goocanvas-0.15/0000777000076400007640000000000011222215706010432 500000000000000goocanvas-0.15/TODO0000644000076400007640000000627111172574677011067 00000000000000 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. Features definitely needed: o API for modifying GooCanvasPath data. o Editable text item - a port of GtkTextView. 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. But don't use caches when printing. 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. goocanvas-0.15/mkinstalldirs0000755000076400007640000000370411222156053013157 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here goocanvas-0.15/ChangeLog0000644000076400007640000021634411222155376012140 000000000000002009-06-29 Damon Chaplin * Released GooCanvas 0.15 2009-06-29 Damon Chaplin * src/goocanvasimage.c: added "scale-to-fit" property, which scales the image to fit the "width" and "height" settings. * demo/units-demo.c: * demo/mv-demo.c (plant_flower): * demo/demo.c (plant_flower): test "scale-to-fit" property. 2009-05-07 Damon Chaplin * src/goocanvasatk.c: fixed GooCanvasWidgetAccessible's G_DEFINE_TYPE call, using GOO_TYPE_CANVAS_ITEM_ACCESSIBLE as parent class. This avoids a hang when using GooCanvasWidget with accessibility support turned on. #581596. 2009-03-16 Damon Chaplin * src/goocanvasitem.c: changed docs referring to "root_x" and "root_y" fields of event structs to "x_root" and "y_root". 2009-03-15 Damon Chaplin * Released GooCanvas 0.14 2009-03-15 Damon Chaplin * src/goocanvas.c (goo_canvas_query_tooltip): new function to propagate the "query-tooltip" signal up through the canvas items. * src/goocanvasitem.[hc]: added "query-tooltip" signal and "tooltip" property. * src/goocanvasitemmodel.c: added "tooltip" property. * src/goocanvasitemsimple.c: added "tooltip" property and query_tooltip signal handler. * configure.in: added dependancy on GTK+ 2.12 for tooltips. * demo/mv-demo.c: * demo/demo.c: added tests for tooltips. 2009-03-15 Damon Chaplin * src/goocanvasgrid.c: improved section docs. * src/goocanvas.c: improved a few function docs. 2009-03-15 Damon Chaplin * docs/coordinates.xml: * docs/architecture.xml: * docs/creating-items.xml: * src/goocanvasitemsimple.c: use the terms "canvas coordinate space" or "canvas space" rather than "device space" which is a bit misleading. * src/goocanvasitem.c: clarify the docs for the mouse position fields of the event structs of the signals. #573458 2009-03-15 Gian Mario Tagliaretti (Committed by Damon with a few changes.) * src/goocanvasitem.h (struct _GooCanvasItemIface): added scroll_event() signals on items. * src/goocanvasitem.c: implemented "scroll_event" signals on items. * src/goocanvas.c: implemented "scroll_event" signals on items. * demo/demo.c: added test for above. #566110 2009-02-17 Damon Chaplin * src/goocanvas.c (goo_canvas_convert_from_item_space): changed the order of the arguments to cairo_matrix_multiply(). This was broken for everything except translations. #572180 2009-01-12 Armin Burgmeier * src/goocanvasellipse.c: * src/goocanvaspolyline.c: * src/goocanvasgroup.c: * src/goocanvaspath.c: * src/goocanvaswidget.c: * src/goocanvastext.c: * src/goocanvastable.c: Added "x", "y", "width" and "height" properties where they do not exist already. GooCanvasGroup clips its children if they are out of the specified area, and GooCanvasText clips the text. It is possible to turn off the clipping by using -1 for width or height, respectively, which is the default. * demo/generic-position-demo.c: * demo/mv-generic-position-demo.c: * demo/Makefile.am: Added a demo showing how this can be used to generically resize items using drag and drop. (Patch from bug #555097 committed with quite a few changes by Damon) 2008-12-29 Damon Chaplin * src/goocanvasgrid.c (calculate_start_position) (paint_vertical_lines, paint_horizontal_lines): handle step <= 0.0. It should now draw a single line at the start position. (based on patch from Murray Cumming) #563487. 2008-12-29 Jonathon Jongsma * demo/Makefile.am: Fix building demos when builddir != srcdir. goocanvasenumtypes.h is generated in the build dir and not the src dir so we must also add the build dir to the INCLUDES. #561401. 2008-11-30 Damon Chaplin * Released GooCanvas 0.13 2008-11-19 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_stop_animation): * src/goocanvasitem.c (goo_canvas_item_animate_cb) (goo_canvas_item_stop_animation): remove the current animation data before emitting "animation-finished", so signal handlers can start a new animation. 2008-11-17 Damon Chaplin * src/goocanvasgrid.c: added "show-horz-grid-lines" and "show-vert-grid-lines" properties, to turn off horz/vert grid lines. 2008-11-17 Damon Chaplin * src/goocanvas.c (redraw_static_items_at_position): redraw each group of static items separately, to stop GTK+ merging the redraw rect into one massive one. * demo/mv-demo.c (create_static_model): * demo/demo.c (setup_static_items): use a group for all the static items. 2008-11-17 Damon Chaplin * src/goocanvas.c: added "redraw-when-scrolled" boolean property, which makes the canvas redraw the entire window when scrolled. This is useful for static items to reduce flicker, but is slower. (goo_canvas_adjustment_value_changed): map/unmap the temporary window to implement "redraw-when-scrolled". 2008-11-04 Damon Chaplin * src/goocanvasutils.h: added typedefs for wrappers of cairo types (but ifdef'd out so not usable), so we can add docs for them. And added the docs, pointing to the cairo docs. * src/goocanvasutils.c (goo_canvas_line_dash_get_type): changed the registered type name from GooCairoLineDash to GooCanvasLineDash so the docs work. The struct was already called GooCanvasLineDash. 2008-11-03 Damon Chaplin * src/goocanvas.c (emit_pointer_event): handle NULL target_item. * src/goocanvaswidget.c: note that widgets can't be static. * README: * docs/overview.xml: mention static items and the grid item. 2008-11-03 Damon Chaplin * src/goocanvas.c (goo_canvas_scroll_to_item): just return if the item is static, as we can't scroll to a static item. (emit_pointer_event): convert the pointer position to static item space for static items. * src/goocanvasatk.c (goo_canvas_item_accessible_get_item_extents): handle static items - don't need to convert to pixels within the window as they are already like that. 2008-11-03 Damon Chaplin * src/goocanvasgrid.[hc]: new grid item. * demo/mv-demo.c (setup_grids): * demo/demo.c (setup_grids): added a grid. * src/Makefile.am: added grid. * src/goocanvas.[hc] (goo_canvas_convert_bounds_to_item_space): new function to convert a bounding box in device space to a bounding box in item space. Useful in paint() methods to optimize painting. * src/goocanvasutils.c (goo_canvas_convert_colors_to_rgba) (goo_canvas_get_rgba_value_from_pattern) (goo_canvas_set_style_property_from_pattern) (goo_canvas_create_pattern_from_color_value) (goo_canvas_create_pattern_from_rgba_value) (goo_canvas_create_pattern_from_pixbuf_value): new private utility functions taken out of goocanvasitemsimple.c code. * src/goocanvasitemsimple.c: use above utility functions. 2008-10-31 Damon Chaplin * src/goocanvasitemmodel.h (struct _GooCanvasItemModelIface): * src/goocanvasitem.h (struct _GooCanvasItemIface): added animation_finished() signals. * src/goocanvasitemmodel.c: * src/goocanvasitem.c: implemented "animation-finished" signals. * demo/mv-demo-animation.c: * demo/demo-animation.c: added test for above. 2008-10-31 Damon Chaplin * demo/mv-demo-arrowhead.c (on_button_press): * demo/demo-arrowhead.c (on_button_press): * demo/mv-demo.c (on_button_press): * demo/demo.c (on_button_press): use GDK_POINTER_MOTION_HINT_MASK for the pointer grab, so we don't get too many events. 2008-10-31 Damon Chaplin * src/goocanvas.h: (goo_canvas_get_static_root_item): new function to get static root item. (goo_canvas_set_static_root_item): new function to set static root item. (goo_canvas_get_static_root_item_model): new function to get static root item model. (goo_canvas_set_static_root_item_model): new function to set static root item model. (goo_canvas_request_item_redraw): new function to request a redraw of an item either in device space or in the static item space. * src/goocanvasitem.h (struct _GooCanvasItemIface): added get_is_static() and set_is_static() interface methods. * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleData): removed one bit from cache_setting and used it for is_static. Hopefully that won't break binary compatibility. * src/goocanvas.c (struct _GooCanvasPrivate): added new private struct with static root item & model and current window position. (goo_canvas_init): init private struct and create static root item. (goo_canvas_dispose): free static root item & model. (goo_canvas_update_internal): update static items. (goo_canvas_get_item_at): check static items as well. (goo_canvas_get_items_at): check static items as well. (goo_canvas_realize): store original window position in private struct. (request_static_redraw): new function to request a redraw in static coordinate space. (request_all_static_redraws): new function to request a redraw of all static items. (paint_static_items): new function to paint the static items. (goo_canvas_expose_event): call paint_static_items(). (goo_canvas_convert_to_static_item_space): new function to convert coords to static space. (goo_canvas_adjustment_value_changed): redraw the static items before the window is scrolled, but in their new position. We do this so we don't see them being dragged along when scrolling. Redraw them again after the window has been moved. Hopefully we can optimize this a bit in future to avoid the flickering. * src/goocanvasitem.c (goo_canvas_item_get_is_static) (goo_canvas_item_set_is_static): new functions to call the interface methods if they are implemented. The default behavior allows old code to work without crashing (but old items can't be static). * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_is_static) (goo_canvas_item_simple_set_is_static): implemented new interface functions - just get/set the bit-flag. * src/goocanvasgroup.c (goo_canvas_group_add_child): call set_is_static() on new child. * src/goocanvasgroup.c (goo_canvas_group_set_is_static): implement new interface method, calling set_is_static() for all children if changed. * src/goocanvasitemsimple.c: * src/goocanvasgroup.c: * src/goocanvastable.c: use new goo_canvas_request_item_redraw() function so static items are redrawn correctly. * demo/mv-demo.c (create_static_model): * demo/demo.c (setup_static_items): added some static items to test. Note that dragging around when scale != 1.0 is weird as the coord spaces are different, but is expected. 2008-10-15 Damon Chaplin * src/goocanvaspolyline.c (goo_canvas_polyline_is_item_at): only check the fill if the polyline path is closed. Otherwise if we call cairo_in_fill() it will automatically close the path which is not what we want. * src/goocanvaspath.c (goo_canvas_path_is_item_at): only check the fill if a fill color/pattern has been set, for similar reasons. 2008-10-12 Damon Chaplin * src/goocanvastext.c (goo_canvas_text_create_layout): fixed calculation of text bounds. 2008-10-12 Armin Burgmeier * src/goocanvastable.c (goo_canvas_table_get_requested_area) (goo_canvas_table_allocate_area): Request redraw of the table's bounds, as GooCanvasItemSimple does, to fix incorrect drawing when changing the table's width or height. (goo_canvas_table_paint): Keep clipping to the allocated size when drawing the children, so they are not rendered outside the allocated area when the table is shrunk. #555093 2008-10-11 Damon Chaplin * docs/coordinates.xml: added section on Cairo limits. * README: updated home page URL. 2008-10-05 Damon Chaplin * src/goocanvastext.c (goo_canvas_text_create_layout): don't turn off font hinting. I don't think it has any effect on text layout so we can safely leave it on. Small text should be easier to read, as well as non-antialiased text. Though it does seem to sometimes produce slightly odd results for rotated text (see the 8-bit text in the demo). 2008-09-21 Damon Chaplin * Released GooCanvas 0.12 2008-09-21 Damon Chaplin * configure.in: renamed LT_CURRENT, LT_AGE & LT_REVISION to CURRENT, AGE & REVISION to avoid problems with libtool 2.2. #552725. 2008-09-14 Damon Chaplin * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_requested_area) (goo_canvas_item_simple_allocate_area): request redraws of the old and new item bounds. 2008-09-09 Damon Chaplin * Released GooCanvas 0.11 2008-09-02 Damon Chaplin * src/goocanvastable.c (goo_canvas_table_paint): use the item's fill and stroke colors for the table background and grid. * demo/table-demo.c: test the above. 2008-08-17 Damon Chaplin * src/goocanvasgroup.c (goo_canvas_group_add_child) (goo_canvas_group_remove_child): emit the "children_changed" ATK signal, if ATK is enabled. This needs testing. 2008-08-17 Damon Chaplin * src/Makefile.am (INCLUDES): * demo/Makefile.am (INCLUDES): get rid of the XXX_DISABLE_DEPRECATED flags so we don't break compilation when GTK+ deprecates stuff. #548086 2008-06-24 Damon Chaplin * src/goocanvasgroup.c (goo_canvas_group_get_child) (goo_canvas_group_model_get_child): return NULL if child_num is out of range. #535150 * src/goocanvasitemmodel.c (goo_canvas_item_model_get_child): * src/goocanvasitem.c (goo_canvas_item_get_child): updated docs. 2008-06-24 Damon Chaplin * src/goocanvasutils.h: removed comma at end of GooCanvasItemVisibility enum. Patch from Hubert Figuiere. #539844 2008-06-22 Kjartan Maraas * demo/demo-animation.c: (create_animation_page): * demo/demo-arrowhead.c: (create_drag_box): * demo/demo-clipping.c: (setup_canvas): * demo/demo-events.c: (setup_item_signals): * demo/demo-features.c: (create_canvas_features): * demo/demo-fifteen.c: (setup_item_signals), (create_canvas_fifteen): * demo/demo-focus.c: (create_focus_box): * demo/demo-grabs.c: (create_fixed), (setup_item_signals): * demo/demo-large-items.c: (create_large_items_page): * demo/demo-paths.c: (create_paths_page): * demo/demo-table.c: (create_demo_item), (create_demo_table), (create_width_for_height_table): * demo/demo.c: (setup_item_signals), (create_canvas_primitives), (setup_canvas), (create_window): * demo/mv-demo-animation.c: (create_animation_page): * demo/mv-demo-arrowhead.c: (on_item_created), (create_canvas_arrowhead): * demo/mv-demo-clipping.c: (setup_canvas): * demo/mv-demo-events.c: (on_item_created), (create_events_page): * demo/mv-demo-features.c: (on_item_created), (create_canvas_features): * demo/mv-demo-fifteen.c: (on_item_created), (create_canvas_fifteen): * demo/mv-demo-focus.c: (on_item_created), (create_focus_page): * demo/mv-demo-grabs.c: (create_fixed), (on_item_created), (create_canvas): * demo/mv-demo-paths.c: (create_paths_page): * demo/mv-demo-table.c: (create_demo_item), (create_demo_table), (create_width_for_height_table): * demo/mv-demo.c: (on_item_created), (create_canvas_primitives), (create_window): * demo/mv-scalability-demo.c: (setup_canvas), (create_canvas), (main): * demo/mv-simple-demo.c: (main): * demo/mv-table-demo.c: (main): * demo/scalability-demo.c: (setup_canvas), (create_canvas), (main): * demo/simple-demo.c: (main): * demo/table-demo.c: (main): * demo/units-demo.c: (setup_canvas), (create_canvas), (main): * demo/widgets-demo.c: (create_focus_box), (main): Use G_CALLBACK instead of the deprecated GtkSignal stuff. 2008-05-18 Damon Chaplin * src/goocanvasatk.c (goo_canvas_widget_accessible_new): made static. 2008-05-18 Damon Chaplin * src/goocanvas.c (goo_canvas_expose_event): when clipping, clip to the intersection of the canvas bounds and the expose bounds, to avoid problems with cairo's coordinate limits. (This was apparent in the scalability demo - it wasn't redrawing properly at the bottom of the canvas.) 2008-05-09 Damon Chaplin * src/goocanvasitemmodel.h: * src/goocanvasitem.h: removed _CLASS macros since they are interfaces. (From Masatake YAMATO). 2008-05-09 Damon Chaplin * demo/widgets-demo.c (remove_widget_clicked): use g_list_delete_link to update the GList, to avoid a crash. 2008-04-27 Damon Chaplin * Released GooCanvas 0.10 2008-04-06 Armin Burgmeier * src/goocanvastable.c: Implemented grid lines between table items by adding "horz-grid-line-width", "vert-grid-line-width", "x-border-spacing" and "y-border-spacing" properties. (Patch applied by Damon with a few changes.) * demo/mv-table-demo.c: * demo/table-demo.c: added tests for the gridlines. 2008-04-04 Damon Chaplin * docs/coordinates.xml: * docs/architecture.xml: new sections. * docs/creating-items.xml: rewritten. * src/goocanvasitemmodel.c (goo_canvas_item_model_set_parent): * src/goocanvasitem.c (goo_canvas_item_set_parent): note in the docs that the "parent" property can be used to set the parent, but that these functions are only for implementing new items (a bit confusing). * src/goocanvasitem.c (goo_canvas_item_is_visible): fixed a bug where if the item doesn't support the method it would just return TRUE, but it should also check the ancestors are visible. * src/goocanvasitemsimple.c (goo_canvas_item_simple_set_property) (goo_canvas_item_model_simple_set_property): use the _remove() functions instead of the find_child()/remove_child() code. 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. 2008-03-27 Damon Chaplin * docs/wysiwyg.xml: new section to document WYSIWYG stuff. 2008-03-23 Damon Chaplin * src/goocanvasitemsimple.c: made "stroke-color-rgba" and "fill-color-rgba" properties read/write. * configure.in (pkg_modules): depend on cairo >= 1.4.0 for cairo_pattern_get_rgba(). * demo/demo.c (test_color_properties): added some test code. 2008-02-25 Damon Chaplin * src/goocanvasitemsimple.c: added default implementations for the simple_update/paint/get_item_at() virtual functions that call simple_create_path(). These make it easier for language bindings. Based on patch from Jonathon Jongsma. 2008-02-25 Damon Chaplin * src/goocanvastext.c (goo_canvas_text_get_natural_extents): added function to get the natural extents of the text. 2007-11-23 Damon Chaplin * src/goocanvastable.c (goo_canvas_table_size_allocate_pass1): when shrinking, make sure the extra value is always decreasing, so we don't get into an infinite loop. 2007-11-18 Damon Chaplin * src/goocanvas.c: added support for "clear-background" property, patch from Grahame Bowland. 2007-11-18 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_get_child_property) (goo_canvas_item_set_child_property): * src/goocanvasitemmodel.c (goo_canvas_item_model_get_child_property) (goo_canvas_item_model_set_child_property): new functions to get/set individual child properties (to help language bindings). * demo/demo-table.c (create_demo_item): * demo/mv-demo-table.c (create_demo_item): test the above. * src/goocanvasitem.c: * src/goocanvasitemmodel.c: fixed some docs that wrongly say functions are for implementing new items only. 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. 2007-08-13 Damon Chaplin * Released GooCanvas 0.9 2007-08-13 Damon Chaplin * src/goocanvastext.c: added "wrap" property (patch from James Dietrich). * src/goocanvastable.c: use static goo_canvas_table_parent_iface and goo_canvas_table_model_parent_iface variables which are set in the class_init functions. That makes it much easier to call the GooCanvasGroup methods when needed. * src/goocanvasitemsimple.c (goo_canvas_item_simple_set_parent): call goo_canvas_item_set_canvas() so items can do whatever is needed (e.g. groups can pass the canvas on to children). * src/goocanvasitem.c (goo_canvas_item_request_update): don't use return here as it is a void function. * src/goocanvastable.c (goo_canvas_table_remove_child): * src/goocanvasgroup.c (goo_canvas_group_remove_child): check the child_num arg is valid. 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. 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. 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. 2007-05-15 Damon Chaplin * src/goocanvas.c (goo_canvas_style_set, goo_canvas_realize): reset the window backgrounds to nothing, to avoid flicker when scrolling. (This happened due to the delay between X clearing the window and GooCanvas repainting it.) (goo_canvas_expose_event): clear the background ourselves here. 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. 2007-05-13 Damon Chaplin * src/goocanvaspath.c: use a common GooCanvasPathData like the other standard items. This fixes a crash where the model's path_commands GArray was updated but the view still pointed to the old GArray which had been freed. * demo/mv-demo-paths.c: * demo/demo-paths.c: added a button to test changing the path data dynamically. 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. 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. 2007-04-27 Damon Chaplin * src/goocanvasitem.h: * src/goocanvasutils.c (goo_canvas_bounds_get_type): added type stuff for language bindings (patch from Murray Cumming). 2007-04-25 Damon Chaplin * src/goocanvasitemmodel.c (_goo_canvas_item_model_emit_child_added) (_goo_canvas_item_model_emit_changed): new simple functions to emit signals faster (avoids signal name lookups). * src/goocanvasitemsimple.c (goo_canvas_item_model_simple_set_property) (goo_canvas_item_model_simple_set_transform) (goo_canvas_item_model_simple_set_style): * src/goocanvasgroup.c (goo_canvas_group_model_add_child): use the above functions for a little speedup. 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). 2007-04-25 Damon Chaplin * src/goocanvasrect.c (goo_canvas_rect_update): added optimized function to calculate the bounds without using cairo. 2007-04-16 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_animate_cb): check keep_source before updating the item so we don't use the freed animation data. 2007-04-16 Damon Chaplin * src/goocanvasitemsimple.c (goo_canvas_item_simple_get_path_bounds): handle empty bounds for an item's fill or stroke. cairo 1.4.x returns 0.0 for x1/y1/x2/y2 in that case, though older versions of cairo returned odd values. So I've added a workaround for that as well. 2007-04-05 Damon Chaplin * src/goocanvas.c (goo_canvas_key_press, goo_canvas_key_release): only emit "key-press" and "key-release" signals on items if the canvas has the focus. (We were incorrectly emitting signals if an embedded widget had the focus, as the events were propagating up to the canvas.) 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. 2007-03-30 Damon Chaplin * src/goocanvasutils.c (goo_canvas_boolean_handled_accumulator): new function, copied from _gtk_boolean_handled_accumulator(). * src/goocanvasitem.c (goo_canvas_item_base_init): use the above accumulator for the event signals, so returning TRUE from a handler stops the signal. * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleData): * src/goocanvasitem.h (struct _GooCanvasItemIface): added a few bits that will be needed to support tooltips with GTK+ 2.12. I have a patch to support tooltips but I don't want to depend on GTK+ 2.12 yet. 2007-03-28 Damon Chaplin * src/goocanvasstyle.c (goo_canvas_style_set_fill_options): check if the fill pattern is set to NULL, which is used to reset any fill pattern or color. If it is, don't set the cairo source and return FALSE. * demo/demo.c (move_ellipse_clicked): set the fill pattern to NULL occasionally to test the above. 2007-03-27 Damon Chaplin * src/goocanvas.c: added "background-color" and "background-color-rgb" properties to set the background color of the canvas, based on a patch from Gian Mario Tagliaretti. * demo/demo.c (create_canvas_primitives): * demo/mv-demo.c (create_canvas_primitives): use above properties. 2007-03-16 Murray Cumming * src/goocanvasitemsimple.h: Change the struct field name from private to priv, to avoid problems when using this from C++. 2007-03-08 Damon Chaplin * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleData): use guints for the bitflags rather than the enum types, since that is what GTK+ does. Maybe enums cause a problem because of being signed ints. Also added cache_setting which we may use in future. (struct _GooCanvasItemSimple): added private pointer to allow a bit of expansion in future (e.g. maybe a cache). 2007-03-08 Damon Chaplin * src/goocanvaswidget.c (goo_canvas_widget_set_canvas): unparent the widget if the canvas is set to NULL (i.e. when the item is removed from the canvas). 2007-03-08 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_remove): * src/goocanvasitem.c (goo_canvas_item_remove): new convenience functions to easily remove items & models from the canvas. * demo/mv-demo-features.c (on_button_press): * demo/demo-features.c (on_button_press): * demo/demo.c (on_button_press): * demo/mv-demo.c (on_button_press): * demo/widgets-demo.c (remove_widget_clicked): use new remove() functions to test them. * docs/goocanvas-sections.txt: rearranged GooCanvasItem/Model to put commonly-used functions first, and added remove() functions. 2007-03-08 Damon Chaplin * src/goocanvastext.[hc]: added ellipsize property, and used bit flags to cut down on memory use a bit. * demo/demo.c (setup_texts): added test for ellipsized text. * demo/mv-demo.c: * demo/mv-demo-table.c: * demo/mv-demo-clipping.c: updated model-view demos, adding new stuff from simple demo. 2007-03-07 Damon Chaplin * src/*.c: added notes to all functions that are only meant to be used when implementing new canvas items. * docs/goocanvas-sections.txt: placed all the functions only used when implementing new canvas items together at the bottom. 2007-03-06 Damon Chaplin * src/goocanvasitem.c (goo_canvas_item_get_items_at): if the item doesn't support this method just return found_items. * src/goocanvas.c (goo_canvas_create_cairo_context): made this public. 2007-03-06 Damon Chaplin * */*: added 'const' to a number of arguments taking a cairo_matrix_t* or a GooCanvasBounds*. 2007-03-06 Damon Chaplin * src/goocanvasitem.[hc]: added get_requested_height() method. * src/goocanvastable.c: Reworked a lot of code to support width-for-height layout. This gets the requested area of all children, calculates the column widths, then checks if any children want to change their requested height given their allocated width. Text items change their requested height based on their width, so this results in a better layout. * src/goocanvastext.h (struct _GooCanvasText): added layout_width to store the width used for the PangoLayout. This initially comes from the text's width property, but can be modified when the text item is layed out in a container like GooCanvasTable. * src/goocanvastext.c (goo_canvas_text_get_requested_height): calculates the requested height for the given width, or just returns -1 if the text item is rotated or has a clip path, in which case the original height is used. (goo_canvas_text_init, goo_canvas_text_create_layout) (goo_canvas_text_update): use layout_width. * demo/demo-table.c (create_width_for_height_table): added tests for width-for-height layout. * demo/demo-clipping.c (setup_canvas): added text item to check clipping works OK with them. 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(). 2007-02-27 Damon Chaplin * src/goocanvasitemmodel.[hc]: * src/goocanvasitem.[hc]: used name "transform" for all arguments to get/set_transform functions. 2007-02-27 Damon Chaplin * src/goocanvasitemmodel.[hc]: * src/goocanvasitem.[hc]: changed get_transform() method to take a cairo_matrix_t* to fill in, and return a boolean if a transform is set. This is better for bindings. * src/goocanvasitemsimple.c: updated get_transform() methods. 2007-02-27 Damon Chaplin * src/goocanvasitem.[hc]: changed get_item_at method to get_items_at which returns a list of found items rather than a single found item. * src/goocanvasitemsimple.[hc]: changed get_item_at() method to is_item_at() which just returns a boolean, and updated to new API. * src/goocanvas.c (goo_canvas_get_item_at): updated to use new API. (goo_canvas_get_items_at): new function to return list of found items. * src/goocanvastable.c (goo_canvas_table_get_items_at): * src/goocanvasgroup.c (goo_canvas_group_get_items_at): * src/goocanvasimage.c (goo_canvas_image_is_item_at): * src/goocanvaspolyline.c (goo_canvas_polyline_is_item_at): * src/goocanvastext.c (goo_canvas_text_is_item_at): * src/goocanvaswidget.c (goo_canvas_widget_is_item_at): * docs/creating-items.xml: * demo/demo-item.c (goo_demo_item_is_item_at): updated for new API. 2007-02-25 Damon Chaplin * src/goocanvasitemsimple.c: added "hint-metrics" property so people can use hinted metrics for prettier text if they aren't scaling the canvas at all. * src/goocanvasstyle.c: added goo_canvas_style_hint_metrics_id quark. * src/goocanvasutils.c (goo_cairo_hint_metrics_get_type): added enum stuff for cairo_hint_metrics_t. * src/goocanvastext.c (goo_canvas_text_create_layout): use hint metrics property. 2007-02-25 Damon Chaplin * src/goocanvas.c (goo_canvas_create_cairo): use CAIRO_ANTIALIAS_GRAY as the default antialiasing mode, as that is what is recommended when using unhinted text. (subpixel antialiasing looks really bad.) 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.) 2007-02-24 Damon Chaplin * demo/widgets-demo.c (on_delete_event): * demo/units-demo.c (on_delete_event): * demo/mv-scalability-demo.c (on_delete_event): * demo/scalability-demo.c (on_delete_event): * demo/mv-demo.c (on_delete_event): * demo/demo.c (on_delete_event): use gtk_main_quit() rather than exit() here, so GTK+ destroys the window and the finalization code gets tested. * src/goocanvas.c (goo_canvas_remove): implement this so embedded widgets are removed properly. 2007-02-20 Damon Chaplin * demo/demo-table.c: * demo/mv-demo-table.c: moved table-demo.c into main demo app, and made a model-view version. 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. 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. 2007-02-19 Damon Chaplin * demo/scalability-demo.c (setup_canvas): set the font on the root group so we don't need to set it on all the text items. Also output the time to the first expose. * demo/mv-scalability-demo.c: new demo based on scalability-demo.c. 2007-02-19 Damon Chaplin * demo/demo.c: * demo/mv-demo.c: * demo/demo-animation.c: * demo/mv-demo-animation.c: made the file-global variables static so they don't clash, and updated the demos a bit. 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. 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. 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. 2007-02-13 Damon Chaplin * src/goocanvas.c (goo_canvas_size_allocate): only allocate the child widgets if we are realized, otherwise it crashes. 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. 2007-02-12 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_set_simple_transform): * src/goocanvasitem.c (goo_canvas_item_set_simple_transform): convert rotation to radians. 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. 2007-02-08 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_set_simple_transform): * src/goocanvasitem.c (goo_canvas_item_set_simple_transform): new convenience functions to set the position, scale and rotation easily. * demo/demo.c (move_ellipse_clicked): added tests for goo_canvas_item_set_simple_transform(). * */*: more documentation updates. I've started adding a few introductory sections, tidied up a few bits, and tried to update all the docs that referred to the old model/view terminology. 2007-02-08 Damon Chaplin * */*: more documentation updates. It is 100% complete now, though it still needs docs on the optional model/view split and creating new items. 2007-02-07 Damon Chaplin * src/goocanvasutils.c (goo_canvas_query_child_properties): check if type is classed before calling g_type_interface_peek(). 2007-02-06 Damon Chaplin * src/goocanvas.[hc]: updated docs. 2007-02-04 Damon Chaplin * src/goocanvasstyle.[hc]: extern the GQuarks in the header and define them in the .c file. 2007-02-04 Damon Chaplin * src/goocanvasitemmodel.c (goo_canvas_item_model_base_init): fix type of "parent" property, from Gian Mario Tagliaretti. 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) 2007-02-02 Damon Chaplin * */*: updated docs for all canvas items & models. 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. 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). * src/goocanvasutils.c (goo_canvas_query_child_properties): new function to allow documentation of child properties with gtk-doc. * src/goocanvasitemmodel.c: * src/goocanvasitem.c: added support for child properties of item models. * src/goocanvastable.c: beginnings of a new table item to layout child items. Doesn't do much yet. * demo/table-demo.c: beginnings of demo for GooCanvasTable. * src/goocanvasitem.c (goo_canvas_item_animate): clarified docs. * src/goocanvasgroup.c: use goo_canvas_item_add/move/remove_child() rather than goo_canvas_group_add/move_remove_child() so subclasses can reuse group's code. Also fix some docs & variable names. 2006-11-30 Damon Chaplin * src/goocanvasitemsimple.h (struct _GooCanvasItemSimpleClass): added new update/paint/get_item_at methods that subclasses can override. If items use these methods GooCanvasItemSimple will perform all the standard stuff before passing control to them. This makes it much easier to create simple canvas items. * demo/demo-item.c: * src/goocanvaspolyline.c: * src/goocanvastext.c: * src/goocanvasimage.c: use the above methods, so we can get rid of all the boilerplate code. 2006-11-29 Damon Chaplin * demo/demo-item.[hc]: new demo item to show how to create new items. There's more boilerplate code than I'd like, but I don't know the best way to deal with it. 2006-11-29 Damon Chaplin * */*: major rewrite to make the model optional, so people can choose to have either a simple canvas or a model/view canvas. (Many people found the model/view split awkward.) The standard items can be used in either scenario. Also added support for cascading styles, with arbitrary properties, and embedded widget items. I'm in the middle of adding support for layout items as well (e.g. something like a GtkTable for items). 2006-10-12 Damon Chaplin * src/goocanvastextview.c (goo_canvas_text_view_create_layout) (goo_canvas_text_view_get_item_view_at) (goo_canvas_text_view_paint): patch from Martin Soto to fix a text positioning bug. The position was wrong when the text width was set and the alignment wasn't PANGO_ALIGN_LEFT. (Pango uses the set width to calculate the text origin, but we were using the logical width.) 2006-10-12 Damon Chaplin * src/goocanvasutils.h: * src/goocanvasprivate.h: make get_type() declarations public as they are useful for bindings. 2006-10-12 Damon Chaplin Applied patch from Paul Davis to use glib_mkenums, slightly modified: * configure.in: use pkg-config to get the glib_genmarshal and glib_mkenums binaries. * src/Makefile.am: use glib_mkenums to generate goocanvasenums.[hc]. * src/goocanvasutils.c: removed goo_canvas_pointer_events_get_type() and goo_canvas_item_visibility_get_type() as they're generated now. * src/goocanvasutils.h: removed get_type() declarations that are now in goocanvasenums.h, and modifed GooCanvasPointerEvents so glib_mkenums could parse it. * src/goocanvas.h: * src/goocanvasitem.c: include goocanvasenums.h. 2006-10-12 Damon Chaplin * src/goocanvaspolyline.h (struct _GooCanvasPoints): use a separate typedef declaration for the struct, to help C++ bindings. From Paul Davis. * src/goocanvaspath.c (goo_canvas_path_new): use 'const' for the path_data argument. From Paul Davis. * src/goocanvaspathview.c (goo_canvas_path_view_create_path): init last_control_point_x/y to avoid compiler warning. 2006-09-11 Damon Chaplin * src/goocanvaspolylineview.c: be more careful about using points and arrow data. * demo/demo.c (setup_lines): add checks for polylines with 0 and 1 points. * configure.in: require GTK+ 2.10.0, for GtkUnit (Gian Mario Tagliaretti). 2006-08-31 Damon Chaplin * src/goocanvasview.c: added "units", "resolution-x" & "resolution-y" properties so we can support points, inches and millimeters being used for item units as well as just pixels. Thus you can create a complete WYSIWYG printable document. But note that you must use absolute units for font sizes, i.e. use "px" after the size in any font description strings, e.g. "Sans 10px". That stops us scaling fonts twice. (goo_canvas_view_set_default_line_width): set a reasonable default line width according to the current units. * demo/units-demo.c: new demo showing different units in use. 2006-08-30 Damon Chaplin * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_update) * src/goocanvaspolylineview.c (goo_canvas_polyline_view_update): added a workaround for cairo limits. Cairo uses fixed point integer maths and is currently limited to 16-bits for the integer component. So we remove any current translation before calculating the bounds of the item, then add it back to the results. This means the 16-bit limit only applies to items' user space rather than the entire canvas. * src/goocanvasitemviewsimple.c (goo_canvas_item_view_simple_get_item_view_at): * src/goocanvaspolylineview.c (goo_canvas_polyline_view_get_item_view_at): as above, remove any current translation before checking if the point is in the item. * demo/scalability-demo.c: updated to create ~100,000 items, either rectangles or images. For images it now reuses a single cairo pattern rather than passing the pixbuf to the GooCanvasImage (which created a new pattern for each one and ran out of memory). It takes about 10 seconds to setup the canvas which is slower than I'd like, but once created it seems to work fast enough. 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.) 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.) goocanvas-0.15/COPYING0000644000076400007640000006131411172574677011431 00000000000000 GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the library GPL. It is numbered 2 because it goes with version 2 of the ordinary GPL.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights. Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library. Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license. The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such. Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better. However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library. Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one. GNU LIBRARY GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! goocanvas-0.15/configure0000755000076400007640000271404711222155661012277 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for goocanvas 0.15. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='goocanvas' PACKAGE_TARNAME='goocanvas' PACKAGE_VERSION='0.15' PACKAGE_STRING='goocanvas 0.15' PACKAGE_BUGREPORT='' ac_unique_file="src/goocanvas.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar LT_VERSION_INFO MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP GREP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED LN_S ECHO AR RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PKG_CONFIG PACKAGE_CFLAGS PACKAGE_LIBS GETTEXT_PACKAGE USE_NLS MSGFMT MSGFMT_OPTS GMSGFMT XGETTEXT CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLLIBS PO_IN_DATADIR_TRUE PO_IN_DATADIR_FALSE POFILES POSUB MKINSTALLDIRS GLIB_GENMARSHAL GLIB_MKENUMS PERL REBUILD PLATFORM_WIN32_TRUE PLATFORM_WIN32_FALSE HTML_DIR GTKDOC_CHECK ENABLE_GTK_DOC_TRUE ENABLE_GTK_DOC_FALSE GTK_DOC_USE_LIBTOOL_TRUE GTK_DOC_USE_LIBTOOL_FALSE LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP F77 FFLAGS PKG_CONFIG PACKAGE_CFLAGS PACKAGE_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures goocanvas 0.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/goocanvas] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of goocanvas 0.15:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-rebuilds disable all source autogeneration rules --enable-gtk-doc use gtk-doc to build documentation [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-html-dir=PATH path to installed docs Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags PKG_CONFIG path to pkg-config utility PACKAGE_CFLAGS C compiler flags for PACKAGE, overriding pkg-config PACKAGE_LIBS linker flags for PACKAGE, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF goocanvas configure 0.15 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by goocanvas $as_me 0.15, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='goocanvas' VERSION='0.15' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Libtool versioning - only update before a public release. # If the code has changed at all: REVISION++. # If any interfaces have changed at all: CURRENT++, REVISION=0. # If interfaces changed but it is backwards compatible: AGE++, else AGE=0. # i.e. the library supports interfaces CURRENT - AGE up to CURRENT. # if two libraries have identical CURRENT and AGE, then newest REVISION used. CURRENT=7 AGE=4 REVISION=0 LT_VERSION_INFO="$CURRENT:$REVISION:$AGE" { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { echo "$as_me:$LINENO: checking for library containing strerror" >&5 echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; } if test "${ac_cv_search_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_search_strerror=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_strerror+set}" = set; then break fi done if test "${ac_cv_search_strerror+set}" = set; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 echo "${ECHO_T}$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi { echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi { echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 5672 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) libsuff=64 case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } else { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6; } else { echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6; } fi { echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8005: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8009: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8295: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8299: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8399: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8403: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6; } if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= { echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ;; *) { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which library types will actually be built { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ fix_srcfile_path \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else ld_shlibs_CXX=no fi ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13270: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13274: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_CXX=yes fi else lt_prog_compiler_static_works_CXX=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } if test x"$lt_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13374: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13378: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` { echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6; } { echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6; } GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14938: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:14942: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_F77=yes fi else lt_prog_compiler_static_works_F77=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } if test x"$lt_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15042: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15046: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='${wl}-z,text' allow_undefined_flag_F77='${wl}-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17231: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17235: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-Bstatic' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' lt_prog_compiler_wl_GCJ='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; rdos*) lt_prog_compiler_static_GCJ='-non_shared' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17521: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:17525: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works_GCJ=yes fi else lt_prog_compiler_static_works_GCJ=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= fi { echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:17625: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:17629: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . 2>&5 $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6; } if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_GCJ=no fi ;; interix[3-9]*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_GCJ=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ='$convenience' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: case $host_cpu in hppa*64*|ia64*) hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; *) hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs_GCJ=no fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_GCJ='${wl}-z,text' allow_undefined_flag_GCJ='${wl}-z,nodefs' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ pic_flag=$lt_prog_compiler_pic_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi { echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ fix_srcfile_path_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ fix_srcfile_path_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion pkg_modules="gtk+-2.0 >= 2.12.0 glib-2.0 >= 2.10.0 cairo >= 1.4.0" if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { echo "$as_me:$LINENO: checking for PACKAGE" >&5 echo $ECHO_N "checking for PACKAGE... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$PACKAGE_CFLAGS"; then pkg_cv_PACKAGE_CFLAGS="$PACKAGE_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\"") >&5 ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_PACKAGE_CFLAGS=`$PKG_CONFIG --cflags "$pkg_modules" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$PACKAGE_LIBS"; then pkg_cv_PACKAGE_LIBS="$PACKAGE_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$pkg_modules\"") >&5 ($PKG_CONFIG --exists --print-errors "$pkg_modules") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_PACKAGE_LIBS=`$PKG_CONFIG --libs "$pkg_modules" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PACKAGE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$pkg_modules"` else PACKAGE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$pkg_modules"` fi # Put the nasty error message in config.log where it belongs echo "$PACKAGE_PKG_ERRORS" >&5 { { echo "$as_me:$LINENO: error: Package requirements ($pkg_modules) were not met: $PACKAGE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 echo "$as_me: error: Package requirements ($pkg_modules) were not met: $PACKAGE_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PACKAGE_CFLAGS and PACKAGE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else PACKAGE_CFLAGS=$pkg_cv_PACKAGE_CFLAGS PACKAGE_LIBS=$pkg_cv_PACKAGE_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } : fi GETTEXT_PACKAGE=goocanvas cat >>confdefs.h <<_ACEOF #define GETTEXT_PACKAGE "$GETTEXT_PACKAGE" _ACEOF ALL_LINGUAS="en_GB es ja" for ac_header in locale.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test $ac_cv_header_locale_h = yes; then { echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6; } if test "${am_cv_val_LC_MESSAGES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return LC_MESSAGES ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_val_LC_MESSAGES=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_val_LC_MESSAGES=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6; } if test $am_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 _ACEOF fi fi USE_NLS=yes gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= if test "${ac_cv_header_libintl_h+set}" = set; then { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking libintl.h usability" >&5 echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking libintl.h presence" >&5 echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } fi if test $ac_cv_header_libintl_h = yes; then gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # { echo "$as_me:$LINENO: checking for ngettext in libc" >&5 echo $ECHO_N "checking for ngettext in libc... $ECHO_C" >&6; } if test "${gt_cv_func_ngettext_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return !ngettext ("","", 1) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_ngettext_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_ngettext_libc=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_func_ngettext_libc" >&5 echo "${ECHO_T}$gt_cv_func_ngettext_libc" >&6; } if test "$gt_cv_func_ngettext_libc" = "yes" ; then { echo "$as_me:$LINENO: checking for dgettext in libc" >&5 echo $ECHO_N "checking for dgettext in libc... $ECHO_C" >&6; } if test "${gt_cv_func_dgettext_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { return !dgettext ("","") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then gt_cv_func_dgettext_libc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 gt_cv_func_dgettext_libc=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $gt_cv_func_dgettext_libc" >&5 echo "${ECHO_T}$gt_cv_func_dgettext_libc" >&6; } fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then for ac_func in bind_textdomain_codeset do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then { echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bindtextdomain (); int main () { return bindtextdomain (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_bindtextdomain=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_bindtextdomain=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6; } if test $ac_cv_lib_intl_bindtextdomain = yes; then { echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5 echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_ngettext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_ngettext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5 echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6; } if test $ac_cv_lib_intl_ngettext = yes; then { echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5 echo $ECHO_N "checking for dgettext in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_dgettext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dgettext (); int main () { return dgettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_dgettext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_dgettext=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dgettext" >&5 echo "${ECHO_T}$ac_cv_lib_intl_dgettext" >&6; } if test $ac_cv_lib_intl_dgettext = yes; then gt_cv_func_dgettext_libintl=yes fi fi fi if test "$gt_cv_func_dgettext_libintl" != "yes" ; then { echo "$as_me:$LINENO: checking if -liconv is needed to use gettext" >&5 echo $ECHO_N "checking if -liconv is needed to use gettext... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6; } { echo "$as_me:$LINENO: checking for ngettext in -lintl" >&5 echo $ECHO_N "checking for ngettext in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_ngettext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ngettext (); int main () { return ngettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_ngettext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_ngettext=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_ngettext" >&5 echo "${ECHO_T}$ac_cv_lib_intl_ngettext" >&6; } if test $ac_cv_lib_intl_ngettext = yes; then { echo "$as_me:$LINENO: checking for dcgettext in -lintl" >&5 echo $ECHO_N "checking for dcgettext in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_dcgettext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl -liconv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dcgettext (); int main () { return dcgettext (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_dcgettext=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_dcgettext=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dcgettext" >&5 echo "${ECHO_T}$ac_cv_lib_intl_dcgettext" >&6; } if test $ac_cv_lib_intl_dcgettext = yes; then gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv else : fi else : fi fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset for ac_func in bind_textdomain_codeset do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != "no"; then { echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" for ac_func in dcgettext do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done MSGFMT_OPTS= { echo "$as_me:$LINENO: checking if msgfmt accepts -c" >&5 echo $ECHO_N "checking if msgfmt accepts -c... $ECHO_C" >&6; } cat >conftest.foo <<_ACEOF msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" _ACEOF if { (echo "$as_me:$LINENO: \$MSGFMT -c -o /dev/null conftest.foo") >&5 ($MSGFMT -c -o /dev/null conftest.foo) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then MSGFMT_OPTS=-c; { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } echo "$as_me: failed input was:" >&5 sed 's/^/| /' conftest.foo >&5 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then CATOBJEXT=.gmo DATADIRNAME=share else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $host in *-*-solaris*) { echo "$as_me:$LINENO: checking for bind_textdomain_codeset" >&5 echo $ECHO_N "checking for bind_textdomain_codeset... $ECHO_C" >&6; } if test "${ac_cv_func_bind_textdomain_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define bind_textdomain_codeset to an innocuous variant, in case declares bind_textdomain_codeset. For example, HP-UX 11i declares gettimeofday. */ #define bind_textdomain_codeset innocuous_bind_textdomain_codeset /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bind_textdomain_codeset (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef bind_textdomain_codeset /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bind_textdomain_codeset (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_bind_textdomain_codeset || defined __stub___bind_textdomain_codeset choke me #endif int main () { return bind_textdomain_codeset (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_bind_textdomain_codeset=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_bind_textdomain_codeset=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_bind_textdomain_codeset" >&5 echo "${ECHO_T}$ac_cv_func_bind_textdomain_codeset" >&6; } if test $ac_cv_func_bind_textdomain_codeset = yes; then CATOBJEXT=.gmo DATADIRNAME=share else CATOBJEXT=.mo DATADIRNAME=lib fi ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi fi if test "$gt_cv_have_gettext" = "yes" ; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else { echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po ac_config_commands="$ac_config_commands default-1" for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else { echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6; } NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS { echo "$as_me:$LINENO: result: $LINGUAS" >&5 echo "${ECHO_T}$LINGUAS" >&6; } fi if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` # Check whether --enable-rebuilds was given. if test "${enable_rebuilds+set}" = set; then enableval=$enable_rebuilds; else enable_rebuilds=yes fi # define a MAINT-like variable REBUILD which is set if Perl # and awk are found, so autogenerated sources can be rebuilt for ac_prog in perl5 perl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PERL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { echo "$as_me:$LINENO: result: $PERL" >&5 echo "${ECHO_T}$PERL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$PERL" && break done REBUILD=\# if test "x$enable_rebuilds" = "xyes" && \ test -n "$PERL" && \ $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then REBUILD= fi { echo "$as_me:$LINENO: checking for some Win32 platform" >&5 echo $ECHO_N "checking for some Win32 platform... $ECHO_C" >&6; } case "$host" in *-*-mingw*|*-*-cygwin*) platform_win32=yes ;; *) platform_win32=no ;; esac { echo "$as_me:$LINENO: result: $platform_win32" >&5 echo "${ECHO_T}$platform_win32" >&6; } if test "$platform_win32" = "yes"; then PLATFORM_WIN32_TRUE= PLATFORM_WIN32_FALSE='#' else PLATFORM_WIN32_TRUE='#' PLATFORM_WIN32_FALSE= fi # Check whether --with-html-dir was given. if test "${with_html_dir+set}" = set; then withval=$with_html_dir; else with_html_dir='${datadir}/gtk-doc/html' fi HTML_DIR="$with_html_dir" # Check whether --enable-gtk-doc was given. if test "${enable_gtk_doc+set}" = set; then enableval=$enable_gtk_doc; else enable_gtk_doc=no fi if test x$enable_gtk_doc = xyes; then if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk-doc >= 1.8\"") >&5 ($PKG_CONFIG --exists --print-errors "gtk-doc >= 1.8") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : else { { echo "$as_me:$LINENO: error: You need to have gtk-doc >= 1.8 installed to build gtk-doc" >&5 echo "$as_me: error: You need to have gtk-doc >= 1.8 installed to build gtk-doc" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: checking whether to build gtk-doc documentation" >&5 echo $ECHO_N "checking whether to build gtk-doc documentation... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $enable_gtk_doc" >&5 echo "${ECHO_T}$enable_gtk_doc" >&6; } for ac_prog in gtkdoc-check do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GTKDOC_CHECK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GTKDOC_CHECK in [\\/]* | ?:[\\/]*) ac_cv_path_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GTKDOC_CHECK="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi GTKDOC_CHECK=$ac_cv_path_GTKDOC_CHECK if test -n "$GTKDOC_CHECK"; then { echo "$as_me:$LINENO: result: $GTKDOC_CHECK" >&5 echo "${ECHO_T}$GTKDOC_CHECK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$GTKDOC_CHECK" && break done if test x$enable_gtk_doc = xyes; then ENABLE_GTK_DOC_TRUE= ENABLE_GTK_DOC_FALSE='#' else ENABLE_GTK_DOC_TRUE='#' ENABLE_GTK_DOC_FALSE= fi if test -n "$LIBTOOL"; then GTK_DOC_USE_LIBTOOL_TRUE= GTK_DOC_USE_LIBTOOL_FALSE='#' else GTK_DOC_USE_LIBTOOL_TRUE='#' GTK_DOC_USE_LIBTOOL_FALSE= fi ac_config_files="$ac_config_files Makefile src/Makefile demo/Makefile docs/Makefile po/Makefile.in goocanvas.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${PLATFORM_WIN32_TRUE}" && test -z "${PLATFORM_WIN32_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"PLATFORM_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"PLATFORM_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_GTK_DOC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by goocanvas $as_me 0.15, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ goocanvas config.status 0.15 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "demo/Makefile") CONFIG_FILES="$CONFIG_FILES demo/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "goocanvas.pc") CONFIG_FILES="$CONFIG_FILES goocanvas.pc" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim LT_VERSION_INFO!$LT_VERSION_INFO$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim SED!$SED$ac_delim LN_S!$LN_S$ac_delim ECHO!$ECHO$ac_delim AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim CXXCPP!$CXXCPP$ac_delim F77!$F77$ac_delim FFLAGS!$FFLAGS$ac_delim ac_ct_F77!$ac_ct_F77$ac_delim LIBTOOL!$LIBTOOL$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim PACKAGE_CFLAGS!$PACKAGE_CFLAGS$ac_delim PACKAGE_LIBS!$PACKAGE_LIBS$ac_delim GETTEXT_PACKAGE!$GETTEXT_PACKAGE$ac_delim USE_NLS!$USE_NLS$ac_delim MSGFMT!$MSGFMT$ac_delim MSGFMT_OPTS!$MSGFMT_OPTS$ac_delim GMSGFMT!$GMSGFMT$ac_delim XGETTEXT!$XGETTEXT$ac_delim CATALOGS!$CATALOGS$ac_delim CATOBJEXT!$CATOBJEXT$ac_delim DATADIRNAME!$DATADIRNAME$ac_delim GMOFILES!$GMOFILES$ac_delim INSTOBJEXT!$INSTOBJEXT$ac_delim INTLLIBS!$INTLLIBS$ac_delim PO_IN_DATADIR_TRUE!$PO_IN_DATADIR_TRUE$ac_delim PO_IN_DATADIR_FALSE!$PO_IN_DATADIR_FALSE$ac_delim POFILES!$POFILES$ac_delim POSUB!$POSUB$ac_delim MKINSTALLDIRS!$MKINSTALLDIRS$ac_delim GLIB_GENMARSHAL!$GLIB_GENMARSHAL$ac_delim GLIB_MKENUMS!$GLIB_MKENUMS$ac_delim PERL!$PERL$ac_delim REBUILD!$REBUILD$ac_delim PLATFORM_WIN32_TRUE!$PLATFORM_WIN32_TRUE$ac_delim PLATFORM_WIN32_FALSE!$PLATFORM_WIN32_FALSE$ac_delim HTML_DIR!$HTML_DIR$ac_delim GTKDOC_CHECK!$GTKDOC_CHECK$ac_delim ENABLE_GTK_DOC_TRUE!$ENABLE_GTK_DOC_TRUE$ac_delim ENABLE_GTK_DOC_FALSE!$ENABLE_GTK_DOC_FALSE$ac_delim GTK_DOC_USE_LIBTOOL_TRUE!$GTK_DOC_USE_LIBTOOL_TRUE$ac_delim GTK_DOC_USE_LIBTOOL_FALSE!$GTK_DOC_USE_LIBTOOL_FALSE$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 43; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "default-1":C) case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi goocanvas-0.15/NEWS0000644000076400007640000001744611222215644011062 00000000000000 GooCanvas 0.15 (Jun 29 2009) ============== o Fixed a bug that caused a hang when using GooCanvasWidget with accessibility support turned on. o Added "scale-to-fit" property to GooCanvasImage, to scale the image to the "width" and "height" settings, instead of just clipping. GooCanvas 0.14 (Mar 15 2009) ============== o Added support for tooltips (this means we need GTK+ 2.12). (Note that there is a GTK+ bug which will cause problems with tooltips on a large canvas. See bug #573294.) o Added "x", "y", "width" and "height" properties to items that didn't have them. o Fixed bug in goo_canvas_convert_from_item_space(). o Added "scroll-event" signal to GooCanvasItem. GooCanvas 0.13 (Nov 30 2008) ============== o New GooCanvasGrid item for drawing grids on the canvas. o Support for static items that don't move as the canvas is zoomed and scrolled (this is a bit experimental). o Font hinting is not turned off any more - this means smaller text should be more readable. Hopefully it doesn't affect text layout. o Fixed a few GooCanvasTable drawing bugs. o Fixed GooCanvasText drawing, when align is set. o Fixed GooCanvasPolyline is_item_at() code, so the fill isn't tested. o Added "animation-finished" signals to GooCanvasItem & Model. GooCanvas 0.12 (Sep 21 2008) ============== o Fixed redraws of tables after updates. o Fixed problems compiling with libtool 2.2. GooCanvas 0.11 (Sep 9 2008) ============== o Use the tables' fill and stroke colors to paint its grid and background. o Emit "children_changed" ATK signal when child items added/removed. o Fixed bug when clipping the entire canvas. o Got rid of the XXX_DISABLE_DEPRECATED compilation flags. GooCanvas 0.10 (Apr 27 2008) ============== o Added support for a border and grid lines to GooCanvasTable, with "horz-grid-line-width", "vert-grid-line-width", "x-border-spacing" and "y-border-spacing" properties. o Added "clear-background" property to GooCanvas, to allow subclasses to paint their own background if desired. o Fixed crash when rendering a GooCanvasTable that hasn't been updated. o Fixed possible infinite loop in GooCanvasTable layout. o Added goo_canvas_text_get_natural_extents() to get the natural extents of the text. o Made "stroke-color-rgba" and "fill-color-rgba" properties read/write. o Added goo_canvas_item_get_simple_transform() and goo_canvas_item_model_get_simple_transform(), which do the opposite of the set_simple_transform() functions. o Improved documentation on general architecture and creating new items. GooCanvas 0.9 (Aug 13 2007) ============= o Added "scale-x" and "scale-y" properties to GooCanvas, so the horizontal and vertical scale can be set independently. o Added "integer-layout" property to GooCanvas, so all layout can be done to the nearest integer (useful for widgets). o Added "automatic-bounds", "bounds-from-origin" and "bounds-padding" properties, used to calculate the canvas bounds automatically. o Added "wrap" property to GooCanvasText, to specify how to wrap text. o Added demo code to show how to create very large items. o Reduced flicker when scrolling. o Fixed crash when changing a GooCanvasPathModel. o Fixed crash in animation code. o Fixed bug that meant the canvas wasn't redrawn properly when the bounds were changed. o Fixed problem when calculating item sizes before the canvas is realized. o Fixed problems calculating bounds of items with empty fills or strokes. GooCanvas 0.8 (Apr 3 2007) ============= o Added support for "width-for-height" layout - items whose requested height changes according to their allocated width (typically text items). o Added "background-color" and "background-color-rgb" properties to GooCanvas. o Added "ellipsize" property to GooCanvasText. o Added goo_canvas_item_remove() and goo_canvas_item_model_remove() convenience functions to remove an item or model from the canvas. o Fixed bug removing widget items. o Fixed bug which meant that the fill pattern couldn't be reset to NULL. o Fixed the item event signals, so that returning TRUE from a handler stops the signal emission. o Added a few things that will be needed to support tooltips, when GTK+ 2.12 is available. (Though I don't want to depend on GTK+ 2.12 yet.) o Added "const" to arguments, where appropriate. GooCanvas 0.7 (Feb 27 2007) ============= o Added goo_canvas_get_items_at() and goo_canvas_get_items_in_area() to get all the items at a given point or in a given area. o Use CAIRO_ANTIALIAS_GRAY as the default antialiasing mode, since that is what is recommended by cairo for unhinted text. o Added "hint-metrics" style property, so people can use hinted text if they want to (though they shouldn't change the canvas scale in that case, as the bounds of the text item may become incorrect). o Unref all objects in dispose methods rather than finalize, to help bindings. o Remove embedded widgets properly. o Clip GooCanvasTable children if needed. o Set the clip path in goo_canvas_render() if needed. o Use the ink rects & the logical rects to calculate the text item bounds. o Copied GTK+ build stuff for generating goocanvasmarshal.[hc] and goocanvasenumtypes.[hc], so hopefully it is easier to build on Windows. o Fixed a few other minor bugs. GooCanvas 0.6 (Feb 17 2007) ============= o Major rewrite to make the model optional, so people can choose to have either a simple canvas or a model/view canvas. The standard items can be used in either scenario. o Added support for cascading style properties (things like fill color, stroke width, font etc.). Properties use a GQuark for a unique identifier, and a GValue for the property value, so they are very flexible. o Added GooCanvasTable item to layout child items. o Made it much easier to create new items, by subclassing GooCanvasItemSimple which handles most of the work. See demo/demo-item.c for a simple item. o Added support for different units - pixels, points, inches or millimeters, and allow setting of vertical and horizontal resolution (dpi). o Added workaround for cairo's 16-bit limit, to support large canvases. o Added demo/scalability-demo which creates 100,000 items over a large canvas. It takes a few seconds to create all the items, but once created it seems to work fast enough. o Improved the animation code, supporting relative or absolute values for the x, y, scale and rotation. o Added "clip-path" and "clip-fill-rule" to specify a clip path for an item. GooCanvas 0.5 (Oct 10 2006) ============= o This was just a development release previewing the new optional model-view rewrite. GooCanvas 0.4 (Aug 24 2006) ============= o Many minor changes to support the PyGooCanvas python bindings. o Added goo_canvas_view_get_item_view() to get views of particular items, to make it easier to setup signal handlers for simple canvases. (See demo/simple-demo.c for a demo of this.) o Support transforms on item views as well as on items. GooCanvas 0.3 (Apr 24 2006) ============= o New GooCanvasPath item (similar to SVG path element). o Accessibility support. o Keyboard focus navigation. o API documentation. o Convenience functions for coordinate conversions. o Smooth scrolling & zooming. o Zoom-independent text layout. o Render part or all of canvas to a cairo_t, for ps/pdf output. o New "visibility" and "visibility-threshold" properties for items. o New "pointer-events" property specifying which parts of items get events. GooCanvas 0.2 (Dec 5 2005) ============= o Affine transformations for all items. o Event handling, including support for pointer grabs. o Support for simple animation. o Finished port of FooCanvas demo, and added test for pointer grabs. GooCanvas 0.1 (Nov 17 2005) ============= o Basic items working. o Model/view split. o Interfaces for items & views. goocanvas-0.15/gtk-doc.make0000644000076400007640000001201610740714602012540 00000000000000# -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### if GTK_DOC_USE_LIBTOOL GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) else GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) endif # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) EXTRA_DIST = \ $(content_files) \ $(HTML_IMAGES) \ $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) if ENABLE_GTK_DOC all-local: html-build.stamp else all-local: endif docs: html-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) cd $(srcdir) && \ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' @-chmod -R u+w $(srcdir) cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) cd $(srcdir) && \ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) rm -rf $(srcdir)/html mkdir $(srcdir)/html cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) @echo 'gtk-doc: Fixing cross-references' cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) touch html-build.stamp ############## clean-local: rm -f *~ *.bak rm -rf .libs distclean-local: cd $(srcdir) && \ rm -rf xml $(REPORT_FILES) \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt maintainer-clean-local: clean cd $(srcdir) && rm -rf xml html install-data-local: installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ then echo '-- Nothing to install' ; \ else \ $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ for i in $$installfiles; do \ echo '-- Installing '$$i ; \ $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ done; \ echo '-- Installing $(srcdir)/html/index.sgml' ; \ $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ (which gtkdoc-rebase >& /dev/null && \ gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR)) || : ; \ fi uninstall-local: rm -f $(DESTDIR)$(TARGET_DIR)/* # # Require gtk-doc when making dist # if ENABLE_GTK_DOC dist-check-gtkdoc: else dist-check-gtkdoc: @echo "*** gtk-doc must be installed and enabled in order to make dist" @false endif dist-hook: dist-check-gtkdoc dist-hook-local mkdir $(distdir)/tmpl mkdir $(distdir)/xml mkdir $(distdir)/html -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl -cp $(srcdir)/xml/*.xml $(distdir)/xml cp $(srcdir)/html/* $(distdir)/html cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ cd $(distdir) && rm -f $(DISTCLEANFILES) -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs goocanvas-0.15/install-sh0000755000076400007640000003160010656605223012361 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-10-14.15 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" posix_glob= posix_mkdir= # Desired mode of installed file. mode=0755 chmodcmd=$chmodprog chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) mode=$2 shift shift case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac done if test $# -ne 0 && test -z "$dir_arg$dstarg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix=/ ;; -*) prefix=./ ;; *) prefix= ;; esac case $posix_glob in '') if (set -f) 2>/dev/null; then posix_glob=true else posix_glob=false fi ;; esac oIFS=$IFS IFS=/ $posix_glob && set -f set fnord $dstdir shift $posix_glob && set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dst"; then $doit $rmcmd -f "$dst" 2>/dev/null \ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } } || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: goocanvas-0.15/config.guess0000755000076400007640000012706310665257023012707 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-05-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: goocanvas-0.15/demo/0000777000076400007640000000000011222215703011353 500000000000000goocanvas-0.15/demo/mv-demo-table.c0000644000076400007640000002404011172574677014112 00000000000000#include #include #include #define DEMO_RECT_ITEM 0 #define DEMO_TEXT_ITEM 1 static GooCanvas *canvas; static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { gchar *id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'button-press' signal at %g, %g (root: %g, %g)\n", id ? id : "unknown", event->x, event->y, event->x_root, event->y_root); return TRUE; } static void create_demo_item (GooCanvasItemModel *table, gint demo_item_type, gint row, gint column, gint rows, gint columns, gchar *text) { GooCanvasItemModel *model = NULL; GooCanvasItem *item; GValue value = { 0 }; guint new_row; switch (demo_item_type) { case DEMO_RECT_ITEM: model = goo_canvas_rect_model_new (table, 0, 0, 38, 19, "fill-color", "red", NULL); break; case DEMO_TEXT_ITEM: model = goo_canvas_text_model_new (table, text, 0, 0, -1, GTK_ANCHOR_NW, NULL); break; } g_value_init (&value, G_TYPE_UINT); g_value_set_uint (&value, row); goo_canvas_item_model_set_child_property (table, model, "row", &value); g_value_set_uint (&value, column); goo_canvas_item_model_set_child_property (table, model, "column", &value); g_value_set_uint (&value, rows); goo_canvas_item_model_set_child_property (table, model, "rows", &value); g_value_set_uint (&value, columns); goo_canvas_item_model_set_child_property (table, model, "columns", &value); /* Test the get function. */ goo_canvas_item_model_get_child_property (table, model, "row", &value); new_row = g_value_get_uint (&value); if (new_row != row) g_warning ("Got bad row setting: %i should be: %i\n", new_row, row); #if 1 goo_canvas_item_model_set_child_properties (table, model, "x-expand", TRUE, "x-fill", TRUE, "y-expand", TRUE, "y-fill", TRUE, NULL); #endif item = goo_canvas_get_item (canvas, model); g_object_set_data (G_OBJECT (item), "id", text); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); } static GooCanvasItemModel* create_table (GooCanvasItemModel *parent, gint row, gint column, gint embedding_level, gdouble x, gdouble y, gdouble rotation, gdouble scale, gint demo_item_type) { GooCanvasItemModel *table; /* Add a few simple items. */ table = goo_canvas_table_model_new (parent, "row-spacing", 4.0, "column-spacing", 4.0, NULL); goo_canvas_item_model_translate (table, x, y); #if 1 goo_canvas_item_model_rotate (table, rotation, 0, 0); #endif #if 1 goo_canvas_item_model_scale (table, scale, scale); #endif if (row != -1) goo_canvas_item_model_set_child_properties (parent, table, "row", row, "column", column, #if 1 "x-expand", TRUE, "x-fill", TRUE, #endif #if 0 "y-expand", TRUE, "y-fill", TRUE, #endif NULL); if (embedding_level) { gint level = embedding_level - 1; create_table (table, 0, 0, level, 50, 50, 0, 0.7, demo_item_type); create_table (table, 0, 1, level, 50, 50, 45, 1.0, demo_item_type); create_table (table, 0, 2, level, 50, 50, 90, 1.0, demo_item_type); create_table (table, 1, 0, level, 50, 50, 135, 1.0, demo_item_type); create_table (table, 1, 1, level, 50, 50, 180, 1.5, demo_item_type); create_table (table, 1, 2, level, 50, 50, 225, 1.0, demo_item_type); create_table (table, 2, 0, level, 50, 50, 270, 1.0, demo_item_type); create_table (table, 2, 1, level, 50, 50, 315, 1.0, demo_item_type); create_table (table, 2, 2, level, 50, 50, 360, 2.0, demo_item_type); } else { create_demo_item (table, demo_item_type, 0, 0, 1, 1, "(0,0)"); create_demo_item (table, demo_item_type, 0, 1, 1, 1, "(1,0)"); create_demo_item (table, demo_item_type, 0, 2, 1, 1, "(2,0)"); create_demo_item (table, demo_item_type, 1, 0, 1, 1, "(0,1)"); create_demo_item (table, demo_item_type, 1, 1, 1, 1, "(1,1)"); create_demo_item (table, demo_item_type, 1, 2, 1, 1, "(2,1)"); create_demo_item (table, demo_item_type, 2, 0, 1, 1, "(0,2)"); create_demo_item (table, demo_item_type, 2, 1, 1, 1, "(1,2)"); create_demo_item (table, demo_item_type, 2, 2, 1, 1, "(2,2)"); } return table; } static void create_demo_table (GooCanvasItemModel *root, gdouble x, gdouble y, gdouble width, gdouble height) { GooCanvasItemModel *table, *square, *circle, *triangle; GooCanvasItem *item; table = goo_canvas_table_model_new (root, "row-spacing", 4.0, "column-spacing", 4.0, "width", width, "height", height, NULL); goo_canvas_item_model_translate (table, x, y); square = goo_canvas_rect_model_new (table, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); goo_canvas_item_model_set_child_properties (table, square, "row", 0, "column", 0, "x-shrink", TRUE, NULL); item = goo_canvas_get_item (canvas, square); g_object_set_data (G_OBJECT (item), "id", "Red square"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); circle = goo_canvas_ellipse_model_new (table, 0.0, 0.0, 25.0, 25.0, "fill-color", "blue", NULL); goo_canvas_item_model_set_child_properties (table, circle, "row", 0, "column", 1, "x-shrink", TRUE, NULL); item = goo_canvas_get_item (canvas, circle); g_object_set_data (G_OBJECT (item), "id", "Blue circle"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); triangle = goo_canvas_polyline_model_new (table, TRUE, 3, 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, "fill-color", "yellow", NULL); goo_canvas_item_model_set_child_properties (table, triangle, "row", 0, "column", 2, "x-shrink", TRUE, NULL); item = goo_canvas_get_item (canvas, triangle); g_object_set_data (G_OBJECT (item), "id", "Yellow triangle"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); } static void create_width_for_height_table (GooCanvasItemModel *root, gdouble x, gdouble y, gdouble width, gdouble height, gdouble rotation) { GooCanvasItemModel *table, *model; GooCanvasItem *item; gchar *text = "This is a long paragraph that will have to be split over a few lines so we can see if its allocated height changes when its allocated width is changed."; table = goo_canvas_table_model_new (root, #if 1 "width", width, "height", height, #endif NULL); goo_canvas_item_model_translate (table, x, y); goo_canvas_item_model_rotate (table, rotation, 0, 0); model = goo_canvas_rect_model_new (table, 0.0, 0.0, width - 2, 10.0, "fill-color", "red", NULL); goo_canvas_item_model_set_child_properties (table, model, "row", 0, "column", 0, "x-shrink", TRUE, NULL); #if 1 model = goo_canvas_text_model_new (table, text, 0, 0, -1, GTK_ANCHOR_NW, NULL); goo_canvas_item_model_set_child_properties (table, model, "row", 1, "column", 0, "x-expand", TRUE, "x-fill", TRUE, "x-shrink", TRUE, "y-expand", TRUE, "y-fill", TRUE, NULL); item = goo_canvas_get_item (canvas, model); g_object_set_data (G_OBJECT (item), "id", "Text Item"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); #endif model = goo_canvas_rect_model_new (table, 0.0, 0.0, width - 2, 10.0, "fill-color", "red", NULL); goo_canvas_item_model_set_child_properties (table, model, "row", 2, "column", 0, "x-shrink", TRUE, NULL); } GtkWidget * create_table_page (void) { GtkWidget *vbox, *scrolled_win; GooCanvasItemModel *root, *table; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = (GooCanvas*) goo_canvas_new (); gtk_widget_set_size_request ((GtkWidget*) canvas, 600, 450); goo_canvas_set_bounds (canvas, 0, 0, 1000, 2000); gtk_container_add (GTK_CONTAINER (scrolled_win), (GtkWidget*) canvas); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (canvas, root); g_object_unref (root); #if 1 create_demo_table (root, 400, 200, -1, -1); create_demo_table (root, 400, 260, 100, -1); #endif #if 1 create_table (root, -1, -1, 0, 10, 10, 0, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 180, 10, 30, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 350, 10, 60, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 500, 10, 90, 1.0, DEMO_TEXT_ITEM); #endif #if 1 table = create_table (root, -1, -1, 0, 30, 150, 0, 1.0, DEMO_TEXT_ITEM); g_object_set (table, "width", 300.0, "height", 100.0, NULL); #endif #if 1 create_table (root, -1, -1, 1, 200, 200, 30, 0.8, DEMO_TEXT_ITEM); #endif #if 0 table = create_table (root, -1, -1, 0, 10, 700, 0, 1.0, DEMO_WIDGET_ITEM); g_object_set (table, "width", 300.0, "height", 200.0, NULL); #endif create_width_for_height_table (root, 100, 1000, 200, -1, 0); #if 1 create_width_for_height_table (root, 100, 1200, 300, -1, 0); create_width_for_height_table (root, 500, 1000, 200, -1, 30); create_width_for_height_table (root, 500, 1200, 300, -1, 30); #endif gtk_widget_show ((GtkWidget*) canvas); return vbox; } goocanvas-0.15/demo/demo-item.c0000644000076400007640000000777611172574677013362 00000000000000/* * GooCanvas Demo. Copyright (C) 2006 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-item.c - a simple demo item. */ #include #include "goocanvas.h" #include "demo-item.h" /* Use the GLib convenience macro to define the type. GooDemoItem is the class struct, goo_demo_item is the function prefix, and our class is a subclass of GOO_TYPE_CANVAS_ITEM_SIMPLE. */ G_DEFINE_TYPE (GooDemoItem, goo_demo_item, GOO_TYPE_CANVAS_ITEM_SIMPLE) /* The standard object initialization function. */ static void goo_demo_item_init (GooDemoItem *demo_item) { demo_item->x = 0.0; demo_item->y = 0.0; demo_item->width = 0.0; demo_item->height = 0.0; } /* The convenience function to create new items. This should start with a parent argument and end with a variable list of object properties to fit in with the standard canvas items. */ GooCanvasItem* goo_demo_item_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItem *item; GooDemoItem *demo_item; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_DEMO_ITEM, NULL); demo_item = (GooDemoItem*) item; demo_item->x = x; demo_item->y = y; demo_item->width = width; demo_item->height = height; va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /* The update method. This is called when the canvas is initially shown and also whenever the object is updated and needs to change its size and/or shape. It should calculate its new bounds in its own coordinate space, storing them in simple->bounds. */ static void goo_demo_item_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooDemoItem *demo_item = (GooDemoItem*) simple; /* Compute the new bounds. */ simple->bounds.x1 = demo_item->x; simple->bounds.y1 = demo_item->y; simple->bounds.x2 = demo_item->x + demo_item->width; simple->bounds.y2 = demo_item->y + demo_item->height; } /* The paint method. This should draw the item on the given cairo_t, using the item's own coordinate space. */ static void goo_demo_item_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooDemoItem *demo_item = (GooDemoItem*) simple; cairo_move_to (cr, demo_item->x, demo_item->y); cairo_line_to (cr, demo_item->x, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y); cairo_close_path (cr); goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_fill (cr); } /* Hit detection. This should check if the given coordinate (in the item's coordinate space) is within the item. If it is it should return TRUE, otherwise it should return FALSE. */ static gboolean goo_demo_item_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooDemoItem *demo_item = (GooDemoItem*) simple; if (x < demo_item->x || (x > demo_item->x + demo_item->width) || y < demo_item->y || (y > demo_item->y + demo_item->height)) return FALSE; return TRUE; } /* The class initialization function. Here we set the class' update(), paint() and is_item_at() methods. */ static void goo_demo_item_class_init (GooDemoItemClass *klass) { GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; simple_class->simple_update = goo_demo_item_update; simple_class->simple_paint = goo_demo_item_paint; simple_class->simple_is_item_at = goo_demo_item_is_item_at; } goocanvas-0.15/demo/demo-paths.c0000644000076400007640000001157011172574677013526 00000000000000#include #include #include #include static GooCanvasItem *path1; static gboolean on_background_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GList *items, *elem; g_print ("Button Press Item: %p\n", target); canvas = goo_canvas_item_get_canvas (item); items = goo_canvas_get_items_at (canvas, event->x_root, event->y_root, FALSE); for (elem = items; elem; elem = elem->next) g_print (" clicked items: %p\n", elem->data); g_list_free (items); return TRUE; } static void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root, *path; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); g_signal_connect (root, "button_press_event", G_CALLBACK (on_background_button_press), NULL); /* Test the simple commands like moveto and lineto: MmZzLlHhVv. */ path1 = goo_canvas_path_new (root, "M 20 20 L 40 40", NULL); path = goo_canvas_path_new (root, "M30 20 l20, 20", NULL); path = goo_canvas_path_new (root, "M 60 20 H 80", NULL); path = goo_canvas_path_new (root, "M60 40 h20", NULL); path = goo_canvas_path_new (root, "M 100,20 V 40", NULL); path = goo_canvas_path_new (root, "M 120 20 v 20", NULL); path = goo_canvas_path_new (root, "M 140 20 h20 v20 h-20 z", NULL); path = goo_canvas_path_new (root, "M 180 20 h20 v20 h-20 z m 5,5 h10 v10 h-10 z", "fill-color", "red", "fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); path = goo_canvas_path_new (root, "M 220 20 L 260 20 L 240 40 z", "fill-color", "red", "stroke-color", "blue", "line-width", 3.0, NULL); /* Test the bezier curve commands: CcSsQqTt. */ path = goo_canvas_path_new (root, "M20,100 C20,50 100,50 100,100 S180,150 180,100", NULL); path = goo_canvas_path_new (root, "M220,100 c0,-50 80,-50 80,0 s80,50 80,0", NULL); path = goo_canvas_path_new (root, "M20,200 Q60,130 100,200 T180,200", NULL); path = goo_canvas_path_new (root, "M220,200 q40,-70 80,0 t80,0", NULL); /* Test the elliptical arc commands: Aa. */ path = goo_canvas_path_new (root, "M200,500 h-150 a150,150 0 1,0 150,-150 z", "fill-color", "red", "stroke-color", "blue", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M175,475 v-150 a150,150 0 0,0 -150,150 z", "fill-color", "yellow", "stroke-color", "blue", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M400,600 l 50,-25 " "a25,25 -30 0,1 50,-25 l 50,-25 " "a25,50 -30 0,1 50,-25 l 50,-25 " "a25,75 -30 0,1 50,-25 l 50,-25 " "a25,100 -30 0,1 50,-25 l 50,-25", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M 525,75 a100,50 0 0,0 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M 725,75 a100,50 0 0,1 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M 525,200 a100,50 0 1,0 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_new (root, "M 725,200 a100,50 0 1,1 100,50", "stroke-color", "red", "line-width", 5.0, NULL); } static void move_path_clicked (GtkWidget *button, GooCanvas *canvas) { static gint count = 0; gchar *data; if (count == 0) data = "M130,70 L317,70"; else if (count == 1) data = "M130,170 L317,170"; else data = "M130,270 L317,270"; g_object_set (path1, "data", data, NULL); count = (count + 1) % 3; } GtkWidget * create_paths_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); w = gtk_button_new_with_label ("Move Path"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_path_clicked), canvas); return vbox; } goocanvas-0.15/demo/mv-simple-demo.c0000644000076400007640000000536211172574677014322 00000000000000#include #include static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItemModel *root, *rect_model, *text_model; GooCanvasItem *rect_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_group_model_new (NULL, NULL); /* Add a few simple items. */ rect_model = goo_canvas_rect_model_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_model = goo_canvas_text_model_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_model_rotate (text_model, 45, 300, 300); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); /* Connect a signal handler for the rectangle item. */ rect_item = goo_canvas_get_item (GOO_CANVAS (canvas), rect_model); g_signal_connect (rect_item, "button_press_event", G_CALLBACK (on_rect_button_press), NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-0.15/demo/widgets-demo.c0000644000076400007640000002652411172574677014062 00000000000000#include #include GtkWidget *canvas; GooCanvasItem *move_item; int num_added_widgets = 0; GList *added_widget_items; static void add_widget_clicked (GtkWidget *button, gpointer data) { GooCanvasItem *root, *witem; GtkWidget *widget; if (num_added_widgets % 2) widget = gtk_label_new ("Hello World"); else widget = gtk_entry_new (); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); witem = goo_canvas_widget_new (root, widget, num_added_widgets * 50, num_added_widgets * 50, 200, 50, NULL); added_widget_items = g_list_prepend (added_widget_items, witem); num_added_widgets++; } static void remove_widget_clicked (GtkWidget *button, gpointer data) { GooCanvasItem *witem; if (!added_widget_items) return; witem = added_widget_items->data; goo_canvas_item_remove (witem); added_widget_items = g_list_delete_link (added_widget_items, added_widget_items); num_added_widgets--; } static void move_widget_clicked (GtkWidget *button, gpointer data) { static gint move_index = 0; static gdouble moves[][4] = { { 50, 50, -1, -1 }, { 300, 100, -1, -1 }, { 200, 200, -1, -1 }, { 400, 100, -1, -1 }, }; g_object_set (move_item, "x", moves[move_index][0], "y", moves[move_index][1], "width", moves[move_index][2], "height", moves[move_index][3], NULL); move_index = (move_index + 1) % 4; } static void change_anchor_clicked (GtkWidget *button, gpointer data) { static GtkAnchorType anchor = GTK_ANCHOR_CENTER; g_print ("Setting anchor to: %i\n", anchor); g_object_set (move_item, "anchor", anchor, NULL); anchor++; if (anchor > GTK_ANCHOR_EAST) anchor = GTK_ANCHOR_CENTER; } static void change_widget_clicked (GtkWidget *button, gpointer data) { GooCanvasItem *witem; GtkWidget *old_widget, *widget; if (!added_widget_items) return; witem = added_widget_items->data; g_object_get (witem, "widget", &old_widget, NULL); if (GTK_IS_ENTRY (old_widget)) widget = gtk_label_new ("Hello World"); else widget = gtk_entry_new (); g_object_set (witem, "widget", widget, NULL); } static void hide_item_clicked (GtkWidget *button, gpointer data) { g_object_set (move_item, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); } static void show_item_clicked (GtkWidget *button, gpointer data) { g_object_set (move_item, "visibility", GOO_CANVAS_ITEM_VISIBLE, NULL); } static void hide_canvas_clicked (GtkWidget *button, gpointer data) { gtk_widget_hide (canvas); } static void show_canvas_clicked (GtkWidget *button, gpointer data) { gtk_widget_show (canvas); } static void change_transform_clicked (GtkWidget *button, gpointer data) { goo_canvas_item_translate (move_item, 25.0, 25.0); } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } static gboolean on_focus_in (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received focus-in event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (item, "stroke-color", "black", NULL); return FALSE; } static gboolean on_focus_out (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received focus-out event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (item, "stroke-pattern", NULL, NULL); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received button-press event\n", id ? id : "unknown"); canvas = goo_canvas_item_get_canvas (item); goo_canvas_grab_focus (canvas, item); return TRUE; } static gboolean on_key_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received key-press event\n", id ? id : "unknown"); return FALSE; } static void create_focus_box (GtkWidget *canvas, gdouble x, gdouble y, gdouble width, gdouble height, gchar *color) { GooCanvasItem *root, *item; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); item = goo_canvas_rect_new (root, x, y, width, height, "stroke-pattern", NULL, "fill-color", color, "line-width", 5.0, "can-focus", TRUE, NULL); g_object_set_data (G_OBJECT (item), "id", color); g_signal_connect (item, "focus_in_event", G_CALLBACK (on_focus_in), NULL); g_signal_connect (item, "focus_out_event", G_CALLBACK (on_focus_out), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "key_press_event", G_CALLBACK (on_key_press), NULL); } int main (int argc, char *argv[]) { GtkWidget *window, *vbox, *hbox, *w, *scrolled_win; GtkWidget *label, *entry, *textview; GtkTextBuffer *buffer; GooCanvasItem *root, *witem; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); w = gtk_button_new_with_label ("Add Widget"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (add_widget_clicked), NULL); w = gtk_button_new_with_label ("Remove Widget"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (remove_widget_clicked), NULL); w = gtk_button_new_with_label ("Move Widget"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_widget_clicked), NULL); w = gtk_button_new_with_label ("Change Anchor"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_anchor_clicked), NULL); w = gtk_button_new_with_label ("Change Widget"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_widget_clicked), NULL); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); w = gtk_button_new_with_label ("Hide Canvas"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (hide_canvas_clicked), NULL); w = gtk_button_new_with_label ("Show Canvas"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (show_canvas_clicked), NULL); w = gtk_button_new_with_label ("Hide Item"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (hide_item_clicked), NULL); w = gtk_button_new_with_label ("Show Item"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (show_item_clicked), NULL); w = gtk_button_new_with_label ("Change Transform"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_transform_clicked), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = goo_canvas_new (); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Add a few simple items. */ label = gtk_label_new ("Hello World"); witem = goo_canvas_widget_new (root, label, 50, 50, 200, 100, NULL); g_object_set_data (G_OBJECT (witem), "id", "hello"); entry = gtk_entry_new (); move_item = goo_canvas_widget_new (root, entry, 50, 250, 200, 50, NULL); g_object_set_data (G_OBJECT (move_item), "id", "entry1"); entry = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (entry), "Size: -1 x -1"); witem = goo_canvas_widget_new (root, entry, 50, 300, -1, -1, NULL); g_object_set_data (G_OBJECT (witem), "id", "entry2"); entry = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (entry), "Size: 100 x -1"); witem = goo_canvas_widget_new (root, entry, 50, 350, 100, -1, NULL); g_object_set_data (G_OBJECT (witem), "id", "entry3"); /* Use a textview so we can see the width & height of the widget. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), GTK_POLICY_NEVER, GTK_POLICY_NEVER); textview = gtk_text_view_new (); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview)); gtk_text_buffer_set_text (GTK_TEXT_BUFFER (buffer), "Size: -1 x 100", -1); gtk_widget_show (textview); gtk_container_add (GTK_CONTAINER (scrolled_win), textview); gtk_widget_set_size_request (scrolled_win, 160, 50); witem = goo_canvas_widget_new (root, scrolled_win, 50, 400, -1, 100, NULL); g_object_set_data (G_OBJECT (witem), "id", "scrolledwin"); /* Create a vbox item with several child entry widgets to check focus traversal.*/ vbox = gtk_vbox_new (FALSE, 4); entry = gtk_entry_new (); gtk_widget_show (entry); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); entry = gtk_entry_new (); gtk_widget_show (entry); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); entry = gtk_entry_new (); gtk_widget_show (entry); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); witem = goo_canvas_widget_new (root, vbox, 50, 600, -1, -1, NULL); g_object_set_data (G_OBJECT (witem), "id", "vbox"); /* Create a few normal canvas items that take keyboard focus. */ create_focus_box (canvas, 110, 80, 50, 30, "red"); create_focus_box (canvas, 300, 160, 50, 30, "orange"); create_focus_box (canvas, 500, 50, 50, 30, "yellow"); gtk_widget_show (canvas); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } goocanvas-0.15/demo/table-demo.c0000644000076400007640000001764311172574677013505 00000000000000#include #include static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } static GooCanvasItem* create_item (GooCanvasItem *table, gdouble width, gdouble height, gint row, gint column, gint rows, gint columns, gboolean x_expand, gboolean x_shrink, gboolean x_fill, gboolean y_expand, gboolean y_shrink, gboolean y_fill) { GooCanvasItem *item; item = goo_canvas_rect_new (table, 0, 0, width, height, "stroke-color", "black", "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, item, "row", row, "column", column, "rows", rows, "columns", columns, "x-expand", x_expand, "x-fill", x_fill, "x-shrink", x_shrink, "y-expand", y_expand, "y-fill", y_fill, "y-shrink", y_shrink, NULL); return item; } void create_table1 (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gboolean with_grid_lines) { GooCanvasItem *table, *items[9]; GooCanvasBounds bounds; gint i = 0; table = goo_canvas_table_new (parent, "width", width, "height", height, NULL); goo_canvas_item_translate (table, x, y); if (with_grid_lines) { g_object_set (G_OBJECT (table), "row-spacing", 2.0, "column-spacing", 2.0, "x-border-spacing", 1.0, "y-border-spacing", 1.0, "horz-grid-line-width", 1.0, "vert-grid-line-width", 2.0, "stroke-color", "blue", "fill-color", "lightblue", NULL); } items[i++] = create_item (table, 17.3, 12.9, 0, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 33.1, 17.2, 1, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 41.6, 23.9, 2, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 7.1, 5.7, 0, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 13.5, 18.2, 1, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 25.2, 22.1, 2, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 11.3, 11.7, 0, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 21.7, 18.8, 1, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 22.2, 13.8, 2, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); for (i = 0; i < 9; i++) { goo_canvas_item_get_bounds (items[i], &bounds); g_print ("Item %i: %g,%g - %g,%g\n", i, bounds.x1 - x, bounds.y1 - y, bounds.x2 - x, bounds.y2 - y); } } /* Creates a table with items spanning multiple cells */ void create_table2 (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gboolean with_grid_lines) { GooCanvasItem *table, *items[9]; GooCanvasBounds bounds; gint i = 0; table = goo_canvas_table_new (parent, "width", width, "height", height, NULL); goo_canvas_item_translate (table, x, y); if (with_grid_lines) { g_object_set (G_OBJECT (table), "row-spacing", 2.0, "column-spacing", 2.0, "x-border-spacing", 1.0, "y-border-spacing", 1.0, "horz-grid-line-width", 1.0, "vert-grid-line-width", 2.0, NULL); } items[i++] = create_item (table, 17.3, 12.9, 0, 0, 2, 2, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 33.1, 17.2, 0, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 41.6, 23.9, 1, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 7.1, 5.7, 0, 3, 2, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 13.5, 18.2, 2, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 25.2, 22.1, 2, 1, 1, 3, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 11.3, 11.7, 3, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 21.7, 18.8, 3, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 22.2, 13.8, 3, 2, 1, 2, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); for (i = 0; i < 9; i++) { goo_canvas_item_get_bounds (items[i], &bounds); g_print ("Item %i: %g,%g - %g,%g\n", i, bounds.x1 - x, bounds.y1 - y, bounds.x2 - x, bounds.y2 - y); } } void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); g_print ("\nTable at default size...\n"); create_table1 (root, 50, 50, -1, -1, FALSE); g_print ("\nTable at reduced size...\n"); create_table1 (root, 250, 50, 30, 30, FALSE); g_print ("\nTable at enlarged size...\n"); create_table1 (root, 450, 50, 100, 100, FALSE); g_print ("\nTable with grid lines at default size...\n"); create_table1 (root, 50, 250, -1, -1, TRUE); g_print ("\nTable with grid lines at reduced size...\n"); create_table1 (root, 250, 250, 30, 30, TRUE); g_print ("\nTable with grid lines at enlarged size...\n"); create_table1 (root, 450, 250, 150, 150, TRUE); g_print ("Multispanning table with grid lines at default size...\n"); create_table2 (root, 50, 450, -1, -1, TRUE); g_print ("Multispanning table with grid lines at reduced size...\n"); create_table2 (root, 250, 450, 30, 30, TRUE); g_print ("Multispanning table with grid lines at enlarged size...\n"); create_table2 (root, 450, 450, 150, 150, TRUE); } int main (int argc, char *argv[]) { GtkWidget *window, *vbox, *label, *scrolled_win, *canvas; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("Normal Layout"); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create top canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, FALSE, FALSE, 0); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 250); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_print ("\n\nNormal Canvas...\n"); setup_canvas (canvas); label = gtk_label_new ("Integer Layout"); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create bottom canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, FALSE, FALSE, 0); canvas = goo_canvas_new (); g_object_set (canvas, "integer-layout", TRUE, NULL); gtk_widget_set_size_request (canvas, 600, 250); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_print ("\n\nInteger Layout Canvas...\n"); setup_canvas (canvas); gtk_main (); return 0; } goocanvas-0.15/demo/demo-clipping.c0000644000076400007640000001163511172574677014216 00000000000000#include #include #include #include static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gchar *id) { g_print ("%s received 'button-press' signal at %g, %g (root: %g, %g)\n", id, event->x, event->y, event->x_root, event->y_root); return TRUE; } static void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root, *item, *table; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Plain items without clip path. */ item = goo_canvas_ellipse_new (root, 0, 0, 50, 30, "fill-color", "blue", NULL); goo_canvas_item_translate (item, 100, 100); goo_canvas_item_rotate (item, 30, 0, 0); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse (unclipped)"); item = goo_canvas_rect_new (root, 200, 50, 100, 100, "fill-color", "red", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle (unclipped)"); item = goo_canvas_rect_new (root, 380, 50, 100, 100, "fill-color", "yellow", NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle (unclipped)"); item = goo_canvas_text_new (root, "Sample Text", 520, 100, -1, GTK_ANCHOR_NW, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text (unclipped)"); /* Clipped items. */ item = goo_canvas_ellipse_new (root, 0, 0, 50, 30, "fill-color", "blue", "clip-path", "M 0 0 h 100 v 100 h -100 Z", NULL); goo_canvas_item_translate (item, 100, 300); goo_canvas_item_rotate (item, 30, 0, 0); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse"); item = goo_canvas_rect_new (root, 200, 250, 100, 100, "fill-color", "red", "clip-path", "M 250 300 h 100 v 100 h -100 Z", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle"); item = goo_canvas_rect_new (root, 380, 250, 100, 100, "fill-color", "yellow", "clip-path", "M480,230 l40,100 l-80 0 z", NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle"); item = goo_canvas_text_new (root, "Sample Text", 520, 300, -1, GTK_ANCHOR_NW, "clip-path", "M535,300 h75 v40 h-75 z", NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text"); /* Table with clipped items. */ table = goo_canvas_table_new (root, NULL); goo_canvas_item_translate (table, 200, 400); goo_canvas_item_rotate (table, 30, 0, 0); item = goo_canvas_ellipse_new (table, 0, 0, 50, 30, "fill-color", "blue", "clip-path", "M 0 0 h 100 v 100 h -100 Z", NULL); goo_canvas_item_translate (item, 100, 300); goo_canvas_item_rotate (item, 30, 0, 0); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse"); item = goo_canvas_rect_new (table, 200, 250, 100, 100, "fill-color", "red", "clip-path", "M 250 300 h 100 v 100 h -100 Z", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); goo_canvas_item_set_child_properties (table, item, "column", 1, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle"); item = goo_canvas_rect_new (table, 380, 250, 100, 100, "fill-color", "yellow", "clip-path", "M480,230 l40,100 l-80 0 z", NULL); goo_canvas_item_set_child_properties (table, item, "column", 2, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle"); item = goo_canvas_text_new (table, "Sample Text", 520, 300, -1, GTK_ANCHOR_NW, "clip-path", "M535,300 h75 v40 h-75 z", NULL); goo_canvas_item_set_child_properties (table, item, "column", 3, NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text"); } GtkWidget * create_clipping_page (void) { GtkWidget *vbox, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); return vbox; } goocanvas-0.15/demo/scalability-demo.c0000644000076400007640000001627111172574677014712 00000000000000#include #include #if 1 #define N_GROUP_COLS 25 #define N_GROUP_ROWS 20 #define N_COLS 10 #define N_ROWS 10 #define ITEM_WIDTH 400 #define PADDING 10 #if 1 #define ROTATE #endif #else /* This tests a very wide canvas, nearly up to the 31-bit GDK window size limit. */ #define N_GROUP_COLS 100000 #define N_GROUP_ROWS 1 #define N_COLS 10 #define N_ROWS 1 #define ITEM_WIDTH 1000 #define PADDING 100 #endif #define N_TOTAL_ID_ITEMS (N_GROUP_COLS * N_GROUP_ROWS) * (N_COLS * N_ROWS) /* The maximum length of a string identifying an item (i.e. its coords). */ #define MAX_ID_LEN 20 #if 1 #define SET_STYLE #endif #if 1 #define USE_TEXT #endif #if 0 #define USE_PIXMAP #endif #if 0 #define ONLY_ONE #endif double total_width, total_height; double left_offset, top_offset; char ids[N_TOTAL_ID_ITEMS][MAX_ID_LEN]; static clock_t start; static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItem *ancestor = target; gchar *id; while (ancestor) { id = g_object_get_data (G_OBJECT (ancestor), "id"); if (id) { g_print ("%s item received 'motion-notify' signal\n", id); return TRUE; } ancestor = goo_canvas_item_get_parent (ancestor); } return TRUE; } static void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root, *group, *item; GdkPixbuf *pixbuf = NULL; cairo_pattern_t *pattern = NULL; int group_i, group_j, i, j; double item_width, item_height; double cell_width, cell_height; double group_width, group_height; int total_items = 0, id_item_num = 0;; GdkColor color = { 0, 0, 0, 0, }; GooCanvasStyle *style, *style2; GValue tmpval = { 0 }; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); g_signal_connect (root, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_object_set (G_OBJECT (root), "font", "Sans 8", NULL); #ifdef USE_PIXMAP pixbuf = gdk_pixbuf_new_from_file("toroid.png", NULL); item_width = gdk_pixbuf_get_width (pixbuf); item_height = gdk_pixbuf_get_height (pixbuf); pattern = goo_canvas_cairo_pattern_from_pixbuf (pixbuf); #else pixbuf = NULL; item_width = ITEM_WIDTH; item_height = 19; #endif cell_width = item_width + PADDING * 2; cell_height = item_height + PADDING * 2; group_width = N_COLS * cell_width; group_height = N_ROWS * cell_height; total_width = N_GROUP_COLS * group_width; total_height = N_GROUP_ROWS * group_height; /* We use -ve offsets to test if -ve coords are handled correctly. */ left_offset = -total_width / 2; top_offset = -total_height / 2; style = goo_canvas_style_new (); gdk_color_parse ("mediumseagreen", &color); pattern = cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style, goo_canvas_style_fill_pattern_id, &tmpval); g_value_unset (&tmpval); style2 = goo_canvas_style_new (); gdk_color_parse ("steelblue", &color); pattern = cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style2, goo_canvas_style_fill_pattern_id, &tmpval); g_value_unset (&tmpval); for (group_i = 0; group_i < N_GROUP_COLS; group_i++) { for (group_j = 0; group_j < N_GROUP_ROWS; group_j++) { double group_x = left_offset + (group_i * group_width); double group_y = top_offset + (group_j * group_height); group = goo_canvas_group_new (root, NULL); total_items++; goo_canvas_item_translate (group, group_x, group_y); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { double item_x = (i * cell_width) + PADDING; double item_y = (j * cell_height) + PADDING; #ifdef ROTATE double rotation = i % 10 * 2; double rotation_x = item_x + item_width / 2; double rotation_y = item_y + item_height / 2; #endif sprintf (ids[id_item_num], "%.10g, %.10g", group_x + item_x, group_y + item_y); #ifdef USE_PIXMAP item = goo_canvas_image_new (group, NULL, item_x, item_y, "pattern", pattern, "width", item_width, "height", item_height, NULL); #else item = goo_canvas_rect_new (group, item_x, item_y, item_width, item_height, NULL); #ifdef SET_STYLE goo_canvas_item_set_style (item, (j % 2) ? style : style2); #endif #ifdef ROTATE goo_canvas_item_rotate (item, rotation, rotation_x, rotation_y); #endif #endif g_object_set_data (G_OBJECT (item), "id", ids[id_item_num]); #if 0 g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); #endif #ifdef USE_TEXT item = goo_canvas_text_new (group, ids[id_item_num], item_x + item_width / 2, item_y + item_height / 2, -1, GTK_ANCHOR_CENTER, NULL); #else item = goo_canvas_rect_new (group, item_x + 20, item_y + 4, item_width - 40, item_height - 8, NULL); #endif #ifdef ROTATE goo_canvas_item_rotate (item, rotation, rotation_x, rotation_y); #endif id_item_num++; total_items += 2; #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } if (pattern) cairo_pattern_destroy (pattern); g_print ("Total items: %i\n", total_items); } static gboolean on_expose_event (GtkWidget *canvas, GdkEvent *event, gpointer unused_data) { static gboolean first_time = TRUE; if (first_time) { printf ("Update Canvas Time Used: %g\n", (double) (clock() - start) / CLOCKS_PER_SEC); first_time = FALSE; } return FALSE; } GtkWidget * create_canvas (void) { GtkWidget *canvas; /* Create the canvas. */ canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); start = clock(); setup_canvas (canvas); printf ("Create Canvas Time Used: %g\n", (double) (clock() - start) / CLOCKS_PER_SEC); start = clock(); goo_canvas_set_bounds (GOO_CANVAS (canvas), left_offset, top_offset, left_offset + total_width, top_offset + total_height); gtk_widget_show (canvas); g_signal_connect (canvas, "expose_event", G_CALLBACK (on_expose_event), NULL); return canvas; } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; gtk_set_locale (); gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = create_canvas (); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); gtk_main (); return 0; } goocanvas-0.15/demo/demo-animation.c0000644000076400007640000001054411172574677014366 00000000000000#include #include #include #include static GooCanvasItem *ellipse1, *ellipse2, *rect1, *rect2, *rect3, *rect4; static void start_animation_clicked (GtkWidget *button, gpointer data) { /* Absolute. */ goo_canvas_item_set_simple_transform (ellipse1, 100, 100, 1, 0); goo_canvas_item_animate (ellipse1, 500, 100, 2, 720, TRUE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); goo_canvas_item_set_simple_transform (rect1, 100, 200, 1, 0); goo_canvas_item_animate (rect1, 100, 200, 1, 350, TRUE, 40 * 36, 40, GOO_CANVAS_ANIMATE_RESTART); goo_canvas_item_set_simple_transform (rect3, 200, 200, 1, 0); goo_canvas_item_animate (rect3, 200, 200, 3, 0, TRUE, 400, 40, GOO_CANVAS_ANIMATE_BOUNCE); /* Relative. */ goo_canvas_item_set_simple_transform (ellipse2, 100, 400, 1, 0); goo_canvas_item_animate (ellipse2, 400, 0, 2, 720, FALSE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); goo_canvas_item_set_simple_transform (rect2, 100, 500, 1, 0); goo_canvas_item_animate (rect2, 0, 0, 1, 350, FALSE, 40 * 36, 40, GOO_CANVAS_ANIMATE_RESTART); goo_canvas_item_set_simple_transform (rect4, 200, 500, 1, 0); goo_canvas_item_animate (rect4, 0, 0, 3, 0, FALSE, 400, 40, GOO_CANVAS_ANIMATE_BOUNCE); } static void stop_animation_clicked (GtkWidget *button, gpointer data) { goo_canvas_item_stop_animation (ellipse1); goo_canvas_item_stop_animation (ellipse2); goo_canvas_item_stop_animation (rect1); goo_canvas_item_stop_animation (rect2); goo_canvas_item_stop_animation (rect3); goo_canvas_item_stop_animation (rect4); } static void on_animation_finished (GooCanvasItem *item, gboolean stopped, gpointer data) { g_print ("Animation finished stopped: %i\n", stopped); #if 0 /* Test starting another animation. */ goo_canvas_item_animate (ellipse1, 500, 200, 2, 720, TRUE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif } static void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Absolute. */ ellipse1 = goo_canvas_ellipse_new (root, 0, 0, 25, 15, "fill-color", "blue", NULL); goo_canvas_item_translate (ellipse1, 100, 100); g_signal_connect (ellipse1, "animation_finished", G_CALLBACK (on_animation_finished), NULL); rect1 = goo_canvas_rect_new (root, -10, -10, 20, 20, "fill-color", "blue", NULL); goo_canvas_item_translate (rect1, 100, 200); rect3 = goo_canvas_rect_new (root, -10, -10, 20, 20, "fill-color", "blue", NULL); goo_canvas_item_translate (rect3, 200, 200); /* Relative. */ ellipse2 = goo_canvas_ellipse_new (root, 0, 0, 25, 15, "fill-color", "red", NULL); goo_canvas_item_translate (ellipse2, 100, 400); rect2 = goo_canvas_rect_new (root, -10, -10, 20, 20, "fill-color", "red", NULL); goo_canvas_item_translate (rect2, 100, 500); rect4 = goo_canvas_rect_new (root, -10, -10, 20, 20, "fill-color", "red", NULL); goo_canvas_item_translate (rect4, 200, 500); } GtkWidget * create_animation_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); w = gtk_button_new_with_label("Start Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (start_animation_clicked), NULL); w = gtk_button_new_with_label("Stop Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); return vbox; } goocanvas-0.15/demo/mv-scalability-demo.c0000644000076400007640000001653111172574677015331 00000000000000#include #include #if 0 #define N_GROUP_COLS 5 #define N_GROUP_ROWS 5 #else #define N_GROUP_COLS 25 #define N_GROUP_ROWS 20 #endif #define N_COLS 10 #define N_ROWS 10 #define ITEM_WIDTH 400 #if 1 #define ROTATE #endif #define N_TOTAL_ID_ITEMS (N_GROUP_COLS * N_GROUP_ROWS) * (N_COLS * N_ROWS) /* The maximum length of a string identifying an item (i.e. its coords). */ #define MAX_ID_LEN 20 #define PADDING 10 #if 1 #define SET_STYLE #endif #if 1 #define USE_TEXT #endif #if 0 #define USE_PIXMAP #endif #if 0 #define ONLY_ONE #endif double total_width, total_height; double left_offset, top_offset; char ids[N_TOTAL_ID_ITEMS][MAX_ID_LEN]; static clock_t start; static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItem *ancestor = target; gchar *id; while (ancestor) { id = g_object_get_data (G_OBJECT (ancestor), "id"); if (id) { g_print ("%s item received 'motion-notify' signal\n", id); return TRUE; } ancestor = goo_canvas_item_get_parent (ancestor); } return TRUE; } static void setup_canvas (GtkWidget *canvas) { GooCanvasItemModel *root, *group, *model; GooCanvasItem *item; GdkPixbuf *pixbuf = NULL; cairo_pattern_t *pattern = NULL; int group_i, group_j, i, j; double item_width, item_height; double cell_width, cell_height; double group_width, group_height; int total_items = 0, id_item_num = 0;; GdkColor color = { 0, 0, 0, 0, }; GooCanvasStyle *style, *style2; GValue tmpval = { 0 }; root = goo_canvas_group_model_new (NULL, "font", "Sans 8", NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); item = goo_canvas_get_item (GOO_CANVAS (canvas), root); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); #ifdef USE_PIXMAP pixbuf = gdk_pixbuf_new_from_file("toroid.png", NULL); item_width = gdk_pixbuf_get_width (pixbuf); item_height = gdk_pixbuf_get_height (pixbuf); pattern = goo_canvas_cairo_pattern_from_pixbuf (pixbuf); #else pixbuf = NULL; item_width = ITEM_WIDTH; item_height = 19; #endif cell_width = item_width + PADDING * 2; cell_height = item_height + PADDING * 2; group_width = N_COLS * cell_width; group_height = N_ROWS * cell_height; total_width = N_GROUP_COLS * group_width; total_height = N_GROUP_ROWS * group_height; /* We use -ve offsets to test if -ve coords are handled correctly. */ left_offset = -total_width / 2; top_offset = -total_height / 2; style = goo_canvas_style_new (); gdk_color_parse ("mediumseagreen", &color); pattern = cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style, goo_canvas_style_fill_pattern_id, &tmpval); g_value_unset (&tmpval); style2 = goo_canvas_style_new (); gdk_color_parse ("steelblue", &color); pattern = cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style2, goo_canvas_style_fill_pattern_id, &tmpval); g_value_unset (&tmpval); for (group_i = 0; group_i < N_GROUP_COLS; group_i++) { for (group_j = 0; group_j < N_GROUP_ROWS; group_j++) { double group_x = left_offset + (group_i * group_width); double group_y = top_offset + (group_j * group_height); group = goo_canvas_group_model_new (root, NULL); total_items++; goo_canvas_item_model_translate (group, group_x, group_y); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { double item_x = (i * cell_width) + PADDING; double item_y = (j * cell_height) + PADDING; #ifdef ROTATE double rotation = i % 10 * 2; double rotation_x = item_x + item_width / 2; double rotation_y = item_y + item_height / 2; #endif sprintf (ids[id_item_num], "%g, %g", group_x + item_x, group_y + item_y); #ifdef USE_PIXMAP model = goo_canvas_image_model_new (group, NULL, item_x, item_y, "pattern", pattern, "width", item_width, "height", item_height, NULL); #else model = goo_canvas_rect_model_new (group, item_x, item_y, item_width, item_height, NULL); #ifdef SET_STYLE goo_canvas_item_model_set_style (model, (j % 2) ? style : style2); #endif #ifdef ROTATE goo_canvas_item_model_rotate (model, rotation, rotation_x, rotation_y); #endif #endif item = goo_canvas_get_item (GOO_CANVAS (canvas), model); g_object_set_data (G_OBJECT (item), "id", ids[id_item_num]); #if 0 g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); #endif #ifdef USE_TEXT model = goo_canvas_text_model_new (group, ids[id_item_num], item_x + item_width / 2, item_y + item_height / 2, -1, GTK_ANCHOR_CENTER, NULL); #else model = goo_canvas_rect_model_new (group, item_x + 20, item_y + 4, item_width - 40, item_height - 8, NULL); #endif #ifdef ROTATE goo_canvas_item_model_rotate (model, rotation, rotation_x, rotation_y); #endif id_item_num++; total_items += 2; #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } #ifdef ONLY_ONE break; #endif } if (pattern) cairo_pattern_destroy (pattern); g_print ("Total items: %i\n", total_items); } static gboolean on_expose_event (GtkWidget *canvas, GdkEvent *event, gpointer unused_data) { static gboolean first_time = TRUE; if (first_time) { printf ("Update Canvas Time Used: %g\n", (double) (clock() - start) / CLOCKS_PER_SEC); first_time = FALSE; } return FALSE; } GtkWidget * create_canvas (void) { GtkWidget *canvas; /* Create the canvas. */ canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); start = clock(); setup_canvas (canvas); printf ("Create Canvas Time Used: %g\n", (double) (clock() - start) / CLOCKS_PER_SEC); start = clock(); goo_canvas_set_bounds (GOO_CANVAS (canvas), left_offset, top_offset, left_offset + total_width, top_offset + total_height); gtk_widget_show (canvas); g_signal_connect (canvas, "expose_event", G_CALLBACK (on_expose_event), NULL); return canvas; } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; gtk_set_locale (); gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = create_canvas (); #if 0 exit (0); #endif gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); gtk_main (); return 0; } goocanvas-0.15/demo/demo-large-rect.h0000644000076400007640000000321411172574677014435 00000000000000/* * GooCanvas Demo. Copyright (C) 2007 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-large-rect.h - a demo item that exceeds the cairo 16-bit size limit. */ #ifndef __GOO_DEMO_LARGE_RECT_H__ #define __GOO_DEMO_LARGE_RECT_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS #define GOO_TYPE_DEMO_LARGE_RECT (goo_demo_large_rect_get_type ()) #define GOO_DEMO_LARGE_RECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_DEMO_LARGE_RECT, GooDemoLargeRect)) #define GOO_DEMO_LARGE_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_DEMO_LARGE_RECT, GooDemoLargeRectClass)) #define GOO_IS_DEMO_LARGE_RECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_DEMO_LARGE_RECT)) #define GOO_IS_DEMO_LARGE_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_DEMO_LARGE_RECT)) #define GOO_DEMO_LARGE_RECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_DEMO_LARGE_RECT, GooDemoLargeRectClass)) typedef struct _GooDemoLargeRect GooDemoLargeRect; typedef struct _GooDemoLargeRectClass GooDemoLargeRectClass; struct _GooDemoLargeRect { GooCanvasItemSimple parent_object; gdouble x, y, width, height; }; struct _GooDemoLargeRectClass { GooCanvasItemSimpleClass parent_class; }; GType goo_demo_large_rect_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_demo_large_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); G_END_DECLS #endif /* __GOO_DEMO_LARGE_RECT_H__ */ goocanvas-0.15/demo/demo-large-items.c0000644000076400007640000001063211172574677014616 00000000000000#include #include #include #include "demo-large-line.h" #include "demo-large-rect.h" /* * We need to make sure that that (MAX_ZOOM * canvas width) < 2^31 so we stay * within the GDK window size limit (a signed 32-bit int). * * The canvas width is 107374182 * 2 = 214748364. * Multiply by MAX_ZOOM (10) = 2147483640. * 2^31 = 2147483648 so we are just inside the GDK limit. */ #if 1 #define CANVAS_TOP -107374182 #define CANVAS_BOTTOM 107374182 #define CANVAS_LEFT -107374182 #define CANVAS_RIGHT 107374182 #else #define CANVAS_TOP 0 #define CANVAS_BOTTOM 10000 #define CANVAS_LEFT 0 #define CANVAS_RIGHT 10000 #endif #define MAX_ZOOM 10 static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItem *ancestor = target; gchar *id; while (ancestor) { id = g_object_get_data (G_OBJECT (ancestor), "id"); if (id) { g_print ("%s item received 'motion-notify' signal\n", id); return TRUE; } ancestor = goo_canvas_item_get_parent (ancestor); } return TRUE; } static void zoom_changed (GtkAdjustment *adj, GooCanvas *canvas) { goo_canvas_set_scale (canvas, adj->value); } GtkWidget * create_large_items_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; GtkAdjustment *adj; GooCanvasItem *root, *item; gchar *text; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); text = g_strdup_printf ("This is a very large canvas, from (%i, %i) to (%i, %i).\nThe maximum zoom is %i. At this scale the canvas comes very close to the GDK window size limit (32-bit gint).\nThe items have been specially written to work around cairo's limits (transformed coords must be < +/- 32768).", CANVAS_LEFT, CANVAS_TOP, CANVAS_RIGHT, CANVAS_BOTTOM, MAX_ZOOM); w = gtk_label_new (text); g_free (text); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); /* Create the canvas. */ canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); g_signal_connect (root, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); #if 1 item = goo_demo_large_rect_new (root, CANVAS_LEFT + 10, CANVAS_TOP + 10, CANVAS_RIGHT - CANVAS_LEFT - 20, CANVAS_BOTTOM - CANVAS_TOP - 20, "fill-color", "yellow", NULL); g_object_set_data (G_OBJECT (item), "id", "Large Yellow Rect"); #endif #if 1 item = goo_demo_large_rect_new (root, CANVAS_LEFT + 100, CANVAS_TOP + 100, CANVAS_RIGHT - CANVAS_LEFT - 200, 50, "fill-color", "orange", NULL); g_object_set_data (G_OBJECT (item), "id", "Large Orange Rect"); #endif #if 1 item = goo_demo_large_line_new (root, CANVAS_LEFT + 100, CANVAS_TOP + 200, CANVAS_RIGHT - 100, CANVAS_TOP + 200, "stroke-color", "purple", "line-width", 10.0, NULL); g_object_set_data (G_OBJECT (item), "id", "Large Purple Line"); #endif #if 1 item = goo_demo_large_line_new (root, CANVAS_LEFT + 100, CANVAS_TOP + 300, CANVAS_RIGHT - 100, CANVAS_BOTTOM - 100, "stroke-color", "blue", "line-width", 10.0, NULL); g_object_set_data (G_OBJECT (item), "id", "Large Blue Line"); /*goo_canvas_item_rotate (item, 10, CANVAS_LEFT + 100, CANVAS_TOP + 200);*/ #endif goo_canvas_set_bounds (GOO_CANVAS (canvas), CANVAS_LEFT, CANVAS_TOP, CANVAS_RIGHT, CANVAS_BOTTOM); gtk_widget_show (canvas); /* Zoom */ w = gtk_label_new ("Zoom:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 10.00, 0.05, 0.50, 0.50)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); return vbox; } goocanvas-0.15/demo/simple-demo.c0000644000076400007640000000507511172574677013703 00000000000000#include #include static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItem *root, *rect_item, *text_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Add a few simple items. */ rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_rotate (text_item, 45, 300, 300); /* Connect a signal handler for the rectangle item. */ g_signal_connect (rect_item, "button_press_event", G_CALLBACK (on_rect_button_press), NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-0.15/demo/mv-demo-clipping.c0000644000076400007640000001341211172574677014631 00000000000000#include #include #include #include static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gchar *id) { g_print ("%s received 'button-press' signal at %g, %g (root: %g, %g)\n", id, event->x, event->y, event->x_root, event->y_root); return TRUE; } static void setup_canvas (GooCanvas *canvas) { GooCanvasItemModel *root, *model, *table; GooCanvasItem *item; root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (canvas, root); g_object_unref (root); /* Plain items without clip path. */ model = goo_canvas_ellipse_model_new (root, 0, 0, 50, 30, "fill-color", "blue", NULL); goo_canvas_item_model_translate (model, 100, 100); goo_canvas_item_model_rotate (model, 30, 0, 0); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse (unclipped)"); model = goo_canvas_rect_model_new (root, 200, 50, 100, 100, "fill-color", "red", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle (unclipped)"); model = goo_canvas_rect_model_new (root, 380, 50, 100, 100, "fill-color", "yellow", NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle (unclipped)"); model = goo_canvas_text_model_new (root, "Sample Text", 520, 100, -1, GTK_ANCHOR_NW, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text (unclipped)"); /* Clipped items. */ model = goo_canvas_ellipse_model_new (root, 0, 0, 50, 30, "fill-color", "blue", "clip-path", "M 0 0 h 100 v 100 h -100 Z", NULL); goo_canvas_item_model_translate (model, 100, 300); goo_canvas_item_model_rotate (model, 30, 0, 0); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse"); model = goo_canvas_rect_model_new (root, 200, 250, 100, 100, "fill-color", "red", "clip-path", "M 250 300 h 100 v 100 h -100 Z", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle"); model = goo_canvas_rect_model_new (root, 380, 250, 100, 100, "fill-color", "yellow", "clip-path", "M480,230 l40,100 l-80 0 z", NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle"); model = goo_canvas_text_model_new (root, "Sample Text", 520, 300, -1, GTK_ANCHOR_NW, "clip-path", "M535,300 h75 v40 h-75 z", NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text (unclipped)"); /* Table with clipped items. */ table = goo_canvas_table_model_new (root, NULL); goo_canvas_item_model_translate (table, 200, 400); goo_canvas_item_model_rotate (table, 30, 0, 0); model = goo_canvas_ellipse_model_new (table, 0, 0, 50, 30, "fill-color", "blue", "clip-path", "M 0 0 h 100 v 100 h -100 Z", NULL); goo_canvas_item_model_translate (model, 100, 300); goo_canvas_item_model_rotate (model, 30, 0, 0); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Blue ellipse"); model = goo_canvas_rect_model_new (table, 200, 250, 100, 100, "fill-color", "red", "clip-path", "M 250 300 h 100 v 100 h -100 Z", "clip-fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); goo_canvas_item_model_set_child_properties (table, model, "column", 1, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Red rectangle"); model = goo_canvas_rect_model_new (table, 380, 250, 100, 100, "fill-color", "yellow", "clip-path", "M480,230 l40,100 l-80 0 z", NULL); goo_canvas_item_model_set_child_properties (table, model, "column", 2, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Yellow rectangle"); model = goo_canvas_text_model_new (table, "Sample Text", 520, 300, -1, GTK_ANCHOR_NW, "clip-path", "M535,300 h75 v40 h-75 z", NULL); goo_canvas_item_model_set_child_properties (table, model, "column", 3, NULL); item = goo_canvas_get_item (canvas, model); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), "Text (unclipped)"); } GtkWidget * create_clipping_page (void) { GtkWidget *vbox, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (GOO_CANVAS (canvas)); return vbox; } goocanvas-0.15/demo/mv-demo-grabs.c0000644000076400007640000002731211172574677014126 00000000000000#include #include #include #include static gboolean on_widget_expose (GtkWidget *widget, GdkEventExpose *event, char *item_id) { g_print ("%s received 'expose' signal\n", item_id); gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_IN, &event->area, widget, NULL, 0, 0, widget->allocation.width, widget->allocation.height); return FALSE; } static gboolean on_widget_enter_notify (GtkWidget *widget, GdkEventCrossing *event, char *item_id) { g_print ("%s received 'enter-notify' signal\n", item_id); return TRUE; } static gboolean on_widget_leave_notify (GtkWidget *widget, GdkEventCrossing *event, char *item_id) { g_print ("%s received 'leave-notify' signal\n", item_id); return TRUE; } static gboolean on_widget_motion_notify (GtkWidget *widget, GdkEventMotion *event, char *item_id) { g_print ("%s received 'motion-notify' signal (window: %p)\n", item_id, event->window); if (event->is_hint) gdk_window_get_pointer (event->window, NULL, NULL, NULL); return TRUE; } static gboolean on_widget_button_press (GtkWidget *widget, GdkEventButton *event, char *item_id) { g_print ("%s received 'button-press' signal\n", item_id); if (strstr (item_id, "explicit")) { GdkGrabStatus status; GdkEventMask mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; status = gdk_pointer_grab (widget->window, FALSE, mask, FALSE, NULL, event->time); if (status == GDK_GRAB_SUCCESS) g_print ("grabbed pointer\n"); else g_print ("pointer grab failed\n"); } return TRUE; } static gboolean on_widget_button_release (GtkWidget *widget, GdkEventButton *event, char *item_id) { g_print ("%s received 'button-release' signal\n", item_id); if (strstr (item_id, "explicit")) { GdkDisplay *display; display = gtk_widget_get_display (widget); gdk_display_pointer_ungrab (display, event->time); g_print ("released pointer grab\n"); } return TRUE; } static gboolean on_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'enter-notify' signal\n", item_id); return FALSE; } static gboolean on_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'leave-notify' signal\n", item_id); return FALSE; } static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'motion-notify' signal\n", item_id); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'button-press' signal\n", item_id); if (strstr (item_id, "explicit")) { GooCanvas *canvas; GdkGrabStatus status; GdkEventMask mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; canvas = goo_canvas_item_get_canvas (item); status = goo_canvas_pointer_grab (canvas, item, mask, NULL, event->time); if (status == GDK_GRAB_SUCCESS) g_print ("grabbed pointer\n"); else g_print ("pointer grab failed\n"); } return FALSE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); char *item_id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received 'button-release' signal\n", item_id); if (strstr (item_id, "explicit")) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); g_print ("released pointer grab\n"); } return FALSE; } static void create_fixed (GtkTable *table, gint row, gchar *text, gchar *id) { GtkWidget *label, *fixed, *drawing_area; char *view_id; label = gtk_label_new (text); gtk_table_attach (table, label, 0, 1, row, row + 1, 0, 0, 0, 0); gtk_widget_show (label); fixed = gtk_fixed_new (); gtk_fixed_set_has_window (GTK_FIXED (fixed), TRUE); gtk_widget_set_events (fixed, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (fixed, 200, 100); gtk_table_attach (GTK_TABLE (table), fixed, 1, 2, row, row + 1, 0, 0, 0, 0); gtk_widget_show (fixed); view_id = g_strdup_printf ("%s-background", id); g_signal_connect (fixed, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (fixed, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (fixed, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (fixed, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (fixed, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (fixed, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); drawing_area = gtk_drawing_area_new (); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (drawing_area, 60, 60); gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 20, 20); gtk_widget_show (drawing_area); view_id = g_strdup_printf ("%s-left", id); g_signal_connect (drawing_area, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (drawing_area, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (drawing_area, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (drawing_area, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (drawing_area, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (drawing_area, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); drawing_area = gtk_drawing_area_new (); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (drawing_area, 60, 60); gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 120, 20); gtk_widget_show (drawing_area); view_id = g_strdup_printf ("%s-right", id); g_signal_connect (drawing_area, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (drawing_area, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (drawing_area, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (drawing_area, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (drawing_area, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (drawing_area, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (GOO_IS_CANVAS_RECT (model)) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (on_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (on_leave_notify), NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); } } static void create_canvas (GtkTable *table, gint row, gchar *text, gchar *id) { GtkWidget *label, *canvas; GooCanvasItemModel *root, *rect; char *view_id; label = gtk_label_new (text); gtk_table_attach (table, label, 0, 1, row, row + 1, 0, 0, 0, 0); gtk_widget_show (label); canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); gtk_widget_set_size_request (canvas, 200, 100); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 200, 100); gtk_table_attach (table, canvas, 1, 2, row, row + 1, 0, 0, 0, 0); gtk_widget_show (canvas); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); rect = goo_canvas_rect_model_new (root, 0, 0, 200, 100, "stroke-pattern", NULL, "fill-color", "yellow", NULL); view_id = g_strdup_printf ("%s-yellow", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); rect = goo_canvas_rect_model_new (root, 20, 20, 60, 60, "stroke-pattern", NULL, "fill-color", "blue", NULL); view_id = g_strdup_printf ("%s-blue", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); rect = goo_canvas_rect_model_new (root, 120, 20, 60, 60, "stroke-pattern", NULL, "fill-color", "red", NULL); view_id = g_strdup_printf ("%s-red", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); } GtkWidget * create_grabs_page (void) { GtkWidget *table, *label; table = gtk_table_new (5, 2, FALSE); gtk_container_set_border_width (GTK_CONTAINER (table), 12); gtk_table_set_row_spacings (GTK_TABLE (table), 12); gtk_table_set_col_spacings (GTK_TABLE (table), 12); gtk_widget_show (table); label = gtk_label_new ("Move the mouse over the widgets and canvas items on the right to see what events they receive.\nClick buttons to start explicit or implicit pointer grabs and see what events they receive now.\n(They should all receive the same events.)"); gtk_table_attach (GTK_TABLE (table), label, 0, 2, 0, 1, 0, 0, 0, 0); gtk_widget_show (label); /* Drawing area with explicit grabs. */ create_fixed (GTK_TABLE (table), 1, "Widget with Explicit Grabs:", "widget-explicit"); /* Drawing area with implicit grabs. */ create_fixed (GTK_TABLE (table), 2, "Widget with Implicit Grabs:", "widget-implicit"); /* Canvas with explicit grabs. */ create_canvas (GTK_TABLE (table), 3, "Canvas with Explicit Grabs:", "canvas-explicit"); /* Canvas with implicit grabs. */ create_canvas (GTK_TABLE (table), 4, "Canvas with Implicit Grabs:", "canvas-implicit"); return table; } goocanvas-0.15/demo/demo-scalability.c0000644000076400007640000000427511172574677014713 00000000000000#include #include #include #include #define N_COLS 5 #define N_ROWS 20 #define PADDING 10 #if 1 #define USE_PIXMAP #endif GtkWidget * create_canvas_scalability (void) { GtkWidget *vbox; GtkWidget *frame; GtkWidget *scrolled_win, *canvas; GtkWidget *table; GdkPixbuf *pixbuf; GooCanvasItem *root, *item; int i, j, width, height; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); table = gtk_table_new (2, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0); gtk_widget_show (table); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_table_attach (GTK_TABLE (table), frame, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); gtk_widget_show (frame); /* Create the canvas and board */ pixbuf = gdk_pixbuf_new_from_file("toroid.png", NULL); #ifdef USE_PIXMAP width = gdk_pixbuf_get_width (pixbuf) + 3; height = gdk_pixbuf_get_height (pixbuf) +1; #else width = 37; height = 19; #endif canvas = goo_canvas_new (); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, N_COLS * (width + PADDING), N_ROWS * (height + PADDING)); gtk_widget_show (canvas); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (frame), scrolled_win); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { #ifdef USE_PIXMAP item = goo_canvas_image_new (root, pixbuf, i * (width + PADDING), j * (height + PADDING), NULL); #else item = goo_canvas_rect_new (root, i * (width + PADDING), j * (height + PADDING), width, height); g_object_set (item, "fill_color", (j%2)?"mediumseagreen":"steelblue", NULL); #endif } } return vbox; } goocanvas-0.15/demo/mv-demo-arrowhead.c0000644000076400007640000003421311172574677015002 00000000000000#include #include #include #include #define LEFT 50.0 #define RIGHT 350.0 #define MIDDLE 150.0 #define DEFAULT_WIDTH 2 #define DEFAULT_SHAPE_A 4 #define DEFAULT_SHAPE_B 5 #define DEFAULT_SHAPE_C 4 static void set_dimension (GooCanvas *canvas, char *arrow_name, char *text_name, double x1, double y1, double x2, double y2, double tx, double ty, int dim) { GooCanvasPoints *points; char buf[100]; points = goo_canvas_points_new (2); points->coords[0] = x1; points->coords[1] = y1; points->coords[2] = x2; points->coords[3] = y2; g_object_set (g_object_get_data (G_OBJECT (canvas), arrow_name), "points", points, NULL); sprintf (buf, "%d", dim); g_object_set (g_object_get_data (G_OBJECT (canvas), text_name), "text", buf, "x", tx, "y", ty, NULL); goo_canvas_points_unref (points); } static void move_drag_box (GooCanvasItem *item, double x, double y) { g_object_set (item, "x", x - 5.0, "y", y - 5.0, NULL); } static void set_arrow_shape (GooCanvas *canvas) { int width; int shape_a, shape_b, shape_c; GooCanvasPoints *points; char buf[100]; width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); shape_a = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_a")); shape_b = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_b")); shape_c = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_c")); /* Big arrow */ g_object_set (g_object_get_data (G_OBJECT (canvas), "big_arrow"), "line-width", 10.0 * width, "arrow-tip-length", (double) (shape_a), "arrow-length", (double) (shape_b), "arrow-width", (double) (shape_c), NULL); /* Outline */ points = goo_canvas_points_new (5); points->coords[0] = RIGHT - 10 * shape_a * width; points->coords[1] = MIDDLE - 10 * width / 2; points->coords[2] = RIGHT - 10 * shape_b * width; points->coords[3] = MIDDLE - 10 * (shape_c * width / 2.0); points->coords[4] = RIGHT; points->coords[5] = MIDDLE; points->coords[6] = points->coords[2]; points->coords[7] = MIDDLE + 10 * (shape_c * width / 2.0); points->coords[8] = points->coords[0]; points->coords[9] = MIDDLE + 10 * width / 2; g_object_set (g_object_get_data (G_OBJECT (canvas), "outline"), "points", points, NULL); goo_canvas_points_unref (points); /* Drag boxes */ move_drag_box (g_object_get_data (G_OBJECT (canvas), "width_drag_box"), LEFT, MIDDLE - 10 * width / 2.0); move_drag_box (g_object_get_data (G_OBJECT (canvas), "shape_a_drag_box"), RIGHT - 10 * shape_a * width, MIDDLE); move_drag_box (g_object_get_data (G_OBJECT (canvas), "shape_b_c_drag_box"), RIGHT - 10 * shape_b * width, MIDDLE - 10 * (shape_c * width / 2.0)); /* Dimensions */ set_dimension (canvas, "width_arrow", "width_text", LEFT - 10, MIDDLE - 10 * width / 2.0, LEFT - 10, MIDDLE + 10 * width / 2.0, LEFT - 15, MIDDLE, width); set_dimension (canvas, "shape_a_arrow", "shape_a_text", RIGHT - 10 * shape_a * width, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT - 10 * shape_a * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 15, shape_a); set_dimension (canvas, "shape_b_arrow", "shape_b_text", RIGHT - 10 * shape_b * width, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT - 10 * shape_b * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 40, shape_b); set_dimension (canvas, "shape_c_arrow", "shape_c_text", RIGHT + 10, MIDDLE - 10 * shape_c * width / 2.0, RIGHT + 10, MIDDLE + 10 * shape_c * width / 2.0, RIGHT + 15, MIDDLE, shape_c); /* Info */ sprintf (buf, "line-width: %d", width); g_object_set (g_object_get_data (G_OBJECT (canvas), "width_info"), "text", buf, NULL); sprintf (buf, "arrow-tip-length: %d (* line-width)", shape_a); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_a_info"), "text", buf, NULL); sprintf (buf, "arrow-length: %d (* line-width)", shape_b); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_b_info"), "text", buf, NULL); sprintf (buf, "arrow-width: %d (* line-width)", shape_c); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_c_info"), "text", buf, NULL); /* Sample arrows */ g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_1"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_2"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_3"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); } static void create_drag_box (GtkWidget *canvas, GooCanvasItemModel *root, char *box_name) { GooCanvasItemModel *box; box = goo_canvas_rect_model_new (root, 0, 0, 10, 10, "fill_color", "black", "stroke_color", "black", "line_width", 1.0, NULL); g_object_set_data (G_OBJECT (canvas), box_name, box); } static void create_dimension (GtkWidget *canvas, GooCanvasItemModel *root, char *arrow_name, char *text_name, GtkAnchorType anchor) { GooCanvasItemModel *item; item = goo_canvas_polyline_model_new (root, FALSE, 0, "fill_color", "black", "start-arrow", TRUE, "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), arrow_name, item); item = goo_canvas_text_model_new (root, NULL, 0, 0, -1, anchor, "fill_color", "black", "font", "Sans 12", NULL); g_object_set_data (G_OBJECT (canvas), text_name, item); } static void create_info (GtkWidget *canvas, GooCanvasItemModel *root, char *info_name, double x, double y) { GooCanvasItemModel *item; item = goo_canvas_text_model_new (root, NULL, x, y, -1, GTK_ANCHOR_NW, "fill_color", "black", "font", "Sans 14", NULL); g_object_set_data (G_OBJECT (canvas), info_name, item); } static void create_sample_arrow (GtkWidget *canvas, GooCanvasItemModel *root, char *sample_name, double x1, double y1, double x2, double y2) { GooCanvasItemModel *item; item = goo_canvas_polyline_model_new_line (root, x1, y1, x2, y2, "start-arrow", TRUE, "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), sample_name, item); } static gboolean on_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); g_object_set (model, "fill_color", "red", NULL); return TRUE; } static gboolean on_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEvent *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (target); g_object_set (model, "fill_color", "black", NULL); return TRUE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GdkCursor *fleur; fleur = gdk_cursor_new (GDK_FLEUR); canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_grab (canvas, item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, fleur, event->time); gdk_cursor_unref (fleur); return TRUE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); return TRUE; } static gboolean on_motion (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvas *canvas = goo_canvas_item_get_canvas (item); GooCanvasItemModel *model = goo_canvas_item_get_model (target); int x, y, width, shape_a, shape_b, shape_c; gboolean change = FALSE; if (!(event->state & GDK_BUTTON1_MASK)) return FALSE; if (model == g_object_get_data (G_OBJECT (canvas), "width_drag_box")) { y = event->y; width = (MIDDLE - y) / 5; if (width < 0) return FALSE; g_object_set_data (G_OBJECT (canvas), "width", GINT_TO_POINTER (width)); set_arrow_shape (canvas); } else if (model == g_object_get_data (G_OBJECT (canvas), "shape_a_drag_box")) { x = event->x; width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); shape_a = (RIGHT - x) / 10 / width; if ((shape_a < 0) || (shape_a > 30)) return FALSE; g_object_set_data (G_OBJECT (canvas), "shape_a", GINT_TO_POINTER (shape_a)); set_arrow_shape (canvas); } else if (model == g_object_get_data (G_OBJECT (canvas), "shape_b_c_drag_box")) { width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); x = event->x; shape_b = (RIGHT - x) / 10 / width; if ((shape_b >= 0) && (shape_b <= 30)) { g_object_set_data (G_OBJECT (canvas), "shape_b", GINT_TO_POINTER (shape_b)); change = TRUE; } y = event->y; shape_c = (MIDDLE - y) * 2 / 10 / width; if (shape_c >= 0) { g_object_set_data (G_OBJECT (canvas), "shape_c", GINT_TO_POINTER (shape_c)); change = TRUE; } if (change) set_arrow_shape (canvas); } return TRUE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (GOO_IS_CANVAS_RECT_MODEL (model)) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (on_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (on_leave_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion), NULL); } } GtkWidget * create_canvas_arrowhead (void) { GtkWidget *vbox; GtkWidget *w; GtkWidget *frame; GtkWidget *canvas; GooCanvasItemModel *root, *item; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); w = gtk_label_new ("This demo allows you to edit arrowhead shapes. Drag the little boxes\n" "to change the shape of the line and its arrowhead. You can see the\n" "arrows at their normal scale on the right hand side of the window."); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), w, TRUE, TRUE, 0); gtk_widget_show (w); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (w), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); gtk_widget_set_size_request (canvas, 500, 350); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 500, 350); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); g_object_set_data (G_OBJECT (canvas), "width", GINT_TO_POINTER (DEFAULT_WIDTH)); g_object_set_data (G_OBJECT (canvas), "shape_a", GINT_TO_POINTER (DEFAULT_SHAPE_A)); g_object_set_data (G_OBJECT (canvas), "shape_b", GINT_TO_POINTER (DEFAULT_SHAPE_B)); g_object_set_data (G_OBJECT (canvas), "shape_c", GINT_TO_POINTER (DEFAULT_SHAPE_C)); /* Big arrow */ item = goo_canvas_polyline_model_new_line (root, LEFT, MIDDLE, RIGHT, MIDDLE, "stroke_color", "mediumseagreen", "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), "big_arrow", item); /* Arrow outline */ item = goo_canvas_polyline_model_new (root, TRUE, 0, "stroke_color", "black", "line-width", 2.0, "line-cap", CAIRO_LINE_CAP_ROUND, "line-join", CAIRO_LINE_JOIN_ROUND, NULL); g_object_set_data (G_OBJECT (canvas), "outline", item); /* Drag boxes */ create_drag_box (canvas, root, "width_drag_box"); create_drag_box (canvas, root, "shape_a_drag_box"); create_drag_box (canvas, root, "shape_b_c_drag_box"); /* Dimensions */ create_dimension (canvas, root, "width_arrow", "width_text", GTK_ANCHOR_E); create_dimension (canvas, root, "shape_a_arrow", "shape_a_text", GTK_ANCHOR_N); create_dimension (canvas, root, "shape_b_arrow", "shape_b_text", GTK_ANCHOR_N); create_dimension (canvas, root, "shape_c_arrow", "shape_c_text", GTK_ANCHOR_W); /* Info */ create_info (canvas, root, "width_info", LEFT, 260); create_info (canvas, root, "shape_a_info", LEFT, 280); create_info (canvas, root, "shape_b_info", LEFT, 300); create_info (canvas, root, "shape_c_info", LEFT, 320); /* Division line */ goo_canvas_polyline_model_new_line (root, RIGHT + 50, 0, RIGHT + 50, 1000, "fill_color", "black", "line-width", 2.0, NULL); /* Sample arrows */ create_sample_arrow (canvas, root, "sample_1", RIGHT + 100, 30, RIGHT + 100, MIDDLE - 30); create_sample_arrow (canvas, root, "sample_2", RIGHT + 70, MIDDLE, RIGHT + 130, MIDDLE); create_sample_arrow (canvas, root, "sample_3", RIGHT + 70, MIDDLE + 30, RIGHT + 130, MIDDLE + 120); /* Done! */ set_arrow_shape (GOO_CANVAS (canvas)); return vbox; } goocanvas-0.15/demo/flower.png0000644000076400007640000000146211172574677013324 00000000000000‰PNG  IHDRísO/gAMA† 1è–_éIDATxÚm“MhTwÅÿñ½ùR3/ãÌ›d"ãKÒÅ€‘D‘DcœJ‘Aƒ‹ nŠ´Ji]‰  Š+.DPA²(]tÓU»üè$ RFZDÖOìÄ’8yÉ8óòæ}L湈 ½ËË=ç\î=GÜ»4ÄgkÇy¯#ÕÅìoߊ¼¹›LøîgÇ$€‚/Ë:%æýßtM“üê;ëu–+t þ@(äÚ•‹ ÇŠûN†~…À²,ï»oŽ Ë~\× nÖÙýåW«j¥7%ýû”UóŽlÎ éØ‹±´HéM‰¶ö6ŒÒ Œé Œ¹'oÑí “Cµ,³Ó“„~â‰(0€¸záœg7€ZÝ&žP …Chûγ¼aÅçAJ3 ËJ7±CGé;0‚cV™¸“GŸ×Ñ´Õv¤´¶‰-ýC„Â!dÙÔ’¤Ñµ‡É‡L&KçÝD”‘V…ªÙ@ÓR$Ûâ´'T¾î. i8ùDÜ›Ùè_>Cö¯å‰1FGG©Tª´(*ý»v ‡¨›uŒj€Sƒ55ˆ½+Fš›™âô™3,.¾cjj5¡’ËQ­è$S]UƒÜX³nA–m©àËöÍQ7m*• ŠÒBgç&âñ8ÍFƒ›cw˜|ý3ëÂa4-µúÞ©·9Noa6ÓÞÒ; p r@FÆÉ„¤¯#™ n®hsº[@ñc˜ ¾,®×DÚ‚(«©»ï¨|YŽõŒ‹Ûåm Ç~€)ø²ô6Çx%%½ä¬nIEND®B`‚goocanvas-0.15/demo/mv-demo-paths.c0000644000076400007640000001075311172574677014150 00000000000000#include #include #include #include static GooCanvasItemModel *path1; static GooCanvasItemModel* create_canvas_model (void) { GooCanvasItemModel *root, *path; root = goo_canvas_group_model_new (NULL, NULL); /* Test the simple commands like moveto and lineto: MmZzLlHhVv. */ path1 = goo_canvas_path_model_new (root, "M 20 20 L 40 40", NULL); path = goo_canvas_path_model_new (root, "M30 20 l20, 20", NULL); path = goo_canvas_path_model_new (root, "M 60 20 H 80", NULL); path = goo_canvas_path_model_new (root, "M60 40 h20", NULL); path = goo_canvas_path_model_new (root, "M 100,20 V 40", NULL); path = goo_canvas_path_model_new (root, "M 120 20 v 20", NULL); path = goo_canvas_path_model_new (root, "M 140 20 h20 v20 h-20 z", NULL); path = goo_canvas_path_model_new (root, "M 180 20 h20 v20 h-20 z m 5,5 h10 v10 h-10 z", "fill-color", "red", "fill-rule", CAIRO_FILL_RULE_EVEN_ODD, NULL); path = goo_canvas_path_model_new (root, "M 220 20 L 260 20 L 240 40 z", "fill-color", "red", "stroke-color", "blue", "line-width", 3.0, NULL); /* Test the bezier curve commands: CcSsQqTt. */ path = goo_canvas_path_model_new (root, "M20,100 C20,50 100,50 100,100 S180,150 180,100", NULL); path = goo_canvas_path_model_new (root, "M220,100 c0,-50 80,-50 80,0 s80,50 80,0", NULL); path = goo_canvas_path_model_new (root, "M20,200 Q60,130 100,200 T180,200", NULL); path = goo_canvas_path_model_new (root, "M220,200 q40,-70 80,0 t80,0", NULL); /* Test the elliptical arc commands: Aa. */ path = goo_canvas_path_model_new (root, "M200,500 h-150 a150,150 0 1,0 150,-150 z", "fill-color", "red", "stroke-color", "blue", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M175,475 v-150 a150,150 0 0,0 -150,150 z", "fill-color", "yellow", "stroke-color", "blue", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M400,600 l 50,-25 " "a25,25 -30 0,1 50,-25 l 50,-25 " "a25,50 -30 0,1 50,-25 l 50,-25 " "a25,75 -30 0,1 50,-25 l 50,-25 " "a25,100 -30 0,1 50,-25 l 50,-25", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M 525,75 a100,50 0 0,0 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M 725,75 a100,50 0 0,1 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M 525,200 a100,50 0 1,0 100,50", "stroke-color", "red", "line-width", 5.0, NULL); path = goo_canvas_path_model_new (root, "M 725,200 a100,50 0 1,1 100,50", "stroke-color", "red", "line-width", 5.0, NULL); return root; } static void move_path_clicked (GtkWidget *button, GooCanvas *canvas) { static gint count = 0; gchar *data; if (count == 0) data = "M130,70 L317,70"; else if (count == 1) data = "M130,170 L317,170"; else data = "M130,270 L317,270"; g_object_set (path1, "data", data, NULL); count = (count + 1) % 3; } GtkWidget * create_paths_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; GooCanvasItemModel *root; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = create_canvas_model (); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); w = gtk_button_new_with_label ("Move Path"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_path_clicked), canvas); return vbox; } goocanvas-0.15/demo/Makefile.am0000644000076400007640000000503211222154617013331 00000000000000## Process this file with automake to produce Makefile.in INCLUDES = \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ @PACKAGE_CFLAGS@ # -DG_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED \ # -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED \ # -DGTK_DISABLE_DEPRECATED noinst_PROGRAMS = demo table-demo generic-position-demo simple-demo scalability-demo units-demo widgets-demo mv-demo mv-table-demo mv-generic-position-demo mv-simple-demo mv-scalability-demo demo_SOURCES = \ demo.c demo-fifteen.c demo-scalability.c demo-grabs.c \ demo-arrowhead.c demo-features.c demo-events.c \ demo-paths.c demo-focus.c demo-item.h demo-item.c demo-animation.c \ demo-clipping.c demo-table.c demo-large-line.h demo-large-line.c \ demo-large-items.c demo-large-rect.h demo-large-rect.c demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_demo_SOURCES = \ mv-demo.c mv-demo-fifteen.c mv-demo-scalability.c mv-demo-grabs.c \ mv-demo-arrowhead.c mv-demo-features.c mv-demo-events.c \ mv-demo-paths.c mv-demo-focus.c mv-demo-animation.c \ mv-demo-clipping.c mv-demo-table.c mv_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) table_demo_SOURCES = \ table-demo.c table_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_table_demo_SOURCES = \ mv-table-demo.c mv_table_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) simple_demo_SOURCES = \ simple-demo.c simple_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_simple_demo_SOURCES = \ mv-simple-demo.c mv_simple_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) scalability_demo_SOURCES = \ scalability-demo.c scalability_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_scalability_demo_SOURCES = \ mv-scalability-demo.c mv_scalability_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) units_demo_SOURCES = \ units-demo.c units_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) widgets_demo_SOURCES = \ widgets-demo.c widgets_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) generic_position_demo_SOURCES = \ generic-position-demo.c generic_position_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_generic_position_demo_SOURCES = \ mv-generic-position-demo.c mv_generic_position_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) EXTRA_DIST = flower.png toroid.png goocanvas-0.15/demo/toroid.png0000644000076400007640000004102511172574677013325 00000000000000‰PNG  IHDR€NèÜgAMA† 1è–_ IDATxÚì¼{°åÙUß÷Y{ÿç}Î}ßîÛ}»{¦gz^fô–’ñ2 ÀÈ@•ãØeBʱƒ‹ÂŽ$•„`W*6±qQeRñŠ$e„ ‰Œ4Òh4šg÷ôû¾ï=ïßï·÷^ùcÿúv+ÈPe —„rº~unß¾}Ï9¿½öZßïw}×þÂ=Éu¡yʼnáæ»Úú -äÐíðÌî“áƒã«áP\ïŒ}ó¹·&?¼ñ ½ÏŠÑjŠ‹Ÿr¹öYÿÛã=ÿ\«oάž5µzf­;à,AÝp—ç&ao¸§/ÂË®”Ð/{í/ÿû×ÃÝúúz·)–L,)†DÔI‰W§^f&Õn¶!oXÿŽä¯/}“¾©sJûi$u¨Ì…ÙóÉöåÈGDýöÃ?(ß·xO8‘g«ˆõBu˜º/Ú+ûÝ3w=$ç6î w·ZØ<ÅH??; Åx;Ù¾y‘«Wž“§_|ªúøÞ–>5ëUWR¯…*þë%¾öÀ˜¼6Ù0¯HNÉC麞M–Ù´ ]²‰A䢿i¶Ç/úOµï×oZùnygçnŸg™’)$Òz”pãqA«À…o:‹‹’Šz^N™îÀÉ3ž¥“J+SR«$‰BX✠!Ì¡Z¶“âÚ‹úòÍËá…íkæùý]e<Ôkã‘Ù.fº[~RzU…þÿð'ҥГ®Y'§- 9­]VÉi±žÞkÞ%¹d‰~:ÐÜ6›()Fl0ÈLÕ!ÍÕ·6Õ4*™ÄEO$ É$áúï‹N¯VÜ÷nKï´'óHb F·ŸJ¸þÇ+ßaää=^£¤rÄ `UÔx07P‰h8¯ÁŸ)åÄÈ|$:>R7RŒM1›0ŸMÅMÌöçž ÿÕ¥+î!hù wÔHK‹MsWþ}æþôM<`_¯+,KW -rO*ÔV"VUPIªRgÄU%k@Þ…¼¹;5uH2Eöÿ Õ›¯ä®o³zâÑ€u"™Ía牔ËTñèwZÖ/x”YH!5*™7:=)D¥TLĪj¨ EŒUÔ+åf#a6R&G0"£4am©qðkï+àâUÿᯕHþý¾œBBOúÉýöõÍÿLk½Õfà»jµ„´Î³Ç—€µ¨­D­R¥"$J’@¿Ñ“ÛanGnŒh   uŒ(·2®¬’Á]°ôâ+E‚¢©ÈÁó)Ï| äþ·&,ßãñN1 !ŒPŽv®t®²Ø…•$5 ň›€ŸA¨™•çAT‘¾‚ùŽŽÜ(o|E±ø–צ?yéª\!ܺ+©eui`9†'ŠŠ½¿X †”޹ÏÞÕy»<Üý.ä¯ ›vC/bš$©"v² ÆÔ¹ÉÄ£^Q*ÂBw‰³{x®|š¹<¨'Äà)…ëØTY~µA“€ŸA’€›Z.~ÔÓ[7œ|%T¥’ a¼ó…yûw½í.ÖVöf—U8WBYÀ|¤ø:-eqs#¸9”‰¢f3¨ ¡‘+½&΍ Š .ŠÖ‹ëƒ"&ÒDŦàPµYª(Tokã¯PP5@‚ˆ7:|>4]„ÞCà5@¤9ê& ן(Yý¾B7ÎyõÛ›º;Ù"”AÄ¡‰ ¨”*¼ƒ¢„ñw¡“Ã#÷‹v›*Z¡½¶ "¨ž\Jh§ÞÀÚ ,·³€/à¡uát ¯´,ËVX ÊÍÔ²rÿ ó‹ßu¿ù¾3+Öü·¿¯;/î†|íeÁH+;ÍÝ‹o³ß|ú'ô ' §Zm[!U0 $hOÌã VÈR$” t>ƒj> •¢ó :hË`]1:C²‚v£A 6x¬zŒõ¤VÉQÅä¥@ñ%…€äg`é9Õ¬”0FÏPí$ÜülÉÒ™„Á†a:„<RÚ<ñXãyÅ77™ëXÊQÀÔTÒIĤ˜ 4Ÿ ‰Uª*fƒ­›0ú+žNŽ´2¬¨¬ö«`ƒp°/„Ji[xìœ%—@`¥#ƒÕ}¬¨TîZ–¿óÈjxí+Õ¶rÏZÛ<ôâ®ÿÚ Ts÷â_–wÝó·ô­çqë-h$°(Æ!¢à]̼‰HÍ¡(,ØÒI‘™Aý1ò˜+¾ôd+’Y“ñÕL·Ig±…MbJÔULwæøënÔpúçsZK9‡— 2í¼É¥?(ðSX¾/¡ò®€NËpñ‰ŠýKއÞjHÚ%Ã#) 5æØ’ÄÔLÞUZ)„©pñY%(LÆ0 éš V±¢hP ¬t * ×·#`=»j8Ñ„~îÞÔ_(+ÖZøÁ™6ô×à,©‘ͯ% ºÒz}ãÙŸá/½ò»ü™vJ/ƒ†Ô:Äy£I;Ë¡,™NGÅ ¬äã‚G Ðha—2q£Tf ³Àl<¥³Ñ¡»ºÊáËÛ¾|D–Cžƒ `ç`4!ëÃÒÙ6³Ã ÕZˆý—×Í5èœV†û%yãë³+X\‡“÷ “O( O ™/ ;Jq¤d: èw¡ÛTò3–§>‹’ó0)V•Ü€/#8YìZúŒF–­GÃÀCkBUM~ö÷Œ±Tš@K` B˜+š(˹v¾6ÀÐþwš÷<öõu›÷„h'µlb"6Ó€Þ˜1¯fHžH J¨@Ôh,¨UçÑYÀ·…Π.K˜íî@éa.PxÆÕ4N54=ߢÜr¸aÀ¸È’ldñF&,®v&pt³$µ± íš%pëê-º]عî fÁh¤móY¸ mh§Š(rmÌ•µ¦pf ñ^Õ×µˆƒÔCfÀUÊt6 l´Ìƒš !1´ºoZnÛ2mfïÒ‘ûõ¹—mEýŸ_dfÕ¼úÜß“ÿàUï ÷­dÚo@#‰Ì(ÆyÌþ½4?AÝ™5Êå&t-’:‚ *âj“è ª€zU“Ê£SÇxTH¾ÜÒl½OiagÓSÕùt '³ið«ŠN4’$‰uÉŠ0h·¤ÝÈuë™}üÒ9m_öûhÒ…Þ˜î‰a÷9åà’²´),žR†{±r5º¢»/ÃÎ%…z0è¡‹‹°Ø‡^ š)ä‰gó´áâ³±²MÆ@P1=,¬Bo€£Z•¨/ÛQÍ3hˆ°¹á´ÙÆ#ÕÉLÛFË¡:§°´Ø 5¥lÍÑ4Àz;©¬Š4SC š:¯`¢J&B•]VJQõ6*—©¢D$®ýãgí{ûIræý×üOMƒ^üª€¬/~?§O~Gp É÷-¤^rãÿÜ>ô Û…¤!H¦xIš(¦.pÞG€ç+4T¨ñÐJ1ƒ:¯Ðy%̽2W´RÌ©ieÎ;ôY[À8‚ppËPõá0Œ7‘¼6Ö„ê0à&Q8H ëªÃ@5†7b`qS(¦J5¼ö.©†h¿ ‹kÐíCUŠîì)Z°§4ï…ÅvJ–´¡¬®¤ŒG%á#øLpF'³ VWÐdO¯ïL)Ê@ÓB'1PÅþEÐ^ÛOŠW´ôQš‹b@mÝ–ÎTé¶3ò ¹6”Vâùáæ[Œýçÿû÷£“À¥×°Òi=<ÐÎÀµa’Ö*í”pùPht”^M°™¢ $9ÌGȤB­Äö >DàW:(+NÕ¶ «(JÕI “…'X‹,eМ#XT=\VÌè!ø+ˆkŠzUR…þ£Ý³Š›(:ŽòƒI¡¹l(gŠ0¹ðSht¡µ$2Ù jœaÿF <ˆ•«¿ ýEa>‚á®rtfÃÈ ÂTX´Y=Õ#̯ÉÊúÒ‹ppgšÕ}Q!mvñL¹¹;ÃH-X¯„2ªzÞ#‰ zï‚å¥Ý€WQÕÈ**ê«ö%ØZ4µÄb€\[©2B½¦Ú÷¬…7íé?ú­­êoÌ•í—Äd‘’•0sñkL±Œj™C3‡¼Åø` i"ƒtv=BõDâ;Nn¡™ (ïÐQ@-fc - 8ÂTQW!Yy†v+äõYÈ%ÅìsT¥¹!ôÎ yO 3Eg‚T5KèF¦Pí+nW)Gu»bÝPLÑòP(ÅQDäÝ%è/ “ì^V·az˜FCÈ“ ßw–vs¤§NNùcFØß+YëóxP\åГƻ,,,L‘dO€€ÉSÔähYÀÄÇà æ +»ÚÃßÁÈÅ,pI±÷fø£)º"Ø!=/dS!Q¥Ù€¬!a{Iê4îþ¬#T#Å*n¥\›AÞÆÛžêüB½ý˜•ý­¨…R9%EO”O}ªâÑW¾Ì=›pb9ÌÆÊî®çDßDdªJ9ž ý&£ém¿(¢¯$€R” N9×É æEÜáDl€ NyÙNPð ˆ Db+…̃9R.È.Ùw?=2Ÿxjþå–sGzÿ3õ>cĤÉYV—¿•f3'Ï…,Ò\°‰ˆIDÓ\tqUÌêi!kÄO’ Y*dM‘VW¨ÆÂþHØÃÖÝ™ˆ©¼HÇ ê„Ñ\˜T¬æ•H'ixÑ›áÀ 3'¤"ÒK„ªm‘¾Jº¨’. Í…Tl*¢U™#Ì™#â‘$1)o¨ø  ! Ýe7U™l!Õñ%b ²´&’5D¶¯"Dº=dyÕˆ¯DÊ™Š€Èl†„¢”Sk^š©È“Ÿ 2ª¬÷œ[ùÈNœGZSY;yBÞÿ¡kâ=br¦%’)RÈdŽŒgÈd†x‡/’HoŽô‹xµçH³Dò I $©/3Gt†ØÁÇ÷eØ Ò˜©´½ÚåvòÈSýÔ$èå?;I¤Ù:#'¾Ûœ¿û;í`1‘……Óne©©iJA©q‹†(âP:B»ëwÃ|ÓÝ: €6{à–€ 4 ä-ð%¡˜Á1¶›Ú=œÂÜCÁì‰rbˆ^ÁXPæÈB ]SAsE-hRë±iL½õÇI¢œ\lGÙ2U­ƒ«ëâÿ1Dw‘ˆáÊóñÐj)UÍžçž ×^4ì^):(<õLàž3Î't[ÂŽÂK7<¯Û˜*‚°·=aïúÎE„_yØAZ÷I©Ì„aÝIg°ì ÑÓh<¸ú3ÙÅÓ$Äd›ÖϾSÄûP¤‚Ï"ÖH¦ÊciX{WÇþÍ_=tŸõ>ÿ2€HnN|¯yýkþG^õÈù³çÎû“'ϺյÅÐ[4Ú[‚Á*2XGºËHÞ l ÆÆ¼Ú`²6ªØ=IS$ï‚›B#…Nz¡ßEMt^!& Ó)ìÏ`æ¡ðHC°@¸6£ ÆÑç%« j& Ø,êPâZ¤™s˜ î„ h ª‰5 o(aë:uåj·“°C™¨˜h "±Qõëv”'-ó±a:X ,„éî=+^¾(l®¤<ó’§,…nèŠã3ϱ“„Ä)êb ¼t/ìA9†f mUüíT|œ‚¿Õÿ®D @Ôxƒ8©í–ÐAN&æÌ§—ö‚~îßÒï½Å¼òÁìW–OkšŒ‹+¦.æ¶äf2H[Ðè#i—Úï˜M¡Ù‰‹XA²&Æ4ñ±X¶B3vY$O¯H1F¯`T«‚F¡s­nˆ ÈP éa)nkkt\S"3ûwª«‘ PÖpÚIãôêðÏëœÐ4òqQ'/¼ðIý»ÕTZy“3h´­$ÒòôV¤ìo+eíñ£»øìiËÓ_ò%,¶…jnÙy¿goÔ%X…ùfláh =`ÑDÕzÑ+¥B)h•œ%¸ãSLHÍPlT¸êK1«ññB"J_5©Ä,~¦âñ*’ù?öÔúOúõÕoÅXù²Å{¡¾ê ¨õ…É!i!šGŸG*`È»HÖ_`²”´Ý#„It\f©` ìàp‹‘ pu¶'0/A ÒOÂV‰ŒÙ–«ú¸ºÊ i¬ ¶;dß ×-Å'Í ÿZ£ø/ë¡I¤4Ka&êíÎèEù­OûÿüàùðËn"×ij•̇×ùÝë_Ô¿wx=¼|ÀÇ Æ4ÛæQrQ0b0(F…vÓÓïgìn)ÞE)úèHY]HØÝ !AèfÂÖ~äú½Äru/DÔN$?ÓYô4Ú)žjL÷®ª™ …Áz‹h‚b‰Í”%EH0äXXLíÅÀ`±Ø`À¬¨œ3l¾¨b^ úÁÛ–ì;ËÿɵŸÐW>ø5kZ½¨è5ºÐhǶ[–ÇÞh£y3~5 iÄç,ƒ$EÄCK¡×ÀtZˆ¡2bse­ýgu*»H""óáñ?‚ÃèdÑb>úìõs×ìƒ:°VÎ70ýúøáEý˜¯Ãã4å!óˆü]s{’“%sœnéKáÏ”/†ßõúY<Å1’MXP LRܶYýI‡úßOrºÓ7ok¶õ‚5JšB«-핹°yÆÜSL9}´ë2#‘mt²¸$‡žD`©™°µçSËî¡?\,SI? qÇ» :sXu«©Un©7Ÿ­ÖÔÏ)–B³ƒŒ€e®9К^´àiËÁ2?~Mù­/"F'Å“¢Ù–.œ9!­>Úì@ÚŒu]Rp)xkkâ¡åжö®ÊZMsdR•ˆMY\;Áð0°dÐZãº:$UÜá˜ðôKàçÐO¡È1­¶óÏMÿºÙÈþ†·É÷èN°Æ'CÿŒþœ…ÇeªO…Oé{ÃgYvIHÄáµd Ïì+˜çÇž~™¿î+Xî¾Â¿Us½r0÷ÿâàËØØ„^³6º=ypiÙ~ïÒ¢¾¾‘éÊh® ãƒA”‘C%òù½©?vö™P'Ïœ‹LRÁ`+•F¥˜€DÏD}ëŒE°uy ƒG€œÊÏàÅQÉ ™³î,S©8xücWü¿züoKCF]çIRƒÿÜö¿dì^ÐC÷q;f__,þ©NÕ¯Õéµd2™†§õñÝð­ýÍí=~ßÓÏsÖ¬Ð4±3-‘u*¨c"¶Jf°V –]rFäLH™R’ТŊôèÒÄ×hÈ­ý÷ÜXRšJ‚à X¬&,ˆk~œpý&ü¡%Ií½þû°zâAŒ´æ!ÄH áÿËEb±ª|Ôñ‹ 3L±¤ÝFå–]7a:*X§d”§Œ¡Šm·Åä·>ü¸ÿГ[¦ÕËf1{§šfêGáKÿ e8Âq¤‡þc:Û_/ó«ªT!0+*¹ºs~ç`$Ÿ-*³SyB+— QLÛ‘ôI%tÆÐ †QHØ×œ‚„S§pƒÃÒ¥É&6èÓ"EñÑ[£­—Yê HIÈÈŽ‹H‚Ôÿ®—ÿ?ª¿˜fóœö{÷RÍëjàjO~a©õu×Á×*KÓ¼—H@«:04´ŸïaL+ÑÒ çNp?+œ¥CK xRpŒ™%S<C…¡¨ƒ Ä’ÓÀS¢€’3ÐéBYI´˜¿lŽžfÐ{¯u·ÁßîÜY‹HŠÖÒ/Zã€y=1žÄ¯Û±*}t2E®îÃÙ,~#¨1Oæp·Ç̇H9½ÃÀ"‚ù ùÐ[ŸÐNÃG§|d¯i>xß’ýù>þ<¡vÎ×bŽ:œç4÷Ê:gµO”Ô²OÀaˆ[Ò‘“˜RQ2¯¹‚E(ëKÉPÚÜylÁ ´LWæ6Aµ 7¶ìŸyOH;BÖ¤{ùI$¨Ob‹7Iã/¨f‘°Î¦0ÚL³µ‰fË itüìåEÔú(Kœ÷ó[¦7‡ÉV^ÞþÂ×ã©_ÇÞLÿgvØ}hÁþ˶øUDZ´Øä4ägu‘žft°ä˜è´' ¸z.Т…K àqK…¥ÄÖ Yûì#YlÑ4m쉄$]‘ÞÊ·SµÛ’d u!mD5ðö…ÄDÚæöa|[ËçÐîyn짆&²¿‡fZ=Œ K¤Â^:D?ú‘úÏ^þç߈‹s‚ú½B?ô¹=ù+÷çæX£ußiÎp¿ÜÅ9]¡«9-,†–IÈR‹º’à«Úœ°rr¡ "¥¼78,=Dµˆ”³Ž±=I6Y?ó3ººùƒê¼a2Œz¹tãî7½ø,¦žÁª¥ ztÓ ¤ë0xìbÝ .믌°µ‹4r¨2 è,G« ߘ>qóÓZèßài%Ÿ™…ÅϽBºï=Å€))N ÒKÕÈ1™¥˜4DõŽH˜`¸gO äõ÷ )9 Û 2 IDATG$™±Mš‰a{!‘“§~*XÓÀ•à˸£M ‹Q¥VÔõµv'x‡½ŒŽ¢*¸xÚ܈æuÇ= Ùº‰ú÷Ñp*z²M…Ÿ¶0ç~ä§eöÏÂá³ÿó7jH0'_gîþ'oÔ o?VHhSa™HB‚Á“’«a:-F3rÓ€¼7£Ô„‰‚àè’6–)‹d ê.Ad·È ’«²$éB"ÁÏ:Q•¨Š˜Ú;.R;iDÍR¢Tªº})Át]|èÄÝ_wºÄW°û4açY$í<ŒbÁQW0m¬vÍêƒ?ÌáÅ÷EnYíB˜~ƒ,üÂ2ý7?$gÿÚÛÂCï\eAh‘“’i<+­÷k‚`UH<äÖÒ_X y×Xéãwö(¿ô³ñtŽ×ŠŠŠ@…Ô B$”3¦4‘º™H4°l2|ŒõÞ»EEô–Ë¡,¢åë–Û‚ô˜ÊlLîÅïwï‡t)Ö|*ЍG®†°ûy°wCþ0ª­H1C¦­›ö¡ÿ »ðýïÓ¤›èüéÏêøÓ?‹[Á(àq·^Àth¾úQsÏñ:}ð›Oéò`@‹ IÝà‘º«w« Tk (…wìïîbö0‰!1&ÙÈHP„Fþ• OA ñ”¤Øú7ǵLÔØD¯^þ¯m«¹é+‰¯©HYlêcÜü”s° Ð:Çd5:_PA†— ;Ÿ߄ޛQY7sþ2¿ ÕKàÀOîoHëî×iâ‘îC¯?¼¤ÓÏýÿ8Ì .zNãì½OÈÊ›^É}?zAϬ¯é2!ÜïcªŽJ@=/ ‘xB-áÆ+%ÅÕç‡x¤þ;x<Ž’Š‚’1S–Qlý: J„!ê ?žÿÒÙ»ü/…¥•7`“ïâ(Z;%5˜â°-f‰|ÉVÑ`ë±oAª)ºódwj¼ µ'cÒho‘r=|©vÐêØ»ëSæ¨mÓìuúÅ Õ˜.ôßnÆOÅ´ñuµô¶AãôÙøñWË#ï9«§Ö–ôúÚ2999 )‚ÅÔ•ÙÔ>­;~Cˆr¯úZ®¸ÿêñzÆ6 8‡Ç¨pTÌ)˜1#¥ Q÷c6ÃÙ ž¦æØ:'(‚¯U€R¨B©uDðÜ7½®åÓÇ`šýoÕçF%É ®¨Ç¶kpW•0Þ®õ€fôú:3¨Dx5m!É&Ò,u…b¯öH Šë†‚f¨_Á—“ø h_ ‹×Ç7°´Ih‘²i²¾Õ¤S©Ë}?ù󎕾iuQ—¤§MiÔ²ËíôêÅwuZ_ðb%öõ^“àŽÝ«¦„áø'=OY͙ޓ!ä$tX &39­ÈHÉ´½CÕqoQkü¯<'Ó«Û¡x!©ã½Á≿BÒX¾½@î¶®6žß:á–9dvõÈbTCýÖµ0¤®¬u‚:`<µ¡?ÉÀœŒ¾ç0„ÚåfȲÚüx«ræµ2%!ÆGL]+U,ŠÅ‰è€†ô—rî={rúMéÖº>z®Çæ ©MAf8ÆïzÉþèûgÕ{å?÷˜¼ûÛÃÉ,õ¡|´½W½h?õ=O„¼o[/ÿ“”lðJyëß ßûÎ3á®d>9YMå"ÏDÈRKž ꮘ¢¡n²ÕKZs…M1â³O¥3RM1žªnã(Ž@‰£D™s,M0•„-½AÉœœ@VÛDÒc·p,á)† ôjROO4è­¼5‘xª€«µ€<¾´8­Q"@×ô6ýó_ªEž<î~êVr "…&ª·ìPõ1š*1È¢üÌ)`¿v¹ÅÅ75N–Ú{+,)YÒ$‹:0I”AQ™2áy&úyrmÈÝò=]ÝÈHë[a4ÇɘàÍý§äÕ¿~Z-ÐwšÚ“xã\d"IÈÏÒ{z]ξ÷$÷òZý¶ÁIÎÐ"#'#¿C¸IÛ¬=ܦyÚR] l}n—ñxDzÜðŒaà uPV•̤œhlRå£ÙM˜OÉI(T(q¾£ÄGe” B“œ¶ælÈnêÛlž6q’8Ã@å¦uü‘ßûWÆImcQñ¾ *wìêŠ!´jëŠs¨D©8$1ÃxƒñžPë~A½ÃCH¡n!³P/¸Ff Ð["RZ«=ÐüFÆ·ní-¬Ì± .±–~¯ËB»Éè`Âl2%hÁ\.2æ Dg¬ð*œ£©½º>ÞªŽÊÄ\ã¢~˜9GœÓojÝË·´Z´ï`ä€ò7©—3xÇÁþÃÑEFþ)ÆîIZ,sJ¾“®n’ÕAÄñBÅXpÄ‹ü.C½Ìpžo£Iï}Ûz7W2ä‹ú!ÆÑg… ¼‰ÜKBV´/wâË7 ÃÃ7þHi\SÌšg4,u˜í5(GsŠù3ÕZÑÓ;ø¼¯3‚g¦Êt8戜¾iÒb‰9‡tê»rˆ2gNEY½˜ÝFZ¤ Èh’‘УbJÅœ?6ׯü±ßù­©ò1 ÐùäÓrtã÷Xºû¯ªÖ;¼"å,“iÛ±-¸!*¬$¸[H_oëÖêu­$Õ=ÄžCÝç£>ìûzXlø0­waCÇ^k#5&Œ8ô—(ü3$–xŒµÆäz‚P¸c¤}«æZ„ Wù(úÎpŽ·ÓbpL¸äŽI™—äÙ ×II8Ë#œä,Y-Çêñn¿sçûš†ö®—T×'‰§@%(,§ÛhÑj4hhÓoô™íMíì#e ¨Ë«…Ü€gŽ2eÆ4LТKO‚cÊ@:TZÖ,b^†€­ƒ`LB—”N]wì,ün¸øÏÆø/|…éàPèþå_”Öò»Èû§Pêí@¶ŽšØø¸1&Td‰Å—¡nÿúhçÓ óÚ^g€6Á>ò¥8Ãp¡‡aC†¡]/Â0Ns„Ç×£PI]ýbUHIXäa6g¹ÿ® &û ®½<©å9KÁSrMþon†OÒf•{x}ÎÕþì©…œmóy^ˆA8Áœãµu ¸šOƒÇÖÕøn*c†ìs}½ÎˆCæŒQõ$$X„l–Òœe4i0¸ÑeÉô8Ù_caiþQ‡ÑlŸ‘ð”T8<Šg LÓ£É2`O·éJ«}fL9dÎŒy]bqmÖùu,³ù‡õ…_{RwI£óÆÃ]qQ.ÿ«üœŠmà¦0¹í{‹I„baŠº9yšbÚ ³£)ž[6ðøC°qáƒÔ—Aå4È è•z·ú­v²;F“zßNªú9`iÑ!ç4Xgc°ÉæÉ;7 v¶ê±ñh†mDz/Oq#|”Œ§y =ÎÕÌÕ>mƒRÉ„çõ™3a™MNË#tt¹Fì‘fšúÅ ›0a‡—Ùâ»\§dNFJ‹ :´iÑ$''­‹™2£âJØâæÁ6-2ÖíK2`Qi²Öu;PQðÌfL™2eY»,É2»ºÌY¡Ã!; õ†ŒŽæ¸9Jñ7ötò‰-}覎?îÐÃ?å|€P…áõ_6ÅoÕþÉo!8˜\‚ù![F’^ þ ÔMÀWœ:9à†ŒøÙ%Ð)TÛÀ…Èó@€ØGcëŸY—M †&ЦZÚã÷Yt¹Ç¤–Ñ"3Mfá‹Ï!SxrÇÀ„˜”#ù§{‚œÄŽ’(-ÕôE­>š³¾½öÚß÷­µAõŒITÔ£]g;Äáþ“}ÙáÎà"áø%3Çd·žÛªuXÍÉ x¬=È_R*¶¨°Íáh hšªßA™£L µ±± $”UN\efUj#‹J£­I:EÂw‚¯9'Å'8m?ƒÌJ¢š‚FÎA2àwô+X8lð›<…k\÷Ù¢±BbSRpÈ6wy“1;”äxtèÑc‰%z,×mZ²+mmaK¬4¢¬¥[­kj'aʈBÆÜb‹.+ti­5{ì“@BLDLNŸŽè눱,Ã竇½2¿‘äÿ»èÝGÄ”ùeIí³Z Ð.¢q1;DÇAÔ¡R§è.õ¹p¾AgL¶¾GU&µG@\Ú† ÂôP“>º Õu›zföiiV"Çza÷ÀÎSŽ„¹qÈæ –K"±…ÃJ¯AîÞá­É—Iô>kâi>Üý v¾DVÆTæu-,l\b¹Á×Ù¡Ïi.ÈßdMwy‹[hÀ§Å+¬²É*,‹UÖ½ ÚVO5PHÊ*¯]×°„…‹K›&=:øx@E@DÈÉ’h!¨˜2%&aFFÊŒ” A—;r|³ºú…„òÞ{=Ô5­æÉºÊJáö>IU8Âê!¬:ºgÜ=XëdÅ*çÎzlnøÜ¿ñ"i41‡£õúYÔsbHCånc$¹I‹…I³ó¬2½­ó×üؤ‡Ü|_,:ä66¶]1,¯q-øWb}À æCÝß¡­NLcJ¦F€Qx–O)§\«žeÀ-šô9¯žá’ÿq²¬U+CLy¢‰«\ª;Üå*‡X(|ÚôXc… NÈ Î¶79Ñ]¥È4ñ,dšO˜–S=aª"]‡7"$%&%¡¤D!iѤK)3&L©Èé ‡1c†LˆMÁ7cFJŠ‹¢-<û-îßÙeôâ{•2Õt.çÓ«BW}Ñhýº.´À?ˆ j{-2y¥|.^ôÙ¾õãƒmsyO8[Kµ8– E\9@ ÁÁÔx®ˆ— ýØûøSÊX˜Äl#q(™2ª®°_¾@Θ'9kšç,ãqDÎ M†Dá ›^_q#y‘=} ÅøpïU› ›P#¾ßaXmq¯úBH |:,±Â:kö:OlžÆ*Ãñ”0›0%&$6MÍ1!ѱÏ3J2l¬Eá(ЄDää´°€’!“’™R±¢ECÎdâ^Ѿ\ÕlÛOÐzF|] ×QA_]"žeä:4«YãIŸþ’ÇÛ“Ëì”ß§¢¢Ç).5ža³y†ýј” Pàá³¾ÔeÂ7gWÁwñéÐg…“œîžâC7F»ƒ!A5"d@Șˆ‰ ~h‚?%2ßGL 0fBÀ”œ Ÿ6m,”GŒÅH Ë7¹µ;cæg¤r®ýƒ¶%—_Õ·¾Q?=j”¤áw(ã‰ÕoHg½A ª¼¦‹Õ:¥î2™„\f6¹I™ŒIÔ6jÀÜ 4ï¯÷r…ÄC™Ž·ºÈ~ Q-ó ×n…‹B>ì×HÙ4>k¬ð4mCWš\‡”ÌTØ4p¥Ãnvƒ­â5r|z¬‹'8ç=M0™逊6.kþ2‰˜p+¼NȰ¶UãâÓ¥ÏINú'¸ôø{böCBDŒ‰™2%gfhÞÂp Å‚ÈM‰™1ejÀ0%$$ 'Em|,$) /Ë·_ÿ/ýê^p„ú†VNfUTz_Ž\­îÿ}Q¯À÷UB¼D²ÿ†€KÂZÚÔ¥qp3Ë…OœX­)“kF 6‚ËF‹Ñ–GìEÅŠ.ÏBÖÈÀö±1  ‰¦ä€”‡Ì¸Gɺ½j%ž¤ËE©s,\|Fúvª×Éáà³ÌYNŠbÓrHF€…¢+úä"ã~| h “ø{¬²aŸäìê;÷Âcv ˜ßµiš¯OŸ%–Ì¿mšxX(4%!&Œ™0aB@H„Bâ‹.‘ˆy]\¿þ¦~ç¯Cf¯î1þR(¢­yº+ÆÞÐ÷þvDüÒ{­~œûJòàÙjð{¢ýÔßkõw5ZR܇ø%ðÛä¥@ŠÇAn@õA_jªy&8RôŽfZÉí«è!ˆ"˜/NÊHÀÒKÆ„”¢ ©HP¦žnsžçH™P ¨° ÏpŸÞ6Aöi±Ê2qi–$ Q€Ç2)‡Ùm"µŸ—&-–é²FÇ^f{/f˜ï2å€Ô§E‹UVéÉMíÓÐÆÆ|ÒOeøÃ”˜€=¶Øf‹-¶Øa›3<ìÓfÄ!gô&§X¦«—8+7W¨FA”»zòwû„_DcUTS³Oò>f€ã;B~@6zQçc(ÿ B Ê ÖõÕQÆßÅŒ1’o·ÀbŽFvÅH•b†:4ŒÈ5­‘󶦄Š)š #´û©P¸ôhr†§Q4(˜S§òšDj‘2`Ä R€Æ£GŸs,s’”˜C49-–PØŒÙ&dŸ’ …¢G“=ÖéÊ>EžrXn1à -Úœàgü3|äÂyVídb#«ÂjáT8Xx8´ðéÓceú´Ðäl³Ã¡0&"6ˤA!3ïyý½/¥»Gs)t¦Ñ3ŽÝHúÁ@C²ÁP%Vû#éQŒ¢b )û5\˜Z€áº€½8ï«ÅVP0T†õ«yê¢0E03}° ÚôÄלË2-6ñ9Â"gLΒĤý&)Bn3ãÐØxô8à !‘DìÒ¤ƒGÀ”æÔP§þ6]Vé°ŒÖ%{ÜgÀ›œå¢û$O?Ëé‹=&û3ÊÒŒ"]¸Ž?‹êiætir[Þ=«ÿûãÛì}½ÕùL§ëYQÒ°õ­êµŒ™ýÔcs~2ÔZoB¾ ÊøPþÇ¢G•dM¡Ö!» :5Vº ö Ò4Åß|ÚUµh‰Ì]=屟åHsæŸóÂpõJrpèà±NƒeŠ‚ Êc+?gBÄC2Æh l«‹Yz±¥Õ,‡-,š~ƒ^¯IÃr¹@hÀ8>àµ.lk·ßDL¸,¾óõ[úÞWªy]%¤×Lž~K¿ORït†Îv©&/RÜùùÍ¡+ŸÖn=gpÄ|<¦æHÌÊ—‹U/é??¶ê«cÅ"Æ"jcá™â°fζLaW „mŽ¡QÓs&«´Ù0,Û}$1©)ë×­•.-–pp˜r”¬°†oì–•á(Žx ‰k½%.=³Êéßjâ㦔ùÑøÇÅÜ8cwó틽â9ñÚÓÃï¾ÛjûqªüŸ!á RôäUŠëWÐÉ!ϬK<©«pñ֌К#_n‚ÁñLP›‚7/!51ÌØ£ 6[BË¤ÔˆŠ„ŠÔôÕI,x´i±†¦l69 ¹á)êê¢aØy ›#,MÚÔ“ƒkoïÑ”>i^GâHE¯ÛÂõ%·BvoÌ¢™Ùãsrj'Of¸üÜ|=#➸=zŽo}!bzëgÑ»üÿýÆYäé?êÉ?¥§tY+€µP˜©–,N`±ŒM ×¼•Gõ‚8 3rnjVv­è)c=Ó|µa„ä&-V±ñÉÌqÏ2ü:‹ŒƒÑ-†ÂññÉ™¢(iàa™Vîšž²±Ì‘®nʰÍ× WÚõ_¯j=£$%©ìVƒ.*,c\‹C¾Áå¸\½ðç9ùàÇ^FzˆÎï qî4þÇÑîI´Ûœ[ª…YsõÞ]·„Y‹ Ê…wþˆÆt Ìûæíù ¥ùÊ Ÿ,RÐ̦.ql×upñiÒÁÁ1ÙEã`›MÁ2Á¯ƒn›Ÿ9XÆõ#ñ» '!!`,wË7xå­;úÆ›#ö¯Oôd+fz7¯Ý3•€žDØ%Õ­ŒlW×wˆòK€Gz)}pÏwZŸ¬~üupš[ lKàESX´°i€X48Ï·iVëQe}|fæ¼óÖ¡G‡‡¦&·Žqó)Ü6M\Z¸¦ˆ”بZj^À2YÅY¡&z@“‘“PŠDÅöôe._þnõí¿H™Ý®¹ú=†Gÿ²à]škQ' ñQðNKÚOIÖ“tOIÚí–¢!¥aŽ£„éÆ9bXÆysµÂÁ¥e `‡”ĦˆTÆq4·œÔ¦M,¹Ñê´îÌݦÿÏ1™ÅÆ6¯]wùä"$Ãwx뛯Ußýüˆñ·5åÏÝŒÁÏ݇°œ·²´IDAT@6ë‹ÞìžÀ»¨Xú´Åò36«[´úІ¥Kµ XçgîºÚ·pp±P$$ì (MÈ{†z÷nàâ9¡±hãÐÀ6¿a›5?ßû-*R—‡Üìsw3Žqðö¡Þ{i¤Ÿ˜Þ+ߣ4û+üÈô'=÷k+ŸµYû—µXtÜy 3v,s|S”"Î#}ÿfÊÐuX:ï` ‡&¶Ñ³–mäzÆî”Œ1 ×xy]€šU¬“½¤"Ay«¯?o?»UÝúÚŒé÷5åìgµÿ’à‡ÂÕ”4?fÓûŒÃÚï9t6,Z]…%$*­D2œé­W§ÜûbNxE¢ÖZlþY›3ŸkÐ[uð…ezz•°µÐe‘ˆÃÛn¿žë íqêSVÏ4h)W4ð„ÂÒˆ2ωö§bp¸§ï¼¶§ïþË”Á‹%ed.I~—·Uÿ ì‡êKœÓ’ƪaÔ’Št¿$½;ïç7Äuèüv‹“Ú »fÓôlá®gŒ¿è­Ÿ²ÿ|IrS#¤ƒ÷”G÷£6M…Ýwp…ºH¿•èàfJü°¤Ø{4还ÿ ’JåøÐíIEND®B`‚goocanvas-0.15/demo/demo-events.c0000644000076400007640000001235211172574677013712 00000000000000#include #include #include #include static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { char *item_id = NULL; if (target) item_id = g_object_get_data (G_OBJECT (target), "id"); if (item_id) g_print ("%s item received 'motion-notify' signal\n", item_id); return FALSE; } static void setup_item_signals (GooCanvasItem *item) { g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); } static void create_events_area (GtkWidget *canvas, gint area_num, GooCanvasPointerEvents pointer_events, gchar *label) { gint row = area_num / 3, col = area_num % 3; gdouble x = col * 200, y = row * 150; GooCanvasItem *root, *rect; char *view_id; GooCanvasLineDash *dash; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); dash = goo_canvas_line_dash_new (2, 5.0, 5.0); /* Create invisible item. */ rect = goo_canvas_rect_new (root, x + 45, y + 35, 30, 30, "fill-color", "red", "visibility", GOO_CANVAS_ITEM_INVISIBLE, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s invisible", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); /* Display a thin rect around it to indicate it is there. */ #if 1 rect = goo_canvas_rect_new (root, x + 42.5, y + 32.5, 36, 36, "line-dash", dash, "line-width", 1.0, "stroke-color", "gray", NULL); #endif /* Create unpainted item. */ rect = goo_canvas_rect_new (root, x + 85, y + 35, 30, 30, "stroke-pattern", NULL, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s unpainted", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); /* Display a thin rect around it to indicate it is there. */ #if 1 rect = goo_canvas_rect_new (root, x + 82.5, y + 32.5, 36, 36, "line-dash", dash, "line-width", 1.0, "stroke-color", "gray", NULL); #endif /* Create stroked item. */ rect = goo_canvas_rect_new (root, x + 125, y + 35, 30, 30, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s stroked", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); /* Create filled item. */ rect = goo_canvas_rect_new (root, x + 60, y + 75, 30, 30, "fill-color", "red", "stroke-pattern", NULL, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s filled", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); /* Create stroked & filled item. */ rect = goo_canvas_rect_new (root, x + 100, y + 75, 30, 30, "fill-color", "red", "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s stroked & filled", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); goo_canvas_text_new (root, label, x + 100, y + 130, -1, GTK_ANCHOR_CENTER, "font", "Sans 12", "fill-color", "blue", NULL); goo_canvas_line_dash_unref (dash); } GtkWidget * create_events_page (void) { GtkWidget *vbox, *alignment, *frame, *label, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); /* Instructions */ label = gtk_label_new ("Move the mouse over the items to check they receive the right motion events.\nThe first 2 items in each group are 1) invisible and 2) visible but unpainted."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Frame and canvas */ alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 600, 450); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); create_events_area (canvas, 0, GOO_CANVAS_EVENTS_NONE, "none"); create_events_area (canvas, 1, GOO_CANVAS_EVENTS_VISIBLE_PAINTED, "visible-painted"); create_events_area (canvas, 2, GOO_CANVAS_EVENTS_VISIBLE_FILL, "visible-fill"); create_events_area (canvas, 3, GOO_CANVAS_EVENTS_VISIBLE_STROKE, "visible-stroke"); create_events_area (canvas, 4, GOO_CANVAS_EVENTS_VISIBLE, "visible"); create_events_area (canvas, 5, GOO_CANVAS_EVENTS_PAINTED, "painted"); create_events_area (canvas, 6, GOO_CANVAS_EVENTS_FILL, "fill"); create_events_area (canvas, 7, GOO_CANVAS_EVENTS_STROKE, "stroke"); create_events_area (canvas, 8, GOO_CANVAS_EVENTS_ALL, "all"); return vbox; } goocanvas-0.15/demo/mv-generic-position-demo.c0000644000076400007640000002066611172574677016313 00000000000000#include #include typedef enum { MODE_MOVE, MODE_RESIZE } Mode; Mode drag_mode; GooCanvasItem *drag_item = NULL; gdouble drag_x = 0.0; gdouble drag_y = 0.0; gdouble item_x = 0.0; gdouble item_y = 0.0; gdouble item_width = 0.0; gdouble item_height = 0.0; static gboolean on_button_press_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); if (event->state & GDK_CONTROL_MASK) { if (event->button == 1 || event->button == 3) { if (event->button == 1) drag_mode = MODE_MOVE; else drag_mode = MODE_RESIZE; drag_item = item; drag_x = event->x; drag_y = event->y; g_object_get (G_OBJECT (model), "x", &item_x, "y", &item_y, "width", &item_width, "height", &item_height, NULL); goo_canvas_pointer_grab (GOO_CANVAS (user_data), item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, NULL, event->time); return TRUE; } } return FALSE; } static gboolean on_button_release_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) { if (drag_item == item && drag_item != NULL) { goo_canvas_pointer_ungrab (GOO_CANVAS (user_data), drag_item, event->time); drag_item = NULL; return TRUE; } return FALSE; } static gboolean on_motion_notify_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventMotion *event, gpointer user_data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); if (drag_item == item && drag_item != NULL) { gdouble rel_x = event->x - drag_x; gdouble rel_y = event->y - drag_y; if (drag_mode == MODE_MOVE) { g_object_set (G_OBJECT (model), "x", item_x + rel_x, "y", item_y + rel_y, NULL); } else { gdouble new_width = MAX (item_width + rel_x, 5.0); gdouble new_height = MAX (item_height + rel_y, 5.0); g_object_set (G_OBJECT (model), "width", new_width, "height", new_height, NULL); } return TRUE; } return FALSE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (g_object_get_data (G_OBJECT (model), "setup-dnd-signals")) { g_signal_connect (G_OBJECT (item), "button-press-event", G_CALLBACK (on_button_press_event_cb), canvas); g_signal_connect (G_OBJECT (item), "button-release-event", G_CALLBACK (on_button_release_event_cb), canvas); /* g_signal_connect (G_OBJECT (item), "grab-broken-event", G_CALLBACK (on_button_release_event_cb), canvas);*/ g_signal_connect (G_OBJECT (item), "motion-notify-event", G_CALLBACK (on_motion_notify_event_cb), canvas); } } static GooCanvasItemModel* create_model (GdkPixbuf *pixbuf) { GooCanvasItemModel *root; GooCanvasItemModel *item; GooCanvasItemModel* child; root = goo_canvas_group_model_new (NULL, NULL); /* Test clipping of GooCanvasGroup: We put the rectangle and the ellipse into * a group with width=200 and height=200. */ item = goo_canvas_group_model_new (root, "x", 50.0, "y", 350.0, "width", 200.0, "height", 200.0, NULL); /*goo_canvas_item_model_rotate(item, 45.0, 150.0, 450.0);*/ child = goo_canvas_rect_model_new (item, 0.0, 0.0, 100, 100, "fill-color", "blue", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_rotate(child, 45.0, 50.0, 50.0); child = goo_canvas_ellipse_model_new (item, 150, 00, 50, 50, "fill-color", "red", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); item = goo_canvas_polyline_model_new (root, FALSE, 5.0, 250.0, 350.0, 275.0, 400.0, 300.0, 350.0, 325.0, 400.0, 350.0, 350.0, "stroke-color", "cyan", "line-width", 5.0, NULL); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); item = goo_canvas_path_model_new (root, "M20,500 C20,450 100,450 100,500", "stroke-color", "green", "line-width", 5.0, NULL); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); item = goo_canvas_image_model_new (root, pixbuf, 150, 450, /*"fill-color", "yellow", */NULL); g_object_unref (pixbuf); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); item = goo_canvas_text_model_new (root, "Hello, World!", 250, 450, -1, GTK_ANCHOR_NW, "fill-color", "magenta", "wrap", PANGO_WRAP_WORD_CHAR, NULL); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); item = goo_canvas_table_model_new (root, "horz-grid-line-width", 2.0, "vert-grid-line-width", 2.0, "row-spacing", 2.0, "column-spacing", 2.0, NULL); goo_canvas_item_model_translate (item, 10.0, 10.0); g_object_set_data (G_OBJECT (item), "setup-dnd-signals", "TRUE"); child = goo_canvas_rect_model_new (item, 10.0, 10.0, 50.0, 50.0, "fill-color", "blue", "x", 10.0, "y", 25.0, NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_set_child_properties (item, child, "column", 0, "row", 0, "columns", 1, "rows", 1, NULL); /*goo_canvas_item_model_translate (child, 10.0, 10.0);*/ child = goo_canvas_rect_model_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_set_child_properties (item, child, "column", 1, "row", 0, "columns", 1, "rows", 1, NULL); child = goo_canvas_rect_model_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "green", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_set_child_properties(item, child, "column", 0, "row", 1, "columns", 1, "rows", 1, NULL); child = goo_canvas_rect_model_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "yellow", NULL); g_object_set_data (G_OBJECT (child), "setup-dnd-signals", "TRUE"); goo_canvas_item_model_set_child_properties (item, child, "column", 1, "row", 1, "columns", 1, "rows", 1, NULL); return root; } static GtkWidget* create_window (GooCanvasItemModel *model) { GtkWidget *window, *vbox, *label, *scrolled_win, *canvas; /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("Use Ctrl+Left Click to move items or Ctrl+Right Click to resize items"); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Create top canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "integer-layout", TRUE, NULL); /* gtk_widget_set_size_request (canvas, 600, 250);*/ goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), model); return window; } int main (int argc, char *argv[]) { GtkWidget *window; GooCanvasItemModel *model; GdkPixbuf *pixbuf; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); pixbuf = gtk_widget_render_icon (window, GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG, NULL); model = create_model (pixbuf); /* Create 2 windows to show off multiple views. */ window = create_window (model); #if 1 window = create_window (model); #endif g_object_unref (model); gtk_main (); return 0; } goocanvas-0.15/demo/demo-large-line.h0000644000076400007640000000327611172574677014437 00000000000000/* * GooCanvas Demo. Copyright (C) 2007 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-large-line.h - a demo item that exceeds the cairo 16-bit size limit. * Note that it doesn't support miters. */ #ifndef __GOO_DEMO_LARGE_LINE_H__ #define __GOO_DEMO_LARGE_LINE_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS #define GOO_TYPE_DEMO_LARGE_LINE (goo_demo_large_line_get_type ()) #define GOO_DEMO_LARGE_LINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_DEMO_LARGE_LINE, GooDemoLargeLine)) #define GOO_DEMO_LARGE_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_DEMO_LARGE_LINE, GooDemoLargeLineClass)) #define GOO_IS_DEMO_LARGE_LINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_DEMO_LARGE_LINE)) #define GOO_IS_DEMO_LARGE_LINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_DEMO_LARGE_LINE)) #define GOO_DEMO_LARGE_LINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_DEMO_LARGE_LINE, GooDemoLargeLineClass)) typedef struct _GooDemoLargeLine GooDemoLargeLine; typedef struct _GooDemoLargeLineClass GooDemoLargeLineClass; struct _GooDemoLargeLine { GooCanvasItemSimple parent_object; gdouble x1, y1, x2, y2; }; struct _GooDemoLargeLineClass { GooCanvasItemSimpleClass parent_class; }; GType goo_demo_large_line_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_demo_large_line_new (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); G_END_DECLS #endif /* __GOO_DEMO_LARGE_LINE_H__ */ goocanvas-0.15/demo/mv-table-demo.c0000644000076400007640000002073011172574677014114 00000000000000#include #include static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } static GooCanvasItemModel* create_item (GooCanvasItemModel *table, gdouble width, gdouble height, gint row, gint column, gint rows, gint columns, gboolean x_expand, gboolean x_shrink, gboolean x_fill, gboolean y_expand, gboolean y_shrink, gboolean y_fill) { GooCanvasItemModel *model; model = goo_canvas_rect_model_new (table, 0, 0, width, height, "fill-color", "red", NULL); goo_canvas_item_model_set_child_properties (table, model, "row", row, "column", column, "rows", rows, "columns", columns, "x-expand", x_expand, "x-fill", x_fill, "x-shrink", x_shrink, "y-expand", y_expand, "y-fill", y_fill, "y-shrink", y_shrink, NULL); return model; } void create_table1 (GtkWidget *canvas, GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gboolean with_grid_lines) { GooCanvasItemModel *table, *items[9]; GooCanvasItem *item; GooCanvasBounds bounds; gint i = 0; table = goo_canvas_table_model_new (parent, "width", width, "height", height, NULL); goo_canvas_item_model_translate (table, x, y); if (with_grid_lines) { g_object_set (G_OBJECT (table), "row-spacing", 2.0, "column-spacing", 2.0, "x-border-spacing", 1.0, "y-border-spacing", 1.0, "horz-grid-line-width", 1.0, "vert-grid-line-width", 2.0, NULL); } items[i++] = create_item (table, 17.3, 12.9, 0, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 33.1, 17.2, 1, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 41.6, 23.9, 2, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 7.1, 5.7, 0, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 13.5, 18.2, 1, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 25.2, 22.1, 2, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 11.3, 11.7, 0, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 21.7, 18.8, 1, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 22.2, 13.8, 2, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); for (i = 0; i < 9; i++) { item = goo_canvas_get_item (GOO_CANVAS (canvas), items[i]); goo_canvas_item_get_bounds (item, &bounds); g_print ("Item %i: %g,%g - %g,%g\n", i, bounds.x1 - x, bounds.y1 - y, bounds.x2 - x, bounds.y2 - y); } } /* Creates a table with items spanning multiple cells */ void create_table2 (GtkWidget *canvas, GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gboolean with_grid_lines) { GooCanvasItemModel *table, *items[9]; GooCanvasItem *item; GooCanvasBounds bounds; gint i = 0; table = goo_canvas_table_model_new (parent, "width", width, "height", height, NULL); goo_canvas_item_model_translate (table, x, y); if (with_grid_lines) { g_object_set (G_OBJECT (table), "row-spacing", 2.0, "column-spacing", 2.0, "x-border-spacing", 1.0, "y-border-spacing", 1.0, "horz-grid-line-width", 1.0, "vert-grid-line-width", 2.0, NULL); } items[i++] = create_item (table, 17.3, 12.9, 0, 0, 2, 2, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 33.1, 17.2, 0, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 41.6, 23.9, 1, 2, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 7.1, 5.7, 0, 3, 2, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 13.5, 18.2, 2, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 25.2, 22.1, 2, 1, 1, 3, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 11.3, 11.7, 3, 0, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 21.7, 18.8, 3, 1, 1, 1, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); items[i++] = create_item (table, 22.2, 13.8, 3, 2, 1, 2, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); for (i = 0; i < 9; i++) { item = goo_canvas_get_item (GOO_CANVAS (canvas), items[i]); goo_canvas_item_get_bounds (item, &bounds); g_print ("Item %i: %g,%g - %g,%g\n", i, bounds.x1 - x, bounds.y1 - y, bounds.x2 - x, bounds.y2 - y); } } void setup_canvas (GtkWidget *canvas) { GooCanvasItemModel *root; root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_print ("\nTable at default size...\n"); create_table1 (canvas, root, 50, 50, -1, -1, FALSE); g_print ("\nTable at reduced size...\n"); create_table1 (canvas, root, 250, 50, 30, 30, FALSE); g_print ("\nTable at enlarged size...\n"); create_table1 (canvas, root, 450, 50, 100, 100, FALSE); g_print ("\nTable with grid lines at default size...\n"); create_table1 (canvas, root, 50, 250, -1, -1, TRUE); g_print ("\nTable with grid lines at reduced size...\n"); create_table1 (canvas, root, 250, 250, 30, 30, TRUE); g_print ("\nTable with grid lines at enlarged size...\n"); create_table1 (canvas, root, 450, 250, 150, 150, TRUE); g_print ("Multispanning table with grid lines at default size...\n"); create_table2 (canvas, root, 50, 450, -1, -1, TRUE); g_print ("Multispanning table with grid lines at reduced size...\n"); create_table2 (canvas, root, 250, 450, 30, 30, TRUE); g_print ("Multispanning table with grid lines at enlarged size...\n"); create_table2 (canvas, root, 450, 450, 150, 150, TRUE); } int main (int argc, char *argv[]) { GtkWidget *window, *vbox, *label, *scrolled_win, *canvas; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("Normal Layout"); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create top canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, FALSE, FALSE, 0); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 250); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_print ("\n\nNormal Canvas...\n"); setup_canvas (canvas); label = gtk_label_new ("Integer Layout"); gtk_widget_show (label); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create bottom canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, FALSE, FALSE, 0); canvas = goo_canvas_new (); g_object_set (canvas, "integer-layout", TRUE, NULL); gtk_widget_set_size_request (canvas, 600, 250); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_print ("\n\nInteger Layout Canvas...\n"); setup_canvas (canvas); gtk_main (); return 0; } goocanvas-0.15/demo/demo-grabs.c0000644000076400007640000002620711172574677013510 00000000000000#include #include #include #include static gboolean on_widget_expose (GtkWidget *widget, GdkEventExpose *event, char *item_id) { g_print ("%s received 'expose' signal\n", item_id); gtk_paint_box (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_IN, &event->area, widget, NULL, 0, 0, widget->allocation.width, widget->allocation.height); return FALSE; } static gboolean on_widget_enter_notify (GtkWidget *widget, GdkEventCrossing *event, char *item_id) { g_print ("%s received 'enter-notify' signal\n", item_id); return TRUE; } static gboolean on_widget_leave_notify (GtkWidget *widget, GdkEventCrossing *event, char *item_id) { g_print ("%s received 'leave-notify' signal\n", item_id); return TRUE; } static gboolean on_widget_motion_notify (GtkWidget *widget, GdkEventMotion *event, char *item_id) { g_print ("%s received 'motion-notify' signal (window: %p)\n", item_id, event->window); if (event->is_hint) gdk_window_get_pointer (event->window, NULL, NULL, NULL); return TRUE; } static gboolean on_widget_button_press (GtkWidget *widget, GdkEventButton *event, char *item_id) { g_print ("%s received 'button-press' signal\n", item_id); if (strstr (item_id, "explicit")) { GdkGrabStatus status; GdkEventMask mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; status = gdk_pointer_grab (widget->window, FALSE, mask, FALSE, NULL, event->time); if (status == GDK_GRAB_SUCCESS) g_print ("grabbed pointer\n"); else g_print ("pointer grab failed\n"); } return TRUE; } static gboolean on_widget_button_release (GtkWidget *widget, GdkEventButton *event, char *item_id) { g_print ("%s received 'button-release' signal\n", item_id); if (strstr (item_id, "explicit")) { GdkDisplay *display; display = gtk_widget_get_display (widget); gdk_display_pointer_ungrab (display, event->time); g_print ("released pointer grab\n"); } return TRUE; } static gboolean on_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'enter-notify' signal\n", item_id); return FALSE; } static gboolean on_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'leave-notify' signal\n", item_id); return FALSE; } static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'motion-notify' signal\n", item_id); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'button-press' signal\n", item_id); if (strstr (item_id, "explicit")) { GooCanvas *canvas; GdkGrabStatus status; GdkEventMask mask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; canvas = goo_canvas_item_get_canvas (item); status = goo_canvas_pointer_grab (canvas, item, mask, NULL, event->time); if (status == GDK_GRAB_SUCCESS) g_print ("grabbed pointer\n"); else g_print ("pointer grab failed\n"); } return FALSE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { char *item_id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'button-release' signal\n", item_id); if (strstr (item_id, "explicit")) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); g_print ("released pointer grab\n"); } return FALSE; } static void create_fixed (GtkTable *table, gint row, gchar *text, gchar *id) { GtkWidget *label, *fixed, *drawing_area; char *view_id; label = gtk_label_new (text); gtk_table_attach (table, label, 0, 1, row, row + 1, 0, 0, 0, 0); gtk_widget_show (label); fixed = gtk_fixed_new (); gtk_fixed_set_has_window (GTK_FIXED (fixed), TRUE); gtk_widget_set_events (fixed, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (fixed, 200, 100); gtk_table_attach (GTK_TABLE (table), fixed, 1, 2, row, row + 1, 0, 0, 0, 0); gtk_widget_show (fixed); view_id = g_strdup_printf ("%s-background", id); g_signal_connect (fixed, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (fixed, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (fixed, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (fixed, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (fixed, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (fixed, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); drawing_area = gtk_drawing_area_new (); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (drawing_area, 60, 60); gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 20, 20); gtk_widget_show (drawing_area); view_id = g_strdup_printf ("%s-left", id); g_signal_connect (drawing_area, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (drawing_area, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (drawing_area, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (drawing_area, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (drawing_area, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (drawing_area, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); drawing_area = gtk_drawing_area_new (); gtk_widget_set_events (drawing_area, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK); gtk_widget_set_size_request (drawing_area, 60, 60); gtk_fixed_put (GTK_FIXED (fixed), drawing_area, 120, 20); gtk_widget_show (drawing_area); view_id = g_strdup_printf ("%s-right", id); g_signal_connect (drawing_area, "expose_event", G_CALLBACK (on_widget_expose), view_id); g_signal_connect (drawing_area, "enter_notify_event", G_CALLBACK (on_widget_enter_notify), view_id); g_signal_connect (drawing_area, "leave_notify_event", G_CALLBACK (on_widget_leave_notify), view_id); g_signal_connect (drawing_area, "motion_notify_event", G_CALLBACK (on_widget_motion_notify), view_id); g_signal_connect (drawing_area, "button_press_event", G_CALLBACK (on_widget_button_press), view_id); g_signal_connect (drawing_area, "button_release_event", G_CALLBACK (on_widget_button_release), view_id); } static void setup_item_signals (GooCanvasItem *item) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (on_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (on_leave_notify), NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); } static void create_canvas (GtkTable *table, gint row, gchar *text, gchar *id) { GtkWidget *label, *canvas; GooCanvasItem *root, *rect; char *view_id; label = gtk_label_new (text); gtk_table_attach (table, label, 0, 1, row, row + 1, 0, 0, 0, 0); gtk_widget_show (label); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 200, 100); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 200, 100); gtk_table_attach (table, canvas, 1, 2, row, row + 1, 0, 0, 0, 0); gtk_widget_show (canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); rect = goo_canvas_rect_new (root, 0, 0, 200, 100, "stroke-pattern", NULL, "fill-color", "yellow", NULL); view_id = g_strdup_printf ("%s-yellow", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); rect = goo_canvas_rect_new (root, 20, 20, 60, 60, "stroke-pattern", NULL, "fill-color", "blue", NULL); view_id = g_strdup_printf ("%s-blue", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); rect = goo_canvas_rect_new (root, 120, 20, 60, 60, "stroke-pattern", NULL, "fill-color", "red", NULL); view_id = g_strdup_printf ("%s-red", id); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); setup_item_signals (rect); } GtkWidget * create_grabs_page (void) { GtkWidget *table, *label; table = gtk_table_new (5, 2, FALSE); gtk_container_set_border_width (GTK_CONTAINER (table), 12); gtk_table_set_row_spacings (GTK_TABLE (table), 12); gtk_table_set_col_spacings (GTK_TABLE (table), 12); gtk_widget_show (table); label = gtk_label_new ("Move the mouse over the widgets and canvas items on the right to see what events they receive.\nClick buttons to start explicit or implicit pointer grabs and see what events they receive now.\n(They should all receive the same events.)"); gtk_table_attach (GTK_TABLE (table), label, 0, 2, 0, 1, 0, 0, 0, 0); gtk_widget_show (label); /* Drawing area with explicit grabs. */ create_fixed (GTK_TABLE (table), 1, "Widget with Explicit Grabs:", "widget-explicit"); /* Drawing area with implicit grabs. */ create_fixed (GTK_TABLE (table), 2, "Widget with Implicit Grabs:", "widget-implicit"); /* Canvas with explicit grabs. */ create_canvas (GTK_TABLE (table), 3, "Canvas with Explicit Grabs:", "canvas-explicit"); /* Canvas with implicit grabs. */ create_canvas (GTK_TABLE (table), 4, "Canvas with Implicit Grabs:", "canvas-implicit"); return table; } goocanvas-0.15/demo/mv-demo-focus.c0000644000076400007640000001221111172574677014137 00000000000000#include #include #include #include static gboolean on_focus_in (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); gchar *id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received focus-in event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (model, "stroke-color", "black", NULL); return FALSE; } static gboolean on_focus_out (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); gchar *id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received focus-out event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (model, "stroke-pattern", NULL, NULL); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); gchar *id = g_object_get_data (G_OBJECT (model), "id"); GooCanvas *canvas; g_print ("%s received button-press event\n", id ? id : "unknown"); canvas = goo_canvas_item_get_canvas (item); goo_canvas_grab_focus (canvas, item); return TRUE; } static gboolean on_key_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); gchar *id = g_object_get_data (G_OBJECT (model), "id"); g_print ("%s received key-press event\n", id ? id : "unknown"); return FALSE; } static void on_item_created (GooCanvas *view, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (GOO_IS_CANVAS_RECT_MODEL (model)) { g_object_set (model, "can-focus", TRUE, NULL); g_signal_connect (item, "focus_in_event", G_CALLBACK (on_focus_in), NULL); g_signal_connect (item, "focus_out_event", G_CALLBACK (on_focus_out), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "key_press_event", G_CALLBACK (on_key_press), NULL); } } static void create_focus_box (GtkWidget *canvas, gdouble x, gdouble y, gdouble width, gdouble height, gchar *color) { GooCanvasItemModel *root, *item; root = goo_canvas_get_root_item_model (GOO_CANVAS (canvas)); item = goo_canvas_rect_model_new (root, x, y, width, height, "stroke-pattern", NULL, "fill-color", color, "line-width", 5.0, "can-focus", TRUE, NULL); g_object_set_data (G_OBJECT (item), "id", color); } static void setup_canvas (GtkWidget *canvas) { GooCanvasItemModel *root; root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); create_focus_box (canvas, 110, 80, 50, 30, "red"); create_focus_box (canvas, 300, 160, 50, 30, "orange"); create_focus_box (canvas, 500, 50, 50, 30, "yellow"); create_focus_box (canvas, 70, 400, 50, 30, "blue"); create_focus_box (canvas, 130, 200, 50, 30, "magenta"); create_focus_box (canvas, 200, 160, 50, 30, "green"); create_focus_box (canvas, 450, 450, 50, 30, "cyan"); create_focus_box (canvas, 300, 350, 50, 30, "grey"); create_focus_box (canvas, 900, 900, 50, 30, "gold"); create_focus_box (canvas, 800, 150, 50, 30, "thistle"); create_focus_box (canvas, 600, 800, 50, 30, "azure"); create_focus_box (canvas, 700, 250, 50, 30, "moccasin"); create_focus_box (canvas, 500, 100, 50, 30, "cornsilk"); create_focus_box (canvas, 200, 750, 50, 30, "plum"); create_focus_box (canvas, 400, 800, 50, 30, "orchid"); } GtkWidget * create_focus_page (void) { GtkWidget *vbox, *label, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); label = gtk_label_new ("Use Tab, Shift+Tab or the arrow keys to move the keyboard focus between the canvas items."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); setup_canvas (canvas); return vbox; } goocanvas-0.15/demo/demo-arrowhead.c0000644000076400007640000003277511172574677014375 00000000000000#include #include #include #include #define LEFT 50.0 #define RIGHT 350.0 #define MIDDLE 150.0 #define DEFAULT_WIDTH 2 #define DEFAULT_SHAPE_A 4 #define DEFAULT_SHAPE_B 5 #define DEFAULT_SHAPE_C 4 static void set_dimension (GooCanvas *canvas, char *arrow_name, char *text_name, double x1, double y1, double x2, double y2, double tx, double ty, int dim) { GooCanvasPoints *points; char buf[100]; points = goo_canvas_points_new (2); points->coords[0] = x1; points->coords[1] = y1; points->coords[2] = x2; points->coords[3] = y2; g_object_set (g_object_get_data (G_OBJECT (canvas), arrow_name), "points", points, NULL); sprintf (buf, "%d", dim); g_object_set (g_object_get_data (G_OBJECT (canvas), text_name), "text", buf, "x", tx, "y", ty, NULL); goo_canvas_points_unref (points); } static void move_drag_box (GooCanvasItem *item, double x, double y) { g_object_set (item, "x", x - 5.0, "y", y - 5.0, NULL); } static void set_arrow_shape (GooCanvas *canvas) { int width; int shape_a, shape_b, shape_c; GooCanvasPoints *points; char buf[100]; width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); shape_a = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_a")); shape_b = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_b")); shape_c = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "shape_c")); /* Big arrow */ g_object_set (g_object_get_data (G_OBJECT (canvas), "big_arrow"), "line-width", 10.0 * width, "arrow-tip-length", (double) (shape_a), "arrow-length", (double) (shape_b), "arrow-width", (double) (shape_c), NULL); /* Outline */ points = goo_canvas_points_new (5); points->coords[0] = RIGHT - 10 * shape_a * width; points->coords[1] = MIDDLE - 10 * width / 2; points->coords[2] = RIGHT - 10 * shape_b * width; points->coords[3] = MIDDLE - 10 * (shape_c * width / 2.0); points->coords[4] = RIGHT; points->coords[5] = MIDDLE; points->coords[6] = points->coords[2]; points->coords[7] = MIDDLE + 10 * (shape_c * width / 2.0); points->coords[8] = points->coords[0]; points->coords[9] = MIDDLE + 10 * width / 2; g_object_set (g_object_get_data (G_OBJECT (canvas), "outline"), "points", points, NULL); goo_canvas_points_unref (points); /* Drag boxes */ move_drag_box (g_object_get_data (G_OBJECT (canvas), "width_drag_box"), LEFT, MIDDLE - 10 * width / 2.0); move_drag_box (g_object_get_data (G_OBJECT (canvas), "shape_a_drag_box"), RIGHT - 10 * shape_a * width, MIDDLE); move_drag_box (g_object_get_data (G_OBJECT (canvas), "shape_b_c_drag_box"), RIGHT - 10 * shape_b * width, MIDDLE - 10 * (shape_c * width / 2.0)); /* Dimensions */ set_dimension (canvas, "width_arrow", "width_text", LEFT - 10, MIDDLE - 10 * width / 2.0, LEFT - 10, MIDDLE + 10 * width / 2.0, LEFT - 15, MIDDLE, width); set_dimension (canvas, "shape_a_arrow", "shape_a_text", RIGHT - 10 * shape_a * width, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 10, RIGHT - 10 * shape_a * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 15, shape_a); set_dimension (canvas, "shape_b_arrow", "shape_b_text", RIGHT - 10 * shape_b * width, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT, MIDDLE + 10 * (shape_c * width / 2.0) + 35, RIGHT - 10 * shape_b * width / 2.0, MIDDLE + 10 * (shape_c * width / 2.0) + 40, shape_b); set_dimension (canvas, "shape_c_arrow", "shape_c_text", RIGHT + 10, MIDDLE - 10 * shape_c * width / 2.0, RIGHT + 10, MIDDLE + 10 * shape_c * width / 2.0, RIGHT + 15, MIDDLE, shape_c); /* Info */ sprintf (buf, "line-width: %d", width); g_object_set (g_object_get_data (G_OBJECT (canvas), "width_info"), "text", buf, NULL); sprintf (buf, "arrow-tip-length: %d (* line-width)", shape_a); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_a_info"), "text", buf, NULL); sprintf (buf, "arrow-length: %d (* line-width)", shape_b); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_b_info"), "text", buf, NULL); sprintf (buf, "arrow-width: %d (* line-width)", shape_c); g_object_set (g_object_get_data (G_OBJECT (canvas), "shape_c_info"), "text", buf, NULL); /* Sample arrows */ g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_1"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_2"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); g_object_set (g_object_get_data (G_OBJECT (canvas), "sample_3"), "line-width", (double) width, "arrow-tip-length", (double) shape_a, "arrow-length", (double) shape_b, "arrow-width", (double) shape_c, NULL); } static void create_dimension (GtkWidget *canvas, GooCanvasItem *root, char *arrow_name, char *text_name, GtkAnchorType anchor) { GooCanvasItem *item; item = goo_canvas_polyline_new (root, FALSE, 0, "fill_color", "black", "start-arrow", TRUE, "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), arrow_name, item); item = goo_canvas_text_new (root, NULL, 0, 0, -1, anchor, "fill_color", "black", "font", "Sans 12", NULL); g_object_set_data (G_OBJECT (canvas), text_name, item); } static void create_info (GtkWidget *canvas, GooCanvasItem *root, char *info_name, double x, double y) { GooCanvasItem *item; item = goo_canvas_text_new (root, NULL, x, y, -1, GTK_ANCHOR_NW, "fill_color", "black", "font", "Sans 14", NULL); g_object_set_data (G_OBJECT (canvas), info_name, item); } static void create_sample_arrow (GtkWidget *canvas, GooCanvasItem *root, char *sample_name, double x1, double y1, double x2, double y2) { GooCanvasItem *item; item = goo_canvas_polyline_new_line (root, x1, y1, x2, y2, "start-arrow", TRUE, "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), sample_name, item); } static gboolean on_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { g_object_set (item, "fill_color", "red", NULL); return TRUE; } static gboolean on_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEvent *event, gpointer data) { g_object_set (item, "fill_color", "black", NULL); return TRUE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GdkCursor *fleur; fleur = gdk_cursor_new (GDK_FLEUR); canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_grab (canvas, item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, fleur, event->time); gdk_cursor_unref (fleur); return TRUE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); return TRUE; } static gboolean on_motion (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvas *canvas = goo_canvas_item_get_canvas (item); int x, y, width, shape_a, shape_b, shape_c; gboolean change = FALSE; if (!(event->state & GDK_BUTTON1_MASK)) return FALSE; if (item == g_object_get_data (G_OBJECT (canvas), "width_drag_box")) { y = event->y; width = (MIDDLE - y) / 5; if (width < 0) return FALSE; g_object_set_data (G_OBJECT (canvas), "width", GINT_TO_POINTER (width)); set_arrow_shape (canvas); } else if (item == g_object_get_data (G_OBJECT (canvas), "shape_a_drag_box")) { x = event->x; width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); shape_a = (RIGHT - x) / 10 / width; if ((shape_a < 0) || (shape_a > 30)) return FALSE; g_object_set_data (G_OBJECT (canvas), "shape_a", GINT_TO_POINTER (shape_a)); set_arrow_shape (canvas); } else if (item == g_object_get_data (G_OBJECT (canvas), "shape_b_c_drag_box")) { width = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (canvas), "width")); x = event->x; shape_b = (RIGHT - x) / 10 / width; if ((shape_b >= 0) && (shape_b <= 30)) { g_object_set_data (G_OBJECT (canvas), "shape_b", GINT_TO_POINTER (shape_b)); change = TRUE; } y = event->y; shape_c = (MIDDLE - y) * 2 / 10 / width; if (shape_c >= 0) { g_object_set_data (G_OBJECT (canvas), "shape_c", GINT_TO_POINTER (shape_c)); change = TRUE; } if (change) set_arrow_shape (canvas); } return TRUE; } static void create_drag_box (GtkWidget *canvas, GooCanvasItem *root, char *box_name) { GooCanvasItem *item; item = goo_canvas_rect_new (root, 0, 0, 10, 10, "fill_color", "black", "stroke_color", "black", "line_width", 1.0, NULL); g_object_set_data (G_OBJECT (canvas), box_name, item); g_signal_connect (item, "enter_notify_event", G_CALLBACK (on_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (on_leave_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion), NULL); } GtkWidget * create_canvas_arrowhead (void) { GtkWidget *vbox; GtkWidget *w; GtkWidget *frame; GtkWidget *canvas; GooCanvasItem *root, *item; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); w = gtk_label_new ("This demo allows you to edit arrowhead shapes. Drag the little boxes\n" "to change the shape of the line and its arrowhead. You can see the\n" "arrows at their normal scale on the right hand side of the window."); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), w, TRUE, TRUE, 0); gtk_widget_show (w); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (w), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); gtk_widget_set_size_request (canvas, 500, 350); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 500, 350); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); g_object_set_data (G_OBJECT (canvas), "width", GINT_TO_POINTER (DEFAULT_WIDTH)); g_object_set_data (G_OBJECT (canvas), "shape_a", GINT_TO_POINTER (DEFAULT_SHAPE_A)); g_object_set_data (G_OBJECT (canvas), "shape_b", GINT_TO_POINTER (DEFAULT_SHAPE_B)); g_object_set_data (G_OBJECT (canvas), "shape_c", GINT_TO_POINTER (DEFAULT_SHAPE_C)); /* Big arrow */ item = goo_canvas_polyline_new_line (root, LEFT, MIDDLE, RIGHT, MIDDLE, "stroke_color", "mediumseagreen", "end-arrow", TRUE, NULL); g_object_set_data (G_OBJECT (canvas), "big_arrow", item); /* Arrow outline */ item = goo_canvas_polyline_new (root, TRUE, 0, "stroke_color", "black", "line-width", 2.0, "line-cap", CAIRO_LINE_CAP_ROUND, "line-join", CAIRO_LINE_JOIN_ROUND, NULL); g_object_set_data (G_OBJECT (canvas), "outline", item); /* Drag boxes */ create_drag_box (canvas, root, "width_drag_box"); create_drag_box (canvas, root, "shape_a_drag_box"); create_drag_box (canvas, root, "shape_b_c_drag_box"); /* Dimensions */ create_dimension (canvas, root, "width_arrow", "width_text", GTK_ANCHOR_E); create_dimension (canvas, root, "shape_a_arrow", "shape_a_text", GTK_ANCHOR_N); create_dimension (canvas, root, "shape_b_arrow", "shape_b_text", GTK_ANCHOR_N); create_dimension (canvas, root, "shape_c_arrow", "shape_c_text", GTK_ANCHOR_W); /* Info */ create_info (canvas, root, "width_info", LEFT, 260); create_info (canvas, root, "shape_a_info", LEFT, 280); create_info (canvas, root, "shape_b_info", LEFT, 300); create_info (canvas, root, "shape_c_info", LEFT, 320); /* Division line */ goo_canvas_polyline_new_line (root, RIGHT + 50, 0, RIGHT + 50, 1000, "fill_color", "black", "line-width", 2.0, NULL); /* Sample arrows */ create_sample_arrow (canvas, root, "sample_1", RIGHT + 100, 30, RIGHT + 100, MIDDLE - 30); create_sample_arrow (canvas, root, "sample_2", RIGHT + 70, MIDDLE, RIGHT + 130, MIDDLE); create_sample_arrow (canvas, root, "sample_3", RIGHT + 70, MIDDLE + 30, RIGHT + 130, MIDDLE + 120); /* Done! */ set_arrow_shape (GOO_CANVAS (canvas)); return vbox; } goocanvas-0.15/demo/units-demo.c0000644000076400007640000001157511222136351013531 00000000000000#include #include cairo_pattern_t *flower_pattern; gdouble flower_width, flower_height; static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { gchar *id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s item received 'motion-notify' signal\n", id ? id : "Unknown"); return FALSE; } static void setup_canvas (GtkWidget *canvas, GtkUnit units, gchar *units_name) { GooCanvasItem *root, *item; gchar buffer[256], font_desc[64]; double *d; double data[4][12] = { /* Pixels */ { 100, 100, 200, 20, 10, 200, 310, 24, 310, 100, 20, 20 }, /* Points */ { 100, 100, 200, 20, 10, 200, 310, 24, 310, 100, 20, 20 }, /* Inches */ { 1, 1, 3, 0.5, 0.16, 3, 4, 0.3, 4.2, 1, 0.5, 0.5 }, /* MM */ { 30, 30, 100, 10, 5, 80, 60, 10, 135, 30, 10, 10 } }; d = data[units]; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); item = goo_canvas_rect_new (root, d[0], d[1], d[2], d[3], NULL); g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); sprintf (buffer, "This box is %gx%g %s", d[2], d[3], units_name); sprintf (font_desc, "Sans %gpx", d[4]); item = goo_canvas_text_new (root, buffer, d[0] + d[2] / 2, d[1] + d[3] / 2, -1, GTK_ANCHOR_CENTER, "font", font_desc, NULL); sprintf (buffer, "This font is %g %s high", d[7], units_name); sprintf (font_desc, "Sans %gpx", d[7]); item = goo_canvas_text_new (root, buffer, d[5], d[6], -1, GTK_ANCHOR_CENTER, "font", font_desc, NULL); item = goo_canvas_image_new (root, NULL, d[8], d[9], "pattern", flower_pattern, "width", d[10], "height", d[11], "scale-to-fit", TRUE, NULL); } static void zoom_changed (GtkAdjustment *adj, GooCanvas *canvas) { goo_canvas_set_scale (canvas, adj->value); } GtkWidget * create_canvas (GtkUnit units, gchar *units_name) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; GtkAdjustment *adj; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); canvas = goo_canvas_new (); w = gtk_label_new ("Zoom:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 100.00, 0.05, 0.50, 0.50)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); gtk_widget_show (scrolled_win); /* Create the canvas. */ gtk_widget_set_size_request (canvas, 600, 450); setup_canvas (canvas, units, units_name); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); g_object_set (canvas, "units", units, "anchor", GTK_ANCHOR_CENTER, NULL); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); return vbox; } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } int main (int argc, char *argv[]) { GtkWidget *window, *notebook; cairo_surface_t *surface; gtk_set_locale (); gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); notebook = gtk_notebook_new (); gtk_widget_show (notebook); gtk_container_add (GTK_CONTAINER (window), notebook); surface = cairo_image_surface_create_from_png ("flower.png"); flower_width = cairo_image_surface_get_width (surface); flower_height = cairo_image_surface_get_height (surface); flower_pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas (GTK_UNIT_PIXEL, "pixels"), gtk_label_new ("Pixels")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas (GTK_UNIT_POINTS, "points"), gtk_label_new ("Points")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas (GTK_UNIT_INCH, "inches"), gtk_label_new ("Inches")); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas (GTK_UNIT_MM, "millimeters"), gtk_label_new ("Millimeters")); gtk_main (); return 0; } goocanvas-0.15/demo/demo-large-line.c0000644000076400007640000001570611172574677014433 00000000000000/* * GooCanvas Demo. Copyright (C) 2007 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-large-line.c - a demo item that exceeds the cairo 16-bit size limit. * Note that it doesn't support miters. */ #include #include "goocanvas.h" #include "demo-large-line.h" /* Use the GLib convenience macro to define the type. GooDemoLargeLine is the class struct, goo_demo_large_line is the function prefix, and our class is a subclass of GOO_TYPE_CANVAS_ITEM_SIMPLE. */ G_DEFINE_TYPE (GooDemoLargeLine, goo_demo_large_line, GOO_TYPE_CANVAS_ITEM_SIMPLE) /* The standard object initialization function. */ static void goo_demo_large_line_init (GooDemoLargeLine *demo_large_line) { demo_large_line->x1 = 0.0; demo_large_line->y1 = 0.0; demo_large_line->x2 = 0.0; demo_large_line->y2 = 0.0; } /* The convenience function to create new items. This should start with a parent argument and end with a variable list of object properties to fit in with the standard canvas items. */ GooCanvasItem* goo_demo_large_line_new (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...) { GooCanvasItem *item; GooDemoLargeLine *demo_large_line; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_DEMO_LARGE_LINE, NULL); demo_large_line = (GooDemoLargeLine*) item; demo_large_line->x1 = x1; demo_large_line->y1 = y1; demo_large_line->x2 = x2; demo_large_line->y2 = y2; va_start (var_args, y2); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /* The update method. This is called when the canvas is initially shown and also whenever the object is updated and needs to change its size and/or shape. It should calculate its new bounds in its own coordinate space, storing them in simple->bounds. */ static void goo_demo_large_line_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooDemoLargeLine *item = (GooDemoLargeLine*) simple; gdouble half_line_width; half_line_width = goo_canvas_item_simple_get_line_width (simple) / 2; /* Compute the new bounds. */ simple->bounds.x1 = MIN (item->x1, item->x2) - half_line_width; simple->bounds.y1 = MIN (item->y1, item->y2) - half_line_width; simple->bounds.x2 = MAX (item->x1, item->x2) + half_line_width; simple->bounds.y2 = MAX (item->y1, item->y2) + half_line_width; } static void clamp_x (gdouble point1[2], gdouble point2[2], gdouble clamp) { gdouble fraction = (clamp - point1[0]) / (point2[0] - point1[0]); point1[0] = clamp; point1[1] += fraction * (point2[1] - point1[1]); } static void clamp_y (gdouble point1[2], gdouble point2[2], gdouble clamp) { gdouble fraction = (clamp - point1[1]) / (point2[1] - point1[1]); point1[1] = clamp; point1[0] += fraction * (point2[0] - point1[0]); } static void paint_large_line (GooDemoLargeLine *line, cairo_t *cr, const GooCanvasBounds *bounds, gdouble line_width, gdouble x1, gdouble y1, gdouble x2, gdouble y2) { GooCanvasItem *item = (GooCanvasItem*) line; GooCanvasItemSimple *simple = (GooCanvasItemSimple*) line; GooCanvas *canvas = simple->canvas; GooCanvasBounds tmp_bounds = *bounds; gdouble point1[2], point2[2], *p1, *p2; point1[0] = x1; point1[1] = y1; point2[0] = x2; point2[1] = y2; /* Transform the coordinates to the canvas device space, so we can clamp the line to the bounds to be painted. */ goo_canvas_convert_from_item_space (canvas, item, &point1[0], &point1[1]); goo_canvas_convert_from_item_space (canvas, item, &point2[0], &point2[1]); /* Extend the bounds a bit to account for the line width. */ tmp_bounds.x1 -= line_width; tmp_bounds.y1 -= line_width; tmp_bounds.x2 += line_width; tmp_bounds.y2 += line_width; /* Make p1 the left-most point. */ if (point1[0] < point2[0]) { p1 = point1; p2 = point2; } else { p1 = point2; p2 = point1; } /* Just return if the line is completely outside the bounds horizontally. */ if (p2[0] < tmp_bounds.x1 || p1[0] > tmp_bounds.x2) return; /* Clamp each x coordinate to the bounds. */ if (p1[0] < tmp_bounds.x1) clamp_x (p1, p2, tmp_bounds.x1); if (p2[0] > tmp_bounds.x2) clamp_x (p2, p1, tmp_bounds.x2); /* Now make p1 the top-most point. */ if (point1[1] < point2[1]) { p1 = point1; p2 = point2; } else { p1 = point2; p2 = point1; } /* Just return if the line is completely outside the bounds vertically. */ if (p2[1] < tmp_bounds.y1 || p1[1] > tmp_bounds.y2) return; /* Clamp each y coordinate to the bounds. */ if (p1[1] < tmp_bounds.y1) clamp_y (p1, p2, tmp_bounds.y1); if (p2[1] > tmp_bounds.y2) clamp_y (p2, p1, tmp_bounds.y2); /* Convert back to item space. */ goo_canvas_convert_to_item_space (canvas, item, &point1[0], &point1[1]); goo_canvas_convert_to_item_space (canvas, item, &point2[0], &point2[1]); /* Draw the line. */ cairo_move_to (cr, point1[0], point1[1]); cairo_line_to (cr, point2[0], point2[1]); cairo_stroke (cr); } /* The paint method. This should draw the item on the given cairo_t, using the item's own coordinate space. */ static void goo_demo_large_line_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooDemoLargeLine *item = (GooDemoLargeLine*) simple; gdouble line_width; goo_canvas_style_set_stroke_options (simple->simple_data->style, cr); line_width = goo_canvas_item_simple_get_line_width (simple); paint_large_line (item, cr, bounds, line_width, item->x1, item->y1, item->x2, item->y2); } /* Hit detection. This should check if the given coordinate (in the item's coordinate space) is within the item. If it is it should return TRUE, otherwise it should return FALSE. */ static gboolean goo_demo_large_line_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { /*GooDemoLargeLine *item = (GooDemoLargeLine*) simple;*/ /* FIXME: Implement this. */ return FALSE; } /* The class initialization function. Here we set the class' update(), paint() and is_item_at() methods. */ static void goo_demo_large_line_class_init (GooDemoLargeLineClass *klass) { GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; simple_class->simple_update = goo_demo_large_line_update; simple_class->simple_paint = goo_demo_large_line_paint; simple_class->simple_is_item_at = goo_demo_large_line_is_item_at; } goocanvas-0.15/demo/demo-item.h0000644000076400007640000000272611172574677013355 00000000000000/* * GooCanvas Demo. Copyright (C) 2006 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-item.c - a simple demo item. */ #ifndef __GOO_DEMO_ITEM_H__ #define __GOO_DEMO_ITEM_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS #define GOO_TYPE_DEMO_ITEM (goo_demo_item_get_type ()) #define GOO_DEMO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_DEMO_ITEM, GooDemoItem)) #define GOO_DEMO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_DEMO_ITEM, GooDemoItemClass)) #define GOO_IS_DEMO_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_DEMO_ITEM)) #define GOO_IS_DEMO_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_DEMO_ITEM)) #define GOO_DEMO_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_DEMO_ITEM, GooDemoItemClass)) typedef struct _GooDemoItem GooDemoItem; typedef struct _GooDemoItemClass GooDemoItemClass; struct _GooDemoItem { GooCanvasItemSimple parent_object; gdouble x, y, width, height; }; struct _GooDemoItemClass { GooCanvasItemSimpleClass parent_class; }; GType goo_demo_item_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_demo_item_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); G_END_DECLS #endif /* __GOO_DEMO_ITEM_H__ */ goocanvas-0.15/demo/demo.c0000644000076400007640000012175611222125062012371 00000000000000/* * GooCanvas Demo. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * main.c - demo app. */ #include #include #include #include #include #include #include #if CAIRO_HAS_PDF_SURFACE #include #endif #include #include "demo-item.h" static GooCanvasItem *ellipse2, *textitem; static gboolean dragging = FALSE; static double drag_x, drag_y; static void setup_canvas (GooCanvas *canvas); GtkWidget *create_canvas_fifteen (void); GtkWidget *create_canvas_features (void); GtkWidget *create_canvas_arrowhead (void); GtkWidget *create_canvas_scalability (void); GtkWidget *create_grabs_page (void); GtkWidget *create_events_page (void); GtkWidget *create_paths_page (void); GtkWidget *create_focus_page (void); GtkWidget *create_animation_page (void); GtkWidget *create_clipping_page (void); GtkWidget *create_table_page (void); GtkWidget *create_large_items_page (void); #if CAIRO_HAS_PDF_SURFACE static void write_pdf_clicked (GtkWidget *button, GooCanvas *canvas) { cairo_surface_t *surface; GooCanvasBounds bounds; cairo_t *cr; g_print ("In write_pdf_clicked\n"); surface = cairo_pdf_surface_create ("demo.pdf", 9 * 72, 10 * 72); cr = cairo_create (surface); /* Place it in the middle of our 9x10 page. */ cairo_translate (cr, 20, 130); bounds.x1 = 100; bounds.y1 = 100; bounds.x2 = 300; bounds.y2 = 300; #if 1 goo_canvas_render (canvas, cr, NULL, 1.0); #else goo_canvas_render (canvas, cr, &bounds, 1.0); #endif cairo_show_page (cr); cairo_surface_destroy (surface); cairo_destroy (cr); } #endif static void zoom_changed (GtkAdjustment *adj, GooCanvas *canvas) { goo_canvas_set_scale (canvas, adj->value); } static void zoom_x_changed (GtkAdjustment *adj, GooCanvas *canvas) { g_object_set (G_OBJECT (canvas), "scale-x", adj->value, NULL); } static void zoom_y_changed (GtkAdjustment *adj, GooCanvas *canvas) { g_object_set (G_OBJECT (canvas), "scale-y", adj->value, NULL); } static void center_toggled (GtkToggleButton *button, gpointer data) { /*foo_canvas_set_center_scroll_region (data, gtk_toggle_button_get_active (button));*/ } static void anchor_toggled (GtkWidget *button, GooCanvas *canvas) { GtkAnchorType anchor; anchor = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "anchor")); if (GTK_TOGGLE_BUTTON (button)->active) g_object_set (canvas, "anchor", anchor, NULL); } static void scroll_to_50_50_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 50, 50); } static void scroll_to_500_500_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 500, 500); } static void scroll_to_250_250_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 250, 250); } static void animate_ellipse_clicked (GtkWidget *button, GooCanvas *canvas) { #if 1 goo_canvas_item_animate (ellipse2, 100, 100, 1, 90, TRUE, 1000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif #if 0 goo_canvas_item_animate (textitem, -300, -200, 1, 90, TRUE, 1000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif } static void stop_animation_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_item_stop_animation (ellipse2); } static void change_bounds_clicked (GtkWidget *button, GooCanvas *canvas) { static gdouble bounds[4][4] = { { -100, -100, 200, 200 }, { 100, 100, 200, 200 }, { 0, 0, 300, 300 }, { 0, 0, 604, 454 } }; static gint bounds_num = 0; gboolean automatic_bounds = TRUE; gboolean bounds_from_origin = FALSE; gdouble bounds_padding = 50.0; if (bounds_num < 4) { automatic_bounds = FALSE; goo_canvas_set_bounds (canvas, bounds[bounds_num][0], bounds[bounds_num][1], bounds[bounds_num][2], bounds[bounds_num][3]); } else if (bounds_num == 4) { bounds_from_origin = TRUE; bounds_padding = 50.0; } g_object_set (G_OBJECT (canvas), "automatic-bounds", automatic_bounds, "bounds-from-origin", bounds_from_origin, "bounds-padding", bounds_padding, NULL); bounds_num = (bounds_num + 1) % 6; } static void move_ellipse_clicked (GtkWidget *button, GooCanvas *canvas) { static int last_state = 0; #if 0 g_print ("Moving ellipse\n"); #endif goo_canvas_item_set_transform (ellipse2, NULL); if (last_state == 0) { g_object_set (ellipse2, "center-x", 300.0, "center-y", 70.0, "radius-x", 45.0, "radius-y", 30.0, "fill-color", "red", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A red ellipse", NULL); last_state = 1; } else if (last_state == 1) { g_object_set (ellipse2, "center-x", 390.0, "center-y", 150.0, "radius-x", 45.0, "radius-y", 40.0, "fill-pattern", NULL, "stroke-color", "midnightblue", "line-width", 4.0, "title", "A brown ellipse", NULL); last_state = 2; } else if (last_state == 2) { g_object_set (ellipse2, "center-x", 0.0, "center-y", 0.0, "radius-y", 30.0, NULL); goo_canvas_item_set_simple_transform (ellipse2, 100, 100, 1, 0); last_state = 3; } else if (last_state == 3) { goo_canvas_item_set_simple_transform (ellipse2, 200, 100, 2, 0); last_state = 4; } else if (last_state == 4) { goo_canvas_item_set_simple_transform (ellipse2, 200, 200, 1, 45); last_state = 5; } else if (last_state == 5) { goo_canvas_item_set_simple_transform (ellipse2, 50, 50, 0.2, 225); last_state = 6; } else { g_object_set (ellipse2, "center-x", 335.0, "center-y", 70.0, "radius-x", 45.0, "radius-y", 30.0, "fill-color", "purple", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A purple ellipse", NULL); last_state = 0; } } static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { #if 0 g_print ("received 'motion-notify' signal at %g, %g\n", event->x, event->y); #endif if (dragging && (event->state & GDK_BUTTON1_MASK)) { double new_x = event->x; double new_y = event->y; goo_canvas_item_translate (item, new_x - drag_x, new_y - drag_y); } return TRUE; } static void output_items_in_area (GooCanvas *canvas, gdouble x, gdouble y) { static gdouble last_x = 0.0, last_y = 0.0; GooCanvasBounds area; GList *items, *elem; /* Print out the items from the last point to this one. */ area.x1 = MIN (x, last_x); area.x2 = MAX (x, last_x); area.y1 = MIN (y, last_y); area.y2 = MAX (y, last_y); items = goo_canvas_get_items_in_area (canvas, &area, TRUE, FALSE, FALSE); for (elem = items; elem; elem = elem->next) { g_print (" found items in area (%g, %g - %g, %g): %p\n", area.x1, area.y1, area.x2, area.y2, elem->data); } g_list_free (items); last_x = x; last_y = y; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GdkCursor *fleur; GList *items, *elem; g_print ("%p received 'button-press' signal at %g, %g (root: %g, %g)\n", item, event->x, event->y, event->x_root, event->y_root); canvas = goo_canvas_item_get_canvas (item); items = goo_canvas_get_items_at (canvas, event->x_root, event->y_root, TRUE); for (elem = items; elem; elem = elem->next) g_print (" found items: %p\n", elem->data); g_list_free (items); output_items_in_area (canvas, event->x_root, event->y_root); switch (event->button) { case 1: if (event->state & GDK_SHIFT_MASK) { goo_canvas_item_remove (item); } else { drag_x = event->x; drag_y = event->y; fleur = gdk_cursor_new (GDK_FLEUR); goo_canvas_pointer_grab (canvas, item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, fleur, event->time); gdk_cursor_unref (fleur); dragging = TRUE; } break; case 2: goo_canvas_item_lower (item, NULL); break; case 3: goo_canvas_item_raise (item, NULL); break; default: break; } return TRUE; } static gboolean on_scroll (GooCanvasItem *item, GooCanvasItem *target, GdkEventScroll *event, gpointer data) { #if 0 g_print ("received 'scroll-event' signal\n"); #endif if (event->direction == GDK_SCROLL_UP) goo_canvas_item_scale (item, 1.1, 1.1); else if (event->direction == GDK_SCROLL_DOWN) goo_canvas_item_scale (item, 0.909, 0.909); else return FALSE; return TRUE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; #if 0 g_print ("received 'button-release' signal\n"); #endif canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); dragging = FALSE; return TRUE; } static gboolean on_background_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GList *items, *elem; #if 1 g_print ("background received 'button-press' signal\n"); #endif canvas = goo_canvas_item_get_canvas (item); output_items_in_area (canvas, event->x_root, event->y_root); items = goo_canvas_get_items_at (canvas, event->x_root, event->y_root, FALSE); for (elem = items; elem; elem = elem->next) g_print (" clicked items: %p\n", elem->data); g_list_free (items); return TRUE; } static void setup_item_signals (GooCanvasItem *item) { g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); } GtkWidget * create_canvas_primitives () { GtkWidget *vbox; GtkWidget *hbox; GtkWidget *w; GtkWidget *scrolled_win, *canvas; GtkAdjustment *adj; GSList *group = NULL; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); w = gtk_label_new ("Drag an item with button 1. Click button 2 on an item to lower it, or button 3 to raise it."); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Create the canvas */ canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "automatic-bounds", TRUE, "bounds-from-origin", FALSE, "bounds-padding", 4.0, "background-color-rgb", 0xC3C3FF, "has-tooltip", TRUE, #if 0 "redraw-when-scrolled", TRUE, #endif NULL); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 604, 454); /* Scale */ w = gtk_label_new ("Scale:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.50)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_label_new ("Scale X:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.50)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_x_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_label_new ("Scale Y:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.50)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_y_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Center: */ w = gtk_check_button_new_with_label("Center scroll region"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); /*gtk_widget_show (w);*/ g_signal_connect (w, "toggled", G_CALLBACK (center_toggled), canvas); /* Move Ellipse */ w = gtk_button_new_with_label("Move Ellipse"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_ellipse_clicked), canvas); /* Animate Ellipse */ w = gtk_button_new_with_label("Animate Ellipse"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (animate_ellipse_clicked), canvas); /* Stop Animation */ w = gtk_button_new_with_label("Stop Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked), canvas); #if CAIRO_HAS_PDF_SURFACE /* Create PDF */ w = gtk_button_new_with_label("Write PDF"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (write_pdf_clicked), canvas); #endif w = gtk_button_new_with_label("Change Bounds"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_bounds_clicked), canvas); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Scroll to */ w = gtk_label_new ("Scroll To:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_button_new_with_label("50,50"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_50_50_clicked), canvas); w = gtk_button_new_with_label("250,250"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_250_250_clicked), canvas); w = gtk_button_new_with_label("500,500"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_500_500_clicked), canvas); /* Scroll anchor */ w = gtk_label_new ("Anchor:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_radio_button_new_with_label (group, "NW"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NW)); w = gtk_radio_button_new_with_label (group, "N"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_N)); w = gtk_radio_button_new_with_label (group, "NE"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NE)); w = gtk_radio_button_new_with_label (group, "W"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_W)); w = gtk_radio_button_new_with_label (group, "C"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_CENTER)); w = gtk_radio_button_new_with_label (group, "E"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_E)); w = gtk_radio_button_new_with_label (group, "SW"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SW)); w = gtk_radio_button_new_with_label (group, "S"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_S)); w = gtk_radio_button_new_with_label (group, "SE"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SE)); /* Layout the stuff */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); /* Add all the canvas items. */ setup_canvas (GOO_CANVAS (canvas)); #if 0 g_signal_connect_after (canvas, "key_press_event", G_CALLBACK (key_press), NULL); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_grab_focus (canvas); #endif return vbox; } static void setup_heading (GooCanvasItem *root, char *text, int pos) { double x = (pos % 3) * 200 + 100; double y = (pos / 3) * 150 + 5; GooCanvasItem *item; PangoRectangle ink_rect, logical_rect; item = goo_canvas_text_new (root, text, x, y, -1, GTK_ANCHOR_N, "font", "Sans 12", NULL); goo_canvas_item_skew_y (item, 30, x, y); /*goo_canvas_item_rotate (item, 30, x, y);*/ goo_canvas_text_get_natural_extents (GOO_CANVAS_TEXT (item), &ink_rect, &logical_rect); g_print ("Ink Extents: %i,%i %ix%i Logical: %i,%i %ix%i\n", ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height, logical_rect.x, logical_rect.y, logical_rect.width, logical_rect.height); } static void setup_divisions (GooCanvasItem *root) { GooCanvasItem *group, *item; group = goo_canvas_group_new (root, NULL); goo_canvas_item_translate (group, 2, 2); item = goo_canvas_rect_new (group, 0, 0, 600, 450, "line-width", 4.0, NULL); item = goo_canvas_polyline_new_line (group, 0, 150, 600, 150, "line-width", 4.0, NULL); item = goo_canvas_polyline_new_line (group, 0, 300, 600, 300, "line-width", 4.0, NULL); item = goo_canvas_polyline_new_line (group, 200, 0, 200, 450, "line-width", 4.0, NULL); item = goo_canvas_polyline_new_line (group, 400, 0, 400, 450, "line-width", 4.0, NULL); #if 1 setup_heading (group, "Rectangles", 0); setup_heading (group, "Ellipses", 1); setup_heading (group, "Texts", 2); setup_heading (group, "Images", 3); setup_heading (group, "Lines", 4); /*setup_heading (group, "No Curves", 5);*/ /*setup_heading (group, "Arcs", 6);*/ setup_heading (group, "Polygons", 7); /*setup_heading (group, "Widgets", 8);*/ #endif } /* FIXME: I think we may need to check byte order. */ static cairo_pattern_t* create_stipple (const char *color_name, guchar stipple_data[16]) { cairo_surface_t *surface; cairo_pattern_t *pattern; GdkColor color; gdk_color_parse (color_name, &color); stipple_data[2] = stipple_data[14] = color.red >> 8; stipple_data[1] = stipple_data[13] = color.green >> 8; stipple_data[0] = stipple_data[12] = color.blue >> 8; surface = cairo_image_surface_create_for_data (stipple_data, CAIRO_FORMAT_ARGB32, 2, 2, 8); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); return pattern; } static void setup_rectangles (GooCanvasItem *root) { GooCanvasItem *item; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; item = goo_canvas_rect_new (root, 20, 30, 50, 30, "stroke-color", "red", "line-width", 8.0, "tooltip", "Red stroked rectangle", NULL); setup_item_signals (item); pattern = create_stipple ("mediumseagreen", stipple_data); item = goo_canvas_rect_new (root, 90, 40, 90, 60, "fill-pattern", pattern, "stroke-color", "black", "line-width", 4.0, "tooltip", "Medium Sea Green stippled rectangle", NULL); cairo_pattern_destroy (pattern); setup_item_signals (item); item = goo_canvas_rect_new (root, 10, 80, 70, 60, "fill-color", "steelblue", /*"fill-pattern", NULL,*/ "tooltip", "Steel Blue rectangle", NULL); setup_item_signals (item); item = goo_canvas_rect_new (root, 20, 90, 70, 60, "fill-color-rgba", 0x3cb37180, "stroke-color", "blue", "line-width", 2.0, "tooltip", "Partially transparent rectangle", NULL); setup_item_signals (item); item = goo_canvas_rect_new (root, 110, 80, 50, 30, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color-rgba", 0x3cb3f180, "tooltip", "Rectangle with rounded corners", NULL); setup_item_signals (item); item = goo_demo_item_new (root, 30, 20, 50, 30, "fill-color", "yellow", "tooltip", "Yellow demo item", NULL); setup_item_signals (item); } static void setup_ellipses (GooCanvasItem *root) { GooCanvasItem *ellipse1, *ellipse3; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; #if 1 ellipse1 = goo_canvas_ellipse_new (root, 245, 45, 25, 15, "stroke-color", "goldenrod", "line-width", 8.0, NULL); setup_item_signals (ellipse1); #endif ellipse2 = goo_canvas_ellipse_new (root, 335, 70, 45, 30, "fill-color", "wheat", "stroke-color", "midnightblue", "line-width", 4.0, "title", "An ellipse", NULL); #if 0 goo_canvas_item_rotate (ellipse2, 30, 0, 0); #endif setup_item_signals (ellipse2); #if 1 pattern = create_stipple ("cadetblue", stipple_data); ellipse3 = goo_canvas_ellipse_new (root, 245, 110, 35, 30, "fill-pattern", pattern, "stroke-color", "black", "line-width", 1.0, NULL); cairo_pattern_destroy (pattern); setup_item_signals (ellipse3); #endif } #define VERTICES 10 #define RADIUS 60.0 static void polish_diamond (GooCanvasItem *root) { GooCanvasItem *group, *item; int i, j; double a, x1, y1, x2, y2; group = goo_canvas_group_new (root, "line-width", 1.0, "line-cap", CAIRO_LINE_CAP_ROUND, NULL); goo_canvas_item_translate (group, 270, 230); setup_item_signals (group); for (i = 0; i < VERTICES; i++) { a = 2.0 * M_PI * i / VERTICES; x1 = RADIUS * cos (a); y1 = RADIUS * sin (a); for (j = i + 1; j < VERTICES; j++) { a = 2.0 * M_PI * j / VERTICES; x2 = RADIUS * cos (a); y2 = RADIUS * sin (a); item = goo_canvas_polyline_new_line (group, x1, y1, x2, y2, NULL); } } } #define SCALE 7.0 static void make_hilbert (GooCanvasItem *root) { char hilbert[] = "urdrrulurulldluuruluurdrurddldrrruluurdrurddldrddlulldrdldrrurd"; char *c; double *pp, *p; GooCanvasItem *item; GooCanvasPoints *points; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; points = goo_canvas_points_new (strlen (hilbert) + 1); points->coords[0] = 340.0; points->coords[1] = 290.0; pp = points->coords; for (c = hilbert, p = points->coords + 2; *c; c++, p += 2, pp += 2) switch (*c) { case 'u': p[0] = pp[0]; p[1] = pp[1] - SCALE; break; case 'd': p[0] = pp[0]; p[1] = pp[1] + SCALE; break; case 'l': p[0] = pp[0] - SCALE; p[1] = pp[1]; break; case 'r': p[0] = pp[0] + SCALE; p[1] = pp[1]; break; } pattern = create_stipple ("red", stipple_data); item = goo_canvas_polyline_new (root, FALSE, 0, "points", points, "line-width", 4.0, "stroke-pattern", pattern, "line-cap", CAIRO_LINE_CAP_SQUARE, "line-join", CAIRO_LINE_JOIN_MITER, NULL); cairo_pattern_destroy (pattern); setup_item_signals (item); goo_canvas_points_unref (points); } static void setup_lines (GooCanvasItem *root) { GooCanvasItem *polyline1, *polyline2, *polyline3, *polyline4, *polyline5; polish_diamond (root); make_hilbert (root); /* Arrow tests */ polyline1 = goo_canvas_polyline_new (root, FALSE, 4, 340.0, 170.0, 340.0, 230.0, 390.0, 230.0, 390.0, 170.0, "stroke-color", "midnightblue", "line-width", 3.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 3.0, "arrow-length", 4.0, "arrow-width", 3.5, NULL); setup_item_signals (polyline1); polyline2 = goo_canvas_polyline_new (root, FALSE, 2, 356.0, 180.0, 374.0, 220.0, "stroke-color", "blue", "line-width", 1.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 5.0, "arrow-length", 6.0, "arrow-width", 6.0, NULL); setup_item_signals (polyline2); polyline3 = goo_canvas_polyline_new (root, FALSE, 2, 356.0, 220.0, 374.0, 180.0, "stroke-color", "blue", "line-width", 1.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 5.0, "arrow-length", 6.0, "arrow-width", 6.0, NULL); setup_item_signals (polyline3); /* Test polyline without any coords. */ polyline4 = goo_canvas_polyline_new (root, FALSE, 0, NULL); setup_item_signals (polyline4); /* Test polyline with 1 coord and arrows. */ polyline5 = goo_canvas_polyline_new (root, FALSE, 1, 356.0, 220.0, "start-arrow", TRUE, "end-arrow", TRUE, NULL); setup_item_signals (polyline5); } static void setup_polygons (GooCanvasItem *root) { GooCanvasItem *polyline1, *polyline2; GooCanvasPoints *points; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; points = goo_canvas_points_new (3); points->coords[0] = 210.0; points->coords[1] = 320.0; points->coords[2] = 210.0; points->coords[3] = 380.0; points->coords[4] = 260.0; points->coords[5] = 350.0; pattern = create_stipple ("blue", stipple_data); polyline1 = goo_canvas_polyline_new (root, TRUE, 0, "line-width", 1.0, "points", points, "fill_pattern", pattern, "stroke_color", "black", NULL); cairo_pattern_destroy (pattern); goo_canvas_points_unref (points); setup_item_signals (polyline1); points = goo_canvas_points_new (14); points->coords[0] = 270.0; points->coords[1] = 330.0; points->coords[2] = 270.0; points->coords[3] = 430.0; points->coords[4] = 390.0; points->coords[5] = 430.0; points->coords[6] = 390.0; points->coords[7] = 330.0; points->coords[8] = 310.0; points->coords[9] = 330.0; points->coords[10] = 310.0; points->coords[11] = 390.0; points->coords[12] = 350.0; points->coords[13] = 390.0; points->coords[14] = 350.0; points->coords[15] = 370.0; points->coords[16] = 330.0; points->coords[17] = 370.0; points->coords[18] = 330.0; points->coords[19] = 350.0; points->coords[20] = 370.0; points->coords[21] = 350.0; points->coords[22] = 370.0; points->coords[23] = 410.0; points->coords[24] = 290.0; points->coords[25] = 410.0; points->coords[26] = 290.0; points->coords[27] = 330.0; polyline2 = goo_canvas_polyline_new (root, TRUE, 0, "points", points, "fill_color", "tan", "stroke_color", "black", "line-width", 3.0, NULL); goo_canvas_points_unref (points); setup_item_signals (polyline2); } static GooCanvasItem * make_anchor (GooCanvasItem *root, double x, double y) { GooCanvasItem *group, *item; cairo_matrix_t transform = { 0.8, 0.2, -0.3, 0.5, x, y }; group = goo_canvas_group_new (root, NULL); goo_canvas_item_translate (group, x, y); #if 1 g_object_set (group, "transform", &transform, NULL); #endif item = goo_canvas_rect_new (group, -2.5, -2.5, 4, 4, "line-width", 1.0, NULL); setup_item_signals (item); g_signal_connect (group, "scroll_event", G_CALLBACK (on_scroll), NULL); return group; } static void setup_texts (GooCanvasItem *root) { GooCanvasItem *item; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; #if 1 pattern = create_stipple ("blue", stipple_data); item = goo_canvas_text_new (make_anchor (root, 420, 20), "Anchor NW", 0, 0, -1, GTK_ANCHOR_NW, "font", "Sans Bold 24", "fill_pattern", pattern, NULL); cairo_pattern_destroy (pattern); setup_item_signals (item); item = goo_canvas_text_new (make_anchor (root, 470, 75), "Anchor center\nJustify center\nMultiline text\nb8bit text ÅÄÖåäö", 0, 0, -1, GTK_ANCHOR_CENTER, "font", "monospace bold 14", "alignment", PANGO_ALIGN_CENTER, "fill_color", "firebrick", NULL); setup_item_signals (item); #endif #if 0 item = goo_canvas_text_new (make_anchor (root, 590, 140), "Clipped text\nClipped text\nClipped text\nClipped text\nClipped text\nClipped text", 0, 0, -1, GTK_ANCHOR_SE, "font", "Sans 12", /*"clip", TRUE,*/ /*"clip_width", 50.0,*/ /*"clip_height", 55.0,*/ /*"x_offset", 10.0,*/ "fill_color", "darkgreen", NULL); setup_item_signals (item); #endif #if 1 textitem = goo_canvas_text_new (make_anchor (root, 420, 240), "This is a very long paragraph that will need to be wrapped over several lines so we can see what happens to line-breaking as the view is zoomed in and out.", 0, 0, 180, GTK_ANCHOR_W, "font", "Sans 12", "fill_color", "goldenrod", NULL); setup_item_signals (textitem); #endif #if 1 textitem = goo_canvas_text_new (root, "Ellipsized text.", 20, 420, 115, GTK_ANCHOR_W, "font", "Sans 12", "fill_color", "blue", "ellipsize", PANGO_ELLIPSIZE_END, NULL); setup_item_signals (textitem); #endif } static void setup_invisible_texts (GooCanvasItem *root) { goo_canvas_text_new (root, "Visible above 0.8x", 500, 330, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 0.8, NULL); goo_canvas_rect_new (root, 410.5, 322.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 0.8, NULL); goo_canvas_text_new (root, "Visible above 1.5x", 500, 350, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 1.5, NULL); goo_canvas_rect_new (root, 410.5, 342.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 1.5, NULL); goo_canvas_text_new (root, "Visible above 3.0x", 500, 370, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 3.0, NULL); goo_canvas_rect_new (root, 410.5, 362.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 3.0, NULL); /* This should never be seen. */ goo_canvas_text_new (root, "Always Invisible", 500, 390, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); goo_canvas_rect_new (root, 410.5, 350.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); } static void plant_flower (GooCanvasItem *root, double x, double y, GtkAnchorType anchor) { cairo_pattern_t *pattern; cairo_surface_t *surface; GooCanvasItem *image; double w, h; surface = cairo_image_surface_create_from_png ("flower.png"); w = cairo_image_surface_get_width (surface); h = cairo_image_surface_get_height (surface); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); image = goo_canvas_image_new (root, NULL, x, y, "pattern", pattern, "width", w * 1.5, "height", h * 2, "scale-to-fit", TRUE, NULL); cairo_pattern_destroy (pattern); setup_item_signals (image); } static void setup_images (GooCanvasItem *root) { GdkPixbuf *im; GooCanvasItem *image; im = gdk_pixbuf_new_from_file ("toroid.png", NULL); if (im) { double w = gdk_pixbuf_get_width (im); double h = gdk_pixbuf_get_height (im); image = goo_canvas_image_new (root, im, 100.0 - w / 2, 225.0 - h / 2, "width", w, "height", h, /* "anchor", GTK_ANCHOR_CENTER, */ NULL); g_object_unref(im); setup_item_signals (image); } else g_warning ("Could not find the toroid.png sample file"); plant_flower (root, 20.0, 170.0, GTK_ANCHOR_NW); plant_flower (root, 180.0, 170.0, GTK_ANCHOR_NE); plant_flower (root, 20.0, 280.0, GTK_ANCHOR_SW); plant_flower (root, 180.0, 280.0, GTK_ANCHOR_SE); } static void setup_static_items (GooCanvas *canvas) { GooCanvasItem *static_root, *group, *item; static_root = goo_canvas_get_static_root_item (canvas); /* All static items in one place in the canvas should be placed in the same group. */ group = goo_canvas_group_new (static_root, NULL); item = goo_canvas_polyline_new_line (group, 40.0, 410.0, 40.0, 330.0, "stroke-color", "midnightblue", "line-width", 3.0, "end-arrow", TRUE, "arrow-tip-length", 3.0, "arrow-length", 4.0, "arrow-width", 3.5, NULL); setup_item_signals (item); item = goo_canvas_polyline_new_line (group, 32.0, 370.0, 48.0, 370.0, "stroke-color", "midnightblue", "line-width", 3.0, NULL); setup_item_signals (item); item = goo_canvas_text_new (group, "N", 40, 320, -1, GTK_ANCHOR_S, "font", "Sans 12", NULL); setup_item_signals (item); } /* This checks that the rgba color properties work properly, i.e. the value written to them is the same when read back out. */ static void test_color_properties (GooCanvasItem *root) { #if 0 GooCanvasItem *item; guint red, green, blue, alpha, rgba_in, rgba_out; item = goo_canvas_rect_new (root, 20, 30, 50, 30, NULL); for (red = 0; red < 256; red += 15) { for (green = 0; green < 256; green += 15) { for (blue = 0; blue < 256; blue ++) { for (alpha = 0; alpha < 256; alpha += 15) { rgba_in = (red << 24) + (green << 16) + (blue << 8) + alpha; g_object_set (item, "fill_color_rgba", rgba_in, NULL); rgba_out = 0; g_object_get (item, "fill_color_rgba", &rgba_out, NULL); if (rgba_in != rgba_out) g_print ("ERROR: rgba in: %.8X out: %.8X\n", rgba_in, rgba_out); } } } } #endif } static void test_simple_transforms (GooCanvasItem *root) { #if 0 GooCanvasItem *item; int rotation, x, y; double scale, x_out, y_out, scale_out, rotation_out, max_error = 0.0000001; item = goo_canvas_rect_new (root, 20, 30, 50, 30, NULL); for (rotation = 0; rotation < 360; rotation += 20) { scale = 0.1; while (scale < 10) { g_print ("Rotation: %i Scale: %g\n", rotation, scale); for (x = -100; x < 100; x += 10) { for (y = -100; y < 100; y += 10) { goo_canvas_item_set_simple_transform (item, x, y, scale, rotation); goo_canvas_item_get_simple_transform (item, &x_out, &y_out, &scale_out, &rotation_out); if (fabs (x_out - x) > max_error || fabs (y_out - y) > max_error || fabs (scale_out - scale) > max_error || fabs (rotation_out - rotation) > max_error) { g_print ("IN X:%i Y:%i Scale:%g Rotation:%i -> %g, %g, %g, %g\n", x, y, scale, rotation, x_out, y_out, scale_out, rotation_out); } } } scale += 0.1; } } #endif } static void setup_grids (GooCanvasItem *root) { GooCanvasItem *item; item = goo_canvas_grid_new (root, 80, 310, 90, 90, 10, 10, 5, 5, "stroke-color", "yellow", "fill-color", "pink", "border-width", 2.0, "border-color", "red", "vert-grid-line-color", "lightblue", "horz-grid-line-width", 1.0, "vert-grid-line-width", 1.0, "vert-grid-lines-on-top", TRUE, NULL); } static void setup_canvas (GooCanvas *canvas) { GooCanvasItem *root; root = goo_canvas_get_root_item (canvas); g_signal_connect (root, "button_press_event", G_CALLBACK (on_background_button_press), NULL); /* Setup canvas items */ #if 1 setup_divisions (root); setup_rectangles (root); setup_ellipses (root); setup_lines (root); setup_polygons (root); setup_texts (root); setup_images (root); setup_invisible_texts (root); setup_static_items (canvas); setup_grids (root); #endif test_color_properties (root); test_simple_transforms (root); } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } static GtkWidget* create_window () { GtkWidget *window, *notebook; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); notebook = gtk_notebook_new (); gtk_widget_show (notebook); gtk_container_add (GTK_CONTAINER (window), notebook); #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_primitives (), gtk_label_new ("Primitives")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_arrowhead (), gtk_label_new ("Arrowhead")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_fifteen (), gtk_label_new ("Fifteen")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_features (), gtk_label_new ("Reparent")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_scalability (), gtk_label_new ("Scalability")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_grabs_page (), gtk_label_new ("Grabs")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_events_page (), gtk_label_new ("Events")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_paths_page (), gtk_label_new ("Paths")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_focus_page (), gtk_label_new ("Focus")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_animation_page (), gtk_label_new ("Animation")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_clipping_page (), gtk_label_new ("Clipping")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_table_page (), gtk_label_new ("Table")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_large_items_page (), gtk_label_new ("Large Items")); #endif return window; } int main (int argc, char *argv[]) { GtkWidget *window; gtk_set_locale (); gtk_init (&argc, &argv); window = create_window (); gtk_main (); return 0; } goocanvas-0.15/demo/demo-fifteen.c0000644000076400007640000001554111172574677014031 00000000000000#include #include #include #include #include #include #include #include #define PIECE_SIZE 50 static void free_stuff (GtkObject *obj, gpointer data) { g_free (data); } static void test_win (GooCanvasItem **board) { int i; #if 0 GtkWidget *dlg; #endif for (i = 0; i < 15; i++) if (!board[i] || (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (board[i]), "piece_num")) != i)) return; #if 0 dlg=gnome_ok_dialog ("You stud, you win!"); gtk_window_set_modal(GTK_WINDOW(dlg),TRUE); gnome_dialog_run (GNOME_DIALOG (dlg)); #endif } static char * get_piece_color (int piece) { static char buf[50]; int x, y; int r, g, b; y = piece / 4; x = piece % 4; r = ((4 - x) * 255) / 4; g = ((4 - y) * 255) / 4; b = 128; sprintf (buf, "#%02x%02x%02x", r, g, b); return buf; } static gboolean piece_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItem *text; #if 0 g_print ("In piece_enter_notify\n"); #endif text = g_object_get_data (G_OBJECT (item), "text"); g_object_set (text, "fill_color", "white", NULL); return FALSE; } static gboolean piece_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEvent *event, gpointer data) { GooCanvasItem *text; #if 0 g_print ("In piece_leave_notify\n"); #endif text = g_object_get_data (G_OBJECT (item), "text"); g_object_set (text, "fill_color", "black", NULL); return FALSE; } static gboolean piece_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GooCanvasItem **board; GooCanvasItem *text; int num, pos, newpos; int x, y; double dx = 0.0, dy = 0.0; int move; canvas = goo_canvas_item_get_canvas (item); board = g_object_get_data (G_OBJECT (canvas), "board"); num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "piece_num")); pos = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "piece_pos")); text = g_object_get_data (G_OBJECT (item), "text"); #if 0 g_print ("In piece_event pos: %i,%i num: %i\n", pos % 4, pos / 4, num + 1); #endif y = pos / 4; x = pos % 4; move = TRUE; if ((y > 0) && (board[(y - 1) * 4 + x] == NULL)) { dx = 0.0; dy = -1.0; y--; } else if ((y < 3) && (board[(y + 1) * 4 + x] == NULL)) { dx = 0.0; dy = 1.0; y++; } else if ((x > 0) && (board[y * 4 + x - 1] == NULL)) { dx = -1.0; dy = 0.0; x--; } else if ((x < 3) && (board[y * 4 + x + 1] == NULL)) { dx = 1.0; dy = 0.0; x++; } else move = FALSE; if (move) { newpos = y * 4 + x; board[pos] = NULL; board[newpos] = item; g_object_set_data (G_OBJECT (item), "piece_pos", GINT_TO_POINTER (newpos)); goo_canvas_item_translate (item, dx * PIECE_SIZE, dy * PIECE_SIZE); test_win (board); } return FALSE; } static void setup_item_signals (GooCanvasItem *item) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (piece_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (piece_leave_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (piece_button_press), NULL); } #define SCRAMBLE_MOVES 256 static void scramble (GtkObject *object, gpointer data) { GooCanvas *canvas; GooCanvasItem **board; int i; int pos, oldpos; int dir; int x, y; srand (time (NULL)); canvas = data; board = g_object_get_data (G_OBJECT (canvas), "board"); /* First, find the blank spot */ for (pos = 0; pos < 16; pos++) if (board[pos] == NULL) break; /* "Move the blank spot" around in order to scramble the pieces */ for (i = 0; i < SCRAMBLE_MOVES; i++) { retry_scramble: dir = rand () % 4; x = y = 0; if ((dir == 0) && (pos > 3)) /* up */ y = -1; else if ((dir == 1) && (pos < 12)) /* down */ y = 1; else if ((dir == 2) && ((pos % 4) != 0)) /* left */ x = -1; else if ((dir == 3) && ((pos % 4) != 3)) /* right */ x = 1; else goto retry_scramble; oldpos = pos + y * 4 + x; board[pos] = board[oldpos]; board[oldpos] = NULL; g_object_set_data (G_OBJECT (board[pos]), "piece_pos", GINT_TO_POINTER (pos)); goo_canvas_item_translate (board[pos], -x * PIECE_SIZE, -y * PIECE_SIZE); pos = oldpos; } } GtkWidget * create_canvas_fifteen (void) { GtkWidget *vbox; GtkWidget *alignment; GtkWidget *frame; GtkWidget *canvas; GtkWidget *button; GooCanvasItem **board; GooCanvasItem *root, *rect, *text; int i, x, y; char buf[20]; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, TRUE, TRUE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); /* Create the canvas and board */ canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "automatic-bounds", TRUE, "bounds-from-origin", FALSE, NULL); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); gtk_widget_set_size_request (canvas, PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1); #if 0 goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1); #endif gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); board = g_new (GooCanvasItem *, 16); g_object_set_data (G_OBJECT (canvas), "board", board); g_signal_connect (canvas, "destroy", G_CALLBACK (free_stuff), board); for (i = 0; i < 15; i++) { y = i / 4; x = i % 4; board[i] = goo_canvas_group_new (root, NULL); goo_canvas_item_translate (board[i], x * PIECE_SIZE, y * PIECE_SIZE); setup_item_signals (board[i]); rect = goo_canvas_rect_new (board[i], 0, 0, PIECE_SIZE, PIECE_SIZE, "fill_color", get_piece_color (i), "stroke_color", "black", "line-width", 1.0, NULL); sprintf (buf, "%d", i + 1); text = goo_canvas_text_new (board[i], buf, PIECE_SIZE / 2.0, PIECE_SIZE / 2.0, -1, GTK_ANCHOR_CENTER, "font", "Sans bold 24", "fill_color", "black", NULL); g_object_set_data (G_OBJECT (board[i]), "text", text); g_object_set_data (G_OBJECT (board[i]), "piece_num", GINT_TO_POINTER (i)); g_object_set_data (G_OBJECT (board[i]), "piece_pos", GINT_TO_POINTER (i)); } board[15] = NULL; /* Scramble button */ button = gtk_button_new_with_label ("Scramble"); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); g_object_set_data (G_OBJECT (button), "board", board); g_signal_connect (button, "clicked", G_CALLBACK (scramble), canvas); gtk_widget_show (button); return vbox; } goocanvas-0.15/demo/demo-focus.c0000644000076400007640000001062211172574677013523 00000000000000#include #include #include #include static gboolean on_focus_in (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received focus-in event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (item, "stroke-color", "black", NULL); return FALSE; } static gboolean on_focus_out (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received focus-out event\n", id ? id : "unknown"); /* Note that this is only for testing. Setting item properties to indicate focus isn't a good idea for real apps, as there may be multiple views. */ g_object_set (item, "stroke-pattern", NULL, NULL); return FALSE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received button-press event\n", id ? id : "unknown"); canvas = goo_canvas_item_get_canvas (item); goo_canvas_grab_focus (canvas, item); return TRUE; } static gboolean on_key_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event, gpointer data) { gchar *id; id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received key-press event\n", id ? id : "unknown"); return FALSE; } static void create_focus_box (GtkWidget *canvas, gdouble x, gdouble y, gdouble width, gdouble height, gchar *color) { GooCanvasItem *root, *item; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); item = goo_canvas_rect_new (root, x, y, width, height, "stroke-pattern", NULL, "fill-color", color, "line-width", 5.0, "can-focus", TRUE, NULL); g_object_set_data (G_OBJECT (item), "id", color); g_signal_connect (item, "focus_in_event", G_CALLBACK (on_focus_in), NULL); g_signal_connect (item, "focus_out_event", G_CALLBACK (on_focus_out), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "key_press_event", G_CALLBACK (on_key_press), NULL); } static void setup_canvas (GtkWidget *canvas) { create_focus_box (canvas, 110, 80, 50, 30, "red"); create_focus_box (canvas, 300, 160, 50, 30, "orange"); create_focus_box (canvas, 500, 50, 50, 30, "yellow"); create_focus_box (canvas, 70, 400, 50, 30, "blue"); create_focus_box (canvas, 130, 200, 50, 30, "magenta"); create_focus_box (canvas, 200, 160, 50, 30, "green"); create_focus_box (canvas, 450, 450, 50, 30, "cyan"); create_focus_box (canvas, 300, 350, 50, 30, "grey"); create_focus_box (canvas, 900, 900, 50, 30, "gold"); create_focus_box (canvas, 800, 150, 50, 30, "thistle"); create_focus_box (canvas, 600, 800, 50, 30, "azure"); create_focus_box (canvas, 700, 250, 50, 30, "moccasin"); create_focus_box (canvas, 500, 100, 50, 30, "cornsilk"); create_focus_box (canvas, 200, 750, 50, 30, "plum"); create_focus_box (canvas, 400, 800, 50, 30, "orchid"); } GtkWidget * create_focus_page (void) { GtkWidget *vbox, *label, *scrolled_win, *canvas; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); label = gtk_label_new ("Use Tab, Shift+Tab or the arrow keys to move the keyboard focus between the canvas items."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); return vbox; } goocanvas-0.15/demo/demo-large-rect.c0000644000076400007640000001454411172574677014440 00000000000000/* * GooCanvas Demo. Copyright (C) 2007 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * demo-large-rect.c - a demo item that exceeds the cairo 16-bit size limit. * Note that it doesn't support rotations or shears. */ #include #include "goocanvas.h" #include "demo-large-rect.h" /* Use the GLib convenience macro to define the type. GooDemoLargeRect is the class struct, goo_demo_large_rect is the function prefix, and our class is a subclass of GOO_TYPE_CANVAS_ITEM_SIMPLE. */ G_DEFINE_TYPE (GooDemoLargeRect, goo_demo_large_rect, GOO_TYPE_CANVAS_ITEM_SIMPLE) /* The standard object initialization function. */ static void goo_demo_large_rect_init (GooDemoLargeRect *demo_large_rect) { demo_large_rect->x = 0.0; demo_large_rect->y = 0.0; demo_large_rect->width = 0.0; demo_large_rect->height = 0.0; } /* The convenience function to create new items. This should start with a parent argument and end with a variable list of object properties to fit in with the standard canvas items. */ GooCanvasItem* goo_demo_large_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItem *item; GooDemoLargeRect *demo_large_rect; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_DEMO_LARGE_RECT, NULL); demo_large_rect = (GooDemoLargeRect*) item; demo_large_rect->x = x; demo_large_rect->y = y; demo_large_rect->width = width; demo_large_rect->height = height; va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /* The update method. This is called when the canvas is initially shown and also whenever the object is updated and needs to change its size and/or shape. It should calculate its new bounds in its own coordinate space, storing them in simple->bounds. */ static void goo_demo_large_rect_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooDemoLargeRect *item = (GooDemoLargeRect*) simple; gdouble half_line_width; /* We can quickly compute the bounds as being just the rectangle's size plus half the line width around each edge. */ half_line_width = goo_canvas_item_simple_get_line_width (simple) / 2; simple->bounds.x1 = item->x - half_line_width; simple->bounds.y1 = item->y - half_line_width; simple->bounds.x2 = item->x + item->width + half_line_width; simple->bounds.y2 = item->y + item->height + half_line_width; } static void create_large_rect_path (GooDemoLargeRect *rect, cairo_t *cr, const GooCanvasBounds *bounds, gdouble line_width, gdouble x, gdouble y, gdouble width, gdouble height) { GooCanvasItem *item = (GooCanvasItem*) rect; GooCanvasItemSimple *simple = (GooCanvasItemSimple*) rect; GooCanvas *canvas = simple->canvas; GooCanvasBounds tmp_bounds = *bounds; gdouble x1 = x, y1 = y, x2 = x + width, y2 = y + height; /* Transform the coordinates to the canvas device space, so we can clamp the line to the bounds to be painted. */ goo_canvas_convert_from_item_space (canvas, item, &x1, &y1); goo_canvas_convert_from_item_space (canvas, item, &x2, &y2); /* Extend the bounds a bit to account for the line width, so when we clamp the rect to the bounds the outside edges aren't visible. */ tmp_bounds.x1 -= line_width; tmp_bounds.y1 -= line_width; tmp_bounds.x2 += line_width; tmp_bounds.y2 += line_width; /* If the rect is completely outside the bounds just return. */ if (x1 > tmp_bounds.x2 || x2 < tmp_bounds.x1 || y1 > tmp_bounds.y2 || y2 < tmp_bounds.y1) return; /* Clamp the rect to the bounds. */ if (x1 < tmp_bounds.x1) x1 = tmp_bounds.x1; if (x2 > tmp_bounds.x2) x2 = tmp_bounds.x2; if (y1 < tmp_bounds.y1) y1 = tmp_bounds.y1; if (y2 > tmp_bounds.y2) y2 = tmp_bounds.y2; /* Convert back to item space. */ goo_canvas_convert_to_item_space (canvas, item, &x1, &y1); goo_canvas_convert_to_item_space (canvas, item, &x2, &y2); /* Create the path. */ cairo_move_to (cr, x1, y1); cairo_line_to (cr, x2, y1); cairo_line_to (cr, x2, y2); cairo_line_to (cr, x1, y2); cairo_close_path (cr); } /* The paint method. This should draw the item on the given cairo_t, using the item's own coordinate space. */ static void goo_demo_large_rect_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooDemoLargeRect *item = (GooDemoLargeRect*) simple; gdouble line_width; line_width = goo_canvas_item_simple_get_line_width (simple); create_large_rect_path (item, cr, bounds, line_width, item->x, item->y, item->width, item->height); goo_canvas_item_simple_paint_path (simple, cr); } /* Hit detection. This should check if the given coordinate (in the item's coordinate space) is within the item. If it is it should return TRUE, otherwise it should return FALSE. */ static gboolean goo_demo_large_rect_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooDemoLargeRect *item = (GooDemoLargeRect*) simple; gdouble half_line_width; /* We assume the item covers its rectangle + line widths. */ half_line_width = goo_canvas_item_simple_get_line_width (simple) / 2; if ((x < item->x - half_line_width) || (x > item->x + item->width + half_line_width) || (y < item->y - half_line_width) || (y > item->y + item->height + half_line_width)) return FALSE; return TRUE; } /* The class initialization function. Here we set the class' update(), paint() and is_item_at() methods. */ static void goo_demo_large_rect_class_init (GooDemoLargeRectClass *klass) { GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; simple_class->simple_update = goo_demo_large_rect_update; simple_class->simple_paint = goo_demo_large_rect_paint; simple_class->simple_is_item_at = goo_demo_large_rect_is_item_at; } goocanvas-0.15/demo/Makefile.in0000644000076400007640000005756211222156057013361 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = demo$(EXEEXT) table-demo$(EXEEXT) \ generic-position-demo$(EXEEXT) simple-demo$(EXEEXT) \ scalability-demo$(EXEEXT) units-demo$(EXEEXT) \ widgets-demo$(EXEEXT) mv-demo$(EXEEXT) mv-table-demo$(EXEEXT) \ mv-generic-position-demo$(EXEEXT) mv-simple-demo$(EXEEXT) \ mv-scalability-demo$(EXEEXT) subdir = demo DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = PROGRAMS = $(noinst_PROGRAMS) am_demo_OBJECTS = demo.$(OBJEXT) demo-fifteen.$(OBJEXT) \ demo-scalability.$(OBJEXT) demo-grabs.$(OBJEXT) \ demo-arrowhead.$(OBJEXT) demo-features.$(OBJEXT) \ demo-events.$(OBJEXT) demo-paths.$(OBJEXT) \ demo-focus.$(OBJEXT) demo-item.$(OBJEXT) \ demo-animation.$(OBJEXT) demo-clipping.$(OBJEXT) \ demo-table.$(OBJEXT) demo-large-line.$(OBJEXT) \ demo-large-items.$(OBJEXT) demo-large-rect.$(OBJEXT) demo_OBJECTS = $(am_demo_OBJECTS) am__DEPENDENCIES_1 = demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_generic_position_demo_OBJECTS = generic-position-demo.$(OBJEXT) generic_position_demo_OBJECTS = $(am_generic_position_demo_OBJECTS) generic_position_demo_DEPENDENCIES = \ $(top_builddir)/src/libgoocanvas.la $(am__DEPENDENCIES_1) am_mv_demo_OBJECTS = mv-demo.$(OBJEXT) mv-demo-fifteen.$(OBJEXT) \ mv-demo-scalability.$(OBJEXT) mv-demo-grabs.$(OBJEXT) \ mv-demo-arrowhead.$(OBJEXT) mv-demo-features.$(OBJEXT) \ mv-demo-events.$(OBJEXT) mv-demo-paths.$(OBJEXT) \ mv-demo-focus.$(OBJEXT) mv-demo-animation.$(OBJEXT) \ mv-demo-clipping.$(OBJEXT) mv-demo-table.$(OBJEXT) mv_demo_OBJECTS = $(am_mv_demo_OBJECTS) mv_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_mv_generic_position_demo_OBJECTS = \ mv-generic-position-demo.$(OBJEXT) mv_generic_position_demo_OBJECTS = \ $(am_mv_generic_position_demo_OBJECTS) mv_generic_position_demo_DEPENDENCIES = \ $(top_builddir)/src/libgoocanvas.la $(am__DEPENDENCIES_1) am_mv_scalability_demo_OBJECTS = mv-scalability-demo.$(OBJEXT) mv_scalability_demo_OBJECTS = $(am_mv_scalability_demo_OBJECTS) mv_scalability_demo_DEPENDENCIES = \ $(top_builddir)/src/libgoocanvas.la $(am__DEPENDENCIES_1) am_mv_simple_demo_OBJECTS = mv-simple-demo.$(OBJEXT) mv_simple_demo_OBJECTS = $(am_mv_simple_demo_OBJECTS) mv_simple_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_mv_table_demo_OBJECTS = mv-table-demo.$(OBJEXT) mv_table_demo_OBJECTS = $(am_mv_table_demo_OBJECTS) mv_table_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_scalability_demo_OBJECTS = scalability-demo.$(OBJEXT) scalability_demo_OBJECTS = $(am_scalability_demo_OBJECTS) scalability_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_simple_demo_OBJECTS = simple-demo.$(OBJEXT) simple_demo_OBJECTS = $(am_simple_demo_OBJECTS) simple_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_table_demo_OBJECTS = table-demo.$(OBJEXT) table_demo_OBJECTS = $(am_table_demo_OBJECTS) table_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_units_demo_OBJECTS = units-demo.$(OBJEXT) units_demo_OBJECTS = $(am_units_demo_OBJECTS) units_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) am_widgets_demo_OBJECTS = widgets-demo.$(OBJEXT) widgets_demo_OBJECTS = $(am_widgets_demo_OBJECTS) widgets_demo_DEPENDENCIES = $(top_builddir)/src/libgoocanvas.la \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(demo_SOURCES) $(generic_position_demo_SOURCES) \ $(mv_demo_SOURCES) $(mv_generic_position_demo_SOURCES) \ $(mv_scalability_demo_SOURCES) $(mv_simple_demo_SOURCES) \ $(mv_table_demo_SOURCES) $(scalability_demo_SOURCES) \ $(simple_demo_SOURCES) $(table_demo_SOURCES) \ $(units_demo_SOURCES) $(widgets_demo_SOURCES) DIST_SOURCES = $(demo_SOURCES) $(generic_position_demo_SOURCES) \ $(mv_demo_SOURCES) $(mv_generic_position_demo_SOURCES) \ $(mv_scalability_demo_SOURCES) $(mv_simple_demo_SOURCES) \ $(mv_table_demo_SOURCES) $(scalability_demo_SOURCES) \ $(simple_demo_SOURCES) $(table_demo_SOURCES) \ $(units_demo_SOURCES) $(widgets_demo_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -I$(top_srcdir)/src \ -I$(top_builddir)/src \ @PACKAGE_CFLAGS@ demo_SOURCES = \ demo.c demo-fifteen.c demo-scalability.c demo-grabs.c \ demo-arrowhead.c demo-features.c demo-events.c \ demo-paths.c demo-focus.c demo-item.h demo-item.c demo-animation.c \ demo-clipping.c demo-table.c demo-large-line.h demo-large-line.c \ demo-large-items.c demo-large-rect.h demo-large-rect.c demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_demo_SOURCES = \ mv-demo.c mv-demo-fifteen.c mv-demo-scalability.c mv-demo-grabs.c \ mv-demo-arrowhead.c mv-demo-features.c mv-demo-events.c \ mv-demo-paths.c mv-demo-focus.c mv-demo-animation.c \ mv-demo-clipping.c mv-demo-table.c mv_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) table_demo_SOURCES = \ table-demo.c table_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_table_demo_SOURCES = \ mv-table-demo.c mv_table_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) simple_demo_SOURCES = \ simple-demo.c simple_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_simple_demo_SOURCES = \ mv-simple-demo.c mv_simple_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) scalability_demo_SOURCES = \ scalability-demo.c scalability_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_scalability_demo_SOURCES = \ mv-scalability-demo.c mv_scalability_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) units_demo_SOURCES = \ units-demo.c units_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) widgets_demo_SOURCES = \ widgets-demo.c widgets_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) generic_position_demo_SOURCES = \ generic-position-demo.c generic_position_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) mv_generic_position_demo_SOURCES = \ mv-generic-position-demo.c mv_generic_position_demo_LDADD = $(top_builddir)/src/libgoocanvas.la @PACKAGE_LIBS@ $(INTLLIBS) EXTRA_DIST = flower.png toroid.png all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu demo/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu demo/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done demo$(EXEEXT): $(demo_OBJECTS) $(demo_DEPENDENCIES) @rm -f demo$(EXEEXT) $(LINK) $(demo_OBJECTS) $(demo_LDADD) $(LIBS) generic-position-demo$(EXEEXT): $(generic_position_demo_OBJECTS) $(generic_position_demo_DEPENDENCIES) @rm -f generic-position-demo$(EXEEXT) $(LINK) $(generic_position_demo_OBJECTS) $(generic_position_demo_LDADD) $(LIBS) mv-demo$(EXEEXT): $(mv_demo_OBJECTS) $(mv_demo_DEPENDENCIES) @rm -f mv-demo$(EXEEXT) $(LINK) $(mv_demo_OBJECTS) $(mv_demo_LDADD) $(LIBS) mv-generic-position-demo$(EXEEXT): $(mv_generic_position_demo_OBJECTS) $(mv_generic_position_demo_DEPENDENCIES) @rm -f mv-generic-position-demo$(EXEEXT) $(LINK) $(mv_generic_position_demo_OBJECTS) $(mv_generic_position_demo_LDADD) $(LIBS) mv-scalability-demo$(EXEEXT): $(mv_scalability_demo_OBJECTS) $(mv_scalability_demo_DEPENDENCIES) @rm -f mv-scalability-demo$(EXEEXT) $(LINK) $(mv_scalability_demo_OBJECTS) $(mv_scalability_demo_LDADD) $(LIBS) mv-simple-demo$(EXEEXT): $(mv_simple_demo_OBJECTS) $(mv_simple_demo_DEPENDENCIES) @rm -f mv-simple-demo$(EXEEXT) $(LINK) $(mv_simple_demo_OBJECTS) $(mv_simple_demo_LDADD) $(LIBS) mv-table-demo$(EXEEXT): $(mv_table_demo_OBJECTS) $(mv_table_demo_DEPENDENCIES) @rm -f mv-table-demo$(EXEEXT) $(LINK) $(mv_table_demo_OBJECTS) $(mv_table_demo_LDADD) $(LIBS) scalability-demo$(EXEEXT): $(scalability_demo_OBJECTS) $(scalability_demo_DEPENDENCIES) @rm -f scalability-demo$(EXEEXT) $(LINK) $(scalability_demo_OBJECTS) $(scalability_demo_LDADD) $(LIBS) simple-demo$(EXEEXT): $(simple_demo_OBJECTS) $(simple_demo_DEPENDENCIES) @rm -f simple-demo$(EXEEXT) $(LINK) $(simple_demo_OBJECTS) $(simple_demo_LDADD) $(LIBS) table-demo$(EXEEXT): $(table_demo_OBJECTS) $(table_demo_DEPENDENCIES) @rm -f table-demo$(EXEEXT) $(LINK) $(table_demo_OBJECTS) $(table_demo_LDADD) $(LIBS) units-demo$(EXEEXT): $(units_demo_OBJECTS) $(units_demo_DEPENDENCIES) @rm -f units-demo$(EXEEXT) $(LINK) $(units_demo_OBJECTS) $(units_demo_LDADD) $(LIBS) widgets-demo$(EXEEXT): $(widgets_demo_OBJECTS) $(widgets_demo_DEPENDENCIES) @rm -f widgets-demo$(EXEEXT) $(LINK) $(widgets_demo_OBJECTS) $(widgets_demo_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-animation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-arrowhead.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-clipping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-events.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-features.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-fifteen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-focus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-grabs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-item.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-large-items.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-large-line.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-large-rect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-paths.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-scalability.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-table.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic-position-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-animation.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-arrowhead.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-clipping.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-events.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-features.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-fifteen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-focus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-grabs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-paths.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-scalability.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo-table.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-generic-position-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-scalability-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-simple-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mv-table-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scalability-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/units-demo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/widgets-demo.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: goocanvas-0.15/demo/mv-demo.c0000644000076400007640000011256011222125345013006 00000000000000/* * GooCanvas Demo. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * main.c - demo app. */ #include #include #include #include #include #include #include #if CAIRO_HAS_PDF_SURFACE #include #endif #include static GooCanvasItemModel *ellipse2, *textitem; static gboolean dragging = FALSE; static double drag_x, drag_y; GtkWidget *create_canvas_fifteen (void); GtkWidget *create_canvas_features (void); GtkWidget *create_canvas_arrowhead (void); GtkWidget *create_canvas_scalability (void); GtkWidget *create_grabs_page (void); GtkWidget *create_events_page (void); GtkWidget *create_paths_page (void); GtkWidget *create_focus_page (void); GtkWidget *create_animation_page (void); GtkWidget *create_clipping_page (void); GtkWidget *create_table_page (void); #if CAIRO_HAS_PDF_SURFACE static void write_pdf_clicked (GtkWidget *button, GooCanvas *canvas) { cairo_surface_t *surface; cairo_t *cr; g_print ("In write_pdf_clicked\n"); surface = cairo_pdf_surface_create ("demo.pdf", 9 * 72, 10 * 72); cr = cairo_create (surface); /* Place it in the middle of our 9x10 page. */ cairo_translate (cr, 20, 130); goo_canvas_render (canvas, cr, NULL, 1.0); cairo_show_page (cr); cairo_surface_destroy (surface); cairo_destroy (cr); } #endif static void zoom_changed (GtkAdjustment *adj, GooCanvas *canvas) { goo_canvas_set_scale (canvas, adj->value); } static void center_toggled (GtkToggleButton *button, gpointer data) { /*foo_canvas_set_center_scroll_region (data, gtk_toggle_button_get_active (button));*/ } static void anchor_toggled (GtkWidget *button, GooCanvas *canvas) { GtkAnchorType anchor; anchor = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "anchor")); if (GTK_TOGGLE_BUTTON (button)->active) g_object_set (canvas, "anchor", anchor, NULL); } static void scroll_to_50_50_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 50, 50); } static void scroll_to_500_500_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 500, 500); } static void scroll_to_250_250_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_scroll_to (canvas, 250, 250); } static void animate_ellipse_clicked (GtkWidget *button, GooCanvas *canvas) { #if 1 goo_canvas_item_model_animate (ellipse2, 100, 100, 1, 90, TRUE, 1000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif #if 0 goo_canvas_item_model_animate (textitem, -300, -200, 1, 90, TRUE, 1000, 40, GOO_CANVAS_ANIMATE_BOUNCE); #endif } static void stop_animation_clicked (GtkWidget *button, GooCanvas *canvas) { goo_canvas_item_model_stop_animation (ellipse2); } static void change_bounds_clicked (GtkWidget *button, GooCanvas *canvas) { static gdouble bounds[4][4] = { { -100, -100, 200, 200 }, { 100, 100, 200, 200 }, { 0, 0, 300, 300 }, { 0, 0, 604, 454 } }; static gint bounds_num = 0; gboolean automatic_bounds = TRUE; gboolean bounds_from_origin = FALSE; gdouble bounds_padding = 50.0; if (bounds_num < 4) { automatic_bounds = FALSE; goo_canvas_set_bounds (canvas, bounds[bounds_num][0], bounds[bounds_num][1], bounds[bounds_num][2], bounds[bounds_num][3]); } else if (bounds_num == 4) { bounds_from_origin = TRUE; bounds_padding = 50.0; } g_object_set (G_OBJECT (canvas), "automatic-bounds", automatic_bounds, "bounds-from-origin", bounds_from_origin, "bounds-padding", bounds_padding, NULL); bounds_num = (bounds_num + 1) % 6; } static void move_ellipse_clicked (GtkWidget *button, GooCanvas *canvas) { static int last_state = 0; #if 0 g_print ("Moving ellipse\n"); #endif goo_canvas_item_model_set_transform (ellipse2, NULL); if (last_state == 0) { g_object_set (ellipse2, "center-x", 300.0, "center-y", 70.0, "radius-x", 45.0, "radius-y", 30.0, "fill-color", "red", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A red ellipse", NULL); last_state = 1; } else if (last_state == 1) { g_object_set (ellipse2, "center-x", 390.0, "center-y", 150.0, "radius-x", 45.0, "radius-y", 40.0, "fill-color", "brown", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A brown ellipse", NULL); last_state = 2; } else if (last_state == 2) { g_object_set (ellipse2, "center-x", 0.0, "center-y", 0.0, "radius-y", 30.0, NULL); goo_canvas_item_model_set_simple_transform (ellipse2, 100, 100, 1, 0); last_state = 3; } else if (last_state == 3) { goo_canvas_item_model_set_simple_transform (ellipse2, 200, 100, 2, 0); last_state = 4; } else if (last_state == 4) { goo_canvas_item_model_set_simple_transform (ellipse2, 200, 200, 1, 45); last_state = 5; } else if (last_state == 5) { goo_canvas_item_model_set_simple_transform (ellipse2, 50, 50, 0.2, 225); last_state = 6; } else { g_object_set (ellipse2, "center-x", 335.0, "center-y", 70.0, "radius-x", 45.0, "radius-y", 30.0, "fill-color", "purple", "stroke-color", "midnightblue", "line-width", 4.0, "title", "A purple ellipse", NULL); last_state = 0; } } static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); #if 0 g_print ("received 'motion-notify' signal at %g, %g\n", event->x, event->y); #endif if (dragging && (event->state & GDK_BUTTON1_MASK)) { double new_x = event->x; double new_y = event->y; #if 0 g_print ("Translating by %g, %g\n", new_x - drag_x, new_y - drag_y); #endif goo_canvas_item_model_translate (model, new_x - drag_x, new_y - drag_y); } return TRUE; } static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); GooCanvas *canvas; GdkCursor *fleur; #if 0 g_print ("%p received 'button-press' signal at %g, %g (root: %g, %g)\n", item, event->x, event->y, event->x_root, event->y_root); #endif switch (event->button) { case 1: if (event->state & GDK_SHIFT_MASK) { goo_canvas_item_model_remove (model); } else { drag_x = event->x; drag_y = event->y; fleur = gdk_cursor_new (GDK_FLEUR); canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_grab (canvas, item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, fleur, event->time); gdk_cursor_unref (fleur); dragging = TRUE; } break; case 2: goo_canvas_item_model_lower (model, NULL); break; case 3: goo_canvas_item_model_raise (model, NULL); break; default: break; } return TRUE; } static gboolean on_button_release (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; #if 0 g_print ("received 'button-release' signal\n"); #endif canvas = goo_canvas_item_get_canvas (item); goo_canvas_pointer_ungrab (canvas, item, event->time); dragging = FALSE; return TRUE; } static gboolean on_background_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { #if 1 g_print ("background item view received 'button-press' signal\n"); #endif return TRUE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (!goo_canvas_item_model_get_parent (model)) { g_signal_connect (item, "button_press_event", G_CALLBACK (on_background_button_press), NULL); } else if (!g_object_get_data (G_OBJECT (model), "skip-signal-connection")) { g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); g_signal_connect (item, "button_release_event", G_CALLBACK (on_button_release), NULL); } } GtkWidget * create_canvas_primitives (GooCanvasItemModel *model, GooCanvasItemModel *static_model) { GtkWidget *vbox; GtkWidget *hbox; GtkWidget *w; GtkWidget *scrolled_win, *canvas; GtkAdjustment *adj; GSList *group = NULL; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); w = gtk_label_new ("Drag an item with button 1. Click button 2 on an item to lower it, or button 3 to raise it."); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Create the canvas */ canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "automatic-bounds", TRUE, "bounds-from-origin", FALSE, "bounds-padding", 4.0, "background-color-rgb", 0xC3C3FF, "has-tooltip", TRUE, #if 0 "redraw-when-scrolled", TRUE, #endif NULL); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 604, 454); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); /* Zoom */ w = gtk_label_new ("Zoom:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.50)); w = gtk_spin_button_new (adj, 0.0, 2); g_signal_connect (adj, "value_changed", G_CALLBACK (zoom_changed), canvas); gtk_widget_set_size_request (w, 50, -1); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); /* Center: */ w = gtk_check_button_new_with_label("Center scroll region"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); /*gtk_widget_show (w);*/ g_signal_connect (w, "toggled", G_CALLBACK (center_toggled), canvas); /* Move Ellipse */ w = gtk_button_new_with_label("Move Ellipse"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (move_ellipse_clicked), canvas); /* Animate Ellipse */ w = gtk_button_new_with_label("Animate Ellipse"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (animate_ellipse_clicked), canvas); /* Stop Animation */ w = gtk_button_new_with_label("Stop Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked), canvas); #if CAIRO_HAS_PDF_SURFACE /* Create PDF */ w = gtk_button_new_with_label("Write PDF"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (write_pdf_clicked), canvas); #endif w = gtk_button_new_with_label("Change Bounds"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (change_bounds_clicked), canvas); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); /* Scroll to */ w = gtk_label_new ("Scroll To:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_button_new_with_label("50,50"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_50_50_clicked), canvas); w = gtk_button_new_with_label("250,250"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_250_250_clicked), canvas); w = gtk_button_new_with_label("500,500"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (scroll_to_500_500_clicked), canvas); /* Scroll anchor */ w = gtk_label_new ("Anchor:"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); w = gtk_radio_button_new_with_label (group, "NW"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NW)); w = gtk_radio_button_new_with_label (group, "N"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_N)); w = gtk_radio_button_new_with_label (group, "NE"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_NE)); w = gtk_radio_button_new_with_label (group, "W"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_W)); w = gtk_radio_button_new_with_label (group, "C"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_CENTER)); w = gtk_radio_button_new_with_label (group, "E"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_E)); w = gtk_radio_button_new_with_label (group, "SW"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SW)); w = gtk_radio_button_new_with_label (group, "S"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_S)); w = gtk_radio_button_new_with_label (group, "SE"); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w)); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "toggled", G_CALLBACK (anchor_toggled), canvas); g_object_set_data (G_OBJECT (w), "anchor", GINT_TO_POINTER (GTK_ANCHOR_SE)); /* Layout the stuff */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); /* Set the model on the canvas view. The canvas view will then create item views to render each of the items. */ goo_canvas_set_root_item_model (GOO_CANVAS (canvas), model); goo_canvas_set_static_root_item_model (GOO_CANVAS (canvas), static_model); #if 0 g_signal_connect_after (canvas, "key_press_event", G_CALLBACK (key_press), NULL); GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); gtk_widget_grab_focus (canvas); #endif return vbox; } static void setup_heading (GooCanvasItemModel *root, char *text, int pos) { double x = (pos % 3) * 200 + 100; double y = (pos / 3) * 150 + 5; GooCanvasItemModel *item; item = goo_canvas_text_model_new (root, text, x, y, -1, GTK_ANCHOR_N, "font", "Sans 12", NULL); goo_canvas_item_model_skew_y (item, 30, x, y); /*goo_canvas_item_rotate (item, 30, x, y);*/ } static void setup_divisions (GooCanvasItemModel *root) { GooCanvasItemModel *group, *item; group = goo_canvas_group_model_new (root, NULL); goo_canvas_item_model_translate (group, 2, 2); item = goo_canvas_rect_model_new (group, 0, 0, 600, 450, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); item = goo_canvas_polyline_model_new_line (group, 0, 150, 600, 150, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); item = goo_canvas_polyline_model_new_line (group, 0, 300, 600, 300, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); item = goo_canvas_polyline_model_new_line (group, 200, 0, 200, 450, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); item = goo_canvas_polyline_model_new_line (group, 400, 0, 400, 450, "line-width", 4.0, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); #if 1 setup_heading (group, "Rectangles", 0); setup_heading (group, "Ellipses", 1); setup_heading (group, "Texts", 2); setup_heading (group, "Images", 3); setup_heading (group, "Lines", 4); /*setup_heading (group, "No Curves", 5);*/ /*setup_heading (group, "Arcs", 6);*/ setup_heading (group, "Polygons", 7); /*setup_heading (group, "Widgets", 8);*/ #endif } /* FIXME: I think we may need to check byte order. */ static cairo_pattern_t* create_stipple (const char *color_name, guchar stipple_data[16]) { cairo_surface_t *surface; cairo_pattern_t *pattern; GdkColor color; gdk_color_parse (color_name, &color); stipple_data[2] = stipple_data[14] = color.red >> 8; stipple_data[1] = stipple_data[13] = color.green >> 8; stipple_data[0] = stipple_data[12] = color.blue >> 8; surface = cairo_image_surface_create_for_data (stipple_data, CAIRO_FORMAT_ARGB32, 2, 2, 8); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); return pattern; } static void setup_rectangles (GooCanvasItemModel *root) { GooCanvasItemModel *item; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; item = goo_canvas_rect_model_new (root, 20, 30, 50, 30, "stroke-color", "red", "line-width", 8.0, "tooltip", "Red stroked rectangle", NULL); pattern = create_stipple ("mediumseagreen", stipple_data); item = goo_canvas_rect_model_new (root, 90, 40, 90, 60, "fill-pattern", pattern, "stroke-color", "black", "line-width", 4.0, "tooltip", "Medium Sea Green stippled rectangle", NULL); cairo_pattern_destroy (pattern); item = goo_canvas_rect_model_new (root, 10, 80, 70, 60, "fill-color", "steelblue", /*"fill-pattern", NULL,*/ "tooltip", "Steel Blue rectangle", NULL); item = goo_canvas_rect_model_new (root, 20, 90, 70, 60, "fill-color-rgba", 0x3cb37180, "stroke-color", "blue", "line-width", 2.0, "tooltip", "Partially transparent rectangle", NULL); item = goo_canvas_rect_model_new (root, 110, 80, 50, 30, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color-rgba", 0x3cb3f180, "tooltip", "Rectangle with rounded corners", NULL); } static void setup_ellipses (GooCanvasItemModel *root) { GooCanvasItemModel *ellipse1, *ellipse3; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; ellipse1 = goo_canvas_ellipse_model_new (root, 245, 45, 25, 15, "stroke-color", "goldenrod", "line-width", 8.0, NULL); #if 1 ellipse2 = goo_canvas_ellipse_model_new (root, 335, 70, 45, 30, "fill-color", "wheat", "stroke-color", "midnightblue", "line-width", 4.0, "title", "An ellipse", NULL); #if 0 goo_canvas_item_model_rotate (ellipse2, 45, 335, 70); #endif pattern = create_stipple ("cadetblue", stipple_data); ellipse3 = goo_canvas_ellipse_model_new (root, 245, 110, 35, 30, "fill-pattern", pattern, "stroke-color", "black", "line-width", 1.0, NULL); cairo_pattern_destroy (pattern); #endif #if 0 { GooCanvasItem *clone = goo_canvas_clone_model_new (root, ellipse1); goo_canvas_item_translate (clone, 100, 100); } #endif } #define VERTICES 10 #define RADIUS 60.0 static void polish_diamond (GooCanvasItemModel *root) { GooCanvasItemModel *group, *item; int i, j; double a, x1, y1, x2, y2; group = goo_canvas_group_model_new (root, "line-width", 1.0, "line-cap", CAIRO_LINE_CAP_ROUND, NULL); goo_canvas_item_model_translate (group, 270, 230); for (i = 0; i < VERTICES; i++) { a = 2.0 * M_PI * i / VERTICES; x1 = RADIUS * cos (a); y1 = RADIUS * sin (a); for (j = i + 1; j < VERTICES; j++) { a = 2.0 * M_PI * j / VERTICES; x2 = RADIUS * cos (a); y2 = RADIUS * sin (a); item = goo_canvas_polyline_model_new_line (group, x1, y1, x2, y2, NULL); g_object_set_data (G_OBJECT (item), "skip-signal-connection", "TRUE"); } } } #define SCALE 7.0 static void make_hilbert (GooCanvasItemModel *root) { char hilbert[] = "urdrrulurulldluuruluurdrurddldrrruluurdrurddldrddlulldrdldrrurd"; char *c; double *pp, *p; GooCanvasItemModel *item; GooCanvasPoints *points; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; points = goo_canvas_points_new (strlen (hilbert) + 1); points->coords[0] = 340.0; points->coords[1] = 290.0; pp = points->coords; for (c = hilbert, p = points->coords + 2; *c; c++, p += 2, pp += 2) switch (*c) { case 'u': p[0] = pp[0]; p[1] = pp[1] - SCALE; break; case 'd': p[0] = pp[0]; p[1] = pp[1] + SCALE; break; case 'l': p[0] = pp[0] - SCALE; p[1] = pp[1]; break; case 'r': p[0] = pp[0] + SCALE; p[1] = pp[1]; break; } pattern = create_stipple ("red", stipple_data); item = goo_canvas_polyline_model_new (root, FALSE, 0, "points", points, "line-width", 4.0, "stroke-pattern", pattern, "line-cap", CAIRO_LINE_CAP_SQUARE, "line-join", CAIRO_LINE_JOIN_MITER, NULL); cairo_pattern_destroy (pattern); goo_canvas_points_unref (points); } static void setup_lines (GooCanvasItemModel *root) { GooCanvasItemModel *polyline1, *polyline2, *polyline3, *polyline4, *polyline5; polish_diamond (root); make_hilbert (root); /* Arrow tests */ polyline1 = goo_canvas_polyline_model_new (root, FALSE, 4, 340.0, 170.0, 340.0, 230.0, 390.0, 230.0, 390.0, 170.0, "stroke-color", "midnightblue", "line-width", 3.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 3.0, "arrow-length", 4.0, "arrow-width", 3.5, NULL); polyline2 = goo_canvas_polyline_model_new (root, FALSE, 2, 356.0, 180.0, 374.0, 220.0, "stroke-color", "blue", "line-width", 1.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 5.0, "arrow-length", 6.0, "arrow-width", 6.0, NULL); polyline3 = goo_canvas_polyline_model_new (root, FALSE, 2, 356.0, 220.0, 374.0, 180.0, "stroke-color", "blue", "line-width", 1.0, "start-arrow", TRUE, "end-arrow", TRUE, "arrow-tip-length", 5.0, "arrow-length", 6.0, "arrow-width", 6.0, NULL); /* Test polyline without any coords. */ polyline4 = goo_canvas_polyline_model_new (root, FALSE, 0, NULL); /* Test polyline with 1 coord and arrows. */ polyline5 = goo_canvas_polyline_model_new (root, FALSE, 1, 356.0, 220.0, "start-arrow", TRUE, "end-arrow", TRUE, NULL); } static void setup_polygons (GooCanvasItemModel *root) { GooCanvasItemModel *polyline1, *polyline2; GooCanvasPoints *points; cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; points = goo_canvas_points_new (3); points->coords[0] = 210.0; points->coords[1] = 320.0; points->coords[2] = 210.0; points->coords[3] = 380.0; points->coords[4] = 260.0; points->coords[5] = 350.0; pattern = create_stipple ("blue", stipple_data); polyline1 = goo_canvas_polyline_model_new (root, TRUE, 0, "line-width", 1.0, "points", points, "fill_pattern", pattern, "stroke_color", "black", NULL); cairo_pattern_destroy (pattern); goo_canvas_points_unref (points); points = goo_canvas_points_new (14); points->coords[0] = 270.0; points->coords[1] = 330.0; points->coords[2] = 270.0; points->coords[3] = 430.0; points->coords[4] = 390.0; points->coords[5] = 430.0; points->coords[6] = 390.0; points->coords[7] = 330.0; points->coords[8] = 310.0; points->coords[9] = 330.0; points->coords[10] = 310.0; points->coords[11] = 390.0; points->coords[12] = 350.0; points->coords[13] = 390.0; points->coords[14] = 350.0; points->coords[15] = 370.0; points->coords[16] = 330.0; points->coords[17] = 370.0; points->coords[18] = 330.0; points->coords[19] = 350.0; points->coords[20] = 370.0; points->coords[21] = 350.0; points->coords[22] = 370.0; points->coords[23] = 410.0; points->coords[24] = 290.0; points->coords[25] = 410.0; points->coords[26] = 290.0; points->coords[27] = 330.0; polyline2 = goo_canvas_polyline_model_new (root, TRUE, 0, "points", points, "fill_color", "tan", "stroke_color", "black", "line-width", 3.0, NULL); goo_canvas_points_unref (points); } static GooCanvasItemModel * make_anchor (GooCanvasItemModel *root, double x, double y) { GooCanvasItemModel *group, *item; cairo_matrix_t transform = { 0.8, 0.2, -0.3, 0.5, x, y }; group = goo_canvas_group_model_new (root, NULL); goo_canvas_item_model_translate (group, x, y); #if 1 g_object_set (group, "transform", &transform, NULL); #endif item = goo_canvas_rect_model_new (group, -2.5, -2.5, 4, 4, "line-width", 1.0, NULL); return group; } static void setup_texts (GooCanvasItemModel *root) { cairo_pattern_t *pattern; static guchar stipple_data[16] = { 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255 }; #if 1 pattern = create_stipple ("blue", stipple_data); goo_canvas_text_model_new (make_anchor (root, 420, 20), "Anchor NW", 0, 0, -1, GTK_ANCHOR_NW, "font", "Sans Bold 24", "fill_pattern", pattern, NULL); cairo_pattern_destroy (pattern); goo_canvas_text_model_new (make_anchor (root, 470, 75), "Anchor center\nJustify center\nMultiline text\nb8bit text ÅÄÖåäö", 0, 0, -1, GTK_ANCHOR_CENTER, "font", "monospace bold 14", "alignment", PANGO_ALIGN_CENTER, "fill_color", "firebrick", NULL); #endif #if 0 goo_canvas_text_model_new (make_anchor (root, 590, 140), "Clipped text\nClipped text\nClipped text\nClipped text\nClipped text\nClipped text", 0, 0, -1, GTK_ANCHOR_SE, "font", "Sans 12", /*"clip", TRUE,*/ /*"clip_width", 50.0,*/ /*"clip_height", 55.0,*/ /*"x_offset", 10.0,*/ "fill_color", "darkgreen", NULL); #endif #if 1 textitem = goo_canvas_text_model_new (make_anchor (root, 420, 240), "This is a very long paragraph that will need to be wrapped over several lines so we can see what happens to line-breaking as the view is zoomed in and out.", 0, 0, 180, GTK_ANCHOR_W, "font", "Sans 12", "fill_color", "goldenrod", NULL); #endif #if 1 textitem = goo_canvas_text_model_new (root, "Ellipsized text.", 20, 420, 115, GTK_ANCHOR_W, "font", "Sans 12", "fill_color", "blue", "ellipsize", PANGO_ELLIPSIZE_END, NULL); #endif } static void setup_invisible_texts (GooCanvasItemModel *root) { goo_canvas_text_model_new (root, "Visible above 0.8x", 500, 330, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 0.8, NULL); goo_canvas_rect_model_new (root, 410.5, 322.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 0.8, NULL); goo_canvas_text_model_new (root, "Visible above 1.5x", 500, 350, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 1.5, NULL); goo_canvas_rect_model_new (root, 410.5, 342.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 1.5, NULL); goo_canvas_text_model_new (root, "Visible above 3.0x", 500, 370, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 3.0, NULL); goo_canvas_rect_model_new (root, 410.5, 362.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "visibility-threshold", 3.0, NULL); /* This should never be seen. */ goo_canvas_text_model_new (root, "Always Invisible", 500, 390, -1, GTK_ANCHOR_CENTER, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); goo_canvas_rect_model_new (root, 410.5, 350.5, 180, 15, "line-width", 1.0, "visibility", GOO_CANVAS_ITEM_INVISIBLE, NULL); } static void plant_flower (GooCanvasItemModel *root, double x, double y, GtkAnchorType anchor) { cairo_pattern_t *pattern; cairo_surface_t *surface; GooCanvasItemModel *image; double w, h; surface = cairo_image_surface_create_from_png ("flower.png"); w = cairo_image_surface_get_width (surface); h = cairo_image_surface_get_height (surface); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); image = goo_canvas_image_model_new (root, NULL, x, y, "pattern", pattern, "width", w * 1.5, "height", h * 2, "scale-to-fit", TRUE, NULL); cairo_pattern_destroy (pattern); } static void setup_images (GooCanvasItemModel *root) { GdkPixbuf *im; GooCanvasItemModel *image; im = gdk_pixbuf_new_from_file ("toroid.png", NULL); if (im) { double w = gdk_pixbuf_get_width (im); double h = gdk_pixbuf_get_height (im); image = goo_canvas_image_model_new (root, im, 100.0 - w / 2, 225.0 - h / 2, "width", w, "height", h, /* "anchor", GTK_ANCHOR_CENTER, */ NULL); g_object_unref(im); } else g_warning ("Could not find the toroid.png sample file"); plant_flower (root, 20.0, 170.0, GTK_ANCHOR_NW); plant_flower (root, 180.0, 170.0, GTK_ANCHOR_NE); plant_flower (root, 20.0, 280.0, GTK_ANCHOR_SW); plant_flower (root, 180.0, 280.0, GTK_ANCHOR_SE); } static GooCanvasItemModel* create_static_model () { GooCanvasItemModel *static_root, *group, *item; static_root = goo_canvas_group_model_new (NULL, NULL); group = goo_canvas_group_model_new (static_root, NULL); item = goo_canvas_polyline_model_new_line (group, 40.0, 410.0, 40.0, 330.0, "stroke-color", "midnightblue", "line-width", 3.0, "end-arrow", TRUE, "arrow-tip-length", 3.0, "arrow-length", 4.0, "arrow-width", 3.5, NULL); item = goo_canvas_polyline_model_new_line (group, 32.0, 370.0, 48.0, 370.0, "stroke-color", "midnightblue", "line-width", 3.0, NULL); item = goo_canvas_text_model_new (group, "N", 40, 320, -1, GTK_ANCHOR_S, "font", "Sans 12", NULL); return static_root; } static void test_simple_transforms (GooCanvasItemModel *root) { #if 0 GooCanvasItemModel *item; int rotation, x, y; double scale, x_out, y_out, scale_out, rotation_out, max_error = 0.0000001; item = goo_canvas_rect_model_new (root, 20, 30, 50, 30, NULL); for (rotation = 0; rotation < 360; rotation += 20) { scale = 0.1; while (scale < 10) { g_print ("Rotation: %i Scale: %g\n", rotation, scale); for (x = -100; x < 100; x += 10) { for (y = -100; y < 100; y += 10) { goo_canvas_item_model_set_simple_transform (item, x, y, scale, rotation); goo_canvas_item_model_get_simple_transform (item, &x_out, &y_out, &scale_out, &rotation_out); if (fabs (x_out - x) > max_error || fabs (y_out - y) > max_error || fabs (scale_out - scale) > max_error || fabs (rotation_out - rotation) > max_error) { g_print ("IN X:%i Y:%i Scale:%g Rotation:%i -> %g, %g, %g, %g\n", x, y, scale, rotation, x_out, y_out, scale_out, rotation_out); } } } scale += 0.1; } } #endif } static void setup_grids (GooCanvasItemModel *root) { GooCanvasItemModel *item; item = goo_canvas_grid_model_new (root, 80, 310, 90, 90, 10, 10, 5, 5, "stroke-color", "yellow", "fill-color", "pink", "border-width", 2.0, "border-color", "red", "vert-grid-line-color", "lightblue", "horz-grid-line-width", 1.0, "vert-grid-line-width", 1.0, "vert-grid-lines-on-top", TRUE, NULL); } static GooCanvasItemModel* create_model (void) { GooCanvasItemModel *root; root = goo_canvas_group_model_new (NULL, NULL); /* Setup canvas items */ #if 1 setup_divisions (root); setup_rectangles (root); setup_ellipses (root); setup_lines (root); setup_polygons (root); setup_texts (root); setup_images (root); setup_invisible_texts (root); setup_grids (root); #endif #if 0 setup_widgets (root); #endif test_simple_transforms (root); return root; } static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { gtk_main_quit (); return FALSE; } static GtkWidget* create_window (GooCanvasItemModel *model, GooCanvasItemModel *static_model) { GtkWidget *window, *notebook; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", G_CALLBACK (on_delete_event), NULL); notebook = gtk_notebook_new (); gtk_widget_show (notebook); gtk_container_add (GTK_CONTAINER (window), notebook); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_primitives (model, static_model), gtk_label_new ("Primitives")); #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_arrowhead (), gtk_label_new ("Arrowhead")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_fifteen (), gtk_label_new ("Fifteen")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_features (), gtk_label_new ("Features")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_canvas_scalability (), gtk_label_new ("Scalability")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_grabs_page (), gtk_label_new ("Grabs")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_events_page (), gtk_label_new ("Events")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_paths_page (), gtk_label_new ("Paths")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_focus_page (), gtk_label_new ("Focus")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_animation_page (), gtk_label_new ("Animation")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_clipping_page (), gtk_label_new ("Clipping")); #endif #if 1 gtk_notebook_append_page (GTK_NOTEBOOK (notebook), create_table_page (), gtk_label_new ("Table")); #endif return window; } int main (int argc, char *argv[]) { GooCanvasItemModel *model, *static_model; GtkWidget *window; gtk_set_locale (); gtk_init (&argc, &argv); model = create_model (); static_model = create_static_model (); /* Create 2 windows to show off multiple views. */ window = create_window (model, static_model); #if 1 window = create_window (model, static_model); #endif g_object_unref (model); g_object_unref (static_model); gtk_main (); return 0; } goocanvas-0.15/demo/mv-demo-features.c0000644000076400007640000000770611172574677014653 00000000000000#include #include #include #include static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItemModel *model = goo_canvas_item_get_model (item); GooCanvasItemModel *parent1, *parent2, *parent; if (event->button != 1 || event->type != GDK_BUTTON_PRESS) return FALSE; parent1 = g_object_get_data (G_OBJECT (model), "parent1"); parent2 = g_object_get_data (G_OBJECT (model), "parent2"); parent = goo_canvas_item_model_get_parent (model); g_object_ref (model); goo_canvas_item_model_remove (model); if (parent == parent1) goo_canvas_item_model_add_child (parent2, model, -1); else goo_canvas_item_model_add_child (parent1, model, -1); g_object_unref (model); return TRUE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (g_object_get_data (G_OBJECT (model), "parent1")) { g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); } } GtkWidget * create_canvas_features (void) { GtkWidget *vbox; GtkWidget *w; GtkWidget *alignment; GtkWidget *frame; GtkWidget *canvas; GooCanvasItemModel *root, *item; GooCanvasItemModel *parent1; GooCanvasItemModel *parent2; GooCanvasItemModel *group; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); /* Instructions */ w = gtk_label_new ("Reparent test: click on the items to switch them between parents"); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); /* Frame and canvas */ alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); root = goo_canvas_group_model_new (NULL, NULL); gtk_widget_set_size_request (canvas, 400, 200); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 400, 200); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); /* First parent and box */ parent1 = goo_canvas_group_model_new (root, NULL); goo_canvas_rect_model_new (parent1, 0, 0, 200, 200, "fill_color", "tan", NULL); /* Second parent and box */ parent2 = goo_canvas_group_model_new (root, NULL); goo_canvas_item_model_translate (parent2, 200, 0); goo_canvas_rect_model_new (parent2, 0, 0, 200, 200, "fill_color", "#204060", NULL); /* Big circle to be reparented */ item = goo_canvas_ellipse_model_new (parent1, 100, 100, 90, 90, "stroke_color", "black", "fill_color", "mediumseagreen", "line-width", 3.0, NULL); g_object_set_data (G_OBJECT (item), "parent1", parent1); g_object_set_data (G_OBJECT (item), "parent2", parent2); #if 0 g_signal_connect (G_OBJECT (item), "event", G_CALLBACK (item_event), NULL); #endif /* A group to be reparented */ group = goo_canvas_group_model_new (parent2, NULL); goo_canvas_item_model_translate (group, 100, 100); goo_canvas_ellipse_model_new (group, 0, 0, 50, 50, "stroke_color", "black", "fill_color", "wheat", "line_width", 3.0, NULL); goo_canvas_ellipse_model_new (group, 0, 0, 25, 25, "fill_color", "steelblue", NULL); g_object_set_data (G_OBJECT (group), "parent1", parent1); g_object_set_data (G_OBJECT (group), "parent2", parent2); #if 0 g_signal_connect (G_OBJECT (group), "event", G_CALLBACK (item_event), NULL); #endif goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); /* Done */ return vbox; } goocanvas-0.15/demo/mv-demo-events.c0000644000076400007640000001273311172574677014335 00000000000000#include #include #include #include static gboolean on_motion_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event, gpointer data) { GooCanvasItemModel *model = NULL; char *item_id = NULL; if (target) model = goo_canvas_item_get_model (target); if (model) item_id = g_object_get_data (G_OBJECT (model), "id"); if (item_id) g_print ("%s item received 'motion-notify' signal\n", item_id); return FALSE; } static void on_item_created (GooCanvas *view, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { g_signal_connect (item, "motion_notify_event", G_CALLBACK (on_motion_notify), NULL); } static void create_events_area (GooCanvasItemModel *root, gint area_num, GooCanvasPointerEvents pointer_events, gchar *label) { gint row = area_num / 3, col = area_num % 3; gdouble x = col * 200, y = row * 150; GooCanvasItemModel *rect; char *view_id; GooCanvasLineDash *dash; dash = goo_canvas_line_dash_new (2, 5.0, 5.0); /* Create invisible item. */ rect = goo_canvas_rect_model_new (root, x + 45, y + 35, 30, 30, "fill-color", "red", "visibility", GOO_CANVAS_ITEM_INVISIBLE, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s invisible", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); /* Display a thin rect around it to indicate it is there. */ #if 1 rect = goo_canvas_rect_model_new (root, x + 42.5, y + 32.5, 36, 36, "line-dash", dash, "line-width", 1.0, "stroke-color", "gray", NULL); #endif /* Create unpainted item. */ rect = goo_canvas_rect_model_new (root, x + 85, y + 35, 30, 30, "stroke-pattern", NULL, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s unpainted", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); /* Display a thin rect around it to indicate it is there. */ #if 1 rect = goo_canvas_rect_model_new (root, x + 82.5, y + 32.5, 36, 36, "line-dash", dash, "line-width", 1.0, "stroke-color", "gray", NULL); #endif /* Create stroked item. */ rect = goo_canvas_rect_model_new (root, x + 125, y + 35, 30, 30, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s stroked", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); /* Create filled item. */ rect = goo_canvas_rect_model_new (root, x + 60, y + 75, 30, 30, "fill-color", "red", "stroke-pattern", NULL, "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s filled", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); /* Create stroked & filled item. */ rect = goo_canvas_rect_model_new (root, x + 100, y + 75, 30, 30, "fill-color", "red", "line-width", 5.0, "pointer-events", pointer_events, NULL); view_id = g_strdup_printf ("%s stroked & filled", label); g_object_set_data_full (G_OBJECT (rect), "id", view_id, g_free); goo_canvas_text_model_new (root, label, x + 100, y + 130, -1, GTK_ANCHOR_CENTER, "font", "Sans 12", "fill-color", "blue", NULL); goo_canvas_line_dash_unref (dash); } GtkWidget * create_events_page (void) { GtkWidget *vbox, *alignment, *frame, *label, *canvas; GooCanvasItemModel *root; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); /* Instructions */ label = gtk_label_new ("Move the mouse over the items to check they receive the right motion events.\nThe first 2 items in each group are 1) invisible and 2) visible but unpainted."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Frame and canvas */ alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); root = goo_canvas_group_model_new (NULL, NULL); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 600, 450); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); create_events_area (root, 0, GOO_CANVAS_EVENTS_NONE, "none"); create_events_area (root, 1, GOO_CANVAS_EVENTS_VISIBLE_PAINTED, "visible-painted"); create_events_area (root, 2, GOO_CANVAS_EVENTS_VISIBLE_FILL, "visible-fill"); create_events_area (root, 3, GOO_CANVAS_EVENTS_VISIBLE_STROKE, "visible-stroke"); create_events_area (root, 4, GOO_CANVAS_EVENTS_VISIBLE, "visible"); create_events_area (root, 5, GOO_CANVAS_EVENTS_PAINTED, "painted"); create_events_area (root, 6, GOO_CANVAS_EVENTS_FILL, "fill"); create_events_area (root, 7, GOO_CANVAS_EVENTS_STROKE, "stroke"); create_events_area (root, 8, GOO_CANVAS_EVENTS_ALL, "all"); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); return vbox; } goocanvas-0.15/demo/mv-demo-fifteen.c0000644000076400007640000001637411172574677014456 00000000000000#include #include #include #include #include #include #include #include #define PIECE_SIZE 50 static void free_stuff (GtkObject *obj, gpointer data) { g_free (data); } static void test_win (GooCanvasItemModel **board) { int i; #if 0 GtkWidget *dlg; #endif for (i = 0; i < 15; i++) if (!board[i] || (GPOINTER_TO_INT (g_object_get_data (G_OBJECT (board[i]), "piece_num")) != i)) return; #if 0 dlg=gnome_ok_dialog ("You stud, you win!"); gtk_window_set_modal(GTK_WINDOW(dlg),TRUE); gnome_dialog_run (GNOME_DIALOG (dlg)); #endif } static char * get_piece_color (int piece) { static char buf[50]; int x, y; int r, g, b; y = piece / 4; x = piece % 4; r = ((4 - x) * 255) / 4; g = ((4 - y) * 255) / 4; b = 128; sprintf (buf, "#%02x%02x%02x", r, g, b); return buf; } static gboolean piece_enter_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event, gpointer data) { GooCanvasItemModel *model, *text; #if 0 g_print ("In piece_enter_notify\n"); #endif model = goo_canvas_item_get_model (item); text = g_object_get_data (G_OBJECT (model), "text"); g_object_set (text, "fill_color", "white", NULL); return FALSE; } static gboolean piece_leave_notify (GooCanvasItem *item, GooCanvasItem *target, GdkEvent *event, gpointer data) { GooCanvasItemModel *model, *text; #if 0 g_print ("In piece_leave_notify\n"); #endif model = goo_canvas_item_get_model (item); text = g_object_get_data (G_OBJECT (model), "text"); g_object_set (text, "fill_color", "black", NULL); return FALSE; } static gboolean piece_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GooCanvasItemModel **board; GooCanvasItemModel *model, *text; int num, pos, newpos; int x, y; double dx = 0.0, dy = 0.0; int move; model = goo_canvas_item_get_model (item); canvas = goo_canvas_item_get_canvas (item); board = g_object_get_data (G_OBJECT (canvas), "board"); num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (model), "piece_num")); pos = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (model), "piece_pos")); text = g_object_get_data (G_OBJECT (model), "text"); #if 0 g_print ("In piece_event pos: %i,%i num: %i\n", pos % 4, pos / 4, num + 1); #endif y = pos / 4; x = pos % 4; move = TRUE; if ((y > 0) && (board[(y - 1) * 4 + x] == NULL)) { dx = 0.0; dy = -1.0; y--; } else if ((y < 3) && (board[(y + 1) * 4 + x] == NULL)) { dx = 0.0; dy = 1.0; y++; } else if ((x > 0) && (board[y * 4 + x - 1] == NULL)) { dx = -1.0; dy = 0.0; x--; } else if ((x < 3) && (board[y * 4 + x + 1] == NULL)) { dx = 1.0; dy = 0.0; x++; } else move = FALSE; if (move) { newpos = y * 4 + x; board[pos] = NULL; board[newpos] = model; g_object_set_data (G_OBJECT (model), "piece_pos", GINT_TO_POINTER (newpos)); goo_canvas_item_model_translate (model, dx * PIECE_SIZE, dy * PIECE_SIZE); test_win (board); } return FALSE; } static void on_item_created (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer data) { if (goo_canvas_item_model_get_parent (model) && GOO_IS_CANVAS_GROUP_MODEL (model)) { g_signal_connect (item, "enter_notify_event", G_CALLBACK (piece_enter_notify), NULL); g_signal_connect (item, "leave_notify_event", G_CALLBACK (piece_leave_notify), NULL); g_signal_connect (item, "button_press_event", G_CALLBACK (piece_button_press), NULL); } } #define SCRAMBLE_MOVES 256 static void scramble (GtkObject *object, gpointer data) { GooCanvas *canvas; GooCanvasItemModel **board; int i; int pos, oldpos; int dir; int x, y; srand (time (NULL)); canvas = data; board = g_object_get_data (G_OBJECT (canvas), "board"); /* First, find the blank spot */ for (pos = 0; pos < 16; pos++) if (board[pos] == NULL) break; /* "Move the blank spot" around in order to scramble the pieces */ for (i = 0; i < SCRAMBLE_MOVES; i++) { retry_scramble: dir = rand () % 4; x = y = 0; if ((dir == 0) && (pos > 3)) /* up */ y = -1; else if ((dir == 1) && (pos < 12)) /* down */ y = 1; else if ((dir == 2) && ((pos % 4) != 0)) /* left */ x = -1; else if ((dir == 3) && ((pos % 4) != 3)) /* right */ x = 1; else goto retry_scramble; oldpos = pos + y * 4 + x; board[pos] = board[oldpos]; board[oldpos] = NULL; g_object_set_data (G_OBJECT (board[pos]), "piece_pos", GINT_TO_POINTER (pos)); goo_canvas_item_model_translate (board[pos], -x * PIECE_SIZE, -y * PIECE_SIZE); pos = oldpos; } } GtkWidget * create_canvas_fifteen (void) { GtkWidget *vbox; GtkWidget *alignment; GtkWidget *frame; GtkWidget *canvas; GtkWidget *button; GooCanvasItemModel **board; GooCanvasItemModel *root, *rect, *text; int i, x, y; char buf[20]; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, TRUE, TRUE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); /* Create the canvas and board */ canvas = goo_canvas_new (); g_signal_connect (canvas, "item_created", G_CALLBACK (on_item_created), NULL); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); gtk_widget_set_size_request (canvas, PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, PIECE_SIZE * 4 + 1, PIECE_SIZE * 4 + 1); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); board = g_new (GooCanvasItemModel *, 16); g_object_set_data (G_OBJECT (canvas), "board", board); g_signal_connect (canvas, "destroy", G_CALLBACK (free_stuff), board); for (i = 0; i < 15; i++) { y = i / 4; x = i % 4; board[i] = goo_canvas_group_model_new (root, NULL); goo_canvas_item_model_translate (board[i], x * PIECE_SIZE, y * PIECE_SIZE); rect = goo_canvas_rect_model_new (board[i], 0, 0, PIECE_SIZE, PIECE_SIZE, "fill_color", get_piece_color (i), "stroke_color", "black", "line-width", 1.0, NULL); sprintf (buf, "%d", i + 1); text = goo_canvas_text_model_new (board[i], buf, PIECE_SIZE / 2.0, PIECE_SIZE / 2.0, -1, GTK_ANCHOR_CENTER, "font", "Sans bold 24", "fill_color", "black", NULL); g_object_set_data (G_OBJECT (board[i]), "text", text); g_object_set_data (G_OBJECT (board[i]), "piece_num", GINT_TO_POINTER (i)); g_object_set_data (G_OBJECT (board[i]), "piece_pos", GINT_TO_POINTER (i)); } board[15] = NULL; /* Scramble button */ button = gtk_button_new_with_label ("Scramble"); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); g_object_set_data (G_OBJECT (button), "board", board); g_signal_connect (button, "clicked", G_CALLBACK (scramble), canvas); gtk_widget_show (button); return vbox; } goocanvas-0.15/demo/generic-position-demo.c0000644000076400007640000001676211172574677015675 00000000000000#include #include typedef enum { MODE_MOVE, MODE_RESIZE } Mode; Mode drag_mode; GooCanvasItem *drag_item = NULL; gdouble drag_x = 0.0; gdouble drag_y = 0.0; gdouble item_x = 0.0; gdouble item_y = 0.0; gdouble item_width = 0.0; gdouble item_height = 0.0; static gboolean on_button_press_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) { if (event->state & GDK_CONTROL_MASK) { if (event->button == 1 || event->button == 3) { if (event->button == 1) drag_mode = MODE_MOVE; else drag_mode = MODE_RESIZE; drag_item = item; drag_x = event->x; drag_y = event->y; g_object_get (G_OBJECT (item), "x", &item_x, "y", &item_y, "width", &item_width, "height", &item_height, NULL); goo_canvas_pointer_grab (GOO_CANVAS (user_data), item, GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_RELEASE_MASK, NULL, event->time); return TRUE; } } return FALSE; } static gboolean on_button_release_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) { if (drag_item == item && drag_item != NULL) { goo_canvas_pointer_ungrab (GOO_CANVAS (user_data), drag_item, event->time); drag_item = NULL; return TRUE; } return FALSE; } static gboolean on_motion_notify_event_cb (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventMotion *event, gpointer user_data) { if (drag_item == item && drag_item != NULL) { gdouble rel_x = event->x - drag_x; gdouble rel_y = event->y - drag_y; if (drag_mode == MODE_MOVE) { g_object_set (G_OBJECT (item), "x", item_x + rel_x, "y", item_y + rel_y, NULL); } else { gdouble new_width = MAX (item_width + rel_x, 5.0); gdouble new_height = MAX (item_height + rel_y, 5.0); g_object_set (G_OBJECT (item), "width", new_width, "height", new_height, NULL); } return TRUE; } return FALSE; } static void setup_dnd_handlers (GooCanvas *canvas, GooCanvasItem *item) { g_signal_connect (G_OBJECT (item), "button-press-event", G_CALLBACK (on_button_press_event_cb), canvas); g_signal_connect (G_OBJECT (item), "button-release-event", G_CALLBACK (on_button_release_event_cb), canvas); /* g_signal_connect (G_OBJECT (item), "grab-broken-event", G_CALLBACK (on_button_release_event_cb), canvas);*/ g_signal_connect (G_OBJECT (item), "motion-notify-event", G_CALLBACK (on_motion_notify_event_cb), canvas); } void setup_canvas (GtkWidget *canvas) { GooCanvasItem *root; GooCanvasItem *item; GdkPixbuf *pixbuf; GtkWidget *button; GooCanvasItem* child; root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Test clipping of GooCanvasGroup: We put the rectangle and the ellipse into * a group with width=200 and height=200. */ item = goo_canvas_group_new (root, "x", 50.0, "y", 350.0, "width", 200.0, "height", 200.0, NULL); /*goo_canvas_item_rotate(item, 45.0, 150.0, 450.0);*/ child = goo_canvas_rect_new (item, 0.0, 0.0, 100, 100, "fill-color", "blue", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_rotate(child, 45.0, 50.0, 50.0); child = goo_canvas_ellipse_new (item, 150, 00, 50, 50, "fill-color", "red", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); item = goo_canvas_polyline_new (root, FALSE, 5.0, 250.0, 350.0, 275.0, 400.0, 300.0, 350.0, 325.0, 400.0, 350.0, 350.0, "stroke-color", "cyan", "line-width", 5.0, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), item); item = goo_canvas_path_new (root, "M20,500 C20,450 100,450 100,500", "stroke-color", "green", "line-width", 5.0, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), item); pixbuf = gtk_widget_render_icon (GTK_WIDGET (canvas), GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG, NULL); item = goo_canvas_image_new (root, pixbuf, 150, 450, /*"fill-color", "yellow", */NULL); g_object_unref (pixbuf); setup_dnd_handlers (GOO_CANVAS (canvas), item); item = goo_canvas_text_new (root, "Hello, World!", 250, 450, -1, GTK_ANCHOR_NW, "fill-color", "magenta", "wrap", PANGO_WRAP_WORD_CHAR, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), item); button = gtk_label_new ("GtkLabel"); item = goo_canvas_widget_new (root, button, 50, 550, -1, -1, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), item); item = goo_canvas_table_new (root, "horz-grid-line-width", 2.0, "vert-grid-line-width", 2.0, "row-spacing", 2.0, "column-spacing", 2.0, NULL); goo_canvas_item_translate (item, 10.0, 10.0); setup_dnd_handlers (GOO_CANVAS (canvas), item); child = goo_canvas_rect_new (item, 10.0, 10.0, 50.0, 50.0, "fill-color", "blue", "x", 10.0, "y", 25.0, NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_set_child_properties (item, child, "column", 0, "row", 0, "columns", 1, "rows", 1, NULL); /*goo_canvas_item_translate (child, 10.0, 10.0);*/ child = goo_canvas_rect_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_set_child_properties (item, child, "column", 1, "row", 0, "columns", 1, "rows", 1, NULL); child = goo_canvas_rect_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "green", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_set_child_properties (item, child, "column", 0, "row", 1, "columns", 1, "rows", 1, NULL); child = goo_canvas_rect_new (item, 0.0, 0.0, 50.0, 50.0, "fill-color", "yellow", NULL); setup_dnd_handlers (GOO_CANVAS (canvas), child); goo_canvas_item_set_child_properties (item, child, "column", 1, "row", 1, "columns", 1, "rows", 1, NULL); } int main (int argc, char *argv[]) { GtkWidget *window, *vbox, *label, *scrolled_win, *canvas; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL); vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("Use Ctrl+Left Click to move items or Ctrl+Right Click to resize items"); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_show (label); /* Create top canvas. */ scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = goo_canvas_new (); g_object_set (G_OBJECT (canvas), "integer-layout", TRUE, NULL); /* gtk_widget_set_size_request (canvas, 600, 250);*/ goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); setup_canvas (canvas); gtk_main (); return 0; } goocanvas-0.15/demo/demo-table.c0000644000076400007640000002270111172574677013474 00000000000000#include #include #include #define DEMO_RECT_ITEM 0 #define DEMO_TEXT_ITEM 1 #define DEMO_WIDGET_ITEM 2 static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { gchar *id = g_object_get_data (G_OBJECT (item), "id"); g_print ("%s received 'button-press' signal at %g, %g (root: %g, %g)\n", id ? id : "unknown", event->x, event->y, event->x_root, event->y_root); return TRUE; } static void create_demo_item (GooCanvasItem *table, gint demo_item_type, gint row, gint column, gint rows, gint columns, gchar *text) { GooCanvasItem *item = NULL; GtkWidget *widget; GValue value = { 0 }; guint new_row; switch (demo_item_type) { case DEMO_RECT_ITEM: item = goo_canvas_rect_new (table, 0, 0, 38, 19, "fill-color", "red", NULL); break; case DEMO_TEXT_ITEM: item = goo_canvas_text_new (table, text, 0, 0, -1, GTK_ANCHOR_NW, NULL); break; case DEMO_WIDGET_ITEM: widget = gtk_button_new_with_label (text); item = goo_canvas_widget_new (table, widget, 0, 0, -1, -1, NULL); break; } g_value_init (&value, G_TYPE_UINT); g_value_set_uint (&value, row); goo_canvas_item_set_child_property (table, item, "row", &value); g_value_set_uint (&value, column); goo_canvas_item_set_child_property (table, item, "column", &value); g_value_set_uint (&value, rows); goo_canvas_item_set_child_property (table, item, "rows", &value); g_value_set_uint (&value, columns); goo_canvas_item_set_child_property (table, item, "columns", &value); /* Test the get function. */ goo_canvas_item_get_child_property (table, item, "row", &value); new_row = g_value_get_uint (&value); if (new_row != row) g_warning ("Got bad row setting: %i should be: %i\n", new_row, row); #if 1 goo_canvas_item_set_child_properties (table, item, "x-expand", TRUE, "x-fill", TRUE, "y-expand", TRUE, "y-fill", TRUE, NULL); #endif g_object_set_data (G_OBJECT (item), "id", text); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); } static GooCanvasItem* create_table (GooCanvasItem *parent, gint row, gint column, gint embedding_level, gdouble x, gdouble y, gdouble rotation, gdouble scale, gint demo_item_type) { GooCanvasItem *table; /* Add a few simple items. */ table = goo_canvas_table_new (parent, "row-spacing", 4.0, "column-spacing", 4.0, NULL); goo_canvas_item_translate (table, x, y); #if 1 goo_canvas_item_rotate (table, rotation, 0, 0); #endif #if 1 goo_canvas_item_scale (table, scale, scale); #endif if (row != -1) goo_canvas_item_set_child_properties (parent, table, "row", row, "column", column, #if 1 "x-expand", TRUE, "x-fill", TRUE, #endif #if 0 "y-expand", TRUE, "y-fill", TRUE, #endif NULL); if (embedding_level) { gint level = embedding_level - 1; create_table (table, 0, 0, level, 50, 50, 0, 0.7, demo_item_type); create_table (table, 0, 1, level, 50, 50, 45, 1.0, demo_item_type); create_table (table, 0, 2, level, 50, 50, 90, 1.0, demo_item_type); create_table (table, 1, 0, level, 50, 50, 135, 1.0, demo_item_type); create_table (table, 1, 1, level, 50, 50, 180, 1.5, demo_item_type); create_table (table, 1, 2, level, 50, 50, 225, 1.0, demo_item_type); create_table (table, 2, 0, level, 50, 50, 270, 1.0, demo_item_type); create_table (table, 2, 1, level, 50, 50, 315, 1.0, demo_item_type); create_table (table, 2, 2, level, 50, 50, 360, 2.0, demo_item_type); } else { create_demo_item (table, demo_item_type, 0, 0, 1, 1, "(0,0)"); create_demo_item (table, demo_item_type, 0, 1, 1, 1, "(1,0)"); create_demo_item (table, demo_item_type, 0, 2, 1, 1, "(2,0)"); create_demo_item (table, demo_item_type, 1, 0, 1, 1, "(0,1)"); create_demo_item (table, demo_item_type, 1, 1, 1, 1, "(1,1)"); create_demo_item (table, demo_item_type, 1, 2, 1, 1, "(2,1)"); create_demo_item (table, demo_item_type, 2, 0, 1, 1, "(0,2)"); create_demo_item (table, demo_item_type, 2, 1, 1, 1, "(1,2)"); create_demo_item (table, demo_item_type, 2, 2, 1, 1, "(2,2)"); } return table; } static void create_demo_table (GooCanvasItem *root, gdouble x, gdouble y, gdouble width, gdouble height) { GooCanvasItem *table, *square, *circle, *triangle; table = goo_canvas_table_new (root, "row-spacing", 4.0, "column-spacing", 4.0, "width", width, "height", height, NULL); goo_canvas_item_translate (table, x, y); square = goo_canvas_rect_new (table, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, square, "row", 0, "column", 0, "x-shrink", TRUE, NULL); g_object_set_data (G_OBJECT (square), "id", "Red square"); g_signal_connect (square, "button_press_event", G_CALLBACK (on_button_press), NULL); circle = goo_canvas_ellipse_new (table, 0.0, 0.0, 25.0, 25.0, "fill-color", "blue", NULL); goo_canvas_item_set_child_properties (table, circle, "row", 0, "column", 1, "x-shrink", TRUE, NULL); g_object_set_data (G_OBJECT (circle), "id", "Blue circle"); g_signal_connect (circle, "button_press_event", G_CALLBACK (on_button_press), NULL); triangle = goo_canvas_polyline_new (table, TRUE, 3, 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, "fill-color", "yellow", NULL); goo_canvas_item_set_child_properties (table, triangle, "row", 0, "column", 2, "x-shrink", TRUE, NULL); g_object_set_data (G_OBJECT (triangle), "id", "Yellow triangle"); g_signal_connect (triangle, "button_press_event", G_CALLBACK (on_button_press), NULL); } static void create_width_for_height_table (GooCanvasItem *root, gdouble x, gdouble y, gdouble width, gdouble height, gdouble rotation) { GooCanvasItem *table, *item; gchar *text = "This is a long paragraph that will have to be split over a few lines so we can see if its allocated height changes when its allocated width is changed."; table = goo_canvas_table_new (root, #if 1 "width", width, "height", height, #endif NULL); goo_canvas_item_translate (table, x, y); goo_canvas_item_rotate (table, rotation, 0, 0); item = goo_canvas_rect_new (table, 0.0, 0.0, width - 2, 10.0, "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, item, "row", 0, "column", 0, "x-shrink", TRUE, NULL); #if 1 item = goo_canvas_text_new (table, text, 0, 0, -1, GTK_ANCHOR_NW, NULL); goo_canvas_item_set_child_properties (table, item, "row", 1, "column", 0, "x-expand", TRUE, "x-fill", TRUE, "x-shrink", TRUE, "y-expand", TRUE, "y-fill", TRUE, NULL); g_object_set_data (G_OBJECT (item), "id", "Text Item"); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); #endif item = goo_canvas_rect_new (table, 0.0, 0.0, width - 2, 10.0, "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, item, "row", 2, "column", 0, "x-shrink", TRUE, NULL); } GtkWidget * create_table_page (void) { GtkWidget *vbox, *scrolled_win, *canvas; GooCanvasItem *root, *table; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 2000); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); #if 1 create_demo_table (root, 400, 200, -1, -1); create_demo_table (root, 400, 260, 100, -1); #endif #if 1 create_table (root, -1, -1, 0, 10, 10, 0, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 180, 10, 30, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 350, 10, 60, 1.0, DEMO_TEXT_ITEM); create_table (root, -1, -1, 0, 500, 10, 90, 1.0, DEMO_TEXT_ITEM); #endif #if 1 table = create_table (root, -1, -1, 0, 30, 150, 0, 1.0, DEMO_TEXT_ITEM); g_object_set (table, "width", 300.0, "height", 100.0, NULL); #endif #if 1 create_table (root, -1, -1, 1, 200, 200, 30, 0.8, DEMO_TEXT_ITEM); #endif #if 1 table = create_table (root, -1, -1, 0, 10, 700, 0, 1.0, DEMO_WIDGET_ITEM); g_object_set (table, "width", 300.0, "height", 200.0, NULL); #endif create_width_for_height_table (root, 100, 1000, 200, -1, 0); #if 1 create_width_for_height_table (root, 100, 1200, 300, -1, 0); create_width_for_height_table (root, 500, 1000, 200, -1, 30); create_width_for_height_table (root, 500, 1200, 300, -1, 30); #endif gtk_widget_show (canvas); return vbox; } goocanvas-0.15/demo/mv-demo-animation.c0000644000076400007640000001104311172574677015001 00000000000000#include #include #include #include static GooCanvasItemModel *root = NULL; static GooCanvasItemModel *ellipse1, *ellipse2, *rect1, *rect2, *rect3, *rect4; static void start_animation_clicked (GtkWidget *button, gpointer data) { /* Absolute. */ goo_canvas_item_model_set_simple_transform (ellipse1, 100, 100, 1, 0); goo_canvas_item_model_animate (ellipse1, 500, 100, 2, 720, TRUE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); goo_canvas_item_model_set_simple_transform (rect1, 100, 200, 1, 0); goo_canvas_item_model_animate (rect1, 100, 200, 1, 350, TRUE, 40 * 36, 40, GOO_CANVAS_ANIMATE_RESTART); goo_canvas_item_model_set_simple_transform (rect3, 200, 200, 1, 0); goo_canvas_item_model_animate (rect3, 200, 200, 3, 0, TRUE, 400, 40, GOO_CANVAS_ANIMATE_BOUNCE); /* Relative. */ goo_canvas_item_model_set_simple_transform (ellipse2, 100, 400, 1, 0); goo_canvas_item_model_animate (ellipse2, 400, 0, 2, 720, FALSE, 2000, 40, GOO_CANVAS_ANIMATE_BOUNCE); goo_canvas_item_model_set_simple_transform (rect2, 100, 500, 1, 0); goo_canvas_item_model_animate (rect2, 0, 0, 1, 350, FALSE, 40 * 36, 40, GOO_CANVAS_ANIMATE_RESTART); goo_canvas_item_model_set_simple_transform (rect4, 200, 500, 1, 0); goo_canvas_item_model_animate (rect4, 0, 0, 3, 0, FALSE, 400, 40, GOO_CANVAS_ANIMATE_BOUNCE); } static void stop_animation_clicked (GtkWidget *button, gpointer data) { goo_canvas_item_model_stop_animation (ellipse1); goo_canvas_item_model_stop_animation (ellipse2); goo_canvas_item_model_stop_animation (rect1); goo_canvas_item_model_stop_animation (rect2); goo_canvas_item_model_stop_animation (rect3); goo_canvas_item_model_stop_animation (rect4); } static void on_animation_finished (GooCanvasItemModel *model, gboolean stopped, gpointer data) { g_print ("Animation finished stopped: %i\n", stopped); } static GooCanvasItemModel* create_canvas_model (void) { if (root) return root; root = goo_canvas_group_model_new (NULL, NULL); /* Absolute. */ ellipse1 = goo_canvas_ellipse_model_new (root, 0, 0, 25, 15, "fill-color", "blue", NULL); goo_canvas_item_model_translate (ellipse1, 100, 100); g_signal_connect (ellipse1, "animation_finished", G_CALLBACK (on_animation_finished), NULL); rect1 = goo_canvas_rect_model_new (root, -10, -10, 20, 20, "fill-color", "blue", NULL); goo_canvas_item_model_translate (rect1, 100, 200); rect3 = goo_canvas_rect_model_new (root, -10, -10, 20, 20, "fill-color", "blue", NULL); goo_canvas_item_model_translate (rect3, 200, 200); /* Relative. */ ellipse2 = goo_canvas_ellipse_model_new (root, 0, 0, 25, 15, "fill-color", "red", NULL); goo_canvas_item_model_translate (ellipse2, 100, 400); rect2 = goo_canvas_rect_model_new (root, -10, -10, 20, 20, "fill-color", "red", NULL); goo_canvas_item_model_translate (rect2, 100, 500); rect4 = goo_canvas_rect_model_new (root, -10, -10, 20, 20, "fill-color", "red", NULL); goo_canvas_item_model_translate (rect4, 200, 500); return root; } GtkWidget * create_animation_page (void) { GtkWidget *vbox, *hbox, *w, *scrolled_win, *canvas; GooCanvasItemModel *root; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); hbox = gtk_hbox_new (FALSE, 4); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); w = gtk_button_new_with_label("Start Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (start_animation_clicked), NULL); w = gtk_button_new_with_label("Stop Animation"); gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE, 0); gtk_widget_show (w); g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked), NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (vbox), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = create_canvas_model (); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); return vbox; } goocanvas-0.15/demo/mv-demo-scalability.c0000644000076400007640000000442611172574677015331 00000000000000#include #include #include #include #define N_COLS 5 #define N_ROWS 20 #define PADDING 10 #if 1 #define USE_PIXMAP #endif GtkWidget * create_canvas_scalability (void) { GtkWidget *vbox; GtkWidget *frame; GtkWidget *scrolled_win, *canvas; GtkWidget *table; GdkPixbuf *pixbuf; GooCanvasItemModel *root, *item; int i, j, width, height; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); table = gtk_table_new (2, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 4); gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0); gtk_widget_show (table); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_table_attach (GTK_TABLE (table), frame, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); gtk_widget_show (frame); /* Create the canvas and board */ pixbuf = gdk_pixbuf_new_from_file("toroid.png", NULL); #ifdef USE_PIXMAP width = gdk_pixbuf_get_width (pixbuf) + 3; height = gdk_pixbuf_get_height (pixbuf) +1; #else width = 37; height = 19; #endif canvas = goo_canvas_new (); root = goo_canvas_group_model_new (NULL, NULL); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); g_object_unref (root); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, N_COLS * (width + PADDING), N_ROWS * (height + PADDING)); gtk_widget_show (canvas); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (frame), scrolled_win); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); for (i = 0; i < N_COLS; i++) { for (j = 0; j < N_ROWS; j++) { #ifdef USE_PIXMAP item = goo_canvas_image_model_new (root, pixbuf, i * (width + PADDING), j * (height + PADDING), NULL); #else item = goo_canvas_rect_model_new (root, i * (width + PADDING), j * (height + PADDING), width, height); g_object_set (item, "fill_color", (j%2)?"mediumseagreen":"steelblue", NULL); #endif } } return vbox; } goocanvas-0.15/demo/demo-features.c0000644000076400007640000000670411172574677014230 00000000000000#include #include #include #include #include #include #include #include #include #include static gboolean on_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvasItem *parent1, *parent2, *parent; if (event->button != 1 || event->type != GDK_BUTTON_PRESS) return FALSE; g_print ("In on_button_press\n"); parent1 = g_object_get_data (G_OBJECT (item), "parent1"); parent2 = g_object_get_data (G_OBJECT (item), "parent2"); parent = goo_canvas_item_get_parent (item); g_object_ref (item); goo_canvas_item_remove (item); if (parent == parent1) goo_canvas_item_add_child (parent2, item, -1); else goo_canvas_item_add_child (parent1, item, -1); g_object_unref (item); return TRUE; } GtkWidget * create_canvas_features (void) { GtkWidget *vbox; GtkWidget *w; GtkWidget *alignment; GtkWidget *frame; GtkWidget *canvas; GooCanvasItem *root, *item; GooCanvasItem *parent1; GooCanvasItem *parent2; GooCanvasItem *group; vbox = gtk_vbox_new (FALSE, 4); gtk_container_set_border_width (GTK_CONTAINER (vbox), 4); gtk_widget_show (vbox); /* Instructions */ w = gtk_label_new ("Reparent test: click on the items to switch them between parents"); gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0); gtk_widget_show (w); /* Frame and canvas */ alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (vbox), alignment, FALSE, FALSE, 0); gtk_widget_show (alignment); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (alignment), frame); gtk_widget_show (frame); canvas = goo_canvas_new (); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); gtk_widget_set_size_request (canvas, 400, 200); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 400, 200); gtk_container_add (GTK_CONTAINER (frame), canvas); gtk_widget_show (canvas); /* First parent and box */ parent1 = goo_canvas_group_new (root, NULL); goo_canvas_rect_new (parent1, 0, 0, 200, 200, "fill_color", "tan", NULL); /* Second parent and box */ parent2 = goo_canvas_group_new (root, NULL); goo_canvas_item_translate (parent2, 200, 0); goo_canvas_rect_new (parent2, 0, 0, 200, 200, "fill_color", "#204060", NULL); /* Big circle to be reparented */ item = goo_canvas_ellipse_new (parent1, 100, 100, 90, 90, "stroke_color", "black", "fill_color", "mediumseagreen", "line-width", 3.0, NULL); g_object_set_data (G_OBJECT (item), "parent1", parent1); g_object_set_data (G_OBJECT (item), "parent2", parent2); g_signal_connect (item, "button_press_event", G_CALLBACK (on_button_press), NULL); /* A group to be reparented */ group = goo_canvas_group_new (parent2, NULL); goo_canvas_item_translate (group, 100, 100); goo_canvas_ellipse_new (group, 0, 0, 50, 50, "stroke_color", "black", "fill_color", "wheat", "line_width", 3.0, NULL); goo_canvas_ellipse_new (group, 0, 0, 25, 25, "fill_color", "steelblue", NULL); g_object_set_data (G_OBJECT (group), "parent1", parent1); g_object_set_data (G_OBJECT (group), "parent2", parent2); g_signal_connect (group, "button_press_event", G_CALLBACK (on_button_press), NULL); return vbox; } goocanvas-0.15/Makefile.am0000644000076400007640000000036011172574677012424 00000000000000## Process this file with automake to produce Makefile.in SUBDIRS = src demo docs po # require automake 1.7 AUTOMAKE_OPTIONS = 1.7 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = goocanvas.pc EXTRA_DIST = goocanvas.pc.in autogen.sh goocanvas-0.15/missing0000755000076400007640000002557710656605223011774 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: goocanvas-0.15/configure.in0000644000076400007640000000423611222155610012661 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(goocanvas, 0.15) AC_PREREQ(2.50) AC_CONFIG_SRCDIR(src/goocanvas.c) AC_CONFIG_HEADERS(config.h) AM_INIT_AUTOMAKE # Libtool versioning - only update before a public release. # If the code has changed at all: REVISION++. # If any interfaces have changed at all: CURRENT++, REVISION=0. # If interfaces changed but it is backwards compatible: AGE++, else AGE=0. # i.e. the library supports interfaces CURRENT - AGE up to CURRENT. # if two libraries have identical CURRENT and AGE, then newest REVISION used. CURRENT=7 AGE=4 REVISION=0 LT_VERSION_INFO="$CURRENT:$REVISION:$AGE" AC_SUBST(LT_VERSION_INFO) AM_MAINTAINER_MODE AC_ISC_POSIX AC_PROG_CC AC_HEADER_STDC AM_PROG_LIBTOOL pkg_modules="gtk+-2.0 >= 2.12.0 glib-2.0 >= 2.10.0 cairo >= 1.4.0" PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) AC_SUBST(PACKAGE_CFLAGS) AC_SUBST(PACKAGE_LIBS) GETTEXT_PACKAGE=goocanvas AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.]) dnl Add the languages which your application supports here. ALL_LINGUAS="en_GB es ja" AM_GLIB_GNU_GETTEXT GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` AC_SUBST(GLIB_MKENUMS) AC_ARG_ENABLE(rebuilds, [AC_HELP_STRING([--disable-rebuilds], [disable all source autogeneration rules])],, [enable_rebuilds=yes]) # define a MAINT-like variable REBUILD which is set if Perl # and awk are found, so autogenerated sources can be rebuilt AC_PATH_PROGS(PERL, perl5 perl) REBUILD=\# if test "x$enable_rebuilds" = "xyes" && \ test -n "$PERL" && \ $PERL -e 'exit !($] >= 5.002)' > /dev/null 2>&1 ; then REBUILD= fi AC_SUBST(REBUILD) AC_MSG_CHECKING([for some Win32 platform]) case "$host" in *-*-mingw*|*-*-cygwin*) platform_win32=yes ;; *) platform_win32=no ;; esac AC_MSG_RESULT([$platform_win32]) AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes") GTK_DOC_CHECK(1.8) AC_OUTPUT([ Makefile src/Makefile demo/Makefile docs/Makefile po/Makefile.in goocanvas.pc ]) goocanvas-0.15/goocanvas.pc.in0000644000076400007640000000040311172574677013277 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: GooCanvas Description: A GTK+ canvas widget using cairo Version: @VERSION@ Requires: gtk+-2.0 cairo Libs: -L${libdir} -lgoocanvas Cflags: -I${includedir}/goocanvas-1.0 goocanvas-0.15/README0000644000076400007640000000432611172574677011256 00000000000000 Welcome to GooCanvas ==================== (a cairo-based canvas widget for GTK+) GooCanvas Home Page : http://live.gnome.org/GooCanvas GooCanvas is similar in many ways to GnomeCanvas and FooCanvas. But it uses cairo for rendering, has an optional model/view split, and uses interfaces for items & models (so you can easily turn any application object into a canvas item or model). 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. To build it run './configure' and 'make'. To run the demo cd into 'demo' and run './demo'. (Or run ./simple-demo for the very simple demo, or ./mv-demo for the model-view demo.) Features: o Optional model/view split. o Uses interfaces for items & views. o Basic items - rect/ellipse/polyline/text/image/grid/group. o Path item, using SVG path specification strings. o Table item for layout of other items (similar to the GtkTable widget). (This also supports items whose requested height changes according to their allocated width, such as text items.) o Embedded GTK+ widgets. o Layers/stacking order with raise/lower functions. o Cascading styles - line width/style/dashes, colors, fill patterns. o Affine transformations for all items - rotations/scales/skews. o Clip paths to support clipping items. o Event handling - button/motion events, "pointer-events" property like SVG. o Grabs - support for pointer & keyboard grabs. o Keyboard focus traversal. o Accessibility (item title & description properties and hierarchy stuff). o Printing (output to a given cairo_t). o Scrolling. o Zooming. o Static items that don't move as the canvas is scrolled or zoomed. o Tooltips. o Item visibility setting - on/off/above zoom threshold. o Simple animation. o Scalable - support for thousands of items over a large canvas area. o Support for different units - pixels/points/inches/millimeters. o API docs. Damon Chaplin (damon@gnome.org) (FooCanvas can be found in GNOME svn in the 'foocanvas' module. FooCanvas was based on GnomeCanvas, which is in the 'libgnomecanvas' module.) goocanvas-0.15/autogen.sh0000755000076400007640000001066011172574677012375 00000000000000#!/bin/sh # Run this to generate all the initial makefiles, etc. srcdir=`dirname $0` test -z "$srcdir" && srcdir=. DIE=0 if [ -n "$GNOME2_DIR" ]; then ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS" LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH" PATH="$GNOME2_DIR/bin:$PATH" export PATH export LD_LIBRARY_PATH fi (test -f $srcdir/configure.in) || { echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" echo " top-level package directory" exit 1 } gtkdocize || exit 1 (autoconf --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`autoconf' installed." echo "Download the appropriate package for your distribution," echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" DIE=1 } (grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && { (intltoolize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`intltool' installed." echo "You can get it from:" echo " ftp://ftp.gnome.org/pub/GNOME/" DIE=1 } } (grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.in >/dev/null) && { (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`xml-i18n-toolize' installed." echo "You can get it from:" echo " ftp://ftp.gnome.org/pub/GNOME/" DIE=1 } } (grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && { (libtool --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`libtool' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 } } (grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null) && { (grep "sed.*POTFILES" $srcdir/configure.in) > /dev/null || \ (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`glib' installed." echo "You can get it from: ftp://ftp.gtk.org/pub/gtk" DIE=1 } } (automake --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: You must have \`automake' installed." echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" DIE=1 NO_AUTOMAKE=yes } # if no automake, don't bother testing for aclocal test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { echo echo "**Error**: Missing \`aclocal'. The version of \`automake'" echo "installed doesn't appear recent enough." echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" DIE=1 } if test "$DIE" -eq 1; then exit 1 fi if test -z "$*"; then echo "**Warning**: I am going to run \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" echo \`$0\'" command line." echo fi case $CC in xlc ) am_opt=--include-deps;; esac for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.in -print` do dr=`dirname $coin` if test -f $dr/NO-AUTO-GEN; then echo skipping $dr -- flagged as no auto-gen else echo processing $dr ( cd $dr aclocalinclude="$ACLOCAL_FLAGS" if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then echo "Creating $dr/aclocal.m4 ..." test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 echo "Running glib-gettextize... Ignore non-fatal messages." echo "no" | glib-gettextize --force --copy echo "Making $dr/aclocal.m4 writable ..." test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 fi if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then echo "Running intltoolize..." intltoolize --copy --force --automake fi if grep "^AM_PROG_XML_I18N_TOOLS" configure.in >/dev/null; then echo "Running xml-i18n-toolize..." xml-i18n-toolize --copy --force --automake fi if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then if test -z "$NO_LIBTOOLIZE" ; then echo "Running libtoolize..." libtoolize --force --copy fi fi echo "Running aclocal $aclocalinclude ..." aclocal $aclocalinclude if grep "^A[CM]_CONFIG_HEADER" configure.in >/dev/null; then echo "Running autoheader..." autoheader fi echo "Running automake --gnu $am_opt ..." automake --add-missing --gnu $am_opt echo "Running autoconf ..." autoconf ) fi done conf_flags="--enable-maintainer-mode" if test x$NOCONFIGURE = x; then echo Running $srcdir/configure $conf_flags "$@" ... $srcdir/configure $conf_flags "$@" \ && echo Now type \`make\' to compile. || exit 1 else echo Skipping configure process. fi goocanvas-0.15/AUTHORS0000644000076400007640000000004011172574677011433 00000000000000Damon Chaplin goocanvas-0.15/depcomp0000755000076400007640000004224610656605223011742 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2006-10-15.18 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software # Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: goocanvas-0.15/docs/0000777000076400007640000000000011222215703011357 500000000000000goocanvas-0.15/docs/goocanvas-overrides.txt0000644000076400007640000000000011172574677016030 00000000000000goocanvas-0.15/docs/html/0000777000076400007640000000000011222215706012326 500000000000000goocanvas-0.15/docs/html/ch01.html0000644000076400007640000000604111222215706013664 00000000000000 Introduction

Introduction

Overview — a quick tour of GooCanvas.
Simple Canvas Example — how to create a simple canvas.
Model/View Canvas Example — how to create a model/view canvas.
Underlying Architecture — how the canvas fits together.
Coordinate Spaces and Limits — how coordinates are used.
Creating New Items — how to create new canvas items.
WYSIWYG Printing — how to use the canvas to create accurate printed output.
goocanvas-0.15/docs/html/GooCanvas.html0000644000076400007640000033047211222215706015021 00000000000000 GooCanvas

GooCanvas

GooCanvas — the main canvas widget.

Synopsis




                    GooCanvas;
                    GooCanvasClass;

GtkWidget*          goo_canvas_new                      (void);

GooCanvasItem*      goo_canvas_get_root_item            (GooCanvas *canvas);
void                goo_canvas_set_root_item            (GooCanvas *canvas,
                                                         GooCanvasItem *item);
GooCanvasItemModel* goo_canvas_get_root_item_model      (GooCanvas *canvas);
void                goo_canvas_set_root_item_model      (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

GooCanvasItem*      goo_canvas_get_static_root_item     (GooCanvas *canvas);
void                goo_canvas_set_static_root_item     (GooCanvas *canvas,
                                                         GooCanvasItem *item);
GooCanvasItemModel* goo_canvas_get_static_root_item_model
                                                        (GooCanvas *canvas);
void                goo_canvas_set_static_root_item_model
                                                        (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

void                goo_canvas_get_bounds               (GooCanvas *canvas,
                                                         gdouble *left,
                                                         gdouble *top,
                                                         gdouble *right,
                                                         gdouble *bottom);
void                goo_canvas_set_bounds               (GooCanvas *canvas,
                                                         gdouble left,
                                                         gdouble top,
                                                         gdouble right,
                                                         gdouble bottom);
gdouble             goo_canvas_get_scale                (GooCanvas *canvas);
void                goo_canvas_set_scale                (GooCanvas *canvas,
                                                         gdouble scale);

GooCanvasItem*      goo_canvas_get_item                 (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);
GooCanvasItem*      goo_canvas_get_item_at              (GooCanvas *canvas,
                                                         gdouble x,
                                                         gdouble y,
                                                         gboolean is_pointer_event);
GList*              goo_canvas_get_items_at             (GooCanvas *canvas,
                                                         gdouble x,
                                                         gdouble y,
                                                         gboolean is_pointer_event);
GList*              goo_canvas_get_items_in_area        (GooCanvas *canvas,
                                                         const GooCanvasBounds *area,
                                                         gboolean inside_area,
                                                         gboolean allow_overlaps,
                                                         gboolean include_containers);

void                goo_canvas_scroll_to                (GooCanvas *canvas,
                                                         gdouble left,
                                                         gdouble top);
void                goo_canvas_render                   (GooCanvas *canvas,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *bounds,
                                                         gdouble scale);

void                goo_canvas_convert_to_pixels        (GooCanvas *canvas,
                                                         gdouble *x,
                                                         gdouble *y);
void                goo_canvas_convert_from_pixels      (GooCanvas *canvas,
                                                         gdouble *x,
                                                         gdouble *y);
void                goo_canvas_convert_to_item_space    (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y);
void                goo_canvas_convert_from_item_space  (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y);
void                goo_canvas_convert_bounds_to_item_space
                                                        (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         GooCanvasBounds *bounds);

GdkGrabStatus       goo_canvas_pointer_grab             (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         GdkEventMask event_mask,
                                                         GdkCursor *cursor,
                                                         guint32 time);
void                goo_canvas_pointer_ungrab           (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         guint32 time);

void                goo_canvas_grab_focus               (GooCanvas *canvas,
                                                         GooCanvasItem *item);
GdkGrabStatus       goo_canvas_keyboard_grab            (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gboolean owner_events,
                                                         guint32 time);
void                goo_canvas_keyboard_ungrab          (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         guint32 time);

cairo_t*            goo_canvas_create_cairo_context     (GooCanvas *canvas);
GooCanvasItem*      goo_canvas_create_item              (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);
void                goo_canvas_unregister_item          (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);
void                goo_canvas_register_widget_item     (GooCanvas *canvas,
                                                         GooCanvasWidget *witem);
void                goo_canvas_unregister_widget_item   (GooCanvas *canvas,
                                                         GooCanvasWidget *witem);
void                goo_canvas_update                   (GooCanvas *canvas);
void                goo_canvas_request_update           (GooCanvas *canvas);
void                goo_canvas_request_redraw           (GooCanvas *canvas,
                                                         const GooCanvasBounds *bounds);
void                goo_canvas_request_item_redraw      (GooCanvas *canvas,
                                                         const GooCanvasBounds *bounds,
                                                         gboolean is_static);
gdouble             goo_canvas_get_default_line_width   (GooCanvas *canvas);


Object Hierarchy


  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GooCanvas

Implemented Interfaces

GooCanvas implements AtkImplementorIface and GtkBuildable.

Properties


  "anchor"                   GtkAnchorType         : Read / Write
  "automatic-bounds"         gboolean              : Read / Write
  "background-color"         gchararray            : Write
  "background-color-rgb"     guint                 : Write
  "bounds-from-origin"       gboolean              : Read / Write
  "bounds-padding"           gdouble               : Read / Write
  "clear-background"         gboolean              : Read / Write
  "integer-layout"           gboolean              : Read / Write
  "redraw-when-scrolled"     gboolean              : Read / Write
  "resolution-x"             gdouble               : Read / Write
  "resolution-y"             gdouble               : Read / Write
  "scale"                    gdouble               : Read / Write
  "scale-x"                  gdouble               : Read / Write
  "scale-y"                  gdouble               : Read / Write
  "units"                    GtkUnit               : Read / Write
  "x1"                       gdouble               : Read / Write
  "x2"                       gdouble               : Read / Write
  "y1"                       gdouble               : Read / Write
  "y2"                       gdouble               : Read / Write

Signals


  "item-created"                                   : Run Last
  "set-scroll-adjustments"                         : Run Last / Action

Description

GooCanvas is the main widget containing a number of canvas items.

Here is a simple example:

 #include <goocanvas.h>
 
 static gboolean on_rect_button_press (GooCanvasItem  *view,
                                       GooCanvasItem  *target,
                                       GdkEventButton *event,
                                       gpointer        data);
 
 int
 main (int argc, char *argv[])
 {
   GtkWidget *window, *scrolled_win, *canvas;
   GooCanvasItem *root, *rect_item, *text_item;
 
   /* Initialize GTK+. */
   gtk_set_locale ();
   gtk_init (&argc, &argv);
 
   /* Create the window and widgets. */
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_default_size (GTK_WINDOW (window), 640, 600);
   gtk_widget_show (window);
   g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event,
                     NULL);
 
   scrolled_win = gtk_scrolled_window_new (NULL, NULL);
   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
                                        GTK_SHADOW_IN);
   gtk_widget_show (scrolled_win);
   gtk_container_add (GTK_CONTAINER (window), scrolled_win);
 
   canvas = goo_canvas_new ();
   gtk_widget_set_size_request (canvas, 600, 450);
   goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000);
   gtk_widget_show (canvas);
   gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
 
   root = goo_canvas_get_root_item (GOO_CANVAS (canvas));
 
   /* Add a few simple items. */
   rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400,
                                    "line-width", 10.0,
                                    "radius-x", 20.0,
                                    "radius-y", 10.0,
                                    "stroke-color", "yellow",
                                    "fill-color", "red",
                                    NULL);
 
   text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1,
                                    GTK_ANCHOR_CENTER,
                                    "font", "Sans 24",
                                    NULL);
   goo_canvas_item_rotate (text_item, 45, 300, 300);
 
   /* Connect a signal handler for the rectangle item. */
   g_signal_connect (rect_item, "button_press_event",
                     (GtkSignalFunc) on_rect_button_press, NULL);
 
   /* Pass control to the GTK+ main event loop. */
   gtk_main ();
 
   return 0;
 }
 
 
 /* This handles button presses in item views. We simply output a message to
    the console. */
 static gboolean
 on_rect_button_press (GooCanvasItem  *item,
                       GooCanvasItem  *target,
                       GdkEventButton *event,
                       gpointer        data)
 {
   g_print ("rect item received button press event\n");
   return TRUE;
 }
 

Details

GooCanvas

typedef struct _GooCanvas GooCanvas;

The GooCanvas struct contains private data only.


GooCanvasClass

typedef struct {
  GooCanvasItem* (* create_item)	    (GooCanvas          *canvas,
					     GooCanvasItemModel *model);

  /* Signals. */
  void           (* item_created)	    (GooCanvas          *canvas,
					     GooCanvasItem      *item,
					     GooCanvasItemModel *model);
} GooCanvasClass;

The GooCanvasClass struct contains one virtual method that subclasses may override.

create_item ()

a virtual method that subclasses may override to create custom canvas items for item models.

item_created ()

signal emitted when a new canvas item has been created. Applications can connect to this to setup signal handlers for the new item.

goo_canvas_new ()

GtkWidget*          goo_canvas_new                      (void);

Creates a new GooCanvas widget.

A GooCanvasGroup is created automatically as the root item of the canvas, though this can be overriden with goo_canvas_set_root_item() or goo_canvas_set_root_item_model().

Returns :

a new GooCanvas widget.

goo_canvas_get_root_item ()

GooCanvasItem*      goo_canvas_get_root_item            (GooCanvas *canvas);

Gets the root item of the canvas, usually a GooCanvasGroup.

canvas :

a GooCanvas.

Returns :

the root item, or NULL if there is no root item.

goo_canvas_set_root_item ()

void                goo_canvas_set_root_item            (GooCanvas *canvas,
                                                         GooCanvasItem *item);

Sets the root item of the canvas. Any existing canvas items are removed.

canvas :

a GooCanvas.

item :

the root canvas item.

goo_canvas_get_root_item_model ()

GooCanvasItemModel* goo_canvas_get_root_item_model      (GooCanvas *canvas);

Gets the root item model of the canvas.

canvas :

a GooCanvas.

Returns :

the root item model, or NULL if there is no root item model.

goo_canvas_set_root_item_model ()

void                goo_canvas_set_root_item_model      (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

Sets the root item model of the canvas.

A hierarchy of canvas items will be created, corresponding to the hierarchy of items in the model. Any current canvas items will be removed.

canvas :

a GooCanvas.

model :

a GooCanvasItemModel.

goo_canvas_get_static_root_item ()

GooCanvasItem*      goo_canvas_get_static_root_item     (GooCanvas *canvas);

Gets the static root item of the canvas.

Static items are exactly the same as ordinary canvas items, except that they do not move or change size when the canvas is scrolled or the scale changes.

Static items are added to the static root item in exactly the same way that ordinary items are added to the root item.

canvas :

a GooCanvas.

Returns :

the static root item, or NULL.

goo_canvas_set_static_root_item ()

void                goo_canvas_set_static_root_item     (GooCanvas *canvas,
                                                         GooCanvasItem *item);

Sets the static root item. Any existing static items are removed.

Static items are exactly the same as ordinary canvas items, except that they do not move or change size when the canvas is scrolled or the scale changes.

Static items are added to the static root item in exactly the same way that ordinary items are added to the root item.

canvas :

a GooCanvas.

item :

the static root item.

goo_canvas_get_static_root_item_model ()

GooCanvasItemModel* goo_canvas_get_static_root_item_model
                                                        (GooCanvas *canvas);

Gets the static root item model of the canvas.

Static item models are exactly the same as ordinary item models, except that the corresponding items do not move or change size when the canvas is scrolled or the scale changes.

Static items models are added to the static root item model in exactly the same way that ordinary item models are added to the root item model.

canvas :

a GooCanvas.

Returns :

the static root item model, or NULL.

goo_canvas_set_static_root_item_model ()

void                goo_canvas_set_static_root_item_model
                                                        (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

Sets the static root item model. Any existing static item models are removed.

Static item models are exactly the same as ordinary item models, except that the corresponding items do not move or change size when the canvas is scrolled or the scale changes.

Static items models are added to the static root item model in exactly the same way that ordinary item models are added to the root item model.

canvas :

a GooCanvas.

model :

the static root item model.

goo_canvas_get_bounds ()

void                goo_canvas_get_bounds               (GooCanvas *canvas,
                                                         gdouble *left,
                                                         gdouble *top,
                                                         gdouble *right,
                                                         gdouble *bottom);

Gets the bounds of the canvas, in canvas units.

By default, canvas units are pixels, though the "units" property can be used to change the units to points, inches or millimeters.

canvas :

a GooCanvas.

left :

a pointer to a gdouble to return the left edge, or NULL.

top :

a pointer to a gdouble to return the top edge, or NULL.

right :

a pointer to a gdouble to return the right edge, or NULL.

bottom :

a pointer to a gdouble to return the bottom edge, or NULL.

goo_canvas_set_bounds ()

void                goo_canvas_set_bounds               (GooCanvas *canvas,
                                                         gdouble left,
                                                         gdouble top,
                                                         gdouble right,
                                                         gdouble bottom);

Sets the bounds of the GooCanvas, in canvas units.

By default, canvas units are pixels, though the "units" property can be used to change the units to points, inches or millimeters.

canvas :

a GooCanvas.

left :

the left edge.

top :

the top edge.

right :

the right edge.

bottom :

the bottom edge.

goo_canvas_get_scale ()

gdouble             goo_canvas_get_scale                (GooCanvas *canvas);

Gets the current scale of the canvas.

The scale specifies the magnification factor of the canvas, e.g. if an item has a width of 2 pixels and the scale is set to 3, it will be displayed with a width of 2 x 3 = 6 pixels.

canvas :

a GooCanvas.

Returns :

the current scale setting.

goo_canvas_set_scale ()

void                goo_canvas_set_scale                (GooCanvas *canvas,
                                                         gdouble scale);

Sets the scale of the canvas.

The scale specifies the magnification factor of the canvas, e.g. if an item has a width of 2 pixels and the scale is set to 3, it will be displayed with a width of 2 x 3 = 6 pixels.

canvas :

a GooCanvas.

scale :

the new scale setting.

goo_canvas_get_item ()

GooCanvasItem*      goo_canvas_get_item                 (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

Gets the canvas item associated with the given GooCanvasItemModel. This is only useful when goo_canvas_set_root_item_model() has been used to set a model for the canvas.

For simple applications you can use goo_canvas_get_item() to set up signal handlers for your items, e.g.

   item = goo_canvas_get_item (GOO_CANVAS (canvas), my_item);
   g_signal_connect (item, "button_press_event",
                     (GtkSignalFunc) on_my_item_button_press, NULL);

More complex applications may want to use the "item-created" signal to hook up their signal handlers.

canvas :

a GooCanvas.

model :

a GooCanvasItemModel.

Returns :

the canvas item corresponding to the given GooCanvasItemModel, or NULL if no canvas item has been created for it yet.

goo_canvas_get_item_at ()

GooCanvasItem*      goo_canvas_get_item_at              (GooCanvas *canvas,
                                                         gdouble x,
                                                         gdouble y,
                                                         gboolean is_pointer_event);

Gets the item at the given point.

canvas :

a GooCanvas.

x :

the x coordinate of the point.

y :

the y coordinate of the point

is_pointer_event :

TRUE if the "pointer-events" property of items should be used to determine which parts of the item are tested.

Returns :

the item found at the given point, or NULL if no item was found.

goo_canvas_get_items_at ()

GList*              goo_canvas_get_items_at             (GooCanvas *canvas,
                                                         gdouble x,
                                                         gdouble y,
                                                         gboolean is_pointer_event);

Gets all items at the given point.

canvas :

a GooCanvas.

x :

the x coordinate of the point.

y :

the y coordinate of the point

is_pointer_event :

TRUE if the "pointer-events" property of items should be used to determine which parts of the item are tested.

Returns :

a list of items found at the given point, with the top item at the start of the list, or NULL if no items were found. The list must be freed with g_list_free().

goo_canvas_get_items_in_area ()

GList*              goo_canvas_get_items_in_area        (GooCanvas *canvas,
                                                         const GooCanvasBounds *area,
                                                         gboolean inside_area,
                                                         gboolean allow_overlaps,
                                                         gboolean include_containers);

Gets a list of items inside or outside a given area.

canvas :

a GooCanvas.

area :

the area to compare with each item's bounds.

inside_area :

TRUE if items inside area should be returned, or FALSE if items outside area should be returned.

allow_overlaps :

TRUE if items which are partly inside and partly outside should be returned.

include_containers :

TRUE if containers should be checked as well as normal items.

Returns :

a list of items in the given area, or NULL if no items are found. The list should be freed with g_list_free().

goo_canvas_scroll_to ()

void                goo_canvas_scroll_to                (GooCanvas *canvas,
                                                         gdouble left,
                                                         gdouble top);

Scrolls the canvas, placing the given point as close to the top-left of the view as possible.

canvas :

a GooCanvas.

left :

the x coordinate to scroll to.

top :

the y coordinate to scroll to.

goo_canvas_render ()

void                goo_canvas_render                   (GooCanvas *canvas,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *bounds,
                                                         gdouble scale);

Renders all or part of a canvas to the given cairo context.

canvas :

a GooCanvas.

cr :

a cairo context.

bounds :

the area to render, or NULL to render the entire canvas.

scale :

the scale to compare with each item's visibility threshold to see if they should be rendered. This only affects items that have their visibility set to GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD.

goo_canvas_convert_to_pixels ()

void                goo_canvas_convert_to_pixels        (GooCanvas *canvas,
                                                         gdouble *x,
                                                         gdouble *y);

Converts a coordinate from the canvas coordinate space to pixels.

The canvas coordinate space is specified in the call to goo_canvas_set_bounds().

The pixel coordinate space specifies pixels from the top-left of the entire canvas window, according to the current scale setting. See goo_canvas_set_scale().

canvas :

a GooCanvas.

x :

a pointer to the x coordinate to convert.

y :

a pointer to the y coordinate to convert.

goo_canvas_convert_from_pixels ()

void                goo_canvas_convert_from_pixels      (GooCanvas *canvas,
                                                         gdouble *x,
                                                         gdouble *y);

Converts a coordinate from pixels to the canvas coordinate space.

The pixel coordinate space specifies pixels from the top-left of the entire canvas window, according to the current scale setting. See goo_canvas_set_scale().

The canvas coordinate space is specified in the call to goo_canvas_set_bounds().

canvas :

a GooCanvas.

x :

a pointer to the x coordinate to convert.

y :

a pointer to the y coordinate to convert.

goo_canvas_convert_to_item_space ()

void                goo_canvas_convert_to_item_space    (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y);

Converts a coordinate from the canvas coordinate space to the given item's coordinate space, applying all transformation matrices including the item's own transformation matrix, if it has one.

canvas :

a GooCanvas.

item :

a GooCanvasItem.

x :

a pointer to the x coordinate to convert.

y :

a pointer to the y coordinate to convert.

goo_canvas_convert_from_item_space ()

void                goo_canvas_convert_from_item_space  (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y);

Converts a coordinate from the given item's coordinate space to the canvas coordinate space, applying all transformation matrices including the item's own transformation matrix, if it has one.

canvas :

a GooCanvas.

item :

a GooCanvasItem.

x :

a pointer to the x coordinate to convert.

y :

a pointer to the y coordinate to convert.

goo_canvas_convert_bounds_to_item_space ()

void                goo_canvas_convert_bounds_to_item_space
                                                        (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         GooCanvasBounds *bounds);

Converts the given bounds in the canvas coordinate space to a bounding box in item space. This is useful in the item paint() methods to convert the bounds to be painted to the item's coordinate space.

canvas :

a GooCanvas.

item :

a GooCanvasItem.

bounds :

the bounds in canvas coordinate space, to be converted.

goo_canvas_pointer_grab ()

GdkGrabStatus       goo_canvas_pointer_grab             (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         GdkEventMask event_mask,
                                                         GdkCursor *cursor,
                                                         guint32 time);

Attempts to grab the pointer for the given item.

canvas :

a GooCanvas.

item :

the item to grab the pointer for.

event_mask :

the events to receive during the grab.

cursor :

the cursor to display during the grab, or NULL.

time :

the time of the event that lead to the pointer grab. This should come from the relevant GdkEvent.

Returns :

GDK_GRAB_SUCCESS if the grab succeeded.

goo_canvas_pointer_ungrab ()

void                goo_canvas_pointer_ungrab           (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         guint32 time);

Ungrabs the pointer, if the given item has the pointer grab.

canvas :

a GooCanvas.

item :

the item that has the grab.

time :

the time of the event that lead to the pointer ungrab. This should come from the relevant GdkEvent.

goo_canvas_grab_focus ()

void                goo_canvas_grab_focus               (GooCanvas *canvas,
                                                         GooCanvasItem *item);

Grabs the keyboard focus for the given item.

canvas :

a GooCanvas.

item :

the item to grab the focus.

goo_canvas_keyboard_grab ()

GdkGrabStatus       goo_canvas_keyboard_grab            (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         gboolean owner_events,
                                                         guint32 time);

Attempts to grab the keyboard for the given item.

canvas :

a GooCanvas.

item :

the item to grab the keyboard for.

owner_events :

TRUE if keyboard events for this application will be reported normally, or FALSE if all keyboard events will be reported with respect to the grab item.

time :

the time of the event that lead to the keyboard grab. This should come from the relevant GdkEvent.

Returns :

GDK_GRAB_SUCCESS if the grab succeeded.

goo_canvas_keyboard_ungrab ()

void                goo_canvas_keyboard_ungrab          (GooCanvas *canvas,
                                                         GooCanvasItem *item,
                                                         guint32 time);

Ungrabs the keyboard, if the given item has the keyboard grab.

canvas :

a GooCanvas.

item :

the item that has the keyboard grab.

time :

the time of the event that lead to the keyboard ungrab. This should come from the relevant GdkEvent.

goo_canvas_create_cairo_context ()

cairo_t*            goo_canvas_create_cairo_context     (GooCanvas *canvas);

Creates a cairo context, initialized with the default canvas settings.

canvas :

a GooCanvas.

Returns :

a new cairo context. It should be freed with cairo_destroy().

goo_canvas_create_item ()

GooCanvasItem*      goo_canvas_create_item              (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

This function is only intended to be used when implementing new canvas items, typically container items such as GooCanvasGroup.

It creates a new canvas item for the given item model, and recursively creates items for any children.

It uses the create_item() virtual method if it has been set. Subclasses of GooCanvas can define this method if they want to use custom views for items.

It emits the "item-created" signal after creating the view, so application code can connect signal handlers to the new view if desired.

canvas :

a GooCanvas.

model :

the item model to create a canvas item for.

Returns :

a new canvas item.

goo_canvas_unregister_item ()

void                goo_canvas_unregister_item          (GooCanvas *canvas,
                                                         GooCanvasItemModel *model);

This function is only intended to be used when implementing new canvas items.

It should be called in the finalize method of GooCanvasItem objects, to remove the canvas item from the GooCanvas's hash table.

canvas :

a GooCanvas.

model :

the item model whose canvas item is being finalized.

goo_canvas_register_widget_item ()

void                goo_canvas_register_widget_item     (GooCanvas *canvas,
                                                         GooCanvasWidget *witem);

This function should only be used by GooCanvasWidget and subclass implementations.

It registers a widget item with the canvas, so that the canvas can do the necessary actions to move and resize the widget as needed.

canvas :

a GooCanvas.

witem :

a GooCanvasWidget item.

goo_canvas_unregister_widget_item ()

void                goo_canvas_unregister_widget_item   (GooCanvas *canvas,
                                                         GooCanvasWidget *witem);

This function should only be used by GooCanvasWidget and subclass implementations.

It unregisters a widget item from the canvas, when the item is no longer in the canvas.

canvas :

a GooCanvas.

witem :

a GooCanvasWidget item.

goo_canvas_update ()

void                goo_canvas_update                   (GooCanvas *canvas);

This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations.

It updates any items that need updating.

If the bounds of items change, they will request a redraw of the old and new bounds so the display is updated correctly.

canvas :

a GooCanvas.

goo_canvas_request_update ()

void                goo_canvas_request_update           (GooCanvas *canvas);

This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations.

It schedules an update of the GooCanvas. This will be performed in the idle loop, after all pending events have been handled, but before the canvas has been repainted.

canvas :

a GooCanvas.

goo_canvas_request_redraw ()

void                goo_canvas_request_redraw           (GooCanvas *canvas,
                                                         const GooCanvasBounds *bounds);

This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations.

Requests that the given bounds be redrawn. The bounds must be in the canvas coordinate space.

canvas :

a GooCanvas.

bounds :

the bounds to redraw, in device space.

goo_canvas_request_item_redraw ()

void                goo_canvas_request_item_redraw      (GooCanvas *canvas,
                                                         const GooCanvasBounds *bounds,
                                                         gboolean is_static);

This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations.

Requests that the given bounds be redrawn. If is_static is TRUE the bounds are assumed to be in the static item coordinate space, otherwise they are assumed to be in the canvas coordinate space.

If is_static is FALSE this function behaves the same as goo_canvas_request_redraw().

canvas :

a GooCanvas.

bounds :

the bounds of the item to redraw.

is_static :

if the item is static.

goo_canvas_get_default_line_width ()

gdouble             goo_canvas_get_default_line_width   (GooCanvas *canvas);

Gets the default line width, which depends on the current units setting.

canvas :

a GooCanvas.

Returns :

the default line width of the canvas.

Property Details

The "anchor" property

  "anchor"                   GtkAnchorType         : Read / Write

Where to place the canvas when it is smaller than the widget's allocated area.

Default value: GTK_ANCHOR_NORTH_WEST


The "automatic-bounds" property

  "automatic-bounds"         gboolean              : Read / Write

If the bounds are automatically calculated based on the bounds of all the items in the canvas.

Default value: FALSE


The "background-color" property

  "background-color"         gchararray            : Write

The color to use for the canvas background.

Default value: NULL


The "background-color-rgb" property

  "background-color-rgb"     guint                 : Write

The color to use for the canvas background, specified as a 24-bit integer value, 0xRRGGBB.

Default value: 0


The "bounds-from-origin" property

  "bounds-from-origin"       gboolean              : Read / Write

If the automatic bounds are calculated from the origin.

Default value: TRUE


The "bounds-padding" property

  "bounds-padding"           gdouble               : Read / Write

The padding added to the automatic bounds.

Allowed values: >= 0

Default value: 0


The "clear-background" property

  "clear-background"         gboolean              : Read / Write

If the background is cleared before the canvas is painted.

Default value: TRUE


The "integer-layout" property

  "integer-layout"           gboolean              : Read / Write

If all item layout is done to the nearest integer.

Default value: FALSE


The "redraw-when-scrolled" property

  "redraw-when-scrolled"     gboolean              : Read / Write

If the canvas is completely redrawn when scrolled, to reduce the flicker of static items.

Default value: FALSE


The "resolution-x" property

  "resolution-x"             gdouble               : Read / Write

The horizontal resolution of the display, in dots per inch.

Allowed values: >= 0

Default value: 96


The "resolution-y" property

  "resolution-y"             gdouble               : Read / Write

The vertical resolution of the display, in dots per inch.

Allowed values: >= 0

Default value: 96


The "scale" property

  "scale"                    gdouble               : Read / Write

The magnification factor of the canvas.

Allowed values: >= 0

Default value: 1


The "scale-x" property

  "scale-x"                  gdouble               : Read / Write

The horizontal magnification factor of the canvas.

Allowed values: >= 0

Default value: 1


The "scale-y" property

  "scale-y"                  gdouble               : Read / Write

The vertical magnification factor of the canvas.

Allowed values: >= 0

Default value: 1


The "units" property

  "units"                    GtkUnit               : Read / Write

The units to use for the canvas.

Default value: GTK_UNIT_PIXEL


The "x1" property

  "x1"                       gdouble               : Read / Write

The x coordinate of the left edge of the canvas bounds, in canvas units.

Default value: 0


The "x2" property

  "x2"                       gdouble               : Read / Write

The x coordinate of the right edge of the canvas bounds, in canvas units.

Default value: 1000


The "y1" property

  "y1"                       gdouble               : Read / Write

The y coordinate of the top edge of the canvas bounds, in canvas units.

Default value: 0


The "y2" property

  "y2"                       gdouble               : Read / Write

The y coordinate of the bottom edge of the canvas bounds, in canvas units.

Default value: 1000

Signal Details

The "item-created" signal

void                user_function                      (GooCanvas          *canvas,
                                                        GooCanvasItem      *item,
                                                        GooCanvasItemModel *model,
                                                        gpointer            user_data)      : Run Last

This is emitted when a new canvas item is created, in model/view mode.

Applications can set up signal handlers for the new items here.

canvas :

the canvas.

item :

the new item.

model :

the item's model.

user_data :

user data set when the signal handler was connected.

The "set-scroll-adjustments" signal

void                user_function                      (GooCanvas     *canvas,
                                                        GtkAdjustment *hadjustment,
                                                        GtkAdjustment *vadjustment,
                                                        gpointer       user_data)        : Run Last / Action

This is used when the GooCanvas is placed inside a GtkScrolledWindow, to connect up the adjustments so scrolling works properly.

It isn't useful for applications.

canvas :

the canvas.

hadjustment :

the horizontal adjustment.

vadjustment :

the vertical adjustment.

user_data :

user data set when the signal handler was connected.

goocanvas-0.15/docs/html/GooCanvasRectModel.html0000644000076400007640000003570011222215706016614 00000000000000 GooCanvasRectModel

GooCanvasRectModel

GooCanvasRectModel — a model for rectangle items.

Object Hierarchy


  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasRectModel

Implemented Interfaces

GooCanvasRectModel implements GooCanvasItemModel.

Properties


  "height"                   gdouble               : Read / Write
  "radius-x"                 gdouble               : Read / Write
  "radius-y"                 gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasRectModel represents a model for rectangle items.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasRectModel use goo_canvas_rect_model_new().

To get or set the properties of an existing GooCanvasRectModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the rectangle you must connect to the signal handlers of the corresponding GooCanvasRect objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasRectModel

typedef struct _GooCanvasRectModel GooCanvasRectModel;

The GooCanvasRectModel struct contains private data only.


goo_canvas_rect_model_new ()

GooCanvasItemModel* goo_canvas_rect_model_new           (GooCanvasItemModel *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);

Creates a new rectangle item.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

x :

the x coordinate of the left of the rectangle.

y :

the y coordinate of the top of the rectangle.

width :

the width of the rectangle.

height :

the height of the rectangle.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new rectangle model.

Here's an example showing how to create a rectangle at (100,100) with a width of 200 and a height of 100.

 GooCanvasItemModel *rect = goo_canvas_rect_model_new (mygroup, 100.0, 100.0, 200.0, 100.0,
                                                       "stroke-color", "red",
                                                       "line-width", 5.0,
                                                       "fill-color", "blue",
                                                       NULL);

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the rectangle.

Allowed values: >= 0

Default value: 0


The "radius-x" property

  "radius-x"                 gdouble               : Read / Write

The horizontal radius to use for rounded corners.

Allowed values: >= 0

Default value: 0


The "radius-y" property

  "radius-y"                 gdouble               : Read / Write

The vertical radius to use for rounded corners.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the rectangle.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the rectangle.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the rectangle.

Default value: 0


goocanvas-0.15/docs/html/GooCanvasGroupModel.html0000644000076400007640000003041011222215706017004 00000000000000 GooCanvasGroupModel

GooCanvasGroupModel

GooCanvasGroupModel — a model for a group of items.

Object Hierarchy


  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasGroupModel
               +----GooCanvasTableModel

Implemented Interfaces

GooCanvasGroupModel implements GooCanvasItemModel.

Properties


  "height"                   gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasGroupModel represents a group of items. Groups can be nested to any depth, to create a hierarchy of items. Items are ordered within each group, with later items being displayed above earlier items.

GooCanvasGroupModel is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasGroupModel will affect all children of the GooCanvasGroupModel (unless the children override the property setting).

GooCanvasGroupModel implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(), and the properties such as "visibility" and "pointer-events".

To create a GooCanvasGroupModel use goo_canvas_group_model_new().

To get or set the properties of an existing GooCanvasGroupModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the group you must connect to the signal handlers of the corresponding GooCanvasGroup objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasGroupModel

typedef struct _GooCanvasGroupModel GooCanvasGroupModel;

The GooCanvasGroupModel struct contains private data only.


goo_canvas_group_model_new ()

GooCanvasItemModel* goo_canvas_group_model_new          (GooCanvasItemModel *parent,
                                                         ...);

Creates a new group item.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new group model.

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the group, or -1 to use the default height.

Default value: -1


The "width" property

  "width"                    gdouble               : Read / Write

The width of the group, or -1 to use the default width.

Default value: -1


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the group.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the group.

Default value: 0


goocanvas-0.15/docs/html/home.png0000644000076400007640000000121611222215703013675 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ1õÚKvIDATxœÕ•±kqÅ?ßrC‡ßàpà ~C„np¼¡CAAJ .B-\'G‡]:Ü “‚ƒCÇ -(ˆ8´à Ô€!…fD°€…çÒ“klbRÛÁoyüxïûîËïwpðIJº<°of_®-@ÒððçRH•´ÏfÖŸtèÂü¤^¯×ÓÚÚš’$Q«ÕÒ|“ôpâ’¶€gív;X^^&Ïs¢(bww—Z­F£ÑÀ9Çææ&Þû3à¶™ Æ’^IRµZUE.0Z]]Uš¦ ÃPY–Mü8óHÒGIÚÙÙÑìììæeŸkqqñÒ€™!ó  $ÛÛÛ¬¯¯3Œn eýþ{-/seeeìÔÃŒãXóóóåO‡Í·$ý8==UÇS™—é½×ÑÑQòRR€¤'ã–9-sÚÛÛ+B^ éC·Û•sîŸÍËÂ+%À°<7³ŸWô˜¿ õâ:™2IEND®B`‚goocanvas-0.15/docs/html/GooCanvasPolylineModel.html0000644000076400007640000005523611222215706017520 00000000000000 GooCanvasPolylineModel

GooCanvasPolylineModel

GooCanvasPolylineModel — a model for polyline items (a series of lines with optional arrows).

Object Hierarchy


  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasPolylineModel

Implemented Interfaces

GooCanvasPolylineModel implements GooCanvasItemModel.

Properties


  "arrow-length"             gdouble               : Read / Write
  "arrow-tip-length"         gdouble               : Read / Write
  "arrow-width"              gdouble               : Read / Write
  "close-path"               gboolean              : Read / Write
  "end-arrow"                gboolean              : Read / Write
  "height"                   gdouble               : Read / Write
  "points"                   GooCanvasPoints       : Read / Write
  "start-arrow"              gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasPolylineModel represents a model for polyline items, which are a series of one or more lines, with optional arrows at either end.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasPolylineModel use goo_canvas_polyline_model_new(), or goo_canvas_polyline_model_new_line() for a simple line between two points.

To get or set the properties of an existing GooCanvasPolylineModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the polyline you must connect to the signal handlers of the corresponding GooCanvasPolyline objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasPolylineModel

typedef struct _GooCanvasPolylineModel GooCanvasPolylineModel;

The GooCanvasPolylineModel struct contains private data only.


goo_canvas_polyline_model_new ()

GooCanvasItemModel* goo_canvas_polyline_model_new       (GooCanvasItemModel *parent,
                                                         gboolean close_path,
                                                         gint num_points,
                                                         ...);

Creates a new polyline model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

close_path :

if the last point should be connected to the first.

num_points :

the number of points in the polyline.

... :

the pairs of coordinates for each point in the line, followed by optional pairs of property names and values, and a terminating NULL.

Returns :

a new polyline model.

Here's an example showing how to create a filled triangle with vertices at (100,100), (300,100), and (200,300).

 GooCanvasItemModel *polyline = goo_canvas_polyline_model_new (mygroup, TRUE, 3,
                                                               100.0, 100.0,
                                                               300.0, 100.0,
                                                               200.0, 300.0,
                                                               "stroke-color", "red",
                                                               "line-width", 5.0,
                                                               "fill-color", "blue",
                                                               NULL);


goo_canvas_polyline_model_new_line ()

GooCanvasItemModel* goo_canvas_polyline_model_new_line  (GooCanvasItemModel *parent,
                                                         gdouble x1,
                                                         gdouble y1,
                                                         gdouble x2,
                                                         gdouble y2,
                                                         ...);

Creates a new polyline model with a single line.

parent :

the parent model, or NULL.

x1 :

the x coordinate of the start of the line.

y1 :

the y coordinate of the start of the line.

x2 :

the x coordinate of the end of the line.

y2 :

the y coordinate of the end of the line.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new polyline model.

Here's an example showing how to create a line from (100,100) to (300,300).

 GooCanvasItemModel *polyline = goo_canvas_polyline_model_new_line (mygroup,
                                                                    100.0, 100.0,
                                                                    300.0, 300.0,
                                                                    "stroke-color", "red",
                                                                    "line-width", 5.0,
                                                                    NULL);

Property Details

The "arrow-length" property

  "arrow-length"             gdouble               : Read / Write

The length of the arrows, as a multiple of the line width.

Allowed values: >= 0

Default value: 5


The "arrow-tip-length" property

  "arrow-tip-length"         gdouble               : Read / Write

The length of the arrow tip, as a multiple of the line width.

Allowed values: >= 0

Default value: 4


The "arrow-width" property

  "arrow-width"              gdouble               : Read / Write

The width of the arrows, as a multiple of the line width.

Allowed values: >= 0

Default value: 4


The "close-path" property

  "close-path"               gboolean              : Read / Write

If the last point should be connected to the first.

Default value: FALSE


The "end-arrow" property

  "end-arrow"                gboolean              : Read / Write

If an arrow should be displayed at the end of the polyline.

Default value: FALSE


The "height" property

  "height"                   gdouble               : Read / Write

The height of the polyline.

Allowed values: >= 0

Default value: 0


The "points" property

  "points"                   GooCanvasPoints       : Read / Write

The array of points.


The "start-arrow" property

  "start-arrow"              gboolean              : Read / Write

If an arrow should be displayed at the start of the polyline.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the polyline.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the left-most point of the polyline.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the top-most point of the polyline.

Default value: 0


goocanvas-0.15/docs/html/goocanvas-architecture.html0000644000076400007640000002343311222215706017575 00000000000000 Underlying Architecture

Underlying Architecture

Underlying Architecture — how the canvas fits together.

Underlying Architecture

The GooCanvas Widget

GooCanvas is a GtkWidget (it is actually a subclass of GtkContainer), and so can be placed in an interface just like any normal widget. Usually a GooCanvas widget would be placed inside a GtkScrolledWindow in order to enable scrolling of the canvas.

The size of the canvas can be set explicitly using goo_canvas_set_bounds(), or if the "automatic-bounds" property is set to TRUE the bounds will be automatically calculated to include all of the canvas items. The units used in the canvas can be set with the "units" property. The canvas units can be pixels, points, inches or millimeters and apply to the canvas and all items.


The Structure of the Simple Canvas

The simple canvas consists of a hierarchy of canvas items. The root item is automatically created by the canvas and can be accessed using goo_canvas_get_root_item(). New items and groups can then be created and added to the root item.

Each item in the canvas keeps a GooCanvasBounds structure which stores the bounding rectangle of the item and all of its descendants. This makes it easy to find out which items in the canvas need repainting or which item the mouse is over. (The bounds are stored in the canvas coordinate space, which is the coordinate space of the entire canvas, after any item transformation matrices have been applied.)


The Structure of the Model/View Canvas

The model/view canvas consists of a hierarchy of item models, and an identical hierarchy of canvas items, with each canvas item corresponding to one item model.

The hierarchy of item models can be used in several GooCanvas widgets, to allow multiple views of the same model. Though different canvas items will be used in each GooCanvas.

The root item model is set with goo_canvas_set_root_item_model(). The canvas will automatically create canvas items to display the hierarchy of item models, and will automatically add and remove canvas items as the item model hierarchy is changed.


The Update Procedure

When items are added to the canvas or their properties are changed they may need to recalculate their bounds. To do this they set an internal flag such as need_update, and make a call to goo_canvas_item_request_update().

GooCanvas handles all the update requests at once, to avoids multiple redraws of the same parts of the canvas. To do this it installs an idle handler, goo_canvas_idle_handler(), which is called as soon as the application is idle (and before any part of the canvas is redrawn).

The idle handler calls goo_canvas_item_update() on the root item, which recursively calls goo_canvas_item_update() on any items as necessary, recalculating their bounds and requesting redraws as appropriate.

If a container item (e.g. GooCanvasGroup) is changed it needs to ensure that all descendants recalculate their bounds so it calls goo_canvas_item_update() for all of its children with the entire_tree argument set to TRUE.


How Changes to Items are Handled

When an item is changed (e.g. if the "x" property of a GooCanvasRect is changed), the item calls goo_canvas_item_simple_changed() with a flag indicating if the bounds of the item need to be recalculated.

If the bounds don't need to be recalculated, then goo_canvas_request_redraw() is called to simply request that the item is redrawn. This results in a call to gdk_window_invalidate_rect() and the redraw proceeds just like a normal GtkWidget.

However, if the bounds do need to be recalculated then goo_canvas_item_request_update() is called to request that the item be updated the next time the canvas performs an update.


How Changes are Handled in the Model/View Canvas

In the Model/View canvas it is the underlying item models which are initially changed. The item models emit "changed" signals which the items respond to. For the standard canvas items the goo_canvas_item_model_simple_changed() signal handler is called, which calls goo_canvas_item_simple_changed() and the procedure continues as in the simple canvas case above.

goocanvas-0.15/docs/html/GooCanvasImage.html0000644000076400007640000003421511222215706015760 00000000000000 GooCanvasImage

GooCanvasImage

GooCanvasImage — an image item.

Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasImage

Implemented Interfaces

GooCanvasImage implements GooCanvasItem.

Properties


  "height"                   gdouble               : Read / Write
  "pattern"                  GooCairoPattern       : Read / Write
  "pixbuf"                   GdkPixbuf             : Write
  "scale-to-fit"             gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasImage represents an image item.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "operator" and "pointer-events".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasImage use goo_canvas_image_new().

To get or set the properties of an existing GooCanvasImage, use g_object_get() and g_object_set().

Details

GooCanvasImage

typedef struct _GooCanvasImage GooCanvasImage;

The GooCanvasImage struct contains private data only.


goo_canvas_image_new ()

GooCanvasItem*      goo_canvas_image_new                (GooCanvasItem *parent,
                                                         GdkPixbuf *pixbuf,
                                                         gdouble x,
                                                         gdouble y,
                                                         ...);

Creates a new image item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

pixbuf :

the GdkPixbuf containing the image data, or NULL.

x :

the x coordinate of the image.

y :

the y coordinate of the image.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new image item.

Here's an example showing how to create an image at (100.0, 100.0), using the given pixbuf at its natural width and height:

 GooCanvasItem *image = goo_canvas_image_new (mygroup, pixbuf, 100.0, 100.0,
                                              NULL);

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the image.

Allowed values: >= 0

Default value: 0


The "pattern" property

  "pattern"                  GooCairoPattern       : Read / Write

The cairo pattern to paint.


The "pixbuf" property

  "pixbuf"                   GdkPixbuf             : Write

The GdkPixbuf to display.


The "scale-to-fit" property

  "scale-to-fit"             gboolean              : Read / Write

If the image is scaled to fit the width and height settings.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the image.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the image.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the image.

Default value: 0


goocanvas-0.15/docs/html/goocanvas.devhelp0000644000076400007640000021261111222215703015573 00000000000000 goocanvas-0.15/docs/html/GooCanvasText.html0000644000076400007640000005060211222215706015660 00000000000000 GooCanvasText

GooCanvasText

GooCanvasText — a text item.

Synopsis




                    GooCanvasText;
GooCanvasItem*      goo_canvas_text_new                 (GooCanvasItem *parent,
                                                         const char *string,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         GtkAnchorType anchor,
                                                         ...);
void                goo_canvas_text_get_natural_extents (GooCanvasText *text,
                                                         PangoRectangle *ink_rect,
                                                         PangoRectangle *logical_rect);


Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasText

Implemented Interfaces

GooCanvasText implements GooCanvasItem.

Properties


  "alignment"                PangoAlignment        : Read / Write
  "anchor"                   GtkAnchorType         : Read / Write
  "ellipsize"                PangoEllipsizeMode    : Read / Write
  "height"                   gdouble               : Read / Write
  "text"                     gchararray            : Read / Write
  "use-markup"               gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "wrap"                     PangoWrapMode         : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasText represents a text item.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "fill-color".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

The "width" and "height" properties specify the area of the item. If it exceeds that area because there is too much text, it is clipped. The properties can be set to -1 to disable clipping.

To create a GooCanvasText use goo_canvas_text_new().

To get or set the properties of an existing GooCanvasText, use g_object_get() and g_object_set().

Details

GooCanvasText

typedef struct _GooCanvasText GooCanvasText;

The GooCanvasText struct contains private data only.


goo_canvas_text_new ()

GooCanvasItem*      goo_canvas_text_new                 (GooCanvasItem *parent,
                                                         const char *string,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         GtkAnchorType anchor,
                                                         ...);

Creates a new text item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

string :

the text to display.

x :

the x coordinate of the text.

y :

the y coordinate of the text.

width :

the width of the text item, or -1 for unlimited width.

anchor :

the position of the text relative to the given x and y coordinates. For example an anchor of GDK_ANCHOR_NW will result in the top-left of the text being placed at the given x and y coordinates. An anchor of GDK_ANCHOR_CENTER will result in the center of the text being placed at the x and y coordinates.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new text item.

Here's an example showing how to create a text item with the bottom right of the text box placed at (500,500):

 GooCanvasItem *text = goo_canvas_text_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE,
                                            "fill-color", "blue",
                                            NULL);


goo_canvas_text_get_natural_extents ()

void                goo_canvas_text_get_natural_extents (GooCanvasText *text,
                                                         PangoRectangle *ink_rect,
                                                         PangoRectangle *logical_rect);

Gets the natural extents of the text, in the text item's coordinate space.

The final extents of the text may be different, if the text item is placed in a layout container such as GooCanvasTable.

text :

a GooCanvasText.

ink_rect :

the location to return the ink rect, or NULL.

logical_rect :

the location to return the logical rect, or NULL.

Property Details

The "alignment" property

  "alignment"                PangoAlignment        : Read / Write

How to align the text.

Default value: PANGO_ALIGN_LEFT


The "anchor" property

  "anchor"                   GtkAnchorType         : Read / Write

How to position the text relative to the given x and y coordinates.

Default value: GTK_ANCHOR_NORTH_WEST


The "ellipsize" property

  "ellipsize"                PangoEllipsizeMode    : Read / Write

The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.

Default value: PANGO_ELLIPSIZE_NONE


The "height" property

  "height"                   gdouble               : Read / Write

The height to use to layout the text, or -1 to use the natural height.

Default value: -1


The "text" property

  "text"                     gchararray            : Read / Write

The text to display.

Default value: NULL


The "use-markup" property

  "use-markup"               gboolean              : Read / Write

Whether to parse PangoMarkup in the text, to support different styles.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width to use to layout the text.

Default value: -1


The "wrap" property

  "wrap"                     PangoWrapMode         : Read / Write

The preferred method of wrapping the string if a width has been set.

Default value: PANGO_WRAP_WORD


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the text.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the text.

Default value: 0


goocanvas-0.15/docs/html/GooCanvasPathModel.html0000644000076400007640000003500411222215706016610 00000000000000 GooCanvasPathModel

GooCanvasPathModel

GooCanvasPathModel — a model for path items (a series of lines and curves).

Object Hierarchy


  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasPathModel

Implemented Interfaces

GooCanvasPathModel implements GooCanvasItemModel.

Properties


  "data"                     gchararray            : Write
  "height"                   gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasPathModel represents a model for path items, which are a series of one or more lines, bezier curves, or elliptical arcs.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

GooCanvasPathModel uses the same path specification strings as the Scalable Vector Graphics (SVG) path element. For details see the SVG specification.

To create a GooCanvasPathModel use goo_canvas_path_model_new().

To get or set the properties of an existing GooCanvasPathModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the path you must connect to the signal handlers of the corresponding GooCanvasPath objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasPathModel

typedef struct _GooCanvasPathModel GooCanvasPathModel;

The GooCanvasPathModel struct contains private data only.


goo_canvas_path_model_new ()

GooCanvasItemModel* goo_canvas_path_model_new           (GooCanvasItemModel *parent,
                                                         const gchar *path_data,
                                                         ...);

Creates a new path model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

path_data :

the sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new path model.

Here's an example showing how to create a red line from (20,20) to (40,40):

 GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup,
                                                       "M 20 20 L 40 40",
                                                       "stroke-color", "red",
                                                       NULL);

This example creates a cubic bezier curve from (20,100) to (100,100) with the control points at (20,50) and (100,50):

 GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup,
                                                       "M20,100 C20,50 100,50 100,100",
                                                       "stroke-color", "blue",
                                                       NULL);

This example uses an elliptical arc to create a filled circle with one quarter missing:

 GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup,
                                                       "M200,500 h-150 a150,150 0 1,0 150,-150 z",
                                                       "fill-color", "red",
                                                       "stroke-color", "blue",
                                                       "line-width", 5.0,
                                                       NULL);

Property Details

The "data" property

  "data"                     gchararray            : Write

The sequence of path commands.

Default value: NULL


The "height" property

  "height"                   gdouble               : Read / Write

The height of the path.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the path.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the path.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the path.

Default value: 0


goocanvas-0.15/docs/html/GooCanvasGrid.html0000644000076400007640000010103411222215706015615 00000000000000 GooCanvasGrid

GooCanvasGrid

GooCanvasGrid — a grid item.

Synopsis




                    GooCanvasGrid;
GooCanvasItem*      goo_canvas_grid_new                 (GooCanvasItem *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);


Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasGrid

Implemented Interfaces

GooCanvasGrid implements GooCanvasItem.

Properties


  "border-color"             gchararray            : Write
  "border-color-rgba"        guint                 : Read / Write
  "border-pattern"           GooCairoPattern       : Read / Write
  "border-pixbuf"            GdkPixbuf             : Write
  "border-width"             gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "horz-grid-line-color"     gchararray            : Write
  "horz-grid-line-color-rgba" guint                 : Read / Write
  "horz-grid-line-pattern"   GooCairoPattern       : Read / Write
  "horz-grid-line-pixbuf"    GdkPixbuf             : Write
  "horz-grid-line-width"     gdouble               : Read / Write
  "show-horz-grid-lines"     gboolean              : Read / Write
  "show-vert-grid-lines"     gboolean              : Read / Write
  "vert-grid-line-color"     gchararray            : Write
  "vert-grid-line-color-rgba" guint                 : Read / Write
  "vert-grid-line-pattern"   GooCairoPattern       : Read / Write
  "vert-grid-line-pixbuf"    GdkPixbuf             : Write
  "vert-grid-line-width"     gdouble               : Read / Write
  "vert-grid-lines-on-top"   gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "x-offset"                 gdouble               : Read / Write
  "x-step"                   gdouble               : Read / Write
  "y"                        gdouble               : Read / Write
  "y-offset"                 gdouble               : Read / Write
  "y-step"                   gdouble               : Read / Write

Description

GooCanvasGrid represents a grid item. A grid consists of a number of equally-spaced horizontal and vertical grid lines, plus an optional border.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasGrid use goo_canvas_grid_new().

To get or set the properties of an existing GooCanvasGrid, use g_object_get() and g_object_set().

The grid's position and size is specified with the "x", "y", "width" and "height" properties.

The "x-step" and "y-step" properties specify the distance between grid lines. The "x-offset" and "y-offset" properties specify the distance before the first grid lines.

The horizontal or vertical grid lines can be hidden using the "show-horz-grid-lines" and "show-vert-grid-lines" properties.

The width of the border can be set using the "border-width" property. The border is drawn outside the area specified with the "x", "y", "width" and "height" properties.

Other properties allow the colors and widths of the grid lines to be set. The grid line color and width properties override the standard "stroke-color" and "line-width" properties, enabling different styles for horizontal and vertical grid lines.

Details

GooCanvasGrid

typedef struct _GooCanvasGrid GooCanvasGrid;

The GooCanvasGrid struct contains private data only.


goo_canvas_grid_new ()

GooCanvasItem*      goo_canvas_grid_new                 (GooCanvasItem *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);

Creates a new grid item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

x :

the x coordinate of the left of the grid.

y :

the y coordinate of the top of the grid.

width :

the width of the grid.

height :

the height of the grid.

x_step :

the distance between the vertical grid lines.

y_step :

the distance between the horizontal grid lines.

x_offset :

the distance before the first vertical grid line.

y_offset :

the distance before the first horizontal grid line.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new grid item.

Here's an example showing how to create a grid:

 GooCanvasItem *grid = goo_canvas_grid_new (mygroup, 100.0, 100.0, 400.0, 200.0,
                                            20.0, 20.0, 10.0, 10.0,
                                            "horz-grid-line-width", 4.0,
                                            "horz-grid-line-color", "yellow",
                                            "vert-grid-line-width", 2.0,
                                            "vert-grid-line-color", "red",
                                            "border-width", 3.0,
                                            "border-color", "white",
                                            "fill-color", "blue",
                                            NULL);

Property Details

The "border-color" property

  "border-color"             gchararray            : Write

The color to use for the border.

Default value: NULL


The "border-color-rgba" property

  "border-color-rgba"        guint                 : Read / Write

The color to use for the border, specified as a 32-bit integer value.

Default value: 0


The "border-pattern" property

  "border-pattern"           GooCairoPattern       : Read / Write

The cairo pattern to paint the border with.


The "border-pixbuf" property

  "border-pixbuf"            GdkPixbuf             : Write

The pixbuf to use to draw the border.


The "border-width" property

  "border-width"             gdouble               : Read / Write

The width of the border around the grid.

Default value: -1


The "height" property

  "height"                   gdouble               : Read / Write

The height of the grid.

Allowed values: >= 0

Default value: 0


The "horz-grid-line-color" property

  "horz-grid-line-color"     gchararray            : Write

The color to use for the horizontal grid lines.

Default value: NULL


The "horz-grid-line-color-rgba" property

  "horz-grid-line-color-rgba" guint                 : Read / Write

The color to use for the horizontal grid lines, specified as a 32-bit integer value.

Default value: 0


The "horz-grid-line-pattern" property

  "horz-grid-line-pattern"   GooCairoPattern       : Read / Write

The cairo pattern to paint the horizontal grid lines with.


The "horz-grid-line-pixbuf" property

  "horz-grid-line-pixbuf"    GdkPixbuf             : Write

The pixbuf to use to draw the horizontal grid lines.


The "horz-grid-line-width" property

  "horz-grid-line-width"     gdouble               : Read / Write

The width of the horizontal grid lines.

Default value: -1


The "show-horz-grid-lines" property

  "show-horz-grid-lines"     gboolean              : Read / Write

If the horizontal grid lines are shown.

Default value: TRUE


The "show-vert-grid-lines" property

  "show-vert-grid-lines"     gboolean              : Read / Write

If the vertical grid lines are shown.

Default value: TRUE


The "vert-grid-line-color" property

  "vert-grid-line-color"     gchararray            : Write

The color to use for the vertical grid lines.

Default value: NULL


The "vert-grid-line-color-rgba" property

  "vert-grid-line-color-rgba" guint                 : Read / Write

The color to use for the vertical grid lines, specified as a 32-bit integer value.

Default value: 0


The "vert-grid-line-pattern" property

  "vert-grid-line-pattern"   GooCairoPattern       : Read / Write

The cairo pattern to paint the vertical grid lines with.


The "vert-grid-line-pixbuf" property

  "vert-grid-line-pixbuf"    GdkPixbuf             : Write

The pixbuf to use to draw the vertical grid lines.


The "vert-grid-line-width" property

  "vert-grid-line-width"     gdouble               : Read / Write

The width of the vertical grid lines.

Default value: -1


The "vert-grid-lines-on-top" property

  "vert-grid-lines-on-top"   gboolean              : Read / Write

If the vertical grid lines are painted above the horizontal grid lines.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the grid.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the grid.

Default value: 0


The "x-offset" property

  "x-offset"                 gdouble               : Read / Write

The distance before the first vertical grid line.

Allowed values: >= 0

Default value: 0


The "x-step" property

  "x-step"                   gdouble               : Read / Write

The distance between the vertical grid lines.

Allowed values: >= 0

Default value: 10


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the grid.

Default value: 0


The "y-offset" property

  "y-offset"                 gdouble               : Read / Write

The distance before the first horizontal grid line.

Allowed values: >= 0

Default value: 0


The "y-step" property

  "y-step"                   gdouble               : Read / Write

The distance between the horizontal grid lines.

Allowed values: >= 0

Default value: 10


goocanvas-0.15/docs/html/GooCanvasTableModel.html0000644000076400007640000007142111222215706016746 00000000000000 GooCanvasTableModel

GooCanvasTableModel

GooCanvasTableModel — a model for a table container to layout items.

Object Hierarchy


  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasGroupModel
               +----GooCanvasTableModel

Implemented Interfaces

GooCanvasTableModel implements GooCanvasItemModel.

Properties


  "column-spacing"           gdouble               : Read / Write
  "homogeneous-columns"      gboolean              : Read / Write
  "homogeneous-rows"         gboolean              : Read / Write
  "horz-grid-line-width"     gdouble               : Read / Write
  "row-spacing"              gdouble               : Read / Write
  "vert-grid-line-width"     gdouble               : Read / Write
  "x-border-spacing"         gdouble               : Read / Write
  "y-border-spacing"         gdouble               : Read / Write

Child Properties


  "bottom-padding"           gdouble               : Read / Write
  "column"                   guint                 : Read / Write
  "columns"                  guint                 : Read / Write
  "left-padding"             gdouble               : Read / Write
  "right-padding"            gdouble               : Read / Write
  "row"                      guint                 : Read / Write
  "rows"                     guint                 : Read / Write
  "top-padding"              gdouble               : Read / Write
  "x-align"                  gdouble               : Read / Write
  "x-expand"                 gboolean              : Read / Write
  "x-fill"                   gboolean              : Read / Write
  "x-shrink"                 gboolean              : Read / Write
  "y-align"                  gdouble               : Read / Write
  "y-expand"                 gboolean              : Read / Write
  "y-fill"                   gboolean              : Read / Write
  "y-shrink"                 gboolean              : Read / Write

Description

GooCanvasTableModel is a model for a table container used to lay out other canvas items. It is used in a similar way to how the GtkTable widget is used to lay out GTK+ widgets.

Item models are added to the table using the normal methods, then goo_canvas_item_model_set_child_properties() is used to specify how each child item is to be positioned within the table (i.e. which row and column it is in, how much padding it should have and whether it should expand or shrink).

GooCanvasTableModel is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasTableModel will affect all children of the GooCanvasTableModel (unless the children override the property setting).

GooCanvasTableModel implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_rotate(), and the properties such as "visibility" and "pointer-events".

To create a GooCanvasTableModel use goo_canvas_table_model_new().

To get or set the properties of an existing GooCanvasTableModel, use g_object_get() and g_object_set().

Details

GooCanvasTableModel

typedef struct _GooCanvasTableModel GooCanvasTableModel;

The GooCanvasTableModel struct contains private data only.


goo_canvas_table_model_new ()

GooCanvasItemModel* goo_canvas_table_model_new          (GooCanvasItemModel *parent,
                                                         ...);

Creates a new table model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new table model.

Here's an example showing how to create a table with a square, a circle and a triangle in it:

 GooCanvasItemModel *table, *square, *circle, *triangle;

 table = goo_canvas_table_model_new (root,
                                     "row-spacing", 4.0,
                                     "column-spacing", 4.0,
                                     NULL);
 goo_canvas_item_model_translate (table, 400, 200);

 square = goo_canvas_rect_model_new (table, 0.0, 0.0, 50.0, 50.0,
                                     "fill-color", "red",
                                     NULL);
 goo_canvas_item_model_set_child_properties (table, square,
                                             "row", 0,
                                             "column", 0,
                                             NULL);

 circle = goo_canvas_ellipse_model_new (table, 0.0, 0.0, 25.0, 25.0,
                                        "fill-color", "blue",
                                        NULL);
 goo_canvas_item_model_set_child_properties (table, circle,
                                             "row", 0,
                                             "column", 1,
                                             NULL);

 triangle = goo_canvas_polyline_model_new (table, TRUE, 3,
                                           25.0, 0.0, 0.0, 50.0, 50.0, 50.0,
                                           "fill-color", "yellow",
                                           NULL);
 goo_canvas_item_model_set_child_properties (table, triangle,
                                             "row", 0,
                                             "column", 2,
                                             NULL);

Property Details

The "column-spacing" property

  "column-spacing"           gdouble               : Read / Write

The default space between columns.

Allowed values: >= 0

Default value: 0


The "homogeneous-columns" property

  "homogeneous-columns"      gboolean              : Read / Write

If all columns are the same width.

Default value: FALSE


The "homogeneous-rows" property

  "homogeneous-rows"         gboolean              : Read / Write

If all rows are the same height.

Default value: FALSE


The "horz-grid-line-width" property

  "horz-grid-line-width"     gdouble               : Read / Write

The width of the grid line to draw between rows.

Allowed values: >= 0

Default value: 0


The "row-spacing" property

  "row-spacing"              gdouble               : Read / Write

The default space between rows.

Allowed values: >= 0

Default value: 0


The "vert-grid-line-width" property

  "vert-grid-line-width"     gdouble               : Read / Write

The width of the grid line to draw between columns.

Allowed values: >= 0

Default value: 0


The "x-border-spacing" property

  "x-border-spacing"         gdouble               : Read / Write

The amount of spacing between the lefmost and rightmost cells and the border grid line.

Allowed values: >= 0

Default value: 0


The "y-border-spacing" property

  "y-border-spacing"         gdouble               : Read / Write

The amount of spacing between the topmost and bottommost cells and the border grid line.

Allowed values: >= 0

Default value: 0

Child Property Details

The "bottom-padding" child property

  "bottom-padding"           gdouble               : Read / Write

Extra space to add below the item.

Allowed values: >= 0

Default value: 0


The "column" child property

  "column"                   guint                 : Read / Write

The column to place the item in.

Allowed values: <= 65535

Default value: 0


The "columns" child property

  "columns"                  guint                 : Read / Write

The number of columns that the item spans.

Allowed values: <= 65535

Default value: 1


The "left-padding" child property

  "left-padding"             gdouble               : Read / Write

Extra space to add to the left of the item.

Allowed values: >= 0

Default value: 0


The "right-padding" child property

  "right-padding"            gdouble               : Read / Write

Extra space to add to the right of the item.

Allowed values: >= 0

Default value: 0


The "row" child property

  "row"                      guint                 : Read / Write

The row to place the item in.

Allowed values: <= 65535

Default value: 0


The "rows" child property

  "rows"                     guint                 : Read / Write

The number of rows that the item spans.

Allowed values: <= 65535

Default value: 1


The "top-padding" child property

  "top-padding"              gdouble               : Read / Write

Extra space to add above the item.

Allowed values: >= 0

Default value: 0


The "x-align" child property

  "x-align"                  gdouble               : Read / Write

The horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-aligned.

Allowed values: [0,1]

Default value: 0.5


The "x-expand" child property

  "x-expand"                 gboolean              : Read / Write

If the item expands horizontally as the table expands.

Default value: FALSE


The "x-fill" child property

  "x-fill"                   gboolean              : Read / Write

If the item fills all horizontal allocated space.

Default value: FALSE


The "x-shrink" child property

  "x-shrink"                 gboolean              : Read / Write

If the item can shrink smaller than its requested size horizontally.

Default value: FALSE


The "y-align" child property

  "y-align"                  gdouble               : Read / Write

The vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-aligned.

Allowed values: [0,1]

Default value: 0.5


The "y-expand" child property

  "y-expand"                 gboolean              : Read / Write

If the item expands vertically as the table expands.

Default value: FALSE


The "y-fill" child property

  "y-fill"                   gboolean              : Read / Write

If the item fills all vertical allocated space.

Default value: FALSE


The "y-shrink" child property

  "y-shrink"                 gboolean              : Read / Write

If the item can shrink smaller than its requested size vertically.

Default value: FALSE


goocanvas-0.15/docs/html/goocanvas-simple-canvas.html0000644000076400007640000001341311222215706017652 00000000000000 Simple Canvas Example

Simple Canvas Example

Simple Canvas Example — how to create a simple canvas.

Simple Canvas Example

Here's a complete example application that creates a GooCanvas with a rectangle and a text item in it:

  #include <stdlib.h>
  #include <goocanvas.h>
  
  
  static gboolean on_rect_button_press (GooCanvasItem  *view,
                                        GooCanvasItem  *target,
                                        GdkEventButton *event,
                                        gpointer        data);
  
  static gboolean on_delete_event      (GtkWidget      *window,
                                        GdkEvent       *event,
                                        gpointer        unused_data);
  
  
  int
  main (int argc, char *argv[])
  {
    GtkWidget *window, *scrolled_win, *canvas;
    GooCanvasItem *root, *rect_item, *text_item;
  
    /* Initialize GTK+. */
    gtk_set_locale ();
    gtk_init (&argc, &argv);
  
    /* Create the window and widgets. */
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size (GTK_WINDOW (window), 640, 600);
    gtk_widget_show (window);
    g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event,
                      NULL);
  
    scrolled_win = gtk_scrolled_window_new (NULL, NULL);
    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
                                         GTK_SHADOW_IN);
    gtk_widget_show (scrolled_win);
    gtk_container_add (GTK_CONTAINER (window), scrolled_win);
  
    canvas = goo_canvas_new ();
    gtk_widget_set_size_request (canvas, 600, 450);
    goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000);
    gtk_widget_show (canvas);
    gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
  
    root = goo_canvas_get_root_item (GOO_CANVAS (canvas));
  
    /* Add a few simple items. */
    rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400,
                                     "line-width", 10.0,
                                     "radius-x", 20.0,
                                     "radius-y", 10.0,
                                     "stroke-color", "yellow",
                                     "fill-color", "red",
                                     NULL);
  
    text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1,
                                     GTK_ANCHOR_CENTER,
                                     "font", "Sans 24",
                                     NULL);
    goo_canvas_item_rotate (text_item, 45, 300, 300);
  
    /* Connect a signal handler for the rectangle item. */
    g_signal_connect (rect_item, "button_press_event",
                      (GtkSignalFunc) on_rect_button_press, NULL);
  
    /* Pass control to the GTK+ main event loop. */
    gtk_main ();
  
    return 0;
  }
  
  
  /* This handles button presses in item views. We simply output a message to
     the console. */
  static gboolean
  on_rect_button_press (GooCanvasItem  *item,
                        GooCanvasItem  *target,
                        GdkEventButton *event,
                        gpointer        data)
  {
    g_print ("rect item received button press event\n");
    return TRUE;
  }
  
  
  /* This is our handler for the "delete-event" signal of the window, which
     is emitted when the 'x' close button is clicked. We just exit here. */
  static gboolean
  on_delete_event (GtkWidget *window,
                   GdkEvent  *event,
                   gpointer   unused_data)
  {
    exit (0);
  }
 
goocanvas-0.15/docs/html/GooCanvasTextModel.html0000644000076400007640000004506711222215706016652 00000000000000 GooCanvasTextModel

GooCanvasTextModel

GooCanvasTextModel — a model for text items.

Synopsis




                    GooCanvasTextModel;
GooCanvasItemModel* goo_canvas_text_model_new           (GooCanvasItemModel *parent,
                                                         const char *string,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         GtkAnchorType anchor,
                                                         ...);


Object Hierarchy


  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasTextModel

Implemented Interfaces

GooCanvasTextModel implements GooCanvasItemModel.

Properties


  "alignment"                PangoAlignment        : Read / Write
  "anchor"                   GtkAnchorType         : Read / Write
  "ellipsize"                PangoEllipsizeMode    : Read / Write
  "height"                   gdouble               : Read / Write
  "text"                     gchararray            : Read / Write
  "use-markup"               gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "wrap"                     PangoWrapMode         : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasTextModel represents a model for text items.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "fill-color".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasTextModel use goo_canvas_text_model_new().

To get or set the properties of an existing GooCanvasTextModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the text item you must connect to the signal handlers of the corresponding GooCanvasText objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasTextModel

typedef struct _GooCanvasTextModel GooCanvasTextModel;

The GooCanvasTextModel struct contains private data only.


goo_canvas_text_model_new ()

GooCanvasItemModel* goo_canvas_text_model_new           (GooCanvasItemModel *parent,
                                                         const char *string,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         GtkAnchorType anchor,
                                                         ...);

Creates a new text model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

string :

the text to display.

x :

the x coordinate of the text.

y :

the y coordinate of the text.

width :

the width of the text item, or -1 for unlimited width.

anchor :

the position of the text relative to the given x and y coordinates. For example an anchor of GDK_ANCHOR_NW will result in the top-left of the text being placed at the given x and y coordinates. An anchor of GDK_ANCHOR_CENTER will result in the center of the text being placed at the x and y coordinates.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new text model.

Here's an example showing how to create a text item with the bottom right of the text box placed at (500,500):

 GooCanvasItemModel *text = goo_canvas_text_model_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE,
                                                       "fill-color", "blue",
                                                       NULL);

Property Details

The "alignment" property

  "alignment"                PangoAlignment        : Read / Write

How to align the text.

Default value: PANGO_ALIGN_LEFT


The "anchor" property

  "anchor"                   GtkAnchorType         : Read / Write

How to position the text relative to the given x and y coordinates.

Default value: GTK_ANCHOR_NORTH_WEST


The "ellipsize" property

  "ellipsize"                PangoEllipsizeMode    : Read / Write

The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.

Default value: PANGO_ELLIPSIZE_NONE


The "height" property

  "height"                   gdouble               : Read / Write

The height to use to layout the text, or -1 to use the natural height.

Default value: -1


The "text" property

  "text"                     gchararray            : Read / Write

The text to display.

Default value: NULL


The "use-markup" property

  "use-markup"               gboolean              : Read / Write

Whether to parse PangoMarkup in the text, to support different styles.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width to use to layout the text.

Default value: -1


The "wrap" property

  "wrap"                     PangoWrapMode         : Read / Write

The preferred method of wrapping the string if a width has been set.

Default value: PANGO_WRAP_WORD


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the text.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the text.

Default value: 0


goocanvas-0.15/docs/html/GooCanvasRect.html0000644000076400007640000003373411222215706015640 00000000000000 GooCanvasRect

GooCanvasRect

GooCanvasRect — a rectangle item.

Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasRect

Implemented Interfaces

GooCanvasRect implements GooCanvasItem.

Properties


  "height"                   gdouble               : Read / Write
  "radius-x"                 gdouble               : Read / Write
  "radius-y"                 gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasRect represents a rectangle item.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasRect use goo_canvas_rect_new().

To get or set the properties of an existing GooCanvasRect, use g_object_get() and g_object_set().

Details

GooCanvasRect

typedef struct _GooCanvasRect GooCanvasRect;

The GooCanvasRect struct contains private data only.


goo_canvas_rect_new ()

GooCanvasItem*      goo_canvas_rect_new                 (GooCanvasItem *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);

Creates a new rectangle item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

x :

the x coordinate of the left of the rectangle.

y :

the y coordinate of the top of the rectangle.

width :

the width of the rectangle.

height :

the height of the rectangle.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new rectangle item.

Here's an example showing how to create a rectangle at (100,100) with a width of 200 and a height of 100.

 GooCanvasItem *rect = goo_canvas_rect_new (mygroup, 100.0, 100.0, 200.0, 100.0,
                                            "stroke-color", "red",
                                            "line-width", 5.0,
                                            "fill-color", "blue",
                                            NULL);

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the rectangle.

Allowed values: >= 0

Default value: 0


The "radius-x" property

  "radius-x"                 gdouble               : Read / Write

The horizontal radius to use for rounded corners.

Allowed values: >= 0

Default value: 0


The "radius-y" property

  "radius-y"                 gdouble               : Read / Write

The vertical radius to use for rounded corners.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the rectangle.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the rectangle.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the rectangle.

Default value: 0


goocanvas-0.15/docs/html/GooCanvasEllipse.html0000644000076400007640000003745711222215706016346 00000000000000 GooCanvasEllipse

GooCanvasEllipse

GooCanvasEllipse — an ellipse item.

Synopsis




                    GooCanvasEllipse;
GooCanvasItem*      goo_canvas_ellipse_new              (GooCanvasItem *parent,
                                                         gdouble center_x,
                                                         gdouble center_y,
                                                         gdouble radius_x,
                                                         gdouble radius_y,
                                                         ...);


Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasEllipse

Implemented Interfaces

GooCanvasEllipse implements GooCanvasItem.

Properties


  "center-x"                 gdouble               : Read / Write
  "center-y"                 gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "radius-x"                 gdouble               : Read / Write
  "radius-y"                 gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasEllipse represents an ellipse item.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasEllipse use goo_canvas_ellipse_new().

To get or set the properties of an existing GooCanvasEllipse, use g_object_get() and g_object_set().

The ellipse can be specified either with the "center-x", "center-y", "radius-x" and "radius-y" properties, or with the "x", "y", "width" and "height" properties.

Details

GooCanvasEllipse

typedef struct _GooCanvasEllipse GooCanvasEllipse;

The GooCanvasEllipse struct contains private data only.


goo_canvas_ellipse_new ()

GooCanvasItem*      goo_canvas_ellipse_new              (GooCanvasItem *parent,
                                                         gdouble center_x,
                                                         gdouble center_y,
                                                         gdouble radius_x,
                                                         gdouble radius_y,
                                                         ...);

Creates a new ellipse item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

center_x :

the x coordinate of the center of the ellipse.

center_y :

the y coordinate of the center of the ellipse.

radius_x :

the horizontal radius of the ellipse.

radius_y :

the vertical radius of the ellipse.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new ellipse item.

Here's an example showing how to create an ellipse centered at (100.0, 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. It is drawn with a red outline with a width of 5.0 and filled with blue:

 GooCanvasItem *ellipse = goo_canvas_ellipse_new (mygroup, 100.0, 100.0, 50.0, 30.0,
                                                  "stroke-color", "red",
                                                  "line-width", 5.0,
                                                  "fill-color", "blue",
                                                  NULL);

Property Details

The "center-x" property

  "center-x"                 gdouble               : Read / Write

The x coordinate of the center of the ellipse.

Default value: 0


The "center-y" property

  "center-y"                 gdouble               : Read / Write

The y coordinate of the center of the ellipse.

Default value: 0


The "height" property

  "height"                   gdouble               : Read / Write

The height of the ellipse.

Allowed values: >= 0

Default value: 0


The "radius-x" property

  "radius-x"                 gdouble               : Read / Write

The horizontal radius of the ellipse.

Allowed values: >= 0

Default value: 0


The "radius-y" property

  "radius-y"                 gdouble               : Read / Write

The vertical radius of the ellipse.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the ellipse.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the left side of the ellipse.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the top of the ellipse.

Default value: 0


goocanvas-0.15/docs/html/GooCanvasTable.html0000644000076400007640000006752511222215706015777 00000000000000 GooCanvasTable

GooCanvasTable

GooCanvasTable — a table container to layout items.

Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasGroup
               +----GooCanvasTable

Implemented Interfaces

GooCanvasTable implements GooCanvasItem.

Properties


  "column-spacing"           gdouble               : Read / Write
  "homogeneous-columns"      gboolean              : Read / Write
  "homogeneous-rows"         gboolean              : Read / Write
  "horz-grid-line-width"     gdouble               : Read / Write
  "row-spacing"              gdouble               : Read / Write
  "vert-grid-line-width"     gdouble               : Read / Write
  "x-border-spacing"         gdouble               : Read / Write
  "y-border-spacing"         gdouble               : Read / Write

Child Properties


  "bottom-padding"           gdouble               : Read / Write
  "column"                   guint                 : Read / Write
  "columns"                  guint                 : Read / Write
  "left-padding"             gdouble               : Read / Write
  "right-padding"            gdouble               : Read / Write
  "row"                      guint                 : Read / Write
  "rows"                     guint                 : Read / Write
  "top-padding"              gdouble               : Read / Write
  "x-align"                  gdouble               : Read / Write
  "x-expand"                 gboolean              : Read / Write
  "x-fill"                   gboolean              : Read / Write
  "x-shrink"                 gboolean              : Read / Write
  "y-align"                  gdouble               : Read / Write
  "y-expand"                 gboolean              : Read / Write
  "y-fill"                   gboolean              : Read / Write
  "y-shrink"                 gboolean              : Read / Write

Description

GooCanvasTable is a table container used to lay out other canvas items. It is used in a similar way to how the GtkTable widget is used to lay out GTK+ widgets.

Items are added to the table using the normal methods, then goo_canvas_item_set_child_properties() is used to specify how each child item is to be positioned within the table (i.e. which row and column it is in, how much padding it should have and whether it should expand or shrink).

GooCanvasTable is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasTable will affect all children of the GooCanvasTable (unless the children override the property setting).

GooCanvasTable implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(), and the properties such as "visibility" and "pointer-events".

To create a GooCanvasTable use goo_canvas_table_new().

To get or set the properties of an existing GooCanvasTable, use g_object_get() and g_object_set().

Details

GooCanvasTable

typedef struct _GooCanvasTable GooCanvasTable;

The GooCanvasTable struct contains private data only.


goo_canvas_table_new ()

GooCanvasItem*      goo_canvas_table_new                (GooCanvasItem *parent,
                                                         ...);

Creates a new table item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new table item.

Here's an example showing how to create a table with a square, a circle and a triangle in it:

 GooCanvasItem *table, *square, *circle, *triangle;
 
 table = goo_canvas_table_new (root,
                               "row-spacing", 4.0,
                               "column-spacing", 4.0,
                               NULL);
 goo_canvas_item_translate (table, 400, 200);
 
 square = goo_canvas_rect_new (table, 0.0, 0.0, 50.0, 50.0,
                               "fill-color", "red",
                               NULL);
 goo_canvas_item_set_child_properties (table, square,
                                       "row", 0,
                                       "column", 0,
                                       NULL);
 
 circle = goo_canvas_ellipse_new (table, 0.0, 0.0, 25.0, 25.0,
                                  "fill-color", "blue",
                                  NULL);
 goo_canvas_item_set_child_properties (table, circle,
                                       "row", 0,
                                       "column", 1,
                                       NULL);
 
 triangle = goo_canvas_polyline_new (table, TRUE, 3,
                                     25.0, 0.0, 0.0, 50.0, 50.0, 50.0,
                                     "fill-color", "yellow",
                                     NULL);
 goo_canvas_item_set_child_properties (table, triangle,
                                       "row", 0,
                                       "column", 2,
                                       NULL);

Property Details

The "column-spacing" property

  "column-spacing"           gdouble               : Read / Write

The default space between columns.

Allowed values: >= 0

Default value: 0


The "homogeneous-columns" property

  "homogeneous-columns"      gboolean              : Read / Write

If all columns are the same width.

Default value: FALSE


The "homogeneous-rows" property

  "homogeneous-rows"         gboolean              : Read / Write

If all rows are the same height.

Default value: FALSE


The "horz-grid-line-width" property

  "horz-grid-line-width"     gdouble               : Read / Write

The width of the grid line to draw between rows.

Allowed values: >= 0

Default value: 0


The "row-spacing" property

  "row-spacing"              gdouble               : Read / Write

The default space between rows.

Allowed values: >= 0

Default value: 0


The "vert-grid-line-width" property

  "vert-grid-line-width"     gdouble               : Read / Write

The width of the grid line to draw between columns.

Allowed values: >= 0

Default value: 0


The "x-border-spacing" property

  "x-border-spacing"         gdouble               : Read / Write

The amount of spacing between the lefmost and rightmost cells and the border grid line.

Allowed values: >= 0

Default value: 0


The "y-border-spacing" property

  "y-border-spacing"         gdouble               : Read / Write

The amount of spacing between the topmost and bottommost cells and the border grid line.

Allowed values: >= 0

Default value: 0

Child Property Details

The "bottom-padding" child property

  "bottom-padding"           gdouble               : Read / Write

Extra space to add below the item.

Allowed values: >= 0

Default value: 0


The "column" child property

  "column"                   guint                 : Read / Write

The column to place the item in.

Allowed values: <= 65535

Default value: 0


The "columns" child property

  "columns"                  guint                 : Read / Write

The number of columns that the item spans.

Allowed values: <= 65535

Default value: 1


The "left-padding" child property

  "left-padding"             gdouble               : Read / Write

Extra space to add to the left of the item.

Allowed values: >= 0

Default value: 0


The "right-padding" child property

  "right-padding"            gdouble               : Read / Write

Extra space to add to the right of the item.

Allowed values: >= 0

Default value: 0


The "row" child property

  "row"                      guint                 : Read / Write

The row to place the item in.

Allowed values: <= 65535

Default value: 0


The "rows" child property

  "rows"                     guint                 : Read / Write

The number of rows that the item spans.

Allowed values: <= 65535

Default value: 1


The "top-padding" child property

  "top-padding"              gdouble               : Read / Write

Extra space to add above the item.

Allowed values: >= 0

Default value: 0


The "x-align" child property

  "x-align"                  gdouble               : Read / Write

The horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-aligned.

Allowed values: [0,1]

Default value: 0.5


The "x-expand" child property

  "x-expand"                 gboolean              : Read / Write

If the item expands horizontally as the table expands.

Default value: FALSE


The "x-fill" child property

  "x-fill"                   gboolean              : Read / Write

If the item fills all horizontal allocated space.

Default value: FALSE


The "x-shrink" child property

  "x-shrink"                 gboolean              : Read / Write

If the item can shrink smaller than its requested size horizontally.

Default value: FALSE


The "y-align" child property

  "y-align"                  gdouble               : Read / Write

The vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-aligned.

Allowed values: [0,1]

Default value: 0.5


The "y-expand" child property

  "y-expand"                 gboolean              : Read / Write

If the item expands vertically as the table expands.

Default value: FALSE


The "y-fill" child property

  "y-fill"                   gboolean              : Read / Write

If the item fills all vertical allocated space.

Default value: FALSE


The "y-shrink" child property

  "y-shrink"                 gboolean              : Read / Write

If the item can shrink smaller than its requested size vertically.

Default value: FALSE


goocanvas-0.15/docs/html/up.png0000644000076400007640000000062611222215703013375 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ2.œE€Ù#IDATxœí“=JÄ@F¿o‰] !+¤œ2…Å[ZÌ<@/á<€¥…XÛ Ú­20v±³ˆÂ…Ïj0»lþvV°ðA`˜ ïÍ ð—t*iùâHÒ­~xR~'IUUÉ9ç#OÁ‘my–eJÓTeY†GvÉ@x¤O#ß;2E>9²|t$DÞ9nnBäíÈjµò‘BRIsIªë:HîŸ8ŽU…œùëùPÖÚN™1fc­sNÎ95Mã§–ɵ¤ ׿ŸØŒ1~¸pEòe$ïIž°€Ç î7nrDòf!;Ã`¨çÝ'äykíÎI’øáû䲤sI_]ÿÇy—‡‘€ÅÀ^^I>O>Á¡ø­§²š?YBIEND®B`‚goocanvas-0.15/docs/html/ch03.html0000644000076400007640000000660311222215706013672 00000000000000 Standard Canvas Items

Standard Canvas Items

GooCanvasGroup — a group of items.
GooCanvasEllipse — an ellipse item.
GooCanvasGrid — a grid item.
GooCanvasImage — an image item.
GooCanvasPath — a path item (a series of lines and curves).
GooCanvasPolyline — a polyline item (a series of lines with optional arrows).
GooCanvasRect — a rectangle item.
GooCanvasText — a text item.
GooCanvasWidget — an embedded widget item.
GooCanvasTable — a table container to layout items.
goocanvas-0.15/docs/html/ch05.html0000644000076400007640000000377111222215706013677 00000000000000 Miscellaneous

Miscellaneous

GooCanvas Types — types used in GooCanvas.
goocanvas-0.15/docs/html/index.sgml0000644000076400007640000020451011222215703014234 00000000000000 goocanvas-0.15/docs/html/GooCanvasItemModelSimple.html0000644000076400007640000005513511222215706017773 00000000000000 GooCanvasItemModelSimple

GooCanvasItemModelSimple

GooCanvasItemModelSimple — the base class for the standard canvas item models.

Implemented Interfaces

GooCanvasItemModelSimple implements GooCanvasItemModel.

Properties


  "antialias"                GooCairoAntialias     : Read / Write
  "clip-fill-rule"           GooCairoFillRule      : Read / Write
  "clip-path"                gchararray            : Write
  "fill-color"               gchararray            : Write
  "fill-color-rgba"          guint                 : Read / Write
  "fill-pattern"             GooCairoPattern       : Read / Write
  "fill-pixbuf"              GdkPixbuf             : Write
  "fill-rule"                GooCairoFillRule      : Read / Write
  "font"                     gchararray            : Read / Write
  "font-desc"                PangoFontDescription  : Read / Write
  "hint-metrics"             GooCairoHintMetrics   : Read / Write
  "line-cap"                 GooCairoLineCap       : Read / Write
  "line-dash"                GooCanvasLineDash     : Read / Write
  "line-join"                GooCairoLineJoin      : Read / Write
  "line-join-miter-limit"    gdouble               : Read / Write
  "line-width"               gdouble               : Read / Write
  "operator"                 GooCairoOperator      : Read / Write
  "stroke-color"             gchararray            : Write
  "stroke-color-rgba"        guint                 : Read / Write
  "stroke-pattern"           GooCairoPattern       : Read / Write
  "stroke-pixbuf"            GdkPixbuf             : Write

Description

GooCanvasItemModelSimple is used as a base class for the standard canvas item models. It can also be used as the base class for new custom canvas item models.

It provides default implementations for many of the GooCanvasItemModel methods.

Subclasses of GooCanvasItemModelSimple only need to implement the create_item() method of the GooCanvasItemModel interface, to create the default canvas item to view the item model.

Details

GooCanvasItemModelSimple

typedef struct {
  GooCanvasItemModel *parent;
  GooCanvasItemSimpleData simple_data;
} GooCanvasItemModelSimple;

The GooCanvasItemModelSimple struct contains the basic data needed to implement canvas item models.

GooCanvasItemModel *parent;

the parent model.

GooCanvasItemSimpleData simple_data;

data used by the canvas item for viewing the model.

Property Details

The "antialias" property

  "antialias"                GooCairoAntialias     : Read / Write

The antialiasing mode to use.

Default value: CAIRO_ANTIALIAS_GRAY


The "clip-fill-rule" property

  "clip-fill-rule"           GooCairoFillRule      : Read / Write

The fill rule used to determine which parts of the item are clipped.

Default value: CAIRO_FILL_RULE_WINDING


The "clip-path" property

  "clip-path"                gchararray            : Write

The sequence of commands describing the clip path of the item, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

Default value: NULL


The "fill-color" property

  "fill-color"               gchararray            : Write

The color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.

Default value: NULL


The "fill-color-rgba" property

  "fill-color-rgba"          guint                 : Read / Write

The color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULL.

Default value: 0


The "fill-pattern" property

  "fill-pattern"             GooCairoPattern       : Read / Write

The pattern to use to paint the interior of the item, or NULL to disable painting.


The "fill-pixbuf" property

  "fill-pixbuf"              GdkPixbuf             : Write

The pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.


The "fill-rule" property

  "fill-rule"                GooCairoFillRule      : Read / Write

The fill rule used to determine which parts of the item are filled.

Default value: CAIRO_FILL_RULE_WINDING


The "font" property

  "font"                     gchararray            : Read / Write

The base font to use for the text.

Default value: NULL


The "font-desc" property

  "font-desc"                PangoFontDescription  : Read / Write

The attributes specifying which font to use.


The "hint-metrics" property

  "hint-metrics"             GooCairoHintMetrics   : Read / Write

The hinting to be used for font metrics.

Default value: CAIRO_HINT_METRICS_OFF


The "line-cap" property

  "line-cap"                 GooCairoLineCap       : Read / Write

The line cap style to use.

Default value: CAIRO_LINE_CAP_BUTT


The "line-dash" property

  "line-dash"                GooCanvasLineDash     : Read / Write

The dash pattern to use.


The "line-join" property

  "line-join"                GooCairoLineJoin      : Read / Write

The line join style to use.

Default value: CAIRO_LINE_JOIN_MITER


The "line-join-miter-limit" property

  "line-join-miter-limit"    gdouble               : Read / Write

The smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit.

Allowed values: >= 0

Default value: 10


The "line-width" property

  "line-width"               gdouble               : Read / Write

The line width to use for the item's perimeter.

Allowed values: >= 0

Default value: 2


The "operator" property

  "operator"                 GooCairoOperator      : Read / Write

The compositing operator to use.

Default value: CAIRO_OPERATOR_OVER


The "stroke-color" property

  "stroke-color"             gchararray            : Write

The color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.

Default value: NULL


The "stroke-color-rgba" property

  "stroke-color-rgba"        guint                 : Read / Write

The color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULL.

Default value: 0


The "stroke-pattern" property

  "stroke-pattern"           GooCairoPattern       : Read / Write

The pattern to use to paint the perimeter of the item, or NULL disable painting.


The "stroke-pixbuf" property

  "stroke-pixbuf"            GdkPixbuf             : Write

The pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.


goocanvas-0.15/docs/html/goocanvas.devhelp20000644000076400007640000022640711222215703015665 00000000000000 goocanvas-0.15/docs/html/GooCanvasEllipseModel.html0000644000076400007640000004146711222215706017323 00000000000000 GooCanvasEllipseModel

GooCanvasEllipseModel

GooCanvasEllipseModel — a model for ellipse items.

Synopsis




                    GooCanvasEllipseModel;
GooCanvasItemModel* goo_canvas_ellipse_model_new        (GooCanvasItemModel *parent,
                                                         gdouble center_x,
                                                         gdouble center_y,
                                                         gdouble radius_x,
                                                         gdouble radius_y,
                                                         ...);


Object Hierarchy


  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasEllipseModel

Implemented Interfaces

GooCanvasEllipseModel implements GooCanvasItemModel.

Properties


  "center-x"                 gdouble               : Read / Write
  "center-y"                 gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "radius-x"                 gdouble               : Read / Write
  "radius-y"                 gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasEllipseModel represents a model for ellipse items.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasEllipseModel use goo_canvas_ellipse_model_new().

To get or set the properties of an existing GooCanvasEllipseModel, use g_object_get() and g_object_set().

The ellipse can be specified either with the "center-x", "center-y", "radius-x" and "radius-y" properties, or with the "x", "y", "width" and "height" properties.

To respond to events such as mouse clicks on the ellipse you must connect to the signal handlers of the corresponding GooCanvasEllipse objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasEllipseModel

typedef struct _GooCanvasEllipseModel GooCanvasEllipseModel;

The GooCanvasEllipseModel struct contains private data only.


goo_canvas_ellipse_model_new ()

GooCanvasItemModel* goo_canvas_ellipse_model_new        (GooCanvasItemModel *parent,
                                                         gdouble center_x,
                                                         gdouble center_y,
                                                         gdouble radius_x,
                                                         gdouble radius_y,
                                                         ...);

Creates a new ellipse model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

center_x :

the x coordinate of the center of the ellipse.

center_y :

the y coordinate of the center of the ellipse.

radius_x :

the horizontal radius of the ellipse.

radius_y :

the vertical radius of the ellipse.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new ellipse model.

Here's an example showing how to create an ellipse centered at (100.0, 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. It is drawn with a red outline with a width of 5.0 and filled with blue:

 GooCanvasItemModel *ellipse = goo_canvas_ellipse_model_new (mygroup, 100.0, 100.0, 50.0, 30.0,
                                                             "stroke-color", "red",
                                                             "line-width", 5.0,
                                                             "fill-color", "blue",
                                                             NULL);

Property Details

The "center-x" property

  "center-x"                 gdouble               : Read / Write

The x coordinate of the center of the ellipse.

Default value: 0


The "center-y" property

  "center-y"                 gdouble               : Read / Write

The y coordinate of the center of the ellipse.

Default value: 0


The "height" property

  "height"                   gdouble               : Read / Write

The height of the ellipse.

Allowed values: >= 0

Default value: 0


The "radius-x" property

  "radius-x"                 gdouble               : Read / Write

The horizontal radius of the ellipse.

Allowed values: >= 0

Default value: 0


The "radius-y" property

  "radius-y"                 gdouble               : Read / Write

The vertical radius of the ellipse.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the ellipse.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the left side of the ellipse.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the top of the ellipse.

Default value: 0


goocanvas-0.15/docs/html/ch04.html0000644000076400007640000000667211222215706013701 00000000000000 Standard Canvas Item Models

Standard Canvas Item Models

GooCanvasGroupModel — a model for a group of items.
GooCanvasEllipseModel — a model for ellipse items.
GooCanvasGridModel — a model for grid items.
GooCanvasImageModel — a model for image items.
GooCanvasPathModel — a model for path items (a series of lines and curves).
GooCanvasPolylineModel — a model for polyline items (a series of lines with optional arrows).
GooCanvasRectModel — a model for rectangle items.
GooCanvasTextModel — a model for text items.
GooCanvasTableModel — a model for a table container to layout items.
goocanvas-0.15/docs/html/goocanvas-creating-items.html0000644000076400007640000004707111222215706020032 00000000000000 Creating New Items

Creating New Items

Creating New Items — how to create new canvas items.

How to Create New Canvas Items

There are 3 ways to create new canvas items, listed here in increasing order of complexity:

These will be discussed in turn below. (It is also possible to create new container items by subclassing GooCanvasGroup, but that is not covered here.)

The final part of this section covers creating item models.

Creating a Simple Subclass of GooCanvasItemSimple

For items that consist of a simple graphic element such as a line, rectangle or circle, it is possible to create a subclass of GooCanvasItemSimple and override just one method, simple_create_path(). (This method is used for the GooCanvasEllipse and GooCanvasPath items.)

The simple_create_path() method should create a path using the given cairo context. The path will be drawn using the stroke, fill and other painting properties from GooCanvasItemSimple.

This example shows the simple_create_path() method for a simple rectangular item, MyItem:

  static void
  my_item_simple_create_path (GooCanvasItemSimple *simple,
                              cairo_t             *cr)
  {
    MyItem *item = (MyItem*) simple;

    cairo_rectangle (cr, item->x, item->y, item->width, item->height);
  }
	

Whenever the item is changed in some way it should call goo_canvas_item_simple_changed(), passing a boolean value indicating whether the item's bounds need to be recalculated or if it only needs to be repainted. The GooCanvasItemSimple code will take care of updating the item and repainting the appropriate parts of the canvas.


Creating a Regular Subclass of GooCanvasItemSimple

Most items will need more than a simple line or rectangle, so they will need to create a subclass of GooCanvasItemSimple and override three methods, simple_update(), simple_paint() and simple_is_item_at().

The simple_update() method should compute the bounds of the item, in the item's coordinate space, and place them in the bounds member of GooCanvasItemSimple. Note that the cairo context passed to this function may have transformations applied to it, so cairo_identity_matrix() should be called before using it.

The simple_paint() method should paint the item using the given cairo context. To use the stroke and fill properties from GooCanvasItemSimple to paint parts of the item call goo_canvas_style_set_stroke_options() and goo_canvas_style_set_fill_options() before calling cairo_stroke() and cairo_fill(). (The item's style can be found in GOO_CANVAS_ITEM_SIMPLE (item)->simple_data->style).

The simple_is_item_at() method should return TRUE if the given coordinate (in the item's coordinate space) is inside the item. (The is_pointer_event argument can be ignored for most purposes since the GooCanvasItemSimple code will take care of it.)

This example code shows the simple_update(), simple_paint() and simple_is_item_at() methods for a rectangular item (the complete item's source code can be found in the GooCanvas demo directory, in demo-item.h and demo-item.c):

  static void
  goo_demo_item_update  (GooCanvasItemSimple *simple,
                         cairo_t             *cr)
  {
    GooDemoItem *demo_item = (GooDemoItem*) simple;
  
    /* Compute the new bounds. */
    simple->bounds.x1 = demo_item->x;
    simple->bounds.y1 = demo_item->y;
    simple->bounds.x2 = demo_item->x + demo_item->width;
    simple->bounds.y2 = demo_item->y + demo_item->height;
  }
  
  
  static void
  goo_demo_item_paint (GooCanvasItemSimple   *simple,
                       cairo_t               *cr,
                       const GooCanvasBounds *bounds)
  {
    GooDemoItem *demo_item = (GooDemoItem*) simple;
  
    cairo_move_to (cr, demo_item->x, demo_item->y);
    cairo_line_to (cr, demo_item->x, demo_item->y + demo_item->height);
    cairo_line_to (cr, demo_item->x + demo_item->width,
                   demo_item->y + demo_item->height);
    cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y);
    cairo_close_path (cr);
    goo_canvas_style_set_fill_options (simple->simple_data->style, cr);
    cairo_fill (cr);
  }
  
  
  static gboolean
  goo_demo_item_is_item_at (GooCanvasItemSimple *simple,
                            gdouble              x,
                            gdouble              y,
                            cairo_t             *cr,
                            gboolean             is_pointer_event)
  {
    GooDemoItem *demo_item = (GooDemoItem*) simple;
  
    if (x < demo_item->x || (x > demo_item->x + demo_item->width)
        || y < demo_item->y || (y > demo_item->y + demo_item->height))
      return FALSE;
  
    return TRUE;
  }
	

As with the simple GooCanvasItemSimple subclass, the item should call goo_canvas_item_simple_changed() whenever it is changed, to ensure that the item's bounds are recomputed and it is repainted if necessary.


Implementing the GooCanvasItem Interface

The most complicated way to create new canvas items is to implement the GooCanvasItem interface directly. This should not be needed in most cases, but may be desired if the developer wants to avoid the memory and processor overheads associated with the GooCanvasItemSimple class, or if the developer wants to turn an existing application object into a canvas item.

At a minimum the canvas item must implement these 6 methods:

  • get_parent() - the item's parent should be returned.

  • set_parent() - the item's parent should be stored (though it should not add a reference to the parent).

  • get_bounds() - returns the bounds of the item, in canvas space. The item should ensure that the bounds are up-to-date before returning them, calling goo_canvas_item_ensure_updated() if necessary.

  • update() - if the item has been changed since the last update, or if the entire_tree flag is TRUE, the item's bounds should be recomputed (in canvas space). It should also request a redraw of the old bounds and the new bounds, so the display is updated appropriately. The new bounds should be returned in the bounds argument.

  • paint() - if the item's bounds intersect the given bounds then the item should be painted on the given cairo context. The scale parameter is only used to check if the item should be visible, according to the item's "visibility" and "visibility-threshold" property settings.

  • get_items_at() - if the given point is inside the item then a pointer to the item should be added to the start of the list of found items. The list is then returned.

The canvas item must also implement the "parent", "title", "description", "visibility", "visibility-threshold", "transform" and "pointer-events" properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.)

If the canvas item will be used within a container that does item layout, such as GooCanvasTable, it must implement the first two methods here at least:

  • get_requested_area() - returns the requested area of the item, in the parent's coordinate space.

  • allocate_area() - allocates the item's area, in the parent's coordinate space.

  • get_requested_height() - returns the requested height of the item, given a particular allocated width, in the parent's coordinate space. (This only needed for items that change height as their width is changed, such as text items.)

If the canvas item supports a transformation matrix it must implement:

  • get_transform() - returns the item's transformation matrix.

  • set_transform() - sets the item's transformation matrix.

If the canvas item supports a GooCanvasStyle setting, it must implement:

  • get_style() - returns the item's style.

  • set_style() - sets the item's style.

Since GooCanvasItemSimple implements most of the above methods and properties its source code is a good place to look for help.


Creating Item Models

As with creating canvas items, to create item models it is possible to subclass GooCanvasItemModelSimple or to implement the GooCanvasItemModel interface directly.

Subclassing GooCanvasItemModelSimple is very easy, since only one method from the GooCanvasItemModel interface must be implemented - create_item(). This should return a new canvas item for viewing the item model in a canvas. (It may be called multiple times if multiple canvases are viewing the same canvas model.)

The GooCanvasItemModelSimple subclass should emit the "changed" signal whenever it has changed, with a boolean flag indicating if the bounds need to be recomputed. The canvas items will connect to this signal and request an update or a redraw as appropriate.

To implement the GooCanvasItemModel interface directly, the class must implement the get_parent(), set_parent() and create_item() methods. It may also implement get_transform(), set_transform(), get_style() and set_style() methods if desired.

The class must also implement the "parent", "title", "description", "can-focus", "visibility", "visibility-threshold", "transform" and "pointer-events" properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.)

goocanvas-0.15/docs/html/ch02.html0000644000076400007640000000556111222215706013673 00000000000000 Core Objects

Core Objects

GooCanvas — the main canvas widget.
GooCanvasItem — the interface for canvas items.
GooCanvasItemModel — the interface for canvas item models.
GooCanvasItemSimple — the base class for the standard canvas items.
GooCanvasItemModelSimple — the base class for the standard canvas item models.
GooCanvasStyle — support for cascading style properties for canvas items.
goocanvas-0.15/docs/html/GooCanvasStyle.html0000644000076400007640000006516611222215706016047 00000000000000 GooCanvasStyle

GooCanvasStyle

GooCanvasStyle — support for cascading style properties for canvas items.

Object Hierarchy


  GObject
   +----GooCanvasStyle

Description

GooCanvasStyle provides support for cascading style properties for canvas items. It is intended to be used when implementing new canvas items.

Style properties are identified by a unique GQuark, and contain arbitrary data stored in a GValue.

GooCanvasStyle also provides a few convenience functions such as goo_canvas_style_set_stroke_options() and goo_canvas_style_set_fill_options() which efficiently apply an item's standard style properties to the given cairo_t.

Details

GooCanvasStyle

typedef struct {
  GooCanvasStyle *parent;
  GArray *properties;
} GooCanvasStyle;

GooCanvasStyle holds the style properties of a canvas item, as well as a pointer to the parent style.

GooCanvasStyle *parent;

the parent style.

GArray *properties;

an array of GooCanvasStyleProperty property settings.

GooCanvasStyleProperty

typedef struct {
  GQuark id;
  GValue value;
} GooCanvasStyleProperty;

GooCanvasStyleProperty represents a property setting.

GQuark id;

the unique property identifier.

GValue value;

the value of the property.

goo_canvas_style_new ()

GooCanvasStyle*     goo_canvas_style_new                (void);

Creates a new GooCanvasStyle.

Returns :

a new GooCanvasStyle.

goo_canvas_style_copy ()

GooCanvasStyle*     goo_canvas_style_copy               (GooCanvasStyle *style);

Copies the given GooCanvasStyle, by copying all of its properties. Though the parent of the new style is left unset.

style :

a GooCanvasStyle.

Returns :

a copy of the given GooCanvasStyle.

goo_canvas_style_get_parent ()

GooCanvasStyle*     goo_canvas_style_get_parent         (GooCanvasStyle *style);

Gets the parent of the style.

style :

a style.

Returns :

the parent of the given style, or NULL.

goo_canvas_style_set_parent ()

void                goo_canvas_style_set_parent         (GooCanvasStyle *style,
                                                         GooCanvasStyle *parent);

Sets the parent of the style.

style :

a style.

parent :

the new parent.

goo_canvas_style_get_property ()

GValue*             goo_canvas_style_get_property       (GooCanvasStyle *style,
                                                         GQuark property_id);

Gets the value of a property.

This searches though all the GooCanvasStyle's own list of property settings and also all ancestor GooCanvasStyle objects.

Note that it returns a pointer to the internal GValue setting, which should not be changed.

style :

a style.

property_id :

the property identifier.

Returns :

the property value, or NULL if it isn't set.

goo_canvas_style_set_property ()

void                goo_canvas_style_set_property       (GooCanvasStyle *style,
                                                         GQuark property_id,
                                                         const GValue *value);

Sets a property in the style, replacing any current setting.

Note that this will override the property setting in ancestor GooCanvasStyle objects.

style :

a style.

property_id :

the property identifier.

value :

the value of the property.

goo_canvas_style_set_fill_options ()

gboolean            goo_canvas_style_set_fill_options   (GooCanvasStyle *style,
                                                         cairo_t *cr);

Sets the standard cairo fill options using the given style.

style :

a style.

cr :

a cairo context.

Returns :

TRUE if a paint source is set, or FALSE if the fill should be skipped.

goo_canvas_style_set_stroke_options ()

gboolean            goo_canvas_style_set_stroke_options (GooCanvasStyle *style,
                                                         cairo_t *cr);

Sets the standard cairo stroke options using the given style.

style :

a style.

cr :

a cairo context.

Returns :

TRUE if a paint source is set, or FALSE if the stroke should be skipped.

goo_canvas_style_antialias_id

extern GQuark goo_canvas_style_antialias_id;

Unique GQuark identifier used for the standard antialias property.


goo_canvas_style_fill_pattern_id

extern GQuark goo_canvas_style_fill_pattern_id;

Unique GQuark identifier used for the standard fill pattern property.


goo_canvas_style_fill_rule_id

extern GQuark goo_canvas_style_fill_rule_id;

Unique GQuark identifier used for the standard fill rule property.


goo_canvas_style_font_desc_id

extern GQuark goo_canvas_style_font_desc_id;

Unique GQuark identifier used for the standard font description property.


goo_canvas_style_hint_metrics_id

extern GQuark goo_canvas_style_hint_metrics_id;

Unique GQuark identifier used for the standard hint metrics property.


goo_canvas_style_line_cap_id

extern GQuark goo_canvas_style_line_cap_id;

Unique GQuark identifier used for the standard line cap property.


goo_canvas_style_line_dash_id

extern GQuark goo_canvas_style_line_dash_id;

Unique GQuark identifier used for the standard line dash property.


goo_canvas_style_line_join_id

extern GQuark goo_canvas_style_line_join_id;

Unique GQuark identifier used for the standard line join property.


goo_canvas_style_line_join_miter_limit_id

extern GQuark goo_canvas_style_line_join_miter_limit_id;

Unique GQuark identifier used for the standard miter limit property.


goo_canvas_style_line_width_id

extern GQuark goo_canvas_style_line_width_id;

Unique GQuark identifier used for the standard line width property.


goo_canvas_style_operator_id

extern GQuark goo_canvas_style_operator_id;

Unique GQuark identifier used for the standard operator property.


goo_canvas_style_stroke_pattern_id

extern GQuark goo_canvas_style_stroke_pattern_id;

Unique GQuark identifier used for the standard stroke pattern property.


goocanvas-0.15/docs/html/GooCanvasPath.html0000644000076400007640000003317011222215706015631 00000000000000 GooCanvasPath

GooCanvasPath

GooCanvasPath — a path item (a series of lines and curves).

Synopsis




                    GooCanvasPath;
GooCanvasItem*      goo_canvas_path_new                 (GooCanvasItem *parent,
                                                         const gchar *path_data,
                                                         ...);


Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasPath

Implemented Interfaces

GooCanvasPath implements GooCanvasItem.

Properties


  "data"                     gchararray            : Write
  "height"                   gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasPath represents a path item, which is a series of one or more lines, bezier curves, or elliptical arcs.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

GooCanvasPath uses the same path specification strings as the Scalable Vector Graphics (SVG) path element. For details see the SVG specification.

To create a GooCanvasPath use goo_canvas_path_new().

To get or set the properties of an existing GooCanvasPath, use g_object_get() and g_object_set().

Details

GooCanvasPath

typedef struct _GooCanvasPath GooCanvasPath;

The GooCanvasPath struct contains private data only.


goo_canvas_path_new ()

GooCanvasItem*      goo_canvas_path_new                 (GooCanvasItem *parent,
                                                         const gchar *path_data,
                                                         ...);

Creates a new path item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

path_data :

the sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new path item.

Here's an example showing how to create a red line from (20,20) to (40,40):

 GooCanvasItem *path = goo_canvas_path_new (mygroup,
                                            "M 20 20 L 40 40",
                                            "stroke-color", "red",
                                            NULL);

This example creates a cubic bezier curve from (20,100) to (100,100) with the control points at (20,50) and (100,50):

 GooCanvasItem *path = goo_canvas_path_new (mygroup,
                                            "M20,100 C20,50 100,50 100,100",
                                            "stroke-color", "blue",
                                            NULL);

This example uses an elliptical arc to create a filled circle with one quarter missing:

 GooCanvasItem *path = goo_canvas_path_new (mygroup,
                                            "M200,500 h-150 a150,150 0 1,0 150,-150 z",
                                            "fill-color", "red",
                                            "stroke-color", "blue",
                                            "line-width", 5.0,
                                            NULL);

Property Details

The "data" property

  "data"                     gchararray            : Write

The sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

Default value: NULL


The "height" property

  "height"                   gdouble               : Read / Write

The height of the path.

Allowed values: >= 0

Default value: 0


The "width" property

  "width"                    gdouble               : Read / Write

The width of the path.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the path.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the path.

Default value: 0


goocanvas-0.15/docs/html/GooCanvasPolyline.html0000644000076400007640000005264111222215706016534 00000000000000 GooCanvasPolyline

GooCanvasPolyline

GooCanvasPolyline — a polyline item (a series of lines with optional arrows).

Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasPolyline

Implemented Interfaces

GooCanvasPolyline implements GooCanvasItem.

Properties


  "arrow-length"             gdouble               : Read / Write
  "arrow-tip-length"         gdouble               : Read / Write
  "arrow-width"              gdouble               : Read / Write
  "close-path"               gboolean              : Read / Write
  "end-arrow"                gboolean              : Read / Write
  "height"                   gdouble               : Read / Write
  "points"                   GooCanvasPoints       : Read / Write
  "start-arrow"              gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasPolyline represents a polyline item, which is a series of one or more lines, with optional arrows at either end.

It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooCanvasPolyline use goo_canvas_polyline_new(), or goo_canvas_polyline_new_line() for a simple line between two points.

To get or set the properties of an existing GooCanvasPolyline, use g_object_get() and g_object_set().

Details

GooCanvasPolyline

typedef struct _GooCanvasPolyline GooCanvasPolyline;

The GooCanvasPolyline struct contains private data only.


goo_canvas_polyline_new ()

GooCanvasItem*      goo_canvas_polyline_new             (GooCanvasItem *parent,
                                                         gboolean close_path,
                                                         gint num_points,
                                                         ...);

Creates a new polyline item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

close_path :

if the last point should be connected to the first.

num_points :

the number of points in the polyline.

... :

the pairs of coordinates for each point in the line, followed by optional pairs of property names and values, and a terminating NULL.

Returns :

a new polyline item.

Here's an example showing how to create a filled triangle with vertices at (100,100), (300,100), and (200,300).

 GooCanvasItem *polyline = goo_canvas_polyline_new (mygroup, TRUE, 3,
                                                    100.0, 100.0,
                                                    300.0, 100.0,
                                                    200.0, 300.0,
                                                    "stroke-color", "red",
                                                    "line-width", 5.0,
                                                    "fill-color", "blue",
                                                    NULL);


goo_canvas_polyline_new_line ()

GooCanvasItem*      goo_canvas_polyline_new_line        (GooCanvasItem *parent,
                                                         gdouble x1,
                                                         gdouble y1,
                                                         gdouble x2,
                                                         gdouble y2,
                                                         ...);

Creates a new polyline item with a single line.

parent :

the parent item, or NULL.

x1 :

the x coordinate of the start of the line.

y1 :

the y coordinate of the start of the line.

x2 :

the x coordinate of the end of the line.

y2 :

the y coordinate of the end of the line.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new polyline item.

Here's an example showing how to create a line from (100,100) to (300,300).

 GooCanvasItem *polyline = goo_canvas_polyline_new_line (mygroup,
                                                         100.0, 100.0,
                                                         300.0, 300.0,
                                                         "stroke-color", "red",
                                                         "line-width", 5.0,
                                                         NULL);

Property Details

The "arrow-length" property

  "arrow-length"             gdouble               : Read / Write

The length of the arrows, as a multiple of the line width.

Allowed values: >= 0

Default value: 5


The "arrow-tip-length" property

  "arrow-tip-length"         gdouble               : Read / Write

The length of the arrow tip, as a multiple of the line width.

Allowed values: >= 0

Default value: 4


The "arrow-width" property

  "arrow-width"              gdouble               : Read / Write

The width of the arrows, as a multiple of the line width.

Allowed values: >= 0

Default value: 4


The "close-path" property

  "close-path"               gboolean              : Read / Write

If the last point should be connected to the first.

Default value: FALSE


The "end-arrow" property

  "end-arrow"                gboolean              : Read / Write

If an arrow should be displayed at the end of the polyline.

Default value: FALSE


The "height" property

  "height"                   gdouble               : Read / Write

The height of the polyline.

Allowed values: >= 0

Default value: 0


The "points" property

  "points"                   GooCanvasPoints       : Read / Write

The array of points.


The "start-arrow" property

  "start-arrow"              gboolean              : Read / Write

If an arrow should be displayed at the start of the polyline.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the polyline.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the left-most point of the polyline.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the top-most point of the polyline.

Default value: 0


goocanvas-0.15/docs/html/goocanvas-goocanvasitem.html0000644000076400007640000051373711222215706017765 00000000000000 GooCanvasItem

GooCanvasItem

GooCanvasItem — the interface for canvas items.

Synopsis




                    GooCanvasItem;
                    GooCanvasItemIface;

void                goo_canvas_item_translate           (GooCanvasItem *item,
                                                         gdouble tx,
                                                         gdouble ty);
void                goo_canvas_item_scale               (GooCanvasItem *item,
                                                         gdouble sx,
                                                         gdouble sy);
void                goo_canvas_item_rotate              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
void                goo_canvas_item_skew_x              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
void                goo_canvas_item_skew_y              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
gboolean            goo_canvas_item_get_transform       (GooCanvasItem *item,
                                                         cairo_matrix_t *transform);
void                goo_canvas_item_set_transform       (GooCanvasItem *item,
                                                         const cairo_matrix_t *transform);
gboolean            goo_canvas_item_get_simple_transform
                                                        (GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y,
                                                         gdouble *scale,
                                                         gdouble *rotation);
void                goo_canvas_item_set_simple_transform
                                                        (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble rotation);
void                goo_canvas_item_get_bounds          (GooCanvasItem *item,
                                                         GooCanvasBounds *bounds);
gboolean            goo_canvas_item_is_visible          (GooCanvasItem *item);
gboolean            goo_canvas_item_get_is_static       (GooCanvasItem *item);
void                goo_canvas_item_set_is_static       (GooCanvasItem *item,
                                                         gboolean is_static);

void                goo_canvas_item_animate             (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble degrees,
                                                         gboolean absolute,
                                                         gint duration,
                                                         gint step_time,
                                                         GooCanvasAnimateType type);
void                goo_canvas_item_stop_animation      (GooCanvasItem *item);

void                goo_canvas_item_raise               (GooCanvasItem *item,
                                                         GooCanvasItem *above);
void                goo_canvas_item_lower               (GooCanvasItem *item,
                                                         GooCanvasItem *below);

void                goo_canvas_item_remove              (GooCanvasItem *item);

GooCanvas*          goo_canvas_item_get_canvas          (GooCanvasItem *item);
void                goo_canvas_item_set_canvas          (GooCanvasItem *item,
                                                         GooCanvas *canvas);

GooCanvasItem*      goo_canvas_item_get_parent          (GooCanvasItem *item);
void                goo_canvas_item_set_parent          (GooCanvasItem *item,
                                                         GooCanvasItem *parent);

GooCanvasItemModel* goo_canvas_item_get_model           (GooCanvasItem *item);
void                goo_canvas_item_set_model           (GooCanvasItem *item,
                                                         GooCanvasItemModel *model);

gboolean            goo_canvas_item_is_container        (GooCanvasItem *item);
gint                goo_canvas_item_get_n_children      (GooCanvasItem *item);
GooCanvasItem*      goo_canvas_item_get_child           (GooCanvasItem *item,
                                                         gint child_num);
gint                goo_canvas_item_find_child          (GooCanvasItem *item,
                                                         GooCanvasItem *child);
void                goo_canvas_item_add_child           (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         gint position);
void                goo_canvas_item_move_child          (GooCanvasItem *item,
                                                         gint old_position,
                                                         gint new_position);
void                goo_canvas_item_remove_child        (GooCanvasItem *item,
                                                         gint child_num);
gboolean            goo_canvas_item_get_transform_for_child
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         cairo_matrix_t *transform);

GooCanvasStyle*     goo_canvas_item_get_style           (GooCanvasItem *item);
void                goo_canvas_item_set_style           (GooCanvasItem *item,
                                                         GooCanvasStyle *style);

void                goo_canvas_item_request_update      (GooCanvasItem *item);
void                goo_canvas_item_ensure_updated      (GooCanvasItem *item);
void                goo_canvas_item_update              (GooCanvasItem *item,
                                                         gboolean entire_tree,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);
gboolean            goo_canvas_item_get_requested_area  (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *requested_area);
gdouble             goo_canvas_item_get_requested_height
                                                        (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         gdouble width);
void                goo_canvas_item_allocate_area       (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *requested_area,
                                                         const GooCanvasBounds *allocated_area,
                                                         gdouble x_offset,
                                                         gdouble y_offset);
GList*              goo_canvas_item_get_items_at        (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         cairo_t *cr,
                                                         gboolean is_pointer_event,
                                                         gboolean parent_is_visible,
                                                         GList *found_items);
void                goo_canvas_item_paint               (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *bounds,
                                                         gdouble scale);

void                goo_canvas_item_class_install_child_property
                                                        (GObjectClass *iclass,
                                                         guint property_id,
                                                         GParamSpec *pspec);
GParamSpec**        goo_canvas_item_class_list_child_properties
                                                        (GObjectClass *iclass,
                                                         guint *n_properties);
GParamSpec*         goo_canvas_item_class_find_child_property
                                                        (GObjectClass *iclass,
                                                         const gchar *property_name);
void                goo_canvas_item_get_child_property  (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         const gchar *property_name,
                                                         GValue *value);
void                goo_canvas_item_set_child_property  (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         const gchar *property_name,
                                                         const GValue *value);
void                goo_canvas_item_get_child_properties
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         ...);
void                goo_canvas_item_get_child_properties_valist
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         va_list var_args);
void                goo_canvas_item_set_child_properties
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         ...);
void                goo_canvas_item_set_child_properties_valist
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         va_list var_args);

Object Hierarchy


  GInterface
   +----GooCanvasItem

Prerequisites

GooCanvasItem requires GObject.

Properties


  "can-focus"                gboolean              : Read / Write
  "description"              gchararray            : Read / Write
  "parent"                   GooCanvasItem         : Read / Write
  "pointer-events"           GooCanvasPointerEvents  : Read / Write
  "title"                    gchararray            : Read / Write
  "tooltip"                  gchararray            : Read / Write
  "transform"                GooCairoMatrix        : Read / Write
  "visibility"               GooCanvasItemVisibility  : Read / Write
  "visibility-threshold"     gdouble               : Read / Write

Signals


  "animation-finished"                             : Run Last
  "button-press-event"                             : Run Last
  "button-release-event"                           : Run Last
  "child-notify"                                   : Run First / No Recursion / Has Details / No Hooks
  "enter-notify-event"                             : Run Last
  "focus-in-event"                                 : Run Last
  "focus-out-event"                                : Run Last
  "grab-broken-event"                              : Run Last
  "key-press-event"                                : Run Last
  "key-release-event"                              : Run Last
  "leave-notify-event"                             : Run Last
  "motion-notify-event"                            : Run Last
  "query-tooltip"                                  : Run Last
  "scroll-event"                                   : Run Last

Description

GooCanvasItem defines the interface that canvas items must implement, and contains methods for operating on canvas items.

Details

GooCanvasItem

typedef struct _GooCanvasItem GooCanvasItem;

GooCanvasItem is a typedef used for objects that implement the GooCanvasItem interface.

(There is no actual GooCanvasItem struct, since it is only an interface. But using 'GooCanvasItem' is more helpful than using 'GObject'.)


GooCanvasItemIface

typedef struct {
  /* Virtual methods that group items must implement. */
  GooCanvas*		(* get_canvas)			(GooCanvasItem		*item);
  void			(* set_canvas)			(GooCanvasItem		*item,
							 GooCanvas		*canvas);
  gint			(* get_n_children)		(GooCanvasItem		*item);
  GooCanvasItem*	(* get_child)			(GooCanvasItem		*item,
							 gint			 child_num);
  void			(* request_update)		(GooCanvasItem		*item);

  /* Virtual methods that group items may implement. */
  void			(* add_child)			(GooCanvasItem		*item,
							 GooCanvasItem		*child,
							 gint			 position);
  void			(* move_child)			(GooCanvasItem		*item,
							 gint			 old_position,
							 gint			 new_position);
  void			(* remove_child)		(GooCanvasItem		*item,
							 gint			 child_num);
  void			(* get_child_property)		(GooCanvasItem		*item,
							 GooCanvasItem		*child,
							 guint			 property_id,
							 GValue			*value,
							 GParamSpec		*pspec);
  void			(* set_child_property)		(GooCanvasItem		*item,
							 GooCanvasItem		*child,
							 guint			 property_id,
							 const GValue		*value,
							 GParamSpec		*pspec);
  gboolean		(* get_transform_for_child)	(GooCanvasItem		*item,
							 GooCanvasItem		*child,
							 cairo_matrix_t		*transform);

  /* Virtual methods that all canvas items must implement. */
  GooCanvasItem*	(* get_parent)			(GooCanvasItem		*item);
  void			(* set_parent)			(GooCanvasItem		*item,
							 GooCanvasItem		*parent);
  void			(* get_bounds)			(GooCanvasItem		*item,
							 GooCanvasBounds	*bounds);
  GList*		(* get_items_at)		(GooCanvasItem		*item,
							 gdouble		 x,
							 gdouble		 y,
							 cairo_t		*cr,
							 gboolean		 is_pointer_event,
							 gboolean		 parent_is_visible,
							 GList                  *found_items);
  void			(* update)			(GooCanvasItem		*item,
							 gboolean		 entire_tree,
							 cairo_t		*cr,
							 GooCanvasBounds	*bounds);
  void			(* paint)			(GooCanvasItem		*item,
							 cairo_t		*cr,
							 const GooCanvasBounds	*bounds,
							 gdouble		 scale);

  gboolean		(* get_requested_area)		(GooCanvasItem		*item,
							 cairo_t		*cr,
							 GooCanvasBounds	*requested_area);
  void			(* allocate_area)		(GooCanvasItem		*item,
							 cairo_t		*cr,
							 const GooCanvasBounds	*requested_area,
							 const GooCanvasBounds	*allocated_area,
							 gdouble		 x_offset,
							 gdouble		 y_offset);

  /* Virtual methods that canvas items may implement. */
  gboolean		(* get_transform)		(GooCanvasItem		*item,
							 cairo_matrix_t		*transform);
  void			(* set_transform)		(GooCanvasItem		*item,
							 const cairo_matrix_t	*transform);
  GooCanvasStyle*	(* get_style)			(GooCanvasItem		*item);
  void			(* set_style)			(GooCanvasItem		*item,
							 GooCanvasStyle		*style);
  gboolean		(* is_visible)			(GooCanvasItem		*item);
  gdouble               (* get_requested_height)	(GooCanvasItem		*item,
							 cairo_t		*cr,
							 gdouble		 width);

  /* Virtual methods that model/view items must implement. */
  GooCanvasItemModel*	(* get_model)			(GooCanvasItem		*item);
  void			(* set_model)			(GooCanvasItem		*item,
							 GooCanvasItemModel	*model);


  /* Signals. */
  gboolean		(* enter_notify_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventCrossing	*event);
  gboolean		(* leave_notify_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventCrossing	*event);
  gboolean		(* motion_notify_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventMotion		*event);
  gboolean		(* button_press_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventButton		*event);
  gboolean		(* button_release_event)	(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventButton		*event);
  gboolean		(* focus_in_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventFocus		*event);
  gboolean		(* focus_out_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventFocus		*event);
  gboolean		(* key_press_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventKey		*event);
  gboolean		(* key_release_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventKey		*event);
  gboolean		(* grab_broken_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventGrabBroken	*event);
  void			(* child_notify)		(GooCanvasItem		*item,
							 GParamSpec		*pspec);
  gboolean		(* query_tooltip)		(GooCanvasItem		*item,
							 gdouble		 x,
							 gdouble		 y,
							 gboolean		 keyboard_tooltip,
							 GtkTooltip		*tooltip);

  gboolean		(* get_is_static)		(GooCanvasItem		*item);
  void			(* set_is_static)		(GooCanvasItem		*item,
							 gboolean		 is_static);

  void			(* animation_finished)		(GooCanvasItem           *item,
							 gboolean                 stopped);

  gboolean		(* scroll_event)		(GooCanvasItem		*item,
							 GooCanvasItem		*target,
							 GdkEventScroll		*event);
} GooCanvasItemIface;

GooCanvasItemIFace holds the virtual methods that make up the GooCanvasItem interface.

Simple canvas items only need to implement the get_parent(), set_parent(), get_bounds(), get_items_at(), update() and paint() methods (and also get_requested_area() and allocate_area() if they are going to be used inside a layout container like GooCanvasTable).

Items that support transforms should also implement get_transform() and set_transform(). Items that support styles should implement get_style() and set_style().

Container items must implement get_canvas(), set_canvas(), get_n_children(), get_child() and request_update(). Containers that support dynamic changes to their children should implement add_child(), move_child() and remove_child(). Layout containers like GooCanvasTable may implement get_child_property(), set_child_property() and get_transform_for_child().

get_canvas ()

returns the canvas the item is in.

set_canvas ()

sets the canvas the item is in.

get_n_children ()

returns the number of children of the item.

get_child ()

returns the child at the given index.

request_update ()

requests that an update is scheduled.

add_child ()

adds a child.

move_child ()

moves a child up or down the stacking order.

remove_child ()

removes a child.

get_child_property ()

gets a child property of a given child item, e.g. the "row" or "column" property of an item in a GooCanvasTable.

set_child_property ()

sets a child property for a given child item.

get_transform_for_child ()

gets the transform used to lay out a given child.

get_parent ()

gets the item's parent.

set_parent ()

sets the item's parent.

get_bounds ()

gets the bounds of the item.

get_items_at ()

gets all the items at the given point.

update ()

updates the item, if needed. It recalculates the bounds of the item and requests redraws of parts of the canvas if necessary.

paint ()

renders the item to the given cairo context.

get_requested_area ()

returns the requested area of the item, in its parent's coordinate space. This is only used for items in layout containers such as GooCanvasTable.

allocate_area ()

allocates the item's area, in its parent's coordinate space. The item must recalculate its bounds and request redraws of parts of the canvas if necessary. This is only used for items in layout containers such as GooCanvasTable.

get_transform ()

gets the item's transformation matrix.

set_transform ()

sets the item's transformation matrix.

get_style ()

gets the item's style.

set_style ()

sets the item's style.

is_visible ()

returns TRUE if the item is currently visible.

get_requested_height ()

returns the requested height of the item, given a particular allocated width, using the parent's coordinate space.

get_model ()

gets the model that the canvas item is viewing.

set_model ()

sets the model that the canvas item will view.

enter_notify_event ()

signal emitted when the mouse enters the item.

leave_notify_event ()

signal emitted when the mouse leaves the item.

motion_notify_event ()

signal emitted when the mouse moves within the item.

button_press_event ()

signal emitted when a mouse button is pressed within the item.

button_release_event ()

signal emitted when a mouse button is released.

focus_in_event ()

signal emitted when the item receices the keyboard focus.

focus_out_event ()

signal emitted when the item loses the keyboard focus.

key_press_event ()

signal emitted when a key is pressed.

key_release_event ()

signal emitted when a key is released.

grab_broken_event ()

signal emitted when a grab that the item has is lost.

child_notify ()

signal emitted when a child property is changed.

query_tooltip ()

signal emitted to query the tooltip of an item.

get_is_static ()

returns TRUE if the item is static.

set_is_static ()

notifies the item whether it is static or not.

animation_finished ()

signal emitted when the item's animation has finished.

scroll_event ()

signal emitted when the mouse wheel is activated within the item.

goo_canvas_item_translate ()

void                goo_canvas_item_translate           (GooCanvasItem *item,
                                                         gdouble tx,
                                                         gdouble ty);

Translates the origin of the item's coordinate system by the given amounts.

item :

an item.

tx :

the amount to move the origin in the horizontal direction.

ty :

the amount to move the origin in the vertical direction.

goo_canvas_item_scale ()

void                goo_canvas_item_scale               (GooCanvasItem *item,
                                                         gdouble sx,
                                                         gdouble sy);

Scales the item's coordinate system by the given amounts.

item :

an item.

sx :

the amount to scale the horizontal axis.

sy :

the amount to scale the vertical axis.

goo_canvas_item_rotate ()

void                goo_canvas_item_rotate              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Rotates the item's coordinate system by the given amount, about the given origin.

item :

an item.

degrees :

the clockwise angle of rotation.

cx :

the x coordinate of the origin of the rotation.

cy :

the y coordinate of the origin of the rotation.

goo_canvas_item_skew_x ()

void                goo_canvas_item_skew_x              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Skews the item's coordinate system along the x axis by the given amount, about the given origin.

item :

an item.

degrees :

the skew angle.

cx :

the x coordinate of the origin of the skew transform.

cy :

the y coordinate of the origin of the skew transform.

goo_canvas_item_skew_y ()

void                goo_canvas_item_skew_y              (GooCanvasItem *item,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Skews the item's coordinate system along the y axis by the given amount, about the given origin.

item :

an item.

degrees :

the skew angle.

cx :

the x coordinate of the origin of the skew transform.

cy :

the y coordinate of the origin of the skew transform.

goo_canvas_item_get_transform ()

gboolean            goo_canvas_item_get_transform       (GooCanvasItem *item,
                                                         cairo_matrix_t *transform);

Gets the transformation matrix of an item.

item :

an item.

transform :

the place to store the transform.

Returns :

TRUE if a transform is set.

goo_canvas_item_set_transform ()

void                goo_canvas_item_set_transform       (GooCanvasItem *item,
                                                         const cairo_matrix_t *transform);

Sets the transformation matrix of an item.

item :

an item.

transform :

the new transformation matrix, or NULL to reset the transformation to the identity matrix.

goo_canvas_item_get_simple_transform ()

gboolean            goo_canvas_item_get_simple_transform
                                                        (GooCanvasItem *item,
                                                         gdouble *x,
                                                         gdouble *y,
                                                         gdouble *scale,
                                                         gdouble *rotation);

This function can be used to get the position, scale and rotation of an item, providing that the item has a simple transformation matrix (e.g. set with goo_canvas_item_set_simple_transform(), or using a combination of simple translate, scale and rotate operations). If the item has a complex transformation matrix the results will be incorrect.

item :

an item.

x :

returns the x coordinate of the origin of the item's coordinate space.

y :

returns the y coordinate of the origin of the item's coordinate space.

scale :

returns the scale of the item.

rotation :

returns the clockwise rotation of the item, in degrees (0-360).

Returns :

TRUE if a transform is set.

goo_canvas_item_set_simple_transform ()

void                goo_canvas_item_set_simple_transform
                                                        (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble rotation);

A convenience function to set the item's transformation matrix.

item :

an item.

x :

the x coordinate of the origin of the item's coordinate space.

y :

the y coordinate of the origin of the item's coordinate space.

scale :

the scale of the item.

rotation :

the clockwise rotation of the item, in degrees.

goo_canvas_item_get_bounds ()

void                goo_canvas_item_get_bounds          (GooCanvasItem *item,
                                                         GooCanvasBounds *bounds);

Gets the bounds of the item.

Note that the bounds includes the entire fill and stroke extents of the item, whether they are painted or not.

item :

a GooCanvasItem.

bounds :

a GooCanvasBounds to return the bounds in.

goo_canvas_item_is_visible ()

gboolean            goo_canvas_item_is_visible          (GooCanvasItem *item);

Checks if the item is visible.

This entails checking the item's own visibility setting, as well as those of its ancestors.

Note that the item may be scrolled off the screen and so may not be actually visible to the user.

item :

a GooCanvasItem.

Returns :

TRUE if the item is visible.

goo_canvas_item_get_is_static ()

gboolean            goo_canvas_item_get_is_static       (GooCanvasItem *item);

Returns TRUE if the item is static. Static items do not move or change size when the canvas is scrolled or the scale changes.

item :

an item.

Returns :

TRUE if the item is static.

goo_canvas_item_set_is_static ()

void                goo_canvas_item_set_is_static       (GooCanvasItem *item,
                                                         gboolean is_static);

Notifies the item that it is static. Static items do not move or change size when the canvas is scrolled or the scale changes.

Container items such as GooCanvasGroup should call this function when children are added, to notify children whether they are static or not. Containers should also pass on any changes in their own status to children.

item :

an item.

is_static :

if the item is static.

goo_canvas_item_animate ()

void                goo_canvas_item_animate             (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble degrees,
                                                         gboolean absolute,
                                                         gint duration,
                                                         gint step_time,
                                                         GooCanvasAnimateType type);

Animates an item from its current position to the given offsets, scale and rotation.

item :

an item.

x :

the final x coordinate.

y :

the final y coordinate.

scale :

the final scale.

degrees :

the final rotation. This can be negative to rotate anticlockwise, and can also be greater than 360 to rotate a number of times.

absolute :

if the x, y, scale and degrees values are absolute, or relative to the current transform. Note that absolute animations only work if the item currently has a simple transform. If the item has a shear or some other complicated transform it may result in strange animations.

duration :

the duration of the animation, in milliseconds (1/1000ths of a second).

step_time :

the time between each animation step, in milliseconds.

type :

specifies what happens when the animation finishes.

goo_canvas_item_stop_animation ()

void                goo_canvas_item_stop_animation      (GooCanvasItem *item);

Stops any current animation for the given item, leaving it at its current position.

item :

an item.

goo_canvas_item_raise ()

void                goo_canvas_item_raise               (GooCanvasItem *item,
                                                         GooCanvasItem *above);

Raises an item in the stacking order.

item :

an item.

above :

the item to raise item above, or NULL to raise item to the top of the stack.

goo_canvas_item_lower ()

void                goo_canvas_item_lower               (GooCanvasItem *item,
                                                         GooCanvasItem *below);

Lowers an item in the stacking order.

item :

an item.

below :

the item to lower item below, or NULL to lower item to the bottom of the stack.

goo_canvas_item_remove ()

void                goo_canvas_item_remove              (GooCanvasItem *item);

Removes an item from its parent. If the item is in a canvas it will be removed.

This would normally also result in the item being freed.

item :

an item.

goo_canvas_item_get_canvas ()

GooCanvas*          goo_canvas_item_get_canvas          (GooCanvasItem *item);

Returns the GooCanvas containing the given GooCanvasItem.

item :

a GooCanvasItem.

Returns :

the GooCanvas.

goo_canvas_item_set_canvas ()

void                goo_canvas_item_set_canvas          (GooCanvasItem *item,
                                                         GooCanvas *canvas);

This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup.

It sets the canvas of the item.

item :

a GooCanvasItem.

canvas :

a GooCanvas

goo_canvas_item_get_parent ()

GooCanvasItem*      goo_canvas_item_get_parent          (GooCanvasItem *item);

Gets the parent of the given item.

item :

an item.

Returns :

the parent item, or NULL if the item has no parent.

goo_canvas_item_set_parent ()

void                goo_canvas_item_set_parent          (GooCanvasItem *item,
                                                         GooCanvasItem *parent);

This function is only intended to be used when implementing new canvas items (specifically container items such as GooCanvasGroup). It sets the parent of the child item.

item :

an item.

parent :

the new parent item.

Note

This function cannot be used to add an item to a group or to change the parent of an item. To do that use the "parent" property.


goo_canvas_item_get_model ()

GooCanvasItemModel* goo_canvas_item_get_model           (GooCanvasItem *item);

Gets the model of the given canvas item.

item :

a GooCanvasItem.

Returns :

the item's model, or NULL if it has no model.

goo_canvas_item_set_model ()

void                goo_canvas_item_set_model           (GooCanvasItem *item,
                                                         GooCanvasItemModel *model);

Sets the model of the given canvas item.

item :

a GooCanvasItem.

model :

a GooCanvasItemModel.

goo_canvas_item_is_container ()

gboolean            goo_canvas_item_is_container        (GooCanvasItem *item);

Tests to see if the given item is a container.

item :

an item.

Returns :

TRUE if the item is a container.

goo_canvas_item_get_n_children ()

gint                goo_canvas_item_get_n_children      (GooCanvasItem *item);

Gets the number of children of the container.

item :

a container item.

Returns :

the number of children.

goo_canvas_item_get_child ()

GooCanvasItem*      goo_canvas_item_get_child           (GooCanvasItem *item,
                                                         gint child_num);

Gets the child item at the given stack position.

item :

a container item.

child_num :

the position of a child in the container's stack.

Returns :

the child item at the given stack position, or NULL if child_num is out of range.

goo_canvas_item_find_child ()

gint                goo_canvas_item_find_child          (GooCanvasItem *item,
                                                         GooCanvasItem *child);

Attempts to find the given child item with the container's stack.

item :

a container item.

child :

the child item to find.

Returns :

the position of the given child item, or -1 if it isn't found.

goo_canvas_item_add_child ()

void                goo_canvas_item_add_child           (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         gint position);

Adds a child item to a container item at the given stack position.

item :

the container to add the item to.

child :

the item to add.

position :

the position of the item, or -1 to place it last (at the top of the stacking order).

goo_canvas_item_move_child ()

void                goo_canvas_item_move_child          (GooCanvasItem *item,
                                                         gint old_position,
                                                         gint new_position);

Moves a child item to a new stack position within the container.

item :

a container item.

old_position :

the current position of the child item.

new_position :

the new position of the child item.

goo_canvas_item_remove_child ()

void                goo_canvas_item_remove_child        (GooCanvasItem *item,
                                                         gint child_num);

Removes the child item at the given position.

item :

a container item.

child_num :

the position of the child item to remove.

goo_canvas_item_get_transform_for_child ()

gboolean            goo_canvas_item_get_transform_for_child
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         cairo_matrix_t *transform);

Gets the transformation matrix of an item combined with any special transform needed for the given child. These special transforms are used by layout items such as GooCanvasTable.

item :

an item.

child :

a child of item.

transform :

the place to store the transform.

Returns :

TRUE if a transform is set.

goo_canvas_item_get_style ()

GooCanvasStyle*     goo_canvas_item_get_style           (GooCanvasItem *item);

Gets the item's style. If the item doesn't have its own style it will return its parent's style.

item :

an item.

Returns :

the item's style.

goo_canvas_item_set_style ()

void                goo_canvas_item_set_style           (GooCanvasItem *item,
                                                         GooCanvasStyle *style);

Sets the item's style, by copying the properties from the given style.

item :

an item.

style :

a style.

goo_canvas_item_request_update ()

void                goo_canvas_item_request_update      (GooCanvasItem *item);

This function is only intended to be used when implementing new canvas items.

It requests that an update of the item is scheduled. It will be performed as soon as the application is idle, and before the canvas is redrawn.

item :

a GooCanvasItem.

goo_canvas_item_ensure_updated ()

void                goo_canvas_item_ensure_updated      (GooCanvasItem *item);

This function is only intended to be used when implementing new canvas items.

It updates the canvas immediately, if an update is scheduled. This ensures that all item bounds are up-to-date.

item :

a GooCanvasItem.

goo_canvas_item_update ()

void                goo_canvas_item_update              (GooCanvasItem *item,
                                                         gboolean entire_tree,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);

This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup.

Updates the item, if needed, and any children.

item :

a GooCanvasItem.

entire_tree :

if the entire subtree should be updated.

cr :

a cairo context.

bounds :

a GooCanvasBounds to return the new bounds in.

goo_canvas_item_get_requested_area ()

gboolean            goo_canvas_item_get_requested_area  (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *requested_area);

This function is only intended to be used when implementing new canvas items, specifically layout items such as GooCanvasTable.

It gets the requested area of a child item.

item :

a GooCanvasItem.

cr :

a cairo context.

requested_area :

a GooCanvasBounds to return the requested area in, in the parent's coordinate space.

Returns :

TRUE if the item should be allocated space.

goo_canvas_item_get_requested_height ()

gdouble             goo_canvas_item_get_requested_height
                                                        (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         gdouble width);

This function is only intended to be used when implementing new canvas items, specifically layout items such as GooCanvasTable.

It gets the requested height of a child item, assuming it is allocated the given width. This is useful for text items whose requested height may change depending on the allocated width.

item :

a GooCanvasItem.

cr :

a cairo context.

width :

the width that the item may be allocated.

Returns :

the requested height of the item, given the allocated width, or -1 if the item doesn't support this method or its height doesn't change when allocated different widths.

goo_canvas_item_allocate_area ()

void                goo_canvas_item_allocate_area       (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *requested_area,
                                                         const GooCanvasBounds *allocated_area,
                                                         gdouble x_offset,
                                                         gdouble y_offset);

This function is only intended to be used when implementing new canvas items, specifically layout items such as GooCanvasTable.

It allocates an area to a child GooCanvasItem.

Note that the parent layout item will use a transform to move each of its children for the layout, so there is no need for the child item to reposition itself. It only needs to recalculate its device bounds.

To help recalculate the item's device bounds, the x_offset and y_offset of the child item's allocated position from its requested position are provided. Simple items can just add these to their bounds.

item :

a GooCanvasItem.

cr :

a cairo context.

requested_area :

the area that the item originally requested, in the parent's coordinate space.

allocated_area :

the area that the item has been allocated, in the parent's coordinate space.

x_offset :

the x offset of the allocated area from the requested area in the device coordinate space.

y_offset :

the y offset of the allocated area from the requested area in the device coordinate space.

goo_canvas_item_get_items_at ()

GList*              goo_canvas_item_get_items_at        (GooCanvasItem *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         cairo_t *cr,
                                                         gboolean is_pointer_event,
                                                         gboolean parent_is_visible,
                                                         GList *found_items);

This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup.

It gets the items at the given point.

item :

a GooCanvasItem.

x :

the x coordinate of the point.

y :

the y coordinate of the point.

cr :

a cairo contect.

is_pointer_event :

TRUE if the "pointer-events" properties of items should be used to determine which parts of the item are tested.

parent_is_visible :

TRUE if the parent item is visible (which implies that all ancestors are also visible).

found_items :

the list of items found so far.

Returns :

the found_items list, with any more found items added onto the start of the list, leaving the top item first.

goo_canvas_item_paint ()

void                goo_canvas_item_paint               (GooCanvasItem *item,
                                                         cairo_t *cr,
                                                         const GooCanvasBounds *bounds,
                                                         gdouble scale);

This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup.

It paints the item and all children if they intersect the given bounds.

Note that the scale argument may be different to the current scale in the GooCanvasItem, e.g. when the canvas is being printed.

item :

a GooCanvasItem.

cr :

a cairo context.

bounds :

the bounds that need to be repainted, in device space.

scale :

the scale to use to determine whether an item should be painted. See "visibility-threshold".

goo_canvas_item_class_install_child_property ()

void                goo_canvas_item_class_install_child_property
                                                        (GObjectClass *iclass,
                                                         guint property_id,
                                                         GParamSpec *pspec);

This function is only intended to be used when implementing new canvas items, specifically layout container items such as GooCanvasTable.

It installs a child property on a canvas item class.

iclass :

a GObjectClass

property_id :

the id for the property

pspec :

the GParamSpec for the property

goo_canvas_item_class_list_child_properties ()

GParamSpec**        goo_canvas_item_class_list_child_properties
                                                        (GObjectClass *iclass,
                                                         guint *n_properties);

This function is only intended to be used when implementing new canvas items, specifically layout container items such as GooCanvasTable.

It returns all child properties of a canvas item class.

iclass :

a GObjectClass

n_properties :

location to return the number of child properties found

Returns :

a newly allocated array of GParamSpec*. The array must be freed with g_free().

goo_canvas_item_class_find_child_property ()

GParamSpec*         goo_canvas_item_class_find_child_property
                                                        (GObjectClass *iclass,
                                                         const gchar *property_name);

This function is only intended to be used when implementing new canvas items, specifically layout container items such as GooCanvasTable.

It finds a child property of a canvas item class by name.

iclass :

a GObjectClass

property_name :

the name of the child property to find

Returns :

the GParamSpec of the child property or NULL if class has no child property with that name.

goo_canvas_item_get_child_property ()

void                goo_canvas_item_get_child_property  (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         const gchar *property_name,
                                                         GValue *value);

Gets a child property of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

property_name :

the name of the child property to get.

value :

a location to return the value.

goo_canvas_item_set_child_property ()

void                goo_canvas_item_set_child_property  (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         const gchar *property_name,
                                                         const GValue *value);

Sets a child property of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

property_name :

the name of the child property to set.

value :

the value to set the property to.

goo_canvas_item_get_child_properties ()

void                goo_canvas_item_get_child_properties
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         ...);

Gets the values of one or more child properties of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

... :

pairs of property names and value pointers, and a terminating NULL.

goo_canvas_item_get_child_properties_valist ()

void                goo_canvas_item_get_child_properties_valist
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         va_list var_args);

Gets the values of one or more child properties of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

var_args :

pairs of property names and value pointers, and a terminating NULL.

goo_canvas_item_set_child_properties ()

void                goo_canvas_item_set_child_properties
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         ...);

Sets the values of one or more child properties of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

... :

pairs of property names and values, and a terminating NULL.

goo_canvas_item_set_child_properties_valist ()

void                goo_canvas_item_set_child_properties_valist
                                                        (GooCanvasItem *item,
                                                         GooCanvasItem *child,
                                                         va_list var_args);

Sets the values of one or more child properties of child.

item :

a GooCanvasItem.

child :

a child GooCanvasItem.

var_args :

pairs of property names and values, and a terminating NULL.

Property Details

The "can-focus" property

  "can-focus"                gboolean              : Read / Write

If the item can take the keyboard focus.

Default value: FALSE


The "description" property

  "description"              gchararray            : Read / Write

A description of the item for use by assistive technologies.

Default value: NULL


The "parent" property

  "parent"                   GooCanvasItem         : Read / Write

The parent item.


The "pointer-events" property

  "pointer-events"           GooCanvasPointerEvents  : Read / Write

Specifies when the item receives pointer events.

Default value: GOO_CANVAS_EVENTS_VISIBLE_MASK|GOO_CANVAS_EVENTS_PAINTED_MASK|GOO_CANVAS_EVENTS_FILL_MASK|GOO_CANVAS_EVENTS_STROKE_MASK


The "title" property

  "title"                    gchararray            : Read / Write

A short context-rich description of the item for use by assistive technologies.

Default value: NULL


The "tooltip" property

  "tooltip"                  gchararray            : Read / Write

The tooltip to display for the item.

Default value: NULL


The "transform" property

  "transform"                GooCairoMatrix        : Read / Write

The transformation matrix of the item.


The "visibility" property

  "visibility"               GooCanvasItemVisibility  : Read / Write

When the canvas item is visible.

Default value: GOO_CANVAS_ITEM_VISIBLE


The "visibility-threshold" property

  "visibility-threshold"     gdouble               : Read / Write

The scale threshold at which the item becomes visible.

Allowed values: >= 0

Default value: 0

Signal Details

The "animation-finished" signal

void                user_function                      (GooCanvasItem *item,
                                                        gboolean       stopped,
                                                        gpointer       user_data)      : Run Last

Emitted when the item animation has finished.

item :

the item that received the signal.

stopped :

if the animation was explicitly stopped.

user_data :

user data set when the signal handler was connected.

The "button-press-event" signal

gboolean            user_function                      (GooCanvasItem  *item,
                                                        GooCanvasItem  *target_item,
                                                        GdkEventButton *event,
                                                        gpointer        user_data)        : Run Last

Emitted when a mouse button is pressed in an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "button-release-event" signal

gboolean            user_function                      (GooCanvasItem  *item,
                                                        GooCanvasItem  *target_item,
                                                        GdkEventButton *event,
                                                        gpointer        user_data)        : Run Last

Emitted when a mouse button is released in an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "child-notify" signal

void                user_function                      (GooCanvasItem *item,
                                                        GParamSpec    *pspec,
                                                        gpointer       user_data)      : Run First / No Recursion / Has Details / No Hooks

Emitted for each child property that has changed. The signal's detail holds the property name.

item :

the item that received the signal.

pspec :

the GParamSpec of the changed child property.

user_data :

user data set when the signal handler was connected.

The "enter-notify-event" signal

gboolean            user_function                      (GooCanvasItem    *item,
                                                        GooCanvasItem    *target_item,
                                                        GdkEventCrossing *event,
                                                        gpointer          user_data)        : Run Last

Emitted when the mouse enters an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "focus-in-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEventFocus *event,
                                                        gpointer       user_data)        : Run Last

Emitted when the item receives the keyboard focus.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "focus-out-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEventFocus *event,
                                                        gpointer       user_data)        : Run Last

Emitted when the item loses the keyboard focus.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "grab-broken-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEvent      *event,
                                                        gpointer       user_data)        : Run Last

Emitted when the item's keyboard or pointer grab was lost unexpectedly.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "key-press-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEventKey   *event,
                                                        gpointer       user_data)        : Run Last

Emitted when a key is pressed and the item has the keyboard focus.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "key-release-event" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        GooCanvasItem *target_item,
                                                        GdkEventKey   *event,
                                                        gpointer       user_data)        : Run Last

Emitted when a key is released and the item has the keyboard focus.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "leave-notify-event" signal

gboolean            user_function                      (GooCanvasItem    *item,
                                                        GooCanvasItem    *target_item,
                                                        GdkEventCrossing *event,
                                                        gpointer          user_data)        : Run Last

Emitted when the mouse leaves an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "motion-notify-event" signal

gboolean            user_function                      (GooCanvasItem  *item,
                                                        GooCanvasItem  *target_item,
                                                        GdkEventMotion *event,
                                                        gpointer        user_data)        : Run Last

Emitted when the mouse moves within an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

The "query-tooltip" signal

gboolean            user_function                      (GooCanvasItem *item,
                                                        gdouble        x,
                                                        gdouble        y,
                                                        gboolean       keyboard_mode,
                                                        GtkTooltip    *tooltip,
                                                        gpointer       user_data)          : Run Last

Emitted when the mouse has paused over the item for a certain amount of time, or the tooltip was requested via the keyboard.

Note that if keyboard_mode is TRUE, the values of x and y are undefined and should not be used.

If the item wants to display a tooltip it should update tooltip and return TRUE.

item :

the item which received the signal.

x :

the x coordinate of the mouse.

y :

the y coordinate of the mouse.

keyboard_mode :

TRUE if the tooltip was triggered using the keyboard.

tooltip :

a GtkTooltip.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE if the item has set a tooltip to show.

The "scroll-event" signal

gboolean            user_function                      (GooCanvasItem  *item,
                                                        GooCanvasItem  *target_item,
                                                        GdkEventScroll *event,
                                                        gpointer        user_data)        : Run Last

Emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned in an item.

item :

the item that received the signal.

target_item :

the target of the event.

event :

the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space.

user_data :

user data set when the signal handler was connected.

Returns :

TRUE to stop the signal emission, or FALSE to let it continue.

goocanvas-0.15/docs/html/GooCanvasWidget.html0000644000076400007640000003433011222215706016157 00000000000000 GooCanvasWidget

GooCanvasWidget

GooCanvasWidget — an embedded widget item.

Synopsis




                    GooCanvasWidget;
GooCanvasItem*      goo_canvas_widget_new               (GooCanvasItem *parent,
                                                         GtkWidget *widget,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);


Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasWidget

Implemented Interfaces

GooCanvasWidget implements GooCanvasItem.

Properties


  "anchor"                   GtkAnchorType         : Read / Write
  "height"                   gdouble               : Read / Write
  "widget"                   GtkWidget             : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasWidget provides support for placing any GtkWidget in the canvas.

The "width" and "height" properties specify the widget's size. If either of them is -1, then the requested size of the widget is used instead, which is the default for both width and height.

Note that there are a number of limitations in the use of ""

  • It doesn't support any transformation besides simple translation. This means you can't scale a canvas with a GooCanvasWidget in it.

  • It doesn't support layering, so you can't place other items beneath or above the GooCanvasWidget.

  • It doesn't support rendering of widgets to a given cairo_t, which means you can't output the widget to a pdf or postscript file.

  • It doesn't have a model/view variant like the other standard items, so it can only be used in a simple canvas without a model.

  • It can't be made a static item.

Details

GooCanvasWidget

typedef struct _GooCanvasWidget GooCanvasWidget;

The GooCanvasWidget struct contains private data only.


goo_canvas_widget_new ()

GooCanvasItem*      goo_canvas_widget_new               (GooCanvasItem *parent,
                                                         GtkWidget *widget,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         ...);

Creates a new widget item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

widget :

the widget.

x :

the x coordinate of the item.

y :

the y coordinate of the item.

width :

the width of the item, or -1 to use the widget's requested width.

height :

the height of the item, or -1 to use the widget's requested height.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new widget item.

Here's an example showing how to create an entry widget centered at (100.0, 100.0):

 GtkWidget *entry = gtk_entry_new ();
 GooCanvasItem *witem = goo_canvas_widget_new (mygroup, entry,
                                               100, 100, -1, -1,
                                               "anchor", GTK_ANCHOR_CENTER,
                                               NULL);

Property Details

The "anchor" property

  "anchor"                   GtkAnchorType         : Read / Write

How to position the widget relative to the item's x and y coordinate settings.

Default value: GTK_ANCHOR_NORTH_WEST


The "height" property

  "height"                   gdouble               : Read / Write

The height of the widget, or -1 to use its requested height.

Default value: -1


The "widget" property

  "widget"                   GtkWidget             : Read / Write

The widget to place in the canvas.


The "width" property

  "width"                    gdouble               : Read / Write

The width of the widget, or -1 to use its requested width.

Default value: -1


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the widget.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the widget.

Default value: 0


goocanvas-0.15/docs/html/GooCanvasGridModel.html0000644000076400007640000010401011222215706016573 00000000000000 GooCanvasGridModel

GooCanvasGridModel

GooCanvasGridModel — a model for grid items.

Synopsis




                    GooCanvasGridModel;
GooCanvasItemModel* goo_canvas_grid_model_new           (GooCanvasItemModel *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);


Object Hierarchy


  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasGridModel

Implemented Interfaces

GooCanvasGridModel implements GooCanvasItemModel.

Properties


  "border-color"             gchararray            : Write
  "border-color-rgba"        guint                 : Read / Write
  "border-pattern"           GooCairoPattern       : Read / Write
  "border-pixbuf"            GdkPixbuf             : Write
  "border-width"             gdouble               : Read / Write
  "height"                   gdouble               : Read / Write
  "horz-grid-line-color"     gchararray            : Write
  "horz-grid-line-color-rgba" guint                 : Read / Write
  "horz-grid-line-pattern"   GooCairoPattern       : Read / Write
  "horz-grid-line-pixbuf"    GdkPixbuf             : Write
  "horz-grid-line-width"     gdouble               : Read / Write
  "show-horz-grid-lines"     gboolean              : Read / Write
  "show-vert-grid-lines"     gboolean              : Read / Write
  "vert-grid-line-color"     gchararray            : Write
  "vert-grid-line-color-rgba" guint                 : Read / Write
  "vert-grid-line-pattern"   GooCairoPattern       : Read / Write
  "vert-grid-line-pixbuf"    GdkPixbuf             : Write
  "vert-grid-line-width"     gdouble               : Read / Write
  "vert-grid-lines-on-top"   gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "x-offset"                 gdouble               : Read / Write
  "x-step"                   gdouble               : Read / Write
  "y"                        gdouble               : Read / Write
  "y-offset"                 gdouble               : Read / Write
  "y-step"                   gdouble               : Read / Write

Description

GooCanvasGridModel represents a model for grid items. A grid consists of a number of equally-spaced horizontal and vertical grid lines, plus an optional border.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasGridModel use goo_canvas_grid_model_new().

To get or set the properties of an existing GooCanvasGridModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the grid you must connect to the signal handlers of the corresponding GooCanvasGrid objects. (See goo_canvas_get_item() and "item-created".)

The grid's position and size is specified with the "x", "y", "width" and "height" properties.

The "x-step" and "y-step" properties specify the distance between grid lines. The "x-offset" and "y-offset" properties specify the distance before the first grid lines.

The horizontal or vertical grid lines can be hidden using the "show-horz-grid-lines" and "show-vert-grid-lines" properties.

The width of the border can be set using the "border-width" property. The border is drawn outside the area specified with the "x", "y", "width" and "height" properties.

Other properties allow the colors and widths of the grid lines to be set. The grid line color and width properties override the standard "stroke-color" and "line-width" properties, enabling different styles for horizontal and vertical grid lines.

Details

GooCanvasGridModel

typedef struct _GooCanvasGridModel GooCanvasGridModel;

The GooCanvasGridModel struct contains private data only.


goo_canvas_grid_model_new ()

GooCanvasItemModel* goo_canvas_grid_model_new           (GooCanvasItemModel *parent,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble width,
                                                         gdouble height,
                                                         gdouble x_step,
                                                         gdouble y_step,
                                                         gdouble x_offset,
                                                         gdouble y_offset,
                                                         ...);

Creates a new grid model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

x :

the x coordinate of the left of the grid.

y :

the y coordinate of the top of the grid.

width :

the width of the grid.

height :

the height of the grid.

x_step :

the distance between the vertical grid lines.

y_step :

the distance between the horizontal grid lines.

x_offset :

the distance before the first vertical grid line.

y_offset :

the distance before the first horizontal grid line.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new grid model.

Here's an example showing how to create a grid:

 GooCanvasItemModel *grid = goo_canvas_grid_model_new (mygroup, 100.0, 100.0, 400.0, 200.0,
                                                       20.0, 20.0, 10.0, 10.0,
                                                       "horz-grid-line-width", 4.0,
                                                       "horz-grid-line-color", "yellow",
                                                       "vert-grid-line-width", 2.0,
                                                       "vert-grid-line-color", "red",
                                                       "border-width", 3.0,
                                                       "border-color", "white",
                                                       "fill-color", "blue",
                                                       NULL);

Property Details

The "border-color" property

  "border-color"             gchararray            : Write

The color to use for the border.

Default value: NULL


The "border-color-rgba" property

  "border-color-rgba"        guint                 : Read / Write

The color to use for the border, specified as a 32-bit integer value.

Default value: 0


The "border-pattern" property

  "border-pattern"           GooCairoPattern       : Read / Write

The cairo pattern to paint the border with.


The "border-pixbuf" property

  "border-pixbuf"            GdkPixbuf             : Write

The pixbuf to use to draw the border.


The "border-width" property

  "border-width"             gdouble               : Read / Write

The width of the border around the grid.

Default value: -1


The "height" property

  "height"                   gdouble               : Read / Write

The height of the grid.

Allowed values: >= 0

Default value: 0


The "horz-grid-line-color" property

  "horz-grid-line-color"     gchararray            : Write

The color to use for the horizontal grid lines.

Default value: NULL


The "horz-grid-line-color-rgba" property

  "horz-grid-line-color-rgba" guint                 : Read / Write

The color to use for the horizontal grid lines, specified as a 32-bit integer value.

Default value: 0


The "horz-grid-line-pattern" property

  "horz-grid-line-pattern"   GooCairoPattern       : Read / Write

The cairo pattern to paint the horizontal grid lines with.


The "horz-grid-line-pixbuf" property

  "horz-grid-line-pixbuf"    GdkPixbuf             : Write

The pixbuf to use to draw the horizontal grid lines.


The "horz-grid-line-width" property

  "horz-grid-line-width"     gdouble               : Read / Write

The width of the horizontal grid lines.

Default value: -1


The "show-horz-grid-lines" property

  "show-horz-grid-lines"     gboolean              : Read / Write

If the horizontal grid lines are shown.

Default value: TRUE


The "show-vert-grid-lines" property

  "show-vert-grid-lines"     gboolean              : Read / Write

If the vertical grid lines are shown.

Default value: TRUE


The "vert-grid-line-color" property

  "vert-grid-line-color"     gchararray            : Write

The color to use for the vertical grid lines.

Default value: NULL


The "vert-grid-line-color-rgba" property

  "vert-grid-line-color-rgba" guint                 : Read / Write

The color to use for the vertical grid lines, specified as a 32-bit integer value.

Default value: 0


The "vert-grid-line-pattern" property

  "vert-grid-line-pattern"   GooCairoPattern       : Read / Write

The cairo pattern to paint the vertical grid lines with.


The "vert-grid-line-pixbuf" property

  "vert-grid-line-pixbuf"    GdkPixbuf             : Write

The pixbuf to use to draw the vertical grid lines.


The "vert-grid-line-width" property

  "vert-grid-line-width"     gdouble               : Read / Write

The width of the vertical grid lines.

Default value: -1


The "vert-grid-lines-on-top" property

  "vert-grid-lines-on-top"   gboolean              : Read / Write

If the vertical grid lines are painted above the horizontal grid lines.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the grid.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the grid.

Default value: 0


The "x-offset" property

  "x-offset"                 gdouble               : Read / Write

The distance before the first vertical grid line.

Allowed values: >= 0

Default value: 0


The "x-step" property

  "x-step"                   gdouble               : Read / Write

The distance between the vertical grid lines.

Allowed values: >= 0

Default value: 10


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the grid.

Default value: 0


The "y-offset" property

  "y-offset"                 gdouble               : Read / Write

The distance before the first horizontal grid line.

Allowed values: >= 0

Default value: 0


The "y-step" property

  "y-step"                   gdouble               : Read / Write

The distance between the horizontal grid lines.

Allowed values: >= 0

Default value: 10


goocanvas-0.15/docs/html/left.png0000644000076400007640000000071311222215703013700 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ1&¹³[(XIDATxœµ•!OÃPEïÛ*ˆ‰ŠID%~ꊯ˜ÄÕ"pæ'öŘ`sÜ–¥rKf–´‚¤â h—mi—ÇIžz}÷ܯIû¤–.pÚö\“`xä‹ ˆl‡?l·[²,H¬‡¯×k<Ï#Žcþ%\’AUx[S³7–n6ù¾¯år¹ßèõzE‰‡’s’žŒ1³ºö“²æÅj@œ—NL$ݤiª0 ¿5/ð}¿²\E‡Ž¤KIo¥Í“$a0üjÞdF£bŠkIê„‹æAh>ŸW¶lC'?“tk;|/t*I»ÝN«ÕÊZø^`Œy•4ë÷ûšN§r]×® çJÒÌó<«’½À“Út»Ýú€à`±Xàºî1@p´ä€¸d½÷ŽZ')høÖÚK¬ ª$V?%Å]€­+³L’sgUKà"ÿw5â3O·•ÜòIEND®B`‚goocanvas-0.15/docs/html/goocanvas-overview.html0000644000076400007640000000750511222215706016763 00000000000000 Overview

Overview

Overview — a quick tour of GooCanvas.

Features

  • Optional model/view split.

  • Uses interfaces for items and views.

  • Basic items - rect/ellipse/polyline/text/image/grid/group.

  • Path item, using SVG path specification strings.

  • Table item for layout of other items (similar to the GtkTable widget). (This also supports items whose requested height changes according to their allocated width, such as text items.)

  • Embedded GTK+ widgets.

  • Layers/stacking order with raise/lower functions.

  • Cascading styles - line width/style/dashes, colors, fill patterns.

  • Affine transformations for all items - rotations/scales/skews.

  • Event handling - button/motion events, "pointer-events" property like SVG.

  • Grabs - support for pointer and keyboard grabs.

  • Keyboard focus traversal.

  • Accessibility (item title and description properties and hierarchy stuff).

  • Printing (output to a given cairo_t).

  • Scrolling.

  • Zooming.

  • Static items that don't move as the canvas is scrolled or zoomed.

  • Item visibility setting - on/off/above zoom threshold.

  • Simple animation.

  • Scalable - support for thousands of items over a large canvas area.

  • Support for different units - pixels/points/inches/millimeters.

goocanvas-0.15/docs/html/style.css0000644000076400007640000000415611222215703014117 00000000000000.synopsis, .classsynopsis { background: #eeeeee; border: solid 1px #aaaaaa; padding: 0.5em; } .programlisting { background: #eeeeff; border: solid 1px #aaaaff; padding: 0.5em; } .variablelist { padding: 4px; margin-left: 3em; } .variablelist td:first-child { vertical-align: top; } /* this is needed so that the local anchors are displayed below the naviagtion */ @media screen { div.refnamediv a[name], div.refsect1 a[name] { position: relative; top: -4.5em; } table.navigation#top { background: #ffeeee; border: solid 1px #ffaaaa; margin-top: 0; margin-bottom: 0; position: fixed; top: 0; left: 0; height: 2em; z-index: 1; } .navigation a { color: #770000; } .navigation a:visited { color: #550000; } td.shortcuts { color: #770000; font-size: 80%; } div.refentry, div.chapter, div.reference, div.part, div.book, div.index, div.glossary, div.sect1, div.appendix, div.preface { position: relative; top: 3em; z-index: 0; } div.refnamediv { margin-top: 2em; } body { padding-bottom: 20em; } } @media print { table.navigation { visibility: collapse; display: none; } div.titlepage table.navigation { visibility: visible; display: table; background: #ffeeee; border: solid 1px #ffaaaa; margin-top: 0; margin-bottom: 0; top: 0; left: 0; height: 2em; } } .navigation .title { font-size: 200%; } div.gallery-float { float: left; padding: 10px; } div.gallery-float img { border-style: none; } div.gallery-spacer { clear: both; } a { text-decoration: none; } a:hover { text-decoration: underline; color: #FF0000; } div.table table { border-collapse: collapse; border-spacing: 0px; border-style: solid; border-color: #777777; border-width: 1px; } div.table table td, div.table table th { border-style: solid; border-color: #777777; border-width: 1px; padding: 3px; vertical-align: top; } div.table table th { background-color: #eeeeee; } hr { color: #888; background: #888; border: 0; height: 1px; clear: both; } goocanvas-0.15/docs/html/GooCanvasImageModel.html0000644000076400007640000003613411222215706016743 00000000000000 GooCanvasImageModel

GooCanvasImageModel

GooCanvasImageModel — a model for image items.

Object Hierarchy


  GObject
   +----GooCanvasItemModelSimple
         +----GooCanvasImageModel

Implemented Interfaces

GooCanvasImageModel implements GooCanvasItemModel.

Properties


  "height"                   gdouble               : Read / Write
  "pattern"                  GooCairoPattern       : Read / Write
  "pixbuf"                   GdkPixbuf             : Write
  "scale-to-fit"             gboolean              : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasImageModel represent a model for image items.

It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "operator" and "pointer-events".

It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate().

To create a GooCanvasImageModel use goo_canvas_image_model_new().

To get or set the properties of an existing GooCanvasImageModel, use g_object_get() and g_object_set().

To respond to events such as mouse clicks on the image you must connect to the signal handlers of the corresponding GooCanvasImage objects. (See goo_canvas_get_item() and "item-created".)

Details

GooCanvasImageModel

typedef struct _GooCanvasImageModel GooCanvasImageModel;

The GooCanvasImageModel struct contains private data only.


goo_canvas_image_model_new ()

GooCanvasItemModel* goo_canvas_image_model_new          (GooCanvasItemModel *parent,
                                                         GdkPixbuf *pixbuf,
                                                         gdouble x,
                                                         gdouble y,
                                                         ...);

Creates a new image model.

parent :

the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

pixbuf :

the GdkPixbuf containing the image data, or NULL.

x :

the x coordinate of the image.

y :

the y coordinate of the image.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new image model.

Here's an example showing how to create an image at (100.0, 100.0), using the given pixbuf at its natural width and height:

 GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0,
                                                         NULL);

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the image.

Allowed values: >= 0

Default value: 0


The "pattern" property

  "pattern"                  GooCairoPattern       : Read / Write

The cairo pattern to paint.


The "pixbuf" property

  "pixbuf"                   GdkPixbuf             : Write

The GdkPixbuf to display.


The "scale-to-fit" property

  "scale-to-fit"             gboolean              : Read / Write

If the image is scaled to fit the width and height settings.

Default value: FALSE


The "width" property

  "width"                    gdouble               : Read / Write

The width of the image.

Allowed values: >= 0

Default value: 0


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the image.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the image.

Default value: 0


goocanvas-0.15/docs/html/right.png0000644000076400007640000000073011222215703014062 00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ2 I%Á=eIDATxœ­”!oÂ@†Ÿ.'**M0$ÄÁ$¿?1~¢vIeEuLlÉ&–Ô4‚ä Í¶B»Ý›œ¹|÷>ï—ûî …$ݶ©oc<”´ÑA©¤×€X’ò Model/View Canvas Example

Model/View Canvas Example

Model/View Canvas Example — how to create a model/view canvas.

Model View Canvas Example

Here's a complete example application that creates a model-view GooCanvas with a rectangle and a text item in it.

  #include <stdlib.h>
  #include <goocanvas.h>
  
  
  static gboolean on_rect_button_press (GooCanvasItem  *view,
                                        GooCanvasItem  *target,
                                        GdkEventButton *event,
                                        gpointer        data);
  
  static gboolean on_delete_event      (GtkWidget      *window,
                                        GdkEvent       *event,
                                        gpointer        unused_data);
  
  
  int
  main (int argc, char *argv[])
  {
    GtkWidget *window, *scrolled_win, *canvas;
    GooCanvasItemModel *root, *rect_model, *text_model;
    GooCanvasItem *rect_item;
  
    /* Initialize GTK+. */
    gtk_set_locale ();
    gtk_init (&argc, &argv);
  
    /* Create the window and widgets. */
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size (GTK_WINDOW (window), 640, 600);
    gtk_widget_show (window);
    g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event,
                      NULL);
  
    scrolled_win = gtk_scrolled_window_new (NULL, NULL);
    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
                                         GTK_SHADOW_IN);
    gtk_widget_show (scrolled_win);
    gtk_container_add (GTK_CONTAINER (window), scrolled_win);
  
    canvas = goo_canvas_new ();
    gtk_widget_set_size_request (canvas, 600, 450);
    goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000);
    gtk_widget_show (canvas);
    gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
  
    root = goo_canvas_group_model_new (NULL, NULL);
  
    /* Add a few simple items. */
    rect_model = goo_canvas_rect_model_new (root, 100, 100, 400, 400,
                                            "line-width", 10.0,
                                            "radius-x", 20.0,
                                            "radius-y", 10.0,
                                            "stroke-color", "yellow",
                                            "fill-color", "red",
                                            NULL);
  
    text_model = goo_canvas_text_model_new (root, "Hello World", 300, 300, -1,
                                            GTK_ANCHOR_CENTER,
                                            "font", "Sans 24",
                                            NULL);
    goo_canvas_item_model_rotate (text_model, 45, 300, 300);
  
    goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root);
  
    /* Connect a signal handler for the rectangle item. */
    rect_item = goo_canvas_get_item (GOO_CANVAS (canvas), rect_model);
    g_signal_connect (rect_item, "button_press_event",
                      (GtkSignalFunc) on_rect_button_press, NULL);
  
    /* Pass control to the GTK+ main event loop. */
    gtk_main ();
  
    return 0;
  }
  
  
  /* This handles button presses in item views. We simply output a message to
     the console. */
  static gboolean
  on_rect_button_press (GooCanvasItem  *item,
                        GooCanvasItem  *target,
                        GdkEventButton *event,
                        gpointer        data)
  {
    g_print ("rect item received button press event\n");
    return TRUE;
  }
  
  
  /* This is our handler for the "delete-event" signal of the window, which
     is emitted when the 'x' close button is clicked. We just exit here. */
  static gboolean
  on_delete_event (GtkWidget *window,
                   GdkEvent  *event,
                   gpointer   unused_data)
  {
    exit (0);
  }
 
goocanvas-0.15/docs/html/GooCanvasItemSimple.html0000644000076400007640000015076611222215706017020 00000000000000 GooCanvasItemSimple

GooCanvasItemSimple

GooCanvasItemSimple — the base class for the standard canvas items.

Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasWidget
         +----GooCanvasRect
         +----GooCanvasGroup
         +----GooCanvasPath
         +----GooCanvasEllipse
         +----GooCanvasText
         +----GooCanvasPolyline
         +----GooCanvasImage
         +----GooCanvasGrid

Implemented Interfaces

GooCanvasItemSimple implements GooCanvasItem.

Properties


  "antialias"                GooCairoAntialias     : Read / Write
  "clip-fill-rule"           GooCairoFillRule      : Read / Write
  "clip-path"                gchararray            : Write
  "fill-color"               gchararray            : Write
  "fill-color-rgba"          guint                 : Read / Write
  "fill-pattern"             GooCairoPattern       : Read / Write
  "fill-pixbuf"              GdkPixbuf             : Write
  "fill-rule"                GooCairoFillRule      : Read / Write
  "font"                     gchararray            : Read / Write
  "font-desc"                PangoFontDescription  : Read / Write
  "hint-metrics"             GooCairoHintMetrics   : Read / Write
  "line-cap"                 GooCairoLineCap       : Read / Write
  "line-dash"                GooCanvasLineDash     : Read / Write
  "line-join"                GooCairoLineJoin      : Read / Write
  "line-join-miter-limit"    gdouble               : Read / Write
  "line-width"               gdouble               : Read / Write
  "operator"                 GooCairoOperator      : Read / Write
  "stroke-color"             gchararray            : Write
  "stroke-color-rgba"        guint                 : Read / Write
  "stroke-pattern"           GooCairoPattern       : Read / Write
  "stroke-pixbuf"            GdkPixbuf             : Write

Description

GooCanvasItemSimple is used as a base class for all of the standard canvas items. It can also be used as the base class for new custom canvas items.

It provides default implementations for many of the GooCanvasItem methods.

For very simple items, all that is needed is to implement the create_path() method. (GooCanvasEllipse, GooCanvasRect and GooCanvasPath do this.)

More complicated items need to implement the update(), paint() and is_item_at() methods instead. (GooCanvasImage, GooCanvasPolyline, GooCanvasText and GooCanvasWidget do this.) They may also need to override some of the other GooCanvasItem methods such as set_canvas(), set_parent() or allocate_area() if special code is needed. (GooCanvasWidget does this to make sure the GtkWidget is embedded in the GooCanvas widget correctly.)

Details

GooCanvasItemSimple

typedef struct {
  GooCanvas *canvas;
  GooCanvasItem *parent;
  GooCanvasItemModelSimple *model;
  GooCanvasItemSimpleData *simple_data;
  GooCanvasBounds bounds;
  guint	need_update			: 1;
  guint need_entire_subtree_update      : 1;
} GooCanvasItemSimple;

The GooCanvasItemSimple struct contains the basic data needed to implement canvas items.

GooCanvas *canvas;

the canvas.

GooCanvasItem *parent;

the parent item.

GooCanvasItemModelSimple *model;

the item's model, if it has one.

GooCanvasItemSimpleData *simple_data;

data that is common to both the model and view classes. If the canvas item has a model, this will point to the model's GooCanvasItemSimpleData, otherwise the canvas item will have its own GooCanvasItemSimpleData.

GooCanvasBounds bounds;

the bounds of the item, in device space.

guint need_update : 1;

if the item needs to recompute its bounds and redraw.

guint need_entire_subtree_update : 1;

if all descendants need to be updated.

GooCanvasItemSimpleData

typedef struct {
  GooCanvasStyle *style;
  cairo_matrix_t *transform;
  GArray *clip_path_commands;
  gchar *tooltip;

  gdouble visibility_threshold;
  guint visibility			: 2;
  guint pointer_events			: 4;
  guint can_focus                       : 1;
  guint own_style                       : 1;
  guint clip_fill_rule			: 4;
  guint is_static			: 1;
} GooCanvasItemSimpleData;

This is the data common to both the model and view classes.

GooCanvasStyle *style;

the style to draw with.

cairo_matrix_t *transform;

the transformation matrix of the item, or NULL.

GArray *clip_path_commands;

an array of GooCanvasPathCommand specifying the clip path of the item, or NULL.

gchar *tooltip;

the item's tooltip.

gdouble visibility_threshold;

the threshold scale setting at which to show the item (if the visibility setting is set to VISIBLE_ABOVE_THRESHOLD).

guint visibility : 2;

the GooCanvasItemVisibility setting specifying whether the item is visible, invisible, or visible above a given canvas scale setting.

guint pointer_events : 4;

the GooCanvasPointerEvents setting specifying the events the item should receive.

guint can_focus : 1;

if the item can take the keyboard focus.

guint own_style : 1;

if the item has its own style, rather than using its parent's.

guint clip_fill_rule : 4;

the cairo_fill_rule_t setting specifying the fill rule used for the clip path.

guint is_static : 1;

if the item is static.

GooCanvasItemSimpleClass

typedef struct {
  void		 (* simple_create_path)	(GooCanvasItemSimple   *simple,
					 cairo_t               *cr);

  void           (* simple_update)	(GooCanvasItemSimple   *simple,
					 cairo_t               *cr);
  void           (* simple_paint)	(GooCanvasItemSimple   *simple,
					 cairo_t               *cr,
					 const GooCanvasBounds *bounds);
  gboolean       (* simple_is_item_at)  (GooCanvasItemSimple   *simple,
					 gdouble                x,
					 gdouble                y,
					 cairo_t               *cr,
					 gboolean               is_pointer_event);
} GooCanvasItemSimpleClass;

The GooCanvasItemSimpleClass struct contains several methods that subclasses can override.

Simple items need only implement the create_path() method. More complex items must override the update(), paint() and is_item_at() methods instead.

simple_create_path ()

simple subclasses that draw basic shapes and paths only need to override this one method. It creates the path for the item. All updating, painting and hit-testing is provided automatically by the GooCanvasItemSimple class. (This method is used by the builtin GooCanvasEllipse, GooCanvasRect and GooCanvasPath items.) More complicated subclasses must override simple_update, simple_paint and simple_is_item_at instead.

simple_update ()

subclasses should override this to calculate their new bounds, in user space.

simple_paint ()

subclasses should override this to paint their item.

simple_is_item_at ()

subclasses should override this to do hit-testing.

goo_canvas_item_simple_check_style ()

void                goo_canvas_item_simple_check_style  (GooCanvasItemSimple *item);

This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their update() or get_requested_area() methods.

It ensures that the item's style is setup correctly. If the item has its own GooCanvasStyle it makes sure the parent is set correctly. If it doesn't have its own style it uses the parent item's style.

item :

a GooCanvasItemSimple.

goo_canvas_item_simple_get_line_width ()

gdouble             goo_canvas_item_simple_get_line_width
                                                        (GooCanvasItemSimple *item);

Gets the item's line width.

item :

a GooCanvasItemSimple.

Returns :

the item's line width.

goo_canvas_item_simple_get_path_bounds ()

void                goo_canvas_item_simple_get_path_bounds
                                                        (GooCanvasItemSimple *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);

This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their update() or get_requested_area() methods.

It calculates the bounds of the current path, using the item's style settings, and stores the results in the given GooCanvasBounds struct.

The returned bounds contains the bounding box of the path in device space, converted to user space coordinates. To calculate the bounds completely in user space, use cairo_identity_matrix() to temporarily reset the current transformation matrix to the identity matrix.

item :

a GooCanvasItemSimple.

cr :

a cairo context.

bounds :

the GooCanvasBounds struct to store the resulting bounding box.

goo_canvas_item_simple_user_bounds_to_device ()

void                goo_canvas_item_simple_user_bounds_to_device
                                                        (GooCanvasItemSimple *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);

This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their update() or get_requested_area() methods.

It converts the item's bounds to a bounding box in the canvas (device) coordinate space.

item :

a GooCanvasItemSimple.

cr :

a cairo context.

bounds :

the bounds of the item, in the item's coordinate space.

goo_canvas_item_simple_user_bounds_to_parent ()

void                goo_canvas_item_simple_user_bounds_to_parent
                                                        (GooCanvasItemSimple *item,
                                                         cairo_t *cr,
                                                         GooCanvasBounds *bounds);

This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their get_requested_area() method.

It converts the item's bounds to a bounding box in its parent's coordinate space. If the item has no transformation matrix set then no conversion is needed.

item :

a GooCanvasItemSimple.

cr :

a cairo context.

bounds :

the bounds of the item, in the item's coordinate space.

goo_canvas_item_simple_check_in_path ()

gboolean            goo_canvas_item_simple_check_in_path
                                                        (GooCanvasItemSimple *item,
                                                         gdouble x,
                                                         gdouble y,
                                                         cairo_t *cr,
                                                         GooCanvasPointerEvents pointer_events);

This function is intended to be used by subclasses of GooCanvasItemSimple.

It checks if the given point is in the current path, using the item's style settings.

item :

a GooCanvasItemSimple.

x :

the x coordinate of the point.

y :

the y coordinate of the point.

cr :

a cairo context.

pointer_events :

specifies which parts of the path to check.

Returns :

TRUE if the given point is in the current path.

goo_canvas_item_simple_paint_path ()

void                goo_canvas_item_simple_paint_path   (GooCanvasItemSimple *item,
                                                         cairo_t *cr);

This function is intended to be used by subclasses of GooCanvasItemSimple.

It paints the current path, using the item's style settings.

item :

a GooCanvasItemSimple.

cr :

a cairo context.

goo_canvas_item_simple_changed ()

void                goo_canvas_item_simple_changed      (GooCanvasItemSimple *item,
                                                         gboolean recompute_bounds);

This function is intended to be used by subclasses of GooCanvasItemSimple.

It is used as a callback for the "changed" signal of the item models. It requests an update or redraw of the item as appropriate.

item :

a GooCanvasItemSimple.

recompute_bounds :

if the item's bounds need to be recomputed.

goo_canvas_item_simple_set_model ()

void                goo_canvas_item_simple_set_model    (GooCanvasItemSimple *item,
                                                         GooCanvasItemModel *model);

This function should be called by subclasses of GooCanvasItemSimple in their set_model() method.

item :

a GooCanvasItemSimple.

model :

the model that item will view.

Property Details

The "antialias" property

  "antialias"                GooCairoAntialias     : Read / Write

The antialiasing mode to use.

Default value: CAIRO_ANTIALIAS_GRAY


The "clip-fill-rule" property

  "clip-fill-rule"           GooCairoFillRule      : Read / Write

The fill rule used to determine which parts of the item are clipped.

Default value: CAIRO_FILL_RULE_WINDING


The "clip-path" property

  "clip-path"                gchararray            : Write

The sequence of commands describing the clip path of the item, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

Default value: NULL


The "fill-color" property

  "fill-color"               gchararray            : Write

The color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.

Default value: NULL


The "fill-color-rgba" property

  "fill-color-rgba"          guint                 : Read / Write

The color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULL.

Default value: 0


The "fill-pattern" property

  "fill-pattern"             GooCairoPattern       : Read / Write

The pattern to use to paint the interior of the item, or NULL to disable painting.


The "fill-pixbuf" property

  "fill-pixbuf"              GdkPixbuf             : Write

The pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.


The "fill-rule" property

  "fill-rule"                GooCairoFillRule      : Read / Write

The fill rule used to determine which parts of the item are filled.

Default value: CAIRO_FILL_RULE_WINDING


The "font" property

  "font"                     gchararray            : Read / Write

The base font to use for the text.

Default value: NULL


The "font-desc" property

  "font-desc"                PangoFontDescription  : Read / Write

The attributes specifying which font to use.


The "hint-metrics" property

  "hint-metrics"             GooCairoHintMetrics   : Read / Write

The hinting to be used for font metrics.

Default value: CAIRO_HINT_METRICS_OFF


The "line-cap" property

  "line-cap"                 GooCairoLineCap       : Read / Write

The line cap style to use.

Default value: CAIRO_LINE_CAP_BUTT


The "line-dash" property

  "line-dash"                GooCanvasLineDash     : Read / Write

The dash pattern to use.


The "line-join" property

  "line-join"                GooCairoLineJoin      : Read / Write

The line join style to use.

Default value: CAIRO_LINE_JOIN_MITER


The "line-join-miter-limit" property

  "line-join-miter-limit"    gdouble               : Read / Write

The smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit.

Allowed values: >= 0

Default value: 10


The "line-width" property

  "line-width"               gdouble               : Read / Write

The line width to use for the item's perimeter.

Allowed values: >= 0

Default value: 2


The "operator" property

  "operator"                 GooCairoOperator      : Read / Write

The compositing operator to use.

Default value: CAIRO_OPERATOR_OVER


The "stroke-color" property

  "stroke-color"             gchararray            : Write

The color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.

Default value: NULL


The "stroke-color-rgba" property

  "stroke-color-rgba"        guint                 : Read / Write

The color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULL.

Default value: 0


The "stroke-pattern" property

  "stroke-pattern"           GooCairoPattern       : Read / Write

The pattern to use to paint the perimeter of the item, or NULL disable painting.


The "stroke-pixbuf" property

  "stroke-pixbuf"            GdkPixbuf             : Write

The pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.


goocanvas-0.15/docs/html/index.html0000644000076400007640000001654411222215706014251 00000000000000 GooCanvas Reference Manual

Introduction
Overview — a quick tour of GooCanvas.
Simple Canvas Example — how to create a simple canvas.
Model/View Canvas Example — how to create a model/view canvas.
Underlying Architecture — how the canvas fits together.
Coordinate Spaces and Limits — how coordinates are used.
Creating New Items — how to create new canvas items.
WYSIWYG Printing — how to use the canvas to create accurate printed output.
Core Objects
GooCanvas — the main canvas widget.
GooCanvasItem — the interface for canvas items.
GooCanvasItemModel — the interface for canvas item models.
GooCanvasItemSimple — the base class for the standard canvas items.
GooCanvasItemModelSimple — the base class for the standard canvas item models.
GooCanvasStyle — support for cascading style properties for canvas items.
Standard Canvas Items
GooCanvasGroup — a group of items.
GooCanvasEllipse — an ellipse item.
GooCanvasGrid — a grid item.
GooCanvasImage — an image item.
GooCanvasPath — a path item (a series of lines and curves).
GooCanvasPolyline — a polyline item (a series of lines with optional arrows).
GooCanvasRect — a rectangle item.
GooCanvasText — a text item.
GooCanvasWidget — an embedded widget item.
GooCanvasTable — a table container to layout items.
Standard Canvas Item Models
GooCanvasGroupModel — a model for a group of items.
GooCanvasEllipseModel — a model for ellipse items.
GooCanvasGridModel — a model for grid items.
GooCanvasImageModel — a model for image items.
GooCanvasPathModel — a model for path items (a series of lines and curves).
GooCanvasPolylineModel — a model for polyline items (a series of lines with optional arrows).
GooCanvasRectModel — a model for rectangle items.
GooCanvasTextModel — a model for text items.
GooCanvasTableModel — a model for a table container to layout items.
Miscellaneous
GooCanvas Types — types used in GooCanvas.
goocanvas-0.15/docs/html/goocanvas-coordinates.html0000644000076400007640000001451311222215706017424 00000000000000 Coordinate Spaces and Limits

Coordinate Spaces and Limits

Coordinate Spaces and Limits — how coordinates are used.

Coordinate Spaces

Items in the canvas typically have a number of properties specifying their location and size. For example the GooCanvasRect item has "x", "y", "width" and "height" properties.

However, items can also have a transformation matrix (e.g. the "transform" property). Transformation matrices modify the item's coordinate space in some way. Modifications include translation (moving the origin), rotation, scaling, and skewing, or combinations of these. Thus the final position of the item on the canvas can be altered dramatically.

The simple animation features in GooCanvas are accomplished by modifying the item's transformation matrix over time. (See goo_canvas_item_animate().)

Since items are in a hierarchy it is possible to move or rotate an entire group of items by simply changing the transformation matrix of the group containing them.

The coordinate space used within the item itself (e.g. where the "x" and "y" properties of a GooCanvasRect are specified) is referred to as "Item Space". The coordinate space used by the entire canvas is referred to as "Canvas Space" (or "Device Space"). "Item Space" and "Canvas Space" may or may not be the same, depending on whether the item or any of its ancestors have a transformation matrix set. (Note that the entire canvas may also be scrolled and/or zoomed, which means that there may be additional transformations above "Canvas Space".)

Functions are provided to convert between coordinate spaces, e.g. goo_canvas_convert_to_item_space() and goo_canvas_convert_from_item_space() convert canvas space coordinates to item space and vice versa.

Coordinate Limits

GooCanvas uses the Cairo graphics library to render canvas items. For performance reasons Cairo uses 32-bit fixed point integers internally when rendering graphics, with 24 bits used for the integer part of values and 8 bits used for the fractional part. This means that values are limited to roughly +/- 8,388,608. (Prior to Cairo 1.6 16 bits were used for the integer part and 16 bits for the fractional part, meaning values were limited to +/- 32,768.)

GooCanvas includes code to work around the Cairo limits to some extent. Subclasses of GooCanvasItemSimple (including all builtin items) can use any desired translation using a transformation matrix. But item space coordinates (modified by any scale, rotation or skew) must be within the Cairo limits.

It is possible to create new canvas items that avoid the Cairo limits completely. For an example of this see the "Large Items" page in the GooCanvas demo application, and the corresponding code.

goocanvas-0.15/docs/html/goocanvas-wysiwyg.html0000644000076400007640000001066511222215706016640 00000000000000 WYSIWYG Printing

WYSIWYG Printing

WYSIWYG Printing — how to use the canvas to create accurate printed output.

WYSIWYG Printing

Screen Resolution

The GooCanvas "resolution-x" and "resolution-y" properties must be set correctly. They both default to 96dpi, which corresponds to a typical monitor. To get a more accurate figure you might be able to use gdk_screen_get_resolution(), but this isn't always guaranteed to be correct. If accuracy is very important a method should be provided for the user to calibrate the screen.


Units

The GooCanvas "units" property must be set to one of GTK_UNIT_MM, GTK_UNIT_POINTS or GTK_UNIT_INCH (it defaults to GTK_UNIT_PIXEL). All values used within the canvas are assumed to be in the specified units, including font sizes.


Font Sizes

Absolute font sizes must be used (to prevent the fonts being mistakenly scaled by Pango as well as by GooCanvas). To specify absolute font sizes add "px" after the font size, e.g. instead of "Sans 9" use "Sans 9px".

Font sizes must be converted to the units used by the canvas. For example, if a 9 point "Sans" font is desired but "units" is set to GTK_UNIT_MM, then the size must first be converted into millimeters: (9 / 72) * 25.4 = 3.175mm. So the font used would be "Sans 3.175px".


Example Code

The units-demo application that comes with the GooCanvas source code demonstrates the use of different units and absolute font sizes.

goocanvas-0.15/docs/html/goocanvas-goocanvasitemmodel.html0000644000076400007640000031242211222215706020772 00000000000000 GooCanvasItemModel

GooCanvasItemModel

GooCanvasItemModel — the interface for canvas item models.

Synopsis




                    GooCanvasItemModel;
                    GooCanvasItemModelIface;

void                goo_canvas_item_model_translate     (GooCanvasItemModel *model,
                                                         gdouble tx,
                                                         gdouble ty);
void                goo_canvas_item_model_scale         (GooCanvasItemModel *model,
                                                         gdouble sx,
                                                         gdouble sy);
void                goo_canvas_item_model_rotate        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
void                goo_canvas_item_model_skew_x        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
void                goo_canvas_item_model_skew_y        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);
gboolean            goo_canvas_item_model_get_transform (GooCanvasItemModel *model,
                                                         cairo_matrix_t *transform);
void                goo_canvas_item_model_set_transform (GooCanvasItemModel *model,
                                                         const cairo_matrix_t *transform);
gboolean            goo_canvas_item_model_get_simple_transform
                                                        (GooCanvasItemModel *model,
                                                         gdouble *x,
                                                         gdouble *y,
                                                         gdouble *scale,
                                                         gdouble *rotation);
void                goo_canvas_item_model_set_simple_transform
                                                        (GooCanvasItemModel *model,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble rotation);

void                goo_canvas_item_model_animate       (GooCanvasItemModel *model,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble degrees,
                                                         gboolean absolute,
                                                         gint duration,
                                                         gint step_time,
                                                         GooCanvasAnimateType type);
void                goo_canvas_item_model_stop_animation
                                                        (GooCanvasItemModel *model);

void                goo_canvas_item_model_raise         (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *above);
void                goo_canvas_item_model_lower         (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *below);

void                goo_canvas_item_model_remove        (GooCanvasItemModel *model);

GooCanvasItemModel* goo_canvas_item_model_get_parent    (GooCanvasItemModel *model);
void                goo_canvas_item_model_set_parent    (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *parent);

gboolean            goo_canvas_item_model_is_container  (GooCanvasItemModel *model);
gint                goo_canvas_item_model_get_n_children
                                                        (GooCanvasItemModel *model);
GooCanvasItemModel* goo_canvas_item_model_get_child     (GooCanvasItemModel *model,
                                                         gint child_num);
void                goo_canvas_item_model_add_child     (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         gint position);
void                goo_canvas_item_model_move_child    (GooCanvasItemModel *model,
                                                         gint old_position,
                                                         gint new_position);
void                goo_canvas_item_model_remove_child  (GooCanvasItemModel *model,
                                                         gint child_num);
gint                goo_canvas_item_model_find_child    (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child);

GooCanvasStyle*     goo_canvas_item_model_get_style     (GooCanvasItemModel *model);
void                goo_canvas_item_model_set_style     (GooCanvasItemModel *model,
                                                         GooCanvasStyle *style);

void                goo_canvas_item_model_class_install_child_property
                                                        (GObjectClass *mclass,
                                                         guint property_id,
                                                         GParamSpec *pspec);
GParamSpec**        goo_canvas_item_model_class_list_child_properties
                                                        (GObjectClass *mclass,
                                                         guint *n_properties);
GParamSpec*         goo_canvas_item_model_class_find_child_property
                                                        (GObjectClass *mclass,
                                                         const gchar *property_name);
void                goo_canvas_item_model_get_child_property
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         const gchar *property_name,
                                                         GValue *value);
void                goo_canvas_item_model_set_child_property
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         const gchar *property_name,
                                                         const GValue *value);
void                goo_canvas_item_model_get_child_properties
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         ...);
void                goo_canvas_item_model_get_child_properties_valist
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         va_list var_args);
void                goo_canvas_item_model_set_child_properties
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         ...);
void                goo_canvas_item_model_set_child_properties_valist
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         va_list var_args);

Object Hierarchy


  GInterface
   +----GooCanvasItemModel

Prerequisites

GooCanvasItemModel requires GObject.

Properties


  "can-focus"                gboolean              : Read / Write
  "description"              gchararray            : Read / Write
  "parent"                   GooCanvasItemModel    : Read / Write
  "pointer-events"           GooCanvasPointerEvents  : Read / Write
  "title"                    gchararray            : Read / Write
  "tooltip"                  gchararray            : Read / Write
  "transform"                GooCairoMatrix        : Read / Write
  "visibility"               GooCanvasItemVisibility  : Read / Write
  "visibility-threshold"     gdouble               : Read / Write

Signals


  "animation-finished"                             : Run Last
  "changed"                                        : Run Last
  "child-added"                                    : Run Last
  "child-moved"                                    : Run Last
  "child-notify"                                   : Run First / No Recursion / Has Details / No Hooks
  "child-removed"                                  : Run Last

Description

GooCanvasItemModel defines the interface that models for canvas items must implement, and contains methods for operating on canvas item models.

Details

GooCanvasItemModel

typedef struct _GooCanvasItemModel GooCanvasItemModel;

GooCanvasItemModel is a typedef used for objects that implement the GooCanvasItemModel interface.

(There is no actual GooCanvasItemModel struct, since it is only an interface. But using 'GooCanvasItemModel' is more helpful than using 'GObject'.)


GooCanvasItemModelIface

typedef struct {
  /* Virtual methods that group models must implement. */
  gint		       (* get_n_children)		(GooCanvasItemModel	*model);
  GooCanvasItemModel*  (* get_child)			(GooCanvasItemModel	*model,
							 gint			 child_num);

  /* Virtual methods that group models may implement. */
  void                 (* add_child)			(GooCanvasItemModel	*model,
							 GooCanvasItemModel	*child,
							 gint			 position);
  void                 (* move_child)			(GooCanvasItemModel	*model,
							 gint			 old_position,
							 gint			 new_position);
  void                 (* remove_child)			(GooCanvasItemModel	*model,
							 gint			 child_num);
  void                 (* get_child_property)		(GooCanvasItemModel	*model,
							 GooCanvasItemModel	*child,
							 guint			 property_id,
							 GValue			*value,
							 GParamSpec		*pspec);
  void                 (* set_child_property)		(GooCanvasItemModel	*item,
							 GooCanvasItemModel	*child,
							 guint			 property_id,
							 const GValue		*value,
							 GParamSpec		*pspec);

  /* Virtual methods that all item models must implement. */
  GooCanvasItemModel*  (* get_parent)			(GooCanvasItemModel	*model);
  void                 (* set_parent)			(GooCanvasItemModel	*model,
							 GooCanvasItemModel	*parent);

  GooCanvasItem*       (* create_item)			(GooCanvasItemModel	*model,
							 GooCanvas		*canvas);

  /* Virtual methods that all item models may implement. */
  gboolean             (* get_transform)		(GooCanvasItemModel	*model,
							 cairo_matrix_t         *transform);
  void                 (* set_transform)		(GooCanvasItemModel	*model,
							 const cairo_matrix_t	*transform);
  GooCanvasStyle*      (* get_style)			(GooCanvasItemModel	*model);
  void                 (* set_style)			(GooCanvasItemModel	*model,
							 GooCanvasStyle		*style);

  /* Signals. */
  void                 (* child_added)			(GooCanvasItemModel	*model,
							 gint			 child_num);
  void                 (* child_moved)			(GooCanvasItemModel	*model,
							 gint			 old_child_num,
							 gint			 new_child_num);
  void                 (* child_removed)		(GooCanvasItemModel	*model,
							 gint			 child_num);
  void                 (* changed)			(GooCanvasItemModel	*model,
							 gboolean		 recompute_bounds);
  void                 (* child_notify)			(GooCanvasItemModel	*model,
							 GParamSpec		*pspec);

  void		       (* animation_finished)		(GooCanvasItemModel     *model,
							 gboolean                stopped);
} GooCanvasItemModelIface;

GooCanvasItemModelIFace holds the virtual methods that make up the GooCanvasItemModel interface.

Simple item models only need to implement the get_parent(), set_parent() and create_item() methods.

Items that support transforms should also implement get_transform() and set_transform(). Items that support styles should implement get_style() and set_style().

Container items must implement get_n_children() and get_child(). Containers that support dynamic changes to their children should implement add_child(), move_child() and remove_child(). Layout containers like GooCanvasTable may implement get_child_property() and set_child_property().

get_n_children ()

returns the number of children of the model.

get_child ()

returns the child at the given index.

add_child ()

adds a child.

move_child ()

moves a child up or down the stacking order.

remove_child ()

removes a child.

get_child_property ()

gets a child property of a given child model, e.g. the "row" or "column" property of a model in a GooCanvasTableModel.

set_child_property ()

sets a child property for a given child model.

get_parent ()

gets the model's parent.

set_parent ()

sets the model's parent.

create_item ()

creates a default canvas item to view the model.

get_transform ()

gets the model's transformation matrix.

set_transform ()

sets the model's transformation matrix.

get_style ()

gets the model's style.

set_style ()

sets the model's style.

child_added ()

signal emitted when a child is added.

child_moved ()

signal emitted when a child is moved in the stacking order.

child_removed ()

signal emitted when a child is removed.

changed ()

signal emitted when the model has changed.

child_notify ()

signal emitted when a child property has changed.

animation_finished ()

signal emitted when the model's animation has finished.

goo_canvas_item_model_translate ()

void                goo_canvas_item_model_translate     (GooCanvasItemModel *model,
                                                         gdouble tx,
                                                         gdouble ty);

Translates the origin of the model's coordinate system by the given amounts.

model :

an item model.

tx :

the amount to move the origin in the horizontal direction.

ty :

the amount to move the origin in the vertical direction.

goo_canvas_item_model_scale ()

void                goo_canvas_item_model_scale         (GooCanvasItemModel *model,
                                                         gdouble sx,
                                                         gdouble sy);

Scales the model's coordinate system by the given amounts.

model :

an item model.

sx :

the amount to scale the horizontal axis.

sy :

the amount to scale the vertical axis.

goo_canvas_item_model_rotate ()

void                goo_canvas_item_model_rotate        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Rotates the model's coordinate system by the given amount, about the given origin.

model :

an item model.

degrees :

the clockwise angle of rotation.

cx :

the x coordinate of the origin of the rotation.

cy :

the y coordinate of the origin of the rotation.

goo_canvas_item_model_skew_x ()

void                goo_canvas_item_model_skew_x        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Skews the model's coordinate system along the x axis by the given amount, about the given origin.

model :

an item model.

degrees :

the skew angle.

cx :

the x coordinate of the origin of the skew transform.

cy :

the y coordinate of the origin of the skew transform.

goo_canvas_item_model_skew_y ()

void                goo_canvas_item_model_skew_y        (GooCanvasItemModel *model,
                                                         gdouble degrees,
                                                         gdouble cx,
                                                         gdouble cy);

Skews the model's coordinate system along the y axis by the given amount, about the given origin.

model :

an item model.

degrees :

the skew angle.

cx :

the x coordinate of the origin of the skew transform.

cy :

the y coordinate of the origin of the skew transform.

goo_canvas_item_model_get_transform ()

gboolean            goo_canvas_item_model_get_transform (GooCanvasItemModel *model,
                                                         cairo_matrix_t *transform);

Gets the transformation matrix of an item model.

model :

an item model.

transform :

the place to store the transform.

Returns :

TRUE if a transform is set.

goo_canvas_item_model_set_transform ()

void                goo_canvas_item_model_set_transform (GooCanvasItemModel *model,
                                                         const cairo_matrix_t *transform);

Sets the transformation matrix of an item model.

model :

an item model.

transform :

the new transformation matrix, or NULL to reset the transformation to the identity matrix.

goo_canvas_item_model_get_simple_transform ()

gboolean            goo_canvas_item_model_get_simple_transform
                                                        (GooCanvasItemModel *model,
                                                         gdouble *x,
                                                         gdouble *y,
                                                         gdouble *scale,
                                                         gdouble *rotation);

This function can be used to get the position, scale and rotation of an item model, providing that the model has a simple transformation matrix (e.g. set with goo_canvas_item_model_set_simple_transform(), or using a combination of simple translate, scale and rotate operations). If the model has a complex transformation matrix the results will be incorrect.

model :

an item model.

x :

returns the x coordinate of the origin of the model's coordinate space.

y :

returns the y coordinate of the origin of the model's coordinate space.

scale :

returns the scale of the model.

rotation :

returns the clockwise rotation of the model, in degrees (0-360).

Returns :

TRUE if a transform is set.

goo_canvas_item_model_set_simple_transform ()

void                goo_canvas_item_model_set_simple_transform
                                                        (GooCanvasItemModel *model,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble rotation);

A convenience function to set the item model's transformation matrix.

model :

an item model.

x :

the x coordinate of the origin of the model's coordinate space.

y :

the y coordinate of the origin of the model's coordinate space.

scale :

the scale of the model.

rotation :

the clockwise rotation of the model, in degrees.

goo_canvas_item_model_animate ()

void                goo_canvas_item_model_animate       (GooCanvasItemModel *model,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble scale,
                                                         gdouble degrees,
                                                         gboolean absolute,
                                                         gint duration,
                                                         gint step_time,
                                                         GooCanvasAnimateType type);

Animates a model from its current position to the given offsets, scale and rotation.

model :

an item model.

x :

the final x coordinate.

y :

the final y coordinate.

scale :

the final scale.

degrees :

the final rotation. This can be negative to rotate anticlockwise, and can also be greater than 360 to rotate a number of times.

absolute :

if the x, y, scale and degrees values are absolute, or relative to the current transform. Note that absolute animations only work if the model currently has a simple transform. If the model has a shear or some other complicated transform it may result in strange animations.

duration :

the duration of the animation, in milliseconds (1/1000ths of a second).

step_time :

the time between each animation step, in milliseconds.

type :

specifies what happens when the animation finishes.

goo_canvas_item_model_stop_animation ()

void                goo_canvas_item_model_stop_animation
                                                        (GooCanvasItemModel *model);

Stops any current animation for the given model, leaving it at its current position.

model :

an item model.

goo_canvas_item_model_raise ()

void                goo_canvas_item_model_raise         (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *above);

Raises a model in the stacking order.

model :

an item model.

above :

the item model to raise model above, or NULL to raise model to the top of the stack.

goo_canvas_item_model_lower ()

void                goo_canvas_item_model_lower         (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *below);

Lowers a model in the stacking order.

model :

an item model.

below :

the item model to lower model below, or NULL to lower model to the bottom of the stack.

goo_canvas_item_model_remove ()

void                goo_canvas_item_model_remove        (GooCanvasItemModel *model);

Removes a model from its parent. If the model is in a canvas it will be removed.

This would normally also result in the model being freed.

model :

an item model.

goo_canvas_item_model_get_parent ()

GooCanvasItemModel* goo_canvas_item_model_get_parent    (GooCanvasItemModel *model);

Gets the parent of the given model.

model :

an item model.

Returns :

the parent model, or NULL if the model has no parent.

goo_canvas_item_model_set_parent ()

void                goo_canvas_item_model_set_parent    (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *parent);

This function is only intended to be used when implementing new canvas item models (specifically container models such as GooCanvasGroupModel). It sets the parent of the child model.

model :

an item model.

parent :

the new parent item model.

Note

This function cannot be used to add a model to a group or to change the parent of a model. To do that use the "parent" property.


goo_canvas_item_model_is_container ()

gboolean            goo_canvas_item_model_is_container  (GooCanvasItemModel *model);

Tests to see if the given item model is a container.

model :

an item model.

Returns :

TRUE if the item model is a container.

goo_canvas_item_model_get_n_children ()

gint                goo_canvas_item_model_get_n_children
                                                        (GooCanvasItemModel *model);

Gets the number of children of the container.

model :

an item model.

Returns :

the number of children.

goo_canvas_item_model_get_child ()

GooCanvasItemModel* goo_canvas_item_model_get_child     (GooCanvasItemModel *model,
                                                         gint child_num);

Gets the child at the given stack position.

model :

an item model.

child_num :

the position of a child in the container's stack.

Returns :

the child at the given stack position, or NULL if child_num is out of range.

goo_canvas_item_model_add_child ()

void                goo_canvas_item_model_add_child     (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         gint position);

Adds a child at the given stack position.

model :

an item model.

child :

the child to add.

position :

the position of the child, or -1 to place it last (at the top of the stacking order).

goo_canvas_item_model_move_child ()

void                goo_canvas_item_model_move_child    (GooCanvasItemModel *model,
                                                         gint old_position,
                                                         gint new_position);

Moves a child to a new stack position.

model :

an item model.

old_position :

the current position of the child.

new_position :

the new position of the child.

goo_canvas_item_model_remove_child ()

void                goo_canvas_item_model_remove_child  (GooCanvasItemModel *model,
                                                         gint child_num);

Removes the child at the given position.

model :

an item model.

child_num :

the position of the child to remove.

goo_canvas_item_model_find_child ()

gint                goo_canvas_item_model_find_child    (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child);

Attempts to find the given child with the container's stack.

model :

an item model.

child :

the child to find.

Returns :

the position of the given child, or -1 if it isn't found.

goo_canvas_item_model_get_style ()

GooCanvasStyle*     goo_canvas_item_model_get_style     (GooCanvasItemModel *model);

Gets the model's style. If the model doesn't have its own style it will return its parent's style.

model :

an item model.

Returns :

the model's style.

goo_canvas_item_model_set_style ()

void                goo_canvas_item_model_set_style     (GooCanvasItemModel *model,
                                                         GooCanvasStyle *style);

Sets the model's style, by copying the properties from the given style.

model :

an item model.

style :

a style.

goo_canvas_item_model_class_install_child_property ()

void                goo_canvas_item_model_class_install_child_property
                                                        (GObjectClass *mclass,
                                                         guint property_id,
                                                         GParamSpec *pspec);

This function is only intended to be used when implementing new canvas item models, specifically layout container item models such as GooCanvasTableModel.

It installs a child property on a canvas item class.

mclass :

a GObjectClass

property_id :

the id for the property

pspec :

the GParamSpec for the property

goo_canvas_item_model_class_list_child_properties ()

GParamSpec**        goo_canvas_item_model_class_list_child_properties
                                                        (GObjectClass *mclass,
                                                         guint *n_properties);

This function is only intended to be used when implementing new canvas item models, specifically layout container item models such as GooCanvasTableModel.

It returns all child properties of a canvas item class.

mclass :

a GObjectClass

n_properties :

location to return the number of child properties found

Returns :

a newly allocated array of GParamSpec*. The array must be freed with g_free().

goo_canvas_item_model_class_find_child_property ()

GParamSpec*         goo_canvas_item_model_class_find_child_property
                                                        (GObjectClass *mclass,
                                                         const gchar *property_name);

This function is only intended to be used when implementing new canvas item models, specifically layout container item models such as GooCanvasTableModel.

It finds a child property of a canvas item class by name.

mclass :

a GObjectClass

property_name :

the name of the child property to find

Returns :

the GParamSpec of the child property or NULL if class has no child property with that name.

goo_canvas_item_model_get_child_property ()

void                goo_canvas_item_model_get_child_property
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         const gchar *property_name,
                                                         GValue *value);

Gets a child property of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

property_name :

the name of the child property to get.

value :

a location to return the value.

goo_canvas_item_model_set_child_property ()

void                goo_canvas_item_model_set_child_property
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         const gchar *property_name,
                                                         const GValue *value);

Sets a child property of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

property_name :

the name of the child property to set.

value :

the value to set the property to.

goo_canvas_item_model_get_child_properties ()

void                goo_canvas_item_model_get_child_properties
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         ...);

Gets the values of one or more child properties of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

... :

pairs of property names and value pointers, and a terminating NULL.

goo_canvas_item_model_get_child_properties_valist ()

void                goo_canvas_item_model_get_child_properties_valist
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         va_list var_args);

Gets the values of one or more child properties of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

var_args :

pairs of property names and value pointers, and a terminating NULL.

goo_canvas_item_model_set_child_properties ()

void                goo_canvas_item_model_set_child_properties
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         ...);

Sets the values of one or more child properties of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

... :

pairs of property names and values, and a terminating NULL.

goo_canvas_item_model_set_child_properties_valist ()

void                goo_canvas_item_model_set_child_properties_valist
                                                        (GooCanvasItemModel *model,
                                                         GooCanvasItemModel *child,
                                                         va_list var_args);

Sets the values of one or more child properties of child.

model :

a GooCanvasItemModel.

child :

a child GooCanvasItemModel.

var_args :

pairs of property names and values, and a terminating NULL.

Property Details

The "can-focus" property

  "can-focus"                gboolean              : Read / Write

If the item can take the keyboard focus.

Default value: FALSE


The "description" property

  "description"              gchararray            : Read / Write

A description of the item for use by assistive technologies.

Default value: NULL


The "parent" property

  "parent"                   GooCanvasItemModel    : Read / Write

The parent item model.


The "pointer-events" property

  "pointer-events"           GooCanvasPointerEvents  : Read / Write

Specifies when the item receives pointer events.

Default value: GOO_CANVAS_EVENTS_VISIBLE_MASK|GOO_CANVAS_EVENTS_PAINTED_MASK|GOO_CANVAS_EVENTS_FILL_MASK|GOO_CANVAS_EVENTS_STROKE_MASK


The "title" property

  "title"                    gchararray            : Read / Write

A short context-rich description of the item for use by assistive technologies.

Default value: NULL


The "tooltip" property

  "tooltip"                  gchararray            : Read / Write

The tooltip to display for the item.

Default value: NULL


The "transform" property

  "transform"                GooCairoMatrix        : Read / Write

The transformation matrix of the item.


The "visibility" property

  "visibility"               GooCanvasItemVisibility  : Read / Write

When the canvas item is visible.

Default value: GOO_CANVAS_ITEM_VISIBLE


The "visibility-threshold" property

  "visibility-threshold"     gdouble               : Read / Write

The scale threshold at which the item becomes visible.

Allowed values: >= 0

Default value: 0

Signal Details

The "animation-finished" signal

void                user_function                      (GooCanvasItemModel *item,
                                                        gboolean            stopped,
                                                        gpointer            user_data)      : Run Last

Emitted when the item model animation has finished.

item :

the item model that received the signal.

stopped :

if the animation was explicitly stopped.

user_data :

user data set when the signal handler was connected.

The "changed" signal

void                user_function                      (GooCanvasItemModel *model,
                                                        gboolean            recompute_bounds,
                                                        gpointer            user_data)             : Run Last

Emitted when the item model has been changed.

model :

the item model that received the signal.

recompute_bounds :

if the bounds of the item need to be recomputed.

user_data :

user data set when the signal handler was connected.

The "child-added" signal

void                user_function                      (GooCanvasItemModel *model,
                                                        gint                child_num,
                                                        gpointer            user_data)      : Run Last

Emitted when a child has been added.

model :

the item model that received the signal.

child_num :

the index of the new child.

user_data :

user data set when the signal handler was connected.

The "child-moved" signal

void                user_function                      (GooCanvasItemModel *model,
                                                        gint                old_child_num,
                                                        gint                new_child_num,
                                                        gpointer            user_data)          : Run Last

Emitted when a child has been moved in the stacking order.

model :

the item model that received the signal.

old_child_num :

the old index of the child.

new_child_num :

the new index of the child.

user_data :

user data set when the signal handler was connected.

The "child-notify" signal

void                user_function                      (GooCanvasItemModel *item,
                                                        GParamSpec         *pspec,
                                                        gpointer            user_data)      : Run First / No Recursion / Has Details / No Hooks

Emitted for each child property that has changed. The signal's detail holds the property name.

item :

the item model that received the signal.

pspec :

the GParamSpec of the changed child property.

user_data :

user data set when the signal handler was connected.

The "child-removed" signal

void                user_function                      (GooCanvasItemModel *model,
                                                        gint                child_num,
                                                        gpointer            user_data)      : Run Last

Emitted when a child has been removed.

model :

the item model that received the signal.

child_num :

the index of the child that was removed.

user_data :

user data set when the signal handler was connected.

goocanvas-0.15/docs/html/GooCanvasGroup.html0000644000076400007640000002715711222215706016041 00000000000000 GooCanvasGroup

GooCanvasGroup

GooCanvasGroup — a group of items.

Object Hierarchy


  GObject
   +----GooCanvasItemSimple
         +----GooCanvasGroup
               +----GooCanvasTable

Implemented Interfaces

GooCanvasGroup implements GooCanvasItem.

Properties


  "height"                   gdouble               : Read / Write
  "width"                    gdouble               : Read / Write
  "x"                        gdouble               : Read / Write
  "y"                        gdouble               : Read / Write

Description

GooCanvasGroup represents a group of items. Groups can be nested to any depth, to create a hierarchy of items. Items are ordered within each group, with later items being displayed above earlier items.

GooCanvasGroup is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasGroup will affect all children of the GooCanvasGroup (unless the children override the property setting).

GooCanvasGroup implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(), and the properties such as "visibility" and "pointer-events".

If the "width" and "height" properties are set to positive values then the group is clipped to the given size.

To create a GooCanvasGroup use goo_canvas_group_new().

To get or set the properties of an existing GooCanvasGroup, use g_object_get() and g_object_set().

Details

GooCanvasGroup

typedef struct _GooCanvasGroup GooCanvasGroup;

The GooCanvasGroup struct contains private data only.


goo_canvas_group_new ()

GooCanvasItem*      goo_canvas_group_new                (GooCanvasItem *parent,
                                                         ...);

Creates a new group item.

parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new group item.

Property Details

The "height" property

  "height"                   gdouble               : Read / Write

The height of the group, or -1 to use the default height.

Default value: -1


The "width" property

  "width"                    gdouble               : Read / Write

The width of the group, or -1 to use the default width.

Default value: -1


The "x" property

  "x"                        gdouble               : Read / Write

The x coordinate of the group.

Default value: 0


The "y" property

  "y"                        gdouble               : Read / Write

The y coordinate of the group.

Default value: 0


goocanvas-0.15/docs/html/goocanvas-GooCanvas-Types.html0000644000076400007640000011762711222215706020106 00000000000000 GooCanvas Types

GooCanvas Types

GooCanvas Types — types used in GooCanvas.

Description

This section describes the types used throughout GooCanvas.

Details

GooCanvasBounds

typedef struct {
  gdouble x1, y1, x2, y2;
} GooCanvasBounds;

GooCanvasBounds represents the bounding box of an item in the canvas.

gdouble x1;

the left edge.

gdouble y1;

the top edge.

gdouble x2;

the right edge.

gdouble y2;

the bottom edge.

enum GooCanvasItemVisibility

typedef enum
{
  GOO_CANVAS_ITEM_HIDDEN			= 0,
  GOO_CANVAS_ITEM_INVISIBLE			= 1,
  GOO_CANVAS_ITEM_VISIBLE			= 2,
  GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD	= 3
} GooCanvasItemVisibility;

The GooCanvasItemVisibility enumeration is used to specify when a canvas item is visible.

GOO_CANVAS_ITEM_HIDDEN

the item is invisible, and is not allocated any space in layout container items such as GooCanvasTable.

GOO_CANVAS_ITEM_INVISIBLE

the item is invisible, but it is still allocated space in layout container items.

GOO_CANVAS_ITEM_VISIBLE

the item is visible.

GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD

the item is visible when the canvas scale setting is greater than or equal to the item's visibility threshold setting.

enum GooCanvasPointerEvents

typedef enum
{
  GOO_CANVAS_EVENTS_VISIBLE_MASK	= 1 << 0,
  GOO_CANVAS_EVENTS_PAINTED_MASK	= 1 << 1,
  GOO_CANVAS_EVENTS_FILL_MASK		= 1 << 2,
  GOO_CANVAS_EVENTS_STROKE_MASK		= 1 << 3,

  GOO_CANVAS_EVENTS_NONE		= 0,
  GOO_CANVAS_EVENTS_VISIBLE_PAINTED	= GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_VISIBLE_FILL	= GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK,
  GOO_CANVAS_EVENTS_VISIBLE_STROKE	= GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_VISIBLE		= GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_PAINTED		= GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_FILL		= GOO_CANVAS_EVENTS_FILL_MASK,
  GOO_CANVAS_EVENTS_STROKE		= GOO_CANVAS_EVENTS_STROKE_MASK,
  GOO_CANVAS_EVENTS_ALL			= GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK
} GooCanvasPointerEvents;

Specifies when an item receives pointer events such as mouse clicks.

GOO_CANVAS_EVENTS_VISIBLE_MASK

a mask indicating that the item only receives events when it is visible.

GOO_CANVAS_EVENTS_PAINTED_MASK

a mask indicating that the item only receives events when the specified parts of it are painted.

GOO_CANVAS_EVENTS_FILL_MASK

a mask indicating that the filled part of the item receives events.

GOO_CANVAS_EVENTS_STROKE_MASK

a mask indicating that the stroked part of the item receives events.

GOO_CANVAS_EVENTS_NONE

the item doesn't receive events at all.

GOO_CANVAS_EVENTS_VISIBLE_PAINTED

the item receives events in its painted areas when it is visible (the default).

GOO_CANVAS_EVENTS_VISIBLE_FILL

the item's interior receives events when it is visible.

GOO_CANVAS_EVENTS_VISIBLE_STROKE

the item's perimeter receives events when it is visible.

GOO_CANVAS_EVENTS_VISIBLE

the item receives events when it is visible, whether it is painted or not.

GOO_CANVAS_EVENTS_PAINTED

the item receives events in its painted areas, whether it is visible or not.

GOO_CANVAS_EVENTS_FILL

the item's interior receives events, whether it is visible or painted or not.

GOO_CANVAS_EVENTS_STROKE

the item's perimeter receives events, whether it is visible or painted or not.

GOO_CANVAS_EVENTS_ALL

the item's perimeter and interior receive events, whether it is visible or painted or not.

enum GooCanvasAnimateType

typedef enum
{
  GOO_CANVAS_ANIMATE_FREEZE,
  GOO_CANVAS_ANIMATE_RESET,
  GOO_CANVAS_ANIMATE_RESTART,
  GOO_CANVAS_ANIMATE_BOUNCE
} GooCanvasAnimateType;

GooCanvasAnimateType is used to specify what happens when the end of an animation is reached.

GOO_CANVAS_ANIMATE_FREEZE

the item remains in the final position.

GOO_CANVAS_ANIMATE_RESET

the item is moved back to the initial position.

GOO_CANVAS_ANIMATE_RESTART

the animation is restarted from the initial position.

GOO_CANVAS_ANIMATE_BOUNCE

the animation bounces back and forth between the start and end positions.

GooCanvasPoints

typedef struct {
  double *coords;
  int num_points;
  int ref_count;
} GooCanvasPoints;

GooCairoPoints represents an array of points.

double *coords;

the coordinates of the points, in pairs.

int num_points;

the number of points.

int ref_count;

the reference count of the struct.

goo_canvas_points_new ()

GooCanvasPoints*    goo_canvas_points_new               (int num_points);

Creates a new GooCanvasPoints struct with space for the given number of points. It should be freed with goo_canvas_points_unref().

num_points :

the number of points to create space for.

Returns :

a new GooCanvasPoints struct.

goo_canvas_points_ref ()

GooCanvasPoints*    goo_canvas_points_ref               (GooCanvasPoints *points);

Increments the reference count of the given GooCanvasPoints struct.

points :

a GooCanvasPoints struct.

Returns :

the GooCanvasPoints struct.

goo_canvas_points_unref ()

void                goo_canvas_points_unref             (GooCanvasPoints *points);

Decrements the reference count of the given GooCanvasPoints struct, freeing it if the reference count falls to zero.

points :

a GooCanvasPoints struct.

GooCanvasLineDash

typedef struct {
  int ref_count;
  int num_dashes;
  double *dashes;
  double dash_offset;
} GooCanvasLineDash;

GooCanvasLineDash specifies a dash pattern to be used when drawing items.

int ref_count;

the reference count of the struct.

int num_dashes;

the number of dashes and gaps between them.

double *dashes;

the sizes of each dash and gap.

double dash_offset;

the start offset into the dash pattern.

goo_canvas_line_dash_new ()

GooCanvasLineDash*  goo_canvas_line_dash_new            (gint num_dashes,
                                                         ...);

Creates a new dash pattern.

num_dashes :

the number of dashes and gaps in the pattern.

... :

the length of each dash and gap.

Returns :

a new dash pattern.

goo_canvas_line_dash_newv ()

GooCanvasLineDash*  goo_canvas_line_dash_newv           (gint num_dashes,
                                                         double *dashes);

Creates a new dash pattern. Takes ownership of the dashes vector.

num_dashes :

the number of dashes and gaps in the pattern.

dashes :

a g_new-allocated vector of doubles, the length of each dash and gap.

Returns :

a new dash pattern.

goo_canvas_line_dash_ref ()

GooCanvasLineDash*  goo_canvas_line_dash_ref            (GooCanvasLineDash *dash);

Increments the reference count of the dash pattern.

dash :

a GooCanvasLineDash.

Returns :

the dash pattern.

goo_canvas_line_dash_unref ()

void                goo_canvas_line_dash_unref          (GooCanvasLineDash *dash);

Decrements the reference count of the dash pattern. If it falls to 0 it is freed.

dash :

a GooCanvasLineDash.

enum GooCanvasPathCommandType

typedef enum
{
  /* Simple commands like moveto and lineto: MmZzLlHhVv. */
  GOO_CANVAS_PATH_MOVE_TO,
  GOO_CANVAS_PATH_CLOSE_PATH,
  GOO_CANVAS_PATH_LINE_TO,
  GOO_CANVAS_PATH_HORIZONTAL_LINE_TO,
  GOO_CANVAS_PATH_VERTICAL_LINE_TO,

  /* Bezier curve commands: CcSsQqTt. */
  GOO_CANVAS_PATH_CURVE_TO,
  GOO_CANVAS_PATH_SMOOTH_CURVE_TO,
  GOO_CANVAS_PATH_QUADRATIC_CURVE_TO,
  GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO,

  /* The elliptical arc commands: Aa. */
  GOO_CANVAS_PATH_ELLIPTICAL_ARC
} GooCanvasPathCommandType;

GooCanvasPathCommandType specifies the type of each command in the path. See the path element in the Scalable Vector Graphics (SVG) specification for more details.

GOO_CANVAS_PATH_MOVE_TO

move to the given point.

GOO_CANVAS_PATH_CLOSE_PATH

close the current path, drawing a line from the current position to the start of the path.

GOO_CANVAS_PATH_LINE_TO

draw a line to the given point.

GOO_CANVAS_PATH_HORIZONTAL_LINE_TO

draw a horizontal line to the given x coordinate.

GOO_CANVAS_PATH_VERTICAL_LINE_TO

draw a vertical line to the given y coordinate.

GOO_CANVAS_PATH_CURVE_TO

draw a bezier curve using two control points to the given point.

GOO_CANVAS_PATH_SMOOTH_CURVE_TO

draw a bezier curve using a reflection of the last control point of the last curve as the first control point, and one new control point, to the given point.

GOO_CANVAS_PATH_QUADRATIC_CURVE_TO

draw a quadratic bezier curve using a single control point to the given point.

GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO

draw a quadratic bezier curve using a reflection of the control point from the previous curve as the control point, to the given point.

GOO_CANVAS_PATH_ELLIPTICAL_ARC

draw an elliptical arc, using the given 2 radii, the x axis rotation, and the 2 flags to disambiguate the arc, to the given point.

union GooCanvasPathCommand

union GooCanvasPathCommand
{
  /* Simple commands like moveto and lineto: MmZzLlHhVv. */
  struct {
    guint type : 5; /* GooCanvasPathCommandType */
    guint relative : 1;
    gdouble x, y;
  } simple;

  /* Bezier curve commands: CcSsQqTt. */
  struct {
    guint type : 5; /* GooCanvasPathCommandType */
    guint relative : 1;
    gdouble x, y, x1, y1, x2, y2;
  } curve;

  /* The elliptical arc commands: Aa. */
  struct {
    guint type : 5; /* GooCanvasPathCommandType */
    guint relative : 1;
    guint large_arc_flag : 1;
    guint sweep_flag : 1;
    gdouble rx, ry, x_axis_rotation, x, y;
  } arc;
};

GooCanvasPathCommand holds the data for each command in the path.

The relative flag specifies that the coordinates for the command are relative to the current point. Otherwise they are assumed to be absolute coordinates.


goo_canvas_parse_path_data ()

GArray*             goo_canvas_parse_path_data          (const gchar *path_data);

Parses the given SVG path specification string.

path_data :

the sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element.

Returns :

a GArray of GooCanvasPathCommand elements.

goo_canvas_create_path ()

void                goo_canvas_create_path              (GArray *commands,
                                                         cairo_t *cr);

Creates the path specified by the given GooCanvasPathCommand array.

commands :

an array of GooCanvasPathCommand.

cr :

a cairo context.

GooCairoAntialias

typedef cairo_antialias_t	GooCairoAntialias;

GooCairoAntialias is simply a wrapper for the cairo_antialias_t type, allowing it to be used for GObject properties.

See the cairo_antialias_t documentation.


GooCairoFillRule

typedef cairo_fill_rule_t	GooCairoFillRule;

GooCairoFillRule is simply a wrapper for the cairo_fill_rule_t type, allowing it to be used for GObject properties.

See the cairo_fill_rule_t documentation.


GooCairoHintMetrics

typedef cairo_hint_metrics_t	GooCairoHintMetrics;

GooCairoHintMetrics is simply a wrapper for the cairo_hint_metrics_t type, allowing it to be used for GObject properties.

See the cairo_hint_metrics_t documentation.


GooCairoLineCap

typedef cairo_line_cap_t	GooCairoLineCap;

GooCairoLineCap is simply a wrapper for the cairo_line_cap_t type, allowing it to be used for GObject properties.

See the cairo_line_cap_t documentation.


GooCairoLineJoin

typedef cairo_line_join_t	GooCairoLineJoin;

GooCairoLineJoin is simply a wrapper for the cairo_line_join_t type, allowing it to be used for GObject properties.

See the cairo_line_join_t documentation.


GooCairoOperator

typedef cairo_operator_t	GooCairoOperator;

GooCairoOperator is simply a wrapper for the cairo_operator_t type, allowing it to be used for GObject properties.

See the cairo_operator_t documentation.


GooCairoMatrix

typedef cairo_matrix_t		GooCairoMatrix;

GooCairoMatrix is simply a wrapper for the cairo_matrix_t type, allowing it to be used for GObject properties.

See the cairo_matrix_t documentation.


GooCairoPattern

typedef cairo_pattern_t		GooCairoPattern;

GooCairoPattern is simply a wrapper for the cairo_pattern_t type, allowing it to be used for GObject properties.

See the cairo_pattern_t documentation.


goocanvas-0.15/docs/goocanvas.types0000644000076400007640000000233711222215703014346 00000000000000goo_canvas_line_dash_get_type goo_cairo_matrix_get_type goo_cairo_pattern_get_type goo_cairo_fill_rule_get_type goo_cairo_operator_get_type goo_cairo_antialias_get_type goo_cairo_line_cap_get_type goo_cairo_line_join_get_type goo_canvas_widget_get_type goo_canvas_rect_get_type goo_canvas_rect_model_get_type goo_canvas_item_get_type goo_canvas_animate_type_get_type goo_canvas_path_command_type_get_type goo_canvas_pointer_events_get_type goo_canvas_item_visibility_get_type goo_canvas_item_model_get_type goo_canvas_group_get_type goo_canvas_group_model_get_type goo_canvas_path_get_type goo_canvas_path_model_get_type goo_canvas_accessible_factory_get_type goo_canvas_item_accessible_factory_get_type goo_canvas_widget_accessible_factory_get_type goo_canvas_ellipse_get_type goo_canvas_ellipse_model_get_type goo_canvas_style_get_type goo_canvas_get_type goo_canvas_text_get_type goo_canvas_text_model_get_type goo_canvas_points_get_type goo_canvas_polyline_get_type goo_canvas_polyline_model_get_type goo_canvas_item_simple_get_type goo_canvas_item_model_simple_get_type goo_canvas_image_get_type goo_canvas_image_model_get_type goo_canvas_table_get_type goo_canvas_table_model_get_type goo_canvas_grid_get_type goo_canvas_grid_model_get_type goocanvas-0.15/docs/Makefile.am0000644000076400007640000000572711172574677013370 00000000000000## Process this file with automake to produce Makefile.in # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE=goocanvas # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR=../src # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS=--query-child-properties=goo_canvas_query_child_properties # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS= # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS=--sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS= # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS= # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB=$(top_srcdir)/src/*.h CFILE_GLOB=$(top_srcdir)/src/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES=goocanvasmarshal.h goocanvasprivate.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES= # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files= \ overview.xml \ simple-canvas.xml \ model-view-canvas.xml \ wysiwyg.xml \ architecture.xml \ coordinates.xml \ creating-items.xml # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files= $(expand_content_files) # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) INCLUDES=-I$(top_srcdir)/src -I$(top_builddir)/src @PACKAGE_CFLAGS@ GTKDOC_LIBS=@PACKAGE_LIBS@ $(top_builddir)/src/libgoocanvas.la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST += goocanvas-0.15/docs/creating-items.xml0000644000076400007640000003024111172574677014756 00000000000000 Creating New Items 3 GOOCANVAS Library Creating New Items how to create new canvas items. How to Create New Canvas Items There are 3 ways to create new canvas items, listed here in increasing order of complexity: Creating a simple subclass of GooCanvasItemSimple. Creating a regular subclass of GooCanvasItemSimple. Implementing the GooCanvasItem interface. These will be discussed in turn below. (It is also possible to create new container items by subclassing #GooCanvasGroup, but that is not covered here.) The final part of this section covers creating item models. Creating a Simple Subclass of GooCanvasItemSimple For items that consist of a simple graphic element such as a line, rectangle or circle, it is possible to create a subclass of #GooCanvasItemSimple and override just one method, simple_create_path(). (This method is used for the #GooCanvasEllipse and #GooCanvasPath items.) The simple_create_path() method should create a path using the given cairo context. The path will be drawn using the stroke, fill and other painting properties from #GooCanvasItemSimple. This example shows the simple_create_path() method for a simple rectangular item, MyItem: static void my_item_simple_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { MyItem *item = (MyItem*) simple; cairo_rectangle (cr, item->x, item->y, item->width, item->height); } Whenever the item is changed in some way it should call goo_canvas_item_simple_changed(), passing a boolean value indicating whether the item's bounds need to be recalculated or if it only needs to be repainted. The #GooCanvasItemSimple code will take care of updating the item and repainting the appropriate parts of the canvas. Creating a Regular Subclass of GooCanvasItemSimple Most items will need more than a simple line or rectangle, so they will need to create a subclass of #GooCanvasItemSimple and override three methods, simple_update(), simple_paint() and simple_is_item_at(). The simple_update() method should compute the bounds of the item, in the item's coordinate space, and place them in the bounds member of #GooCanvasItemSimple-struct. Note that the cairo context passed to this function may have transformations applied to it, so cairo_identity_matrix() should be called before using it. The simple_paint() method should paint the item using the given cairo context. To use the stroke and fill properties from #GooCanvasItemSimple to paint parts of the item call goo_canvas_style_set_stroke_options() and goo_canvas_style_set_fill_options() before calling cairo_stroke() and cairo_fill(). (The item's style can be found in GOO_CANVAS_ITEM_SIMPLE (item)->simple_data->style). The simple_is_item_at() method should return %TRUE if the given coordinate (in the item's coordinate space) is inside the item. (The is_pointer_event argument can be ignored for most purposes since the #GooCanvasItemSimple code will take care of it.) This example code shows the simple_update(), simple_paint() and simple_is_item_at() methods for a rectangular item (the complete item's source code can be found in the GooCanvas demo directory, in demo-item.h and demo-item.c): static void goo_demo_item_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooDemoItem *demo_item = (GooDemoItem*) simple; /* Compute the new bounds. */ simple->bounds.x1 = demo_item->x; simple->bounds.y1 = demo_item->y; simple->bounds.x2 = demo_item->x + demo_item->width; simple->bounds.y2 = demo_item->y + demo_item->height; } static void goo_demo_item_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooDemoItem *demo_item = (GooDemoItem*) simple; cairo_move_to (cr, demo_item->x, demo_item->y); cairo_line_to (cr, demo_item->x, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y); cairo_close_path (cr); goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_fill (cr); } static gboolean goo_demo_item_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooDemoItem *demo_item = (GooDemoItem*) simple; if (x < demo_item->x || (x > demo_item->x + demo_item->width) || y < demo_item->y || (y > demo_item->y + demo_item->height)) return FALSE; return TRUE; } As with the simple #GooCanvasItemSimple subclass, the item should call goo_canvas_item_simple_changed() whenever it is changed, to ensure that the item's bounds are recomputed and it is repainted if necessary. Implementing the GooCanvasItem Interface The most complicated way to create new canvas items is to implement the #GooCanvasItem interface directly. This should not be needed in most cases, but may be desired if the developer wants to avoid the memory and processor overheads associated with the #GooCanvasItemSimple class, or if the developer wants to turn an existing application object into a canvas item. At a minimum the canvas item must implement these 6 methods: get_parent() - the item's parent should be returned. set_parent() - the item's parent should be stored (though it should not add a reference to the parent). get_bounds() - returns the bounds of the item, in canvas space. The item should ensure that the bounds are up-to-date before returning them, calling goo_canvas_item_ensure_updated() if necessary. update() - if the item has been changed since the last update, or if the entire_tree flag is %TRUE, the item's bounds should be recomputed (in canvas space). It should also request a redraw of the old bounds and the new bounds, so the display is updated appropriately. The new bounds should be returned in the bounds argument. paint() - if the item's bounds intersect the given bounds then the item should be painted on the given cairo context. The scale parameter is only used to check if the item should be visible, according to the item's #GooCanvasItem:visibility and #GooCanvasItem:visibility-threshold property settings. get_items_at() - if the given point is inside the item then a pointer to the item should be added to the start of the list of found items. The list is then returned. The canvas item must also implement the #GooCanvasItem:parent, #GooCanvasItem:title, #GooCanvasItem:description, #GooCanvasItem:visibility, #GooCanvasItem:visibility-threshold, #GooCanvasItem:transform and #GooCanvasItem:pointer-events properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.) If the canvas item will be used within a container that does item layout, such as #GooCanvasTable, it must implement the first two methods here at least: get_requested_area() - returns the requested area of the item, in the parent's coordinate space. allocate_area() - allocates the item's area, in the parent's coordinate space. get_requested_height() - returns the requested height of the item, given a particular allocated width, in the parent's coordinate space. (This only needed for items that change height as their width is changed, such as text items.) If the canvas item supports a transformation matrix it must implement: get_transform() - returns the item's transformation matrix. set_transform() - sets the item's transformation matrix. If the canvas item supports a #GooCanvasStyle setting, it must implement: get_style() - returns the item's style. set_style() - sets the item's style. Since #GooCanvasItemSimple implements most of the above methods and properties its source code is a good place to look for help. Creating Item Models As with creating canvas items, to create item models it is possible to subclass #GooCanvasItemModelSimple or to implement the #GooCanvasItemModel interface directly. Subclassing #GooCanvasItemModelSimple is very easy, since only one method from the #GooCanvasItemModel interface must be implemented - create_item(). This should return a new canvas item for viewing the item model in a canvas. (It may be called multiple times if multiple canvases are viewing the same canvas model.) The #GooCanvasItemModelSimple subclass should emit the "changed" signal whenever it has changed, with a boolean flag indicating if the bounds need to be recomputed. The canvas items will connect to this signal and request an update or a redraw as appropriate. To implement the #GooCanvasItemModel interface directly, the class must implement the get_parent(), set_parent() and create_item() methods. It may also implement get_transform(), set_transform(), get_style() and set_style() methods if desired. The class must also implement the #GooCanvasItemModel:parent, #GooCanvasItemModel:title, #GooCanvasItemModel:description, #GooCanvasItemModel:can-focus, #GooCanvasItemModel:visibility, #GooCanvasItemModel:visibility-threshold, #GooCanvasItemModel:transform and #GooCanvasItemModel:pointer-events properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.) goocanvas-0.15/docs/tmpl/0000777000076400007640000000000011222215703012333 500000000000000goocanvas-0.15/docs/tmpl/goocanvasellipse.sgml0000644000076400007640000000176111222215703016476 00000000000000 GooCanvasEllipse @parent: @center_x: @center_y: @radius_x: @radius_y: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/dummy.sgml0000644000076400007640000000000011222215703014254 00000000000000goocanvas-0.15/docs/tmpl/goocanvasimage.sgml0000644000076400007640000000157611222215703016127 00000000000000 GooCanvasImage @parent: @pixbuf: @x: @y: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvasitemsimple.sgml0000644000076400007640000000645111222215703017212 00000000000000 GooCanvasItemSimple @canvas: @parent: @model: @simple_data: @bounds: @need_update: @need_entire_subtree_update: @style: @transform: @clip_path_commands: @tooltip: @visibility_threshold: @visibility: @pointer_events: @can_focus: @own_style: @clip_fill_rule: @is_static: @simple_create_path: @simple_update: @simple_paint: @simple_is_item_at: @item: @item: @Returns: @item: @cr: @bounds: @item: @cr: @bounds: @item: @cr: @bounds: @item: @x: @y: @cr: @pointer_events: @Returns: @item: @cr: @item: @recompute_bounds: @item: @model: goocanvas-0.15/docs/tmpl/goocanvasstyle.sgml0000644000076400007640000000423511222215703016200 00000000000000 GooCanvasStyle @parent: @properties: @id: @value: @Returns: @style: @Returns: @style: @Returns: @style: @parent: @style: @property_id: @Returns: @style: @property_id: @value: @style: @cr: @Returns: @style: @cr: @Returns: goocanvas-0.15/docs/tmpl/goocanvaswidget.sgml0000644000076400007640000000152311222215703016320 00000000000000 GooCanvasWidget @parent: @widget: @x: @y: @width: @height: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvaspath.sgml0000644000076400007640000000134611222215703015774 00000000000000 GooCanvasPath @parent: @path_data: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvasitem.sgml0000644000076400007640000002242411222215703015776 00000000000000 goocanvasitem @goocanvasitem: the object which received the signal. @arg1: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @goocanvasitem: the object which received the signal. @arg1: @arg2: @arg3: @arg4: @Returns: @goocanvasitem: the object which received the signal. @arg1: @event: @Returns: @get_canvas: @set_canvas: @get_n_children: @get_child: @request_update: @add_child: @move_child: @remove_child: @get_child_property: @set_child_property: @get_transform_for_child: @get_parent: @set_parent: @get_bounds: @get_items_at: @update: @paint: @get_requested_area: @allocate_area: @get_transform: @set_transform: @get_style: @set_style: @is_visible: @get_requested_height: @get_model: @set_model: @enter_notify_event: @leave_notify_event: @motion_notify_event: @button_press_event: @button_release_event: @focus_in_event: @focus_out_event: @key_press_event: @key_release_event: @grab_broken_event: @child_notify: @query_tooltip: @get_is_static: @set_is_static: @animation_finished: @scroll_event: @item: @tx: @ty: @item: @sx: @sy: @item: @degrees: @cx: @cy: @item: @degrees: @cx: @cy: @item: @degrees: @cx: @cy: @item: @transform: @Returns: @item: @transform: @item: @x: @y: @scale: @rotation: @Returns: @item: @x: @y: @scale: @rotation: @item: @bounds: @item: @Returns: @item: @Returns: @item: @is_static: @item: @x: @y: @scale: @degrees: @absolute: @duration: @step_time: @type: @item: @item: @above: @item: @below: @item: @item: @Returns: @item: @canvas: @item: @Returns: @item: @parent: @item: @Returns: @item: @model: @item: @Returns: @item: @Returns: @item: @child_num: @Returns: @item: @child: @Returns: @item: @child: @position: @item: @old_position: @new_position: @item: @child_num: @item: @child: @transform: @Returns: @item: @Returns: @item: @style: @item: @item: @item: @entire_tree: @cr: @bounds: @item: @cr: @requested_area: @Returns: @item: @cr: @width: @Returns: @item: @cr: @requested_area: @allocated_area: @x_offset: @y_offset: @item: @x: @y: @cr: @is_pointer_event: @parent_is_visible: @found_items: @Returns: @item: @cr: @bounds: @scale: @iclass: @property_id: @pspec: @iclass: @n_properties: @Returns: @iclass: @property_name: @Returns: @item: @child: @property_name: @value: @item: @child: @property_name: @value: @item: @child: @Varargs: @item: @child: @var_args: @item: @child: @Varargs: @item: @child: @var_args: goocanvas-0.15/docs/tmpl/goocanvastext.sgml0000644000076400007640000000227411222215703016025 00000000000000 GooCanvasText @parent: @string: @x: @y: @width: @anchor: @Varargs: @Returns: @text: @ink_rect: @logical_rect: goocanvas-0.15/docs/tmpl/goocanvasgroupmodel.sgml0000644000076400007640000000130711222215703017212 00000000000000 GooCanvasGroupModel @parent: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvas-unused.sgml0000644000076400007640000000000011222215703016402 00000000000000goocanvas-0.15/docs/tmpl/goocanvas.sgml0000644000076400007640000001350011222215703015112 00000000000000 GooCanvas @goocanvas: the object which received the signal. @arg1: @arg2: @goocanvas: the object which received the signal. @arg1: @arg2: @create_item: @item_created: @Returns: @canvas: @Returns: @canvas: @item: @canvas: @Returns: @canvas: @model: @canvas: @Returns: @canvas: @item: @canvas: @Returns: @canvas: @model: @canvas: @left: @top: @right: @bottom: @canvas: @left: @top: @right: @bottom: @canvas: @Returns: @canvas: @scale: @canvas: @model: @Returns: @canvas: @x: @y: @is_pointer_event: @Returns: @canvas: @x: @y: @is_pointer_event: @Returns: @canvas: @area: @inside_area: @allow_overlaps: @include_containers: @Returns: @canvas: @left: @top: @canvas: @cr: @bounds: @scale: @canvas: @x: @y: @canvas: @x: @y: @canvas: @item: @x: @y: @canvas: @item: @x: @y: @canvas: @item: @bounds: @canvas: @item: @event_mask: @cursor: @time: @Returns: @canvas: @item: @time: @canvas: @item: @canvas: @item: @owner_events: @time: @Returns: @canvas: @item: @time: @canvas: @Returns: @canvas: @model: @Returns: @canvas: @model: @canvas: @witem: @canvas: @witem: @canvas: @canvas: @canvas: @bounds: @canvas: @bounds: @is_static: @canvas: @Returns: goocanvas-0.15/docs/tmpl/goocanvasitemmodelsimple.sgml0000644000076400007640000000376411222215703020237 00000000000000 GooCanvasItemModelSimple @parent: @simple_data: goocanvas-0.15/docs/tmpl/goocanvasellipsemodel.sgml0000644000076400007640000000205111222215703017510 00000000000000 GooCanvasEllipseModel @parent: @center_x: @center_y: @radius_x: @radius_y: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvastextmodel.sgml0000644000076400007640000000220511222215703017040 00000000000000 GooCanvasTextModel @parent: @string: @x: @y: @width: @anchor: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvasitemmodel.sgml0000644000076400007640000001403411222215703017015 00000000000000 goocanvasitemmodel @goocanvasitemmodel: the object which received the signal. @arg1: @goocanvasitemmodel: the object which received the signal. @arg1: @goocanvasitemmodel: the object which received the signal. @arg1: @goocanvasitemmodel: the object which received the signal. @arg1: @arg2: @goocanvasitemmodel: the object which received the signal. @arg1: @goocanvasitemmodel: the object which received the signal. @arg1: @get_n_children: @get_child: @add_child: @move_child: @remove_child: @get_child_property: @set_child_property: @get_parent: @set_parent: @create_item: @get_transform: @set_transform: @get_style: @set_style: @child_added: @child_moved: @child_removed: @changed: @child_notify: @animation_finished: @model: @tx: @ty: @model: @sx: @sy: @model: @degrees: @cx: @cy: @model: @degrees: @cx: @cy: @model: @degrees: @cx: @cy: @model: @transform: @Returns: @model: @transform: @model: @x: @y: @scale: @rotation: @Returns: @model: @x: @y: @scale: @rotation: @model: @x: @y: @scale: @degrees: @absolute: @duration: @step_time: @type: @model: @model: @above: @model: @below: @model: @model: @Returns: @model: @parent: @model: @Returns: @model: @Returns: @model: @child_num: @Returns: @model: @child: @position: @model: @old_position: @new_position: @model: @child_num: @model: @child: @Returns: @model: @Returns: @model: @style: @mclass: @property_id: @pspec: @mclass: @n_properties: @Returns: @mclass: @property_name: @Returns: @model: @child: @property_name: @value: @model: @child: @property_name: @value: @model: @child: @Varargs: @model: @child: @var_args: @model: @child: @Varargs: @model: @child: @var_args: goocanvas-0.15/docs/tmpl/goocanvasutils.sgml0000644000076400007640000000626711222215703016207 00000000000000 GooCanvas Types @x1: @y1: @x2: @y2: @GOO_CANVAS_ITEM_HIDDEN: @GOO_CANVAS_ITEM_INVISIBLE: @GOO_CANVAS_ITEM_VISIBLE: @GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD: @GOO_CANVAS_EVENTS_VISIBLE_MASK: @GOO_CANVAS_EVENTS_PAINTED_MASK: @GOO_CANVAS_EVENTS_FILL_MASK: @GOO_CANVAS_EVENTS_STROKE_MASK: @GOO_CANVAS_EVENTS_NONE: @GOO_CANVAS_EVENTS_VISIBLE_PAINTED: @GOO_CANVAS_EVENTS_VISIBLE_FILL: @GOO_CANVAS_EVENTS_VISIBLE_STROKE: @GOO_CANVAS_EVENTS_VISIBLE: @GOO_CANVAS_EVENTS_PAINTED: @GOO_CANVAS_EVENTS_FILL: @GOO_CANVAS_EVENTS_STROKE: @GOO_CANVAS_EVENTS_ALL: @GOO_CANVAS_ANIMATE_FREEZE: @GOO_CANVAS_ANIMATE_RESET: @GOO_CANVAS_ANIMATE_RESTART: @GOO_CANVAS_ANIMATE_BOUNCE: @coords: @num_points: @ref_count: @num_points: @Returns: @points: @Returns: @points: @ref_count: @num_dashes: @dashes: @dash_offset: @num_dashes: @Varargs: @Returns: @num_dashes: @dashes: @Returns: @dash: @Returns: @dash: @GOO_CANVAS_PATH_MOVE_TO: @GOO_CANVAS_PATH_CLOSE_PATH: @GOO_CANVAS_PATH_LINE_TO: @GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: @GOO_CANVAS_PATH_VERTICAL_LINE_TO: @GOO_CANVAS_PATH_CURVE_TO: @GOO_CANVAS_PATH_SMOOTH_CURVE_TO: @GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: @GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: @GOO_CANVAS_PATH_ELLIPTICAL_ARC: @path_data: @Returns: @commands: @cr: goocanvas-0.15/docs/tmpl/goocanvasrect.sgml0000644000076400007640000000147311222215703015776 00000000000000 GooCanvasRect @parent: @x: @y: @width: @height: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvasgrid.sgml0000644000076400007640000000450111222215703015761 00000000000000 GooCanvasGrid @parent: @x: @y: @width: @height: @x_step: @y_step: @x_offset: @y_offset: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvaspolyline.sgml0000644000076400007640000000252011222215703016666 00000000000000 GooCanvasPolyline @parent: @close_path: @num_points: @Varargs: @Returns: @parent: @x1: @y1: @x2: @y2: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvasgridmodel.sgml0000644000076400007640000000472311222215703017010 00000000000000 GooCanvasGridModel @parent: @x: @y: @width: @height: @x_step: @y_step: @x_offset: @y_offset: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvasimagemodel.sgml0000644000076400007640000000166111222215703017143 00000000000000 GooCanvasImageModel @parent: @pixbuf: @x: @y: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvasrectmodel.sgml0000644000076400007640000000155111222215703017014 00000000000000 GooCanvasRectModel @parent: @x: @y: @width: @height: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvasgroup.sgml0000644000076400007640000000124311222215703016170 00000000000000 GooCanvasGroup @parent: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvastablemodel.sgml0000644000076400007640000000425211222215703017147 00000000000000 GooCanvasTableModel @parent: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvaspathmodel.sgml0000644000076400007640000000141711222215703017014 00000000000000 GooCanvasPathModel @parent: @path_data: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvaspolylinemodel.sgml0000644000076400007640000000263511222215703017716 00000000000000 GooCanvasPolylineModel @parent: @close_path: @num_points: @Varargs: @Returns: @parent: @x1: @y1: @x2: @y2: @Varargs: @Returns: goocanvas-0.15/docs/tmpl/goocanvastable.sgml0000644000076400007640000000404211222215703016123 00000000000000 GooCanvasTable @parent: @Varargs: @Returns: goocanvas-0.15/docs/model-view-canvas.xml0000644000076400007640000001065611172574677015374 00000000000000 Model/View Canvas Example 3 GOOCANVAS Library Model/View Canvas Example how to create a model/view canvas. Model View Canvas Example Here's a complete example application that creates a model-view #GooCanvas with a rectangle and a text item in it. #include <stdlib.h> #include <goocanvas.h> static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItemModel *root, *rect_model, *text_model; GooCanvasItem *rect_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event, NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_group_model_new (NULL, NULL); /* Add a few simple items. */ rect_model = goo_canvas_rect_model_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_model = goo_canvas_text_model_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_model_rotate (text_model, 45, 300, 300); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); /* Connect a signal handler for the rectangle item. */ rect_item = goo_canvas_get_item (GOO_CANVAS (canvas), rect_model); g_signal_connect (rect_item, "button_press_event", (GtkSignalFunc) on_rect_button_press, NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-0.15/docs/architecture.xml0000644000076400007640000001262211172574677014530 00000000000000 Underlying Architecture 3 GOOCANVAS Library Underlying Architecture how the canvas fits together. Underlying Architecture The GooCanvas Widget #GooCanvas is a #GtkWidget (it is actually a subclass of #GtkContainer), and so can be placed in an interface just like any normal widget. Usually a #GooCanvas widget would be placed inside a #GtkScrolledWindow in order to enable scrolling of the canvas. The size of the canvas can be set explicitly using goo_canvas_set_bounds(), or if the #GooCanvas:automatic-bounds property is set to %TRUE the bounds will be automatically calculated to include all of the canvas items. The units used in the canvas can be set with the #GooCanvas:units property. The canvas units can be pixels, points, inches or millimeters and apply to the canvas and all items. The Structure of the Simple Canvas The simple canvas consists of a hierarchy of canvas items. The root item is automatically created by the canvas and can be accessed using goo_canvas_get_root_item(). New items and groups can then be created and added to the root item. Each item in the canvas keeps a #GooCanvasBounds structure which stores the bounding rectangle of the item and all of its descendants. This makes it easy to find out which items in the canvas need repainting or which item the mouse is over. (The bounds are stored in the canvas coordinate space, which is the coordinate space of the entire canvas, after any item transformation matrices have been applied.) The Structure of the Model/View Canvas The model/view canvas consists of a hierarchy of item models, and an identical hierarchy of canvas items, with each canvas item corresponding to one item model. The hierarchy of item models can be used in several #GooCanvas widgets, to allow multiple views of the same model. Though different canvas items will be used in each #GooCanvas. The root item model is set with goo_canvas_set_root_item_model(). The canvas will automatically create canvas items to display the hierarchy of item models, and will automatically add and remove canvas items as the item model hierarchy is changed. The Update Procedure When items are added to the canvas or their properties are changed they may need to recalculate their bounds. To do this they set an internal flag such as @need_update, and make a call to goo_canvas_item_request_update(). #GooCanvas handles all the update requests at once, to avoids multiple redraws of the same parts of the canvas. To do this it installs an idle handler, goo_canvas_idle_handler(), which is called as soon as the application is idle (and before any part of the canvas is redrawn). The idle handler calls goo_canvas_item_update() on the root item, which recursively calls goo_canvas_item_update() on any items as necessary, recalculating their bounds and requesting redraws as appropriate. If a container item (e.g. #GooCanvasGroup) is changed it needs to ensure that all descendants recalculate their bounds so it calls goo_canvas_item_update() for all of its children with the @entire_tree argument set to %TRUE. How Changes to Items are Handled When an item is changed (e.g. if the #GooCanvasRect:x property of a #GooCanvasRect is changed), the item calls goo_canvas_item_simple_changed() with a flag indicating if the bounds of the item need to be recalculated. If the bounds don't need to be recalculated, then goo_canvas_request_redraw() is called to simply request that the item is redrawn. This results in a call to gdk_window_invalidate_rect() and the redraw proceeds just like a normal #GtkWidget. However, if the bounds do need to be recalculated then goo_canvas_item_request_update() is called to request that the item be updated the next time the canvas performs an update. How Changes are Handled in the Model/View Canvas In the Model/View canvas it is the underlying item models which are initially changed. The item models emit "changed" signals which the items respond to. For the standard canvas items the goo_canvas_item_model_simple_changed() signal handler is called, which calls goo_canvas_item_simple_changed() and the procedure continues as in the simple canvas case above. goocanvas-0.15/docs/wysiwyg.xml0000644000076400007640000000451411172574677013571 00000000000000 WYSIWYG Printing 3 GOOCANVAS Library WYSIWYG Printing how to use the canvas to create accurate printed output. WYSIWYG Printing Screen Resolution The GooCanvas #GooCanvas:resolution-x and #GooCanvas:resolution-y properties must be set correctly. They both default to 96dpi, which corresponds to a typical monitor. To get a more accurate figure you might be able to use gdk_screen_get_resolution(), but this isn't always guaranteed to be correct. If accuracy is very important a method should be provided for the user to calibrate the screen. Units The GooCanvas #GooCanvas:units property must be set to one of %GTK_UNIT_MM, %GTK_UNIT_POINTS or %GTK_UNIT_INCH (it defaults to %GTK_UNIT_PIXEL). All values used within the canvas are assumed to be in the specified units, including font sizes. Font Sizes Absolute font sizes must be used (to prevent the fonts being mistakenly scaled by Pango as well as by GooCanvas). To specify absolute font sizes add "px" after the font size, e.g. instead of "Sans 9" use "Sans 9px". Font sizes must be converted to the units used by the canvas. For example, if a 9 point "Sans" font is desired but #GooCanvas:units is set to %GTK_UNIT_MM, then the size must first be converted into millimeters: (9 / 72) * 25.4 = 3.175mm. So the font used would be "Sans 3.175px". Example Code The units-demo application that comes with the GooCanvas source code demonstrates the use of different units and absolute font sizes. goocanvas-0.15/docs/xml/0000777000076400007640000000000011222215703012157 500000000000000goocanvas-0.15/docs/xml/goocanvasitemmodelsimple.xml0000644000076400007640000004321611222215703017715 00000000000000 GooCanvasItemModelSimple 3 GOOCANVAS Library GooCanvasItemModelSimple the base class for the standard canvas item models. Synopsis GooCanvasItemModelSimple; Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasRectModel +----GooCanvasGroupModel +----GooCanvasPathModel +----GooCanvasEllipseModel +----GooCanvasTextModel +----GooCanvasPolylineModel +----GooCanvasImageModel +----GooCanvasGridModel Implemented Interfaces GooCanvasItemModelSimple implements GooCanvasItemModel. Properties "antialias" GooCairoAntialias : Read / Write "clip-fill-rule" GooCairoFillRule : Read / Write "clip-path" gchararray : Write "fill-color" gchararray : Write "fill-color-rgba" guint : Read / Write "fill-pattern" GooCairoPattern : Read / Write "fill-pixbuf" GdkPixbuf : Write "fill-rule" GooCairoFillRule : Read / Write "font" gchararray : Read / Write "font-desc" PangoFontDescription : Read / Write "hint-metrics" GooCairoHintMetrics : Read / Write "line-cap" GooCairoLineCap : Read / Write "line-dash" GooCanvasLineDash : Read / Write "line-join" GooCairoLineJoin : Read / Write "line-join-miter-limit" gdouble : Read / Write "line-width" gdouble : Read / Write "operator" GooCairoOperator : Read / Write "stroke-color" gchararray : Write "stroke-color-rgba" guint : Read / Write "stroke-pattern" GooCairoPattern : Read / Write "stroke-pixbuf" GdkPixbuf : Write Description GooCanvasItemModelSimple is used as a base class for the standard canvas item models. It can also be used as the base class for new custom canvas item models. It provides default implementations for many of the GooCanvasItemModel methods. Subclasses of GooCanvasItemModelSimple only need to implement the create_item() method of the GooCanvasItemModel interface, to create the default canvas item to view the item model. Details <anchor id="GooCanvasItemModelSimple-struct" role="struct"/>GooCanvasItemModelSimple GooCanvasItemModelSimpletypedef struct { GooCanvasItemModel *parent; GooCanvasItemSimpleData simple_data; } GooCanvasItemModelSimple; The GooCanvasItemModelSimple struct contains the basic data needed to implement canvas item models. GooCanvasItemModel *parent; the parent model. GooCanvasItemSimpleData simple_data; data used by the canvas item for viewing the model. Property Details <anchor id="GooCanvasItemModelSimple--antialias"/>The <literal>"antialias"</literal> property GooCanvasItemModelSimple:antialias "antialias" GooCairoAntialias : Read / Write The antialiasing mode to use.Default value: CAIRO_ANTIALIAS_GRAY <anchor id="GooCanvasItemModelSimple--clip-fill-rule"/>The <literal>"clip-fill-rule"</literal> property GooCanvasItemModelSimple:clip-fill-rule "clip-fill-rule" GooCairoFillRule : Read / Write The fill rule used to determine which parts of the item are clipped.Default value: CAIRO_FILL_RULE_WINDING <anchor id="GooCanvasItemModelSimple--clip-path"/>The <literal>"clip-path"</literal> property GooCanvasItemModelSimple:clip-path "clip-path" gchararray : Write The sequence of commands describing the clip path of the item, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element. Default value: NULL <anchor id="GooCanvasItemModelSimple--fill-color"/>The <literal>"fill-color"</literal> property GooCanvasItemModelSimple:fill-color "fill-color" gchararray : Write The color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.Default value: NULL <anchor id="GooCanvasItemModelSimple--fill-color-rgba"/>The <literal>"fill-color-rgba"</literal> property GooCanvasItemModelSimple:fill-color-rgba "fill-color-rgba" guint : Read / Write The color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULL.Default value: 0 <anchor id="GooCanvasItemModelSimple--fill-pattern"/>The <literal>"fill-pattern"</literal> property GooCanvasItemModelSimple:fill-pattern "fill-pattern" GooCairoPattern : Read / Write The pattern to use to paint the interior of the item, or NULL to disable painting. <anchor id="GooCanvasItemModelSimple--fill-pixbuf"/>The <literal>"fill-pixbuf"</literal> property GooCanvasItemModelSimple:fill-pixbuf "fill-pixbuf" GdkPixbuf : Write The pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL. <anchor id="GooCanvasItemModelSimple--fill-rule"/>The <literal>"fill-rule"</literal> property GooCanvasItemModelSimple:fill-rule "fill-rule" GooCairoFillRule : Read / Write The fill rule used to determine which parts of the item are filled.Default value: CAIRO_FILL_RULE_WINDING <anchor id="GooCanvasItemModelSimple--font"/>The <literal>"font"</literal> property GooCanvasItemModelSimple:font "font" gchararray : Read / Write The base font to use for the text.Default value: NULL <anchor id="GooCanvasItemModelSimple--font-desc"/>The <literal>"font-desc"</literal> property GooCanvasItemModelSimple:font-desc "font-desc" PangoFontDescription : Read / Write The attributes specifying which font to use. <anchor id="GooCanvasItemModelSimple--hint-metrics"/>The <literal>"hint-metrics"</literal> property GooCanvasItemModelSimple:hint-metrics "hint-metrics" GooCairoHintMetrics : Read / Write The hinting to be used for font metrics.Default value: CAIRO_HINT_METRICS_OFF <anchor id="GooCanvasItemModelSimple--line-cap"/>The <literal>"line-cap"</literal> property GooCanvasItemModelSimple:line-cap "line-cap" GooCairoLineCap : Read / Write The line cap style to use.Default value: CAIRO_LINE_CAP_BUTT <anchor id="GooCanvasItemModelSimple--line-dash"/>The <literal>"line-dash"</literal> property GooCanvasItemModelSimple:line-dash "line-dash" GooCanvasLineDash : Read / Write The dash pattern to use. <anchor id="GooCanvasItemModelSimple--line-join"/>The <literal>"line-join"</literal> property GooCanvasItemModelSimple:line-join "line-join" GooCairoLineJoin : Read / Write The line join style to use.Default value: CAIRO_LINE_JOIN_MITER <anchor id="GooCanvasItemModelSimple--line-join-miter-limit"/>The <literal>"line-join-miter-limit"</literal> property GooCanvasItemModelSimple:line-join-miter-limit "line-join-miter-limit" gdouble : Read / Write The smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit.Allowed values: >= 0 Default value: 10 <anchor id="GooCanvasItemModelSimple--line-width"/>The <literal>"line-width"</literal> property GooCanvasItemModelSimple:line-width "line-width" gdouble : Read / Write The line width to use for the item's perimeter.Allowed values: >= 0 Default value: 2 <anchor id="GooCanvasItemModelSimple--operator"/>The <literal>"operator"</literal> property GooCanvasItemModelSimple:operator "operator" GooCairoOperator : Read / Write The compositing operator to use.Default value: CAIRO_OPERATOR_OVER <anchor id="GooCanvasItemModelSimple--stroke-color"/>The <literal>"stroke-color"</literal> property GooCanvasItemModelSimple:stroke-color "stroke-color" gchararray : Write The color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.Default value: NULL <anchor id="GooCanvasItemModelSimple--stroke-color-rgba"/>The <literal>"stroke-color-rgba"</literal> property GooCanvasItemModelSimple:stroke-color-rgba "stroke-color-rgba" guint : Read / Write The color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULL.Default value: 0 <anchor id="GooCanvasItemModelSimple--stroke-pattern"/>The <literal>"stroke-pattern"</literal> property GooCanvasItemModelSimple:stroke-pattern "stroke-pattern" GooCairoPattern : Read / Write The pattern to use to paint the perimeter of the item, or NULL disable painting. <anchor id="GooCanvasItemModelSimple--stroke-pixbuf"/>The <literal>"stroke-pixbuf"</literal> property GooCanvasItemModelSimple:stroke-pixbuf "stroke-pixbuf" GdkPixbuf : Write The pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL. goocanvas-0.15/docs/xml/goocanvastable.xml0000644000076400007640000005436511222215703015622 00000000000000 GooCanvasTable 3 GOOCANVAS Library GooCanvasTable a table container to layout items. Synopsis GooCanvasTable; GooCanvasItem* goo_canvas_table_new (GooCanvasItem *parent, ...); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasGroup +----GooCanvasTable Implemented Interfaces GooCanvasTable implements GooCanvasItem. Properties "column-spacing" gdouble : Read / Write "homogeneous-columns" gboolean : Read / Write "homogeneous-rows" gboolean : Read / Write "horz-grid-line-width" gdouble : Read / Write "row-spacing" gdouble : Read / Write "vert-grid-line-width" gdouble : Read / Write "x-border-spacing" gdouble : Read / Write "y-border-spacing" gdouble : Read / Write Child Properties "bottom-padding" gdouble : Read / Write "column" guint : Read / Write "columns" guint : Read / Write "left-padding" gdouble : Read / Write "right-padding" gdouble : Read / Write "row" guint : Read / Write "rows" guint : Read / Write "top-padding" gdouble : Read / Write "x-align" gdouble : Read / Write "x-expand" gboolean : Read / Write "x-fill" gboolean : Read / Write "x-shrink" gboolean : Read / Write "y-align" gdouble : Read / Write "y-expand" gboolean : Read / Write "y-fill" gboolean : Read / Write "y-shrink" gboolean : Read / Write Description GooCanvasTable is a table container used to lay out other canvas items. It is used in a similar way to how the GtkTable widget is used to lay out GTK+ widgets. Items are added to the table using the normal methods, then goo_canvas_item_set_child_properties() is used to specify how each child item is to be positioned within the table (i.e. which row and column it is in, how much padding it should have and whether it should expand or shrink). GooCanvasTable is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasTable will affect all children of the GooCanvasTable (unless the children override the property setting). GooCanvasTable implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(), and the properties such as "visibility" and "pointer-events". To create a GooCanvasTable use goo_canvas_table_new(). To get or set the properties of an existing GooCanvasTable, use g_object_get() and g_object_set(). Details <anchor id="GooCanvasTable-struct" role="struct"/>GooCanvasTable GooCanvasTabletypedef struct _GooCanvasTable GooCanvasTable; The GooCanvasTable struct contains private data only. <anchor id="goo-canvas-table-new" role="function"/>goo_canvas_table_new () goo_canvas_table_newGooCanvasItem* goo_canvas_table_new (GooCanvasItem *parent, ...); Creates a new table item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new table item. Here's an example showing how to create a table with a square, a circle and a triangle in it: GooCanvasItem *table, *square, *circle, *triangle; table = goo_canvas_table_new (root, "row-spacing", 4.0, "column-spacing", 4.0, NULL); goo_canvas_item_translate (table, 400, 200); square = goo_canvas_rect_new (table, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); goo_canvas_item_set_child_properties (table, square, "row", 0, "column", 0, NULL); circle = goo_canvas_ellipse_new (table, 0.0, 0.0, 25.0, 25.0, "fill-color", "blue", NULL); goo_canvas_item_set_child_properties (table, circle, "row", 0, "column", 1, NULL); triangle = goo_canvas_polyline_new (table, TRUE, 3, 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, "fill-color", "yellow", NULL); goo_canvas_item_set_child_properties (table, triangle, "row", 0, "column", 2, NULL); Property Details <anchor id="GooCanvasTable--column-spacing"/>The <literal>"column-spacing"</literal> property GooCanvasTable:column-spacing "column-spacing" gdouble : Read / Write The default space between columns.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTable--homogeneous-columns"/>The <literal>"homogeneous-columns"</literal> property GooCanvasTable:homogeneous-columns "homogeneous-columns" gboolean : Read / Write If all columns are the same width.Default value: FALSE <anchor id="GooCanvasTable--homogeneous-rows"/>The <literal>"homogeneous-rows"</literal> property GooCanvasTable:homogeneous-rows "homogeneous-rows" gboolean : Read / Write If all rows are the same height.Default value: FALSE <anchor id="GooCanvasTable--horz-grid-line-width"/>The <literal>"horz-grid-line-width"</literal> property GooCanvasTable:horz-grid-line-width "horz-grid-line-width" gdouble : Read / Write The width of the grid line to draw between rows.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTable--row-spacing"/>The <literal>"row-spacing"</literal> property GooCanvasTable:row-spacing "row-spacing" gdouble : Read / Write The default space between rows.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTable--vert-grid-line-width"/>The <literal>"vert-grid-line-width"</literal> property GooCanvasTable:vert-grid-line-width "vert-grid-line-width" gdouble : Read / Write The width of the grid line to draw between columns.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTable--x-border-spacing"/>The <literal>"x-border-spacing"</literal> property GooCanvasTable:x-border-spacing "x-border-spacing" gdouble : Read / Write The amount of spacing between the lefmost and rightmost cells and the border grid line.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTable--y-border-spacing"/>The <literal>"y-border-spacing"</literal> property GooCanvasTable:y-border-spacing "y-border-spacing" gdouble : Read / Write The amount of spacing between the topmost and bottommost cells and the border grid line.Allowed values: >= 0 Default value: 0 Child Property Details <anchor id="GooCanvasTable--bottom-padding"/>The <literal>"bottom-padding"</literal> child property GooCanvasTable:bottom-padding "bottom-padding" gdouble : Read / Write Extra space to add below the item.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTable--column"/>The <literal>"column"</literal> child property GooCanvasTable:column "column" guint : Read / Write The column to place the item in.Allowed values: <= 65535 Default value: 0 <anchor id="GooCanvasTable--columns"/>The <literal>"columns"</literal> child property GooCanvasTable:columns "columns" guint : Read / Write The number of columns that the item spans.Allowed values: <= 65535 Default value: 1 <anchor id="GooCanvasTable--left-padding"/>The <literal>"left-padding"</literal> child property GooCanvasTable:left-padding "left-padding" gdouble : Read / Write Extra space to add to the left of the item.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTable--right-padding"/>The <literal>"right-padding"</literal> child property GooCanvasTable:right-padding "right-padding" gdouble : Read / Write Extra space to add to the right of the item.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTable--row"/>The <literal>"row"</literal> child property GooCanvasTable:row "row" guint : Read / Write The row to place the item in.Allowed values: <= 65535 Default value: 0 <anchor id="GooCanvasTable--rows"/>The <literal>"rows"</literal> child property GooCanvasTable:rows "rows" guint : Read / Write The number of rows that the item spans.Allowed values: <= 65535 Default value: 1 <anchor id="GooCanvasTable--top-padding"/>The <literal>"top-padding"</literal> child property GooCanvasTable:top-padding "top-padding" gdouble : Read / Write Extra space to add above the item.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTable--x-align"/>The <literal>"x-align"</literal> child property GooCanvasTable:x-align "x-align" gdouble : Read / Write The horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-aligned.Allowed values: [0,1] Default value: 0.5 <anchor id="GooCanvasTable--x-expand"/>The <literal>"x-expand"</literal> child property GooCanvasTable:x-expand "x-expand" gboolean : Read / Write If the item expands horizontally as the table expands.Default value: FALSE <anchor id="GooCanvasTable--x-fill"/>The <literal>"x-fill"</literal> child property GooCanvasTable:x-fill "x-fill" gboolean : Read / Write If the item fills all horizontal allocated space.Default value: FALSE <anchor id="GooCanvasTable--x-shrink"/>The <literal>"x-shrink"</literal> child property GooCanvasTable:x-shrink "x-shrink" gboolean : Read / Write If the item can shrink smaller than its requested size horizontally.Default value: FALSE <anchor id="GooCanvasTable--y-align"/>The <literal>"y-align"</literal> child property GooCanvasTable:y-align "y-align" gdouble : Read / Write The vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-aligned.Allowed values: [0,1] Default value: 0.5 <anchor id="GooCanvasTable--y-expand"/>The <literal>"y-expand"</literal> child property GooCanvasTable:y-expand "y-expand" gboolean : Read / Write If the item expands vertically as the table expands.Default value: FALSE <anchor id="GooCanvasTable--y-fill"/>The <literal>"y-fill"</literal> child property GooCanvasTable:y-fill "y-fill" gboolean : Read / Write If the item fills all vertical allocated space.Default value: FALSE <anchor id="GooCanvasTable--y-shrink"/>The <literal>"y-shrink"</literal> child property GooCanvasTable:y-shrink "y-shrink" gboolean : Read / Write If the item can shrink smaller than its requested size vertically.Default value: FALSE goocanvas-0.15/docs/xml/goocanvaspath.xml0000644000076400007640000002346311222215703015462 00000000000000 GooCanvasPath 3 GOOCANVAS Library GooCanvasPath a path item (a series of lines and curves). Synopsis GooCanvasPath; GooCanvasItem* goo_canvas_path_new (GooCanvasItem *parent, const gchar *path_data, ...); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasPath Implemented Interfaces GooCanvasPath implements GooCanvasItem. Properties "data" gchararray : Write "height" gdouble : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasPath represents a path item, which is a series of one or more lines, bezier curves, or elliptical arcs. It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(). GooCanvasPath uses the same path specification strings as the Scalable Vector Graphics (SVG) path element. For details see the SVG specification. To create a GooCanvasPath use goo_canvas_path_new(). To get or set the properties of an existing GooCanvasPath, use g_object_get() and g_object_set(). Details <anchor id="GooCanvasPath-struct" role="struct"/>GooCanvasPath GooCanvasPathtypedef struct _GooCanvasPath GooCanvasPath; The GooCanvasPath struct contains private data only. <anchor id="goo-canvas-path-new" role="function"/>goo_canvas_path_new () goo_canvas_path_newGooCanvasItem* goo_canvas_path_new (GooCanvasItem *parent, const gchar *path_data, ...); Creates a new path item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. path_data : the sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new path item. Here's an example showing how to create a red line from (20,20) to (40,40): GooCanvasItem *path = goo_canvas_path_new (mygroup, "M 20 20 L 40 40", "stroke-color", "red", NULL); This example creates a cubic bezier curve from (20,100) to (100,100) with the control points at (20,50) and (100,50): GooCanvasItem *path = goo_canvas_path_new (mygroup, "M20,100 C20,50 100,50 100,100", "stroke-color", "blue", NULL); This example uses an elliptical arc to create a filled circle with one quarter missing: GooCanvasItem *path = goo_canvas_path_new (mygroup, "M200,500 h-150 a150,150 0 1,0 150,-150 z", "fill-color", "red", "stroke-color", "blue", "line-width", 5.0, NULL); Property Details <anchor id="GooCanvasPath--data"/>The <literal>"data"</literal> property GooCanvasPath:data "data" gchararray : Write The sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element. Default value: NULL <anchor id="GooCanvasPath--height"/>The <literal>"height"</literal> property GooCanvasPath:height "height" gdouble : Read / Write The height of the path.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasPath--width"/>The <literal>"width"</literal> property GooCanvasPath:width "width" gdouble : Read / Write The width of the path.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasPath--x"/>The <literal>"x"</literal> property GooCanvasPath:x "x" gdouble : Read / Write The x coordinate of the path.Default value: 0 <anchor id="GooCanvasPath--y"/>The <literal>"y"</literal> property GooCanvasPath:y "y" gdouble : Read / Write The y coordinate of the path.Default value: 0 goocanvas-0.15/docs/xml/goocanvasitemsimple.xml0000644000076400007640000012660411222215703016677 00000000000000 GooCanvasItemSimple 3 GOOCANVAS Library GooCanvasItemSimple the base class for the standard canvas items. Synopsis GooCanvasItemSimple; GooCanvasItemSimpleData; GooCanvasItemSimpleClass; void goo_canvas_item_simple_check_style (GooCanvasItemSimple *item); gdouble goo_canvas_item_simple_get_line_width (GooCanvasItemSimple *item); void goo_canvas_item_simple_get_path_bounds (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); void goo_canvas_item_simple_user_bounds_to_device (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); void goo_canvas_item_simple_user_bounds_to_parent (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); gboolean goo_canvas_item_simple_check_in_path (GooCanvasItemSimple *item, gdouble x, gdouble y, cairo_t *cr, GooCanvasPointerEvents pointer_events); void goo_canvas_item_simple_paint_path (GooCanvasItemSimple *item, cairo_t *cr); void goo_canvas_item_simple_changed (GooCanvasItemSimple *item, gboolean recompute_bounds); void goo_canvas_item_simple_set_model (GooCanvasItemSimple *item, GooCanvasItemModel *model); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasWidget +----GooCanvasRect +----GooCanvasGroup +----GooCanvasPath +----GooCanvasEllipse +----GooCanvasText +----GooCanvasPolyline +----GooCanvasImage +----GooCanvasGrid Implemented Interfaces GooCanvasItemSimple implements GooCanvasItem. Properties "antialias" GooCairoAntialias : Read / Write "clip-fill-rule" GooCairoFillRule : Read / Write "clip-path" gchararray : Write "fill-color" gchararray : Write "fill-color-rgba" guint : Read / Write "fill-pattern" GooCairoPattern : Read / Write "fill-pixbuf" GdkPixbuf : Write "fill-rule" GooCairoFillRule : Read / Write "font" gchararray : Read / Write "font-desc" PangoFontDescription : Read / Write "hint-metrics" GooCairoHintMetrics : Read / Write "line-cap" GooCairoLineCap : Read / Write "line-dash" GooCanvasLineDash : Read / Write "line-join" GooCairoLineJoin : Read / Write "line-join-miter-limit" gdouble : Read / Write "line-width" gdouble : Read / Write "operator" GooCairoOperator : Read / Write "stroke-color" gchararray : Write "stroke-color-rgba" guint : Read / Write "stroke-pattern" GooCairoPattern : Read / Write "stroke-pixbuf" GdkPixbuf : Write Description GooCanvasItemSimple is used as a base class for all of the standard canvas items. It can also be used as the base class for new custom canvas items. It provides default implementations for many of the GooCanvasItem methods. For very simple items, all that is needed is to implement the create_path() method. (GooCanvasEllipse, GooCanvasRect and GooCanvasPath do this.) More complicated items need to implement the update(), paint() and is_item_at() methods instead. (GooCanvasImage, GooCanvasPolyline, GooCanvasText and GooCanvasWidget do this.) They may also need to override some of the other GooCanvasItem methods such as set_canvas(), set_parent() or allocate_area() if special code is needed. (GooCanvasWidget does this to make sure the GtkWidget is embedded in the GooCanvas widget correctly.) Details <anchor id="GooCanvasItemSimple-struct" role="struct"/>GooCanvasItemSimple GooCanvasItemSimpletypedef struct { GooCanvas *canvas; GooCanvasItem *parent; GooCanvasItemModelSimple *model; GooCanvasItemSimpleData *simple_data; GooCanvasBounds bounds; guint need_update : 1; guint need_entire_subtree_update : 1; } GooCanvasItemSimple; The GooCanvasItemSimple struct contains the basic data needed to implement canvas items. GooCanvas *canvas; the canvas. GooCanvasItem *parent; the parent item. GooCanvasItemModelSimple *model; the item's model, if it has one. GooCanvasItemSimpleData *simple_data; data that is common to both the model and view classes. If the canvas item has a model, this will point to the model's GooCanvasItemSimpleData, otherwise the canvas item will have its own GooCanvasItemSimpleData. GooCanvasBounds bounds; the bounds of the item, in device space. guint need_update : 1; if the item needs to recompute its bounds and redraw. guint need_entire_subtree_update : 1; if all descendants need to be updated. <anchor id="GooCanvasItemSimpleData" role="struct"/>GooCanvasItemSimpleData GooCanvasItemSimpleDatatypedef struct { GooCanvasStyle *style; cairo_matrix_t *transform; GArray *clip_path_commands; gchar *tooltip; gdouble visibility_threshold; guint visibility : 2; guint pointer_events : 4; guint can_focus : 1; guint own_style : 1; guint clip_fill_rule : 4; guint is_static : 1; } GooCanvasItemSimpleData; This is the data common to both the model and view classes. GooCanvasStyle *style; the style to draw with. cairo_matrix_t *transform; the transformation matrix of the item, or NULL. GArray *clip_path_commands; an array of GooCanvasPathCommand specifying the clip path of the item, or NULL. gchar *tooltip; the item's tooltip. gdouble visibility_threshold; the threshold scale setting at which to show the item (if the visibility setting is set to VISIBLE_ABOVE_THRESHOLD). guint visibility : 2; the GooCanvasItemVisibility setting specifying whether the item is visible, invisible, or visible above a given canvas scale setting. guint pointer_events : 4; the GooCanvasPointerEvents setting specifying the events the item should receive. guint can_focus : 1; if the item can take the keyboard focus. guint own_style : 1; if the item has its own style, rather than using its parent's. guint clip_fill_rule : 4; the cairo_fill_rule_t setting specifying the fill rule used for the clip path. guint is_static : 1; if the item is static. <anchor id="GooCanvasItemSimpleClass" role="struct"/>GooCanvasItemSimpleClass GooCanvasItemSimpleClasstypedef struct { void (* simple_create_path) (GooCanvasItemSimple *simple, cairo_t *cr); void (* simple_update) (GooCanvasItemSimple *simple, cairo_t *cr); void (* simple_paint) (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds); gboolean (* simple_is_item_at) (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event); } GooCanvasItemSimpleClass; The GooCanvasItemSimpleClass struct contains several methods that subclasses can override. Simple items need only implement the create_path() method. More complex items must override the update(), paint() and is_item_at() methods instead. simple_create_path () simple subclasses that draw basic shapes and paths only need to override this one method. It creates the path for the item. All updating, painting and hit-testing is provided automatically by the GooCanvasItemSimple class. (This method is used by the builtin GooCanvasEllipse, GooCanvasRect and GooCanvasPath items.) More complicated subclasses must override simple_update, simple_paint and simple_is_item_at instead. simple_update () subclasses should override this to calculate their new bounds, in user space. simple_paint () subclasses should override this to paint their item. simple_is_item_at () subclasses should override this to do hit-testing. <anchor id="goo-canvas-item-simple-check-style" role="function"/>goo_canvas_item_simple_check_style () goo_canvas_item_simple_check_stylevoid goo_canvas_item_simple_check_style (GooCanvasItemSimple *item); This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their update() or get_requested_area() methods. It ensures that the item's style is setup correctly. If the item has its own GooCanvasStyle it makes sure the parent is set correctly. If it doesn't have its own style it uses the parent item's style. item : a GooCanvasItemSimple. <anchor id="goo-canvas-item-simple-get-line-width" role="function"/>goo_canvas_item_simple_get_line_width () goo_canvas_item_simple_get_line_widthgdouble goo_canvas_item_simple_get_line_width (GooCanvasItemSimple *item); Gets the item's line width. item : a GooCanvasItemSimple. Returns : the item's line width. <anchor id="goo-canvas-item-simple-get-path-bounds" role="function"/>goo_canvas_item_simple_get_path_bounds () goo_canvas_item_simple_get_path_boundsvoid goo_canvas_item_simple_get_path_bounds (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their update() or get_requested_area() methods. It calculates the bounds of the current path, using the item's style settings, and stores the results in the given GooCanvasBounds struct. The returned bounds contains the bounding box of the path in device space, converted to user space coordinates. To calculate the bounds completely in user space, use cairo_identity_matrix() to temporarily reset the current transformation matrix to the identity matrix. item : a GooCanvasItemSimple. cr : a cairo context. bounds : the GooCanvasBounds struct to store the resulting bounding box. <anchor id="goo-canvas-item-simple-user-bounds-to-device" role="function"/>goo_canvas_item_simple_user_bounds_to_device () goo_canvas_item_simple_user_bounds_to_devicevoid goo_canvas_item_simple_user_bounds_to_device (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their update() or get_requested_area() methods. It converts the item's bounds to a bounding box in the canvas (device) coordinate space. item : a GooCanvasItemSimple. cr : a cairo context. bounds : the bounds of the item, in the item's coordinate space. <anchor id="goo-canvas-item-simple-user-bounds-to-parent" role="function"/>goo_canvas_item_simple_user_bounds_to_parent () goo_canvas_item_simple_user_bounds_to_parentvoid goo_canvas_item_simple_user_bounds_to_parent (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); This function is intended to be used by subclasses of GooCanvasItemSimple, typically in their get_requested_area() method. It converts the item's bounds to a bounding box in its parent's coordinate space. If the item has no transformation matrix set then no conversion is needed. item : a GooCanvasItemSimple. cr : a cairo context. bounds : the bounds of the item, in the item's coordinate space. <anchor id="goo-canvas-item-simple-check-in-path" role="function"/>goo_canvas_item_simple_check_in_path () goo_canvas_item_simple_check_in_pathgboolean goo_canvas_item_simple_check_in_path (GooCanvasItemSimple *item, gdouble x, gdouble y, cairo_t *cr, GooCanvasPointerEvents pointer_events); This function is intended to be used by subclasses of GooCanvasItemSimple. It checks if the given point is in the current path, using the item's style settings. item : a GooCanvasItemSimple. x : the x coordinate of the point. y : the y coordinate of the point. cr : a cairo context. pointer_events : specifies which parts of the path to check. Returns : TRUE if the given point is in the current path. <anchor id="goo-canvas-item-simple-paint-path" role="function"/>goo_canvas_item_simple_paint_path () goo_canvas_item_simple_paint_pathvoid goo_canvas_item_simple_paint_path (GooCanvasItemSimple *item, cairo_t *cr); This function is intended to be used by subclasses of GooCanvasItemSimple. It paints the current path, using the item's style settings. item : a GooCanvasItemSimple. cr : a cairo context. <anchor id="goo-canvas-item-simple-changed" role="function"/>goo_canvas_item_simple_changed () goo_canvas_item_simple_changedvoid goo_canvas_item_simple_changed (GooCanvasItemSimple *item, gboolean recompute_bounds); This function is intended to be used by subclasses of GooCanvasItemSimple. It is used as a callback for the "changed" signal of the item models. It requests an update or redraw of the item as appropriate. item : a GooCanvasItemSimple. recompute_bounds : if the item's bounds need to be recomputed. <anchor id="goo-canvas-item-simple-set-model" role="function"/>goo_canvas_item_simple_set_model () goo_canvas_item_simple_set_modelvoid goo_canvas_item_simple_set_model (GooCanvasItemSimple *item, GooCanvasItemModel *model); This function should be called by subclasses of GooCanvasItemSimple in their set_model() method. item : a GooCanvasItemSimple. model : the model that item will view. Property Details <anchor id="GooCanvasItemSimple--antialias"/>The <literal>"antialias"</literal> property GooCanvasItemSimple:antialias "antialias" GooCairoAntialias : Read / Write The antialiasing mode to use.Default value: CAIRO_ANTIALIAS_GRAY <anchor id="GooCanvasItemSimple--clip-fill-rule"/>The <literal>"clip-fill-rule"</literal> property GooCanvasItemSimple:clip-fill-rule "clip-fill-rule" GooCairoFillRule : Read / Write The fill rule used to determine which parts of the item are clipped.Default value: CAIRO_FILL_RULE_WINDING <anchor id="GooCanvasItemSimple--clip-path"/>The <literal>"clip-path"</literal> property GooCanvasItemSimple:clip-path "clip-path" gchararray : Write The sequence of commands describing the clip path of the item, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element. Default value: NULL <anchor id="GooCanvasItemSimple--fill-color"/>The <literal>"fill-color"</literal> property GooCanvasItemSimple:fill-color "fill-color" gchararray : Write The color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL.Default value: NULL <anchor id="GooCanvasItemSimple--fill-color-rgba"/>The <literal>"fill-color-rgba"</literal> property GooCanvasItemSimple:fill-color-rgba "fill-color-rgba" guint : Read / Write The color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULL.Default value: 0 <anchor id="GooCanvasItemSimple--fill-pattern"/>The <literal>"fill-pattern"</literal> property GooCanvasItemSimple:fill-pattern "fill-pattern" GooCairoPattern : Read / Write The pattern to use to paint the interior of the item, or NULL to disable painting. <anchor id="GooCanvasItemSimple--fill-pixbuf"/>The <literal>"fill-pixbuf"</literal> property GooCanvasItemSimple:fill-pixbuf "fill-pixbuf" GdkPixbuf : Write The pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL. <anchor id="GooCanvasItemSimple--fill-rule"/>The <literal>"fill-rule"</literal> property GooCanvasItemSimple:fill-rule "fill-rule" GooCairoFillRule : Read / Write The fill rule used to determine which parts of the item are filled.Default value: CAIRO_FILL_RULE_WINDING <anchor id="GooCanvasItemSimple--font"/>The <literal>"font"</literal> property GooCanvasItemSimple:font "font" gchararray : Read / Write The base font to use for the text.Default value: NULL <anchor id="GooCanvasItemSimple--font-desc"/>The <literal>"font-desc"</literal> property GooCanvasItemSimple:font-desc "font-desc" PangoFontDescription : Read / Write The attributes specifying which font to use. <anchor id="GooCanvasItemSimple--hint-metrics"/>The <literal>"hint-metrics"</literal> property GooCanvasItemSimple:hint-metrics "hint-metrics" GooCairoHintMetrics : Read / Write The hinting to be used for font metrics.Default value: CAIRO_HINT_METRICS_OFF <anchor id="GooCanvasItemSimple--line-cap"/>The <literal>"line-cap"</literal> property GooCanvasItemSimple:line-cap "line-cap" GooCairoLineCap : Read / Write The line cap style to use.Default value: CAIRO_LINE_CAP_BUTT <anchor id="GooCanvasItemSimple--line-dash"/>The <literal>"line-dash"</literal> property GooCanvasItemSimple:line-dash "line-dash" GooCanvasLineDash : Read / Write The dash pattern to use. <anchor id="GooCanvasItemSimple--line-join"/>The <literal>"line-join"</literal> property GooCanvasItemSimple:line-join "line-join" GooCairoLineJoin : Read / Write The line join style to use.Default value: CAIRO_LINE_JOIN_MITER <anchor id="GooCanvasItemSimple--line-join-miter-limit"/>The <literal>"line-join-miter-limit"</literal> property GooCanvasItemSimple:line-join-miter-limit "line-join-miter-limit" gdouble : Read / Write The smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit.Allowed values: >= 0 Default value: 10 <anchor id="GooCanvasItemSimple--line-width"/>The <literal>"line-width"</literal> property GooCanvasItemSimple:line-width "line-width" gdouble : Read / Write The line width to use for the item's perimeter.Allowed values: >= 0 Default value: 2 <anchor id="GooCanvasItemSimple--operator"/>The <literal>"operator"</literal> property GooCanvasItemSimple:operator "operator" GooCairoOperator : Read / Write The compositing operator to use.Default value: CAIRO_OPERATOR_OVER <anchor id="GooCanvasItemSimple--stroke-color"/>The <literal>"stroke-color"</literal> property GooCanvasItemSimple:stroke-color "stroke-color" gchararray : Write The color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL.Default value: NULL <anchor id="GooCanvasItemSimple--stroke-color-rgba"/>The <literal>"stroke-color-rgba"</literal> property GooCanvasItemSimple:stroke-color-rgba "stroke-color-rgba" guint : Read / Write The color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULL.Default value: 0 <anchor id="GooCanvasItemSimple--stroke-pattern"/>The <literal>"stroke-pattern"</literal> property GooCanvasItemSimple:stroke-pattern "stroke-pattern" GooCairoPattern : Read / Write The pattern to use to paint the perimeter of the item, or NULL disable painting. <anchor id="GooCanvasItemSimple--stroke-pixbuf"/>The <literal>"stroke-pixbuf"</literal> property GooCanvasItemSimple:stroke-pixbuf "stroke-pixbuf" GdkPixbuf : Write The pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL. goocanvas-0.15/docs/xml/goocanvastext.xml0000644000076400007640000003660211222215703015511 00000000000000 GooCanvasText 3 GOOCANVAS Library GooCanvasText a text item. Synopsis GooCanvasText; GooCanvasItem* goo_canvas_text_new (GooCanvasItem *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...); void goo_canvas_text_get_natural_extents (GooCanvasText *text, PangoRectangle *ink_rect, PangoRectangle *logical_rect); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasText Implemented Interfaces GooCanvasText implements GooCanvasItem. Properties "alignment" PangoAlignment : Read / Write "anchor" GtkAnchorType : Read / Write "ellipsize" PangoEllipsizeMode : Read / Write "height" gdouble : Read / Write "text" gchararray : Read / Write "use-markup" gboolean : Read / Write "width" gdouble : Read / Write "wrap" PangoWrapMode : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasText represents a text item. It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "fill-color". It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(). The "width" and "height" properties specify the area of the item. If it exceeds that area because there is too much text, it is clipped. The properties can be set to -1 to disable clipping. To create a GooCanvasText use goo_canvas_text_new(). To get or set the properties of an existing GooCanvasText, use g_object_get() and g_object_set(). Details <anchor id="GooCanvasText-struct" role="struct"/>GooCanvasText GooCanvasTexttypedef struct _GooCanvasText GooCanvasText; The GooCanvasText struct contains private data only. <anchor id="goo-canvas-text-new" role="function"/>goo_canvas_text_new () goo_canvas_text_newGooCanvasItem* goo_canvas_text_new (GooCanvasItem *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...); Creates a new text item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. string : the text to display. x : the x coordinate of the text. y : the y coordinate of the text. width : the width of the text item, or -1 for unlimited width. anchor : the position of the text relative to the given x and y coordinates. For example an anchor of GDK_ANCHOR_NW will result in the top-left of the text being placed at the given x and y coordinates. An anchor of GDK_ANCHOR_CENTER will result in the center of the text being placed at the x and y coordinates. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new text item. Here's an example showing how to create a text item with the bottom right of the text box placed at (500,500): GooCanvasItem *text = goo_canvas_text_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE, "fill-color", "blue", NULL); <anchor id="goo-canvas-text-get-natural-extents" role="function"/>goo_canvas_text_get_natural_extents () goo_canvas_text_get_natural_extentsvoid goo_canvas_text_get_natural_extents (GooCanvasText *text, PangoRectangle *ink_rect, PangoRectangle *logical_rect); Gets the natural extents of the text, in the text item's coordinate space. The final extents of the text may be different, if the text item is placed in a layout container such as GooCanvasTable. text : a GooCanvasText. ink_rect : the location to return the ink rect, or NULL. logical_rect : the location to return the logical rect, or NULL. Property Details <anchor id="GooCanvasText--alignment"/>The <literal>"alignment"</literal> property GooCanvasText:alignment "alignment" PangoAlignment : Read / Write How to align the text.Default value: PANGO_ALIGN_LEFT <anchor id="GooCanvasText--anchor"/>The <literal>"anchor"</literal> property GooCanvasText:anchor "anchor" GtkAnchorType : Read / Write How to position the text relative to the given x and y coordinates.Default value: GTK_ANCHOR_NORTH_WEST <anchor id="GooCanvasText--ellipsize"/>The <literal>"ellipsize"</literal> property GooCanvasText:ellipsize "ellipsize" PangoEllipsizeMode : Read / Write The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.Default value: PANGO_ELLIPSIZE_NONE <anchor id="GooCanvasText--height"/>The <literal>"height"</literal> property GooCanvasText:height "height" gdouble : Read / Write The height to use to layout the text, or -1 to use the natural height.Default value: -1 <anchor id="GooCanvasText--text"/>The <literal>"text"</literal> property GooCanvasText:text "text" gchararray : Read / Write The text to display.Default value: NULL <anchor id="GooCanvasText--use-markup"/>The <literal>"use-markup"</literal> property GooCanvasText:use-markup "use-markup" gboolean : Read / Write Whether to parse PangoMarkup in the text, to support different styles.Default value: FALSE <anchor id="GooCanvasText--width"/>The <literal>"width"</literal> property GooCanvasText:width "width" gdouble : Read / Write The width to use to layout the text.Default value: -1 <anchor id="GooCanvasText--wrap"/>The <literal>"wrap"</literal> property GooCanvasText:wrap "wrap" PangoWrapMode : Read / Write The preferred method of wrapping the string if a width has been set.Default value: PANGO_WRAP_WORD <anchor id="GooCanvasText--x"/>The <literal>"x"</literal> property GooCanvasText:x "x" gdouble : Read / Write The x coordinate of the text.Default value: 0 <anchor id="GooCanvasText--y"/>The <literal>"y"</literal> property GooCanvasText:y "y" gdouble : Read / Write The y coordinate of the text.Default value: 0 goocanvas-0.15/docs/xml/goocanvasrect.xml0000644000076400007640000002374311222215703015464 00000000000000 GooCanvasRect 3 GOOCANVAS Library GooCanvasRect a rectangle item. Synopsis GooCanvasRect; GooCanvasItem* goo_canvas_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasRect Implemented Interfaces GooCanvasRect implements GooCanvasItem. Properties "height" gdouble : Read / Write "radius-x" gdouble : Read / Write "radius-y" gdouble : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasRect represents a rectangle item. It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(). To create a GooCanvasRect use goo_canvas_rect_new(). To get or set the properties of an existing GooCanvasRect, use g_object_get() and g_object_set(). Details <anchor id="GooCanvasRect-struct" role="struct"/>GooCanvasRect GooCanvasRecttypedef struct _GooCanvasRect GooCanvasRect; The GooCanvasRect struct contains private data only. <anchor id="goo-canvas-rect-new" role="function"/>goo_canvas_rect_new () goo_canvas_rect_newGooCanvasItem* goo_canvas_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); Creates a new rectangle item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. x : the x coordinate of the left of the rectangle. y : the y coordinate of the top of the rectangle. width : the width of the rectangle. height : the height of the rectangle. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new rectangle item. Here's an example showing how to create a rectangle at (100,100) with a width of 200 and a height of 100. GooCanvasItem *rect = goo_canvas_rect_new (mygroup, 100.0, 100.0, 200.0, 100.0, "stroke-color", "red", "line-width", 5.0, "fill-color", "blue", NULL); Property Details <anchor id="GooCanvasRect--height"/>The <literal>"height"</literal> property GooCanvasRect:height "height" gdouble : Read / Write The height of the rectangle.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasRect--radius-x"/>The <literal>"radius-x"</literal> property GooCanvasRect:radius-x "radius-x" gdouble : Read / Write The horizontal radius to use for rounded corners.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasRect--radius-y"/>The <literal>"radius-y"</literal> property GooCanvasRect:radius-y "radius-y" gdouble : Read / Write The vertical radius to use for rounded corners.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasRect--width"/>The <literal>"width"</literal> property GooCanvasRect:width "width" gdouble : Read / Write The width of the rectangle.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasRect--x"/>The <literal>"x"</literal> property GooCanvasRect:x "x" gdouble : Read / Write The x coordinate of the rectangle.Default value: 0 <anchor id="GooCanvasRect--y"/>The <literal>"y"</literal> property GooCanvasRect:y "y" gdouble : Read / Write The y coordinate of the rectangle.Default value: 0 goocanvas-0.15/docs/xml/goocanvasrectmodel.xml0000644000076400007640000002536211222215703016504 00000000000000 GooCanvasRectModel 3 GOOCANVAS Library GooCanvasRectModel a model for rectangle items. Synopsis GooCanvasRectModel; GooCanvasItemModel* goo_canvas_rect_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasRectModel Implemented Interfaces GooCanvasRectModel implements GooCanvasItemModel. Properties "height" gdouble : Read / Write "radius-x" gdouble : Read / Write "radius-y" gdouble : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasRectModel represents a model for rectangle items. It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(). To create a GooCanvasRectModel use goo_canvas_rect_model_new(). To get or set the properties of an existing GooCanvasRectModel, use g_object_get() and g_object_set(). To respond to events such as mouse clicks on the rectangle you must connect to the signal handlers of the corresponding GooCanvasRect objects. (See goo_canvas_get_item() and "item-created".) Details <anchor id="GooCanvasRectModel-struct" role="struct"/>GooCanvasRectModel GooCanvasRectModeltypedef struct _GooCanvasRectModel GooCanvasRectModel; The GooCanvasRectModel struct contains private data only. <anchor id="goo-canvas-rect-model-new" role="function"/>goo_canvas_rect_model_new () goo_canvas_rect_model_newGooCanvasItemModel* goo_canvas_rect_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); Creates a new rectangle item. parent : the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. x : the x coordinate of the left of the rectangle. y : the y coordinate of the top of the rectangle. width : the width of the rectangle. height : the height of the rectangle. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new rectangle model. Here's an example showing how to create a rectangle at (100,100) with a width of 200 and a height of 100. GooCanvasItemModel *rect = goo_canvas_rect_model_new (mygroup, 100.0, 100.0, 200.0, 100.0, "stroke-color", "red", "line-width", 5.0, "fill-color", "blue", NULL); Property Details <anchor id="GooCanvasRectModel--height"/>The <literal>"height"</literal> property GooCanvasRectModel:height "height" gdouble : Read / Write The height of the rectangle.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasRectModel--radius-x"/>The <literal>"radius-x"</literal> property GooCanvasRectModel:radius-x "radius-x" gdouble : Read / Write The horizontal radius to use for rounded corners.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasRectModel--radius-y"/>The <literal>"radius-y"</literal> property GooCanvasRectModel:radius-y "radius-y" gdouble : Read / Write The vertical radius to use for rounded corners.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasRectModel--width"/>The <literal>"width"</literal> property GooCanvasRectModel:width "width" gdouble : Read / Write The width of the rectangle.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasRectModel--x"/>The <literal>"x"</literal> property GooCanvasRectModel:x "x" gdouble : Read / Write The x coordinate of the rectangle.Default value: 0 <anchor id="GooCanvasRectModel--y"/>The <literal>"y"</literal> property GooCanvasRectModel:y "y" gdouble : Read / Write The y coordinate of the rectangle.Default value: 0 goocanvas-0.15/docs/xml/goocanvasitem.xml0000644000076400007640000042722111222215703015464 00000000000000 GooCanvasItem 3 GOOCANVAS Library GooCanvasItem the interface for canvas items. Synopsis GooCanvasItem; GooCanvasItemIface; void goo_canvas_item_translate (GooCanvasItem *item, gdouble tx, gdouble ty); void goo_canvas_item_scale (GooCanvasItem *item, gdouble sx, gdouble sy); void goo_canvas_item_rotate (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_skew_x (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_skew_y (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); gboolean goo_canvas_item_get_transform (GooCanvasItem *item, cairo_matrix_t *transform); void goo_canvas_item_set_transform (GooCanvasItem *item, const cairo_matrix_t *transform); gboolean goo_canvas_item_get_simple_transform (GooCanvasItem *item, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation); void goo_canvas_item_set_simple_transform (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble rotation); void goo_canvas_item_get_bounds (GooCanvasItem *item, GooCanvasBounds *bounds); gboolean goo_canvas_item_is_visible (GooCanvasItem *item); gboolean goo_canvas_item_get_is_static (GooCanvasItem *item); void goo_canvas_item_set_is_static (GooCanvasItem *item, gboolean is_static); void goo_canvas_item_animate (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); void goo_canvas_item_stop_animation (GooCanvasItem *item); void goo_canvas_item_raise (GooCanvasItem *item, GooCanvasItem *above); void goo_canvas_item_lower (GooCanvasItem *item, GooCanvasItem *below); void goo_canvas_item_remove (GooCanvasItem *item); GooCanvas* goo_canvas_item_get_canvas (GooCanvasItem *item); void goo_canvas_item_set_canvas (GooCanvasItem *item, GooCanvas *canvas); GooCanvasItem* goo_canvas_item_get_parent (GooCanvasItem *item); void goo_canvas_item_set_parent (GooCanvasItem *item, GooCanvasItem *parent); GooCanvasItemModel* goo_canvas_item_get_model (GooCanvasItem *item); void goo_canvas_item_set_model (GooCanvasItem *item, GooCanvasItemModel *model); gboolean goo_canvas_item_is_container (GooCanvasItem *item); gint goo_canvas_item_get_n_children (GooCanvasItem *item); GooCanvasItem* goo_canvas_item_get_child (GooCanvasItem *item, gint child_num); gint goo_canvas_item_find_child (GooCanvasItem *item, GooCanvasItem *child); void goo_canvas_item_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position); void goo_canvas_item_move_child (GooCanvasItem *item, gint old_position, gint new_position); void goo_canvas_item_remove_child (GooCanvasItem *item, gint child_num); gboolean goo_canvas_item_get_transform_for_child (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform); GooCanvasStyle* goo_canvas_item_get_style (GooCanvasItem *item); void goo_canvas_item_set_style (GooCanvasItem *item, GooCanvasStyle *style); void goo_canvas_item_request_update (GooCanvasItem *item); void goo_canvas_item_ensure_updated (GooCanvasItem *item); void goo_canvas_item_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds); gboolean goo_canvas_item_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area); gdouble goo_canvas_item_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width); void goo_canvas_item_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset); GList* goo_canvas_item_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_is_visible, GList *found_items); void goo_canvas_item_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); void goo_canvas_item_class_install_child_property (GObjectClass *iclass, guint property_id, GParamSpec *pspec); GParamSpec** goo_canvas_item_class_list_child_properties (GObjectClass *iclass, guint *n_properties); GParamSpec* goo_canvas_item_class_find_child_property (GObjectClass *iclass, const gchar *property_name); void goo_canvas_item_get_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, GValue *value); void goo_canvas_item_set_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, const GValue *value); void goo_canvas_item_get_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...); void goo_canvas_item_get_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args); void goo_canvas_item_set_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...); void goo_canvas_item_set_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args); Object Hierarchy GInterface +----GooCanvasItem Prerequisites GooCanvasItem requires GObject. Known Implementations GooCanvasItem is implemented by GooCanvasGrid, GooCanvasRect, GooCanvasTable, GooCanvasPolyline, GooCanvasPath, GooCanvasEllipse, GooCanvasText, GooCanvasWidget, GooCanvasImage, GooCanvasGroup and GooCanvasItemSimple. Properties "can-focus" gboolean : Read / Write "description" gchararray : Read / Write "parent" GooCanvasItem : Read / Write "pointer-events" GooCanvasPointerEvents : Read / Write "title" gchararray : Read / Write "tooltip" gchararray : Read / Write "transform" GooCairoMatrix : Read / Write "visibility" GooCanvasItemVisibility : Read / Write "visibility-threshold" gdouble : Read / Write Signals "animation-finished" : Run Last "button-press-event" : Run Last "button-release-event" : Run Last "child-notify" : Run First / No Recursion / Has Details / No Hooks "enter-notify-event" : Run Last "focus-in-event" : Run Last "focus-out-event" : Run Last "grab-broken-event" : Run Last "key-press-event" : Run Last "key-release-event" : Run Last "leave-notify-event" : Run Last "motion-notify-event" : Run Last "query-tooltip" : Run Last "scroll-event" : Run Last Description GooCanvasItem defines the interface that canvas items must implement, and contains methods for operating on canvas items. Details <anchor id="GooCanvasItem-struct" role="struct"/>GooCanvasItem GooCanvasItemtypedef struct _GooCanvasItem GooCanvasItem; GooCanvasItem is a typedef used for objects that implement the GooCanvasItem interface. (There is no actual GooCanvasItem struct, since it is only an interface. But using 'GooCanvasItem' is more helpful than using 'GObject'.) <anchor id="GooCanvasItemIface" role="struct"/>GooCanvasItemIface GooCanvasItemIfacetypedef struct { /* Virtual methods that group items must implement. */ GooCanvas* (* get_canvas) (GooCanvasItem *item); void (* set_canvas) (GooCanvasItem *item, GooCanvas *canvas); gint (* get_n_children) (GooCanvasItem *item); GooCanvasItem* (* get_child) (GooCanvasItem *item, gint child_num); void (* request_update) (GooCanvasItem *item); /* Virtual methods that group items may implement. */ void (* add_child) (GooCanvasItem *item, GooCanvasItem *child, gint position); void (* move_child) (GooCanvasItem *item, gint old_position, gint new_position); void (* remove_child) (GooCanvasItem *item, gint child_num); void (* get_child_property) (GooCanvasItem *item, GooCanvasItem *child, guint property_id, GValue *value, GParamSpec *pspec); void (* set_child_property) (GooCanvasItem *item, GooCanvasItem *child, guint property_id, const GValue *value, GParamSpec *pspec); gboolean (* get_transform_for_child) (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform); /* Virtual methods that all canvas items must implement. */ GooCanvasItem* (* get_parent) (GooCanvasItem *item); void (* set_parent) (GooCanvasItem *item, GooCanvasItem *parent); void (* get_bounds) (GooCanvasItem *item, GooCanvasBounds *bounds); GList* (* get_items_at) (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_is_visible, GList *found_items); void (* update) (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds); void (* paint) (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); gboolean (* get_requested_area) (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area); void (* allocate_area) (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset); /* Virtual methods that canvas items may implement. */ gboolean (* get_transform) (GooCanvasItem *item, cairo_matrix_t *transform); void (* set_transform) (GooCanvasItem *item, const cairo_matrix_t *transform); GooCanvasStyle* (* get_style) (GooCanvasItem *item); void (* set_style) (GooCanvasItem *item, GooCanvasStyle *style); gboolean (* is_visible) (GooCanvasItem *item); gdouble (* get_requested_height) (GooCanvasItem *item, cairo_t *cr, gdouble width); /* Virtual methods that model/view items must implement. */ GooCanvasItemModel* (* get_model) (GooCanvasItem *item); void (* set_model) (GooCanvasItem *item, GooCanvasItemModel *model); /* Signals. */ gboolean (* enter_notify_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event); gboolean (* leave_notify_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event); gboolean (* motion_notify_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event); gboolean (* button_press_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event); gboolean (* button_release_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event); gboolean (* focus_in_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event); gboolean (* focus_out_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event); gboolean (* key_press_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event); gboolean (* key_release_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event); gboolean (* grab_broken_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventGrabBroken *event); void (* child_notify) (GooCanvasItem *item, GParamSpec *pspec); gboolean (* query_tooltip) (GooCanvasItem *item, gdouble x, gdouble y, gboolean keyboard_tooltip, GtkTooltip *tooltip); gboolean (* get_is_static) (GooCanvasItem *item); void (* set_is_static) (GooCanvasItem *item, gboolean is_static); void (* animation_finished) (GooCanvasItem *item, gboolean stopped); gboolean (* scroll_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventScroll *event); } GooCanvasItemIface; GooCanvasItemIFace holds the virtual methods that make up the GooCanvasItem interface. Simple canvas items only need to implement the get_parent(), set_parent(), get_bounds(), get_items_at(), update() and paint() methods (and also get_requested_area() and allocate_area() if they are going to be used inside a layout container like GooCanvasTable). Items that support transforms should also implement get_transform() and set_transform(). Items that support styles should implement get_style() and set_style(). Container items must implement get_canvas(), set_canvas(), get_n_children(), get_child() and request_update(). Containers that support dynamic changes to their children should implement add_child(), move_child() and remove_child(). Layout containers like GooCanvasTable may implement get_child_property(), set_child_property() and get_transform_for_child(). get_canvas () returns the canvas the item is in. set_canvas () sets the canvas the item is in. get_n_children () returns the number of children of the item. get_child () returns the child at the given index. request_update () requests that an update is scheduled. add_child () adds a child. move_child () moves a child up or down the stacking order. remove_child () removes a child. get_child_property () gets a child property of a given child item, e.g. the "row" or "column" property of an item in a GooCanvasTable. set_child_property () sets a child property for a given child item. get_transform_for_child () gets the transform used to lay out a given child. get_parent () gets the item's parent. set_parent () sets the item's parent. get_bounds () gets the bounds of the item. get_items_at () gets all the items at the given point. update () updates the item, if needed. It recalculates the bounds of the item and requests redraws of parts of the canvas if necessary. paint () renders the item to the given cairo context. get_requested_area () returns the requested area of the item, in its parent's coordinate space. This is only used for items in layout containers such as GooCanvasTable. allocate_area () allocates the item's area, in its parent's coordinate space. The item must recalculate its bounds and request redraws of parts of the canvas if necessary. This is only used for items in layout containers such as GooCanvasTable. get_transform () gets the item's transformation matrix. set_transform () sets the item's transformation matrix. get_style () gets the item's style. set_style () sets the item's style. is_visible () returns TRUE if the item is currently visible. get_requested_height () returns the requested height of the item, given a particular allocated width, using the parent's coordinate space. get_model () gets the model that the canvas item is viewing. set_model () sets the model that the canvas item will view. enter_notify_event () signal emitted when the mouse enters the item. leave_notify_event () signal emitted when the mouse leaves the item. motion_notify_event () signal emitted when the mouse moves within the item. button_press_event () signal emitted when a mouse button is pressed within the item. button_release_event () signal emitted when a mouse button is released. focus_in_event () signal emitted when the item receices the keyboard focus. focus_out_event () signal emitted when the item loses the keyboard focus. key_press_event () signal emitted when a key is pressed. key_release_event () signal emitted when a key is released. grab_broken_event () signal emitted when a grab that the item has is lost. child_notify () signal emitted when a child property is changed. query_tooltip () signal emitted to query the tooltip of an item. get_is_static () returns TRUE if the item is static. set_is_static () notifies the item whether it is static or not. animation_finished () signal emitted when the item's animation has finished. scroll_event () signal emitted when the mouse wheel is activated within the item. <anchor id="goo-canvas-item-translate" role="function"/>goo_canvas_item_translate () goo_canvas_item_translatevoid goo_canvas_item_translate (GooCanvasItem *item, gdouble tx, gdouble ty); Translates the origin of the item's coordinate system by the given amounts. item : an item. tx : the amount to move the origin in the horizontal direction. ty : the amount to move the origin in the vertical direction. <anchor id="goo-canvas-item-scale" role="function"/>goo_canvas_item_scale () goo_canvas_item_scalevoid goo_canvas_item_scale (GooCanvasItem *item, gdouble sx, gdouble sy); Scales the item's coordinate system by the given amounts. item : an item. sx : the amount to scale the horizontal axis. sy : the amount to scale the vertical axis. <anchor id="goo-canvas-item-rotate" role="function"/>goo_canvas_item_rotate () goo_canvas_item_rotatevoid goo_canvas_item_rotate (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); Rotates the item's coordinate system by the given amount, about the given origin. item : an item. degrees : the clockwise angle of rotation. cx : the x coordinate of the origin of the rotation. cy : the y coordinate of the origin of the rotation. <anchor id="goo-canvas-item-skew-x" role="function"/>goo_canvas_item_skew_x () goo_canvas_item_skew_xvoid goo_canvas_item_skew_x (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); Skews the item's coordinate system along the x axis by the given amount, about the given origin. item : an item. degrees : the skew angle. cx : the x coordinate of the origin of the skew transform. cy : the y coordinate of the origin of the skew transform. <anchor id="goo-canvas-item-skew-y" role="function"/>goo_canvas_item_skew_y () goo_canvas_item_skew_yvoid goo_canvas_item_skew_y (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); Skews the item's coordinate system along the y axis by the given amount, about the given origin. item : an item. degrees : the skew angle. cx : the x coordinate of the origin of the skew transform. cy : the y coordinate of the origin of the skew transform. <anchor id="goo-canvas-item-get-transform" role="function"/>goo_canvas_item_get_transform () goo_canvas_item_get_transformgboolean goo_canvas_item_get_transform (GooCanvasItem *item, cairo_matrix_t *transform); Gets the transformation matrix of an item. item : an item. transform : the place to store the transform. Returns : TRUE if a transform is set. <anchor id="goo-canvas-item-set-transform" role="function"/>goo_canvas_item_set_transform () goo_canvas_item_set_transformvoid goo_canvas_item_set_transform (GooCanvasItem *item, const cairo_matrix_t *transform); Sets the transformation matrix of an item. item : an item. transform : the new transformation matrix, or NULL to reset the transformation to the identity matrix. <anchor id="goo-canvas-item-get-simple-transform" role="function"/>goo_canvas_item_get_simple_transform () goo_canvas_item_get_simple_transformgboolean goo_canvas_item_get_simple_transform (GooCanvasItem *item, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation); This function can be used to get the position, scale and rotation of an item, providing that the item has a simple transformation matrix (e.g. set with goo_canvas_item_set_simple_transform(), or using a combination of simple translate, scale and rotate operations). If the item has a complex transformation matrix the results will be incorrect. item : an item. x : returns the x coordinate of the origin of the item's coordinate space. y : returns the y coordinate of the origin of the item's coordinate space. scale : returns the scale of the item. rotation : returns the clockwise rotation of the item, in degrees (0-360). Returns : TRUE if a transform is set. <anchor id="goo-canvas-item-set-simple-transform" role="function"/>goo_canvas_item_set_simple_transform () goo_canvas_item_set_simple_transformvoid goo_canvas_item_set_simple_transform (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble rotation); A convenience function to set the item's transformation matrix. item : an item. x : the x coordinate of the origin of the item's coordinate space. y : the y coordinate of the origin of the item's coordinate space. scale : the scale of the item. rotation : the clockwise rotation of the item, in degrees. <anchor id="goo-canvas-item-get-bounds" role="function"/>goo_canvas_item_get_bounds () goo_canvas_item_get_boundsvoid goo_canvas_item_get_bounds (GooCanvasItem *item, GooCanvasBounds *bounds); Gets the bounds of the item. Note that the bounds includes the entire fill and stroke extents of the item, whether they are painted or not. item : a GooCanvasItem. bounds : a GooCanvasBounds to return the bounds in. <anchor id="goo-canvas-item-is-visible" role="function"/>goo_canvas_item_is_visible () goo_canvas_item_is_visiblegboolean goo_canvas_item_is_visible (GooCanvasItem *item); Checks if the item is visible. This entails checking the item's own visibility setting, as well as those of its ancestors. Note that the item may be scrolled off the screen and so may not be actually visible to the user. item : a GooCanvasItem. Returns : TRUE if the item is visible. <anchor id="goo-canvas-item-get-is-static" role="function"/>goo_canvas_item_get_is_static () goo_canvas_item_get_is_staticgboolean goo_canvas_item_get_is_static (GooCanvasItem *item); Returns TRUE if the item is static. Static items do not move or change size when the canvas is scrolled or the scale changes. item : an item. Returns : TRUE if the item is static. <anchor id="goo-canvas-item-set-is-static" role="function"/>goo_canvas_item_set_is_static () goo_canvas_item_set_is_staticvoid goo_canvas_item_set_is_static (GooCanvasItem *item, gboolean is_static); Notifies the item that it is static. Static items do not move or change size when the canvas is scrolled or the scale changes. Container items such as GooCanvasGroup should call this function when children are added, to notify children whether they are static or not. Containers should also pass on any changes in their own status to children. item : an item. is_static : if the item is static. <anchor id="goo-canvas-item-animate" role="function"/>goo_canvas_item_animate () goo_canvas_item_animatevoid goo_canvas_item_animate (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); Animates an item from its current position to the given offsets, scale and rotation. item : an item. x : the final x coordinate. y : the final y coordinate. scale : the final scale. degrees : the final rotation. This can be negative to rotate anticlockwise, and can also be greater than 360 to rotate a number of times. absolute : if the x, y, scale and degrees values are absolute, or relative to the current transform. Note that absolute animations only work if the item currently has a simple transform. If the item has a shear or some other complicated transform it may result in strange animations. duration : the duration of the animation, in milliseconds (1/1000ths of a second). step_time : the time between each animation step, in milliseconds. type : specifies what happens when the animation finishes. <anchor id="goo-canvas-item-stop-animation" role="function"/>goo_canvas_item_stop_animation () goo_canvas_item_stop_animationvoid goo_canvas_item_stop_animation (GooCanvasItem *item); Stops any current animation for the given item, leaving it at its current position. item : an item. <anchor id="goo-canvas-item-raise" role="function"/>goo_canvas_item_raise () goo_canvas_item_raisevoid goo_canvas_item_raise (GooCanvasItem *item, GooCanvasItem *above); Raises an item in the stacking order. item : an item. above : the item to raise item above, or NULL to raise item to the top of the stack. <anchor id="goo-canvas-item-lower" role="function"/>goo_canvas_item_lower () goo_canvas_item_lowervoid goo_canvas_item_lower (GooCanvasItem *item, GooCanvasItem *below); Lowers an item in the stacking order. item : an item. below : the item to lower item below, or NULL to lower item to the bottom of the stack. <anchor id="goo-canvas-item-remove" role="function"/>goo_canvas_item_remove () goo_canvas_item_removevoid goo_canvas_item_remove (GooCanvasItem *item); Removes an item from its parent. If the item is in a canvas it will be removed. This would normally also result in the item being freed. item : an item. <anchor id="goo-canvas-item-get-canvas" role="function"/>goo_canvas_item_get_canvas () goo_canvas_item_get_canvasGooCanvas* goo_canvas_item_get_canvas (GooCanvasItem *item); Returns the GooCanvas containing the given GooCanvasItem. item : a GooCanvasItem. Returns : the GooCanvas. <anchor id="goo-canvas-item-set-canvas" role="function"/>goo_canvas_item_set_canvas () goo_canvas_item_set_canvasvoid goo_canvas_item_set_canvas (GooCanvasItem *item, GooCanvas *canvas); This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup. It sets the canvas of the item. item : a GooCanvasItem. canvas : a GooCanvas <anchor id="goo-canvas-item-get-parent" role="function"/>goo_canvas_item_get_parent () goo_canvas_item_get_parentGooCanvasItem* goo_canvas_item_get_parent (GooCanvasItem *item); Gets the parent of the given item. item : an item. Returns : the parent item, or NULL if the item has no parent. <anchor id="goo-canvas-item-set-parent" role="function"/>goo_canvas_item_set_parent () goo_canvas_item_set_parentvoid goo_canvas_item_set_parent (GooCanvasItem *item, GooCanvasItem *parent); This function is only intended to be used when implementing new canvas items (specifically container items such as GooCanvasGroup). It sets the parent of the child item. item : an item. parent : the new parent item. This function cannot be used to add an item to a group or to change the parent of an item. To do that use the "parent" property. <anchor id="goo-canvas-item-get-model" role="function"/>goo_canvas_item_get_model () goo_canvas_item_get_modelGooCanvasItemModel* goo_canvas_item_get_model (GooCanvasItem *item); Gets the model of the given canvas item. item : a GooCanvasItem. Returns : the item's model, or NULL if it has no model. <anchor id="goo-canvas-item-set-model" role="function"/>goo_canvas_item_set_model () goo_canvas_item_set_modelvoid goo_canvas_item_set_model (GooCanvasItem *item, GooCanvasItemModel *model); Sets the model of the given canvas item. item : a GooCanvasItem. model : a GooCanvasItemModel. <anchor id="goo-canvas-item-is-container" role="function"/>goo_canvas_item_is_container () goo_canvas_item_is_containergboolean goo_canvas_item_is_container (GooCanvasItem *item); Tests to see if the given item is a container. item : an item. Returns : TRUE if the item is a container. <anchor id="goo-canvas-item-get-n-children" role="function"/>goo_canvas_item_get_n_children () goo_canvas_item_get_n_childrengint goo_canvas_item_get_n_children (GooCanvasItem *item); Gets the number of children of the container. item : a container item. Returns : the number of children. <anchor id="goo-canvas-item-get-child" role="function"/>goo_canvas_item_get_child () goo_canvas_item_get_childGooCanvasItem* goo_canvas_item_get_child (GooCanvasItem *item, gint child_num); Gets the child item at the given stack position. item : a container item. child_num : the position of a child in the container's stack. Returns : the child item at the given stack position, or NULL if child_num is out of range. <anchor id="goo-canvas-item-find-child" role="function"/>goo_canvas_item_find_child () goo_canvas_item_find_childgint goo_canvas_item_find_child (GooCanvasItem *item, GooCanvasItem *child); Attempts to find the given child item with the container's stack. item : a container item. child : the child item to find. Returns : the position of the given child item, or -1 if it isn't found. <anchor id="goo-canvas-item-add-child" role="function"/>goo_canvas_item_add_child () goo_canvas_item_add_childvoid goo_canvas_item_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position); Adds a child item to a container item at the given stack position. item : the container to add the item to. child : the item to add. position : the position of the item, or -1 to place it last (at the top of the stacking order). <anchor id="goo-canvas-item-move-child" role="function"/>goo_canvas_item_move_child () goo_canvas_item_move_childvoid goo_canvas_item_move_child (GooCanvasItem *item, gint old_position, gint new_position); Moves a child item to a new stack position within the container. item : a container item. old_position : the current position of the child item. new_position : the new position of the child item. <anchor id="goo-canvas-item-remove-child" role="function"/>goo_canvas_item_remove_child () goo_canvas_item_remove_childvoid goo_canvas_item_remove_child (GooCanvasItem *item, gint child_num); Removes the child item at the given position. item : a container item. child_num : the position of the child item to remove. <anchor id="goo-canvas-item-get-transform-for-child" role="function"/>goo_canvas_item_get_transform_for_child () goo_canvas_item_get_transform_for_childgboolean goo_canvas_item_get_transform_for_child (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform); Gets the transformation matrix of an item combined with any special transform needed for the given child. These special transforms are used by layout items such as GooCanvasTable. item : an item. child : a child of item. transform : the place to store the transform. Returns : TRUE if a transform is set. <anchor id="goo-canvas-item-get-style" role="function"/>goo_canvas_item_get_style () goo_canvas_item_get_styleGooCanvasStyle* goo_canvas_item_get_style (GooCanvasItem *item); Gets the item's style. If the item doesn't have its own style it will return its parent's style. item : an item. Returns : the item's style. <anchor id="goo-canvas-item-set-style" role="function"/>goo_canvas_item_set_style () goo_canvas_item_set_stylevoid goo_canvas_item_set_style (GooCanvasItem *item, GooCanvasStyle *style); Sets the item's style, by copying the properties from the given style. item : an item. style : a style. <anchor id="goo-canvas-item-request-update" role="function"/>goo_canvas_item_request_update () goo_canvas_item_request_updatevoid goo_canvas_item_request_update (GooCanvasItem *item); This function is only intended to be used when implementing new canvas items. It requests that an update of the item is scheduled. It will be performed as soon as the application is idle, and before the canvas is redrawn. item : a GooCanvasItem. <anchor id="goo-canvas-item-ensure-updated" role="function"/>goo_canvas_item_ensure_updated () goo_canvas_item_ensure_updatedvoid goo_canvas_item_ensure_updated (GooCanvasItem *item); This function is only intended to be used when implementing new canvas items. It updates the canvas immediately, if an update is scheduled. This ensures that all item bounds are up-to-date. item : a GooCanvasItem. <anchor id="goo-canvas-item-update" role="function"/>goo_canvas_item_update () goo_canvas_item_updatevoid goo_canvas_item_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds); This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup. Updates the item, if needed, and any children. item : a GooCanvasItem. entire_tree : if the entire subtree should be updated. cr : a cairo context. bounds : a GooCanvasBounds to return the new bounds in. <anchor id="goo-canvas-item-get-requested-area" role="function"/>goo_canvas_item_get_requested_area () goo_canvas_item_get_requested_areagboolean goo_canvas_item_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area); This function is only intended to be used when implementing new canvas items, specifically layout items such as GooCanvasTable. It gets the requested area of a child item. item : a GooCanvasItem. cr : a cairo context. requested_area : a GooCanvasBounds to return the requested area in, in the parent's coordinate space. Returns : TRUE if the item should be allocated space. <anchor id="goo-canvas-item-get-requested-height" role="function"/>goo_canvas_item_get_requested_height () goo_canvas_item_get_requested_heightgdouble goo_canvas_item_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width); This function is only intended to be used when implementing new canvas items, specifically layout items such as GooCanvasTable. It gets the requested height of a child item, assuming it is allocated the given width. This is useful for text items whose requested height may change depending on the allocated width. item : a GooCanvasItem. cr : a cairo context. width : the width that the item may be allocated. Returns : the requested height of the item, given the allocated width, or -1 if the item doesn't support this method or its height doesn't change when allocated different widths. <anchor id="goo-canvas-item-allocate-area" role="function"/>goo_canvas_item_allocate_area () goo_canvas_item_allocate_areavoid goo_canvas_item_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset); This function is only intended to be used when implementing new canvas items, specifically layout items such as GooCanvasTable. It allocates an area to a child GooCanvasItem. Note that the parent layout item will use a transform to move each of its children for the layout, so there is no need for the child item to reposition itself. It only needs to recalculate its device bounds. To help recalculate the item's device bounds, the x_offset and y_offset of the child item's allocated position from its requested position are provided. Simple items can just add these to their bounds. item : a GooCanvasItem. cr : a cairo context. requested_area : the area that the item originally requested, in the parent's coordinate space. allocated_area : the area that the item has been allocated, in the parent's coordinate space. x_offset : the x offset of the allocated area from the requested area in the device coordinate space. y_offset : the y offset of the allocated area from the requested area in the device coordinate space. <anchor id="goo-canvas-item-get-items-at" role="function"/>goo_canvas_item_get_items_at () goo_canvas_item_get_items_atGList* goo_canvas_item_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_is_visible, GList *found_items); This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup. It gets the items at the given point. item : a GooCanvasItem. x : the x coordinate of the point. y : the y coordinate of the point. cr : a cairo contect. is_pointer_event : TRUE if the "pointer-events" properties of items should be used to determine which parts of the item are tested. parent_is_visible : TRUE if the parent item is visible (which implies that all ancestors are also visible). found_items : the list of items found so far. Returns : the found_items list, with any more found items added onto the start of the list, leaving the top item first. <anchor id="goo-canvas-item-paint" role="function"/>goo_canvas_item_paint () goo_canvas_item_paintvoid goo_canvas_item_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); This function is only intended to be used when implementing new canvas items, specifically container items such as GooCanvasGroup. It paints the item and all children if they intersect the given bounds. Note that the scale argument may be different to the current scale in the GooCanvasItem, e.g. when the canvas is being printed. item : a GooCanvasItem. cr : a cairo context. bounds : the bounds that need to be repainted, in device space. scale : the scale to use to determine whether an item should be painted. See "visibility-threshold". <anchor id="goo-canvas-item-class-install-child-property" role="function"/>goo_canvas_item_class_install_child_property () goo_canvas_item_class_install_child_propertyvoid goo_canvas_item_class_install_child_property (GObjectClass *iclass, guint property_id, GParamSpec *pspec); This function is only intended to be used when implementing new canvas items, specifically layout container items such as GooCanvasTable. It installs a child property on a canvas item class. iclass : a GObjectClass property_id : the id for the property pspec : the GParamSpec for the property <anchor id="goo-canvas-item-class-list-child-properties" role="function"/>goo_canvas_item_class_list_child_properties () goo_canvas_item_class_list_child_propertiesGParamSpec** goo_canvas_item_class_list_child_properties (GObjectClass *iclass, guint *n_properties); This function is only intended to be used when implementing new canvas items, specifically layout container items such as GooCanvasTable. It returns all child properties of a canvas item class. iclass : a GObjectClass n_properties : location to return the number of child properties found Returns : a newly allocated array of GParamSpec*. The array must be freed with g_free(). <anchor id="goo-canvas-item-class-find-child-property" role="function"/>goo_canvas_item_class_find_child_property () goo_canvas_item_class_find_child_propertyGParamSpec* goo_canvas_item_class_find_child_property (GObjectClass *iclass, const gchar *property_name); This function is only intended to be used when implementing new canvas items, specifically layout container items such as GooCanvasTable. It finds a child property of a canvas item class by name. iclass : a GObjectClass property_name : the name of the child property to find Returns : the GParamSpec of the child property or NULL if class has no child property with that name. <anchor id="goo-canvas-item-get-child-property" role="function"/>goo_canvas_item_get_child_property () goo_canvas_item_get_child_propertyvoid goo_canvas_item_get_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, GValue *value); Gets a child property of child. item : a GooCanvasItem. child : a child GooCanvasItem. property_name : the name of the child property to get. value : a location to return the value. <anchor id="goo-canvas-item-set-child-property" role="function"/>goo_canvas_item_set_child_property () goo_canvas_item_set_child_propertyvoid goo_canvas_item_set_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, const GValue *value); Sets a child property of child. item : a GooCanvasItem. child : a child GooCanvasItem. property_name : the name of the child property to set. value : the value to set the property to. <anchor id="goo-canvas-item-get-child-properties" role="function"/>goo_canvas_item_get_child_properties () goo_canvas_item_get_child_propertiesvoid goo_canvas_item_get_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...); Gets the values of one or more child properties of child. item : a GooCanvasItem. child : a child GooCanvasItem. ... : pairs of property names and value pointers, and a terminating NULL. <anchor id="goo-canvas-item-get-child-properties-valist" role="function"/>goo_canvas_item_get_child_properties_valist () goo_canvas_item_get_child_properties_valistvoid goo_canvas_item_get_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args); Gets the values of one or more child properties of child. item : a GooCanvasItem. child : a child GooCanvasItem. var_args : pairs of property names and value pointers, and a terminating NULL. <anchor id="goo-canvas-item-set-child-properties" role="function"/>goo_canvas_item_set_child_properties () goo_canvas_item_set_child_propertiesvoid goo_canvas_item_set_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...); Sets the values of one or more child properties of child. item : a GooCanvasItem. child : a child GooCanvasItem. ... : pairs of property names and values, and a terminating NULL. <anchor id="goo-canvas-item-set-child-properties-valist" role="function"/>goo_canvas_item_set_child_properties_valist () goo_canvas_item_set_child_properties_valistvoid goo_canvas_item_set_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args); Sets the values of one or more child properties of child. item : a GooCanvasItem. child : a child GooCanvasItem. var_args : pairs of property names and values, and a terminating NULL. Property Details <anchor id="GooCanvasItem--can-focus"/>The <literal>"can-focus"</literal> property GooCanvasItem:can-focus "can-focus" gboolean : Read / Write If the item can take the keyboard focus.Default value: FALSE <anchor id="GooCanvasItem--description"/>The <literal>"description"</literal> property GooCanvasItem:description "description" gchararray : Read / Write A description of the item for use by assistive technologies.Default value: NULL <anchor id="GooCanvasItem--parent"/>The <literal>"parent"</literal> property GooCanvasItem:parent "parent" GooCanvasItem : Read / Write The parent item. <anchor id="GooCanvasItem--pointer-events"/>The <literal>"pointer-events"</literal> property GooCanvasItem:pointer-events "pointer-events" GooCanvasPointerEvents : Read / Write Specifies when the item receives pointer events.Default value: GOO_CANVAS_EVENTS_VISIBLE_MASK|GOO_CANVAS_EVENTS_PAINTED_MASK|GOO_CANVAS_EVENTS_FILL_MASK|GOO_CANVAS_EVENTS_STROKE_MASK <anchor id="GooCanvasItem--title"/>The <literal>"title"</literal> property GooCanvasItem:title "title" gchararray : Read / Write A short context-rich description of the item for use by assistive technologies.Default value: NULL <anchor id="GooCanvasItem--tooltip"/>The <literal>"tooltip"</literal> property GooCanvasItem:tooltip "tooltip" gchararray : Read / Write The tooltip to display for the item.Default value: NULL <anchor id="GooCanvasItem--transform"/>The <literal>"transform"</literal> property GooCanvasItem:transform "transform" GooCairoMatrix : Read / Write The transformation matrix of the item. <anchor id="GooCanvasItem--visibility"/>The <literal>"visibility"</literal> property GooCanvasItem:visibility "visibility" GooCanvasItemVisibility : Read / Write When the canvas item is visible.Default value: GOO_CANVAS_ITEM_VISIBLE <anchor id="GooCanvasItem--visibility-threshold"/>The <literal>"visibility-threshold"</literal> property GooCanvasItem:visibility-threshold "visibility-threshold" gdouble : Read / Write The scale threshold at which the item becomes visible.Allowed values: >= 0 Default value: 0 Signal Details <anchor id="GooCanvasItem-animation-finished"/>The <literal>"animation-finished"</literal> signal GooCanvasItem::animation-finishedvoid user_function (GooCanvasItem *item, gboolean stopped, gpointer user_data) : Run Last Emitted when the item animation has finished. item : the item that received the signal. stopped : if the animation was explicitly stopped. user_data : user data set when the signal handler was connected. <anchor id="GooCanvasItem-button-press-event"/>The <literal>"button-press-event"</literal> signal GooCanvasItem::button-press-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) : Run Last Emitted when a mouse button is pressed in an item. item : the item that received the signal. target_item : the target of the event. event : the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-button-release-event"/>The <literal>"button-release-event"</literal> signal GooCanvasItem::button-release-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventButton *event, gpointer user_data) : Run Last Emitted when a mouse button is released in an item. item : the item that received the signal. target_item : the target of the event. event : the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-child-notify"/>The <literal>"child-notify"</literal> signal GooCanvasItem::child-notifyvoid user_function (GooCanvasItem *item, GParamSpec *pspec, gpointer user_data) : Run First / No Recursion / Has Details / No Hooks Emitted for each child property that has changed. The signal's detail holds the property name. item : the item that received the signal. pspec : the GParamSpec of the changed child property. user_data : user data set when the signal handler was connected. <anchor id="GooCanvasItem-enter-notify-event"/>The <literal>"enter-notify-event"</literal> signal GooCanvasItem::enter-notify-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, gpointer user_data) : Run Last Emitted when the mouse enters an item. item : the item that received the signal. target_item : the target of the event. event : the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-focus-in-event"/>The <literal>"focus-in-event"</literal> signal GooCanvasItem::focus-in-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventFocus *event, gpointer user_data) : Run Last Emitted when the item receives the keyboard focus. item : the item that received the signal. target_item : the target of the event. event : the event data. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-focus-out-event"/>The <literal>"focus-out-event"</literal> signal GooCanvasItem::focus-out-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventFocus *event, gpointer user_data) : Run Last Emitted when the item loses the keyboard focus. item : the item that received the signal. target_item : the target of the event. event : the event data. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-grab-broken-event"/>The <literal>"grab-broken-event"</literal> signal GooCanvasItem::grab-broken-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEvent *event, gpointer user_data) : Run Last Emitted when the item's keyboard or pointer grab was lost unexpectedly. item : the item that received the signal. target_item : the target of the event. event : the event data. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-key-press-event"/>The <literal>"key-press-event"</literal> signal GooCanvasItem::key-press-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventKey *event, gpointer user_data) : Run Last Emitted when a key is pressed and the item has the keyboard focus. item : the item that received the signal. target_item : the target of the event. event : the event data. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-key-release-event"/>The <literal>"key-release-event"</literal> signal GooCanvasItem::key-release-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventKey *event, gpointer user_data) : Run Last Emitted when a key is released and the item has the keyboard focus. item : the item that received the signal. target_item : the target of the event. event : the event data. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-leave-notify-event"/>The <literal>"leave-notify-event"</literal> signal GooCanvasItem::leave-notify-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventCrossing *event, gpointer user_data) : Run Last Emitted when the mouse leaves an item. item : the item that received the signal. target_item : the target of the event. event : the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-motion-notify-event"/>The <literal>"motion-notify-event"</literal> signal GooCanvasItem::motion-notify-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventMotion *event, gpointer user_data) : Run Last Emitted when the mouse moves within an item. item : the item that received the signal. target_item : the target of the event. event : the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. <anchor id="GooCanvasItem-query-tooltip"/>The <literal>"query-tooltip"</literal> signal GooCanvasItem::query-tooltipgboolean user_function (GooCanvasItem *item, gdouble x, gdouble y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer user_data) : Run Last Emitted when the mouse has paused over the item for a certain amount of time, or the tooltip was requested via the keyboard. Note that if keyboard_mode is TRUE, the values of x and y are undefined and should not be used. If the item wants to display a tooltip it should update tooltip and return TRUE. item : the item which received the signal. x : the x coordinate of the mouse. y : the y coordinate of the mouse. keyboard_mode : TRUE if the tooltip was triggered using the keyboard. tooltip : a GtkTooltip. user_data : user data set when the signal handler was connected. Returns : TRUE if the item has set a tooltip to show. <anchor id="GooCanvasItem-scroll-event"/>The <literal>"scroll-event"</literal> signal GooCanvasItem::scroll-eventgboolean user_function (GooCanvasItem *item, GooCanvasItem *target_item, GdkEventScroll *event, gpointer user_data) : Run Last Emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned in an item. item : the item that received the signal. target_item : the target of the event. event : the event data. The x & y fields contain the mouse position in the item's coordinate space. The x_root & y_root fields contain the same coordinates converted to the canvas coordinate space. user_data : user data set when the signal handler was connected. Returns : TRUE to stop the signal emission, or FALSE to let it continue. goocanvas-0.15/docs/xml/goocanvaspolylinemodel.xml0000644000076400007640000004274311222215703017404 00000000000000 GooCanvasPolylineModel 3 GOOCANVAS Library GooCanvasPolylineModel a model for polyline items (a series of lines with optional arrows). Synopsis GooCanvasPolylineModel; GooCanvasItemModel* goo_canvas_polyline_model_new (GooCanvasItemModel *parent, gboolean close_path, gint num_points, ...); GooCanvasItemModel* goo_canvas_polyline_model_new_line (GooCanvasItemModel *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasPolylineModel Implemented Interfaces GooCanvasPolylineModel implements GooCanvasItemModel. Properties "arrow-length" gdouble : Read / Write "arrow-tip-length" gdouble : Read / Write "arrow-width" gdouble : Read / Write "close-path" gboolean : Read / Write "end-arrow" gboolean : Read / Write "height" gdouble : Read / Write "points" GooCanvasPoints : Read / Write "start-arrow" gboolean : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasPolylineModel represents a model for polyline items, which are a series of one or more lines, with optional arrows at either end. It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(). To create a GooCanvasPolylineModel use goo_canvas_polyline_model_new(), or goo_canvas_polyline_model_new_line() for a simple line between two points. To get or set the properties of an existing GooCanvasPolylineModel, use g_object_get() and g_object_set(). To respond to events such as mouse clicks on the polyline you must connect to the signal handlers of the corresponding GooCanvasPolyline objects. (See goo_canvas_get_item() and "item-created".) Details <anchor id="GooCanvasPolylineModel-struct" role="struct"/>GooCanvasPolylineModel GooCanvasPolylineModeltypedef struct _GooCanvasPolylineModel GooCanvasPolylineModel; The GooCanvasPolylineModel struct contains private data only. <anchor id="goo-canvas-polyline-model-new" role="function"/>goo_canvas_polyline_model_new () goo_canvas_polyline_model_newGooCanvasItemModel* goo_canvas_polyline_model_new (GooCanvasItemModel *parent, gboolean close_path, gint num_points, ...); Creates a new polyline model. parent : the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. close_path : if the last point should be connected to the first. num_points : the number of points in the polyline. ... : the pairs of coordinates for each point in the line, followed by optional pairs of property names and values, and a terminating NULL. Returns : a new polyline model. Here's an example showing how to create a filled triangle with vertices at (100,100), (300,100), and (200,300). GooCanvasItemModel *polyline = goo_canvas_polyline_model_new (mygroup, TRUE, 3, 100.0, 100.0, 300.0, 100.0, 200.0, 300.0, "stroke-color", "red", "line-width", 5.0, "fill-color", "blue", NULL); <anchor id="goo-canvas-polyline-model-new-line" role="function"/>goo_canvas_polyline_model_new_line () goo_canvas_polyline_model_new_lineGooCanvasItemModel* goo_canvas_polyline_model_new_line (GooCanvasItemModel *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); Creates a new polyline model with a single line. parent : the parent model, or NULL. x1 : the x coordinate of the start of the line. y1 : the y coordinate of the start of the line. x2 : the x coordinate of the end of the line. y2 : the y coordinate of the end of the line. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new polyline model. Here's an example showing how to create a line from (100,100) to (300,300). GooCanvasItemModel *polyline = goo_canvas_polyline_model_new_line (mygroup, 100.0, 100.0, 300.0, 300.0, "stroke-color", "red", "line-width", 5.0, NULL); Property Details <anchor id="GooCanvasPolylineModel--arrow-length"/>The <literal>"arrow-length"</literal> property GooCanvasPolylineModel:arrow-length "arrow-length" gdouble : Read / Write The length of the arrows, as a multiple of the line width.Allowed values: >= 0 Default value: 5 <anchor id="GooCanvasPolylineModel--arrow-tip-length"/>The <literal>"arrow-tip-length"</literal> property GooCanvasPolylineModel:arrow-tip-length "arrow-tip-length" gdouble : Read / Write The length of the arrow tip, as a multiple of the line width.Allowed values: >= 0 Default value: 4 <anchor id="GooCanvasPolylineModel--arrow-width"/>The <literal>"arrow-width"</literal> property GooCanvasPolylineModel:arrow-width "arrow-width" gdouble : Read / Write The width of the arrows, as a multiple of the line width.Allowed values: >= 0 Default value: 4 <anchor id="GooCanvasPolylineModel--close-path"/>The <literal>"close-path"</literal> property GooCanvasPolylineModel:close-path "close-path" gboolean : Read / Write If the last point should be connected to the first.Default value: FALSE <anchor id="GooCanvasPolylineModel--end-arrow"/>The <literal>"end-arrow"</literal> property GooCanvasPolylineModel:end-arrow "end-arrow" gboolean : Read / Write If an arrow should be displayed at the end of the polyline.Default value: FALSE <anchor id="GooCanvasPolylineModel--height"/>The <literal>"height"</literal> property GooCanvasPolylineModel:height "height" gdouble : Read / Write The height of the polyline.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasPolylineModel--points"/>The <literal>"points"</literal> property GooCanvasPolylineModel:points "points" GooCanvasPoints : Read / Write The array of points. <anchor id="GooCanvasPolylineModel--start-arrow"/>The <literal>"start-arrow"</literal> property GooCanvasPolylineModel:start-arrow "start-arrow" gboolean : Read / Write If an arrow should be displayed at the start of the polyline.Default value: FALSE <anchor id="GooCanvasPolylineModel--width"/>The <literal>"width"</literal> property GooCanvasPolylineModel:width "width" gdouble : Read / Write The width of the polyline.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasPolylineModel--x"/>The <literal>"x"</literal> property GooCanvasPolylineModel:x "x" gdouble : Read / Write The x coordinate of the left-most point of the polyline.Default value: 0 <anchor id="GooCanvasPolylineModel--y"/>The <literal>"y"</literal> property GooCanvasPolylineModel:y "y" gdouble : Read / Write The y coordinate of the top-most point of the polyline.Default value: 0 goocanvas-0.15/docs/xml/goocanvasitemmodel.xml0000644000076400007640000025154611222215703016512 00000000000000 GooCanvasItemModel 3 GOOCANVAS Library GooCanvasItemModel the interface for canvas item models. Synopsis GooCanvasItemModel; GooCanvasItemModelIface; void goo_canvas_item_model_translate (GooCanvasItemModel *model, gdouble tx, gdouble ty); void goo_canvas_item_model_scale (GooCanvasItemModel *model, gdouble sx, gdouble sy); void goo_canvas_item_model_rotate (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_model_skew_x (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_model_skew_y (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); gboolean goo_canvas_item_model_get_transform (GooCanvasItemModel *model, cairo_matrix_t *transform); void goo_canvas_item_model_set_transform (GooCanvasItemModel *model, const cairo_matrix_t *transform); gboolean goo_canvas_item_model_get_simple_transform (GooCanvasItemModel *model, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation); void goo_canvas_item_model_set_simple_transform (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble rotation); void goo_canvas_item_model_animate (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); void goo_canvas_item_model_stop_animation (GooCanvasItemModel *model); void goo_canvas_item_model_raise (GooCanvasItemModel *model, GooCanvasItemModel *above); void goo_canvas_item_model_lower (GooCanvasItemModel *model, GooCanvasItemModel *below); void goo_canvas_item_model_remove (GooCanvasItemModel *model); GooCanvasItemModel* goo_canvas_item_model_get_parent (GooCanvasItemModel *model); void goo_canvas_item_model_set_parent (GooCanvasItemModel *model, GooCanvasItemModel *parent); gboolean goo_canvas_item_model_is_container (GooCanvasItemModel *model); gint goo_canvas_item_model_get_n_children (GooCanvasItemModel *model); GooCanvasItemModel* goo_canvas_item_model_get_child (GooCanvasItemModel *model, gint child_num); void goo_canvas_item_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position); void goo_canvas_item_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position); void goo_canvas_item_model_remove_child (GooCanvasItemModel *model, gint child_num); gint goo_canvas_item_model_find_child (GooCanvasItemModel *model, GooCanvasItemModel *child); GooCanvasStyle* goo_canvas_item_model_get_style (GooCanvasItemModel *model); void goo_canvas_item_model_set_style (GooCanvasItemModel *model, GooCanvasStyle *style); void goo_canvas_item_model_class_install_child_property (GObjectClass *mclass, guint property_id, GParamSpec *pspec); GParamSpec** goo_canvas_item_model_class_list_child_properties (GObjectClass *mclass, guint *n_properties); GParamSpec* goo_canvas_item_model_class_find_child_property (GObjectClass *mclass, const gchar *property_name); void goo_canvas_item_model_get_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, GValue *value); void goo_canvas_item_model_set_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, const GValue *value); void goo_canvas_item_model_get_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...); void goo_canvas_item_model_get_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args); void goo_canvas_item_model_set_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...); void goo_canvas_item_model_set_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args); Object Hierarchy GInterface +----GooCanvasItemModel Prerequisites GooCanvasItemModel requires GObject. Known Implementations GooCanvasItemModel is implemented by GooCanvasRectModel, GooCanvasEllipseModel, GooCanvasPolylineModel, GooCanvasTableModel, GooCanvasItemModelSimple, GooCanvasTextModel, GooCanvasGridModel, GooCanvasPathModel, GooCanvasImageModel and GooCanvasGroupModel. Properties "can-focus" gboolean : Read / Write "description" gchararray : Read / Write "parent" GooCanvasItemModel : Read / Write "pointer-events" GooCanvasPointerEvents : Read / Write "title" gchararray : Read / Write "tooltip" gchararray : Read / Write "transform" GooCairoMatrix : Read / Write "visibility" GooCanvasItemVisibility : Read / Write "visibility-threshold" gdouble : Read / Write Signals "animation-finished" : Run Last "changed" : Run Last "child-added" : Run Last "child-moved" : Run Last "child-notify" : Run First / No Recursion / Has Details / No Hooks "child-removed" : Run Last Description GooCanvasItemModel defines the interface that models for canvas items must implement, and contains methods for operating on canvas item models. Details <anchor id="GooCanvasItemModel-struct" role="struct"/>GooCanvasItemModel GooCanvasItemModeltypedef struct _GooCanvasItemModel GooCanvasItemModel; GooCanvasItemModel is a typedef used for objects that implement the GooCanvasItemModel interface. (There is no actual GooCanvasItemModel struct, since it is only an interface. But using 'GooCanvasItemModel' is more helpful than using 'GObject'.) <anchor id="GooCanvasItemModelIface" role="struct"/>GooCanvasItemModelIface GooCanvasItemModelIfacetypedef struct { /* Virtual methods that group models must implement. */ gint (* get_n_children) (GooCanvasItemModel *model); GooCanvasItemModel* (* get_child) (GooCanvasItemModel *model, gint child_num); /* Virtual methods that group models may implement. */ void (* add_child) (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position); void (* move_child) (GooCanvasItemModel *model, gint old_position, gint new_position); void (* remove_child) (GooCanvasItemModel *model, gint child_num); void (* get_child_property) (GooCanvasItemModel *model, GooCanvasItemModel *child, guint property_id, GValue *value, GParamSpec *pspec); void (* set_child_property) (GooCanvasItemModel *item, GooCanvasItemModel *child, guint property_id, const GValue *value, GParamSpec *pspec); /* Virtual methods that all item models must implement. */ GooCanvasItemModel* (* get_parent) (GooCanvasItemModel *model); void (* set_parent) (GooCanvasItemModel *model, GooCanvasItemModel *parent); GooCanvasItem* (* create_item) (GooCanvasItemModel *model, GooCanvas *canvas); /* Virtual methods that all item models may implement. */ gboolean (* get_transform) (GooCanvasItemModel *model, cairo_matrix_t *transform); void (* set_transform) (GooCanvasItemModel *model, const cairo_matrix_t *transform); GooCanvasStyle* (* get_style) (GooCanvasItemModel *model); void (* set_style) (GooCanvasItemModel *model, GooCanvasStyle *style); /* Signals. */ void (* child_added) (GooCanvasItemModel *model, gint child_num); void (* child_moved) (GooCanvasItemModel *model, gint old_child_num, gint new_child_num); void (* child_removed) (GooCanvasItemModel *model, gint child_num); void (* changed) (GooCanvasItemModel *model, gboolean recompute_bounds); void (* child_notify) (GooCanvasItemModel *model, GParamSpec *pspec); void (* animation_finished) (GooCanvasItemModel *model, gboolean stopped); } GooCanvasItemModelIface; GooCanvasItemModelIFace holds the virtual methods that make up the GooCanvasItemModel interface. Simple item models only need to implement the get_parent(), set_parent() and create_item() methods. Items that support transforms should also implement get_transform() and set_transform(). Items that support styles should implement get_style() and set_style(). Container items must implement get_n_children() and get_child(). Containers that support dynamic changes to their children should implement add_child(), move_child() and remove_child(). Layout containers like GooCanvasTable may implement get_child_property() and set_child_property(). get_n_children () returns the number of children of the model. get_child () returns the child at the given index. add_child () adds a child. move_child () moves a child up or down the stacking order. remove_child () removes a child. get_child_property () gets a child property of a given child model, e.g. the "row" or "column" property of a model in a GooCanvasTableModel. set_child_property () sets a child property for a given child model. get_parent () gets the model's parent. set_parent () sets the model's parent. create_item () creates a default canvas item to view the model. get_transform () gets the model's transformation matrix. set_transform () sets the model's transformation matrix. get_style () gets the model's style. set_style () sets the model's style. child_added () signal emitted when a child is added. child_moved () signal emitted when a child is moved in the stacking order. child_removed () signal emitted when a child is removed. changed () signal emitted when the model has changed. child_notify () signal emitted when a child property has changed. animation_finished () signal emitted when the model's animation has finished. <anchor id="goo-canvas-item-model-translate" role="function"/>goo_canvas_item_model_translate () goo_canvas_item_model_translatevoid goo_canvas_item_model_translate (GooCanvasItemModel *model, gdouble tx, gdouble ty); Translates the origin of the model's coordinate system by the given amounts. model : an item model. tx : the amount to move the origin in the horizontal direction. ty : the amount to move the origin in the vertical direction. <anchor id="goo-canvas-item-model-scale" role="function"/>goo_canvas_item_model_scale () goo_canvas_item_model_scalevoid goo_canvas_item_model_scale (GooCanvasItemModel *model, gdouble sx, gdouble sy); Scales the model's coordinate system by the given amounts. model : an item model. sx : the amount to scale the horizontal axis. sy : the amount to scale the vertical axis. <anchor id="goo-canvas-item-model-rotate" role="function"/>goo_canvas_item_model_rotate () goo_canvas_item_model_rotatevoid goo_canvas_item_model_rotate (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); Rotates the model's coordinate system by the given amount, about the given origin. model : an item model. degrees : the clockwise angle of rotation. cx : the x coordinate of the origin of the rotation. cy : the y coordinate of the origin of the rotation. <anchor id="goo-canvas-item-model-skew-x" role="function"/>goo_canvas_item_model_skew_x () goo_canvas_item_model_skew_xvoid goo_canvas_item_model_skew_x (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); Skews the model's coordinate system along the x axis by the given amount, about the given origin. model : an item model. degrees : the skew angle. cx : the x coordinate of the origin of the skew transform. cy : the y coordinate of the origin of the skew transform. <anchor id="goo-canvas-item-model-skew-y" role="function"/>goo_canvas_item_model_skew_y () goo_canvas_item_model_skew_yvoid goo_canvas_item_model_skew_y (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); Skews the model's coordinate system along the y axis by the given amount, about the given origin. model : an item model. degrees : the skew angle. cx : the x coordinate of the origin of the skew transform. cy : the y coordinate of the origin of the skew transform. <anchor id="goo-canvas-item-model-get-transform" role="function"/>goo_canvas_item_model_get_transform () goo_canvas_item_model_get_transformgboolean goo_canvas_item_model_get_transform (GooCanvasItemModel *model, cairo_matrix_t *transform); Gets the transformation matrix of an item model. model : an item model. transform : the place to store the transform. Returns : TRUE if a transform is set. <anchor id="goo-canvas-item-model-set-transform" role="function"/>goo_canvas_item_model_set_transform () goo_canvas_item_model_set_transformvoid goo_canvas_item_model_set_transform (GooCanvasItemModel *model, const cairo_matrix_t *transform); Sets the transformation matrix of an item model. model : an item model. transform : the new transformation matrix, or NULL to reset the transformation to the identity matrix. <anchor id="goo-canvas-item-model-get-simple-transform" role="function"/>goo_canvas_item_model_get_simple_transform () goo_canvas_item_model_get_simple_transformgboolean goo_canvas_item_model_get_simple_transform (GooCanvasItemModel *model, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation); This function can be used to get the position, scale and rotation of an item model, providing that the model has a simple transformation matrix (e.g. set with goo_canvas_item_model_set_simple_transform(), or using a combination of simple translate, scale and rotate operations). If the model has a complex transformation matrix the results will be incorrect. model : an item model. x : returns the x coordinate of the origin of the model's coordinate space. y : returns the y coordinate of the origin of the model's coordinate space. scale : returns the scale of the model. rotation : returns the clockwise rotation of the model, in degrees (0-360). Returns : TRUE if a transform is set. <anchor id="goo-canvas-item-model-set-simple-transform" role="function"/>goo_canvas_item_model_set_simple_transform () goo_canvas_item_model_set_simple_transformvoid goo_canvas_item_model_set_simple_transform (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble rotation); A convenience function to set the item model's transformation matrix. model : an item model. x : the x coordinate of the origin of the model's coordinate space. y : the y coordinate of the origin of the model's coordinate space. scale : the scale of the model. rotation : the clockwise rotation of the model, in degrees. <anchor id="goo-canvas-item-model-animate" role="function"/>goo_canvas_item_model_animate () goo_canvas_item_model_animatevoid goo_canvas_item_model_animate (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); Animates a model from its current position to the given offsets, scale and rotation. model : an item model. x : the final x coordinate. y : the final y coordinate. scale : the final scale. degrees : the final rotation. This can be negative to rotate anticlockwise, and can also be greater than 360 to rotate a number of times. absolute : if the x, y, scale and degrees values are absolute, or relative to the current transform. Note that absolute animations only work if the model currently has a simple transform. If the model has a shear or some other complicated transform it may result in strange animations. duration : the duration of the animation, in milliseconds (1/1000ths of a second). step_time : the time between each animation step, in milliseconds. type : specifies what happens when the animation finishes. <anchor id="goo-canvas-item-model-stop-animation" role="function"/>goo_canvas_item_model_stop_animation () goo_canvas_item_model_stop_animationvoid goo_canvas_item_model_stop_animation (GooCanvasItemModel *model); Stops any current animation for the given model, leaving it at its current position. model : an item model. <anchor id="goo-canvas-item-model-raise" role="function"/>goo_canvas_item_model_raise () goo_canvas_item_model_raisevoid goo_canvas_item_model_raise (GooCanvasItemModel *model, GooCanvasItemModel *above); Raises a model in the stacking order. model : an item model. above : the item model to raise model above, or NULL to raise model to the top of the stack. <anchor id="goo-canvas-item-model-lower" role="function"/>goo_canvas_item_model_lower () goo_canvas_item_model_lowervoid goo_canvas_item_model_lower (GooCanvasItemModel *model, GooCanvasItemModel *below); Lowers a model in the stacking order. model : an item model. below : the item model to lower model below, or NULL to lower model to the bottom of the stack. <anchor id="goo-canvas-item-model-remove" role="function"/>goo_canvas_item_model_remove () goo_canvas_item_model_removevoid goo_canvas_item_model_remove (GooCanvasItemModel *model); Removes a model from its parent. If the model is in a canvas it will be removed. This would normally also result in the model being freed. model : an item model. <anchor id="goo-canvas-item-model-get-parent" role="function"/>goo_canvas_item_model_get_parent () goo_canvas_item_model_get_parentGooCanvasItemModel* goo_canvas_item_model_get_parent (GooCanvasItemModel *model); Gets the parent of the given model. model : an item model. Returns : the parent model, or NULL if the model has no parent. <anchor id="goo-canvas-item-model-set-parent" role="function"/>goo_canvas_item_model_set_parent () goo_canvas_item_model_set_parentvoid goo_canvas_item_model_set_parent (GooCanvasItemModel *model, GooCanvasItemModel *parent); This function is only intended to be used when implementing new canvas item models (specifically container models such as GooCanvasGroupModel). It sets the parent of the child model. model : an item model. parent : the new parent item model. This function cannot be used to add a model to a group or to change the parent of a model. To do that use the "parent" property. <anchor id="goo-canvas-item-model-is-container" role="function"/>goo_canvas_item_model_is_container () goo_canvas_item_model_is_containergboolean goo_canvas_item_model_is_container (GooCanvasItemModel *model); Tests to see if the given item model is a container. model : an item model. Returns : TRUE if the item model is a container. <anchor id="goo-canvas-item-model-get-n-children" role="function"/>goo_canvas_item_model_get_n_children () goo_canvas_item_model_get_n_childrengint goo_canvas_item_model_get_n_children (GooCanvasItemModel *model); Gets the number of children of the container. model : an item model. Returns : the number of children. <anchor id="goo-canvas-item-model-get-child" role="function"/>goo_canvas_item_model_get_child () goo_canvas_item_model_get_childGooCanvasItemModel* goo_canvas_item_model_get_child (GooCanvasItemModel *model, gint child_num); Gets the child at the given stack position. model : an item model. child_num : the position of a child in the container's stack. Returns : the child at the given stack position, or NULL if child_num is out of range. <anchor id="goo-canvas-item-model-add-child" role="function"/>goo_canvas_item_model_add_child () goo_canvas_item_model_add_childvoid goo_canvas_item_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position); Adds a child at the given stack position. model : an item model. child : the child to add. position : the position of the child, or -1 to place it last (at the top of the stacking order). <anchor id="goo-canvas-item-model-move-child" role="function"/>goo_canvas_item_model_move_child () goo_canvas_item_model_move_childvoid goo_canvas_item_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position); Moves a child to a new stack position. model : an item model. old_position : the current position of the child. new_position : the new position of the child. <anchor id="goo-canvas-item-model-remove-child" role="function"/>goo_canvas_item_model_remove_child () goo_canvas_item_model_remove_childvoid goo_canvas_item_model_remove_child (GooCanvasItemModel *model, gint child_num); Removes the child at the given position. model : an item model. child_num : the position of the child to remove. <anchor id="goo-canvas-item-model-find-child" role="function"/>goo_canvas_item_model_find_child () goo_canvas_item_model_find_childgint goo_canvas_item_model_find_child (GooCanvasItemModel *model, GooCanvasItemModel *child); Attempts to find the given child with the container's stack. model : an item model. child : the child to find. Returns : the position of the given child, or -1 if it isn't found. <anchor id="goo-canvas-item-model-get-style" role="function"/>goo_canvas_item_model_get_style () goo_canvas_item_model_get_styleGooCanvasStyle* goo_canvas_item_model_get_style (GooCanvasItemModel *model); Gets the model's style. If the model doesn't have its own style it will return its parent's style. model : an item model. Returns : the model's style. <anchor id="goo-canvas-item-model-set-style" role="function"/>goo_canvas_item_model_set_style () goo_canvas_item_model_set_stylevoid goo_canvas_item_model_set_style (GooCanvasItemModel *model, GooCanvasStyle *style); Sets the model's style, by copying the properties from the given style. model : an item model. style : a style. <anchor id="goo-canvas-item-model-class-install-child-property" role="function"/>goo_canvas_item_model_class_install_child_property () goo_canvas_item_model_class_install_child_propertyvoid goo_canvas_item_model_class_install_child_property (GObjectClass *mclass, guint property_id, GParamSpec *pspec); This function is only intended to be used when implementing new canvas item models, specifically layout container item models such as GooCanvasTableModel. It installs a child property on a canvas item class. mclass : a GObjectClass property_id : the id for the property pspec : the GParamSpec for the property <anchor id="goo-canvas-item-model-class-list-child-properties" role="function"/>goo_canvas_item_model_class_list_child_properties () goo_canvas_item_model_class_list_child_propertiesGParamSpec** goo_canvas_item_model_class_list_child_properties (GObjectClass *mclass, guint *n_properties); This function is only intended to be used when implementing new canvas item models, specifically layout container item models such as GooCanvasTableModel. It returns all child properties of a canvas item class. mclass : a GObjectClass n_properties : location to return the number of child properties found Returns : a newly allocated array of GParamSpec*. The array must be freed with g_free(). <anchor id="goo-canvas-item-model-class-find-child-property" role="function"/>goo_canvas_item_model_class_find_child_property () goo_canvas_item_model_class_find_child_propertyGParamSpec* goo_canvas_item_model_class_find_child_property (GObjectClass *mclass, const gchar *property_name); This function is only intended to be used when implementing new canvas item models, specifically layout container item models such as GooCanvasTableModel. It finds a child property of a canvas item class by name. mclass : a GObjectClass property_name : the name of the child property to find Returns : the GParamSpec of the child property or NULL if class has no child property with that name. <anchor id="goo-canvas-item-model-get-child-property" role="function"/>goo_canvas_item_model_get_child_property () goo_canvas_item_model_get_child_propertyvoid goo_canvas_item_model_get_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, GValue *value); Gets a child property of child. model : a GooCanvasItemModel. child : a child GooCanvasItemModel. property_name : the name of the child property to get. value : a location to return the value. <anchor id="goo-canvas-item-model-set-child-property" role="function"/>goo_canvas_item_model_set_child_property () goo_canvas_item_model_set_child_propertyvoid goo_canvas_item_model_set_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, const GValue *value); Sets a child property of child. model : a GooCanvasItemModel. child : a child GooCanvasItemModel. property_name : the name of the child property to set. value : the value to set the property to. <anchor id="goo-canvas-item-model-get-child-properties" role="function"/>goo_canvas_item_model_get_child_properties () goo_canvas_item_model_get_child_propertiesvoid goo_canvas_item_model_get_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...); Gets the values of one or more child properties of child. model : a GooCanvasItemModel. child : a child GooCanvasItemModel. ... : pairs of property names and value pointers, and a terminating NULL. <anchor id="goo-canvas-item-model-get-child-properties-valist" role="function"/>goo_canvas_item_model_get_child_properties_valist () goo_canvas_item_model_get_child_properties_valistvoid goo_canvas_item_model_get_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args); Gets the values of one or more child properties of child. model : a GooCanvasItemModel. child : a child GooCanvasItemModel. var_args : pairs of property names and value pointers, and a terminating NULL. <anchor id="goo-canvas-item-model-set-child-properties" role="function"/>goo_canvas_item_model_set_child_properties () goo_canvas_item_model_set_child_propertiesvoid goo_canvas_item_model_set_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...); Sets the values of one or more child properties of child. model : a GooCanvasItemModel. child : a child GooCanvasItemModel. ... : pairs of property names and values, and a terminating NULL. <anchor id="goo-canvas-item-model-set-child-properties-valist" role="function"/>goo_canvas_item_model_set_child_properties_valist () goo_canvas_item_model_set_child_properties_valistvoid goo_canvas_item_model_set_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args); Sets the values of one or more child properties of child. model : a GooCanvasItemModel. child : a child GooCanvasItemModel. var_args : pairs of property names and values, and a terminating NULL. Property Details <anchor id="GooCanvasItemModel--can-focus"/>The <literal>"can-focus"</literal> property GooCanvasItemModel:can-focus "can-focus" gboolean : Read / Write If the item can take the keyboard focus.Default value: FALSE <anchor id="GooCanvasItemModel--description"/>The <literal>"description"</literal> property GooCanvasItemModel:description "description" gchararray : Read / Write A description of the item for use by assistive technologies.Default value: NULL <anchor id="GooCanvasItemModel--parent"/>The <literal>"parent"</literal> property GooCanvasItemModel:parent "parent" GooCanvasItemModel : Read / Write The parent item model. <anchor id="GooCanvasItemModel--pointer-events"/>The <literal>"pointer-events"</literal> property GooCanvasItemModel:pointer-events "pointer-events" GooCanvasPointerEvents : Read / Write Specifies when the item receives pointer events.Default value: GOO_CANVAS_EVENTS_VISIBLE_MASK|GOO_CANVAS_EVENTS_PAINTED_MASK|GOO_CANVAS_EVENTS_FILL_MASK|GOO_CANVAS_EVENTS_STROKE_MASK <anchor id="GooCanvasItemModel--title"/>The <literal>"title"</literal> property GooCanvasItemModel:title "title" gchararray : Read / Write A short context-rich description of the item for use by assistive technologies.Default value: NULL <anchor id="GooCanvasItemModel--tooltip"/>The <literal>"tooltip"</literal> property GooCanvasItemModel:tooltip "tooltip" gchararray : Read / Write The tooltip to display for the item.Default value: NULL <anchor id="GooCanvasItemModel--transform"/>The <literal>"transform"</literal> property GooCanvasItemModel:transform "transform" GooCairoMatrix : Read / Write The transformation matrix of the item. <anchor id="GooCanvasItemModel--visibility"/>The <literal>"visibility"</literal> property GooCanvasItemModel:visibility "visibility" GooCanvasItemVisibility : Read / Write When the canvas item is visible.Default value: GOO_CANVAS_ITEM_VISIBLE <anchor id="GooCanvasItemModel--visibility-threshold"/>The <literal>"visibility-threshold"</literal> property GooCanvasItemModel:visibility-threshold "visibility-threshold" gdouble : Read / Write The scale threshold at which the item becomes visible.Allowed values: >= 0 Default value: 0 Signal Details <anchor id="GooCanvasItemModel-animation-finished"/>The <literal>"animation-finished"</literal> signal GooCanvasItemModel::animation-finishedvoid user_function (GooCanvasItemModel *item, gboolean stopped, gpointer user_data) : Run Last Emitted when the item model animation has finished. item : the item model that received the signal. stopped : if the animation was explicitly stopped. user_data : user data set when the signal handler was connected. <anchor id="GooCanvasItemModel-changed"/>The <literal>"changed"</literal> signal GooCanvasItemModel::changedvoid user_function (GooCanvasItemModel *model, gboolean recompute_bounds, gpointer user_data) : Run Last Emitted when the item model has been changed. model : the item model that received the signal. recompute_bounds : if the bounds of the item need to be recomputed. user_data : user data set when the signal handler was connected. <anchor id="GooCanvasItemModel-child-added"/>The <literal>"child-added"</literal> signal GooCanvasItemModel::child-addedvoid user_function (GooCanvasItemModel *model, gint child_num, gpointer user_data) : Run Last Emitted when a child has been added. model : the item model that received the signal. child_num : the index of the new child. user_data : user data set when the signal handler was connected. <anchor id="GooCanvasItemModel-child-moved"/>The <literal>"child-moved"</literal> signal GooCanvasItemModel::child-movedvoid user_function (GooCanvasItemModel *model, gint old_child_num, gint new_child_num, gpointer user_data) : Run Last Emitted when a child has been moved in the stacking order. model : the item model that received the signal. old_child_num : the old index of the child. new_child_num : the new index of the child. user_data : user data set when the signal handler was connected. <anchor id="GooCanvasItemModel-child-notify"/>The <literal>"child-notify"</literal> signal GooCanvasItemModel::child-notifyvoid user_function (GooCanvasItemModel *item, GParamSpec *pspec, gpointer user_data) : Run First / No Recursion / Has Details / No Hooks Emitted for each child property that has changed. The signal's detail holds the property name. item : the item model that received the signal. pspec : the GParamSpec of the changed child property. user_data : user data set when the signal handler was connected. <anchor id="GooCanvasItemModel-child-removed"/>The <literal>"child-removed"</literal> signal GooCanvasItemModel::child-removedvoid user_function (GooCanvasItemModel *model, gint child_num, gpointer user_data) : Run Last Emitted when a child has been removed. model : the item model that received the signal. child_num : the index of the child that was removed. user_data : user data set when the signal handler was connected. goocanvas-0.15/docs/xml/creating-items.xml0000644000076400007640000004123711222215703015537 00000000000000 Creating New Items 3 GOOCANVAS Library Creating New Items how to create new canvas items. How to Create New Canvas Items There are 3 ways to create new canvas items, listed here in increasing order of complexity: Creating a simple subclass of GooCanvasItemSimple. Creating a regular subclass of GooCanvasItemSimple. Implementing the GooCanvasItem interface. These will be discussed in turn below. (It is also possible to create new container items by subclassing GooCanvasGroup, but that is not covered here.) The final part of this section covers creating item models. Creating a Simple Subclass of GooCanvasItemSimple For items that consist of a simple graphic element such as a line, rectangle or circle, it is possible to create a subclass of GooCanvasItemSimple and override just one method, simple_create_path(). (This method is used for the GooCanvasEllipse and GooCanvasPath items.) The simple_create_path() method should create a path using the given cairo context. The path will be drawn using the stroke, fill and other painting properties from GooCanvasItemSimple. This example shows the simple_create_path() method for a simple rectangular item, MyItem: static void my_item_simple_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { MyItem *item = (MyItem*) simple; cairo_rectangle (cr, item->x, item->y, item->width, item->height); } Whenever the item is changed in some way it should call goo_canvas_item_simple_changed(), passing a boolean value indicating whether the item's bounds need to be recalculated or if it only needs to be repainted. The GooCanvasItemSimple code will take care of updating the item and repainting the appropriate parts of the canvas. Creating a Regular Subclass of GooCanvasItemSimple Most items will need more than a simple line or rectangle, so they will need to create a subclass of GooCanvasItemSimple and override three methods, simple_update(), simple_paint() and simple_is_item_at(). The simple_update() method should compute the bounds of the item, in the item's coordinate space, and place them in the bounds member of GooCanvasItemSimple. Note that the cairo context passed to this function may have transformations applied to it, so cairo_identity_matrix() should be called before using it. The simple_paint() method should paint the item using the given cairo context. To use the stroke and fill properties from GooCanvasItemSimple to paint parts of the item call goo_canvas_style_set_stroke_options() and goo_canvas_style_set_fill_options() before calling cairo_stroke() and cairo_fill(). (The item's style can be found in GOO_CANVAS_ITEM_SIMPLE (item)->simple_data->style). The simple_is_item_at() method should return TRUE if the given coordinate (in the item's coordinate space) is inside the item. (The is_pointer_event argument can be ignored for most purposes since the GooCanvasItemSimple code will take care of it.) This example code shows the simple_update(), simple_paint() and simple_is_item_at() methods for a rectangular item (the complete item's source code can be found in the GooCanvas demo directory, in demo-item.h and demo-item.c): static void goo_demo_item_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooDemoItem *demo_item = (GooDemoItem*) simple; /* Compute the new bounds. */ simple->bounds.x1 = demo_item->x; simple->bounds.y1 = demo_item->y; simple->bounds.x2 = demo_item->x + demo_item->width; simple->bounds.y2 = demo_item->y + demo_item->height; } static void goo_demo_item_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooDemoItem *demo_item = (GooDemoItem*) simple; cairo_move_to (cr, demo_item->x, demo_item->y); cairo_line_to (cr, demo_item->x, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y + demo_item->height); cairo_line_to (cr, demo_item->x + demo_item->width, demo_item->y); cairo_close_path (cr); goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_fill (cr); } static gboolean goo_demo_item_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooDemoItem *demo_item = (GooDemoItem*) simple; if (x < demo_item->x || (x > demo_item->x + demo_item->width) || y < demo_item->y || (y > demo_item->y + demo_item->height)) return FALSE; return TRUE; } As with the simple GooCanvasItemSimple subclass, the item should call goo_canvas_item_simple_changed() whenever it is changed, to ensure that the item's bounds are recomputed and it is repainted if necessary. Implementing the GooCanvasItem Interface The most complicated way to create new canvas items is to implement the GooCanvasItem interface directly. This should not be needed in most cases, but may be desired if the developer wants to avoid the memory and processor overheads associated with the GooCanvasItemSimple class, or if the developer wants to turn an existing application object into a canvas item. At a minimum the canvas item must implement these 6 methods: get_parent() - the item's parent should be returned. set_parent() - the item's parent should be stored (though it should not add a reference to the parent). get_bounds() - returns the bounds of the item, in canvas space. The item should ensure that the bounds are up-to-date before returning them, calling goo_canvas_item_ensure_updated() if necessary. update() - if the item has been changed since the last update, or if the entire_tree flag is TRUE, the item's bounds should be recomputed (in canvas space). It should also request a redraw of the old bounds and the new bounds, so the display is updated appropriately. The new bounds should be returned in the bounds argument. paint() - if the item's bounds intersect the given bounds then the item should be painted on the given cairo context. The scale parameter is only used to check if the item should be visible, according to the item's "visibility" and "visibility-threshold" property settings. get_items_at() - if the given point is inside the item then a pointer to the item should be added to the start of the list of found items. The list is then returned. The canvas item must also implement the "parent", "title", "description", "visibility", "visibility-threshold", "transform" and "pointer-events" properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.) If the canvas item will be used within a container that does item layout, such as GooCanvasTable, it must implement the first two methods here at least: get_requested_area() - returns the requested area of the item, in the parent's coordinate space. allocate_area() - allocates the item's area, in the parent's coordinate space. get_requested_height() - returns the requested height of the item, given a particular allocated width, in the parent's coordinate space. (This only needed for items that change height as their width is changed, such as text items.) If the canvas item supports a transformation matrix it must implement: get_transform() - returns the item's transformation matrix. set_transform() - sets the item's transformation matrix. If the canvas item supports a GooCanvasStyle setting, it must implement: get_style() - returns the item's style. set_style() - sets the item's style. Since GooCanvasItemSimple implements most of the above methods and properties its source code is a good place to look for help. Creating Item Models As with creating canvas items, to create item models it is possible to subclass GooCanvasItemModelSimple or to implement the GooCanvasItemModel interface directly. Subclassing GooCanvasItemModelSimple is very easy, since only one method from the GooCanvasItemModel interface must be implemented - create_item(). This should return a new canvas item for viewing the item model in a canvas. (It may be called multiple times if multiple canvases are viewing the same canvas model.) The GooCanvasItemModelSimple subclass should emit the "changed" signal whenever it has changed, with a boolean flag indicating if the bounds need to be recomputed. The canvas items will connect to this signal and request an update or a redraw as appropriate. To implement the GooCanvasItemModel interface directly, the class must implement the get_parent(), set_parent() and create_item() methods. It may also implement get_transform(), set_transform(), get_style() and set_style() methods if desired. The class must also implement the "parent", "title", "description", "can-focus", "visibility", "visibility-threshold", "transform" and "pointer-events" properties. (The last 4 properties can simply be ignored if the application doesn't intend to use them.) goocanvas-0.15/docs/xml/goocanvastextmodel.xml0000644000076400007640000003355111222215703016532 00000000000000 GooCanvasTextModel 3 GOOCANVAS Library GooCanvasTextModel a model for text items. Synopsis GooCanvasTextModel; GooCanvasItemModel* goo_canvas_text_model_new (GooCanvasItemModel *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...); Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasTextModel Implemented Interfaces GooCanvasTextModel implements GooCanvasItemModel. Properties "alignment" PangoAlignment : Read / Write "anchor" GtkAnchorType : Read / Write "ellipsize" PangoEllipsizeMode : Read / Write "height" gdouble : Read / Write "text" gchararray : Read / Write "use-markup" gboolean : Read / Write "width" gdouble : Read / Write "wrap" PangoWrapMode : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasTextModel represents a model for text items. It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "fill-color". It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(). To create a GooCanvasTextModel use goo_canvas_text_model_new(). To get or set the properties of an existing GooCanvasTextModel, use g_object_get() and g_object_set(). To respond to events such as mouse clicks on the text item you must connect to the signal handlers of the corresponding GooCanvasText objects. (See goo_canvas_get_item() and "item-created".) Details <anchor id="GooCanvasTextModel-struct" role="struct"/>GooCanvasTextModel GooCanvasTextModeltypedef struct _GooCanvasTextModel GooCanvasTextModel; The GooCanvasTextModel struct contains private data only. <anchor id="goo-canvas-text-model-new" role="function"/>goo_canvas_text_model_new () goo_canvas_text_model_newGooCanvasItemModel* goo_canvas_text_model_new (GooCanvasItemModel *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...); Creates a new text model. parent : the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. string : the text to display. x : the x coordinate of the text. y : the y coordinate of the text. width : the width of the text item, or -1 for unlimited width. anchor : the position of the text relative to the given x and y coordinates. For example an anchor of GDK_ANCHOR_NW will result in the top-left of the text being placed at the given x and y coordinates. An anchor of GDK_ANCHOR_CENTER will result in the center of the text being placed at the x and y coordinates. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new text model. Here's an example showing how to create a text item with the bottom right of the text box placed at (500,500): GooCanvasItemModel *text = goo_canvas_text_model_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE, "fill-color", "blue", NULL); Property Details <anchor id="GooCanvasTextModel--alignment"/>The <literal>"alignment"</literal> property GooCanvasTextModel:alignment "alignment" PangoAlignment : Read / Write How to align the text.Default value: PANGO_ALIGN_LEFT <anchor id="GooCanvasTextModel--anchor"/>The <literal>"anchor"</literal> property GooCanvasTextModel:anchor "anchor" GtkAnchorType : Read / Write How to position the text relative to the given x and y coordinates.Default value: GTK_ANCHOR_NORTH_WEST <anchor id="GooCanvasTextModel--ellipsize"/>The <literal>"ellipsize"</literal> property GooCanvasTextModel:ellipsize "ellipsize" PangoEllipsizeMode : Read / Write The preferred place to ellipsize the string, if the label does not have enough room to display the entire string.Default value: PANGO_ELLIPSIZE_NONE <anchor id="GooCanvasTextModel--height"/>The <literal>"height"</literal> property GooCanvasTextModel:height "height" gdouble : Read / Write The height to use to layout the text, or -1 to use the natural height.Default value: -1 <anchor id="GooCanvasTextModel--text"/>The <literal>"text"</literal> property GooCanvasTextModel:text "text" gchararray : Read / Write The text to display.Default value: NULL <anchor id="GooCanvasTextModel--use-markup"/>The <literal>"use-markup"</literal> property GooCanvasTextModel:use-markup "use-markup" gboolean : Read / Write Whether to parse PangoMarkup in the text, to support different styles.Default value: FALSE <anchor id="GooCanvasTextModel--width"/>The <literal>"width"</literal> property GooCanvasTextModel:width "width" gdouble : Read / Write The width to use to layout the text.Default value: -1 <anchor id="GooCanvasTextModel--wrap"/>The <literal>"wrap"</literal> property GooCanvasTextModel:wrap "wrap" PangoWrapMode : Read / Write The preferred method of wrapping the string if a width has been set.Default value: PANGO_WRAP_WORD <anchor id="GooCanvasTextModel--x"/>The <literal>"x"</literal> property GooCanvasTextModel:x "x" gdouble : Read / Write The x coordinate of the text.Default value: 0 <anchor id="GooCanvasTextModel--y"/>The <literal>"y"</literal> property GooCanvasTextModel:y "y" gdouble : Read / Write The y coordinate of the text.Default value: 0 goocanvas-0.15/docs/xml/goocanvas.xml0000644000076400007640000026342011222215703014604 00000000000000 GooCanvas 3 GOOCANVAS Library GooCanvas the main canvas widget. Synopsis GooCanvas; GooCanvasClass; GtkWidget* goo_canvas_new (void); GooCanvasItem* goo_canvas_get_root_item (GooCanvas *canvas); void goo_canvas_set_root_item (GooCanvas *canvas, GooCanvasItem *item); GooCanvasItemModel* goo_canvas_get_root_item_model (GooCanvas *canvas); void goo_canvas_set_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model); GooCanvasItem* goo_canvas_get_static_root_item (GooCanvas *canvas); void goo_canvas_set_static_root_item (GooCanvas *canvas, GooCanvasItem *item); GooCanvasItemModel* goo_canvas_get_static_root_item_model (GooCanvas *canvas); void goo_canvas_set_static_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model); void goo_canvas_get_bounds (GooCanvas *canvas, gdouble *left, gdouble *top, gdouble *right, gdouble *bottom); void goo_canvas_set_bounds (GooCanvas *canvas, gdouble left, gdouble top, gdouble right, gdouble bottom); gdouble goo_canvas_get_scale (GooCanvas *canvas); void goo_canvas_set_scale (GooCanvas *canvas, gdouble scale); GooCanvasItem* goo_canvas_get_item (GooCanvas *canvas, GooCanvasItemModel *model); GooCanvasItem* goo_canvas_get_item_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event); GList* goo_canvas_get_items_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event); GList* goo_canvas_get_items_in_area (GooCanvas *canvas, const GooCanvasBounds *area, gboolean inside_area, gboolean allow_overlaps, gboolean include_containers); void goo_canvas_scroll_to (GooCanvas *canvas, gdouble left, gdouble top); void goo_canvas_render (GooCanvas *canvas, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); void goo_canvas_convert_to_pixels (GooCanvas *canvas, gdouble *x, gdouble *y); void goo_canvas_convert_from_pixels (GooCanvas *canvas, gdouble *x, gdouble *y); void goo_canvas_convert_to_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y); void goo_canvas_convert_from_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y); void goo_canvas_convert_bounds_to_item_space (GooCanvas *canvas, GooCanvasItem *item, GooCanvasBounds *bounds); GdkGrabStatus goo_canvas_pointer_grab (GooCanvas *canvas, GooCanvasItem *item, GdkEventMask event_mask, GdkCursor *cursor, guint32 time); void goo_canvas_pointer_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time); void goo_canvas_grab_focus (GooCanvas *canvas, GooCanvasItem *item); GdkGrabStatus goo_canvas_keyboard_grab (GooCanvas *canvas, GooCanvasItem *item, gboolean owner_events, guint32 time); void goo_canvas_keyboard_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time); cairo_t* goo_canvas_create_cairo_context (GooCanvas *canvas); GooCanvasItem* goo_canvas_create_item (GooCanvas *canvas, GooCanvasItemModel *model); void goo_canvas_unregister_item (GooCanvas *canvas, GooCanvasItemModel *model); void goo_canvas_register_widget_item (GooCanvas *canvas, GooCanvasWidget *witem); void goo_canvas_unregister_widget_item (GooCanvas *canvas, GooCanvasWidget *witem); void goo_canvas_update (GooCanvas *canvas); void goo_canvas_request_update (GooCanvas *canvas); void goo_canvas_request_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds); void goo_canvas_request_item_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds, gboolean is_static); gdouble goo_canvas_get_default_line_width (GooCanvas *canvas); Object Hierarchy GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GooCanvas Implemented Interfaces GooCanvas implements AtkImplementorIface and GtkBuildable. Properties "anchor" GtkAnchorType : Read / Write "automatic-bounds" gboolean : Read / Write "background-color" gchararray : Write "background-color-rgb" guint : Write "bounds-from-origin" gboolean : Read / Write "bounds-padding" gdouble : Read / Write "clear-background" gboolean : Read / Write "integer-layout" gboolean : Read / Write "redraw-when-scrolled" gboolean : Read / Write "resolution-x" gdouble : Read / Write "resolution-y" gdouble : Read / Write "scale" gdouble : Read / Write "scale-x" gdouble : Read / Write "scale-y" gdouble : Read / Write "units" GtkUnit : Read / Write "x1" gdouble : Read / Write "x2" gdouble : Read / Write "y1" gdouble : Read / Write "y2" gdouble : Read / Write Signals "item-created" : Run Last "set-scroll-adjustments" : Run Last / Action Description GooCanvas is the main widget containing a number of canvas items. Here is a simple example: #include <goocanvas.h> static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItem *root, *rect_item, *text_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event, NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Add a few simple items. */ rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_rotate (text_item, 45, 300, 300); /* Connect a signal handler for the rectangle item. */ g_signal_connect (rect_item, "button_press_event", (GtkSignalFunc) on_rect_button_press, NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } Details <anchor id="GooCanvas-struct" role="struct"/>GooCanvas GooCanvastypedef struct _GooCanvas GooCanvas; The GooCanvas struct contains private data only. <anchor id="GooCanvasClass" role="struct"/>GooCanvasClass GooCanvasClasstypedef struct { GooCanvasItem* (* create_item) (GooCanvas *canvas, GooCanvasItemModel *model); /* Signals. */ void (* item_created) (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model); } GooCanvasClass; The GooCanvasClass struct contains one virtual method that subclasses may override. create_item () a virtual method that subclasses may override to create custom canvas items for item models. item_created () signal emitted when a new canvas item has been created. Applications can connect to this to setup signal handlers for the new item. <anchor id="goo-canvas-new" role="function"/>goo_canvas_new () goo_canvas_newGtkWidget* goo_canvas_new (void); Creates a new GooCanvas widget. A GooCanvasGroup is created automatically as the root item of the canvas, though this can be overriden with goo_canvas_set_root_item() or goo_canvas_set_root_item_model(). Returns : a new GooCanvas widget. <anchor id="goo-canvas-get-root-item" role="function"/>goo_canvas_get_root_item () goo_canvas_get_root_itemGooCanvasItem* goo_canvas_get_root_item (GooCanvas *canvas); Gets the root item of the canvas, usually a GooCanvasGroup. canvas : a GooCanvas. Returns : the root item, or NULL if there is no root item. <anchor id="goo-canvas-set-root-item" role="function"/>goo_canvas_set_root_item () goo_canvas_set_root_itemvoid goo_canvas_set_root_item (GooCanvas *canvas, GooCanvasItem *item); Sets the root item of the canvas. Any existing canvas items are removed. canvas : a GooCanvas. item : the root canvas item. <anchor id="goo-canvas-get-root-item-model" role="function"/>goo_canvas_get_root_item_model () goo_canvas_get_root_item_modelGooCanvasItemModel* goo_canvas_get_root_item_model (GooCanvas *canvas); Gets the root item model of the canvas. canvas : a GooCanvas. Returns : the root item model, or NULL if there is no root item model. <anchor id="goo-canvas-set-root-item-model" role="function"/>goo_canvas_set_root_item_model () goo_canvas_set_root_item_modelvoid goo_canvas_set_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model); Sets the root item model of the canvas. A hierarchy of canvas items will be created, corresponding to the hierarchy of items in the model. Any current canvas items will be removed. canvas : a GooCanvas. model : a GooCanvasItemModel. <anchor id="goo-canvas-get-static-root-item" role="function"/>goo_canvas_get_static_root_item () goo_canvas_get_static_root_itemGooCanvasItem* goo_canvas_get_static_root_item (GooCanvas *canvas); Gets the static root item of the canvas. Static items are exactly the same as ordinary canvas items, except that they do not move or change size when the canvas is scrolled or the scale changes. Static items are added to the static root item in exactly the same way that ordinary items are added to the root item. canvas : a GooCanvas. Returns : the static root item, or NULL. <anchor id="goo-canvas-set-static-root-item" role="function"/>goo_canvas_set_static_root_item () goo_canvas_set_static_root_itemvoid goo_canvas_set_static_root_item (GooCanvas *canvas, GooCanvasItem *item); Sets the static root item. Any existing static items are removed. Static items are exactly the same as ordinary canvas items, except that they do not move or change size when the canvas is scrolled or the scale changes. Static items are added to the static root item in exactly the same way that ordinary items are added to the root item. canvas : a GooCanvas. item : the static root item. <anchor id="goo-canvas-get-static-root-item-model" role="function"/>goo_canvas_get_static_root_item_model () goo_canvas_get_static_root_item_modelGooCanvasItemModel* goo_canvas_get_static_root_item_model (GooCanvas *canvas); Gets the static root item model of the canvas. Static item models are exactly the same as ordinary item models, except that the corresponding items do not move or change size when the canvas is scrolled or the scale changes. Static items models are added to the static root item model in exactly the same way that ordinary item models are added to the root item model. canvas : a GooCanvas. Returns : the static root item model, or NULL. <anchor id="goo-canvas-set-static-root-item-model" role="function"/>goo_canvas_set_static_root_item_model () goo_canvas_set_static_root_item_modelvoid goo_canvas_set_static_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model); Sets the static root item model. Any existing static item models are removed. Static item models are exactly the same as ordinary item models, except that the corresponding items do not move or change size when the canvas is scrolled or the scale changes. Static items models are added to the static root item model in exactly the same way that ordinary item models are added to the root item model. canvas : a GooCanvas. model : the static root item model. <anchor id="goo-canvas-get-bounds" role="function"/>goo_canvas_get_bounds () goo_canvas_get_boundsvoid goo_canvas_get_bounds (GooCanvas *canvas, gdouble *left, gdouble *top, gdouble *right, gdouble *bottom); Gets the bounds of the canvas, in canvas units. By default, canvas units are pixels, though the "units" property can be used to change the units to points, inches or millimeters. canvas : a GooCanvas. left : a pointer to a gdouble to return the left edge, or NULL. top : a pointer to a gdouble to return the top edge, or NULL. right : a pointer to a gdouble to return the right edge, or NULL. bottom : a pointer to a gdouble to return the bottom edge, or NULL. <anchor id="goo-canvas-set-bounds" role="function"/>goo_canvas_set_bounds () goo_canvas_set_boundsvoid goo_canvas_set_bounds (GooCanvas *canvas, gdouble left, gdouble top, gdouble right, gdouble bottom); Sets the bounds of the GooCanvas, in canvas units. By default, canvas units are pixels, though the "units" property can be used to change the units to points, inches or millimeters. canvas : a GooCanvas. left : the left edge. top : the top edge. right : the right edge. bottom : the bottom edge. <anchor id="goo-canvas-get-scale" role="function"/>goo_canvas_get_scale () goo_canvas_get_scalegdouble goo_canvas_get_scale (GooCanvas *canvas); Gets the current scale of the canvas. The scale specifies the magnification factor of the canvas, e.g. if an item has a width of 2 pixels and the scale is set to 3, it will be displayed with a width of 2 x 3 = 6 pixels. canvas : a GooCanvas. Returns : the current scale setting. <anchor id="goo-canvas-set-scale" role="function"/>goo_canvas_set_scale () goo_canvas_set_scalevoid goo_canvas_set_scale (GooCanvas *canvas, gdouble scale); Sets the scale of the canvas. The scale specifies the magnification factor of the canvas, e.g. if an item has a width of 2 pixels and the scale is set to 3, it will be displayed with a width of 2 x 3 = 6 pixels. canvas : a GooCanvas. scale : the new scale setting. <anchor id="goo-canvas-get-item" role="function"/>goo_canvas_get_item () goo_canvas_get_itemGooCanvasItem* goo_canvas_get_item (GooCanvas *canvas, GooCanvasItemModel *model); Gets the canvas item associated with the given GooCanvasItemModel. This is only useful when goo_canvas_set_root_item_model() has been used to set a model for the canvas. For simple applications you can use goo_canvas_get_item() to set up signal handlers for your items, e.g. item = goo_canvas_get_item (GOO_CANVAS (canvas), my_item); g_signal_connect (item, "button_press_event", (GtkSignalFunc) on_my_item_button_press, NULL); More complex applications may want to use the "item-created" signal to hook up their signal handlers. canvas : a GooCanvas. model : a GooCanvasItemModel. Returns : the canvas item corresponding to the given GooCanvasItemModel, or NULL if no canvas item has been created for it yet. <anchor id="goo-canvas-get-item-at" role="function"/>goo_canvas_get_item_at () goo_canvas_get_item_atGooCanvasItem* goo_canvas_get_item_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event); Gets the item at the given point. canvas : a GooCanvas. x : the x coordinate of the point. y : the y coordinate of the point is_pointer_event : TRUE if the "pointer-events" property of items should be used to determine which parts of the item are tested. Returns : the item found at the given point, or NULL if no item was found. <anchor id="goo-canvas-get-items-at" role="function"/>goo_canvas_get_items_at () goo_canvas_get_items_atGList* goo_canvas_get_items_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event); Gets all items at the given point. canvas : a GooCanvas. x : the x coordinate of the point. y : the y coordinate of the point is_pointer_event : TRUE if the "pointer-events" property of items should be used to determine which parts of the item are tested. Returns : a list of items found at the given point, with the top item at the start of the list, or NULL if no items were found. The list must be freed with g_list_free(). <anchor id="goo-canvas-get-items-in-area" role="function"/>goo_canvas_get_items_in_area () goo_canvas_get_items_in_areaGList* goo_canvas_get_items_in_area (GooCanvas *canvas, const GooCanvasBounds *area, gboolean inside_area, gboolean allow_overlaps, gboolean include_containers); Gets a list of items inside or outside a given area. canvas : a GooCanvas. area : the area to compare with each item's bounds. inside_area : TRUE if items inside area should be returned, or FALSE if items outside area should be returned. allow_overlaps : TRUE if items which are partly inside and partly outside should be returned. include_containers : TRUE if containers should be checked as well as normal items. Returns : a list of items in the given area, or NULL if no items are found. The list should be freed with g_list_free(). <anchor id="goo-canvas-scroll-to" role="function"/>goo_canvas_scroll_to () goo_canvas_scroll_tovoid goo_canvas_scroll_to (GooCanvas *canvas, gdouble left, gdouble top); Scrolls the canvas, placing the given point as close to the top-left of the view as possible. canvas : a GooCanvas. left : the x coordinate to scroll to. top : the y coordinate to scroll to. <anchor id="goo-canvas-render" role="function"/>goo_canvas_render () goo_canvas_rendervoid goo_canvas_render (GooCanvas *canvas, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); Renders all or part of a canvas to the given cairo context. canvas : a GooCanvas. cr : a cairo context. bounds : the area to render, or NULL to render the entire canvas. scale : the scale to compare with each item's visibility threshold to see if they should be rendered. This only affects items that have their visibility set to GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD. <anchor id="goo-canvas-convert-to-pixels" role="function"/>goo_canvas_convert_to_pixels () goo_canvas_convert_to_pixelsvoid goo_canvas_convert_to_pixels (GooCanvas *canvas, gdouble *x, gdouble *y); Converts a coordinate from the canvas coordinate space to pixels. The canvas coordinate space is specified in the call to goo_canvas_set_bounds(). The pixel coordinate space specifies pixels from the top-left of the entire canvas window, according to the current scale setting. See goo_canvas_set_scale(). canvas : a GooCanvas. x : a pointer to the x coordinate to convert. y : a pointer to the y coordinate to convert. <anchor id="goo-canvas-convert-from-pixels" role="function"/>goo_canvas_convert_from_pixels () goo_canvas_convert_from_pixelsvoid goo_canvas_convert_from_pixels (GooCanvas *canvas, gdouble *x, gdouble *y); Converts a coordinate from pixels to the canvas coordinate space. The pixel coordinate space specifies pixels from the top-left of the entire canvas window, according to the current scale setting. See goo_canvas_set_scale(). The canvas coordinate space is specified in the call to goo_canvas_set_bounds(). canvas : a GooCanvas. x : a pointer to the x coordinate to convert. y : a pointer to the y coordinate to convert. <anchor id="goo-canvas-convert-to-item-space" role="function"/>goo_canvas_convert_to_item_space () goo_canvas_convert_to_item_spacevoid goo_canvas_convert_to_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y); Converts a coordinate from the canvas coordinate space to the given item's coordinate space, applying all transformation matrices including the item's own transformation matrix, if it has one. canvas : a GooCanvas. item : a GooCanvasItem. x : a pointer to the x coordinate to convert. y : a pointer to the y coordinate to convert. <anchor id="goo-canvas-convert-from-item-space" role="function"/>goo_canvas_convert_from_item_space () goo_canvas_convert_from_item_spacevoid goo_canvas_convert_from_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y); Converts a coordinate from the given item's coordinate space to the canvas coordinate space, applying all transformation matrices including the item's own transformation matrix, if it has one. canvas : a GooCanvas. item : a GooCanvasItem. x : a pointer to the x coordinate to convert. y : a pointer to the y coordinate to convert. <anchor id="goo-canvas-convert-bounds-to-item-space" role="function"/>goo_canvas_convert_bounds_to_item_space () goo_canvas_convert_bounds_to_item_spacevoid goo_canvas_convert_bounds_to_item_space (GooCanvas *canvas, GooCanvasItem *item, GooCanvasBounds *bounds); Converts the given bounds in the canvas coordinate space to a bounding box in item space. This is useful in the item paint() methods to convert the bounds to be painted to the item's coordinate space. canvas : a GooCanvas. item : a GooCanvasItem. bounds : the bounds in canvas coordinate space, to be converted. <anchor id="goo-canvas-pointer-grab" role="function"/>goo_canvas_pointer_grab () goo_canvas_pointer_grabGdkGrabStatus goo_canvas_pointer_grab (GooCanvas *canvas, GooCanvasItem *item, GdkEventMask event_mask, GdkCursor *cursor, guint32 time); Attempts to grab the pointer for the given item. canvas : a GooCanvas. item : the item to grab the pointer for. event_mask : the events to receive during the grab. cursor : the cursor to display during the grab, or NULL. time : the time of the event that lead to the pointer grab. This should come from the relevant GdkEvent. Returns : GDK_GRAB_SUCCESS if the grab succeeded. <anchor id="goo-canvas-pointer-ungrab" role="function"/>goo_canvas_pointer_ungrab () goo_canvas_pointer_ungrabvoid goo_canvas_pointer_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time); Ungrabs the pointer, if the given item has the pointer grab. canvas : a GooCanvas. item : the item that has the grab. time : the time of the event that lead to the pointer ungrab. This should come from the relevant GdkEvent. <anchor id="goo-canvas-grab-focus" role="function"/>goo_canvas_grab_focus () goo_canvas_grab_focusvoid goo_canvas_grab_focus (GooCanvas *canvas, GooCanvasItem *item); Grabs the keyboard focus for the given item. canvas : a GooCanvas. item : the item to grab the focus. <anchor id="goo-canvas-keyboard-grab" role="function"/>goo_canvas_keyboard_grab () goo_canvas_keyboard_grabGdkGrabStatus goo_canvas_keyboard_grab (GooCanvas *canvas, GooCanvasItem *item, gboolean owner_events, guint32 time); Attempts to grab the keyboard for the given item. canvas : a GooCanvas. item : the item to grab the keyboard for. owner_events : TRUE if keyboard events for this application will be reported normally, or FALSE if all keyboard events will be reported with respect to the grab item. time : the time of the event that lead to the keyboard grab. This should come from the relevant GdkEvent. Returns : GDK_GRAB_SUCCESS if the grab succeeded. <anchor id="goo-canvas-keyboard-ungrab" role="function"/>goo_canvas_keyboard_ungrab () goo_canvas_keyboard_ungrabvoid goo_canvas_keyboard_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time); Ungrabs the keyboard, if the given item has the keyboard grab. canvas : a GooCanvas. item : the item that has the keyboard grab. time : the time of the event that lead to the keyboard ungrab. This should come from the relevant GdkEvent. <anchor id="goo-canvas-create-cairo-context" role="function"/>goo_canvas_create_cairo_context () goo_canvas_create_cairo_contextcairo_t* goo_canvas_create_cairo_context (GooCanvas *canvas); Creates a cairo context, initialized with the default canvas settings. canvas : a GooCanvas. Returns : a new cairo context. It should be freed with cairo_destroy(). <anchor id="goo-canvas-create-item" role="function"/>goo_canvas_create_item () goo_canvas_create_itemGooCanvasItem* goo_canvas_create_item (GooCanvas *canvas, GooCanvasItemModel *model); This function is only intended to be used when implementing new canvas items, typically container items such as GooCanvasGroup. It creates a new canvas item for the given item model, and recursively creates items for any children. It uses the create_item() virtual method if it has been set. Subclasses of GooCanvas can define this method if they want to use custom views for items. It emits the "item-created" signal after creating the view, so application code can connect signal handlers to the new view if desired. canvas : a GooCanvas. model : the item model to create a canvas item for. Returns : a new canvas item. <anchor id="goo-canvas-unregister-item" role="function"/>goo_canvas_unregister_item () goo_canvas_unregister_itemvoid goo_canvas_unregister_item (GooCanvas *canvas, GooCanvasItemModel *model); This function is only intended to be used when implementing new canvas items. It should be called in the finalize method of GooCanvasItem objects, to remove the canvas item from the GooCanvas's hash table. canvas : a GooCanvas. model : the item model whose canvas item is being finalized. <anchor id="goo-canvas-register-widget-item" role="function"/>goo_canvas_register_widget_item () goo_canvas_register_widget_itemvoid goo_canvas_register_widget_item (GooCanvas *canvas, GooCanvasWidget *witem); This function should only be used by GooCanvasWidget and subclass implementations. It registers a widget item with the canvas, so that the canvas can do the necessary actions to move and resize the widget as needed. canvas : a GooCanvas. witem : a GooCanvasWidget item. <anchor id="goo-canvas-unregister-widget-item" role="function"/>goo_canvas_unregister_widget_item () goo_canvas_unregister_widget_itemvoid goo_canvas_unregister_widget_item (GooCanvas *canvas, GooCanvasWidget *witem); This function should only be used by GooCanvasWidget and subclass implementations. It unregisters a widget item from the canvas, when the item is no longer in the canvas. canvas : a GooCanvas. witem : a GooCanvasWidget item. <anchor id="goo-canvas-update" role="function"/>goo_canvas_update () goo_canvas_updatevoid goo_canvas_update (GooCanvas *canvas); This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations. It updates any items that need updating. If the bounds of items change, they will request a redraw of the old and new bounds so the display is updated correctly. canvas : a GooCanvas. <anchor id="goo-canvas-request-update" role="function"/>goo_canvas_request_update () goo_canvas_request_updatevoid goo_canvas_request_update (GooCanvas *canvas); This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations. It schedules an update of the GooCanvas. This will be performed in the idle loop, after all pending events have been handled, but before the canvas has been repainted. canvas : a GooCanvas. <anchor id="goo-canvas-request-redraw" role="function"/>goo_canvas_request_redraw () goo_canvas_request_redrawvoid goo_canvas_request_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds); This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations. Requests that the given bounds be redrawn. The bounds must be in the canvas coordinate space. canvas : a GooCanvas. bounds : the bounds to redraw, in device space. <anchor id="goo-canvas-request-item-redraw" role="function"/>goo_canvas_request_item_redraw () goo_canvas_request_item_redrawvoid goo_canvas_request_item_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds, gboolean is_static); This function is only intended to be used by subclasses of GooCanvas or GooCanvasItem implementations. Requests that the given bounds be redrawn. If is_static is TRUE the bounds are assumed to be in the static item coordinate space, otherwise they are assumed to be in the canvas coordinate space. If is_static is FALSE this function behaves the same as goo_canvas_request_redraw(). canvas : a GooCanvas. bounds : the bounds of the item to redraw. is_static : if the item is static. <anchor id="goo-canvas-get-default-line-width" role="function"/>goo_canvas_get_default_line_width () goo_canvas_get_default_line_widthgdouble goo_canvas_get_default_line_width (GooCanvas *canvas); Gets the default line width, which depends on the current units setting. canvas : a GooCanvas. Returns : the default line width of the canvas. Property Details <anchor id="GooCanvas--anchor"/>The <literal>"anchor"</literal> property GooCanvas:anchor "anchor" GtkAnchorType : Read / Write Where to place the canvas when it is smaller than the widget's allocated area.Default value: GTK_ANCHOR_NORTH_WEST <anchor id="GooCanvas--automatic-bounds"/>The <literal>"automatic-bounds"</literal> property GooCanvas:automatic-bounds "automatic-bounds" gboolean : Read / Write If the bounds are automatically calculated based on the bounds of all the items in the canvas.Default value: FALSE <anchor id="GooCanvas--background-color"/>The <literal>"background-color"</literal> property GooCanvas:background-color "background-color" gchararray : Write The color to use for the canvas background.Default value: NULL <anchor id="GooCanvas--background-color-rgb"/>The <literal>"background-color-rgb"</literal> property GooCanvas:background-color-rgb "background-color-rgb" guint : Write The color to use for the canvas background, specified as a 24-bit integer value, 0xRRGGBB.Default value: 0 <anchor id="GooCanvas--bounds-from-origin"/>The <literal>"bounds-from-origin"</literal> property GooCanvas:bounds-from-origin "bounds-from-origin" gboolean : Read / Write If the automatic bounds are calculated from the origin.Default value: TRUE <anchor id="GooCanvas--bounds-padding"/>The <literal>"bounds-padding"</literal> property GooCanvas:bounds-padding "bounds-padding" gdouble : Read / Write The padding added to the automatic bounds.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvas--clear-background"/>The <literal>"clear-background"</literal> property GooCanvas:clear-background "clear-background" gboolean : Read / Write If the background is cleared before the canvas is painted.Default value: TRUE <anchor id="GooCanvas--integer-layout"/>The <literal>"integer-layout"</literal> property GooCanvas:integer-layout "integer-layout" gboolean : Read / Write If all item layout is done to the nearest integer.Default value: FALSE <anchor id="GooCanvas--redraw-when-scrolled"/>The <literal>"redraw-when-scrolled"</literal> property GooCanvas:redraw-when-scrolled "redraw-when-scrolled" gboolean : Read / Write If the canvas is completely redrawn when scrolled, to reduce the flicker of static items.Default value: FALSE <anchor id="GooCanvas--resolution-x"/>The <literal>"resolution-x"</literal> property GooCanvas:resolution-x "resolution-x" gdouble : Read / Write The horizontal resolution of the display, in dots per inch.Allowed values: >= 0 Default value: 96 <anchor id="GooCanvas--resolution-y"/>The <literal>"resolution-y"</literal> property GooCanvas:resolution-y "resolution-y" gdouble : Read / Write The vertical resolution of the display, in dots per inch.Allowed values: >= 0 Default value: 96 <anchor id="GooCanvas--scale"/>The <literal>"scale"</literal> property GooCanvas:scale "scale" gdouble : Read / Write The magnification factor of the canvas.Allowed values: >= 0 Default value: 1 <anchor id="GooCanvas--scale-x"/>The <literal>"scale-x"</literal> property GooCanvas:scale-x "scale-x" gdouble : Read / Write The horizontal magnification factor of the canvas.Allowed values: >= 0 Default value: 1 <anchor id="GooCanvas--scale-y"/>The <literal>"scale-y"</literal> property GooCanvas:scale-y "scale-y" gdouble : Read / Write The vertical magnification factor of the canvas.Allowed values: >= 0 Default value: 1 <anchor id="GooCanvas--units"/>The <literal>"units"</literal> property GooCanvas:units "units" GtkUnit : Read / Write The units to use for the canvas.Default value: GTK_UNIT_PIXEL <anchor id="GooCanvas--x1"/>The <literal>"x1"</literal> property GooCanvas:x1 "x1" gdouble : Read / Write The x coordinate of the left edge of the canvas bounds, in canvas units.Default value: 0 <anchor id="GooCanvas--x2"/>The <literal>"x2"</literal> property GooCanvas:x2 "x2" gdouble : Read / Write The x coordinate of the right edge of the canvas bounds, in canvas units.Default value: 1000 <anchor id="GooCanvas--y1"/>The <literal>"y1"</literal> property GooCanvas:y1 "y1" gdouble : Read / Write The y coordinate of the top edge of the canvas bounds, in canvas units.Default value: 0 <anchor id="GooCanvas--y2"/>The <literal>"y2"</literal> property GooCanvas:y2 "y2" gdouble : Read / Write The y coordinate of the bottom edge of the canvas bounds, in canvas units.Default value: 1000 Signal Details <anchor id="GooCanvas-item-created"/>The <literal>"item-created"</literal> signal GooCanvas::item-createdvoid user_function (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model, gpointer user_data) : Run Last This is emitted when a new canvas item is created, in model/view mode. Applications can set up signal handlers for the new items here. canvas : the canvas. item : the new item. model : the item's model. user_data : user data set when the signal handler was connected. <anchor id="GooCanvas-set-scroll-adjustments"/>The <literal>"set-scroll-adjustments"</literal> signal GooCanvas::set-scroll-adjustmentsvoid user_function (GooCanvas *canvas, GtkAdjustment *hadjustment, GtkAdjustment *vadjustment, gpointer user_data) : Run Last / Action This is used when the GooCanvas is placed inside a GtkScrolledWindow, to connect up the adjustments so scrolling works properly. It isn't useful for applications. canvas : the canvas. hadjustment : the horizontal adjustment. vadjustment : the vertical adjustment. user_data : user data set when the signal handler was connected. goocanvas-0.15/docs/xml/goocanvasstyle.xml0000644000076400007640000005134611222215703015667 00000000000000 GooCanvasStyle 3 GOOCANVAS Library GooCanvasStyle support for cascading style properties for canvas items. Synopsis GooCanvasStyle; GooCanvasStyleProperty; GooCanvasStyle* goo_canvas_style_new (void); GooCanvasStyle* goo_canvas_style_copy (GooCanvasStyle *style); GooCanvasStyle* goo_canvas_style_get_parent (GooCanvasStyle *style); void goo_canvas_style_set_parent (GooCanvasStyle *style, GooCanvasStyle *parent); GValue* goo_canvas_style_get_property (GooCanvasStyle *style, GQuark property_id); void goo_canvas_style_set_property (GooCanvasStyle *style, GQuark property_id, const GValue *value); gboolean goo_canvas_style_set_fill_options (GooCanvasStyle *style, cairo_t *cr); gboolean goo_canvas_style_set_stroke_options (GooCanvasStyle *style, cairo_t *cr); extern GQuark goo_canvas_style_antialias_id; extern GQuark goo_canvas_style_fill_pattern_id; extern GQuark goo_canvas_style_fill_rule_id; extern GQuark goo_canvas_style_font_desc_id; extern GQuark goo_canvas_style_hint_metrics_id; extern GQuark goo_canvas_style_line_cap_id; extern GQuark goo_canvas_style_line_dash_id; extern GQuark goo_canvas_style_line_join_id; extern GQuark goo_canvas_style_line_join_miter_limit_id; extern GQuark goo_canvas_style_line_width_id; extern GQuark goo_canvas_style_operator_id; extern GQuark goo_canvas_style_stroke_pattern_id; Object Hierarchy GObject +----GooCanvasStyle Description GooCanvasStyle provides support for cascading style properties for canvas items. It is intended to be used when implementing new canvas items. Style properties are identified by a unique GQuark, and contain arbitrary data stored in a GValue. GooCanvasStyle also provides a few convenience functions such as goo_canvas_style_set_stroke_options() and goo_canvas_style_set_fill_options() which efficiently apply an item's standard style properties to the given cairo_t. Details <anchor id="GooCanvasStyle-struct" role="struct"/>GooCanvasStyle GooCanvasStyletypedef struct { GooCanvasStyle *parent; GArray *properties; } GooCanvasStyle; GooCanvasStyle holds the style properties of a canvas item, as well as a pointer to the parent style. GooCanvasStyle *parent; the parent style. GArray *properties; an array of GooCanvasStyleProperty property settings. <anchor id="GooCanvasStyleProperty" role="struct"/>GooCanvasStyleProperty GooCanvasStylePropertytypedef struct { GQuark id; GValue value; } GooCanvasStyleProperty; GooCanvasStyleProperty represents a property setting. GQuark id; the unique property identifier. GValue value; the value of the property. <anchor id="goo-canvas-style-new" role="function"/>goo_canvas_style_new () goo_canvas_style_newGooCanvasStyle* goo_canvas_style_new (void); Creates a new GooCanvasStyle. Returns : a new GooCanvasStyle. <anchor id="goo-canvas-style-copy" role="function"/>goo_canvas_style_copy () goo_canvas_style_copyGooCanvasStyle* goo_canvas_style_copy (GooCanvasStyle *style); Copies the given GooCanvasStyle, by copying all of its properties. Though the parent of the new style is left unset. style : a GooCanvasStyle. Returns : a copy of the given GooCanvasStyle. <anchor id="goo-canvas-style-get-parent" role="function"/>goo_canvas_style_get_parent () goo_canvas_style_get_parentGooCanvasStyle* goo_canvas_style_get_parent (GooCanvasStyle *style); Gets the parent of the style. style : a style. Returns : the parent of the given style, or NULL. <anchor id="goo-canvas-style-set-parent" role="function"/>goo_canvas_style_set_parent () goo_canvas_style_set_parentvoid goo_canvas_style_set_parent (GooCanvasStyle *style, GooCanvasStyle *parent); Sets the parent of the style. style : a style. parent : the new parent. <anchor id="goo-canvas-style-get-property" role="function"/>goo_canvas_style_get_property () goo_canvas_style_get_propertyGValue* goo_canvas_style_get_property (GooCanvasStyle *style, GQuark property_id); Gets the value of a property. This searches though all the GooCanvasStyle's own list of property settings and also all ancestor GooCanvasStyle objects. Note that it returns a pointer to the internal GValue setting, which should not be changed. style : a style. property_id : the property identifier. Returns : the property value, or NULL if it isn't set. <anchor id="goo-canvas-style-set-property" role="function"/>goo_canvas_style_set_property () goo_canvas_style_set_propertyvoid goo_canvas_style_set_property (GooCanvasStyle *style, GQuark property_id, const GValue *value); Sets a property in the style, replacing any current setting. Note that this will override the property setting in ancestor GooCanvasStyle objects. style : a style. property_id : the property identifier. value : the value of the property. <anchor id="goo-canvas-style-set-fill-options" role="function"/>goo_canvas_style_set_fill_options () goo_canvas_style_set_fill_optionsgboolean goo_canvas_style_set_fill_options (GooCanvasStyle *style, cairo_t *cr); Sets the standard cairo fill options using the given style. style : a style. cr : a cairo context. Returns : TRUE if a paint source is set, or FALSE if the fill should be skipped. <anchor id="goo-canvas-style-set-stroke-options" role="function"/>goo_canvas_style_set_stroke_options () goo_canvas_style_set_stroke_optionsgboolean goo_canvas_style_set_stroke_options (GooCanvasStyle *style, cairo_t *cr); Sets the standard cairo stroke options using the given style. style : a style. cr : a cairo context. Returns : TRUE if a paint source is set, or FALSE if the stroke should be skipped. <anchor id="goo-canvas-style-antialias-id" role="variable"/>goo_canvas_style_antialias_id goo_canvas_style_antialias_idextern GQuark goo_canvas_style_antialias_id; Unique GQuark identifier used for the standard antialias property. <anchor id="goo-canvas-style-fill-pattern-id" role="variable"/>goo_canvas_style_fill_pattern_id goo_canvas_style_fill_pattern_idextern GQuark goo_canvas_style_fill_pattern_id; Unique GQuark identifier used for the standard fill pattern property. <anchor id="goo-canvas-style-fill-rule-id" role="variable"/>goo_canvas_style_fill_rule_id goo_canvas_style_fill_rule_idextern GQuark goo_canvas_style_fill_rule_id; Unique GQuark identifier used for the standard fill rule property. <anchor id="goo-canvas-style-font-desc-id" role="variable"/>goo_canvas_style_font_desc_id goo_canvas_style_font_desc_idextern GQuark goo_canvas_style_font_desc_id; Unique GQuark identifier used for the standard font description property. <anchor id="goo-canvas-style-hint-metrics-id" role="variable"/>goo_canvas_style_hint_metrics_id goo_canvas_style_hint_metrics_idextern GQuark goo_canvas_style_hint_metrics_id; Unique GQuark identifier used for the standard hint metrics property. <anchor id="goo-canvas-style-line-cap-id" role="variable"/>goo_canvas_style_line_cap_id goo_canvas_style_line_cap_idextern GQuark goo_canvas_style_line_cap_id; Unique GQuark identifier used for the standard line cap property. <anchor id="goo-canvas-style-line-dash-id" role="variable"/>goo_canvas_style_line_dash_id goo_canvas_style_line_dash_idextern GQuark goo_canvas_style_line_dash_id; Unique GQuark identifier used for the standard line dash property. <anchor id="goo-canvas-style-line-join-id" role="variable"/>goo_canvas_style_line_join_id goo_canvas_style_line_join_idextern GQuark goo_canvas_style_line_join_id; Unique GQuark identifier used for the standard line join property. <anchor id="goo-canvas-style-line-join-miter-limit-id" role="variable"/>goo_canvas_style_line_join_miter_limit_id goo_canvas_style_line_join_miter_limit_idextern GQuark goo_canvas_style_line_join_miter_limit_id; Unique GQuark identifier used for the standard miter limit property. <anchor id="goo-canvas-style-line-width-id" role="variable"/>goo_canvas_style_line_width_id goo_canvas_style_line_width_idextern GQuark goo_canvas_style_line_width_id; Unique GQuark identifier used for the standard line width property. <anchor id="goo-canvas-style-operator-id" role="variable"/>goo_canvas_style_operator_id goo_canvas_style_operator_idextern GQuark goo_canvas_style_operator_id; Unique GQuark identifier used for the standard operator property. <anchor id="goo-canvas-style-stroke-pattern-id" role="variable"/>goo_canvas_style_stroke_pattern_id goo_canvas_style_stroke_pattern_idextern GQuark goo_canvas_style_stroke_pattern_id; Unique GQuark identifier used for the standard stroke pattern property. goocanvas-0.15/docs/xml/goocanvaspathmodel.xml0000644000076400007640000002476411222215703016510 00000000000000 GooCanvasPathModel 3 GOOCANVAS Library GooCanvasPathModel a model for path items (a series of lines and curves). Synopsis GooCanvasPathModel; GooCanvasItemModel* goo_canvas_path_model_new (GooCanvasItemModel *parent, const gchar *path_data, ...); Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasPathModel Implemented Interfaces GooCanvasPathModel implements GooCanvasItemModel. Properties "data" gchararray : Write "height" gdouble : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasPathModel represents a model for path items, which are a series of one or more lines, bezier curves, or elliptical arcs. It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(). GooCanvasPathModel uses the same path specification strings as the Scalable Vector Graphics (SVG) path element. For details see the SVG specification. To create a GooCanvasPathModel use goo_canvas_path_model_new(). To get or set the properties of an existing GooCanvasPathModel, use g_object_get() and g_object_set(). To respond to events such as mouse clicks on the path you must connect to the signal handlers of the corresponding GooCanvasPath objects. (See goo_canvas_get_item() and "item-created".) Details <anchor id="GooCanvasPathModel-struct" role="struct"/>GooCanvasPathModel GooCanvasPathModeltypedef struct _GooCanvasPathModel GooCanvasPathModel; The GooCanvasPathModel struct contains private data only. <anchor id="goo-canvas-path-model-new" role="function"/>goo_canvas_path_model_new () goo_canvas_path_model_newGooCanvasItemModel* goo_canvas_path_model_new (GooCanvasItemModel *parent, const gchar *path_data, ...); Creates a new path model. parent : the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. path_data : the sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new path model. Here's an example showing how to create a red line from (20,20) to (40,40): GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup, "M 20 20 L 40 40", "stroke-color", "red", NULL); This example creates a cubic bezier curve from (20,100) to (100,100) with the control points at (20,50) and (100,50): GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup, "M20,100 C20,50 100,50 100,100", "stroke-color", "blue", NULL); This example uses an elliptical arc to create a filled circle with one quarter missing: GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup, "M200,500 h-150 a150,150 0 1,0 150,-150 z", "fill-color", "red", "stroke-color", "blue", "line-width", 5.0, NULL); Property Details <anchor id="GooCanvasPathModel--data"/>The <literal>"data"</literal> property GooCanvasPathModel:data "data" gchararray : Write The sequence of path commands.Default value: NULL <anchor id="GooCanvasPathModel--height"/>The <literal>"height"</literal> property GooCanvasPathModel:height "height" gdouble : Read / Write The height of the path.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasPathModel--width"/>The <literal>"width"</literal> property GooCanvasPathModel:width "width" gdouble : Read / Write The width of the path.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasPathModel--x"/>The <literal>"x"</literal> property GooCanvasPathModel:x "x" gdouble : Read / Write The x coordinate of the path.Default value: 0 <anchor id="GooCanvasPathModel--y"/>The <literal>"y"</literal> property GooCanvasPathModel:y "y" gdouble : Read / Write The y coordinate of the path.Default value: 0 goocanvas-0.15/docs/xml/goocanvasellipsemodel.xml0000644000076400007640000003064011222215703017177 00000000000000 GooCanvasEllipseModel 3 GOOCANVAS Library GooCanvasEllipseModel a model for ellipse items. Synopsis GooCanvasEllipseModel; GooCanvasItemModel* goo_canvas_ellipse_model_new (GooCanvasItemModel *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...); Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasEllipseModel Implemented Interfaces GooCanvasEllipseModel implements GooCanvasItemModel. Properties "center-x" gdouble : Read / Write "center-y" gdouble : Read / Write "height" gdouble : Read / Write "radius-x" gdouble : Read / Write "radius-y" gdouble : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasEllipseModel represents a model for ellipse items. It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(). To create a GooCanvasEllipseModel use goo_canvas_ellipse_model_new(). To get or set the properties of an existing GooCanvasEllipseModel, use g_object_get() and g_object_set(). The ellipse can be specified either with the "center-x", "center-y", "radius-x" and "radius-y" properties, or with the "x", "y", "width" and "height" properties. To respond to events such as mouse clicks on the ellipse you must connect to the signal handlers of the corresponding GooCanvasEllipse objects. (See goo_canvas_get_item() and "item-created".) Details <anchor id="GooCanvasEllipseModel-struct" role="struct"/>GooCanvasEllipseModel GooCanvasEllipseModeltypedef struct _GooCanvasEllipseModel GooCanvasEllipseModel; The GooCanvasEllipseModel struct contains private data only. <anchor id="goo-canvas-ellipse-model-new" role="function"/>goo_canvas_ellipse_model_new () goo_canvas_ellipse_model_newGooCanvasItemModel* goo_canvas_ellipse_model_new (GooCanvasItemModel *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...); Creates a new ellipse model. parent : the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. center_x : the x coordinate of the center of the ellipse. center_y : the y coordinate of the center of the ellipse. radius_x : the horizontal radius of the ellipse. radius_y : the vertical radius of the ellipse. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new ellipse model. Here's an example showing how to create an ellipse centered at (100.0, 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. It is drawn with a red outline with a width of 5.0 and filled with blue: GooCanvasItemModel *ellipse = goo_canvas_ellipse_model_new (mygroup, 100.0, 100.0, 50.0, 30.0, "stroke-color", "red", "line-width", 5.0, "fill-color", "blue", NULL); Property Details <anchor id="GooCanvasEllipseModel--center-x"/>The <literal>"center-x"</literal> property GooCanvasEllipseModel:center-x "center-x" gdouble : Read / Write The x coordinate of the center of the ellipse.Default value: 0 <anchor id="GooCanvasEllipseModel--center-y"/>The <literal>"center-y"</literal> property GooCanvasEllipseModel:center-y "center-y" gdouble : Read / Write The y coordinate of the center of the ellipse.Default value: 0 <anchor id="GooCanvasEllipseModel--height"/>The <literal>"height"</literal> property GooCanvasEllipseModel:height "height" gdouble : Read / Write The height of the ellipse.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasEllipseModel--radius-x"/>The <literal>"radius-x"</literal> property GooCanvasEllipseModel:radius-x "radius-x" gdouble : Read / Write The horizontal radius of the ellipse.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasEllipseModel--radius-y"/>The <literal>"radius-y"</literal> property GooCanvasEllipseModel:radius-y "radius-y" gdouble : Read / Write The vertical radius of the ellipse.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasEllipseModel--width"/>The <literal>"width"</literal> property GooCanvasEllipseModel:width "width" gdouble : Read / Write The width of the ellipse.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasEllipseModel--x"/>The <literal>"x"</literal> property GooCanvasEllipseModel:x "x" gdouble : Read / Write The x coordinate of the left side of the ellipse.Default value: 0 <anchor id="GooCanvasEllipseModel--y"/>The <literal>"y"</literal> property GooCanvasEllipseModel:y "y" gdouble : Read / Write The y coordinate of the top of the ellipse.Default value: 0 goocanvas-0.15/docs/xml/model-view-canvas.xml0000644000076400007640000001073311222215703016142 00000000000000 Model/View Canvas Example 3 GOOCANVAS Library Model/View Canvas Example how to create a model/view canvas. Model View Canvas Example Here's a complete example application that creates a model-view GooCanvas with a rectangle and a text item in it. #include <stdlib.h> #include <goocanvas.h> static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItemModel *root, *rect_model, *text_model; GooCanvasItem *rect_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event, NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_group_model_new (NULL, NULL); /* Add a few simple items. */ rect_model = goo_canvas_rect_model_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_model = goo_canvas_text_model_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_model_rotate (text_model, 45, 300, 300); goo_canvas_set_root_item_model (GOO_CANVAS (canvas), root); /* Connect a signal handler for the rectangle item. */ rect_item = goo_canvas_get_item (GOO_CANVAS (canvas), rect_model); g_signal_connect (rect_item, "button_press_event", (GtkSignalFunc) on_rect_button_press, NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-0.15/docs/xml/goocanvasgroupmodel.xml0000644000076400007640000002043211222215703016674 00000000000000 GooCanvasGroupModel 3 GOOCANVAS Library GooCanvasGroupModel a model for a group of items. Synopsis GooCanvasGroupModel; GooCanvasItemModel* goo_canvas_group_model_new (GooCanvasItemModel *parent, ...); Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasGroupModel +----GooCanvasTableModel Implemented Interfaces GooCanvasGroupModel implements GooCanvasItemModel. Properties "height" gdouble : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasGroupModel represents a group of items. Groups can be nested to any depth, to create a hierarchy of items. Items are ordered within each group, with later items being displayed above earlier items. GooCanvasGroupModel is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasGroupModel will affect all children of the GooCanvasGroupModel (unless the children override the property setting). GooCanvasGroupModel implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(), and the properties such as "visibility" and "pointer-events". To create a GooCanvasGroupModel use goo_canvas_group_model_new(). To get or set the properties of an existing GooCanvasGroupModel, use g_object_get() and g_object_set(). To respond to events such as mouse clicks on the group you must connect to the signal handlers of the corresponding GooCanvasGroup objects. (See goo_canvas_get_item() and "item-created".) Details <anchor id="GooCanvasGroupModel-struct" role="struct"/>GooCanvasGroupModel GooCanvasGroupModeltypedef struct _GooCanvasGroupModel GooCanvasGroupModel; The GooCanvasGroupModel struct contains private data only. <anchor id="goo-canvas-group-model-new" role="function"/>goo_canvas_group_model_new () goo_canvas_group_model_newGooCanvasItemModel* goo_canvas_group_model_new (GooCanvasItemModel *parent, ...); Creates a new group item. parent : the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new group model. Property Details <anchor id="GooCanvasGroupModel--height"/>The <literal>"height"</literal> property GooCanvasGroupModel:height "height" gdouble : Read / Write The height of the group, or -1 to use the default height.Default value: -1 <anchor id="GooCanvasGroupModel--width"/>The <literal>"width"</literal> property GooCanvasGroupModel:width "width" gdouble : Read / Write The width of the group, or -1 to use the default width.Default value: -1 <anchor id="GooCanvasGroupModel--x"/>The <literal>"x"</literal> property GooCanvasGroupModel:x "x" gdouble : Read / Write The x coordinate of the group.Default value: 0 <anchor id="GooCanvasGroupModel--y"/>The <literal>"y"</literal> property GooCanvasGroupModel:y "y" gdouble : Read / Write The y coordinate of the group.Default value: 0 goocanvas-0.15/docs/xml/architecture.xml0000644000076400007640000001631611222215703015306 00000000000000 Underlying Architecture 3 GOOCANVAS Library Underlying Architecture how the canvas fits together. Underlying Architecture The GooCanvas Widget GooCanvas is a GtkWidget (it is actually a subclass of GtkContainer), and so can be placed in an interface just like any normal widget. Usually a GooCanvas widget would be placed inside a GtkScrolledWindow in order to enable scrolling of the canvas. The size of the canvas can be set explicitly using goo_canvas_set_bounds(), or if the "automatic-bounds" property is set to TRUE the bounds will be automatically calculated to include all of the canvas items. The units used in the canvas can be set with the "units" property. The canvas units can be pixels, points, inches or millimeters and apply to the canvas and all items. The Structure of the Simple Canvas The simple canvas consists of a hierarchy of canvas items. The root item is automatically created by the canvas and can be accessed using goo_canvas_get_root_item(). New items and groups can then be created and added to the root item. Each item in the canvas keeps a GooCanvasBounds structure which stores the bounding rectangle of the item and all of its descendants. This makes it easy to find out which items in the canvas need repainting or which item the mouse is over. (The bounds are stored in the canvas coordinate space, which is the coordinate space of the entire canvas, after any item transformation matrices have been applied.) The Structure of the Model/View Canvas The model/view canvas consists of a hierarchy of item models, and an identical hierarchy of canvas items, with each canvas item corresponding to one item model. The hierarchy of item models can be used in several GooCanvas widgets, to allow multiple views of the same model. Though different canvas items will be used in each GooCanvas. The root item model is set with goo_canvas_set_root_item_model(). The canvas will automatically create canvas items to display the hierarchy of item models, and will automatically add and remove canvas items as the item model hierarchy is changed. The Update Procedure When items are added to the canvas or their properties are changed they may need to recalculate their bounds. To do this they set an internal flag such as need_update, and make a call to goo_canvas_item_request_update(). GooCanvas handles all the update requests at once, to avoids multiple redraws of the same parts of the canvas. To do this it installs an idle handler, goo_canvas_idle_handler(), which is called as soon as the application is idle (and before any part of the canvas is redrawn). The idle handler calls goo_canvas_item_update() on the root item, which recursively calls goo_canvas_item_update() on any items as necessary, recalculating their bounds and requesting redraws as appropriate. If a container item (e.g. GooCanvasGroup) is changed it needs to ensure that all descendants recalculate their bounds so it calls goo_canvas_item_update() for all of its children with the entire_tree argument set to TRUE. How Changes to Items are Handled When an item is changed (e.g. if the "x" property of a GooCanvasRect is changed), the item calls goo_canvas_item_simple_changed() with a flag indicating if the bounds of the item need to be recalculated. If the bounds don't need to be recalculated, then goo_canvas_request_redraw() is called to simply request that the item is redrawn. This results in a call to gdk_window_invalidate_rect() and the redraw proceeds just like a normal GtkWidget. However, if the bounds do need to be recalculated then goo_canvas_item_request_update() is called to request that the item be updated the next time the canvas performs an update. How Changes are Handled in the Model/View Canvas In the Model/View canvas it is the underlying item models which are initially changed. The item models emit "changed" signals which the items respond to. For the standard canvas items the goo_canvas_item_model_simple_changed() signal handler is called, which calls goo_canvas_item_simple_changed() and the procedure continues as in the simple canvas case above. goocanvas-0.15/docs/xml/goocanvasgrid.xml0000644000076400007640000006326711222215703015461 00000000000000 GooCanvasGrid 3 GOOCANVAS Library GooCanvasGrid a grid item. Synopsis GooCanvasGrid; GooCanvasItem* goo_canvas_grid_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasGrid Implemented Interfaces GooCanvasGrid implements GooCanvasItem. Properties "border-color" gchararray : Write "border-color-rgba" guint : Read / Write "border-pattern" GooCairoPattern : Read / Write "border-pixbuf" GdkPixbuf : Write "border-width" gdouble : Read / Write "height" gdouble : Read / Write "horz-grid-line-color" gchararray : Write "horz-grid-line-color-rgba" guint : Read / Write "horz-grid-line-pattern" GooCairoPattern : Read / Write "horz-grid-line-pixbuf" GdkPixbuf : Write "horz-grid-line-width" gdouble : Read / Write "show-horz-grid-lines" gboolean : Read / Write "show-vert-grid-lines" gboolean : Read / Write "vert-grid-line-color" gchararray : Write "vert-grid-line-color-rgba" guint : Read / Write "vert-grid-line-pattern" GooCairoPattern : Read / Write "vert-grid-line-pixbuf" GdkPixbuf : Write "vert-grid-line-width" gdouble : Read / Write "vert-grid-lines-on-top" gboolean : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "x-offset" gdouble : Read / Write "x-step" gdouble : Read / Write "y" gdouble : Read / Write "y-offset" gdouble : Read / Write "y-step" gdouble : Read / Write Description GooCanvasGrid represents a grid item. A grid consists of a number of equally-spaced horizontal and vertical grid lines, plus an optional border. It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(). To create a GooCanvasGrid use goo_canvas_grid_new(). To get or set the properties of an existing GooCanvasGrid, use g_object_get() and g_object_set(). The grid's position and size is specified with the "x", "y", "width" and "height" properties. The "x-step" and "y-step" properties specify the distance between grid lines. The "x-offset" and "y-offset" properties specify the distance before the first grid lines. The horizontal or vertical grid lines can be hidden using the "show-horz-grid-lines" and "show-vert-grid-lines" properties. The width of the border can be set using the "border-width" property. The border is drawn outside the area specified with the "x", "y", "width" and "height" properties. Other properties allow the colors and widths of the grid lines to be set. The grid line color and width properties override the standard "stroke-color" and "line-width" properties, enabling different styles for horizontal and vertical grid lines. Details <anchor id="GooCanvasGrid-struct" role="struct"/>GooCanvasGrid GooCanvasGridtypedef struct _GooCanvasGrid GooCanvasGrid; The GooCanvasGrid struct contains private data only. <anchor id="goo-canvas-grid-new" role="function"/>goo_canvas_grid_new () goo_canvas_grid_newGooCanvasItem* goo_canvas_grid_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...); Creates a new grid item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. x : the x coordinate of the left of the grid. y : the y coordinate of the top of the grid. width : the width of the grid. height : the height of the grid. x_step : the distance between the vertical grid lines. y_step : the distance between the horizontal grid lines. x_offset : the distance before the first vertical grid line. y_offset : the distance before the first horizontal grid line. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new grid item. Here's an example showing how to create a grid: GooCanvasItem *grid = goo_canvas_grid_new (mygroup, 100.0, 100.0, 400.0, 200.0, 20.0, 20.0, 10.0, 10.0, "horz-grid-line-width", 4.0, "horz-grid-line-color", "yellow", "vert-grid-line-width", 2.0, "vert-grid-line-color", "red", "border-width", 3.0, "border-color", "white", "fill-color", "blue", NULL); Property Details <anchor id="GooCanvasGrid--border-color"/>The <literal>"border-color"</literal> property GooCanvasGrid:border-color "border-color" gchararray : Write The color to use for the border.Default value: NULL <anchor id="GooCanvasGrid--border-color-rgba"/>The <literal>"border-color-rgba"</literal> property GooCanvasGrid:border-color-rgba "border-color-rgba" guint : Read / Write The color to use for the border, specified as a 32-bit integer value.Default value: 0 <anchor id="GooCanvasGrid--border-pattern"/>The <literal>"border-pattern"</literal> property GooCanvasGrid:border-pattern "border-pattern" GooCairoPattern : Read / Write The cairo pattern to paint the border with. <anchor id="GooCanvasGrid--border-pixbuf"/>The <literal>"border-pixbuf"</literal> property GooCanvasGrid:border-pixbuf "border-pixbuf" GdkPixbuf : Write The pixbuf to use to draw the border. <anchor id="GooCanvasGrid--border-width"/>The <literal>"border-width"</literal> property GooCanvasGrid:border-width "border-width" gdouble : Read / Write The width of the border around the grid.Default value: -1 <anchor id="GooCanvasGrid--height"/>The <literal>"height"</literal> property GooCanvasGrid:height "height" gdouble : Read / Write The height of the grid.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasGrid--horz-grid-line-color"/>The <literal>"horz-grid-line-color"</literal> property GooCanvasGrid:horz-grid-line-color "horz-grid-line-color" gchararray : Write The color to use for the horizontal grid lines.Default value: NULL <anchor id="GooCanvasGrid--horz-grid-line-color-rgba"/>The <literal>"horz-grid-line-color-rgba"</literal> property GooCanvasGrid:horz-grid-line-color-rgba "horz-grid-line-color-rgba" guint : Read / Write The color to use for the horizontal grid lines, specified as a 32-bit integer value.Default value: 0 <anchor id="GooCanvasGrid--horz-grid-line-pattern"/>The <literal>"horz-grid-line-pattern"</literal> property GooCanvasGrid:horz-grid-line-pattern "horz-grid-line-pattern" GooCairoPattern : Read / Write The cairo pattern to paint the horizontal grid lines with. <anchor id="GooCanvasGrid--horz-grid-line-pixbuf"/>The <literal>"horz-grid-line-pixbuf"</literal> property GooCanvasGrid:horz-grid-line-pixbuf "horz-grid-line-pixbuf" GdkPixbuf : Write The pixbuf to use to draw the horizontal grid lines. <anchor id="GooCanvasGrid--horz-grid-line-width"/>The <literal>"horz-grid-line-width"</literal> property GooCanvasGrid:horz-grid-line-width "horz-grid-line-width" gdouble : Read / Write The width of the horizontal grid lines.Default value: -1 <anchor id="GooCanvasGrid--show-horz-grid-lines"/>The <literal>"show-horz-grid-lines"</literal> property GooCanvasGrid:show-horz-grid-lines "show-horz-grid-lines" gboolean : Read / Write If the horizontal grid lines are shown.Default value: TRUE <anchor id="GooCanvasGrid--show-vert-grid-lines"/>The <literal>"show-vert-grid-lines"</literal> property GooCanvasGrid:show-vert-grid-lines "show-vert-grid-lines" gboolean : Read / Write If the vertical grid lines are shown.Default value: TRUE <anchor id="GooCanvasGrid--vert-grid-line-color"/>The <literal>"vert-grid-line-color"</literal> property GooCanvasGrid:vert-grid-line-color "vert-grid-line-color" gchararray : Write The color to use for the vertical grid lines.Default value: NULL <anchor id="GooCanvasGrid--vert-grid-line-color-rgba"/>The <literal>"vert-grid-line-color-rgba"</literal> property GooCanvasGrid:vert-grid-line-color-rgba "vert-grid-line-color-rgba" guint : Read / Write The color to use for the vertical grid lines, specified as a 32-bit integer value.Default value: 0 <anchor id="GooCanvasGrid--vert-grid-line-pattern"/>The <literal>"vert-grid-line-pattern"</literal> property GooCanvasGrid:vert-grid-line-pattern "vert-grid-line-pattern" GooCairoPattern : Read / Write The cairo pattern to paint the vertical grid lines with. <anchor id="GooCanvasGrid--vert-grid-line-pixbuf"/>The <literal>"vert-grid-line-pixbuf"</literal> property GooCanvasGrid:vert-grid-line-pixbuf "vert-grid-line-pixbuf" GdkPixbuf : Write The pixbuf to use to draw the vertical grid lines. <anchor id="GooCanvasGrid--vert-grid-line-width"/>The <literal>"vert-grid-line-width"</literal> property GooCanvasGrid:vert-grid-line-width "vert-grid-line-width" gdouble : Read / Write The width of the vertical grid lines.Default value: -1 <anchor id="GooCanvasGrid--vert-grid-lines-on-top"/>The <literal>"vert-grid-lines-on-top"</literal> property GooCanvasGrid:vert-grid-lines-on-top "vert-grid-lines-on-top" gboolean : Read / Write If the vertical grid lines are painted above the horizontal grid lines.Default value: FALSE <anchor id="GooCanvasGrid--width"/>The <literal>"width"</literal> property GooCanvasGrid:width "width" gdouble : Read / Write The width of the grid.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasGrid--x"/>The <literal>"x"</literal> property GooCanvasGrid:x "x" gdouble : Read / Write The x coordinate of the grid.Default value: 0 <anchor id="GooCanvasGrid--x-offset"/>The <literal>"x-offset"</literal> property GooCanvasGrid:x-offset "x-offset" gdouble : Read / Write The distance before the first vertical grid line.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasGrid--x-step"/>The <literal>"x-step"</literal> property GooCanvasGrid:x-step "x-step" gdouble : Read / Write The distance between the vertical grid lines.Allowed values: >= 0 Default value: 10 <anchor id="GooCanvasGrid--y"/>The <literal>"y"</literal> property GooCanvasGrid:y "y" gdouble : Read / Write The y coordinate of the grid.Default value: 0 <anchor id="GooCanvasGrid--y-offset"/>The <literal>"y-offset"</literal> property GooCanvasGrid:y-offset "y-offset" gdouble : Read / Write The distance before the first horizontal grid line.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasGrid--y-step"/>The <literal>"y-step"</literal> property GooCanvasGrid:y-step "y-step" gdouble : Read / Write The distance between the horizontal grid lines.Allowed values: >= 0 Default value: 10 goocanvas-0.15/docs/xml/goocanvaspolyline.xml0000644000076400007640000004072711222215703016363 00000000000000 GooCanvasPolyline 3 GOOCANVAS Library GooCanvasPolyline a polyline item (a series of lines with optional arrows). Synopsis GooCanvasPolyline; GooCanvasItem* goo_canvas_polyline_new (GooCanvasItem *parent, gboolean close_path, gint num_points, ...); GooCanvasItem* goo_canvas_polyline_new_line (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasPolyline Implemented Interfaces GooCanvasPolyline implements GooCanvasItem. Properties "arrow-length" gdouble : Read / Write "arrow-tip-length" gdouble : Read / Write "arrow-width" gdouble : Read / Write "close-path" gboolean : Read / Write "end-arrow" gboolean : Read / Write "height" gdouble : Read / Write "points" GooCanvasPoints : Read / Write "start-arrow" gboolean : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasPolyline represents a polyline item, which is a series of one or more lines, with optional arrows at either end. It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(). To create a GooCanvasPolyline use goo_canvas_polyline_new(), or goo_canvas_polyline_new_line() for a simple line between two points. To get or set the properties of an existing GooCanvasPolyline, use g_object_get() and g_object_set(). Details <anchor id="GooCanvasPolyline-struct" role="struct"/>GooCanvasPolyline GooCanvasPolylinetypedef struct _GooCanvasPolyline GooCanvasPolyline; The GooCanvasPolyline struct contains private data only. <anchor id="goo-canvas-polyline-new" role="function"/>goo_canvas_polyline_new () goo_canvas_polyline_newGooCanvasItem* goo_canvas_polyline_new (GooCanvasItem *parent, gboolean close_path, gint num_points, ...); Creates a new polyline item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. close_path : if the last point should be connected to the first. num_points : the number of points in the polyline. ... : the pairs of coordinates for each point in the line, followed by optional pairs of property names and values, and a terminating NULL. Returns : a new polyline item. Here's an example showing how to create a filled triangle with vertices at (100,100), (300,100), and (200,300). GooCanvasItem *polyline = goo_canvas_polyline_new (mygroup, TRUE, 3, 100.0, 100.0, 300.0, 100.0, 200.0, 300.0, "stroke-color", "red", "line-width", 5.0, "fill-color", "blue", NULL); <anchor id="goo-canvas-polyline-new-line" role="function"/>goo_canvas_polyline_new_line () goo_canvas_polyline_new_lineGooCanvasItem* goo_canvas_polyline_new_line (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); Creates a new polyline item with a single line. parent : the parent item, or NULL. x1 : the x coordinate of the start of the line. y1 : the y coordinate of the start of the line. x2 : the x coordinate of the end of the line. y2 : the y coordinate of the end of the line. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new polyline item. Here's an example showing how to create a line from (100,100) to (300,300). GooCanvasItem *polyline = goo_canvas_polyline_new_line (mygroup, 100.0, 100.0, 300.0, 300.0, "stroke-color", "red", "line-width", 5.0, NULL); Property Details <anchor id="GooCanvasPolyline--arrow-length"/>The <literal>"arrow-length"</literal> property GooCanvasPolyline:arrow-length "arrow-length" gdouble : Read / Write The length of the arrows, as a multiple of the line width.Allowed values: >= 0 Default value: 5 <anchor id="GooCanvasPolyline--arrow-tip-length"/>The <literal>"arrow-tip-length"</literal> property GooCanvasPolyline:arrow-tip-length "arrow-tip-length" gdouble : Read / Write The length of the arrow tip, as a multiple of the line width.Allowed values: >= 0 Default value: 4 <anchor id="GooCanvasPolyline--arrow-width"/>The <literal>"arrow-width"</literal> property GooCanvasPolyline:arrow-width "arrow-width" gdouble : Read / Write The width of the arrows, as a multiple of the line width.Allowed values: >= 0 Default value: 4 <anchor id="GooCanvasPolyline--close-path"/>The <literal>"close-path"</literal> property GooCanvasPolyline:close-path "close-path" gboolean : Read / Write If the last point should be connected to the first.Default value: FALSE <anchor id="GooCanvasPolyline--end-arrow"/>The <literal>"end-arrow"</literal> property GooCanvasPolyline:end-arrow "end-arrow" gboolean : Read / Write If an arrow should be displayed at the end of the polyline.Default value: FALSE <anchor id="GooCanvasPolyline--height"/>The <literal>"height"</literal> property GooCanvasPolyline:height "height" gdouble : Read / Write The height of the polyline.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasPolyline--points"/>The <literal>"points"</literal> property GooCanvasPolyline:points "points" GooCanvasPoints : Read / Write The array of points. <anchor id="GooCanvasPolyline--start-arrow"/>The <literal>"start-arrow"</literal> property GooCanvasPolyline:start-arrow "start-arrow" gboolean : Read / Write If an arrow should be displayed at the start of the polyline.Default value: FALSE <anchor id="GooCanvasPolyline--width"/>The <literal>"width"</literal> property GooCanvasPolyline:width "width" gdouble : Read / Write The width of the polyline.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasPolyline--x"/>The <literal>"x"</literal> property GooCanvasPolyline:x "x" gdouble : Read / Write The x coordinate of the left-most point of the polyline.Default value: 0 <anchor id="GooCanvasPolyline--y"/>The <literal>"y"</literal> property GooCanvasPolyline:y "y" gdouble : Read / Write The y coordinate of the top-most point of the polyline.Default value: 0 goocanvas-0.15/docs/xml/goocanvaswidget.xml0000644000076400007640000002506011222215703016004 00000000000000 GooCanvasWidget 3 GOOCANVAS Library GooCanvasWidget an embedded widget item. Synopsis GooCanvasWidget; GooCanvasItem* goo_canvas_widget_new (GooCanvasItem *parent, GtkWidget *widget, gdouble x, gdouble y, gdouble width, gdouble height, ...); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasWidget Implemented Interfaces GooCanvasWidget implements GooCanvasItem. Properties "anchor" GtkAnchorType : Read / Write "height" gdouble : Read / Write "widget" GtkWidget : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasWidget provides support for placing any GtkWidget in the canvas. The "width" and "height" properties specify the widget's size. If either of them is -1, then the requested size of the widget is used instead, which is the default for both width and height. Note that there are a number of limitations in the use of "" It doesn't support any transformation besides simple translation. This means you can't scale a canvas with a GooCanvasWidget in it. It doesn't support layering, so you can't place other items beneath or above the GooCanvasWidget. It doesn't support rendering of widgets to a given cairo_t, which means you can't output the widget to a pdf or postscript file. It doesn't have a model/view variant like the other standard items, so it can only be used in a simple canvas without a model. It can't be made a static item. Details <anchor id="GooCanvasWidget-struct" role="struct"/>GooCanvasWidget GooCanvasWidgettypedef struct _GooCanvasWidget GooCanvasWidget; The GooCanvasWidget struct contains private data only. <anchor id="goo-canvas-widget-new" role="function"/>goo_canvas_widget_new () goo_canvas_widget_newGooCanvasItem* goo_canvas_widget_new (GooCanvasItem *parent, GtkWidget *widget, gdouble x, gdouble y, gdouble width, gdouble height, ...); Creates a new widget item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. widget : the widget. x : the x coordinate of the item. y : the y coordinate of the item. width : the width of the item, or -1 to use the widget's requested width. height : the height of the item, or -1 to use the widget's requested height. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new widget item. Here's an example showing how to create an entry widget centered at (100.0, 100.0): GtkWidget *entry = gtk_entry_new (); GooCanvasItem *witem = goo_canvas_widget_new (mygroup, entry, 100, 100, -1, -1, "anchor", GTK_ANCHOR_CENTER, NULL); Property Details <anchor id="GooCanvasWidget--anchor"/>The <literal>"anchor"</literal> property GooCanvasWidget:anchor "anchor" GtkAnchorType : Read / Write How to position the widget relative to the item's x and y coordinate settings.Default value: GTK_ANCHOR_NORTH_WEST <anchor id="GooCanvasWidget--height"/>The <literal>"height"</literal> property GooCanvasWidget:height "height" gdouble : Read / Write The height of the widget, or -1 to use its requested height.Default value: -1 <anchor id="GooCanvasWidget--widget"/>The <literal>"widget"</literal> property GooCanvasWidget:widget "widget" GtkWidget : Read / Write The widget to place in the canvas. <anchor id="GooCanvasWidget--width"/>The <literal>"width"</literal> property GooCanvasWidget:width "width" gdouble : Read / Write The width of the widget, or -1 to use its requested width.Default value: -1 <anchor id="GooCanvasWidget--x"/>The <literal>"x"</literal> property GooCanvasWidget:x "x" gdouble : Read / Write The x coordinate of the widget.Default value: 0 <anchor id="GooCanvasWidget--y"/>The <literal>"y"</literal> property GooCanvasWidget:y "y" gdouble : Read / Write The y coordinate of the widget.Default value: 0 goocanvas-0.15/docs/xml/goocanvasimagemodel.xml0000644000076400007640000002532511222215703016630 00000000000000 GooCanvasImageModel 3 GOOCANVAS Library GooCanvasImageModel a model for image items. Synopsis GooCanvasImageModel; GooCanvasItemModel* goo_canvas_image_model_new (GooCanvasItemModel *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...); Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasImageModel Implemented Interfaces GooCanvasImageModel implements GooCanvasItemModel. Properties "height" gdouble : Read / Write "pattern" GooCairoPattern : Read / Write "pixbuf" GdkPixbuf : Write "scale-to-fit" gboolean : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasImageModel represent a model for image items. It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "operator" and "pointer-events". It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(). To create a GooCanvasImageModel use goo_canvas_image_model_new(). To get or set the properties of an existing GooCanvasImageModel, use g_object_get() and g_object_set(). To respond to events such as mouse clicks on the image you must connect to the signal handlers of the corresponding GooCanvasImage objects. (See goo_canvas_get_item() and "item-created".) Details <anchor id="GooCanvasImageModel-struct" role="struct"/>GooCanvasImageModel GooCanvasImageModeltypedef struct _GooCanvasImageModel GooCanvasImageModel; The GooCanvasImageModel struct contains private data only. <anchor id="goo-canvas-image-model-new" role="function"/>goo_canvas_image_model_new () goo_canvas_image_model_newGooCanvasItemModel* goo_canvas_image_model_new (GooCanvasItemModel *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...); Creates a new image model. parent : the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. pixbuf : the GdkPixbuf containing the image data, or NULL. x : the x coordinate of the image. y : the y coordinate of the image. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new image model. Here's an example showing how to create an image at (100.0, 100.0), using the given pixbuf at its natural width and height: GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0, NULL); Property Details <anchor id="GooCanvasImageModel--height"/>The <literal>"height"</literal> property GooCanvasImageModel:height "height" gdouble : Read / Write The height of the image.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasImageModel--pattern"/>The <literal>"pattern"</literal> property GooCanvasImageModel:pattern "pattern" GooCairoPattern : Read / Write The cairo pattern to paint. <anchor id="GooCanvasImageModel--pixbuf"/>The <literal>"pixbuf"</literal> property GooCanvasImageModel:pixbuf "pixbuf" GdkPixbuf : Write The GdkPixbuf to display. <anchor id="GooCanvasImageModel--scale-to-fit"/>The <literal>"scale-to-fit"</literal> property GooCanvasImageModel:scale-to-fit "scale-to-fit" gboolean : Read / Write If the image is scaled to fit the width and height settings.Default value: FALSE <anchor id="GooCanvasImageModel--width"/>The <literal>"width"</literal> property GooCanvasImageModel:width "width" gdouble : Read / Write The width of the image.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasImageModel--x"/>The <literal>"x"</literal> property GooCanvasImageModel:x "x" gdouble : Read / Write The x coordinate of the image.Default value: 0 <anchor id="GooCanvasImageModel--y"/>The <literal>"y"</literal> property GooCanvasImageModel:y "y" gdouble : Read / Write The y coordinate of the image.Default value: 0 goocanvas-0.15/docs/xml/wysiwyg.xml0000644000076400007640000000557311222215703014351 00000000000000 WYSIWYG Printing 3 GOOCANVAS Library WYSIWYG Printing how to use the canvas to create accurate printed output. WYSIWYG Printing Screen Resolution The GooCanvas "resolution-x" and "resolution-y" properties must be set correctly. They both default to 96dpi, which corresponds to a typical monitor. To get a more accurate figure you might be able to use gdk_screen_get_resolution(), but this isn't always guaranteed to be correct. If accuracy is very important a method should be provided for the user to calibrate the screen. Units The GooCanvas "units" property must be set to one of GTK_UNIT_MM, GTK_UNIT_POINTS or GTK_UNIT_INCH (it defaults to GTK_UNIT_PIXEL). All values used within the canvas are assumed to be in the specified units, including font sizes. Font Sizes Absolute font sizes must be used (to prevent the fonts being mistakenly scaled by Pango as well as by GooCanvas). To specify absolute font sizes add "px" after the font size, e.g. instead of "Sans 9" use "Sans 9px". Font sizes must be converted to the units used by the canvas. For example, if a 9 point "Sans" font is desired but "units" is set to GTK_UNIT_MM, then the size must first be converted into millimeters: (9 / 72) * 25.4 = 3.175mm. So the font used would be "Sans 3.175px". Example Code The units-demo application that comes with the GooCanvas source code demonstrates the use of different units and absolute font sizes. goocanvas-0.15/docs/xml/goocanvasgroup.xml0000644000076400007640000001745011222215703015661 00000000000000 GooCanvasGroup 3 GOOCANVAS Library GooCanvasGroup a group of items. Synopsis GooCanvasGroup; GooCanvasItem* goo_canvas_group_new (GooCanvasItem *parent, ...); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasGroup +----GooCanvasTable Implemented Interfaces GooCanvasGroup implements GooCanvasItem. Properties "height" gdouble : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasGroup represents a group of items. Groups can be nested to any depth, to create a hierarchy of items. Items are ordered within each group, with later items being displayed above earlier items. GooCanvasGroup is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasGroup will affect all children of the GooCanvasGroup (unless the children override the property setting). GooCanvasGroup implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(), and the properties such as "visibility" and "pointer-events". If the "width" and "height" properties are set to positive values then the group is clipped to the given size. To create a GooCanvasGroup use goo_canvas_group_new(). To get or set the properties of an existing GooCanvasGroup, use g_object_get() and g_object_set(). Details <anchor id="GooCanvasGroup-struct" role="struct"/>GooCanvasGroup GooCanvasGrouptypedef struct _GooCanvasGroup GooCanvasGroup; The GooCanvasGroup struct contains private data only. <anchor id="goo-canvas-group-new" role="function"/>goo_canvas_group_new () goo_canvas_group_newGooCanvasItem* goo_canvas_group_new (GooCanvasItem *parent, ...); Creates a new group item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new group item. Property Details <anchor id="GooCanvasGroup--height"/>The <literal>"height"</literal> property GooCanvasGroup:height "height" gdouble : Read / Write The height of the group, or -1 to use the default height.Default value: -1 <anchor id="GooCanvasGroup--width"/>The <literal>"width"</literal> property GooCanvasGroup:width "width" gdouble : Read / Write The width of the group, or -1 to use the default width.Default value: -1 <anchor id="GooCanvasGroup--x"/>The <literal>"x"</literal> property GooCanvasGroup:x "x" gdouble : Read / Write The x coordinate of the group.Default value: 0 <anchor id="GooCanvasGroup--y"/>The <literal>"y"</literal> property GooCanvasGroup:y "y" gdouble : Read / Write The y coordinate of the group.Default value: 0 goocanvas-0.15/docs/xml/overview.xml0000644000076400007640000000514611222215703014471 00000000000000 Overview 3 GOOCANVAS Library Overview a quick tour of GooCanvas. Features Optional model/view split. Uses interfaces for items and views. Basic items - rect/ellipse/polyline/text/image/grid/group. Path item, using SVG path specification strings. Table item for layout of other items (similar to the GtkTable widget). (This also supports items whose requested height changes according to their allocated width, such as text items.) Embedded GTK+ widgets. Layers/stacking order with raise/lower functions. Cascading styles - line width/style/dashes, colors, fill patterns. Affine transformations for all items - rotations/scales/skews. Event handling - button/motion events, "pointer-events" property like SVG. Grabs - support for pointer and keyboard grabs. Keyboard focus traversal. Accessibility (item title and description properties and hierarchy stuff). Printing (output to a given cairo_t). Scrolling. Zooming. Static items that don't move as the canvas is scrolled or zoomed. Item visibility setting - on/off/above zoom threshold. Simple animation. Scalable - support for thousands of items over a large canvas area. Support for different units - pixels/points/inches/millimeters. goocanvas-0.15/docs/xml/goocanvasutils.xml0000644000076400007640000010373611222215703015670 00000000000000 GooCanvas Types 3 GOOCANVAS Library GooCanvas Types types used in GooCanvas. Synopsis GooCanvasBounds; enum GooCanvasItemVisibility; enum GooCanvasPointerEvents; enum GooCanvasAnimateType; GooCanvasPoints; GooCanvasPoints* goo_canvas_points_new (int num_points); GooCanvasPoints* goo_canvas_points_ref (GooCanvasPoints *points); void goo_canvas_points_unref (GooCanvasPoints *points); GooCanvasLineDash; GooCanvasLineDash* goo_canvas_line_dash_new (gint num_dashes, ...); GooCanvasLineDash* goo_canvas_line_dash_newv (gint num_dashes, double *dashes); GooCanvasLineDash* goo_canvas_line_dash_ref (GooCanvasLineDash *dash); void goo_canvas_line_dash_unref (GooCanvasLineDash *dash); enum GooCanvasPathCommandType; union GooCanvasPathCommand; GArray* goo_canvas_parse_path_data (const gchar *path_data); void goo_canvas_create_path (GArray *commands, cairo_t *cr); typedef GooCairoAntialias; typedef GooCairoFillRule; typedef GooCairoHintMetrics; typedef GooCairoLineCap; typedef GooCairoLineJoin; typedef GooCairoOperator; typedef GooCairoMatrix; typedef GooCairoPattern; Description This section describes the types used throughout GooCanvas. Details <anchor id="GooCanvasBounds" role="struct"/>GooCanvasBounds GooCanvasBoundstypedef struct { gdouble x1, y1, x2, y2; } GooCanvasBounds; GooCanvasBounds represents the bounding box of an item in the canvas. gdouble x1; the left edge. gdouble y1; the top edge. gdouble x2; the right edge. gdouble y2; the bottom edge. <anchor id="GooCanvasItemVisibility" role="enum"/>enum GooCanvasItemVisibility GooCanvasItemVisibilitytypedef enum { GOO_CANVAS_ITEM_HIDDEN = 0, GOO_CANVAS_ITEM_INVISIBLE = 1, GOO_CANVAS_ITEM_VISIBLE = 2, GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD = 3 } GooCanvasItemVisibility; The GooCanvasItemVisibility enumeration is used to specify when a canvas item is visible. GOO_CANVAS_ITEM_HIDDEN the item is invisible, and is not allocated any space in layout container items such as GooCanvasTable. GOO_CANVAS_ITEM_INVISIBLE the item is invisible, but it is still allocated space in layout container items. GOO_CANVAS_ITEM_VISIBLE the item is visible. GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD the item is visible when the canvas scale setting is greater than or equal to the item's visibility threshold setting. <anchor id="GooCanvasPointerEvents" role="enum"/>enum GooCanvasPointerEvents GooCanvasPointerEventstypedef enum { GOO_CANVAS_EVENTS_VISIBLE_MASK = 1 << 0, GOO_CANVAS_EVENTS_PAINTED_MASK = 1 << 1, GOO_CANVAS_EVENTS_FILL_MASK = 1 << 2, GOO_CANVAS_EVENTS_STROKE_MASK = 1 << 3, GOO_CANVAS_EVENTS_NONE = 0, GOO_CANVAS_EVENTS_VISIBLE_PAINTED = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_VISIBLE_FILL = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK, GOO_CANVAS_EVENTS_VISIBLE_STROKE = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_VISIBLE = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_PAINTED = GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_FILL = GOO_CANVAS_EVENTS_FILL_MASK, GOO_CANVAS_EVENTS_STROKE = GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_ALL = GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK } GooCanvasPointerEvents; Specifies when an item receives pointer events such as mouse clicks. GOO_CANVAS_EVENTS_VISIBLE_MASK a mask indicating that the item only receives events when it is visible. GOO_CANVAS_EVENTS_PAINTED_MASK a mask indicating that the item only receives events when the specified parts of it are painted. GOO_CANVAS_EVENTS_FILL_MASK a mask indicating that the filled part of the item receives events. GOO_CANVAS_EVENTS_STROKE_MASK a mask indicating that the stroked part of the item receives events. GOO_CANVAS_EVENTS_NONE the item doesn't receive events at all. GOO_CANVAS_EVENTS_VISIBLE_PAINTED the item receives events in its painted areas when it is visible (the default). GOO_CANVAS_EVENTS_VISIBLE_FILL the item's interior receives events when it is visible. GOO_CANVAS_EVENTS_VISIBLE_STROKE the item's perimeter receives events when it is visible. GOO_CANVAS_EVENTS_VISIBLE the item receives events when it is visible, whether it is painted or not. GOO_CANVAS_EVENTS_PAINTED the item receives events in its painted areas, whether it is visible or not. GOO_CANVAS_EVENTS_FILL the item's interior receives events, whether it is visible or painted or not. GOO_CANVAS_EVENTS_STROKE the item's perimeter receives events, whether it is visible or painted or not. GOO_CANVAS_EVENTS_ALL the item's perimeter and interior receive events, whether it is visible or painted or not. <anchor id="GooCanvasAnimateType" role="enum"/>enum GooCanvasAnimateType GooCanvasAnimateTypetypedef enum { GOO_CANVAS_ANIMATE_FREEZE, GOO_CANVAS_ANIMATE_RESET, GOO_CANVAS_ANIMATE_RESTART, GOO_CANVAS_ANIMATE_BOUNCE } GooCanvasAnimateType; GooCanvasAnimateType is used to specify what happens when the end of an animation is reached. GOO_CANVAS_ANIMATE_FREEZE the item remains in the final position. GOO_CANVAS_ANIMATE_RESET the item is moved back to the initial position. GOO_CANVAS_ANIMATE_RESTART the animation is restarted from the initial position. GOO_CANVAS_ANIMATE_BOUNCE the animation bounces back and forth between the start and end positions. <anchor id="GooCanvasPoints" role="struct"/>GooCanvasPoints GooCanvasPointstypedef struct { double *coords; int num_points; int ref_count; } GooCanvasPoints; GooCairoPoints represents an array of points. double *coords; the coordinates of the points, in pairs. int num_points; the number of points. int ref_count; the reference count of the struct. <anchor id="goo-canvas-points-new" role="function"/>goo_canvas_points_new () goo_canvas_points_newGooCanvasPoints* goo_canvas_points_new (int num_points); Creates a new GooCanvasPoints struct with space for the given number of points. It should be freed with goo_canvas_points_unref(). num_points : the number of points to create space for. Returns : a new GooCanvasPoints struct. <anchor id="goo-canvas-points-ref" role="function"/>goo_canvas_points_ref () goo_canvas_points_refGooCanvasPoints* goo_canvas_points_ref (GooCanvasPoints *points); Increments the reference count of the given GooCanvasPoints struct. points : a GooCanvasPoints struct. Returns : the GooCanvasPoints struct. <anchor id="goo-canvas-points-unref" role="function"/>goo_canvas_points_unref () goo_canvas_points_unrefvoid goo_canvas_points_unref (GooCanvasPoints *points); Decrements the reference count of the given GooCanvasPoints struct, freeing it if the reference count falls to zero. points : a GooCanvasPoints struct. <anchor id="GooCanvasLineDash" role="struct"/>GooCanvasLineDash GooCanvasLineDashtypedef struct { int ref_count; int num_dashes; double *dashes; double dash_offset; } GooCanvasLineDash; GooCanvasLineDash specifies a dash pattern to be used when drawing items. int ref_count; the reference count of the struct. int num_dashes; the number of dashes and gaps between them. double *dashes; the sizes of each dash and gap. double dash_offset; the start offset into the dash pattern. <anchor id="goo-canvas-line-dash-new" role="function"/>goo_canvas_line_dash_new () goo_canvas_line_dash_newGooCanvasLineDash* goo_canvas_line_dash_new (gint num_dashes, ...); Creates a new dash pattern. num_dashes : the number of dashes and gaps in the pattern. ... : the length of each dash and gap. Returns : a new dash pattern. <anchor id="goo-canvas-line-dash-newv" role="function"/>goo_canvas_line_dash_newv () goo_canvas_line_dash_newvGooCanvasLineDash* goo_canvas_line_dash_newv (gint num_dashes, double *dashes); Creates a new dash pattern. Takes ownership of the dashes vector. num_dashes : the number of dashes and gaps in the pattern. dashes : a g_new-allocated vector of doubles, the length of each dash and gap. Returns : a new dash pattern. <anchor id="goo-canvas-line-dash-ref" role="function"/>goo_canvas_line_dash_ref () goo_canvas_line_dash_refGooCanvasLineDash* goo_canvas_line_dash_ref (GooCanvasLineDash *dash); Increments the reference count of the dash pattern. dash : a GooCanvasLineDash. Returns : the dash pattern. <anchor id="goo-canvas-line-dash-unref" role="function"/>goo_canvas_line_dash_unref () goo_canvas_line_dash_unrefvoid goo_canvas_line_dash_unref (GooCanvasLineDash *dash); Decrements the reference count of the dash pattern. If it falls to 0 it is freed. dash : a GooCanvasLineDash. <anchor id="GooCanvasPathCommandType" role="enum"/>enum GooCanvasPathCommandType GooCanvasPathCommandTypetypedef enum { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ GOO_CANVAS_PATH_MOVE_TO, GOO_CANVAS_PATH_CLOSE_PATH, GOO_CANVAS_PATH_LINE_TO, GOO_CANVAS_PATH_HORIZONTAL_LINE_TO, GOO_CANVAS_PATH_VERTICAL_LINE_TO, /* Bezier curve commands: CcSsQqTt. */ GOO_CANVAS_PATH_CURVE_TO, GOO_CANVAS_PATH_SMOOTH_CURVE_TO, GOO_CANVAS_PATH_QUADRATIC_CURVE_TO, GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO, /* The elliptical arc commands: Aa. */ GOO_CANVAS_PATH_ELLIPTICAL_ARC } GooCanvasPathCommandType; GooCanvasPathCommandType specifies the type of each command in the path. See the path element in the Scalable Vector Graphics (SVG) specification for more details. GOO_CANVAS_PATH_MOVE_TO move to the given point. GOO_CANVAS_PATH_CLOSE_PATH close the current path, drawing a line from the current position to the start of the path. GOO_CANVAS_PATH_LINE_TO draw a line to the given point. GOO_CANVAS_PATH_HORIZONTAL_LINE_TO draw a horizontal line to the given x coordinate. GOO_CANVAS_PATH_VERTICAL_LINE_TO draw a vertical line to the given y coordinate. GOO_CANVAS_PATH_CURVE_TO draw a bezier curve using two control points to the given point. GOO_CANVAS_PATH_SMOOTH_CURVE_TO draw a bezier curve using a reflection of the last control point of the last curve as the first control point, and one new control point, to the given point. GOO_CANVAS_PATH_QUADRATIC_CURVE_TO draw a quadratic bezier curve using a single control point to the given point. GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO draw a quadratic bezier curve using a reflection of the control point from the previous curve as the control point, to the given point. GOO_CANVAS_PATH_ELLIPTICAL_ARC draw an elliptical arc, using the given 2 radii, the x axis rotation, and the 2 flags to disambiguate the arc, to the given point. <anchor id="GooCanvasPathCommand" role="union"/>union GooCanvasPathCommand GooCanvasPathCommandunion GooCanvasPathCommand { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ struct { guint type : 5; /* GooCanvasPathCommandType */ guint relative : 1; gdouble x, y; } simple; /* Bezier curve commands: CcSsQqTt. */ struct { guint type : 5; /* GooCanvasPathCommandType */ guint relative : 1; gdouble x, y, x1, y1, x2, y2; } curve; /* The elliptical arc commands: Aa. */ struct { guint type : 5; /* GooCanvasPathCommandType */ guint relative : 1; guint large_arc_flag : 1; guint sweep_flag : 1; gdouble rx, ry, x_axis_rotation, x, y; } arc; }; GooCanvasPathCommand holds the data for each command in the path. The relative flag specifies that the coordinates for the command are relative to the current point. Otherwise they are assumed to be absolute coordinates. <anchor id="goo-canvas-parse-path-data" role="function"/>goo_canvas_parse_path_data () goo_canvas_parse_path_dataGArray* goo_canvas_parse_path_data (const gchar *path_data); Parses the given SVG path specification string. path_data : the sequence of path commands, specified as a string using the same syntax as in the Scalable Vector Graphics (SVG) path element. Returns : a GArray of GooCanvasPathCommand elements. <anchor id="goo-canvas-create-path" role="function"/>goo_canvas_create_path () goo_canvas_create_pathvoid goo_canvas_create_path (GArray *commands, cairo_t *cr); Creates the path specified by the given GooCanvasPathCommand array. commands : an array of GooCanvasPathCommand. cr : a cairo context. <anchor id="GooCairoAntialias" role="typedef"/>GooCairoAntialias GooCairoAntialiastypedef cairo_antialias_t GooCairoAntialias; GooCairoAntialias is simply a wrapper for the cairo_antialias_t type, allowing it to be used for GObject properties. See the cairo_antialias_t documentation. <anchor id="GooCairoFillRule" role="typedef"/>GooCairoFillRule GooCairoFillRuletypedef cairo_fill_rule_t GooCairoFillRule; GooCairoFillRule is simply a wrapper for the cairo_fill_rule_t type, allowing it to be used for GObject properties. See the cairo_fill_rule_t documentation. <anchor id="GooCairoHintMetrics" role="typedef"/>GooCairoHintMetrics GooCairoHintMetricstypedef cairo_hint_metrics_t GooCairoHintMetrics; GooCairoHintMetrics is simply a wrapper for the cairo_hint_metrics_t type, allowing it to be used for GObject properties. See the cairo_hint_metrics_t documentation. <anchor id="GooCairoLineCap" role="typedef"/>GooCairoLineCap GooCairoLineCaptypedef cairo_line_cap_t GooCairoLineCap; GooCairoLineCap is simply a wrapper for the cairo_line_cap_t type, allowing it to be used for GObject properties. See the cairo_line_cap_t documentation. <anchor id="GooCairoLineJoin" role="typedef"/>GooCairoLineJoin GooCairoLineJointypedef cairo_line_join_t GooCairoLineJoin; GooCairoLineJoin is simply a wrapper for the cairo_line_join_t type, allowing it to be used for GObject properties. See the cairo_line_join_t documentation. <anchor id="GooCairoOperator" role="typedef"/>GooCairoOperator GooCairoOperatortypedef cairo_operator_t GooCairoOperator; GooCairoOperator is simply a wrapper for the cairo_operator_t type, allowing it to be used for GObject properties. See the cairo_operator_t documentation. <anchor id="GooCairoMatrix" role="typedef"/>GooCairoMatrix GooCairoMatrixtypedef cairo_matrix_t GooCairoMatrix; GooCairoMatrix is simply a wrapper for the cairo_matrix_t type, allowing it to be used for GObject properties. See the cairo_matrix_t documentation. <anchor id="GooCairoPattern" role="typedef"/>GooCairoPattern GooCairoPatterntypedef cairo_pattern_t GooCairoPattern; GooCairoPattern is simply a wrapper for the cairo_pattern_t type, allowing it to be used for GObject properties. See the cairo_pattern_t documentation. goocanvas-0.15/docs/xml/goocanvasimage.xml0000644000076400007640000002373411222215703015611 00000000000000 GooCanvasImage 3 GOOCANVAS Library GooCanvasImage an image item. Synopsis GooCanvasImage; GooCanvasItem* goo_canvas_image_new (GooCanvasItem *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasImage Implemented Interfaces GooCanvasImage implements GooCanvasItem. Properties "height" gdouble : Read / Write "pattern" GooCairoPattern : Read / Write "pixbuf" GdkPixbuf : Write "scale-to-fit" gboolean : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasImage represents an image item. It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "operator" and "pointer-events". It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(). To create a GooCanvasImage use goo_canvas_image_new(). To get or set the properties of an existing GooCanvasImage, use g_object_get() and g_object_set(). Details <anchor id="GooCanvasImage-struct" role="struct"/>GooCanvasImage GooCanvasImagetypedef struct _GooCanvasImage GooCanvasImage; The GooCanvasImage struct contains private data only. <anchor id="goo-canvas-image-new" role="function"/>goo_canvas_image_new () goo_canvas_image_newGooCanvasItem* goo_canvas_image_new (GooCanvasItem *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...); Creates a new image item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. pixbuf : the GdkPixbuf containing the image data, or NULL. x : the x coordinate of the image. y : the y coordinate of the image. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new image item. Here's an example showing how to create an image at (100.0, 100.0), using the given pixbuf at its natural width and height: GooCanvasItem *image = goo_canvas_image_new (mygroup, pixbuf, 100.0, 100.0, NULL); Property Details <anchor id="GooCanvasImage--height"/>The <literal>"height"</literal> property GooCanvasImage:height "height" gdouble : Read / Write The height of the image.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasImage--pattern"/>The <literal>"pattern"</literal> property GooCanvasImage:pattern "pattern" GooCairoPattern : Read / Write The cairo pattern to paint. <anchor id="GooCanvasImage--pixbuf"/>The <literal>"pixbuf"</literal> property GooCanvasImage:pixbuf "pixbuf" GdkPixbuf : Write The GdkPixbuf to display. <anchor id="GooCanvasImage--scale-to-fit"/>The <literal>"scale-to-fit"</literal> property GooCanvasImage:scale-to-fit "scale-to-fit" gboolean : Read / Write If the image is scaled to fit the width and height settings.Default value: FALSE <anchor id="GooCanvasImage--width"/>The <literal>"width"</literal> property GooCanvasImage:width "width" gdouble : Read / Write The width of the image.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasImage--x"/>The <literal>"x"</literal> property GooCanvasImage:x "x" gdouble : Read / Write The x coordinate of the image.Default value: 0 <anchor id="GooCanvasImage--y"/>The <literal>"y"</literal> property GooCanvasImage:y "y" gdouble : Read / Write The y coordinate of the image.Default value: 0 goocanvas-0.15/docs/xml/coordinates.xml0000644000076400007640000001050211222215703015125 00000000000000 Coordinate Spaces and Limits 3 GOOCANVAS Library Coordinate Spaces and Limits how coordinates are used. Coordinate Spaces Items in the canvas typically have a number of properties specifying their location and size. For example the GooCanvasRect item has "x", "y", "width" and "height" properties. However, items can also have a transformation matrix (e.g. the "transform" property). Transformation matrices modify the item's coordinate space in some way. Modifications include translation (moving the origin), rotation, scaling, and skewing, or combinations of these. Thus the final position of the item on the canvas can be altered dramatically. The simple animation features in GooCanvas are accomplished by modifying the item's transformation matrix over time. (See goo_canvas_item_animate().) Since items are in a hierarchy it is possible to move or rotate an entire group of items by simply changing the transformation matrix of the group containing them. The coordinate space used within the item itself (e.g. where the "x" and "y" properties of a GooCanvasRect are specified) is referred to as "Item Space". The coordinate space used by the entire canvas is referred to as "Canvas Space" (or "Device Space"). "Item Space" and "Canvas Space" may or may not be the same, depending on whether the item or any of its ancestors have a transformation matrix set. (Note that the entire canvas may also be scrolled and/or zoomed, which means that there may be additional transformations above "Canvas Space".) Functions are provided to convert between coordinate spaces, e.g. goo_canvas_convert_to_item_space() and goo_canvas_convert_from_item_space() convert canvas space coordinates to item space and vice versa. Coordinate Limits GooCanvas uses the Cairo graphics library to render canvas items. For performance reasons Cairo uses 32-bit fixed point integers internally when rendering graphics, with 24 bits used for the integer part of values and 8 bits used for the fractional part. This means that values are limited to roughly +/- 8,388,608. (Prior to Cairo 1.6 16 bits were used for the integer part and 16 bits for the fractional part, meaning values were limited to +/- 32,768.) GooCanvas includes code to work around the Cairo limits to some extent. Subclasses of GooCanvasItemSimple (including all builtin items) can use any desired translation using a transformation matrix. But item space coordinates (modified by any scale, rotation or skew) must be within the Cairo limits. It is possible to create new canvas items that avoid the Cairo limits completely. For an example of this see the "Large Items" page in the GooCanvas demo application, and the corresponding code. goocanvas-0.15/docs/xml/simple-canvas.xml0000644000076400007640000001030411222215703015355 00000000000000 Simple Canvas Example 3 GOOCANVAS Library Simple Canvas Example how to create a simple canvas. Simple Canvas Example Here's a complete example application that creates a GooCanvas with a rectangle and a text item in it: #include <stdlib.h> #include <goocanvas.h> static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItem *root, *rect_item, *text_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event, NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Add a few simple items. */ rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_rotate (text_item, 45, 300, 300); /* Connect a signal handler for the rectangle item. */ g_signal_connect (rect_item, "button_press_event", (GtkSignalFunc) on_rect_button_press, NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-0.15/docs/xml/goocanvasgridmodel.xml0000644000076400007640000006557111222215703016502 00000000000000 GooCanvasGridModel 3 GOOCANVAS Library GooCanvasGridModel a model for grid items. Synopsis GooCanvasGridModel; GooCanvasItemModel* goo_canvas_grid_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...); Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasGridModel Implemented Interfaces GooCanvasGridModel implements GooCanvasItemModel. Properties "border-color" gchararray : Write "border-color-rgba" guint : Read / Write "border-pattern" GooCairoPattern : Read / Write "border-pixbuf" GdkPixbuf : Write "border-width" gdouble : Read / Write "height" gdouble : Read / Write "horz-grid-line-color" gchararray : Write "horz-grid-line-color-rgba" guint : Read / Write "horz-grid-line-pattern" GooCairoPattern : Read / Write "horz-grid-line-pixbuf" GdkPixbuf : Write "horz-grid-line-width" gdouble : Read / Write "show-horz-grid-lines" gboolean : Read / Write "show-vert-grid-lines" gboolean : Read / Write "vert-grid-line-color" gchararray : Write "vert-grid-line-color-rgba" guint : Read / Write "vert-grid-line-pattern" GooCairoPattern : Read / Write "vert-grid-line-pixbuf" GdkPixbuf : Write "vert-grid-line-width" gdouble : Read / Write "vert-grid-lines-on-top" gboolean : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "x-offset" gdouble : Read / Write "x-step" gdouble : Read / Write "y" gdouble : Read / Write "y-offset" gdouble : Read / Write "y-step" gdouble : Read / Write Description GooCanvasGridModel represents a model for grid items. A grid consists of a number of equally-spaced horizontal and vertical grid lines, plus an optional border. It is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(). To create a GooCanvasGridModel use goo_canvas_grid_model_new(). To get or set the properties of an existing GooCanvasGridModel, use g_object_get() and g_object_set(). To respond to events such as mouse clicks on the grid you must connect to the signal handlers of the corresponding GooCanvasGrid objects. (See goo_canvas_get_item() and "item-created".) The grid's position and size is specified with the "x", "y", "width" and "height" properties. The "x-step" and "y-step" properties specify the distance between grid lines. The "x-offset" and "y-offset" properties specify the distance before the first grid lines. The horizontal or vertical grid lines can be hidden using the "show-horz-grid-lines" and "show-vert-grid-lines" properties. The width of the border can be set using the "border-width" property. The border is drawn outside the area specified with the "x", "y", "width" and "height" properties. Other properties allow the colors and widths of the grid lines to be set. The grid line color and width properties override the standard "stroke-color" and "line-width" properties, enabling different styles for horizontal and vertical grid lines. Details <anchor id="GooCanvasGridModel-struct" role="struct"/>GooCanvasGridModel GooCanvasGridModeltypedef struct _GooCanvasGridModel GooCanvasGridModel; The GooCanvasGridModel struct contains private data only. <anchor id="goo-canvas-grid-model-new" role="function"/>goo_canvas_grid_model_new () goo_canvas_grid_model_newGooCanvasItemModel* goo_canvas_grid_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...); Creates a new grid model. parent : the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. x : the x coordinate of the left of the grid. y : the y coordinate of the top of the grid. width : the width of the grid. height : the height of the grid. x_step : the distance between the vertical grid lines. y_step : the distance between the horizontal grid lines. x_offset : the distance before the first vertical grid line. y_offset : the distance before the first horizontal grid line. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new grid model. Here's an example showing how to create a grid: GooCanvasItemModel *grid = goo_canvas_grid_model_new (mygroup, 100.0, 100.0, 400.0, 200.0, 20.0, 20.0, 10.0, 10.0, "horz-grid-line-width", 4.0, "horz-grid-line-color", "yellow", "vert-grid-line-width", 2.0, "vert-grid-line-color", "red", "border-width", 3.0, "border-color", "white", "fill-color", "blue", NULL); Property Details <anchor id="GooCanvasGridModel--border-color"/>The <literal>"border-color"</literal> property GooCanvasGridModel:border-color "border-color" gchararray : Write The color to use for the border.Default value: NULL <anchor id="GooCanvasGridModel--border-color-rgba"/>The <literal>"border-color-rgba"</literal> property GooCanvasGridModel:border-color-rgba "border-color-rgba" guint : Read / Write The color to use for the border, specified as a 32-bit integer value.Default value: 0 <anchor id="GooCanvasGridModel--border-pattern"/>The <literal>"border-pattern"</literal> property GooCanvasGridModel:border-pattern "border-pattern" GooCairoPattern : Read / Write The cairo pattern to paint the border with. <anchor id="GooCanvasGridModel--border-pixbuf"/>The <literal>"border-pixbuf"</literal> property GooCanvasGridModel:border-pixbuf "border-pixbuf" GdkPixbuf : Write The pixbuf to use to draw the border. <anchor id="GooCanvasGridModel--border-width"/>The <literal>"border-width"</literal> property GooCanvasGridModel:border-width "border-width" gdouble : Read / Write The width of the border around the grid.Default value: -1 <anchor id="GooCanvasGridModel--height"/>The <literal>"height"</literal> property GooCanvasGridModel:height "height" gdouble : Read / Write The height of the grid.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasGridModel--horz-grid-line-color"/>The <literal>"horz-grid-line-color"</literal> property GooCanvasGridModel:horz-grid-line-color "horz-grid-line-color" gchararray : Write The color to use for the horizontal grid lines.Default value: NULL <anchor id="GooCanvasGridModel--horz-grid-line-color-rgba"/>The <literal>"horz-grid-line-color-rgba"</literal> property GooCanvasGridModel:horz-grid-line-color-rgba "horz-grid-line-color-rgba" guint : Read / Write The color to use for the horizontal grid lines, specified as a 32-bit integer value.Default value: 0 <anchor id="GooCanvasGridModel--horz-grid-line-pattern"/>The <literal>"horz-grid-line-pattern"</literal> property GooCanvasGridModel:horz-grid-line-pattern "horz-grid-line-pattern" GooCairoPattern : Read / Write The cairo pattern to paint the horizontal grid lines with. <anchor id="GooCanvasGridModel--horz-grid-line-pixbuf"/>The <literal>"horz-grid-line-pixbuf"</literal> property GooCanvasGridModel:horz-grid-line-pixbuf "horz-grid-line-pixbuf" GdkPixbuf : Write The pixbuf to use to draw the horizontal grid lines. <anchor id="GooCanvasGridModel--horz-grid-line-width"/>The <literal>"horz-grid-line-width"</literal> property GooCanvasGridModel:horz-grid-line-width "horz-grid-line-width" gdouble : Read / Write The width of the horizontal grid lines.Default value: -1 <anchor id="GooCanvasGridModel--show-horz-grid-lines"/>The <literal>"show-horz-grid-lines"</literal> property GooCanvasGridModel:show-horz-grid-lines "show-horz-grid-lines" gboolean : Read / Write If the horizontal grid lines are shown.Default value: TRUE <anchor id="GooCanvasGridModel--show-vert-grid-lines"/>The <literal>"show-vert-grid-lines"</literal> property GooCanvasGridModel:show-vert-grid-lines "show-vert-grid-lines" gboolean : Read / Write If the vertical grid lines are shown.Default value: TRUE <anchor id="GooCanvasGridModel--vert-grid-line-color"/>The <literal>"vert-grid-line-color"</literal> property GooCanvasGridModel:vert-grid-line-color "vert-grid-line-color" gchararray : Write The color to use for the vertical grid lines.Default value: NULL <anchor id="GooCanvasGridModel--vert-grid-line-color-rgba"/>The <literal>"vert-grid-line-color-rgba"</literal> property GooCanvasGridModel:vert-grid-line-color-rgba "vert-grid-line-color-rgba" guint : Read / Write The color to use for the vertical grid lines, specified as a 32-bit integer value.Default value: 0 <anchor id="GooCanvasGridModel--vert-grid-line-pattern"/>The <literal>"vert-grid-line-pattern"</literal> property GooCanvasGridModel:vert-grid-line-pattern "vert-grid-line-pattern" GooCairoPattern : Read / Write The cairo pattern to paint the vertical grid lines with. <anchor id="GooCanvasGridModel--vert-grid-line-pixbuf"/>The <literal>"vert-grid-line-pixbuf"</literal> property GooCanvasGridModel:vert-grid-line-pixbuf "vert-grid-line-pixbuf" GdkPixbuf : Write The pixbuf to use to draw the vertical grid lines. <anchor id="GooCanvasGridModel--vert-grid-line-width"/>The <literal>"vert-grid-line-width"</literal> property GooCanvasGridModel:vert-grid-line-width "vert-grid-line-width" gdouble : Read / Write The width of the vertical grid lines.Default value: -1 <anchor id="GooCanvasGridModel--vert-grid-lines-on-top"/>The <literal>"vert-grid-lines-on-top"</literal> property GooCanvasGridModel:vert-grid-lines-on-top "vert-grid-lines-on-top" gboolean : Read / Write If the vertical grid lines are painted above the horizontal grid lines.Default value: FALSE <anchor id="GooCanvasGridModel--width"/>The <literal>"width"</literal> property GooCanvasGridModel:width "width" gdouble : Read / Write The width of the grid.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasGridModel--x"/>The <literal>"x"</literal> property GooCanvasGridModel:x "x" gdouble : Read / Write The x coordinate of the grid.Default value: 0 <anchor id="GooCanvasGridModel--x-offset"/>The <literal>"x-offset"</literal> property GooCanvasGridModel:x-offset "x-offset" gdouble : Read / Write The distance before the first vertical grid line.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasGridModel--x-step"/>The <literal>"x-step"</literal> property GooCanvasGridModel:x-step "x-step" gdouble : Read / Write The distance between the vertical grid lines.Allowed values: >= 0 Default value: 10 <anchor id="GooCanvasGridModel--y"/>The <literal>"y"</literal> property GooCanvasGridModel:y "y" gdouble : Read / Write The y coordinate of the grid.Default value: 0 <anchor id="GooCanvasGridModel--y-offset"/>The <literal>"y-offset"</literal> property GooCanvasGridModel:y-offset "y-offset" gdouble : Read / Write The distance before the first horizontal grid line.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasGridModel--y-step"/>The <literal>"y-step"</literal> property GooCanvasGridModel:y-step "y-step" gdouble : Read / Write The distance between the horizontal grid lines.Allowed values: >= 0 Default value: 10 goocanvas-0.15/docs/xml/goocanvasellipse.xml0000644000076400007640000002716011222215703016161 00000000000000 GooCanvasEllipse 3 GOOCANVAS Library GooCanvasEllipse an ellipse item. Synopsis GooCanvasEllipse; GooCanvasItem* goo_canvas_ellipse_new (GooCanvasItem *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...); Object Hierarchy GObject +----GooCanvasItemSimple +----GooCanvasEllipse Implemented Interfaces GooCanvasEllipse implements GooCanvasItem. Properties "center-x" gdouble : Read / Write "center-y" gdouble : Read / Write "height" gdouble : Read / Write "radius-x" gdouble : Read / Write "radius-y" gdouble : Read / Write "width" gdouble : Read / Write "x" gdouble : Read / Write "y" gdouble : Read / Write Description GooCanvasEllipse represents an ellipse item. It is a subclass of GooCanvasItemSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also implements the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate(). To create a GooCanvasEllipse use goo_canvas_ellipse_new(). To get or set the properties of an existing GooCanvasEllipse, use g_object_get() and g_object_set(). The ellipse can be specified either with the "center-x", "center-y", "radius-x" and "radius-y" properties, or with the "x", "y", "width" and "height" properties. Details <anchor id="GooCanvasEllipse-struct" role="struct"/>GooCanvasEllipse GooCanvasEllipsetypedef struct _GooCanvasEllipse GooCanvasEllipse; The GooCanvasEllipse struct contains private data only. <anchor id="goo-canvas-ellipse-new" role="function"/>goo_canvas_ellipse_new () goo_canvas_ellipse_newGooCanvasItem* goo_canvas_ellipse_new (GooCanvasItem *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...); Creates a new ellipse item. parent : the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. center_x : the x coordinate of the center of the ellipse. center_y : the y coordinate of the center of the ellipse. radius_x : the horizontal radius of the ellipse. radius_y : the vertical radius of the ellipse. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new ellipse item. Here's an example showing how to create an ellipse centered at (100.0, 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. It is drawn with a red outline with a width of 5.0 and filled with blue: GooCanvasItem *ellipse = goo_canvas_ellipse_new (mygroup, 100.0, 100.0, 50.0, 30.0, "stroke-color", "red", "line-width", 5.0, "fill-color", "blue", NULL); Property Details <anchor id="GooCanvasEllipse--center-x"/>The <literal>"center-x"</literal> property GooCanvasEllipse:center-x "center-x" gdouble : Read / Write The x coordinate of the center of the ellipse.Default value: 0 <anchor id="GooCanvasEllipse--center-y"/>The <literal>"center-y"</literal> property GooCanvasEllipse:center-y "center-y" gdouble : Read / Write The y coordinate of the center of the ellipse.Default value: 0 <anchor id="GooCanvasEllipse--height"/>The <literal>"height"</literal> property GooCanvasEllipse:height "height" gdouble : Read / Write The height of the ellipse.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasEllipse--radius-x"/>The <literal>"radius-x"</literal> property GooCanvasEllipse:radius-x "radius-x" gdouble : Read / Write The horizontal radius of the ellipse.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasEllipse--radius-y"/>The <literal>"radius-y"</literal> property GooCanvasEllipse:radius-y "radius-y" gdouble : Read / Write The vertical radius of the ellipse.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasEllipse--width"/>The <literal>"width"</literal> property GooCanvasEllipse:width "width" gdouble : Read / Write The width of the ellipse.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasEllipse--x"/>The <literal>"x"</literal> property GooCanvasEllipse:x "x" gdouble : Read / Write The x coordinate of the left side of the ellipse.Default value: 0 <anchor id="GooCanvasEllipse--y"/>The <literal>"y"</literal> property GooCanvasEllipse:y "y" gdouble : Read / Write The y coordinate of the top of the ellipse.Default value: 0 goocanvas-0.15/docs/xml/goocanvastablemodel.xml0000644000076400007640000005610311222215703016633 00000000000000 GooCanvasTableModel 3 GOOCANVAS Library GooCanvasTableModel a model for a table container to layout items. Synopsis GooCanvasTableModel; GooCanvasItemModel* goo_canvas_table_model_new (GooCanvasItemModel *parent, ...); Object Hierarchy GObject +----GooCanvasItemModelSimple +----GooCanvasGroupModel +----GooCanvasTableModel Implemented Interfaces GooCanvasTableModel implements GooCanvasItemModel. Properties "column-spacing" gdouble : Read / Write "homogeneous-columns" gboolean : Read / Write "homogeneous-rows" gboolean : Read / Write "horz-grid-line-width" gdouble : Read / Write "row-spacing" gdouble : Read / Write "vert-grid-line-width" gdouble : Read / Write "x-border-spacing" gdouble : Read / Write "y-border-spacing" gdouble : Read / Write Child Properties "bottom-padding" gdouble : Read / Write "column" guint : Read / Write "columns" guint : Read / Write "left-padding" gdouble : Read / Write "right-padding" gdouble : Read / Write "row" guint : Read / Write "rows" guint : Read / Write "top-padding" gdouble : Read / Write "x-align" gdouble : Read / Write "x-expand" gboolean : Read / Write "x-fill" gboolean : Read / Write "x-shrink" gboolean : Read / Write "y-align" gdouble : Read / Write "y-expand" gboolean : Read / Write "y-fill" gboolean : Read / Write "y-shrink" gboolean : Read / Write Description GooCanvasTableModel is a model for a table container used to lay out other canvas items. It is used in a similar way to how the GtkTable widget is used to lay out GTK+ widgets. Item models are added to the table using the normal methods, then goo_canvas_item_model_set_child_properties() is used to specify how each child item is to be positioned within the table (i.e. which row and column it is in, how much padding it should have and whether it should expand or shrink). GooCanvasTableModel is a subclass of GooCanvasItemModelSimple and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". Setting a style property on a GooCanvasTableModel will affect all children of the GooCanvasTableModel (unless the children override the property setting). GooCanvasTableModel implements the GooCanvasItemModel interface, so you can use the GooCanvasItemModel functions such as goo_canvas_item_model_raise() and goo_canvas_item_rotate(), and the properties such as "visibility" and "pointer-events". To create a GooCanvasTableModel use goo_canvas_table_model_new(). To get or set the properties of an existing GooCanvasTableModel, use g_object_get() and g_object_set(). Details <anchor id="GooCanvasTableModel-struct" role="struct"/>GooCanvasTableModel GooCanvasTableModeltypedef struct _GooCanvasTableModel GooCanvasTableModel; The GooCanvasTableModel struct contains private data only. <anchor id="goo-canvas-table-model-new" role="function"/>goo_canvas_table_model_new () goo_canvas_table_model_newGooCanvasItemModel* goo_canvas_table_model_new (GooCanvasItemModel *parent, ...); Creates a new table model. parent : the parent model, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it. ... : optional pairs of property names and values, and a terminating NULL. Returns : a new table model. Here's an example showing how to create a table with a square, a circle and a triangle in it: GooCanvasItemModel *table, *square, *circle, *triangle; table = goo_canvas_table_model_new (root, "row-spacing", 4.0, "column-spacing", 4.0, NULL); goo_canvas_item_model_translate (table, 400, 200); square = goo_canvas_rect_model_new (table, 0.0, 0.0, 50.0, 50.0, "fill-color", "red", NULL); goo_canvas_item_model_set_child_properties (table, square, "row", 0, "column", 0, NULL); circle = goo_canvas_ellipse_model_new (table, 0.0, 0.0, 25.0, 25.0, "fill-color", "blue", NULL); goo_canvas_item_model_set_child_properties (table, circle, "row", 0, "column", 1, NULL); triangle = goo_canvas_polyline_model_new (table, TRUE, 3, 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, "fill-color", "yellow", NULL); goo_canvas_item_model_set_child_properties (table, triangle, "row", 0, "column", 2, NULL); Property Details <anchor id="GooCanvasTableModel--column-spacing"/>The <literal>"column-spacing"</literal> property GooCanvasTableModel:column-spacing "column-spacing" gdouble : Read / Write The default space between columns.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTableModel--homogeneous-columns"/>The <literal>"homogeneous-columns"</literal> property GooCanvasTableModel:homogeneous-columns "homogeneous-columns" gboolean : Read / Write If all columns are the same width.Default value: FALSE <anchor id="GooCanvasTableModel--homogeneous-rows"/>The <literal>"homogeneous-rows"</literal> property GooCanvasTableModel:homogeneous-rows "homogeneous-rows" gboolean : Read / Write If all rows are the same height.Default value: FALSE <anchor id="GooCanvasTableModel--horz-grid-line-width"/>The <literal>"horz-grid-line-width"</literal> property GooCanvasTableModel:horz-grid-line-width "horz-grid-line-width" gdouble : Read / Write The width of the grid line to draw between rows.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTableModel--row-spacing"/>The <literal>"row-spacing"</literal> property GooCanvasTableModel:row-spacing "row-spacing" gdouble : Read / Write The default space between rows.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTableModel--vert-grid-line-width"/>The <literal>"vert-grid-line-width"</literal> property GooCanvasTableModel:vert-grid-line-width "vert-grid-line-width" gdouble : Read / Write The width of the grid line to draw between columns.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTableModel--x-border-spacing"/>The <literal>"x-border-spacing"</literal> property GooCanvasTableModel:x-border-spacing "x-border-spacing" gdouble : Read / Write The amount of spacing between the lefmost and rightmost cells and the border grid line.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTableModel--y-border-spacing"/>The <literal>"y-border-spacing"</literal> property GooCanvasTableModel:y-border-spacing "y-border-spacing" gdouble : Read / Write The amount of spacing between the topmost and bottommost cells and the border grid line.Allowed values: >= 0 Default value: 0 Child Property Details <anchor id="GooCanvasTableModel--bottom-padding"/>The <literal>"bottom-padding"</literal> child property GooCanvasTableModel:bottom-padding "bottom-padding" gdouble : Read / Write Extra space to add below the item.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTableModel--column"/>The <literal>"column"</literal> child property GooCanvasTableModel:column "column" guint : Read / Write The column to place the item in.Allowed values: <= 65535 Default value: 0 <anchor id="GooCanvasTableModel--columns"/>The <literal>"columns"</literal> child property GooCanvasTableModel:columns "columns" guint : Read / Write The number of columns that the item spans.Allowed values: <= 65535 Default value: 1 <anchor id="GooCanvasTableModel--left-padding"/>The <literal>"left-padding"</literal> child property GooCanvasTableModel:left-padding "left-padding" gdouble : Read / Write Extra space to add to the left of the item.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTableModel--right-padding"/>The <literal>"right-padding"</literal> child property GooCanvasTableModel:right-padding "right-padding" gdouble : Read / Write Extra space to add to the right of the item.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTableModel--row"/>The <literal>"row"</literal> child property GooCanvasTableModel:row "row" guint : Read / Write The row to place the item in.Allowed values: <= 65535 Default value: 0 <anchor id="GooCanvasTableModel--rows"/>The <literal>"rows"</literal> child property GooCanvasTableModel:rows "rows" guint : Read / Write The number of rows that the item spans.Allowed values: <= 65535 Default value: 1 <anchor id="GooCanvasTableModel--top-padding"/>The <literal>"top-padding"</literal> child property GooCanvasTableModel:top-padding "top-padding" gdouble : Read / Write Extra space to add above the item.Allowed values: >= 0 Default value: 0 <anchor id="GooCanvasTableModel--x-align"/>The <literal>"x-align"</literal> child property GooCanvasTableModel:x-align "x-align" gdouble : Read / Write The horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-aligned.Allowed values: [0,1] Default value: 0.5 <anchor id="GooCanvasTableModel--x-expand"/>The <literal>"x-expand"</literal> child property GooCanvasTableModel:x-expand "x-expand" gboolean : Read / Write If the item expands horizontally as the table expands.Default value: FALSE <anchor id="GooCanvasTableModel--x-fill"/>The <literal>"x-fill"</literal> child property GooCanvasTableModel:x-fill "x-fill" gboolean : Read / Write If the item fills all horizontal allocated space.Default value: FALSE <anchor id="GooCanvasTableModel--x-shrink"/>The <literal>"x-shrink"</literal> child property GooCanvasTableModel:x-shrink "x-shrink" gboolean : Read / Write If the item can shrink smaller than its requested size horizontally.Default value: FALSE <anchor id="GooCanvasTableModel--y-align"/>The <literal>"y-align"</literal> child property GooCanvasTableModel:y-align "y-align" gdouble : Read / Write The vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-aligned.Allowed values: [0,1] Default value: 0.5 <anchor id="GooCanvasTableModel--y-expand"/>The <literal>"y-expand"</literal> child property GooCanvasTableModel:y-expand "y-expand" gboolean : Read / Write If the item expands vertically as the table expands.Default value: FALSE <anchor id="GooCanvasTableModel--y-fill"/>The <literal>"y-fill"</literal> child property GooCanvasTableModel:y-fill "y-fill" gboolean : Read / Write If the item fills all vertical allocated space.Default value: FALSE <anchor id="GooCanvasTableModel--y-shrink"/>The <literal>"y-shrink"</literal> child property GooCanvasTableModel:y-shrink "y-shrink" gboolean : Read / Write If the item can shrink smaller than its requested size vertically.Default value: FALSE goocanvas-0.15/docs/overview.xml0000644000076400007640000000514611172574677013717 00000000000000 Overview 3 GOOCANVAS Library Overview a quick tour of GooCanvas. Features Optional model/view split. Uses interfaces for items and views. Basic items - rect/ellipse/polyline/text/image/grid/group. Path item, using SVG path specification strings. Table item for layout of other items (similar to the GtkTable widget). (This also supports items whose requested height changes according to their allocated width, such as text items.) Embedded GTK+ widgets. Layers/stacking order with raise/lower functions. Cascading styles - line width/style/dashes, colors, fill patterns. Affine transformations for all items - rotations/scales/skews. Event handling - button/motion events, "pointer-events" property like SVG. Grabs - support for pointer and keyboard grabs. Keyboard focus traversal. Accessibility (item title and description properties and hierarchy stuff). Printing (output to a given cairo_t). Scrolling. Zooming. Static items that don't move as the canvas is scrolled or zoomed. Item visibility setting - on/off/above zoom threshold. Simple animation. Scalable - support for thousands of items over a large canvas area. Support for different units - pixels/points/inches/millimeters. goocanvas-0.15/docs/coordinates.xml0000644000076400007640000000725211172574677014363 00000000000000 Coordinate Spaces and Limits 3 GOOCANVAS Library Coordinate Spaces and Limits how coordinates are used. Coordinate Spaces Items in the canvas typically have a number of properties specifying their location and size. For example the #GooCanvasRect item has #GooCanvasRect:x, #GooCanvasRect:y, #GooCanvasRect:width and #GooCanvasRect:height properties. However, items can also have a transformation matrix (e.g. the #GooCanvasItem:transform property). Transformation matrices modify the item's coordinate space in some way. Modifications include translation (moving the origin), rotation, scaling, and skewing, or combinations of these. Thus the final position of the item on the canvas can be altered dramatically. The simple animation features in #GooCanvas are accomplished by modifying the item's transformation matrix over time. (See goo_canvas_item_animate().) Since items are in a hierarchy it is possible to move or rotate an entire group of items by simply changing the transformation matrix of the group containing them. The coordinate space used within the item itself (e.g. where the #GooCanvasRect:x and #GooCanvasRect:y properties of a #GooCanvasRect are specified) is referred to as "Item Space". The coordinate space used by the entire canvas is referred to as "Canvas Space" (or "Device Space"). "Item Space" and "Canvas Space" may or may not be the same, depending on whether the item or any of its ancestors have a transformation matrix set. (Note that the entire canvas may also be scrolled and/or zoomed, which means that there may be additional transformations above "Canvas Space".) Functions are provided to convert between coordinate spaces, e.g. goo_canvas_convert_to_item_space() and goo_canvas_convert_from_item_space() convert canvas space coordinates to item space and vice versa. Coordinate Limits GooCanvas uses the Cairo graphics library to render canvas items. For performance reasons Cairo uses 32-bit fixed point integers internally when rendering graphics, with 24 bits used for the integer part of values and 8 bits used for the fractional part. This means that values are limited to roughly +/- 8,388,608. (Prior to Cairo 1.6 16 bits were used for the integer part and 16 bits for the fractional part, meaning values were limited to +/- 32,768.) GooCanvas includes code to work around the Cairo limits to some extent. Subclasses of GooCanvasItemSimple (including all builtin items) can use any desired translation using a transformation matrix. But item space coordinates (modified by any scale, rotation or skew) must be within the Cairo limits. It is possible to create new canvas items that avoid the Cairo limits completely. For an example of this see the "Large Items" page in the GooCanvas demo application, and the corresponding code. goocanvas-0.15/docs/simple-canvas.xml0000644000076400007640000001022711172574677014607 00000000000000 Simple Canvas Example 3 GOOCANVAS Library Simple Canvas Example how to create a simple canvas. Simple Canvas Example Here's a complete example application that creates a #GooCanvas with a rectangle and a text item in it: #include <stdlib.h> #include <goocanvas.h> static gboolean on_rect_button_press (GooCanvasItem *view, GooCanvasItem *target, GdkEventButton *event, gpointer data); static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data); int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win, *canvas; GooCanvasItem *root, *rect_item, *text_item; /* Initialize GTK+. */ gtk_set_locale (); gtk_init (&argc, &argv); /* Create the window and widgets. */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); gtk_widget_show (window); g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event, NULL); scrolled_win = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), GTK_SHADOW_IN); gtk_widget_show (scrolled_win); gtk_container_add (GTK_CONTAINER (window), scrolled_win); canvas = goo_canvas_new (); gtk_widget_set_size_request (canvas, 600, 450); goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); gtk_widget_show (canvas); gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); /* Add a few simple items. */ rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400, "line-width", 10.0, "radius-x", 20.0, "radius-y", 10.0, "stroke-color", "yellow", "fill-color", "red", NULL); text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1, GTK_ANCHOR_CENTER, "font", "Sans 24", NULL); goo_canvas_item_rotate (text_item, 45, 300, 300); /* Connect a signal handler for the rectangle item. */ g_signal_connect (rect_item, "button_press_event", (GtkSignalFunc) on_rect_button_press, NULL); /* Pass control to the GTK+ main event loop. */ gtk_main (); return 0; } /* This handles button presses in item views. We simply output a message to the console. */ static gboolean on_rect_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { g_print ("rect item received button press event\n"); return TRUE; } /* This is our handler for the "delete-event" signal of the window, which is emitted when the 'x' close button is clicked. We just exit here. */ static gboolean on_delete_event (GtkWidget *window, GdkEvent *event, gpointer unused_data) { exit (0); } goocanvas-0.15/docs/Makefile.in0000644000076400007640000004310511222156057013351 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # -*- mode: makefile -*- #################################### # Everything below here is generic # #################################### VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/gtk-doc.make subdir = docs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # We require automake 1.6 at least. AUTOMAKE_OPTIONS = 1.6 # This is a blank Makefile.am for using gtk-doc. # Copy this to your project's API docs directory and modify the variables to # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples # of using the various options. # The name of the module, e.g. 'glib'. DOC_MODULE = goocanvas # The top-level SGML file. You can change this if you want to. DOC_MAIN_SGML_FILE = $(DOC_MODULE)-docs.sgml # The directory containing the source code. Relative to $(srcdir). # gtk-doc will search all .c & .h files beneath here for inline comments # documenting the functions and macros. # e.g. DOC_SOURCE_DIR=../../../gtk DOC_SOURCE_DIR = ../src # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS = --query-child-properties=goo_canvas_query_child_properties # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS = # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml MKDB_OPTIONS = --sgml-mode --output-format=xml # Extra options to supply to gtkdoc-mktmpl # e.g. MKTMPL_OPTIONS=--only-section-tmpl MKTMPL_OPTIONS = # Extra options to supply to gtkdoc-fixref. Not normally needed. # e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html FIXXREF_OPTIONS = # Used for dependencies. The docs will be rebuilt if any of these change. # e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h # e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c HFILE_GLOB = $(top_srcdir)/src/*.h CFILE_GLOB = $(top_srcdir)/src/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h IGNORE_HFILES = goocanvasmarshal.h goocanvasprivate.h # Images to copy into HTML directory. # e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png HTML_IMAGES = # SGML files where gtk-doc abbrevations (#GtkWidget) are expanded # These files must be listed here *and* in content_files # e.g. expand_content_files=running.sgml expand_content_files = \ overview.xml \ simple-canvas.xml \ model-view-canvas.xml \ wysiwyg.xml \ architecture.xml \ coordinates.xml \ creating-items.xml # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). # e.g. content_files=running.sgml building.sgml changes-2.0.sgml content_files = $(expand_content_files) # CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. # Only needed if you are using gtkdoc-scangobj to dynamically query widget # signals and properties. # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src @PACKAGE_CFLAGS@ GTKDOC_LIBS = @PACKAGE_LIBS@ $(top_builddir)/src/libgoocanvas.la @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --mode=compile $(CC) $(INCLUDES) $(AM_CFLAGS) $(CFLAGS) @GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) @GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) # We set GPATH here; this gives us semantics for GNU make # which are more like other make's VPATH, when it comes to # whether a source that is a target of one rule is then # searched for in VPATH/GPATH. # GPATH = $(srcdir) TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) # This includes the standard gtk-doc make rules, copied by gtkdocize. # Other files to distribute # e.g. EXTRA_DIST += version.xml.in EXTRA_DIST = $(content_files) $(HTML_IMAGES) $(DOC_MAIN_SGML_FILE) \ $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt DOC_STAMPS = scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ $(DOC_MODULE).hierarchy \ $(DOC_MODULE).interfaces \ $(DOC_MODULE).prerequisites \ $(DOC_MODULE).signals REPORT_FILES = \ $(DOC_MODULE)-undocumented.txt \ $(DOC_MODULE)-undeclared.txt \ $(DOC_MODULE)-unused.txt CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ clean-libtool clean-local dist-hook distclean \ distclean-generic distclean-libtool distclean-local distdir \ dvi dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-local install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic \ maintainer-clean-local mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-local @ENABLE_GTK_DOC_TRUE@all-local: html-build.stamp @ENABLE_GTK_DOC_FALSE@all-local: docs: html-build.stamp #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' @-chmod -R u+w $(srcdir) cd $(srcdir) && \ gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES) if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \ else \ cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ fi touch scan-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp @true #### templates #### tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' @-chmod -R u+w $(srcdir) cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @true tmpl/*.sgml: @true #### xml #### sgml-build.stamp: tmpl.stamp $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) cd $(srcdir) && \ gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS) touch sgml-build.stamp sgml.stamp: sgml-build.stamp @true #### html #### html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' @-chmod -R u+w $(srcdir) rm -rf $(srcdir)/html mkdir $(srcdir)/html cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) @echo 'gtk-doc: Fixing cross-references' cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) touch html-build.stamp ############## clean-local: rm -f *~ *.bak rm -rf .libs distclean-local: cd $(srcdir) && \ rm -rf xml $(REPORT_FILES) \ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt maintainer-clean-local: clean cd $(srcdir) && rm -rf xml html install-data-local: installfiles=`echo $(srcdir)/html/*`; \ if test "$$installfiles" = '$(srcdir)/html/*'; \ then echo '-- Nothing to install' ; \ else \ $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR); \ for i in $$installfiles; do \ echo '-- Installing '$$i ; \ $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \ done; \ echo '-- Installing $(srcdir)/html/index.sgml' ; \ $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR) || :; \ (which gtkdoc-rebase >& /dev/null && \ gtkdoc-rebase --relative --dest-dir=$(DESTDIR) --html-dir=$(DESTDIR)$(TARGET_DIR)) || : ; \ fi uninstall-local: rm -f $(DESTDIR)$(TARGET_DIR)/* # # Require gtk-doc when making dist # @ENABLE_GTK_DOC_TRUE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@dist-check-gtkdoc: @ENABLE_GTK_DOC_FALSE@ @echo "*** gtk-doc must be installed and enabled in order to make dist" @ENABLE_GTK_DOC_FALSE@ @false dist-hook: dist-check-gtkdoc dist-hook-local mkdir $(distdir)/tmpl mkdir $(distdir)/xml mkdir $(distdir)/html -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl -cp $(srcdir)/xml/*.xml $(distdir)/xml cp $(srcdir)/html/* $(distdir)/html cp $(srcdir)/$(DOC_MODULE).types $(distdir)/ cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/ cd $(distdir) && rm -f $(DISTCLEANFILES) -gtkdoc-rebase --online --relative --html-dir=$(distdir)/html .PHONY : dist-hook-local docs # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: goocanvas-0.15/docs/goocanvas-docs.sgml0000644000076400007640000000430511172574677015115 00000000000000 GooCanvas Reference Manual Introduction Core Objects Standard Canvas Items Standard Canvas Item Models Miscellaneous goocanvas-0.15/docs/goocanvas-sections.txt0000644000076400007640000004006511222215703015646 00000000000000
goocanvastable GooCanvasTable GooCanvasTable goo_canvas_table_new GOO_CANVAS_TABLE GOO_IS_CANVAS_TABLE GOO_TYPE_CANVAS_TABLE goo_canvas_table_get_type GOO_CANVAS_TABLE_CLASS GOO_IS_CANVAS_TABLE_CLASS GOO_CANVAS_TABLE_GET_CLASS GooCanvasTableData GooCanvasTableDimension GooCanvasTableLayoutData GooCanvasTableClass
goocanvastablemodel GooCanvasTableModel GooCanvasTableModel goo_canvas_table_model_new GOO_TYPE_CANVAS_TABLE_MODEL goo_canvas_table_model_get_type GOO_CANVAS_TABLE_MODEL GOO_CANVAS_TABLE_MODEL_CLASS GOO_IS_CANVAS_TABLE_MODEL GOO_IS_CANVAS_TABLE_MODEL_CLASS GOO_CANVAS_TABLE_MODEL_GET_CLASS GooCanvasTableModelClass
goocanvasrect GooCanvasRect GooCanvasRect goo_canvas_rect_new GOO_CANVAS_RECT GOO_IS_CANVAS_RECT GOO_TYPE_CANVAS_RECT goo_canvas_rect_get_type GOO_CANVAS_RECT_CLASS GOO_IS_CANVAS_RECT_CLASS GOO_CANVAS_RECT_GET_CLASS GooCanvasRectData GooCanvasRectClass
goocanvasrectmodel GooCanvasRectModel GooCanvasRectModel goo_canvas_rect_model_new GOO_TYPE_CANVAS_RECT_MODEL goo_canvas_rect_model_get_type GOO_CANVAS_RECT_MODEL GOO_CANVAS_RECT_MODEL_CLASS GOO_IS_CANVAS_RECT_MODEL GOO_IS_CANVAS_RECT_MODEL_CLASS GOO_CANVAS_RECT_MODEL_GET_CLASS GooCanvasRectModelClass
goocanvasitem GooCanvasItem GooCanvasItemIface goo_canvas_item_translate goo_canvas_item_scale goo_canvas_item_rotate goo_canvas_item_skew_x goo_canvas_item_skew_y goo_canvas_item_get_transform goo_canvas_item_set_transform goo_canvas_item_get_simple_transform goo_canvas_item_set_simple_transform goo_canvas_item_get_bounds goo_canvas_item_is_visible goo_canvas_item_get_is_static goo_canvas_item_set_is_static goo_canvas_item_animate goo_canvas_item_stop_animation goo_canvas_item_raise goo_canvas_item_lower goo_canvas_item_remove goo_canvas_item_get_canvas goo_canvas_item_set_canvas goo_canvas_item_get_parent goo_canvas_item_set_parent goo_canvas_item_get_model goo_canvas_item_set_model goo_canvas_item_is_container goo_canvas_item_get_n_children goo_canvas_item_get_child goo_canvas_item_find_child goo_canvas_item_add_child goo_canvas_item_move_child goo_canvas_item_remove_child goo_canvas_item_get_transform_for_child goo_canvas_item_get_style goo_canvas_item_set_style goo_canvas_item_request_update goo_canvas_item_ensure_updated goo_canvas_item_update goo_canvas_item_get_requested_area goo_canvas_item_get_requested_height goo_canvas_item_allocate_area goo_canvas_item_get_items_at goo_canvas_item_paint goo_canvas_item_class_install_child_property goo_canvas_item_class_list_child_properties goo_canvas_item_class_find_child_property goo_canvas_item_get_child_property goo_canvas_item_set_child_property goo_canvas_item_get_child_properties goo_canvas_item_get_child_properties_valist goo_canvas_item_set_child_properties goo_canvas_item_set_child_properties_valist GOO_CANVAS_ITEM GOO_IS_CANVAS_ITEM GOO_TYPE_CANVAS_ITEM goo_canvas_item_get_type GOO_CANVAS_ITEM_GET_IFACE
goocanvasitemmodel GooCanvasItemModel GooCanvasItemModelIface goo_canvas_item_model_translate goo_canvas_item_model_scale goo_canvas_item_model_rotate goo_canvas_item_model_skew_x goo_canvas_item_model_skew_y goo_canvas_item_model_get_transform goo_canvas_item_model_set_transform goo_canvas_item_model_get_simple_transform goo_canvas_item_model_set_simple_transform goo_canvas_item_model_animate goo_canvas_item_model_stop_animation goo_canvas_item_model_raise goo_canvas_item_model_lower goo_canvas_item_model_remove goo_canvas_item_model_get_parent goo_canvas_item_model_set_parent goo_canvas_item_model_is_container goo_canvas_item_model_get_n_children goo_canvas_item_model_get_child goo_canvas_item_model_add_child goo_canvas_item_model_move_child goo_canvas_item_model_remove_child goo_canvas_item_model_find_child goo_canvas_item_model_get_style goo_canvas_item_model_set_style goo_canvas_item_model_class_install_child_property goo_canvas_item_model_class_list_child_properties goo_canvas_item_model_class_find_child_property goo_canvas_item_model_get_child_property goo_canvas_item_model_set_child_property goo_canvas_item_model_get_child_properties goo_canvas_item_model_get_child_properties_valist goo_canvas_item_model_set_child_properties goo_canvas_item_model_set_child_properties_valist GOO_CANVAS_ITEM_MODEL GOO_IS_CANVAS_ITEM_MODEL GOO_TYPE_CANVAS_ITEM_MODEL goo_canvas_item_model_get_type GOO_CANVAS_ITEM_MODEL_GET_IFACE
goocanvasgroup GooCanvasGroup GooCanvasGroup goo_canvas_group_new GOO_CANVAS_GROUP GOO_IS_CANVAS_GROUP GOO_TYPE_CANVAS_GROUP goo_canvas_group_get_type GOO_CANVAS_GROUP_CLASS GOO_IS_CANVAS_GROUP_CLASS GOO_CANVAS_GROUP_GET_CLASS GooCanvasGroupClass
goocanvasgroupmodel GooCanvasGroupModel GooCanvasGroupModel goo_canvas_group_model_new GOO_TYPE_CANVAS_GROUP_MODEL goo_canvas_group_model_get_type GOO_CANVAS_GROUP_MODEL GOO_CANVAS_GROUP_MODEL_CLASS GOO_IS_CANVAS_GROUP_MODEL GOO_IS_CANVAS_GROUP_MODEL_CLASS GOO_CANVAS_GROUP_MODEL_GET_CLASS GooCanvasGroupModelClass
goocanvaspath GooCanvasPath GooCanvasPath goo_canvas_path_new GOO_CANVAS_PATH GOO_IS_CANVAS_PATH GOO_TYPE_CANVAS_PATH goo_canvas_path_get_type GOO_CANVAS_PATH_CLASS GOO_IS_CANVAS_PATH_CLASS GOO_CANVAS_PATH_GET_CLASS GooCanvasPathData goo_canvas_path_command_type_get_type GOO_TYPE_CANVAS_PATH_COMMAND_TYPE GooCanvasPathClass
goocanvaspathmodel GooCanvasPathModel GooCanvasPathModel goo_canvas_path_model_new GOO_TYPE_CANVAS_PATH_MODEL GOO_CANVAS_PATH_MODEL goo_canvas_path_model_get_type GOO_CANVAS_PATH_MODEL_CLASS GOO_IS_CANVAS_PATH_MODEL GOO_IS_CANVAS_PATH_MODEL_CLASS GOO_CANVAS_PATH_MODEL_GET_CLASS GooCanvasPathModelClass
goocanvasellipse GooCanvasEllipse GooCanvasEllipse goo_canvas_ellipse_new GOO_CANVAS_ELLIPSE GOO_IS_CANVAS_ELLIPSE GOO_TYPE_CANVAS_ELLIPSE goo_canvas_ellipse_get_type GOO_CANVAS_ELLIPSE_CLASS GOO_IS_CANVAS_ELLIPSE_CLASS GOO_CANVAS_ELLIPSE_GET_CLASS GooCanvasEllipseData GooCanvasEllipseClass
goocanvasellipsemodel GooCanvasEllipseModel GooCanvasEllipseModel goo_canvas_ellipse_model_new GOO_TYPE_CANVAS_ELLIPSE_MODEL GOO_CANVAS_ELLIPSE_MODEL goo_canvas_ellipse_model_get_type GOO_CANVAS_ELLIPSE_MODEL_CLASS GOO_IS_CANVAS_ELLIPSE_MODEL GOO_IS_CANVAS_ELLIPSE_MODEL_CLASS GOO_CANVAS_ELLIPSE_MODEL_GET_CLASS GooCanvasEllipseModelClass
goocanvas GooCanvas GooCanvas GooCanvasClass goo_canvas_new goo_canvas_get_root_item goo_canvas_set_root_item goo_canvas_get_root_item_model goo_canvas_set_root_item_model goo_canvas_get_static_root_item goo_canvas_set_static_root_item goo_canvas_get_static_root_item_model goo_canvas_set_static_root_item_model goo_canvas_get_bounds goo_canvas_set_bounds goo_canvas_get_scale goo_canvas_set_scale goo_canvas_get_item goo_canvas_get_item_at goo_canvas_get_items_at goo_canvas_get_items_in_area goo_canvas_scroll_to goo_canvas_render goo_canvas_convert_to_pixels goo_canvas_convert_from_pixels goo_canvas_convert_to_item_space goo_canvas_convert_from_item_space goo_canvas_convert_bounds_to_item_space goo_canvas_pointer_grab goo_canvas_pointer_ungrab goo_canvas_grab_focus goo_canvas_keyboard_grab goo_canvas_keyboard_ungrab goo_canvas_create_cairo_context goo_canvas_create_item goo_canvas_unregister_item goo_canvas_register_widget_item goo_canvas_unregister_widget_item goo_canvas_update goo_canvas_request_update goo_canvas_request_redraw goo_canvas_request_item_redraw goo_canvas_get_default_line_width GOO_CANVAS GOO_IS_CANVAS GOO_TYPE_CANVAS goo_canvas_get_type GOO_CANVAS_CLASS GOO_IS_CANVAS_CLASS GOO_CANVAS_GET_CLASS
goocanvastext GooCanvasText GooCanvasText goo_canvas_text_new goo_canvas_text_get_natural_extents GOO_CANVAS_TEXT GOO_IS_CANVAS_TEXT GOO_TYPE_CANVAS_TEXT goo_canvas_text_get_type GOO_CANVAS_TEXT_CLASS GOO_IS_CANVAS_TEXT_CLASS GOO_CANVAS_TEXT_GET_CLASS GooCanvasTextData GooCanvasTextClass
goocanvastextmodel GooCanvasTextModel GooCanvasTextModel goo_canvas_text_model_new GOO_TYPE_CANVAS_TEXT_MODEL GOO_CANVAS_TEXT_MODEL goo_canvas_text_model_get_type GOO_CANVAS_TEXT_MODEL_CLASS GOO_IS_CANVAS_TEXT_MODEL GOO_IS_CANVAS_TEXT_MODEL_CLASS GOO_CANVAS_TEXT_MODEL_GET_CLASS GooCanvasTextModelClass
goocanvaspolyline GooCanvasPolyline GooCanvasPolyline goo_canvas_polyline_new goo_canvas_polyline_new_line GOO_CANVAS_POLYLINE GOO_IS_CANVAS_POLYLINE GOO_TYPE_CANVAS_POLYLINE goo_canvas_polyline_get_type GOO_CANVAS_POLYLINE_CLASS GOO_IS_CANVAS_POLYLINE_CLASS GOO_CANVAS_POLYLINE_GET_CLASS GooCanvasPolylineData NUM_ARROW_POINTS GooCanvasPolylineArrowData GooCanvasPolylineClass
goocanvaspolylinemodel GooCanvasPolylineModel GooCanvasPolylineModel goo_canvas_polyline_model_new goo_canvas_polyline_model_new_line GOO_TYPE_CANVAS_POLYLINE_MODEL GOO_CANVAS_POLYLINE_MODEL goo_canvas_polyline_model_get_type GOO_CANVAS_POLYLINE_MODEL_CLASS GOO_IS_CANVAS_POLYLINE_MODEL GOO_IS_CANVAS_POLYLINE_MODEL_CLASS GOO_CANVAS_POLYLINE_MODEL_GET_CLASS GooCanvasPolylineModelClass
goocanvasitemsimple GooCanvasItemSimple GooCanvasItemSimple GooCanvasItemSimpleData GooCanvasItemSimpleClass goo_canvas_item_simple_check_style goo_canvas_item_simple_get_line_width goo_canvas_item_simple_get_path_bounds goo_canvas_item_simple_user_bounds_to_device goo_canvas_item_simple_user_bounds_to_parent goo_canvas_item_simple_check_in_path goo_canvas_item_simple_paint_path goo_canvas_item_simple_changed goo_canvas_item_simple_set_model GOO_CANVAS_ITEM_SIMPLE GOO_IS_CANVAS_ITEM_SIMPLE GOO_TYPE_CANVAS_ITEM_SIMPLE goo_canvas_item_simple_get_type GOO_CANVAS_ITEM_SIMPLE_CLASS GOO_IS_CANVAS_ITEM_SIMPLE_CLASS GOO_CANVAS_ITEM_SIMPLE_GET_CLASS
goocanvasitemmodelsimple GooCanvasItemModelSimple GooCanvasItemModelSimple GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE goo_canvas_item_model_simple_get_type GOO_CANVAS_ITEM_MODEL_SIMPLE GOO_CANVAS_ITEM_MODEL_SIMPLE_CLASS GOO_IS_CANVAS_ITEM_MODEL_SIMPLE GOO_IS_CANVAS_ITEM_MODEL_SIMPLE_CLASS GOO_CANVAS_ITEM_MODEL_SIMPLE_GET_CLASS GooCanvasItemModelSimpleClass
goocanvasimage GooCanvasImage GooCanvasImage goo_canvas_image_new GOO_CANVAS_IMAGE GOO_IS_CANVAS_IMAGE GOO_TYPE_CANVAS_IMAGE goo_canvas_image_get_type GOO_CANVAS_IMAGE_CLASS GOO_IS_CANVAS_IMAGE_CLASS GOO_CANVAS_IMAGE_GET_CLASS GooCanvasImageData GooCanvasImageClass
goocanvasimagemodel GooCanvasImageModel GooCanvasImageModel goo_canvas_image_model_new GOO_TYPE_CANVAS_IMAGE_MODEL GOO_CANVAS_IMAGE_MODEL goo_canvas_image_model_get_type GOO_CANVAS_IMAGE_MODEL_CLASS GOO_IS_CANVAS_IMAGE_MODEL GOO_IS_CANVAS_IMAGE_MODEL_CLASS GOO_CANVAS_IMAGE_MODEL_GET_CLASS GooCanvasImageModelClass
goocanvasgrid GooCanvasGrid GooCanvasGrid goo_canvas_grid_new GOO_CANVAS_GRID GOO_IS_CANVAS_GRID GOO_TYPE_CANVAS_GRID goo_canvas_grid_get_type GOO_CANVAS_GRID_CLASS GOO_IS_CANVAS_GRID_CLASS GOO_CANVAS_GRID_GET_CLASS GooCanvasGridData GooCanvasGridClass
goocanvasgridmodel GooCanvasGridModel GooCanvasGridModel goo_canvas_grid_model_new GOO_CANVAS_GRID_MODEL GOO_IS_CANVAS_GRID_MODEL GOO_TYPE_CANVAS_GRID_MODEL goo_canvas_grid_model_get_type GOO_CANVAS_GRID_MODEL_CLASS GOO_IS_CANVAS_GRID_MODEL_CLASS GOO_CANVAS_GRID_MODEL_GET_CLASS GooCanvasGridModelClass
goocanvaswidget GooCanvasWidget GooCanvasWidget goo_canvas_widget_new GOO_CANVAS_WIDGET GOO_CANVAS_WIDGET_CLASS GOO_CANVAS_WIDGET_GET_CLASS GOO_IS_CANVAS_WIDGET GOO_IS_CANVAS_WIDGET_CLASS goo_canvas_widget_get_type GOO_TYPE_CANVAS_WIDGET GooCanvasWidgetClass
goocanvasstyle GooCanvasStyle GooCanvasStyle GooCanvasStyleProperty goo_canvas_style_new goo_canvas_style_copy goo_canvas_style_get_parent goo_canvas_style_set_parent goo_canvas_style_get_property goo_canvas_style_set_property goo_canvas_style_set_fill_options goo_canvas_style_set_stroke_options goo_canvas_style_antialias_id goo_canvas_style_fill_pattern_id goo_canvas_style_fill_rule_id goo_canvas_style_font_desc_id goo_canvas_style_hint_metrics_id goo_canvas_style_line_cap_id goo_canvas_style_line_dash_id goo_canvas_style_line_join_id goo_canvas_style_line_join_miter_limit_id goo_canvas_style_line_width_id goo_canvas_style_operator_id goo_canvas_style_stroke_pattern_id GOO_CANVAS_STYLE GOO_CANVAS_STYLE_CLASS GOO_CANVAS_STYLE_GET_CLASS GOO_IS_CANVAS_STYLE GOO_IS_CANVAS_STYLE_CLASS GOO_TYPE_CANVAS_STYLE goo_canvas_style_get_type GooCanvasStyleClass
goocanvasutils GooCanvas Types GooCanvasBounds GooCanvasItemVisibility GooCanvasPointerEvents GooCanvasAnimateType GooCanvasPoints goo_canvas_points_new goo_canvas_points_ref goo_canvas_points_unref GooCanvasLineDash goo_canvas_line_dash_new goo_canvas_line_dash_newv goo_canvas_line_dash_ref goo_canvas_line_dash_unref GooCanvasPathCommandType GooCanvasPathCommand goo_canvas_parse_path_data goo_canvas_create_path GooCairoAntialias GooCairoFillRule GooCairoHintMetrics GooCairoLineCap GooCairoLineJoin GooCairoOperator GooCairoMatrix GooCairoPattern GOO_TYPE_CANVAS_POINTS goo_canvas_points_get_type GOO_TYPE_CANVAS_POINTER_EVENTS goo_canvas_pointer_events_get_type GOO_TYPE_CANVAS_ITEM_VISIBILITY goo_canvas_item_visibility_get_type GOO_TYPE_CAIRO_MATRIX goo_cairo_matrix_get_type goo_cairo_matrix_copy goo_cairo_matrix_free GOO_TYPE_CAIRO_PATTERN goo_cairo_pattern_get_type GOO_TYPE_CANVAS_LINE_DASH goo_canvas_line_dash_get_type GOO_TYPE_CAIRO_ANTIALIAS GOO_TYPE_CAIRO_FILL_RULE GOO_TYPE_CAIRO_LINE_CAP GOO_TYPE_CAIRO_LINE_JOIN GOO_TYPE_CAIRO_OPERATOR GOO_TYPE_CANVAS_ANIMATE_TYPE goo_cairo_antialias_get_type goo_cairo_fill_rule_get_type goo_cairo_line_cap_get_type goo_cairo_line_join_get_type goo_cairo_operator_get_type goo_canvas_animate_type_get_type GOO_TYPE_CAIRO_HINT_METRICS goo_cairo_hint_metrics_get_type GOO_TYPE_CANVAS_BOUNDS goo_canvas_bounds_get_type goo_canvas_accessible_factory_get_type goo_canvas_item_accessible_factory_get_type goo_canvas_widget_accessible_factory_get_type
goocanvas-0.15/po/0000777000076400007640000000000011222215707011051 500000000000000goocanvas-0.15/po/Makefile.in.in0000644000076400007640000001771411222156053013447 00000000000000# Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper # # This file file be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # # - Modified by Owen Taylor to use GETTEXT_PACKAGE # instead of PACKAGE and to look for po2tbl in ./ not in intl/ # # - Modified by jacob berkman to install # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ libdir = @libdir@ localedir = $(libdir)/locale gnulocaledir = $(datadir)/locale gettextsrcdir = $(datadir)/glib-2.0/gettext/po subdir = po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ CC = @CC@ GENCAT = @GENCAT@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge DEFS = @DEFS@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ INCLUDES = -I.. -I$(top_srcdir)/intl COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) SOURCES = POFILES = @POFILES@ GMOFILES = @GMOFILES@ DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \ $(POFILES) $(GMOFILES) $(SOURCES) POTFILES = \ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ INSTOBJEXT = @INSTOBJEXT@ .SUFFIXES: .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat .c.o: $(COMPILE) $< .po.pox: $(MAKE) $(GETTEXT_PACKAGE).pot $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) $(MSGFMT_OPTS) -o $$file $< .po.cat: sed -f ../intl/po2msg.sed < $< > $*.msg \ && rm -f $@ && $(GENCAT) $@ $*.msg all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) $(XGETTEXT) --default-domain=$(GETTEXT_PACKAGE) --directory=$(top_srcdir) \ --add-comments --keyword=_ --keyword=N_ \ --flag=g_strdup_printf:1:c-format \ --flag=g_string_printf:2:c-format \ --flag=g_string_append_printf:2:c-format \ --flag=g_error_new:3:c-format \ --flag=g_set_error:4:c-format \ --flag=g_markup_printf_escaped:1:c-format \ --flag=g_log:3:c-format \ --flag=g_print:1:c-format \ --flag=g_printerr:1:c-format \ --flag=g_printf:1:c-format \ --flag=g_fprintf:2:c-format \ --flag=g_sprintf:2:c-format \ --flag=g_snprintf:3:c-format \ --flag=g_scanner_error:2:c-format \ --flag=g_scanner_warn:2:c-format \ --files-from=$(srcdir)/POTFILES.in \ && test ! -f $(GETTEXT_PACKAGE).po \ || ( rm -f $(srcdir)/$(GETTEXT_PACKAGE).pot \ && mv $(GETTEXT_PACKAGE).po $(srcdir)/$(GETTEXT_PACKAGE).pot ) install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ fi @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ case "$$cat" in \ *.gmo) destdir=$(gnulocaledir);; \ *) destdir=$(localedir);; \ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $$dir; \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ fi; \ if test -r $$cat; then \ $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ else \ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ fi; \ if test -r $$cat.m; then \ $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ else \ if test -r $(srcdir)/$$cat.m ; then \ $(INSTALL_DATA) $(srcdir)/$$cat.m \ $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ echo "installing $(srcdir)/$$cat as" \ "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ else \ true; \ fi; \ fi; \ done if test "$(PACKAGE)" = "glib"; then \ if test -r "$(MKINSTALLDIRS)"; then \ $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ else \ $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ fi; \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ done if test "$(PACKAGE)" = "glib"; then \ rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ fi check: all dvi info tags TAGS ID: mostlyclean: rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f $(GMOFILES) distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) dist distdir: update-po $(DISTFILES) dists="$(DISTFILES)"; \ for file in $$dists; do \ ln $(srcdir)/$$file $(distdir) 2> /dev/null \ || cp -p $(srcdir)/$$file $(distdir); \ done update-po: Makefile $(MAKE) $(GETTEXT_PACKAGE).pot tmpdir=`pwd`; \ cd $(srcdir); \ catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ echo "$$lang:"; \ if $(MSGMERGE) $$lang.po $(GETTEXT_PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$cat failed!"; \ rm -f $$tmpdir/$$lang.new.po; \ fi; \ done # POTFILES is created from POTFILES.in by stripping comments, empty lines # and Intltool tags (enclosed in square brackets), and appending a full # relative path to them POTFILES: POTFILES.in ( if test 'x$(srcdir)' != 'x.'; then \ posrcprefix='$(top_srcdir)/'; \ else \ posrcprefix="../"; \ fi; \ rm -f $@-t $@ \ && (sed -e '/^#/d' \ -e "s/^\[.*\] +//" \ -e '/^[ ]*$$/d' \ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ | sed -e '$$s/\\$$//') > $@-t \ && chmod a-w $@-t \ && mv $@-t $@ ) Makefile: Makefile.in.in ../config.status POTFILES cd .. \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: goocanvas-0.15/po/ChangeLog0000644000076400007640000000065611172574677012570 000000000000002008-12-29 Damon Chaplin * POTFILES.in: added goocanvasgrid.c. 2008-05-04 Damon Chaplin * ja.po: update from Kouhei Sutou. 2007-03-06 Damon Chaplin * es.po: update from Rafael Villar Burke. 2007-02-15 Damon Chaplin * ja.po: update from Kouhei Sutou. 2007-02-12 Damon Chaplin * ja.po: * es.po: added new po files. goocanvas-0.15/po/es.po0000644000076400007640000007703711222156155011753 00000000000000# Spanish translation for GooCanvas # This file is distributed under the same license as the GooCanvas package. # msgid "" msgstr "" "Project-Id-Version: GooCanvas CVS\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-29 16:23+0100\n" "PO-Revision-Date: 2006-04-24 16:26+0100\n" "Last-Translator: Rafael Villar Burke \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/goocanvas.c:284 msgid "Scale" msgstr "Escala" #: src/goocanvas.c:285 msgid "The magnification factor of the canvas" msgstr "Factor de ampliación del lienzo" #: src/goocanvas.c:291 #, fuzzy msgid "Scale X" msgstr "Escala" #: src/goocanvas.c:292 #, fuzzy msgid "The horizontal magnification factor of the canvas" msgstr "Factor de ampliación del lienzo" #: src/goocanvas.c:298 #, fuzzy msgid "Scale Y" msgstr "Escala" #: src/goocanvas.c:299 #, fuzzy msgid "The vertical magnification factor of the canvas" msgstr "Factor de ampliación del lienzo" #: src/goocanvas.c:305 src/goocanvastext.c:158 src/goocanvaswidget.c:589 msgid "Anchor" msgstr "Ancla" #: src/goocanvas.c:306 msgid "" "Where to place the canvas when it is smaller than the widget's allocated area" msgstr "Dónde situar el lienzo cuando es menor que el área asignada al control" #: src/goocanvas.c:313 msgid "X1" msgstr "X1" #: src/goocanvas.c:314 msgid "The x coordinate of the left edge of the canvas bounds, in canvas units" msgstr "" "Coordenada x del borde izquierdo de los límites del lienzo, en unidades del " "lienzo" #: src/goocanvas.c:321 msgid "Y1" msgstr "Y1" #: src/goocanvas.c:322 msgid "The y coordinate of the top edge of the canvas bounds, in canvas units" msgstr "" "Coordenada y del borde superior de los límites del lienzo, en unidades del " "lienzo" #: src/goocanvas.c:329 msgid "X2" msgstr "X2" #: src/goocanvas.c:330 msgid "" "The x coordinate of the right edge of the canvas bounds, in canvas units" msgstr "" "Coordenada x del borde derecho de los límites del lienzo, en unidades del " "lienzo" #: src/goocanvas.c:338 msgid "Y2" msgstr "Y2" #: src/goocanvas.c:339 msgid "" "The y coordinate of the bottom edge of the canvas bounds, in canvas units" msgstr "" "Coordenada y del borde inferior de los límites del lienzo, en unidades del " "lienzo" #: src/goocanvas.c:348 msgid "Automatic Bounds" msgstr "" #: src/goocanvas.c:349 msgid "" "If the bounds are automatically calculated based on the bounds of all the " "items in the canvas" msgstr "" #: src/goocanvas.c:355 msgid "Bounds From Origin" msgstr "" #: src/goocanvas.c:356 msgid "If the automatic bounds are calculated from the origin" msgstr "" #: src/goocanvas.c:362 #, fuzzy msgid "Bounds Padding" msgstr "Margen superior" #: src/goocanvas.c:363 msgid "The padding added to the automatic bounds" msgstr "" #: src/goocanvas.c:369 msgid "Units" msgstr "Unidades" #: src/goocanvas.c:370 msgid "The units to use for the canvas" msgstr "Unidades que se han de usar para el lienzo" #: src/goocanvas.c:377 msgid "Resolution X" msgstr "Resolución X" #: src/goocanvas.c:378 msgid "The horizontal resolution of the display, in dots per inch" msgstr "Resolución horizontal de la pantalla, en puntos por pulgada" #: src/goocanvas.c:385 msgid "Resolution Y" msgstr "Resolución Y" #: src/goocanvas.c:386 msgid "The vertical resolution of the display, in dots per inch" msgstr "Resolución vertical de la pantalla, en puntos por pulgada" #: src/goocanvas.c:394 msgid "Background Color" msgstr "" #: src/goocanvas.c:395 #, fuzzy msgid "The color to use for the canvas background" msgstr "Unidades que se han de usar para el lienzo" #: src/goocanvas.c:401 #, fuzzy msgid "Background Color RGB" msgstr "RGBA del color de trazo" #: src/goocanvas.c:402 #, fuzzy msgid "" "The color to use for the canvas background, specified as a 24-bit integer " "value, 0xRRGGBB" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvas.c:408 msgid "Integer Layout" msgstr "" #: src/goocanvas.c:409 msgid "If all item layout is done to the nearest integer" msgstr "" #: src/goocanvas.c:415 msgid "Clear Background" msgstr "" #: src/goocanvas.c:416 msgid "If the background is cleared before the canvas is painted" msgstr "" #: src/goocanvas.c:422 msgid "Redraw When Scrolled" msgstr "" #: src/goocanvas.c:423 msgid "" "If the canvas is completely redrawn when scrolled, to reduce the flicker of " "static items" msgstr "" #: src/goocanvasellipse.c:77 msgid "Center X" msgstr "Centro X" #: src/goocanvasellipse.c:78 msgid "The x coordinate of the center of the ellipse" msgstr "Coordenada x del centro de la elipse" #: src/goocanvasellipse.c:85 msgid "Center Y" msgstr "Centro Y" #: src/goocanvasellipse.c:86 msgid "The y coordinate of the center of the ellipse" msgstr "Coordenada y del centro de la elipse" #: src/goocanvasellipse.c:93 src/goocanvasrect.c:90 msgid "Radius X" msgstr "Radio X" #: src/goocanvasellipse.c:94 msgid "The horizontal radius of the ellipse" msgstr "Radio horizontal de la elipse" #: src/goocanvasellipse.c:100 src/goocanvasrect.c:97 msgid "Radius Y" msgstr "Radio Y" #: src/goocanvasellipse.c:101 msgid "The vertical radius of the ellipse" msgstr "Radio vertical de la elipse" #: src/goocanvasellipse.c:108 #, fuzzy msgid "The x coordinate of the left side of the ellipse" msgstr "Coordenada x del centro de la elipse" #: src/goocanvasellipse.c:116 #, fuzzy msgid "The y coordinate of the top of the ellipse" msgstr "Coordenada y del centro de la elipse" #: src/goocanvasellipse.c:123 src/goocanvasgrid.c:124 src/goocanvasgroup.c:106 #: src/goocanvasimage.c:107 src/goocanvaspath.c:93 src/goocanvaspolyline.c:207 #: src/goocanvasrect.c:76 src/goocanvastext.c:141 src/goocanvaswidget.c:572 msgid "Width" msgstr "Ancho" #: src/goocanvasellipse.c:124 #, fuzzy msgid "The width of the ellipse" msgstr "Ancho de la imagen" #: src/goocanvasellipse.c:130 src/goocanvasgrid.c:131 src/goocanvasgroup.c:114 #: src/goocanvasimage.c:114 src/goocanvaspath.c:100 #: src/goocanvaspolyline.c:214 src/goocanvasrect.c:83 src/goocanvastext.c:149 #: src/goocanvaswidget.c:580 msgid "Height" msgstr "Alto" #: src/goocanvasellipse.c:131 #, fuzzy msgid "The height of the ellipse" msgstr "Altura de la la imagen" #: src/goocanvasgrid.c:109 #, fuzzy msgid "The x coordinate of the grid" msgstr "Coordenada x del control" #: src/goocanvasgrid.c:117 #, fuzzy msgid "The y coordinate of the grid" msgstr "Coordenada y del control" #: src/goocanvasgrid.c:125 #, fuzzy msgid "The width of the grid" msgstr "Ancho de la imagen" #: src/goocanvasgrid.c:132 #, fuzzy msgid "The height of the grid" msgstr "Altura de la la imagen" #: src/goocanvasgrid.c:139 msgid "The distance between the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:146 msgid "The distance between the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:153 msgid "The distance before the first vertical grid line" msgstr "" #: src/goocanvasgrid.c:160 msgid "The distance before the first horizontal grid line" msgstr "" #: src/goocanvasgrid.c:166 src/goocanvastable.c:276 msgid "Horizontal Grid Line Width" msgstr "" #: src/goocanvasgrid.c:167 #, fuzzy msgid "The width of the horizontal grid lines" msgstr "Ancho del rectángulo" #: src/goocanvasgrid.c:174 src/goocanvastable.c:283 msgid "Vertical Grid Line Width" msgstr "" #: src/goocanvasgrid.c:175 #, fuzzy msgid "The width of the vertical grid lines" msgstr "Ancho del rectángulo" #: src/goocanvasgrid.c:182 msgid "Horizontal Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:183 #, fuzzy msgid "The cairo pattern to paint the horizontal grid lines with" msgstr "Patrón cairo para dibujar" #: src/goocanvasgrid.c:189 msgid "Vertical Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:190 #, fuzzy msgid "The cairo pattern to paint the vertical grid lines with" msgstr "Patrón cairo para dibujar" #: src/goocanvasgrid.c:196 #, fuzzy msgid "Border Width" msgstr "Ancho de flecha" #: src/goocanvasgrid.c:197 #, fuzzy msgid "The width of the border around the grid" msgstr "Ancho del rectángulo" #: src/goocanvasgrid.c:204 #, fuzzy msgid "Border Pattern" msgstr "Patrón de trazado" #: src/goocanvasgrid.c:205 #, fuzzy msgid "The cairo pattern to paint the border with" msgstr "Patrón cairo para dibujar" #: src/goocanvasgrid.c:211 msgid "Show Horizontal Grid Lines" msgstr "" #: src/goocanvasgrid.c:212 msgid "If the horizontal grid lines are shown" msgstr "" #: src/goocanvasgrid.c:218 msgid "Show Vertical Grid Lines" msgstr "" #: src/goocanvasgrid.c:219 msgid "If the vertical grid lines are shown" msgstr "" #: src/goocanvasgrid.c:225 msgid "Vertical Grid Lines On Top" msgstr "" #: src/goocanvasgrid.c:226 msgid "If the vertical grid lines are painted above the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:234 msgid "Horizontal Grid Line Color" msgstr "" #: src/goocanvasgrid.c:235 #, fuzzy msgid "The color to use for the horizontal grid lines" msgstr "Color para usar en el perímetro del elemento" #: src/goocanvasgrid.c:241 msgid "Horizontal Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:242 #, fuzzy msgid "" "The color to use for the horizontal grid lines, specified as a 32-bit " "integer value" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasgrid.c:248 msgid "Horizontal Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:249 #, fuzzy msgid "The pixbuf to use to draw the horizontal grid lines" msgstr "Pixbuf que se ha de usar para dibujar el perímetro del elemento" #: src/goocanvasgrid.c:255 msgid "Vertical Grid Line Color" msgstr "" #: src/goocanvasgrid.c:256 #, fuzzy msgid "The color to use for the vertical grid lines" msgstr "Unidades que se han de usar para el lienzo" #: src/goocanvasgrid.c:262 #, fuzzy msgid "Vertical Grid Line Color RGBA" msgstr "RGBA del color de trazo" #: src/goocanvasgrid.c:263 #, fuzzy msgid "" "The color to use for the vertical grid lines, specified as a 32-bit integer " "value" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasgrid.c:269 msgid "Vertical Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:270 #, fuzzy msgid "The pixbuf to use to draw the vertical grid lines" msgstr "Pixbuf que se ha de usar para dibujar el perímetro del elemento" #: src/goocanvasgrid.c:276 #, fuzzy msgid "Border Color" msgstr "Color de trazo" #: src/goocanvasgrid.c:277 #, fuzzy msgid "The color to use for the border" msgstr "Color para usar en el perímetro del elemento" #: src/goocanvasgrid.c:283 #, fuzzy msgid "Border Color RGBA" msgstr "RGBA del color de trazo" #: src/goocanvasgrid.c:284 #, fuzzy msgid "The color to use for the border, specified as a 32-bit integer value" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasgrid.c:290 #, fuzzy msgid "Border Pixbuf" msgstr "Pixbuf de trazado" #: src/goocanvasgrid.c:291 #, fuzzy msgid "The pixbuf to use to draw the border" msgstr "Pixbuf que se ha de usar para dibujar el perímetro del elemento" #: src/goocanvasgroup.c:91 #, fuzzy msgid "The x coordinate of the group" msgstr "Coordenada x de la imagen" #: src/goocanvasgroup.c:99 #, fuzzy msgid "The y coordinate of the group" msgstr "Coordenada y de la imagen" #: src/goocanvasgroup.c:107 #, fuzzy msgid "The width of the group, or -1 to use the default width" msgstr "Ancho solicitado de la tabla, o -1 para usar el ancho predeterminado" #: src/goocanvasgroup.c:115 #, fuzzy msgid "The height of the group, or -1 to use the default height" msgstr "Altura solicitada de la tabla, o -1 para usar la altura predefinida" #: src/goocanvasimage.c:84 msgid "Pattern" msgstr "Patrón" #: src/goocanvasimage.c:85 msgid "The cairo pattern to paint" msgstr "Patrón cairo para dibujar" #: src/goocanvasimage.c:92 msgid "The x coordinate of the image" msgstr "Coordenada x de la imagen" #: src/goocanvasimage.c:100 msgid "The y coordinate of the image" msgstr "Coordenada y de la imagen" #: src/goocanvasimage.c:108 msgid "The width of the image" msgstr "Ancho de la imagen" #: src/goocanvasimage.c:115 msgid "The height of the image" msgstr "Altura de la la imagen" #: src/goocanvasimage.c:121 #, fuzzy msgid "Scale To Fit" msgstr "Escala" #: src/goocanvasimage.c:122 msgid "If the image is scaled to fit the width and height settings" msgstr "" #: src/goocanvasimage.c:128 msgid "Pixbuf" msgstr "Pixbuf" #: src/goocanvasimage.c:129 msgid "The GdkPixbuf to display" msgstr "GdkPixbuf para mostrar" #: src/goocanvasitem.c:461 src/goocanvasitemmodel.c:219 msgid "Parent" msgstr "Padre" #: src/goocanvasitem.c:462 msgid "The parent item" msgstr "Elemento padre" #: src/goocanvasitem.c:468 src/goocanvasitemmodel.c:226 msgid "Visibility" msgstr "Visibilidad" #: src/goocanvasitem.c:469 src/goocanvasitemmodel.c:227 msgid "When the canvas item is visible" msgstr "Si el elemento del lienzo es visible" #: src/goocanvasitem.c:476 src/goocanvasitemmodel.c:234 msgid "Visibility Threshold" msgstr "Umbral de visibilidad" #: src/goocanvasitem.c:477 src/goocanvasitemmodel.c:235 msgid "The scale threshold at which the item becomes visible" msgstr "El umbral de escala a partir del cual el elemento se hace visible" #: src/goocanvasitem.c:485 src/goocanvasitemmodel.c:243 msgid "Transform" msgstr "Transformación" #: src/goocanvasitem.c:486 src/goocanvasitemmodel.c:244 msgid "The transformation matrix of the item" msgstr "Matriz de transformación del elemento" #: src/goocanvasitem.c:492 src/goocanvasitemmodel.c:250 msgid "Pointer Events" msgstr "Eventos de puntero" #: src/goocanvasitem.c:493 src/goocanvasitemmodel.c:251 msgid "Specifies when the item receives pointer events" msgstr "Especifica si el elemento recibe eventos de puntero" #: src/goocanvasitem.c:500 src/goocanvasitemmodel.c:258 msgid "Title" msgstr "Título" #: src/goocanvasitem.c:501 src/goocanvasitemmodel.c:259 msgid "" "A short context-rich description of the item for use by assistive " "technologies" msgstr "" "Descripción del elemento, breve pero indicativa del contexto, para su uso " "por tecnologías de accesibilidad" #: src/goocanvasitem.c:507 src/goocanvasitemmodel.c:265 msgid "Description" msgstr "Descripción" #: src/goocanvasitem.c:508 src/goocanvasitemmodel.c:266 msgid "A description of the item for use by assistive technologies" msgstr "Descripción del elemento para su uso por tecnologías de accesibilidad" #: src/goocanvasitem.c:514 src/goocanvasitemmodel.c:272 msgid "Can Focus" msgstr "Puede recibir el foco" #: src/goocanvasitem.c:515 src/goocanvasitemmodel.c:273 msgid "If the item can take the keyboard focus" msgstr "Si el elemento puede tomar el foco del teclado" #: src/goocanvasitem.c:521 src/goocanvasitemmodel.c:279 msgid "Tooltip" msgstr "" #: src/goocanvasitem.c:522 src/goocanvasitemmodel.c:280 #, fuzzy msgid "The tooltip to display for the item" msgstr "Fila en la que situar el elemento" #: src/goocanvasitemmodel.c:220 msgid "The parent item model" msgstr "Modelo del elemento padre" #: src/goocanvasitemsimple.c:126 msgid "Stroke Pattern" msgstr "Patrón de trazado" #: src/goocanvasitemsimple.c:127 #, fuzzy msgid "" "The pattern to use to paint the perimeter of the item, or NULL disable " "painting" msgstr "El patrón utilizado para dibujar el perímetro del elemento" #: src/goocanvasitemsimple.c:133 msgid "Fill Pattern" msgstr "Patrón de relleno" #: src/goocanvasitemsimple.c:134 #, fuzzy msgid "" "The pattern to use to paint the interior of the item, or NULL to disable " "painting" msgstr "Patrón usado para pintar el interior del elemento" #: src/goocanvasitemsimple.c:140 msgid "Fill Rule" msgstr "Regla de rellenado" #: src/goocanvasitemsimple.c:141 msgid "The fill rule used to determine which parts of the item are filled" msgstr "Regla de rellenado para determinar qué partes del elemento se rellenan" #: src/goocanvasitemsimple.c:148 msgid "Operator" msgstr "Operador" #: src/goocanvasitemsimple.c:149 msgid "The compositing operator to use" msgstr "Operador de composición que se ha de utilizar" #: src/goocanvasitemsimple.c:156 msgid "Antialias" msgstr "Antialias" #: src/goocanvasitemsimple.c:157 msgid "The antialiasing mode to use" msgstr "Modo de antialiasing que se ha de usar" #: src/goocanvasitemsimple.c:165 msgid "Line Width" msgstr "Grosor de línea" #: src/goocanvasitemsimple.c:166 msgid "The line width to use for the item's perimeter" msgstr "Grosor de línea que se ha de usar en el perímetro del elemento" #: src/goocanvasitemsimple.c:172 msgid "Line Cap" msgstr "Remate de línea" #: src/goocanvasitemsimple.c:173 msgid "The line cap style to use" msgstr "Estilo de remate de línea que se ha de usar" #: src/goocanvasitemsimple.c:180 msgid "Line Join" msgstr "Unión de línea" #: src/goocanvasitemsimple.c:181 msgid "The line join style to use" msgstr "Estilo de unión de línea que se ha de usar" #: src/goocanvasitemsimple.c:188 msgid "Miter Limit" msgstr "Límite para unión a inglete" #: src/goocanvasitemsimple.c:189 msgid "" "The smallest angle to use with miter joins, in degrees. Bevel joins will be " "used below this limit" msgstr "" "El ángulo mínimo para usar uniones a inglete, en grados. Se usarán uniones " "biseladas por debajo de este límite" #: src/goocanvasitemsimple.c:195 msgid "Line Dash" msgstr "Rayado de línea" #: src/goocanvasitemsimple.c:196 msgid "The dash pattern to use" msgstr "Patrón de rayas de línea que se ha de usar" #: src/goocanvasitemsimple.c:203 msgid "Font" msgstr "Fuente" #: src/goocanvasitemsimple.c:204 msgid "The base font to use for the text" msgstr "Fuente base del texto" #: src/goocanvasitemsimple.c:210 msgid "Font Description" msgstr "Descripción de la fuente" #: src/goocanvasitemsimple.c:211 msgid "The attributes specifying which font to use" msgstr "Atributos que especifican la fuente que se ha de usar" #: src/goocanvasitemsimple.c:217 msgid "Hint Metrics" msgstr "Métrica de hinting" #: src/goocanvasitemsimple.c:218 msgid "The hinting to be used for font metrics" msgstr "Hinting que se han de usar para la medición de fuentes" #: src/goocanvasitemsimple.c:226 msgid "Stroke Color" msgstr "Color de trazo" #: src/goocanvasitemsimple.c:227 #, fuzzy msgid "" "The color to use for the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasitemsimple.c:233 msgid "Stroke Color RGBA" msgstr "RGBA del color de trazo" #: src/goocanvasitemsimple.c:234 #, fuzzy msgid "" "The color to use for the item's perimeter, specified as a 32-bit integer " "value. To disable painting set the 'stroke-pattern' property to NULL" msgstr "" "Color que se ha de usar para el perímetro del elemento, especificado como un " "entero de 32-bits" #: src/goocanvasitemsimple.c:240 msgid "Stroke Pixbuf" msgstr "Pixbuf de trazado" #: src/goocanvasitemsimple.c:241 msgid "" "The pixbuf to use to draw the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:247 msgid "Fill Color" msgstr "Color de relleno" #: src/goocanvasitemsimple.c:248 #, fuzzy msgid "" "The color to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" "Color que se ha de usar para pintar el interior del elemento, especificado " "como un valor entero de 32-bits" #: src/goocanvasitemsimple.c:254 msgid "Fill Color RGBA" msgstr "RGBA del color de relleno" #: src/goocanvasitemsimple.c:255 #, fuzzy msgid "" "The color to use to paint the interior of the item, specified as a 32-bit " "integer value. To disable painting set the 'fill-pattern' property to NULL" msgstr "" "Color que se ha de usar para pintar el interior del elemento, especificado " "como un valor entero de 32-bits" #: src/goocanvasitemsimple.c:261 msgid "Fill Pixbuf" msgstr "Pixbuf de relleno" #: src/goocanvasitemsimple.c:262 #, fuzzy msgid "" "The pixbuf to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "El pixbuf que se ha de usar para pintar el interior del elemento" #: src/goocanvasitemsimple.c:312 msgid "Clip Path" msgstr "Figura de recorte" #: src/goocanvasitemsimple.c:313 msgid "The sequence of path commands specifying the clip path" msgstr "Secuencia de órdenes de para especificar la figura de recorte" #: src/goocanvasitemsimple.c:319 msgid "Clip Fill Rule" msgstr "Regla de recorte con relleno" #: src/goocanvasitemsimple.c:320 msgid "The fill rule used to determine which parts of the item are clipped" msgstr "Regla de rellenado para determinar qué partes del elemento se recortan" #: src/goocanvaspath.c:70 msgid "Path Data" msgstr "Dato de trazo" #: src/goocanvaspath.c:71 msgid "The sequence of path commands" msgstr "Secuencia de órdenes de trazo" #: src/goocanvaspath.c:78 #, fuzzy msgid "The x coordinate of the path" msgstr "Coordenada x del texto" #: src/goocanvaspath.c:86 #, fuzzy msgid "The y coordinate of the path" msgstr "Coordenada y del texto" #: src/goocanvaspath.c:94 #, fuzzy msgid "The width of the path" msgstr "Ancho de la imagen" #: src/goocanvaspath.c:101 #, fuzzy msgid "The height of the path" msgstr "Altura de la la imagen" #: src/goocanvaspolyline.c:142 msgid "Points" msgstr "Puntos" #: src/goocanvaspolyline.c:143 msgid "The array of points" msgstr "Lista de puntos" #: src/goocanvaspolyline.c:149 msgid "Close Path" msgstr "Cerrar Trazo" #: src/goocanvaspolyline.c:150 msgid "If the last point should be connected to the first" msgstr "Si el último punto se ha de conectar con el primero" #: src/goocanvaspolyline.c:156 msgid "Start Arrow" msgstr "Flecha inicial" #: src/goocanvaspolyline.c:157 msgid "If an arrow should be displayed at the start of the polyline" msgstr "Si se debe mostrar una flecha al principio de la polilínea" #: src/goocanvaspolyline.c:163 msgid "End Arrow" msgstr "Flecha final" #: src/goocanvaspolyline.c:164 msgid "If an arrow should be displayed at the end of the polyline" msgstr "Si se debe mostrar una flecha al final de la polilínea" #: src/goocanvaspolyline.c:170 msgid "Arrow Length" msgstr "Longitud de flecha" #: src/goocanvaspolyline.c:171 msgid "The length of the arrows, as a multiple of the line width" msgstr "Longitud de las flechas, como múltiplo del grosor de línea" #: src/goocanvaspolyline.c:177 msgid "Arrow Width" msgstr "Ancho de flecha" #: src/goocanvaspolyline.c:178 msgid "The width of the arrows, as a multiple of the line width" msgstr "El ancho de las flechas, como múltiplo del grosor de línea" #: src/goocanvaspolyline.c:184 msgid "Arrow Tip Length" msgstr "Longitud de la punta de la flecha" #: src/goocanvaspolyline.c:185 msgid "The length of the arrow tip, as a multiple of the line width" msgstr "" "La longitud de la punta de la flecha, como múltiplo del grosor de línea" #: src/goocanvaspolyline.c:192 #, fuzzy msgid "The x coordinate of the left-most point of the polyline" msgstr "Coordenada x del centro de la elipse" #: src/goocanvaspolyline.c:200 #, fuzzy msgid "The y coordinate of the top-most point of the polyline" msgstr "Coordenada y del centro de la elipse" #: src/goocanvaspolyline.c:208 #, fuzzy msgid "The width of the polyline" msgstr "Ancho de la imagen" #: src/goocanvaspolyline.c:215 #, fuzzy msgid "The height of the polyline" msgstr "Altura de la la imagen" #: src/goocanvasrect.c:61 msgid "The x coordinate of the rectangle" msgstr "Coordenada x del rectángulo" #: src/goocanvasrect.c:69 msgid "The y coordinate of the rectangle" msgstr "Coordenada y del rectángulo" #: src/goocanvasrect.c:77 msgid "The width of the rectangle" msgstr "Ancho del rectángulo" #: src/goocanvasrect.c:84 msgid "The height of the rectangle" msgstr "Altura del rectángulo" #: src/goocanvasrect.c:91 msgid "The horizontal radius to use for rounded corners" msgstr "Radio horizontal para usar en esquinas redondeadas" #: src/goocanvasrect.c:98 msgid "The vertical radius to use for rounded corners" msgstr "Radio vertical para usar en esquinas redondeadas" #: src/goocanvastable.c:237 #, fuzzy msgid "Row Spacing" msgstr "Espacio entre filas" #: src/goocanvastable.c:238 msgid "The default space between rows" msgstr "Espacio predeterminado entre filas" #: src/goocanvastable.c:244 #, fuzzy msgid "Column Spacing" msgstr "Espacio entre columnas" #: src/goocanvastable.c:245 msgid "The default space between columns" msgstr "Espacio predeterminado entre columnas" #: src/goocanvastable.c:251 msgid "Homogenous Rows" msgstr "Filas homogéneas" #: src/goocanvastable.c:252 msgid "If all rows are the same height" msgstr "Si todas las filas poseen la misma altura" #: src/goocanvastable.c:258 msgid "Homogenous Columns" msgstr "Columnas homogéneas" #: src/goocanvastable.c:259 msgid "If all columns are the same width" msgstr "Si todas las columnas poseen el mismo ancho" #: src/goocanvastable.c:264 msgid "X Border Spacing" msgstr "" #: src/goocanvastable.c:265 msgid "" "The amount of spacing between the lefmost and rightmost cells and the border " "grid line" msgstr "" #: src/goocanvastable.c:270 msgid "Y Border Spacing" msgstr "" #: src/goocanvastable.c:271 msgid "" "The amount of spacing between the topmost and bottommost cells and the " "border grid line" msgstr "" #: src/goocanvastable.c:277 #, fuzzy msgid "The width of the grid line to draw between rows" msgstr "Ancho del rectángulo" #: src/goocanvastable.c:284 #, fuzzy msgid "The width of the grid line to draw between columns" msgstr "Espacio predeterminado entre columnas" #: src/goocanvastable.c:293 msgid "Left Padding" msgstr "Margen izquierdo" #: src/goocanvastable.c:294 msgid "Extra space to add to the left of the item" msgstr "Espacio adicional añadido a la izquierda del elemento" #: src/goocanvastable.c:299 msgid "Right Padding" msgstr "Margen derecho" #: src/goocanvastable.c:300 msgid "Extra space to add to the right of the item" msgstr "Espacio adicional añadido a la derecha del elemento" #: src/goocanvastable.c:305 msgid "Top Padding" msgstr "Margen superior" #: src/goocanvastable.c:306 msgid "Extra space to add above the item" msgstr "Espacio adicional añadido sobre el elemento" #: src/goocanvastable.c:311 msgid "Bottom Padding" msgstr "Margen inferior" #: src/goocanvastable.c:312 msgid "Extra space to add below the item" msgstr "Espacio adicional añadido bajo el elemento" #: src/goocanvastable.c:318 msgid "X Align" msgstr "Alineación en X" #: src/goocanvastable.c:319 msgid "" "The horizontal position of the item within its allocated space. 0.0 is left-" "aligned, 1.0 is right-aligned" msgstr "" "Posición horizontal del elemento dentro del espacio que le ha sido asignado. " "0.0 es alineado a la izquierda y 1.0 es alineado a la derecha" #: src/goocanvastable.c:324 msgid "Y Align" msgstr "Alineación Y" #: src/goocanvastable.c:325 msgid "" "The vertical position of the item within its allocated space. 0.0 is top-" "aligned, 1.0 is bottom-aligned" msgstr "" "Posición vertical del elemento dentro del espacio que le ha sido asignado. " "0.0 es alineado a la parte superior y 1.0 es alineado a la parte inferior" #: src/goocanvastable.c:331 msgid "Row" msgstr "Fila" #: src/goocanvastable.c:332 msgid "The row to place the item in" msgstr "Fila en la que situar el elemento" #: src/goocanvastable.c:337 msgid "Column" msgstr "Columna" #: src/goocanvastable.c:338 msgid "The column to place the item in" msgstr "Columna en la que situar el elemento" #: src/goocanvastable.c:343 msgid "Rows" msgstr "Filas" #: src/goocanvastable.c:344 msgid "The number of rows that the item spans" msgstr "Número de filas que abarca el elemento" #: src/goocanvastable.c:349 msgid "Columns" msgstr "Columnas" #: src/goocanvastable.c:350 msgid "The number of columns that the item spans" msgstr "Número de columnas que abarca el elemento" #: src/goocanvastable.c:356 msgid "X Expand" msgstr "Expandir X" #: src/goocanvastable.c:357 msgid "If the item expands horizontally as the table expands" msgstr "Si el elemento se expande horizontalmente al expandirse la tabla" #: src/goocanvastable.c:362 msgid "X Fill" msgstr "Llenar X" #: src/goocanvastable.c:363 msgid "If the item fills all horizontal allocated space" msgstr "Si el elemento rellena todo el espacio horizontal asignado" #: src/goocanvastable.c:368 msgid "X Shrink" msgstr "Disminuir X" #: src/goocanvastable.c:369 msgid "If the item can shrink smaller than its requested size horizontally" msgstr "" "Si el elemento puede reducirse horizontalmente por debajo de su tamaño " "solicitado" #: src/goocanvastable.c:374 msgid "Y Expand" msgstr "Expandir Y" #: src/goocanvastable.c:375 msgid "If the item expands vertically as the table expands" msgstr "Si el elemento se expande verticalmente al expandirse la tabla" #: src/goocanvastable.c:380 msgid "Y Fill" msgstr "Llenar Y" #: src/goocanvastable.c:381 msgid "If the item fills all vertical allocated space" msgstr "Si el elemento rellena todo el espacio vertical asignado" #: src/goocanvastable.c:386 msgid "Y Shrink" msgstr "Disminuir Y" #: src/goocanvastable.c:387 msgid "If the item can shrink smaller than its requested size vertically" msgstr "" "Si el elemento puede reducirse verticalmente por debajo de su tamaño " "solicitado" #: src/goocanvastext.c:94 msgid "Text" msgstr "Texto" #: src/goocanvastext.c:95 msgid "The text to display" msgstr "El texto que se ha de mostrar" #: src/goocanvastext.c:101 msgid "Use Markup" msgstr "Usar marcado" #: src/goocanvastext.c:102 msgid "Whether to parse PangoMarkup in the text, to support different styles" msgstr "" "Si se ha de usar PangoMarkup en el texto, para admitir distintos estilos" #: src/goocanvastext.c:108 msgid "Ellipsize" msgstr "" #: src/goocanvastext.c:109 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "" #: src/goocanvastext.c:116 msgid "Wrap" msgstr "" #: src/goocanvastext.c:117 msgid "The preferred method of wrapping the string if a width has been set" msgstr "" #: src/goocanvastext.c:126 msgid "The x coordinate of the text" msgstr "Coordenada x del texto" #: src/goocanvastext.c:134 msgid "The y coordinate of the text" msgstr "Coordenada y del texto" #: src/goocanvastext.c:142 msgid "The width to use to layout the text" msgstr "Ancho para disponer el texto" #: src/goocanvastext.c:150 #, fuzzy msgid "The height to use to layout the text, or -1 to use the natural height" msgstr "Altura solicitada de la tabla, o -1 para usar la altura predefinida" #: src/goocanvastext.c:159 msgid "How to position the text relative to the given x and y coordinates" msgstr "Cómo situar el texto en relación a las coordenadas x e y dadas" #: src/goocanvastext.c:166 msgid "Alignment" msgstr "Alineación" #: src/goocanvastext.c:167 msgid "How to align the text" msgstr "Cómo alinear el texto" #: src/goocanvaswidget.c:549 msgid "Widget" msgstr "Control" #: src/goocanvaswidget.c:550 msgid "The widget to place in the canvas" msgstr "Control que se ha de colocar en el lienzo" #: src/goocanvaswidget.c:557 msgid "The x coordinate of the widget" msgstr "Coordenada x del control" #: src/goocanvaswidget.c:565 msgid "The y coordinate of the widget" msgstr "Coordenada y del control" #: src/goocanvaswidget.c:573 msgid "The width of the widget, or -1 to use its requested width" msgstr "Ancho del control, o -1 para usar el tamaño que solicite" #: src/goocanvaswidget.c:581 msgid "The height of the widget, or -1 to use its requested height" msgstr "Altura del control, o -1 para usar el tamaño que solicite" #: src/goocanvaswidget.c:590 msgid "" "How to position the widget relative to the item's x and y coordinate settings" msgstr "" "Cómo situar el control en relación a las coordenadas x e y del elemento" #~ msgid "The color to use to paint the interior of the item" #~ msgstr "Color usado para pintar el interior del elemento" goocanvas-0.15/po/en_GB.gmo0000644000076400007640000000053711222156156012452 00000000000000Þ•$,8%9Project-Id-Version: GooCanvas CVS Report-Msgid-Bugs-To: POT-Creation-Date: 2009-06-29 16:23+0100 PO-Revision-Date: 2006-04-24 16:26+0100 Last-Translator: Damon Chaplin Language-Team: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit goocanvas-0.15/po/en_GB.po0000644000076400007640000005633111222156155012310 00000000000000# English (British) translation for GooCanvas # Copyright (C) 2006 Damon Chaplin. # This file is distributed under the same license as the GooCanvas package. # Damon Chaplin , 2006. # msgid "" msgstr "" "Project-Id-Version: GooCanvas CVS\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-29 16:23+0100\n" "PO-Revision-Date: 2006-04-24 16:26+0100\n" "Last-Translator: Damon Chaplin \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/goocanvas.c:284 msgid "Scale" msgstr "" #: src/goocanvas.c:285 msgid "The magnification factor of the canvas" msgstr "" #: src/goocanvas.c:291 msgid "Scale X" msgstr "" #: src/goocanvas.c:292 msgid "The horizontal magnification factor of the canvas" msgstr "" #: src/goocanvas.c:298 msgid "Scale Y" msgstr "" #: src/goocanvas.c:299 msgid "The vertical magnification factor of the canvas" msgstr "" #: src/goocanvas.c:305 src/goocanvastext.c:158 src/goocanvaswidget.c:589 msgid "Anchor" msgstr "" #: src/goocanvas.c:306 msgid "" "Where to place the canvas when it is smaller than the widget's allocated area" msgstr "" #: src/goocanvas.c:313 msgid "X1" msgstr "" #: src/goocanvas.c:314 msgid "The x coordinate of the left edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:321 msgid "Y1" msgstr "" #: src/goocanvas.c:322 msgid "The y coordinate of the top edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:329 msgid "X2" msgstr "" #: src/goocanvas.c:330 msgid "" "The x coordinate of the right edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:338 msgid "Y2" msgstr "" #: src/goocanvas.c:339 msgid "" "The y coordinate of the bottom edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:348 msgid "Automatic Bounds" msgstr "" #: src/goocanvas.c:349 msgid "" "If the bounds are automatically calculated based on the bounds of all the " "items in the canvas" msgstr "" #: src/goocanvas.c:355 msgid "Bounds From Origin" msgstr "" #: src/goocanvas.c:356 msgid "If the automatic bounds are calculated from the origin" msgstr "" #: src/goocanvas.c:362 msgid "Bounds Padding" msgstr "" #: src/goocanvas.c:363 msgid "The padding added to the automatic bounds" msgstr "" #: src/goocanvas.c:369 msgid "Units" msgstr "" #: src/goocanvas.c:370 msgid "The units to use for the canvas" msgstr "" #: src/goocanvas.c:377 msgid "Resolution X" msgstr "" #: src/goocanvas.c:378 msgid "The horizontal resolution of the display, in dots per inch" msgstr "" #: src/goocanvas.c:385 msgid "Resolution Y" msgstr "" #: src/goocanvas.c:386 msgid "The vertical resolution of the display, in dots per inch" msgstr "" #: src/goocanvas.c:394 msgid "Background Color" msgstr "" #: src/goocanvas.c:395 msgid "The color to use for the canvas background" msgstr "" #: src/goocanvas.c:401 msgid "Background Color RGB" msgstr "" #: src/goocanvas.c:402 msgid "" "The color to use for the canvas background, specified as a 24-bit integer " "value, 0xRRGGBB" msgstr "" #: src/goocanvas.c:408 msgid "Integer Layout" msgstr "" #: src/goocanvas.c:409 msgid "If all item layout is done to the nearest integer" msgstr "" #: src/goocanvas.c:415 msgid "Clear Background" msgstr "" #: src/goocanvas.c:416 msgid "If the background is cleared before the canvas is painted" msgstr "" #: src/goocanvas.c:422 msgid "Redraw When Scrolled" msgstr "" #: src/goocanvas.c:423 msgid "" "If the canvas is completely redrawn when scrolled, to reduce the flicker of " "static items" msgstr "" #: src/goocanvasellipse.c:77 msgid "Center X" msgstr "" #: src/goocanvasellipse.c:78 msgid "The x coordinate of the center of the ellipse" msgstr "" #: src/goocanvasellipse.c:85 msgid "Center Y" msgstr "" #: src/goocanvasellipse.c:86 msgid "The y coordinate of the center of the ellipse" msgstr "" #: src/goocanvasellipse.c:93 src/goocanvasrect.c:90 msgid "Radius X" msgstr "" #: src/goocanvasellipse.c:94 msgid "The horizontal radius of the ellipse" msgstr "" #: src/goocanvasellipse.c:100 src/goocanvasrect.c:97 msgid "Radius Y" msgstr "" #: src/goocanvasellipse.c:101 msgid "The vertical radius of the ellipse" msgstr "" #: src/goocanvasellipse.c:108 msgid "The x coordinate of the left side of the ellipse" msgstr "" #: src/goocanvasellipse.c:116 msgid "The y coordinate of the top of the ellipse" msgstr "" #: src/goocanvasellipse.c:123 src/goocanvasgrid.c:124 src/goocanvasgroup.c:106 #: src/goocanvasimage.c:107 src/goocanvaspath.c:93 src/goocanvaspolyline.c:207 #: src/goocanvasrect.c:76 src/goocanvastext.c:141 src/goocanvaswidget.c:572 msgid "Width" msgstr "" #: src/goocanvasellipse.c:124 msgid "The width of the ellipse" msgstr "" #: src/goocanvasellipse.c:130 src/goocanvasgrid.c:131 src/goocanvasgroup.c:114 #: src/goocanvasimage.c:114 src/goocanvaspath.c:100 #: src/goocanvaspolyline.c:214 src/goocanvasrect.c:83 src/goocanvastext.c:149 #: src/goocanvaswidget.c:580 msgid "Height" msgstr "" #: src/goocanvasellipse.c:131 msgid "The height of the ellipse" msgstr "" #: src/goocanvasgrid.c:109 msgid "The x coordinate of the grid" msgstr "" #: src/goocanvasgrid.c:117 msgid "The y coordinate of the grid" msgstr "" #: src/goocanvasgrid.c:125 msgid "The width of the grid" msgstr "" #: src/goocanvasgrid.c:132 msgid "The height of the grid" msgstr "" #: src/goocanvasgrid.c:139 msgid "The distance between the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:146 msgid "The distance between the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:153 msgid "The distance before the first vertical grid line" msgstr "" #: src/goocanvasgrid.c:160 msgid "The distance before the first horizontal grid line" msgstr "" #: src/goocanvasgrid.c:166 src/goocanvastable.c:276 msgid "Horizontal Grid Line Width" msgstr "" #: src/goocanvasgrid.c:167 msgid "The width of the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:174 src/goocanvastable.c:283 msgid "Vertical Grid Line Width" msgstr "" #: src/goocanvasgrid.c:175 msgid "The width of the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:182 msgid "Horizontal Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:183 msgid "The cairo pattern to paint the horizontal grid lines with" msgstr "" #: src/goocanvasgrid.c:189 msgid "Vertical Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:190 msgid "The cairo pattern to paint the vertical grid lines with" msgstr "" #: src/goocanvasgrid.c:196 msgid "Border Width" msgstr "" #: src/goocanvasgrid.c:197 msgid "The width of the border around the grid" msgstr "" #: src/goocanvasgrid.c:204 msgid "Border Pattern" msgstr "" #: src/goocanvasgrid.c:205 msgid "The cairo pattern to paint the border with" msgstr "" #: src/goocanvasgrid.c:211 msgid "Show Horizontal Grid Lines" msgstr "" #: src/goocanvasgrid.c:212 msgid "If the horizontal grid lines are shown" msgstr "" #: src/goocanvasgrid.c:218 msgid "Show Vertical Grid Lines" msgstr "" #: src/goocanvasgrid.c:219 msgid "If the vertical grid lines are shown" msgstr "" #: src/goocanvasgrid.c:225 msgid "Vertical Grid Lines On Top" msgstr "" #: src/goocanvasgrid.c:226 msgid "If the vertical grid lines are painted above the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:234 msgid "Horizontal Grid Line Color" msgstr "" #: src/goocanvasgrid.c:235 msgid "The color to use for the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:241 msgid "Horizontal Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:242 msgid "" "The color to use for the horizontal grid lines, specified as a 32-bit " "integer value" msgstr "" #: src/goocanvasgrid.c:248 msgid "Horizontal Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:249 msgid "The pixbuf to use to draw the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:255 msgid "Vertical Grid Line Color" msgstr "" #: src/goocanvasgrid.c:256 msgid "The color to use for the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:262 msgid "Vertical Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:263 msgid "" "The color to use for the vertical grid lines, specified as a 32-bit integer " "value" msgstr "" #: src/goocanvasgrid.c:269 msgid "Vertical Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:270 msgid "The pixbuf to use to draw the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:276 msgid "Border Color" msgstr "" #: src/goocanvasgrid.c:277 msgid "The color to use for the border" msgstr "" #: src/goocanvasgrid.c:283 msgid "Border Color RGBA" msgstr "" #: src/goocanvasgrid.c:284 msgid "The color to use for the border, specified as a 32-bit integer value" msgstr "" #: src/goocanvasgrid.c:290 msgid "Border Pixbuf" msgstr "" #: src/goocanvasgrid.c:291 msgid "The pixbuf to use to draw the border" msgstr "" #: src/goocanvasgroup.c:91 msgid "The x coordinate of the group" msgstr "" #: src/goocanvasgroup.c:99 msgid "The y coordinate of the group" msgstr "" #: src/goocanvasgroup.c:107 msgid "The width of the group, or -1 to use the default width" msgstr "" #: src/goocanvasgroup.c:115 msgid "The height of the group, or -1 to use the default height" msgstr "" #: src/goocanvasimage.c:84 msgid "Pattern" msgstr "" #: src/goocanvasimage.c:85 msgid "The cairo pattern to paint" msgstr "" #: src/goocanvasimage.c:92 msgid "The x coordinate of the image" msgstr "" #: src/goocanvasimage.c:100 msgid "The y coordinate of the image" msgstr "" #: src/goocanvasimage.c:108 msgid "The width of the image" msgstr "" #: src/goocanvasimage.c:115 msgid "The height of the image" msgstr "" #: src/goocanvasimage.c:121 msgid "Scale To Fit" msgstr "" #: src/goocanvasimage.c:122 msgid "If the image is scaled to fit the width and height settings" msgstr "" #: src/goocanvasimage.c:128 msgid "Pixbuf" msgstr "" #: src/goocanvasimage.c:129 msgid "The GdkPixbuf to display" msgstr "" #: src/goocanvasitem.c:461 src/goocanvasitemmodel.c:219 msgid "Parent" msgstr "" #: src/goocanvasitem.c:462 msgid "The parent item" msgstr "" #: src/goocanvasitem.c:468 src/goocanvasitemmodel.c:226 msgid "Visibility" msgstr "" #: src/goocanvasitem.c:469 src/goocanvasitemmodel.c:227 msgid "When the canvas item is visible" msgstr "" #: src/goocanvasitem.c:476 src/goocanvasitemmodel.c:234 msgid "Visibility Threshold" msgstr "" #: src/goocanvasitem.c:477 src/goocanvasitemmodel.c:235 msgid "The scale threshold at which the item becomes visible" msgstr "" #: src/goocanvasitem.c:485 src/goocanvasitemmodel.c:243 msgid "Transform" msgstr "" #: src/goocanvasitem.c:486 src/goocanvasitemmodel.c:244 msgid "The transformation matrix of the item" msgstr "" #: src/goocanvasitem.c:492 src/goocanvasitemmodel.c:250 msgid "Pointer Events" msgstr "" #: src/goocanvasitem.c:493 src/goocanvasitemmodel.c:251 msgid "Specifies when the item receives pointer events" msgstr "" #: src/goocanvasitem.c:500 src/goocanvasitemmodel.c:258 msgid "Title" msgstr "" #: src/goocanvasitem.c:501 src/goocanvasitemmodel.c:259 msgid "" "A short context-rich description of the item for use by assistive " "technologies" msgstr "" #: src/goocanvasitem.c:507 src/goocanvasitemmodel.c:265 msgid "Description" msgstr "" #: src/goocanvasitem.c:508 src/goocanvasitemmodel.c:266 msgid "A description of the item for use by assistive technologies" msgstr "" #: src/goocanvasitem.c:514 src/goocanvasitemmodel.c:272 msgid "Can Focus" msgstr "" #: src/goocanvasitem.c:515 src/goocanvasitemmodel.c:273 msgid "If the item can take the keyboard focus" msgstr "" #: src/goocanvasitem.c:521 src/goocanvasitemmodel.c:279 msgid "Tooltip" msgstr "" #: src/goocanvasitem.c:522 src/goocanvasitemmodel.c:280 msgid "The tooltip to display for the item" msgstr "" #: src/goocanvasitemmodel.c:220 msgid "The parent item model" msgstr "" #: src/goocanvasitemsimple.c:126 msgid "Stroke Pattern" msgstr "" #: src/goocanvasitemsimple.c:127 msgid "" "The pattern to use to paint the perimeter of the item, or NULL disable " "painting" msgstr "" #: src/goocanvasitemsimple.c:133 msgid "Fill Pattern" msgstr "" #: src/goocanvasitemsimple.c:134 msgid "" "The pattern to use to paint the interior of the item, or NULL to disable " "painting" msgstr "" #: src/goocanvasitemsimple.c:140 msgid "Fill Rule" msgstr "" #: src/goocanvasitemsimple.c:141 msgid "The fill rule used to determine which parts of the item are filled" msgstr "" #: src/goocanvasitemsimple.c:148 msgid "Operator" msgstr "" #: src/goocanvasitemsimple.c:149 msgid "The compositing operator to use" msgstr "" #: src/goocanvasitemsimple.c:156 msgid "Antialias" msgstr "" #: src/goocanvasitemsimple.c:157 msgid "The antialiasing mode to use" msgstr "" #: src/goocanvasitemsimple.c:165 msgid "Line Width" msgstr "" #: src/goocanvasitemsimple.c:166 msgid "The line width to use for the item's perimeter" msgstr "" #: src/goocanvasitemsimple.c:172 msgid "Line Cap" msgstr "" #: src/goocanvasitemsimple.c:173 msgid "The line cap style to use" msgstr "" #: src/goocanvasitemsimple.c:180 msgid "Line Join" msgstr "" #: src/goocanvasitemsimple.c:181 msgid "The line join style to use" msgstr "" #: src/goocanvasitemsimple.c:188 msgid "Miter Limit" msgstr "" #: src/goocanvasitemsimple.c:189 msgid "" "The smallest angle to use with miter joins, in degrees. Bevel joins will be " "used below this limit" msgstr "" #: src/goocanvasitemsimple.c:195 msgid "Line Dash" msgstr "" #: src/goocanvasitemsimple.c:196 msgid "The dash pattern to use" msgstr "" #: src/goocanvasitemsimple.c:203 msgid "Font" msgstr "" #: src/goocanvasitemsimple.c:204 msgid "The base font to use for the text" msgstr "" #: src/goocanvasitemsimple.c:210 msgid "Font Description" msgstr "" #: src/goocanvasitemsimple.c:211 msgid "The attributes specifying which font to use" msgstr "" #: src/goocanvasitemsimple.c:217 msgid "Hint Metrics" msgstr "" #: src/goocanvasitemsimple.c:218 msgid "The hinting to be used for font metrics" msgstr "" #: src/goocanvasitemsimple.c:226 msgid "Stroke Color" msgstr "" #: src/goocanvasitemsimple.c:227 msgid "" "The color to use for the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:233 msgid "Stroke Color RGBA" msgstr "" #: src/goocanvasitemsimple.c:234 msgid "" "The color to use for the item's perimeter, specified as a 32-bit integer " "value. To disable painting set the 'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:240 msgid "Stroke Pixbuf" msgstr "" #: src/goocanvasitemsimple.c:241 msgid "" "The pixbuf to use to draw the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:247 msgid "Fill Color" msgstr "" #: src/goocanvasitemsimple.c:248 msgid "" "The color to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:254 msgid "Fill Color RGBA" msgstr "" #: src/goocanvasitemsimple.c:255 msgid "" "The color to use to paint the interior of the item, specified as a 32-bit " "integer value. To disable painting set the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:261 msgid "Fill Pixbuf" msgstr "" #: src/goocanvasitemsimple.c:262 msgid "" "The pixbuf to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:312 msgid "Clip Path" msgstr "" #: src/goocanvasitemsimple.c:313 msgid "The sequence of path commands specifying the clip path" msgstr "" #: src/goocanvasitemsimple.c:319 msgid "Clip Fill Rule" msgstr "" #: src/goocanvasitemsimple.c:320 msgid "The fill rule used to determine which parts of the item are clipped" msgstr "" #: src/goocanvaspath.c:70 msgid "Path Data" msgstr "" #: src/goocanvaspath.c:71 msgid "The sequence of path commands" msgstr "" #: src/goocanvaspath.c:78 msgid "The x coordinate of the path" msgstr "" #: src/goocanvaspath.c:86 msgid "The y coordinate of the path" msgstr "" #: src/goocanvaspath.c:94 msgid "The width of the path" msgstr "" #: src/goocanvaspath.c:101 msgid "The height of the path" msgstr "" #: src/goocanvaspolyline.c:142 msgid "Points" msgstr "" #: src/goocanvaspolyline.c:143 msgid "The array of points" msgstr "" #: src/goocanvaspolyline.c:149 msgid "Close Path" msgstr "" #: src/goocanvaspolyline.c:150 msgid "If the last point should be connected to the first" msgstr "" #: src/goocanvaspolyline.c:156 msgid "Start Arrow" msgstr "" #: src/goocanvaspolyline.c:157 msgid "If an arrow should be displayed at the start of the polyline" msgstr "" #: src/goocanvaspolyline.c:163 msgid "End Arrow" msgstr "" #: src/goocanvaspolyline.c:164 msgid "If an arrow should be displayed at the end of the polyline" msgstr "" #: src/goocanvaspolyline.c:170 msgid "Arrow Length" msgstr "" #: src/goocanvaspolyline.c:171 msgid "The length of the arrows, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:177 msgid "Arrow Width" msgstr "" #: src/goocanvaspolyline.c:178 msgid "The width of the arrows, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:184 msgid "Arrow Tip Length" msgstr "" #: src/goocanvaspolyline.c:185 msgid "The length of the arrow tip, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:192 msgid "The x coordinate of the left-most point of the polyline" msgstr "" #: src/goocanvaspolyline.c:200 msgid "The y coordinate of the top-most point of the polyline" msgstr "" #: src/goocanvaspolyline.c:208 msgid "The width of the polyline" msgstr "" #: src/goocanvaspolyline.c:215 msgid "The height of the polyline" msgstr "" #: src/goocanvasrect.c:61 msgid "The x coordinate of the rectangle" msgstr "" #: src/goocanvasrect.c:69 msgid "The y coordinate of the rectangle" msgstr "" #: src/goocanvasrect.c:77 msgid "The width of the rectangle" msgstr "" #: src/goocanvasrect.c:84 msgid "The height of the rectangle" msgstr "" #: src/goocanvasrect.c:91 msgid "The horizontal radius to use for rounded corners" msgstr "" #: src/goocanvasrect.c:98 msgid "The vertical radius to use for rounded corners" msgstr "" #: src/goocanvastable.c:237 msgid "Row Spacing" msgstr "" #: src/goocanvastable.c:238 msgid "The default space between rows" msgstr "" #: src/goocanvastable.c:244 msgid "Column Spacing" msgstr "" #: src/goocanvastable.c:245 msgid "The default space between columns" msgstr "" #: src/goocanvastable.c:251 msgid "Homogenous Rows" msgstr "" #: src/goocanvastable.c:252 msgid "If all rows are the same height" msgstr "" #: src/goocanvastable.c:258 msgid "Homogenous Columns" msgstr "" #: src/goocanvastable.c:259 msgid "If all columns are the same width" msgstr "" #: src/goocanvastable.c:264 msgid "X Border Spacing" msgstr "" #: src/goocanvastable.c:265 msgid "" "The amount of spacing between the lefmost and rightmost cells and the border " "grid line" msgstr "" #: src/goocanvastable.c:270 msgid "Y Border Spacing" msgstr "" #: src/goocanvastable.c:271 msgid "" "The amount of spacing between the topmost and bottommost cells and the " "border grid line" msgstr "" #: src/goocanvastable.c:277 msgid "The width of the grid line to draw between rows" msgstr "" #: src/goocanvastable.c:284 msgid "The width of the grid line to draw between columns" msgstr "" #: src/goocanvastable.c:293 msgid "Left Padding" msgstr "" #: src/goocanvastable.c:294 msgid "Extra space to add to the left of the item" msgstr "" #: src/goocanvastable.c:299 msgid "Right Padding" msgstr "" #: src/goocanvastable.c:300 msgid "Extra space to add to the right of the item" msgstr "" #: src/goocanvastable.c:305 msgid "Top Padding" msgstr "" #: src/goocanvastable.c:306 msgid "Extra space to add above the item" msgstr "" #: src/goocanvastable.c:311 msgid "Bottom Padding" msgstr "" #: src/goocanvastable.c:312 msgid "Extra space to add below the item" msgstr "" #: src/goocanvastable.c:318 msgid "X Align" msgstr "" #: src/goocanvastable.c:319 msgid "" "The horizontal position of the item within its allocated space. 0.0 is left-" "aligned, 1.0 is right-aligned" msgstr "" #: src/goocanvastable.c:324 msgid "Y Align" msgstr "" #: src/goocanvastable.c:325 msgid "" "The vertical position of the item within its allocated space. 0.0 is top-" "aligned, 1.0 is bottom-aligned" msgstr "" #: src/goocanvastable.c:331 msgid "Row" msgstr "" #: src/goocanvastable.c:332 msgid "The row to place the item in" msgstr "" #: src/goocanvastable.c:337 msgid "Column" msgstr "" #: src/goocanvastable.c:338 msgid "The column to place the item in" msgstr "" #: src/goocanvastable.c:343 msgid "Rows" msgstr "" #: src/goocanvastable.c:344 msgid "The number of rows that the item spans" msgstr "" #: src/goocanvastable.c:349 msgid "Columns" msgstr "" #: src/goocanvastable.c:350 msgid "The number of columns that the item spans" msgstr "" #: src/goocanvastable.c:356 msgid "X Expand" msgstr "" #: src/goocanvastable.c:357 msgid "If the item expands horizontally as the table expands" msgstr "" #: src/goocanvastable.c:362 msgid "X Fill" msgstr "" #: src/goocanvastable.c:363 msgid "If the item fills all horizontal allocated space" msgstr "" #: src/goocanvastable.c:368 msgid "X Shrink" msgstr "" #: src/goocanvastable.c:369 msgid "If the item can shrink smaller than its requested size horizontally" msgstr "" #: src/goocanvastable.c:374 msgid "Y Expand" msgstr "" #: src/goocanvastable.c:375 msgid "If the item expands vertically as the table expands" msgstr "" #: src/goocanvastable.c:380 msgid "Y Fill" msgstr "" #: src/goocanvastable.c:381 msgid "If the item fills all vertical allocated space" msgstr "" #: src/goocanvastable.c:386 msgid "Y Shrink" msgstr "" #: src/goocanvastable.c:387 msgid "If the item can shrink smaller than its requested size vertically" msgstr "" #: src/goocanvastext.c:94 msgid "Text" msgstr "" #: src/goocanvastext.c:95 msgid "The text to display" msgstr "" #: src/goocanvastext.c:101 msgid "Use Markup" msgstr "" #: src/goocanvastext.c:102 msgid "Whether to parse PangoMarkup in the text, to support different styles" msgstr "" #: src/goocanvastext.c:108 msgid "Ellipsize" msgstr "" #: src/goocanvastext.c:109 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "" #: src/goocanvastext.c:116 msgid "Wrap" msgstr "" #: src/goocanvastext.c:117 msgid "The preferred method of wrapping the string if a width has been set" msgstr "" #: src/goocanvastext.c:126 msgid "The x coordinate of the text" msgstr "" #: src/goocanvastext.c:134 msgid "The y coordinate of the text" msgstr "" #: src/goocanvastext.c:142 msgid "The width to use to layout the text" msgstr "" #: src/goocanvastext.c:150 msgid "The height to use to layout the text, or -1 to use the natural height" msgstr "" #: src/goocanvastext.c:159 msgid "How to position the text relative to the given x and y coordinates" msgstr "" #: src/goocanvastext.c:166 msgid "Alignment" msgstr "" #: src/goocanvastext.c:167 msgid "How to align the text" msgstr "" #: src/goocanvaswidget.c:549 msgid "Widget" msgstr "" #: src/goocanvaswidget.c:550 msgid "The widget to place in the canvas" msgstr "" #: src/goocanvaswidget.c:557 msgid "The x coordinate of the widget" msgstr "" #: src/goocanvaswidget.c:565 msgid "The y coordinate of the widget" msgstr "" #: src/goocanvaswidget.c:573 msgid "The width of the widget, or -1 to use its requested width" msgstr "" #: src/goocanvaswidget.c:581 msgid "The height of the widget, or -1 to use its requested height" msgstr "" #: src/goocanvaswidget.c:590 msgid "" "How to position the widget relative to the item's x and y coordinate settings" msgstr "" goocanvas-0.15/po/es.gmo0000644000076400007640000003345611222156156012115 00000000000000Þ•¥Dßl è ;é N% t~ … œ ­¹ ÈÒÛä ó ý  #!-!O*q+œ ÈÓ ã ð ü  #0CSBiM¬!ú:<<wC´Aø':5b3˜0Ì.ý2, _l u  ‰ ” © °ºÂÉØßè ñ þ "/( X dqƒ ’ ¥¾Û+ï!=Xx˜!°ÒCñB5x;¬'èi$z0Ÿ:Ð< 9H‚œ.·&æ) &7^n„5¡×6õa,Ž%¢Ègè"P.s8¢!Û8ý6M9h#¢-ÆôG!ZH|ÅâI-Ky!—¹FÖ< B NX ^ it‰M©E÷= D J R [ b k n q y ‚ ‰ ’ • -˜ GÆ!l" {"‡" "—"!ª"Ì"Ü"ì"# ##1# C#P#X# a# n#,{#+¨#6Ô#4 $@$Q$k$~$$£$ª$Ä$É$Ý$ò$%@%I\%+¦%)Ò%7ü%;4&Rp&PÃ&.'@C'>„':Ã'8þ'47(l(}(Ž(Ÿ(°(Á(ß(è( î(ü() ))%)-) 5) C)Q)`)e)k)3r)¦)µ)Ä)Ü)ï)**&*E*5U*‹*¡*$¼*.á*,+%=+"c+G†+GÎ+,-,:D,7,‹·,C-2a-<”-IÑ-<.,X.,….@². ó.*/'?/g/v/!/A²/ô/>0rR0Å0&ã0* 1•51Ë10ç1:2)S2<}2º2Í29ã23$:3_3Sy3Í3Qê3<4S4Rl4$¿4ä4þ45R25…5ž5¦5¶5Æ5 Ï5 Ü5è5$þ5H#6Hl6µ6½6Ã6 Ô6ß6 è6ô6÷6 ú6 77 7(7+7NDeˆj}v*\™Š_[$Ÿ‹ ;4€f†#I6d|¡˜z’ŒSlG0) yZg%‘ T!'PC8mO¢›w&RsXaWŽV.žKu?={p3^”¤+bFEQ –"2L(“ƒt•rš: i/c—ox…q ‡]œ-‚h„J`<7k~@59M1A‰U¥n£B>Y,HA description of the item for use by assistive technologiesA short context-rich description of the item for use by assistive technologiesAlignmentAnchorAntialiasArrow LengthArrow Tip LengthArrow WidthBottom PaddingCan FocusCenter XCenter YClip Fill RuleClip PathClose PathColumnColumnsDescriptionEnd ArrowExtra space to add above the itemExtra space to add below the itemExtra space to add to the left of the itemExtra space to add to the right of the itemFill ColorFill Color RGBAFill PatternFill PixbufFill RuleFontFont DescriptionHeightHint MetricsHomogenous ColumnsHomogenous RowsHow to align the textHow to position the text relative to the given x and y coordinatesHow to position the widget relative to the item's x and y coordinate settingsIf all columns are the same widthIf all rows are the same heightIf an arrow should be displayed at the end of the polylineIf an arrow should be displayed at the start of the polylineIf the item can shrink smaller than its requested size horizontallyIf the item can shrink smaller than its requested size verticallyIf the item can take the keyboard focusIf the item expands horizontally as the table expandsIf the item expands vertically as the table expandsIf the item fills all horizontal allocated spaceIf the item fills all vertical allocated spaceIf the last point should be connected to the firstLeft PaddingLine CapLine DashLine JoinLine WidthMiter LimitOperatorParentPath DataPatternPixbufPointer EventsPointsRadius XRadius YResolution XResolution YRight PaddingRowRowsScaleSpecifies when the item receives pointer eventsStart ArrowStroke ColorStroke Color RGBAStroke PatternStroke PixbufTextThe GdkPixbuf to displayThe antialiasing mode to useThe array of pointsThe attributes specifying which font to useThe base font to use for the textThe cairo pattern to paintThe column to place the item inThe compositing operator to useThe dash pattern to useThe default space between columnsThe default space between rowsThe fill rule used to determine which parts of the item are clippedThe fill rule used to determine which parts of the item are filledThe height of the imageThe height of the rectangleThe height of the widget, or -1 to use its requested heightThe hinting to be used for font metricsThe horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-alignedThe horizontal radius of the ellipseThe horizontal radius to use for rounded cornersThe horizontal resolution of the display, in dots per inchThe length of the arrow tip, as a multiple of the line widthThe length of the arrows, as a multiple of the line widthThe line cap style to useThe line join style to useThe line width to use for the item's perimeterThe magnification factor of the canvasThe number of columns that the item spansThe number of rows that the item spansThe parent itemThe parent item modelThe row to place the item inThe scale threshold at which the item becomes visibleThe sequence of path commandsThe sequence of path commands specifying the clip pathThe smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limitThe text to displayThe transformation matrix of the itemThe units to use for the canvasThe vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-alignedThe vertical radius of the ellipseThe vertical radius to use for rounded cornersThe vertical resolution of the display, in dots per inchThe widget to place in the canvasThe width of the arrows, as a multiple of the line widthThe width of the imageThe width of the rectangleThe width of the widget, or -1 to use its requested widthThe width to use to layout the textThe x coordinate of the center of the ellipseThe x coordinate of the imageThe x coordinate of the left edge of the canvas bounds, in canvas unitsThe x coordinate of the rectangleThe x coordinate of the right edge of the canvas bounds, in canvas unitsThe x coordinate of the textThe x coordinate of the widgetThe y coordinate of the bottom edge of the canvas bounds, in canvas unitsThe y coordinate of the center of the ellipseThe y coordinate of the imageThe y coordinate of the rectangleThe y coordinate of the textThe y coordinate of the top edge of the canvas bounds, in canvas unitsThe y coordinate of the widgetTitleTop PaddingTransformUnitsUse MarkupVisibilityVisibility ThresholdWhen the canvas item is visibleWhere to place the canvas when it is smaller than the widget's allocated areaWhether to parse PangoMarkup in the text, to support different stylesWidgetWidthX AlignX ExpandX FillX ShrinkX1X2Y AlignY ExpandY FillY ShrinkY1Y2Project-Id-Version: GooCanvas CVS Report-Msgid-Bugs-To: POT-Creation-Date: 2009-06-29 16:23+0100 PO-Revision-Date: 2006-04-24 16:26+0100 Last-Translator: Rafael Villar Burke Language-Team: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Descripción del elemento para su uso por tecnologías de accesibilidadDescripción del elemento, breve pero indicativa del contexto, para su uso por tecnologías de accesibilidadAlineaciónAnclaAntialiasLongitud de flechaLongitud de la punta de la flechaAncho de flechaMargen inferiorPuede recibir el focoCentro XCentro YRegla de recorte con rellenoFigura de recorteCerrar TrazoColumnaColumnasDescripciónFlecha finalEspacio adicional añadido sobre el elementoEspacio adicional añadido bajo el elementoEspacio adicional añadido a la izquierda del elementoEspacio adicional añadido a la derecha del elementoColor de rellenoRGBA del color de rellenoPatrón de rellenoPixbuf de rellenoRegla de rellenadoFuenteDescripción de la fuenteAltoMétrica de hintingColumnas homogéneasFilas homogéneasCómo alinear el textoCómo situar el texto en relación a las coordenadas x e y dadasCómo situar el control en relación a las coordenadas x e y del elementoSi todas las columnas poseen el mismo anchoSi todas las filas poseen la misma alturaSi se debe mostrar una flecha al final de la polilíneaSi se debe mostrar una flecha al principio de la polilíneaSi el elemento puede reducirse horizontalmente por debajo de su tamaño solicitadoSi el elemento puede reducirse verticalmente por debajo de su tamaño solicitadoSi el elemento puede tomar el foco del tecladoSi el elemento se expande horizontalmente al expandirse la tablaSi el elemento se expande verticalmente al expandirse la tablaSi el elemento rellena todo el espacio horizontal asignadoSi el elemento rellena todo el espacio vertical asignadoSi el último punto se ha de conectar con el primeroMargen izquierdoRemate de líneaRayado de líneaUnión de líneaGrosor de líneaLímite para unión a ingleteOperadorPadreDato de trazoPatrónPixbufEventos de punteroPuntosRadio XRadio YResolución XResolución YMargen derechoFilaFilasEscalaEspecifica si el elemento recibe eventos de punteroFlecha inicialColor de trazoRGBA del color de trazoPatrón de trazadoPixbuf de trazadoTextoGdkPixbuf para mostrarModo de antialiasing que se ha de usarLista de puntosAtributos que especifican la fuente que se ha de usarFuente base del textoPatrón cairo para dibujarColumna en la que situar el elementoOperador de composición que se ha de utilizarPatrón de rayas de línea que se ha de usarEspacio predeterminado entre columnasEspacio predeterminado entre filasRegla de rellenado para determinar qué partes del elemento se recortanRegla de rellenado para determinar qué partes del elemento se rellenanAltura de la la imagenAltura del rectánguloAltura del control, o -1 para usar el tamaño que soliciteHinting que se han de usar para la medición de fuentesPosición horizontal del elemento dentro del espacio que le ha sido asignado. 0.0 es alineado a la izquierda y 1.0 es alineado a la derechaRadio horizontal de la elipseRadio horizontal para usar en esquinas redondeadasResolución horizontal de la pantalla, en puntos por pulgadaLa longitud de la punta de la flecha, como múltiplo del grosor de líneaLongitud de las flechas, como múltiplo del grosor de líneaEstilo de remate de línea que se ha de usarEstilo de unión de línea que se ha de usarGrosor de línea que se ha de usar en el perímetro del elementoFactor de ampliación del lienzoNúmero de columnas que abarca el elementoNúmero de filas que abarca el elementoElemento padreModelo del elemento padreFila en la que situar el elementoEl umbral de escala a partir del cual el elemento se hace visibleSecuencia de órdenes de trazoSecuencia de órdenes de para especificar la figura de recorteEl ángulo mínimo para usar uniones a inglete, en grados. Se usarán uniones biseladas por debajo de este límiteEl texto que se ha de mostrarMatriz de transformación del elementoUnidades que se han de usar para el lienzoPosición vertical del elemento dentro del espacio que le ha sido asignado. 0.0 es alineado a la parte superior y 1.0 es alineado a la parte inferiorRadio vertical de la elipseRadio vertical para usar en esquinas redondeadasResolución vertical de la pantalla, en puntos por pulgadaControl que se ha de colocar en el lienzoEl ancho de las flechas, como múltiplo del grosor de líneaAncho de la imagenAncho del rectánguloAncho del control, o -1 para usar el tamaño que soliciteAncho para disponer el textoCoordenada x del centro de la elipseCoordenada x de la imagenCoordenada x del borde izquierdo de los límites del lienzo, en unidades del lienzoCoordenada x del rectánguloCoordenada x del borde derecho de los límites del lienzo, en unidades del lienzoCoordenada x del textoCoordenada x del controlCoordenada y del borde inferior de los límites del lienzo, en unidades del lienzoCoordenada y del centro de la elipseCoordenada y de la imagenCoordenada y del rectánguloCoordenada y del textoCoordenada y del borde superior de los límites del lienzo, en unidades del lienzoCoordenada y del controlTítuloMargen superiorTransformaciónUnidadesUsar marcadoVisibilidadUmbral de visibilidadSi el elemento del lienzo es visibleDónde situar el lienzo cuando es menor que el área asignada al controlSi se ha de usar PangoMarkup en el texto, para admitir distintos estilosControlAnchoAlineación en XExpandir XLlenar XDisminuir XX1X2Alineación YExpandir YLlenar YDisminuir YY1Y2goocanvas-0.15/po/ja.gmo0000644000076400007640000004604311222156156012074 00000000000000Þ•Í„ì @;AN} ÌÖ Ý çô "3HWj yƒŒ•¦ µ ¿ÊÑà è ô þ!!**L+w £® ¾ Ë ×áæ÷ þ .IB_M¢!ð1D:d<Ÿ6Ü9]MC«Aï'15Y30Ã.ô2#V er { …  𦝠¶ÀÈÏÞåî ÷   #/4:B/J z †“¥ ´ÂÇVàW7¬+À!ì*)YT®h<”¥o:ªÊê!$CCB‡Êâ;þ':1bi”$þ0# :T < 9Ì ! !.;!&j!)‘!&»!)â! ""Q2"O„"mÔ"pB#C³#p÷#h$5…$»$6Ù$a%r%%†%¬%/Ì%gü%"d&.‡&8¶&!ï&8'2J'/}'­'Ä'9ß'#(-=(k(G‰(!Ñ(Hó(<)Y)Ix)-Â)ð)!*0*FM*”*³* ¹* Å*Ï* Õ*à* ù*++M9+E‡+Í+Ô+Ú+ß+ç+ø+,,,,,,0,9,@,I,L,LO,œ--µ-ã- ê-÷-. . 9.F. Y.c.y..«.Ç.Ý.ð. /$/5/K/^/b/r/y/€/ ‡/0”/0Å/0ö/0'0X0%n0”0³0Ì0 â0ï01 1 "1 /1<1-[1S‰1aÝ1-?2Bm20°26á2633O3Eƒ3oÉ3Z94Z”4Kï4K;5K‡59Ó59 69G6 6Ž6 ¤6±6 È6Õ6Ü6ò6ù6ý6 77!7:7>7Q7d7y7Ž7¤7¨7¸7 ¿7Ì7ã7Nú7 I8V8%o8•8´8 Ð8Ý8Bó8B69-y9 §9-´9'â9+ :6:KR:”ž:n3;­¢;‡P<Ø<ñ<, =$7=$\=`=]â=@>P>gc>-Ë>*ù>S$?x?—?4³?*è?!@'5@']@'…@­@É@å@3A5AEAa^AjÀA†+BвBQ=CZCêC<D@DB_Du¢DE1EME*lEY—EñEF4-F3bF–FµFÎF çFôFaG3fGšG¶GEÉGHE#HiH‚HE¡HçHII*IECI‰I ¨IµIËIÒIÙIõI JJ07JchJbÌJ/KBK FKSKeKK‘K£KµK¸K»KÍKçKùK LL L“8k½„žÍ-œ­¹t\u›ÂH(ŠŽ`iKw¢´©4Xƒ² 2+ɘ!o” €Z¦ÀcaLsÄlRV=}qN)¸Ÿ‘Á { /™@O>³U.‰—Y®r$&mJˆCb3 °6ªÊE¤‚–j5%¥WƬgpšz7¡‡S¯‹9…†Aź~Ìx^¶Ã¾d»DvT];<F ÈŒ|[_«¨Çh1 •¿§e0’f,*GB"nP'˵I¼#:My±?·£QA description of the item for use by assistive technologiesA short context-rich description of the item for use by assistive technologiesAlignmentAnchorAntialiasArrow LengthArrow Tip LengthArrow WidthAutomatic BoundsBackground ColorBackground Color RGBBottom PaddingBounds From OriginBounds PaddingCan FocusCenter XCenter YClear BackgroundClip Fill RuleClip PathClose PathColumnColumn SpacingColumnsDescriptionEllipsizeEnd ArrowExtra space to add above the itemExtra space to add below the itemExtra space to add to the left of the itemExtra space to add to the right of the itemFill ColorFill Color RGBAFill PatternFill PixbufFill RuleFontFont DescriptionHeightHint MetricsHomogenous ColumnsHomogenous RowsHorizontal Grid Line WidthHow to align the textHow to position the text relative to the given x and y coordinatesHow to position the widget relative to the item's x and y coordinate settingsIf all columns are the same widthIf all item layout is done to the nearest integerIf all rows are the same heightIf an arrow should be displayed at the end of the polylineIf an arrow should be displayed at the start of the polylineIf the automatic bounds are calculated from the originIf the background is cleared before the canvas is paintedIf the bounds are automatically calculated based on the bounds of all the items in the canvasIf the item can shrink smaller than its requested size horizontallyIf the item can shrink smaller than its requested size verticallyIf the item can take the keyboard focusIf the item expands horizontally as the table expandsIf the item expands vertically as the table expandsIf the item fills all horizontal allocated spaceIf the item fills all vertical allocated spaceIf the last point should be connected to the firstInteger LayoutLeft PaddingLine CapLine DashLine JoinLine WidthMiter LimitOperatorParentPath DataPatternPixbufPointer EventsPointsRadius XRadius YResolution XResolution YRight PaddingRowRow SpacingRowsScaleScale XScale YSpecifies when the item receives pointer eventsStart ArrowStroke ColorStroke Color RGBAStroke PatternStroke PixbufTextThe GdkPixbuf to displayThe amount of spacing between the lefmost and rightmost cells and the border grid lineThe amount of spacing between the topmost and bottommost cells and the border grid lineThe antialiasing mode to useThe array of pointsThe attributes specifying which font to useThe base font to use for the textThe cairo pattern to paintThe color to use for the canvas backgroundThe color to use for the canvas background, specified as a 24-bit integer value, 0xRRGGBBThe color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULLThe color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULLThe color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULLThe color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULLThe column to place the item inThe compositing operator to useThe dash pattern to useThe default space between columnsThe default space between rowsThe fill rule used to determine which parts of the item are clippedThe fill rule used to determine which parts of the item are filledThe height of the imageThe height of the rectangleThe height of the widget, or -1 to use its requested heightThe hinting to be used for font metricsThe horizontal magnification factor of the canvasThe horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-alignedThe horizontal radius of the ellipseThe horizontal radius to use for rounded cornersThe horizontal resolution of the display, in dots per inchThe length of the arrow tip, as a multiple of the line widthThe length of the arrows, as a multiple of the line widthThe line cap style to useThe line join style to useThe line width to use for the item's perimeterThe magnification factor of the canvasThe number of columns that the item spansThe number of rows that the item spansThe padding added to the automatic boundsThe parent itemThe parent item modelThe pattern to use to paint the interior of the item, or NULL to disable paintingThe pattern to use to paint the perimeter of the item, or NULL disable paintingThe pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULLThe pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULLThe preferred method of wrapping the string if a width has been setThe preferred place to ellipsize the string, if the label does not have enough room to display the entire stringThe row to place the item inThe scale threshold at which the item becomes visibleThe sequence of path commandsThe sequence of path commands specifying the clip pathThe smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limitThe text to displayThe transformation matrix of the itemThe units to use for the canvasThe vertical magnification factor of the canvasThe vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-alignedThe vertical radius of the ellipseThe vertical radius to use for rounded cornersThe vertical resolution of the display, in dots per inchThe widget to place in the canvasThe width of the arrows, as a multiple of the line widthThe width of the grid line to draw between columnsThe width of the grid line to draw between rowsThe width of the imageThe width of the rectangleThe width of the widget, or -1 to use its requested widthThe width to use to layout the textThe x coordinate of the center of the ellipseThe x coordinate of the imageThe x coordinate of the left edge of the canvas bounds, in canvas unitsThe x coordinate of the rectangleThe x coordinate of the right edge of the canvas bounds, in canvas unitsThe x coordinate of the textThe x coordinate of the widgetThe y coordinate of the bottom edge of the canvas bounds, in canvas unitsThe y coordinate of the center of the ellipseThe y coordinate of the imageThe y coordinate of the rectangleThe y coordinate of the textThe y coordinate of the top edge of the canvas bounds, in canvas unitsThe y coordinate of the widgetTitleTop PaddingTransformUnitsUse MarkupVertical Grid Line WidthVisibilityVisibility ThresholdWhen the canvas item is visibleWhere to place the canvas when it is smaller than the widget's allocated areaWhether to parse PangoMarkup in the text, to support different stylesWidgetWidthWrapX AlignX Border SpacingX ExpandX FillX ShrinkX1X2Y AlignY Border SpacingY ExpandY FillY ShrinkY1Y2Project-Id-Version: GooCanvas CVS Report-Msgid-Bugs-To: POT-Creation-Date: 2009-06-29 16:23+0100 PO-Revision-Date: 2008-04-28 20:42+0900 Last-Translator: kou@cozmixng.org Language-Team: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; æ”¯æ´æŠ€è¡“ç”¨ã®èª¬æ˜Žæ”¯æ´æŠ€è¡“用ã®çŸ­ã„文脈豊富ãªèª¬æ˜Žé…置アンカーアンãƒã‚¨ã‚¤ãƒªã‚¢ã‚¹çŸ¢å°ã®é•·ã•矢å°ã®å…ˆç«¯ã®é•·ã•矢å°ã®å¹…自動境界計算背景色背景色ã®RGB表ç¾ä¸‹éƒ¨ãƒ‘ディング原点ã‹ã‚‰ã®å¢ƒç•Œè¨ˆç®—境界部ã®ãƒ‘ディングフォーカスå¯å¦ä¸­å¿ƒã® X 座標中心㮠Y 座標背景消去切り抜ã用塗りã¤ã¶ã—基準切り抜ã用パスパスを閉ã˜ã‚‹åˆ—列間ã®ç©ºç™½åˆ—数説明çœç•¥çµ‚点矢å°ã‚¢ã‚¤ãƒ†ãƒ ã®ä¸Šéƒ¨ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½ã‚¢ã‚¤ãƒ†ãƒ ã®ä¸‹éƒ¨ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½ã‚¢ã‚¤ãƒ†ãƒ ã®å·¦å´ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½ã‚¢ã‚¤ãƒ†ãƒ ã®å³å´ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½å¡—りã¤ã¶ã—ã®è‰²å¡—りã¤ã¶ã—用ã®RGBA表ç¾ã®è‰²å¡—りã¤ã¶ã—用パターン塗りã¤ã¶ã—用Pixbuf塗りã¤ã¶ã—基準フォントフォント記述高ã•ヒントメトリクスå‡ä¸€ã®åˆ—å‡ä¸€ã®è¡Œæ°´å¹³æ–¹å‘ã®æ ¼å­ç·šã®å¹…ã©ã®ã‚ˆã†ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’é…ç½®ã™ã‚‹ã‹ä¸Žãˆã‚‰ã‚ŒãŸ X/Y 座標ã«å¯¾ã—ã¦ã©ã®ã‚ˆã†ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’é…ç½®ã™ã‚‹ã‹ã‚¢ã‚¤ãƒ†ãƒ ã® X/Y座標ã®è¨­å®šã«å¯¾ã—ã¦ã©ã®ã‚ˆã†ã«ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆã‚’é…ç½®ã™ã‚‹ã‹å…¨ã¦ã®åˆ—ã‚’åŒã˜å¹…ã«ã™ã‚‹ã‹ã©ã†ã‹ã™ã¹ã¦ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’近似整数ã§é…ç½®ã™ã‚‹ã‹ã©ã†ã‹å…¨ã¦ã®è¡Œã‚’åŒã˜é«˜ã•ã«ã™ã‚‹ã‹ã©ã†ã‹å¤šç·šå½¢ã®çµ‚点ã«çŸ¢å°ã‚’表示ã™ã‚‹ã‹ã©ã†ã‹å¤šç·šå½¢ã®å§‹ç‚¹ã«çŸ¢å°ã‚’表示ã™ã‚‹ã‹ã©ã†ã‹è‡ªå‹•境界計算を原点ã‹ã‚‰è¡Œã†ã‹ã©ã†ã‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚’æç”»ã™ã‚‹å‰ã«èƒŒæ™¯ã‚’消去ã™ã‚‹ã‹ã©ã†ã‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®ã™ã¹ã¦ã®ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œã‚’å…ƒã«ã—ã¦è‡ªå‹•çš„ã«å¢ƒç•Œã‚’計算ã™ã‚‹ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ãŒè¦æ±‚ã•ã‚ŒãŸæ°´å¹³æ–¹å‘ã®ã‚µã‚¤ã‚ºã‚ˆã‚Šã‚‚縮å°ã§ãã‚‹ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ãŒè¦æ±‚ã•れãŸåž‚ç›´æ–¹å‘ã®ã‚µã‚¤ã‚ºã‚ˆã‚Šã‚‚縮å°ã§ãã‚‹ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ãƒ•ォーカスをå—ã‘付ã‘ã‚‹ã‹ã©ã†ã‹è¡¨ãŒä¼¸é•·ã—ãŸã‚‰ã‚¢ã‚¤ãƒ†ãƒ ã‚’水平方å‘ã«ä¼¸é•·ã™ã‚‹ã‹ã©ã†ã‹è¡¨ãŒä¼¸é•·ã—ãŸã‚‰ã‚¢ã‚¤ãƒ†ãƒ ã‚’垂直方å‘ã«ä¼¸é•·ã™ã‚‹ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ãŒæ°´å¹³é ˜åŸŸã„ã£ã±ã„使ã†ã‹ã©ã†ã‹ã‚¢ã‚¤ãƒ†ãƒ ãŒåž‚直領域ã„ã£ã±ã„使ã†ã‹ã©ã†ã‹æœ€å¾Œã®ç‚¹ãŒæœ€åˆã®ç‚¹ã«çµã³ä»˜ã‘ã‚‹ã‹ã©ã†ã‹æ•´æ•°é…置左å´ãƒ‘ディング線ã®é ‚点線ã®ãƒ€ãƒƒã‚·ãƒ¥ (-)ç·šã®çµåˆç·šå¹…ç•™ã‚ç¶™ãŽã®å¢ƒç•Œæ¼”算親パスデータパターンPixbufãƒã‚¤ãƒ³ã‚¿ã‚¤ãƒ™ãƒ³ãƒˆç‚¹åŠå¾„ã® X 座標åŠå¾„ã® Y 座標X æ–¹å‘ã®è§£åƒåº¦Y æ–¹å‘ã®è§£åƒåº¦å³å´ãƒ‘ディング行行間ã®ç©ºç™½è¡Œæ•°ã‚¹ã‚±ãƒ¼ãƒ«Xæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«Yæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«ã„ã¤ã‚¢ã‚¤ãƒ†ãƒ ãŒãƒã‚¤ãƒ³ã‚¿ã‚¤ãƒ™ãƒ³ãƒˆã‚’å—ã‘å–ã‚‹ã‹æŒ‡å®šã—ã¾ã™å§‹ç‚¹çŸ¢å°ã‚¹ãƒˆãƒ­ãƒ¼ã‚¯ç”¨ã®è‰²ã‚¹ãƒˆãƒ­ãƒ¼ã‚¯ç”¨ã®RGBA表ç¾ã®è‰²ã‚¹ãƒˆãƒ­ãƒ¼ã‚¯ç”¨ãƒ‘ターンストローク用ã®Pixbufテキスト表示ã™ã‚‹GdkPixbuf最左・最å³ã‚»ãƒ«ã¨å¢ƒç•Œã®æ ¼å­ç·šã®é–“ã®ç©ºç™½ã®ç·é‡æœ€ä¸Šãƒ»æœ€ä¸‹ã‚»ãƒ«ã¨å¢ƒç•Œã®æ ¼å­ç·šã®é–“ã®ç©ºç™½ã®ç·é‡ä½¿ç”¨ã™ã‚‹ã‚¢ãƒ³ãƒã‚¨ã‚¤ãƒªã‚¢ã‚¹ãƒ¢ãƒ¼ãƒ‰ç‚¹ã®é…列使用ã™ã‚‹ãƒ•ォントを特定ã™ã‚‹å±žæ€§ãƒ†ã‚­ã‚¹ãƒˆã«ä½¿ã†åŸºåº•フォント塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターンキャンãƒã‚¹ã®èƒŒæ™¯è‰²24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²32ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤ã§æŒ‡å®šã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œç·šã®è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'stroke-pattern'プロパティをNULLã«ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œç·šã®è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'stroke-pattern'プロパティをNULLã«ã™ã‚‹32ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤ã§æŒ‡å®šã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-pattern'プロパティをNULLã«ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-pattern'プロパティをNULLã«ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã‚’ç½®ã列使用ã™ã‚‹åˆæˆæ¼”算使用ã™ã‚‹ãƒ€ãƒƒã‚·ãƒ¥ (-) ã®ãƒ‘ターン列ã®é–“ã®ãƒ‡ãƒ•ォルトã®ç©ºç™½è¡Œã®é–“ã®ãƒ‡ãƒ•ォルトã®ç©ºç™½ã‚¢ã‚¤ãƒ†ãƒ ã®ä¸€éƒ¨ãŒåˆ‡ã‚ŠæŠœã‹ã‚Œã¦ã„ã‚‹ã‹ã‚’判断ã™ã‚‹ãŸã‚ã®å¡—りã¤ã¶ã—基準アイテムã®ä¸€éƒ¨ãŒå¡—りã¤ã¶ã•れãŸã‹ã‚’判断ã™ã‚‹ãŸã‚ã®å¡—りã¤ã¶ã—基準画åƒã®é«˜ã•長方形ã®é«˜ã•ウィジェットã®é«˜ã•。ウィジェットãŒè¦æ±‚ã•れã¦ã„る高ã•を使ã†ãªã‚‰ -1 ã§ã™ãƒ•ォントメトリクスã§ä½¿ã†ãƒ’ントキャンãƒã‚¹ã®æ°´å¹³æ–¹å‘ã®æ‹¡å¤§çŽ‡é ˜åŸŸä¸­ã®ã‚¢ã‚¤ãƒ†ãƒ ã®æ°´å¹³ä½ç½®ã€‚0.0 ã¯å·¦è©°ã‚ã€1.0 ã¯å³è©°ã‚ã§ã™æ¥•å††ã®æ°´å¹³æ–¹å‘ã®åŠå¾„丸角ã§ä½¿ã†æ°´å¹³åŠå¾„ç”»é¢ã®æ°´å¹³è§£åƒåº¦ (ドット/インãƒã€DPI)矢å°ã®å…ˆç«¯ã®é•·ã• (ç·šå¹…ã®å€æ•°)矢å°ã®é•·ã• (ç·šå¹…ã®å€æ•°)使用ã™ã‚‹ç·šã®é ‚点ã®ã‚¹ã‚¿ã‚¤ãƒ«ä½¿ç”¨ã™ã‚‹ç·šã®çµåˆã®ã‚¹ã‚¿ã‚¤ãƒ«ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œç·šã«ä½¿ã†ç·šå¹…キャンãƒã‚¹ã®æ‹¡å¤§çŽ‡ã‚¢ã‚¤ãƒ†ãƒ ãŒä½¿ã†åˆ—数アイテムãŒä½¿ã†è¡Œæ•°è‡ªå‹•境界計算ã§è¿½åŠ ã•れãŸãƒ‘ディング親アイテム親アイテムモデルアイテムã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã®ãƒ‘ターン。塗りã¤ã¶ã•ãªã„å ´åˆã¯NULLアイテムã®å¢ƒç•Œç·šã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†ãƒ‘ターン。塗りã¤ã¶ã•ãªã„å ´åˆã¯NULLアイテムã®å¢ƒç•Œç·šã‚’æç”»ã™ã‚‹ãŸã‚ã«ä½¿ã†Pixbuf。æç”»ã—ãªã„å ´åˆã¯'stroke-pattern'プロパティをNULLã«ã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†Pixbuf。塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-pattern'プロパティをNULLã«ã™ã‚‹å¹…ãŒè¨­å®šã•れã¦ã„ã‚‹ã¨ãã«æ–‡å­—åˆ—ã®æŠ˜ã‚Šè¿”ã—ã«ä½¿ã†ã¹ã方法文字列全体を表示ã™ã‚‹å ´æ‰€ãŒç„¡ã„ã¨ãã«æ–‡å­—列をçœç•¥ã™ã‚‹ã¹ã場所アイテムを置ã行アイテムãŒè¦‹ãˆã‚‹ã‚ˆã†ã«ãªã‚‹å€çއã®ã—ãã„値パスコマンドã®ãªã‚‰ã³åˆ‡ã‚ŠæŠœã用パスを指定ã™ã‚‹ãƒ‘スコマンドã®ãªã‚‰ã³ä½¿ç”¨ã™ã‚‹ç•™ã‚ç¶™ãŽã®æœ€å°è§’度 (度数)。ã“ã®å¢ƒç•Œå€¤ã‚ˆã‚Šä½Žã„å ´åˆã¯ããŽç¶™ãŽãŒä½¿ã‚れã¾ã™è¡¨ç¤ºã™ã‚‹ãƒ†ã‚­ã‚¹ãƒˆã‚¢ã‚¤ãƒ†ãƒ ã®å¤‰æ›è¡Œåˆ—キャンãƒã‚¹ã§ä½¿ã†å˜ä½ã‚­ãƒ£ãƒ³ãƒã‚¹ã®åž‚ç›´æ–¹å‘ã®æ‹¡å¤§çŽ‡é ˜åŸŸä¸­å†…ã§ã®ã‚¢ã‚¤ãƒ†ãƒ ã®åž‚ç›´ä½ç½®ã€‚0.0 ã¯ä¸Šè©°ã‚ã€1.0 ã¯ä¸‹è©°ã‚ã§ã™æ¥•円ã®åž‚ç›´æ–¹å‘ã®åŠå¾„丸角ã§ä½¿ã†åž‚ç›´åŠå¾„<ç”»é¢ã®åž‚ç›´è§£åƒåº¦ (ドット/インãƒã€DPI)キャンãƒã‚¹å†…ã«é…ç½®ã™ã‚‹ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆçŸ¢å°ã®å¹… (ç·šå¹…ã®å€æ•°)åˆ—é–“ã®æ ¼å­ç·šã®å¹…è¡Œé–“ã®æ ¼å­ç·šã®å¹…ç”»åƒã®å¹…長方形ã®å¹…ウィジェットã®å¹…。ウィジェットãŒè¦æ±‚ã•れã¦ã„る幅を使ã†ãªã‚‰ -1 ã§ã™ãƒ†ã‚­ã‚¹ãƒˆã‚’é…ç½®ã™ã‚‹ãŸã‚ã«ä½¿ç”¨ã™ã‚‹å¹…楕円ã®ä¸­å¿ƒã® X 座標画åƒã® X 座標キャンãƒã‚¹å·¦ç«¯ã® X 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)長方形ã®x座標キャンãƒã‚¹å³ç«¯ã® X 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)テキスト㮠X 座標ウィジェット㮠X 座標キャンãƒã‚¹ä¸‹ç«¯ã® Y 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)楕円ã®ä¸­å¿ƒã® Y 座標画åƒã® Y 座標長方形ã®y座標テキスト㮠Y 座標キャンãƒã‚¹ä¸Šç«¯ã® Y 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)ウィジェット㮠Y 座標タイトル上部パディング変æ›å˜ä½ãƒžãƒ¼ã‚¯ã‚¢ãƒƒãƒ—を使ã†åž‚ç›´æ–¹å‘ã®æ ¼å­ç·šã®å¹…å¯è¦–性å¯è¦–性ã®ã—ãã„値ã„ã¤ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚¢ã‚¤ãƒ†ãƒ ãŒè¦‹ãˆã‚‹ã‹ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆã®é ˜åŸŸã‚ˆã‚Šã‚‚å°ã•ããªã£ãŸã¨ãã«ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚’ã©ã“ã«ãŠãã‹ç•°ãªã‚‹ã‚¹ã‚¿ã‚¤ãƒ«ã‚’使ã†ãŸã‚ã«ãƒ†ã‚­ã‚¹ãƒˆä¸­ã®PangoMarkupをパースã™ã‚‹ã‹ã©ã†ã‹ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆå¹…折り返ã—X æ–¹å‘ã®é…ç½®Xæ–¹å‘ã®å¢ƒç•Œã®ç©ºç™½X æ–¹å‘ã®ä¼¸é•·X æ–¹å‘ã®å……å¡«X æ–¹å‘ã®ç¸®å°X1X2Y æ–¹å‘ã®é…ç½®Yæ–¹å‘ã®å¢ƒç•Œã®ç©ºç™½Y æ–¹å‘ã®ä¼¸é•·Y æ–¹å‘ã®å……å¡«Y æ–¹å‘ã®ç¸®å°Y1Y2goocanvas-0.15/po/POTFILES.in0000644000076400007640000000064111172574677012565 00000000000000# List of source files containing translatable strings. src/goocanvasatk.c src/goocanvas.c src/goocanvasellipse.c src/goocanvasgrid.c src/goocanvasgroup.c src/goocanvasimage.c src/goocanvasitem.c src/goocanvasitemmodel.c src/goocanvasitemsimple.c src/goocanvaspath.c src/goocanvaspolyline.c src/goocanvasrect.c src/goocanvasstyle.c src/goocanvastable.c src/goocanvastext.c src/goocanvasutils.c src/goocanvaswidget.c goocanvas-0.15/po/ja.po0000644000076400007640000010162611222156155011726 00000000000000# Japanese translation for GooCanvas # Copyright (C) 2007 Kouhei Sutou # This file is distributed under the same license as the GooCanvas package. # Kouhei Sutou , 2007. # msgid "" msgstr "" "Project-Id-Version: GooCanvas CVS\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-29 16:23+0100\n" "PO-Revision-Date: 2008-04-28 20:42+0900\n" "Last-Translator: kou@cozmixng.org \n" "Language-Team:\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: src/goocanvas.c:284 msgid "Scale" msgstr "スケール" #: src/goocanvas.c:285 msgid "The magnification factor of the canvas" msgstr "キャンãƒã‚¹ã®æ‹¡å¤§çއ" #: src/goocanvas.c:291 msgid "Scale X" msgstr "Xæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«" #: src/goocanvas.c:292 msgid "The horizontal magnification factor of the canvas" msgstr "キャンãƒã‚¹ã®æ°´å¹³æ–¹å‘ã®æ‹¡å¤§çއ" #: src/goocanvas.c:298 msgid "Scale Y" msgstr "Yæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«" #: src/goocanvas.c:299 msgid "The vertical magnification factor of the canvas" msgstr "キャンãƒã‚¹ã®åž‚ç›´æ–¹å‘ã®æ‹¡å¤§çއ" #: src/goocanvas.c:305 src/goocanvastext.c:158 src/goocanvaswidget.c:589 msgid "Anchor" msgstr "アンカー" #: src/goocanvas.c:306 msgid "" "Where to place the canvas when it is smaller than the widget's allocated area" msgstr "ウィジェットã®é ˜åŸŸã‚ˆã‚Šã‚‚å°ã•ããªã£ãŸã¨ãã«ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚’ã©ã“ã«ãŠãã‹" #: src/goocanvas.c:313 msgid "X1" msgstr "X1" #: src/goocanvas.c:314 msgid "The x coordinate of the left edge of the canvas bounds, in canvas units" msgstr "キャンãƒã‚¹å·¦ç«¯ã® X 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)" #: src/goocanvas.c:321 msgid "Y1" msgstr "Y1" #: src/goocanvas.c:322 msgid "The y coordinate of the top edge of the canvas bounds, in canvas units" msgstr "キャンãƒã‚¹ä¸Šç«¯ã® Y 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)" #: src/goocanvas.c:329 msgid "X2" msgstr "X2" #: src/goocanvas.c:330 msgid "" "The x coordinate of the right edge of the canvas bounds, in canvas units" msgstr "キャンãƒã‚¹å³ç«¯ã® X 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)" #: src/goocanvas.c:338 msgid "Y2" msgstr "Y2" #: src/goocanvas.c:339 msgid "" "The y coordinate of the bottom edge of the canvas bounds, in canvas units" msgstr "キャンãƒã‚¹ä¸‹ç«¯ã® Y 座標 (キャンãƒã‚¹ã®å˜ä½ã§æŒ‡å®š)" #: src/goocanvas.c:348 msgid "Automatic Bounds" msgstr "自動境界計算" #: src/goocanvas.c:349 msgid "" "If the bounds are automatically calculated based on the bounds of all the " "items in the canvas" msgstr "" "キャンãƒã‚¹ã®ã™ã¹ã¦ã®ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œã‚’å…ƒã«ã—ã¦è‡ªå‹•çš„ã«å¢ƒç•Œã‚’計算ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvas.c:355 msgid "Bounds From Origin" msgstr "原点ã‹ã‚‰ã®å¢ƒç•Œè¨ˆç®—" #: src/goocanvas.c:356 msgid "If the automatic bounds are calculated from the origin" msgstr "自動境界計算を原点ã‹ã‚‰è¡Œã†ã‹ã©ã†ã‹" #: src/goocanvas.c:362 msgid "Bounds Padding" msgstr "境界部ã®ãƒ‘ディング" #: src/goocanvas.c:363 msgid "The padding added to the automatic bounds" msgstr "自動境界計算ã§è¿½åŠ ã•れãŸãƒ‘ディング" #: src/goocanvas.c:369 msgid "Units" msgstr "å˜ä½" #: src/goocanvas.c:370 msgid "The units to use for the canvas" msgstr "キャンãƒã‚¹ã§ä½¿ã†å˜ä½" #: src/goocanvas.c:377 msgid "Resolution X" msgstr "X æ–¹å‘ã®è§£åƒåº¦" #: src/goocanvas.c:378 msgid "The horizontal resolution of the display, in dots per inch" msgstr "ç”»é¢ã®æ°´å¹³è§£åƒåº¦ (ドット/インãƒã€DPI)" #: src/goocanvas.c:385 msgid "Resolution Y" msgstr "Y æ–¹å‘ã®è§£åƒåº¦" #: src/goocanvas.c:386 msgid "The vertical resolution of the display, in dots per inch" msgstr "ç”»é¢ã®åž‚ç›´è§£åƒåº¦ (ドット/インãƒã€DPI)" #: src/goocanvas.c:394 msgid "Background Color" msgstr "背景色" #: src/goocanvas.c:395 msgid "The color to use for the canvas background" msgstr "キャンãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvas.c:401 msgid "Background Color RGB" msgstr "背景色ã®RGB表ç¾" #: src/goocanvas.c:402 msgid "" "The color to use for the canvas background, specified as a 24-bit integer " "value, 0xRRGGBB" msgstr "24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvas.c:408 msgid "Integer Layout" msgstr "æ•´æ•°é…ç½®" #: src/goocanvas.c:409 msgid "If all item layout is done to the nearest integer" msgstr "ã™ã¹ã¦ã®ã‚¢ã‚¤ãƒ†ãƒ ã‚’近似整数ã§é…ç½®ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvas.c:415 msgid "Clear Background" msgstr "背景消去" #: src/goocanvas.c:416 msgid "If the background is cleared before the canvas is painted" msgstr "キャンãƒã‚¹ã‚’æç”»ã™ã‚‹å‰ã«èƒŒæ™¯ã‚’消去ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvas.c:422 msgid "Redraw When Scrolled" msgstr "" #: src/goocanvas.c:423 msgid "" "If the canvas is completely redrawn when scrolled, to reduce the flicker of " "static items" msgstr "" #: src/goocanvasellipse.c:77 msgid "Center X" msgstr "中心㮠X 座標" #: src/goocanvasellipse.c:78 msgid "The x coordinate of the center of the ellipse" msgstr "楕円ã®ä¸­å¿ƒã® X 座標" #: src/goocanvasellipse.c:85 msgid "Center Y" msgstr "中心㮠Y 座標" #: src/goocanvasellipse.c:86 msgid "The y coordinate of the center of the ellipse" msgstr "楕円ã®ä¸­å¿ƒã® Y 座標" #: src/goocanvasellipse.c:93 src/goocanvasrect.c:90 msgid "Radius X" msgstr "åŠå¾„ã® X 座標" #: src/goocanvasellipse.c:94 msgid "The horizontal radius of the ellipse" msgstr "æ¥•å††ã®æ°´å¹³æ–¹å‘ã®åŠå¾„" #: src/goocanvasellipse.c:100 src/goocanvasrect.c:97 msgid "Radius Y" msgstr "åŠå¾„ã® Y 座標" #: src/goocanvasellipse.c:101 msgid "The vertical radius of the ellipse" msgstr "楕円ã®åž‚ç›´æ–¹å‘ã®åŠå¾„" #: src/goocanvasellipse.c:108 #, fuzzy msgid "The x coordinate of the left side of the ellipse" msgstr "楕円ã®ä¸­å¿ƒã® X 座標" #: src/goocanvasellipse.c:116 #, fuzzy msgid "The y coordinate of the top of the ellipse" msgstr "楕円ã®ä¸­å¿ƒã® Y 座標" #: src/goocanvasellipse.c:123 src/goocanvasgrid.c:124 src/goocanvasgroup.c:106 #: src/goocanvasimage.c:107 src/goocanvaspath.c:93 src/goocanvaspolyline.c:207 #: src/goocanvasrect.c:76 src/goocanvastext.c:141 src/goocanvaswidget.c:572 msgid "Width" msgstr "å¹…" #: src/goocanvasellipse.c:124 #, fuzzy msgid "The width of the ellipse" msgstr "ç”»åƒã®å¹…" #: src/goocanvasellipse.c:130 src/goocanvasgrid.c:131 src/goocanvasgroup.c:114 #: src/goocanvasimage.c:114 src/goocanvaspath.c:100 #: src/goocanvaspolyline.c:214 src/goocanvasrect.c:83 src/goocanvastext.c:149 #: src/goocanvaswidget.c:580 msgid "Height" msgstr "高ã•" #: src/goocanvasellipse.c:131 #, fuzzy msgid "The height of the ellipse" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvasgrid.c:109 #, fuzzy msgid "The x coordinate of the grid" msgstr "ウィジェット㮠X 座標" #: src/goocanvasgrid.c:117 #, fuzzy msgid "The y coordinate of the grid" msgstr "ウィジェット㮠Y 座標" #: src/goocanvasgrid.c:125 #, fuzzy msgid "The width of the grid" msgstr "ç”»åƒã®å¹…" #: src/goocanvasgrid.c:132 #, fuzzy msgid "The height of the grid" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvasgrid.c:139 msgid "The distance between the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:146 msgid "The distance between the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:153 msgid "The distance before the first vertical grid line" msgstr "" #: src/goocanvasgrid.c:160 msgid "The distance before the first horizontal grid line" msgstr "" #: src/goocanvasgrid.c:166 src/goocanvastable.c:276 msgid "Horizontal Grid Line Width" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:167 #, fuzzy msgid "The width of the horizontal grid lines" msgstr "長方形ã®å¹…" #: src/goocanvasgrid.c:174 src/goocanvastable.c:283 msgid "Vertical Grid Line Width" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:175 #, fuzzy msgid "The width of the vertical grid lines" msgstr "長方形ã®å¹…" #: src/goocanvasgrid.c:182 #, fuzzy msgid "Horizontal Grid Line Pattern" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:183 #, fuzzy msgid "The cairo pattern to paint the horizontal grid lines with" msgstr "塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターン" #: src/goocanvasgrid.c:189 #, fuzzy msgid "Vertical Grid Line Pattern" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:190 #, fuzzy msgid "The cairo pattern to paint the vertical grid lines with" msgstr "塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターン" #: src/goocanvasgrid.c:196 #, fuzzy msgid "Border Width" msgstr "矢å°ã®å¹…" #: src/goocanvasgrid.c:197 #, fuzzy msgid "The width of the border around the grid" msgstr "長方形ã®å¹…" #: src/goocanvasgrid.c:204 #, fuzzy msgid "Border Pattern" msgstr "ストローク用パターン" #: src/goocanvasgrid.c:205 #, fuzzy msgid "The cairo pattern to paint the border with" msgstr "塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターン" #: src/goocanvasgrid.c:211 #, fuzzy msgid "Show Horizontal Grid Lines" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:212 msgid "If the horizontal grid lines are shown" msgstr "" #: src/goocanvasgrid.c:218 #, fuzzy msgid "Show Vertical Grid Lines" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:219 msgid "If the vertical grid lines are shown" msgstr "" #: src/goocanvasgrid.c:225 #, fuzzy msgid "Vertical Grid Lines On Top" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:226 msgid "If the vertical grid lines are painted above the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:234 #, fuzzy msgid "Horizontal Grid Line Color" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:235 #, fuzzy msgid "The color to use for the horizontal grid lines" msgstr "キャンãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:241 #, fuzzy msgid "Horizontal Grid Line Color RGBA" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:242 #, fuzzy msgid "" "The color to use for the horizontal grid lines, specified as a 32-bit " "integer value" msgstr "24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:248 #, fuzzy msgid "Horizontal Grid Line Pixbuf" msgstr "水平方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:249 msgid "The pixbuf to use to draw the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:255 #, fuzzy msgid "Vertical Grid Line Color" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:256 #, fuzzy msgid "The color to use for the vertical grid lines" msgstr "キャンãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:262 #, fuzzy msgid "Vertical Grid Line Color RGBA" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:263 #, fuzzy msgid "" "The color to use for the vertical grid lines, specified as a 32-bit integer " "value" msgstr "24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:269 #, fuzzy msgid "Vertical Grid Line Pixbuf" msgstr "垂直方å‘ã®æ ¼å­ç·šã®å¹…" #: src/goocanvasgrid.c:270 #, fuzzy msgid "The pixbuf to use to draw the vertical grid lines" msgstr "キャンãƒã‚¹ã§ä½¿ã†å˜ä½" #: src/goocanvasgrid.c:276 #, fuzzy msgid "Border Color" msgstr "ストローク用ã®è‰²" #: src/goocanvasgrid.c:277 #, fuzzy msgid "The color to use for the border" msgstr "キャンãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:283 #, fuzzy msgid "Border Color RGBA" msgstr "ストローク用ã®RGBA表ç¾ã®è‰²" #: src/goocanvasgrid.c:284 #, fuzzy msgid "The color to use for the border, specified as a 32-bit integer value" msgstr "24ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤(0xRRGGBB)ã§æŒ‡å®šã™ã‚‹ã‚­ãƒ£ãƒ³ãƒã‚¹ã®èƒŒæ™¯è‰²" #: src/goocanvasgrid.c:290 #, fuzzy msgid "Border Pixbuf" msgstr "ストローク用ã®Pixbuf" #: src/goocanvasgrid.c:291 #, fuzzy msgid "The pixbuf to use to draw the border" msgstr "テキストをé…ç½®ã™ã‚‹ãŸã‚ã«ä½¿ç”¨ã™ã‚‹å¹…" #: src/goocanvasgroup.c:91 #, fuzzy msgid "The x coordinate of the group" msgstr "ç”»åƒã® X 座標" #: src/goocanvasgroup.c:99 #, fuzzy msgid "The y coordinate of the group" msgstr "ç”»åƒã® Y 座標" #: src/goocanvasgroup.c:107 #, fuzzy msgid "The width of the group, or -1 to use the default width" msgstr "è¦æ±‚ã™ã‚‹è¡¨ã®å¹…。デフォルトã®å¹…を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvasgroup.c:115 #, fuzzy msgid "The height of the group, or -1 to use the default height" msgstr "è¦æ±‚ã™ã‚‹è¡¨ã®é«˜ã•。デフォルトã®é«˜ã•を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvasimage.c:84 msgid "Pattern" msgstr "パターン" #: src/goocanvasimage.c:85 msgid "The cairo pattern to paint" msgstr "塗りã¤ã¶ã—用㮠cairo ã®ãƒ‘ターン" #: src/goocanvasimage.c:92 msgid "The x coordinate of the image" msgstr "ç”»åƒã® X 座標" #: src/goocanvasimage.c:100 msgid "The y coordinate of the image" msgstr "ç”»åƒã® Y 座標" #: src/goocanvasimage.c:108 msgid "The width of the image" msgstr "ç”»åƒã®å¹…" #: src/goocanvasimage.c:115 msgid "The height of the image" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvasimage.c:121 #, fuzzy msgid "Scale To Fit" msgstr "Xæ–¹å‘ã®ã‚¹ã‚±ãƒ¼ãƒ«" #: src/goocanvasimage.c:122 msgid "If the image is scaled to fit the width and height settings" msgstr "" #: src/goocanvasimage.c:128 msgid "Pixbuf" msgstr "Pixbuf" #: src/goocanvasimage.c:129 msgid "The GdkPixbuf to display" msgstr "表示ã™ã‚‹GdkPixbuf" #: src/goocanvasitem.c:461 src/goocanvasitemmodel.c:219 msgid "Parent" msgstr "親" #: src/goocanvasitem.c:462 msgid "The parent item" msgstr "親アイテム" #: src/goocanvasitem.c:468 src/goocanvasitemmodel.c:226 msgid "Visibility" msgstr "å¯è¦–性" #: src/goocanvasitem.c:469 src/goocanvasitemmodel.c:227 msgid "When the canvas item is visible" msgstr "ã„ã¤ã‚­ãƒ£ãƒ³ãƒã‚¹ã‚¢ã‚¤ãƒ†ãƒ ãŒè¦‹ãˆã‚‹ã‹" #: src/goocanvasitem.c:476 src/goocanvasitemmodel.c:234 msgid "Visibility Threshold" msgstr "å¯è¦–性ã®ã—ãã„値" #: src/goocanvasitem.c:477 src/goocanvasitemmodel.c:235 msgid "The scale threshold at which the item becomes visible" msgstr "アイテムãŒè¦‹ãˆã‚‹ã‚ˆã†ã«ãªã‚‹å€çއã®ã—ãã„値" #: src/goocanvasitem.c:485 src/goocanvasitemmodel.c:243 msgid "Transform" msgstr "変æ›" #: src/goocanvasitem.c:486 src/goocanvasitemmodel.c:244 msgid "The transformation matrix of the item" msgstr "アイテムã®å¤‰æ›è¡Œåˆ—" #: src/goocanvasitem.c:492 src/goocanvasitemmodel.c:250 msgid "Pointer Events" msgstr "ãƒã‚¤ãƒ³ã‚¿ã‚¤ãƒ™ãƒ³ãƒˆ" #: src/goocanvasitem.c:493 src/goocanvasitemmodel.c:251 msgid "Specifies when the item receives pointer events" msgstr "ã„ã¤ã‚¢ã‚¤ãƒ†ãƒ ãŒãƒã‚¤ãƒ³ã‚¿ã‚¤ãƒ™ãƒ³ãƒˆã‚’å—ã‘å–ã‚‹ã‹æŒ‡å®šã—ã¾ã™" #: src/goocanvasitem.c:500 src/goocanvasitemmodel.c:258 msgid "Title" msgstr "タイトル" #: src/goocanvasitem.c:501 src/goocanvasitemmodel.c:259 msgid "" "A short context-rich description of the item for use by assistive " "technologies" msgstr "æ”¯æ´æŠ€è¡“ç”¨ã®çŸ­ã„文脈豊富ãªèª¬æ˜Ž" #: src/goocanvasitem.c:507 src/goocanvasitemmodel.c:265 msgid "Description" msgstr "説明" #: src/goocanvasitem.c:508 src/goocanvasitemmodel.c:266 msgid "A description of the item for use by assistive technologies" msgstr "æ”¯æ´æŠ€è¡“ç”¨ã®èª¬æ˜Ž" #: src/goocanvasitem.c:514 src/goocanvasitemmodel.c:272 msgid "Can Focus" msgstr "フォーカスå¯å¦" #: src/goocanvasitem.c:515 src/goocanvasitemmodel.c:273 msgid "If the item can take the keyboard focus" msgstr "アイテムã¯ã‚­ãƒ¼ãƒœãƒ¼ãƒ‰ãƒ•ォーカスをå—ã‘付ã‘ã‚‹ã‹ã©ã†ã‹" #: src/goocanvasitem.c:521 src/goocanvasitemmodel.c:279 msgid "Tooltip" msgstr "" #: src/goocanvasitem.c:522 src/goocanvasitemmodel.c:280 #, fuzzy msgid "The tooltip to display for the item" msgstr "アイテムを置ã行" #: src/goocanvasitemmodel.c:220 msgid "The parent item model" msgstr "親アイテムモデル" #: src/goocanvasitemsimple.c:126 msgid "Stroke Pattern" msgstr "ストローク用パターン" #: src/goocanvasitemsimple.c:127 msgid "" "The pattern to use to paint the perimeter of the item, or NULL disable " "painting" msgstr "" "アイテムã®å¢ƒç•Œç·šã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†ãƒ‘ターン。塗りã¤ã¶ã•ãªã„å ´åˆã¯NULL" #: src/goocanvasitemsimple.c:133 msgid "Fill Pattern" msgstr "塗りã¤ã¶ã—用パターン" #: src/goocanvasitemsimple.c:134 msgid "" "The pattern to use to paint the interior of the item, or NULL to disable " "painting" msgstr "アイテムã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã®ãƒ‘ターン。塗りã¤ã¶ã•ãªã„å ´åˆã¯NULL" #: src/goocanvasitemsimple.c:140 msgid "Fill Rule" msgstr "塗りã¤ã¶ã—基準" #: src/goocanvasitemsimple.c:141 msgid "The fill rule used to determine which parts of the item are filled" msgstr "アイテムã®ä¸€éƒ¨ãŒå¡—りã¤ã¶ã•れãŸã‹ã‚’判断ã™ã‚‹ãŸã‚ã®å¡—りã¤ã¶ã—基準" #: src/goocanvasitemsimple.c:148 msgid "Operator" msgstr "演算" #: src/goocanvasitemsimple.c:149 msgid "The compositing operator to use" msgstr "使用ã™ã‚‹åˆæˆæ¼”ç®—" #: src/goocanvasitemsimple.c:156 msgid "Antialias" msgstr "アンãƒã‚¨ã‚¤ãƒªã‚¢ã‚¹" #: src/goocanvasitemsimple.c:157 msgid "The antialiasing mode to use" msgstr "使用ã™ã‚‹ã‚¢ãƒ³ãƒã‚¨ã‚¤ãƒªã‚¢ã‚¹ãƒ¢ãƒ¼ãƒ‰" #: src/goocanvasitemsimple.c:165 msgid "Line Width" msgstr "ç·šå¹…" #: src/goocanvasitemsimple.c:166 msgid "The line width to use for the item's perimeter" msgstr "アイテムã®å¢ƒç•Œç·šã«ä½¿ã†ç·šå¹…" #: src/goocanvasitemsimple.c:172 msgid "Line Cap" msgstr "ç·šã®é ‚点" #: src/goocanvasitemsimple.c:173 msgid "The line cap style to use" msgstr "使用ã™ã‚‹ç·šã®é ‚点ã®ã‚¹ã‚¿ã‚¤ãƒ«" #: src/goocanvasitemsimple.c:180 msgid "Line Join" msgstr "ç·šã®çµåˆ" #: src/goocanvasitemsimple.c:181 msgid "The line join style to use" msgstr "使用ã™ã‚‹ç·šã®çµåˆã®ã‚¹ã‚¿ã‚¤ãƒ«" #: src/goocanvasitemsimple.c:188 msgid "Miter Limit" msgstr "ç•™ã‚ç¶™ãŽã®å¢ƒç•Œ" #: src/goocanvasitemsimple.c:189 msgid "" "The smallest angle to use with miter joins, in degrees. Bevel joins will be " "used below this limit" msgstr "" "使用ã™ã‚‹ç•™ã‚ç¶™ãŽã®æœ€å°è§’度 (度数)。ã“ã®å¢ƒç•Œå€¤ã‚ˆã‚Šä½Žã„å ´åˆã¯ããŽç¶™ãŽãŒä½¿ã‚れã¾" "ã™" #: src/goocanvasitemsimple.c:195 msgid "Line Dash" msgstr "ç·šã®ãƒ€ãƒƒã‚·ãƒ¥ (-)" #: src/goocanvasitemsimple.c:196 msgid "The dash pattern to use" msgstr "使用ã™ã‚‹ãƒ€ãƒƒã‚·ãƒ¥ (-) ã®ãƒ‘ターン" #: src/goocanvasitemsimple.c:203 msgid "Font" msgstr "フォント" #: src/goocanvasitemsimple.c:204 msgid "The base font to use for the text" msgstr "テキストã«ä½¿ã†åŸºåº•フォント" #: src/goocanvasitemsimple.c:210 msgid "Font Description" msgstr "フォント記述" #: src/goocanvasitemsimple.c:211 msgid "The attributes specifying which font to use" msgstr "使用ã™ã‚‹ãƒ•ォントを特定ã™ã‚‹å±žæ€§" #: src/goocanvasitemsimple.c:217 msgid "Hint Metrics" msgstr "ヒントメトリクス" #: src/goocanvasitemsimple.c:218 msgid "The hinting to be used for font metrics" msgstr "フォントメトリクスã§ä½¿ã†ãƒ’ント" #: src/goocanvasitemsimple.c:226 msgid "Stroke Color" msgstr "ストローク用ã®è‰²" #: src/goocanvasitemsimple.c:227 msgid "" "The color to use for the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" "アイテムã®å¢ƒç•Œç·šã®è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'stroke-pattern'プロパティをNULLã«" "ã™ã‚‹" #: src/goocanvasitemsimple.c:233 msgid "Stroke Color RGBA" msgstr "ストローク用ã®RGBA表ç¾ã®è‰²" #: src/goocanvasitemsimple.c:234 msgid "" "The color to use for the item's perimeter, specified as a 32-bit integer " "value. To disable painting set the 'stroke-pattern' property to NULL" msgstr "" "32ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤ã§æŒ‡å®šã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å¢ƒç•Œç·šã®è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'stroke-" "pattern'プロパティをNULLã«ã™ã‚‹" #: src/goocanvasitemsimple.c:240 msgid "Stroke Pixbuf" msgstr "ストローク用ã®Pixbuf" #: src/goocanvasitemsimple.c:241 msgid "" "The pixbuf to use to draw the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" "アイテムã®å¢ƒç•Œç·šã‚’æç”»ã™ã‚‹ãŸã‚ã«ä½¿ã†Pixbuf。æç”»ã—ãªã„å ´åˆã¯'stroke-" "pattern'プロパティをNULLã«ã™ã‚‹" #: src/goocanvasitemsimple.c:247 msgid "Fill Color" msgstr "塗りã¤ã¶ã—ã®è‰²" #: src/goocanvasitemsimple.c:248 msgid "" "The color to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" "アイテムã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†è‰²ã€‚塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-pattern'プ" "ロパティをNULLã«ã™ã‚‹" #: src/goocanvasitemsimple.c:254 msgid "Fill Color RGBA" msgstr "塗りã¤ã¶ã—用ã®RGBA表ç¾ã®è‰²" #: src/goocanvasitemsimple.c:255 msgid "" "The color to use to paint the interior of the item, specified as a 32-bit " "integer value. To disable painting set the 'fill-pattern' property to NULL" msgstr "" "32ãƒ“ãƒƒãƒˆã®æ•´æ•°å€¤ã§æŒ‡å®šã™ã‚‹ã‚¢ã‚¤ãƒ†ãƒ ã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†è‰²ã€‚塗りã¤ã¶ã•" "ãªã„å ´åˆã¯'fill-pattern'プロパティをNULLã«ã™ã‚‹" #: src/goocanvasitemsimple.c:261 msgid "Fill Pixbuf" msgstr "塗りã¤ã¶ã—用Pixbuf" #: src/goocanvasitemsimple.c:262 msgid "" "The pixbuf to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" "アイテムã®å†…å´ã‚’塗りã¤ã¶ã™ãŸã‚ã«ä½¿ã†Pixbuf。塗りã¤ã¶ã•ãªã„å ´åˆã¯'fill-" "pattern'プロパティをNULLã«ã™ã‚‹" # 「切り抜ã用ã€ã˜ã‚ƒãªãã¦ã€Œã‚¯ãƒªãƒƒãƒ”ングã€ã®æ–¹ãŒã„ã„? #: src/goocanvasitemsimple.c:312 msgid "Clip Path" msgstr "切り抜ã用パス" #: src/goocanvasitemsimple.c:313 msgid "The sequence of path commands specifying the clip path" msgstr "切り抜ã用パスを指定ã™ã‚‹ãƒ‘スコマンドã®ãªã‚‰ã³" #: src/goocanvasitemsimple.c:319 msgid "Clip Fill Rule" msgstr "切り抜ã用塗りã¤ã¶ã—基準" #: src/goocanvasitemsimple.c:320 msgid "The fill rule used to determine which parts of the item are clipped" msgstr "アイテムã®ä¸€éƒ¨ãŒåˆ‡ã‚ŠæŠœã‹ã‚Œã¦ã„ã‚‹ã‹ã‚’判断ã™ã‚‹ãŸã‚ã®å¡—りã¤ã¶ã—基準" #: src/goocanvaspath.c:70 msgid "Path Data" msgstr "パスデータ" #: src/goocanvaspath.c:71 msgid "The sequence of path commands" msgstr "パスコマンドã®ãªã‚‰ã³" #: src/goocanvaspath.c:78 #, fuzzy msgid "The x coordinate of the path" msgstr "テキスト㮠X 座標" #: src/goocanvaspath.c:86 #, fuzzy msgid "The y coordinate of the path" msgstr "テキスト㮠Y 座標" #: src/goocanvaspath.c:94 #, fuzzy msgid "The width of the path" msgstr "ç”»åƒã®å¹…" #: src/goocanvaspath.c:101 #, fuzzy msgid "The height of the path" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvaspolyline.c:142 msgid "Points" msgstr "点" #: src/goocanvaspolyline.c:143 msgid "The array of points" msgstr "点ã®é…列" #: src/goocanvaspolyline.c:149 msgid "Close Path" msgstr "パスを閉ã˜ã‚‹" #: src/goocanvaspolyline.c:150 msgid "If the last point should be connected to the first" msgstr "最後ã®ç‚¹ãŒæœ€åˆã®ç‚¹ã«çµã³ä»˜ã‘ã‚‹ã‹ã©ã†ã‹" #: src/goocanvaspolyline.c:156 msgid "Start Arrow" msgstr "始点矢å°" #: src/goocanvaspolyline.c:157 msgid "If an arrow should be displayed at the start of the polyline" msgstr "多線形ã®å§‹ç‚¹ã«çŸ¢å°ã‚’表示ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvaspolyline.c:163 msgid "End Arrow" msgstr "終点矢å°" #: src/goocanvaspolyline.c:164 msgid "If an arrow should be displayed at the end of the polyline" msgstr "多線形ã®çµ‚点ã«çŸ¢å°ã‚’表示ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvaspolyline.c:170 msgid "Arrow Length" msgstr "矢å°ã®é•·ã•" #: src/goocanvaspolyline.c:171 msgid "The length of the arrows, as a multiple of the line width" msgstr "矢å°ã®é•·ã• (ç·šå¹…ã®å€æ•°)" #: src/goocanvaspolyline.c:177 msgid "Arrow Width" msgstr "矢å°ã®å¹…" #: src/goocanvaspolyline.c:178 msgid "The width of the arrows, as a multiple of the line width" msgstr "矢å°ã®å¹… (ç·šå¹…ã®å€æ•°)" #: src/goocanvaspolyline.c:184 msgid "Arrow Tip Length" msgstr "矢å°ã®å…ˆç«¯ã®é•·ã•" #: src/goocanvaspolyline.c:185 msgid "The length of the arrow tip, as a multiple of the line width" msgstr "矢å°ã®å…ˆç«¯ã®é•·ã• (ç·šå¹…ã®å€æ•°)" #: src/goocanvaspolyline.c:192 #, fuzzy msgid "The x coordinate of the left-most point of the polyline" msgstr "楕円ã®ä¸­å¿ƒã® X 座標" #: src/goocanvaspolyline.c:200 #, fuzzy msgid "The y coordinate of the top-most point of the polyline" msgstr "楕円ã®ä¸­å¿ƒã® Y 座標" #: src/goocanvaspolyline.c:208 #, fuzzy msgid "The width of the polyline" msgstr "ç”»åƒã®å¹…" #: src/goocanvaspolyline.c:215 #, fuzzy msgid "The height of the polyline" msgstr "ç”»åƒã®é«˜ã•" #: src/goocanvasrect.c:61 msgid "The x coordinate of the rectangle" msgstr "長方形ã®x座標" #: src/goocanvasrect.c:69 msgid "The y coordinate of the rectangle" msgstr "長方形ã®y座標" #: src/goocanvasrect.c:77 msgid "The width of the rectangle" msgstr "長方形ã®å¹…" #: src/goocanvasrect.c:84 msgid "The height of the rectangle" msgstr "長方形ã®é«˜ã•" #: src/goocanvasrect.c:91 msgid "The horizontal radius to use for rounded corners" msgstr "丸角ã§ä½¿ã†æ°´å¹³åŠå¾„" #: src/goocanvasrect.c:98 msgid "The vertical radius to use for rounded corners" msgstr "丸角ã§ä½¿ã†åž‚ç›´åŠå¾„<" #: src/goocanvastable.c:237 msgid "Row Spacing" msgstr "行間ã®ç©ºç™½" #: src/goocanvastable.c:238 msgid "The default space between rows" msgstr "行ã®é–“ã®ãƒ‡ãƒ•ォルトã®ç©ºç™½" #: src/goocanvastable.c:244 msgid "Column Spacing" msgstr "列間ã®ç©ºç™½" #: src/goocanvastable.c:245 msgid "The default space between columns" msgstr "列ã®é–“ã®ãƒ‡ãƒ•ォルトã®ç©ºç™½" #: src/goocanvastable.c:251 msgid "Homogenous Rows" msgstr "å‡ä¸€ã®è¡Œ" #: src/goocanvastable.c:252 msgid "If all rows are the same height" msgstr "å…¨ã¦ã®è¡Œã‚’åŒã˜é«˜ã•ã«ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:258 msgid "Homogenous Columns" msgstr "å‡ä¸€ã®åˆ—" #: src/goocanvastable.c:259 msgid "If all columns are the same width" msgstr "å…¨ã¦ã®åˆ—ã‚’åŒã˜å¹…ã«ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:264 msgid "X Border Spacing" msgstr "Xæ–¹å‘ã®å¢ƒç•Œã®ç©ºç™½" #: src/goocanvastable.c:265 msgid "" "The amount of spacing between the lefmost and rightmost cells and the border " "grid line" msgstr "最左・最å³ã‚»ãƒ«ã¨å¢ƒç•Œã®æ ¼å­ç·šã®é–“ã®ç©ºç™½ã®ç·é‡" #: src/goocanvastable.c:270 msgid "Y Border Spacing" msgstr "Yæ–¹å‘ã®å¢ƒç•Œã®ç©ºç™½" #: src/goocanvastable.c:271 msgid "" "The amount of spacing between the topmost and bottommost cells and the " "border grid line" msgstr "最上・最下セルã¨å¢ƒç•Œã®æ ¼å­ç·šã®é–“ã®ç©ºç™½ã®ç·é‡" #: src/goocanvastable.c:277 msgid "The width of the grid line to draw between rows" msgstr "è¡Œé–“ã®æ ¼å­ç·šã®å¹…" #: src/goocanvastable.c:284 msgid "The width of the grid line to draw between columns" msgstr "åˆ—é–“ã®æ ¼å­ç·šã®å¹…" #: src/goocanvastable.c:293 msgid "Left Padding" msgstr "å·¦å´ãƒ‘ディング" #: src/goocanvastable.c:294 msgid "Extra space to add to the left of the item" msgstr "アイテムã®å·¦å´ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½" #: src/goocanvastable.c:299 msgid "Right Padding" msgstr "å³å´ãƒ‘ディング" #: src/goocanvastable.c:300 msgid "Extra space to add to the right of the item" msgstr "アイテムã®å³å´ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½" #: src/goocanvastable.c:305 msgid "Top Padding" msgstr "上部パディング" #: src/goocanvastable.c:306 msgid "Extra space to add above the item" msgstr "アイテムã®ä¸Šéƒ¨ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½" #: src/goocanvastable.c:311 msgid "Bottom Padding" msgstr "下部パディング" #: src/goocanvastable.c:312 msgid "Extra space to add below the item" msgstr "アイテムã®ä¸‹éƒ¨ã«åŠ ãˆã‚‹ä½™åˆ†ãªç©ºç™½" #: src/goocanvastable.c:318 msgid "X Align" msgstr "X æ–¹å‘ã®é…ç½®" #: src/goocanvastable.c:319 msgid "" "The horizontal position of the item within its allocated space. 0.0 is left-" "aligned, 1.0 is right-aligned" msgstr "領域中ã®ã‚¢ã‚¤ãƒ†ãƒ ã®æ°´å¹³ä½ç½®ã€‚0.0 ã¯å·¦è©°ã‚ã€1.0 ã¯å³è©°ã‚ã§ã™" #: src/goocanvastable.c:324 msgid "Y Align" msgstr "Y æ–¹å‘ã®é…ç½®" #: src/goocanvastable.c:325 msgid "" "The vertical position of the item within its allocated space. 0.0 is top-" "aligned, 1.0 is bottom-aligned" msgstr "領域中内ã§ã®ã‚¢ã‚¤ãƒ†ãƒ ã®åž‚ç›´ä½ç½®ã€‚0.0 ã¯ä¸Šè©°ã‚ã€1.0 ã¯ä¸‹è©°ã‚ã§ã™" #: src/goocanvastable.c:331 msgid "Row" msgstr "行" #: src/goocanvastable.c:332 msgid "The row to place the item in" msgstr "アイテムを置ã行" #: src/goocanvastable.c:337 msgid "Column" msgstr "列" #: src/goocanvastable.c:338 msgid "The column to place the item in" msgstr "アイテムを置ã列" #: src/goocanvastable.c:343 msgid "Rows" msgstr "行数" #: src/goocanvastable.c:344 msgid "The number of rows that the item spans" msgstr "アイテムãŒä½¿ã†è¡Œæ•°" #: src/goocanvastable.c:349 msgid "Columns" msgstr "列数" #: src/goocanvastable.c:350 msgid "The number of columns that the item spans" msgstr "アイテムãŒä½¿ã†åˆ—æ•°" #: src/goocanvastable.c:356 msgid "X Expand" msgstr "X æ–¹å‘ã®ä¼¸é•·" #: src/goocanvastable.c:357 msgid "If the item expands horizontally as the table expands" msgstr "表ãŒä¼¸é•·ã—ãŸã‚‰ã‚¢ã‚¤ãƒ†ãƒ ã‚’水平方å‘ã«ä¼¸é•·ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:362 msgid "X Fill" msgstr "X æ–¹å‘ã®å……å¡«" #: src/goocanvastable.c:363 msgid "If the item fills all horizontal allocated space" msgstr "ã‚¢ã‚¤ãƒ†ãƒ ãŒæ°´å¹³é ˜åŸŸã„ã£ã±ã„使ã†ã‹ã©ã†ã‹" #: src/goocanvastable.c:368 msgid "X Shrink" msgstr "X æ–¹å‘ã®ç¸®å°" #: src/goocanvastable.c:369 msgid "If the item can shrink smaller than its requested size horizontally" msgstr "アイテムãŒè¦æ±‚ã•ã‚ŒãŸæ°´å¹³æ–¹å‘ã®ã‚µã‚¤ã‚ºã‚ˆã‚Šã‚‚縮å°ã§ãã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:374 msgid "Y Expand" msgstr "Y æ–¹å‘ã®ä¼¸é•·" #: src/goocanvastable.c:375 msgid "If the item expands vertically as the table expands" msgstr "表ãŒä¼¸é•·ã—ãŸã‚‰ã‚¢ã‚¤ãƒ†ãƒ ã‚’垂直方å‘ã«ä¼¸é•·ã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastable.c:380 msgid "Y Fill" msgstr "Y æ–¹å‘ã®å……å¡«" #: src/goocanvastable.c:381 msgid "If the item fills all vertical allocated space" msgstr "アイテムãŒåž‚直領域ã„ã£ã±ã„使ã†ã‹ã©ã†ã‹" #: src/goocanvastable.c:386 msgid "Y Shrink" msgstr "Y æ–¹å‘ã®ç¸®å°" #: src/goocanvastable.c:387 msgid "If the item can shrink smaller than its requested size vertically" msgstr "アイテムãŒè¦æ±‚ã•れãŸåž‚ç›´æ–¹å‘ã®ã‚µã‚¤ã‚ºã‚ˆã‚Šã‚‚縮å°ã§ãã‚‹ã‹ã©ã†ã‹" #: src/goocanvastext.c:94 msgid "Text" msgstr "テキスト" #: src/goocanvastext.c:95 msgid "The text to display" msgstr "表示ã™ã‚‹ãƒ†ã‚­ã‚¹ãƒˆ" #: src/goocanvastext.c:101 msgid "Use Markup" msgstr "マークアップを使ã†" #: src/goocanvastext.c:102 msgid "Whether to parse PangoMarkup in the text, to support different styles" msgstr "ç•°ãªã‚‹ã‚¹ã‚¿ã‚¤ãƒ«ã‚’使ã†ãŸã‚ã«ãƒ†ã‚­ã‚¹ãƒˆä¸­ã®PangoMarkupをパースã™ã‚‹ã‹ã©ã†ã‹" #: src/goocanvastext.c:108 msgid "Ellipsize" msgstr "çœç•¥" #: src/goocanvastext.c:109 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "文字列全体を表示ã™ã‚‹å ´æ‰€ãŒç„¡ã„ã¨ãã«æ–‡å­—列をçœç•¥ã™ã‚‹ã¹ã場所" #: src/goocanvastext.c:116 msgid "Wrap" msgstr "折り返ã—" #: src/goocanvastext.c:117 msgid "The preferred method of wrapping the string if a width has been set" msgstr "å¹…ãŒè¨­å®šã•れã¦ã„ã‚‹ã¨ãã«æ–‡å­—åˆ—ã®æŠ˜ã‚Šè¿”ã—ã«ä½¿ã†ã¹ã方法" #: src/goocanvastext.c:126 msgid "The x coordinate of the text" msgstr "テキスト㮠X 座標" #: src/goocanvastext.c:134 msgid "The y coordinate of the text" msgstr "テキスト㮠Y 座標" #: src/goocanvastext.c:142 msgid "The width to use to layout the text" msgstr "テキストをé…ç½®ã™ã‚‹ãŸã‚ã«ä½¿ç”¨ã™ã‚‹å¹…" #: src/goocanvastext.c:150 #, fuzzy msgid "The height to use to layout the text, or -1 to use the natural height" msgstr "è¦æ±‚ã™ã‚‹è¡¨ã®é«˜ã•。デフォルトã®é«˜ã•を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvastext.c:159 msgid "How to position the text relative to the given x and y coordinates" msgstr "与ãˆã‚‰ã‚ŒãŸ X/Y 座標ã«å¯¾ã—ã¦ã©ã®ã‚ˆã†ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’é…ç½®ã™ã‚‹ã‹" #: src/goocanvastext.c:166 msgid "Alignment" msgstr "é…ç½®" #: src/goocanvastext.c:167 msgid "How to align the text" msgstr "ã©ã®ã‚ˆã†ã«ãƒ†ã‚­ã‚¹ãƒˆã‚’é…ç½®ã™ã‚‹ã‹" #: src/goocanvaswidget.c:549 msgid "Widget" msgstr "ウィジェット" #: src/goocanvaswidget.c:550 msgid "The widget to place in the canvas" msgstr "キャンãƒã‚¹å†…ã«é…ç½®ã™ã‚‹ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆ" #: src/goocanvaswidget.c:557 msgid "The x coordinate of the widget" msgstr "ウィジェット㮠X 座標" #: src/goocanvaswidget.c:565 msgid "The y coordinate of the widget" msgstr "ウィジェット㮠Y 座標" #: src/goocanvaswidget.c:573 msgid "The width of the widget, or -1 to use its requested width" msgstr "ウィジェットã®å¹…。ウィジェットãŒè¦æ±‚ã•れã¦ã„る幅を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvaswidget.c:581 msgid "The height of the widget, or -1 to use its requested height" msgstr "ウィジェットã®é«˜ã•。ウィジェットãŒè¦æ±‚ã•れã¦ã„る高ã•を使ã†ãªã‚‰ -1 ã§ã™" #: src/goocanvaswidget.c:590 msgid "" "How to position the widget relative to the item's x and y coordinate settings" msgstr "アイテム㮠X/Y座標ã®è¨­å®šã«å¯¾ã—ã¦ã©ã®ã‚ˆã†ã«ã‚¦ã‚£ã‚¸ã‚§ãƒƒãƒˆã‚’é…ç½®ã™ã‚‹ã‹" goocanvas-0.15/po/goocanvas.pot0000644000076400007640000005635311222156155013506 00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-29 16:23+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/goocanvas.c:284 msgid "Scale" msgstr "" #: src/goocanvas.c:285 msgid "The magnification factor of the canvas" msgstr "" #: src/goocanvas.c:291 msgid "Scale X" msgstr "" #: src/goocanvas.c:292 msgid "The horizontal magnification factor of the canvas" msgstr "" #: src/goocanvas.c:298 msgid "Scale Y" msgstr "" #: src/goocanvas.c:299 msgid "The vertical magnification factor of the canvas" msgstr "" #: src/goocanvas.c:305 src/goocanvastext.c:158 src/goocanvaswidget.c:589 msgid "Anchor" msgstr "" #: src/goocanvas.c:306 msgid "" "Where to place the canvas when it is smaller than the widget's allocated area" msgstr "" #: src/goocanvas.c:313 msgid "X1" msgstr "" #: src/goocanvas.c:314 msgid "The x coordinate of the left edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:321 msgid "Y1" msgstr "" #: src/goocanvas.c:322 msgid "The y coordinate of the top edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:329 msgid "X2" msgstr "" #: src/goocanvas.c:330 msgid "" "The x coordinate of the right edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:338 msgid "Y2" msgstr "" #: src/goocanvas.c:339 msgid "" "The y coordinate of the bottom edge of the canvas bounds, in canvas units" msgstr "" #: src/goocanvas.c:348 msgid "Automatic Bounds" msgstr "" #: src/goocanvas.c:349 msgid "" "If the bounds are automatically calculated based on the bounds of all the " "items in the canvas" msgstr "" #: src/goocanvas.c:355 msgid "Bounds From Origin" msgstr "" #: src/goocanvas.c:356 msgid "If the automatic bounds are calculated from the origin" msgstr "" #: src/goocanvas.c:362 msgid "Bounds Padding" msgstr "" #: src/goocanvas.c:363 msgid "The padding added to the automatic bounds" msgstr "" #: src/goocanvas.c:369 msgid "Units" msgstr "" #: src/goocanvas.c:370 msgid "The units to use for the canvas" msgstr "" #: src/goocanvas.c:377 msgid "Resolution X" msgstr "" #: src/goocanvas.c:378 msgid "The horizontal resolution of the display, in dots per inch" msgstr "" #: src/goocanvas.c:385 msgid "Resolution Y" msgstr "" #: src/goocanvas.c:386 msgid "The vertical resolution of the display, in dots per inch" msgstr "" #: src/goocanvas.c:394 msgid "Background Color" msgstr "" #: src/goocanvas.c:395 msgid "The color to use for the canvas background" msgstr "" #: src/goocanvas.c:401 msgid "Background Color RGB" msgstr "" #: src/goocanvas.c:402 msgid "" "The color to use for the canvas background, specified as a 24-bit integer " "value, 0xRRGGBB" msgstr "" #: src/goocanvas.c:408 msgid "Integer Layout" msgstr "" #: src/goocanvas.c:409 msgid "If all item layout is done to the nearest integer" msgstr "" #: src/goocanvas.c:415 msgid "Clear Background" msgstr "" #: src/goocanvas.c:416 msgid "If the background is cleared before the canvas is painted" msgstr "" #: src/goocanvas.c:422 msgid "Redraw When Scrolled" msgstr "" #: src/goocanvas.c:423 msgid "" "If the canvas is completely redrawn when scrolled, to reduce the flicker of " "static items" msgstr "" #: src/goocanvasellipse.c:77 msgid "Center X" msgstr "" #: src/goocanvasellipse.c:78 msgid "The x coordinate of the center of the ellipse" msgstr "" #: src/goocanvasellipse.c:85 msgid "Center Y" msgstr "" #: src/goocanvasellipse.c:86 msgid "The y coordinate of the center of the ellipse" msgstr "" #: src/goocanvasellipse.c:93 src/goocanvasrect.c:90 msgid "Radius X" msgstr "" #: src/goocanvasellipse.c:94 msgid "The horizontal radius of the ellipse" msgstr "" #: src/goocanvasellipse.c:100 src/goocanvasrect.c:97 msgid "Radius Y" msgstr "" #: src/goocanvasellipse.c:101 msgid "The vertical radius of the ellipse" msgstr "" #: src/goocanvasellipse.c:108 msgid "The x coordinate of the left side of the ellipse" msgstr "" #: src/goocanvasellipse.c:116 msgid "The y coordinate of the top of the ellipse" msgstr "" #: src/goocanvasellipse.c:123 src/goocanvasgrid.c:124 src/goocanvasgroup.c:106 #: src/goocanvasimage.c:107 src/goocanvaspath.c:93 src/goocanvaspolyline.c:207 #: src/goocanvasrect.c:76 src/goocanvastext.c:141 src/goocanvaswidget.c:572 msgid "Width" msgstr "" #: src/goocanvasellipse.c:124 msgid "The width of the ellipse" msgstr "" #: src/goocanvasellipse.c:130 src/goocanvasgrid.c:131 src/goocanvasgroup.c:114 #: src/goocanvasimage.c:114 src/goocanvaspath.c:100 #: src/goocanvaspolyline.c:214 src/goocanvasrect.c:83 src/goocanvastext.c:149 #: src/goocanvaswidget.c:580 msgid "Height" msgstr "" #: src/goocanvasellipse.c:131 msgid "The height of the ellipse" msgstr "" #: src/goocanvasgrid.c:109 msgid "The x coordinate of the grid" msgstr "" #: src/goocanvasgrid.c:117 msgid "The y coordinate of the grid" msgstr "" #: src/goocanvasgrid.c:125 msgid "The width of the grid" msgstr "" #: src/goocanvasgrid.c:132 msgid "The height of the grid" msgstr "" #: src/goocanvasgrid.c:139 msgid "The distance between the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:146 msgid "The distance between the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:153 msgid "The distance before the first vertical grid line" msgstr "" #: src/goocanvasgrid.c:160 msgid "The distance before the first horizontal grid line" msgstr "" #: src/goocanvasgrid.c:166 src/goocanvastable.c:276 msgid "Horizontal Grid Line Width" msgstr "" #: src/goocanvasgrid.c:167 msgid "The width of the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:174 src/goocanvastable.c:283 msgid "Vertical Grid Line Width" msgstr "" #: src/goocanvasgrid.c:175 msgid "The width of the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:182 msgid "Horizontal Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:183 msgid "The cairo pattern to paint the horizontal grid lines with" msgstr "" #: src/goocanvasgrid.c:189 msgid "Vertical Grid Line Pattern" msgstr "" #: src/goocanvasgrid.c:190 msgid "The cairo pattern to paint the vertical grid lines with" msgstr "" #: src/goocanvasgrid.c:196 msgid "Border Width" msgstr "" #: src/goocanvasgrid.c:197 msgid "The width of the border around the grid" msgstr "" #: src/goocanvasgrid.c:204 msgid "Border Pattern" msgstr "" #: src/goocanvasgrid.c:205 msgid "The cairo pattern to paint the border with" msgstr "" #: src/goocanvasgrid.c:211 msgid "Show Horizontal Grid Lines" msgstr "" #: src/goocanvasgrid.c:212 msgid "If the horizontal grid lines are shown" msgstr "" #: src/goocanvasgrid.c:218 msgid "Show Vertical Grid Lines" msgstr "" #: src/goocanvasgrid.c:219 msgid "If the vertical grid lines are shown" msgstr "" #: src/goocanvasgrid.c:225 msgid "Vertical Grid Lines On Top" msgstr "" #: src/goocanvasgrid.c:226 msgid "If the vertical grid lines are painted above the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:234 msgid "Horizontal Grid Line Color" msgstr "" #: src/goocanvasgrid.c:235 msgid "The color to use for the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:241 msgid "Horizontal Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:242 msgid "" "The color to use for the horizontal grid lines, specified as a 32-bit " "integer value" msgstr "" #: src/goocanvasgrid.c:248 msgid "Horizontal Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:249 msgid "The pixbuf to use to draw the horizontal grid lines" msgstr "" #: src/goocanvasgrid.c:255 msgid "Vertical Grid Line Color" msgstr "" #: src/goocanvasgrid.c:256 msgid "The color to use for the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:262 msgid "Vertical Grid Line Color RGBA" msgstr "" #: src/goocanvasgrid.c:263 msgid "" "The color to use for the vertical grid lines, specified as a 32-bit integer " "value" msgstr "" #: src/goocanvasgrid.c:269 msgid "Vertical Grid Line Pixbuf" msgstr "" #: src/goocanvasgrid.c:270 msgid "The pixbuf to use to draw the vertical grid lines" msgstr "" #: src/goocanvasgrid.c:276 msgid "Border Color" msgstr "" #: src/goocanvasgrid.c:277 msgid "The color to use for the border" msgstr "" #: src/goocanvasgrid.c:283 msgid "Border Color RGBA" msgstr "" #: src/goocanvasgrid.c:284 msgid "The color to use for the border, specified as a 32-bit integer value" msgstr "" #: src/goocanvasgrid.c:290 msgid "Border Pixbuf" msgstr "" #: src/goocanvasgrid.c:291 msgid "The pixbuf to use to draw the border" msgstr "" #: src/goocanvasgroup.c:91 msgid "The x coordinate of the group" msgstr "" #: src/goocanvasgroup.c:99 msgid "The y coordinate of the group" msgstr "" #: src/goocanvasgroup.c:107 msgid "The width of the group, or -1 to use the default width" msgstr "" #: src/goocanvasgroup.c:115 msgid "The height of the group, or -1 to use the default height" msgstr "" #: src/goocanvasimage.c:84 msgid "Pattern" msgstr "" #: src/goocanvasimage.c:85 msgid "The cairo pattern to paint" msgstr "" #: src/goocanvasimage.c:92 msgid "The x coordinate of the image" msgstr "" #: src/goocanvasimage.c:100 msgid "The y coordinate of the image" msgstr "" #: src/goocanvasimage.c:108 msgid "The width of the image" msgstr "" #: src/goocanvasimage.c:115 msgid "The height of the image" msgstr "" #: src/goocanvasimage.c:121 msgid "Scale To Fit" msgstr "" #: src/goocanvasimage.c:122 msgid "If the image is scaled to fit the width and height settings" msgstr "" #: src/goocanvasimage.c:128 msgid "Pixbuf" msgstr "" #: src/goocanvasimage.c:129 msgid "The GdkPixbuf to display" msgstr "" #: src/goocanvasitem.c:461 src/goocanvasitemmodel.c:219 msgid "Parent" msgstr "" #: src/goocanvasitem.c:462 msgid "The parent item" msgstr "" #: src/goocanvasitem.c:468 src/goocanvasitemmodel.c:226 msgid "Visibility" msgstr "" #: src/goocanvasitem.c:469 src/goocanvasitemmodel.c:227 msgid "When the canvas item is visible" msgstr "" #: src/goocanvasitem.c:476 src/goocanvasitemmodel.c:234 msgid "Visibility Threshold" msgstr "" #: src/goocanvasitem.c:477 src/goocanvasitemmodel.c:235 msgid "The scale threshold at which the item becomes visible" msgstr "" #: src/goocanvasitem.c:485 src/goocanvasitemmodel.c:243 msgid "Transform" msgstr "" #: src/goocanvasitem.c:486 src/goocanvasitemmodel.c:244 msgid "The transformation matrix of the item" msgstr "" #: src/goocanvasitem.c:492 src/goocanvasitemmodel.c:250 msgid "Pointer Events" msgstr "" #: src/goocanvasitem.c:493 src/goocanvasitemmodel.c:251 msgid "Specifies when the item receives pointer events" msgstr "" #: src/goocanvasitem.c:500 src/goocanvasitemmodel.c:258 msgid "Title" msgstr "" #: src/goocanvasitem.c:501 src/goocanvasitemmodel.c:259 msgid "" "A short context-rich description of the item for use by assistive " "technologies" msgstr "" #: src/goocanvasitem.c:507 src/goocanvasitemmodel.c:265 msgid "Description" msgstr "" #: src/goocanvasitem.c:508 src/goocanvasitemmodel.c:266 msgid "A description of the item for use by assistive technologies" msgstr "" #: src/goocanvasitem.c:514 src/goocanvasitemmodel.c:272 msgid "Can Focus" msgstr "" #: src/goocanvasitem.c:515 src/goocanvasitemmodel.c:273 msgid "If the item can take the keyboard focus" msgstr "" #: src/goocanvasitem.c:521 src/goocanvasitemmodel.c:279 msgid "Tooltip" msgstr "" #: src/goocanvasitem.c:522 src/goocanvasitemmodel.c:280 msgid "The tooltip to display for the item" msgstr "" #: src/goocanvasitemmodel.c:220 msgid "The parent item model" msgstr "" #: src/goocanvasitemsimple.c:126 msgid "Stroke Pattern" msgstr "" #: src/goocanvasitemsimple.c:127 msgid "" "The pattern to use to paint the perimeter of the item, or NULL disable " "painting" msgstr "" #: src/goocanvasitemsimple.c:133 msgid "Fill Pattern" msgstr "" #: src/goocanvasitemsimple.c:134 msgid "" "The pattern to use to paint the interior of the item, or NULL to disable " "painting" msgstr "" #: src/goocanvasitemsimple.c:140 msgid "Fill Rule" msgstr "" #: src/goocanvasitemsimple.c:141 msgid "The fill rule used to determine which parts of the item are filled" msgstr "" #: src/goocanvasitemsimple.c:148 msgid "Operator" msgstr "" #: src/goocanvasitemsimple.c:149 msgid "The compositing operator to use" msgstr "" #: src/goocanvasitemsimple.c:156 msgid "Antialias" msgstr "" #: src/goocanvasitemsimple.c:157 msgid "The antialiasing mode to use" msgstr "" #: src/goocanvasitemsimple.c:165 msgid "Line Width" msgstr "" #: src/goocanvasitemsimple.c:166 msgid "The line width to use for the item's perimeter" msgstr "" #: src/goocanvasitemsimple.c:172 msgid "Line Cap" msgstr "" #: src/goocanvasitemsimple.c:173 msgid "The line cap style to use" msgstr "" #: src/goocanvasitemsimple.c:180 msgid "Line Join" msgstr "" #: src/goocanvasitemsimple.c:181 msgid "The line join style to use" msgstr "" #: src/goocanvasitemsimple.c:188 msgid "Miter Limit" msgstr "" #: src/goocanvasitemsimple.c:189 msgid "" "The smallest angle to use with miter joins, in degrees. Bevel joins will be " "used below this limit" msgstr "" #: src/goocanvasitemsimple.c:195 msgid "Line Dash" msgstr "" #: src/goocanvasitemsimple.c:196 msgid "The dash pattern to use" msgstr "" #: src/goocanvasitemsimple.c:203 msgid "Font" msgstr "" #: src/goocanvasitemsimple.c:204 msgid "The base font to use for the text" msgstr "" #: src/goocanvasitemsimple.c:210 msgid "Font Description" msgstr "" #: src/goocanvasitemsimple.c:211 msgid "The attributes specifying which font to use" msgstr "" #: src/goocanvasitemsimple.c:217 msgid "Hint Metrics" msgstr "" #: src/goocanvasitemsimple.c:218 msgid "The hinting to be used for font metrics" msgstr "" #: src/goocanvasitemsimple.c:226 msgid "Stroke Color" msgstr "" #: src/goocanvasitemsimple.c:227 msgid "" "The color to use for the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:233 msgid "Stroke Color RGBA" msgstr "" #: src/goocanvasitemsimple.c:234 msgid "" "The color to use for the item's perimeter, specified as a 32-bit integer " "value. To disable painting set the 'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:240 msgid "Stroke Pixbuf" msgstr "" #: src/goocanvasitemsimple.c:241 msgid "" "The pixbuf to use to draw the item's perimeter. To disable painting set the " "'stroke-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:247 msgid "Fill Color" msgstr "" #: src/goocanvasitemsimple.c:248 msgid "" "The color to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:254 msgid "Fill Color RGBA" msgstr "" #: src/goocanvasitemsimple.c:255 msgid "" "The color to use to paint the interior of the item, specified as a 32-bit " "integer value. To disable painting set the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:261 msgid "Fill Pixbuf" msgstr "" #: src/goocanvasitemsimple.c:262 msgid "" "The pixbuf to use to paint the interior of the item. To disable painting set " "the 'fill-pattern' property to NULL" msgstr "" #: src/goocanvasitemsimple.c:312 msgid "Clip Path" msgstr "" #: src/goocanvasitemsimple.c:313 msgid "The sequence of path commands specifying the clip path" msgstr "" #: src/goocanvasitemsimple.c:319 msgid "Clip Fill Rule" msgstr "" #: src/goocanvasitemsimple.c:320 msgid "The fill rule used to determine which parts of the item are clipped" msgstr "" #: src/goocanvaspath.c:70 msgid "Path Data" msgstr "" #: src/goocanvaspath.c:71 msgid "The sequence of path commands" msgstr "" #: src/goocanvaspath.c:78 msgid "The x coordinate of the path" msgstr "" #: src/goocanvaspath.c:86 msgid "The y coordinate of the path" msgstr "" #: src/goocanvaspath.c:94 msgid "The width of the path" msgstr "" #: src/goocanvaspath.c:101 msgid "The height of the path" msgstr "" #: src/goocanvaspolyline.c:142 msgid "Points" msgstr "" #: src/goocanvaspolyline.c:143 msgid "The array of points" msgstr "" #: src/goocanvaspolyline.c:149 msgid "Close Path" msgstr "" #: src/goocanvaspolyline.c:150 msgid "If the last point should be connected to the first" msgstr "" #: src/goocanvaspolyline.c:156 msgid "Start Arrow" msgstr "" #: src/goocanvaspolyline.c:157 msgid "If an arrow should be displayed at the start of the polyline" msgstr "" #: src/goocanvaspolyline.c:163 msgid "End Arrow" msgstr "" #: src/goocanvaspolyline.c:164 msgid "If an arrow should be displayed at the end of the polyline" msgstr "" #: src/goocanvaspolyline.c:170 msgid "Arrow Length" msgstr "" #: src/goocanvaspolyline.c:171 msgid "The length of the arrows, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:177 msgid "Arrow Width" msgstr "" #: src/goocanvaspolyline.c:178 msgid "The width of the arrows, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:184 msgid "Arrow Tip Length" msgstr "" #: src/goocanvaspolyline.c:185 msgid "The length of the arrow tip, as a multiple of the line width" msgstr "" #: src/goocanvaspolyline.c:192 msgid "The x coordinate of the left-most point of the polyline" msgstr "" #: src/goocanvaspolyline.c:200 msgid "The y coordinate of the top-most point of the polyline" msgstr "" #: src/goocanvaspolyline.c:208 msgid "The width of the polyline" msgstr "" #: src/goocanvaspolyline.c:215 msgid "The height of the polyline" msgstr "" #: src/goocanvasrect.c:61 msgid "The x coordinate of the rectangle" msgstr "" #: src/goocanvasrect.c:69 msgid "The y coordinate of the rectangle" msgstr "" #: src/goocanvasrect.c:77 msgid "The width of the rectangle" msgstr "" #: src/goocanvasrect.c:84 msgid "The height of the rectangle" msgstr "" #: src/goocanvasrect.c:91 msgid "The horizontal radius to use for rounded corners" msgstr "" #: src/goocanvasrect.c:98 msgid "The vertical radius to use for rounded corners" msgstr "" #: src/goocanvastable.c:237 msgid "Row Spacing" msgstr "" #: src/goocanvastable.c:238 msgid "The default space between rows" msgstr "" #: src/goocanvastable.c:244 msgid "Column Spacing" msgstr "" #: src/goocanvastable.c:245 msgid "The default space between columns" msgstr "" #: src/goocanvastable.c:251 msgid "Homogenous Rows" msgstr "" #: src/goocanvastable.c:252 msgid "If all rows are the same height" msgstr "" #: src/goocanvastable.c:258 msgid "Homogenous Columns" msgstr "" #: src/goocanvastable.c:259 msgid "If all columns are the same width" msgstr "" #: src/goocanvastable.c:264 msgid "X Border Spacing" msgstr "" #: src/goocanvastable.c:265 msgid "" "The amount of spacing between the lefmost and rightmost cells and the border " "grid line" msgstr "" #: src/goocanvastable.c:270 msgid "Y Border Spacing" msgstr "" #: src/goocanvastable.c:271 msgid "" "The amount of spacing between the topmost and bottommost cells and the " "border grid line" msgstr "" #: src/goocanvastable.c:277 msgid "The width of the grid line to draw between rows" msgstr "" #: src/goocanvastable.c:284 msgid "The width of the grid line to draw between columns" msgstr "" #: src/goocanvastable.c:293 msgid "Left Padding" msgstr "" #: src/goocanvastable.c:294 msgid "Extra space to add to the left of the item" msgstr "" #: src/goocanvastable.c:299 msgid "Right Padding" msgstr "" #: src/goocanvastable.c:300 msgid "Extra space to add to the right of the item" msgstr "" #: src/goocanvastable.c:305 msgid "Top Padding" msgstr "" #: src/goocanvastable.c:306 msgid "Extra space to add above the item" msgstr "" #: src/goocanvastable.c:311 msgid "Bottom Padding" msgstr "" #: src/goocanvastable.c:312 msgid "Extra space to add below the item" msgstr "" #: src/goocanvastable.c:318 msgid "X Align" msgstr "" #: src/goocanvastable.c:319 msgid "" "The horizontal position of the item within its allocated space. 0.0 is left-" "aligned, 1.0 is right-aligned" msgstr "" #: src/goocanvastable.c:324 msgid "Y Align" msgstr "" #: src/goocanvastable.c:325 msgid "" "The vertical position of the item within its allocated space. 0.0 is top-" "aligned, 1.0 is bottom-aligned" msgstr "" #: src/goocanvastable.c:331 msgid "Row" msgstr "" #: src/goocanvastable.c:332 msgid "The row to place the item in" msgstr "" #: src/goocanvastable.c:337 msgid "Column" msgstr "" #: src/goocanvastable.c:338 msgid "The column to place the item in" msgstr "" #: src/goocanvastable.c:343 msgid "Rows" msgstr "" #: src/goocanvastable.c:344 msgid "The number of rows that the item spans" msgstr "" #: src/goocanvastable.c:349 msgid "Columns" msgstr "" #: src/goocanvastable.c:350 msgid "The number of columns that the item spans" msgstr "" #: src/goocanvastable.c:356 msgid "X Expand" msgstr "" #: src/goocanvastable.c:357 msgid "If the item expands horizontally as the table expands" msgstr "" #: src/goocanvastable.c:362 msgid "X Fill" msgstr "" #: src/goocanvastable.c:363 msgid "If the item fills all horizontal allocated space" msgstr "" #: src/goocanvastable.c:368 msgid "X Shrink" msgstr "" #: src/goocanvastable.c:369 msgid "If the item can shrink smaller than its requested size horizontally" msgstr "" #: src/goocanvastable.c:374 msgid "Y Expand" msgstr "" #: src/goocanvastable.c:375 msgid "If the item expands vertically as the table expands" msgstr "" #: src/goocanvastable.c:380 msgid "Y Fill" msgstr "" #: src/goocanvastable.c:381 msgid "If the item fills all vertical allocated space" msgstr "" #: src/goocanvastable.c:386 msgid "Y Shrink" msgstr "" #: src/goocanvastable.c:387 msgid "If the item can shrink smaller than its requested size vertically" msgstr "" #: src/goocanvastext.c:94 msgid "Text" msgstr "" #: src/goocanvastext.c:95 msgid "The text to display" msgstr "" #: src/goocanvastext.c:101 msgid "Use Markup" msgstr "" #: src/goocanvastext.c:102 msgid "Whether to parse PangoMarkup in the text, to support different styles" msgstr "" #: src/goocanvastext.c:108 msgid "Ellipsize" msgstr "" #: src/goocanvastext.c:109 msgid "" "The preferred place to ellipsize the string, if the label does not have " "enough room to display the entire string" msgstr "" #: src/goocanvastext.c:116 msgid "Wrap" msgstr "" #: src/goocanvastext.c:117 msgid "The preferred method of wrapping the string if a width has been set" msgstr "" #: src/goocanvastext.c:126 msgid "The x coordinate of the text" msgstr "" #: src/goocanvastext.c:134 msgid "The y coordinate of the text" msgstr "" #: src/goocanvastext.c:142 msgid "The width to use to layout the text" msgstr "" #: src/goocanvastext.c:150 msgid "The height to use to layout the text, or -1 to use the natural height" msgstr "" #: src/goocanvastext.c:159 msgid "How to position the text relative to the given x and y coordinates" msgstr "" #: src/goocanvastext.c:166 msgid "Alignment" msgstr "" #: src/goocanvastext.c:167 msgid "How to align the text" msgstr "" #: src/goocanvaswidget.c:549 msgid "Widget" msgstr "" #: src/goocanvaswidget.c:550 msgid "The widget to place in the canvas" msgstr "" #: src/goocanvaswidget.c:557 msgid "The x coordinate of the widget" msgstr "" #: src/goocanvaswidget.c:565 msgid "The y coordinate of the widget" msgstr "" #: src/goocanvaswidget.c:573 msgid "The width of the widget, or -1 to use its requested width" msgstr "" #: src/goocanvaswidget.c:581 msgid "The height of the widget, or -1 to use its requested height" msgstr "" #: src/goocanvaswidget.c:590 msgid "" "How to position the widget relative to the item's x and y coordinate settings" msgstr "" goocanvas-0.15/aclocal.m40000644000076400007640000106233611222155655012227 00000000000000# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_if(m4_PACKAGE_VERSION, [2.61],, [m4_fatal([this file was generated for autoconf 2.61. You have another version of autoconf. If you want to use that, you should regenerate the build system entirely.], [63])]) # Copyright (C) 1995-2002 Free Software Foundation, Inc. # Copyright (C) 2001-2003,2004 Red Hat, Inc. # # This file is free software, distributed under the terms of the GNU # General Public License. As a special exception to the GNU General # Public License, this file may be distributed as part of a program # that contains a configuration script generated by Autoconf, under # the same distribution terms as the rest of that program. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # # Macro to add for using GNU gettext. # Ulrich Drepper , 1995, 1996 # # Modified to never use included libintl. # Owen Taylor , 12/15/1998 # # Major rework to remove unused code # Owen Taylor , 12/11/2002 # # Added better handling of ALL_LINGUAS from GNU gettext version # written by Bruno Haible, Owen Taylor 5/30/3002 # # Modified to require ngettext # Matthias Clasen 08/06/2004 # # We need this here as well, since someone might use autoconf-2.5x # to configure GLib then an older version to configure a package # using AM_GLIB_GNU_GETTEXT AC_PREREQ(2.53) dnl dnl We go to great lengths to make sure that aclocal won't dnl try to pull in the installed version of these macros dnl when running aclocal in the glib directory. dnl m4_copy([AC_DEFUN],[glib_DEFUN]) m4_copy([AC_REQUIRE],[glib_REQUIRE]) dnl dnl At the end, if we're not within glib, we'll define the public dnl definitions in terms of our private definitions. dnl # GLIB_LC_MESSAGES #-------------------- glib_DEFUN([GLIB_LC_MESSAGES], [AC_CHECK_HEADERS([locale.h]) if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) # GLIB_PATH_PROG_WITH_TEST #---------------------------- dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) glib_DEFUN([GLIB_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) # GLIB_WITH_NLS #----------------- glib_DEFUN([GLIB_WITH_NLS], dnl NLS is obligatory [USE_NLS=yes AC_SUBST(USE_NLS) gt_cv_have_gettext=no CATOBJEXT=NONE XGETTEXT=: INTLLIBS= AC_CHECK_HEADER(libintl.h, [gt_cv_func_dgettext_libintl="no" libintl_extra_libs="" # # First check in libc # AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc, [AC_TRY_LINK([ #include ], [return !ngettext ("","", 1)], gt_cv_func_ngettext_libc=yes, gt_cv_func_ngettext_libc=no) ]) if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc, [AC_TRY_LINK([ #include ], [return !dgettext ("","")], gt_cv_func_dgettext_libc=yes, gt_cv_func_dgettext_libc=no) ]) fi if test "$gt_cv_func_ngettext_libc" = "yes" ; then AC_CHECK_FUNCS(bind_textdomain_codeset) fi # # If we don't have everything we want, check in libintl # if test "$gt_cv_func_dgettext_libc" != "yes" \ || test "$gt_cv_func_ngettext_libc" != "yes" \ || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then AC_CHECK_LIB(intl, bindtextdomain, [AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dgettext, gt_cv_func_dgettext_libintl=yes)])]) if test "$gt_cv_func_dgettext_libintl" != "yes" ; then AC_MSG_CHECKING([if -liconv is needed to use gettext]) AC_MSG_RESULT([]) AC_CHECK_LIB(intl, ngettext, [AC_CHECK_LIB(intl, dcgettext, [gt_cv_func_dgettext_libintl=yes libintl_extra_libs=-liconv], :,-liconv)], :,-liconv) fi # # If we found libintl, then check in it for bind_textdomain_codeset(); # we'll prefer libc if neither have bind_textdomain_codeset(), # and both have dgettext and ngettext # if test "$gt_cv_func_dgettext_libintl" = "yes" ; then glib_save_LIBS="$LIBS" LIBS="$LIBS -lintl $libintl_extra_libs" unset ac_cv_func_bind_textdomain_codeset AC_CHECK_FUNCS(bind_textdomain_codeset) LIBS="$glib_save_LIBS" if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then gt_cv_func_dgettext_libc=no else if test "$gt_cv_func_dgettext_libc" = "yes" \ && test "$gt_cv_func_ngettext_libc" = "yes"; then gt_cv_func_dgettext_libintl=no fi fi fi fi if test "$gt_cv_func_dgettext_libc" = "yes" \ || test "$gt_cv_func_dgettext_libintl" = "yes"; then gt_cv_have_gettext=yes fi if test "$gt_cv_func_dgettext_libintl" = "yes"; then INTLLIBS="-lintl $libintl_extra_libs" fi if test "$gt_cv_have_gettext" = "yes"; then AC_DEFINE(HAVE_GETTEXT,1, [Define if the GNU gettext() function is already present or preinstalled.]) GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then glib_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) MSGFMT_OPTS= AC_MSG_CHECKING([if msgfmt accepts -c]) GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[ msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: test 1.0\n" "PO-Revision-Date: 2007-02-15 12:01+0100\n" "Last-Translator: test \n" "Language-Team: C \n" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" ], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) AC_SUBST(MSGFMT_OPTS) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr], [CATOBJEXT=.gmo DATADIRNAME=share], [case $host in *-*-solaris*) dnl On Solaris, if bind_textdomain_codeset is in libc, dnl GNU format message catalog is always supported, dnl since both are added to the libc all together. dnl Hence, we'd like to go with DATADIRNAME=share and dnl and CATOBJEXT=.gmo in this case. AC_CHECK_FUNC(bind_textdomain_codeset, [CATOBJEXT=.gmo DATADIRNAME=share], [CATOBJEXT=.mo DATADIRNAME=lib]) ;; *) CATOBJEXT=.mo DATADIRNAME=lib ;; esac]) LIBS="$glib_save_LIBS" INSTOBJEXT=.mo else gt_cv_have_gettext=no fi fi ]) if test "$gt_cv_have_gettext" = "yes" ; then AC_DEFINE(ENABLE_NLS, 1, [always defined to indicate that i18n is enabled]) fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is not GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi # We need to process the po/ directory. POSUB=po AC_OUTPUT_COMMANDS( [case "$CONFIG_FILES" in *po/Makefile.in*) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile esac]) dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.in. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(DATADIRNAME) AC_SUBST(GMOFILES) AC_SUBST(INSTOBJEXT) AC_SUBST(INTLLIBS) AC_SUBST(PO_IN_DATADIR_TRUE) AC_SUBST(PO_IN_DATADIR_FALSE) AC_SUBST(POFILES) AC_SUBST(POSUB) ]) # AM_GLIB_GNU_GETTEXT # ------------------- # Do checks necessary for use of gettext. If a suitable implementation # of gettext is found in either in libintl or in the C library, # it will set INTLLIBS to the libraries needed for use of gettext # and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable # gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST() # on various variables needed by the Makefile.in.in installed by # glib-gettextize. dnl glib_DEFUN([GLIB_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_HEADER_STDC])dnl GLIB_LC_MESSAGES GLIB_WITH_NLS if test "$gt_cv_have_gettext" = "yes"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but ($top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) dnl Generate list of files to be processed by xgettext which will dnl be included in po/Makefile. test -d po || mkdir po if test "x$srcdir" != "x."; then if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then posrcprefix="$srcdir/" else posrcprefix="../$srcdir/" fi else posrcprefix="../" fi rm -f po/POTFILES sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES ]) # AM_GLIB_DEFINE_LOCALEDIR(VARIABLE) # ------------------------------- # Define VARIABLE to the location where catalog files will # be installed by po/Makefile. glib_DEFUN([GLIB_DEFINE_LOCALEDIR], [glib_REQUIRE([GLIB_GNU_GETTEXT])dnl glib_save_prefix="$prefix" glib_save_exec_prefix="$exec_prefix" glib_save_datarootdir="$datarootdir" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix datarootdir=`eval echo "${datarootdir}"` if test "x$CATOBJEXT" = "x.mo" ; then localedir=`eval echo "${libdir}/locale"` else localedir=`eval echo "${datadir}/locale"` fi prefix="$glib_save_prefix" exec_prefix="$glib_save_exec_prefix" datarootdir="$glib_save_datarootdir" AC_DEFINE_UNQUOTED($1, "$localedir", [Define the location where the catalogs will be installed]) ]) dnl dnl Now the definitions that aclocal will find dnl ifdef(glib_configure_in,[],[ AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)]) AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)]) ])dnl # GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL]) # # Create a temporary file with TEST-FILE as its contents and pass the # file name to PROGRAM. Perform ACTION-IF-PASS if PROGRAM exits with # 0 and perform ACTION-IF-FAIL for any other exit status. AC_DEFUN([GLIB_RUN_PROG], [cat >conftest.foo <<_ACEOF $2 _ACEOF if AC_RUN_LOG([$1 conftest.foo]); then m4_ifval([$3], [$3], [:]) m4_ifvaln([$4], [else $4])dnl echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD fi]) dnl -*- mode: autoconf -*- # serial 1 dnl Usage: dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) AC_DEFUN([GTK_DOC_CHECK], [ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first dnl for overriding the documentation installation directory AC_ARG_WITH([html-dir], AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, [with_html_dir='${datadir}/gtk-doc/html']) HTML_DIR="$with_html_dir" AC_SUBST([HTML_DIR]) dnl enable/disable documentation building AC_ARG_ENABLE([gtk-doc], AS_HELP_STRING([--enable-gtk-doc], [use gtk-doc to build documentation [[default=no]]]),, [enable_gtk_doc=no]) if test x$enable_gtk_doc = xyes; then ifelse([$1],[], [PKG_CHECK_EXISTS([gtk-doc],, AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], [PKG_CHECK_EXISTS([gtk-doc >= $1],, AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build gtk-doc]))]) fi AC_MSG_CHECKING([whether to build gtk-doc documentation]) AC_MSG_RESULT($enable_gtk_doc) AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,) AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) ]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # serial 51 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [AC_REQUIRE([LT_AC_PROG_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string=`eval $cmd`) 2>/dev/null && echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) libsuff=64 case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) LD="${LD-ld} -64" ;; esac ;; esac fi rm -rf conftest* ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # ------------------ AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" m4_if($1,[],[ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi if test -z "$LTCFLAGS"; then eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 DLLs AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- # set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognize shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognize a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # it is assumed to be `libltdl'. LIBLTDL will be prefixed with # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' # (note the single quotes!). If your package is not flat and you're not # using automake, define top_builddir and top_srcdir appropriately in # the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, # and an installed libltdl is not found, it is assumed to be `libltdl'. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and top_srcdir # appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # ------------------ AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # ------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. # So that behaviour is only enabled if SCOABSPATH is set to a # non-empty value in the environment. Most likely only useful for # creating official distributions of packages. # This is a hack until libtool officially supports absolute path # names for shared libraries. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_AC_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac ])# AC_LIBTOOL_POSTDEP_PREDEP # AC_LIBTOOL_LANG_F77_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) AC_DEFUN([_LT_AC_LANG_F77_CONFIG], [AC_REQUIRE([AC_PROG_F77]) AC_LANG_PUSH(Fortran 77) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_AC_TAGVAR(GCC, $1)="$G77" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_F77_CONFIG # AC_LIBTOOL_LANG_GCJ_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], [AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_GCJ_CONFIG # AC_LIBTOOL_LANG_RC_CONFIG # ------------------------- # Ensure that the configuration vars for the Windows resource compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) AC_DEFUN([_LT_AC_LANG_RC_CONFIG], [AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes AC_LIBTOOL_CONFIG($1) AC_LANG_RESTORE CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_RC_CONFIG # AC_LIBTOOL_CONFIG([TAGNAME]) # ---------------------------- # If TAGNAME is not passed, then create an initial libtool script # with a default configuration from the untagged config vars. Otherwise # add code to config.status for appending the configuration named by # TAGNAME from the matching tagged config vars. AC_DEFUN([AC_LIBTOOL_CONFIG], [# The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ _LT_AC_TAGVAR(compiler, $1) \ _LT_AC_TAGVAR(CC, $1) \ _LT_AC_TAGVAR(LD, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ _LT_AC_TAGVAR(old_archive_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ _LT_AC_TAGVAR(predep_objects, $1) \ _LT_AC_TAGVAR(postdep_objects, $1) \ _LT_AC_TAGVAR(predeps, $1) \ _LT_AC_TAGVAR(postdeps, $1) \ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ _LT_AC_TAGVAR(archive_cmds, $1) \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ _LT_AC_TAGVAR(postinstall_cmds, $1) \ _LT_AC_TAGVAR(postuninstall_cmds, $1) \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ _LT_AC_TAGVAR(allow_undefined_flag, $1) \ _LT_AC_TAGVAR(no_undefined_flag, $1) \ _LT_AC_TAGVAR(export_symbols_cmds, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ _LT_AC_TAGVAR(hardcode_automatic, $1) \ _LT_AC_TAGVAR(module_cmds, $1) \ _LT_AC_TAGVAR(module_expsym_cmds, $1) \ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ _LT_AC_TAGVAR(fix_srcfile_path, $1) \ _LT_AC_TAGVAR(exclude_expsyms, $1) \ _LT_AC_TAGVAR(include_expsyms, $1); do case $var in _LT_AC_TAGVAR(old_archive_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ _LT_AC_TAGVAR(archive_cmds, $1) | \ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ _LT_AC_TAGVAR(module_cmds, $1) | \ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\[$]0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` ;; esac ifelse([$1], [], [cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" AC_MSG_NOTICE([creating $ofile])], [cfgfile="$ofile"]) cat <<__EOF__ >> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # LTCC compiler flags. LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([LT_AC_PROG_SED]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux* | k*bsd*-gnu) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac # # Check to make sure the static flag actually works. # wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_REQUIRE([LT_AC_PROG_SED])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; *) tmp_sharedflag='-shared' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case $host_os in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # Cheap backport of AS_EXECUTABLE_P and required macros # from Autoconf 2.59; we should not use $as_executable_p directly. # _AS_TEST_PREPARE # ---------------- m4_ifndef([_AS_TEST_PREPARE], [m4_defun([_AS_TEST_PREPARE], [if test -x / >/dev/null 2>&1; then as_executable_p='test -x' else as_executable_p='test -f' fi ])])# _AS_TEST_PREPARE # AS_EXECUTABLE_P # --------------- # Check whether a file is executable. m4_ifndef([AS_EXECUTABLE_P], [m4_defun([AS_EXECUTABLE_P], [AS_REQUIRE([_AS_TEST_PREPARE])dnl $as_executable_p $1[]dnl ])])# AS_EXECUTABLE_P # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR goocanvas-0.15/ltmain.sh0000644000076400007640000060446510665257023012215 00000000000000# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007 Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.24 TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)" # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= duplicate_deps=no preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 ##################################### # Shell function definitions: # This seems to be the best place for them # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $mkdir "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || { $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 exit $EXIT_FAILURE } fi $echo "X$my_tmpdir" | $Xsed } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ $SED -n -e '1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) extracted_serial=`expr $extracted_serial + 1` my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then exit $exit_status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" disable_libs=no # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) echo "\ $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP Copyright (C) 2007 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag preserve_args="$preserve_args --tag" ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi case $disable_libs in no) ;; shared) build_libtool_libs=no build_old_libs=yes ;; static) build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` ;; esac # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.[fF][09]?) xform=[fF][09]. ;; *.for) xform=for ;; *.java) xform=java ;; *.obj) xform=obj ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qlibobj="\"$qlibobj\"" ;; esac test "X$libobj" != "X$qlibobj" \ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework|darwin_framework_skip) test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework|-arch|-isysroot) case " $CC " in *" ${arg} ${1} "* | *" ${arg} ${1} "*) prev=darwin_framework_skip ;; *) compiler_flags="$compiler_flags $arg" prev=darwin_framework ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" notinst_path="$notinst_path $dir" fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" compiler_flags="$compiler_flags $arg" continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then exit $exit_status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $absdir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes ; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP ": [^:]* bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then major=`expr $current - $age` else major=`expr $current - $age + 1` fi case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name=`expr $a_deplib : '-l\(.*\)'` # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then case $archive_cmds in *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; esac else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then $show "${rm}r $gentop" $run ${rm}r "$gentop" fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac else $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* ) $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. case $host in *cygwin* | *mingw* ) if test -f "$output_objdir/${outputname}.def" ; then compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` else compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` fi ;; * ) compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` ;; esac ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" exit_status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $exit_status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) output_name=`basename $output` output_path=`dirname $output` cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) /* -DDEBUG is fairly common in CFLAGS. */ #undef DEBUG #if defined DEBUGWRAPPER # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) #else # define DEBUG(format, ...) #endif const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); const char * base_name (const char *name); char * find_executable(const char *wrapper); int check_executable(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup (base_name (argv[0])); DEBUG("(main) argv[0] : %s\n",argv[0]); DEBUG("(main) program_name : %s\n",program_name); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = find_executable(argv[0]); if (newargz[1] == NULL) lt_fatal("Couldn't find %s", argv[0]); DEBUG("(main) found exe at : %s\n",newargz[1]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; for (i=0; i> $cwrappersource <> $cwrappersource <> $cwrappersource <<"EOF" return 127; } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char)name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable(const char * path) { struct stat st; DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && ( /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ #if defined (S_IXOTH) ((st.st_mode & S_IXOTH) == S_IXOTH) || #endif #if defined (S_IXGRP) ((st.st_mode & S_IXGRP) == S_IXGRP) || #endif ((st.st_mode & S_IXUSR) == S_IXUSR)) ) return 1; else return 0; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise */ char * find_executable (const char* wrapper) { int has_slash = 0; const char* p; const char* p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char* concat_name; DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char* path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char* q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR(*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable(concat_name)) return concat_name; XFREE(concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen(tmp); concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable(concat_name)) return concat_name; XFREE(concat_name); return NULL; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \$*\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" exit_status=$? if test "$exit_status" -ne 0 && test ! -d "$gentop"; then exit $exit_status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` else relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' fi exit $lt_exit } done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # Note that it is not necessary on cygwin/mingw to append a dot to # foo even if both foo and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. # # If there is no directory component, then add one. case $wrapper in */* | *\\*) . ${wrapper} ;; *) . ./${wrapper} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir=`func_mktempdir` file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "X----------------------------------------------------------------------" | $Xsed $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared disable_libs=shared # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static disable_libs=static # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: goocanvas-0.15/INSTALL0000644000076400007640000002231010656605223011404 00000000000000Installation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. goocanvas-0.15/Makefile.in0000644000076400007640000005224011222156057012421 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/goocanvas.pc.in $(top_srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \ depcomp install-sh ltmain.sh missing mkinstalldirs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = goocanvas.pc SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(pkgconfigdir)" pkgconfigDATA_INSTALL = $(INSTALL_DATA) DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src demo docs po # require automake 1.7 AUTOMAKE_OPTIONS = 1.7 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = goocanvas.pc EXTRA_DIST = goocanvas.pc.in autogen.sh all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 goocanvas.pc: $(top_builddir)/config.status $(srcdir)/goocanvas.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(DATA) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-pkgconfigDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: goocanvas-0.15/config.sub0000755000076400007640000007772610665257023012364 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-04-29' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: goocanvas-0.15/src/0000777000076400007640000000000011222215702011215 500000000000000goocanvas-0.15/src/goocanvasgroup.h0000644000076400007640000000677511172574677014405 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasgroup.h - group item. */ #ifndef __GOO_CANVAS_GROUP_H__ #define __GOO_CANVAS_GROUP_H__ #include #include "goocanvasitemsimple.h" #include "goocanvasutils.h" G_BEGIN_DECLS #define GOO_TYPE_CANVAS_GROUP (goo_canvas_group_get_type ()) #define GOO_CANVAS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_GROUP, GooCanvasGroup)) #define GOO_CANVAS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_GROUP, GooCanvasGroupClass)) #define GOO_IS_CANVAS_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_GROUP)) #define GOO_IS_CANVAS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_GROUP)) #define GOO_CANVAS_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_GROUP, GooCanvasGroupClass)) typedef struct _GooCanvasGroup GooCanvasGroup; typedef struct _GooCanvasGroupClass GooCanvasGroupClass; typedef struct _GooCanvasGroupModel GooCanvasGroupModel; typedef struct _GooCanvasGroupModelClass GooCanvasGroupModelClass; /** * GooCanvasGroup * * The #GooCanvasGroup-struct struct contains private data only. */ struct _GooCanvasGroup { GooCanvasItemSimple parent_object; /* An array of pointers to GooCanvasItems. The first element is at the bottom of the display stack and the last element is at the top. */ GPtrArray *items; }; struct _GooCanvasGroupClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_group_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_group_new (GooCanvasItem *parent, ...); #define GOO_TYPE_CANVAS_GROUP_MODEL (goo_canvas_group_model_get_type ()) #define GOO_CANVAS_GROUP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_GROUP_MODEL, GooCanvasGroupModel)) #define GOO_CANVAS_GROUP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_GROUP_MODEL, GooCanvasGroupModelClass)) #define GOO_IS_CANVAS_GROUP_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_GROUP_MODEL)) #define GOO_IS_CANVAS_GROUP_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_GROUP_MODEL)) #define GOO_CANVAS_GROUP_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_GROUP_MODEL, GooCanvasGroupModelClass)) /** * GooCanvasGroupModel * * The #GooCanvasGroupModel-struct struct contains private data only. */ struct _GooCanvasGroupModel { GooCanvasItemModelSimple parent_object; /* An array of pointers to GooCanvasItemModels. The first element is at the bottom of the display stack and the last element is at the top. */ GPtrArray *children; }; struct _GooCanvasGroupModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_group_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_group_model_new (GooCanvasItemModel *parent, ...); G_END_DECLS #endif /* __GOO_CANVAS_GROUP_H__ */ goocanvas-0.15/src/goocanvastable.h0000644000076400007640000000775211172574677014334 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvastable.h - table item. */ #ifndef __GOO_CANVAS_TABLE_H__ #define __GOO_CANVAS_TABLE_H__ #include #include "goocanvasgroup.h" G_BEGIN_DECLS typedef struct _GooCanvasTableDimension GooCanvasTableDimension; struct _GooCanvasTableDimension { gint size; gdouble default_spacing; /* These are specific spacings for particular rows or columns. A negative value indicates that the default should be used. */ gdouble *spacings; guint homogeneous : 1; }; /* This is the data used by both model and view classes. */ typedef struct _GooCanvasTableData GooCanvasTableData; typedef struct _GooCanvasTableLayoutData GooCanvasTableLayoutData; struct _GooCanvasTableData { /* The explicitly set width or height, or -1. */ gdouble width, height; /* One for rows & one for columns. */ GooCanvasTableDimension dimensions[2]; gdouble border_width; /* An array of GooCanvasTableChild. */ GArray *children; GooCanvasTableLayoutData *layout_data; }; #define GOO_TYPE_CANVAS_TABLE (goo_canvas_table_get_type ()) #define GOO_CANVAS_TABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TABLE, GooCanvasTable)) #define GOO_CANVAS_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TABLE, GooCanvasTableClass)) #define GOO_IS_CANVAS_TABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_TABLE)) #define GOO_IS_CANVAS_TABLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_TABLE)) #define GOO_CANVAS_TABLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_TABLE, GooCanvasTableClass)) typedef struct _GooCanvasTable GooCanvasTable; typedef struct _GooCanvasTableClass GooCanvasTableClass; /** * GooCanvasTable * * The #GooCanvasTable-struct struct contains private data only. */ struct _GooCanvasTable { GooCanvasGroup parent; GooCanvasTableData *table_data; }; struct _GooCanvasTableClass { GooCanvasGroupClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_table_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_table_new (GooCanvasItem *parent, ...); #define GOO_TYPE_CANVAS_TABLE_MODEL (goo_canvas_table_model_get_type ()) #define GOO_CANVAS_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TABLE_MODEL, GooCanvasTableModel)) #define GOO_CANVAS_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TABLE_MODEL, GooCanvasTableModelClass)) #define GOO_IS_CANVAS_TABLE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_TABLE_MODEL)) #define GOO_IS_CANVAS_TABLE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_TABLE_MODEL)) #define GOO_CANVAS_TABLE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_TABLE_MODEL, GooCanvasTableModelClass)) typedef struct _GooCanvasTableModel GooCanvasTableModel; typedef struct _GooCanvasTableModelClass GooCanvasTableModelClass; /** * GooCanvasTableModel * * The #GooCanvasTableModel-struct struct contains private data only. */ struct _GooCanvasTableModel { GooCanvasGroupModel parent_object; GooCanvasTableData table_data; }; struct _GooCanvasTableModelClass { GooCanvasGroupModelClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_table_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_table_model_new (GooCanvasItemModel *parent, ...); G_END_DECLS #endif /* __GOO_CANVAS_TABLE_H__ */ goocanvas-0.15/src/goocanvasprivate.h0000644000076400007640000000326511172574677014712 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasprivate.h - private types & utility functions. */ #ifndef __GOO_CANVAS_PRIVATE_H__ #define __GOO_CANVAS_PRIVATE_H__ #include #include "goocanvasstyle.h" G_BEGIN_DECLS /* * GPtrArray extensions. */ void goo_canvas_util_ptr_array_insert (GPtrArray *ptr_array, gpointer data, gint index); void goo_canvas_util_ptr_array_move (GPtrArray *ptr_array, gint old_index, gint new_index); gint goo_canvas_util_ptr_array_find_index (GPtrArray *ptr_array, gpointer data); cairo_pattern_t* goo_canvas_cairo_pattern_from_pixbuf (GdkPixbuf *pixbuf); cairo_surface_t* goo_canvas_cairo_surface_from_pixbuf (GdkPixbuf *pixbuf); guint goo_canvas_convert_colors_to_rgba (double red, double green, double blue, double alpha); void goo_canvas_get_rgba_value_from_pattern (cairo_pattern_t *pattern, GValue *value); void goo_canvas_set_style_property_from_pattern (GooCanvasStyle *style, GQuark property_id, cairo_pattern_t *pattern); cairo_pattern_t* goo_canvas_create_pattern_from_color_value (const GValue *value); cairo_pattern_t* goo_canvas_create_pattern_from_rgba_value (const GValue *value); cairo_pattern_t* goo_canvas_create_pattern_from_pixbuf_value (const GValue *value); gboolean goo_canvas_boolean_handled_accumulator (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy); G_END_DECLS #endif /* __GOO_CANVAS_PRIVATE_H__ */ goocanvas-0.15/src/goocanvastext.h0000644000076400007640000001006711172574677014222 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvastext.h - text item. */ #ifndef __GOO_CANVAS_TEXT_H__ #define __GOO_CANVAS_TEXT_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasTextData GooCanvasTextData; struct _GooCanvasTextData { gchar *text; gdouble x, y, width; guint use_markup : 1; guint anchor : 5; /* GtkAnchorType */ guint alignment : 3; /* PangoAlignment */ guint ellipsize : 3; /* PangoEllipsizeMode */ guint wrap : 3; /* PangoWrapMode */ }; #define GOO_TYPE_CANVAS_TEXT (goo_canvas_text_get_type ()) #define GOO_CANVAS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TEXT, GooCanvasText)) #define GOO_CANVAS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TEXT, GooCanvasTextClass)) #define GOO_IS_CANVAS_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_TEXT)) #define GOO_IS_CANVAS_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_TEXT)) #define GOO_CANVAS_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_TEXT, GooCanvasTextClass)) typedef struct _GooCanvasText GooCanvasText; typedef struct _GooCanvasTextClass GooCanvasTextClass; /** * GooCanvasText * * The #GooCanvasText-struct struct contains private data only. */ struct _GooCanvasText { GooCanvasItemSimple parent; GooCanvasTextData *text_data; gdouble layout_width; }; struct _GooCanvasTextClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_text_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_text_new (GooCanvasItem *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...); void goo_canvas_text_get_natural_extents (GooCanvasText *text, PangoRectangle *ink_rect, PangoRectangle *logical_rect); #define GOO_TYPE_CANVAS_TEXT_MODEL (goo_canvas_text_model_get_type ()) #define GOO_CANVAS_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextModel)) #define GOO_CANVAS_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextModelClass)) #define GOO_IS_CANVAS_TEXT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_TEXT_MODEL)) #define GOO_IS_CANVAS_TEXT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_TEXT_MODEL)) #define GOO_CANVAS_TEXT_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextModelClass)) typedef struct _GooCanvasTextModel GooCanvasTextModel; typedef struct _GooCanvasTextModelClass GooCanvasTextModelClass; /** * GooCanvasTextModel * * The #GooCanvasTextModel-struct struct contains private data only. */ struct _GooCanvasTextModel { GooCanvasItemModelSimple parent_object; GooCanvasTextData text_data; }; struct _GooCanvasTextModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_text_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_text_model_new (GooCanvasItemModel *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...); G_END_DECLS #endif /* __GOO_CANVAS_TEXT_H__ */ goocanvas-0.15/src/goocanvasitemmodel.h0000644000076400007640000002650211172574677015216 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitemmodel.h - interface for canvas item models. */ #ifndef __GOO_CANVAS_ITEM_MODEL_H__ #define __GOO_CANVAS_ITEM_MODEL_H__ #include #include "goocanvasitem.h" G_BEGIN_DECLS #define GOO_TYPE_CANVAS_ITEM_MODEL (goo_canvas_item_model_get_type ()) #define GOO_CANVAS_ITEM_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ITEM_MODEL, GooCanvasItemModel)) #define GOO_IS_CANVAS_ITEM_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ITEM_MODEL)) #define GOO_CANVAS_ITEM_MODEL_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GOO_TYPE_CANVAS_ITEM_MODEL, GooCanvasItemModelIface)) /** * GooCanvasItemModel * * #GooCanvasItemModel is a typedef used for objects that implement the * #GooCanvasItemModel interface. * * (There is no actual #GooCanvasItemModel struct, since it is only an interface. * But using '#GooCanvasItemModel' is more helpful than using '#GObject'.) */ /* The typedef is in goocanvasitem.h */ /*typedef struct _GooCanvasItemModel GooCanvasItemModel;*/ /** * GooCanvasItemModelIface * @get_n_children: returns the number of children of the model. * @get_child: returns the child at the given index. * @add_child: adds a child. * @move_child: moves a child up or down the stacking order. * @remove_child: removes a child. * @get_child_property: gets a child property of a given child model, * e.g. the "row" or "column" property of a model in a #GooCanvasTableModel. * @set_child_property: sets a child property for a given child model. * @get_parent: gets the model's parent. * @set_parent: sets the model's parent. * @create_item: creates a default canvas item to view the model. * @get_transform: gets the model's transformation matrix. * @set_transform: sets the model's transformation matrix. * @get_style: gets the model's style. * @set_style: sets the model's style. * @child_added: signal emitted when a child is added. * @child_moved: signal emitted when a child is moved in the stacking order. * @child_removed: signal emitted when a child is removed. * @changed: signal emitted when the model has changed. * @child_notify: signal emitted when a child property has changed. * @animation_finished: signal emitted when the model's animation has finished. * * #GooCanvasItemModelIFace holds the virtual methods that make up the * #GooCanvasItemModel interface. * * Simple item models only need to implement the get_parent(), set_parent() * and create_item() methods. * * Items that support transforms should also implement get_transform() and * set_transform(). Items that support styles should implement get_style() * and set_style(). * * Container items must implement get_n_children() and get_child(). * Containers that support dynamic changes to their children should implement * add_child(), move_child() and remove_child(). * Layout containers like #GooCanvasTable may implement * get_child_property() and set_child_property(). */ typedef struct _GooCanvasItemModelIface GooCanvasItemModelIface; struct _GooCanvasItemModelIface { /*< private >*/ GTypeInterface base_iface; /*< public >*/ /* Virtual methods that group models must implement. */ gint (* get_n_children) (GooCanvasItemModel *model); GooCanvasItemModel* (* get_child) (GooCanvasItemModel *model, gint child_num); /* Virtual methods that group models may implement. */ void (* add_child) (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position); void (* move_child) (GooCanvasItemModel *model, gint old_position, gint new_position); void (* remove_child) (GooCanvasItemModel *model, gint child_num); void (* get_child_property) (GooCanvasItemModel *model, GooCanvasItemModel *child, guint property_id, GValue *value, GParamSpec *pspec); void (* set_child_property) (GooCanvasItemModel *item, GooCanvasItemModel *child, guint property_id, const GValue *value, GParamSpec *pspec); /* Virtual methods that all item models must implement. */ GooCanvasItemModel* (* get_parent) (GooCanvasItemModel *model); void (* set_parent) (GooCanvasItemModel *model, GooCanvasItemModel *parent); GooCanvasItem* (* create_item) (GooCanvasItemModel *model, GooCanvas *canvas); /* Virtual methods that all item models may implement. */ gboolean (* get_transform) (GooCanvasItemModel *model, cairo_matrix_t *transform); void (* set_transform) (GooCanvasItemModel *model, const cairo_matrix_t *transform); GooCanvasStyle* (* get_style) (GooCanvasItemModel *model); void (* set_style) (GooCanvasItemModel *model, GooCanvasStyle *style); /* Signals. */ void (* child_added) (GooCanvasItemModel *model, gint child_num); void (* child_moved) (GooCanvasItemModel *model, gint old_child_num, gint new_child_num); void (* child_removed) (GooCanvasItemModel *model, gint child_num); void (* changed) (GooCanvasItemModel *model, gboolean recompute_bounds); void (* child_notify) (GooCanvasItemModel *model, GParamSpec *pspec); void (* animation_finished) (GooCanvasItemModel *model, gboolean stopped); /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); void (*_goo_canvas_reserved5) (void); void (*_goo_canvas_reserved6) (void); void (*_goo_canvas_reserved7) (void); }; GType goo_canvas_item_model_get_type (void) G_GNUC_CONST; /* * Group functions - these should only be called on container models. */ gint goo_canvas_item_model_get_n_children (GooCanvasItemModel *model); GooCanvasItemModel* goo_canvas_item_model_get_child (GooCanvasItemModel *model, gint child_num); void goo_canvas_item_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position); void goo_canvas_item_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position); void goo_canvas_item_model_remove_child (GooCanvasItemModel *model, gint child_num); gint goo_canvas_item_model_find_child (GooCanvasItemModel *model, GooCanvasItemModel *child); void goo_canvas_item_model_get_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, GValue *value); void goo_canvas_item_model_set_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, const GValue *value); void goo_canvas_item_model_get_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...) G_GNUC_NULL_TERMINATED; void goo_canvas_item_model_set_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...) G_GNUC_NULL_TERMINATED; void goo_canvas_item_model_get_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args); void goo_canvas_item_model_set_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args); /* * Model functions - these are safe to call on all models. */ GooCanvasItemModel* goo_canvas_item_model_get_parent (GooCanvasItemModel *model); void goo_canvas_item_model_set_parent (GooCanvasItemModel *model, GooCanvasItemModel *parent); void goo_canvas_item_model_remove (GooCanvasItemModel *model); gboolean goo_canvas_item_model_is_container (GooCanvasItemModel *model); void goo_canvas_item_model_raise (GooCanvasItemModel *model, GooCanvasItemModel *above); void goo_canvas_item_model_lower (GooCanvasItemModel *model, GooCanvasItemModel *below); gboolean goo_canvas_item_model_get_transform (GooCanvasItemModel *model, cairo_matrix_t *transform); void goo_canvas_item_model_set_transform (GooCanvasItemModel *model, const cairo_matrix_t *transform); gboolean goo_canvas_item_model_get_simple_transform (GooCanvasItemModel *model, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation); void goo_canvas_item_model_set_simple_transform (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble rotation); void goo_canvas_item_model_translate (GooCanvasItemModel *model, gdouble tx, gdouble ty); void goo_canvas_item_model_scale (GooCanvasItemModel *model, gdouble sx, gdouble sy); void goo_canvas_item_model_rotate (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_model_skew_x (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_model_skew_y (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy); GooCanvasStyle* goo_canvas_item_model_get_style (GooCanvasItemModel *model); void goo_canvas_item_model_set_style (GooCanvasItemModel *model, GooCanvasStyle *style); void goo_canvas_item_model_animate (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); void goo_canvas_item_model_stop_animation (GooCanvasItemModel *model); /* * Functions to support child properties when implementing new canvas items. */ void goo_canvas_item_model_class_install_child_property (GObjectClass *mclass, guint property_id, GParamSpec *pspec); GParamSpec* goo_canvas_item_model_class_find_child_property (GObjectClass *mclass, const gchar *property_name); GParamSpec** goo_canvas_item_model_class_list_child_properties (GObjectClass *mclass, guint *n_properties); G_END_DECLS #endif /* __GOO_CANVAS_ITEM_MODEL_H__ */ goocanvas-0.15/src/goocanvasenumtypes.h0000644000076400007640000000152011200564376015244 00000000000000 /* Generated data (by glib-mkenums) */ #ifndef __GOO_CANVAS_ENUM_TYPES_H__ #define __GOO_CANVAS_ENUM_TYPES_H__ #include G_BEGIN_DECLS /* Enumerations from "goocanvasitem.h" */ GType goo_canvas_animate_type_get_type (void); #define GOO_TYPE_CANVAS_ANIMATE_TYPE (goo_canvas_animate_type_get_type()) /* Enumerations from "goocanvasutils.h" */ GType goo_canvas_pointer_events_get_type (void); #define GOO_TYPE_CANVAS_POINTER_EVENTS (goo_canvas_pointer_events_get_type()) GType goo_canvas_item_visibility_get_type (void); #define GOO_TYPE_CANVAS_ITEM_VISIBILITY (goo_canvas_item_visibility_get_type()) GType goo_canvas_path_command_type_get_type (void); #define GOO_TYPE_CANVAS_PATH_COMMAND_TYPE (goo_canvas_path_command_type_get_type()) G_END_DECLS #endif /* __GOO_CANVAS_ENUM_TYPES_H__ */ /* Generated data ends here */ goocanvas-0.15/src/goocanvas.c0000644000076400007640000037630411222120116013264 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvas.c - the main canvas widget. */ /** * SECTION: goocanvas * @Title: GooCanvas * @Short_Description: the main canvas widget. * * #GooCanvas is the main widget containing a number of canvas items. * * Here is a simple example: * * * #include <goocanvas.h> * * static gboolean on_rect_button_press (GooCanvasItem *view, * GooCanvasItem *target, * GdkEventButton *event, * gpointer data); * * int * main (int argc, char *argv[]) * { * GtkWidget *window, *scrolled_win, *canvas; * GooCanvasItem *root, *rect_item, *text_item; * * /* Initialize GTK+. */ * gtk_set_locale (); * gtk_init (&argc, &argv); * * /* Create the window and widgets. */ * window = gtk_window_new (GTK_WINDOW_TOPLEVEL); * gtk_window_set_default_size (GTK_WINDOW (window), 640, 600); * gtk_widget_show (window); * g_signal_connect (window, "delete_event", (GtkSignalFunc) on_delete_event, * NULL); * * scrolled_win = gtk_scrolled_window_new (NULL, NULL); * gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), * GTK_SHADOW_IN); * gtk_widget_show (scrolled_win); * gtk_container_add (GTK_CONTAINER (window), scrolled_win); * * canvas = goo_canvas_new (); * gtk_widget_set_size_request (canvas, 600, 450); * goo_canvas_set_bounds (GOO_CANVAS (canvas), 0, 0, 1000, 1000); * gtk_widget_show (canvas); * gtk_container_add (GTK_CONTAINER (scrolled_win), canvas); * * root = goo_canvas_get_root_item (GOO_CANVAS (canvas)); * * /* Add a few simple items. */ * rect_item = goo_canvas_rect_new (root, 100, 100, 400, 400, * "line-width", 10.0, * "radius-x", 20.0, * "radius-y", 10.0, * "stroke-color", "yellow", * "fill-color", "red", * NULL); * * text_item = goo_canvas_text_new (root, "Hello World", 300, 300, -1, * GTK_ANCHOR_CENTER, * "font", "Sans 24", * NULL); * goo_canvas_item_rotate (text_item, 45, 300, 300); * * /* Connect a signal handler for the rectangle item. */ * g_signal_connect (rect_item, "button_press_event", * (GtkSignalFunc) on_rect_button_press, NULL); * * /* Pass control to the GTK+ main event loop. */ * gtk_main (); * * return 0; * } * * * /* This handles button presses in item views. We simply output a message to * the console. */ * static gboolean * on_rect_button_press (GooCanvasItem *item, * GooCanvasItem *target, * GdkEventButton *event, * gpointer data) * { * g_print ("rect item received button press event\n"); * return TRUE; * } * * */ #include #include #include #include #include "goocanvasatk.h" #include "goocanvas.h" #include "goocanvasitemmodel.h" #include "goocanvasitem.h" #include "goocanvasgroup.h" #include "goocanvasmarshal.h" #define GOO_CANVAS_GET_PRIVATE(canvas) \ (G_TYPE_INSTANCE_GET_PRIVATE ((canvas), GOO_TYPE_CANVAS, GooCanvasPrivate)) typedef struct _GooCanvasPrivate GooCanvasPrivate; struct _GooCanvasPrivate { GooCanvasItem *static_root_item; GooCanvasItemModel *static_root_item_model; gint window_x, window_y; }; enum { PROP_0, PROP_SCALE, PROP_SCALE_X, PROP_SCALE_Y, PROP_ANCHOR, PROP_X1, PROP_Y1, PROP_X2, PROP_Y2, PROP_AUTOMATIC_BOUNDS, PROP_BOUNDS_FROM_ORIGIN, PROP_BOUNDS_PADDING, PROP_UNITS, PROP_RESOLUTION_X, PROP_RESOLUTION_Y, PROP_BACKGROUND_COLOR, PROP_BACKGROUND_COLOR_RGB, PROP_INTEGER_LAYOUT, PROP_CLEAR_BACKGROUND, PROP_REDRAW_WHEN_SCROLLED }; enum { ITEM_CREATED, LAST_SIGNAL }; static guint canvas_signals[LAST_SIGNAL] = { 0 }; static void goo_canvas_dispose (GObject *object); static void goo_canvas_finalize (GObject *object); static void goo_canvas_realize (GtkWidget *widget); static void goo_canvas_unrealize (GtkWidget *widget); static void goo_canvas_map (GtkWidget *widget); static void goo_canvas_style_set (GtkWidget *widget, GtkStyle *old_style); static void goo_canvas_size_request (GtkWidget *widget, GtkRequisition *requisition); static void goo_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void goo_canvas_set_adjustments (GooCanvas *canvas, GtkAdjustment *hadj, GtkAdjustment *vadj); static gboolean goo_canvas_expose_event (GtkWidget *widget, GdkEventExpose *event); static gboolean goo_canvas_button_press (GtkWidget *widget, GdkEventButton *event); static gboolean goo_canvas_button_release (GtkWidget *widget, GdkEventButton *event); static gboolean goo_canvas_motion (GtkWidget *widget, GdkEventMotion *event); static gboolean goo_canvas_scroll (GtkWidget *widget, GdkEventScroll *event); static gboolean goo_canvas_focus (GtkWidget *widget, GtkDirectionType direction); static gboolean goo_canvas_key_press (GtkWidget *widget, GdkEventKey *event); static gboolean goo_canvas_key_release (GtkWidget *widget, GdkEventKey *event); static gboolean goo_canvas_crossing (GtkWidget *widget, GdkEventCrossing *event); static gboolean goo_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event); static gboolean goo_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event); static gboolean goo_canvas_grab_broken (GtkWidget *widget, GdkEventGrabBroken *event); static void goo_canvas_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void goo_canvas_remove (GtkContainer *container, GtkWidget *widget); static void goo_canvas_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); static gboolean goo_canvas_query_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip); static void goo_canvas_set_scale_internal (GooCanvas *canvas, gdouble scale_x, gdouble scale_y); static void set_item_pointer (GooCanvasItem **item, GooCanvasItem *new_item); static void update_pointer_item (GooCanvas *canvas, GdkEvent *event); static void reconfigure_canvas (GooCanvas *canvas, gboolean redraw_if_needed); static void goo_canvas_update_automatic_bounds (GooCanvas *canvas); static void goo_canvas_convert_to_static_item_space (GooCanvas *canvas, gdouble *x, gdouble *y); G_DEFINE_TYPE (GooCanvas, goo_canvas, GTK_TYPE_CONTAINER) /* This evaluates to TRUE if an item is still in the canvas. */ #define ITEM_IS_VALID(item) (goo_canvas_item_get_canvas (item)) #define GOO_CANVAS_DEFAULT_WIDTH 1000.0 #define GOO_CANVAS_DEFAULT_HEIGHT 1000.0 static void goo_canvas_class_init (GooCanvasClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GtkWidgetClass *widget_class = (GtkWidgetClass*) klass; GtkContainerClass *container_class = (GtkContainerClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasPrivate)); gobject_class->dispose = goo_canvas_dispose; gobject_class->finalize = goo_canvas_finalize; gobject_class->get_property = goo_canvas_get_property; gobject_class->set_property = goo_canvas_set_property; widget_class->realize = goo_canvas_realize; widget_class->unrealize = goo_canvas_unrealize; widget_class->map = goo_canvas_map; widget_class->size_request = goo_canvas_size_request; widget_class->size_allocate = goo_canvas_size_allocate; widget_class->style_set = goo_canvas_style_set; widget_class->expose_event = goo_canvas_expose_event; widget_class->button_press_event = goo_canvas_button_press; widget_class->button_release_event = goo_canvas_button_release; widget_class->motion_notify_event = goo_canvas_motion; widget_class->scroll_event = goo_canvas_scroll; widget_class->focus = goo_canvas_focus; widget_class->key_press_event = goo_canvas_key_press; widget_class->key_release_event = goo_canvas_key_release; widget_class->enter_notify_event = goo_canvas_crossing; widget_class->leave_notify_event = goo_canvas_crossing; widget_class->focus_in_event = goo_canvas_focus_in; widget_class->focus_out_event = goo_canvas_focus_out; widget_class->grab_broken_event = goo_canvas_grab_broken; widget_class->query_tooltip = goo_canvas_query_tooltip; container_class->remove = goo_canvas_remove; container_class->forall = goo_canvas_forall; klass->set_scroll_adjustments = goo_canvas_set_adjustments; /* Register our accessible factory, but only if accessibility is enabled. */ if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET))) { atk_registry_set_factory_type (atk_get_default_registry (), GOO_TYPE_CANVAS, goo_canvas_accessible_factory_get_type ()); } g_object_class_install_property (gobject_class, PROP_SCALE, g_param_spec_double ("scale", _("Scale"), _("The magnification factor of the canvas"), 0.0, G_MAXDOUBLE, 1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALE_X, g_param_spec_double ("scale-x", _("Scale X"), _("The horizontal magnification factor of the canvas"), 0.0, G_MAXDOUBLE, 1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALE_Y, g_param_spec_double ("scale-y", _("Scale Y"), _("The vertical magnification factor of the canvas"), 0.0, G_MAXDOUBLE, 1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ANCHOR, g_param_spec_enum ("anchor", _("Anchor"), _("Where to place the canvas when it is smaller than the widget's allocated area"), GTK_TYPE_ANCHOR_TYPE, GTK_ANCHOR_NW, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X1, g_param_spec_double ("x1", _("X1"), _("The x coordinate of the left edge of the canvas bounds, in canvas units"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y1, g_param_spec_double ("y1", _("Y1"), _("The y coordinate of the top edge of the canvas bounds, in canvas units"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X2, g_param_spec_double ("x2", _("X2"), _("The x coordinate of the right edge of the canvas bounds, in canvas units"), -G_MAXDOUBLE, G_MAXDOUBLE, GOO_CANVAS_DEFAULT_WIDTH, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y2, g_param_spec_double ("y2", _("Y2"), _("The y coordinate of the bottom edge of the canvas bounds, in canvas units"), -G_MAXDOUBLE, G_MAXDOUBLE, GOO_CANVAS_DEFAULT_HEIGHT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_AUTOMATIC_BOUNDS, g_param_spec_boolean ("automatic-bounds", _("Automatic Bounds"), _("If the bounds are automatically calculated based on the bounds of all the items in the canvas"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BOUNDS_FROM_ORIGIN, g_param_spec_boolean ("bounds-from-origin", _("Bounds From Origin"), _("If the automatic bounds are calculated from the origin"), TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BOUNDS_PADDING, g_param_spec_double ("bounds-padding", _("Bounds Padding"), _("The padding added to the automatic bounds"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_UNITS, g_param_spec_enum ("units", _("Units"), _("The units to use for the canvas"), GTK_TYPE_UNIT, GTK_UNIT_PIXEL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RESOLUTION_X, g_param_spec_double ("resolution-x", _("Resolution X"), _("The horizontal resolution of the display, in dots per inch"), 0.0, G_MAXDOUBLE, 96.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RESOLUTION_Y, g_param_spec_double ("resolution-y", _("Resolution Y"), _("The vertical resolution of the display, in dots per inch"), 0.0, G_MAXDOUBLE, 96.0, G_PARAM_READWRITE)); /* Convenience properties - writable only. */ g_object_class_install_property (gobject_class, PROP_BACKGROUND_COLOR, g_param_spec_string ("background-color", _("Background Color"), _("The color to use for the canvas background"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_BACKGROUND_COLOR_RGB, g_param_spec_uint ("background-color-rgb", _("Background Color RGB"), _("The color to use for the canvas background, specified as a 24-bit integer value, 0xRRGGBB"), 0, G_MAXUINT, 0, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_INTEGER_LAYOUT, g_param_spec_boolean ("integer-layout", _("Integer Layout"), _("If all item layout is done to the nearest integer"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CLEAR_BACKGROUND, g_param_spec_boolean ("clear-background", _("Clear Background"), _("If the background is cleared before the canvas is painted"), TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_REDRAW_WHEN_SCROLLED, g_param_spec_boolean ("redraw-when-scrolled", _("Redraw When Scrolled"), _("If the canvas is completely redrawn when scrolled, to reduce the flicker of static items"), FALSE, G_PARAM_READWRITE)); /** * GooCanvas::set-scroll-adjustments * @canvas: the canvas. * @hadjustment: the horizontal adjustment. * @vadjustment: the vertical adjustment. * * This is used when the #GooCanvas is placed inside a #GtkScrolledWindow, * to connect up the adjustments so scrolling works properly. * * It isn't useful for applications. */ widget_class->set_scroll_adjustments_signal = g_signal_new ("set_scroll_adjustments", G_OBJECT_CLASS_TYPE (gobject_class), G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, G_STRUCT_OFFSET (GooCanvasClass, set_scroll_adjustments), NULL, NULL, goo_canvas_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT); /* Signals. */ /** * GooCanvas::item-created * @canvas: the canvas. * @item: the new item. * @model: the item's model. * * This is emitted when a new canvas item is created, in model/view mode. * * Applications can set up signal handlers for the new items here. */ canvas_signals[ITEM_CREATED] = g_signal_new ("item-created", G_TYPE_FROM_CLASS (gobject_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasClass, item_created), NULL, NULL, goo_canvas_marshal_VOID__OBJECT_OBJECT, G_TYPE_NONE, 2, GOO_TYPE_CANVAS_ITEM, GOO_TYPE_CANVAS_ITEM_MODEL); } static void goo_canvas_init (GooCanvas *canvas) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); /* We set GTK_CAN_FOCUS by default, so it works as people expect. Though developers can turn this off if not needed for efficiency. */ GTK_WIDGET_SET_FLAGS (canvas, GTK_CAN_FOCUS); canvas->scale_x = 1.0; canvas->scale_y = 1.0; canvas->scale = 1.0; canvas->need_update = TRUE; canvas->need_entire_subtree_update = TRUE; canvas->crossing_event.type = GDK_LEAVE_NOTIFY; canvas->anchor = GTK_ANCHOR_NORTH_WEST; canvas->clear_background = TRUE; canvas->redraw_when_scrolled = FALSE; /* Set the default bounds to a reasonable size. */ canvas->bounds.x1 = 0.0; canvas->bounds.y1 = 0.0; canvas->bounds.x2 = GOO_CANVAS_DEFAULT_WIDTH; canvas->bounds.y2 = GOO_CANVAS_DEFAULT_HEIGHT; canvas->automatic_bounds = FALSE; canvas->bounds_from_origin = TRUE; canvas->bounds_padding = 0.0; canvas->units = GTK_UNIT_PIXEL; canvas->resolution_x = 96.0; canvas->resolution_y = 96.0; /* Create our own adjustments, in case we aren't inserted into a scrolled window. The accessibility code needs these. */ canvas->hadjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); canvas->vadjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); g_object_ref_sink (canvas->hadjustment); g_object_ref_sink (canvas->vadjustment); canvas->model_to_item = g_hash_table_new (g_direct_hash, g_direct_equal); /* Use a simple group as the default root item, which is fine 99% of the time. Apps can set their own root item if required. */ canvas->root_item = goo_canvas_group_new (NULL, NULL); goo_canvas_item_set_canvas (canvas->root_item, canvas); priv->static_root_item = goo_canvas_group_new (NULL, NULL); goo_canvas_item_set_canvas (priv->static_root_item, canvas); goo_canvas_item_set_is_static (priv->static_root_item, TRUE); priv->static_root_item_model = NULL; priv->window_x = 0; priv->window_y = 0; } /** * goo_canvas_new: * * Creates a new #GooCanvas widget. * * A #GooCanvasGroup is created automatically as the root item of the canvas, * though this can be overriden with goo_canvas_set_root_item() or * goo_canvas_set_root_item_model(). * * Returns: a new #GooCanvas widget. **/ GtkWidget* goo_canvas_new (void) { return GTK_WIDGET (g_object_new (GOO_TYPE_CANVAS, NULL)); } static void goo_canvas_dispose (GObject *object) { GooCanvas *canvas = (GooCanvas*) object; GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); if (canvas->model_to_item) { g_hash_table_destroy (canvas->model_to_item); canvas->model_to_item = NULL; } if (canvas->root_item) { g_object_unref (canvas->root_item); canvas->root_item = NULL; } if (canvas->root_item_model) { g_object_unref (canvas->root_item_model); canvas->root_item_model = NULL; } if (priv->static_root_item) { g_object_unref (priv->static_root_item); priv->static_root_item = NULL; } if (priv->static_root_item_model) { g_object_unref (priv->static_root_item_model); priv->static_root_item_model = NULL; } if (canvas->idle_id) { g_source_remove (canvas->idle_id); canvas->idle_id = 0; } /* Release any references we hold to items. */ set_item_pointer (&canvas->pointer_item, NULL); set_item_pointer (&canvas->pointer_grab_item, NULL); set_item_pointer (&canvas->pointer_grab_initial_item, NULL); set_item_pointer (&canvas->focused_item, NULL); set_item_pointer (&canvas->keyboard_grab_item, NULL); if (canvas->hadjustment) { g_object_unref (canvas->hadjustment); canvas->hadjustment = NULL; } if (canvas->vadjustment) { g_object_unref (canvas->vadjustment); canvas->vadjustment = NULL; } G_OBJECT_CLASS (goo_canvas_parent_class)->dispose (object); } static void goo_canvas_finalize (GObject *object) { /*GooCanvas *canvas = (GooCanvas*) object;*/ G_OBJECT_CLASS (goo_canvas_parent_class)->finalize (object); } /** * goo_canvas_get_default_line_width: * @canvas: a #GooCanvas. * * Gets the default line width, which depends on the current units setting. * * Returns: the default line width of the canvas. **/ gdouble goo_canvas_get_default_line_width (GooCanvas *canvas) { gdouble line_width = 2.0; if (!canvas) return 2.0; /* We use the same default as cairo when using pixels, i.e. 2 pixels. For other units we use 2 points, or thereabouts. */ switch (canvas->units) { case GTK_UNIT_PIXEL: line_width = 2.0; break; case GTK_UNIT_POINTS: line_width = 2.0; break; case GTK_UNIT_INCH: line_width = 2.0 / 72.0; break; case GTK_UNIT_MM: line_width = 0.7; break; } return line_width; } /** * goo_canvas_create_cairo_context: * @canvas: a #GooCanvas. * * Creates a cairo context, initialized with the default canvas settings. * * Returns: a new cairo context. It should be freed with cairo_destroy(). **/ cairo_t* goo_canvas_create_cairo_context (GooCanvas *canvas) { cairo_t *cr; cairo_surface_t *surface; /* If the canvas is realized we can use the GDK function to create a cairo context for the canvas window. Otherwise we create a small temporary image surface. */ if (canvas && canvas->canvas_window) { cr = gdk_cairo_create (canvas->canvas_window); } else { surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 1, 1); cr = cairo_create (surface); /* The cairo context will keep a reference to the surface so we can drop our reference. */ cairo_surface_destroy (surface); } /* We use CAIRO_ANTIALIAS_GRAY as the default antialiasing mode, as that is what is recommended when using unhinted text. */ cairo_set_antialias (cr, CAIRO_ANTIALIAS_GRAY); /* Set the default line width based on the current units setting. */ cairo_set_line_width (cr, goo_canvas_get_default_line_width (canvas)); return cr; } static void goo_canvas_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvas *canvas = (GooCanvas*) object; switch (prop_id) { case PROP_SCALE: g_value_set_double (value, canvas->scale); break; case PROP_SCALE_X: g_value_set_double (value, canvas->scale_x); break; case PROP_SCALE_Y: g_value_set_double (value, canvas->scale_y); break; case PROP_ANCHOR: g_value_set_enum (value, canvas->anchor); break; case PROP_X1: g_value_set_double (value, canvas->bounds.x1); break; case PROP_Y1: g_value_set_double (value, canvas->bounds.y1); break; case PROP_X2: g_value_set_double (value, canvas->bounds.x2); break; case PROP_Y2: g_value_set_double (value, canvas->bounds.y2); break; case PROP_AUTOMATIC_BOUNDS: g_value_set_boolean (value, canvas->automatic_bounds); break; case PROP_BOUNDS_FROM_ORIGIN: g_value_set_boolean (value, canvas->bounds_from_origin); break; case PROP_BOUNDS_PADDING: g_value_set_double (value, canvas->bounds_padding); break; case PROP_UNITS: g_value_set_enum (value, canvas->units); break; case PROP_RESOLUTION_X: g_value_set_double (value, canvas->resolution_x); break; case PROP_RESOLUTION_Y: g_value_set_double (value, canvas->resolution_y); break; case PROP_INTEGER_LAYOUT: g_value_set_boolean (value, canvas->integer_layout); break; case PROP_CLEAR_BACKGROUND: g_value_set_boolean (value, canvas->clear_background); break; case PROP_REDRAW_WHEN_SCROLLED: g_value_set_boolean (value, canvas->redraw_when_scrolled); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvas *canvas = (GooCanvas*) object; GdkColor color = { 0, 0, 0, 0, }; gboolean need_reconfigure = FALSE; gboolean need_update_automatic_bounds = FALSE; guint rgb; switch (prop_id) { case PROP_SCALE: goo_canvas_set_scale (canvas, g_value_get_double (value)); break; case PROP_SCALE_X: goo_canvas_set_scale_internal (canvas, g_value_get_double (value), canvas->scale_y); break; case PROP_SCALE_Y: goo_canvas_set_scale_internal (canvas, canvas->scale_x, g_value_get_double (value)); break; case PROP_ANCHOR: canvas->anchor = g_value_get_enum (value); need_reconfigure = TRUE; break; case PROP_X1: canvas->bounds.x1 = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_Y1: canvas->bounds.y1 = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_X2: canvas->bounds.x2 = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_Y2: canvas->bounds.y2 = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_AUTOMATIC_BOUNDS: canvas->automatic_bounds = g_value_get_boolean (value); if (canvas->automatic_bounds) need_update_automatic_bounds = TRUE; break; case PROP_BOUNDS_FROM_ORIGIN: canvas->bounds_from_origin = g_value_get_boolean (value); if (canvas->automatic_bounds) need_update_automatic_bounds = TRUE; break; case PROP_BOUNDS_PADDING: canvas->bounds_padding = g_value_get_double (value); if (canvas->automatic_bounds) need_update_automatic_bounds = TRUE; break; case PROP_UNITS: canvas->units = g_value_get_enum (value); need_reconfigure = TRUE; break; case PROP_RESOLUTION_X: canvas->resolution_x = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_RESOLUTION_Y: canvas->resolution_y = g_value_get_double (value); need_reconfigure = TRUE; break; case PROP_BACKGROUND_COLOR: if (!g_value_get_string (value)) gtk_widget_modify_base ((GtkWidget*) canvas, GTK_STATE_NORMAL, NULL); else if (gdk_color_parse (g_value_get_string (value), &color)) gtk_widget_modify_base ((GtkWidget*) canvas, GTK_STATE_NORMAL, &color); else g_warning ("Unknown color: %s", g_value_get_string (value)); break; case PROP_BACKGROUND_COLOR_RGB: rgb = g_value_get_uint (value); color.red = ((rgb >> 16) & 0xFF) * 257; color.green = ((rgb >> 8) & 0xFF) * 257; color.blue = ((rgb) & 0xFF) * 257; gtk_widget_modify_base ((GtkWidget*) canvas, GTK_STATE_NORMAL, &color); break; case PROP_INTEGER_LAYOUT: canvas->integer_layout = g_value_get_boolean (value); canvas->need_entire_subtree_update = TRUE; goo_canvas_request_update (canvas); break; case PROP_CLEAR_BACKGROUND: canvas->clear_background = g_value_get_boolean (value); break; case PROP_REDRAW_WHEN_SCROLLED: canvas->redraw_when_scrolled = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } if (need_update_automatic_bounds) { goo_canvas_update_automatic_bounds (canvas); } if (need_reconfigure) { reconfigure_canvas (canvas, FALSE); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } } /** * goo_canvas_get_root_item_model: * @canvas: a #GooCanvas. * * Gets the root item model of the canvas. * * Returns: the root item model, or %NULL if there is no root item model. **/ GooCanvasItemModel* goo_canvas_get_root_item_model (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); return canvas->root_item_model; } /** * goo_canvas_set_root_item_model: * @canvas: a #GooCanvas. * @model: a #GooCanvasItemModel. * * Sets the root item model of the canvas. * * A hierarchy of canvas items will be created, corresponding to the hierarchy * of items in the model. Any current canvas items will be removed. **/ void goo_canvas_set_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model) { g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); if (canvas->root_item_model == model) return; if (canvas->root_item_model) { g_object_unref (canvas->root_item_model); canvas->root_item_model = NULL; } if (canvas->root_item) { g_object_unref (canvas->root_item); canvas->root_item = NULL; } if (model) { canvas->root_item_model = g_object_ref (model); /* Create a hierarchy of canvas items for all the items in the model. */ canvas->root_item = goo_canvas_create_item (canvas, model); } else { /* The model has been reset so we go back to a default root group. */ canvas->root_item = goo_canvas_group_new (NULL, NULL); } goo_canvas_item_set_canvas (canvas->root_item, canvas); canvas->need_update = TRUE; if (GTK_WIDGET_REALIZED (canvas)) goo_canvas_update (canvas); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_get_root_item: * @canvas: a #GooCanvas. * * Gets the root item of the canvas, usually a #GooCanvasGroup. * * Returns: the root item, or %NULL if there is no root item. **/ GooCanvasItem* goo_canvas_get_root_item (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); return canvas->root_item; } /** * goo_canvas_set_root_item: * @canvas: a #GooCanvas. * @item: the root canvas item. * * Sets the root item of the canvas. Any existing canvas items are removed. **/ void goo_canvas_set_root_item (GooCanvas *canvas, GooCanvasItem *item) { g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); if (canvas->root_item == item) return; /* Remove any current model. */ if (canvas->root_item_model) { g_object_unref (canvas->root_item_model); canvas->root_item_model = NULL; } if (canvas->root_item) g_object_unref (canvas->root_item); canvas->root_item = g_object_ref (item); goo_canvas_item_set_canvas (canvas->root_item, canvas); canvas->need_update = TRUE; if (GTK_WIDGET_REALIZED (canvas)) goo_canvas_update (canvas); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_get_static_root_item: * @canvas: a #GooCanvas. * * Gets the static root item of the canvas. * * Static items are exactly the same as ordinary canvas items, except that * they do not move or change size when the canvas is scrolled or the scale * changes. * * Static items are added to the static root item in exactly the same way that * ordinary items are added to the root item. * * Returns: the static root item, or %NULL. **/ GooCanvasItem* goo_canvas_get_static_root_item (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); return GOO_CANVAS_GET_PRIVATE (canvas)->static_root_item; } /** * goo_canvas_set_static_root_item: * @canvas: a #GooCanvas. * @item: the static root item. * * Sets the static root item. Any existing static items are removed. * * Static items are exactly the same as ordinary canvas items, except that * they do not move or change size when the canvas is scrolled or the scale * changes. * * Static items are added to the static root item in exactly the same way that * ordinary items are added to the root item. **/ void goo_canvas_set_static_root_item (GooCanvas *canvas, GooCanvasItem *item) { GooCanvasPrivate *priv; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); priv = GOO_CANVAS_GET_PRIVATE (canvas); if (priv->static_root_item == item) return; /* Remove any current model. */ if (priv->static_root_item_model) { g_object_unref (priv->static_root_item_model); priv->static_root_item_model = NULL; } if (priv->static_root_item) g_object_unref (priv->static_root_item); priv->static_root_item = g_object_ref (item); goo_canvas_item_set_canvas (priv->static_root_item, canvas); goo_canvas_item_set_is_static (priv->static_root_item, TRUE); canvas->need_update = TRUE; if (GTK_WIDGET_REALIZED (canvas)) goo_canvas_update (canvas); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_get_static_root_item_model: * @canvas: a #GooCanvas. * * Gets the static root item model of the canvas. * * Static item models are exactly the same as ordinary item models, except that * the corresponding items do not move or change size when the canvas is * scrolled or the scale changes. * * Static items models are added to the static root item model in exactly the * same way that ordinary item models are added to the root item model. * * Returns: the static root item model, or %NULL. **/ GooCanvasItemModel* goo_canvas_get_static_root_item_model (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); return GOO_CANVAS_GET_PRIVATE (canvas)->static_root_item_model; } /** * goo_canvas_set_static_root_item_model: * @canvas: a #GooCanvas. * @model: the static root item model. * * Sets the static root item model. Any existing static item models are * removed. * * Static item models are exactly the same as ordinary item models, except that * the corresponding items do not move or change size when the canvas is * scrolled or the scale changes. * * Static items models are added to the static root item model in exactly the * same way that ordinary item models are added to the root item model. **/ void goo_canvas_set_static_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model) { GooCanvasPrivate *priv; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); priv = GOO_CANVAS_GET_PRIVATE (canvas); if (priv->static_root_item_model == model) return; if (priv->static_root_item_model) { g_object_unref (priv->static_root_item_model); priv->static_root_item_model = NULL; } if (priv->static_root_item) { g_object_unref (priv->static_root_item); priv->static_root_item = NULL; } if (model) { priv->static_root_item_model = g_object_ref (model); /* Create a hierarchy of canvas items for all the items in the model. */ priv->static_root_item = goo_canvas_create_item (canvas, model); } else { /* The model has been reset so we go back to a default root group. */ priv->static_root_item = goo_canvas_group_new (NULL, NULL); } goo_canvas_item_set_canvas (priv->static_root_item, canvas); goo_canvas_item_set_is_static (priv->static_root_item, TRUE); canvas->need_update = TRUE; if (GTK_WIDGET_REALIZED (canvas)) goo_canvas_update (canvas); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_get_item: * @canvas: a #GooCanvas. * @model: a #GooCanvasItemModel. * * Gets the canvas item associated with the given #GooCanvasItemModel. * This is only useful when goo_canvas_set_root_item_model() has been used to * set a model for the canvas. * * For simple applications you can use goo_canvas_get_item() to set up * signal handlers for your items, e.g. * * * item = goo_canvas_get_item (GOO_CANVAS (canvas), my_item); * g_signal_connect (item, "button_press_event", * (GtkSignalFunc) on_my_item_button_press, NULL); * * * More complex applications may want to use the #GooCanvas::item-created * signal to hook up their signal handlers. * * Returns: the canvas item corresponding to the given #GooCanvasItemModel, * or %NULL if no canvas item has been created for it yet. **/ GooCanvasItem* goo_canvas_get_item (GooCanvas *canvas, GooCanvasItemModel *model) { GooCanvasItem *item = NULL; g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); g_return_val_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model), NULL); if (canvas->model_to_item) item = g_hash_table_lookup (canvas->model_to_item, model); /* If the item model has a canvas item check it is valid. */ g_return_val_if_fail (!item || GOO_IS_CANVAS_ITEM (item), NULL); return item; } /** * goo_canvas_get_item_at: * @canvas: a #GooCanvas. * @x: the x coordinate of the point. * @y: the y coordinate of the point * @is_pointer_event: %TRUE if the "pointer-events" property of * items should be used to determine which parts of the item are tested. * * Gets the item at the given point. * * Returns: the item found at the given point, or %NULL if no item was found. **/ GooCanvasItem* goo_canvas_get_item_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event) { GooCanvasPrivate *priv; cairo_t *cr; GooCanvasItem *result = NULL; GList *list = NULL; g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); priv = GOO_CANVAS_GET_PRIVATE (canvas); cr = goo_canvas_create_cairo_context (canvas); if (canvas->root_item) list = goo_canvas_item_get_items_at (canvas->root_item, x, y, cr, is_pointer_event, TRUE, NULL); if (!list && priv->static_root_item) { gdouble static_x = x, static_y = y; goo_canvas_convert_to_static_item_space (canvas, &static_x, &static_y); list = goo_canvas_item_get_items_at (priv->static_root_item, static_x, static_y, cr, is_pointer_event, TRUE, NULL); } cairo_destroy (cr); /* We just return the top item in the list. */ if (list) result = list->data; g_list_free (list); return result; } /** * goo_canvas_get_items_at: * @canvas: a #GooCanvas. * @x: the x coordinate of the point. * @y: the y coordinate of the point * @is_pointer_event: %TRUE if the "pointer-events" property of * items should be used to determine which parts of the item are tested. * * Gets all items at the given point. * * Returns: a list of items found at the given point, with the top item at * the start of the list, or %NULL if no items were found. The list must be * freed with g_list_free(). **/ GList* goo_canvas_get_items_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event) { GooCanvasPrivate *priv; cairo_t *cr; GList *result = NULL; g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); priv = GOO_CANVAS_GET_PRIVATE (canvas); cr = goo_canvas_create_cairo_context (canvas); if (canvas->root_item) result = goo_canvas_item_get_items_at (canvas->root_item, x, y, cr, is_pointer_event, TRUE, NULL); if (priv->static_root_item) { gdouble static_x = x, static_y = y; goo_canvas_convert_to_static_item_space (canvas, &static_x, &static_y); result = goo_canvas_item_get_items_at (priv->static_root_item, static_x, static_y, cr, is_pointer_event, TRUE, result); } cairo_destroy (cr); return result; } static GList* goo_canvas_get_items_in_area_recurse (GooCanvas *canvas, GooCanvasItem *item, const GooCanvasBounds *area, gboolean inside_area, gboolean allow_overlaps, gboolean include_containers, GList *found_items) { GooCanvasBounds bounds; gboolean completely_inside = FALSE, completely_outside = FALSE; gboolean is_container, add_item = FALSE; gint n_children, i; /* First check the item/container itself. */ goo_canvas_item_get_bounds (item, &bounds); is_container = goo_canvas_item_is_container (item); if (bounds.x1 >= area->x1 && bounds.x2 <= area->x2 && bounds.y1 >= area->y1 && bounds.y2 <= area->y2) completely_inside = TRUE; if (bounds.x1 > area->x2 || bounds.x2 < area->x1 || bounds.y1 > area->y2 || bounds.y2 < area->y1) completely_outside = TRUE; if (inside_area) { if (completely_inside || (allow_overlaps && !completely_outside)) add_item = TRUE; } else { if (completely_outside || (allow_overlaps && !completely_inside)) add_item = TRUE; } if (add_item && (!is_container || include_containers)) found_items = g_list_prepend (found_items, item); /* Now check any children, if appropriate. */ if ((inside_area && !completely_outside) || (!inside_area && !completely_inside)) { n_children = goo_canvas_item_get_n_children (item); for (i = 0; i < n_children; i++) { GooCanvasItem *child = goo_canvas_item_get_child (item, i); found_items = goo_canvas_get_items_in_area_recurse (canvas, child, area, inside_area, allow_overlaps, include_containers, found_items); } } return found_items; } /** * goo_canvas_get_items_in_area: * @canvas: a #GooCanvas. * @area: the area to compare with each item's bounds. * @inside_area: %TRUE if items inside @area should be returned, or %FALSE if * items outside @area should be returned. * @allow_overlaps: %TRUE if items which are partly inside and partly outside * should be returned. * @include_containers: %TRUE if containers should be checked as well as * normal items. * * Gets a list of items inside or outside a given area. * * Returns: a list of items in the given area, or %NULL if no items are found. * The list should be freed with g_list_free(). **/ GList* goo_canvas_get_items_in_area (GooCanvas *canvas, const GooCanvasBounds *area, gboolean inside_area, gboolean allow_overlaps, gboolean include_containers) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), NULL); /* If no root item is set, just return NULL. */ if (!canvas->root_item) return NULL; return goo_canvas_get_items_in_area_recurse (canvas, canvas->root_item, area, inside_area, allow_overlaps, include_containers, NULL); } static void goo_canvas_realize (GtkWidget *widget) { GooCanvas *canvas; GooCanvasPrivate *priv; GdkWindowAttr attributes; gint attributes_mask; gint width_pixels, height_pixels; GList *tmp_list; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); priv = GOO_CANVAS_GET_PRIVATE (canvas); GTK_WIDGET_SET_FLAGS (canvas, GTK_REALIZED); attributes.window_type = GDK_WINDOW_CHILD; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = widget->allocation.width; attributes.height = widget->allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); attributes.colormap = gtk_widget_get_colormap (widget); attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; widget->window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gdk_window_set_user_data (widget->window, widget); /* We want to round the sizes up to the next pixel. */ width_pixels = ((canvas->bounds.x2 - canvas->bounds.x1) * canvas->device_to_pixels_x) + 1; height_pixels = ((canvas->bounds.y2 - canvas->bounds.y1) * canvas->device_to_pixels_y) + 1; attributes.x = canvas->hadjustment ? - canvas->hadjustment->value : 0, attributes.y = canvas->vadjustment ? - canvas->vadjustment->value : 0; attributes.width = MAX (width_pixels, widget->allocation.width); attributes.height = MAX (height_pixels, widget->allocation.height); attributes.event_mask = GDK_EXPOSURE_MASK | GDK_SCROLL_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_FOCUS_CHANGE_MASK | gtk_widget_get_events (widget); priv->window_x = attributes.x; priv->window_y = attributes.y; canvas->canvas_window = gdk_window_new (widget->window, &attributes, attributes_mask); gdk_window_set_user_data (canvas->canvas_window, widget); attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = widget->allocation.width; attributes.height = widget->allocation.height; attributes.event_mask = 0; canvas->tmp_window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gdk_window_set_user_data (canvas->tmp_window, widget); widget->style = gtk_style_attach (widget->style, widget->window); /* Make sure the window backgrounds aren't set, to avoid flicker when scrolling (due to the delay between X clearing the background and GooCanvas painting it). */ gdk_window_set_back_pixmap (widget->window, NULL, FALSE); gdk_window_set_back_pixmap (canvas->canvas_window, NULL, FALSE); gdk_window_set_back_pixmap (canvas->tmp_window, NULL, FALSE); /* Set the parent window of all the child widget items. */ tmp_list = canvas->widget_items; while (tmp_list) { GooCanvasWidget *witem = tmp_list->data; tmp_list = tmp_list->next; if (witem->widget) gtk_widget_set_parent_window (witem->widget, canvas->canvas_window); } goo_canvas_update (GOO_CANVAS (widget)); } static void goo_canvas_unrealize (GtkWidget *widget) { GooCanvas *canvas; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); gdk_window_set_user_data (canvas->canvas_window, NULL); gdk_window_destroy (canvas->canvas_window); canvas->canvas_window = NULL; gdk_window_set_user_data (canvas->tmp_window, NULL); gdk_window_destroy (canvas->tmp_window); canvas->tmp_window = NULL; if (GTK_WIDGET_CLASS (goo_canvas_parent_class)->unrealize) GTK_WIDGET_CLASS (goo_canvas_parent_class)->unrealize (widget); } static void goo_canvas_map (GtkWidget *widget) { GooCanvas *canvas; GList *tmp_list; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED); tmp_list = canvas->widget_items; while (tmp_list) { GooCanvasWidget *witem = tmp_list->data; tmp_list = tmp_list->next; if (witem->widget && GTK_WIDGET_VISIBLE (witem->widget)) { if (!GTK_WIDGET_MAPPED (witem->widget)) gtk_widget_map (witem->widget); } } gdk_window_show (canvas->canvas_window); gdk_window_show (widget->window); } static void goo_canvas_style_set (GtkWidget *widget, GtkStyle *old_style) { if (GTK_WIDGET_CLASS (goo_canvas_parent_class)->style_set) GTK_WIDGET_CLASS (goo_canvas_parent_class)->style_set (widget, old_style); if (GTK_WIDGET_REALIZED (widget)) { /* Make sure the window backgrounds aren't set, to avoid flicker when scrolling (due to the delay between X clearing the background and GooCanvas painting it). */ gdk_window_set_back_pixmap (widget->window, NULL, FALSE); gdk_window_set_back_pixmap (GOO_CANVAS (widget)->canvas_window, NULL, FALSE); } } static void goo_canvas_configure_hadjustment (GooCanvas *canvas, gint window_width) { GtkWidget *widget = GTK_WIDGET (canvas); GtkAdjustment *adj = canvas->hadjustment; gboolean changed = FALSE; gboolean value_changed = FALSE; gdouble max_value; if (adj->upper != window_width) { adj->upper = window_width; changed = TRUE; } if (adj->page_size != widget->allocation.width) { adj->page_size = widget->allocation.width; adj->page_increment = adj->page_size * 0.9; adj->step_increment = adj->page_size * 0.1; changed = TRUE; } max_value = MAX (0.0, adj->upper - adj->page_size); if (adj->value > max_value) { adj->value = max_value; value_changed = TRUE; } if (changed) gtk_adjustment_changed (adj); if (value_changed) gtk_adjustment_value_changed (adj); } static void goo_canvas_configure_vadjustment (GooCanvas *canvas, gint window_height) { GtkWidget *widget = GTK_WIDGET (canvas); GtkAdjustment *adj = canvas->vadjustment; gboolean changed = FALSE; gboolean value_changed = FALSE; gdouble max_value; if (adj->upper != window_height) { adj->upper = window_height; changed = TRUE; } if (adj->page_size != widget->allocation.height) { adj->page_size = widget->allocation.height; adj->page_increment = adj->page_size * 0.9; adj->step_increment = adj->page_size * 0.1; changed = TRUE; } max_value = MAX (0.0, adj->upper - adj->page_size); if (adj->value > max_value) { adj->value = max_value; value_changed = TRUE; } if (changed) gtk_adjustment_changed (adj); if (value_changed) gtk_adjustment_value_changed (adj); } static void recalculate_scales (GooCanvas *canvas) { switch (canvas->units) { case GTK_UNIT_PIXEL: canvas->device_to_pixels_x = canvas->scale_x; canvas->device_to_pixels_y = canvas->scale_y; break; case GTK_UNIT_POINTS: canvas->device_to_pixels_x = canvas->scale_x * (canvas->resolution_x / 72.0); canvas->device_to_pixels_y = canvas->scale_y * (canvas->resolution_y / 72.0); break; case GTK_UNIT_INCH: canvas->device_to_pixels_x = canvas->scale_x * canvas->resolution_x; canvas->device_to_pixels_y = canvas->scale_y * canvas->resolution_y; break; case GTK_UNIT_MM: /* There are 25.4 mm to an inch. */ canvas->device_to_pixels_x = canvas->scale_x * (canvas->resolution_x / 25.4); canvas->device_to_pixels_y = canvas->scale_y * (canvas->resolution_y / 25.4); break; } } static void request_static_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); GdkRectangle rect; if (!GTK_WIDGET_DRAWABLE (canvas) || (bounds->x1 == bounds->x2)) return; /* We subtract one from the left & top edges, in case anti-aliasing makes the drawing use an extra pixel. */ rect.x = (double) bounds->x1 - priv->window_x - 1; rect.y = (double) bounds->y1 - priv->window_y - 1; /* We add an extra one here for the same reason. (The other extra one is to round up to the next pixel.) And one for luck! */ rect.width = (double) bounds->x2 - priv->window_x - rect.x + 2 + 1; rect.height = (double) bounds->y2 - priv->window_y - rect.y + 2 + 1; gdk_window_invalidate_rect (canvas->canvas_window, &rect, FALSE); } /* This requests a redraw of all the toplevel static items at their current position, but redraws them at their given new position. We redraw one item at a time to avoid GTK+ merging the rectangles into one big one. */ static void redraw_static_items_at_position (GooCanvas *canvas, gint x, gint y) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); GooCanvasBounds bounds; GooCanvasItem *item; gint n_children, i, window_x_copy, window_y_copy; if (!priv->static_root_item) return; window_x_copy = priv->window_x; window_y_copy = priv->window_y; n_children = goo_canvas_item_get_n_children (priv->static_root_item); for (i = 0; i < n_children; i++) { item = goo_canvas_item_get_child (priv->static_root_item, i); /* Get the bounds of all the static items, relative to the window. */ goo_canvas_item_get_bounds (item, &bounds); /* Request a redraw of the old position. */ request_static_redraw (canvas, &bounds); /* Redraw the item in its new position. */ priv->window_x = x; priv->window_y = y; gdk_window_process_updates (canvas->canvas_window, TRUE); /* Now reset the window position. */ priv->window_x = window_x_copy; priv->window_y = window_y_copy; } } /* This makes sure the canvas is all set up correctly, i.e. the scrollbar adjustments are set, the canvas x & y offsets are calculated, and the canvas window is sized. */ static void reconfigure_canvas (GooCanvas *canvas, gboolean redraw_if_needed) { gint width_pixels, height_pixels; gint window_x = 0, window_y = 0, window_width, window_height; gint new_x_offset = 0, new_y_offset = 0; GtkWidget *widget; widget = GTK_WIDGET (canvas); /* Make sure the bounds are sane. */ if (canvas->bounds.x2 < canvas->bounds.x1) canvas->bounds.x2 = canvas->bounds.x1; if (canvas->bounds.y2 < canvas->bounds.y1) canvas->bounds.y2 = canvas->bounds.y1; /* Recalculate device_to_pixels_x & device_to_pixels_y. */ recalculate_scales (canvas); /* This is the natural size of the canvas window in pixels, rounded up to the next pixel. */ width_pixels = ((canvas->bounds.x2 - canvas->bounds.x1) * canvas->device_to_pixels_x) + 1; height_pixels = ((canvas->bounds.y2 - canvas->bounds.y1) * canvas->device_to_pixels_y) + 1; /* The actual window size is always at least as big as the widget's window.*/ window_width = MAX (width_pixels, widget->allocation.width); window_height = MAX (height_pixels, widget->allocation.height); /* If the width or height is smaller than the window, we need to calculate the canvas x & y offsets according to the anchor. */ if (width_pixels < widget->allocation.width) { switch (canvas->anchor) { case GTK_ANCHOR_NORTH_WEST: case GTK_ANCHOR_WEST: case GTK_ANCHOR_SOUTH_WEST: new_x_offset = 0; break; case GTK_ANCHOR_NORTH: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_SOUTH: new_x_offset = (widget->allocation.width - width_pixels) / 2; break; case GTK_ANCHOR_NORTH_EAST: case GTK_ANCHOR_EAST: case GTK_ANCHOR_SOUTH_EAST: new_x_offset = widget->allocation.width - width_pixels; break; } } if (height_pixels < widget->allocation.height) { switch (canvas->anchor) { case GTK_ANCHOR_NORTH_WEST: case GTK_ANCHOR_NORTH: case GTK_ANCHOR_NORTH_EAST: new_y_offset = 0; break; case GTK_ANCHOR_WEST: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_EAST: new_y_offset = (widget->allocation.height - height_pixels) / 2; break; case GTK_ANCHOR_SOUTH_WEST: case GTK_ANCHOR_SOUTH: case GTK_ANCHOR_SOUTH_EAST: new_y_offset = widget->allocation.height - height_pixels; break; } } canvas->freeze_count++; if (canvas->hadjustment) { goo_canvas_configure_hadjustment (canvas, window_width); window_x = - canvas->hadjustment->value; } if (canvas->vadjustment) { goo_canvas_configure_vadjustment (canvas, window_height); window_y = - canvas->vadjustment->value; } canvas->freeze_count--; if (GTK_WIDGET_REALIZED (canvas)) { gdk_window_move_resize (canvas->canvas_window, window_x, window_y, window_width, window_height); } /* If one of the offsets has changed we have to redraw the widget. */ if (canvas->canvas_x_offset != new_x_offset || canvas->canvas_y_offset != new_y_offset) { canvas->canvas_x_offset = new_x_offset; canvas->canvas_y_offset = new_y_offset; if (redraw_if_needed) gtk_widget_queue_draw (GTK_WIDGET (canvas)); } } static void goo_canvas_size_request (GtkWidget *widget, GtkRequisition *requisition) { GList *tmp_list; GooCanvas *canvas; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); requisition->width = 0; requisition->height = 0; tmp_list = canvas->widget_items; while (tmp_list) { GooCanvasWidget *witem = tmp_list->data; GtkRequisition child_requisition; tmp_list = tmp_list->next; if (witem->widget) gtk_widget_size_request (witem->widget, &child_requisition); } } static void goo_canvas_allocate_child_widget (GooCanvas *canvas, GooCanvasWidget *witem) { GooCanvasBounds bounds; GtkAllocation allocation; goo_canvas_item_get_bounds ((GooCanvasItem*) witem, &bounds); goo_canvas_convert_to_pixels (canvas, &bounds.x1, &bounds.y1); goo_canvas_convert_to_pixels (canvas, &bounds.x2, &bounds.y2); /* Note that we only really support integers for the bounds, and we don't support scaling of a canvas with widget items in it. */ allocation.x = bounds.x1; allocation.y = bounds.y1; allocation.width = bounds.x2 - allocation.x; allocation.height = bounds.y2 - allocation.y; gtk_widget_size_allocate (witem->widget, &allocation); } static void goo_canvas_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GooCanvas *canvas; GList *tmp_list; g_return_if_fail (GOO_IS_CANVAS (widget)); canvas = GOO_CANVAS (widget); widget->allocation = *allocation; if (GTK_WIDGET_REALIZED (widget)) { /* We can only allocate our children when we are realized, since we need a window to create a cairo_t which we use for layout. */ tmp_list = canvas->widget_items; while (tmp_list) { GooCanvasWidget *witem = tmp_list->data; tmp_list = tmp_list->next; if (witem->widget) goo_canvas_allocate_child_widget (canvas, witem); } gdk_window_move_resize (widget->window, allocation->x, allocation->y, allocation->width, allocation->height); gdk_window_move_resize (canvas->tmp_window, allocation->x, allocation->y, allocation->width, allocation->height); } reconfigure_canvas (canvas, TRUE); } static void goo_canvas_adjustment_value_changed (GtkAdjustment *adjustment, GooCanvas *canvas) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); AtkObject *accessible; if (!canvas->freeze_count && GTK_WIDGET_REALIZED (canvas)) { if (canvas->redraw_when_scrolled) { /* Map the temporary window to stop the canvas window being scrolled. When it is unmapped the entire canvas will be redrawn. */ if (GTK_WIDGET_MAPPED (canvas)) gdk_window_show (canvas->tmp_window); } else { /* Redraw the area currently occupied by the static items. But draw the static items in their new position. This stops them from being "dragged" when the window is scrolled. */ redraw_static_items_at_position (canvas, -canvas->hadjustment->value, -canvas->hadjustment->value); /* Move the static items to the new position. */ priv->window_x = -canvas->hadjustment->value; priv->window_y = -canvas->vadjustment->value; } gdk_window_move (canvas->canvas_window, - canvas->hadjustment->value, - canvas->vadjustment->value); if (canvas->redraw_when_scrolled) { /* Unmap the temporary window, causing the entire canvas to be redrawn. */ if (GTK_WIDGET_MAPPED (canvas)) gdk_window_hide (canvas->tmp_window); } else { /* Process updates here for smoother scrolling. */ gdk_window_process_updates (canvas->canvas_window, TRUE); /* Now ensure the static items are redrawn in their new position. */ redraw_static_items_at_position (canvas, priv->window_x, priv->window_y); } /* Notify any accessibility modules that the view has changed. */ accessible = gtk_widget_get_accessible (GTK_WIDGET (canvas)); g_signal_emit_by_name (accessible, "visible_data_changed"); } } /* Sets either or both adjustments, If hadj or vadj is NULL a new adjustment is created. */ static void goo_canvas_set_adjustments (GooCanvas *canvas, GtkAdjustment *hadj, GtkAdjustment *vadj) { gboolean need_reconfigure = FALSE; g_return_if_fail (GOO_IS_CANVAS (canvas)); if (hadj) g_return_if_fail (GTK_IS_ADJUSTMENT (hadj)); else if (canvas->hadjustment) hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); if (vadj) g_return_if_fail (GTK_IS_ADJUSTMENT (vadj)); else if (canvas->vadjustment) vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); if (canvas->hadjustment && (canvas->hadjustment != hadj)) { g_signal_handlers_disconnect_by_func (canvas->hadjustment, goo_canvas_adjustment_value_changed, canvas); g_object_unref (canvas->hadjustment); } if (canvas->vadjustment && (canvas->vadjustment != vadj)) { g_signal_handlers_disconnect_by_func (canvas->vadjustment, goo_canvas_adjustment_value_changed, canvas); g_object_unref (canvas->vadjustment); } if (canvas->hadjustment != hadj) { canvas->hadjustment = hadj; g_object_ref_sink (canvas->hadjustment); g_signal_connect (canvas->hadjustment, "value_changed", G_CALLBACK (goo_canvas_adjustment_value_changed), canvas); need_reconfigure = TRUE; } if (canvas->vadjustment != vadj) { canvas->vadjustment = vadj; g_object_ref_sink (canvas->vadjustment); g_signal_connect (canvas->vadjustment, "value_changed", G_CALLBACK (goo_canvas_adjustment_value_changed), canvas); need_reconfigure = TRUE; } if (need_reconfigure) reconfigure_canvas (canvas, TRUE); } /* Sets one of our pointers to an item, adding a reference to it and releasing any reference to the current item. */ static void set_item_pointer (GooCanvasItem **item, GooCanvasItem *new) { /* If the item hasn't changed, just return. */ if (*item == new) return; /* Unref the current item, if it isn't NULL. */ if (*item) g_object_unref (*item); /* Set the new item. */ *item = new; /* Add a reference to it, if it isn't NULL. */ if (*item) g_object_ref (*item); } /** * goo_canvas_get_bounds: * @canvas: a #GooCanvas. * @left: a pointer to a #gdouble to return the left edge, or %NULL. * @top: a pointer to a #gdouble to return the top edge, or %NULL. * @right: a pointer to a #gdouble to return the right edge, or %NULL. * @bottom: a pointer to a #gdouble to return the bottom edge, or %NULL. * * Gets the bounds of the canvas, in canvas units. * * By default, canvas units are pixels, though the #GooCanvas:units property * can be used to change the units to points, inches or millimeters. **/ void goo_canvas_get_bounds (GooCanvas *canvas, gdouble *left, gdouble *top, gdouble *right, gdouble *bottom) { g_return_if_fail (GOO_IS_CANVAS (canvas)); if (left) *left = canvas->bounds.x1; if (top) *top = canvas->bounds.y1; if (right) *right = canvas->bounds.x2; if (bottom) *bottom = canvas->bounds.y2; } /** * goo_canvas_set_bounds: * @canvas: a #GooCanvas. * @left: the left edge. * @top: the top edge. * @right: the right edge. * @bottom: the bottom edge. * * Sets the bounds of the #GooCanvas, in canvas units. * * By default, canvas units are pixels, though the #GooCanvas:units property * can be used to change the units to points, inches or millimeters. **/ void goo_canvas_set_bounds (GooCanvas *canvas, gdouble left, gdouble top, gdouble right, gdouble bottom) { g_return_if_fail (GOO_IS_CANVAS (canvas)); canvas->bounds.x1 = left; canvas->bounds.y1 = top; canvas->bounds.x2 = right; canvas->bounds.y2 = bottom; reconfigure_canvas (canvas, FALSE); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } /** * goo_canvas_scroll_to: * @canvas: a #GooCanvas. * @left: the x coordinate to scroll to. * @top: the y coordinate to scroll to. * * Scrolls the canvas, placing the given point as close to the top-left of * the view as possible. **/ void goo_canvas_scroll_to (GooCanvas *canvas, gdouble left, gdouble top) { gdouble x = left, y = top; g_return_if_fail (GOO_IS_CANVAS (canvas)); /* The scrollbar adjustments use pixel values, so convert to pixels. */ goo_canvas_convert_to_pixels (canvas, &x, &y); /* Make sure we stay within the bounds. */ x = CLAMP (x, canvas->hadjustment->lower, canvas->hadjustment->upper - canvas->hadjustment->page_size); y = CLAMP (y, canvas->vadjustment->lower, canvas->vadjustment->upper - canvas->vadjustment->page_size); canvas->freeze_count++; gtk_adjustment_set_value (canvas->hadjustment, x); gtk_adjustment_set_value (canvas->vadjustment, y); canvas->freeze_count--; goo_canvas_adjustment_value_changed (NULL, canvas); } /* This makes sure the given item is displayed, scrolling if necessary. */ static void goo_canvas_scroll_to_item (GooCanvas *canvas, GooCanvasItem *item) { GooCanvasBounds bounds; gdouble hvalue, vvalue; /* We can't scroll to static items. */ if (goo_canvas_item_get_is_static (item)) return; goo_canvas_item_get_bounds (item, &bounds); goo_canvas_convert_to_pixels (canvas, &bounds.x1, &bounds.y1); goo_canvas_convert_to_pixels (canvas, &bounds.x2, &bounds.y2); canvas->freeze_count++; /* Remember the current adjustment values. */ hvalue = canvas->hadjustment->value; vvalue = canvas->vadjustment->value; /* Update the adjustments so the item is displayed. */ gtk_adjustment_clamp_page (canvas->hadjustment, bounds.x1, bounds.x2); gtk_adjustment_clamp_page (canvas->vadjustment, bounds.y1, bounds.y2); canvas->freeze_count--; /* If the adjustments have changed we need to scroll. */ if (hvalue != canvas->hadjustment->value || vvalue != canvas->vadjustment->value) goo_canvas_adjustment_value_changed (NULL, canvas); } /** * goo_canvas_get_scale: * @canvas: a #GooCanvas. * * Gets the current scale of the canvas. * * The scale specifies the magnification factor of the canvas, e.g. if an item * has a width of 2 pixels and the scale is set to 3, it will be displayed with * a width of 2 x 3 = 6 pixels. * * Returns: the current scale setting. **/ gdouble goo_canvas_get_scale (GooCanvas *canvas) { g_return_val_if_fail (GOO_IS_CANVAS (canvas), 1.0); return canvas->scale; } static void goo_canvas_set_scale_internal (GooCanvas *canvas, gdouble scale_x, gdouble scale_y) { gdouble x, y; g_return_if_fail (GOO_IS_CANVAS (canvas)); /* Calculate the coords of the current center point in pixels. */ x = canvas->hadjustment->value + canvas->hadjustment->page_size / 2; y = canvas->vadjustment->value + canvas->vadjustment->page_size / 2; /* Convert from pixel units to device units. */ goo_canvas_convert_from_pixels (canvas, &x, &y); /* Show our temporary window above the canvas window, so that the windowing system doesn't try to scroll the contents when we change the adjustments. Since we are changing the scale we need to redraw everything so the scrolling is unnecessary and really ugly. FIXME: There is a possible issue with keyboard focus/input methods here, since hidden windows can't have the keyboard focus. */ if (GTK_WIDGET_MAPPED (canvas)) gdk_window_show (canvas->tmp_window); canvas->freeze_count++; canvas->scale_x = scale_x; canvas->scale_y = scale_y; canvas->scale = MIN (scale_x, scale_y); reconfigure_canvas (canvas, FALSE); /* Convert from the center point to the new desired top-left posision. */ x -= canvas->hadjustment->page_size / canvas->device_to_pixels_x / 2; y -= canvas->vadjustment->page_size / canvas->device_to_pixels_y / 2; /* Now try to scroll to it. */ goo_canvas_scroll_to (canvas, x, y); canvas->freeze_count--; goo_canvas_adjustment_value_changed (NULL, canvas); /* Now hide the temporary window, so the canvas window will get an expose event. */ if (GTK_WIDGET_MAPPED (canvas)) gdk_window_hide (canvas->tmp_window); } /** * goo_canvas_set_scale: * @canvas: a #GooCanvas. * @scale: the new scale setting. * * Sets the scale of the canvas. * * The scale specifies the magnification factor of the canvas, e.g. if an item * has a width of 2 pixels and the scale is set to 3, it will be displayed with * a width of 2 x 3 = 6 pixels. **/ void goo_canvas_set_scale (GooCanvas *canvas, gdouble scale) { g_return_if_fail (GOO_IS_CANVAS (canvas)); goo_canvas_set_scale_internal (canvas, scale, scale); } /** * goo_canvas_unregister_item: * @canvas: a #GooCanvas. * @model: the item model whose canvas item is being finalized. * * This function is only intended to be used when implementing new canvas * items. * * It should be called in the finalize method of #GooCanvasItem * objects, to remove the canvas item from the #GooCanvas's hash table. **/ void goo_canvas_unregister_item (GooCanvas *canvas, GooCanvasItemModel *model) { if (canvas->model_to_item) g_hash_table_remove (canvas->model_to_item, model); } /** * goo_canvas_create_item: * @canvas: a #GooCanvas. * @model: the item model to create a canvas item for. * * This function is only intended to be used when implementing new canvas * items, typically container items such as #GooCanvasGroup. * * It creates a new canvas item for the given item model, and recursively * creates items for any children. * * It uses the create_item() virtual method if it has been set. * Subclasses of #GooCanvas can define this method if they want to use * custom views for items. * * It emits the #GooCanvas::item-created signal after creating the view, so * application code can connect signal handlers to the new view if desired. * * Returns: a new canvas item. **/ GooCanvasItem* goo_canvas_create_item (GooCanvas *canvas, GooCanvasItemModel *model) { GooCanvasItem *item = NULL; /* Use the virtual method if it has been set. */ if (GOO_CANVAS_GET_CLASS (canvas)->create_item) item = GOO_CANVAS_GET_CLASS (canvas)->create_item (canvas, model); /* The virtual method can return NULL to use the default view for an item. */ if (!item) item = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model)->create_item (model, canvas); if (canvas->model_to_item) g_hash_table_insert (canvas->model_to_item, model, item); /* Emit a signal so apps can hook up signal handlers if they want. */ g_signal_emit (canvas, canvas_signals[ITEM_CREATED], 0, item, model); return item; } static void goo_canvas_update_automatic_bounds (GooCanvas *canvas) { GooCanvasBounds bounds = { 0.0, 0.0, GOO_CANVAS_DEFAULT_WIDTH, GOO_CANVAS_DEFAULT_HEIGHT }; if (canvas->root_item) goo_canvas_item_get_bounds (canvas->root_item, &bounds); /* Calculate the new automatic bounds, which is the bounds of all the items in the canvas plus any specified padding. If bounds_from_origin is set x1 and y1 are set to 0.0. */ if (canvas->bounds_from_origin) { bounds.x1 = 0.0; bounds.y1 = 0.0; bounds.x2 += canvas->bounds_padding; bounds.y2 += canvas->bounds_padding; } else { bounds.x1 -= canvas->bounds_padding; bounds.y1 -= canvas->bounds_padding; bounds.x2 += canvas->bounds_padding; bounds.y2 += canvas->bounds_padding; } /* Make sure the bounds are sane. */ if (bounds.x2 < bounds.x1) bounds.x2 = bounds.x1; if (bounds.y2 < bounds.y1) bounds.y2 = bounds.y1; /* If the bounds have changed, reconfigure the canvas and redraw. */ if (bounds.x1 != canvas->bounds.x1 || bounds.y1 != canvas->bounds.y1 || bounds.x2 != canvas->bounds.x2 || bounds.y2 != canvas->bounds.y2) { canvas->bounds = bounds; reconfigure_canvas (canvas, FALSE); gtk_widget_queue_draw (GTK_WIDGET (canvas)); } } static void goo_canvas_update_internal (GooCanvas *canvas, cairo_t *cr) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); GooCanvasBounds bounds, static_bounds; /* It is possible that processing the first set of updates causes other updates to be scheduled, so we loop round until all are done. Items should ensure that they don't cause this to loop forever. */ while (canvas->need_update) { gboolean entire_tree = canvas->need_entire_subtree_update; canvas->need_update = FALSE; canvas->need_entire_subtree_update = FALSE; if (canvas->root_item) goo_canvas_item_update (canvas->root_item, entire_tree, cr, &bounds); if (priv->static_root_item) goo_canvas_item_update (priv->static_root_item, entire_tree, cr, &static_bounds); } /* If the bounds are automatically-calculated, update them now. */ if (canvas->root_item && canvas->automatic_bounds) goo_canvas_update_automatic_bounds (canvas); /* Check which item is under the pointer. */ update_pointer_item (canvas, NULL); } /** * goo_canvas_update: * @canvas: a #GooCanvas. * * This function is only intended to be used by subclasses of #GooCanvas or * #GooCanvasItem implementations. * * It updates any items that need updating. * * If the bounds of items change, they will request a redraw of the old and * new bounds so the display is updated correctly. **/ void goo_canvas_update (GooCanvas *canvas) { cairo_t *cr = goo_canvas_create_cairo_context (canvas); goo_canvas_update_internal (canvas, cr); cairo_destroy (cr); } static gint goo_canvas_idle_handler (GooCanvas *canvas) { GDK_THREADS_ENTER (); goo_canvas_update (canvas); /* Reset idle id. Note that we do this after goo_canvas_update(), to make sure we don't schedule another idle handler while that is running. */ canvas->idle_id = 0; GDK_THREADS_LEAVE (); /* Return FALSE to remove the idle handler. */ return FALSE; } /** * goo_canvas_request_update: * @canvas: a #GooCanvas. * * This function is only intended to be used by subclasses of #GooCanvas or * #GooCanvasItem implementations. * * It schedules an update of the #GooCanvas. This will be performed in * the idle loop, after all pending events have been handled, but before * the canvas has been repainted. **/ void goo_canvas_request_update (GooCanvas *canvas) { canvas->need_update = TRUE; /* We have to wait until we are realized. We'll do a full update then. */ if (!GTK_WIDGET_REALIZED (canvas)) return; /* We use a higher priority than the normal GTK+ resize/redraw idle handlers * so the canvas state will be updated before allocating sizes & redrawing. */ if (!canvas->idle_id) canvas->idle_id = g_idle_add_full (GTK_PRIORITY_RESIZE - 5, (GSourceFunc) goo_canvas_idle_handler, canvas, NULL); } /** * goo_canvas_request_redraw: * @canvas: a #GooCanvas. * @bounds: the bounds to redraw, in device space. * * This function is only intended to be used by subclasses of #GooCanvas or * #GooCanvasItem implementations. * * Requests that the given bounds be redrawn. The bounds must be in the canvas * coordinate space. **/ void goo_canvas_request_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds) { GdkRectangle rect; if (!GTK_WIDGET_DRAWABLE (canvas) || (bounds->x1 == bounds->x2)) return; /* We subtract one from the left & top edges, in case anti-aliasing makes the drawing use an extra pixel. */ rect.x = (double) (bounds->x1 - canvas->bounds.x1) * canvas->device_to_pixels_x - 1; rect.y = (double) (bounds->y1 - canvas->bounds.y1) * canvas->device_to_pixels_y - 1; /* We add an extra one here for the same reason. (The other extra one is to round up to the next pixel.) And one for luck! */ rect.width = (double) (bounds->x2 - canvas->bounds.x1) * canvas->device_to_pixels_x - rect.x + 2 + 1; rect.height = (double) (bounds->y2 - canvas->bounds.y1) * canvas->device_to_pixels_y - rect.y + 2 + 1; rect.x += canvas->canvas_x_offset; rect.y += canvas->canvas_y_offset; gdk_window_invalidate_rect (canvas->canvas_window, &rect, FALSE); } /** * goo_canvas_request_item_redraw: * @canvas: a #GooCanvas. * @bounds: the bounds of the item to redraw. * @is_static: if the item is static. * * This function is only intended to be used by subclasses of #GooCanvas or * #GooCanvasItem implementations. * * Requests that the given bounds be redrawn. If @is_static is %TRUE the bounds * are assumed to be in the static item coordinate space, otherwise they are * assumed to be in the canvas coordinate space. * * If @is_static is %FALSE this function behaves the same as * goo_canvas_request_redraw(). **/ void goo_canvas_request_item_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds, gboolean is_static) { if (is_static) request_static_redraw (canvas, bounds); else goo_canvas_request_redraw (canvas, bounds); } static void paint_static_items (GooCanvas *canvas, GdkEventExpose *event, cairo_t *cr) { GooCanvasPrivate *priv = GOO_CANVAS_GET_PRIVATE (canvas); GooCanvasBounds static_bounds; double static_x_offset, static_y_offset; cairo_save (cr); cairo_identity_matrix (cr); static_x_offset = floor (canvas->hadjustment->value); static_y_offset = floor (canvas->vadjustment->value); cairo_translate (cr, static_x_offset, static_y_offset); /* FIXME: Uses pixels at present - use canvas units instead? */ static_bounds.x1 = event->area.x - static_x_offset; static_bounds.y1 = event->area.y - static_y_offset; static_bounds.x2 = event->area.width + static_bounds.x1; static_bounds.y2 = event->area.height + static_bounds.y1; goo_canvas_item_paint (priv->static_root_item, cr, &static_bounds, 1.0); cairo_restore (cr); } static gboolean goo_canvas_expose_event (GtkWidget *widget, GdkEventExpose *event) { GooCanvas *canvas = GOO_CANVAS (widget); GooCanvasBounds bounds, root_item_bounds; cairo_t *cr; double x1, y1, x2, y2; if (!canvas->root_item) return FALSE; if (event->window != canvas->canvas_window) return FALSE; /* Clear the background. */ if (canvas->clear_background) { gdk_draw_rectangle (canvas->canvas_window, widget->style->base_gc[widget->state], TRUE, event->area.x, event->area.y, event->area.width, event->area.height); } cr = goo_canvas_create_cairo_context (canvas); if (canvas->need_update) goo_canvas_update_internal (canvas, cr); bounds.x1 = ((event->area.x - canvas->canvas_x_offset) / canvas->device_to_pixels_x) + canvas->bounds.x1; bounds.y1 = ((event->area.y - canvas->canvas_y_offset) / canvas->device_to_pixels_y) + canvas->bounds.y1; bounds.x2 = (event->area.width / canvas->device_to_pixels_x) + bounds.x1; bounds.y2 = (event->area.height / canvas->device_to_pixels_y) + bounds.y1; /* Translate it to use the canvas pixel offsets (used when the canvas is smaller than the window and the anchor isn't set to NORTH_WEST). */ cairo_translate (cr, canvas->canvas_x_offset, canvas->canvas_y_offset); /* Scale it so we can use canvas coordinates. */ cairo_scale (cr, canvas->device_to_pixels_x, canvas->device_to_pixels_y); /* Translate it so the top-left of the canvas becomes (0,0). */ cairo_translate (cr, -canvas->bounds.x1, -canvas->bounds.y1); /* Clip to the canvas bounds, if necessary. We only need to clip if the items in the canvas extend outside the canvas bounds and the canvas bounds is less than the area being painted. */ goo_canvas_item_get_bounds (canvas->root_item, &root_item_bounds); if ((root_item_bounds.x1 < canvas->bounds.x1 && canvas->bounds.x1 > bounds.x1) || (root_item_bounds.x2 > canvas->bounds.x2 && canvas->bounds.x2 < bounds.x2) || (root_item_bounds.y1 < canvas->bounds.y1 && canvas->bounds.y1 > bounds.y1) || (root_item_bounds.y2 > canvas->bounds.y2 && canvas->bounds.y2 < bounds.y2)) { /* Clip to the intersection of the canvas bounds and the expose bounds, to avoid cairo's 16-bit limits. */ x1 = MAX (canvas->bounds.x1, bounds.x1); y1 = MAX (canvas->bounds.y1, bounds.y1); x2 = MIN (canvas->bounds.x2, bounds.x2); y2 = MIN (canvas->bounds.y2, bounds.y2); cairo_new_path (cr); cairo_move_to (cr, x1, y1); cairo_line_to (cr, x2, y1); cairo_line_to (cr, x2, y2); cairo_line_to (cr, x1, y2); cairo_close_path (cr); cairo_clip (cr); } goo_canvas_item_paint (canvas->root_item, cr, &bounds, canvas->scale); paint_static_items (canvas, event, cr); cairo_destroy (cr); GTK_WIDGET_CLASS (goo_canvas_parent_class)->expose_event (widget, event); return FALSE; } /** * goo_canvas_render: * @canvas: a #GooCanvas. * @cr: a cairo context. * @bounds: the area to render, or %NULL to render the entire canvas. * @scale: the scale to compare with each item's visibility * threshold to see if they should be rendered. This only affects items that * have their visibility set to %GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD. * * Renders all or part of a canvas to the given cairo context. **/ void goo_canvas_render (GooCanvas *canvas, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { if (canvas->need_update) goo_canvas_update (canvas); /* Set the default line width based on the current units setting. */ cairo_set_line_width (cr, goo_canvas_get_default_line_width (canvas)); if (bounds) { /* Clip to the given bounds. */ cairo_new_path (cr); cairo_move_to (cr, bounds->x1, bounds->y1); cairo_line_to (cr, bounds->x2, bounds->y1); cairo_line_to (cr, bounds->x2, bounds->y2); cairo_line_to (cr, bounds->x1, bounds->y2); cairo_close_path (cr); cairo_clip (cr); goo_canvas_item_paint (canvas->root_item, cr, bounds, scale); } else { goo_canvas_item_paint (canvas->root_item, cr, &canvas->bounds, scale); } } /* * Keyboard/Mouse Event & Grab Handling. */ /* Initializes a synthesized crossing event from a given button press/release, motion, or crossing event. */ static void initialize_crossing_event (GooCanvas *canvas, GdkEvent *event) { GdkEventCrossing *crossing_event = &canvas->crossing_event; /* Initialize the crossing event. */ crossing_event->type = event->any.type; crossing_event->window = event->any.window; crossing_event->send_event = event->any.send_event; crossing_event->subwindow = NULL; crossing_event->detail = GDK_NOTIFY_ANCESTOR; crossing_event->focus = FALSE; crossing_event->mode = GDK_CROSSING_NORMAL; switch (event->type) { case GDK_MOTION_NOTIFY: crossing_event->time = event->motion.time; crossing_event->x = event->motion.x; crossing_event->y = event->motion.y; crossing_event->x_root = event->motion.x_root; crossing_event->y_root = event->motion.y_root; crossing_event->state = event->motion.state; break; case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: crossing_event->time = event->crossing.time; crossing_event->x = event->crossing.x; crossing_event->y = event->crossing.y; crossing_event->x_root = event->crossing.x_root; crossing_event->y_root = event->crossing.y_root; crossing_event->state = event->crossing.state; break; case GDK_SCROLL: crossing_event->time = event->scroll.time; crossing_event->x = event->scroll.x; crossing_event->y = event->scroll.y; crossing_event->x_root = event->scroll.x_root; crossing_event->y_root = event->scroll.y_root; crossing_event->state = event->scroll.state; break; default: /* It must be a button press/release event. */ crossing_event->time = event->button.time; crossing_event->x = event->button.x; crossing_event->y = event->button.y; crossing_event->x_root = event->button.x_root; crossing_event->y_root = event->button.y_root; crossing_event->state = event->button.state; break; } } /* Emits a signal for an item and all its parents, until one of them returns TRUE. */ static gboolean propagate_event (GooCanvas *canvas, GooCanvasItem *item, gchar *signal_name, GdkEvent *event) { GooCanvasItem *ancestor; gboolean stop_emission = FALSE, valid; /* Don't emit any events if the canvas is not realized. */ if (!GTK_WIDGET_REALIZED (canvas)) return FALSE; if (item) { /* Check if the item is still in the canvas. */ if (!ITEM_IS_VALID (item)) return FALSE; ancestor = item; } else { /* If there is no target item, we send the event to the root item, with target set to NULL. */ ancestor = canvas->root_item; } /* Make sure the item pointer remains valid throughout the emission. */ if (item) g_object_ref (item); while (ancestor) { g_object_ref (ancestor); g_signal_emit_by_name (ancestor, signal_name, item, event, &stop_emission); /* Check if the ancestor is still in the canvas. */ valid = ITEM_IS_VALID (ancestor) ? TRUE : FALSE; g_object_unref (ancestor); if (stop_emission || !valid) break; ancestor = goo_canvas_item_get_parent (ancestor); } if (item) g_object_unref (item); return stop_emission; } /* This is called to emit pointer events - enter/leave notify, motion notify, and button press/release. */ static gboolean emit_pointer_event (GooCanvas *canvas, gchar *signal_name, GdkEvent *original_event) { GdkEvent event = *original_event; GooCanvasItem *target_item = canvas->pointer_item; double *x, *y, *x_root, *y_root; /* Check if an item has grabbed the pointer. */ if (canvas->pointer_grab_item) { /* When the pointer is grabbed, it receives all the pointer motion, button press/release events and its own enter/leave notify events. Enter/leave notify events for other items are discarded. */ if ((event.type == GDK_ENTER_NOTIFY || event.type == GDK_LEAVE_NOTIFY) && canvas->pointer_item != canvas->pointer_grab_item) return FALSE; target_item = canvas->pointer_grab_item; } /* Check if the target item is still in the canvas. */ if (target_item && !ITEM_IS_VALID (target_item)) return FALSE; /* Translate the x & y coordinates to the item's space. */ switch (event.type) { case GDK_MOTION_NOTIFY: x = &event.motion.x; y = &event.motion.y; x_root = &event.motion.x_root; y_root = &event.motion.y_root; break; case GDK_ENTER_NOTIFY: case GDK_LEAVE_NOTIFY: x = &event.crossing.x; y = &event.crossing.y; x_root = &event.crossing.x_root; y_root = &event.crossing.y_root; break; case GDK_SCROLL: x = &event.scroll.x; y = &event.scroll.y; x_root = &event.scroll.x_root; y_root = &event.scroll.y_root; break; default: /* It must be a button press/release event. */ x = &event.button.x; y = &event.button.y; x_root = &event.button.x_root; y_root = &event.button.y_root; break; } /* Add 0.5 to the pixel coordinates so we use the center of the pixel. */ *x += 0.5; *y += 0.5; /* Convert to the canvas coordinate space. */ goo_canvas_convert_from_pixels (canvas, x, y); /* Convert to static item space, if necessary. */ if (target_item && goo_canvas_item_get_is_static (target_item)) goo_canvas_convert_to_static_item_space (canvas, x, y); /* Copy to the x_root & y_root fields. */ *x_root = *x; *y_root = *y; /* Convert to the item's coordinate space. */ goo_canvas_convert_to_item_space (canvas, target_item, x, y); return propagate_event (canvas, target_item, signal_name, &event); } /* Finds the item that the mouse is over, using the given event's * coordinates. It emits enter/leave events for items as appropriate. */ static void update_pointer_item (GooCanvas *canvas, GdkEvent *event) { GooCanvasItem *new_item = NULL; if (event) initialize_crossing_event (canvas, event); /* If the event type is GDK_LEAVE_NOTIFY, the mouse has left the canvas, so we leave new_item as NULL, otherwise we find which item is underneath the mouse. Note that we initialize the type to GDK_LEAVE_NOTIFY in goo_canvas_init() to indicate the mouse isn't in the canvas. */ if (canvas->crossing_event.type != GDK_LEAVE_NOTIFY && canvas->root_item) { double x = canvas->crossing_event.x; double y = canvas->crossing_event.y; goo_canvas_convert_from_pixels (canvas, &x, &y); new_item = goo_canvas_get_item_at (canvas, x, y, TRUE); } /* If the current item hasn't changed, just return. */ if (new_item == canvas->pointer_item) return; /* Ref the new item, in case it is removed below. */ if (new_item) g_object_ref (new_item); /* Emit a leave-notify event for the current item. */ if (canvas->pointer_item) { canvas->crossing_event.type = GDK_LEAVE_NOTIFY; emit_pointer_event (canvas, "leave_notify_event", (GdkEvent*) &canvas->crossing_event); } /* If there is no new item we are done. */ if (!new_item) { set_item_pointer (&canvas->pointer_item, NULL); return; } /* If the new item isn't in the canvas any more, don't use it. */ if (!ITEM_IS_VALID (new_item)) { set_item_pointer (&canvas->pointer_item, NULL); g_object_unref (new_item); return; } /* Emit an enter-notify for the new current item. */ set_item_pointer (&canvas->pointer_item, new_item); canvas->crossing_event.type = GDK_ENTER_NOTIFY; emit_pointer_event (canvas, "enter_notify_event", (GdkEvent*) &canvas->crossing_event); g_object_unref (new_item); } static gboolean goo_canvas_crossing (GtkWidget *widget, GdkEventCrossing *event) { GooCanvas *canvas = GOO_CANVAS (widget); if (event->window != canvas->canvas_window) return FALSE; /* This will result in synthesizing focus_in/out events as appropriate. */ update_pointer_item (canvas, (GdkEvent*) event); return FALSE; } static gboolean goo_canvas_motion (GtkWidget *widget, GdkEventMotion *event) { GooCanvas *canvas = GOO_CANVAS (widget); if (event->window != canvas->canvas_window) return FALSE; /* For motion notify hint events we need to call gdk_window_get_pointer() to let X know we're ready for another pointer event. */ if (event->is_hint) gdk_window_get_pointer (event->window, NULL, NULL, NULL); update_pointer_item (canvas, (GdkEvent*) event); return emit_pointer_event (canvas, "motion_notify_event", (GdkEvent*) event); } static gboolean goo_canvas_button_press (GtkWidget *widget, GdkEventButton *event) { GooCanvas *canvas = GOO_CANVAS (widget); GdkDisplay *display; if (event->window != canvas->canvas_window) return FALSE; update_pointer_item (canvas, (GdkEvent*) event); /* Check if this is the start of an implicit pointer grab, i.e. if we don't already have a grab and the app has no active grab. */ display = gtk_widget_get_display (widget); if (!canvas->pointer_grab_item && !gdk_display_pointer_is_grabbed (display)) { set_item_pointer (&canvas->pointer_grab_initial_item, canvas->pointer_item); set_item_pointer (&canvas->pointer_grab_item, canvas->pointer_item); canvas->pointer_grab_button = event->button; } return emit_pointer_event (canvas, "button_press_event", (GdkEvent*) event); } static gboolean goo_canvas_button_release (GtkWidget *widget, GdkEventButton *event) { GooCanvas *canvas = GOO_CANVAS (widget); GdkDisplay *display; gboolean retval; if (event->window != canvas->canvas_window) return FALSE; update_pointer_item (canvas, (GdkEvent*) event); retval = emit_pointer_event (canvas, "button_release_event", (GdkEvent*) event); /* Check if an implicit (passive) grab has ended. */ display = gtk_widget_get_display (widget); if (canvas->pointer_grab_item && event->button == canvas->pointer_grab_button && !gdk_display_pointer_is_grabbed (display)) { /* We set the pointer item back to the item it was in before the grab, so we'll synthesize enter/leave notify events as appropriate. */ if (canvas->pointer_grab_initial_item && ITEM_IS_VALID (canvas->pointer_grab_initial_item)) set_item_pointer (&canvas->pointer_item, canvas->pointer_grab_initial_item); else set_item_pointer (&canvas->pointer_item, NULL); set_item_pointer (&canvas->pointer_grab_item, NULL); set_item_pointer (&canvas->pointer_grab_initial_item, NULL); update_pointer_item (canvas, (GdkEvent*) event); } return retval; } static gint goo_canvas_scroll (GtkWidget *widget, GdkEventScroll *event) { GooCanvas *canvas = GOO_CANVAS (widget); GtkAdjustment *adj; gdouble delta, new_value; if (event->window == canvas->canvas_window) { /* See if the current item wants the scroll event. */ update_pointer_item (canvas, (GdkEvent*) event); if (emit_pointer_event (canvas, "scroll_event", (GdkEvent*) event)) return TRUE; } if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_DOWN) adj = canvas->vadjustment; else adj = canvas->hadjustment; delta = pow (adj->page_size, 2.0 / 3.0); if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_LEFT) delta = - delta; new_value = CLAMP (adj->value + delta, adj->lower, adj->upper - adj->page_size); gtk_adjustment_set_value (adj, new_value); return TRUE; } static gboolean goo_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event) { GooCanvas *canvas = GOO_CANVAS (widget); GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS); if (canvas->focused_item) return propagate_event (canvas, canvas->focused_item, "focus_in_event", (GdkEvent*) event); else return FALSE; } static gboolean goo_canvas_focus_out (GtkWidget *widget, GdkEventFocus *event) { GooCanvas *canvas = GOO_CANVAS (widget); GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS); if (canvas->focused_item) return propagate_event (canvas, canvas->focused_item, "focus_out_event", (GdkEvent*) event); else return FALSE; } static gboolean goo_canvas_key_press (GtkWidget *widget, GdkEventKey *event) { GooCanvas *canvas = GOO_CANVAS (widget); if (GTK_WIDGET_HAS_FOCUS (canvas) && canvas->focused_item) if (propagate_event (canvas, canvas->focused_item, "key_press_event", (GdkEvent*) event)) return TRUE; return GTK_WIDGET_CLASS (goo_canvas_parent_class)->key_press_event (widget, event); } static gboolean goo_canvas_key_release (GtkWidget *widget, GdkEventKey *event) { GooCanvas *canvas = GOO_CANVAS (widget); if (GTK_WIDGET_HAS_FOCUS (canvas) && canvas->focused_item) if (propagate_event (canvas, canvas->focused_item, "key_release_event", (GdkEvent*) event)) return TRUE; return GTK_WIDGET_CLASS (goo_canvas_parent_class)->key_release_event (widget, event); } static void generate_grab_broken (GooCanvas *canvas, GooCanvasItem *item, gboolean keyboard, gboolean implicit) { GdkEventGrabBroken event; if (!ITEM_IS_VALID (item)) return; event.type = GDK_GRAB_BROKEN; event.window = canvas->canvas_window; event.send_event = 0; event.keyboard = keyboard; event.implicit = implicit; event.grab_window = event.window; propagate_event (canvas, item, "grab_broken_event", (GdkEvent*) &event); } static gboolean goo_canvas_grab_broken (GtkWidget *widget, GdkEventGrabBroken *event) { GooCanvas *canvas; g_return_val_if_fail (GOO_IS_CANVAS (widget), FALSE); canvas = GOO_CANVAS (widget); if (event->keyboard) { if (canvas->keyboard_grab_item) { generate_grab_broken (canvas, canvas->keyboard_grab_item, event->keyboard, event->implicit); set_item_pointer (&canvas->keyboard_grab_item, NULL); } } else { if (canvas->pointer_grab_item) { generate_grab_broken (canvas, canvas->pointer_grab_item, event->keyboard, event->implicit); set_item_pointer (&canvas->pointer_grab_item, NULL); } } return TRUE; } /** * goo_canvas_grab_focus: * @canvas: a #GooCanvas. * @item: the item to grab the focus. * * Grabs the keyboard focus for the given item. **/ void goo_canvas_grab_focus (GooCanvas *canvas, GooCanvasItem *item) { GdkEventFocus event; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GTK_WIDGET_CAN_FOCUS (canvas)); if (canvas->focused_item) { event.type = GDK_FOCUS_CHANGE; event.window = canvas->canvas_window; event.send_event = FALSE; event.in = FALSE; propagate_event (canvas, canvas->focused_item, "focus_out_event", (GdkEvent*) &event); } set_item_pointer (&canvas->focused_item, item); gtk_widget_grab_focus (GTK_WIDGET (canvas)); if (canvas->focused_item) { event.type = GDK_FOCUS_CHANGE; event.window = canvas->canvas_window; event.send_event = FALSE; event.in = TRUE; propagate_event (canvas, canvas->focused_item, "focus_in_event", (GdkEvent*) &event); } } /* * Pointer/keyboard grabbing & ungrabbing. */ /** * goo_canvas_pointer_grab: * @canvas: a #GooCanvas. * @item: the item to grab the pointer for. * @event_mask: the events to receive during the grab. * @cursor: the cursor to display during the grab, or NULL. * @time: the time of the event that lead to the pointer grab. This should * come from the relevant #GdkEvent. * * Attempts to grab the pointer for the given item. * * Returns: %GDK_GRAB_SUCCESS if the grab succeeded. **/ GdkGrabStatus goo_canvas_pointer_grab (GooCanvas *canvas, GooCanvasItem *item, GdkEventMask event_mask, GdkCursor *cursor, guint32 time) { GdkGrabStatus status = GDK_GRAB_SUCCESS; g_return_val_if_fail (GOO_IS_CANVAS (canvas), GDK_GRAB_NOT_VIEWABLE); g_return_val_if_fail (GOO_IS_CANVAS_ITEM (item), GDK_GRAB_NOT_VIEWABLE); /* If another item already has the pointer grab, we need to synthesize a grab-broken event for the current grab item. */ if (canvas->pointer_grab_item && canvas->pointer_grab_item != item) { generate_grab_broken (canvas, canvas->pointer_grab_item, FALSE, FALSE); set_item_pointer (&canvas->pointer_grab_item, NULL); } /* This overrides any existing grab. */ status = gdk_pointer_grab (canvas->canvas_window, FALSE, event_mask, NULL, cursor, time); if (status == GDK_GRAB_SUCCESS) { set_item_pointer (&canvas->pointer_grab_initial_item, canvas->pointer_item); set_item_pointer (&canvas->pointer_grab_item, item); } return status; } /** * goo_canvas_pointer_ungrab: * @canvas: a #GooCanvas. * @item: the item that has the grab. * @time: the time of the event that lead to the pointer ungrab. This should * come from the relevant #GdkEvent. * * Ungrabs the pointer, if the given item has the pointer grab. **/ void goo_canvas_pointer_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time) { GdkDisplay *display; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); /* If the item doesn't actually have the pointer grab, just return. */ if (canvas->pointer_grab_item != item) return; /* If it is an active pointer grab, ungrab it explicitly. */ display = gtk_widget_get_display (GTK_WIDGET (canvas)); if (gdk_display_pointer_is_grabbed (display)) gdk_display_pointer_ungrab (display, time); /* We set the pointer item back to the item it was in before the grab, so we'll synthesize enter/leave notify events as appropriate. */ if (canvas->pointer_grab_initial_item && ITEM_IS_VALID (canvas->pointer_grab_initial_item)) set_item_pointer (&canvas->pointer_item, canvas->pointer_grab_initial_item); else set_item_pointer (&canvas->pointer_item, NULL); set_item_pointer (&canvas->pointer_grab_item, NULL); set_item_pointer (&canvas->pointer_grab_initial_item, NULL); update_pointer_item (canvas, NULL); } /** * goo_canvas_keyboard_grab: * @canvas: a #GooCanvas. * @item: the item to grab the keyboard for. * @owner_events: %TRUE if keyboard events for this application will be * reported normally, or %FALSE if all keyboard events will be reported with * respect to the grab item. * @time: the time of the event that lead to the keyboard grab. This should * come from the relevant #GdkEvent. * * Attempts to grab the keyboard for the given item. * * Returns: %GDK_GRAB_SUCCESS if the grab succeeded. **/ GdkGrabStatus goo_canvas_keyboard_grab (GooCanvas *canvas, GooCanvasItem *item, gboolean owner_events, guint32 time) { GdkGrabStatus status = GDK_GRAB_SUCCESS; g_return_val_if_fail (GOO_IS_CANVAS (canvas), GDK_GRAB_NOT_VIEWABLE); g_return_val_if_fail (GOO_IS_CANVAS_ITEM (item), GDK_GRAB_NOT_VIEWABLE); /* Check if the item already has the keyboard grab. */ if (canvas->keyboard_grab_item == item) return GDK_GRAB_ALREADY_GRABBED; /* If another item already has the keyboard grab, we need to synthesize a grab-broken event for the current grab item. */ if (canvas->keyboard_grab_item) { generate_grab_broken (canvas, canvas->keyboard_grab_item, TRUE, FALSE); set_item_pointer (&canvas->keyboard_grab_item, NULL); } /* This overrides any existing grab. */ status = gdk_keyboard_grab (canvas->canvas_window, owner_events, time); if (status == GDK_GRAB_SUCCESS) set_item_pointer (&canvas->keyboard_grab_item, item); return status; } /** * goo_canvas_keyboard_ungrab: * @canvas: a #GooCanvas. * @item: the item that has the keyboard grab. * @time: the time of the event that lead to the keyboard ungrab. This should * come from the relevant #GdkEvent. * * Ungrabs the keyboard, if the given item has the keyboard grab. **/ void goo_canvas_keyboard_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time) { GdkDisplay *display; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); /* If the item doesn't actually have the keyboard grab, just return. */ if (canvas->keyboard_grab_item != item) return; set_item_pointer (&canvas->keyboard_grab_item, NULL); display = gtk_widget_get_display (GTK_WIDGET (canvas)); gdk_display_keyboard_ungrab (display, time); } /* * Coordinate conversion. */ /** * goo_canvas_convert_to_pixels: * @canvas: a #GooCanvas. * @x: a pointer to the x coordinate to convert. * @y: a pointer to the y coordinate to convert. * * Converts a coordinate from the canvas coordinate space to pixels. * * The canvas coordinate space is specified in the call to * goo_canvas_set_bounds(). * * The pixel coordinate space specifies pixels from the top-left of the entire * canvas window, according to the current scale setting. * See goo_canvas_set_scale(). **/ void goo_canvas_convert_to_pixels (GooCanvas *canvas, gdouble *x, gdouble *y) { *x = ((*x - canvas->bounds.x1) * canvas->device_to_pixels_x) + canvas->canvas_x_offset; *y = ((*y - canvas->bounds.y1) * canvas->device_to_pixels_y) + canvas->canvas_y_offset; } /** * goo_canvas_convert_from_pixels: * @canvas: a #GooCanvas. * @x: a pointer to the x coordinate to convert. * @y: a pointer to the y coordinate to convert. * * Converts a coordinate from pixels to the canvas coordinate space. * * The pixel coordinate space specifies pixels from the top-left of the entire * canvas window, according to the current scale setting. * See goo_canvas_set_scale(). * * The canvas coordinate space is specified in the call to * goo_canvas_set_bounds(). * **/ void goo_canvas_convert_from_pixels (GooCanvas *canvas, gdouble *x, gdouble *y) { *x = ((*x - canvas->canvas_x_offset) / canvas->device_to_pixels_x) + canvas->bounds.x1; *y = ((*y - canvas->canvas_y_offset) / canvas->device_to_pixels_y) + canvas->bounds.y1; } static void goo_canvas_convert_from_window_pixels (GooCanvas *canvas, gdouble *x, gdouble *y) { *x += canvas->hadjustment->value; *y += canvas->vadjustment->value; goo_canvas_convert_from_pixels (canvas, x, y); } /* Converts from the canvas coordinate space to the static item coordinate space, i.e. in pixels from the top-left of the viewport window. */ static void goo_canvas_convert_to_static_item_space (GooCanvas *canvas, gdouble *x, gdouble *y) { *x = ((*x - canvas->bounds.x1) * canvas->device_to_pixels_x) + canvas->canvas_x_offset - canvas->hadjustment->value; *y = ((*y - canvas->bounds.y1) * canvas->device_to_pixels_y) + canvas->canvas_y_offset - canvas->vadjustment->value; } static void get_transform_to_item_space (GooCanvasItem *item, cairo_matrix_t *transform) { GooCanvasItem *tmp = item, *parent, *child; GList *list = NULL, *l; cairo_matrix_t item_transform, inverse = { 1, 0, 0, 1, 0, 0 }; gboolean has_transform; /* Step up from the item to the top, pushing items onto the list. */ while (tmp) { list = g_list_prepend (list, tmp); tmp = goo_canvas_item_get_parent (tmp); } /* Now step down applying the inverse of each item's transformation. */ for (l = list; l; l = l->next) { parent = (GooCanvasItem*) l->data; child = l->next ? (GooCanvasItem*) l->next->data : NULL; has_transform = goo_canvas_item_get_transform_for_child (parent, child, &item_transform); if (has_transform) { cairo_matrix_invert (&item_transform); cairo_matrix_multiply (&inverse, &inverse, &item_transform); } } g_list_free (list); *transform = inverse; } /** * goo_canvas_convert_to_item_space: * @canvas: a #GooCanvas. * @item: a #GooCanvasItem. * @x: a pointer to the x coordinate to convert. * @y: a pointer to the y coordinate to convert. * * Converts a coordinate from the canvas coordinate space to the given * item's coordinate space, applying all transformation matrices including the * item's own transformation matrix, if it has one. **/ void goo_canvas_convert_to_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y) { cairo_matrix_t transform; get_transform_to_item_space (item, &transform); cairo_matrix_transform_point (&transform, x, y); } /** * goo_canvas_convert_from_item_space: * @canvas: a #GooCanvas. * @item: a #GooCanvasItem. * @x: a pointer to the x coordinate to convert. * @y: a pointer to the y coordinate to convert. * * Converts a coordinate from the given item's coordinate space to the canvas * coordinate space, applying all transformation matrices including the * item's own transformation matrix, if it has one. **/ void goo_canvas_convert_from_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y) { GooCanvasItem *tmp = item, *parent, *child; GList *list = NULL, *l; cairo_matrix_t item_transform, transform = { 1, 0, 0, 1, 0, 0 }; gboolean has_transform; /* Step up from the item to the top, pushing items onto the list. */ while (tmp) { list = g_list_prepend (list, tmp); tmp = goo_canvas_item_get_parent (tmp); } /* Now step down applying each item's transformation. */ for (l = list; l; l = l->next) { parent = (GooCanvasItem*) l->data; child = l->next ? (GooCanvasItem*) l->next->data : NULL; has_transform = goo_canvas_item_get_transform_for_child (parent, child, &item_transform); if (has_transform) { cairo_matrix_multiply (&transform, &item_transform, &transform); } } g_list_free (list); /* Now convert the coordinates. */ cairo_matrix_transform_point (&transform, x, y); } /** * goo_canvas_convert_bounds_to_item_space: * @canvas: a #GooCanvas. * @item: a #GooCanvasItem. * @bounds: the bounds in canvas coordinate space, to be converted. * * Converts the given bounds in the canvas coordinate space to a bounding box * in item space. This is useful in the item paint() methods to convert the * bounds to be painted to the item's coordinate space. **/ void goo_canvas_convert_bounds_to_item_space (GooCanvas *canvas, GooCanvasItem *item, GooCanvasBounds *bounds) { GooCanvasBounds tmp_bounds = *bounds, tmp_bounds2 = *bounds; cairo_matrix_t transform; get_transform_to_item_space (item, &transform); /* Convert the top-left and bottom-right corners to device coords. */ cairo_matrix_transform_point (&transform, &tmp_bounds.x1, &tmp_bounds.y1); cairo_matrix_transform_point (&transform, &tmp_bounds.x2, &tmp_bounds.y2); /* Now convert the top-right and bottom-left corners. */ cairo_matrix_transform_point (&transform, &tmp_bounds2.x1, &tmp_bounds2.y2); cairo_matrix_transform_point (&transform, &tmp_bounds2.x2, &tmp_bounds2.y1); /* Calculate the minimum x coordinate seen and put in x1. */ bounds->x1 = MIN (tmp_bounds.x1, tmp_bounds.x2); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x1); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x2); /* Calculate the maximum x coordinate seen and put in x2. */ bounds->x2 = MAX (tmp_bounds.x1, tmp_bounds.x2); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x1); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x2); /* Calculate the minimum y coordinate seen and put in y1. */ bounds->y1 = MIN (tmp_bounds.y1, tmp_bounds.y2); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y1); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y2); /* Calculate the maximum y coordinate seen and put in y2. */ bounds->y2 = MAX (tmp_bounds.y1, tmp_bounds.y2); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y1); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y2); } /* * Keyboard focus navigation. */ typedef struct _GooCanvasFocusData GooCanvasFocusData; struct _GooCanvasFocusData { /* The item to start from, usually the currently focused item, or NULL. */ GooCanvasItem *start_item; /* The bounds of the start item. We try to find the next closest one in the desired direction. */ GooCanvasBounds start_bounds; gdouble start_center_x, start_center_y; /* The direction to move the focus in. */ GtkDirectionType direction; /* The text direction of the widget. */ GtkTextDirection text_direction; /* The best item found so far, and the offsets for it. */ GooCanvasItem *best_item; gdouble best_x_offset, best_y_offset, best_score; /* The offsets for the item being tested. */ GooCanvasBounds current_bounds; gdouble current_x_offset, current_y_offset, current_score; }; /* This tries to figure out the bounds of the start item or widget. */ static void goo_canvas_get_start_bounds (GooCanvas *canvas, GooCanvasFocusData *data) { GooCanvasBounds *bounds; GtkWidget *toplevel, *focus_widget; GtkAllocation *allocation; gint focus_widget_x, focus_widget_y; /* If an item is currently focused, we just need its bounds. */ if (data->start_item) { goo_canvas_item_get_bounds (data->start_item, &data->start_bounds); return; } /* Otherwise try to get the currently focused widget in the window. */ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (canvas)); bounds = &data->start_bounds; if (toplevel && GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->focus_widget) { focus_widget = GTK_WINDOW (toplevel)->focus_widget; /* Translate the allocation to be relative to the GooCanvas. Skip ancestor widgets as the coords won't help. */ if (!gtk_widget_is_ancestor (GTK_WIDGET (canvas), focus_widget) && gtk_widget_translate_coordinates (focus_widget, GTK_WIDGET (canvas), 0, 0, &focus_widget_x, &focus_widget_y)) { /* Translate into device units. */ bounds->x1 = focus_widget_x; bounds->y1 = focus_widget_y; bounds->x2 = focus_widget_x + focus_widget->allocation.width; bounds->y2 = focus_widget_y + focus_widget->allocation.height; goo_canvas_convert_from_window_pixels (canvas, &bounds->x1, &bounds->y1); goo_canvas_convert_from_window_pixels (canvas, &bounds->x2, &bounds->y2); return; } } /* As a last resort, we guess a starting position based on the direction. */ allocation = >K_WIDGET (canvas)->allocation; switch (data->direction) { case GTK_DIR_DOWN: case GTK_DIR_RIGHT: /* Start from top-left. */ bounds->x1 = 0.0; bounds->y1 = 0.0; break; case GTK_DIR_UP: /* Start from bottom-left. */ bounds->x1 = 0.0; bounds->y1 = allocation->height; break; case GTK_DIR_LEFT: /* Start from top-right. */ bounds->x1 = allocation->width; bounds->y1 = 0.0; break; case GTK_DIR_TAB_FORWARD: bounds->y1 = 0.0; if (data->text_direction == GTK_TEXT_DIR_RTL) /* Start from top-right. */ bounds->x1 = allocation->width; else /* Start from top-left. */ bounds->x1 = 0.0; break; case GTK_DIR_TAB_BACKWARD: bounds->y1 = allocation->height; if (data->text_direction == GTK_TEXT_DIR_RTL) /* Start from bottom-left. */ bounds->x1 = 0.0; else /* Start from bottom-right. */ bounds->x1 = allocation->width; break; } goo_canvas_convert_from_window_pixels (canvas, &bounds->x1, &bounds->y1); bounds->x2 = bounds->x1; bounds->y2 = bounds->y1; } /* Check if the given item is a better candidate for the focus than the current best one in the data struct. */ static gboolean goo_canvas_focus_check_is_best (GooCanvas *canvas, GooCanvasItem *item, GooCanvasFocusData *data) { gdouble center_x, center_y; gdouble abs_x_offset = 0.0, abs_y_offset = 0.0; data->current_score = 0.0; goo_canvas_item_get_bounds (item, &data->current_bounds); center_x = (data->current_bounds.x1 + data->current_bounds.x2) / 2.0; center_y = (data->current_bounds.y1 + data->current_bounds.y2) / 2.0; /* Calculate the offsets of the center of this item from the center of the current focus item or widget. */ data->current_x_offset = center_x - data->start_center_x; data->current_y_offset = center_y - data->start_center_y; /* If the item overlaps the current one at all we use 0 as the offset. */ if (data->current_bounds.x1 > data->start_bounds.x2 || data->current_bounds.x2 < data->start_bounds.x2) abs_x_offset = fabs (data->current_x_offset); if (data->current_bounds.y1 > data->start_bounds.y2 || data->current_bounds.y2 < data->start_bounds.y2) abs_y_offset = fabs (data->current_y_offset); /* FIXME: I'm still not sure about the score calculations here. There are still a few odd jumps when using keyboard focus navigation. */ switch (data->direction) { case GTK_DIR_UP: /* If the y offset is > 0 we can discard this item. */ if (data->current_y_offset >= 0 || abs_x_offset > abs_y_offset) return FALSE; /* Compute a score (lower is best) and check if it is the best. */ data->current_score = abs_x_offset * 2 + abs_y_offset; if (!data->best_item || data->current_score < data->best_score) return TRUE; break; case GTK_DIR_DOWN: /* If the y offset is < 0 we can discard this item. */ if (data->current_y_offset <= 0 || abs_x_offset > abs_y_offset) return FALSE; /* Compute a score (lower is best) and check if it is the best. */ data->current_score = abs_x_offset /** 2*/ + abs_y_offset; if (!data->best_item || data->current_score < data->best_score) return TRUE; break; case GTK_DIR_LEFT: /* If the x offset is > 0 we can discard this item. */ if (data->current_x_offset >= 0 || abs_y_offset > abs_x_offset) return FALSE; /* Compute a score (lower is best) and check if it is the best. */ data->current_score = abs_y_offset * 2 + abs_x_offset; if (!data->best_item || data->current_score < data->best_score) return TRUE; break; case GTK_DIR_RIGHT: /* If the x offset is < 0 we can discard this item. */ if (data->current_x_offset <= 0 || abs_y_offset > abs_x_offset) return FALSE; /* Compute a score (lower is best) and check if it is the best. */ data->current_score = abs_y_offset * 2 + abs_x_offset; if (!data->best_item || data->current_score < data->best_score) return TRUE; break; case GTK_DIR_TAB_BACKWARD: /* We need to handle this differently depending on text direction. */ if (data->text_direction == GTK_TEXT_DIR_RTL) { /* If the y offset is > 0, or it is 0 and the x offset > 0 we can discard this item. */ if (data->current_y_offset > 0 || (data->current_y_offset == 0 && data->current_x_offset < 0)) return FALSE; /* If the y offset is > the current best y offset, this is best. */ if (!data->best_item || data->current_y_offset > data->best_y_offset) return TRUE; /* If the y offsets are the same, choose the largest x offset. */ if (data->current_y_offset == data->best_y_offset && data->current_x_offset < data->best_x_offset) return TRUE; } else { /* If the y offset is > 0, or it is 0 and the x offset > 0 we can discard this item. */ if (data->current_y_offset > 0 || (data->current_y_offset == 0 && data->current_x_offset > 0)) return FALSE; /* If the y offset is > the current best y offset, this is best. */ if (!data->best_item || data->current_y_offset > data->best_y_offset) return TRUE; /* If the y offsets are the same, choose the largest x offset. */ if (data->current_y_offset == data->best_y_offset && data->current_x_offset > data->best_x_offset) return TRUE; } break; case GTK_DIR_TAB_FORWARD: /* We need to handle this differently depending on text direction. */ if (data->text_direction == GTK_TEXT_DIR_RTL) { /* If the y offset is < 0, or it is 0 and the x offset > 0 we can discard this item. */ if (data->current_y_offset < 0 || (data->current_y_offset == 0 && data->current_x_offset > 0)) return FALSE; /* If the y offset is < the current best y offset, this is best. */ if (!data->best_item || data->current_y_offset < data->best_y_offset) return TRUE; /* If the y offsets are the same, choose the largest x offset. */ if (data->current_y_offset == data->best_y_offset && data->current_x_offset > data->best_x_offset) return TRUE; } else { /* If the y offset is < 0, or it is 0 and the x offset < 0 we can discard this item. */ if (data->current_y_offset < 0 || (data->current_y_offset == 0 && data->current_x_offset < 0)) return FALSE; /* If the y offset is < the current best y offset, this is best. */ if (!data->best_item || data->current_y_offset < data->best_y_offset) return TRUE; /* If the y offsets are the same, choose the smallest x offset. */ if (data->current_y_offset == data->best_y_offset && data->current_x_offset < data->best_x_offset) return TRUE; } break; } return FALSE; } /* Recursively look for the next best item in the desired direction. */ static void goo_canvas_focus_recurse (GooCanvas *canvas, GooCanvasItem *item, GooCanvasFocusData *data) { GooCanvasItem *child; gboolean can_focus = FALSE, is_best; gint n_children, i; /* If the item is not a possible candidate, just return. */ is_best = goo_canvas_focus_check_is_best (canvas, item, data); if (is_best && goo_canvas_item_is_visible (item)) { /* Check if the item can take the focus. */ if (GOO_IS_CANVAS_WIDGET (item)) { /* We have to assume that widget items can take focus, since any of their descendants may take the focus. */ if (((GooCanvasWidget*) item)->widget) can_focus = TRUE; } else { g_object_get (item, "can-focus", &can_focus, NULL); } /* If the item can take the focus itself, and it isn't the current focus item, save its score and return. (If it is a container it takes precedence over its children). */ if (can_focus && item != data->start_item) { data->best_item = item; data->best_x_offset = data->current_x_offset; data->best_y_offset = data->current_y_offset; data->best_score = data->current_score; return; } } /* If the item is a container, check the children recursively. */ n_children = goo_canvas_item_get_n_children (item); if (n_children) { /* Check if we can skip the entire group. */ switch (data->direction) { case GTK_DIR_UP: /* If the group is below the bottom of the current focused item we can skip it. */ if (data->current_bounds.y1 > data->start_bounds.y2) return; break; case GTK_DIR_DOWN: /* If the group is above the top of the current focused item we can skip it. */ if (data->current_bounds.y2 < data->start_bounds.y1) return; break; case GTK_DIR_LEFT: /* If the group is to the right of the current focused item we can skip it. */ if (data->current_bounds.x1 > data->start_bounds.x2) return; break; case GTK_DIR_RIGHT: /* If the group is to the left of the current focused item we can skip it. */ if (data->current_bounds.x2 < data->start_bounds.x1) return; break; default: break; } for (i = 0; i < n_children; i++) { child = goo_canvas_item_get_child (item, i); goo_canvas_focus_recurse (canvas, child, data); } } } /* FIXME: We could add support for a focus chain, like GtkContainer. */ static gboolean goo_canvas_focus (GtkWidget *widget, GtkDirectionType direction) { GooCanvas *canvas; GooCanvasFocusData data; GtkWidget *old_focus_child; gboolean found_item; gint try; g_return_val_if_fail (GOO_IS_CANVAS (widget), FALSE); canvas = GOO_CANVAS (widget); /* If keyboard navigation has been turned off for the canvas, return FALSE.*/ if (!GTK_WIDGET_CAN_FOCUS (canvas)) return FALSE; /* If a child widget has the focus, try moving the focus within that. */ old_focus_child = GTK_CONTAINER (canvas)->focus_child; if (old_focus_child && gtk_widget_child_focus (old_focus_child, direction)) return TRUE; data.direction = direction; data.text_direction = gtk_widget_get_direction (widget); data.start_item = NULL; if (GTK_WIDGET_HAS_FOCUS (canvas)) data.start_item = canvas->focused_item; else if (old_focus_child && GOO_IS_CANVAS_WIDGET (old_focus_child)) data.start_item = g_object_get_data (G_OBJECT (old_focus_child), "goo-canvas-item"); /* Keep looping until we find an item to focus or we fail. I've added a limit on the number of tries just in case we get into an infinite loop. */ for (try = 1; try < 1000; try++) { /* Get the bounds of the currently focused item or widget. */ goo_canvas_get_start_bounds (canvas, &data); data.start_center_x = (data.start_bounds.x1 + data.start_bounds.x2) / 2.0; data.start_center_y = (data.start_bounds.y1 + data.start_bounds.y2) / 2.0; data.best_item = NULL; /* Recursively look for the next best item in the desired direction. */ goo_canvas_focus_recurse (canvas, canvas->root_item, &data); /* If we found an item to focus, grab the focus and return TRUE. */ if (!data.best_item) break; if (GOO_IS_CANVAS_WIDGET (data.best_item)) { found_item = gtk_widget_child_focus (((GooCanvasWidget*) data.best_item)->widget, direction); } else { found_item = TRUE; goo_canvas_grab_focus (canvas, data.best_item); } if (found_item) { goo_canvas_scroll_to_item (canvas, data.best_item); return TRUE; } /* Try again from the last item tried. */ data.start_item = data.best_item; } return FALSE; } /** * goo_canvas_register_widget_item: * @canvas: a #GooCanvas. * @witem: a #GooCanvasWidget item. * * This function should only be used by #GooCanvasWidget and subclass * implementations. * * It registers a widget item with the canvas, so that the canvas can do the * necessary actions to move and resize the widget as needed. **/ void goo_canvas_register_widget_item (GooCanvas *canvas, GooCanvasWidget *witem) { g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_WIDGET (witem)); canvas->widget_items = g_list_append (canvas->widget_items, witem); } /** * goo_canvas_unregister_widget_item: * @canvas: a #GooCanvas. * @witem: a #GooCanvasWidget item. * * This function should only be used by #GooCanvasWidget and subclass * implementations. * * It unregisters a widget item from the canvas, when the item is no longer in * the canvas. **/ void goo_canvas_unregister_widget_item (GooCanvas *canvas, GooCanvasWidget *witem) { GList *tmp_list; GooCanvasWidget *tmp_witem; g_return_if_fail (GOO_IS_CANVAS (canvas)); g_return_if_fail (GOO_IS_CANVAS_WIDGET (witem)); tmp_list = canvas->widget_items; while (tmp_list) { tmp_witem = tmp_list->data; if (tmp_witem == witem) break; tmp_list = tmp_list->next; } if (tmp_list) { canvas->widget_items = g_list_remove_link (canvas->widget_items, tmp_list); g_list_free_1 (tmp_list); } } static void goo_canvas_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { GooCanvas *canvas; GList *tmp_list; GooCanvasWidget *witem; g_return_if_fail (GOO_IS_CANVAS (container)); g_return_if_fail (callback != NULL); canvas = GOO_CANVAS (container); tmp_list = canvas->widget_items; while (tmp_list) { witem = tmp_list->data; tmp_list = tmp_list->next; if (witem->widget) (* callback) (witem->widget, callback_data); } } static void goo_canvas_remove (GtkContainer *container, GtkWidget *widget) { GooCanvas *canvas; GList *tmp_list; GooCanvasWidget *witem; GooCanvasItem *parent; gint child_num; g_return_if_fail (GOO_IS_CANVAS (container)); canvas = GOO_CANVAS (container); tmp_list = canvas->widget_items; while (tmp_list) { witem = tmp_list->data; tmp_list = tmp_list->next; if (witem->widget == widget) { parent = goo_canvas_item_get_parent ((GooCanvasItem*) witem); child_num = goo_canvas_item_find_child (parent, (GooCanvasItem*) witem); goo_canvas_item_remove_child (parent, child_num); break; } } } static gboolean goo_canvas_query_tooltip (GtkWidget *widget, gint x, gint y, gboolean keyboard_tip, GtkTooltip *tooltip) { GooCanvas *canvas = (GooCanvas*) widget; GooCanvasItem *item = canvas->pointer_item, *parent; gdouble item_x = x, item_y = y; gboolean tip_set = FALSE, has_transform; cairo_matrix_t transform; if (!item) return FALSE; /* Convert from pixels to the item's coordinate space. */ goo_canvas_convert_from_pixels (canvas, &item_x, &item_y); goo_canvas_convert_to_item_space (canvas, item, &item_x, &item_y); for (;;) { g_signal_emit_by_name (item, "query-tooltip", item_x, item_y, keyboard_tip, tooltip, &tip_set); if (tip_set) return TRUE; parent = goo_canvas_item_get_parent (item); if (!parent) break; /* Convert x & y to the parent's coordinate space. */ has_transform = goo_canvas_item_get_transform_for_child (parent, item, &transform); if (has_transform) cairo_matrix_transform_point (&transform, &item_x, &item_y); item = parent; } /* We call the parent method in case the canvas itself has a tooltip set. */ return GTK_WIDGET_CLASS (goo_canvas_parent_class)->query_tooltip (widget, x, y, keyboard_tip, tooltip); } goocanvas-0.15/src/goocanvas.h0000644000076400007640000002623511172574677013321 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvas.h - the main canvas widget. */ #ifndef __GOO_CANVAS_H__ #define __GOO_CANVAS_H__ #include #include #include #include #include #include #include #include #include #include #include #include G_BEGIN_DECLS #define GOO_TYPE_CANVAS (goo_canvas_get_type ()) #define GOO_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS, GooCanvas)) #define GOO_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS, GooCanvasClass)) #define GOO_IS_CANVAS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS)) #define GOO_IS_CANVAS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS)) #define GOO_CANVAS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS, GooCanvasClass)) typedef struct _GooCanvasClass GooCanvasClass; /** * GooCanvas * * The #GooCanvas-struct struct contains private data only. */ struct _GooCanvas { GtkContainer container; /* The model for the root item, in model/view mode. */ GooCanvasItemModel *root_item_model; /* The root canvas item. */ GooCanvasItem *root_item; /* The bounds of the canvas, in canvas units (not pixels). */ GooCanvasBounds bounds; /* The scale/zoom factors of the canvas. */ gdouble scale_x, scale_y; /* The minimum of scale_x and scale_y, to compare with items' visibility thresholds. */ gdouble scale; /* Where the canvas is anchored (where it is displayed when it is smaller than the entire window). */ GtkAnchorType anchor; /* Idle handler ID, for processing updates. */ guint idle_id; /* This is TRUE if some item in the canvas needs an update. */ guint need_update : 1; /* This is TRUE if all items in the canvas need to be updated. */ guint need_entire_subtree_update : 1; /* This is TRUE if all layout should be done to the nearest integer. */ guint integer_layout : 1; /* This is TRUE if the bounds are calculated automatically, using the bounds of all the items in the canvas. */ guint automatic_bounds : 1; /* This is TRUE if the automatic bounds are calculated from the origin. */ guint bounds_from_origin : 1; /* This is TRUE if the background is cleared before painting the canvas. */ guint clear_background : 1; /* This is TRUE if the canvas is completely redrawn when scrolled. It is useful when there are sticky items to reduce flicker, but is slower. */ guint redraw_when_scrolled : 1; /* This is the padding around the automatic bounds. */ gdouble bounds_padding; /* The item that the mouse is over. */ GooCanvasItem *pointer_item; /* The item that has the pointer grab, or NULL. */ GooCanvasItem *pointer_grab_item; /* This is the item that the grab was started from. When the grab ends we synthesize enter/leave notify events from this item. */ GooCanvasItem *pointer_grab_initial_item; /* This is the mouse button that started an implicit pointer grab. When the same button is released the implicit grab ends. */ guint pointer_grab_button; /* The item that has the keyboard focus, or NULL. */ GooCanvasItem *focused_item; /* The item that has the keyboard grab, or NULL. */ GooCanvasItem *keyboard_grab_item; /* The synthesized event used for sending enter-notify and leave-notify events to items. */ GdkEventCrossing crossing_event; /* The main canvas window, which gets scrolled around. */ GdkWindow *canvas_window; /* The offsets of the canvas within the canvas window, in pixels. These are used when the canvas is smaller than the window size and the anchor is not NORTH_WEST. */ gint canvas_x_offset; gint canvas_y_offset; /* The adjustments used for scrolling. */ GtkAdjustment *hadjustment; GtkAdjustment *vadjustment; /* Freezes any movement of the canvas window, until thawed. This is used when we need to set both adjustments and don't want it to scroll twice. */ gint freeze_count; /* A window temporarily mapped above the canvas to stop X from scrolling the contents unnecessarily (i.e. when we zoom in/out). */ GdkWindow *tmp_window; /* A hash table mapping canvas item models to canvas items. */ GHashTable *model_to_item; /* The units of the canvas, which applies to all item coords. */ GtkUnit units; /* The horizontal and vertical resolution of the display, in dots per inch. This is only needed when units other than pixels are used. */ gdouble resolution_x, resolution_y; /* The multiplers to convert from device units to pixels, taking into account the canvas scale, the units setting and the display resolution. */ gdouble device_to_pixels_x, device_to_pixels_y; /* The list of child widgets (using GooCanvasWidget items). */ GList *widget_items; }; /** * GooCanvasClass * @create_item: a virtual method that subclasses may override to create custom * canvas items for item models. * @item_created: signal emitted when a new canvas item has been created. * Applications can connect to this to setup signal handlers for the new item. * * The #GooCanvasClass-struct struct contains one virtual method that * subclasses may override. */ struct _GooCanvasClass { /*< private >*/ GtkContainerClass parent_class; void (* set_scroll_adjustments) (GooCanvas *canvas, GtkAdjustment *hadjustment, GtkAdjustment *vadjustment); /* Virtual methods. */ /*< public >*/ GooCanvasItem* (* create_item) (GooCanvas *canvas, GooCanvasItemModel *model); /* Signals. */ void (* item_created) (GooCanvas *canvas, GooCanvasItem *item, GooCanvasItemModel *model); /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); void (*_goo_canvas_reserved5) (void); void (*_goo_canvas_reserved6) (void); void (*_goo_canvas_reserved7) (void); void (*_goo_canvas_reserved8) (void); }; GType goo_canvas_get_type (void) G_GNUC_CONST; GtkWidget* goo_canvas_new (void); GooCanvasItem* goo_canvas_get_root_item (GooCanvas *canvas); void goo_canvas_set_root_item (GooCanvas *canvas, GooCanvasItem *item); GooCanvasItemModel* goo_canvas_get_root_item_model (GooCanvas *canvas); void goo_canvas_set_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model); GooCanvasItem* goo_canvas_get_static_root_item (GooCanvas *canvas); void goo_canvas_set_static_root_item (GooCanvas *canvas, GooCanvasItem *item); GooCanvasItemModel* goo_canvas_get_static_root_item_model (GooCanvas *canvas); void goo_canvas_set_static_root_item_model (GooCanvas *canvas, GooCanvasItemModel *model); GooCanvasItem* goo_canvas_get_item (GooCanvas *canvas, GooCanvasItemModel *model); GooCanvasItem* goo_canvas_get_item_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event); GList* goo_canvas_get_items_at (GooCanvas *canvas, gdouble x, gdouble y, gboolean is_pointer_event); GList* goo_canvas_get_items_in_area(GooCanvas *canvas, const GooCanvasBounds *area, gboolean inside_area, gboolean allow_overlaps, gboolean include_containers); gdouble goo_canvas_get_scale (GooCanvas *canvas); void goo_canvas_set_scale (GooCanvas *canvas, gdouble scale); void goo_canvas_get_bounds (GooCanvas *canvas, gdouble *left, gdouble *top, gdouble *right, gdouble *bottom); void goo_canvas_set_bounds (GooCanvas *canvas, gdouble left, gdouble top, gdouble right, gdouble bottom); void goo_canvas_scroll_to (GooCanvas *canvas, gdouble left, gdouble top); void goo_canvas_grab_focus (GooCanvas *canvas, GooCanvasItem *item); void goo_canvas_render (GooCanvas *canvas, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); /* * Coordinate conversion. */ void goo_canvas_convert_to_pixels (GooCanvas *canvas, gdouble *x, gdouble *y); void goo_canvas_convert_from_pixels (GooCanvas *canvas, gdouble *x, gdouble *y); void goo_canvas_convert_to_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y); void goo_canvas_convert_from_item_space (GooCanvas *canvas, GooCanvasItem *item, gdouble *x, gdouble *y); void goo_canvas_convert_bounds_to_item_space (GooCanvas *canvas, GooCanvasItem *item, GooCanvasBounds *bounds); /* * Pointer/keyboard grabbing & ungrabbing. */ GdkGrabStatus goo_canvas_pointer_grab (GooCanvas *canvas, GooCanvasItem *item, GdkEventMask event_mask, GdkCursor *cursor, guint32 time); void goo_canvas_pointer_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time); GdkGrabStatus goo_canvas_keyboard_grab (GooCanvas *canvas, GooCanvasItem *item, gboolean owner_events, guint32 time); void goo_canvas_keyboard_ungrab (GooCanvas *canvas, GooCanvasItem *item, guint32 time); /* * Internal functions, mainly for canvas subclasses and item implementations. */ cairo_t* goo_canvas_create_cairo_context (GooCanvas *canvas); GooCanvasItem* goo_canvas_create_item (GooCanvas *canvas, GooCanvasItemModel *model); void goo_canvas_unregister_item (GooCanvas *canvas, GooCanvasItemModel *model); void goo_canvas_update (GooCanvas *canvas); void goo_canvas_request_update (GooCanvas *canvas); void goo_canvas_request_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds); void goo_canvas_request_item_redraw (GooCanvas *canvas, const GooCanvasBounds *bounds, gboolean is_static); gdouble goo_canvas_get_default_line_width (GooCanvas *canvas); void goo_canvas_register_widget_item (GooCanvas *canvas, GooCanvasWidget *witem); void goo_canvas_unregister_widget_item (GooCanvas *canvas, GooCanvasWidget *witem); G_END_DECLS #endif /* __GOO_CANVAS_H__ */ goocanvas-0.15/src/goocanvasrect.c0000644000076400007640000004246611172574677014176 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasrect.c - rectangle item. */ /** * SECTION:goocanvasrect * @Title: GooCanvasRect * @Short_Description: a rectangle item. * * GooCanvasRect represents a rectangle item. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasRect use goo_canvas_rect_new(). * * To get or set the properties of an existing #GooCanvasRect, use * g_object_get() and g_object_set(). */ #include #include #include #include #include "goocanvasrect.h" #include "goocanvas.h" enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_RADIUS_X, PROP_RADIUS_Y }; static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasRect, goo_canvas_rect, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_rect_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the rectangle"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the rectangle"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the rectangle"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the rectangle"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RADIUS_X, g_param_spec_double ("radius_x", _("Radius X"), _("The horizontal radius to use for rounded corners"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RADIUS_Y, g_param_spec_double ("radius_y", _("Radius Y"), _("The vertical radius to use for rounded corners"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); } static void goo_canvas_rect_init (GooCanvasRect *rect) { rect->rect_data = g_slice_new0 (GooCanvasRectData); } /** * goo_canvas_rect_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @x: the x coordinate of the left of the rectangle. * @y: the y coordinate of the top of the rectangle. * @width: the width of the rectangle. * @height: the height of the rectangle. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new rectangle item. * * * * Here's an example showing how to create a rectangle at (100,100) with a * width of 200 and a height of 100. * * * GooCanvasItem *rect = goo_canvas_rect_new (mygroup, 100.0, 100.0, 200.0, 100.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new rectangle item. **/ GooCanvasItem* goo_canvas_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItem *item; GooCanvasRect *rect; GooCanvasRectData *rect_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_RECT, NULL); rect = (GooCanvasRect*) item; rect_data = rect->rect_data; rect_data->x = x; rect_data->y = y; rect_data->width = width; rect_data->height = height; rect_data->radius_x = 0; rect_data->radius_y = 0; va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_rect_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasRect *rect = (GooCanvasRect*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) g_slice_free (GooCanvasRectData, rect->rect_data); rect->rect_data = NULL; G_OBJECT_CLASS (goo_canvas_rect_parent_class)->finalize (object); } static void goo_canvas_rect_get_common_property (GObject *object, GooCanvasRectData *rect_data, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, rect_data->x); break; case PROP_Y: g_value_set_double (value, rect_data->y); break; case PROP_WIDTH: g_value_set_double (value, rect_data->width); break; case PROP_HEIGHT: g_value_set_double (value, rect_data->height); break; case PROP_RADIUS_X: g_value_set_double (value, rect_data->radius_x); break; case PROP_RADIUS_Y: g_value_set_double (value, rect_data->radius_y); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_rect_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasRect *rect = (GooCanvasRect*) object; goo_canvas_rect_get_common_property (object, rect->rect_data, prop_id, value, pspec); } static void goo_canvas_rect_set_common_property (GObject *object, GooCanvasRectData *rect_data, guint prop_id, const GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: rect_data->x = g_value_get_double (value); break; case PROP_Y: rect_data->y = g_value_get_double (value); break; case PROP_WIDTH: rect_data->width = g_value_get_double (value); break; case PROP_HEIGHT: rect_data->height = g_value_get_double (value); break; case PROP_RADIUS_X: rect_data->radius_x = g_value_get_double (value); break; case PROP_RADIUS_Y: rect_data->radius_y = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_rect_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasRect *rect = (GooCanvasRect*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_rect_set_common_property (object, rect->rect_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_rect_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasRect *rect = (GooCanvasRect*) simple; GooCanvasRectData *rect_data = rect->rect_data; cairo_new_path (cr); /* Check if we need to draw rounded corners. */ if (rect_data->radius_x > 0 && rect_data->radius_y > 0) { /* The radii can't be more than half the size of the rect. */ double rx = MIN (rect_data->radius_x, rect_data->width / 2); double ry = MIN (rect_data->radius_y, rect_data->height / 2); /* Draw the top-right arc. */ cairo_save (cr); cairo_translate (cr, rect_data->x + rect_data->width - rx, rect_data->y + ry); cairo_scale (cr, rx, ry); cairo_arc (cr, 0.0, 0.0, 1.0, 1.5 * M_PI, 2.0 * M_PI); cairo_restore (cr); /* Draw the line down the right side. */ cairo_line_to (cr, rect_data->x + rect_data->width, rect_data->y + rect_data->height - ry); /* Draw the bottom-right arc. */ cairo_save (cr); cairo_translate (cr, rect_data->x + rect_data->width - rx, rect_data->y + rect_data->height - ry); cairo_scale (cr, rx, ry); cairo_arc (cr, 0.0, 0.0, 1.0, 0.0, 0.5 * M_PI); cairo_restore (cr); /* Draw the line left across the bottom. */ cairo_line_to (cr, rect_data->x + rx, rect_data->y + rect_data->height); /* Draw the bottom-left arc. */ cairo_save (cr); cairo_translate (cr, rect_data->x + rx, rect_data->y + rect_data->height - ry); cairo_scale (cr, rx, ry); cairo_arc (cr, 0.0, 0.0, 1.0, 0.5 * M_PI, M_PI); cairo_restore (cr); /* Draw the line up the left side. */ cairo_line_to (cr, rect_data->x, rect_data->y + ry); /* Draw the top-left arc. */ cairo_save (cr); cairo_translate (cr, rect_data->x + rx, rect_data->y + ry); cairo_scale (cr, rx, ry); cairo_arc (cr, 0.0, 0.0, 1.0, M_PI, 1.5 * M_PI); cairo_restore (cr); /* Close the path across the top. */ cairo_close_path (cr); } else { /* Draw the plain rectangle. */ cairo_rectangle (cr, rect_data->x, rect_data->y, rect_data->width, rect_data->height); } } static void goo_canvas_rect_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasRect *rect = (GooCanvasRect*) simple; GooCanvasRectData *rect_data = rect->rect_data; gdouble half_line_width; /* We can quickly compute the bounds as being just the rectangle's size plus half the line width around each edge. */ half_line_width = goo_canvas_item_simple_get_line_width (simple) / 2; simple->bounds.x1 = rect_data->x - half_line_width; simple->bounds.y1 = rect_data->y - half_line_width; simple->bounds.x2 = rect_data->x + rect_data->width + half_line_width; simple->bounds.y2 = rect_data->y + rect_data->height + half_line_width; } static void goo_canvas_rect_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasRect *rect = (GooCanvasRect*) item; GooCanvasRectModel *rmodel = (GooCanvasRectModel*) model; /* If our rect_data was allocated, free it. */ if (!simple->model) g_slice_free (GooCanvasRectData, rect->rect_data); /* Now use the new model's rect_data instead. */ rect->rect_data = &rmodel->rect_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_rect_set_model; } static void goo_canvas_rect_class_init (GooCanvasRectClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->finalize = goo_canvas_rect_finalize; gobject_class->get_property = goo_canvas_rect_get_property; gobject_class->set_property = goo_canvas_rect_set_property; simple_class->simple_create_path = goo_canvas_rect_create_path; simple_class->simple_update = goo_canvas_rect_update; goo_canvas_rect_install_common_properties (gobject_class); } /** * SECTION:goocanvasrectmodel * @Title: GooCanvasRectModel * @Short_Description: a model for rectangle items. * * GooCanvasRectModel represents a model for rectangle items. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasRectModel use goo_canvas_rect_model_new(). * * To get or set the properties of an existing #GooCanvasRectModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the rectangle you must connect * to the signal handlers of the corresponding #GooCanvasRect objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_rect_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_rect_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasRectModel, goo_canvas_rect_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_rect_model_class_init (GooCanvasRectModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->get_property = goo_canvas_rect_model_get_property; gobject_class->set_property = goo_canvas_rect_model_set_property; goo_canvas_rect_install_common_properties (gobject_class); } static void goo_canvas_rect_model_init (GooCanvasRectModel *rmodel) { } /** * goo_canvas_rect_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @x: the x coordinate of the left of the rectangle. * @y: the y coordinate of the top of the rectangle. * @width: the width of the rectangle. * @height: the height of the rectangle. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new rectangle item. * * * * Here's an example showing how to create a rectangle at (100,100) with a * width of 200 and a height of 100. * * * GooCanvasItemModel *rect = goo_canvas_rect_model_new (mygroup, 100.0, 100.0, 200.0, 100.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new rectangle model. **/ GooCanvasItemModel* goo_canvas_rect_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItemModel *model; GooCanvasRectModel *rmodel; GooCanvasRectData *rect_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_RECT_MODEL, NULL); rmodel = (GooCanvasRectModel*) model; rect_data = &rmodel->rect_data; rect_data->x = x; rect_data->y = y; rect_data->width = width; rect_data->height = height; rect_data->radius_x = 0; rect_data->radius_y = 0; va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_rect_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasRectModel *rmodel = (GooCanvasRectModel*) object; goo_canvas_rect_get_common_property (object, &rmodel->rect_data, prop_id, value, pspec); } static void goo_canvas_rect_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasRectModel *rmodel = (GooCanvasRectModel*) object; goo_canvas_rect_set_common_property (object, &rmodel->rect_data, prop_id, value, pspec); g_signal_emit_by_name (rmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_rect_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_RECT, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_rect_model_create_item; } goocanvas-0.15/src/goocanvasatk.c0000644000076400007640000004723511200614342013767 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Copyright 2001 Sun Microsystems Inc. * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation * Released under the GNU LGPL license. See COPYING for details. * * goocanvasatk.c - the accessibility code. Most of this has been ported from * the gail/libgnomecanvas & foocanvas code. */ #include #include #include #include "goocanvas.h" /* * GooCanvasItemAccessible. */ typedef AtkGObjectAccessible GooCanvasItemAccessible; typedef AtkGObjectAccessibleClass GooCanvasItemAccessibleClass; #define GOO_TYPE_CANVAS_ITEM_ACCESSIBLE (goo_canvas_item_accessible_get_type ()) #define GOO_IS_CANVAS_ITEM_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), goo_canvas_item_accessible_get_type ())) static void goo_canvas_item_accessible_component_interface_init (AtkComponentIface *iface); static gint goo_canvas_item_accessible_get_index_in_parent (AtkObject *accessible); G_DEFINE_TYPE_WITH_CODE (GooCanvasItemAccessible, goo_canvas_item_accessible, ATK_TYPE_GOBJECT_ACCESSIBLE, G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, goo_canvas_item_accessible_component_interface_init)) /* Returns the extents of the item, in pixels relative to the main canvas window. */ static void goo_canvas_item_accessible_get_item_extents (GooCanvasItem *item, GdkRectangle *rect) { GooCanvas *canvas; GooCanvasBounds bounds; canvas = goo_canvas_item_get_canvas (item); if (!canvas) { rect->x = rect->y = rect->width = rect->height = 0; return; } /* Get the bounds in device units. */ goo_canvas_item_get_bounds (item, &bounds); /* Static items are in pixels so don't need converting. */ if (!goo_canvas_item_get_is_static (item)) { /* Convert to pixels within the entire canvas. */ goo_canvas_convert_to_pixels (canvas, &bounds.x1, &bounds.y1); goo_canvas_convert_to_pixels (canvas, &bounds.x2, &bounds.y2); /* Convert to pixels within the visible window. */ bounds.x1 -= canvas->hadjustment->value; bounds.y1 -= canvas->vadjustment->value; bounds.x2 -= canvas->hadjustment->value; bounds.y2 -= canvas->vadjustment->value; } /* Round up or down to integers. */ rect->x = floor (bounds.x1); rect->y = floor (bounds.y1); rect->width = ceil (bounds.x1) - rect->x; rect->height = ceil (bounds.y1) - rect->y; } /* This returns TRUE if the given rectangle intersects the canvas window. The rectangle should be in pixels relative to the main canvas window. */ static gboolean goo_canvas_item_accessible_is_item_in_window (GooCanvasItem *item, GdkRectangle *rect) { GtkWidget *widget; widget = (GtkWidget*) goo_canvas_item_get_canvas (item); if (!widget) return FALSE; if (rect->x + rect->width < 0 || rect->x > widget->allocation.width || rect->y + rect->height < 0 || rect->y > widget->allocation.height) return FALSE; return TRUE; } static gboolean goo_canvas_item_accessible_is_item_on_screen (GooCanvasItem *item) { GdkRectangle rect; goo_canvas_item_accessible_get_item_extents (item, &rect); return goo_canvas_item_accessible_is_item_in_window (item, &rect); } static void goo_canvas_item_accessible_get_extents (AtkComponent *component, gint *x, gint *y, gint *width, gint *height, AtkCoordType coord_type) { GooCanvasItem *item; GooCanvas *canvas; GObject *object; gint window_x, window_y; gint toplevel_x, toplevel_y; GdkRectangle rect; GdkWindow *window; g_return_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component)); *x = *y = G_MININT; object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component)); if (!object) return; item = GOO_CANVAS_ITEM (object); canvas = goo_canvas_item_get_canvas (item); if (!canvas || !GTK_WIDGET (canvas)->window) return; goo_canvas_item_accessible_get_item_extents (item, &rect); *width = rect.width; *height = rect.height; if (!goo_canvas_item_accessible_is_item_in_window (item, &rect)) return; gdk_window_get_origin (GTK_WIDGET (canvas)->window, &window_x, &window_y); *x = rect.x + window_x; *y = rect.y + window_y; if (coord_type == ATK_XY_WINDOW) { window = gdk_window_get_toplevel (GTK_WIDGET (canvas)->window); gdk_window_get_origin (window, &toplevel_x, &toplevel_y); *x -= toplevel_x; *y -= toplevel_y; } } static gint goo_canvas_item_accessible_get_mdi_zorder (AtkComponent *component) { g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component), -1); return goo_canvas_item_accessible_get_index_in_parent (ATK_OBJECT (component)); } static guint goo_canvas_item_accessible_add_focus_handler (AtkComponent *component, AtkFocusHandler handler) { GSignalMatchType match_type; GClosure *closure; guint signal_id; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component), 0); match_type = G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC; signal_id = g_signal_lookup ("focus-event", ATK_TYPE_OBJECT); /* If the handler has already been added just return. */ if (g_signal_handler_find (component, match_type, signal_id, 0, NULL, (gpointer) handler, NULL)) return 0; closure = g_cclosure_new (G_CALLBACK (handler), NULL, (GClosureNotify) NULL); return g_signal_connect_closure_by_id (component, signal_id, 0, closure, FALSE); } static void goo_canvas_item_accessible_remove_focus_handler (AtkComponent *component, guint handler_id) { g_return_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component)); g_signal_handler_disconnect (ATK_OBJECT (component), handler_id); } static gboolean goo_canvas_item_accessible_grab_focus (AtkComponent *component) { GooCanvasItem *item; GooCanvas *canvas; GtkWidget *toplevel; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (component), FALSE); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (component)); if (!object) return FALSE; item = GOO_CANVAS_ITEM (object); canvas = goo_canvas_item_get_canvas (item); if (!canvas) return FALSE; goo_canvas_grab_focus (canvas, item); toplevel = gtk_widget_get_toplevel (GTK_WIDGET (canvas)); if (GTK_WIDGET_TOPLEVEL (toplevel)) gtk_window_present (GTK_WINDOW (toplevel)); return TRUE; } static void goo_canvas_item_accessible_component_interface_init (AtkComponentIface *iface) { iface->get_extents = goo_canvas_item_accessible_get_extents; iface->get_mdi_zorder = goo_canvas_item_accessible_get_mdi_zorder; iface->add_focus_handler = goo_canvas_item_accessible_add_focus_handler; iface->remove_focus_handler = goo_canvas_item_accessible_remove_focus_handler; iface->grab_focus = goo_canvas_item_accessible_grab_focus; } static void goo_canvas_item_accessible_initialize (AtkObject *object, gpointer data) { if (ATK_OBJECT_CLASS (goo_canvas_item_accessible_parent_class)->initialize) ATK_OBJECT_CLASS (goo_canvas_item_accessible_parent_class)->initialize (object, data); object->role = ATK_ROLE_UNKNOWN; /* FIXME: Maybe this should be ATK_LAYER_CANVAS. */ g_object_set_data (G_OBJECT (object), "atk-component-layer", GINT_TO_POINTER (ATK_LAYER_MDI)); } static AtkObject* goo_canvas_item_accessible_get_parent (AtkObject *accessible) { GooCanvasItem *item, *parent; GooCanvas *canvas; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), NULL); if (accessible->accessible_parent) return accessible->accessible_parent; object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return NULL; item = GOO_CANVAS_ITEM (object); parent = goo_canvas_item_get_parent (item); if (parent) return atk_gobject_accessible_for_object (G_OBJECT (parent)); canvas = goo_canvas_item_get_canvas (item); if (canvas) return gtk_widget_get_accessible (GTK_WIDGET (canvas)); return NULL; } static gint goo_canvas_item_accessible_get_index_in_parent (AtkObject *accessible) { GooCanvasItem *item, *parent; GooCanvas *canvas; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), -1); if (accessible->accessible_parent) { gint n_children, i; gboolean found = FALSE; n_children = atk_object_get_n_accessible_children (accessible->accessible_parent); for (i = 0; i < n_children; i++) { AtkObject *child; child = atk_object_ref_accessible_child (accessible->accessible_parent, i); if (child == accessible) found = TRUE; g_object_unref (child); if (found) return i; } return -1; } object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return -1; item = GOO_CANVAS_ITEM (object); parent = goo_canvas_item_get_parent (item); if (parent) return goo_canvas_item_find_child (parent, item); canvas = goo_canvas_item_get_canvas (item); if (canvas) return 0; return -1; } static gint goo_canvas_item_accessible_get_n_children (AtkObject *accessible) { GooCanvasItem *item; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), 0); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return 0; item = GOO_CANVAS_ITEM (object); return goo_canvas_item_get_n_children (item); } static AtkObject* goo_canvas_item_accessible_ref_child (AtkObject *accessible, gint child_num) { GooCanvasItem *item, *child; AtkObject *atk_object; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), NULL); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return NULL; item = GOO_CANVAS_ITEM (object); child = goo_canvas_item_get_child (item, child_num); if (!child) return NULL; atk_object = atk_gobject_accessible_for_object (G_OBJECT (child)); g_object_ref (atk_object); return atk_object; } static AtkStateSet* goo_canvas_item_accessible_ref_state_set (AtkObject *accessible) { GooCanvasItem *item; GooCanvas *canvas; AtkStateSet *state_set; GObject *object; gboolean can_focus = FALSE; g_return_val_if_fail (GOO_IS_CANVAS_ITEM_ACCESSIBLE (accessible), NULL); state_set = ATK_OBJECT_CLASS (goo_canvas_item_accessible_parent_class)->ref_state_set (accessible); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (!object) { atk_state_set_add_state (state_set, ATK_STATE_DEFUNCT); return state_set; } item = GOO_CANVAS_ITEM (object); canvas = goo_canvas_item_get_canvas (item); if (!canvas) return state_set; if (goo_canvas_item_is_visible (item)) { atk_state_set_add_state (state_set, ATK_STATE_VISIBLE); if (goo_canvas_item_accessible_is_item_on_screen (item)) atk_state_set_add_state (state_set, ATK_STATE_SHOWING); } g_object_get (item, "can-focus", &can_focus, NULL); if (GTK_WIDGET_CAN_FOCUS (GTK_WIDGET (canvas)) && can_focus) { atk_state_set_add_state (state_set, ATK_STATE_FOCUSABLE); if (GTK_WIDGET_HAS_FOCUS (canvas) && canvas->focused_item == item) atk_state_set_add_state (state_set, ATK_STATE_FOCUSED); } return state_set; } static void goo_canvas_item_accessible_class_init (GooCanvasItemAccessibleClass *klass) { AtkObjectClass *aklass = (AtkObjectClass*) klass; aklass->initialize = goo_canvas_item_accessible_initialize; aklass->get_parent = goo_canvas_item_accessible_get_parent; aklass->get_index_in_parent = goo_canvas_item_accessible_get_index_in_parent; aklass->get_n_children = goo_canvas_item_accessible_get_n_children; aklass->ref_child = goo_canvas_item_accessible_ref_child; aklass->ref_state_set = goo_canvas_item_accessible_ref_state_set; } static void goo_canvas_item_accessible_init (GooCanvasItemAccessible *accessible) { } static AtkObject * goo_canvas_item_accessible_new (GObject *object) { AtkObject *accessible; g_return_val_if_fail (GOO_IS_CANVAS_ITEM (object), NULL); accessible = g_object_new (goo_canvas_item_accessible_get_type (), NULL); atk_object_initialize (accessible, object); return accessible; } /* * GooCanvasItemAccessibleFactory. */ typedef AtkObjectFactory GooCanvasItemAccessibleFactory; typedef AtkObjectFactoryClass GooCanvasItemAccessibleFactoryClass; G_DEFINE_TYPE (GooCanvasItemAccessibleFactory, goo_canvas_item_accessible_factory, ATK_TYPE_OBJECT_FACTORY) static void goo_canvas_item_accessible_factory_class_init (GooCanvasItemAccessibleFactoryClass *klass) { klass->create_accessible = goo_canvas_item_accessible_new; klass->get_accessible_type = goo_canvas_item_accessible_get_type; } static void goo_canvas_item_accessible_factory_init (GooCanvasItemAccessibleFactory *factory) { } /* * GooCanvasWidgetAccessible. */ typedef AtkGObjectAccessible GooCanvasWidgetAccessible; typedef AtkGObjectAccessibleClass GooCanvasWidgetAccessibleClass; #define GOO_IS_CANVAS_WIDGET_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), goo_canvas_widget_accessible_get_type ())) G_DEFINE_TYPE (GooCanvasWidgetAccessible, goo_canvas_widget_accessible, GOO_TYPE_CANVAS_ITEM_ACCESSIBLE) static void goo_canvas_widget_accessible_initialize (AtkObject *object, gpointer data) { if (ATK_OBJECT_CLASS (goo_canvas_widget_accessible_parent_class)->initialize) ATK_OBJECT_CLASS (goo_canvas_widget_accessible_parent_class)->initialize (object, data); object->role = ATK_ROLE_PANEL; } static gint goo_canvas_widget_accessible_get_n_children (AtkObject *accessible) { GooCanvasWidget *witem; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_WIDGET_ACCESSIBLE (accessible), 0); object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return 0; witem = GOO_CANVAS_WIDGET (object); return witem->widget ? 1 : 0; } static AtkObject * goo_canvas_widget_accessible_ref_child (AtkObject *accessible, gint child_num) { GooCanvasWidget *witem; AtkObject *atk_object; GObject *object; g_return_val_if_fail (GOO_IS_CANVAS_WIDGET_ACCESSIBLE (accessible), NULL); if (child_num != 0) return NULL; object = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible)); if (object == NULL) return NULL; g_return_val_if_fail (GOO_IS_CANVAS_WIDGET (object), NULL); witem = GOO_CANVAS_WIDGET (object); if (!witem->widget) return NULL; atk_object = gtk_widget_get_accessible (witem->widget); g_object_ref (atk_object); return atk_object; } static void goo_canvas_widget_accessible_class_init (GooCanvasWidgetAccessibleClass *klass) { AtkObjectClass *aklass = (AtkObjectClass*) klass; aklass->initialize = goo_canvas_widget_accessible_initialize; aklass->get_n_children = goo_canvas_widget_accessible_get_n_children; aklass->ref_child = goo_canvas_widget_accessible_ref_child; } static void goo_canvas_widget_accessible_init (GooCanvasWidgetAccessible *accessible) { } static AtkObject* goo_canvas_widget_accessible_new (GObject *object) { AtkObject *accessible; g_return_val_if_fail (GOO_IS_CANVAS_WIDGET (object), NULL); accessible = g_object_new (goo_canvas_widget_accessible_get_type (), NULL); atk_object_initialize (accessible, object); return accessible; } /* * GooCanvasWidgetAccessibleFactory. */ typedef AtkObjectFactory GooCanvasWidgetAccessibleFactory; typedef AtkObjectFactoryClass GooCanvasWidgetAccessibleFactoryClass; G_DEFINE_TYPE (GooCanvasWidgetAccessibleFactory, goo_canvas_widget_accessible_factory, ATK_TYPE_OBJECT_FACTORY) static void goo_canvas_widget_accessible_factory_class_init (GooCanvasWidgetAccessibleFactoryClass *klass) { klass->create_accessible = goo_canvas_widget_accessible_new; klass->get_accessible_type = goo_canvas_widget_accessible_get_type; } static void goo_canvas_widget_accessible_factory_init (GooCanvasWidgetAccessibleFactory *factory) { } /* * GooCanvasAccessible. */ static gpointer accessible_parent_class = NULL; static void goo_canvas_accessible_initialize (AtkObject *object, gpointer data) { if (ATK_OBJECT_CLASS (accessible_parent_class)->initialize) ATK_OBJECT_CLASS (accessible_parent_class)->initialize (object, data); /* FIXME: Maybe this should be ATK_ROLE_CANVAS. */ object->role = ATK_ROLE_LAYERED_PANE; } static gint goo_canvas_accessible_get_n_children (AtkObject *object) { GtkAccessible *accessible; GtkWidget *widget; accessible = GTK_ACCESSIBLE (object); widget = accessible->widget; /* Check if widget still exists. */ if (widget == NULL) return 0; g_return_val_if_fail (GOO_IS_CANVAS (widget), 0); if (goo_canvas_get_root_item (GOO_CANVAS (widget))) return 1; return 0; } static AtkObject* goo_canvas_accessible_ref_child (AtkObject *object, gint child_num) { GtkAccessible *accessible; GtkWidget *widget; GooCanvasItem *root; AtkObject *atk_object; /* Canvas only has one child, so return NULL if index is non zero */ if (child_num != 0) return NULL; accessible = GTK_ACCESSIBLE (object); widget = accessible->widget; /* Check if widget still exists. */ if (widget == NULL) return NULL; root = goo_canvas_get_root_item (GOO_CANVAS (widget)); if (!root) return NULL; atk_object = atk_gobject_accessible_for_object (G_OBJECT (root)); g_object_ref (atk_object); return atk_object; } static void goo_canvas_accessible_class_init (AtkObjectClass *klass) { accessible_parent_class = g_type_class_peek_parent (klass); klass->initialize = goo_canvas_accessible_initialize; klass->get_n_children = goo_canvas_accessible_get_n_children; klass->ref_child = goo_canvas_accessible_ref_child; } static GType goo_canvas_accessible_get_type (void) { static GType g_define_type_id = 0; if (G_UNLIKELY (g_define_type_id == 0)) { AtkObjectFactory *factory; GType parent_atk_type; GTypeQuery query; GTypeInfo tinfo = { 0 }; /* Gail doesn't declare its classes publicly, so we have to do a query to find the size of the class and instances. */ factory = atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET); if (!factory) return G_TYPE_INVALID; parent_atk_type = atk_object_factory_get_accessible_type (factory); if (!parent_atk_type) return G_TYPE_INVALID; g_type_query (parent_atk_type, &query); tinfo.class_init = (GClassInitFunc) goo_canvas_accessible_class_init; tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; g_define_type_id = g_type_register_static (parent_atk_type, "GooCanvasAccessible", &tinfo, 0); } return g_define_type_id; } static AtkObject * goo_canvas_accessible_new (GObject *object) { AtkObject *accessible; g_return_val_if_fail (GOO_IS_CANVAS (object), NULL); accessible = g_object_new (goo_canvas_accessible_get_type (), NULL); atk_object_initialize (accessible, object); return accessible; } /* * GooCanvasAccessibleFactory. */ typedef AtkObjectFactory GooCanvasAccessibleFactory; typedef AtkObjectFactoryClass GooCanvasAccessibleFactoryClass; G_DEFINE_TYPE (GooCanvasAccessibleFactory, goo_canvas_accessible_factory, ATK_TYPE_OBJECT_FACTORY) static void goo_canvas_accessible_factory_class_init (GooCanvasAccessibleFactoryClass *klass) { klass->create_accessible = goo_canvas_accessible_new; klass->get_accessible_type = goo_canvas_accessible_get_type; } static void goo_canvas_accessible_factory_init (GooCanvasAccessibleFactory *factory) { } goocanvas-0.15/src/goocanvasitem.h0000644000076400007640000004500711172574677014176 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitem.h - interface for canvas items & groups. */ #ifndef __GOO_CANVAS_ITEM_H__ #define __GOO_CANVAS_ITEM_H__ #include #include "goocanvasstyle.h" G_BEGIN_DECLS /** * GooCanvasAnimateType * @GOO_CANVAS_ANIMATE_FREEZE: the item remains in the final position. * @GOO_CANVAS_ANIMATE_RESET: the item is moved back to the initial position. * @GOO_CANVAS_ANIMATE_RESTART: the animation is restarted from the initial * position. * @GOO_CANVAS_ANIMATE_BOUNCE: the animation bounces back and forth between the * start and end positions. * * #GooCanvasAnimateType is used to specify what happens when the end of an * animation is reached. */ typedef enum { GOO_CANVAS_ANIMATE_FREEZE, GOO_CANVAS_ANIMATE_RESET, GOO_CANVAS_ANIMATE_RESTART, GOO_CANVAS_ANIMATE_BOUNCE } GooCanvasAnimateType; /** * GooCanvasBounds * @x1: the left edge. * @y1: the top edge. * @x2: the right edge. * @y2: the bottom edge. * * #GooCanvasBounds represents the bounding box of an item in the canvas. */ typedef struct _GooCanvasBounds GooCanvasBounds; struct _GooCanvasBounds { gdouble x1, y1, x2, y2; }; GType goo_canvas_bounds_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CANVAS_BOUNDS (goo_canvas_bounds_get_type ()) #define GOO_TYPE_CANVAS_ITEM (goo_canvas_item_get_type ()) #define GOO_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ITEM, GooCanvasItem)) #define GOO_IS_CANVAS_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ITEM)) #define GOO_CANVAS_ITEM_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GOO_TYPE_CANVAS_ITEM, GooCanvasItemIface)) /* Workaround for circular dependencies. Include this file first. */ typedef struct _GooCanvas GooCanvas; typedef struct _GooCanvasItemModel GooCanvasItemModel; /** * GooCanvasItem * * #GooCanvasItem is a typedef used for objects that implement the * #GooCanvasItem interface. * * (There is no actual #GooCanvasItem struct, since it is only an interface. * But using '#GooCanvasItem' is more helpful than using '#GObject'.) */ typedef struct _GooCanvasItem GooCanvasItem; /** * GooCanvasItemIface * @get_canvas: returns the canvas the item is in. * @set_canvas: sets the canvas the item is in. * @get_n_children: returns the number of children of the item. * @get_child: returns the child at the given index. * @request_update: requests that an update is scheduled. * @add_child: adds a child. * @move_child: moves a child up or down the stacking order. * @remove_child: removes a child. * @get_child_property: gets a child property of a given child item, * e.g. the "row" or "column" property of an item in a #GooCanvasTable. * @set_child_property: sets a child property for a given child item. * @get_transform_for_child: gets the transform used to lay out a given child. * @get_parent: gets the item's parent. * @set_parent: sets the item's parent. * @get_bounds: gets the bounds of the item. * @get_items_at: gets all the items at the given point. * @update: updates the item, if needed. It recalculates the bounds of the item * and requests redraws of parts of the canvas if necessary. * @paint: renders the item to the given cairo context. * @get_requested_area: returns the requested area of the item, in its parent's * coordinate space. This is only used for items in layout containers such as * #GooCanvasTable. * @allocate_area: allocates the item's area, in its parent's coordinate space. * The item must recalculate its bounds and request redraws of parts of the * canvas if necessary. This is only used for items in layout containers such * as #GooCanvasTable. * @get_transform: gets the item's transformation matrix. * @set_transform: sets the item's transformation matrix. * @get_style: gets the item's style. * @set_style: sets the item's style. * @is_visible: returns %TRUE if the item is currently visible. * @get_is_static: returns %TRUE if the item is static. * @set_is_static: notifies the item whether it is static or not. * @get_requested_height: returns the requested height of the item, * given a particular allocated width, using the parent's coordinate space. * @get_model: gets the model that the canvas item is viewing. * @set_model: sets the model that the canvas item will view. * @enter_notify_event: signal emitted when the mouse enters the item. * @leave_notify_event: signal emitted when the mouse leaves the item. * @motion_notify_event: signal emitted when the mouse moves within the item. * @button_press_event: signal emitted when a mouse button is pressed within * the item. * @button_release_event: signal emitted when a mouse button is released. * @focus_in_event: signal emitted when the item receices the keyboard focus. * @focus_out_event: signal emitted when the item loses the keyboard focus. * @key_press_event: signal emitted when a key is pressed. * @key_release_event: signal emitted when a key is released. * @grab_broken_event: signal emitted when a grab that the item has is lost. * @child_notify: signal emitted when a child property is changed. * @query_tooltip: signal emitted to query the tooltip of an item. * @animation_finished: signal emitted when the item's animation has finished. * @scroll_event: signal emitted when the mouse wheel is activated within * the item. * * #GooCanvasItemIFace holds the virtual methods that make up the * #GooCanvasItem interface. * * Simple canvas items only need to implement the get_parent(), set_parent(), * get_bounds(), get_items_at(), update() and paint() methods (and also * get_requested_area() and allocate_area() if they are going to be used * inside a layout container like #GooCanvasTable). * * Items that support transforms should also implement get_transform() and * set_transform(). Items that support styles should implement get_style() * and set_style(). * * Container items must implement get_canvas(), set_canvas(), * get_n_children(), get_child() and request_update(). Containers that support * dynamic changes to their children should implement add_child(), * move_child() and remove_child(). Layout containers like #GooCanvasTable * may implement get_child_property(), set_child_property() and * get_transform_for_child(). */ typedef struct _GooCanvasItemIface GooCanvasItemIface; struct _GooCanvasItemIface { /*< private >*/ GTypeInterface base_iface; /*< public >*/ /* Virtual methods that group items must implement. */ GooCanvas* (* get_canvas) (GooCanvasItem *item); void (* set_canvas) (GooCanvasItem *item, GooCanvas *canvas); gint (* get_n_children) (GooCanvasItem *item); GooCanvasItem* (* get_child) (GooCanvasItem *item, gint child_num); void (* request_update) (GooCanvasItem *item); /* Virtual methods that group items may implement. */ void (* add_child) (GooCanvasItem *item, GooCanvasItem *child, gint position); void (* move_child) (GooCanvasItem *item, gint old_position, gint new_position); void (* remove_child) (GooCanvasItem *item, gint child_num); void (* get_child_property) (GooCanvasItem *item, GooCanvasItem *child, guint property_id, GValue *value, GParamSpec *pspec); void (* set_child_property) (GooCanvasItem *item, GooCanvasItem *child, guint property_id, const GValue *value, GParamSpec *pspec); gboolean (* get_transform_for_child) (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform); /* Virtual methods that all canvas items must implement. */ GooCanvasItem* (* get_parent) (GooCanvasItem *item); void (* set_parent) (GooCanvasItem *item, GooCanvasItem *parent); void (* get_bounds) (GooCanvasItem *item, GooCanvasBounds *bounds); GList* (* get_items_at) (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_is_visible, GList *found_items); void (* update) (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds); void (* paint) (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); gboolean (* get_requested_area) (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area); void (* allocate_area) (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset); /* Virtual methods that canvas items may implement. */ gboolean (* get_transform) (GooCanvasItem *item, cairo_matrix_t *transform); void (* set_transform) (GooCanvasItem *item, const cairo_matrix_t *transform); GooCanvasStyle* (* get_style) (GooCanvasItem *item); void (* set_style) (GooCanvasItem *item, GooCanvasStyle *style); gboolean (* is_visible) (GooCanvasItem *item); gdouble (* get_requested_height) (GooCanvasItem *item, cairo_t *cr, gdouble width); /* Virtual methods that model/view items must implement. */ GooCanvasItemModel* (* get_model) (GooCanvasItem *item); void (* set_model) (GooCanvasItem *item, GooCanvasItemModel *model); /* Signals. */ gboolean (* enter_notify_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event); gboolean (* leave_notify_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventCrossing *event); gboolean (* motion_notify_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventMotion *event); gboolean (* button_press_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event); gboolean (* button_release_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event); gboolean (* focus_in_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event); gboolean (* focus_out_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventFocus *event); gboolean (* key_press_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event); gboolean (* key_release_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventKey *event); gboolean (* grab_broken_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventGrabBroken *event); void (* child_notify) (GooCanvasItem *item, GParamSpec *pspec); gboolean (* query_tooltip) (GooCanvasItem *item, gdouble x, gdouble y, gboolean keyboard_tooltip, GtkTooltip *tooltip); gboolean (* get_is_static) (GooCanvasItem *item); void (* set_is_static) (GooCanvasItem *item, gboolean is_static); void (* animation_finished) (GooCanvasItem *item, gboolean stopped); gboolean (* scroll_event) (GooCanvasItem *item, GooCanvasItem *target, GdkEventScroll *event); /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_item_get_type (void) G_GNUC_CONST; /* * Group functions - these should only be called on container items. */ gint goo_canvas_item_get_n_children (GooCanvasItem *item); GooCanvasItem* goo_canvas_item_get_child (GooCanvasItem *item, gint child_num); gint goo_canvas_item_find_child (GooCanvasItem *item, GooCanvasItem *child); void goo_canvas_item_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position); void goo_canvas_item_move_child (GooCanvasItem *item, gint old_position, gint new_position); void goo_canvas_item_remove_child (GooCanvasItem *item, gint child_num); void goo_canvas_item_get_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, GValue *value); void goo_canvas_item_set_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, const GValue *value); void goo_canvas_item_get_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...) G_GNUC_NULL_TERMINATED; void goo_canvas_item_set_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...) G_GNUC_NULL_TERMINATED; void goo_canvas_item_get_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args); void goo_canvas_item_set_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args); gboolean goo_canvas_item_get_transform_for_child (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform); /* * Item functions - these are safe to call on all items. */ GooCanvas* goo_canvas_item_get_canvas (GooCanvasItem *item); void goo_canvas_item_set_canvas (GooCanvasItem *item, GooCanvas *canvas); GooCanvasItem* goo_canvas_item_get_parent (GooCanvasItem *item); void goo_canvas_item_set_parent (GooCanvasItem *item, GooCanvasItem *parent); void goo_canvas_item_remove (GooCanvasItem *item); gboolean goo_canvas_item_is_container (GooCanvasItem *item); void goo_canvas_item_raise (GooCanvasItem *item, GooCanvasItem *above); void goo_canvas_item_lower (GooCanvasItem *item, GooCanvasItem *below); gboolean goo_canvas_item_get_transform (GooCanvasItem *item, cairo_matrix_t *transform); void goo_canvas_item_set_transform (GooCanvasItem *item, const cairo_matrix_t *transform); gboolean goo_canvas_item_get_simple_transform (GooCanvasItem *item, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation); void goo_canvas_item_set_simple_transform (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble rotation); void goo_canvas_item_translate (GooCanvasItem *item, gdouble tx, gdouble ty); void goo_canvas_item_scale (GooCanvasItem *item, gdouble sx, gdouble sy); void goo_canvas_item_rotate (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_skew_x (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); void goo_canvas_item_skew_y (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy); GooCanvasStyle* goo_canvas_item_get_style (GooCanvasItem *item); void goo_canvas_item_set_style (GooCanvasItem *item, GooCanvasStyle *style); void goo_canvas_item_animate (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); void goo_canvas_item_stop_animation (GooCanvasItem *item); void goo_canvas_item_get_bounds (GooCanvasItem *item, GooCanvasBounds *bounds); GList* goo_canvas_item_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_is_visible, GList *found_items); gboolean goo_canvas_item_is_visible (GooCanvasItem *item); GooCanvasItemModel* goo_canvas_item_get_model (GooCanvasItem *item); void goo_canvas_item_set_model (GooCanvasItem *item, GooCanvasItemModel *model); void goo_canvas_item_request_update (GooCanvasItem *item); void goo_canvas_item_ensure_updated (GooCanvasItem *item); void goo_canvas_item_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds); void goo_canvas_item_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale); gboolean goo_canvas_item_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area); gdouble goo_canvas_item_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width); void goo_canvas_item_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset); gboolean goo_canvas_item_get_is_static (GooCanvasItem *item); void goo_canvas_item_set_is_static (GooCanvasItem *item, gboolean is_static); /* * Functions to support child properties when implementing new canvas items. */ void goo_canvas_item_class_install_child_property (GObjectClass *iclass, guint property_id, GParamSpec *pspec); GParamSpec* goo_canvas_item_class_find_child_property (GObjectClass *iclass, const gchar *property_name); GParamSpec** goo_canvas_item_class_list_child_properties (GObjectClass *iclass, guint *n_properties); G_END_DECLS #endif /* __GOO_CANVAS_ITEM_H__ */ goocanvas-0.15/src/goocanvastext.c0000644000076400007640000010112011172574677014204 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvastext.c - text item. */ /** * SECTION:goocanvastext * @Title: GooCanvasText * @Short_Description: a text item. * * GooCanvasText represents a text item. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "fill-color". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * The #GooCanvasText:width and #GooCanvasText:height properties specify the * area of the item. If it exceeds that area because there is too much text, * it is clipped. The properties can be set to -1 to disable clipping. * * To create a #GooCanvasText use goo_canvas_text_new(). * * To get or set the properties of an existing #GooCanvasText, use * g_object_get() and g_object_set(). */ #include #include #include #include "goocanvastext.h" #include "goocanvas.h" typedef struct _GooCanvasTextPrivate GooCanvasTextPrivate; struct _GooCanvasTextPrivate { gdouble height; }; #define GOO_CANVAS_TEXT_GET_PRIVATE(text) \ (G_TYPE_INSTANCE_GET_PRIVATE ((text), GOO_TYPE_CANVAS_TEXT, GooCanvasTextPrivate)) #define GOO_CANVAS_TEXT_MODEL_GET_PRIVATE(text) \ (G_TYPE_INSTANCE_GET_PRIVATE ((text), GOO_TYPE_CANVAS_TEXT_MODEL, GooCanvasTextPrivate)) enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_TEXT, PROP_USE_MARKUP, PROP_ANCHOR, PROP_ALIGN, PROP_ELLIPSIZE, PROP_WRAP }; static PangoLayout* goo_canvas_text_create_layout (GooCanvasItemSimpleData *simple_data, GooCanvasTextData *text_data, gdouble layout_width, cairo_t *cr, GooCanvasBounds *bounds, gdouble *origin_x_return, gdouble *origin_y_return); static void goo_canvas_text_finalize (GObject *object); static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_text_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_text_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasText, goo_canvas_text, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_text_install_common_properties (GObjectClass *gobject_class) { /* Text */ g_object_class_install_property (gobject_class, PROP_TEXT, g_param_spec_string ("text", _("Text"), _("The text to display"), NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_USE_MARKUP, g_param_spec_boolean ("use-markup", _("Use Markup"), _("Whether to parse PangoMarkup in the text, to support different styles"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ELLIPSIZE, g_param_spec_enum ("ellipsize", _("Ellipsize"), _("The preferred place to ellipsize the string, if the label does not have enough room to display the entire string"), PANGO_TYPE_ELLIPSIZE_MODE, PANGO_ELLIPSIZE_NONE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WRAP, g_param_spec_enum ("wrap", _("Wrap"), _("The preferred method of wrapping the string if a width has been set"), PANGO_TYPE_WRAP_MODE, PANGO_WRAP_WORD, G_PARAM_READWRITE)); /* Position */ g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the text"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the text"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width to use to layout the text"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height to use to layout the text, or -1 to use the natural height"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ANCHOR, g_param_spec_enum ("anchor", _("Anchor"), _("How to position the text relative to the given x and y coordinates"), GTK_TYPE_ANCHOR_TYPE, GTK_ANCHOR_NW, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ALIGN, g_param_spec_enum ("alignment", _("Alignment"), _("How to align the text"), PANGO_TYPE_ALIGNMENT, PANGO_ALIGN_LEFT, G_PARAM_READWRITE)); } static void goo_canvas_text_init (GooCanvasText *text) { GooCanvasTextPrivate *priv = GOO_CANVAS_TEXT_GET_PRIVATE (text); text->text_data = g_slice_new0 (GooCanvasTextData); text->text_data->width = -1.0; text->text_data->anchor = GTK_ANCHOR_NW; text->text_data->ellipsize = PANGO_ELLIPSIZE_NONE; text->text_data->wrap = PANGO_WRAP_WORD; text->layout_width = -1.0; priv->height = -1.0; } /** * goo_canvas_text_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @string: the text to display. * @x: the x coordinate of the text. * @y: the y coordinate of the text. * @width: the width of the text item, or -1 for unlimited width. * @anchor: the position of the text relative to the given @x and @y * coordinates. For example an anchor of %GDK_ANCHOR_NW will result in the * top-left of the text being placed at the given @x and @y coordinates. * An anchor of %GDK_ANCHOR_CENTER will result in the center of the text being * placed at the @x and @y coordinates. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new text item. * * * * Here's an example showing how to create a text item with the bottom right * of the text box placed at (500,500): * * * GooCanvasItem *text = goo_canvas_text_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE, * "fill-color", "blue", * NULL); * * * Returns: a new text item. **/ GooCanvasItem* goo_canvas_text_new (GooCanvasItem *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...) { GooCanvasItem *item; GooCanvasText *text; GooCanvasTextData *text_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_TEXT, NULL); text = (GooCanvasText*) item; text_data = text->text_data; text_data->text = g_strdup (string); text_data->x = x; text_data->y = y; text_data->width = width; text_data->anchor = anchor; va_start (var_args, anchor); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_text_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasText *text = (GooCanvasText*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { g_free (text->text_data->text); g_slice_free (GooCanvasTextData, text->text_data); } text->text_data = NULL; G_OBJECT_CLASS (goo_canvas_text_parent_class)->finalize (object); } /* Gets the private data to use, from the model or from the item itself. */ static GooCanvasTextPrivate* goo_canvas_text_get_private (GooCanvasText *text) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) text; if (simple->model) return GOO_CANVAS_TEXT_MODEL_GET_PRIVATE (simple->model); else return GOO_CANVAS_TEXT_GET_PRIVATE (text); } static void goo_canvas_text_get_common_property (GObject *object, GooCanvasTextData *text_data, GooCanvasTextPrivate *priv, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, text_data->x); break; case PROP_Y: g_value_set_double (value, text_data->y); break; case PROP_WIDTH: g_value_set_double (value, text_data->width); break; case PROP_HEIGHT: g_value_set_double (value, priv->height); break; case PROP_TEXT: g_value_set_string (value, text_data->text); break; case PROP_USE_MARKUP: g_value_set_boolean (value, text_data->use_markup); break; case PROP_ELLIPSIZE: g_value_set_enum (value, text_data->ellipsize); break; case PROP_WRAP: g_value_set_enum (value, text_data->wrap); break; case PROP_ANCHOR: g_value_set_enum (value, text_data->anchor); break; case PROP_ALIGN: g_value_set_enum (value, text_data->alignment); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_text_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasText *text = (GooCanvasText*) object; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); goo_canvas_text_get_common_property (object, text->text_data, priv, prop_id, value, pspec); } static void goo_canvas_text_set_common_property (GObject *object, GooCanvasTextData *text_data, GooCanvasTextPrivate *priv, guint prop_id, const GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: text_data->x = g_value_get_double (value); break; case PROP_Y: text_data->y = g_value_get_double (value); break; case PROP_WIDTH: text_data->width = g_value_get_double (value); break; case PROP_HEIGHT: priv->height = g_value_get_double (value); break; case PROP_TEXT: g_free (text_data->text); text_data->text = g_value_dup_string (value); break; case PROP_USE_MARKUP: text_data->use_markup = g_value_get_boolean (value); break; case PROP_ELLIPSIZE: text_data->ellipsize = g_value_get_enum (value); break; case PROP_WRAP: text_data->wrap = g_value_get_enum (value); break; case PROP_ANCHOR: text_data->anchor = g_value_get_enum (value); break; case PROP_ALIGN: text_data->alignment = g_value_get_enum (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_text_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasText *text = (GooCanvasText*) object; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_text_set_common_property (object, text->text_data, priv, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static PangoLayout* goo_canvas_text_create_layout (GooCanvasItemSimpleData *simple_data, GooCanvasTextData *text_data, gdouble layout_width, cairo_t *cr, GooCanvasBounds *bounds, gdouble *origin_x_return, gdouble *origin_y_return) { GooCanvasStyle *style = simple_data->style; GValue *svalue; PangoLayout *layout; PangoContext *context; PangoRectangle ink_rect, logical_rect; double logical_width, logical_height, align_width, origin_x, origin_y; gchar *string; double x1_extension, x2_extension, y1_extension, y2_extension; cairo_font_options_t *font_options; cairo_hint_metrics_t hint_metrics = CAIRO_HINT_METRICS_OFF; string = text_data->text ? text_data->text : ""; layout = pango_cairo_create_layout (cr); context = pango_layout_get_context (layout); if (layout_width > 0) pango_layout_set_width (layout, (double) layout_width * PANGO_SCALE); if (text_data->use_markup) pango_layout_set_markup (layout, string, -1); else pango_layout_set_text (layout, string, -1); svalue = goo_canvas_style_get_property (style, goo_canvas_style_font_desc_id); if (svalue) pango_layout_set_font_description (layout, svalue->data[0].v_pointer); svalue = goo_canvas_style_get_property (style, goo_canvas_style_hint_metrics_id); if (svalue) hint_metrics = svalue->data[0].v_long; font_options = cairo_font_options_create (); cairo_font_options_set_hint_metrics (font_options, hint_metrics); pango_cairo_context_set_font_options (context, font_options); cairo_font_options_destroy (font_options); if (text_data->alignment != PANGO_ALIGN_LEFT) pango_layout_set_alignment (layout, text_data->alignment); pango_layout_set_ellipsize (layout, text_data->ellipsize); pango_layout_set_wrap (layout, text_data->wrap); if (bounds) { /* Get size of the text, so we can position it according to anchor. */ pango_layout_get_extents (layout, &ink_rect, &logical_rect); logical_width = (double) logical_rect.width / PANGO_SCALE; logical_height = (double) logical_rect.height / PANGO_SCALE; /* If the text width has been set, that width is used to do the alignment positioning. Otherwise the actual width is used. */ if (text_data->width > 0) align_width = text_data->width; else align_width = logical_width; /* Now calculate the origin of the text, i.e. where we will tell Pango to draw it. */ origin_x = text_data->x; origin_y = text_data->y; switch (text_data->anchor) { case GTK_ANCHOR_N: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_S: origin_x -= align_width / 2.0; break; case GTK_ANCHOR_NE: case GTK_ANCHOR_E: case GTK_ANCHOR_SE: origin_x -= align_width; break; default: break; } switch (text_data->anchor) { case GTK_ANCHOR_W: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_E: origin_y -= logical_height / 2.0; break; case GTK_ANCHOR_SW: case GTK_ANCHOR_S: case GTK_ANCHOR_SE: origin_y -= logical_height; break; default: break; } /* Return the origin of the text if required. */ if (origin_x_return) *origin_x_return = origin_x; if (origin_y_return) *origin_y_return = origin_y; /* Now calculate the logical bounds. */ bounds->x1 = origin_x; bounds->y1 = origin_y; if (text_data->width > 0) { /* If the text width has been set, and the alignment isn't PANGO_ALIGN_LEFT, we need to adjust for the difference between the actual width of the text and the width that was used for alignment. */ switch (text_data->alignment) { case PANGO_ALIGN_CENTER: bounds->x1 += (align_width - logical_width) / 2.0; break; case PANGO_ALIGN_RIGHT: bounds->x1 += align_width - logical_width; break; default: break; } } bounds->x2 = bounds->x1 + logical_width; bounds->y2 = bounds->y1 + logical_height; /* Now adjust it to take into account the ink bounds. Calculate how far the ink rect extends outside each edge of the logical rect and adjust the bounds as necessary. */ x1_extension = logical_rect.x - ink_rect.x; if (x1_extension > 0) bounds->x1 -= x1_extension / PANGO_SCALE; x2_extension = (ink_rect.x + ink_rect.width) - (logical_rect.x + logical_rect.width); if (x2_extension > 0) bounds->x2 += x2_extension / PANGO_SCALE; y1_extension = logical_rect.y - ink_rect.y; if (y1_extension > 0) bounds->y1 -= y1_extension / PANGO_SCALE; y2_extension = (ink_rect.y + ink_rect.height) - (logical_rect.y + logical_rect.height); if (y2_extension > 0) bounds->y2 += y2_extension / PANGO_SCALE; } return layout; } static void goo_canvas_text_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasText *text = (GooCanvasText*) simple; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); PangoLayout *layout; /* Initialize the layout width to the text item's specified width property. It may get changed later in get_requested_height() according to the layout container and settings. */ text->layout_width = text->text_data->width; /* Compute the new bounds. */ layout = goo_canvas_text_create_layout (simple->simple_data, text->text_data, text->layout_width, cr, &simple->bounds, NULL, NULL); g_object_unref (layout); /* If the height is set, use that. */ if (priv->height > 0.0) simple->bounds.y2 = simple->bounds.y1 + priv->height; } static gboolean goo_canvas_text_is_unpainted (GooCanvasStyle *style) { GValue *value; value = goo_canvas_style_get_property (style, goo_canvas_style_fill_pattern_id); /* We only return TRUE if the value is explicitly set to NULL. */ if (value && !value->data[0].v_pointer) return TRUE; return FALSE; } static gboolean goo_canvas_text_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasText *text = (GooCanvasText*) simple; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); PangoLayout *layout; GooCanvasBounds bounds; PangoLayoutIter *iter; PangoRectangle ink_rect, log_rect; int px, py, x1, y1, x2, y2; int log_x2, ink_x2, log_y2, ink_y2; gdouble origin_x, origin_y; gboolean in_item = FALSE; /* If there is no text just return. */ if (!text->text_data->text || !text->text_data->text[0]) return FALSE; if (is_pointer_event && simple_data->pointer_events & GOO_CANVAS_EVENTS_PAINTED_MASK && goo_canvas_text_is_unpainted (simple_data->style)) return FALSE; /* Check if the point is outside the clipped height. */ if (priv->height > 0.0 && y > priv->height) return FALSE; layout = goo_canvas_text_create_layout (simple_data, text->text_data, text->layout_width, cr, &bounds, &origin_x, &origin_y); /* Convert the coordinates into Pango units. */ px = (x - origin_x) * PANGO_SCALE; py = (y - origin_y) * PANGO_SCALE; /* We use line extents here. Note that SVG uses character cells to determine hits so we have slightly different behavior. */ iter = pango_layout_get_iter (layout); do { pango_layout_iter_get_line_extents (iter, &ink_rect, &log_rect); /* We use a union of the ink rect and the logical rect, as we want to let the user click on any part of the ink, even if it extends outside the character cell (i.e. the ink rect), or click on the space in the character cell (i.e. the logical rect). */ x1 = MIN (log_rect.x, ink_rect.x); y1 = MIN (log_rect.y, ink_rect.y); log_x2 = log_rect.x + log_rect.width; ink_x2 = ink_rect.x + ink_rect.width; x2 = MAX (log_x2, ink_x2); log_y2 = log_rect.y + log_rect.height; ink_y2 = ink_rect.y + ink_rect.height; y2 = MAX (log_y2, ink_y2); if (px >= x1 && px < x2 && py >= y1 && py < y2) { in_item = TRUE; break; } } while (pango_layout_iter_next_line (iter)); pango_layout_iter_free (iter); g_object_unref (layout); return in_item; } static void goo_canvas_text_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasText *text = (GooCanvasText*) simple; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); PangoLayout *layout; GooCanvasBounds layout_bounds; gdouble origin_x, origin_y; /* If there is no text just return. */ if (!text->text_data->text || !text->text_data->text[0]) return; goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_new_path (cr); layout = goo_canvas_text_create_layout (simple->simple_data, text->text_data, text->layout_width, cr, &layout_bounds, &origin_x, &origin_y); cairo_save (cr); if (priv->height > 0.0) { cairo_rectangle (cr, origin_x, origin_y, text->layout_width, priv->height); cairo_clip (cr); } cairo_move_to (cr, origin_x, origin_y); pango_cairo_show_layout (cr, layout); cairo_restore (cr); g_object_unref (layout); } static gdouble goo_canvas_text_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasText *text = (GooCanvasText*) item; GooCanvasTextPrivate *priv = goo_canvas_text_get_private (text); PangoLayout *layout; gdouble height; /* If we have a transformation besides a simple scale & translation, just return -1 as we can't adjust the height in that case. */ if (simple_data->clip_path_commands || (simple_data->transform && (simple_data->transform->xy != 0.0 || simple_data->transform->yx != 0.0))) return -1; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); /* Convert the width from the parent's coordinate space. Note that we only need to support a simple scale operation here. */ text->layout_width = width; if (simple_data->transform) text->layout_width /= simple_data->transform->xx; if (priv->height < 0.0) { /* Create layout with given width. */ layout = goo_canvas_text_create_layout (simple_data, text->text_data, text->layout_width, cr, &simple->bounds, NULL, NULL); g_object_unref (layout); height = simple->bounds.y2 - simple->bounds.y1; } else { height = priv->height; } /* Convert to the parent's coordinate space. As above, we only need to support a simple scale operation here. */ if (simple_data->transform) height *= simple_data->transform->yy; /* Convert the item's bounds to device space. */ goo_canvas_item_simple_user_bounds_to_device (simple, cr, &simple->bounds); cairo_restore (cr); /* Return the new requested height of the text. */ return height; } /** * goo_canvas_text_get_natural_extents: * @text: a #GooCanvasText. * @ink_rect: the location to return the ink rect, or %NULL. * @logical_rect: the location to return the logical rect, or %NULL. * * Gets the natural extents of the text, in the text item's coordinate space. * * The final extents of the text may be different, if the text item is placed * in a layout container such as #GooCanvasTable. **/ void goo_canvas_text_get_natural_extents (GooCanvasText *text, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { GooCanvasItem *item = (GooCanvasItem*) text; GooCanvasItemSimple *simple = (GooCanvasItemSimple*) text; PangoLayout *layout; cairo_t *cr; if (simple->need_update) goo_canvas_item_ensure_updated (item); cr = goo_canvas_create_cairo_context (simple->canvas); layout = goo_canvas_text_create_layout (simple->simple_data, text->text_data, text->text_data->width, cr, NULL, NULL, NULL); pango_layout_get_extents (layout, ink_rect, logical_rect); g_object_unref (layout); cairo_destroy (cr); } static void goo_canvas_text_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasText *text = (GooCanvasText*) item; GooCanvasTextModel *tmodel = (GooCanvasTextModel*) model; /* If our text_data was allocated, free it. */ if (!simple->model) g_slice_free (GooCanvasTextData, text->text_data); /* Now use the new model's text_data instead. */ text->text_data = &tmodel->text_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->get_requested_height = goo_canvas_text_get_requested_height; iface->set_model = goo_canvas_text_set_model; } static void goo_canvas_text_class_init (GooCanvasTextClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasTextPrivate)); gobject_class->finalize = goo_canvas_text_finalize; gobject_class->get_property = goo_canvas_text_get_property; gobject_class->set_property = goo_canvas_text_set_property; simple_class->simple_update = goo_canvas_text_update; simple_class->simple_paint = goo_canvas_text_paint; simple_class->simple_is_item_at = goo_canvas_text_is_item_at; goo_canvas_text_install_common_properties (gobject_class); } /** * SECTION:goocanvastextmodel * @Title: GooCanvasTextModel * @Short_Description: a model for text items. * * GooCanvasTextModel represents a model for text items. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "fill-color". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasTextModel use goo_canvas_text_model_new(). * * To get or set the properties of an existing #GooCanvasTextModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the text item you must connect * to the signal handlers of the corresponding #GooCanvasText objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_text_model_finalize (GObject *object); static void goo_canvas_text_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_text_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasTextModel, goo_canvas_text_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_text_model_class_init (GooCanvasTextModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasTextPrivate)); gobject_class->finalize = goo_canvas_text_model_finalize; gobject_class->get_property = goo_canvas_text_model_get_property; gobject_class->set_property = goo_canvas_text_model_set_property; goo_canvas_text_install_common_properties (gobject_class); } static void goo_canvas_text_model_init (GooCanvasTextModel *tmodel) { GooCanvasTextPrivate *priv = GOO_CANVAS_TEXT_MODEL_GET_PRIVATE (tmodel); tmodel->text_data.width = -1.0; tmodel->text_data.anchor = GTK_ANCHOR_NW; tmodel->text_data.ellipsize = PANGO_ELLIPSIZE_NONE; tmodel->text_data.wrap = PANGO_WRAP_WORD; priv->height = -1.0; } /** * goo_canvas_text_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @string: the text to display. * @x: the x coordinate of the text. * @y: the y coordinate of the text. * @width: the width of the text item, or -1 for unlimited width. * @anchor: the position of the text relative to the given @x and @y * coordinates. For example an anchor of %GDK_ANCHOR_NW will result in the * top-left of the text being placed at the given @x and @y coordinates. * An anchor of %GDK_ANCHOR_CENTER will result in the center of the text being * placed at the @x and @y coordinates. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new text model. * * * * Here's an example showing how to create a text item with the bottom right * of the text box placed at (500,500): * * * GooCanvasItemModel *text = goo_canvas_text_model_new (mygroup, "Hello World", 500.0, 500.0, 200.0, GTK_ANCHOR_SE, * "fill-color", "blue", * NULL); * * * Returns: a new text model. **/ GooCanvasItemModel* goo_canvas_text_model_new (GooCanvasItemModel *parent, const char *string, gdouble x, gdouble y, gdouble width, GtkAnchorType anchor, ...) { GooCanvasItemModel *model; GooCanvasTextModel *tmodel; GooCanvasTextData *text_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_TEXT_MODEL, NULL); tmodel = (GooCanvasTextModel*) model; text_data = &tmodel->text_data; text_data->text = g_strdup (string); text_data->x = x; text_data->y = y; text_data->width = width; text_data->anchor = anchor; va_start (var_args, anchor); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_text_model_finalize (GObject *object) { GooCanvasTextModel *tmodel = (GooCanvasTextModel*) object; g_free (tmodel->text_data.text); G_OBJECT_CLASS (goo_canvas_text_model_parent_class)->finalize (object); } static void goo_canvas_text_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasTextModel *tmodel = (GooCanvasTextModel*) object; GooCanvasTextPrivate *priv = GOO_CANVAS_TEXT_MODEL_GET_PRIVATE (tmodel); goo_canvas_text_get_common_property (object, &tmodel->text_data, priv, prop_id, value, pspec); } static void goo_canvas_text_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasTextModel *tmodel = (GooCanvasTextModel*) object; GooCanvasTextPrivate *priv = GOO_CANVAS_TEXT_MODEL_GET_PRIVATE (tmodel); goo_canvas_text_set_common_property (object, &tmodel->text_data, priv, prop_id, value, pspec); g_signal_emit_by_name (tmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_text_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_TEXT, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_text_model_create_item; } goocanvas-0.15/src/goocanvasutils.c0000644000076400007640000007551211172574677014377 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasutils.c - utility functions. */ /** * SECTION:goocanvasutils * @Title: GooCanvas Types * @Short_Description: types used in GooCanvas. * * This section describes the types used throughout GooCanvas. */ #include #include #include #include "goocanvas.h" /* Glib doesn't provide a g_ptr_array_index() so we need our own one. */ void goo_canvas_util_ptr_array_insert (GPtrArray *ptr_array, gpointer data, gint index) { gint i; /* Add the pointer at the end so there is enough room. */ g_ptr_array_add (ptr_array, data); /* If index is -1, we are done. */ if (index == -1) return; /* Move the other pointers to make room for the new one. */ for (i = ptr_array->len - 1; i > index; i--) ptr_array->pdata[i] = ptr_array->pdata[i - 1]; /* Put the new element in its proper place. */ ptr_array->pdata[index] = data; } /* Glib doesn't provide a g_ptr_array_move() so we need our own one. */ void goo_canvas_util_ptr_array_move (GPtrArray *ptr_array, gint old_index, gint new_index) { gpointer data; gint i; data = ptr_array->pdata[old_index]; if (new_index > old_index) { /* Move the pointers down one place. */ for (i = old_index; i < new_index; i++) ptr_array->pdata[i] = ptr_array->pdata[i + 1]; } else { /* Move the pointers up one place. */ for (i = old_index; i > new_index; i--) ptr_array->pdata[i] = ptr_array->pdata[i - 1]; } ptr_array->pdata[new_index] = data; } /* Glib doesn't provide a g_ptr_array_move() so we need our own one. */ gint goo_canvas_util_ptr_array_find_index (GPtrArray *ptr_array, gpointer data) { gint i; for (i = 0; i < ptr_array->len; i++) { if (ptr_array->pdata[i] == data) return i; } return -1; } /* * Cairo utilities. */ cairo_surface_t* goo_canvas_cairo_surface_from_pixbuf (GdkPixbuf *pixbuf) { gint width = gdk_pixbuf_get_width (pixbuf); gint height = gdk_pixbuf_get_height (pixbuf); guchar *gdk_pixels = gdk_pixbuf_get_pixels (pixbuf); int gdk_rowstride = gdk_pixbuf_get_rowstride (pixbuf); int n_channels = gdk_pixbuf_get_n_channels (pixbuf); guchar *cairo_pixels; cairo_format_t format; cairo_surface_t *surface; static const cairo_user_data_key_t key; int j; if (n_channels == 3) format = CAIRO_FORMAT_RGB24; else format = CAIRO_FORMAT_ARGB32; cairo_pixels = g_malloc (4 * width * height); surface = cairo_image_surface_create_for_data ((unsigned char *)cairo_pixels, format, width, height, 4 * width); cairo_surface_set_user_data (surface, &key, cairo_pixels, (cairo_destroy_func_t)g_free); for (j = height; j; j--) { guchar *p = gdk_pixels; guchar *q = cairo_pixels; if (n_channels == 3) { guchar *end = p + 3 * width; while (p < end) { #if G_BYTE_ORDER == G_LITTLE_ENDIAN q[0] = p[2]; q[1] = p[1]; q[2] = p[0]; #else q[1] = p[0]; q[2] = p[1]; q[3] = p[2]; #endif p += 3; q += 4; } } else { guchar *end = p + 4 * width; guint t1,t2,t3; #define MULT(d,c,a,t) G_STMT_START { t = c * a; d = ((t >> 8) + t) >> 8; } G_STMT_END while (p < end) { #if G_BYTE_ORDER == G_LITTLE_ENDIAN MULT(q[0], p[2], p[3], t1); MULT(q[1], p[1], p[3], t2); MULT(q[2], p[0], p[3], t3); q[3] = p[3]; #else q[0] = p[3]; MULT(q[1], p[0], p[3], t1); MULT(q[2], p[1], p[3], t2); MULT(q[3], p[2], p[3], t3); #endif p += 4; q += 4; } #undef MULT } gdk_pixels += gdk_rowstride; cairo_pixels += 4 * width; } return surface; } cairo_pattern_t* goo_canvas_cairo_pattern_from_pixbuf (GdkPixbuf *pixbuf) { cairo_surface_t *surface; cairo_pattern_t *pattern; surface = goo_canvas_cairo_surface_from_pixbuf (pixbuf); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); return pattern; } /* * Cairo types. */ GType goo_cairo_pattern_get_type (void) { static GType cairo_pattern_type = 0; if (cairo_pattern_type == 0) cairo_pattern_type = g_boxed_type_register_static ("GooCairoPattern", (GBoxedCopyFunc) cairo_pattern_reference, (GBoxedFreeFunc) cairo_pattern_destroy); return cairo_pattern_type; } GType goo_cairo_fill_rule_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_FILL_RULE_WINDING, "CAIRO_FILL_RULE_WINDING", "winding" }, { CAIRO_FILL_RULE_EVEN_ODD, "CAIRO_FILL_RULE_EVEN_ODD", "even-odd" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoFillRule", values); } return etype; } GType goo_cairo_operator_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_OPERATOR_CLEAR, "CAIRO_OPERATOR_CLEAR", "clear" }, { CAIRO_OPERATOR_SOURCE, "CAIRO_OPERATOR_SOURCE", "source" }, { CAIRO_OPERATOR_OVER, "CAIRO_OPERATOR_OVER", "over" }, { CAIRO_OPERATOR_IN, "CAIRO_OPERATOR_IN", "in" }, { CAIRO_OPERATOR_OUT, "CAIRO_OPERATOR_OUT", "out" }, { CAIRO_OPERATOR_ATOP, "CAIRO_OPERATOR_ATOP", "atop" }, { CAIRO_OPERATOR_DEST, "CAIRO_OPERATOR_DEST", "dest" }, { CAIRO_OPERATOR_DEST_OVER, "CAIRO_OPERATOR_DEST_OVER", "dest-over" }, { CAIRO_OPERATOR_DEST_IN, "CAIRO_OPERATOR_DEST_IN", "dest-in" }, { CAIRO_OPERATOR_DEST_OUT, "CAIRO_OPERATOR_DEST_OUT", "dest-out" }, { CAIRO_OPERATOR_DEST_ATOP, "CAIRO_OPERATOR_DEST_ATOP", "dest-atop" }, { CAIRO_OPERATOR_XOR, "CAIRO_OPERATOR_XOR", "xor" }, { CAIRO_OPERATOR_ADD, "CAIRO_OPERATOR_ADD", "add" }, { CAIRO_OPERATOR_SATURATE, "CAIRO_OPERATOR_SATURATE", "saturate" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoOperator", values); } return etype; } GType goo_cairo_antialias_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_ANTIALIAS_DEFAULT, "CAIRO_ANTIALIAS_DEFAULT", "default" }, { CAIRO_ANTIALIAS_NONE, "CAIRO_ANTIALIAS_NONE", "none" }, { CAIRO_ANTIALIAS_GRAY, "CAIRO_ANTIALIAS_GRAY", "gray" }, { CAIRO_ANTIALIAS_SUBPIXEL, "CAIRO_ANTIALIAS_SUBPIXEL", "subpixel" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoAntialias", values); } return etype; } GType goo_cairo_line_cap_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_LINE_CAP_BUTT, "CAIRO_LINE_CAP_BUTT", "butt" }, { CAIRO_LINE_CAP_ROUND, "CAIRO_LINE_CAP_ROUND", "round" }, { CAIRO_LINE_CAP_SQUARE, "CAIRO_LINE_CAP_SQUARE", "square" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoLineCap", values); } return etype; } GType goo_cairo_line_join_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_LINE_JOIN_MITER, "CAIRO_LINE_JOIN_MITER", "miter" }, { CAIRO_LINE_JOIN_ROUND, "CAIRO_LINE_JOIN_ROUND", "round" }, { CAIRO_LINE_JOIN_BEVEL, "CAIRO_LINE_JOIN_BEVEL", "bevel" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoLineJoin", values); } return etype; } GType goo_cairo_hint_metrics_get_type (void) { static GType etype = 0; if (etype == 0) { static const GEnumValue values[] = { { CAIRO_HINT_METRICS_DEFAULT, "CAIRO_HINT_METRICS_DEFAULT", "default" }, { CAIRO_HINT_METRICS_OFF, "CAIRO_HINT_METRICS_OFF", "off" }, { CAIRO_HINT_METRICS_ON, "CAIRO_HINT_METRICS_ON", "on" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCairoHintMetrics", values); } return etype; } /** * goo_canvas_line_dash_ref: * @dash: a #GooCanvasLineDash. * * Increments the reference count of the dash pattern. * * Returns: the dash pattern. **/ GooCanvasLineDash* goo_canvas_line_dash_ref (GooCanvasLineDash *dash) { if (dash) dash->ref_count++; return dash; } /** * goo_canvas_line_dash_unref: * @dash: a #GooCanvasLineDash. * * Decrements the reference count of the dash pattern. If it falls to 0 * it is freed. **/ void goo_canvas_line_dash_unref (GooCanvasLineDash *dash) { if (dash && --dash->ref_count == 0) { g_free (dash->dashes); g_free (dash); } } GType goo_canvas_line_dash_get_type (void) { static GType cairo_line_dash_type = 0; if (cairo_line_dash_type == 0) cairo_line_dash_type = g_boxed_type_register_static ("GooCanvasLineDash", (GBoxedCopyFunc) goo_canvas_line_dash_ref, (GBoxedFreeFunc) goo_canvas_line_dash_unref); return cairo_line_dash_type; } /** * goo_canvas_line_dash_new: * @num_dashes: the number of dashes and gaps in the pattern. * @...: the length of each dash and gap. * * Creates a new dash pattern. * * Returns: a new dash pattern. **/ GooCanvasLineDash* goo_canvas_line_dash_new (gint num_dashes, ...) { GooCanvasLineDash *dash; va_list var_args; gint i; dash = g_new (GooCanvasLineDash, 1); dash->ref_count = 1; dash->num_dashes = num_dashes; dash->dashes = g_new (double, num_dashes); dash->dash_offset = 0.0; va_start (var_args, num_dashes); for (i = 0; i < num_dashes; i++) { dash->dashes[i] = va_arg (var_args, double); } va_end (var_args); return dash; } /** * goo_canvas_line_dash_newv: * @num_dashes: the number of dashes and gaps in the pattern. * @dashes: a g_new-allocated vector of doubles, the length of each * dash and gap. * * Creates a new dash pattern. Takes ownership of the @dashes vector. * * Returns: a new dash pattern. **/ GooCanvasLineDash* goo_canvas_line_dash_newv (gint num_dashes, double *dashes) { GooCanvasLineDash *dash; dash = g_new (GooCanvasLineDash, 1); dash->ref_count = 1; dash->num_dashes = num_dashes; dash->dashes = dashes; dash->dash_offset = 0.0; return dash; } cairo_matrix_t* goo_cairo_matrix_copy (const cairo_matrix_t *matrix) { cairo_matrix_t *matrix_copy; if (!matrix) return NULL; matrix_copy = g_slice_new (cairo_matrix_t); *matrix_copy = *matrix; return matrix_copy; } void goo_cairo_matrix_free (cairo_matrix_t *matrix) { g_slice_free (cairo_matrix_t, matrix); } GType goo_cairo_matrix_get_type (void) { static GType type_cairo_matrix = 0; if (!type_cairo_matrix) type_cairo_matrix = g_boxed_type_register_static ("GooCairoMatrix", (GBoxedCopyFunc) goo_cairo_matrix_copy, (GBoxedFreeFunc) goo_cairo_matrix_free); return type_cairo_matrix; } /* This is a semi-private function to help gtk-doc find child properties. */ GParamSpec** goo_canvas_query_child_properties (gpointer class, guint *n_properties) { if (!G_TYPE_IS_CLASSED (G_TYPE_FROM_CLASS (class))) return NULL; if (g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM)) return goo_canvas_item_class_list_child_properties (class, n_properties); if (g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM_MODEL)) return goo_canvas_item_model_class_list_child_properties (class, n_properties); return NULL; } static gdouble parse_double (gchar **pos, gboolean *error) { gdouble result; gchar *p; /* If an error has already occurred, just return. */ if (*error) return 0; /* Skip whitespace and commas. */ p = *pos; while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n' || *p == ',') p++; /* Parse the double, and set pos to the first char after it. */ result = g_ascii_strtod (p, pos); /* If no characters were parsed, set the error flag. */ if (p == *pos) *error = TRUE; return result; } static gint parse_flag (gchar **pos, gboolean *error) { gint result = 0; gchar *p; /* If an error has already occurred, just return. */ if (*error) return 0; /* Skip whitespace and commas. */ p = *pos; while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n' || *p == ',') p++; /* The flag must be a '0' or a '1'. */ if (*p == '0') result = 0; else if (*p == '1') result = 1; else { *error = TRUE; return 0; } *pos = p + 1; return result; } /** * goo_canvas_parse_path_data: * @path_data: the sequence of path commands, specified as a string using the * same syntax as in the Scalable * Vector Graphics (SVG) path element. * * Parses the given SVG path specification string. * * Returns: a #GArray of #GooCanvasPathCommand elements. **/ GArray* goo_canvas_parse_path_data (const gchar *path_data) { GArray *commands; GooCanvasPathCommand cmd; gchar *pos, command = 0, next_command; gboolean error = FALSE; commands = g_array_new (0, 0, sizeof (GooCanvasPathCommand)); if (!path_data) return commands; pos = (gchar*) path_data; for (;;) { while (*pos == ' ' || *pos == '\t' || *pos == '\r' || *pos == '\n') pos++; if (!*pos) break; next_command = *pos; /* If there is no command letter, we use the same command as the last one, except for the first command, and 'moveto' (which becomes 'lineto'). */ if ((next_command < 'a' || next_command > 'z') && (next_command < 'A' || next_command > 'Z')) { /* If this is the first command, then set the error flag and assume a simple close-path command. */ if (!command) { error = TRUE; command = 'Z'; } /* moveto commands change to lineto. */ else if (command == 'm') command = 'l'; else if (command == 'M') command = 'L'; } else { command = next_command; pos++; } cmd.simple.relative = 0; switch (command) { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ case 'm': cmd.simple.relative = 1; case 'M': cmd.simple.type = GOO_CANVAS_PATH_MOVE_TO; cmd.simple.x = parse_double (&pos, &error); cmd.simple.y = parse_double (&pos, &error); break; case 'Z': case 'z': cmd.simple.type = GOO_CANVAS_PATH_CLOSE_PATH; break; case 'l': cmd.simple.relative = 1; case 'L': cmd.simple.type = GOO_CANVAS_PATH_LINE_TO; cmd.simple.x = parse_double (&pos, &error); cmd.simple.y = parse_double (&pos, &error); break; case 'h': cmd.simple.relative = 1; case 'H': cmd.simple.type = GOO_CANVAS_PATH_HORIZONTAL_LINE_TO; cmd.simple.x = parse_double (&pos, &error); break; case 'v': cmd.simple.relative = 1; case 'V': cmd.simple.type = GOO_CANVAS_PATH_VERTICAL_LINE_TO; cmd.simple.y = parse_double (&pos, &error); break; /* Bezier curve commands: CcSsQqTt. */ case 'c': cmd.curve.relative = 1; case 'C': cmd.curve.type = GOO_CANVAS_PATH_CURVE_TO; cmd.curve.x1 = parse_double (&pos, &error); cmd.curve.y1 = parse_double (&pos, &error); cmd.curve.x2 = parse_double (&pos, &error); cmd.curve.y2 = parse_double (&pos, &error); cmd.curve.x = parse_double (&pos, &error); cmd.curve.y = parse_double (&pos, &error); break; case 's': cmd.curve.relative = 1; case 'S': cmd.curve.type = GOO_CANVAS_PATH_SMOOTH_CURVE_TO; cmd.curve.x2 = parse_double (&pos, &error); cmd.curve.y2 = parse_double (&pos, &error); cmd.curve.x = parse_double (&pos, &error); cmd.curve.y = parse_double (&pos, &error); break; case 'q': cmd.curve.relative = 1; case 'Q': cmd.curve.type = GOO_CANVAS_PATH_QUADRATIC_CURVE_TO; cmd.curve.x1 = parse_double (&pos, &error); cmd.curve.y1 = parse_double (&pos, &error); cmd.curve.x = parse_double (&pos, &error); cmd.curve.y = parse_double (&pos, &error); break; case 't': cmd.curve.relative = 1; case 'T': cmd.curve.type = GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO; cmd.curve.x = parse_double (&pos, &error); cmd.curve.y = parse_double (&pos, &error); break; /* The elliptical arc commands: Aa. */ case 'a': cmd.arc.relative = 1; case 'A': cmd.arc.type = GOO_CANVAS_PATH_ELLIPTICAL_ARC; cmd.arc.rx = parse_double (&pos, &error); cmd.arc.ry = parse_double (&pos, &error); cmd.arc.x_axis_rotation = parse_double (&pos, &error); cmd.arc.large_arc_flag = parse_flag (&pos, &error); cmd.arc.sweep_flag = parse_flag (&pos, &error); cmd.arc.x = parse_double (&pos, &error); cmd.arc.y = parse_double (&pos, &error); break; default: error = TRUE; break; } /* If an error has occurred, return without adding the new command. Thus we include everything in the path up to the error, like SVG. */ if (error) return commands; g_array_append_val (commands, cmd); } return commands; } static void do_curve_to (GooCanvasPathCommand *cmd, cairo_t *cr, gdouble *x, gdouble *y, gdouble *last_control_point_x, gdouble *last_control_point_y) { if (cmd->curve.relative) { cairo_curve_to (cr, *x + cmd->curve.x1, *y + cmd->curve.y1, *x + cmd->curve.x2, *y + cmd->curve.y2, *x + cmd->curve.x, *y + cmd->curve.y); *last_control_point_x = *x + cmd->curve.x2; *last_control_point_y = *y + cmd->curve.y2; *x += cmd->curve.x; *y += cmd->curve.y; } else { cairo_curve_to (cr, cmd->curve.x1, cmd->curve.y1, cmd->curve.x2, cmd->curve.y2, cmd->curve.x, cmd->curve.y); *last_control_point_x = cmd->curve.x2; *last_control_point_y = cmd->curve.y2; *x = cmd->curve.x; *y = cmd->curve.y; } } static void do_smooth_curve_to (GooCanvasPathCommand *cmd, GooCanvasPathCommandType prev_cmd_type, cairo_t *cr, gdouble *x, gdouble *y, gdouble *last_control_point_x, gdouble *last_control_point_y) { gdouble x1, y1; /* If the last command was a curveto or smooth curveto, we use the reflection of the last control point about the current point as the first control point of this curve. Otherwise we use the current point as the first control point. */ if (prev_cmd_type == GOO_CANVAS_PATH_CURVE_TO || prev_cmd_type == GOO_CANVAS_PATH_SMOOTH_CURVE_TO) { x1 = *x + (*x - *last_control_point_x); y1 = *y + (*y - *last_control_point_y); } else { x1 = *x; y1 = *y; } if (cmd->curve.relative) { cairo_curve_to (cr, x1, y1, *x + cmd->curve.x2, *y + cmd->curve.y2, *x + cmd->curve.x, *y + cmd->curve.y); *last_control_point_x = *x + cmd->curve.x2; *last_control_point_y = *y + cmd->curve.y2; *x += cmd->curve.x; *y += cmd->curve.y; } else { cairo_curve_to (cr, x1, y1, cmd->curve.x2, cmd->curve.y2, cmd->curve.x, cmd->curve.y); *last_control_point_x = cmd->curve.x2; *last_control_point_y = cmd->curve.y2; *x = cmd->curve.x; *y = cmd->curve.y; } } static void do_quadratic_curve_to (GooCanvasPathCommand *cmd, cairo_t *cr, gdouble *x, gdouble *y, gdouble *last_control_point_x, gdouble *last_control_point_y) { gdouble qx1, qy1, qx2, qy2, x1, y1, x2, y2; if (cmd->curve.relative) { qx1 = *x + cmd->curve.x1; qy1 = *y + cmd->curve.y1; qx2 = *x + cmd->curve.x; qy2 = *y + cmd->curve.y; } else { qx1 = cmd->curve.x1; qy1 = cmd->curve.y1; qx2 = cmd->curve.x; qy2 = cmd->curve.y; } /* We need to convert the quadratic into a cubic bezier. */ x1 = *x + (qx1 - *x) * 2.0 / 3.0; y1 = *y + (qy1 - *y) * 2.0 / 3.0; x2 = x1 + (qx2 - *x) / 3.0; y2 = y1 + (qy2 - *y) / 3.0; cairo_curve_to (cr, x1, y1, x2, y2, qx2, qy2); *x = qx2; *y = qy2; *last_control_point_x = qx1; *last_control_point_y = qy1; } static void do_smooth_quadratic_curve_to (GooCanvasPathCommand *cmd, GooCanvasPathCommandType prev_cmd_type, cairo_t *cr, gdouble *x, gdouble *y, gdouble *last_control_point_x, gdouble *last_control_point_y) { gdouble qx1, qy1, qx2, qy2, x1, y1, x2, y2; /* If the last command was a quadratic or smooth quadratic, we use the reflection of the last control point about the current point as the first control point of this curve. Otherwise we use the current point as the first control point. */ if (prev_cmd_type == GOO_CANVAS_PATH_QUADRATIC_CURVE_TO || prev_cmd_type == GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO) { qx1 = *x + (*x - *last_control_point_x); qy1 = *y + (*y - *last_control_point_y); } else { qx1 = *x; qy1 = *y; } if (cmd->curve.relative) { qx2 = *x + cmd->curve.x; qy2 = *y + cmd->curve.y; } else { qx2 = cmd->curve.x; qy2 = cmd->curve.y; } /* We need to convert the quadratic into a cubic bezier. */ x1 = *x + (qx1 - *x) * 2.0 / 3.0; y1 = *y + (qy1 - *y) * 2.0 / 3.0; x2 = x1 + (qx2 - *x) / 3.0; y2 = y1 + (qy2 - *y) / 3.0; cairo_curve_to (cr, x1, y1, x2, y2, qx2, qy2); *x = qx2; *y = qy2; *last_control_point_x = qx1; *last_control_point_y = qy1; } static gdouble calc_angle (gdouble ux, gdouble uy, gdouble vx, gdouble vy) { gdouble top, u_magnitude, v_magnitude, angle_cos, angle; top = ux * vx + uy * vy; u_magnitude = sqrt (ux * ux + uy * uy); v_magnitude = sqrt (vx * vx + vy * vy); angle_cos = top / (u_magnitude * v_magnitude); /* We check if the cosine is slightly out-of-bounds. */ if (angle_cos >= 1.0) angle = 0.0; if (angle_cos <= -1.0) angle = M_PI; else angle = acos (angle_cos); if (ux * vy - uy * vx < 0) angle = - angle; return angle; } /* FIXME: Maybe we should do these calculations once when the path data is parsed, and keep the cairo parameters we need in the command instead. */ static void do_elliptical_arc (GooCanvasPathCommand *cmd, cairo_t *cr, gdouble *x, gdouble *y) { gdouble x1 = *x, y1 = *y, x2, y2, rx, ry, lambda; gdouble v1, v2, angle, angle_sin, angle_cos, x11, y11; gdouble rx_squared, ry_squared, x11_squared, y11_squared, top, bottom; gdouble c, cx1, cy1, cx, cy, start_angle, angle_delta; /* Calculate the end point of the arc - x2,y2. */ if (cmd->arc.relative) { x2 = x1 + cmd->arc.x; y2 = y1 + cmd->arc.y; } else { x2 = cmd->arc.x; y2 = cmd->arc.y; } *x = x2; *y = y2; /* If the endpoints are exactly the same, just return (see SVG spec). */ if (x1 == x2 && y1 == y2) return; /* If either rx or ry is 0, do a simple lineto (see SVG spec). */ if (cmd->arc.rx == 0.0 || cmd->arc.ry == 0.0) { cairo_line_to (cr, x2, y2); return; } /* Calculate x1' and y1' (as per SVG implementation notes). */ v1 = (x1 - x2) / 2.0; v2 = (y1 - y2) / 2.0; angle = cmd->arc.x_axis_rotation * (M_PI / 180.0); angle_sin = sin (angle); angle_cos = cos (angle); x11 = (angle_cos * v1) + (angle_sin * v2); y11 = - (angle_sin * v1) + (angle_cos * v2); /* Ensure rx and ry are positive and large enough. */ rx = cmd->arc.rx > 0.0 ? cmd->arc.rx : - cmd->arc.rx; ry = cmd->arc.ry > 0.0 ? cmd->arc.ry : - cmd->arc.ry; lambda = (x11 * x11) / (rx * rx) + (y11 * y11) / (ry * ry); if (lambda > 1.0) { gdouble square_root = sqrt (lambda); rx *= square_root; ry *= square_root; } /* Calculate cx' and cy'. */ rx_squared = rx * rx; ry_squared = ry * ry; x11_squared = x11 * x11; y11_squared = y11 * y11; top = (rx_squared * ry_squared) - (rx_squared * y11_squared) - (ry_squared * x11_squared); if (top < 0.0) { c = 0.0; } else { bottom = (rx_squared * y11_squared) + (ry_squared * x11_squared); c = sqrt (top / bottom); } if (cmd->arc.large_arc_flag == cmd->arc.sweep_flag) c = - c; cx1 = c * ((rx * y11) / ry); cy1 = c * (- (ry * x11) / rx); /* Calculate cx and cy. */ cx = (angle_cos * cx1) - (angle_sin * cy1) + (x1 + x2) / 2; cy = (angle_sin * cx1) + (angle_cos * cy1) + (y1 + y2) / 2; /* Calculate the start and end angles. */ v1 = (x11 - cx1) / rx; v2 = (y11 - cy1) / ry; start_angle = calc_angle (1, 0, v1, v2); angle_delta = calc_angle (v1, v2, (-x11 - cx1) / rx, (-y11 - cy1) / ry); if (cmd->arc.sweep_flag == 0 && angle_delta > 0.0) angle_delta -= 2 * M_PI; else if (cmd->arc.sweep_flag == 1 && angle_delta < 0.0) angle_delta += 2 * M_PI; /* Now draw the arc. */ cairo_save (cr); cairo_translate (cr, cx, cy); cairo_rotate (cr, angle); cairo_scale (cr, rx, ry); if (angle_delta > 0.0) cairo_arc (cr, 0.0, 0.0, 1.0, start_angle, start_angle + angle_delta); else cairo_arc_negative (cr, 0.0, 0.0, 1.0, start_angle, start_angle + angle_delta); cairo_restore (cr); } /** * goo_canvas_create_path: * @commands: an array of #GooCanvasPathCommand. * @cr: a cairo context. * * Creates the path specified by the given #GooCanvasPathCommand array. **/ void goo_canvas_create_path (GArray *commands, cairo_t *cr) { GooCanvasPathCommand *cmd; GooCanvasPathCommandType prev_cmd_type = GOO_CANVAS_PATH_CLOSE_PATH; gdouble x = 0, y = 0, path_start_x = 0, path_start_y = 0; gdouble last_control_point_x = 0.0, last_control_point_y = 0.0; gint i; cairo_new_path (cr); if (!commands || commands->len == 0) return; for (i = 0; i < commands->len; i++) { cmd = &g_array_index (commands, GooCanvasPathCommand, i); switch (cmd->simple.type) { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ case GOO_CANVAS_PATH_MOVE_TO: if (cmd->simple.relative) { x += cmd->simple.x; y += cmd->simple.y; } else { x = cmd->simple.x; y = cmd->simple.y; } path_start_x = x; path_start_y = y; cairo_move_to (cr, x, y); break; case GOO_CANVAS_PATH_CLOSE_PATH: x = path_start_x; y = path_start_y; cairo_close_path (cr); break; case GOO_CANVAS_PATH_LINE_TO: if (cmd->simple.relative) { x += cmd->simple.x; y += cmd->simple.y; } else { x = cmd->simple.x; y = cmd->simple.y; } cairo_line_to (cr, x, y); break; case GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: if (cmd->simple.relative) x += cmd->simple.x; else x = cmd->simple.x; cairo_line_to (cr, x, y); break; case GOO_CANVAS_PATH_VERTICAL_LINE_TO: if (cmd->simple.relative) y += cmd->simple.y; else y = cmd->simple.y; cairo_line_to (cr, x, y); break; /* Bezier curve commands: CcSsQqTt. */ case GOO_CANVAS_PATH_CURVE_TO: do_curve_to (cmd, cr, &x, &y, &last_control_point_x, &last_control_point_y); break; case GOO_CANVAS_PATH_SMOOTH_CURVE_TO: do_smooth_curve_to (cmd, prev_cmd_type, cr, &x, &y, &last_control_point_x, &last_control_point_y); break; case GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: do_quadratic_curve_to (cmd, cr, &x, &y, &last_control_point_x, &last_control_point_y); break; case GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: do_smooth_quadratic_curve_to (cmd, prev_cmd_type, cr, &x, &y, &last_control_point_x, &last_control_point_y); break; /* The elliptical arc commands: Aa. */ case GOO_CANVAS_PATH_ELLIPTICAL_ARC: do_elliptical_arc (cmd, cr, &x, &y); break; } prev_cmd_type = cmd->simple.type; } } /* This is a copy of _gtk_boolean_handled_accumulator. */ gboolean goo_canvas_boolean_handled_accumulator (GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy) { gboolean continue_emission; gboolean signal_handled; signal_handled = g_value_get_boolean (handler_return); g_value_set_boolean (return_accu, signal_handled); continue_emission = !signal_handled; return continue_emission; } static GooCanvasBounds * goo_canvas_bounds_copy (const GooCanvasBounds *bounds) { GooCanvasBounds *result = g_new (GooCanvasBounds, 1); *result = *bounds; return result; } GType goo_canvas_bounds_get_type (void) { static GType our_type = 0; if (our_type == 0) our_type = g_boxed_type_register_static ("GooCanvasBounds", (GBoxedCopyFunc) goo_canvas_bounds_copy, (GBoxedFreeFunc) g_free); return our_type; } /* Converts red, green, blue and alpha doubles to an RGBA guint. */ guint goo_canvas_convert_colors_to_rgba (double red, double green, double blue, double alpha) { guint red_byte, green_byte, blue_byte, alpha_byte; red_byte = red * 256; red_byte -= red_byte >> 8; green_byte = green * 256; green_byte -= green_byte >> 8; blue_byte = blue * 256; blue_byte -= blue_byte >> 8; alpha_byte = alpha * 256; alpha_byte -= alpha_byte >> 8; return (red_byte << 24) + (green_byte << 16) + (blue_byte << 8) + alpha_byte; } void goo_canvas_get_rgba_value_from_pattern (cairo_pattern_t *pattern, GValue *value) { double red, green, blue, alpha; guint rgba = 0; if (pattern && cairo_pattern_get_type (pattern) == CAIRO_PATTERN_TYPE_SOLID) { cairo_pattern_get_rgba (pattern, &red, &green, &blue, &alpha); rgba = goo_canvas_convert_colors_to_rgba (red, green, blue, alpha); } g_value_set_uint (value, rgba); } /* Sets a style property to the given pattern, taking ownership of it. */ void goo_canvas_set_style_property_from_pattern (GooCanvasStyle *style, GQuark property_id, cairo_pattern_t *pattern) { GValue tmpval = { 0 }; g_value_init (&tmpval, GOO_TYPE_CAIRO_PATTERN); g_value_take_boxed (&tmpval, pattern); goo_canvas_style_set_property (style, property_id, &tmpval); g_value_unset (&tmpval); } cairo_pattern_t* goo_canvas_create_pattern_from_color_value (const GValue *value) { GdkColor color = { 0, 0, 0, 0, }; if (g_value_get_string (value)) gdk_color_parse (g_value_get_string (value), &color); return cairo_pattern_create_rgb (color.red / 65535.0, color.green / 65535.0, color.blue / 65535.0); } cairo_pattern_t* goo_canvas_create_pattern_from_rgba_value (const GValue *value) { guint rgba, red, green, blue, alpha; rgba = g_value_get_uint (value); red = (rgba >> 24) & 0xFF; green = (rgba >> 16) & 0xFF; blue = (rgba >> 8) & 0xFF; alpha = (rgba) & 0xFF; return cairo_pattern_create_rgba (red / 255.0, green / 255.0, blue / 255.0, alpha / 255.0); } cairo_pattern_t* goo_canvas_create_pattern_from_pixbuf_value (const GValue *value) { GdkPixbuf *pixbuf; cairo_surface_t *surface; cairo_pattern_t *pattern; pixbuf = g_value_get_object (value); surface = goo_canvas_cairo_surface_from_pixbuf (pixbuf); pattern = cairo_pattern_create_for_surface (surface); cairo_surface_destroy (surface); cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT); return pattern; } goocanvas-0.15/src/goocanvaspolyline.c0000644000076400007640000012432511172574677015067 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaspolyline.c - polyline item, with optional arrows. */ /** * SECTION:goocanvaspolyline * @Title: GooCanvasPolyline * @Short_Description: a polyline item (a series of lines with optional arrows). * * GooCanvasPolyline represents a polyline item, which is a series of one or * more lines, with optional arrows at either end. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasPolyline use goo_canvas_polyline_new(), or * goo_canvas_polyline_new_line() for a simple line between two points. * * To get or set the properties of an existing #GooCanvasPolyline, use * g_object_get() and g_object_set(). */ #include #include #include #include #include #include #include "goocanvaspolyline.h" #include "goocanvas.h" /** * goo_canvas_points_new: * @num_points: the number of points to create space for. * * Creates a new #GooCanvasPoints struct with space for the given number of * points. It should be freed with goo_canvas_points_unref(). * * Returns: a new #GooCanvasPoints struct. **/ GooCanvasPoints* goo_canvas_points_new (int num_points) { GooCanvasPoints *points; points = g_slice_new (GooCanvasPoints); points->num_points = num_points; points->coords = g_slice_alloc (num_points * 2 * sizeof (double)); points->ref_count = 1; return points; } /** * goo_canvas_points_ref: * @points: a #GooCanvasPoints struct. * * Increments the reference count of the given #GooCanvasPoints struct. * * Returns: the #GooCanvasPoints struct. **/ GooCanvasPoints* goo_canvas_points_ref (GooCanvasPoints *points) { points->ref_count++; return points; } /** * goo_canvas_points_unref: * @points: a #GooCanvasPoints struct. * * Decrements the reference count of the given #GooCanvasPoints struct, * freeing it if the reference count falls to zero. **/ void goo_canvas_points_unref (GooCanvasPoints *points) { if (--points->ref_count == 0) { g_slice_free1 (points->num_points * 2 * sizeof (double), points->coords); g_slice_free (GooCanvasPoints, points); } } GType goo_canvas_points_get_type (void) { static GType type_canvas_points = 0; if (!type_canvas_points) type_canvas_points = g_boxed_type_register_static ("GooCanvasPoints", (GBoxedCopyFunc) goo_canvas_points_ref, (GBoxedFreeFunc) goo_canvas_points_unref); return type_canvas_points; } enum { PROP_0, PROP_POINTS, PROP_CLOSE_PATH, PROP_START_ARROW, PROP_END_ARROW, PROP_ARROW_LENGTH, PROP_ARROW_WIDTH, PROP_ARROW_TIP_LENGTH, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT }; static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasPolyline, goo_canvas_polyline, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_polyline_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_POINTS, g_param_spec_boxed ("points", _("Points"), _("The array of points"), GOO_TYPE_CANVAS_POINTS, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CLOSE_PATH, g_param_spec_boolean ("close-path", _("Close Path"), _("If the last point should be connected to the first"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_START_ARROW, g_param_spec_boolean ("start-arrow", _("Start Arrow"), _("If an arrow should be displayed at the start of the polyline"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_END_ARROW, g_param_spec_boolean ("end-arrow", _("End Arrow"), _("If an arrow should be displayed at the end of the polyline"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ARROW_LENGTH, g_param_spec_double ("arrow-length", _("Arrow Length"), _("The length of the arrows, as a multiple of the line width"), 0.0, G_MAXDOUBLE, 5.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ARROW_WIDTH, g_param_spec_double ("arrow-width", _("Arrow Width"), _("The width of the arrows, as a multiple of the line width"), 0.0, G_MAXDOUBLE, 4.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ARROW_TIP_LENGTH, g_param_spec_double ("arrow-tip-length", _("Arrow Tip Length"), _("The length of the arrow tip, as a multiple of the line width"), 0.0, G_MAXDOUBLE, 4.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the left-most point of the polyline"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the top-most point of the polyline"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the polyline"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the polyline"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); } static void goo_canvas_polyline_init (GooCanvasPolyline *polyline) { polyline->polyline_data = g_slice_new0 (GooCanvasPolylineData); } static void goo_canvas_polyline_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPolyline *polyline = (GooCanvasPolyline*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { g_slice_free1 (polyline->polyline_data->num_points * 2 * sizeof (gdouble), polyline->polyline_data->coords); g_slice_free (GooCanvasPolylineArrowData, polyline->polyline_data->arrow_data); g_slice_free (GooCanvasPolylineData, polyline->polyline_data); } polyline->polyline_data = NULL; G_OBJECT_CLASS (goo_canvas_polyline_parent_class)->finalize (object); } static void goo_canvas_polyline_get_extent (GooCanvasPolylineData *polyline_data, GooCanvasBounds *bounds) { guint i; if (polyline_data->num_points == 0) { bounds->x1 = bounds->y1 = bounds->x2 = bounds->y2 = 0.0; } else { bounds->x1 = bounds->x2 = polyline_data->coords[0]; bounds->y1 = bounds->y2 = polyline_data->coords[1]; for (i = 1; i < polyline_data->num_points; i++) { bounds->x1 = MIN (bounds->x1, polyline_data->coords[2 * i]); bounds->y1 = MIN (bounds->y1, polyline_data->coords[2 * i + 1]); bounds->x2 = MAX (bounds->x2, polyline_data->coords[2 * i]); bounds->y2 = MAX (bounds->y2, polyline_data->coords[2 * i + 1]); } } } static void goo_canvas_polyline_get_common_property (GObject *object, GooCanvasPolylineData *polyline_data, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasPoints *points; GooCanvasBounds extent; switch (prop_id) { case PROP_POINTS: if (polyline_data->num_points == 0) { g_value_set_boxed (value, NULL); } else { points = goo_canvas_points_new (polyline_data->num_points); memcpy (points->coords, polyline_data->coords, polyline_data->num_points * 2 * sizeof (double)); g_value_set_boxed (value, points); goo_canvas_points_unref (points); } break; case PROP_CLOSE_PATH: g_value_set_boolean (value, polyline_data->close_path); break; case PROP_START_ARROW: g_value_set_boolean (value, polyline_data->start_arrow); break; case PROP_END_ARROW: g_value_set_boolean (value, polyline_data->end_arrow); break; case PROP_ARROW_LENGTH: g_value_set_double (value, polyline_data->arrow_data ? polyline_data->arrow_data->arrow_length : 5.0); break; case PROP_ARROW_WIDTH: g_value_set_double (value, polyline_data->arrow_data ? polyline_data->arrow_data->arrow_width : 4.0); break; case PROP_ARROW_TIP_LENGTH: g_value_set_double (value, polyline_data->arrow_data ? polyline_data->arrow_data->arrow_tip_length : 4.0); break; case PROP_X: goo_canvas_polyline_get_extent (polyline_data, &extent); g_value_set_double (value, extent.x1); break; case PROP_Y: goo_canvas_polyline_get_extent (polyline_data, &extent); g_value_set_double (value, extent.y1); break; case PROP_WIDTH: goo_canvas_polyline_get_extent (polyline_data, &extent); g_value_set_double (value, extent.x2 - extent.x1); break; case PROP_HEIGHT: goo_canvas_polyline_get_extent (polyline_data, &extent); g_value_set_double (value, extent.y2 - extent.y1); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_polyline_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasPolyline *polyline = (GooCanvasPolyline*) object; goo_canvas_polyline_get_common_property (object, polyline->polyline_data, prop_id, value, pspec); } static void ensure_arrow_data (GooCanvasPolylineData *polyline_data) { if (!polyline_data->arrow_data) { polyline_data->arrow_data = g_slice_new (GooCanvasPolylineArrowData); /* These seem like reasonable defaults for the arrow dimensions. They are specified in multiples of the line width so they scale OK. */ polyline_data->arrow_data->arrow_width = 4.0; polyline_data->arrow_data->arrow_length = 5.0; polyline_data->arrow_data->arrow_tip_length = 4.0; } } #define GOO_CANVAS_EPSILON 1e-10 static void reconfigure_arrow (GooCanvasPolylineData *polyline_data, gint end_point, gint prev_point, gdouble line_width, gdouble *line_coords, gdouble *arrow_coords) { GooCanvasPolylineArrowData *arrow = polyline_data->arrow_data; double dx, dy, length, sin_theta, cos_theta; double half_arrow_width, arrow_length, arrow_tip_length; double arrow_end_center_x, arrow_end_center_y; double arrow_tip_center_x, arrow_tip_center_y; double x_offset, y_offset, half_line_width, line_trim; dx = polyline_data->coords[prev_point] - polyline_data->coords[end_point]; dy = polyline_data->coords[prev_point + 1] - polyline_data->coords[end_point + 1]; length = sqrt (dx * dx + dy * dy); if (length < GOO_CANVAS_EPSILON) { /* The length is too short to reliably get the angle so just guess. */ sin_theta = 1.0; cos_theta = 0.0; } else { /* Calculate a unit vector moving from the arrow point along the line. */ sin_theta = dy / length; cos_theta = dx / length; } /* These are all specified in multiples of the line width, so convert. */ half_arrow_width = arrow->arrow_width * line_width / 2; arrow_length = arrow->arrow_length * line_width; arrow_tip_length = arrow->arrow_tip_length * line_width; /* The arrow tip is at the end point of the line. */ arrow_coords[0] = polyline_data->coords[end_point]; arrow_coords[1] = polyline_data->coords[end_point + 1]; /* Calculate the end of the arrow, along the center line. */ arrow_end_center_x = arrow_coords[0] + (arrow_length * cos_theta); arrow_end_center_y = arrow_coords[1] + (arrow_length * sin_theta); /* Now calculate the 2 end points of the arrow either side of the line. */ x_offset = half_arrow_width * sin_theta; y_offset = half_arrow_width * cos_theta; arrow_coords[2] = arrow_end_center_x + x_offset; arrow_coords[3] = arrow_end_center_y - y_offset; arrow_coords[8] = arrow_end_center_x - x_offset; arrow_coords[9] = arrow_end_center_y + y_offset; /* Calculate the end of the arrow tip, along the center line. */ arrow_tip_center_x = arrow_coords[0] + (arrow_tip_length * cos_theta); arrow_tip_center_y = arrow_coords[1] + (arrow_tip_length * sin_theta); /* Now calculate the 2 arrow points on either edge of the line. */ half_line_width = line_width / 2.0; x_offset = half_line_width * sin_theta; y_offset = half_line_width * cos_theta; arrow_coords[4] = arrow_tip_center_x + x_offset; arrow_coords[5] = arrow_tip_center_y - y_offset; arrow_coords[6] = arrow_tip_center_x - x_offset; arrow_coords[7] = arrow_tip_center_y + y_offset; /* Calculate the new end of the line. We have to move it back slightly so it doesn't draw over the arrow tip. But we overlap the arrow by a small fraction of the line width to avoid a tiny gap. */ line_trim = arrow_tip_length - (line_width / 10.0); line_coords[0] = arrow_coords[0] + (line_trim * cos_theta); line_coords[1] = arrow_coords[1] + (line_trim * sin_theta); } /* Recalculates the arrow polygons for the line */ static void goo_canvas_polyline_reconfigure_arrows (GooCanvasPolyline *polyline) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) polyline; GooCanvasPolylineData *polyline_data = polyline->polyline_data; double line_width; if (!polyline_data->reconfigure_arrows) return; polyline_data->reconfigure_arrows = FALSE; if (polyline_data->num_points < 2 || (!polyline_data->start_arrow && !polyline_data->end_arrow)) return; line_width = goo_canvas_item_simple_get_line_width (simple); ensure_arrow_data (polyline_data); if (polyline_data->start_arrow) reconfigure_arrow (polyline_data, 0, 2, line_width, polyline_data->arrow_data->line_start, polyline_data->arrow_data->start_arrow_coords); if (polyline_data->end_arrow) { int end_point, prev_point; if (polyline_data->close_path) { end_point = 0; prev_point = polyline_data->num_points - 1; } else { end_point = polyline_data->num_points - 1; prev_point = polyline_data->num_points - 2; } reconfigure_arrow (polyline_data, end_point * 2, prev_point * 2, line_width, polyline_data->arrow_data->line_end, polyline_data->arrow_data->end_arrow_coords); } } static void goo_canvas_polyline_set_common_property (GObject *object, GooCanvasPolylineData *polyline_data, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasPoints *points; GooCanvasBounds extent; gdouble x_offset, y_offset, x_scale, y_scale; guint i; switch (prop_id) { case PROP_POINTS: points = g_value_get_boxed (value); if (polyline_data->coords) { g_slice_free1 (polyline_data->num_points * 2 * sizeof (double), polyline_data->coords); polyline_data->coords = NULL; } if (!points) { polyline_data->num_points = 0; } else { polyline_data->num_points = points->num_points; polyline_data->coords = g_slice_alloc (polyline_data->num_points * 2 * sizeof (double)); memcpy (polyline_data->coords, points->coords, polyline_data->num_points * 2 * sizeof (double)); } polyline_data->reconfigure_arrows = TRUE; g_object_notify (object, "x"); g_object_notify (object, "y"); g_object_notify (object, "width"); g_object_notify (object, "height"); break; case PROP_CLOSE_PATH: polyline_data->close_path = g_value_get_boolean (value); polyline_data->reconfigure_arrows = TRUE; break; case PROP_START_ARROW: polyline_data->start_arrow = g_value_get_boolean (value); polyline_data->reconfigure_arrows = TRUE; break; case PROP_END_ARROW: polyline_data->end_arrow = g_value_get_boolean (value); polyline_data->reconfigure_arrows = TRUE; break; case PROP_ARROW_LENGTH: ensure_arrow_data (polyline_data); polyline_data->arrow_data->arrow_length = g_value_get_double (value); polyline_data->reconfigure_arrows = TRUE; break; case PROP_ARROW_WIDTH: ensure_arrow_data (polyline_data); polyline_data->arrow_data->arrow_width = g_value_get_double (value); polyline_data->reconfigure_arrows = TRUE; break; case PROP_ARROW_TIP_LENGTH: ensure_arrow_data (polyline_data); polyline_data->arrow_data->arrow_tip_length = g_value_get_double (value); polyline_data->reconfigure_arrows = TRUE; break; case PROP_X: if (polyline_data->num_points > 0) { /* Calculate the x offset from the current position. */ goo_canvas_polyline_get_extent (polyline_data, &extent); x_offset = g_value_get_double (value) - extent.x1; /* Add the offset to all the x coordinates. */ for (i = 0; i < polyline_data->num_points; i++) polyline_data->coords[2 * i] += x_offset; g_object_notify (object, "points"); } break; case PROP_Y: if (polyline_data->num_points > 0) { /* Calculate the y offset from the current position. */ goo_canvas_polyline_get_extent (polyline_data, &extent); y_offset = g_value_get_double (value) - extent.y1; /* Add the offset to all the y coordinates. */ for (i = 0; i < polyline_data->num_points; i++) polyline_data->coords[2 * i + 1] += y_offset; g_object_notify (object, "points"); } break; case PROP_WIDTH: if (polyline_data->num_points >= 2) { goo_canvas_polyline_get_extent (polyline_data, &extent); if (extent.x2 - extent.x1 != 0.0) { /* Calculate the amount to scale the polyline. */ x_scale = g_value_get_double (value) / (extent.x2 - extent.x1); /* Scale the x coordinates, relative to the left-most point. */ for (i = 0; i < polyline_data->num_points; i++) polyline_data->coords[2 * i] = extent.x1 + (polyline_data->coords[2 * i] - extent.x1) * x_scale; g_object_notify (object, "points"); } } break; case PROP_HEIGHT: if (polyline_data->num_points >= 2) { goo_canvas_polyline_get_extent (polyline_data, &extent); if (extent.y2 - extent.y1 != 0.0) { /* Calculate the amount to scale the polyline. */ y_scale = g_value_get_double (value) / (extent.y2 - extent.y1); /* Scale the y coordinates, relative to the top-most point. */ for (i = 0; i < polyline_data->num_points; i++) polyline_data->coords[2 * i + 1] = extent.y1 + (polyline_data->coords[2 * i + 1] - extent.y1) * y_scale; g_object_notify (object, "points"); } } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_polyline_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPolyline *polyline = (GooCanvasPolyline*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_polyline_set_common_property (object, polyline->polyline_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } /** * goo_canvas_polyline_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @close_path: if the last point should be connected to the first. * @num_points: the number of points in the polyline. * @...: the pairs of coordinates for each point in the line, followed by * optional pairs of property names and values, and a terminating %NULL. * * Creates a new polyline item. * * * * Here's an example showing how to create a filled triangle with vertices * at (100,100), (300,100), and (200,300). * * * GooCanvasItem *polyline = goo_canvas_polyline_new (mygroup, TRUE, 3, * 100.0, 100.0, * 300.0, 100.0, * 200.0, 300.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new polyline item. **/ GooCanvasItem* goo_canvas_polyline_new (GooCanvasItem *parent, gboolean close_path, gint num_points, ...) { GooCanvasItem *item; GooCanvasPolyline *polyline; GooCanvasPolylineData *polyline_data; const char *first_property; va_list var_args; gint i; item = g_object_new (GOO_TYPE_CANVAS_POLYLINE, NULL); polyline = (GooCanvasPolyline*) item; polyline_data = polyline->polyline_data; polyline_data->close_path = close_path; polyline_data->num_points = num_points; if (num_points) polyline_data->coords = g_slice_alloc (num_points * 2 * sizeof (gdouble)); va_start (var_args, num_points); for (i = 0; i < num_points * 2; i++) polyline_data->coords[i] = va_arg (var_args, gdouble); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /** * goo_canvas_polyline_new_line: * @parent: the parent item, or %NULL. * @x1: the x coordinate of the start of the line. * @y1: the y coordinate of the start of the line. * @x2: the x coordinate of the end of the line. * @y2: the y coordinate of the end of the line. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new polyline item with a single line. * * * * Here's an example showing how to create a line from (100,100) to (300,300). * * * GooCanvasItem *polyline = goo_canvas_polyline_new_line (mygroup, * 100.0, 100.0, * 300.0, 300.0, * "stroke-color", "red", * "line-width", 5.0, * NULL); * * * Returns: a new polyline item. **/ GooCanvasItem* goo_canvas_polyline_new_line (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...) { GooCanvasItem *item; GooCanvasPolyline *polyline; GooCanvasPolylineData *polyline_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_POLYLINE, NULL); polyline = (GooCanvasPolyline*) item; polyline_data = polyline->polyline_data; polyline_data->close_path = FALSE; polyline_data->num_points = 2; polyline_data->coords = g_slice_alloc (4 * sizeof (gdouble)); polyline_data->coords[0] = x1; polyline_data->coords[1] = y1; polyline_data->coords[2] = x2; polyline_data->coords[3] = y2; va_start (var_args, y2); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_polyline_create_path (GooCanvasPolyline *polyline, cairo_t *cr) { GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasPolylineArrowData *arrow = polyline_data->arrow_data; gint i; cairo_new_path (cr); if (polyline_data->num_points == 0) return; /* If there is an arrow at the start of the polyline, we need to move the start of the line slightly to avoid drawing over the arrow tip. */ if (polyline_data->start_arrow && polyline_data->num_points >= 2) cairo_move_to (cr, arrow->line_start[0], arrow->line_start[1]); else cairo_move_to (cr, polyline_data->coords[0], polyline_data->coords[1]); if (polyline_data->end_arrow && polyline_data->num_points >= 2) { gint last_point = polyline_data->num_points - 1; if (!polyline_data->close_path) last_point--; for (i = 1; i <= last_point; i++) cairo_line_to (cr, polyline_data->coords[i * 2], polyline_data->coords[i * 2 + 1]); cairo_line_to (cr, arrow->line_end[0], arrow->line_end[1]); } else { for (i = 1; i < polyline_data->num_points; i++) cairo_line_to (cr, polyline_data->coords[i * 2], polyline_data->coords[i * 2 + 1]); if (polyline_data->close_path) cairo_close_path (cr); } } static void goo_canvas_polyline_create_start_arrow_path (GooCanvasPolyline *polyline, cairo_t *cr) { GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasPolylineArrowData *arrow = polyline_data->arrow_data; gint i; cairo_new_path (cr); if (polyline_data->num_points < 2) return; cairo_move_to (cr, arrow->start_arrow_coords[0], arrow->start_arrow_coords[1]); for (i = 1; i < NUM_ARROW_POINTS; i++) { cairo_line_to (cr, arrow->start_arrow_coords[i * 2], arrow->start_arrow_coords[i * 2 + 1]); } cairo_close_path (cr); } static void goo_canvas_polyline_create_end_arrow_path (GooCanvasPolyline *polyline, cairo_t *cr) { GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasPolylineArrowData *arrow = polyline_data->arrow_data; gint i; cairo_new_path (cr); if (polyline_data->num_points < 2) return; cairo_move_to (cr, arrow->end_arrow_coords[0], arrow->end_arrow_coords[1]); for (i = 1; i < NUM_ARROW_POINTS; i++) { cairo_line_to (cr, arrow->end_arrow_coords[i * 2], arrow->end_arrow_coords[i * 2 + 1]); } cairo_close_path (cr); } static gboolean goo_canvas_polyline_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPolyline *polyline = (GooCanvasPolyline*) simple; GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasPointerEvents pointer_events = GOO_CANVAS_EVENTS_ALL; gboolean do_stroke; if (polyline_data->num_points == 0) return FALSE; /* Check if the item should receive events. */ if (is_pointer_event) pointer_events = simple_data->pointer_events; /* If the path isn't closed, we never check the fill. */ if (!(polyline_data->close_path && polyline_data->num_points > 2)) pointer_events &= ~GOO_CANVAS_EVENTS_FILL_MASK; goo_canvas_polyline_create_path (polyline, cr); if (goo_canvas_item_simple_check_in_path (simple, x, y, cr, pointer_events)) return TRUE; /* Check the arrows, if the polyline has them. */ if ((polyline_data->start_arrow || polyline_data->end_arrow) && polyline_data->num_points >= 2 && (pointer_events & GOO_CANVAS_EVENTS_STROKE_MASK)) { /* We use the stroke pattern to match the style of the line. */ do_stroke = goo_canvas_style_set_stroke_options (simple_data->style, cr); if (!(pointer_events & GOO_CANVAS_EVENTS_PAINTED_MASK) || do_stroke) { if (polyline_data->start_arrow) { goo_canvas_polyline_create_start_arrow_path (polyline, cr); if (cairo_in_fill (cr, x, y)) return TRUE; } if (polyline_data->end_arrow) { goo_canvas_polyline_create_end_arrow_path (polyline, cr); if (cairo_in_fill (cr, x, y)) return TRUE; } } } return FALSE; } static void goo_canvas_polyline_compute_bounds (GooCanvasPolyline *polyline, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) polyline; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPolylineData *polyline_data = polyline->polyline_data; GooCanvasBounds tmp_bounds; cairo_matrix_t transform; if (polyline_data->num_points == 0) { bounds->x1 = bounds->x2 = bounds->y1 = bounds->y2 = 0.0; return; } /* Use the identity matrix to get the bounds completely in user space. */ cairo_get_matrix (cr, &transform); cairo_identity_matrix (cr); goo_canvas_polyline_create_path (polyline, cr); goo_canvas_item_simple_get_path_bounds (simple, cr, bounds); /* Add on the arrows, if required. */ if ((polyline_data->start_arrow || polyline_data->end_arrow) && polyline_data->num_points >= 2) { /* We use the stroke pattern to match the style of the line. */ goo_canvas_style_set_stroke_options (simple_data->style, cr); if (polyline_data->start_arrow) { goo_canvas_polyline_create_start_arrow_path (polyline, cr); cairo_fill_extents (cr, &tmp_bounds.x1, &tmp_bounds.y1, &tmp_bounds.x2, &tmp_bounds.y2); bounds->x1 = MIN (bounds->x1, tmp_bounds.x1); bounds->y1 = MIN (bounds->y1, tmp_bounds.y1); bounds->x2 = MAX (bounds->x2, tmp_bounds.x2); bounds->y2 = MAX (bounds->y2, tmp_bounds.y2); } if (polyline_data->end_arrow) { goo_canvas_polyline_create_end_arrow_path (polyline, cr); cairo_fill_extents (cr, &tmp_bounds.x1, &tmp_bounds.y1, &tmp_bounds.x2, &tmp_bounds.y2); bounds->x1 = MIN (bounds->x1, tmp_bounds.x1); bounds->y1 = MIN (bounds->y1, tmp_bounds.y1); bounds->x2 = MAX (bounds->x2, tmp_bounds.x2); bounds->y2 = MAX (bounds->y2, tmp_bounds.y2); } } cairo_set_matrix (cr, &transform); } static void goo_canvas_polyline_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasPolyline *polyline = (GooCanvasPolyline*) simple; GooCanvasPolylineData *polyline_data = polyline->polyline_data; if (polyline_data->reconfigure_arrows) goo_canvas_polyline_reconfigure_arrows (polyline); /* Compute the new bounds. */ goo_canvas_polyline_compute_bounds (polyline, cr, &simple->bounds); } static void goo_canvas_polyline_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPolyline *polyline = (GooCanvasPolyline*) simple; GooCanvasPolylineData *polyline_data = polyline->polyline_data; if (polyline_data->num_points == 0) return; goo_canvas_polyline_create_path (polyline, cr); goo_canvas_item_simple_paint_path (simple, cr); /* Paint the arrows, if required. */ if ((polyline_data->start_arrow || polyline_data->end_arrow) && polyline_data->num_points >= 2) { /* We use the stroke pattern to match the style of the line. */ goo_canvas_style_set_stroke_options (simple_data->style, cr); if (polyline_data->start_arrow) { goo_canvas_polyline_create_start_arrow_path (polyline, cr); cairo_fill (cr); } if (polyline_data->end_arrow) { goo_canvas_polyline_create_end_arrow_path (polyline, cr); cairo_fill (cr); } } } static void goo_canvas_polyline_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasPolyline *polyline = (GooCanvasPolyline*) item; GooCanvasPolylineModel *pmodel = (GooCanvasPolylineModel*) model; /* If our polyline_data was allocated, free it. */ if (!simple->model) g_slice_free (GooCanvasPolylineData, polyline->polyline_data); /* Now use the new model's polyline_data instead. */ polyline->polyline_data = &pmodel->polyline_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_polyline_set_model; } static void goo_canvas_polyline_class_init (GooCanvasPolylineClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->finalize = goo_canvas_polyline_finalize; gobject_class->get_property = goo_canvas_polyline_get_property; gobject_class->set_property = goo_canvas_polyline_set_property; simple_class->simple_update = goo_canvas_polyline_update; simple_class->simple_paint = goo_canvas_polyline_paint; simple_class->simple_is_item_at = goo_canvas_polyline_is_item_at; goo_canvas_polyline_install_common_properties (gobject_class); } /** * SECTION:goocanvaspolylinemodel * @Title: GooCanvasPolylineModel * @Short_Description: a model for polyline items (a series of lines with * optional arrows). * * GooCanvasPolylineModel represents a model for polyline items, which are a * series of one or more lines, with optional arrows at either end. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasPolylineModel use goo_canvas_polyline_model_new(), or * goo_canvas_polyline_model_new_line() for a simple line between two points. * * To get or set the properties of an existing #GooCanvasPolylineModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the polyline you must connect * to the signal handlers of the corresponding #GooCanvasPolyline objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_polyline_model_finalize (GObject *object); static void goo_canvas_polyline_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_polyline_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasPolylineModel, goo_canvas_polyline_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_polyline_model_class_init (GooCanvasPolylineModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->finalize = goo_canvas_polyline_model_finalize; gobject_class->get_property = goo_canvas_polyline_model_get_property; gobject_class->set_property = goo_canvas_polyline_model_set_property; goo_canvas_polyline_install_common_properties (gobject_class); } static void goo_canvas_polyline_model_init (GooCanvasPolylineModel *pmodel) { } /** * goo_canvas_polyline_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @close_path: if the last point should be connected to the first. * @num_points: the number of points in the polyline. * @...: the pairs of coordinates for each point in the line, followed by * optional pairs of property names and values, and a terminating %NULL. * * Creates a new polyline model. * * * * Here's an example showing how to create a filled triangle with vertices * at (100,100), (300,100), and (200,300). * * * GooCanvasItemModel *polyline = goo_canvas_polyline_model_new (mygroup, TRUE, 3, * 100.0, 100.0, * 300.0, 100.0, * 200.0, 300.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new polyline model. **/ GooCanvasItemModel* goo_canvas_polyline_model_new (GooCanvasItemModel *parent, gboolean close_path, gint num_points, ...) { GooCanvasItemModel *model; GooCanvasPolylineModel *pmodel; GooCanvasPolylineData *polyline_data; const char *first_property; va_list var_args; gint i; model = g_object_new (GOO_TYPE_CANVAS_POLYLINE_MODEL, NULL); pmodel = (GooCanvasPolylineModel*) model; polyline_data = &pmodel->polyline_data; polyline_data->close_path = close_path; polyline_data->num_points = num_points; if (num_points) polyline_data->coords = g_slice_alloc (num_points * 2 * sizeof (gdouble)); va_start (var_args, num_points); for (i = 0; i < num_points * 2; i++) polyline_data->coords[i] = va_arg (var_args, gdouble); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } /** * goo_canvas_polyline_model_new_line: * @parent: the parent model, or %NULL. * @x1: the x coordinate of the start of the line. * @y1: the y coordinate of the start of the line. * @x2: the x coordinate of the end of the line. * @y2: the y coordinate of the end of the line. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new polyline model with a single line. * * * * Here's an example showing how to create a line from (100,100) to (300,300). * * * GooCanvasItemModel *polyline = goo_canvas_polyline_model_new_line (mygroup, * 100.0, 100.0, * 300.0, 300.0, * "stroke-color", "red", * "line-width", 5.0, * NULL); * * * Returns: a new polyline model. **/ GooCanvasItemModel* goo_canvas_polyline_model_new_line (GooCanvasItemModel *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...) { GooCanvasItemModel *model; GooCanvasPolylineModel *pmodel; GooCanvasPolylineData *polyline_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_POLYLINE_MODEL, NULL); pmodel = (GooCanvasPolylineModel*) model; polyline_data = &pmodel->polyline_data; polyline_data->close_path = FALSE; polyline_data->num_points = 2; polyline_data->coords = g_slice_alloc (4 * sizeof (gdouble)); polyline_data->coords[0] = x1; polyline_data->coords[1] = y1; polyline_data->coords[2] = x2; polyline_data->coords[3] = y2; va_start (var_args, y2); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_polyline_model_finalize (GObject *object) { GooCanvasPolylineModel *pmodel = (GooCanvasPolylineModel*) object; g_slice_free1 (pmodel->polyline_data.num_points * 2 * sizeof (gdouble), pmodel->polyline_data.coords); g_slice_free (GooCanvasPolylineArrowData, pmodel->polyline_data.arrow_data); G_OBJECT_CLASS (goo_canvas_polyline_model_parent_class)->finalize (object); } static void goo_canvas_polyline_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasPolylineModel *pmodel = (GooCanvasPolylineModel*) object; goo_canvas_polyline_get_common_property (object, &pmodel->polyline_data, prop_id, value, pspec); } static void goo_canvas_polyline_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasPolylineModel *pmodel = (GooCanvasPolylineModel*) object; goo_canvas_polyline_set_common_property (object, &pmodel->polyline_data, prop_id, value, pspec); g_signal_emit_by_name (pmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_polyline_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_POLYLINE, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_polyline_model_create_item; } goocanvas-0.15/src/goocanvasrect.h0000644000076400007640000000720511172574677014173 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasrect.h - rectangle item. */ #ifndef __GOO_CANVAS_RECT_H__ #define __GOO_CANVAS_RECT_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasRectData GooCanvasRectData; struct _GooCanvasRectData { gdouble x, y, width, height, radius_x, radius_y; }; #define GOO_TYPE_CANVAS_RECT (goo_canvas_rect_get_type ()) #define GOO_CANVAS_RECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_RECT, GooCanvasRect)) #define GOO_CANVAS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_RECT, GooCanvasRectClass)) #define GOO_IS_CANVAS_RECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_RECT)) #define GOO_IS_CANVAS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_RECT)) #define GOO_CANVAS_RECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_RECT, GooCanvasRectClass)) typedef struct _GooCanvasRect GooCanvasRect; typedef struct _GooCanvasRectClass GooCanvasRectClass; /** * GooCanvasRect * * The #GooCanvasRect-struct struct contains private data only. */ struct _GooCanvasRect { GooCanvasItemSimple parent; GooCanvasRectData *rect_data; }; struct _GooCanvasRectClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_rect_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); #define GOO_TYPE_CANVAS_RECT_MODEL (goo_canvas_rect_model_get_type ()) #define GOO_CANVAS_RECT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_RECT_MODEL, GooCanvasRectModel)) #define GOO_CANVAS_RECT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_RECT_MODEL, GooCanvasRectModelClass)) #define GOO_IS_CANVAS_RECT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_RECT_MODEL)) #define GOO_IS_CANVAS_RECT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_RECT_MODEL)) #define GOO_CANVAS_RECT_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_RECT_MODEL, GooCanvasRectModelClass)) typedef struct _GooCanvasRectModel GooCanvasRectModel; typedef struct _GooCanvasRectModelClass GooCanvasRectModelClass; /** * GooCanvasRectModel * * The #GooCanvasRectModel-struct struct contains private data only. */ struct _GooCanvasRectModel { GooCanvasItemModelSimple parent_object; GooCanvasRectData rect_data; }; struct _GooCanvasRectModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_rect_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_rect_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, ...); G_END_DECLS #endif /* __GOO_CANVAS_RECT_H__ */ goocanvas-0.15/src/goocanvasitemmodel.c0000644000076400007640000010576411172574677015221 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitem.c - interface for canvas items & groups. */ /** * SECTION:goocanvasitemmodel * @Title: GooCanvasItemModel * @Short_Description: the interface for canvas item models. * * #GooCanvasItemModel defines the interface that models for canvas items must * implement, and contains methods for operating on canvas item models. */ #include #include #include #include #include #include #include "goocanvasprivate.h" #include #include "goocanvasitemmodel.h" #include "goocanvasutils.h" #include "goocanvasmarshal.h" static GParamSpecPool *_goo_canvas_item_model_child_property_pool = NULL; static GObjectNotifyContext *_goo_canvas_item_model_child_property_notify_context = NULL; static const char *animation_key = "GooCanvasItemAnimation"; enum { CHILD_ADDED, CHILD_MOVED, CHILD_REMOVED, CHANGED, CHILD_NOTIFY, ANIMATION_FINISHED, LAST_SIGNAL }; static guint item_model_signals[LAST_SIGNAL] = { 0 }; static void goo_canvas_item_model_base_init (gpointer g_class); extern void _goo_canvas_style_init (void); extern void _goo_canvas_item_get_child_property_internal (GObject *object, GObject *child, const gchar *property_name, GValue *value, GParamSpecPool *property_pool, gboolean is_model); GType goo_canvas_item_model_get_type (void) { static GType item_model_type = 0; if (!item_model_type) { static const GTypeInfo item_model_info = { sizeof (GooCanvasItemModelIface), /* class_size */ goo_canvas_item_model_base_init, /* base_init */ NULL, /* base_finalize */ }; item_model_type = g_type_register_static (G_TYPE_INTERFACE, "GooCanvasItemModel", &item_model_info, 0); g_type_interface_add_prerequisite (item_model_type, G_TYPE_OBJECT); } return item_model_type; } static void child_property_notify_dispatcher (GObject *object, guint n_pspecs, GParamSpec **pspecs) { guint i; for (i = 0; i < n_pspecs; i++) g_signal_emit (object, item_model_signals[CHILD_NOTIFY], g_quark_from_string (pspecs[i]->name), pspecs[i]); } static void goo_canvas_item_model_base_init (gpointer g_iface) { static GObjectNotifyContext cpn_context = { 0, NULL, NULL }; static gboolean initialized = FALSE; if (!initialized) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); _goo_canvas_item_model_child_property_pool = g_param_spec_pool_new (TRUE); cpn_context.quark_notify_queue = g_quark_from_static_string ("GooCanvasItemModel-child-property-notify-queue"); cpn_context.dispatcher = child_property_notify_dispatcher; _goo_canvas_item_model_child_property_notify_context = &cpn_context; /** * GooCanvasItemModel::child-added * @model: the item model that received the signal. * @child_num: the index of the new child. * * Emitted when a child has been added. */ item_model_signals[CHILD_ADDED] = g_signal_new ("child-added", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, child_added), NULL, NULL, goo_canvas_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); /** * GooCanvasItemModel::child-moved * @model: the item model that received the signal. * @old_child_num: the old index of the child. * @new_child_num: the new index of the child. * * Emitted when a child has been moved in the stacking order. */ item_model_signals[CHILD_MOVED] = g_signal_new ("child-moved", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, child_moved), NULL, NULL, goo_canvas_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); /** * GooCanvasItemModel::child-removed * @model: the item model that received the signal. * @child_num: the index of the child that was removed. * * Emitted when a child has been removed. */ item_model_signals[CHILD_REMOVED] = g_signal_new ("child-removed", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, child_removed), NULL, NULL, goo_canvas_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); /** * GooCanvasItemModel::changed * @model: the item model that received the signal. * @recompute_bounds: if the bounds of the item need to be recomputed. * * Emitted when the item model has been changed. */ item_model_signals[CHANGED] = g_signal_new ("changed", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, changed), NULL, NULL, goo_canvas_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); /** * GooCanvasItemModel::child-notify * @item: the item model that received the signal. * @pspec: the #GParamSpec of the changed child property. * * Emitted for each child property that has changed. * The signal's detail holds the property name. */ item_model_signals[CHILD_NOTIFY] = g_signal_new ("child_notify", iface_type, G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (GooCanvasItemModelIface, child_notify), NULL, NULL, g_cclosure_marshal_VOID__PARAM, G_TYPE_NONE, 1, G_TYPE_PARAM); /** * GooCanvasItemModel::animation-finished * @item: the item model that received the signal. * @stopped: if the animation was explicitly stopped. * * Emitted when the item model animation has finished. */ item_model_signals[ANIMATION_FINISHED] = g_signal_new ("animation-finished", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemModelIface, animation_finished), NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); g_object_interface_install_property (g_iface, g_param_spec_object ("parent", _("Parent"), _("The parent item model"), GOO_TYPE_CANVAS_ITEM_MODEL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_enum ("visibility", _("Visibility"), _("When the canvas item is visible"), GOO_TYPE_CANVAS_ITEM_VISIBILITY, GOO_CANVAS_ITEM_VISIBLE, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_double ("visibility-threshold", _("Visibility Threshold"), _("The scale threshold at which the item becomes visible"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_boxed ("transform", _("Transform"), _("The transformation matrix of the item"), GOO_TYPE_CAIRO_MATRIX, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_flags ("pointer-events", _("Pointer Events"), _("Specifies when the item receives pointer events"), GOO_TYPE_CANVAS_POINTER_EVENTS, GOO_CANVAS_EVENTS_VISIBLE_PAINTED, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("title", _("Title"), _("A short context-rich description of the item for use by assistive technologies"), NULL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("description", _("Description"), _("A description of the item for use by assistive technologies"), NULL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_boolean ("can-focus", _("Can Focus"), _("If the item can take the keyboard focus"), FALSE, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("tooltip", _("Tooltip"), _("The tooltip to display for the item"), NULL, G_PARAM_READWRITE)); _goo_canvas_style_init (); initialized = TRUE; } } /** * goo_canvas_item_model_add_child: * @model: an item model. * @child: the child to add. * @position: the position of the child, or -1 to place it last (at the top of * the stacking order). * * Adds a child at the given stack position. **/ void goo_canvas_item_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); g_return_if_fail (iface->add_child != NULL); g_return_if_fail (model != child); iface->add_child (model, child, position); } /** * goo_canvas_item_model_move_child: * @model: an item model. * @old_position: the current position of the child. * @new_position: the new position of the child. * * Moves a child to a new stack position. **/ void goo_canvas_item_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); g_return_if_fail (iface->move_child != NULL); iface->move_child (model, old_position, new_position); } /** * goo_canvas_item_model_remove_child: * @model: an item model. * @child_num: the position of the child to remove. * * Removes the child at the given position. **/ void goo_canvas_item_model_remove_child (GooCanvasItemModel *model, gint child_num) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); g_return_if_fail (iface->remove_child != NULL); iface->remove_child (model, child_num); } /** * goo_canvas_item_model_find_child: * @model: an item model. * @child: the child to find. * * Attempts to find the given child with the container's stack. * * Returns: the position of the given @child, or -1 if it isn't found. **/ gint goo_canvas_item_model_find_child (GooCanvasItemModel *model, GooCanvasItemModel *child) { GooCanvasItemModel *item; int n_children, i; /* Find the current position of item and above. */ n_children = goo_canvas_item_model_get_n_children (model); for (i = 0; i < n_children; i++) { item = goo_canvas_item_model_get_child (model, i); if (child == item) return i; } return -1; } /** * goo_canvas_item_model_is_container: * @model: an item model. * * Tests to see if the given item model is a container. * * Returns: %TRUE if the item model is a container. **/ gboolean goo_canvas_item_model_is_container (GooCanvasItemModel *model) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_n_children ? TRUE : FALSE; } /** * goo_canvas_item_model_get_n_children: * @model: an item model. * * Gets the number of children of the container. * * Returns: the number of children. **/ gint goo_canvas_item_model_get_n_children (GooCanvasItemModel *model) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_n_children ? iface->get_n_children (model) : 0; } /** * goo_canvas_item_model_get_child: * @model: an item model. * @child_num: the position of a child in the container's stack. * * Gets the child at the given stack position. * * Returns: the child at the given stack position, or %NULL if @child_num * is out of range. **/ GooCanvasItemModel* goo_canvas_item_model_get_child (GooCanvasItemModel *model, gint child_num) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_child ? iface->get_child (model, child_num) : NULL; } /** * goo_canvas_item_model_get_parent: * @model: an item model. * * Gets the parent of the given model. * * Returns: the parent model, or %NULL if the model has no parent. **/ GooCanvasItemModel* goo_canvas_item_model_get_parent (GooCanvasItemModel *model) { return GOO_CANVAS_ITEM_MODEL_GET_IFACE (model)->get_parent (model); } /** * goo_canvas_item_model_set_parent: * @model: an item model. * @parent: the new parent item model. * * This function is only intended to be used when implementing new canvas * item models (specifically container models such as #GooCanvasGroupModel). * It sets the parent of the child model. * * * This function cannot be used to add a model to a group * or to change the parent of a model. * To do that use the #GooCanvasItemModel:parent property. * **/ void goo_canvas_item_model_set_parent (GooCanvasItemModel *model, GooCanvasItemModel *parent) { GOO_CANVAS_ITEM_MODEL_GET_IFACE (model)->set_parent (model, parent); } /** * goo_canvas_item_model_remove: * @model: an item model. * * Removes a model from its parent. If the model is in a canvas it will be * removed. * * This would normally also result in the model being freed. **/ void goo_canvas_item_model_remove (GooCanvasItemModel *model) { GooCanvasItemModel *parent; gint child_num; parent = goo_canvas_item_model_get_parent (model); if (!parent) return; child_num = goo_canvas_item_model_find_child (parent, model); if (child_num == -1) return; goo_canvas_item_model_remove_child (parent, child_num); } /** * goo_canvas_item_model_raise: * @model: an item model. * @above: the item model to raise @model above, or %NULL to raise @model to the top * of the stack. * * Raises a model in the stacking order. **/ void goo_canvas_item_model_raise (GooCanvasItemModel *model, GooCanvasItemModel *above) { GooCanvasItemModel *parent, *child; int n_children, i, model_pos = -1, above_pos = -1; parent = goo_canvas_item_model_get_parent (model); if (!parent || model == above) return; /* Find the current position of model and above. */ n_children = goo_canvas_item_model_get_n_children (parent); for (i = 0; i < n_children; i++) { child = goo_canvas_item_model_get_child (parent, i); if (child == model) model_pos = i; if (child == above) above_pos = i; } /* If above is NULL we raise the model to the top of the stack. */ if (!above) above_pos = n_children - 1; g_return_if_fail (model_pos != -1); g_return_if_fail (above_pos != -1); /* Only move the model if the new position is higher in the stack. */ if (above_pos > model_pos) goo_canvas_item_model_move_child (parent, model_pos, above_pos); } /** * goo_canvas_item_model_lower: * @model: an item model. * @below: the item model to lower @model below, or %NULL to lower @model to the * bottom of the stack. * * Lowers a model in the stacking order. **/ void goo_canvas_item_model_lower (GooCanvasItemModel *model, GooCanvasItemModel *below) { GooCanvasItemModel *parent, *child; int n_children, i, model_pos = -1, below_pos = -1; parent = goo_canvas_item_model_get_parent (model); if (!parent || model == below) return; /* Find the current position of model and below. */ n_children = goo_canvas_item_model_get_n_children (parent); for (i = 0; i < n_children; i++) { child = goo_canvas_item_model_get_child (parent, i); if (child == model) model_pos = i; if (child == below) below_pos = i; } /* If below is NULL we lower the model to the bottom of the stack. */ if (!below) below_pos = 0; g_return_if_fail (model_pos != -1); g_return_if_fail (below_pos != -1); /* Only move the model if the new position is lower in the stack. */ if (below_pos < model_pos) goo_canvas_item_model_move_child (parent, model_pos, below_pos); } /** * goo_canvas_item_model_get_transform: * @model: an item model. * @transform: the place to store the transform. * * Gets the transformation matrix of an item model. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_model_get_transform (GooCanvasItemModel *model, cairo_matrix_t *transform) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_transform ? iface->get_transform (model, transform) : FALSE; } /** * goo_canvas_item_model_set_transform: * @model: an item model. * @transform: the new transformation matrix, or %NULL to reset the * transformation to the identity matrix. * * Sets the transformation matrix of an item model. **/ void goo_canvas_item_model_set_transform (GooCanvasItemModel *model, const cairo_matrix_t *transform) { GOO_CANVAS_ITEM_MODEL_GET_IFACE (model)->set_transform (model, transform); } /** * goo_canvas_item_model_get_simple_transform: * @model: an item model. * @x: returns the x coordinate of the origin of the model's coordinate space. * @y: returns the y coordinate of the origin of the model's coordinate space. * @scale: returns the scale of the model. * @rotation: returns the clockwise rotation of the model, in degrees (0-360). * * This function can be used to get the position, scale and rotation of an * item model, providing that the model has a simple transformation matrix * (e.g. set with goo_canvas_item_model_set_simple_transform(), or using a * combination of simple translate, scale and rotate operations). If the model * has a complex transformation matrix the results will be incorrect. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_model_get_simple_transform (GooCanvasItemModel *model, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; double x1 = 1.0, y1 = 0.0, radians; gboolean has_transform = FALSE; if (iface->get_transform) has_transform = iface->get_transform (model, &matrix); if (!has_transform) { *x = *y = *rotation = 0.0; *scale = 1.0; return FALSE; } *x = matrix.x0; *y = matrix.y0; matrix.x0 = 0.0; matrix.y0 = 0.0; cairo_matrix_transform_point (&matrix, &x1, &y1); *scale = sqrt (x1 * x1 + y1 * y1); radians = atan2 (y1, x1); *rotation = radians * (180 / M_PI); if (*rotation < 0) *rotation += 360; return TRUE; } /** * goo_canvas_item_model_set_simple_transform: * @model: an item model. * @x: the x coordinate of the origin of the model's coordinate space. * @y: the y coordinate of the origin of the model's coordinate space. * @scale: the scale of the model. * @rotation: the clockwise rotation of the model, in degrees. * * A convenience function to set the item model's transformation matrix. **/ void goo_canvas_item_model_set_simple_transform (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble rotation) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; cairo_matrix_translate (&new_matrix, x, y); cairo_matrix_scale (&new_matrix, scale, scale); cairo_matrix_rotate (&new_matrix, rotation * (M_PI / 180)); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_translate: * @model: an item model. * @tx: the amount to move the origin in the horizontal direction. * @ty: the amount to move the origin in the vertical direction. * * Translates the origin of the model's coordinate system by the given amounts. **/ void goo_canvas_item_model_translate (GooCanvasItemModel *model, gdouble tx, gdouble ty) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; iface->get_transform (model, &new_matrix); cairo_matrix_translate (&new_matrix, tx, ty); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_scale: * @model: an item model. * @sx: the amount to scale the horizontal axis. * @sy: the amount to scale the vertical axis. * * Scales the model's coordinate system by the given amounts. **/ void goo_canvas_item_model_scale (GooCanvasItemModel *model, gdouble sx, gdouble sy) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; iface->get_transform (model, &new_matrix); cairo_matrix_scale (&new_matrix, sx, sy); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_rotate: * @model: an item model. * @degrees: the clockwise angle of rotation. * @cx: the x coordinate of the origin of the rotation. * @cy: the y coordinate of the origin of the rotation. * * Rotates the model's coordinate system by the given amount, about the given * origin. **/ void goo_canvas_item_model_rotate (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (model, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_rotate (&new_matrix, radians); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_skew_x: * @model: an item model. * @degrees: the skew angle. * @cx: the x coordinate of the origin of the skew transform. * @cy: the y coordinate of the origin of the skew transform. * * Skews the model's coordinate system along the x axis by the given amount, * about the given origin. **/ void goo_canvas_item_model_skew_x (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t tmp, new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (model, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_init (&tmp, 1, 0, tan (radians), 1, 0, 0); cairo_matrix_multiply (&new_matrix, &tmp, &new_matrix); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_skew_y: * @model: an item model. * @degrees: the skew angle. * @cx: the x coordinate of the origin of the skew transform. * @cy: the y coordinate of the origin of the skew transform. * * Skews the model's coordinate system along the y axis by the given amount, * about the given origin. **/ void goo_canvas_item_model_skew_y (GooCanvasItemModel *model, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); cairo_matrix_t tmp, new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (model, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_init (&tmp, 1, tan (radians), 0, 1, 0, 0); cairo_matrix_multiply (&new_matrix, &tmp, &new_matrix); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (model, &new_matrix); } /** * goo_canvas_item_model_get_style: * @model: an item model. * * Gets the model's style. If the model doesn't have its own style it will * return its parent's style. * * Returns: the model's style. **/ GooCanvasStyle* goo_canvas_item_model_get_style (GooCanvasItemModel *model) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); return iface->get_style ? iface->get_style (model) : NULL; } /** * goo_canvas_item_model_set_style: * @model: an item model. * @style: a style. * * Sets the model's style, by copying the properties from the given style. **/ void goo_canvas_item_model_set_style (GooCanvasItemModel *model, GooCanvasStyle *style) { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); if (iface->set_style) iface->set_style (model, style); } extern void _goo_canvas_item_animate_internal (GooCanvasItem *item, GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type); /** * goo_canvas_item_model_animate: * @model: an item model. * @x: the final x coordinate. * @y: the final y coordinate. * @scale: the final scale. * @degrees: the final rotation. This can be negative to rotate anticlockwise, * and can also be greater than 360 to rotate a number of times. * @absolute: if the @x, @y, @scale and @degrees values are absolute, or * relative to the current transform. Note that absolute animations only work * if the model currently has a simple transform. If the model has a shear or * some other complicated transform it may result in strange animations. * @duration: the duration of the animation, in milliseconds (1/1000ths of a * second). * @step_time: the time between each animation step, in milliseconds. * @type: specifies what happens when the animation finishes. * * Animates a model from its current position to the given offsets, scale * and rotation. **/ void goo_canvas_item_model_animate (GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type) { _goo_canvas_item_animate_internal (NULL, model, x, y, scale, degrees, absolute, duration, step_time, type); } /** * goo_canvas_item_model_stop_animation: * @model: an item model. * * Stops any current animation for the given model, leaving it at its current * position. **/ void goo_canvas_item_model_stop_animation (GooCanvasItemModel *model) { /* This will result in a call to goo_canvas_item_free_animation() above. */ g_object_set_data (G_OBJECT (model), animation_key, NULL); g_signal_emit_by_name (model, "animation-finished", TRUE); } /* * Child Properties. */ extern void _goo_canvas_item_set_child_property_internal (GObject *object, GObject *child, const gchar *property_name, const GValue *value, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model); extern void _goo_canvas_item_get_child_properties_internal (GObject *object, GObject *child, va_list var_args, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model); extern void _goo_canvas_item_set_child_properties_internal (GObject *object, GObject *child, va_list var_args, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model); /** * goo_canvas_item_model_get_child_property: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @property_name: the name of the child property to get. * @value: a location to return the value. * * Gets a child property of @child. **/ void goo_canvas_item_model_get_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, GValue *value) { g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (child)); g_return_if_fail (property_name != NULL); g_return_if_fail (G_IS_VALUE (value)); _goo_canvas_item_get_child_property_internal ((GObject*) model, (GObject*) child, property_name, value, _goo_canvas_item_model_child_property_pool, TRUE); } /** * goo_canvas_item_model_set_child_property: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @property_name: the name of the child property to set. * @value: the value to set the property to. * * Sets a child property of @child. **/ void goo_canvas_item_model_set_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, const gchar *property_name, const GValue *value) { g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (child)); g_return_if_fail (property_name != NULL); g_return_if_fail (G_IS_VALUE (value)); _goo_canvas_item_set_child_property_internal ((GObject*) model, (GObject*) child, property_name, value, _goo_canvas_item_model_child_property_pool, _goo_canvas_item_model_child_property_notify_context, TRUE); } /** * goo_canvas_item_model_get_child_properties_valist: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @var_args: pairs of property names and value pointers, and a terminating * %NULL. * * Gets the values of one or more child properties of @child. **/ void goo_canvas_item_model_get_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args) { g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (child)); _goo_canvas_item_get_child_properties_internal ((GObject*) model, (GObject*) child, var_args, _goo_canvas_item_model_child_property_pool, _goo_canvas_item_model_child_property_notify_context, TRUE); } /** * goo_canvas_item_model_set_child_properties_valist: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @var_args: pairs of property names and values, and a terminating %NULL. * * Sets the values of one or more child properties of @child. **/ void goo_canvas_item_model_set_child_properties_valist (GooCanvasItemModel *model, GooCanvasItemModel *child, va_list var_args) { g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (model)); g_return_if_fail (GOO_IS_CANVAS_ITEM_MODEL (child)); _goo_canvas_item_set_child_properties_internal ((GObject*) model, (GObject*) child, var_args, _goo_canvas_item_model_child_property_pool, _goo_canvas_item_model_child_property_notify_context, TRUE); } /** * goo_canvas_item_model_get_child_properties: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @...: pairs of property names and value pointers, and a terminating %NULL. * * Gets the values of one or more child properties of @child. **/ void goo_canvas_item_model_get_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...) { va_list var_args; va_start (var_args, child); goo_canvas_item_model_get_child_properties_valist (model, child, var_args); va_end (var_args); } /** * goo_canvas_item_model_set_child_properties: * @model: a #GooCanvasItemModel. * @child: a child #GooCanvasItemModel. * @...: pairs of property names and values, and a terminating %NULL. * * Sets the values of one or more child properties of @child. **/ void goo_canvas_item_model_set_child_properties (GooCanvasItemModel *model, GooCanvasItemModel *child, ...) { va_list var_args; va_start (var_args, child); goo_canvas_item_model_set_child_properties_valist (model, child, var_args); va_end (var_args); } /** * goo_canvas_item_model_class_install_child_property: * @mclass: a #GObjectClass * @property_id: the id for the property * @pspec: the #GParamSpec for the property * * This function is only intended to be used when implementing new canvas * item models, specifically layout container item models such as * #GooCanvasTableModel. * * It installs a child property on a canvas item class. **/ void goo_canvas_item_model_class_install_child_property (GObjectClass *mclass, guint property_id, GParamSpec *pspec) { g_return_if_fail (G_IS_OBJECT_CLASS (mclass)); g_return_if_fail (G_IS_PARAM_SPEC (pspec)); g_return_if_fail (property_id > 0); if (g_param_spec_pool_lookup (_goo_canvas_item_model_child_property_pool, pspec->name, G_OBJECT_CLASS_TYPE (mclass), FALSE)) { g_warning (G_STRLOC ": class `%s' already contains a child property named `%s'", G_OBJECT_CLASS_NAME (mclass), pspec->name); return; } g_param_spec_ref (pspec); g_param_spec_sink (pspec); pspec->param_id = property_id; g_param_spec_pool_insert (_goo_canvas_item_model_child_property_pool, pspec, G_OBJECT_CLASS_TYPE (mclass)); } /** * goo_canvas_item_model_class_find_child_property: * @mclass: a #GObjectClass * @property_name: the name of the child property to find * @returns: the #GParamSpec of the child property or %NULL if @class has no * child property with that name. * * This function is only intended to be used when implementing new canvas * item models, specifically layout container item models such as * #GooCanvasTableModel. * * It finds a child property of a canvas item class by name. */ GParamSpec* goo_canvas_item_model_class_find_child_property (GObjectClass *mclass, const gchar *property_name) { g_return_val_if_fail (G_IS_OBJECT_CLASS (mclass), NULL); g_return_val_if_fail (property_name != NULL, NULL); return g_param_spec_pool_lookup (_goo_canvas_item_model_child_property_pool, property_name, G_OBJECT_CLASS_TYPE (mclass), TRUE); } /** * goo_canvas_item_model_class_list_child_properties: * @mclass: a #GObjectClass * @n_properties: location to return the number of child properties found * @returns: a newly allocated array of #GParamSpec*. The array must be * freed with g_free(). * * This function is only intended to be used when implementing new canvas * item models, specifically layout container item models such as * #GooCanvasTableModel. * * It returns all child properties of a canvas item class. */ GParamSpec** goo_canvas_item_model_class_list_child_properties (GObjectClass *mclass, guint *n_properties) { GParamSpec **pspecs; guint n; g_return_val_if_fail (G_IS_OBJECT_CLASS (mclass), NULL); pspecs = g_param_spec_pool_list (_goo_canvas_item_model_child_property_pool, G_OBJECT_CLASS_TYPE (mclass), &n); if (n_properties) *n_properties = n; return pspecs; } void _goo_canvas_item_model_emit_child_added (GooCanvasItemModel *model, gint position) { g_signal_emit (model, item_model_signals[CHILD_ADDED], 0, position); } void _goo_canvas_item_model_emit_changed (GooCanvasItemModel *model, gboolean recompute_bounds) { g_signal_emit (model, item_model_signals[CHANGED], 0, recompute_bounds); } goocanvas-0.15/src/goocanvastable.c0000644000076400007640000031405311172574677014322 00000000000000/* * GooCanvas. Copyright (C) 2005-7 Damon Chaplin. * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * Copyright (C) 1997-2000 the GTK+ team. * Released under the GNU LGPL license. See COPYING for details. * * goocanvastable.c - table item. A lot of this code has been ported from * the GtkTable widget. */ /** * SECTION:goocanvastable * @Title: GooCanvasTable * @Short_Description: a table container to layout items. * * #GooCanvasTable is a table container used to lay out other canvas items. * It is used in a similar way to how the GtkTable widget is used to lay out * GTK+ widgets. * * Items are added to the table using the normal methods, then * goo_canvas_item_set_child_properties() is used to specify how each child * item is to be positioned within the table (i.e. which row and column it is * in, how much padding it should have and whether it should expand or * shrink). * * #GooCanvasTable is a subclass of #GooCanvasItemSimple and so * inherits all of the style properties such as "stroke-color", "fill-color" * and "line-width". Setting a style property on a #GooCanvasTable will affect * all children of the #GooCanvasTable (unless the children override the * property setting). * * #GooCanvasTable implements the #GooCanvasItem interface, so you can use * the #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(), and the properties such as "visibility" and * "pointer-events". * * To create a #GooCanvasTable use goo_canvas_table_new(). * * To get or set the properties of an existing #GooCanvasTable, use * g_object_get() and g_object_set(). */ #include #include #include #include #include #include "goocanvastable.h" #include "goocanvas.h" enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_ROW_SPACING, PROP_COLUMN_SPACING, PROP_HOMOGENEOUS_ROWS, PROP_HOMOGENEOUS_COLUMNS, PROP_X_BORDER_SPACING, PROP_Y_BORDER_SPACING, PROP_VERT_GRID_LINE_WIDTH, PROP_HORZ_GRID_LINE_WIDTH }; enum { CHILD_PROP_0, CHILD_PROP_LEFT_PADDING, CHILD_PROP_RIGHT_PADDING, CHILD_PROP_TOP_PADDING, CHILD_PROP_BOTTOM_PADDING, CHILD_PROP_X_ALIGN, CHILD_PROP_Y_ALIGN, CHILD_PROP_ROW, CHILD_PROP_COLUMN, CHILD_PROP_ROWS, CHILD_PROP_COLUMNS, CHILD_PROP_X_EXPAND, CHILD_PROP_X_FILL, CHILD_PROP_X_SHRINK, CHILD_PROP_Y_EXPAND, CHILD_PROP_Y_FILL, CHILD_PROP_Y_SHRINK }; #define HORZ 0 #define VERT 1 typedef enum { GOO_CANVAS_TABLE_CHILD_EXPAND = 1 << 0, GOO_CANVAS_TABLE_CHILD_FILL = 1 << 1, GOO_CANVAS_TABLE_CHILD_SHRINK = 1 << 2 } GooCanvasTableChildFlags; /* This is used in the GooCanvasTableData children GArray to keep the child properties for each of the children. */ typedef struct _GooCanvasTableChild GooCanvasTableChild; struct _GooCanvasTableChild { gdouble position[2]; /* Translation offset in table. */ gdouble start_pad[2], end_pad[2]; gdouble align[2]; guint16 start[2], size[2]; /* Start row/col & num rows/cols. */ guint8 flags[2]; /* GooCanvasTableChildFlags. */ }; typedef struct _GooCanvasTableDimensionLayoutData GooCanvasTableDimensionLayoutData; struct _GooCanvasTableDimensionLayoutData { /* This is the actual spacing for after the row or column, including the grid line width. It is set in goo_canvas_table_init_layout_data(). */ gdouble spacing; /* Stores the grid line visibilty for the grid lines to the right or bottom of this row/column, respectivel, for each cell in the other dimension. */ guint32 *grid_line_visibility; /* The requisition is calculated in goo_canvas_table_size_request_pass[123]*/ gdouble requisition; /* The allocation is initialized in goo_canvas_table_size_allocate_init() and calculated in goo_canvas_table_size_allocate_pass1(). */ gdouble allocation; /* The row or column start and end positions are calculated in goo_canvas_table_size_allocate_pass2(). */ gdouble start; gdouble end; /* These flags are initialized in goo_canvas_table_init_layout_data() and set in goo_canvas_table_size_request_init(). */ guint need_expand : 1; guint need_shrink : 1; guint expand : 1; guint shrink : 1; guint empty : 1; }; typedef struct _GooCanvasTableChildLayoutData GooCanvasTableChildLayoutData; struct _GooCanvasTableChildLayoutData { gdouble requested_position[2]; gdouble requested_size[2]; gdouble start_pad[2], end_pad[2]; }; /* Convenience macros to set/unset/check bit-flags. */ #define GOO_CANVAS_TABLE_SET_GRID_LINE_VISIBILITY(dim, x, y) \ ((dim)[(x)].grid_line_visibility[(y)/32] |= (1 << ((y) % 32))) #define GOO_CANVAS_TABLE_UNSET_GRID_LINE_VISIBILITY(dim, x, y) \ ((dim)[(x)].grid_line_visibility[(y)/32] &= ~(1 << ((y) % 32))) #define GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(dim, x, y) \ ((dim)[(x)].grid_line_visibility[(y)/32] & (1 << ((y) % 32))) /* The children array is only kept around while doing the layout. It gets freed in goo_canvas_table_allocate_area(). */ struct _GooCanvasTableLayoutData { GooCanvasTableDimensionLayoutData *dldata[2]; GooCanvasTableChildLayoutData *children; /* Position of the table */ gdouble x; gdouble y; /* This is TRUE if we are rounding everything to the nearest integer. */ gboolean integer_layout; /* This is the border width used, possibly rounded to an integer. */ gdouble border_width; /* The actual property value */ gdouble prop_grid_line_width[2]; /* The grid line width in both directions (rounded for integer layout). */ gdouble grid_line_width[2]; /* This is the actual spacing between the uppermost, bottommost, leftmost and rightmost cells from the widget border. This is the border spacing for that dimension. */ gdouble border_spacing[2]; /* These are in the table's coordinate space. */ gdouble natural_size[2]; gdouble requested_size[2]; gdouble allocated_size[2]; /* This is the last width for which we have calculated the requested heights. It is initialized to -1 in goo_canvas_table_init_layout_data() and checked/set in goo_canvas_table_update_requested_heights(). */ gdouble last_width; }; static GooCanvasItemIface *goo_canvas_table_parent_iface; static void item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_table_finalize (GObject *object); static void goo_canvas_table_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_table_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); static void goo_canvas_table_init_layout_data (GooCanvasTable *table); static void goo_canvas_table_free_layout_data (GooCanvasTableData *table_data); G_DEFINE_TYPE_WITH_CODE (GooCanvasTable, goo_canvas_table, GOO_TYPE_CANVAS_GROUP, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, item_interface_init)) typedef void (*InstallChildPropertyFunc) (GObjectClass*, guint, GParamSpec*); static void goo_canvas_table_install_common_properties (GObjectClass *gobject_class, InstallChildPropertyFunc install_child_property) { /* Override from GooCanvasGroup */ g_object_class_override_property (gobject_class, PROP_X, "x"); g_object_class_override_property (gobject_class, PROP_Y, "y"); g_object_class_override_property (gobject_class, PROP_WIDTH, "width"); g_object_class_override_property (gobject_class, PROP_HEIGHT, "height"); /* FIXME: Support setting individual row/col spacing. */ g_object_class_install_property (gobject_class, PROP_ROW_SPACING, g_param_spec_double ("row-spacing", _("Row Spacing"), _("The default space between rows"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_COLUMN_SPACING, g_param_spec_double ("column-spacing", _("Column Spacing"), _("The default space between columns"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HOMOGENEOUS_ROWS, g_param_spec_boolean ("homogeneous-rows", _("Homogenous Rows"), _("If all rows are the same height"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HOMOGENEOUS_COLUMNS, g_param_spec_boolean ("homogeneous-columns", _("Homogenous Columns"), _("If all columns are the same width"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X_BORDER_SPACING, g_param_spec_double("x-border-spacing", _("X Border Spacing"), _("The amount of spacing between the lefmost and rightmost cells and the border grid line"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y_BORDER_SPACING, g_param_spec_double("y-border-spacing", _("Y Border Spacing"), _("The amount of spacing between the topmost and bottommost cells and the border grid line"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_WIDTH, g_param_spec_double("horz-grid-line-width", _("Horizontal Grid Line Width"), _("The width of the grid line to draw between rows"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_WIDTH, g_param_spec_double("vert-grid-line-width", _("Vertical Grid Line Width"), _("The width of the grid line to draw between columns"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); /* * Child properties. */ install_child_property (gobject_class, CHILD_PROP_LEFT_PADDING, g_param_spec_double ("left-padding", _("Left Padding"), _("Extra space to add to the left of the item"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_RIGHT_PADDING, g_param_spec_double ("right-padding", _("Right Padding"), _("Extra space to add to the right of the item"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_TOP_PADDING, g_param_spec_double ("top-padding", _("Top Padding"), _("Extra space to add above the item"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_BOTTOM_PADDING, g_param_spec_double ("bottom-padding", _("Bottom Padding"), _("Extra space to add below the item"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_X_ALIGN, g_param_spec_double ("x-align", _("X Align"), _("The horizontal position of the item within its allocated space. 0.0 is left-aligned, 1.0 is right-aligned"), 0.0, 1.0, 0.5, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_Y_ALIGN, g_param_spec_double ("y-align", _("Y Align"), _("The vertical position of the item within its allocated space. 0.0 is top-aligned, 1.0 is bottom-aligned"), 0.0, 1.0, 0.5, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_ROW, g_param_spec_uint ("row", _("Row"), _("The row to place the item in"), 0, 65535, 0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_COLUMN, g_param_spec_uint ("column", _("Column"), _("The column to place the item in"), 0, 65535, 0, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_ROWS, g_param_spec_uint ("rows", _("Rows"), _("The number of rows that the item spans"), 0, 65535, 1, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_COLUMNS, g_param_spec_uint ("columns", _("Columns"), _("The number of columns that the item spans"), 0, 65535, 1, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_X_EXPAND, g_param_spec_boolean ("x-expand", _("X Expand"), _("If the item expands horizontally as the table expands"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_X_FILL, g_param_spec_boolean ("x-fill", _("X Fill"), _("If the item fills all horizontal allocated space"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_X_SHRINK, g_param_spec_boolean ("x-shrink", _("X Shrink"), _("If the item can shrink smaller than its requested size horizontally"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_Y_EXPAND, g_param_spec_boolean ("y-expand", _("Y Expand"), _("If the item expands vertically as the table expands"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_Y_FILL, g_param_spec_boolean ("y-fill", _("Y Fill"), _("If the item fills all vertical allocated space"), FALSE, G_PARAM_READWRITE)); install_child_property (gobject_class, CHILD_PROP_Y_SHRINK, g_param_spec_boolean ("y-shrink", _("Y Shrink"), _("If the item can shrink smaller than its requested size vertically"), FALSE, G_PARAM_READWRITE)); } static void goo_canvas_table_class_init (GooCanvasTableClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; goo_canvas_table_parent_iface = g_type_interface_peek (goo_canvas_table_parent_class, GOO_TYPE_CANVAS_ITEM); gobject_class->finalize = goo_canvas_table_finalize; gobject_class->get_property = goo_canvas_table_get_property; gobject_class->set_property = goo_canvas_table_set_property; goo_canvas_table_install_common_properties (gobject_class, goo_canvas_item_class_install_child_property); } /* This initializes the common table data. */ static void goo_canvas_table_init_data (GooCanvasTableData *table_data) { gint d; table_data->width = -1.0; table_data->height = -1.0; for (d = 0; d < 2; d++) { table_data->dimensions[d].size = 0; table_data->dimensions[d].default_spacing = 0.0; table_data->dimensions[d].spacings = NULL; table_data->dimensions[d].homogeneous = FALSE; } table_data->border_width = 0.0; table_data->children = g_array_new (0, 0, sizeof (GooCanvasTableChild)); table_data->layout_data = g_slice_new (GooCanvasTableLayoutData); table_data->layout_data->x = 0.0; table_data->layout_data->y = 0.0; table_data->layout_data->children = NULL; for (d = 0; d < 2; d++) { table_data->layout_data->dldata[d] = NULL; table_data->layout_data->prop_grid_line_width[d] = 0.0; table_data->layout_data->grid_line_width[d] = 0.0; table_data->layout_data->border_spacing[d] = 0.0; } } /* This frees the contents of the table data, but not the struct itself. */ static void goo_canvas_table_free_data (GooCanvasTableData *table_data) { gint d; g_array_free (table_data->children, TRUE); for (d = 0; d < 2; d++) { g_free (table_data->dimensions[d].spacings); table_data->dimensions[d].spacings = NULL; } goo_canvas_table_free_layout_data (table_data); } static void goo_canvas_table_init (GooCanvasTable *table) { table->table_data = g_slice_new0 (GooCanvasTableData); goo_canvas_table_init_data (table->table_data); } /** * goo_canvas_table_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new table item. * * * * Here's an example showing how to create a table with a square, a circle and * a triangle in it: * * * GooCanvasItem *table, *square, *circle, *triangle; * * table = goo_canvas_table_new (root, * "row-spacing", 4.0, * "column-spacing", 4.0, * NULL); * goo_canvas_item_translate (table, 400, 200); * * square = goo_canvas_rect_new (table, 0.0, 0.0, 50.0, 50.0, * "fill-color", "red", * NULL); * goo_canvas_item_set_child_properties (table, square, * "row", 0, * "column", 0, * NULL); * * circle = goo_canvas_ellipse_new (table, 0.0, 0.0, 25.0, 25.0, * "fill-color", "blue", * NULL); * goo_canvas_item_set_child_properties (table, circle, * "row", 0, * "column", 1, * NULL); * * triangle = goo_canvas_polyline_new (table, TRUE, 3, * 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, * "fill-color", "yellow", * NULL); * goo_canvas_item_set_child_properties (table, triangle, * "row", 0, * "column", 2, * NULL); * * * Returns: a new table item. **/ GooCanvasItem* goo_canvas_table_new (GooCanvasItem *parent, ...) { GooCanvasItem *item; va_list var_args; const char *first_property; item = g_object_new (GOO_TYPE_CANVAS_TABLE, NULL); va_start (var_args, parent); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (item), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_table_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasTable *table = (GooCanvasTable*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { goo_canvas_table_free_data (table->table_data); g_slice_free (GooCanvasTableData, table->table_data); } table->table_data = NULL; G_OBJECT_CLASS (goo_canvas_table_parent_class)->finalize (object); } static void goo_canvas_table_get_common_property (GObject *object, GooCanvasTableData *table_data, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, table_data->layout_data->x); break; case PROP_Y: g_value_set_double (value, table_data->layout_data->y); break; case PROP_WIDTH: g_value_set_double (value, table_data->width); break; case PROP_HEIGHT: g_value_set_double (value, table_data->height); break; case PROP_ROW_SPACING: g_value_set_double (value, table_data->dimensions[VERT].default_spacing); break; case PROP_COLUMN_SPACING: g_value_set_double (value, table_data->dimensions[HORZ].default_spacing); break; case PROP_HOMOGENEOUS_ROWS: g_value_set_boolean (value, table_data->dimensions[VERT].homogeneous); break; case PROP_HOMOGENEOUS_COLUMNS: g_value_set_boolean (value, table_data->dimensions[HORZ].homogeneous); break; case PROP_X_BORDER_SPACING: g_value_set_double (value, table_data->layout_data->border_spacing[HORZ]); break; case PROP_Y_BORDER_SPACING: g_value_set_double (value, table_data->layout_data->border_spacing[VERT]); break; case PROP_HORZ_GRID_LINE_WIDTH: g_value_set_double (value, table_data->layout_data->prop_grid_line_width[HORZ]); break; case PROP_VERT_GRID_LINE_WIDTH: g_value_set_double (value, table_data->layout_data->prop_grid_line_width[VERT]); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_table_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasTable *table = (GooCanvasTable*) object; goo_canvas_table_get_common_property (object, table->table_data, prop_id, value, pspec); } static gboolean goo_canvas_table_set_common_property (GObject *object, GooCanvasTableData *table_data, guint prop_id, const GValue *value, GParamSpec *pspec) { gboolean recompute_bounds = TRUE; switch (prop_id) { case PROP_X: table_data->layout_data->x = g_value_get_double (value); break; case PROP_Y: table_data->layout_data->y = g_value_get_double (value); break; case PROP_WIDTH: table_data->width = g_value_get_double (value); break; case PROP_HEIGHT: table_data->height = g_value_get_double (value); break; case PROP_ROW_SPACING: table_data->dimensions[VERT].default_spacing = g_value_get_double (value); break; case PROP_COLUMN_SPACING: table_data->dimensions[HORZ].default_spacing = g_value_get_double (value); break; case PROP_HOMOGENEOUS_ROWS: table_data->dimensions[VERT].homogeneous = g_value_get_boolean (value); break; case PROP_HOMOGENEOUS_COLUMNS: table_data->dimensions[HORZ].homogeneous = g_value_get_boolean (value); break; case PROP_X_BORDER_SPACING: table_data->layout_data->border_spacing[HORZ] = g_value_get_double (value); break; case PROP_Y_BORDER_SPACING: table_data->layout_data->border_spacing[VERT] = g_value_get_double (value); break; case PROP_HORZ_GRID_LINE_WIDTH: table_data->layout_data->prop_grid_line_width[HORZ] = g_value_get_double (value); break; case PROP_VERT_GRID_LINE_WIDTH: table_data->layout_data->prop_grid_line_width[VERT] = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } return recompute_bounds; } static void goo_canvas_table_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasTable *table = (GooCanvasTable*) object; gboolean recompute_bounds; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } recompute_bounds = goo_canvas_table_set_common_property (object, table->table_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, recompute_bounds); } static void goo_canvas_table_update_dimensions (GooCanvasTableData *table_data, GooCanvasTableChild *table_child) { GooCanvasTableLayoutData *layout_data; gint d, size[2], i; layout_data = table_data->layout_data; size[0] = table_child->start[0] + table_child->size[0]; size[1] = table_child->start[1] + table_child->size[1]; for (d = 0; d < 2; d++) { if (size[d] > table_data->dimensions[d].size) { /* Resize the spacings array and the layout data array. */ table_data->dimensions[d].spacings = g_realloc (table_data->dimensions[d].spacings, size[d] * sizeof (gdouble)); layout_data->dldata[d] = g_renew (GooCanvasTableDimensionLayoutData, layout_data->dldata[d], size[d]); /* Initialize new spacings to -1.0 so the default is used, and set the new grid_line_visibility arrays to NULL. */ for (i = table_data->dimensions[d].size; i < size[d]; i++) { table_data->dimensions[d].spacings[i] = -1.0; layout_data->dldata[d][i].grid_line_visibility = NULL; } } } table_data->dimensions[0].size = MAX (size[0], table_data->dimensions[0].size); table_data->dimensions[1].size = MAX (size[1], table_data->dimensions[1].size); } /* Sets or unsets grid line visibility for a given child */ static void goo_canvas_update_grid_line_visibility (GooCanvasTableData *table_data) { GooCanvasTableLayoutData *layout_data; GooCanvasTableChild *table_child; guint32 grid_line_size; gint d, d2, child_num, i, j; layout_data = table_data->layout_data; for (d = 0; d < 2; d++) { /* This is the opposite dimension. */ d2 = 1 - d; /* The amount of guint32s we need to store grid line visibility for a particular row or column. In case of vertical grid lines we store the grid lines (right to) a particular column for each row. Therefore we need one bit for each row. This is also why this depends on dimensions[1-d] instead of dimensions[d]. */ grid_line_size = ((table_data->dimensions[d2].size + 31) / 32); /* Allocate or reallocate the grid_line_visibility arrays and initialize all grid lines to visible (by setting to the arrays to all 0xFF). */ for (i = 0; i + 1 < table_data->dimensions[d].size; i++) { layout_data->dldata[d][i].grid_line_visibility = g_realloc (layout_data->dldata[d][i].grid_line_visibility, grid_line_size * sizeof (guint32)); memset (layout_data->dldata[d][i].grid_line_visibility, 0xff, grid_line_size * sizeof (guint32)); } /* Remove lines for each child spanning multiple rows/colmuns */ for (child_num = 0; child_num < table_data->children->len; child_num++) { table_child = &g_array_index (table_data->children, GooCanvasTableChild, child_num); /* Foreach cell the child is spanning */ for (i = table_child->start[d]; i < table_child->start[d] + table_child->size[d] - 1; i++) { /* Iterate through occupied cells in the other dimension */ for (j = table_child->start[d2]; j < table_child->start[d2] + table_child->size[d2]; j++) { GOO_CANVAS_TABLE_UNSET_GRID_LINE_VISIBILITY (layout_data->dldata[d], i, j); } } } } } static void goo_canvas_table_add_child_internal (GooCanvasTableData *table_data, gint position) { GooCanvasTableChild table_child; gint d; /* Initialize a table child struct. */ for (d = 0; d < 2; d++) { table_child.start_pad[d] = 0.0; table_child.end_pad[d] = 0.0; table_child.align[d] = 0.5; table_child.start[d] = 0; table_child.size[d] = 1; /* Unlike GtkTable our children do not expand & fill by default, as that makes more sense with the builtin simple items. */ table_child.flags[d] = 0; } if (position < 0) position = table_data->children->len; g_array_insert_val (table_data->children, position, table_child); goo_canvas_table_update_dimensions (table_data, &table_child); } static void goo_canvas_table_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasTable *table = (GooCanvasTable*) item; if (!simple->model) goo_canvas_table_add_child_internal (table->table_data, position); /* Let the parent GooCanvasGroup code do the rest. */ goo_canvas_table_parent_iface->add_child (item, child, position); } static void goo_canvas_table_move_child_internal (GooCanvasTableData *table_data, gint old_position, gint new_position) { GooCanvasTableChild *table_child, tmp_child; /* Copy the child temporarily. */ table_child = &g_array_index (table_data->children, GooCanvasTableChild, old_position); tmp_child = *table_child; /* Move the array data up or down. */ if (new_position > old_position) { /* Move the items down one place. */ g_memmove (table_child, &g_array_index (table_data->children, GooCanvasTableChild, old_position + 1), sizeof (GooCanvasTableChild) * (new_position - old_position)); } else { /* Move the items up one place. */ g_memmove (&g_array_index (table_data->children, GooCanvasTableChild, new_position + 1), &g_array_index (table_data->children, GooCanvasTableChild, new_position), sizeof (GooCanvasTableChild) * (old_position - new_position)); } /* Copy the child into its new position. */ table_child = &g_array_index (table_data->children, GooCanvasTableChild, new_position); *table_child = tmp_child; } static void goo_canvas_table_move_child (GooCanvasItem *item, gint old_position, gint new_position) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasTable *table = (GooCanvasTable*) item; if (!simple->model) goo_canvas_table_move_child_internal (table->table_data, old_position, new_position); /* Let the parent GooCanvasGroup code do the rest. */ goo_canvas_table_parent_iface->move_child (item, old_position, new_position); } static void goo_canvas_table_remove_child (GooCanvasItem *item, gint child_num) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; g_return_if_fail (child_num < group->items->len); if (!simple->model) g_array_remove_index (table->table_data->children, child_num); /* Let the parent GooCanvasGroup code do the rest. */ goo_canvas_table_parent_iface->remove_child (item, child_num); } static void goo_canvas_table_get_common_child_property (GObject *object, GooCanvasTableChild *table_child, guint property_id, GValue *value, GParamSpec *pspec) { switch (property_id) { case CHILD_PROP_LEFT_PADDING: g_value_set_double (value, table_child->start_pad[HORZ]); break; case CHILD_PROP_RIGHT_PADDING: g_value_set_double (value, table_child->end_pad[HORZ]); break; case CHILD_PROP_TOP_PADDING: g_value_set_double (value, table_child->start_pad[VERT]); break; case CHILD_PROP_BOTTOM_PADDING: g_value_set_double (value, table_child->end_pad[VERT]); break; case CHILD_PROP_X_ALIGN: g_value_set_double (value, table_child->align[HORZ]); break; case CHILD_PROP_Y_ALIGN: g_value_set_double (value, table_child->align[VERT]); break; case CHILD_PROP_ROW: g_value_set_uint (value, table_child->start[VERT]); break; case CHILD_PROP_COLUMN: g_value_set_uint (value, table_child->start[HORZ]); break; case CHILD_PROP_ROWS: g_value_set_uint (value, table_child->size[VERT]); break; case CHILD_PROP_COLUMNS: g_value_set_uint (value, table_child->size[HORZ]); break; case CHILD_PROP_X_EXPAND: g_value_set_boolean (value, table_child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_EXPAND); break; case CHILD_PROP_X_FILL: g_value_set_boolean (value, table_child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_FILL); break; case CHILD_PROP_X_SHRINK: g_value_set_boolean (value, table_child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_SHRINK); break; case CHILD_PROP_Y_EXPAND: g_value_set_boolean (value, table_child->flags[VERT] & GOO_CANVAS_TABLE_CHILD_EXPAND); break; case CHILD_PROP_Y_FILL: g_value_set_boolean (value, table_child->flags[VERT] & GOO_CANVAS_TABLE_CHILD_FILL); break; case CHILD_PROP_Y_SHRINK: g_value_set_boolean (value, table_child->flags[VERT] & GOO_CANVAS_TABLE_CHILD_SHRINK); break; default: G_OBJECT_WARN_INVALID_PSPEC ((object), "child property id", (property_id), (pspec)); break; } } static void goo_canvas_table_get_child_property (GooCanvasItem *item, GooCanvasItem *child, guint property_id, GValue *value, GParamSpec *pspec) { GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableChild *table_child; gint child_num; for (child_num = 0; child_num < group->items->len; child_num++) { if (group->items->pdata[child_num] == child) { table_child = &g_array_index (table->table_data->children, GooCanvasTableChild, child_num); goo_canvas_table_get_common_child_property ((GObject*) table, table_child, property_id, value, pspec); break; } } } static void goo_canvas_table_set_common_child_property (GObject *object, GooCanvasTableData *table_data, GooCanvasTableChild *table_child, guint property_id, const GValue *value, GParamSpec *pspec) { switch (property_id) { case CHILD_PROP_LEFT_PADDING: table_child->start_pad[HORZ] = g_value_get_double (value); break; case CHILD_PROP_RIGHT_PADDING: table_child->end_pad[HORZ] = g_value_get_double (value); break; case CHILD_PROP_TOP_PADDING: table_child->start_pad[VERT] = g_value_get_double (value); break; case CHILD_PROP_BOTTOM_PADDING: table_child->end_pad[VERT] = g_value_get_double (value); break; case CHILD_PROP_X_ALIGN: table_child->align[HORZ] = g_value_get_double (value); break; case CHILD_PROP_Y_ALIGN: table_child->align[VERT] = g_value_get_double (value); break; case CHILD_PROP_ROW: table_child->start[VERT] = g_value_get_uint (value); break; case CHILD_PROP_COLUMN: table_child->start[HORZ] = g_value_get_uint (value); break; case CHILD_PROP_ROWS: table_child->size[VERT] = g_value_get_uint (value); break; case CHILD_PROP_COLUMNS: table_child->size[HORZ] = g_value_get_uint (value); break; case CHILD_PROP_X_EXPAND: if (g_value_get_boolean (value)) table_child->flags[HORZ] |= GOO_CANVAS_TABLE_CHILD_EXPAND; else table_child->flags[HORZ] &= ~GOO_CANVAS_TABLE_CHILD_EXPAND; break; case CHILD_PROP_X_FILL: if (g_value_get_boolean (value)) table_child->flags[HORZ] |= GOO_CANVAS_TABLE_CHILD_FILL; else table_child->flags[HORZ] &= ~GOO_CANVAS_TABLE_CHILD_FILL; break; case CHILD_PROP_X_SHRINK: if (g_value_get_boolean (value)) table_child->flags[HORZ] |= GOO_CANVAS_TABLE_CHILD_SHRINK; else table_child->flags[HORZ] &= ~GOO_CANVAS_TABLE_CHILD_SHRINK; break; case CHILD_PROP_Y_EXPAND: if (g_value_get_boolean (value)) table_child->flags[VERT] |= GOO_CANVAS_TABLE_CHILD_EXPAND; else table_child->flags[VERT] &= ~GOO_CANVAS_TABLE_CHILD_EXPAND; break; case CHILD_PROP_Y_FILL: if (g_value_get_boolean (value)) table_child->flags[VERT] |= GOO_CANVAS_TABLE_CHILD_FILL; else table_child->flags[VERT] &= ~GOO_CANVAS_TABLE_CHILD_FILL; break; case CHILD_PROP_Y_SHRINK: if (g_value_get_boolean (value)) table_child->flags[VERT] |= GOO_CANVAS_TABLE_CHILD_SHRINK; else table_child->flags[VERT] &= ~GOO_CANVAS_TABLE_CHILD_SHRINK; break; default: G_OBJECT_WARN_INVALID_PSPEC ((object), "child property id", (property_id), (pspec)); break; } goo_canvas_table_update_dimensions (table_data, table_child); } static void goo_canvas_table_set_child_property (GooCanvasItem *item, GooCanvasItem *child, guint property_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableChild *table_child; gint child_num; for (child_num = 0; child_num < group->items->len; child_num++) { if (group->items->pdata[child_num] == child) { table_child = &g_array_index (table->table_data->children, GooCanvasTableChild, child_num); goo_canvas_table_set_common_child_property ((GObject*) table, table->table_data, table_child, property_id, value, pspec); break; } } goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_table_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; /* If our table_data was allocated, free it. */ if (!simple->model) { goo_canvas_table_free_data (table->table_data); g_slice_free (GooCanvasTableData, table->table_data); } /* Now use the new model's table_data instead. */ table->table_data = &tmodel->table_data; /* Let the parent GooCanvasGroup code do the rest. */ goo_canvas_table_parent_iface->set_model (item, model); } /* * Size requisition/allocation code. */ static void goo_canvas_table_free_layout_data (GooCanvasTableData *table_data) { gint i; if (table_data->layout_data) { for (i = 0; i < table_data->dimensions[VERT].size; i++) g_free (table_data->layout_data->dldata[VERT][i].grid_line_visibility); for (i = 0; i < table_data->dimensions[HORZ].size; i++) g_free (table_data->layout_data->dldata[HORZ][i].grid_line_visibility); g_free (table_data->layout_data->dldata[HORZ]); g_free (table_data->layout_data->dldata[VERT]); g_free (table_data->layout_data->children); g_slice_free (GooCanvasTableLayoutData, table_data->layout_data); table_data->layout_data = NULL; } } /* This allocates the layout data, and initializes the row and column data. */ static void goo_canvas_table_init_layout_data (GooCanvasTable *table) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) table; GooCanvasTableData *table_data = table->table_data; GooCanvasTableDimension *dimension; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *dldata; gint d, i; layout_data->children = g_new (GooCanvasTableChildLayoutData, table_data->children->len); layout_data->last_width = -1; /* If we are not yet added to a canvas, integer layout is irrelevant anyway. We still need the layout_data for private fields, such as border spacing and grid line visibility. */ if (simple->canvas) layout_data->integer_layout = simple->canvas->integer_layout; else layout_data->integer_layout = FALSE; layout_data->border_width = table_data->border_width; if (layout_data->integer_layout) layout_data->border_width = floor (layout_data->border_width + 0.5); layout_data->grid_line_width[0] = layout_data->prop_grid_line_width[0]; layout_data->grid_line_width[1] = layout_data->prop_grid_line_width[1]; if (layout_data->integer_layout) { layout_data->grid_line_width[0] = floor (layout_data->grid_line_width[0] + 0.5); layout_data->grid_line_width[1] = floor (layout_data->grid_line_width[1] + 0.5); } for (d = 0; d < 2; d++) { dimension = &table_data->dimensions[d]; /* Already allocated in goo_canvas_table_update_dimensions() */ /*layout_data->dldata[d] = g_renew (GooCanvasTableDimensionLayoutData, layout_data->dldata[d], dimension->size);*/ dldata = layout_data->dldata[d]; for (i = 0; i < dimension->size; i++) { /* Calculate the actual spacings. If -ve use the default. */ if (dimension->spacings[i] > 0) dldata[i].spacing = dimension->spacings[i]; else dldata[i].spacing = dimension->default_spacing; /* Add grid line widths to spacing */ dldata[i].spacing += layout_data->prop_grid_line_width[1-d]; /* In integer layout mode, round spacings to the nearest integer. */ if (layout_data->integer_layout) dldata[i].spacing = floor (dldata[i].spacing + 0.5); dldata[i].need_expand = FALSE; dldata[i].need_shrink = TRUE; dldata[i].expand = FALSE; dldata[i].shrink = TRUE; dldata[i].empty = TRUE; } } /* Update grid line visibility */ goo_canvas_update_grid_line_visibility (table_data); } /* This gets the requested size of all child items, and sets the expand, shrink and empty flags for each row and column. It should only be called once in the entire size_request/allocate procedure and nothing should change the values it sets (except the requested height of children may change after calling get_requested_height() on them). */ static void goo_canvas_table_size_request_init (GooCanvasTable *table, cairo_t *cr) { GooCanvasGroup *group = (GooCanvasGroup*) table; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimension *dimension; GooCanvasTableDimensionLayoutData *dldata; GooCanvasTableChild *child; GooCanvasItem *child_item; GooCanvasBounds bounds; gboolean allocate, has_expand, has_shrink; gint i, j, d, start, end; guint8 flags; for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); child_item = group->items->pdata[i]; /* Children will return FALSE if they don't need space allocated. */ allocate = goo_canvas_item_get_requested_area (child_item, cr, &bounds); /* Remember the requested position and size of the child. */ layout_data->children[i].requested_position[HORZ] = bounds.x1; layout_data->children[i].requested_position[VERT] = bounds.y1; if (!allocate) { layout_data->children[i].requested_size[HORZ] = -1.0; layout_data->children[i].requested_size[VERT] = -1.0; continue; } layout_data->children[i].requested_size[HORZ] = bounds.x2 - bounds.x1; layout_data->children[i].requested_size[VERT] = bounds.y2 - bounds.y1; layout_data->children[i].start_pad[HORZ] = child->start_pad[HORZ]; layout_data->children[i].end_pad[HORZ] = child->end_pad[HORZ]; layout_data->children[i].start_pad[VERT] = child->start_pad[VERT]; layout_data->children[i].end_pad[VERT] = child->end_pad[VERT]; if (layout_data->integer_layout) { layout_data->children[i].requested_size[HORZ] = ceil (layout_data->children[i].requested_size[HORZ]); layout_data->children[i].requested_size[VERT] = ceil (layout_data->children[i].requested_size[VERT]); layout_data->children[i].start_pad[HORZ] = floor (layout_data->children[i].start_pad[HORZ] + 0.5); layout_data->children[i].end_pad[HORZ] = floor (layout_data->children[i].end_pad[HORZ] + 0.5); layout_data->children[i].start_pad[VERT] = floor (layout_data->children[i].start_pad[VERT] + 0.5); layout_data->children[i].end_pad[VERT] = floor (layout_data->children[i].end_pad[VERT] + 0.5); } /* Set the expand, shrink & empty flags in the GooCanvasTableDimensionLayoutData for the row/column, if the item only spans 1 row/column. */ for (d = 0; d < 2; d++) { dldata = layout_data->dldata[d]; start = child->start[d]; flags = child->flags[d]; if (child->size[d] == 1) { if (flags & GOO_CANVAS_TABLE_CHILD_EXPAND) dldata[start].expand = TRUE; if (!(flags & GOO_CANVAS_TABLE_CHILD_SHRINK)) dldata[start].shrink = FALSE; dldata[start].empty = FALSE; } } } /* Now handle children that span more than one row or column. */ for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); if (layout_data->children[i].requested_size[HORZ] < 0.0) continue; for (d = 0; d < 2; d++) { dldata = layout_data->dldata[d]; start = child->start[d]; end = start + child->size[d] - 1; flags = child->flags[d]; if (child->size[d] != 1) { has_expand = FALSE; has_shrink = TRUE; for (j = start; j <= end; j++) { dldata[j].empty = FALSE; if (dldata[j].expand) has_expand = TRUE; if (!dldata[j].shrink) has_shrink = FALSE; } /* If the child expands, but none of the rows/columns already has expand set, we set need_expand for all of them. */ if (!has_expand && (flags & GOO_CANVAS_TABLE_CHILD_EXPAND)) { for (j = start; j <= end; j++) dldata[j].need_expand = TRUE; } /* If the child doesn't shrink, but all of the rows/columns have shrink set, we set need_shrink to FALSE for all of them. */ if (has_shrink && !(flags & GOO_CANVAS_TABLE_CHILD_SHRINK)) { for (j = start; j <= end; j++) dldata[j].need_shrink = FALSE; } } } } /* Now set the final expand, shrink & empty flags. They shouldn't be changed after this point. */ for (d = 0; d < 2; d++) { dimension = &table_data->dimensions[d]; dldata = layout_data->dldata[d]; for (i = 0; i < dimension->size; i++) { if (dldata[i].empty) { dldata[i].expand = FALSE; dldata[i].shrink = FALSE; } else { if (dldata[i].need_expand) dldata[i].expand = TRUE; if (!dldata[i].need_shrink) dldata[i].shrink = FALSE; } } } } /* This calculates the initial size request for each row & column, which is the maximum size of all items that are in that row or column. (It skips items that span more than one row or column.) */ static void goo_canvas_table_size_request_pass1 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableDimension *dimension = &table_data->dimensions[d]; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *dldata = layout_data->dldata[d]; GooCanvasTableChild *child; gdouble requested_size; gint i, start; for (i = 0; i < dimension->size; i++) dldata[i].requisition = 0.0; for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); requested_size = layout_data->children[i].requested_size[d]; /* Child needs allocation & spans a single row or column. */ if (requested_size >= 0.0 && child->size[d] == 1) { requested_size += layout_data->children[i].start_pad[d] + layout_data->children[i].end_pad[d]; start = child->start[d]; dldata[start].requisition = MAX (dldata[start].requisition, requested_size); } } } /* This ensures that homogeneous tables have all rows/columns the same size. Note that it is called once after items in a single row/column have been calculated, and then again after items spanning several rows/columns have been calculated. */ static void goo_canvas_table_size_request_pass2 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *dldata = layout_data->dldata[d]; gdouble max_size = 0.0; gint i; if (table_data->dimensions[d].homogeneous) { /* Calculate the maximum row or column size. */ for (i = 0; i < table_data->dimensions[d].size; i++) max_size = MAX (max_size, dldata[i].requisition); /* Use the maximum size for all rows or columns. */ for (i = 0; i < table_data->dimensions[d].size; i++) dldata[i].requisition = max_size; } } /* This handles items that span more than one row or column, by making sure there is enough space for them and expanding the row/column size request if needed. */ static void goo_canvas_table_size_request_pass3 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *dldata; GooCanvasTableChild *child; gint i, j; for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); if (layout_data->children[i].requested_size[HORZ] <= 0.0) continue; /* Child spans multiple rows/columns. */ if (child->size[d] != 1) { gint start = child->start[d]; gint end = start + child->size[d] - 1; gdouble total_space = 0.0, space_needed; dldata = layout_data->dldata[d]; /* Check if there is already enough space for the child. */ for (j = start; j <= end; j++) { total_space += dldata[j].requisition; if (j < end) total_space += dldata[j].spacing; } /* If we need to request more space for this child to fill its requisition, then divide up the needed space amongst the columns it spans, favoring expandable columns if any. */ space_needed = layout_data->children[i].requested_size[d] + layout_data->children[i].start_pad[d] + layout_data->children[i].end_pad[d]; if (total_space < space_needed) { gint n_expand = 0; gboolean force_expand = FALSE; gdouble expand = space_needed - total_space; gdouble extra; for (j = start; j <= end; j++) { if (dldata[j].expand) n_expand++; } if (n_expand == 0) { n_expand = child->size[d]; force_expand = TRUE; } if (layout_data->integer_layout) { for (j = start; j <= end; j++) { if (force_expand || dldata[j].expand) { extra = floor (expand / n_expand + 0.5); dldata[j].requisition += extra; expand -= extra; n_expand--; } } } else { extra = expand / n_expand; for (j = start; j <= end; j++) { if (force_expand || dldata[j].expand) dldata[j].requisition += extra; } } } } } } static void goo_canvas_table_size_allocate_init (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimension *dimension = &table_data->dimensions[d]; GooCanvasTableDimensionLayoutData *dldata = layout_data->dldata[d]; gint i; /* Set the initial allocation, by copying over the requisition. Also set the final expand & shrink flags. */ for (i = 0; i < dimension->size; i++) dldata[i].allocation = dldata[i].requisition; } static void goo_canvas_table_size_allocate_pass1 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimension *dimension; GooCanvasTableDimensionLayoutData *dldata; gdouble total_size, size_to_allocate, natural_size, extra, old_extra; gint i, nexpand, nshrink; /* If we were allocated more space than we requested * then we have to expand any expandable rows and columns * to fill in the extra space. */ dimension = &table_data->dimensions[d]; dldata = layout_data->dldata[d]; natural_size = 0; nexpand = 0; nshrink = 0; for (i = 0; i < dimension->size; i++) { natural_size += dldata[i].requisition; if (dldata[i].expand) nexpand += 1; if (dldata[i].shrink && dldata[i].allocation > 0.0) nshrink += 1; } for (i = 0; i + 1 < dimension->size; i++) natural_size += dldata[i].spacing; /* Note: natural_size does not contain without border width and border spacing here. */ /* total_size is the size available for allocating widgets. We always allocate space for border_width, but for right/bottom border_spacing only if all children can be allocated without being shrunk. */ if (layout_data->allocated_size[d] < layout_data->border_width * 2.0 + layout_data->border_spacing[d] + layout_data->grid_line_width[1-d]) total_size = 0; else if (layout_data->allocated_size[d] < layout_data->border_width * 2.0 + layout_data->border_spacing[d] + layout_data->grid_line_width[1-d] + natural_size) total_size = layout_data->allocated_size[d] - layout_data->border_width * 2.0 - layout_data->border_spacing[d] - layout_data->grid_line_width[1-d]; else if (layout_data->allocated_size[d] < layout_data->border_width * 2.0 + (layout_data->border_spacing[d] + layout_data->grid_line_width[1-d]) * 2.0 + natural_size) total_size = natural_size; else total_size = layout_data->allocated_size[d] - layout_data->border_width * 2.0 - (layout_data->border_spacing[d] + layout_data->grid_line_width[1-d])* 2.0; if (dimension->homogeneous) { /* If the table is homogeneous in this dimension we check if any of the children expand, or if there are no children, or if we were allocated less space than we requested and any children shrink. If so, we divide up all the allocated space. */ if (nexpand || table_data->children->len == 0 || (natural_size > total_size && nshrink)) { size_to_allocate = total_size; for (i = 0; i + 1 < dimension->size; i++) size_to_allocate -= dldata[i].spacing; if (layout_data->integer_layout) { gint n_elements = dimension->size; for (i = 0; i < dimension->size; i++) { dldata[i].allocation = floor (size_to_allocate / n_elements + 0.5); size_to_allocate -= dldata[i].allocation; n_elements--; } } else { size_to_allocate /= dimension->size; for (i = 0; i < dimension->size; i++) dldata[i].allocation = size_to_allocate; } } } else { /* Check to see if we were allocated more width than we requested. */ if ((natural_size < total_size) && (nexpand >= 1)) { if (layout_data->integer_layout) { gdouble expand = total_size - natural_size; for (i = 0; i < dimension->size; i++) { if (dldata[i].expand) { extra = floor (expand / nexpand + 0.5); dldata[i].allocation += extra; expand -= extra; nexpand--; } } } else { extra = (total_size - natural_size) / nexpand; for (i = 0; i < dimension->size; i++) { if (dldata[i].expand) dldata[i].allocation += extra; } } } /* Check to see if we were allocated less width than we requested, * then shrink until we fit the size give. */ if (natural_size > total_size) { gint total_nshrink = nshrink; extra = natural_size - total_size; while (total_nshrink > 0 && extra > 0) { nshrink = total_nshrink; old_extra = extra; for (i = 0; i < dimension->size; i++) { if (dldata[i].shrink && dldata[i].allocation > 0.0) { gdouble old_allocation = dldata[i].allocation; gdouble shrink_amount = extra / nshrink; gdouble new_allocation; if (layout_data->integer_layout) shrink_amount = floor (shrink_amount + 0.5); new_allocation = old_allocation - shrink_amount; dldata[i].allocation = MAX (0.0, new_allocation); extra -= old_allocation - dldata[i].allocation; nshrink -= 1; if (dldata[i].allocation <= 0.0) total_nshrink -= 1; } } if (extra >= old_extra) break; } } } } /* Calculates the start and end position of each row/column. */ static void goo_canvas_table_size_allocate_pass2 (GooCanvasTable *table, gint d) { GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimension *dimension; GooCanvasTableDimensionLayoutData *dldata; gdouble pos; gint i; dimension = &table_data->dimensions[d]; dldata = layout_data->dldata[d]; pos = layout_data->border_width + layout_data->border_spacing[d] + layout_data->grid_line_width[1-d]; for (i = 0; i < dimension->size; i++) { dldata[i].start = pos; pos += dldata[i].allocation; dldata[i].end = pos; pos += dldata[i].spacing; #if 0 g_print ("%s %i: %g - %g\n", d ? "Row" : "Column", i, dldata[i].start, dldata[i].end); #endif } } /* This does the actual allocation of each child, calculating its size and position according to the rows & columns it spans. */ static void goo_canvas_table_size_allocate_pass3 (GooCanvasTable *table, cairo_t *cr, gdouble table_x_offset, gdouble table_y_offset) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) table; GooCanvasGroup *group = (GooCanvasGroup*) table; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows = layout_data->dldata[VERT]; GooCanvasTableDimensionLayoutData *columns = layout_data->dldata[HORZ]; GooCanvasTableChild *child; GooCanvasItem *child_item; GooCanvasTableChildLayoutData *child_data; GooCanvasBounds requested_area, allocated_area; GtkTextDirection direction = GTK_TEXT_DIR_NONE; gint start_column, end_column, start_row, end_row, i; gdouble x, y, max_width, max_height, width, height; gdouble requested_width, requested_height; gdouble x_offset, y_offset; if (simple->canvas) direction = gtk_widget_get_direction (GTK_WIDGET (simple->canvas)); for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); child_item = group->items->pdata[i]; child_data = &layout_data->children[i]; requested_width = child_data->requested_size[HORZ]; requested_height = child_data->requested_size[VERT]; if (requested_width <= 0.0) continue; start_column = child->start[HORZ]; end_column = child->start[HORZ] + child->size[HORZ] - 1; x = columns[start_column].start + layout_data->children[i].start_pad[HORZ]; max_width = columns[end_column].end - layout_data->children[i].end_pad[HORZ] - x; start_row = child->start[VERT]; end_row = child->start[VERT] + child->size[VERT] - 1; y = rows[start_row].start + layout_data->children[i].start_pad[VERT]; max_height = rows[end_row].end - layout_data->children[i].end_pad[VERT] - y; width = max_width = MAX (0.0, max_width); height = max_height = MAX (0.0, max_height); if (!(child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_FILL)) { width = MIN (max_width, requested_width); x += (max_width - width) * child->align[HORZ]; if (layout_data->integer_layout) x = floor (x + 0.5); } if (!(child->flags[VERT] & GOO_CANVAS_TABLE_CHILD_FILL)) { height = MIN (max_height, requested_height); y += (max_height - height) * child->align[VERT]; if (layout_data->integer_layout) y = floor (y + 0.5); } if (direction == GTK_TEXT_DIR_RTL) x = layout_data->allocated_size[HORZ] - width; requested_area.x1 = layout_data->children[i].requested_position[HORZ]; requested_area.y1 = layout_data->children[i].requested_position[VERT]; requested_area.x2 = requested_area.x1 + requested_width; requested_area.y2 = requested_area.y1 + requested_height; allocated_area.x1 = x; allocated_area.y1 = y; allocated_area.x2 = allocated_area.x1 + width; allocated_area.y2 = allocated_area.y1 + height; /* Calculate how much we will have to translate the child by. */ child->position[HORZ] = allocated_area.x1 - requested_area.x1; child->position[VERT] = allocated_area.y1 - requested_area.y1; /* Translate the cairo context so the item's user space is correct. */ cairo_translate (cr, child->position[HORZ], child->position[VERT]); x_offset = allocated_area.x1 - requested_area.x1; y_offset = allocated_area.y1 - requested_area.y1; cairo_user_to_device_distance (cr, &x_offset, &y_offset); x_offset += table_x_offset; y_offset += table_y_offset; goo_canvas_item_allocate_area (child_item, cr, &requested_area, &allocated_area, x_offset, y_offset); cairo_translate (cr, -child->position[HORZ], -child->position[VERT]); } } static void goo_canvas_table_update_requested_heights (GooCanvasItem *item, cairo_t *cr) { GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows = layout_data->dldata[VERT]; GooCanvasTableDimensionLayoutData *columns = layout_data->dldata[HORZ]; GooCanvasTableChild *child; GooCanvasItem *child_item; GooCanvasTableChildLayoutData *child_data; gint start_column, end_column, i, row, end; gdouble x, max_width, width, requested_width, requested_height, height = 0.0; /* Just return if we've already calculated requested heights for this exact width. */ if (layout_data->last_width == layout_data->allocated_size[HORZ]) return; layout_data->last_width = layout_data->allocated_size[HORZ]; /* First calculate the allocations for each column. */ goo_canvas_table_size_allocate_init (table, HORZ); goo_canvas_table_size_allocate_pass1 (table, HORZ); goo_canvas_table_size_allocate_pass2 (table, HORZ); /* Now check if any child changes height based on their allocated width. */ for (i = 0; i < table_data->children->len; i++) { child = &g_array_index (table_data->children, GooCanvasTableChild, i); child_item = group->items->pdata[i]; child_data = &layout_data->children[i]; requested_width = child_data->requested_size[HORZ]; /* Skip children that won't be allocated. */ if (requested_width <= 0.0) continue; start_column = child->start[HORZ]; end_column = child->start[HORZ] + child->size[HORZ] - 1; x = columns[start_column].start + layout_data->children[i].start_pad[HORZ]; max_width = columns[end_column].end - layout_data->children[i].end_pad[HORZ] - x; width = max_width = MAX (0.0, max_width); if (!(child->flags[HORZ] & GOO_CANVAS_TABLE_CHILD_FILL)) width = MIN (max_width, requested_width); requested_height = goo_canvas_item_get_requested_height (child_item, cr, width); if (requested_height >= 0.0) child_data->requested_size[VERT] = requested_height; } /* Now recalculate the requested heights of each row. */ goo_canvas_table_size_request_pass1 (table, VERT); goo_canvas_table_size_request_pass2 (table, VERT); goo_canvas_table_size_request_pass3 (table, VERT); goo_canvas_table_size_request_pass2 (table, VERT); end = table_data->dimensions[VERT].size - 1; for (row = 0; row <= end; row++) { height += rows[row].requisition; if (row < end) height += rows[row].spacing; } height += (layout_data->border_width + layout_data->border_spacing[VERT] + layout_data->grid_line_width[HORZ]) * 2.0; layout_data->natural_size[VERT] = height; } /* Returns FALSE if item shouldn't be allocated. */ static gboolean goo_canvas_table_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows, *columns; gdouble width = 0.0, height = 0.0; gint row, column, end; /* Request a redraw of the existing bounds */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); /* We reset the bounds to 0, just in case we are hidden or aren't allocated any area. */ simple->bounds.x1 = simple->bounds.x2 = 0.0; simple->bounds.y1 = simple->bounds.y2 = 0.0; simple->need_update = FALSE; goo_canvas_item_simple_check_style (simple); if (simple_data->visibility == GOO_CANVAS_ITEM_HIDDEN) return FALSE; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); /* Initialize the layout data, get the requested sizes of all children, and set the expand, shrink and empty flags. */ goo_canvas_table_init_layout_data (table); goo_canvas_table_size_request_init (table, cr); /* Calculate the requested width of the table. */ goo_canvas_table_size_request_pass1 (table, HORZ); goo_canvas_table_size_request_pass2 (table, HORZ); goo_canvas_table_size_request_pass3 (table, HORZ); goo_canvas_table_size_request_pass2 (table, HORZ); rows = layout_data->dldata[VERT]; columns = layout_data->dldata[HORZ]; end = table_data->dimensions[HORZ].size - 1; for (column = 0; column <= end; column++) { width += columns[column].requisition; if (column < end) width += columns[column].spacing; } width += (layout_data->border_width + layout_data->border_spacing[HORZ] + layout_data->grid_line_width[VERT]) * 2.0; /* Save the natural size, so we know if we have to clip children. */ layout_data->natural_size[HORZ] = width; /* If the width has been set, that overrides the calculations. */ if (table_data->width > 0.0) width = table_data->width; layout_data->requested_size[HORZ] = width; layout_data->allocated_size[HORZ] = width; /* Update the requested heights, based on the requested column widths. */ goo_canvas_table_update_requested_heights (item, cr); goo_canvas_table_size_request_pass1 (table, VERT); goo_canvas_table_size_request_pass2 (table, VERT); goo_canvas_table_size_request_pass3 (table, VERT); goo_canvas_table_size_request_pass2 (table, VERT); end = table_data->dimensions[VERT].size - 1; for (row = 0; row <= end; row++) { height += rows[row].requisition; if (row < end) height += rows[row].spacing; } height += (layout_data->border_width + layout_data->border_spacing[VERT] + layout_data->grid_line_width[HORZ]) * 2.0; /* Save the natural size, so we know if we have to clip children. */ layout_data->natural_size[VERT] = height; /* If the height has been set, that overrides the calculations. */ if (table_data->height > 0.0) height = table_data->height; layout_data->requested_size[VERT] = height; /* Copy the user bounds to the requested area. */ requested_area->x1 = requested_area->y1 = 0.0; requested_area->x2 = width; requested_area->y2 = height; /* Convert to the parent's coordinate space. */ goo_canvas_item_simple_user_bounds_to_parent (simple, cr, requested_area); cairo_restore (cr); return TRUE; } static gdouble goo_canvas_table_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; gdouble allocated_width = width, height; /* If we have a transformation besides a simple scale & translation, just return -1 as we can't adjust the height in that case. */ if (simple_data->transform && (simple_data->transform->xy != 0.0 || simple_data->transform->yx != 0.0)) return -1; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); /* Convert the width from the parent's coordinate space. Note that we only need to support a simple scale operation here. */ if (simple_data->transform) allocated_width /= simple_data->transform->xx; layout_data->allocated_size[HORZ] = allocated_width; if (layout_data->integer_layout) layout_data->allocated_size[HORZ] = floor (layout_data->allocated_size[HORZ]); goo_canvas_table_update_requested_heights (item, cr); cairo_restore (cr); /* Convert to the parent's coordinate space. As above, we only need to support a simple scale operation here. */ height = layout_data->natural_size[VERT]; if (simple_data->transform) height *= simple_data->transform->yy; /* Return the new requested height of the table. */ return height; } static void goo_canvas_table_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; gdouble requested_width, requested_height, allocated_width, allocated_height; gdouble width_proportion, height_proportion, min_proportion; requested_width = requested_area->x2 - requested_area->x1; requested_height = requested_area->y2 - requested_area->y1; allocated_width = allocated_area->x2 - allocated_area->x1; allocated_height = allocated_area->y2 - allocated_area->y1; /* Calculate what proportion of our requested size we were allocated. */ width_proportion = allocated_width / requested_width; height_proportion = allocated_height / requested_height; /* If the table is rotated we have to scale it to make sure it fits in the allocated area. */ if (simple_data->transform && (simple_data->transform->xy != 0.0 || simple_data->transform->yx != 0.0)) { /* Calculate the minimum proportion, which we'll use to scale our original width & height requests. */ min_proportion = MIN (width_proportion, height_proportion); layout_data->allocated_size[HORZ] = layout_data->requested_size[HORZ] * min_proportion; layout_data->allocated_size[VERT] = layout_data->requested_size[VERT] * min_proportion; } else { /* If the table isn't rotated we can just scale according to the allocated proportions. */ layout_data->allocated_size[HORZ] = layout_data->requested_size[HORZ] * width_proportion; layout_data->allocated_size[VERT] = layout_data->requested_size[VERT] * height_proportion; } if (layout_data->integer_layout) { layout_data->allocated_size[HORZ] = floor (layout_data->requested_size[HORZ]); layout_data->allocated_size[VERT] = floor (layout_data->requested_size[VERT]); } /* We have to remove the translation that our parent is giving us while we update the size requests, otherwise child items' bounds will include the translation which we result in incorrect bounds after allocation. */ cairo_save (cr); cairo_translate (cr, -(allocated_area->x1 - requested_area->x1), -(allocated_area->y1 - requested_area->y1)); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); goo_canvas_table_update_requested_heights (item, cr); cairo_restore (cr); cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); /* Calculate the table's bounds. */ simple->bounds.x1 = simple->bounds.y1 = 0.0; simple->bounds.x2 = layout_data->allocated_size[HORZ]; simple->bounds.y2 = layout_data->allocated_size[VERT]; goo_canvas_item_simple_user_bounds_to_device (simple, cr, &simple->bounds); goo_canvas_table_size_allocate_init (table, VERT); goo_canvas_table_size_allocate_pass1 (table, VERT); goo_canvas_table_size_allocate_pass2 (table, VERT); goo_canvas_table_size_allocate_pass3 (table, cr, x_offset, y_offset); /* We free the children array but keep the dimension layout data, since we may need that for clipping children. */ g_free (layout_data->children); layout_data->children = NULL; cairo_restore (cr); goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); } static void goo_canvas_table_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasBounds tmp_bounds; if (entire_tree || simple->need_update) { simple->need_update = FALSE; simple->need_entire_subtree_update = FALSE; goo_canvas_item_simple_check_style (simple); /* We just allocate exactly what is requested. */ if (goo_canvas_table_get_requested_area (item, cr, &tmp_bounds)) { goo_canvas_table_allocate_area (item, cr, &tmp_bounds, &tmp_bounds, 0, 0); } } *bounds = simple->bounds; } static void goo_canvas_table_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasStyle *style = simple_data->style; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows = layout_data->dldata[VERT]; GooCanvasTableDimensionLayoutData *columns = layout_data->dldata[HORZ]; gdouble vert_grid_line_width = layout_data->grid_line_width[VERT]; gdouble horz_grid_line_width = layout_data->grid_line_width[HORZ]; GArray *children = table_data->children; GooCanvasTableChild *table_child; GooCanvasItem *child; gboolean check_clip = FALSE, clip; gint start_column, end_column, start_row, end_row, i, j; gdouble x, y, end_x, end_y; gdouble frame_width, frame_height; gdouble line_start, line_end; gdouble spacing, half_spacing_before, half_spacing_after; gboolean old_grid_line_visibility, cur_grid_line_visibility; /* Skip the item if the bounds don't intersect the expose rectangle. */ if (simple->bounds.x1 > bounds->x2 || simple->bounds.x2 < bounds->x1 || simple->bounds.y1 > bounds->y2 || simple->bounds.y2 < bounds->y1) return; /* Check if the item should be visible. */ if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold)) return; /* Paint all the items in the group. */ cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); /* Clip with the table's clip path, if it is set. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); cairo_clip (cr); } /* Check if the table was allocated less space than it requested, in which case we may need to clip children. */ if (layout_data->allocated_size[HORZ] < layout_data->natural_size[HORZ] || layout_data->allocated_size[VERT] < layout_data->natural_size[VERT]) check_clip = TRUE; /* frame_width/frame_height is the size of the table we draw the grid lines around. This normally is the allocated size, except when we are shrunk in which case we use the natural size. The grid will be clipped in that case. */ frame_width = MAX (layout_data->allocated_size[HORZ], layout_data->natural_size[HORZ]); frame_height = MAX (layout_data->allocated_size[VERT], layout_data->natural_size[VERT]); /* Draw border and grid lines */ if (check_clip) { cairo_rectangle (cr, layout_data->border_width, layout_data->border_width, layout_data->allocated_size[HORZ] - 2*layout_data->border_width, layout_data->allocated_size[VERT] - 2*layout_data->border_width); cairo_clip (cr); } /* Save current line width, line cap etc. for drawing items after having drawn grid lines */ cairo_save (cr); /* Fill the table, if desired. */ if (goo_canvas_style_set_fill_options (style, cr)) { cairo_rectangle (cr, layout_data->border_width + vert_grid_line_width, layout_data->border_width + horz_grid_line_width, layout_data->allocated_size[HORZ] - 2 * (layout_data->border_width + vert_grid_line_width), layout_data->allocated_size[VERT] - 2 * (layout_data->border_width + horz_grid_line_width)); cairo_fill (cr); } /* We use the style for the stroke color, but the line cap style and line width are overridden here. */ goo_canvas_style_set_stroke_options (style, cr); cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); /* Horizontal grid lines */ if (horz_grid_line_width > 0.0) { cairo_set_line_width (cr, horz_grid_line_width); /* Outer lines */ line_start = layout_data->border_width; line_end = frame_width - layout_data->border_width; cairo_move_to (cr, line_start, layout_data->border_width + horz_grid_line_width/2); cairo_rel_line_to (cr, line_end - line_start, 0); cairo_move_to (cr, line_start, frame_height - layout_data->border_width - horz_grid_line_width/2); cairo_rel_line_to (cr, line_end - line_start, 0); /* Inner lines. Make sure we don't do overlapping drawing operations, so we could easily draw alpha transparent borders */ for (i = 0; i + 1 < table_data->dimensions[VERT].size; i++) { for (j = 0; j < table_data->dimensions[HORZ].size; j++) { cur_grid_line_visibility = GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], i, j); if (cur_grid_line_visibility) { spacing = (columns[j].spacing - vert_grid_line_width); half_spacing_before = spacing / 2.0; if (simple->canvas->integer_layout) half_spacing_before = floor (half_spacing_before); half_spacing_after = spacing - half_spacing_before; if (j == 0) line_start = layout_data->border_width + vert_grid_line_width; else if (old_grid_line_visibility) line_start = columns[j].start - half_spacing_after; else line_start = columns[j-1].end + half_spacing_before; half_spacing_after = (columns[j].spacing - vert_grid_line_width)/2.0; if (simple->canvas->integer_layout) half_spacing_after = ceil (half_spacing_after); if (j == table_data->dimensions[HORZ].size - 1) line_end = frame_width - layout_data->border_width - vert_grid_line_width; else line_end = columns[j + 1].start - half_spacing_after; cairo_move_to (cr, line_start, rows[i].end + rows[i].spacing/2.0); cairo_rel_line_to (cr, line_end - line_start, 0); } old_grid_line_visibility = cur_grid_line_visibility; } } cairo_stroke (cr); } /* Vertical grid lines */ if (vert_grid_line_width > 0.0) { cairo_set_line_width (cr, vert_grid_line_width); /* Outer lines */ line_start = layout_data->border_width + horz_grid_line_width; line_end = frame_height - layout_data->border_width - horz_grid_line_width; cairo_move_to (cr, layout_data->border_width + vert_grid_line_width/2, line_start); cairo_rel_line_to (cr, 0, line_end - line_start); cairo_move_to (cr, frame_width - layout_data->border_width - vert_grid_line_width/2, line_start); cairo_rel_line_to (cr, 0, line_end - line_start); /* Inner lines. Make sure we don't do overlapping drawing operations, so we could easily draw alpha transparent borders. We need to take additionally care that we don't cross already drawn horizontal lines. */ for (i = 0; i + 1 < table_data->dimensions[HORZ].size; i++) { for (j = 0; j < table_data->dimensions[VERT].size; j++) { cur_grid_line_visibility = GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[HORZ], i, j); if (cur_grid_line_visibility) { spacing = (rows[j].spacing - horz_grid_line_width); half_spacing_before = spacing / 2.0; if (simple->canvas->integer_layout) half_spacing_before = floor (half_spacing_before); half_spacing_after = spacing - half_spacing_before; if (j == 0) line_start = layout_data->border_width + horz_grid_line_width; else if (old_grid_line_visibility) line_start = rows[j].start - half_spacing_after; else /* Don't draw top part if already drawn by horizontal grid line */ if (GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], j-1, i) || GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], j-1, i+1)) line_start = rows[j].start - half_spacing_after; else line_start = rows[j-1].end + half_spacing_before; half_spacing_before = half_spacing_after = (rows[j].spacing - horz_grid_line_width)/2.0; if (simple->canvas->integer_layout) { half_spacing_before = floor (half_spacing_before); half_spacing_after = ceil (half_spacing_after); } if (j == table_data->dimensions[VERT].size - 1) line_end = frame_height - layout_data->border_width - horz_grid_line_width; else /* Don't draw bottom part if already drawn by horizontal grid line */ if (GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], j, i) || GOO_CANVAS_TABLE_IS_GRID_LINE_VISIBLE(layout_data->dldata[VERT], j, i+1)) line_end = rows[j].end + half_spacing_before; else line_end = rows[j + 1].start - half_spacing_after; cairo_move_to (cr, columns[i].end + columns[i].spacing/2.0, line_start); cairo_rel_line_to (cr, 0, line_end - line_start); } old_grid_line_visibility = cur_grid_line_visibility; } } cairo_stroke (cr); } cairo_restore (cr); for (i = 0; i < group->items->len; i++) { child = group->items->pdata[i]; table_child = &g_array_index (children, GooCanvasTableChild, i); clip = FALSE; /* Clip the child to make sure it doesn't go outside its area. */ if (check_clip) { /* Calculate the position of the child and how much space it has. */ start_column = table_child->start[HORZ]; end_column = table_child->start[HORZ] + table_child->size[HORZ] - 1; x = columns[start_column].start + table_child->start_pad[HORZ]; end_x = columns[end_column].end - table_child->end_pad[HORZ]; start_row = table_child->start[VERT]; end_row = table_child->start[VERT] + table_child->size[VERT] - 1; y = rows[start_row].start + table_child->start_pad[VERT]; end_y = rows[end_row].end - table_child->end_pad[VERT]; if (simple->canvas->integer_layout) { x = floor (x + 0.5); end_x = floor (end_x + 0.5); y = floor (y + 0.5); end_y = floor (end_y + 0.5); } /* Make sure it doesn't go outside the table's allocated size. */ end_x = MIN (end_x, layout_data->allocated_size[HORZ]); end_y = MIN (end_y, layout_data->allocated_size[VERT]); /* Only try to paint the child if it has some allocated space. */ if (end_x <= x || end_y <= y) continue; /* Check if any of the rows/columns the child is in can shrink. */ for (j = start_column; j <= end_column; j++) if (columns[j].shrink) clip = TRUE; for (j = start_row; j <= end_row; j++) if (rows[j].shrink) clip = TRUE; /* Only clip the child if it may have been shrunk. */ if (clip) { cairo_save (cr); cairo_rectangle (cr, x, y, end_x - x, end_y - y); cairo_clip (cr); } } cairo_translate (cr, table_child->position[HORZ], table_child->position[VERT]); goo_canvas_item_paint (child, cr, bounds, scale); cairo_translate (cr, -table_child->position[HORZ], -table_child->position[VERT]); if (clip) cairo_restore (cr); } cairo_restore (cr); } static GList* goo_canvas_table_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_visible, GList *found_items) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableData *table_data = table->table_data; GooCanvasTableLayoutData *layout_data = table_data->layout_data; GooCanvasTableDimensionLayoutData *rows = layout_data->dldata[VERT]; GooCanvasTableDimensionLayoutData *columns = layout_data->dldata[HORZ]; GArray *children = table_data->children; GooCanvasTableChild *table_child; GooCanvasItem *child; gboolean visible = parent_visible, check_clip = FALSE; double user_x = x, user_y = y; gint start_column, end_column, start_row, end_row, i; gdouble start_x, end_x, start_y, end_y; if (simple->need_update) goo_canvas_item_ensure_updated (item); /* Skip the item if the point isn't in the item's bounds. */ if (simple->bounds.x1 > x || simple->bounds.x2 < x || simple->bounds.y1 > y || simple->bounds.y2 < y) return found_items; if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold)) visible = FALSE; /* Check if the group should receive events. */ if (is_pointer_event && (simple_data->pointer_events == GOO_CANVAS_EVENTS_NONE || ((simple_data->pointer_events & GOO_CANVAS_EVENTS_VISIBLE_MASK) && !visible))) return found_items; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, layout_data->x, layout_data->y); cairo_device_to_user (cr, &user_x, &user_y); /* If the table has a clip path, check if the point is inside it. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); if (!cairo_in_fill (cr, user_x, user_y)) { cairo_restore (cr); return found_items; } } /* Check if the table was allocated less space than it requested, in which case we may need to clip children. */ if (layout_data->allocated_size[HORZ] < layout_data->natural_size[HORZ] || layout_data->allocated_size[VERT] < layout_data->natural_size[VERT]) check_clip = TRUE; /* Step up from the bottom of the children to the top, adding any items found to the start of the list. */ for (i = 0; i < group->items->len; i++) { child = group->items->pdata[i]; table_child = &g_array_index (children, GooCanvasTableChild, i); /* If the child may have been clipped, check the point is in the child's allocated area. */ if (check_clip) { /* Calculate the position of the child and how much space it has. */ start_column = table_child->start[HORZ]; end_column = table_child->start[HORZ] + table_child->size[HORZ] - 1; start_x = columns[start_column].start + table_child->start_pad[HORZ]; end_x = columns[end_column].end - table_child->end_pad[HORZ]; start_row = table_child->start[VERT]; end_row = table_child->start[VERT] + table_child->size[VERT] - 1; start_y = rows[start_row].start + table_child->start_pad[VERT]; end_y = rows[end_row].end - table_child->end_pad[VERT]; if (simple->canvas->integer_layout) { start_x = floor (start_x + 0.5); end_x = floor (end_x + 0.5); start_y = floor (start_y + 0.5); end_y = floor (end_y + 0.5); } if (user_x < start_x || user_x > end_x || user_y < start_y || user_y > end_y) continue; } cairo_translate (cr, table_child->position[HORZ], table_child->position[VERT]); found_items = goo_canvas_item_get_items_at (child, x, y, cr, is_pointer_event, visible, found_items); cairo_translate (cr, -table_child->position[HORZ], -table_child->position[VERT]); } cairo_restore (cr); return found_items; } gboolean goo_canvas_table_get_transform_for_child (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasTable *table = (GooCanvasTable*) item; GooCanvasTableChild *table_child; gboolean has_transform = FALSE; gint child_num; if (simple->simple_data->transform) { *transform = *simple->simple_data->transform; has_transform = TRUE; } else { cairo_matrix_init_identity (transform); } for (child_num = 0; child_num < group->items->len; child_num++) { if (group->items->pdata[child_num] == child) { table_child = &g_array_index (table->table_data->children, GooCanvasTableChild, child_num); cairo_matrix_translate (transform, table_child->position[HORZ], table_child->position[VERT]); has_transform = TRUE; break; } } return has_transform; } static void item_interface_init (GooCanvasItemIface *iface) { iface->add_child = goo_canvas_table_add_child; iface->move_child = goo_canvas_table_move_child; iface->remove_child = goo_canvas_table_remove_child; iface->get_child_property = goo_canvas_table_get_child_property; iface->set_child_property = goo_canvas_table_set_child_property; iface->get_transform_for_child = goo_canvas_table_get_transform_for_child; iface->update = goo_canvas_table_update; iface->get_requested_area = goo_canvas_table_get_requested_area; iface->get_requested_height = goo_canvas_table_get_requested_height; iface->allocate_area = goo_canvas_table_allocate_area; iface->paint = goo_canvas_table_paint; iface->get_items_at = goo_canvas_table_get_items_at; iface->set_model = goo_canvas_table_set_model; } /** * SECTION:goocanvastablemodel * @Title: GooCanvasTableModel * @Short_Description: a model for a table container to layout items. * * #GooCanvasTableModel is a model for a table container used to lay out other * canvas items. It is used in a similar way to how the GtkTable widget is used * to lay out GTK+ widgets. * * Item models are added to the table using the normal methods, then * goo_canvas_item_model_set_child_properties() is used to specify how each * child item is to be positioned within the table (i.e. which row and column * it is in, how much padding it should have and whether it should expand or * shrink). * * #GooCanvasTableModel is a subclass of #GooCanvasItemModelSimple and so * inherits all of the style properties such as "stroke-color", "fill-color" * and "line-width". Setting a style property on a #GooCanvasTableModel will * affect all children of the #GooCanvasTableModel (unless the children * override the property setting). * * #GooCanvasTableModel implements the #GooCanvasItemModel interface, so you * can use the #GooCanvasItemModel functions such as * goo_canvas_item_model_raise() and goo_canvas_item_rotate(), and the * properties such as "visibility" and "pointer-events". * * To create a #GooCanvasTableModel use goo_canvas_table_model_new(). * * To get or set the properties of an existing #GooCanvasTableModel, use * g_object_get() and g_object_set(). */ static GooCanvasItemModelIface *goo_canvas_table_model_parent_iface; static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_table_model_finalize (GObject *object); static void goo_canvas_table_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_table_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasTableModel, goo_canvas_table_model, GOO_TYPE_CANVAS_GROUP_MODEL, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_table_model_class_init (GooCanvasTableModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; goo_canvas_table_model_parent_iface = g_type_interface_peek (goo_canvas_table_model_parent_class, GOO_TYPE_CANVAS_ITEM_MODEL); gobject_class->finalize = goo_canvas_table_model_finalize; gobject_class->get_property = goo_canvas_table_model_get_property; gobject_class->set_property = goo_canvas_table_model_set_property; goo_canvas_table_install_common_properties (gobject_class, goo_canvas_item_model_class_install_child_property); } static void goo_canvas_table_model_init (GooCanvasTableModel *tmodel) { goo_canvas_table_init_data (&tmodel->table_data); } /** * goo_canvas_table_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new table model. * * * * Here's an example showing how to create a table with a square, a circle and * a triangle in it: * * * GooCanvasItemModel *table, *square, *circle, *triangle; * * table = goo_canvas_table_model_new (root, * "row-spacing", 4.0, * "column-spacing", 4.0, * NULL); * goo_canvas_item_model_translate (table, 400, 200); * * square = goo_canvas_rect_model_new (table, 0.0, 0.0, 50.0, 50.0, * "fill-color", "red", * NULL); * goo_canvas_item_model_set_child_properties (table, square, * "row", 0, * "column", 0, * NULL); * * circle = goo_canvas_ellipse_model_new (table, 0.0, 0.0, 25.0, 25.0, * "fill-color", "blue", * NULL); * goo_canvas_item_model_set_child_properties (table, circle, * "row", 0, * "column", 1, * NULL); * * triangle = goo_canvas_polyline_model_new (table, TRUE, 3, * 25.0, 0.0, 0.0, 50.0, 50.0, 50.0, * "fill-color", "yellow", * NULL); * goo_canvas_item_model_set_child_properties (table, triangle, * "row", 0, * "column", 2, * NULL); * * * Returns: a new table model. **/ GooCanvasItemModel* goo_canvas_table_model_new (GooCanvasItemModel *parent, ...) { GooCanvasItemModel *model; va_list var_args; const char *first_property; model = g_object_new (GOO_TYPE_CANVAS_TABLE_MODEL, NULL); va_start (var_args, parent); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (model), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_table_model_finalize (GObject *object) { GooCanvasTableModel *tmodel = (GooCanvasTableModel*) object; goo_canvas_table_free_data (&tmodel->table_data); G_OBJECT_CLASS (goo_canvas_table_model_parent_class)->finalize (object); } static void goo_canvas_table_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasTableModel *emodel = (GooCanvasTableModel*) object; goo_canvas_table_get_common_property (object, &emodel->table_data, prop_id, value, pspec); } static void goo_canvas_table_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasTableModel *emodel = (GooCanvasTableModel*) object; gboolean recompute_bounds; recompute_bounds = goo_canvas_table_set_common_property (object, &emodel->table_data, prop_id, value, pspec); g_signal_emit_by_name (emodel, "changed", recompute_bounds); } static void goo_canvas_table_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position) { GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; goo_canvas_table_add_child_internal (&tmodel->table_data, position); /* Let the parent GooCanvasGroupModel code do the rest. */ goo_canvas_table_model_parent_iface->add_child (model, child, position); } static void goo_canvas_table_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position) { GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; goo_canvas_table_move_child_internal (&tmodel->table_data, old_position, new_position); /* Let the parent GooCanvasGroupModel code do the rest. */ goo_canvas_table_model_parent_iface->move_child (model, old_position, new_position); } static void goo_canvas_table_model_remove_child (GooCanvasItemModel *model, gint child_num) { GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; g_array_remove_index (tmodel->table_data.children, child_num); /* Let the parent GooCanvasGroupModel code do the rest. */ goo_canvas_table_model_parent_iface->remove_child (model, child_num); } static void goo_canvas_table_model_get_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, guint property_id, GValue *value, GParamSpec *pspec) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; GooCanvasTableChild *table_child; gint child_num; for (child_num = 0; child_num < gmodel->children->len; child_num++) { if (gmodel->children->pdata[child_num] == child) { table_child = &g_array_index (tmodel->table_data.children, GooCanvasTableChild, child_num); goo_canvas_table_get_common_child_property ((GObject*) tmodel, table_child, property_id, value, pspec); break; } } } static void goo_canvas_table_model_set_child_property (GooCanvasItemModel *model, GooCanvasItemModel *child, guint property_id, const GValue *value, GParamSpec *pspec) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; GooCanvasTableModel *tmodel = (GooCanvasTableModel*) model; GooCanvasTableChild *table_child; gint child_num; for (child_num = 0; child_num < gmodel->children->len; child_num++) { if (gmodel->children->pdata[child_num] == child) { table_child = &g_array_index (tmodel->table_data.children, GooCanvasTableChild, child_num); goo_canvas_table_set_common_child_property ((GObject*) tmodel, &tmodel->table_data, table_child, property_id, value, pspec); break; } } g_signal_emit_by_name (tmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_table_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = goo_canvas_table_new (NULL, NULL); /* Note that we set the canvas before the model, since we may need the canvas to create any child items. */ goo_canvas_item_set_canvas (item, canvas); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->add_child = goo_canvas_table_model_add_child; iface->move_child = goo_canvas_table_model_move_child; iface->remove_child = goo_canvas_table_model_remove_child; iface->get_child_property = goo_canvas_table_model_get_child_property; iface->set_child_property = goo_canvas_table_model_set_child_property; iface->create_item = goo_canvas_table_model_create_item; } goocanvas-0.15/src/goocanvasmarshal.h0000644000076400007640000000630411200564376014647 00000000000000 #ifndef __goo_canvas_marshal_MARSHAL_H__ #define __goo_canvas_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* VOID:VOID (./goocanvasmarshal.list:1) */ #define goo_canvas_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID /* VOID:INT (./goocanvasmarshal.list:2) */ #define goo_canvas_marshal_VOID__INT g_cclosure_marshal_VOID__INT /* VOID:INT,INT (./goocanvasmarshal.list:3) */ extern void goo_canvas_marshal_VOID__INT_INT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* VOID:BOOLEAN (./goocanvasmarshal.list:4) */ #define goo_canvas_marshal_VOID__BOOLEAN g_cclosure_marshal_VOID__BOOLEAN /* VOID:OBJECT,OBJECT (./goocanvasmarshal.list:5) */ extern void goo_canvas_marshal_VOID__OBJECT_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:BOXED (./goocanvasmarshal.list:6) */ extern void goo_canvas_marshal_BOOLEAN__BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:OBJECT,BOXED (./goocanvasmarshal.list:7) */ extern void goo_canvas_marshal_BOOLEAN__OBJECT_BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); /* BOOLEAN:DOUBLE,DOUBLE,BOOLEAN,OBJECT (./goocanvasmarshal.list:8) */ extern void goo_canvas_marshal_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); G_END_DECLS #endif /* __goo_canvas_marshal_MARSHAL_H__ */ goocanvas-0.15/src/goocanvasitemsimple.h0000644000076400007640000002142311172574677015404 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitemsimple.h - abstract base class for simple items. */ #ifndef __GOO_CANVAS_ITEM_SIMPLE_H__ #define __GOO_CANVAS_ITEM_SIMPLE_H__ #include #include "goocanvasitem.h" #include "goocanvasitemmodel.h" #include "goocanvasstyle.h" #include "goocanvasutils.h" G_BEGIN_DECLS /** * GooCanvasItemSimpleData * @style: the style to draw with. * @transform: the transformation matrix of the item, or %NULL. * @clip_path_commands: an array of #GooCanvasPathCommand specifying the clip * path of the item, or %NULL. * @tooltip: the item's tooltip. * @visibility_threshold: the threshold scale setting at which to show the item * (if the @visibility setting is set to %VISIBLE_ABOVE_THRESHOLD). * @visibility: the #GooCanvasItemVisibility setting specifying whether the * item is visible, invisible, or visible above a given canvas scale setting. * @pointer_events: the #GooCanvasPointerEvents setting specifying the events * the item should receive. * @can_focus: if the item can take the keyboard focus. * @own_style: if the item has its own style, rather than using its parent's. * @clip_fill_rule: the #cairo_fill_rule_t setting specifying the fill rule * used for the clip path. * @is_static: if the item is static. * * This is the data common to both the model and view classes. */ typedef struct _GooCanvasItemSimpleData GooCanvasItemSimpleData; struct _GooCanvasItemSimpleData { GooCanvasStyle *style; cairo_matrix_t *transform; GArray *clip_path_commands; gchar *tooltip; /*< public >*/ gdouble visibility_threshold; guint visibility : 2; guint pointer_events : 4; guint can_focus : 1; guint own_style : 1; guint clip_fill_rule : 4; guint is_static : 1; /*< private >*/ /* We might use this in future for a cache setting - never/always/visible. */ guint cache_setting : 2; /* We might need this for tooltips in future. */ guint has_tooltip : 1; }; #define GOO_TYPE_CANVAS_ITEM_SIMPLE (goo_canvas_item_simple_get_type ()) #define GOO_CANVAS_ITEM_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ITEM_SIMPLE, GooCanvasItemSimple)) #define GOO_CANVAS_ITEM_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_ITEM_SIMPLE, GooCanvasItemSimpleClass)) #define GOO_IS_CANVAS_ITEM_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ITEM_SIMPLE)) #define GOO_IS_CANVAS_ITEM_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_ITEM_SIMPLE)) #define GOO_CANVAS_ITEM_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_ITEM_SIMPLE, GooCanvasItemSimpleClass)) typedef struct _GooCanvasItemSimple GooCanvasItemSimple; typedef struct _GooCanvasItemSimpleClass GooCanvasItemSimpleClass; typedef struct _GooCanvasItemModelSimple GooCanvasItemModelSimple; /** * GooCanvasItemSimple * @canvas: the canvas. * @parent: the parent item. * @model: the item's model, if it has one. * @simple_data: data that is common to both the model and view classes. If * the canvas item has a model, this will point to the model's * #GooCanvasItemSimpleData, otherwise the canvas item will have its own * #GooCanvasItemSimpleData. * @bounds: the bounds of the item, in device space. * @need_update: if the item needs to recompute its bounds and redraw. * @need_entire_subtree_update: if all descendants need to be updated. * * The #GooCanvasItemSimple-struct struct contains the basic data needed to * implement canvas items. */ struct _GooCanvasItemSimple { /* */ GObject parent_object; /* */ GooCanvas *canvas; GooCanvasItem *parent; GooCanvasItemModelSimple *model; GooCanvasItemSimpleData *simple_data; GooCanvasBounds bounds; guint need_update : 1; guint need_entire_subtree_update : 1; /* */ /* We might use this in future for things like a cache. */ gpointer priv; }; /** * GooCanvasItemSimpleClass * @simple_create_path: simple subclasses that draw basic shapes and paths only * need to override this one method. It creates the path for the item. * All updating, painting and hit-testing is provided automatically by the * #GooCanvasItemSimple class. (This method is used by the builtin * #GooCanvasEllipse, #GooCanvasRect and #GooCanvasPath items.) * More complicated subclasses must override @simple_update, @simple_paint and * @simple_is_item_at instead. * @simple_update: subclasses should override this to calculate their new * bounds, in user space. * @simple_paint: subclasses should override this to paint their item. * @simple_is_item_at: subclasses should override this to do hit-testing. * * The #GooCanvasItemSimpleClass-struct struct contains several methods that * subclasses can override. * * Simple items need only implement the create_path() method. More complex * items must override the update(), paint() and is_item_at() methods instead. */ struct _GooCanvasItemSimpleClass { /*< private >*/ GObjectClass parent_class; /*< public >*/ void (* simple_create_path) (GooCanvasItemSimple *simple, cairo_t *cr); void (* simple_update) (GooCanvasItemSimple *simple, cairo_t *cr); void (* simple_paint) (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds); gboolean (* simple_is_item_at) (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event); /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_item_simple_get_type (void) G_GNUC_CONST; void goo_canvas_item_simple_get_path_bounds (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); void goo_canvas_item_simple_user_bounds_to_device (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); void goo_canvas_item_simple_user_bounds_to_parent (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds); gboolean goo_canvas_item_simple_check_in_path (GooCanvasItemSimple *item, gdouble x, gdouble y, cairo_t *cr, GooCanvasPointerEvents pointer_events); void goo_canvas_item_simple_paint_path (GooCanvasItemSimple *item, cairo_t *cr); void goo_canvas_item_simple_changed (GooCanvasItemSimple *item, gboolean recompute_bounds); void goo_canvas_item_simple_check_style (GooCanvasItemSimple *item); gdouble goo_canvas_item_simple_get_line_width (GooCanvasItemSimple *item); void goo_canvas_item_simple_set_model (GooCanvasItemSimple *item, GooCanvasItemModel *model); #define GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE (goo_canvas_item_model_simple_get_type ()) #define GOO_CANVAS_ITEM_MODEL_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, GooCanvasItemModelSimple)) #define GOO_CANVAS_ITEM_MODEL_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, GooCanvasItemModelSimpleClass)) #define GOO_IS_CANVAS_ITEM_MODEL_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE)) #define GOO_IS_CANVAS_ITEM_MODEL_SIMPLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE)) #define GOO_CANVAS_ITEM_MODEL_SIMPLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, GooCanvasItemModelSimpleClass)) typedef struct _GooCanvasItemModelSimpleClass GooCanvasItemModelSimpleClass; /** * GooCanvasItemModelSimple * @parent: the parent model. * @simple_data: data used by the canvas item for viewing the model. * * The #GooCanvasItemModelSimple-struct struct contains the basic data needed * to implement canvas item models. */ struct _GooCanvasItemModelSimple { GObject parent_object; /*< public >*/ GooCanvasItemModel *parent; GooCanvasItemSimpleData simple_data; /*< private >*/ /* The title and description of the item for accessibility. */ gchar *title; gchar *description; }; struct _GooCanvasItemModelSimpleClass { GObjectClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_item_model_simple_get_type (void) G_GNUC_CONST; G_END_DECLS #endif /* __GOO_CANVAS_ITEM_SIMPLE_H__ */ goocanvas-0.15/src/Makefile.am0000644000076400007640000001120411222155066013171 00000000000000## Process this file with automake to produce Makefile.in INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ -DG_LOG_DOMAIN=\"GooCanvas\" \ @PACKAGE_CFLAGS@ # -DG_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED \ # -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED \ # -DGTK_DISABLE_DEPRECATED lib_LTLIBRARIES = libgoocanvas.la libgoocanvas_la_LIBADD = @PACKAGE_LIBS@ $(INTLLIBS) if PLATFORM_WIN32 no_undefined = -no-undefined endif libtool_opts = \ -version-info $(LT_VERSION_INFO) \ -export-dynamic $(no_undefined) \ -rpath $(libdir) libgoocanvas_la_LDFLAGS = $(libtool_opts) libgoocanvasincludedir = $(includedir)/goocanvas-1.0 libgoocanvas_public_headers = \ goocanvasellipse.h \ goocanvasgrid.h \ goocanvasgroup.h \ goocanvasimage.h \ goocanvasitem.h \ goocanvasitemmodel.h \ goocanvasitemsimple.h \ goocanvaspolyline.h \ goocanvaspath.h \ goocanvasrect.h \ goocanvasstyle.h \ goocanvastable.h \ goocanvastext.h \ goocanvasutils.h \ goocanvaswidget.h \ goocanvas.h libgoocanvas_la_SOURCES = \ goocanvasatk.h \ goocanvasatk.c \ goocanvasellipse.c \ goocanvasenumtypes.c \ goocanvasgrid.c \ goocanvasgroup.c \ goocanvasimage.c \ goocanvasitem.c \ goocanvasitemmodel.c \ goocanvasitemsimple.c \ goocanvasmarshal.c \ goocanvaspolyline.c \ goocanvaspath.c \ goocanvasprivate.h \ goocanvasrect.c \ goocanvasstyle.c \ goocanvastable.c \ goocanvastext.c \ goocanvasutils.c \ goocanvaswidget.c \ goocanvas.c libgoocanvas_extra_sources = \ goocanvasmarshal.list libgoocanvas_built_headers = \ goocanvasenumtypes.h \ goocanvasmarshal.h libgoocanvas_built_sources = \ goocanvasenumtypes.c \ goocanvasmarshal.c stamp_files = \ stamp-goocanvasmarshal.h \ stamp-goocanvasenumtypes.h libgoocanvasinclude_HEADERS = \ $(libgoocanvas_public_headers) \ $(libgoocanvas_built_headers) # # Most of the stuff below has been pinched from the GTK+ Makefile.am, as # it is tricky to get right and we know it works for GTK+. # # all autogenerated files need to be generated in the srcdir, # so old versions get remade and are not confused with newer # versions in the build dir. thus a development setup requires # srcdir to be writable, passing --disable-rebuilds to # ../configure will supress all autogeneration rules. goocanvasmarshal.h: stamp-goocanvasmarshal.h @true stamp-goocanvasmarshal.h: @REBUILD@ goocanvasmarshal.list $(GLIB_GENMARSHAL) --prefix=goo_canvas_marshal $(srcdir)/goocanvasmarshal.list --header >> xgen-gmlh \ && (cmp -s xgen-gmlh goocanvasmarshal.h || cp xgen-gmlh goocanvasmarshal.h) \ && rm -f xgen-gmlh \ && echo timestamp > $(@F) goocanvasmarshal.c: @REBUILD@ goocanvasmarshal.list (echo "#include \"goocanvasmarshal.h\""; \ $(GLIB_GENMARSHAL) --prefix=goo_canvas_marshal $(srcdir)/goocanvasmarshal.list --body) >> xgen-gmlc \ && cp xgen-gmlc goocanvasmarshal.c \ && rm -f xgen-gmlc goocanvasenumtypes.h: stamp-goocanvasenumtypes.h @true stamp-goocanvasenumtypes.h: @REBUILD@ $(goo_canvas_public_headers) Makefile (cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#ifndef __GOO_CANVAS_ENUM_TYPES_H__\n#define __GOO_CANVAS_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ --fprod "/* Enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void);\n#define GOO_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n\n\n" \ --ftail "G_END_DECLS\n\n#endif /* __GOO_CANVAS_ENUM_TYPES_H__ */" \ $(libgoocanvas_public_headers)) >> xgen-gtbh \ && (cmp -s xgen-gtbh goocanvasenumtypes.h || cp xgen-gtbh goocanvasenumtypes.h ) \ && rm -f xgen-gtbh \ && echo timestamp > $(@F) goocanvasenumtypes.c: @REBUILD@ $(goo_canvas_public_headers) Makefile (cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#include \n" \ --fhead "#include \"goocanvas.h\"\n" \ --fprod "\n/* Enumerations from \"@filename@\" */" \ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if( etype == 0 ) \n {\n static const G@Type@Value values[] = {" \ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values );\n }\n return etype;\n}\n" \ $(libgoocanvas_public_headers)) > xgen-gtbc \ && cp xgen-gtbc goocanvasenumtypes.c \ && rm -f xgen-gtbc gen_sources = xgen-gdef xgen-gtbh xgen-gtic xgen-gmh xgen-gmc xgen-gmlh xgen-gmlc CLEANFILES = $(gen_sources) BUILT_SOURCES = $(libgoocanvas_built_headers) $(libgoocanvas_built_sources) MAINTAINERCLEANFILES = $(BUILT_SOURCES) $(stamp_files) EXTRA_DIST = $(BUILT_SOURCES) $(libgoocanvas_extra_sources) goocanvas-0.15/src/goocanvasatk.h0000644000076400007640000000102711172574677014011 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasatk.h - the accessibility code. */ #ifndef __GOO_CANVAS_ATK_H__ #define __GOO_CANVAS_ATK_H__ #include G_BEGIN_DECLS GType goo_canvas_accessible_factory_get_type (void) G_GNUC_CONST; GType goo_canvas_item_accessible_factory_get_type (void) G_GNUC_CONST; GType goo_canvas_widget_accessible_factory_get_type (void) G_GNUC_CONST; G_END_DECLS #endif /* __GOO_CANVAS_ATK_H__ */ goocanvas-0.15/src/goocanvasutils.h0000644000076400007640000002624711172574677014405 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasutils.h - utility functions. */ #ifndef __GOO_CANVAS_UTILS_H__ #define __GOO_CANVAS_UTILS_H__ #include G_BEGIN_DECLS /* * Enum types. */ /** * GooCanvasPointerEvents * @GOO_CANVAS_EVENTS_VISIBLE_MASK: a mask indicating that the item only * receives events when it is visible. * @GOO_CANVAS_EVENTS_PAINTED_MASK: a mask indicating that the item only * receives events when the specified parts of it are painted. * @GOO_CANVAS_EVENTS_FILL_MASK: a mask indicating that the filled part of * the item receives events. * @GOO_CANVAS_EVENTS_STROKE_MASK: a mask indicating that the stroked part * of the item receives events. * @GOO_CANVAS_EVENTS_NONE: the item doesn't receive events at all. * @GOO_CANVAS_EVENTS_VISIBLE_PAINTED: the item receives events in its * painted areas when it is visible (the default). * @GOO_CANVAS_EVENTS_VISIBLE_FILL: the item's interior receives events * when it is visible. * @GOO_CANVAS_EVENTS_VISIBLE_STROKE: the item's perimeter receives * events when it is visible. * @GOO_CANVAS_EVENTS_VISIBLE: the item receives events when it is visible, * whether it is painted or not. * @GOO_CANVAS_EVENTS_PAINTED: the item receives events in its painted areas, * whether it is visible or not. * @GOO_CANVAS_EVENTS_FILL: the item's interior receives events, whether it * is visible or painted or not. * @GOO_CANVAS_EVENTS_STROKE: the item's perimeter receives events, whether * it is visible or painted or not. * @GOO_CANVAS_EVENTS_ALL: the item's perimeter and interior receive events, * whether it is visible or painted or not. * * Specifies when an item receives pointer events such as mouse clicks. */ typedef enum { GOO_CANVAS_EVENTS_VISIBLE_MASK = 1 << 0, GOO_CANVAS_EVENTS_PAINTED_MASK = 1 << 1, GOO_CANVAS_EVENTS_FILL_MASK = 1 << 2, GOO_CANVAS_EVENTS_STROKE_MASK = 1 << 3, GOO_CANVAS_EVENTS_NONE = 0, GOO_CANVAS_EVENTS_VISIBLE_PAINTED = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_VISIBLE_FILL = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK, GOO_CANVAS_EVENTS_VISIBLE_STROKE = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_VISIBLE = GOO_CANVAS_EVENTS_VISIBLE_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_PAINTED = GOO_CANVAS_EVENTS_PAINTED_MASK | GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_FILL = GOO_CANVAS_EVENTS_FILL_MASK, GOO_CANVAS_EVENTS_STROKE = GOO_CANVAS_EVENTS_STROKE_MASK, GOO_CANVAS_EVENTS_ALL = GOO_CANVAS_EVENTS_FILL_MASK | GOO_CANVAS_EVENTS_STROKE_MASK } GooCanvasPointerEvents; /** * GooCanvasItemVisibility * @GOO_CANVAS_ITEM_HIDDEN: the item is invisible, and is not allocated any * space in layout container items such as #GooCanvasTable. * @GOO_CANVAS_ITEM_INVISIBLE: the item is invisible, but it is still allocated * space in layout container items. * @GOO_CANVAS_ITEM_VISIBLE: the item is visible. * @GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD: the item is visible when the * canvas scale setting is greater than or equal to the item's visibility * threshold setting. * * The #GooCanvasItemVisibility enumeration is used to specify when a canvas * item is visible. */ /* NOTE: Values are important here, as we test for <= GOO_CANVAS_ITEM_INVISIBLE to check if an item is invisible or hidden. */ typedef enum { GOO_CANVAS_ITEM_HIDDEN = 0, GOO_CANVAS_ITEM_INVISIBLE = 1, GOO_CANVAS_ITEM_VISIBLE = 2, GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD = 3 } GooCanvasItemVisibility; /** * GooCanvasPathCommandType * @GOO_CANVAS_PATH_MOVE_TO: move to the given point. * @GOO_CANVAS_PATH_CLOSE_PATH: close the current path, drawing a line from the * current position to the start of the path. * @GOO_CANVAS_PATH_LINE_TO: draw a line to the given point. * @GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: draw a horizontal line to the given * x coordinate. * @GOO_CANVAS_PATH_VERTICAL_LINE_TO: draw a vertical line to the given y * coordinate. * @GOO_CANVAS_PATH_CURVE_TO: draw a bezier curve using two control * points to the given point. * @GOO_CANVAS_PATH_SMOOTH_CURVE_TO: draw a bezier curve using a reflection * of the last control point of the last curve as the first control point, * and one new control point, to the given point. * @GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: draw a quadratic bezier curve using * a single control point to the given point. * @GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: draw a quadratic bezier curve * using a reflection of the control point from the previous curve as the * control point, to the given point. * @GOO_CANVAS_PATH_ELLIPTICAL_ARC: draw an elliptical arc, using the given * 2 radii, the x axis rotation, and the 2 flags to disambiguate the arc, * to the given point. * * GooCanvasPathCommandType specifies the type of each command in the path. * See the path element in the * Scalable Vector Graphics (SVG) specification for more details. */ typedef enum { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ GOO_CANVAS_PATH_MOVE_TO, GOO_CANVAS_PATH_CLOSE_PATH, GOO_CANVAS_PATH_LINE_TO, GOO_CANVAS_PATH_HORIZONTAL_LINE_TO, GOO_CANVAS_PATH_VERTICAL_LINE_TO, /* Bezier curve commands: CcSsQqTt. */ GOO_CANVAS_PATH_CURVE_TO, GOO_CANVAS_PATH_SMOOTH_CURVE_TO, GOO_CANVAS_PATH_QUADRATIC_CURVE_TO, GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO, /* The elliptical arc commands: Aa. */ GOO_CANVAS_PATH_ELLIPTICAL_ARC } GooCanvasPathCommandType; typedef union _GooCanvasPathCommand GooCanvasPathCommand; /* Note that the command type is always the first element in each struct, so we can always use it whatever type of command it is. */ /** * GooCanvasPathCommand * * GooCanvasPathCommand holds the data for each command in the path. * * The @relative flag specifies that the coordinates for the command are * relative to the current point. Otherwise they are assumed to be absolute * coordinates. */ union _GooCanvasPathCommand { /* Simple commands like moveto and lineto: MmZzLlHhVv. */ struct { guint type : 5; /* GooCanvasPathCommandType */ guint relative : 1; gdouble x, y; } simple; /* Bezier curve commands: CcSsQqTt. */ struct { guint type : 5; /* GooCanvasPathCommandType */ guint relative : 1; gdouble x, y, x1, y1, x2, y2; } curve; /* The elliptical arc commands: Aa. */ struct { guint type : 5; /* GooCanvasPathCommandType */ guint relative : 1; guint large_arc_flag : 1; guint sweep_flag : 1; gdouble rx, ry, x_axis_rotation, x, y; } arc; }; GArray* goo_canvas_parse_path_data (const gchar *path_data); void goo_canvas_create_path (GArray *commands, cairo_t *cr); /* * Cairo utilities. */ typedef struct _GooCanvasLineDash GooCanvasLineDash; /** * GooCanvasLineDash * @ref_count: the reference count of the struct. * @num_dashes: the number of dashes and gaps between them. * @dashes: the sizes of each dash and gap. * @dash_offset: the start offset into the dash pattern. * * #GooCanvasLineDash specifies a dash pattern to be used when drawing items. */ struct _GooCanvasLineDash { int ref_count; int num_dashes; double *dashes; double dash_offset; }; /* These are here so we can document the cairo type wrappers - don't use. */ #if 0 typedef cairo_antialias_t GooCairoAntialias; typedef cairo_fill_rule_t GooCairoFillRule; typedef cairo_hint_metrics_t GooCairoHintMetrics; typedef cairo_line_cap_t GooCairoLineCap; typedef cairo_line_join_t GooCairoLineJoin; typedef cairo_operator_t GooCairoOperator; typedef cairo_matrix_t GooCairoMatrix; typedef cairo_pattern_t GooCairoPattern; #endif /** * GooCairoAntialias * * #GooCairoAntialias is simply a wrapper for the #cairo_antialias_t type, * allowing it to be used for #GObject properties. * * See the #cairo_antialias_t documentation. */ /** * GooCairoFillRule * * #GooCairoFillRule is simply a wrapper for the #cairo_fill_rule_t type, * allowing it to be used for #GObject properties. * * See the #cairo_fill_rule_t documentation. */ /** * GooCairoHintMetrics * * #GooCairoHintMetrics is simply a wrapper for the #cairo_hint_metrics_t type, * allowing it to be used for #GObject properties. * * See the #cairo_hint_metrics_t documentation. */ /** * GooCairoLineCap * * #GooCairoLineCap is simply a wrapper for the #cairo_line_cap_t type, * allowing it to be used for #GObject properties. * * See the #cairo_line_cap_t documentation. */ /** * GooCairoLineJoin * * #GooCairoLineJoin is simply a wrapper for the #cairo_line_join_t type, * allowing it to be used for #GObject properties. * * See the #cairo_line_join_t documentation. */ /** * GooCairoOperator * * #GooCairoOperator is simply a wrapper for the #cairo_operator_t type, * allowing it to be used for #GObject properties. * * See the #cairo_operator_t documentation. */ /** * GooCairoMatrix * * #GooCairoMatrix is simply a wrapper for the #cairo_matrix_t type, * allowing it to be used for #GObject properties. * * See the #cairo_matrix_t documentation. */ /** * GooCairoPattern * * #GooCairoPattern is simply a wrapper for the #cairo_pattern_t type, * allowing it to be used for #GObject properties. * * See the #cairo_pattern_t documentation. */ #define GOO_TYPE_CANVAS_LINE_DASH (goo_canvas_line_dash_get_type ()) GType goo_canvas_line_dash_get_type (void) G_GNUC_CONST; GooCanvasLineDash* goo_canvas_line_dash_new (gint num_dashes, ...); GooCanvasLineDash* goo_canvas_line_dash_newv (gint num_dashes, double *dashes); GooCanvasLineDash* goo_canvas_line_dash_ref (GooCanvasLineDash *dash); void goo_canvas_line_dash_unref (GooCanvasLineDash *dash); #define GOO_TYPE_CAIRO_MATRIX (goo_cairo_matrix_get_type()) GType goo_cairo_matrix_get_type (void) G_GNUC_CONST; cairo_matrix_t* goo_cairo_matrix_copy (const cairo_matrix_t *matrix); void goo_cairo_matrix_free (cairo_matrix_t *matrix); #define GOO_TYPE_CAIRO_PATTERN (goo_cairo_pattern_get_type ()) GType goo_cairo_pattern_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_FILL_RULE (goo_cairo_fill_rule_get_type ()) GType goo_cairo_fill_rule_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_OPERATOR (goo_cairo_operator_get_type()) GType goo_cairo_operator_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_ANTIALIAS (goo_cairo_antialias_get_type()) GType goo_cairo_antialias_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_LINE_CAP (goo_cairo_line_cap_get_type ()) GType goo_cairo_line_cap_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_LINE_JOIN (goo_cairo_line_join_get_type ()) GType goo_cairo_line_join_get_type (void) G_GNUC_CONST; #define GOO_TYPE_CAIRO_HINT_METRICS (goo_cairo_hint_metrics_get_type ()) GType goo_cairo_hint_metrics_get_type (void) G_GNUC_CONST; G_END_DECLS #endif /* __GOO_CANVAS_UTILS_H__ */ goocanvas-0.15/src/goocanvasstyle.c0000644000076400007640000003431111172574677014367 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasstyle.c - cascading styles. */ /** * SECTION:goocanvasstyle * @Title: GooCanvasStyle * @Short_Description: support for cascading style properties for canvas items. * * #GooCanvasStyle provides support for cascading style properties for canvas * items. It is intended to be used when implementing new canvas items. * * Style properties are identified by a unique #GQuark, and contain * arbitrary data stored in a #GValue. * * #GooCanvasStyle also provides a few convenience functions such as * goo_canvas_style_set_stroke_options() and * goo_canvas_style_set_fill_options() which efficiently apply an item's * standard style properties to the given cairo_t. */ #include #include #include "goocanvasstyle.h" #include "goocanvasutils.h" /* GQuarks for the basic properties. */ /** * goo_canvas_style_stroke_pattern_id: * * Unique #GQuark identifier used for the standard stroke pattern property. **/ GQuark goo_canvas_style_stroke_pattern_id; /** * goo_canvas_style_fill_pattern_id: * * Unique #GQuark identifier used for the standard fill pattern property. **/ GQuark goo_canvas_style_fill_pattern_id; /** * goo_canvas_style_fill_rule_id: * * Unique #GQuark identifier used for the standard fill rule property. **/ GQuark goo_canvas_style_fill_rule_id; /** * goo_canvas_style_operator_id: * * Unique #GQuark identifier used for the standard operator property. **/ GQuark goo_canvas_style_operator_id; /** * goo_canvas_style_antialias_id: * * Unique #GQuark identifier used for the standard antialias property. **/ GQuark goo_canvas_style_antialias_id; /** * goo_canvas_style_line_width_id: * * Unique #GQuark identifier used for the standard line width property. **/ GQuark goo_canvas_style_line_width_id; /** * goo_canvas_style_line_cap_id: * * Unique #GQuark identifier used for the standard line cap property. **/ GQuark goo_canvas_style_line_cap_id; /** * goo_canvas_style_line_join_id: * * Unique #GQuark identifier used for the standard line join property. **/ GQuark goo_canvas_style_line_join_id; /** * goo_canvas_style_line_join_miter_limit_id: * * Unique #GQuark identifier used for the standard miter limit property. **/ GQuark goo_canvas_style_line_join_miter_limit_id; /** * goo_canvas_style_line_dash_id: * * Unique #GQuark identifier used for the standard line dash property. **/ GQuark goo_canvas_style_line_dash_id; /** * goo_canvas_style_font_desc_id: * * Unique #GQuark identifier used for the standard font description property. **/ GQuark goo_canvas_style_font_desc_id; /** * goo_canvas_style_hint_metrics_id: * * Unique #GQuark identifier used for the standard hint metrics property. **/ GQuark goo_canvas_style_hint_metrics_id; static void goo_canvas_style_dispose (GObject *object); static void goo_canvas_style_finalize (GObject *object); G_DEFINE_TYPE (GooCanvasStyle, goo_canvas_style, G_TYPE_OBJECT) /* Create GQuarks for the basic properties. This is called by goo_canvas_style_class_init(), goo_canvas_item_base_init() and goo_canvas_item_model_base_init() to try to ensure the GQuarks are initialized before they are needed. */ void _goo_canvas_style_init (void) { static gboolean initialized = FALSE; if (!initialized) { goo_canvas_style_stroke_pattern_id = g_quark_from_static_string ("GooCanvasStyle:stroke_pattern"); goo_canvas_style_fill_pattern_id = g_quark_from_static_string ("GooCanvasStyle:fill_pattern"); goo_canvas_style_fill_rule_id = g_quark_from_static_string ("GooCanvasStyle:fill_rule"); goo_canvas_style_operator_id = g_quark_from_static_string ("GooCanvasStyle:operator"); goo_canvas_style_antialias_id = g_quark_from_static_string ("GooCanvasStyle:antialias"); goo_canvas_style_line_width_id = g_quark_from_static_string ("GooCanvasStyle:line_width"); goo_canvas_style_line_cap_id = g_quark_from_static_string ("GooCanvasStyle:line_cap"); goo_canvas_style_line_join_id = g_quark_from_static_string ("GooCanvasStyle:line_join"); goo_canvas_style_line_join_miter_limit_id = g_quark_from_static_string ("GooCanvasStyle:line_join_miter_limit"); goo_canvas_style_line_dash_id = g_quark_from_static_string ("GooCanvasStyle:line_dash"); goo_canvas_style_font_desc_id = g_quark_from_static_string ("GooCanvasStyle:font_desc"); goo_canvas_style_hint_metrics_id = g_quark_from_static_string ("GooCanvasStyle:hint_metrics"); initialized = TRUE; } } static void goo_canvas_style_class_init (GooCanvasStyleClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->dispose = goo_canvas_style_dispose; gobject_class->finalize = goo_canvas_style_finalize; _goo_canvas_style_init (); } static void goo_canvas_style_init (GooCanvasStyle *style) { style->properties = g_array_new (0, 0, sizeof (GooCanvasStyleProperty)); } /** * goo_canvas_style_new: * * Creates a new #GooCanvasStyle. * * Returns: a new #GooCanvasStyle. **/ GooCanvasStyle* goo_canvas_style_new (void) { return GOO_CANVAS_STYLE (g_object_new (GOO_TYPE_CANVAS_STYLE, NULL)); } static void goo_canvas_style_dispose (GObject *object) { GooCanvasStyle *style = (GooCanvasStyle*) object; GooCanvasStyleProperty *property; gint i; if (style->parent) { g_object_unref (style->parent); style->parent = NULL; } /* Free the property GValues. */ for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); g_value_unset (&property->value); } g_array_set_size (style->properties, 0); G_OBJECT_CLASS (goo_canvas_style_parent_class)->dispose (object); } static void goo_canvas_style_finalize (GObject *object) { GooCanvasStyle *style = (GooCanvasStyle*) object; g_array_free (style->properties, TRUE); G_OBJECT_CLASS (goo_canvas_style_parent_class)->finalize (object); } /** * goo_canvas_style_copy: * @style: a #GooCanvasStyle. * * Copies the given #GooCanvasStyle, by copying all of its properties. * Though the parent of the new style is left unset. * * Returns: a copy of the given #GooCanvasStyle. **/ GooCanvasStyle* goo_canvas_style_copy (GooCanvasStyle *style) { GooCanvasStyle *copy; GooCanvasStyleProperty *property; gint i; copy = goo_canvas_style_new (); for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); goo_canvas_style_set_property (copy, property->id, &property->value); } return copy; } /** * goo_canvas_style_get_parent: * @style: a style. * * Gets the parent of the style. * * Returns: the parent of the given style, or %NULL. **/ GooCanvasStyle* goo_canvas_style_get_parent (GooCanvasStyle *style) { return style->parent; } /** * goo_canvas_style_set_parent: * @style: a style. * @parent: the new parent. * * Sets the parent of the style. **/ void goo_canvas_style_set_parent (GooCanvasStyle *style, GooCanvasStyle *parent) { if (style->parent == parent) return; if (style->parent) g_object_unref (style->parent); style->parent = parent; if (style->parent) g_object_ref (style->parent); } /** * goo_canvas_style_get_property: * @style: a style. * @property_id: the property identifier. * * Gets the value of a property. * * This searches though all the #GooCanvasStyle's own list of property settings * and also all ancestor #GooCanvasStyle objects. * * Note that it returns a pointer to the internal #GValue setting, which should * not be changed. * * Returns: the property value, or %NULL if it isn't set. **/ GValue* goo_canvas_style_get_property (GooCanvasStyle *style, GQuark property_id) { GooCanvasStyleProperty *property; gint i; /* Step up the hierarchy of styles until we find the property. Note that if style is passed in as NULL we simply return NULL. */ while (style) { for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); if (property->id == property_id) return &property->value; } style = style->parent; } return NULL; } /** * goo_canvas_style_set_property: * @style: a style. * @property_id: the property identifier. * @value: the value of the property. * * Sets a property in the style, replacing any current setting. * * Note that this will override the property setting in ancestor * #GooCanvasStyle objects. **/ void goo_canvas_style_set_property (GooCanvasStyle *style, GQuark property_id, const GValue *value) { GooCanvasStyleProperty *property, new_property = { 0 }; gint i; /* See if the property is already set. */ for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); if (property->id == property_id) { /* If the new value is NULL, remove the property setting, otherwise update the property value. */ if (value) { g_value_copy (value, &property->value); } else { g_value_unset (&property->value); g_array_remove_index_fast (style->properties, i); } return; } } /* The property isn't set, so append a new property. */ if (value) { new_property.id = property_id; g_value_init (&new_property.value, G_VALUE_TYPE (value)); g_value_copy (value, &new_property.value); g_array_append_val (style->properties, new_property); } } /** * goo_canvas_style_set_stroke_options: * @style: a style. * @cr: a cairo context. * * Sets the standard cairo stroke options using the given style. * * Returns: %TRUE if a paint source is set, or %FALSE if the stroke should * be skipped. **/ gboolean goo_canvas_style_set_stroke_options (GooCanvasStyle *style, cairo_t *cr) { GooCanvasStyleProperty *property; gboolean operator_set = FALSE, antialias_set = FALSE; gboolean stroke_pattern_set = FALSE, line_width_set = FALSE; gboolean line_cap_set = FALSE, line_join_set = FALSE; gboolean miter_limit_set = FALSE, line_dash_set = FALSE; gboolean source_set = FALSE, need_stroke = TRUE; gint i; if (!style) return TRUE; /* Step up the hierarchy of styles looking for the properties. */ while (style) { for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); if (property->id == goo_canvas_style_operator_id && !operator_set) { cairo_set_operator (cr, property->value.data[0].v_long); operator_set = TRUE; } else if (property->id == goo_canvas_style_antialias_id && !antialias_set) { cairo_set_antialias (cr, property->value.data[0].v_long); antialias_set = TRUE; } else if (property->id == goo_canvas_style_stroke_pattern_id && !stroke_pattern_set) { if (property->value.data[0].v_pointer) { cairo_set_source (cr, property->value.data[0].v_pointer); source_set = TRUE; } else { /* If the stroke pattern has been explicitly set to NULL, then we don't need to do the stroke. */ need_stroke = FALSE; } stroke_pattern_set = TRUE; } else if (property->id == goo_canvas_style_line_width_id && !line_width_set) { cairo_set_line_width (cr, property->value.data[0].v_double); line_width_set = TRUE; } else if (property->id == goo_canvas_style_line_cap_id && !line_cap_set) { cairo_set_line_cap (cr, property->value.data[0].v_long); line_cap_set = TRUE; } else if (property->id == goo_canvas_style_line_join_id && !line_join_set) { cairo_set_line_join (cr, property->value.data[0].v_long); line_join_set = TRUE; } else if (property->id == goo_canvas_style_line_join_miter_limit_id && !miter_limit_set) { cairo_set_miter_limit (cr, property->value.data[0].v_double); miter_limit_set = TRUE; } else if (property->id == goo_canvas_style_line_dash_id && !line_dash_set) { GooCanvasLineDash *dash = property->value.data[0].v_pointer; cairo_set_dash (cr, dash->dashes, dash->num_dashes, dash->dash_offset); line_dash_set = TRUE; } } style = style->parent; } /* If a stroke pattern hasn't been set in the style we reset the source to black, just in case a fill pattern was used for the item. */ if (!source_set) cairo_set_source_rgb (cr, 0, 0, 0); return need_stroke; } /** * goo_canvas_style_set_fill_options: * @style: a style. * @cr: a cairo context. * * Sets the standard cairo fill options using the given style. * * Returns: %TRUE if a paint source is set, or %FALSE if the fill should * be skipped. **/ gboolean goo_canvas_style_set_fill_options (GooCanvasStyle *style, cairo_t *cr) { GooCanvasStyleProperty *property; gboolean operator_set = FALSE, antialias_set = FALSE; gboolean fill_rule_set = FALSE, fill_pattern_set = FALSE; gboolean need_fill = FALSE; gint i; if (!style) return FALSE; /* Step up the hierarchy of styles looking for the properties. */ while (style) { for (i = 0; i < style->properties->len; i++) { property = &g_array_index (style->properties, GooCanvasStyleProperty, i); if (property->id == goo_canvas_style_operator_id && !operator_set) { cairo_set_operator (cr, property->value.data[0].v_long); operator_set = TRUE; } else if (property->id == goo_canvas_style_antialias_id && !antialias_set) { cairo_set_antialias (cr, property->value.data[0].v_long); antialias_set = TRUE; } else if (property->id == goo_canvas_style_fill_rule_id && !fill_rule_set) { cairo_set_fill_rule (cr, property->value.data[0].v_long); fill_rule_set = TRUE; } else if (property->id == goo_canvas_style_fill_pattern_id && !fill_pattern_set) { if (property->value.data[0].v_pointer) { cairo_set_source (cr, property->value.data[0].v_pointer); need_fill = TRUE; } fill_pattern_set = TRUE; } } style = style->parent; } return need_fill; } goocanvas-0.15/src/goocanvasmarshal.c0000644000076400007640000002513611200564376014646 00000000000000#include "goocanvasmarshal.h" #include #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_char (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_long #define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* VOID:VOID (./goocanvasmarshal.list:1) */ /* VOID:INT (./goocanvasmarshal.list:2) */ /* VOID:INT,INT (./goocanvasmarshal.list:3) */ void goo_canvas_marshal_VOID__INT_INT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1, gint arg_1, gint arg_2, gpointer data2); register GMarshalFunc_VOID__INT_INT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_int (param_values + 1), g_marshal_value_peek_int (param_values + 2), data2); } /* VOID:BOOLEAN (./goocanvasmarshal.list:4) */ /* VOID:OBJECT,OBJECT (./goocanvasmarshal.list:5) */ void goo_canvas_marshal_VOID__OBJECT_OBJECT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__OBJECT_OBJECT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__OBJECT_OBJECT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_object (param_values + 2), data2); } /* BOOLEAN:BOXED (./goocanvasmarshal.list:6) */ void goo_canvas_marshal_BOOLEAN__BOXED (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED) (gpointer data1, gpointer arg_1, gpointer data2); register GMarshalFunc_BOOLEAN__BOXED callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 2); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__BOXED) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_boxed (param_values + 1), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:OBJECT,BOXED (./goocanvasmarshal.list:7) */ void goo_canvas_marshal_BOOLEAN__OBJECT_BOXED (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_BOXED) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_BOOLEAN__OBJECT_BOXED callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__OBJECT_BOXED) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_object (param_values + 1), g_marshal_value_peek_boxed (param_values + 2), data2); g_value_set_boolean (return_value, v_return); } /* BOOLEAN:DOUBLE,DOUBLE,BOOLEAN,OBJECT (./goocanvasmarshal.list:8) */ void goo_canvas_marshal_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT (GClosure *closure, GValue *return_value G_GNUC_UNUSED, guint n_param_values, const GValue *param_values, gpointer invocation_hint G_GNUC_UNUSED, gpointer marshal_data) { typedef gboolean (*GMarshalFunc_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT) (gpointer data1, gdouble arg_1, gdouble arg_2, gboolean arg_3, gpointer arg_4, gpointer data2); register GMarshalFunc_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 5); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT) (marshal_data ? marshal_data : cc->callback); v_return = callback (data1, g_marshal_value_peek_double (param_values + 1), g_marshal_value_peek_double (param_values + 2), g_marshal_value_peek_boolean (param_values + 3), g_marshal_value_peek_object (param_values + 4), data2); g_value_set_boolean (return_value, v_return); } goocanvas-0.15/src/goocanvasimage.h0000644000076400007640000000712011172574677014314 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasimage.h - image item. */ #ifndef __GOO_CANVAS_IMAGE_H__ #define __GOO_CANVAS_IMAGE_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasImageData GooCanvasImageData; struct _GooCanvasImageData { cairo_pattern_t *pattern; gdouble x, y, width, height; }; #define GOO_TYPE_CANVAS_IMAGE (goo_canvas_image_get_type ()) #define GOO_CANVAS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_IMAGE, GooCanvasImage)) #define GOO_CANVAS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_IMAGE, GooCanvasImageClass)) #define GOO_IS_CANVAS_IMAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_IMAGE)) #define GOO_IS_CANVAS_IMAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_IMAGE)) #define GOO_CANVAS_IMAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_IMAGE, GooCanvasImageClass)) typedef struct _GooCanvasImage GooCanvasImage; typedef struct _GooCanvasImageClass GooCanvasImageClass; /** * GooCanvasImage * * The #GooCanvasImage-struct struct contains private data only. */ struct _GooCanvasImage { GooCanvasItemSimple parent_object; GooCanvasImageData *image_data; }; struct _GooCanvasImageClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_image_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_image_new (GooCanvasItem *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...); #define GOO_TYPE_CANVAS_IMAGE_MODEL (goo_canvas_image_model_get_type ()) #define GOO_CANVAS_IMAGE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_IMAGE_MODEL, GooCanvasImageModel)) #define GOO_CANVAS_IMAGE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_IMAGE_MODEL, GooCanvasImageModelClass)) #define GOO_IS_CANVAS_IMAGE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_IMAGE_MODEL)) #define GOO_IS_CANVAS_IMAGE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_IMAGE_MODEL)) #define GOO_CANVAS_IMAGE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_IMAGE_MODEL, GooCanvasImageModelClass)) typedef struct _GooCanvasImageModel GooCanvasImageModel; typedef struct _GooCanvasImageModelClass GooCanvasImageModelClass; /** * GooCanvasImageModel * * The #GooCanvasImageModel-struct struct contains private data only. */ struct _GooCanvasImageModel { GooCanvasItemModelSimple parent_object; GooCanvasImageData image_data; }; struct _GooCanvasImageModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_image_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_image_model_new (GooCanvasItemModel *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...); G_END_DECLS #endif /* __GOO_CANVAS_IMAGE_H__ */ goocanvas-0.15/src/goocanvaspath.c0000644000076400007640000006257611172574677014201 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaspath.c - a path item, very similar to the SVG path element. */ /** * SECTION:goocanvaspath * @Title: GooCanvasPath * @Short_Description: a path item (a series of lines and curves). * * GooCanvasPath represents a path item, which is a series of one or more * lines, bezier curves, or elliptical arcs. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * #GooCanvasPath uses the same path specification strings as the Scalable * Vector Graphics (SVG) path element. For details see the * SVG specification. * * To create a #GooCanvasPath use goo_canvas_path_new(). * * To get or set the properties of an existing #GooCanvasPath, use * g_object_get() and g_object_set(). */ #include #include #include #include "goocanvaspath.h" #include "goocanvas.h" enum { PROP_0, PROP_DATA, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT }; static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasPath, goo_canvas_path, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_path_install_common_properties (GObjectClass *gobject_class) { /** * GooCanvasPath:data * * The sequence of path commands, specified as a string using the same syntax * as in the Scalable Vector * Graphics (SVG) path element. */ g_object_class_install_property (gobject_class, PROP_DATA, g_param_spec_string ("data", _("Path Data"), _("The sequence of path commands"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the path"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the path"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the path"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the path"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); } static void goo_canvas_path_init (GooCanvasPath *path) { path->path_data = g_slice_new0 (GooCanvasPathData); } /** * goo_canvas_path_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @path_data: the sequence of path commands, specified as a string using the * same syntax as in the Scalable * Vector Graphics (SVG) path element. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new path item. * * * * Here's an example showing how to create a red line from (20,20) to (40,40): * * * GooCanvasItem *path = goo_canvas_path_new (mygroup, * "M 20 20 L 40 40", * "stroke-color", "red", * NULL); * * * This example creates a cubic bezier curve from (20,100) to (100,100) with * the control points at (20,50) and (100,50): * * * GooCanvasItem *path = goo_canvas_path_new (mygroup, * "M20,100 C20,50 100,50 100,100", * "stroke-color", "blue", * NULL); * * * This example uses an elliptical arc to create a filled circle with one * quarter missing: * * * GooCanvasItem *path = goo_canvas_path_new (mygroup, * "M200,500 h-150 a150,150 0 1,0 150,-150 z", * "fill-color", "red", * "stroke-color", "blue", * "line-width", 5.0, * NULL); * * * Returns: a new path item. **/ GooCanvasItem* goo_canvas_path_new (GooCanvasItem *parent, const gchar *path_data, ...) { GooCanvasItem *item; GooCanvasPath *path; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_PATH, NULL); path = (GooCanvasPath*) item; path->path_data->path_commands = goo_canvas_parse_path_data (path_data); va_start (var_args, path_data); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_path_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPath *path = (GooCanvasPath*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { if (path->path_data->path_commands) g_array_free (path->path_data->path_commands, TRUE); g_slice_free (GooCanvasPathData, path->path_data); } path->path_data = NULL; G_OBJECT_CLASS (goo_canvas_path_parent_class)->finalize (object); } static void goo_canvas_path_common_get_extent (GooCanvas *canvas, GooCanvasPathData *path_data, GooCanvasBounds *bounds) { cairo_t *cr; cr = goo_canvas_create_cairo_context (canvas); goo_canvas_create_path (path_data->path_commands, cr); cairo_fill_extents (cr, &bounds->x1, &bounds->y1, &bounds->x2, &bounds->y2); cairo_destroy (cr); } /* Moves all the absolute points in the command by the given amounts. Relative points don't need to be moved. */ static void goo_canvas_path_move_command (GooCanvasPathCommand *cmd, gdouble x_offset, gdouble y_offset) { switch (cmd->simple.type) { case GOO_CANVAS_PATH_MOVE_TO: case GOO_CANVAS_PATH_CLOSE_PATH: case GOO_CANVAS_PATH_LINE_TO: case GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: case GOO_CANVAS_PATH_VERTICAL_LINE_TO: if (!cmd->simple.relative) { cmd->simple.x += x_offset; cmd->simple.y += y_offset; } break; case GOO_CANVAS_PATH_CURVE_TO: case GOO_CANVAS_PATH_SMOOTH_CURVE_TO: case GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: case GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: if (!cmd->curve.relative) { cmd->curve.x += x_offset; cmd->curve.y += y_offset; cmd->curve.x1 += x_offset; cmd->curve.y1 += y_offset; cmd->curve.x2 += x_offset; cmd->curve.y2 += y_offset; } break; case GOO_CANVAS_PATH_ELLIPTICAL_ARC: if (!cmd->arc.relative) { cmd->arc.x += x_offset; cmd->arc.y += y_offset; } break; default: g_assert_not_reached(); break; } } /* Scales all the points in the command by the given amounts. Absolute points are scaled about the given origin. */ static void goo_canvas_path_scale_command (GooCanvasPathCommand *cmd, gdouble x_origin, gdouble y_origin, gdouble x_scale, gdouble y_scale) { switch (cmd->simple.type) { case GOO_CANVAS_PATH_MOVE_TO: case GOO_CANVAS_PATH_CLOSE_PATH: case GOO_CANVAS_PATH_LINE_TO: case GOO_CANVAS_PATH_HORIZONTAL_LINE_TO: case GOO_CANVAS_PATH_VERTICAL_LINE_TO: if (cmd->simple.relative) { cmd->simple.x *= x_scale; cmd->simple.y *= y_scale; } else { cmd->simple.x = x_origin + (cmd->simple.x - x_origin) * x_scale; cmd->simple.y = y_origin + (cmd->simple.y - y_origin) * y_scale; } break; case GOO_CANVAS_PATH_CURVE_TO: case GOO_CANVAS_PATH_SMOOTH_CURVE_TO: case GOO_CANVAS_PATH_QUADRATIC_CURVE_TO: case GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO: if (cmd->curve.relative) { cmd->curve.x *= x_scale; cmd->curve.y *= y_scale; cmd->curve.x1 *= x_scale; cmd->curve.y1 *= y_scale; cmd->curve.x2 *= x_scale; cmd->curve.y2 *= y_scale; } else { cmd->curve.x = x_origin + (cmd->curve.x - x_origin) * x_scale; cmd->curve.y = y_origin + (cmd->curve.y - y_origin) * y_scale; cmd->curve.x1 = x_origin + (cmd->curve.x1 - x_origin) * x_scale; cmd->curve.y1 = y_origin + (cmd->curve.y1 - y_origin) * y_scale; cmd->curve.x2 = x_origin + (cmd->curve.x2 - x_origin) * x_scale; cmd->curve.y2 = y_origin + (cmd->curve.y2 - y_origin) * y_scale; } break; case GOO_CANVAS_PATH_ELLIPTICAL_ARC: if (cmd->arc.relative) { cmd->arc.x *= x_scale; cmd->arc.y *= y_scale; } else { cmd->arc.x = x_origin + (cmd->arc.x - x_origin) * x_scale; cmd->arc.y = y_origin + (cmd->arc.y - y_origin) * y_scale; } break; default: g_assert_not_reached(); break; } } static void goo_canvas_path_get_common_property (GObject *object, GooCanvas *canvas, GooCanvasPathData *path_data, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasBounds extent; switch (prop_id) { case PROP_X: goo_canvas_path_common_get_extent (canvas, path_data, &extent); g_value_set_double (value, extent.x1); break; case PROP_Y: goo_canvas_path_common_get_extent (canvas, path_data, &extent); g_value_set_double (value, extent.y1); break; case PROP_WIDTH: goo_canvas_path_common_get_extent (canvas, path_data, &extent); g_value_set_double (value, extent.x2 - extent.x1); break; case PROP_HEIGHT: goo_canvas_path_common_get_extent (canvas, path_data, &extent); g_value_set_double (value, extent.y2 - extent.y1); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_path_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPath *path = (GooCanvasPath*) object; goo_canvas_path_get_common_property (object, simple->canvas, path->path_data, prop_id, value, pspec); } static void goo_canvas_path_set_common_property (GObject *object, GooCanvas *canvas, GooCanvasPathData *path_data, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasBounds extent; GooCanvasPathCommand *cmd; gdouble x_offset, y_offset, x_scale, y_scale; guint i; switch (prop_id) { case PROP_DATA: if (path_data->path_commands) g_array_free (path_data->path_commands, TRUE); path_data->path_commands = goo_canvas_parse_path_data (g_value_get_string (value)); g_object_notify (object, "x"); g_object_notify (object, "y"); g_object_notify (object, "width"); g_object_notify (object, "height"); break; case PROP_X: if (path_data->path_commands->len > 0) { /* Calculate the x offset from the current position. */ goo_canvas_path_common_get_extent (canvas, path_data, &extent); x_offset = g_value_get_double (value) - extent.x1; /* Add the offset to all the absolute x coordinates. */ for (i = 0; i < path_data->path_commands->len; i++) { cmd = &g_array_index (path_data->path_commands, GooCanvasPathCommand, i); goo_canvas_path_move_command (cmd, x_offset, 0.0); } g_object_notify (object, "data"); } break; case PROP_Y: if (path_data->path_commands->len > 0) { /* Calculate the y offset from the current position. */ goo_canvas_path_common_get_extent (canvas, path_data, &extent); y_offset = g_value_get_double (value) - extent.y1; /* Add the offset to all the absolute y coordinates. */ for (i = 0; i < path_data->path_commands->len; i++) { cmd = &g_array_index (path_data->path_commands, GooCanvasPathCommand, i); goo_canvas_path_move_command (cmd, 0.0, y_offset); } g_object_notify (object, "data"); } break; case PROP_WIDTH: if (path_data->path_commands->len >= 2) { goo_canvas_path_common_get_extent (canvas, path_data, &extent); if (extent.x2 - extent.x1 != 0.0) { /* Calculate the amount to scale the path. */ x_scale = g_value_get_double (value) / (extent.x2 - extent.x1); /* Scale the x coordinates, relative to the left-most point. */ for (i = 0; i < path_data->path_commands->len; i++) { cmd = &g_array_index (path_data->path_commands, GooCanvasPathCommand, i); goo_canvas_path_scale_command (cmd, extent.x1, 0.0, x_scale, 1.0); } g_object_notify (object, "data"); } } break; case PROP_HEIGHT: if (path_data->path_commands->len >= 2) { goo_canvas_path_common_get_extent (canvas, path_data, &extent); if (extent.y2 - extent.y1 != 0.0) { /* Calculate the amount to scale the polyline. */ y_scale = g_value_get_double (value) / (extent.y2 - extent.y1); /* Scale the y coordinates, relative to the top-most point. */ for (i = 0; i < path_data->path_commands->len; i++) { cmd = &g_array_index (path_data->path_commands, GooCanvasPathCommand, i); goo_canvas_path_scale_command (cmd, 0.0, extent.y1, 1.0, y_scale); } g_object_notify (object, "data"); } } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_path_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasPath *path = (GooCanvasPath*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_path_set_common_property (object, simple->canvas, path->path_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_path_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasPath *path = (GooCanvasPath*) simple; goo_canvas_create_path (path->path_data->path_commands, cr); } static gboolean goo_canvas_path_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPointerEvents pointer_events = GOO_CANVAS_EVENTS_ALL; gboolean do_fill; /* By default only check the fill if a fill color/pattern is specified. */ do_fill = goo_canvas_style_set_fill_options (simple_data->style, cr); if (!do_fill) pointer_events &= ~GOO_CANVAS_EVENTS_FILL_MASK; /* If is_pointer_event is set use the pointer_events property instead. */ if (is_pointer_event) pointer_events = simple_data->pointer_events; goo_canvas_path_create_path (simple, cr); if (goo_canvas_item_simple_check_in_path (simple, x, y, cr, pointer_events)) return TRUE; return FALSE; } static void goo_canvas_path_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasPath *path = (GooCanvasPath*) item; GooCanvasPathModel *emodel = (GooCanvasPathModel*) model; /* If our data was allocated, free it. */ if (!simple->model) { if (path->path_data->path_commands) g_array_free (path->path_data->path_commands, TRUE); g_slice_free (GooCanvasPathData, path->path_data); } /* Now use the new model's data instead. */ path->path_data = &emodel->path_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_path_set_model; } static void goo_canvas_path_class_init (GooCanvasPathClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->finalize = goo_canvas_path_finalize; gobject_class->get_property = goo_canvas_path_get_property; gobject_class->set_property = goo_canvas_path_set_property; simple_class->simple_create_path = goo_canvas_path_create_path; simple_class->simple_is_item_at = goo_canvas_path_is_item_at; goo_canvas_path_install_common_properties (gobject_class); } /** * SECTION:goocanvaspathmodel * @Title: GooCanvasPathModel * @Short_Description: a model for path items (a series of lines and curves). * * GooCanvasPathModel represents a model for path items, which are a series of * one or more lines, bezier curves, or elliptical arcs. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * #GooCanvasPathModel uses the same path specification strings as the Scalable * Vector Graphics (SVG) path element. For details see the * SVG specification. * * To create a #GooCanvasPathModel use goo_canvas_path_model_new(). * * To get or set the properties of an existing #GooCanvasPathModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the path you must connect * to the signal handlers of the corresponding #GooCanvasPath objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_path_model_finalize (GObject *object); static void goo_canvas_path_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_path_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasPathModel, goo_canvas_path_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_path_model_class_init (GooCanvasPathModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->finalize = goo_canvas_path_model_finalize; gobject_class->get_property = goo_canvas_path_model_get_property; gobject_class->set_property = goo_canvas_path_model_set_property; goo_canvas_path_install_common_properties (gobject_class); } static void goo_canvas_path_model_init (GooCanvasPathModel *pmodel) { } /** * goo_canvas_path_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @path_data: the sequence of path commands, specified as a string using the * same syntax as in the Scalable * Vector Graphics (SVG) path element. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new path model. * * * * Here's an example showing how to create a red line from (20,20) to (40,40): * * * GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup, * "M 20 20 L 40 40", * "stroke-color", "red", * NULL); * * * This example creates a cubic bezier curve from (20,100) to (100,100) with * the control points at (20,50) and (100,50): * * * GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup, * "M20,100 C20,50 100,50 100,100", * "stroke-color", "blue", * NULL); * * * This example uses an elliptical arc to create a filled circle with one * quarter missing: * * * GooCanvasItemModel *path = goo_canvas_path_model_new (mygroup, * "M200,500 h-150 a150,150 0 1,0 150,-150 z", * "fill-color", "red", * "stroke-color", "blue", * "line-width", 5.0, * NULL); * * * Returns: a new path model. **/ GooCanvasItemModel* goo_canvas_path_model_new (GooCanvasItemModel *parent, const gchar *path_data, ...) { GooCanvasItemModel *model; GooCanvasPathModel *pmodel; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_PATH_MODEL, NULL); pmodel = (GooCanvasPathModel*) model; pmodel->path_data.path_commands = goo_canvas_parse_path_data (path_data); va_start (var_args, path_data); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_path_model_finalize (GObject *object) { GooCanvasPathModel *pmodel = (GooCanvasPathModel*) object; if (pmodel->path_data.path_commands) g_array_free (pmodel->path_data.path_commands, TRUE); G_OBJECT_CLASS (goo_canvas_path_model_parent_class)->finalize (object); } static void goo_canvas_path_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasPathModel *pmodel = (GooCanvasPathModel*) object; goo_canvas_path_get_common_property (object, NULL, &pmodel->path_data, prop_id, value, pspec); } static void goo_canvas_path_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasPathModel *pmodel = (GooCanvasPathModel*) object; goo_canvas_path_set_common_property (object, NULL, &pmodel->path_data, prop_id, value, pspec); g_signal_emit_by_name (pmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_path_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_PATH, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_path_model_create_item; } goocanvas-0.15/src/goocanvasgrid.c0000644000076400007640000011536411172574677014164 00000000000000/* * GooCanvas. Copyright (C) 2005-8 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasgrid.c - a grid item. */ /** * SECTION:goocanvasgrid * @Title: GooCanvasGrid * @Short_Description: a grid item. * * GooCanvasGrid represents a grid item. * A grid consists of a number of equally-spaced horizontal and vertical * grid lines, plus an optional border. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasGrid use goo_canvas_grid_new(). * * To get or set the properties of an existing #GooCanvasGrid, use * g_object_get() and g_object_set(). * * The grid's position and size is specified with the #GooCanvasGrid:x, * #GooCanvasGrid:y, #GooCanvasGrid:width and #GooCanvasGrid:height properties. * * The #GooCanvasGrid:x-step and #GooCanvasGrid:y-step properties specify the * distance between grid lines. The #GooCanvasGrid:x-offset and * #GooCanvasGrid:y-offset properties specify the distance before the first * grid lines. * * The horizontal or vertical grid lines can be hidden using the * #GooCanvasGrid:show-horz-grid-lines and #GooCanvasGrid:show-vert-grid-lines * properties. * * The width of the border can be set using the #GooCanvasGrid:border-width * property. The border is drawn outside the area specified with the * #GooCanvasGrid:x, #GooCanvasGrid:y, #GooCanvasGrid:width and * #GooCanvasGrid:height properties. * * Other properties allow the colors and widths of the grid lines to be set. * The grid line color and width properties override the standard * #GooCanvasItemSimple:stroke-color and #GooCanvasItemSimple:line-width * properties, enabling different styles for horizontal and vertical grid lines. */ #include #include #include #include #include "goocanvasprivate.h" #include "goocanvas.h" enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_X_STEP, PROP_Y_STEP, PROP_X_OFFSET, PROP_Y_OFFSET, PROP_HORZ_GRID_LINE_WIDTH, PROP_VERT_GRID_LINE_WIDTH, PROP_HORZ_GRID_LINE_PATTERN, PROP_VERT_GRID_LINE_PATTERN, PROP_BORDER_WIDTH, PROP_BORDER_PATTERN, PROP_SHOW_HORZ_GRID_LINES, PROP_SHOW_VERT_GRID_LINES, PROP_VERT_GRID_LINES_ON_TOP, /* Convenience properties. */ PROP_HORZ_GRID_LINE_COLOR, PROP_HORZ_GRID_LINE_COLOR_RGBA, PROP_HORZ_GRID_LINE_PIXBUF, PROP_VERT_GRID_LINE_COLOR, PROP_VERT_GRID_LINE_COLOR_RGBA, PROP_VERT_GRID_LINE_PIXBUF, PROP_BORDER_COLOR, PROP_BORDER_COLOR_RGBA, PROP_BORDER_PIXBUF }; GooCanvasItemIface *goo_canvas_grid_parent_iface; static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasGrid, goo_canvas_grid, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_grid_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the grid"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the grid"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the grid"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the grid"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X_STEP, g_param_spec_double ("x-step", "X Step", _("The distance between the vertical grid lines"), 0.0, G_MAXDOUBLE, 10.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y_STEP, g_param_spec_double ("y-step", "Y Step", _("The distance between the horizontal grid lines"), 0.0, G_MAXDOUBLE, 10.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X_OFFSET, g_param_spec_double ("x-offset", "X Offset", _("The distance before the first vertical grid line"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y_OFFSET, g_param_spec_double ("y-offset", "Y Offset", _("The distance before the first horizontal grid line"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_WIDTH, g_param_spec_double ("horz-grid-line-width", _("Horizontal Grid Line Width"), _("The width of the horizontal grid lines"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_WIDTH, g_param_spec_double ("vert-grid-line-width", _("Vertical Grid Line Width"), _("The width of the vertical grid lines"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_PATTERN, g_param_spec_boxed ("horz-grid-line-pattern", _("Horizontal Grid Line Pattern"), _("The cairo pattern to paint the horizontal grid lines with"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_PATTERN, g_param_spec_boxed ("vert-grid-line-pattern", _("Vertical Grid Line Pattern"), _("The cairo pattern to paint the vertical grid lines with"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BORDER_WIDTH, g_param_spec_double ("border-width", _("Border Width"), _("The width of the border around the grid"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BORDER_PATTERN, g_param_spec_boxed ("border-pattern", _("Border Pattern"), _("The cairo pattern to paint the border with"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SHOW_HORZ_GRID_LINES, g_param_spec_boolean ("show-horz-grid-lines", _("Show Horizontal Grid Lines"), _("If the horizontal grid lines are shown"), TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SHOW_VERT_GRID_LINES, g_param_spec_boolean ("show-vert-grid-lines", _("Show Vertical Grid Lines"), _("If the vertical grid lines are shown"), TRUE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINES_ON_TOP, g_param_spec_boolean ("vert-grid-lines-on-top", _("Vertical Grid Lines On Top"), _("If the vertical grid lines are painted above the horizontal grid lines"), FALSE, G_PARAM_READWRITE)); /* Convenience properties - some are writable only. */ g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_COLOR, g_param_spec_string ("horz-grid-line-color", _("Horizontal Grid Line Color"), _("The color to use for the horizontal grid lines"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_COLOR_RGBA, g_param_spec_uint ("horz-grid-line-color-rgba", _("Horizontal Grid Line Color RGBA"), _("The color to use for the horizontal grid lines, specified as a 32-bit integer value"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HORZ_GRID_LINE_PIXBUF, g_param_spec_object ("horz-grid-line-pixbuf", _("Horizontal Grid Line Pixbuf"), _("The pixbuf to use to draw the horizontal grid lines"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_COLOR, g_param_spec_string ("vert-grid-line-color", _("Vertical Grid Line Color"), _("The color to use for the vertical grid lines"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_COLOR_RGBA, g_param_spec_uint ("vert-grid-line-color-rgba", _("Vertical Grid Line Color RGBA"), _("The color to use for the vertical grid lines, specified as a 32-bit integer value"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_VERT_GRID_LINE_PIXBUF, g_param_spec_object ("vert-grid-line-pixbuf", _("Vertical Grid Line Pixbuf"), _("The pixbuf to use to draw the vertical grid lines"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_BORDER_COLOR, g_param_spec_string ("border-color", _("Border Color"), _("The color to use for the border"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_BORDER_COLOR_RGBA, g_param_spec_uint ("border-color-rgba", _("Border Color RGBA"), _("The color to use for the border, specified as a 32-bit integer value"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_BORDER_PIXBUF, g_param_spec_object ("border-pixbuf", _("Border Pixbuf"), _("The pixbuf to use to draw the border"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); } /* This initializes the common grid data. */ static void goo_canvas_grid_init_data (GooCanvasGridData *grid_data) { grid_data->x = 0.0; grid_data->y = 0.0; grid_data->width = 0.0; grid_data->height = 0.0; grid_data->x_step = 10.0; grid_data->y_step = 10.0; grid_data->x_offset = 0.0; grid_data->y_offset = 0.0; grid_data->horz_grid_line_width = -1.0; grid_data->vert_grid_line_width = -1.0; grid_data->horz_grid_line_pattern = NULL; grid_data->vert_grid_line_pattern = NULL; grid_data->border_width = -1.0; grid_data->border_pattern = NULL; grid_data->show_horz_grid_lines = TRUE; grid_data->show_vert_grid_lines = TRUE; grid_data->vert_grid_lines_on_top = FALSE; } /* This frees the contents of the grid data, but not the struct itself. */ static void goo_canvas_grid_free_data (GooCanvasGridData *grid_data) { } static void goo_canvas_grid_init (GooCanvasGrid *grid) { grid->grid_data = g_slice_new0 (GooCanvasGridData); goo_canvas_grid_init_data (grid->grid_data); } /** * goo_canvas_grid_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @x: the x coordinate of the left of the grid. * @y: the y coordinate of the top of the grid. * @width: the width of the grid. * @height: the height of the grid. * @x_step: the distance between the vertical grid lines. * @y_step: the distance between the horizontal grid lines. * @x_offset: the distance before the first vertical grid line. * @y_offset: the distance before the first horizontal grid line. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new grid item. * * * * Here's an example showing how to create a grid: * * * GooCanvasItem *grid = goo_canvas_grid_new (mygroup, 100.0, 100.0, 400.0, 200.0, * 20.0, 20.0, 10.0, 10.0, * "horz-grid-line-width", 4.0, * "horz-grid-line-color", "yellow", * "vert-grid-line-width", 2.0, * "vert-grid-line-color", "red", * "border-width", 3.0, * "border-color", "white", * "fill-color", "blue", * NULL); * * * Returns: a new grid item. **/ GooCanvasItem* goo_canvas_grid_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...) { GooCanvasItem *item; GooCanvasGrid *grid; GooCanvasGridData *grid_data; va_list var_args; const char *first_property; item = g_object_new (GOO_TYPE_CANVAS_GRID, NULL); grid = (GooCanvasGrid*) item; grid_data = grid->grid_data; grid_data->x = x; grid_data->y = y; grid_data->width = width; grid_data->height = height; grid_data->x_step = x_step; grid_data->y_step = y_step; grid_data->x_offset = x_offset; grid_data->y_offset = y_offset; va_start (var_args, y_offset); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (item), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_grid_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasGrid *grid = (GooCanvasGrid*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) { goo_canvas_grid_free_data (grid->grid_data); g_slice_free (GooCanvasGridData, grid->grid_data); } grid->grid_data = NULL; G_OBJECT_CLASS (goo_canvas_grid_parent_class)->finalize (object); } static void goo_canvas_grid_get_common_property (GObject *object, GooCanvasGridData *grid_data, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, grid_data->x); break; case PROP_Y: g_value_set_double (value, grid_data->y); break; case PROP_WIDTH: g_value_set_double (value, grid_data->width); break; case PROP_HEIGHT: g_value_set_double (value, grid_data->height); break; case PROP_X_STEP: g_value_set_double (value, grid_data->x_step); break; case PROP_Y_STEP: g_value_set_double (value, grid_data->y_step); break; case PROP_X_OFFSET: g_value_set_double (value, grid_data->x_offset); break; case PROP_Y_OFFSET: g_value_set_double (value, grid_data->y_offset); break; case PROP_HORZ_GRID_LINE_WIDTH: g_value_set_double (value, grid_data->horz_grid_line_width); break; case PROP_VERT_GRID_LINE_WIDTH: g_value_set_double (value, grid_data->vert_grid_line_width); break; case PROP_HORZ_GRID_LINE_PATTERN: g_value_set_boxed (value, grid_data->horz_grid_line_pattern); break; case PROP_VERT_GRID_LINE_PATTERN: g_value_set_boxed (value, grid_data->vert_grid_line_pattern); break; case PROP_BORDER_WIDTH: g_value_set_double (value, grid_data->border_width); break; case PROP_BORDER_PATTERN: g_value_set_boxed (value, grid_data->border_pattern); break; case PROP_SHOW_HORZ_GRID_LINES: g_value_set_boolean (value, grid_data->show_horz_grid_lines); break; case PROP_SHOW_VERT_GRID_LINES: g_value_set_boolean (value, grid_data->show_vert_grid_lines); break; case PROP_VERT_GRID_LINES_ON_TOP: g_value_set_boolean (value, grid_data->vert_grid_lines_on_top); break; /* Convenience properties. */ case PROP_HORZ_GRID_LINE_COLOR_RGBA: goo_canvas_get_rgba_value_from_pattern (grid_data->horz_grid_line_pattern, value); break; case PROP_VERT_GRID_LINE_COLOR_RGBA: goo_canvas_get_rgba_value_from_pattern (grid_data->vert_grid_line_pattern, value); break; case PROP_BORDER_COLOR_RGBA: goo_canvas_get_rgba_value_from_pattern (grid_data->border_pattern, value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_grid_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasGrid *grid = (GooCanvasGrid*) object; goo_canvas_grid_get_common_property (object, grid->grid_data, prop_id, value, pspec); } static void goo_canvas_grid_set_common_property (GObject *object, GooCanvasGridData *grid_data, guint prop_id, const GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: grid_data->x = g_value_get_double (value); break; case PROP_Y: grid_data->y = g_value_get_double (value); break; case PROP_WIDTH: grid_data->width = g_value_get_double (value); break; case PROP_HEIGHT: grid_data->height = g_value_get_double (value); break; case PROP_X_STEP: grid_data->x_step = g_value_get_double (value); break; case PROP_Y_STEP: grid_data->y_step = g_value_get_double (value); break; case PROP_X_OFFSET: grid_data->x_offset = g_value_get_double (value); break; case PROP_Y_OFFSET: grid_data->y_offset = g_value_get_double (value); break; case PROP_HORZ_GRID_LINE_WIDTH: grid_data->horz_grid_line_width = g_value_get_double (value); break; case PROP_VERT_GRID_LINE_WIDTH: grid_data->vert_grid_line_width = g_value_get_double (value); break; case PROP_HORZ_GRID_LINE_PATTERN: cairo_pattern_destroy (grid_data->horz_grid_line_pattern); grid_data->horz_grid_line_pattern = g_value_get_boxed (value); cairo_pattern_reference (grid_data->horz_grid_line_pattern); break; case PROP_VERT_GRID_LINE_PATTERN: cairo_pattern_destroy (grid_data->vert_grid_line_pattern); grid_data->vert_grid_line_pattern = g_value_get_boxed (value); cairo_pattern_reference (grid_data->vert_grid_line_pattern); break; case PROP_BORDER_WIDTH: grid_data->border_width = g_value_get_double (value); break; case PROP_BORDER_PATTERN: cairo_pattern_destroy (grid_data->border_pattern); grid_data->border_pattern = g_value_get_boxed (value); cairo_pattern_reference (grid_data->border_pattern); break; case PROP_SHOW_HORZ_GRID_LINES: grid_data->show_horz_grid_lines = g_value_get_boolean (value); break; case PROP_SHOW_VERT_GRID_LINES: grid_data->show_vert_grid_lines = g_value_get_boolean (value); break; case PROP_VERT_GRID_LINES_ON_TOP: grid_data->vert_grid_lines_on_top = g_value_get_boolean (value); break; /* Convenience properties. */ case PROP_HORZ_GRID_LINE_COLOR: cairo_pattern_destroy (grid_data->horz_grid_line_pattern); grid_data->horz_grid_line_pattern = goo_canvas_create_pattern_from_color_value (value); break; case PROP_HORZ_GRID_LINE_COLOR_RGBA: cairo_pattern_destroy (grid_data->horz_grid_line_pattern); grid_data->horz_grid_line_pattern = goo_canvas_create_pattern_from_rgba_value (value); break; case PROP_HORZ_GRID_LINE_PIXBUF: cairo_pattern_destroy (grid_data->horz_grid_line_pattern); grid_data->horz_grid_line_pattern = goo_canvas_create_pattern_from_pixbuf_value (value); break; case PROP_VERT_GRID_LINE_COLOR: cairo_pattern_destroy (grid_data->vert_grid_line_pattern); grid_data->vert_grid_line_pattern = goo_canvas_create_pattern_from_color_value (value); break; case PROP_VERT_GRID_LINE_COLOR_RGBA: cairo_pattern_destroy (grid_data->vert_grid_line_pattern); grid_data->vert_grid_line_pattern = goo_canvas_create_pattern_from_rgba_value (value); break; case PROP_VERT_GRID_LINE_PIXBUF: cairo_pattern_destroy (grid_data->vert_grid_line_pattern); grid_data->vert_grid_line_pattern = goo_canvas_create_pattern_from_pixbuf_value (value); break; case PROP_BORDER_COLOR: cairo_pattern_destroy (grid_data->border_pattern); grid_data->border_pattern = goo_canvas_create_pattern_from_color_value (value); break; case PROP_BORDER_COLOR_RGBA: cairo_pattern_destroy (grid_data->border_pattern); grid_data->border_pattern = goo_canvas_create_pattern_from_rgba_value (value); break; case PROP_BORDER_PIXBUF: cairo_pattern_destroy (grid_data->border_pattern); grid_data->border_pattern = goo_canvas_create_pattern_from_pixbuf_value (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_grid_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasGrid *grid = (GooCanvasGrid*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_grid_set_common_property (object, grid->grid_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_grid_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasGrid *grid = (GooCanvasGrid*) simple; GooCanvasGridData *grid_data = grid->grid_data; gdouble border_width = 0.0; /* We can quickly compute the bounds as being just the grid's size plus the border width around each edge. */ if (grid_data->border_width > 0.0) border_width = grid_data->border_width; simple->bounds.x1 = grid_data->x - border_width; simple->bounds.y1 = grid_data->y - border_width; simple->bounds.x2 = grid_data->x + grid_data->width + border_width; simple->bounds.y2 = grid_data->y + grid_data->height + border_width; } static gdouble calculate_start_position (gdouble start_pos, gdouble step, gdouble redraw_start_pos, gdouble line_width) { gdouble n = 0.0, result; /* We want the first position where pos + line_width/2 >= redraw_start_pos. i.e. start_pos + (n * step) + (line_width / 2) >= redraw_start_pos, or (n * step) >= redraw_start_pos - start_pos - (line_width / 2), or n >= (redraw_start_pos - start_pos - (line_width / 2) / step). */ if (step > 0.0) n = ceil (((redraw_start_pos - start_pos - (line_width / 2.0))) / step); if (n <= 0.0) result = start_pos; else result = start_pos + (n * step); return result; } static void paint_vertical_lines (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGrid *grid = (GooCanvasGrid*) simple; GooCanvasGridData *grid_data = grid->grid_data; double x, max_x, max_y, max_bounds_x, line_width; gboolean has_stroke; if (!grid_data->show_vert_grid_lines) return; max_x = grid_data->x + grid_data->width; max_y = grid_data->y + grid_data->height; has_stroke = goo_canvas_style_set_stroke_options (simple_data->style, cr); line_width = goo_canvas_item_simple_get_line_width (simple); /* If the grid's vertical grid line pattern/color has been set, use that. If not, and we don't have a stroke color just return. */ if (grid_data->vert_grid_line_pattern) cairo_set_source (cr, grid_data->vert_grid_line_pattern); else if (!has_stroke) return; /* If the grid's vertical grid line width has been set, use that. */ if (grid_data->vert_grid_line_width > 0.0) { line_width = grid_data->vert_grid_line_width; cairo_set_line_width (cr, line_width); } cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); /* Calculate the first grid line that intersects the bounds to redraw. */ x = calculate_start_position (grid_data->x + grid_data->x_offset, grid_data->x_step, bounds->x1, line_width); /* Calculate the last possible line position. */ max_bounds_x = bounds->x2 + (line_width / 2.0); max_x = MIN (max_x, max_bounds_x); /* Add on a tiny fraction of step to avoid any double comparison issues. */ max_x += grid_data->x_step * 0.00001; while (x <= max_x) { cairo_move_to (cr, x, grid_data->y); cairo_line_to (cr, x, max_y); cairo_stroke (cr); /* Avoid an infinite loop. */ if (grid_data->x_step <= 0.0) break; x += grid_data->x_step; } } static void paint_horizontal_lines (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGrid *grid = (GooCanvasGrid*) simple; GooCanvasGridData *grid_data = grid->grid_data; double y, max_x, max_y, max_bounds_y, line_width; gboolean has_stroke; if (!grid_data->show_horz_grid_lines) return; max_x = grid_data->x + grid_data->width; max_y = grid_data->y + grid_data->height; has_stroke = goo_canvas_style_set_stroke_options (simple_data->style, cr); line_width = goo_canvas_item_simple_get_line_width (simple); /* If the grid's horizontal grid line pattern/color has been set, use that. If not, and we don't have a stroke color just return. */ if (grid_data->horz_grid_line_pattern) cairo_set_source (cr, grid_data->horz_grid_line_pattern); else if (!has_stroke) return; /* If the grid's horizontal grid line width has been set, use that. */ if (grid_data->horz_grid_line_width > 0.0) { line_width = grid_data->horz_grid_line_width; cairo_set_line_width (cr, grid_data->horz_grid_line_width); } cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); /* Calculate the first grid line that intersects the bounds to redraw. */ y = calculate_start_position (grid_data->y + grid_data->y_offset, grid_data->y_step, bounds->y1, line_width); /* Calculate the last possible line position. */ max_bounds_y = bounds->y2 + (line_width / 2.0); max_y = MIN (max_y, max_bounds_y); /* Add on a tiny fraction of step to avoid any double comparison issues. */ max_y += grid_data->y_step * 0.00001; while (y <= max_y) { cairo_move_to (cr, grid_data->x, y); cairo_line_to (cr, max_x, y); cairo_stroke (cr); /* Avoid an infinite loop. */ if (grid_data->y_step <= 0.0) break; y += grid_data->y_step; } } static void goo_canvas_grid_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGrid *grid = (GooCanvasGrid*) simple; GooCanvasGridData *grid_data = grid->grid_data; GooCanvasBounds redraw_bounds = *bounds; gdouble half_border_width; /* Paint the background in the fill pattern/color, if one is set. */ if (goo_canvas_style_set_fill_options (simple_data->style, cr)) { cairo_rectangle (cr, grid_data->x, grid_data->y, grid_data->width, grid_data->height); cairo_fill (cr); } /* Clip to the grid's area while painting the grid lines. */ cairo_save (cr); cairo_rectangle (cr, grid_data->x, grid_data->y, grid_data->width, grid_data->height); cairo_clip (cr); /* Convert the bounds to be redrawn from device space to item space. */ goo_canvas_convert_bounds_to_item_space (simple->canvas, (GooCanvasItem*) simple, &redraw_bounds); /* Paint the grid lines, in the required order. */ if (grid_data->vert_grid_lines_on_top) { paint_horizontal_lines (simple, cr, &redraw_bounds); paint_vertical_lines (simple, cr, &redraw_bounds); } else { paint_vertical_lines (simple, cr, &redraw_bounds); paint_horizontal_lines (simple, cr, &redraw_bounds); } cairo_restore (cr); /* Paint the border. */ if (grid_data->border_width > 0) { if (grid_data->border_pattern) cairo_set_source (cr, grid_data->border_pattern); else goo_canvas_style_set_stroke_options (simple_data->style, cr); cairo_set_line_width (cr, grid_data->border_width); half_border_width = grid_data->border_width / 2.0; cairo_rectangle (cr, grid_data->x - half_border_width, grid_data->y - half_border_width, grid_data->width + grid_data->border_width, grid_data->height + grid_data->border_width); cairo_stroke (cr); } } static void goo_canvas_grid_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGrid *grid = (GooCanvasGrid*) item; GooCanvasGridModel *gmodel = (GooCanvasGridModel*) model; /* If our grid_data was allocated, free it. */ if (!simple->model) { goo_canvas_grid_free_data (grid->grid_data); g_slice_free (GooCanvasGridData, grid->grid_data); } /* Now use the new model's grid_data instead. */ grid->grid_data = &gmodel->grid_data; /* Let the parent class do the rest. */ goo_canvas_grid_parent_iface->set_model (item, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_grid_set_model; } static void goo_canvas_grid_class_init (GooCanvasGridClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; goo_canvas_grid_parent_iface = g_type_interface_peek (goo_canvas_grid_parent_class, GOO_TYPE_CANVAS_ITEM); gobject_class->finalize = goo_canvas_grid_finalize; gobject_class->get_property = goo_canvas_grid_get_property; gobject_class->set_property = goo_canvas_grid_set_property; simple_class->simple_update = goo_canvas_grid_update; simple_class->simple_paint = goo_canvas_grid_paint; goo_canvas_grid_install_common_properties (gobject_class); } /** * SECTION:goocanvasgridmodel * @Title: GooCanvasGridModel * @Short_Description: a model for grid items. * * GooCanvasGridModel represents a model for grid items. * A grid consists of a number of equally-spaced horizontal and vertical * grid lines, plus an optional border. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasGridModel use goo_canvas_grid_model_new(). * * To get or set the properties of an existing #GooCanvasGridModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the grid you must connect * to the signal handlers of the corresponding #GooCanvasGrid objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) * * The grid's position and size is specified with the #GooCanvasGridModel:x, * #GooCanvasGridModel:y, #GooCanvasGridModel:width and * #GooCanvasGridModel:height properties. * * The #GooCanvasGridModel:x-step and #GooCanvasGridModel:y-step properties * specify the distance between grid lines. The #GooCanvasGridModel:x-offset * and #GooCanvasGridModel:y-offset properties specify the distance before the * first grid lines. * * The horizontal or vertical grid lines can be hidden using the * #GooCanvasGridModel:show-horz-grid-lines and * #GooCanvasGridModel:show-vert-grid-lines properties. * * The width of the border can be set using the #GooCanvasGridModel:border-width * property. The border is drawn outside the area specified with the * #GooCanvasGridModel:x, #GooCanvasGridModel:y, #GooCanvasGridModel:width and * #GooCanvasGridModel:height properties. * * Other properties allow the colors and widths of the grid lines to be set. * The grid line color and width properties override the standard * #GooCanvasItemModelSimple:stroke-color and * #GooCanvasItemModelSimple:line-width properties, enabling different styles * for horizontal and vertical grid lines. */ GooCanvasItemModelIface *goo_canvas_grid_model_parent_iface; static void item_model_interface_init (GooCanvasItemModelIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasGridModel, goo_canvas_grid_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_grid_model_init (GooCanvasGridModel *gmodel) { goo_canvas_grid_init_data (&gmodel->grid_data); } /** * goo_canvas_grid_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @x: the x coordinate of the left of the grid. * @y: the y coordinate of the top of the grid. * @width: the width of the grid. * @height: the height of the grid. * @x_step: the distance between the vertical grid lines. * @y_step: the distance between the horizontal grid lines. * @x_offset: the distance before the first vertical grid line. * @y_offset: the distance before the first horizontal grid line. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new grid model. * * * * Here's an example showing how to create a grid: * * * GooCanvasItemModel *grid = goo_canvas_grid_model_new (mygroup, 100.0, 100.0, 400.0, 200.0, * 20.0, 20.0, 10.0, 10.0, * "horz-grid-line-width", 4.0, * "horz-grid-line-color", "yellow", * "vert-grid-line-width", 2.0, * "vert-grid-line-color", "red", * "border-width", 3.0, * "border-color", "white", * "fill-color", "blue", * NULL); * * * Returns: a new grid model. **/ GooCanvasItemModel* goo_canvas_grid_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...) { GooCanvasItemModel *model; GooCanvasGridModel *gmodel; GooCanvasGridData *grid_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_GRID_MODEL, NULL); gmodel = (GooCanvasGridModel*) model; grid_data = &gmodel->grid_data; grid_data->x = x; grid_data->y = y; grid_data->width = width; grid_data->height = height; grid_data->x_step = x_step; grid_data->y_step = y_step; grid_data->x_offset = x_offset; grid_data->y_offset = y_offset; va_start (var_args, y_offset); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_grid_model_finalize (GObject *object) { GooCanvasGridModel *gmodel = (GooCanvasGridModel*) object; goo_canvas_grid_free_data (&gmodel->grid_data); G_OBJECT_CLASS (goo_canvas_grid_model_parent_class)->finalize (object); } static void goo_canvas_grid_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasGridModel *gmodel = (GooCanvasGridModel*) object; goo_canvas_grid_get_common_property (object, &gmodel->grid_data, prop_id, value, pspec); } static void goo_canvas_grid_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasGridModel *gmodel = (GooCanvasGridModel*) object; goo_canvas_grid_set_common_property (object, &gmodel->grid_data, prop_id, value, pspec); g_signal_emit_by_name (gmodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_grid_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_GRID, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_grid_model_create_item; } static void goo_canvas_grid_model_class_init (GooCanvasGridModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; goo_canvas_grid_model_parent_iface = g_type_interface_peek (goo_canvas_grid_model_parent_class, GOO_TYPE_CANVAS_ITEM_MODEL); gobject_class->finalize = goo_canvas_grid_model_finalize; gobject_class->get_property = goo_canvas_grid_model_get_property; gobject_class->set_property = goo_canvas_grid_model_set_property; goo_canvas_grid_install_common_properties (gobject_class); } goocanvas-0.15/src/goocanvasellipse.h0000644000076400007640000000747011172574677014677 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasellipse.h - ellipse item. */ #ifndef __GOO_CANVAS_ELLIPSE_H__ #define __GOO_CANVAS_ELLIPSE_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasEllipseData GooCanvasEllipseData; struct _GooCanvasEllipseData { gdouble center_x, center_y, radius_x, radius_y; }; #define GOO_TYPE_CANVAS_ELLIPSE (goo_canvas_ellipse_get_type ()) #define GOO_CANVAS_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ELLIPSE, GooCanvasEllipse)) #define GOO_CANVAS_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_ELLIPSE, GooCanvasEllipseClass)) #define GOO_IS_CANVAS_ELLIPSE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ELLIPSE)) #define GOO_IS_CANVAS_ELLIPSE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_ELLIPSE)) #define GOO_CANVAS_ELLIPSE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_ELLIPSE, GooCanvasEllipseClass)) typedef struct _GooCanvasEllipse GooCanvasEllipse; typedef struct _GooCanvasEllipseClass GooCanvasEllipseClass; /** * GooCanvasEllipse * * The #GooCanvasEllipse-struct struct contains private data only. */ struct _GooCanvasEllipse { GooCanvasItemSimple parent_object; GooCanvasEllipseData *ellipse_data; }; struct _GooCanvasEllipseClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_ellipse_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_ellipse_new (GooCanvasItem *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...); #define GOO_TYPE_CANVAS_ELLIPSE_MODEL (goo_canvas_ellipse_model_get_type ()) #define GOO_CANVAS_ELLIPSE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_ELLIPSE_MODEL, GooCanvasEllipseModel)) #define GOO_CANVAS_ELLIPSE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_ELLIPSE_MODEL, GooCanvasEllipseModelClass)) #define GOO_IS_CANVAS_ELLIPSE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_ELLIPSE_MODEL)) #define GOO_IS_CANVAS_ELLIPSE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_ELLIPSE_MODEL)) #define GOO_CANVAS_ELLIPSE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_ELLIPSE_MODEL, GooCanvasEllipseModelClass)) typedef struct _GooCanvasEllipseModel GooCanvasEllipseModel; typedef struct _GooCanvasEllipseModelClass GooCanvasEllipseModelClass; /** * GooCanvasEllipseModel * * The #GooCanvasEllipseModel-struct struct contains private data only. */ struct _GooCanvasEllipseModel { GooCanvasItemModelSimple parent_object; GooCanvasEllipseData ellipse_data; }; struct _GooCanvasEllipseModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_ellipse_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_ellipse_model_new (GooCanvasItemModel *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...); G_END_DECLS #endif /* __GOO_CANVAS_ELLIPSE_H__ */ goocanvas-0.15/src/goocanvasitemsimple.c0000644000076400007640000020507111172574677015402 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitemsimple.c - abstract base class for canvas items. */ /** * SECTION:goocanvasitemsimple * @Title: GooCanvasItemSimple * @Short_Description: the base class for the standard canvas items. * @Stability_Level: * @See_Also: * * #GooCanvasItemSimple is used as a base class for all of the standard canvas * items. It can also be used as the base class for new custom canvas items. * * It provides default implementations for many of the #GooCanvasItem * methods. * * For very simple items, all that is needed is to implement the create_path() * method. (#GooCanvasEllipse, #GooCanvasRect and #GooCanvasPath do this.) * * More complicated items need to implement the update(), paint() and * is_item_at() methods instead. (#GooCanvasImage, #GooCanvasPolyline, * #GooCanvasText and #GooCanvasWidget do this.) They may also need to * override some of the other GooCanvasItem methods such as set_canvas(), * set_parent() or allocate_area() if special code is needed. (#GooCanvasWidget * does this to make sure the #GtkWidget is embedded in the #GooCanvas widget * correctly.) */ #include #include #include #include "goocanvasprivate.h" #include "goocanvasitemsimple.h" #include "goocanvas.h" #include "goocanvasatk.h" enum { PROP_0, /* Basic drawing properties. */ PROP_STROKE_PATTERN, PROP_FILL_PATTERN, PROP_FILL_RULE, PROP_OPERATOR, PROP_ANTIALIAS, /* Line style & width properties. */ PROP_LINE_WIDTH, PROP_LINE_CAP, PROP_LINE_JOIN, PROP_LINE_JOIN_MITER_LIMIT, PROP_LINE_DASH, /* Font properties. */ PROP_FONT, PROP_FONT_DESC, PROP_HINT_METRICS, /* Convenience properties. */ PROP_STROKE_COLOR, PROP_STROKE_COLOR_RGBA, PROP_STROKE_PIXBUF, PROP_FILL_COLOR, PROP_FILL_COLOR_RGBA, PROP_FILL_PIXBUF, /* Other properties. Note that the order here is important PROP_TRANSFORM must be the first non-style property. see set_property(). */ PROP_TRANSFORM, PROP_PARENT, PROP_VISIBILITY, PROP_VISIBILITY_THRESHOLD, PROP_POINTER_EVENTS, PROP_TITLE, PROP_DESCRIPTION, PROP_CAN_FOCUS, PROP_CLIP_PATH, PROP_CLIP_FILL_RULE, PROP_TOOLTIP }; static gboolean accessibility_enabled = FALSE; static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_item_simple_dispose (GObject *object); static void goo_canvas_item_simple_finalize (GObject *object); static void goo_canvas_item_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_item_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void goo_canvas_item_simple_default_create_path (GooCanvasItemSimple *simple, cairo_t *cr); static void goo_canvas_item_simple_default_update (GooCanvasItemSimple *simple, cairo_t *cr); static void goo_canvas_item_simple_default_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds); static gboolean goo_canvas_item_simple_default_is_item_at (GooCanvasItemSimple *simple, double x, double y, cairo_t *cr, gboolean is_pointer_event); G_DEFINE_TYPE_WITH_CODE (GooCanvasItemSimple, goo_canvas_item_simple, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_item_simple_install_common_properties (GObjectClass *gobject_class) { /* Basic drawing properties. */ g_object_class_install_property (gobject_class, PROP_STROKE_PATTERN, g_param_spec_boxed ("stroke-pattern", _("Stroke Pattern"), _("The pattern to use to paint the perimeter of the item, or NULL disable painting"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FILL_PATTERN, g_param_spec_boxed ("fill-pattern", _("Fill Pattern"), _("The pattern to use to paint the interior of the item, or NULL to disable painting"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FILL_RULE, g_param_spec_enum ("fill-rule", _("Fill Rule"), _("The fill rule used to determine which parts of the item are filled"), GOO_TYPE_CAIRO_FILL_RULE, CAIRO_FILL_RULE_WINDING, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_OPERATOR, g_param_spec_enum ("operator", _("Operator"), _("The compositing operator to use"), GOO_TYPE_CAIRO_OPERATOR, CAIRO_OPERATOR_OVER, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ANTIALIAS, g_param_spec_enum ("antialias", _("Antialias"), _("The antialiasing mode to use"), GOO_TYPE_CAIRO_ANTIALIAS, CAIRO_ANTIALIAS_GRAY, G_PARAM_READWRITE)); /* Line style & width properties. */ g_object_class_install_property (gobject_class, PROP_LINE_WIDTH, g_param_spec_double ("line-width", _("Line Width"), _("The line width to use for the item's perimeter"), 0.0, G_MAXDOUBLE, 2.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LINE_CAP, g_param_spec_enum ("line-cap", _("Line Cap"), _("The line cap style to use"), GOO_TYPE_CAIRO_LINE_CAP, CAIRO_LINE_CAP_BUTT, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LINE_JOIN, g_param_spec_enum ("line-join", _("Line Join"), _("The line join style to use"), GOO_TYPE_CAIRO_LINE_JOIN, CAIRO_LINE_JOIN_MITER, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LINE_JOIN_MITER_LIMIT, g_param_spec_double ("line-join-miter-limit", _("Miter Limit"), _("The smallest angle to use with miter joins, in degrees. Bevel joins will be used below this limit"), 0.0, G_MAXDOUBLE, 10.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_LINE_DASH, g_param_spec_boxed ("line-dash", _("Line Dash"), _("The dash pattern to use"), GOO_TYPE_CANVAS_LINE_DASH, G_PARAM_READWRITE)); /* Font properties. */ g_object_class_install_property (gobject_class, PROP_FONT, g_param_spec_string ("font", _("Font"), _("The base font to use for the text"), NULL, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FONT_DESC, g_param_spec_boxed ("font-desc", _("Font Description"), _("The attributes specifying which font to use"), PANGO_TYPE_FONT_DESCRIPTION, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HINT_METRICS, g_param_spec_enum ("hint-metrics", _("Hint Metrics"), _("The hinting to be used for font metrics"), GOO_TYPE_CAIRO_HINT_METRICS, CAIRO_HINT_METRICS_OFF, G_PARAM_READWRITE)); /* Convenience properties - writable only. */ g_object_class_install_property (gobject_class, PROP_STROKE_COLOR, g_param_spec_string ("stroke-color", _("Stroke Color"), _("The color to use for the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_STROKE_COLOR_RGBA, g_param_spec_uint ("stroke-color-rgba", _("Stroke Color RGBA"), _("The color to use for the item's perimeter, specified as a 32-bit integer value. To disable painting set the 'stroke-pattern' property to NULL"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_STROKE_PIXBUF, g_param_spec_object ("stroke-pixbuf", _("Stroke Pixbuf"), _("The pixbuf to use to draw the item's perimeter. To disable painting set the 'stroke-pattern' property to NULL"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_FILL_COLOR, g_param_spec_string ("fill-color", _("Fill Color"), _("The color to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_FILL_COLOR_RGBA, g_param_spec_uint ("fill-color-rgba", _("Fill Color RGBA"), _("The color to use to paint the interior of the item, specified as a 32-bit integer value. To disable painting set the 'fill-pattern' property to NULL"), 0, G_MAXUINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_FILL_PIXBUF, g_param_spec_object ("fill-pixbuf", _("Fill Pixbuf"), _("The pixbuf to use to paint the interior of the item. To disable painting set the 'fill-pattern' property to NULL"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); /* Other properties. */ g_object_class_override_property (gobject_class, PROP_PARENT, "parent"); g_object_class_override_property (gobject_class, PROP_VISIBILITY, "visibility"); g_object_class_override_property (gobject_class, PROP_VISIBILITY_THRESHOLD, "visibility-threshold"); g_object_class_override_property (gobject_class, PROP_TRANSFORM, "transform"); g_object_class_override_property (gobject_class, PROP_POINTER_EVENTS, "pointer-events"); g_object_class_override_property (gobject_class, PROP_TITLE, "title"); g_object_class_override_property (gobject_class, PROP_DESCRIPTION, "description"); g_object_class_override_property (gobject_class, PROP_CAN_FOCUS, "can-focus"); g_object_class_override_property (gobject_class, PROP_TOOLTIP, "tooltip"); /** * GooCanvasItemSimple:clip-path * * The sequence of commands describing the clip path of the item, specified * as a string using the same syntax * as in the Scalable Vector * Graphics (SVG) path element. */ /** * GooCanvasItemModelSimple:clip-path * * The sequence of commands describing the clip path of the item, specified * as a string using the same syntax * as in the Scalable Vector * Graphics (SVG) path element. */ g_object_class_install_property (gobject_class, PROP_CLIP_PATH, g_param_spec_string ("clip-path", _("Clip Path"), _("The sequence of path commands specifying the clip path"), NULL, G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_CLIP_FILL_RULE, g_param_spec_enum ("clip-fill-rule", _("Clip Fill Rule"), _("The fill rule used to determine which parts of the item are clipped"), GOO_TYPE_CAIRO_FILL_RULE, CAIRO_FILL_RULE_WINDING, G_PARAM_READWRITE)); } static void goo_canvas_item_simple_class_init (GooCanvasItemSimpleClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->dispose = goo_canvas_item_simple_dispose; gobject_class->finalize = goo_canvas_item_simple_finalize; gobject_class->get_property = goo_canvas_item_simple_get_property; gobject_class->set_property = goo_canvas_item_simple_set_property; /* Register our accessible factory, but only if accessibility is enabled. */ if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET))) { accessibility_enabled = TRUE; atk_registry_set_factory_type (atk_get_default_registry (), GOO_TYPE_CANVAS_ITEM_SIMPLE, goo_canvas_item_accessible_factory_get_type ()); } goo_canvas_item_simple_install_common_properties (gobject_class); klass->simple_create_path = goo_canvas_item_simple_default_create_path; klass->simple_update = goo_canvas_item_simple_default_update; klass->simple_paint = goo_canvas_item_simple_default_paint; klass->simple_is_item_at = goo_canvas_item_simple_default_is_item_at; } static void goo_canvas_item_simple_init (GooCanvasItemSimple *item) { GooCanvasBounds *bounds = &item->bounds; bounds->x1 = bounds->y1 = bounds->x2 = bounds->y2 = 0.0; item->simple_data = g_slice_new0 (GooCanvasItemSimpleData); item->simple_data->visibility = GOO_CANVAS_ITEM_VISIBLE; item->simple_data->pointer_events = GOO_CANVAS_EVENTS_VISIBLE_PAINTED; item->simple_data->clip_fill_rule = CAIRO_FILL_RULE_WINDING; item->need_update = TRUE; item->need_entire_subtree_update = TRUE; } static void goo_canvas_item_simple_reset_model (GooCanvasItemSimple *simple) { if (simple->model) { g_signal_handlers_disconnect_matched (simple->model, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, simple); g_object_unref (simple->model); simple->model = NULL; simple->simple_data = NULL; } } /* Frees the contents of the GooCanvasItemSimpleData, but not the struct. */ static void goo_canvas_item_simple_free_data (GooCanvasItemSimpleData *simple_data) { if (simple_data) { if (simple_data->style) { g_object_unref (simple_data->style); simple_data->style = NULL; } if (simple_data->clip_path_commands) { g_array_free (simple_data->clip_path_commands, TRUE); simple_data->clip_path_commands = NULL; } g_slice_free (cairo_matrix_t, simple_data->transform); simple_data->transform = NULL; } } static void goo_canvas_item_simple_dispose (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; /* Remove the view from the GooCanvas hash table. */ if (simple->canvas && simple->model) goo_canvas_unregister_item (simple->canvas, (GooCanvasItemModel*) simple->model); goo_canvas_item_simple_reset_model (simple); goo_canvas_item_simple_free_data (simple->simple_data); G_OBJECT_CLASS (goo_canvas_item_simple_parent_class)->dispose (object); } static void goo_canvas_item_simple_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; g_slice_free (GooCanvasItemSimpleData, simple->simple_data); simple->simple_data = NULL; G_OBJECT_CLASS (goo_canvas_item_simple_parent_class)->finalize (object); } static void goo_canvas_item_simple_get_common_property (GObject *object, GooCanvasItemSimpleData *simple_data, GooCanvas *canvas, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasStyle *style = simple_data->style; GValue *svalue; gdouble line_width = 2.0; gchar *font = NULL; switch (prop_id) { /* Basic drawing properties. */ case PROP_STROKE_PATTERN: svalue = goo_canvas_style_get_property (style, goo_canvas_style_stroke_pattern_id); g_value_set_boxed (value, svalue ? svalue->data[0].v_pointer : NULL); break; case PROP_FILL_PATTERN: svalue = goo_canvas_style_get_property (style, goo_canvas_style_fill_pattern_id); g_value_set_boxed (value, svalue ? svalue->data[0].v_pointer : NULL); break; case PROP_FILL_RULE: svalue = goo_canvas_style_get_property (style, goo_canvas_style_fill_rule_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_FILL_RULE_WINDING); break; case PROP_OPERATOR: svalue = goo_canvas_style_get_property (style, goo_canvas_style_operator_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_OPERATOR_OVER); break; case PROP_ANTIALIAS: svalue = goo_canvas_style_get_property (style, goo_canvas_style_antialias_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_ANTIALIAS_GRAY); break; /* Line style & width properties. */ case PROP_LINE_WIDTH: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_width_id); if (svalue) line_width = svalue->data[0].v_double; else if (canvas) line_width = goo_canvas_get_default_line_width (canvas); g_value_set_double (value, line_width); break; case PROP_LINE_CAP: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_cap_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_LINE_CAP_BUTT); break; case PROP_LINE_JOIN: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_join_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_LINE_JOIN_MITER); break; case PROP_LINE_JOIN_MITER_LIMIT: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_join_miter_limit_id); g_value_set_double (value, svalue ? svalue->data[0].v_double : 10.0); break; case PROP_LINE_DASH: svalue = goo_canvas_style_get_property (style, goo_canvas_style_line_dash_id); g_value_set_boxed (value, svalue ? svalue->data[0].v_pointer : NULL); break; /* Font properties. */ case PROP_FONT: svalue = goo_canvas_style_get_property (style, goo_canvas_style_font_desc_id); if (svalue) font = pango_font_description_to_string (svalue->data[0].v_pointer); g_value_set_string (value, font); g_free (font); break; case PROP_FONT_DESC: svalue = goo_canvas_style_get_property (style, goo_canvas_style_font_desc_id); g_value_set_boxed (value, svalue ? svalue->data[0].v_pointer : NULL); break; case PROP_HINT_METRICS: svalue = goo_canvas_style_get_property (style, goo_canvas_style_hint_metrics_id); g_value_set_enum (value, svalue ? svalue->data[0].v_long : CAIRO_HINT_METRICS_OFF); break; /* Convenience properties. */ case PROP_STROKE_COLOR_RGBA: svalue = goo_canvas_style_get_property (style, goo_canvas_style_stroke_pattern_id); if (svalue) goo_canvas_get_rgba_value_from_pattern (svalue->data[0].v_pointer, value); break; case PROP_FILL_COLOR_RGBA: svalue = goo_canvas_style_get_property (style, goo_canvas_style_fill_pattern_id); if (svalue) goo_canvas_get_rgba_value_from_pattern (svalue->data[0].v_pointer, value); break; /* Other properties. */ case PROP_TRANSFORM: g_value_set_boxed (value, simple_data->transform); break; case PROP_VISIBILITY: g_value_set_enum (value, simple_data->visibility); break; case PROP_VISIBILITY_THRESHOLD: g_value_set_double (value, simple_data->visibility_threshold); break; case PROP_POINTER_EVENTS: g_value_set_flags (value, simple_data->pointer_events); break; case PROP_CAN_FOCUS: g_value_set_boolean (value, simple_data->can_focus); break; case PROP_CLIP_FILL_RULE: g_value_set_enum (value, simple_data->clip_fill_rule); break; case PROP_TOOLTIP: g_value_set_string (value, simple_data->tooltip); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_item_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasItemSimpleData *simple_data = simple->simple_data; AtkObject *accessible; switch (prop_id) { case PROP_PARENT: g_value_set_object (value, simple->parent); break; case PROP_TITLE: accessible = atk_gobject_accessible_for_object (object); g_value_set_string (value, atk_object_get_name (accessible)); break; case PROP_DESCRIPTION: accessible = atk_gobject_accessible_for_object (object); g_value_set_string (value, atk_object_get_description (accessible)); break; default: goo_canvas_item_simple_get_common_property (object, simple_data, simple->canvas, prop_id, value, pspec); break; } } static gboolean goo_canvas_item_simple_set_common_property (GObject *object, GooCanvasItemSimpleData *simple_data, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasStyle *style; cairo_pattern_t *pattern; gboolean recompute_bounds = FALSE; cairo_matrix_t *transform; GValue tmpval = { 0 }; const char *font_name; PangoFontDescription *font_desc = NULL; /* See if we need to create our own style. */ if (prop_id < PROP_TRANSFORM) { if (!simple_data->style) { simple_data->style = goo_canvas_style_new (); } else if (!simple_data->own_style) { g_object_unref (simple_data->style); simple_data->style = goo_canvas_style_new (); } simple_data->own_style = TRUE; } style = simple_data->style; switch (prop_id) { /* Basic drawing properties. */ case PROP_STROKE_PATTERN: goo_canvas_style_set_property (style, goo_canvas_style_stroke_pattern_id, value); break; case PROP_FILL_PATTERN: goo_canvas_style_set_property (style, goo_canvas_style_fill_pattern_id, value); break; case PROP_FILL_RULE: goo_canvas_style_set_property (style, goo_canvas_style_fill_rule_id, value); break; case PROP_OPERATOR: goo_canvas_style_set_property (style, goo_canvas_style_operator_id, value); break; case PROP_ANTIALIAS: goo_canvas_style_set_property (style, goo_canvas_style_antialias_id, value); break; /* Line style & width properties. */ case PROP_LINE_WIDTH: goo_canvas_style_set_property (style, goo_canvas_style_line_width_id, value); recompute_bounds = TRUE; break; case PROP_LINE_CAP: goo_canvas_style_set_property (style, goo_canvas_style_line_cap_id, value); recompute_bounds = TRUE; break; case PROP_LINE_JOIN: goo_canvas_style_set_property (style, goo_canvas_style_line_join_id, value); recompute_bounds = TRUE; break; case PROP_LINE_JOIN_MITER_LIMIT: goo_canvas_style_set_property (style, goo_canvas_style_line_join_miter_limit_id, value); recompute_bounds = TRUE; break; case PROP_LINE_DASH: goo_canvas_style_set_property (style, goo_canvas_style_line_dash_id, value); recompute_bounds = TRUE; break; /* Font properties. */ case PROP_FONT: font_name = g_value_get_string (value); if (font_name) font_desc = pango_font_description_from_string (font_name); g_value_init (&tmpval, PANGO_TYPE_FONT_DESCRIPTION); g_value_take_boxed (&tmpval, font_desc); goo_canvas_style_set_property (style, goo_canvas_style_font_desc_id, &tmpval); g_value_unset (&tmpval); recompute_bounds = TRUE; break; case PROP_FONT_DESC: goo_canvas_style_set_property (style, goo_canvas_style_font_desc_id, value); recompute_bounds = TRUE; break; case PROP_HINT_METRICS: goo_canvas_style_set_property (style, goo_canvas_style_hint_metrics_id, value); recompute_bounds = TRUE; break; /* Convenience properties. */ case PROP_STROKE_COLOR: pattern = goo_canvas_create_pattern_from_color_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_stroke_pattern_id, pattern); break; case PROP_STROKE_COLOR_RGBA: pattern = goo_canvas_create_pattern_from_rgba_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_stroke_pattern_id, pattern); break; case PROP_STROKE_PIXBUF: pattern = goo_canvas_create_pattern_from_pixbuf_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_stroke_pattern_id, pattern); break; case PROP_FILL_COLOR: pattern = goo_canvas_create_pattern_from_color_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_fill_pattern_id, pattern); break; case PROP_FILL_COLOR_RGBA: pattern = goo_canvas_create_pattern_from_rgba_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_fill_pattern_id, pattern); break; case PROP_FILL_PIXBUF: pattern = goo_canvas_create_pattern_from_pixbuf_value (value); goo_canvas_set_style_property_from_pattern (style, goo_canvas_style_fill_pattern_id, pattern); break; /* Other properties. */ case PROP_TRANSFORM: g_slice_free (cairo_matrix_t, simple_data->transform); transform = g_value_get_boxed (value); simple_data->transform = goo_cairo_matrix_copy (transform); recompute_bounds = TRUE; break; case PROP_VISIBILITY: simple_data->visibility = g_value_get_enum (value); break; case PROP_VISIBILITY_THRESHOLD: simple_data->visibility_threshold = g_value_get_double (value); break; case PROP_POINTER_EVENTS: simple_data->pointer_events = g_value_get_flags (value); break; case PROP_CAN_FOCUS: simple_data->can_focus = g_value_get_boolean (value); break; case PROP_CLIP_PATH: if (simple_data->clip_path_commands) g_array_free (simple_data->clip_path_commands, TRUE); simple_data->clip_path_commands = goo_canvas_parse_path_data (g_value_get_string (value)); recompute_bounds = TRUE; break; case PROP_CLIP_FILL_RULE: simple_data->clip_fill_rule = g_value_get_enum (value); recompute_bounds = TRUE; break; case PROP_TOOLTIP: simple_data->tooltip = g_value_dup_string (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } return recompute_bounds; } static void goo_canvas_item_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItem *item = (GooCanvasItem*) object; GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasItem *parent; AtkObject *accessible; gboolean recompute_bounds; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } switch (prop_id) { case PROP_PARENT: parent = g_value_get_object (value); goo_canvas_item_remove (item); goo_canvas_item_add_child (parent, item, -1); break; case PROP_TITLE: accessible = atk_gobject_accessible_for_object (object); atk_object_set_name (accessible, g_value_get_string (value)); break; case PROP_DESCRIPTION: accessible = atk_gobject_accessible_for_object (object); atk_object_set_description (accessible, g_value_get_string (value)); break; default: recompute_bounds = goo_canvas_item_simple_set_common_property (object, simple_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, recompute_bounds); break; } } static GooCanvas* goo_canvas_item_simple_get_canvas (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; return simple->canvas; } static void goo_canvas_item_simple_set_canvas (GooCanvasItem *item, GooCanvas *canvas) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; simple->canvas = canvas; } static GooCanvasItem* goo_canvas_item_simple_get_parent (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; return simple->parent; } static void goo_canvas_item_simple_set_parent (GooCanvasItem *item, GooCanvasItem *parent) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvas *canvas; simple->parent = parent; canvas = parent ? goo_canvas_item_get_canvas (parent) : NULL; goo_canvas_item_set_canvas (item, canvas); simple->need_update = TRUE; simple->need_entire_subtree_update = TRUE; } /** * goo_canvas_item_simple_changed: * @item: a #GooCanvasItemSimple. * @recompute_bounds: if the item's bounds need to be recomputed. * * This function is intended to be used by subclasses of #GooCanvasItemSimple. * * It is used as a callback for the "changed" signal of the item models. * It requests an update or redraw of the item as appropriate. **/ void goo_canvas_item_simple_changed (GooCanvasItemSimple *item, gboolean recompute_bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (recompute_bounds) { item->need_entire_subtree_update = TRUE; if (!item->need_update) { goo_canvas_item_request_update ((GooCanvasItem*) item); /* Do this after requesting an update, since GooCanvasGroup will ignore the update request if we do this first. */ item->need_update = TRUE; } } else { if (item->canvas) goo_canvas_request_item_redraw (item->canvas, &item->bounds, simple_data->is_static); } } static gboolean goo_canvas_item_simple_get_transform (GooCanvasItem *item, cairo_matrix_t *matrix) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (!simple_data->transform) return FALSE; *matrix = *simple_data->transform; return TRUE; } static void goo_canvas_item_simple_set_transform (GooCanvasItem *item, const cairo_matrix_t *transform) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (transform) { if (!simple_data->transform) simple_data->transform = g_slice_new (cairo_matrix_t); *simple_data->transform = *transform; } else { g_slice_free (cairo_matrix_t, simple_data->transform); simple_data->transform = NULL; } goo_canvas_item_simple_changed (simple, TRUE); } static GooCanvasStyle* goo_canvas_item_simple_get_style (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; return simple->simple_data->style; } static void goo_canvas_item_simple_set_style (GooCanvasItem *item, GooCanvasStyle *style) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (simple_data->style) g_object_unref (simple_data->style); if (style) { simple_data->style = goo_canvas_style_copy (style); simple_data->own_style = TRUE; } else { simple_data->style = NULL; simple_data->own_style = FALSE; } goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_item_simple_get_bounds (GooCanvasItem *item, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; if (simple->need_update) goo_canvas_item_ensure_updated (item); *bounds = simple->bounds; } static GList* goo_canvas_item_simple_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_visible, GList *found_items) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (item); GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; double user_x = x, user_y = y; cairo_matrix_t matrix; gboolean add_item = FALSE; if (simple->need_update) goo_canvas_item_ensure_updated (item); /* Skip the item if the point isn't in the item's bounds. */ if (simple->bounds.x1 > x || simple->bounds.x2 < x || simple->bounds.y1 > y || simple->bounds.y2 < y) return found_items; /* Check if the item should receive events. */ if (is_pointer_event) { if (simple_data->pointer_events == GOO_CANVAS_EVENTS_NONE) return found_items; if (simple_data->pointer_events & GOO_CANVAS_EVENTS_VISIBLE_MASK && (!parent_visible || simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold))) return found_items; } cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_device_to_user (cr, &user_x, &user_y); /* Remove any current translation, to avoid the 16-bit cairo limit. */ cairo_get_matrix (cr, &matrix); matrix.x0 = matrix.y0 = 0.0; cairo_set_matrix (cr, &matrix); /* If the item has a clip path, check if the point is inside it. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); if (!cairo_in_fill (cr, user_x, user_y)) { cairo_restore (cr); return found_items; } } add_item = class->simple_is_item_at (simple, user_x, user_y, cr, is_pointer_event); cairo_restore (cr); if (add_item) return g_list_prepend (found_items, item); else return found_items; } static gboolean goo_canvas_item_simple_default_is_item_at (GooCanvasItemSimple *simple, double x, double y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (simple); GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasPointerEvents pointer_events = GOO_CANVAS_EVENTS_ALL; if (is_pointer_event) pointer_events = simple_data->pointer_events; /* Use the virtual method subclasses define to create the path. */ class->simple_create_path (simple, cr); if (goo_canvas_item_simple_check_in_path (simple, x, y, cr, pointer_events)) return TRUE; return FALSE; } static gboolean goo_canvas_item_simple_is_visible (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold)) return FALSE; if (simple->parent) return goo_canvas_item_is_visible (simple->parent); return TRUE; } static gboolean goo_canvas_item_simple_get_is_static (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; return simple_data->is_static; } static void goo_canvas_item_simple_set_is_static (GooCanvasItem *item, gboolean is_static) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; simple_data->is_static = is_static; } /** * goo_canvas_item_simple_check_style: * @item: a #GooCanvasItemSimple. * * This function is intended to be used by subclasses of #GooCanvasItemSimple, * typically in their update() or get_requested_area() methods. * * It ensures that the item's style is setup correctly. If the item has its * own #GooCanvasStyle it makes sure the parent is set correctly. If it * doesn't have its own style it uses the parent item's style. **/ void goo_canvas_item_simple_check_style (GooCanvasItemSimple *item) { GooCanvasItemSimpleData *simple_data = item->simple_data; GooCanvasStyle *parent_style = NULL; if (item->parent) parent_style = goo_canvas_item_get_style (item->parent); if (simple_data->own_style) { goo_canvas_style_set_parent (simple_data->style, parent_style); } else if (simple_data->style != parent_style) { /* The item doesn't have its own style so we use the parent's (though that may also be NULL). */ if (simple_data->style) g_object_unref (simple_data->style); simple_data->style = parent_style; if (parent_style) g_object_ref (parent_style); } } static void goo_canvas_item_simple_update_internal (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (simple); GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasBounds tmp_bounds; cairo_matrix_t transform; simple->need_update = FALSE; goo_canvas_item_simple_check_style (simple); cairo_get_matrix (cr, &transform); class->simple_update (simple, cr); /* Modify the extents by the item's clip path. */ if (simple_data->clip_path_commands) { cairo_identity_matrix (cr); goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); cairo_fill_extents (cr, &tmp_bounds.x1, &tmp_bounds.y1, &tmp_bounds.x2, &tmp_bounds.y2); simple->bounds.x1 = MAX (simple->bounds.x1, tmp_bounds.x1); simple->bounds.y1 = MAX (simple->bounds.y1, tmp_bounds.y1); simple->bounds.x2 = MIN (simple->bounds.x2, tmp_bounds.x2); simple->bounds.y2 = MIN (simple->bounds.y2, tmp_bounds.y2); if (simple->bounds.x1 > simple->bounds.x2) simple->bounds.x2 = simple->bounds.x1; if (simple->bounds.y1 > simple->bounds.y2) simple->bounds.y2 = simple->bounds.y1; } cairo_set_matrix (cr, &transform); } static void goo_canvas_item_simple_default_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (simple); /* Use the identity matrix to get the bounds completely in user space. */ cairo_identity_matrix (cr); class->simple_create_path (simple, cr); goo_canvas_item_simple_get_path_bounds (simple, cr, &simple->bounds); } static void goo_canvas_item_simple_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; cairo_matrix_t matrix; double x_offset, y_offset; if (entire_tree || simple->need_update) { /* Request a redraw of the existing bounds. */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); /* Remove any current translation, to avoid the 16-bit cairo limit. */ cairo_get_matrix (cr, &matrix); x_offset = matrix.x0; y_offset = matrix.y0; matrix.x0 = matrix.y0 = 0.0; cairo_set_matrix (cr, &matrix); goo_canvas_item_simple_update_internal (simple, cr); goo_canvas_item_simple_user_bounds_to_device (simple, cr, &simple->bounds); /* Add the translation back to the bounds. */ simple->bounds.x1 += x_offset; simple->bounds.y1 += y_offset; simple->bounds.x2 += x_offset; simple->bounds.y2 += y_offset; cairo_restore (cr); /* Request a redraw of the new bounds. */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); } *bounds = simple->bounds; } static gboolean goo_canvas_item_simple_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; cairo_matrix_t matrix; double x_offset, y_offset; /* Request a redraw of the existing bounds. */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); /* Remove any current translation, to avoid the 16-bit cairo limit. */ cairo_get_matrix (cr, &matrix); x_offset = matrix.x0; y_offset = matrix.y0; matrix.x0 = matrix.y0 = 0.0; cairo_set_matrix (cr, &matrix); goo_canvas_item_simple_update_internal (simple, cr); if (simple->simple_data->visibility == GOO_CANVAS_ITEM_HIDDEN) { simple->bounds.x1 = simple->bounds.x2 = 0.0; simple->bounds.y1 = simple->bounds.y2 = 0.0; cairo_restore (cr); return FALSE; } /* FIXME: Maybe optimize by just converting the offsets to user space and adding them? */ /* Convert to device space. */ cairo_user_to_device (cr, &simple->bounds.x1, &simple->bounds.y1); cairo_user_to_device (cr, &simple->bounds.x2, &simple->bounds.y2); /* Add the translation back to the bounds. */ simple->bounds.x1 += x_offset; simple->bounds.y1 += y_offset; simple->bounds.x2 += x_offset; simple->bounds.y2 += y_offset; /* Restore the item's proper transformation matrix. */ matrix.x0 = x_offset; matrix.y0 = y_offset; cairo_set_matrix (cr, &matrix); /* Convert back to user space. */ cairo_device_to_user (cr, &simple->bounds.x1, &simple->bounds.y1); cairo_device_to_user (cr, &simple->bounds.x2, &simple->bounds.y2); /* Copy the user bounds to the requested area. */ *requested_area = simple->bounds; /* Convert to the parent's coordinate space. */ goo_canvas_item_simple_user_bounds_to_parent (simple, cr, requested_area); /* Convert the item's bounds to device space. */ goo_canvas_item_simple_user_bounds_to_device (simple, cr, &simple->bounds); cairo_restore (cr); return TRUE; } static void goo_canvas_item_simple_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; /* Simple items can't resize at all, so we just adjust the bounds x & y positions here, and let the item be clipped if necessary. */ simple->bounds.x1 += x_offset; simple->bounds.y1 += y_offset; simple->bounds.x2 += x_offset; simple->bounds.y2 += y_offset; /* Request a redraw of the new bounds. */ goo_canvas_request_item_redraw (simple->canvas, &simple->bounds, simple_data->is_static); } static void goo_canvas_item_simple_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (item); GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; /* Skip the item if the bounds don't intersect the expose rectangle. */ if (simple->bounds.x1 > bounds->x2 || simple->bounds.x2 < bounds->x1 || simple->bounds.y1 > bounds->y2 || simple->bounds.y2 < bounds->y1) return; /* Check if the item should be visible. */ if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && scale < simple_data->visibility_threshold)) return; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); /* Clip with the item's clip path, if it is set. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); cairo_clip (cr); } class->simple_paint (simple, cr, bounds); cairo_restore (cr); } static void goo_canvas_item_simple_default_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasItemSimpleClass *class = GOO_CANVAS_ITEM_SIMPLE_GET_CLASS (simple); class->simple_create_path (simple, cr); goo_canvas_item_simple_paint_path (simple, cr); } static void goo_canvas_item_simple_default_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { /* Do nothing. */ } static void goo_canvas_item_simple_title_changed (GooCanvasItemModelSimple *smodel, GParamSpec *pspec, GooCanvasItemSimple *item) { AtkObject *accessible; accessible = atk_gobject_accessible_for_object (G_OBJECT (item)); atk_object_set_name (accessible, smodel->title); } static void goo_canvas_item_simple_description_changed (GooCanvasItemModelSimple *smodel, GParamSpec *pspec, GooCanvasItemSimple *item) { AtkObject *accessible; accessible = atk_gobject_accessible_for_object (G_OBJECT (item)); atk_object_set_description (accessible, smodel->description); } static void goo_canvas_item_simple_setup_accessibility (GooCanvasItemSimple *item) { GooCanvasItemModelSimple *smodel = item->model; AtkObject *accessible; accessible = atk_gobject_accessible_for_object (G_OBJECT (item)); if (!ATK_IS_NO_OP_OBJECT (accessible)) { if (smodel->title) atk_object_set_name (accessible, smodel->title); if (smodel->description) atk_object_set_description (accessible, smodel->description); g_signal_connect (smodel, "notify::title", G_CALLBACK (goo_canvas_item_simple_title_changed), item); g_signal_connect (smodel, "notify::description", G_CALLBACK (goo_canvas_item_simple_description_changed), item); } } static void goo_canvas_item_model_simple_changed (GooCanvasItemModelSimple *smodel, gboolean recompute_bounds, GooCanvasItemSimple *simple) { goo_canvas_item_simple_changed (simple, recompute_bounds); } static GooCanvasItemModel* goo_canvas_item_simple_get_model (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; return (GooCanvasItemModel*) simple->model; } /** * goo_canvas_item_simple_set_model: * @item: a #GooCanvasItemSimple. * @model: the model that @item will view. * * This function should be called by subclasses of #GooCanvasItemSimple * in their set_model() method. **/ void goo_canvas_item_simple_set_model (GooCanvasItemSimple *item, GooCanvasItemModel *model) { g_return_if_fail (model != NULL); goo_canvas_item_simple_reset_model (item); goo_canvas_item_simple_free_data (item->simple_data); g_slice_free (GooCanvasItemSimpleData, item->simple_data); item->model = g_object_ref (model); item->simple_data = &item->model->simple_data; if (accessibility_enabled) goo_canvas_item_simple_setup_accessibility (item); g_signal_connect (model, "changed", G_CALLBACK (goo_canvas_item_model_simple_changed), item); } static void goo_canvas_item_simple_set_model_internal (GooCanvasItem *item, GooCanvasItemModel *model) { goo_canvas_item_simple_set_model ((GooCanvasItemSimple*) item, model); } static gboolean goo_canvas_item_simple_query_tooltip (GooCanvasItem *item, gdouble x, gdouble y, gboolean keyboard_tip, GtkTooltip *tooltip) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; if (simple_data->tooltip) { gtk_tooltip_set_markup (tooltip, simple_data->tooltip); return TRUE; } return FALSE; } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->get_canvas = goo_canvas_item_simple_get_canvas; iface->set_canvas = goo_canvas_item_simple_set_canvas; iface->get_parent = goo_canvas_item_simple_get_parent; iface->set_parent = goo_canvas_item_simple_set_parent; iface->get_bounds = goo_canvas_item_simple_get_bounds; iface->get_items_at = goo_canvas_item_simple_get_items_at; iface->update = goo_canvas_item_simple_update; iface->get_requested_area = goo_canvas_item_simple_get_requested_area; iface->allocate_area = goo_canvas_item_simple_allocate_area; iface->paint = goo_canvas_item_simple_paint; iface->get_transform = goo_canvas_item_simple_get_transform; iface->set_transform = goo_canvas_item_simple_set_transform; iface->get_style = goo_canvas_item_simple_get_style; iface->set_style = goo_canvas_item_simple_set_style; iface->is_visible = goo_canvas_item_simple_is_visible; iface->get_is_static = goo_canvas_item_simple_get_is_static; iface->set_is_static = goo_canvas_item_simple_set_is_static; iface->get_model = goo_canvas_item_simple_get_model; iface->set_model = goo_canvas_item_simple_set_model_internal; iface->query_tooltip = goo_canvas_item_simple_query_tooltip; } /** * goo_canvas_item_simple_paint_path: * @item: a #GooCanvasItemSimple. * @cr: a cairo context. * * This function is intended to be used by subclasses of #GooCanvasItemSimple. * * It paints the current path, using the item's style settings. **/ void goo_canvas_item_simple_paint_path (GooCanvasItemSimple *item, cairo_t *cr) { GooCanvasStyle *style = item->simple_data->style; if (goo_canvas_style_set_fill_options (style, cr)) cairo_fill_preserve (cr); if (goo_canvas_style_set_stroke_options (style, cr)) cairo_stroke (cr); cairo_new_path (cr); } /* Returns the bounds of the path, using the item's stroke and fill options, in device coords. Note that the bounds include both the stroke and the fill extents, even if they will not be painted. (We need this to handle the "pointer-events" property.) */ /** * goo_canvas_item_simple_get_path_bounds: * @item: a #GooCanvasItemSimple. * @cr: a cairo context. * @bounds: the #GooCanvasBounds struct to store the resulting bounding box. * * This function is intended to be used by subclasses of #GooCanvasItemSimple, * typically in their update() or get_requested_area() methods. * * It calculates the bounds of the current path, using the item's style * settings, and stores the results in the given #GooCanvasBounds struct. * * The returned bounds contains the bounding box of the path in device space, * converted to user space coordinates. To calculate the bounds completely in * user space, use cairo_identity_matrix() to temporarily reset the current * transformation matrix to the identity matrix. **/ void goo_canvas_item_simple_get_path_bounds (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasStyle *style = item->simple_data->style; GooCanvasBounds fill_bounds, stroke_bounds; /* Calculate the filled extents. */ goo_canvas_style_set_fill_options (style, cr); cairo_fill_extents (cr, &fill_bounds.x1, &fill_bounds.y1, &fill_bounds.x2, &fill_bounds.y2); /* Check the stroke. */ goo_canvas_style_set_stroke_options (style, cr); cairo_stroke_extents (cr, &stroke_bounds.x1, &stroke_bounds.y1, &stroke_bounds.x2, &stroke_bounds.y2); /* Workaround for cairo < 1.4.0. It used to just return odd values if the path had empty bounds. This fix will work, but only if there is no transform currently set, since cairo will convert to user space. */ if (cairo_version () < CAIRO_VERSION_ENCODE (1, 4, 0)) { if (fill_bounds.x1 == 32767.0 && fill_bounds.x2 == -32768.0) fill_bounds.x1 = fill_bounds.x2 = 0.0; if (stroke_bounds.x1 == 32767.0 && stroke_bounds.x2 == -32768.0) stroke_bounds.x1 = stroke_bounds.x2 = 0.0; } if (fill_bounds.x1 == 0.0 && fill_bounds.x2 == 0.0) { /* The fill bounds are empty so just use the stroke bounds. If the stroke bounds are also empty the bounds will be all 0.0. */ bounds->x1 = MIN (stroke_bounds.x1, stroke_bounds.x2); bounds->x2 = MAX (stroke_bounds.x1, stroke_bounds.x2); bounds->y1 = MIN (stroke_bounds.y1, stroke_bounds.y2); bounds->y2 = MAX (stroke_bounds.y1, stroke_bounds.y2); } else if (stroke_bounds.x1 == 0.0 && stroke_bounds.x2 == 0.0) { /* The stroke bounds are empty so just use the fill bounds. */ bounds->x1 = MIN (fill_bounds.x1, fill_bounds.x2); bounds->x2 = MAX (fill_bounds.x1, fill_bounds.x2); bounds->y1 = MIN (fill_bounds.y1, fill_bounds.y2); bounds->y2 = MAX (fill_bounds.y1, fill_bounds.y2); } else { /* Both fill & stoke bounds are non-empty so combine them. */ bounds->x1 = MIN (fill_bounds.x1, fill_bounds.x2); bounds->x2 = MAX (fill_bounds.x1, fill_bounds.x2); bounds->y1 = MIN (fill_bounds.y1, fill_bounds.y2); bounds->y2 = MAX (fill_bounds.y1, fill_bounds.y2); bounds->x1 = MIN (bounds->x1, stroke_bounds.x1); bounds->x1 = MIN (bounds->x1, stroke_bounds.x2); bounds->x2 = MAX (bounds->x2, stroke_bounds.x1); bounds->x2 = MAX (bounds->x2, stroke_bounds.x2); bounds->y1 = MIN (bounds->y1, stroke_bounds.y1); bounds->y1 = MIN (bounds->y1, stroke_bounds.y2); bounds->y2 = MAX (bounds->y2, stroke_bounds.y1); bounds->y2 = MAX (bounds->y2, stroke_bounds.y2); } } /** * goo_canvas_item_simple_user_bounds_to_device: * @item: a #GooCanvasItemSimple. * @cr: a cairo context. * @bounds: the bounds of the item, in the item's coordinate space. * * This function is intended to be used by subclasses of #GooCanvasItemSimple, * typically in their update() or get_requested_area() methods. * * It converts the item's bounds to a bounding box in the canvas (device) * coordinate space. **/ void goo_canvas_item_simple_user_bounds_to_device (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasBounds tmp_bounds = *bounds, tmp_bounds2 = *bounds; /* Convert the top-left and bottom-right corners to device coords. */ cairo_user_to_device (cr, &tmp_bounds.x1, &tmp_bounds.y1); cairo_user_to_device (cr, &tmp_bounds.x2, &tmp_bounds.y2); /* Now convert the top-right and bottom-left corners. */ cairo_user_to_device (cr, &tmp_bounds2.x1, &tmp_bounds2.y2); cairo_user_to_device (cr, &tmp_bounds2.x2, &tmp_bounds2.y1); /* Calculate the minimum x coordinate seen and put in x1. */ bounds->x1 = MIN (tmp_bounds.x1, tmp_bounds.x2); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x1); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x2); /* Calculate the maximum x coordinate seen and put in x2. */ bounds->x2 = MAX (tmp_bounds.x1, tmp_bounds.x2); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x1); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x2); /* Calculate the minimum y coordinate seen and put in y1. */ bounds->y1 = MIN (tmp_bounds.y1, tmp_bounds.y2); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y1); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y2); /* Calculate the maximum y coordinate seen and put in y2. */ bounds->y2 = MAX (tmp_bounds.y1, tmp_bounds.y2); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y1); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y2); } /** * goo_canvas_item_simple_user_bounds_to_parent: * @item: a #GooCanvasItemSimple. * @cr: a cairo context. * @bounds: the bounds of the item, in the item's coordinate space. * * This function is intended to be used by subclasses of #GooCanvasItemSimple, * typically in their get_requested_area() method. * * It converts the item's bounds to a bounding box in its parent's coordinate * space. If the item has no transformation matrix set then no conversion is * needed. **/ void goo_canvas_item_simple_user_bounds_to_parent (GooCanvasItemSimple *item, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimpleData *simple_data = item->simple_data; cairo_matrix_t *transform = simple_data->transform; GooCanvasBounds tmp_bounds, tmp_bounds2; if (!transform) return; tmp_bounds = tmp_bounds2 = *bounds; /* Convert the top-left and bottom-right corners to parent coords. */ cairo_matrix_transform_point (transform, &tmp_bounds.x1, &tmp_bounds.y1); cairo_matrix_transform_point (transform, &tmp_bounds.x2, &tmp_bounds.y2); /* Now convert the top-right and bottom-left corners. */ cairo_matrix_transform_point (transform, &tmp_bounds2.x1, &tmp_bounds2.y2); cairo_matrix_transform_point (transform, &tmp_bounds2.x2, &tmp_bounds2.y1); /* Calculate the minimum x coordinate seen and put in x1. */ bounds->x1 = MIN (tmp_bounds.x1, tmp_bounds.x2); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x1); bounds->x1 = MIN (bounds->x1, tmp_bounds2.x2); /* Calculate the maximum x coordinate seen and put in x2. */ bounds->x2 = MAX (tmp_bounds.x1, tmp_bounds.x2); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x1); bounds->x2 = MAX (bounds->x2, tmp_bounds2.x2); /* Calculate the minimum y coordinate seen and put in y1. */ bounds->y1 = MIN (tmp_bounds.y1, tmp_bounds.y2); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y1); bounds->y1 = MIN (bounds->y1, tmp_bounds2.y2); /* Calculate the maximum y coordinate seen and put in y2. */ bounds->y2 = MAX (tmp_bounds.y1, tmp_bounds.y2); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y1); bounds->y2 = MAX (bounds->y2, tmp_bounds2.y2); } /** * goo_canvas_item_simple_check_in_path: * @item: a #GooCanvasItemSimple. * @x: the x coordinate of the point. * @y: the y coordinate of the point. * @cr: a cairo context. * @pointer_events: specifies which parts of the path to check. * * This function is intended to be used by subclasses of #GooCanvasItemSimple. * * It checks if the given point is in the current path, using the item's * style settings. * * Returns: %TRUE if the given point is in the current path. **/ gboolean goo_canvas_item_simple_check_in_path (GooCanvasItemSimple *item, gdouble x, gdouble y, cairo_t *cr, GooCanvasPointerEvents pointer_events) { GooCanvasStyle *style = item->simple_data->style; gboolean do_fill, do_stroke; /* Check the filled path, if required. */ if (pointer_events & GOO_CANVAS_EVENTS_FILL_MASK) { do_fill = goo_canvas_style_set_fill_options (style, cr); if (!(pointer_events & GOO_CANVAS_EVENTS_PAINTED_MASK) || do_fill) { if (cairo_in_fill (cr, x, y)) return TRUE; } } /* Check the stroke, if required. */ if (pointer_events & GOO_CANVAS_EVENTS_STROKE_MASK) { do_stroke = goo_canvas_style_set_stroke_options (style, cr); if (!(pointer_events & GOO_CANVAS_EVENTS_PAINTED_MASK) || do_stroke) { if (cairo_in_stroke (cr, x, y)) return TRUE; } } return FALSE; } /** * goo_canvas_item_simple_get_line_width: * @item: a #GooCanvasItemSimple. * * Gets the item's line width. * * Returns: the item's line width. **/ gdouble goo_canvas_item_simple_get_line_width (GooCanvasItemSimple *item) { GValue *value; value = goo_canvas_style_get_property (item->simple_data->style, goo_canvas_style_line_width_id); if (value) return value->data[0].v_double; else if (item->canvas) return goo_canvas_get_default_line_width (item->canvas); else return 2.0; } /** * SECTION:goocanvasitemmodelsimple * @Title: GooCanvasItemModelSimple * @Short_Description: the base class for the standard canvas item models. * @Stability_Level: * @See_Also: * * #GooCanvasItemModelSimple is used as a base class for the standard canvas * item models. It can also be used as the base class for new custom canvas * item models. * * It provides default implementations for many of the #GooCanvasItemModel * methods. * * Subclasses of #GooCanvasItemModelSimple only need to implement the * create_item() method of the #GooCanvasItemModel interface, to create * the default canvas item to view the item model. */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_item_model_simple_dispose (GObject *object); static void goo_canvas_item_model_simple_finalize (GObject *object); static void goo_canvas_item_model_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_item_model_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasItemModelSimple, goo_canvas_item_model_simple, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_item_model_simple_class_init (GooCanvasItemModelSimpleClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->dispose = goo_canvas_item_model_simple_dispose; gobject_class->finalize = goo_canvas_item_model_simple_finalize; gobject_class->get_property = goo_canvas_item_model_simple_get_property; gobject_class->set_property = goo_canvas_item_model_simple_set_property; goo_canvas_item_simple_install_common_properties (gobject_class); } static void goo_canvas_item_model_simple_init (GooCanvasItemModelSimple *smodel) { smodel->simple_data.visibility = GOO_CANVAS_ITEM_VISIBLE; smodel->simple_data.pointer_events = GOO_CANVAS_EVENTS_VISIBLE_PAINTED; smodel->simple_data.clip_fill_rule = CAIRO_FILL_RULE_WINDING; } static void goo_canvas_item_model_simple_dispose (GObject *object) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) object; goo_canvas_item_simple_free_data (&smodel->simple_data); G_OBJECT_CLASS (goo_canvas_item_model_simple_parent_class)->dispose (object); } static void goo_canvas_item_model_simple_finalize (GObject *object) { /*GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) object;*/ G_OBJECT_CLASS (goo_canvas_item_model_simple_parent_class)->finalize (object); } static void goo_canvas_item_model_simple_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) object; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; switch (prop_id) { case PROP_PARENT: g_value_set_object (value, smodel->parent); break; case PROP_TITLE: g_value_set_string (value, smodel->title); break; case PROP_DESCRIPTION: g_value_set_string (value, smodel->description); break; default: goo_canvas_item_simple_get_common_property (object, simple_data, NULL, prop_id, value, pspec); break; } } extern void _goo_canvas_item_model_emit_changed (GooCanvasItemModel *model, gboolean recompute_bounds); static void goo_canvas_item_model_simple_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemModel *model = (GooCanvasItemModel*) object; GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) object; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; GooCanvasItemModel *parent; gboolean recompute_bounds; switch (prop_id) { case PROP_PARENT: parent = g_value_get_object (value); goo_canvas_item_model_remove (model); goo_canvas_item_model_add_child (parent, model, -1); break; case PROP_TITLE: g_free (smodel->title); smodel->title = g_value_dup_string (value); break; case PROP_DESCRIPTION: g_free (smodel->description); smodel->description = g_value_dup_string (value); break; default: recompute_bounds = goo_canvas_item_simple_set_common_property (object, simple_data, prop_id, value, pspec); _goo_canvas_item_model_emit_changed (model, recompute_bounds); break; } } static GooCanvasItemModel* goo_canvas_item_model_simple_get_parent (GooCanvasItemModel *model) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; return smodel->parent; } static void goo_canvas_item_model_simple_set_parent (GooCanvasItemModel *model, GooCanvasItemModel *parent) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; smodel->parent = parent; } static gboolean goo_canvas_item_model_simple_get_transform (GooCanvasItemModel *model, cairo_matrix_t *matrix) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; if (!simple_data->transform) return FALSE; *matrix = *simple_data->transform; return TRUE; } static void goo_canvas_item_model_simple_set_transform (GooCanvasItemModel *model, const cairo_matrix_t *transform) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; if (transform) { if (!simple_data->transform) simple_data->transform = g_slice_new (cairo_matrix_t); *simple_data->transform = *transform; } else { g_slice_free (cairo_matrix_t, simple_data->transform); simple_data->transform = NULL; } _goo_canvas_item_model_emit_changed (model, TRUE); } static GooCanvasStyle* goo_canvas_item_model_simple_get_style (GooCanvasItemModel *model) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; return smodel->simple_data.style; } static void goo_canvas_item_model_simple_set_style (GooCanvasItemModel *model, GooCanvasStyle *style) { GooCanvasItemModelSimple *smodel = (GooCanvasItemModelSimple*) model; GooCanvasItemSimpleData *simple_data = &smodel->simple_data; if (simple_data->style) g_object_unref (simple_data->style); if (style) { simple_data->style = goo_canvas_style_copy (style); simple_data->own_style = TRUE; } else { simple_data->style = NULL; simple_data->own_style = FALSE; } _goo_canvas_item_model_emit_changed (model, TRUE); } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->get_parent = goo_canvas_item_model_simple_get_parent; iface->set_parent = goo_canvas_item_model_simple_set_parent; iface->get_transform = goo_canvas_item_model_simple_get_transform; iface->set_transform = goo_canvas_item_model_simple_set_transform; iface->get_style = goo_canvas_item_model_simple_get_style; iface->set_style = goo_canvas_item_model_simple_set_style; } goocanvas-0.15/src/goocanvaspath.h0000644000076400007640000000674611172574677014203 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaspath.h - a path item, very similar to the SVG path element. */ #ifndef __GOO_CANVAS_PATH_H__ #define __GOO_CANVAS_PATH_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasPathData GooCanvasPathData; struct _GooCanvasPathData { /* An array of GooCanvasPathCommand. */ GArray *path_commands; }; #define GOO_TYPE_CANVAS_PATH (goo_canvas_path_get_type ()) #define GOO_CANVAS_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_PATH, GooCanvasPath)) #define GOO_CANVAS_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_PATH, GooCanvasPathClass)) #define GOO_IS_CANVAS_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_PATH)) #define GOO_IS_CANVAS_PATH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_PATH)) #define GOO_CANVAS_PATH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_PATH, GooCanvasPathClass)) typedef struct _GooCanvasPath GooCanvasPath; typedef struct _GooCanvasPathClass GooCanvasPathClass; /** * GooCanvasPath * * The #GooCanvasPath-struct struct contains private data only. */ struct _GooCanvasPath { GooCanvasItemSimple parent; GooCanvasPathData *path_data; }; struct _GooCanvasPathClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_path_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_path_new (GooCanvasItem *parent, const gchar *path_data, ...); #define GOO_TYPE_CANVAS_PATH_MODEL (goo_canvas_path_model_get_type ()) #define GOO_CANVAS_PATH_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_PATH_MODEL, GooCanvasPathModel)) #define GOO_CANVAS_PATH_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_PATH_MODEL, GooCanvasPathModelClass)) #define GOO_IS_CANVAS_PATH_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_PATH_MODEL)) #define GOO_IS_CANVAS_PATH_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_PATH_MODEL)) #define GOO_CANVAS_PATH_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_PATH_MODEL, GooCanvasPathModelClass)) typedef struct _GooCanvasPathModel GooCanvasPathModel; typedef struct _GooCanvasPathModelClass GooCanvasPathModelClass; /** * GooCanvasPathModel * * The #GooCanvasPathModel-struct struct contains private data only. */ struct _GooCanvasPathModel { GooCanvasItemModelSimple parent_object; GooCanvasPathData path_data; }; struct _GooCanvasPathModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_path_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_path_model_new (GooCanvasItemModel *parent, const gchar *path_data, ...); G_END_DECLS #endif /* __GOO_CANVAS_PATH_H__ */ goocanvas-0.15/src/goocanvasgrid.h0000644000076400007640000001143511172574677014163 00000000000000/* * GooCanvas. Copyright (C) 2005-8 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasgrid.h - a grid item. */ #ifndef __GOO_CANVAS_GRID_H__ #define __GOO_CANVAS_GRID_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /* This is the data used by both model and view classes. */ typedef struct _GooCanvasGridData GooCanvasGridData; struct _GooCanvasGridData { /* The area that the grid covers. */ gdouble x, y, width, height; /* The distance between grid lines. */ gdouble x_step, y_step; /* The offset before the first grid line. */ gdouble x_offset, y_offset; /* The widths of the grid lines, or -ve to use item's stroke width. */ gdouble horz_grid_line_width, vert_grid_line_width; /* The color/pattern for the grid lines, or NULL to use the stroke color. */ cairo_pattern_t *horz_grid_line_pattern, *vert_grid_line_pattern; /* The width of the border around the grid, or -1 for no border. */ gdouble border_width; /* The color/pattern for the border, or NULL to use the stroke color. */ cairo_pattern_t *border_pattern; /* If the horizontal and vertical grid lines should be shown. */ guint show_horz_grid_lines : 1; guint show_vert_grid_lines : 1; /* If vertical grid lines are drawn on top. */ guint vert_grid_lines_on_top : 1; }; #define GOO_TYPE_CANVAS_GRID (goo_canvas_grid_get_type ()) #define GOO_CANVAS_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_GRID, GooCanvasGrid)) #define GOO_CANVAS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_GRID, GooCanvasGridClass)) #define GOO_IS_CANVAS_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_GRID)) #define GOO_IS_CANVAS_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_GRID)) #define GOO_CANVAS_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_GRID, GooCanvasGridClass)) typedef struct _GooCanvasGrid GooCanvasGrid; typedef struct _GooCanvasGridClass GooCanvasGridClass; /** * GooCanvasGrid * * The #GooCanvasGrid-struct struct contains private data only. */ struct _GooCanvasGrid { GooCanvasItemSimple parent_object; GooCanvasGridData *grid_data; }; struct _GooCanvasGridClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_grid_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_grid_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...); #define GOO_TYPE_CANVAS_GRID_MODEL (goo_canvas_grid_model_get_type ()) #define GOO_CANVAS_GRID_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_GRID_MODEL, GooCanvasGridModel)) #define GOO_CANVAS_GRID_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_GRID_MODEL, GooCanvasGridModelClass)) #define GOO_IS_CANVAS_GRID_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_GRID_MODEL)) #define GOO_IS_CANVAS_GRID_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_GRID_MODEL)) #define GOO_CANVAS_GRID_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_GRID_MODEL, GooCanvasGridModelClass)) typedef struct _GooCanvasGridModel GooCanvasGridModel; typedef struct _GooCanvasGridModelClass GooCanvasGridModelClass; /** * GooCanvasGridModel * * The #GooCanvasGridModel-struct struct contains private data only. */ struct _GooCanvasGridModel { GooCanvasItemModelSimple parent_object; GooCanvasGridData grid_data; }; struct _GooCanvasGridModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_grid_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_grid_model_new (GooCanvasItemModel *parent, gdouble x, gdouble y, gdouble width, gdouble height, gdouble x_step, gdouble y_step, gdouble x_offset, gdouble y_offset, ...); G_END_DECLS #endif /* __GOO_CANVAS_GRID_H__ */ goocanvas-0.15/src/goocanvasitem.c0000644000076400007640000020510511172574677014166 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasitem.c - interface for canvas items & groups. */ /** * SECTION:goocanvasitem * @Title: GooCanvasItem * @Short_Description: the interface for canvas items. * * #GooCanvasItem defines the interface that canvas items must implement, * and contains methods for operating on canvas items. */ #include #include #include #include #include #include #include "goocanvasprivate.h" #include "goocanvasitem.h" #include "goocanvas.h" #include "goocanvasutils.h" #include "goocanvasmarshal.h" static GParamSpecPool *_goo_canvas_item_child_property_pool = NULL; static GObjectNotifyContext *_goo_canvas_item_child_property_notify_context = NULL; static const char *animation_key = "GooCanvasItemAnimation"; enum { /* Mouse events. */ ENTER_NOTIFY_EVENT, LEAVE_NOTIFY_EVENT, MOTION_NOTIFY_EVENT, BUTTON_PRESS_EVENT, BUTTON_RELEASE_EVENT, /* Keyboard events. */ FOCUS_IN_EVENT, FOCUS_OUT_EVENT, KEY_PRESS_EVENT, KEY_RELEASE_EVENT, /* Miscellaneous signals. */ GRAB_BROKEN_EVENT, CHILD_NOTIFY, ANIMATION_FINISHED, SCROLL_EVENT, QUERY_TOOLTIP, LAST_SIGNAL }; static guint canvas_item_signals[LAST_SIGNAL] = { 0 }; static void goo_canvas_item_base_init (gpointer g_class); extern void _goo_canvas_style_init (void); GType goo_canvas_item_get_type (void) { static GType canvas_item_type = 0; if (!canvas_item_type) { static const GTypeInfo canvas_item_info = { sizeof (GooCanvasItemIface), /* class_size */ goo_canvas_item_base_init, /* base_init */ NULL, /* base_finalize */ }; canvas_item_type = g_type_register_static (G_TYPE_INTERFACE, "GooCanvasItem", &canvas_item_info, 0); g_type_interface_add_prerequisite (canvas_item_type, G_TYPE_OBJECT); } return canvas_item_type; } static void child_property_notify_dispatcher (GObject *object, guint n_pspecs, GParamSpec **pspecs) { guint i; for (i = 0; i < n_pspecs; i++) g_signal_emit (object, canvas_item_signals[CHILD_NOTIFY], g_quark_from_string (pspecs[i]->name), pspecs[i]); } static void goo_canvas_item_base_init (gpointer g_iface) { static GObjectNotifyContext cpn_context = { 0, NULL, NULL }; static gboolean initialized = FALSE; if (!initialized) { GType iface_type = G_TYPE_FROM_INTERFACE (g_iface); _goo_canvas_item_child_property_pool = g_param_spec_pool_new (TRUE); cpn_context.quark_notify_queue = g_quark_from_static_string ("GooCanvasItem-child-property-notify-queue"); cpn_context.dispatcher = child_property_notify_dispatcher; _goo_canvas_item_child_property_notify_context = &cpn_context; /* Mouse events. */ /** * GooCanvasItem::enter-notify-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when the mouse enters an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[ENTER_NOTIFY_EVENT] = g_signal_new ("enter_notify_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, enter_notify_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::leave-notify-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when the mouse leaves an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[LEAVE_NOTIFY_EVENT] = g_signal_new ("leave_notify_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, leave_notify_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::motion-notify-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when the mouse moves within an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[MOTION_NOTIFY_EVENT] = g_signal_new ("motion_notify_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, motion_notify_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::button-press-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when a mouse button is pressed in an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[BUTTON_PRESS_EVENT] = g_signal_new ("button_press_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, button_press_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::button-release-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when a mouse button is released in an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[BUTTON_RELEASE_EVENT] = g_signal_new ("button_release_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, button_release_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /* Keyboard events. */ /** * GooCanvasItem::focus-in-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when the item receives the keyboard focus. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[FOCUS_IN_EVENT] = g_signal_new ("focus_in_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, focus_in_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::focus-out-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when the item loses the keyboard focus. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[FOCUS_OUT_EVENT] = g_signal_new ("focus_out_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, focus_out_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::key-press-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when a key is pressed and the item has the keyboard * focus. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[KEY_PRESS_EVENT] = g_signal_new ("key_press_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, key_press_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::key-release-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when a key is released and the item has the keyboard * focus. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[KEY_RELEASE_EVENT] = g_signal_new ("key_release_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, key_release_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::query-tooltip: * @item: the item which received the signal. * @x: the x coordinate of the mouse. * @y: the y coordinate of the mouse. * @keyboard_mode: %TRUE if the tooltip was triggered using the keyboard. * @tooltip: a #GtkTooltip. * * Emitted when the mouse has paused over the item for a certain amount * of time, or the tooltip was requested via the keyboard. * * Note that if @keyboard_mode is %TRUE, the values of @x and @y are * undefined and should not be used. * * If the item wants to display a tooltip it should update @tooltip * and return %TRUE. * * Returns: %TRUE if the item has set a tooltip to show. */ canvas_item_signals[QUERY_TOOLTIP] = g_signal_new ("query-tooltip", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, query_tooltip), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__DOUBLE_DOUBLE_BOOLEAN_OBJECT, G_TYPE_BOOLEAN, 4, G_TYPE_DOUBLE, G_TYPE_DOUBLE, G_TYPE_BOOLEAN, GTK_TYPE_TOOLTIP); /** * GooCanvasItem::grab-broken-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. * * Emitted when the item's keyboard or pointer grab was lost * unexpectedly. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[GRAB_BROKEN_EVENT] = g_signal_new ("grab_broken_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, grab_broken_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); /** * GooCanvasItem::child-notify * @item: the item that received the signal. * @pspec: the #GParamSpec of the changed child property. * * Emitted for each child property that has changed. * The signal's detail holds the property name. */ canvas_item_signals[CHILD_NOTIFY] = g_signal_new ("child_notify", iface_type, G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE | G_SIGNAL_DETAILED | G_SIGNAL_NO_HOOKS, G_STRUCT_OFFSET (GooCanvasItemIface, child_notify), NULL, NULL, g_cclosure_marshal_VOID__PARAM, G_TYPE_NONE, 1, G_TYPE_PARAM); /** * GooCanvasItem::animation-finished * @item: the item that received the signal. * @stopped: if the animation was explicitly stopped. * * Emitted when the item animation has finished. */ canvas_item_signals[ANIMATION_FINISHED] = g_signal_new ("animation-finished", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, animation_finished), NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); /** * GooCanvasItem::scroll-event * @item: the item that received the signal. * @target_item: the target of the event. * @event: the event data. The x & y fields contain the mouse position * in the item's coordinate space. The x_root & y_root fields contain * the same coordinates converted to the canvas coordinate space. * * Emitted when a button in the 4 to 7 range is pressed. Wheel mice are * usually configured to generate button press events for buttons 4 and 5 * when the wheel is turned in an item. * * Returns: %TRUE to stop the signal emission, or %FALSE to let it * continue. */ canvas_item_signals[SCROLL_EVENT] = g_signal_new ("scroll_event", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GooCanvasItemIface, scroll_event), goo_canvas_boolean_handled_accumulator, NULL, goo_canvas_marshal_BOOLEAN__OBJECT_BOXED, G_TYPE_BOOLEAN, 2, GOO_TYPE_CANVAS_ITEM, GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE); g_object_interface_install_property (g_iface, g_param_spec_object ("parent", _("Parent"), _("The parent item"), GOO_TYPE_CANVAS_ITEM, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_enum ("visibility", _("Visibility"), _("When the canvas item is visible"), GOO_TYPE_CANVAS_ITEM_VISIBILITY, GOO_CANVAS_ITEM_VISIBLE, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_double ("visibility-threshold", _("Visibility Threshold"), _("The scale threshold at which the item becomes visible"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_boxed ("transform", _("Transform"), _("The transformation matrix of the item"), GOO_TYPE_CAIRO_MATRIX, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_flags ("pointer-events", _("Pointer Events"), _("Specifies when the item receives pointer events"), GOO_TYPE_CANVAS_POINTER_EVENTS, GOO_CANVAS_EVENTS_VISIBLE_PAINTED, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("title", _("Title"), _("A short context-rich description of the item for use by assistive technologies"), NULL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("description", _("Description"), _("A description of the item for use by assistive technologies"), NULL, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_boolean ("can-focus", _("Can Focus"), _("If the item can take the keyboard focus"), FALSE, G_PARAM_READWRITE)); g_object_interface_install_property (g_iface, g_param_spec_string ("tooltip", _("Tooltip"), _("The tooltip to display for the item"), NULL, G_PARAM_READWRITE)); _goo_canvas_style_init (); initialized = TRUE; } } /** * goo_canvas_item_get_canvas: * @item: a #GooCanvasItem. * * Returns the #GooCanvas containing the given #GooCanvasItem. * * Returns: the #GooCanvas. **/ GooCanvas* goo_canvas_item_get_canvas (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->get_canvas) { return iface->get_canvas (item); } else { GooCanvasItem *parent = iface->get_parent (item); if (parent) return goo_canvas_item_get_canvas (parent); return NULL; } } /** * goo_canvas_item_set_canvas: * @item: a #GooCanvasItem. * @canvas: a #GooCanvas * * This function is only intended to be used when implementing new canvas * items, specifically container items such as #GooCanvasGroup. * * It sets the canvas of the item. **/ void goo_canvas_item_set_canvas (GooCanvasItem *item, GooCanvas *canvas) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->set_canvas) iface->set_canvas (item, canvas); } /** * goo_canvas_item_add_child: * @item: the container to add the item to. * @child: the item to add. * @position: the position of the item, or -1 to place it last (at the top of * the stacking order). * * Adds a child item to a container item at the given stack position. **/ void goo_canvas_item_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); g_return_if_fail (iface->add_child != NULL); g_return_if_fail (item != child); iface->add_child (item, child, position); } /** * goo_canvas_item_move_child: * @item: a container item. * @old_position: the current position of the child item. * @new_position: the new position of the child item. * * Moves a child item to a new stack position within the container. **/ void goo_canvas_item_move_child (GooCanvasItem *item, gint old_position, gint new_position) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); g_return_if_fail (iface->move_child != NULL); iface->move_child (item, old_position, new_position); } /** * goo_canvas_item_remove_child: * @item: a container item. * @child_num: the position of the child item to remove. * * Removes the child item at the given position. **/ void goo_canvas_item_remove_child (GooCanvasItem *item, gint child_num) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); g_return_if_fail (iface->remove_child != NULL); iface->remove_child (item, child_num); } /** * goo_canvas_item_find_child: * @item: a container item. * @child: the child item to find. * * Attempts to find the given child item with the container's stack. * * Returns: the position of the given @child item, or -1 if it isn't found. **/ gint goo_canvas_item_find_child (GooCanvasItem *item, GooCanvasItem *child) { GooCanvasItem *tmp; int n_children, i; /* Find the current position of item and above. */ n_children = goo_canvas_item_get_n_children (item); for (i = 0; i < n_children; i++) { tmp = goo_canvas_item_get_child (item, i); if (child == tmp) return i; } return -1; } /** * goo_canvas_item_is_container: * @item: an item. * * Tests to see if the given item is a container. * * Returns: %TRUE if the item is a container. **/ gboolean goo_canvas_item_is_container (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_n_children ? TRUE : FALSE; } /** * goo_canvas_item_get_n_children: * @item: a container item. * * Gets the number of children of the container. * * Returns: the number of children. **/ gint goo_canvas_item_get_n_children (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_n_children ? iface->get_n_children (item) : 0; } /** * goo_canvas_item_get_child: * @item: a container item. * @child_num: the position of a child in the container's stack. * * Gets the child item at the given stack position. * * Returns: the child item at the given stack position, or %NULL if @child_num * is out of range. **/ GooCanvasItem* goo_canvas_item_get_child (GooCanvasItem *item, gint child_num) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_child ? iface->get_child (item, child_num) : NULL; } /** * goo_canvas_item_get_parent: * @item: an item. * * Gets the parent of the given item. * * Returns: the parent item, or %NULL if the item has no parent. **/ GooCanvasItem* goo_canvas_item_get_parent (GooCanvasItem *item) { g_return_val_if_fail (GOO_IS_CANVAS_ITEM (item), NULL); return GOO_CANVAS_ITEM_GET_IFACE (item)->get_parent (item); } /** * goo_canvas_item_set_parent: * @item: an item. * @parent: the new parent item. * * This function is only intended to be used when implementing new canvas * items (specifically container items such as #GooCanvasGroup). * It sets the parent of the child item. * * * This function cannot be used to add an item to a group * or to change the parent of an item. * To do that use the #GooCanvasItem:parent property. * **/ void goo_canvas_item_set_parent (GooCanvasItem *item, GooCanvasItem *parent) { GOO_CANVAS_ITEM_GET_IFACE (item)->set_parent (item, parent); } /** * goo_canvas_item_get_is_static: * @item: an item. * * Returns %TRUE if the item is static. Static items do not move or change * size when the canvas is scrolled or the scale changes. * * Returns: %TRUE if the item is static. **/ gboolean goo_canvas_item_get_is_static (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->get_is_static) return iface->get_is_static (item); return FALSE; } /** * goo_canvas_item_set_is_static: * @item: an item. * @is_static: if the item is static. * * Notifies the item that it is static. Static items do not move or change * size when the canvas is scrolled or the scale changes. * * Container items such as #GooCanvasGroup should call this function when * children are added, to notify children whether they are static or not. * Containers should also pass on any changes in their own status to children. **/ void goo_canvas_item_set_is_static (GooCanvasItem *item, gboolean is_static) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->set_is_static) iface->set_is_static (item, is_static); } /** * goo_canvas_item_remove: * @item: an item. * * Removes an item from its parent. If the item is in a canvas it will be * removed. * * This would normally also result in the item being freed. **/ void goo_canvas_item_remove (GooCanvasItem *item) { GooCanvasItem *parent; gint child_num; parent = goo_canvas_item_get_parent (item); if (!parent) return; child_num = goo_canvas_item_find_child (parent, item); if (child_num == -1) return; goo_canvas_item_remove_child (parent, child_num); } /** * goo_canvas_item_raise: * @item: an item. * @above: the item to raise @item above, or %NULL to raise @item to the top * of the stack. * * Raises an item in the stacking order. **/ void goo_canvas_item_raise (GooCanvasItem *item, GooCanvasItem *above) { GooCanvasItem *parent, *child; int n_children, i, item_pos = -1, above_pos = -1; parent = goo_canvas_item_get_parent (item); if (!parent || item == above) return; /* Find the current position of item and above. */ n_children = goo_canvas_item_get_n_children (parent); for (i = 0; i < n_children; i++) { child = goo_canvas_item_get_child (parent, i); if (child == item) item_pos = i; if (child == above) above_pos = i; } /* If above is NULL we raise the item to the top of the stack. */ if (!above) above_pos = n_children - 1; g_return_if_fail (item_pos != -1); g_return_if_fail (above_pos != -1); /* Only move the item if the new position is higher in the stack. */ if (above_pos > item_pos) goo_canvas_item_move_child (parent, item_pos, above_pos); } /** * goo_canvas_item_lower: * @item: an item. * @below: the item to lower @item below, or %NULL to lower @item to the * bottom of the stack. * * Lowers an item in the stacking order. **/ void goo_canvas_item_lower (GooCanvasItem *item, GooCanvasItem *below) { GooCanvasItem *parent, *child; int n_children, i, item_pos = -1, below_pos = -1; parent = goo_canvas_item_get_parent (item); if (!parent || item == below) return; /* Find the current position of item and below. */ n_children = goo_canvas_item_get_n_children (parent); for (i = 0; i < n_children; i++) { child = goo_canvas_item_get_child (parent, i); if (child == item) item_pos = i; if (child == below) below_pos = i; } /* If below is NULL we lower the item to the bottom of the stack. */ if (!below) below_pos = 0; g_return_if_fail (item_pos != -1); g_return_if_fail (below_pos != -1); /* Only move the item if the new position is lower in the stack. */ if (below_pos < item_pos) goo_canvas_item_move_child (parent, item_pos, below_pos); } /** * goo_canvas_item_get_transform: * @item: an item. * @transform: the place to store the transform. * * Gets the transformation matrix of an item. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_get_transform (GooCanvasItem *item, cairo_matrix_t *transform) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_transform ? iface->get_transform (item, transform) : FALSE; } /** * goo_canvas_item_get_transform_for_child: * @item: an item. * @child: a child of @item. * @transform: the place to store the transform. * * Gets the transformation matrix of an item combined with any special * transform needed for the given child. These special transforms are used * by layout items such as #GooCanvasTable. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_get_transform_for_child (GooCanvasItem *item, GooCanvasItem *child, cairo_matrix_t *transform) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (child && iface->get_transform_for_child) return iface->get_transform_for_child (item, child, transform); /* We fallback to the standard get_transform method. */ if (iface->get_transform) return iface->get_transform (item, transform); return FALSE; } /** * goo_canvas_item_set_transform: * @item: an item. * @transform: the new transformation matrix, or %NULL to reset the * transformation to the identity matrix. * * Sets the transformation matrix of an item. **/ void goo_canvas_item_set_transform (GooCanvasItem *item, const cairo_matrix_t *transform) { GOO_CANVAS_ITEM_GET_IFACE (item)->set_transform (item, transform); } /** * goo_canvas_item_get_simple_transform: * @item: an item. * @x: returns the x coordinate of the origin of the item's coordinate space. * @y: returns the y coordinate of the origin of the item's coordinate space. * @scale: returns the scale of the item. * @rotation: returns the clockwise rotation of the item, in degrees (0-360). * * This function can be used to get the position, scale and rotation of an * item, providing that the item has a simple transformation matrix * (e.g. set with goo_canvas_item_set_simple_transform(), or using a * combination of simple translate, scale and rotate operations). If the item * has a complex transformation matrix the results will be incorrect. * * Returns: %TRUE if a transform is set. **/ gboolean goo_canvas_item_get_simple_transform (GooCanvasItem *item, gdouble *x, gdouble *y, gdouble *scale, gdouble *rotation) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; double x1 = 1.0, y1 = 0.0, radians; gboolean has_transform = FALSE; if (iface->get_transform) has_transform = iface->get_transform (item, &matrix); if (!has_transform) { *x = *y = *rotation = 0.0; *scale = 1.0; return FALSE; } *x = matrix.x0; *y = matrix.y0; matrix.x0 = 0.0; matrix.y0 = 0.0; cairo_matrix_transform_point (&matrix, &x1, &y1); *scale = sqrt (x1 * x1 + y1 * y1); radians = atan2 (y1, x1); *rotation = radians * (180 / M_PI); if (*rotation < 0) *rotation += 360; return TRUE; } /** * goo_canvas_item_set_simple_transform: * @item: an item. * @x: the x coordinate of the origin of the item's coordinate space. * @y: the y coordinate of the origin of the item's coordinate space. * @scale: the scale of the item. * @rotation: the clockwise rotation of the item, in degrees. * * A convenience function to set the item's transformation matrix. **/ void goo_canvas_item_set_simple_transform (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble rotation) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; cairo_matrix_translate (&new_matrix, x, y); cairo_matrix_scale (&new_matrix, scale, scale); cairo_matrix_rotate (&new_matrix, rotation * (M_PI / 180)); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_translate: * @item: an item. * @tx: the amount to move the origin in the horizontal direction. * @ty: the amount to move the origin in the vertical direction. * * Translates the origin of the item's coordinate system by the given amounts. **/ void goo_canvas_item_translate (GooCanvasItem *item, gdouble tx, gdouble ty) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; iface->get_transform (item, &new_matrix); cairo_matrix_translate (&new_matrix, tx, ty); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_scale: * @item: an item. * @sx: the amount to scale the horizontal axis. * @sy: the amount to scale the vertical axis. * * Scales the item's coordinate system by the given amounts. **/ void goo_canvas_item_scale (GooCanvasItem *item, gdouble sx, gdouble sy) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; iface->get_transform (item, &new_matrix); cairo_matrix_scale (&new_matrix, sx, sy); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_rotate: * @item: an item. * @degrees: the clockwise angle of rotation. * @cx: the x coordinate of the origin of the rotation. * @cy: the y coordinate of the origin of the rotation. * * Rotates the item's coordinate system by the given amount, about the given * origin. **/ void goo_canvas_item_rotate (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (item, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_rotate (&new_matrix, radians); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_skew_x: * @item: an item. * @degrees: the skew angle. * @cx: the x coordinate of the origin of the skew transform. * @cy: the y coordinate of the origin of the skew transform. * * Skews the item's coordinate system along the x axis by the given amount, * about the given origin. **/ void goo_canvas_item_skew_x (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t tmp, new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (item, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_init (&tmp, 1, 0, tan (radians), 1, 0, 0); cairo_matrix_multiply (&new_matrix, &tmp, &new_matrix); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_skew_y: * @item: an item. * @degrees: the skew angle. * @cx: the x coordinate of the origin of the skew transform. * @cy: the y coordinate of the origin of the skew transform. * * Skews the item's coordinate system along the y axis by the given amount, * about the given origin. **/ void goo_canvas_item_skew_y (GooCanvasItem *item, gdouble degrees, gdouble cx, gdouble cy) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); cairo_matrix_t tmp, new_matrix = { 1, 0, 0, 1, 0, 0 }; double radians = degrees * (M_PI / 180); iface->get_transform (item, &new_matrix); cairo_matrix_translate (&new_matrix, cx, cy); cairo_matrix_init (&tmp, 1, tan (radians), 0, 1, 0, 0); cairo_matrix_multiply (&new_matrix, &tmp, &new_matrix); cairo_matrix_translate (&new_matrix, -cx, -cy); iface->set_transform (item, &new_matrix); } /** * goo_canvas_item_get_style: * @item: an item. * * Gets the item's style. If the item doesn't have its own style it will return * its parent's style. * * Returns: the item's style. **/ GooCanvasStyle* goo_canvas_item_get_style (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_style ? iface->get_style (item) : NULL; } /** * goo_canvas_item_set_style: * @item: an item. * @style: a style. * * Sets the item's style, by copying the properties from the given style. **/ void goo_canvas_item_set_style (GooCanvasItem *item, GooCanvasStyle *style) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->set_style) iface->set_style (item, style); } typedef struct _GooCanvasItemAnimation GooCanvasItemAnimation; struct _GooCanvasItemAnimation { GooCanvasAnimateType type; GooCanvasItem *item; GooCanvasItemModel *model; int step, total_steps; cairo_matrix_t start; gdouble x_start, y_start, scale_start, radians_start; gdouble x_step, y_step, scale_step, radians_step; gboolean absolute; gboolean forward; guint timeout_id; }; static void goo_canvas_item_free_animation (GooCanvasItemAnimation *anim) { if (anim->timeout_id) { g_source_remove (anim->timeout_id); anim->timeout_id = 0; } g_free (anim); } static gboolean goo_canvas_item_animate_cb (GooCanvasItemAnimation *anim) { GooCanvasItem *item = anim->item; GooCanvasItemModel *model = anim->model; GooCanvasAnimateType type = anim->type; GooCanvasItemIface *iface = NULL; GooCanvasItemModelIface *model_iface = NULL; cairo_matrix_t new_matrix; gboolean keep_source = TRUE; gdouble scale; gint step; GDK_THREADS_ENTER (); if (model) model_iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); else iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (++anim->step > anim->total_steps) { switch (type) { case GOO_CANVAS_ANIMATE_RESET: /* Reset the transform to the initial value. */ if (model) model_iface->set_transform (model, &anim->start); else iface->set_transform (item, &anim->start); /* Fall through.. */ case GOO_CANVAS_ANIMATE_FREEZE: keep_source = FALSE; anim->timeout_id = 0; /* This will result in a call to goo_canvas_item_free_animation() above. We've set the timeout_id to 0 so it isn't removed twice. */ if (model) { g_object_set_data (G_OBJECT (model), animation_key, NULL); g_signal_emit_by_name (model, "animation-finished", FALSE); } else { g_object_set_data (G_OBJECT (item), animation_key, NULL); g_signal_emit_by_name (item, "animation-finished", FALSE); } break; case GOO_CANVAS_ANIMATE_RESTART: anim->step = 0; break; case GOO_CANVAS_ANIMATE_BOUNCE: anim->forward = !anim->forward; anim->step = 1; break; } } if (keep_source) { step = anim->forward ? anim->step : anim->total_steps - anim->step; if (anim->absolute) { cairo_matrix_init_identity (&new_matrix); scale = anim->scale_start + anim->scale_step * step; cairo_matrix_translate (&new_matrix, anim->x_start + anim->x_step * step, anim->y_start + anim->y_step * step); cairo_matrix_scale (&new_matrix, scale, scale); cairo_matrix_rotate (&new_matrix, anim->radians_start + anim->radians_step * step); } else { new_matrix = anim->start; scale = 1 + anim->scale_step * step; cairo_matrix_translate (&new_matrix, anim->x_step * step, anim->y_step * step); cairo_matrix_scale (&new_matrix, scale, scale); cairo_matrix_rotate (&new_matrix, anim->radians_step * step); } if (model) model_iface->set_transform (model, &new_matrix); else iface->set_transform (item, &new_matrix); } GDK_THREADS_LEAVE (); /* Return FALSE to remove the timeout handler when we are finished. */ return keep_source; } void _goo_canvas_item_animate_internal (GooCanvasItem *item, GooCanvasItemModel *model, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type) { GObject *object; cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; GooCanvasItemAnimation *anim; if (item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->get_transform (item, &matrix); object = (GObject*) item; } else { GooCanvasItemModelIface *iface = GOO_CANVAS_ITEM_MODEL_GET_IFACE (model); iface->get_transform (model, &matrix); object = (GObject*) model; } anim = g_new (GooCanvasItemAnimation, 1); anim->type = type; anim->item = item; anim->model = model; anim->step = 0; anim->total_steps = duration / step_time; anim->start = matrix; anim->absolute = absolute; anim->forward = TRUE; /* For absolute animation we have to try to calculate the current position, scale and rotation. */ if (absolute) { cairo_matrix_t tmp_matrix = anim->start; double x1 = 1.0, y1 = 0.0; anim->x_start = tmp_matrix.x0; anim->y_start = tmp_matrix.y0; tmp_matrix.x0 = 0.0; tmp_matrix.y0 = 0.0; cairo_matrix_transform_point (&tmp_matrix, &x1, &y1); anim->scale_start = sqrt (x1 * x1 + y1 * y1); anim->radians_start = atan2 (y1, x1); anim->x_step = (x - anim->x_start) / anim->total_steps; anim->y_step = (y - anim->y_start) / anim->total_steps; anim->scale_step = (scale - anim->scale_start) / anim->total_steps; anim->radians_step = (degrees * (M_PI / 180) - anim->radians_start) / anim->total_steps; } else { anim->x_step = x / anim->total_steps; anim->y_step = y / anim->total_steps; anim->scale_step = (scale - 1.0) / anim->total_steps; anim->radians_step = (degrees * (M_PI / 180)) / anim->total_steps; } /* Store a pointer to the new animation in the item. This will automatically stop any current animation and free it. */ g_object_set_data_full (object, animation_key, anim, (GDestroyNotify) goo_canvas_item_free_animation); anim->timeout_id = g_timeout_add (step_time, (GSourceFunc) goo_canvas_item_animate_cb, anim); } /** * goo_canvas_item_animate: * @item: an item. * @x: the final x coordinate. * @y: the final y coordinate. * @scale: the final scale. * @degrees: the final rotation. This can be negative to rotate anticlockwise, * and can also be greater than 360 to rotate a number of times. * @absolute: if the @x, @y, @scale and @degrees values are absolute, or * relative to the current transform. Note that absolute animations only work * if the item currently has a simple transform. If the item has a shear or * some other complicated transform it may result in strange animations. * @duration: the duration of the animation, in milliseconds (1/1000ths of a * second). * @step_time: the time between each animation step, in milliseconds. * @type: specifies what happens when the animation finishes. * * Animates an item from its current position to the given offsets, scale * and rotation. **/ void goo_canvas_item_animate (GooCanvasItem *item, gdouble x, gdouble y, gdouble scale, gdouble degrees, gboolean absolute, gint duration, gint step_time, GooCanvasAnimateType type) { _goo_canvas_item_animate_internal (item, NULL, x, y, scale, degrees, absolute, duration, step_time, type); } /** * goo_canvas_item_stop_animation: * @item: an item. * * Stops any current animation for the given item, leaving it at its current * position. **/ void goo_canvas_item_stop_animation (GooCanvasItem *item) { /* This will result in a call to goo_canvas_item_free_animation() above. */ g_object_set_data (G_OBJECT (item), animation_key, NULL); g_signal_emit_by_name (item, "animation-finished", TRUE); } /** * goo_canvas_item_request_update: * @item: a #GooCanvasItem. * * This function is only intended to be used when implementing new canvas * items. * * It requests that an update of the item is scheduled. It will be performed * as soon as the application is idle, and before the canvas is redrawn. **/ void goo_canvas_item_request_update (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->request_update) iface->request_update (item); else goo_canvas_item_request_update (iface->get_parent (item)); } /** * goo_canvas_item_get_bounds: * @item: a #GooCanvasItem. * @bounds: a #GooCanvasBounds to return the bounds in. * * Gets the bounds of the item. * * Note that the bounds includes the entire fill and stroke extents of the * item, whether they are painted or not. **/ void goo_canvas_item_get_bounds (GooCanvasItem *item, GooCanvasBounds *bounds) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->get_bounds (item, bounds); } /** * goo_canvas_item_get_items_at: * @item: a #GooCanvasItem. * @x: the x coordinate of the point. * @y: the y coordinate of the point. * @cr: a cairo contect. * @is_pointer_event: %TRUE if the "pointer-events" properties of items should * be used to determine which parts of the item are tested. * @parent_is_visible: %TRUE if the parent item is visible (which * implies that all ancestors are also visible). * @found_items: the list of items found so far. * * This function is only intended to be used when implementing new canvas * items, specifically container items such as #GooCanvasGroup. * * It gets the items at the given point. * * Returns: the @found_items list, with any more found items added onto * the start of the list, leaving the top item first. **/ GList* goo_canvas_item_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_is_visible, GList *found_items) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->get_items_at) return iface->get_items_at (item, x, y, cr, is_pointer_event, parent_is_visible, found_items); else return found_items; } /** * goo_canvas_item_is_visible: * @item: a #GooCanvasItem. * * Checks if the item is visible. * * This entails checking the item's own visibility setting, as well as those * of its ancestors. * * Note that the item may be scrolled off the screen and so may not * be actually visible to the user. * * Returns: %TRUE if the item is visible. **/ gboolean goo_canvas_item_is_visible (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); GooCanvasItem *parent; if (iface->is_visible) return iface->is_visible (item); /* If the item doesn't implement the is_visible method we assume it is visible and check its ancestors. */ parent = goo_canvas_item_get_parent (item); if (parent) return goo_canvas_item_is_visible (parent); return TRUE; } /** * goo_canvas_item_get_model: * @item: a #GooCanvasItem. * * Gets the model of the given canvas item. * * Returns: the item's model, or %NULL if it has no model. **/ GooCanvasItemModel* goo_canvas_item_get_model (GooCanvasItem *item) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_model ? iface->get_model (item) : NULL; } /** * goo_canvas_item_set_model: * @item: a #GooCanvasItem. * @model: a #GooCanvasItemModel. * * Sets the model of the given canvas item. **/ void goo_canvas_item_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->set_model) iface->set_model (item, model); } /** * goo_canvas_item_ensure_updated: * @item: a #GooCanvasItem. * * This function is only intended to be used when implementing new canvas * items. * * It updates the canvas immediately, if an update is scheduled. * This ensures that all item bounds are up-to-date. **/ void goo_canvas_item_ensure_updated (GooCanvasItem *item) { GooCanvas *canvas; canvas = goo_canvas_item_get_canvas (item); if (canvas) goo_canvas_update (canvas); } /** * goo_canvas_item_update: * @item: a #GooCanvasItem. * @entire_tree: if the entire subtree should be updated. * @cr: a cairo context. * @bounds: a #GooCanvasBounds to return the new bounds in. * * This function is only intended to be used when implementing new canvas * items, specifically container items such as #GooCanvasGroup. * * Updates the item, if needed, and any children. **/ void goo_canvas_item_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->update (item, entire_tree, cr, bounds); } /** * goo_canvas_item_paint: * @item: a #GooCanvasItem. * @cr: a cairo context. * @bounds: the bounds that need to be repainted, in device space. * @scale: the scale to use to determine whether an item should be painted. * See #GooCanvasItem:visibility-threshold. * * This function is only intended to be used when implementing new canvas * items, specifically container items such as #GooCanvasGroup. * * It paints the item and all children if they intersect the given bounds. * * Note that the @scale argument may be different to the current scale in the * #GooCanvasItem, e.g. when the canvas is being printed. **/ void goo_canvas_item_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->paint (item, cr, bounds, scale); } /** * goo_canvas_item_get_requested_area: * @item: a #GooCanvasItem. * @cr: a cairo context. * @requested_area: a #GooCanvasBounds to return the requested area in, in the * parent's coordinate space. * * This function is only intended to be used when implementing new canvas * items, specifically layout items such as #GooCanvasTable. * * It gets the requested area of a child item. * * Returns: %TRUE if the item should be allocated space. **/ gboolean goo_canvas_item_get_requested_area (GooCanvasItem *item, cairo_t *cr, GooCanvasBounds *requested_area) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); return iface->get_requested_area (item, cr, requested_area); } /** * goo_canvas_item_get_requested_height: * @item: a #GooCanvasItem. * @cr: a cairo context. * @width: the width that the item may be allocated. * * This function is only intended to be used when implementing new canvas * items, specifically layout items such as #GooCanvasTable. * * It gets the requested height of a child item, assuming it is allocated the * given width. This is useful for text items whose requested height may change * depending on the allocated width. * * Returns: the requested height of the item, given the allocated width, * or %-1 if the item doesn't support this method or its height doesn't * change when allocated different widths. **/ gdouble goo_canvas_item_get_requested_height (GooCanvasItem *item, cairo_t *cr, gdouble width) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); if (iface->get_requested_height) return iface->get_requested_height (item, cr, width); else return -1; } /** * goo_canvas_item_allocate_area: * @item: a #GooCanvasItem. * @cr: a cairo context. * @requested_area: the area that the item originally requested, in the * parent's coordinate space. * @allocated_area: the area that the item has been allocated, in the parent's * coordinate space. * @x_offset: the x offset of the allocated area from the requested area in * the device coordinate space. * @y_offset: the y offset of the allocated area from the requested area in * the device coordinate space. * * This function is only intended to be used when implementing new canvas * items, specifically layout items such as #GooCanvasTable. * * It allocates an area to a child #GooCanvasItem. * * Note that the parent layout item will use a transform to move each of its * children for the layout, so there is no need for the child item to * reposition itself. It only needs to recalculate its device bounds. * * To help recalculate the item's device bounds, the @x_offset and @y_offset * of the child item's allocated position from its requested position are * provided. Simple items can just add these to their bounds. **/ void goo_canvas_item_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset) { GooCanvasItemIface *iface = GOO_CANVAS_ITEM_GET_IFACE (item); iface->allocate_area (item, cr, requested_area, allocated_area, x_offset, y_offset); } /* * Child Properties. */ static inline void item_get_child_property (GObject *object, GObject *child, GParamSpec *pspec, GValue *value, gboolean is_model) { GObjectClass *class; class = g_type_class_peek (pspec->owner_type); if (is_model) { GooCanvasItemModelIface *iface; iface = g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM_MODEL); iface->get_child_property ((GooCanvasItemModel*) object, (GooCanvasItemModel*) child, pspec->param_id, value, pspec); } else { GooCanvasItemIface *iface; iface = g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM); iface->get_child_property ((GooCanvasItem*) object, (GooCanvasItem*) child, pspec->param_id, value, pspec); } } void _goo_canvas_item_get_child_property_internal (GObject *object, GObject *child, const gchar *property_name, GValue *value, GParamSpecPool *property_pool, gboolean is_model) { GParamSpec *pspec; g_object_ref (object); g_object_ref (child); pspec = g_param_spec_pool_lookup (property_pool, property_name, G_OBJECT_TYPE (object), TRUE); if (!pspec) g_warning ("%s: class `%s' has no child property named `%s'", G_STRLOC, G_OBJECT_TYPE_NAME (object), property_name); else if (!(pspec->flags & G_PARAM_READABLE)) g_warning ("%s: child property `%s' of class `%s' is not readable", G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object)); else { GValue *prop_value, tmp_value = { 0, }; /* auto-conversion of the callers value type */ if (G_VALUE_TYPE (value) == G_PARAM_SPEC_VALUE_TYPE (pspec)) { g_value_reset (value); prop_value = value; } else if (!g_value_type_transformable (G_PARAM_SPEC_VALUE_TYPE (pspec), G_VALUE_TYPE (value))) { g_warning ("can't retrieve child property `%s' of type `%s' as value of type `%s'", pspec->name, g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)), G_VALUE_TYPE_NAME (value)); g_object_unref (child); g_object_unref (object); return; } else { g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec)); prop_value = &tmp_value; } item_get_child_property (object, child, pspec, prop_value, is_model); if (prop_value != value) { g_value_transform (prop_value, value); g_value_unset (&tmp_value); } } g_object_unref (child); g_object_unref (object); } void _goo_canvas_item_get_child_properties_internal (GObject *object, GObject *child, va_list var_args, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model) { g_object_ref (object); g_object_ref (child); for (;;) { GValue value = { 0, }; GParamSpec *pspec; gchar *name, *error = NULL; name = va_arg (var_args, gchar*); if (!name) break; pspec = g_param_spec_pool_lookup (property_pool, name, G_OBJECT_TYPE (object), TRUE); if (!pspec) { g_warning ("%s: class `%s' has no child property named `%s'", G_STRLOC, G_OBJECT_TYPE_NAME (object), name); break; } if (!(pspec->flags & G_PARAM_READABLE)) { g_warning ("%s: child property `%s' of class `%s' is not readable", G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object)); break; } g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); item_get_child_property (object, child, pspec, &value, is_model); G_VALUE_LCOPY (&value, var_args, 0, &error); if (error) { g_warning ("%s: %s", G_STRLOC, error); g_free (error); g_value_unset (&value); break; } g_value_unset (&value); } g_object_unref (child); g_object_unref (object); } static inline void canvas_item_set_child_property (GObject *object, GObject *child, GParamSpec *pspec, const GValue *value, GObjectNotifyQueue *nqueue, gboolean is_model) { GValue tmp_value = { 0, }; /* provide a copy to work from, convert (if necessary) and validate */ g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec)); if (!g_value_transform (value, &tmp_value)) g_warning ("unable to set child property `%s' of type `%s' from value of type `%s'", pspec->name, g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)), G_VALUE_TYPE_NAME (value)); else if (g_param_value_validate (pspec, &tmp_value) && !(pspec->flags & G_PARAM_LAX_VALIDATION)) { gchar *contents = g_strdup_value_contents (value); g_warning ("value \"%s\" of type `%s' is invalid for property `%s' of type `%s'", contents, G_VALUE_TYPE_NAME (value), pspec->name, g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec))); g_free (contents); } else { GObjectClass *class = g_type_class_peek (pspec->owner_type); if (is_model) { GooCanvasItemModelIface *iface; iface = g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM_MODEL); iface->set_child_property ((GooCanvasItemModel*) object, (GooCanvasItemModel*) child, pspec->param_id, &tmp_value, pspec); } else { GooCanvasItemIface *iface; iface = g_type_interface_peek (class, GOO_TYPE_CANVAS_ITEM); iface->set_child_property ((GooCanvasItem*) object, (GooCanvasItem*) child, pspec->param_id, &tmp_value, pspec); } g_object_notify_queue_add (G_OBJECT (child), nqueue, pspec); } g_value_unset (&tmp_value); } void _goo_canvas_item_set_child_property_internal (GObject *object, GObject *child, const gchar *property_name, const GValue *value, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model) { GObjectNotifyQueue *nqueue; GParamSpec *pspec; g_object_ref (object); g_object_ref (child); nqueue = g_object_notify_queue_freeze (child, notify_context); pspec = g_param_spec_pool_lookup (property_pool, property_name, G_OBJECT_TYPE (object), TRUE); if (!pspec) g_warning ("%s: class `%s' has no child property named `%s'", G_STRLOC, G_OBJECT_TYPE_NAME (object), property_name); else if (!(pspec->flags & G_PARAM_WRITABLE)) g_warning ("%s: child property `%s' of class `%s' is not writable", G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object)); else { canvas_item_set_child_property (object, child, pspec, value, nqueue, is_model); } g_object_notify_queue_thaw (child, nqueue); g_object_unref (object); g_object_unref (child); } void _goo_canvas_item_set_child_properties_internal (GObject *object, GObject *child, va_list var_args, GParamSpecPool *property_pool, GObjectNotifyContext *notify_context, gboolean is_model) { GObjectNotifyQueue *nqueue; g_object_ref (object); g_object_ref (child); nqueue = g_object_notify_queue_freeze (child, notify_context); for (;;) { GValue value = { 0, }; GParamSpec *pspec; gchar *name, *error = NULL; name = va_arg (var_args, gchar*); if (!name) break; pspec = g_param_spec_pool_lookup (property_pool, name, G_OBJECT_TYPE (object), TRUE); if (!pspec) { g_warning ("%s: class `%s' has no child property named `%s'", G_STRLOC, G_OBJECT_TYPE_NAME (object), name); break; } if (!(pspec->flags & G_PARAM_WRITABLE)) { g_warning ("%s: child property `%s' of class `%s' is not writable", G_STRLOC, pspec->name, G_OBJECT_TYPE_NAME (object)); break; } g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (pspec)); G_VALUE_COLLECT (&value, var_args, 0, &error); if (error) { g_warning ("%s: %s", G_STRLOC, error); g_free (error); /* we purposely leak the value here, it might not be * in a sane state if an error condition occoured */ break; } canvas_item_set_child_property (object, child, pspec, &value, nqueue, is_model); g_value_unset (&value); } g_object_notify_queue_thaw (G_OBJECT (child), nqueue); g_object_unref (object); g_object_unref (child); } /** * goo_canvas_item_get_child_property: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @property_name: the name of the child property to get. * @value: a location to return the value. * * Gets a child property of @child. **/ void goo_canvas_item_get_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, GValue *value) { g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GOO_IS_CANVAS_ITEM (child)); g_return_if_fail (property_name != NULL); g_return_if_fail (G_IS_VALUE (value)); _goo_canvas_item_get_child_property_internal ((GObject*) item, (GObject*) child, property_name, value, _goo_canvas_item_child_property_pool, FALSE); } /** * goo_canvas_item_set_child_property: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @property_name: the name of the child property to set. * @value: the value to set the property to. * * Sets a child property of @child. **/ void goo_canvas_item_set_child_property (GooCanvasItem *item, GooCanvasItem *child, const gchar *property_name, const GValue *value) { g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GOO_IS_CANVAS_ITEM (child)); g_return_if_fail (property_name != NULL); g_return_if_fail (G_IS_VALUE (value)); _goo_canvas_item_set_child_property_internal ((GObject*) item, (GObject*) child, property_name, value, _goo_canvas_item_child_property_pool, _goo_canvas_item_child_property_notify_context, FALSE); } /** * goo_canvas_item_get_child_properties_valist: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @var_args: pairs of property names and value pointers, and a terminating * %NULL. * * Gets the values of one or more child properties of @child. **/ void goo_canvas_item_get_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args) { g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GOO_IS_CANVAS_ITEM (child)); _goo_canvas_item_get_child_properties_internal ((GObject*) item, (GObject*) child, var_args, _goo_canvas_item_child_property_pool, _goo_canvas_item_child_property_notify_context, FALSE); } /** * goo_canvas_item_set_child_properties_valist: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @var_args: pairs of property names and values, and a terminating %NULL. * * Sets the values of one or more child properties of @child. **/ void goo_canvas_item_set_child_properties_valist (GooCanvasItem *item, GooCanvasItem *child, va_list var_args) { g_return_if_fail (GOO_IS_CANVAS_ITEM (item)); g_return_if_fail (GOO_IS_CANVAS_ITEM (child)); _goo_canvas_item_set_child_properties_internal ((GObject*) item, (GObject*) child, var_args, _goo_canvas_item_child_property_pool, _goo_canvas_item_child_property_notify_context, FALSE); } /** * goo_canvas_item_get_child_properties: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @...: pairs of property names and value pointers, and a terminating %NULL. * * Gets the values of one or more child properties of @child. **/ void goo_canvas_item_get_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...) { va_list var_args; va_start (var_args, child); goo_canvas_item_get_child_properties_valist (item, child, var_args); va_end (var_args); } /** * goo_canvas_item_set_child_properties: * @item: a #GooCanvasItem. * @child: a child #GooCanvasItem. * @...: pairs of property names and values, and a terminating %NULL. * * Sets the values of one or more child properties of @child. **/ void goo_canvas_item_set_child_properties (GooCanvasItem *item, GooCanvasItem *child, ...) { va_list var_args; va_start (var_args, child); goo_canvas_item_set_child_properties_valist (item, child, var_args); va_end (var_args); } /** * goo_canvas_item_class_install_child_property: * @iclass: a #GObjectClass * @property_id: the id for the property * @pspec: the #GParamSpec for the property * * This function is only intended to be used when implementing new canvas * items, specifically layout container items such as #GooCanvasTable. * * It installs a child property on a canvas item class. **/ void goo_canvas_item_class_install_child_property (GObjectClass *iclass, guint property_id, GParamSpec *pspec) { g_return_if_fail (G_IS_OBJECT_CLASS (iclass)); g_return_if_fail (G_IS_PARAM_SPEC (pspec)); g_return_if_fail (property_id > 0); if (g_param_spec_pool_lookup (_goo_canvas_item_child_property_pool, pspec->name, G_OBJECT_CLASS_TYPE (iclass), FALSE)) { g_warning (G_STRLOC ": class `%s' already contains a child property named `%s'", G_OBJECT_CLASS_NAME (iclass), pspec->name); return; } g_param_spec_ref (pspec); g_param_spec_sink (pspec); pspec->param_id = property_id; g_param_spec_pool_insert (_goo_canvas_item_child_property_pool, pspec, G_OBJECT_CLASS_TYPE (iclass)); } /** * goo_canvas_item_class_find_child_property: * @iclass: a #GObjectClass * @property_name: the name of the child property to find * @returns: the #GParamSpec of the child property or %NULL if @class has no * child property with that name. * * This function is only intended to be used when implementing new canvas * items, specifically layout container items such as #GooCanvasTable. * * It finds a child property of a canvas item class by name. */ GParamSpec* goo_canvas_item_class_find_child_property (GObjectClass *iclass, const gchar *property_name) { g_return_val_if_fail (G_IS_OBJECT_CLASS (iclass), NULL); g_return_val_if_fail (property_name != NULL, NULL); return g_param_spec_pool_lookup (_goo_canvas_item_child_property_pool, property_name, G_OBJECT_CLASS_TYPE (iclass), TRUE); } /** * goo_canvas_item_class_list_child_properties: * @iclass: a #GObjectClass * @n_properties: location to return the number of child properties found * @returns: a newly allocated array of #GParamSpec*. The array must be * freed with g_free(). * * This function is only intended to be used when implementing new canvas * items, specifically layout container items such as #GooCanvasTable. * * It returns all child properties of a canvas item class. */ GParamSpec** goo_canvas_item_class_list_child_properties (GObjectClass *iclass, guint *n_properties) { GParamSpec **pspecs; guint n; g_return_val_if_fail (G_IS_OBJECT_CLASS (iclass), NULL); pspecs = g_param_spec_pool_list (_goo_canvas_item_child_property_pool, G_OBJECT_CLASS_TYPE (iclass), &n); if (n_properties) *n_properties = n; return pspecs; } goocanvas-0.15/src/goocanvaspolyline.h0000644000076400007640000001303611172574677015070 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaspolyline.h - polyline item, with optional arrows. */ #ifndef __GOO_CANVAS_POLYLINE_H__ #define __GOO_CANVAS_POLYLINE_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS /** * GooCanvasPoints * @coords: the coordinates of the points, in pairs. * @num_points: the number of points. * @ref_count: the reference count of the struct. * * #GooCairoPoints represents an array of points. */ typedef struct _GooCanvasPoints GooCanvasPoints; struct _GooCanvasPoints { double *coords; int num_points; int ref_count; }; #define GOO_TYPE_CANVAS_POINTS goo_canvas_points_get_type() GType goo_canvas_points_get_type (void); GooCanvasPoints* goo_canvas_points_new (int num_points); GooCanvasPoints* goo_canvas_points_ref (GooCanvasPoints *points); void goo_canvas_points_unref (GooCanvasPoints *points); #define NUM_ARROW_POINTS 5 /* number of points in an arrowhead */ typedef struct _GooCanvasPolylineArrowData GooCanvasPolylineArrowData; struct _GooCanvasPolylineArrowData { /* These are specified in multiples of the line width, e.g. if arrow_width is 2 the width of the arrow will be twice the width of the line. */ gdouble arrow_width, arrow_length, arrow_tip_length; gdouble line_start[2], line_end[2]; gdouble start_arrow_coords[NUM_ARROW_POINTS * 2]; gdouble end_arrow_coords[NUM_ARROW_POINTS * 2]; }; /* This is the data used by both model and view classes. */ typedef struct _GooCanvasPolylineData GooCanvasPolylineData; struct _GooCanvasPolylineData { gdouble *coords; GooCanvasPolylineArrowData *arrow_data; guint num_points : 16; guint close_path : 1; guint start_arrow : 1; guint end_arrow : 1; guint reconfigure_arrows : 1; }; #define GOO_TYPE_CANVAS_POLYLINE (goo_canvas_polyline_get_type ()) #define GOO_CANVAS_POLYLINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolyline)) #define GOO_CANVAS_POLYLINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass)) #define GOO_IS_CANVAS_POLYLINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_POLYLINE)) #define GOO_IS_CANVAS_POLYLINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_POLYLINE)) #define GOO_CANVAS_POLYLINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_POLYLINE, GooCanvasPolylineClass)) typedef struct _GooCanvasPolyline GooCanvasPolyline; typedef struct _GooCanvasPolylineClass GooCanvasPolylineClass; /** * GooCanvasPolyline * * The #GooCanvasPolyline-struct struct contains private data only. */ struct _GooCanvasPolyline { GooCanvasItemSimple parent; GooCanvasPolylineData *polyline_data; }; struct _GooCanvasPolylineClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_polyline_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_polyline_new (GooCanvasItem *parent, gboolean close_path, gint num_points, ...); GooCanvasItem* goo_canvas_polyline_new_line (GooCanvasItem *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); #define GOO_TYPE_CANVAS_POLYLINE_MODEL (goo_canvas_polyline_model_get_type ()) #define GOO_CANVAS_POLYLINE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModel)) #define GOO_CANVAS_POLYLINE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModelClass)) #define GOO_IS_CANVAS_POLYLINE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL)) #define GOO_IS_CANVAS_POLYLINE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_POLYLINE_MODEL)) #define GOO_CANVAS_POLYLINE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_POLYLINE_MODEL, GooCanvasPolylineModelClass)) typedef struct _GooCanvasPolylineModel GooCanvasPolylineModel; typedef struct _GooCanvasPolylineModelClass GooCanvasPolylineModelClass; /** * GooCanvasPolylineModel * * The #GooCanvasPolylineModel-struct struct contains private data only. */ struct _GooCanvasPolylineModel { GooCanvasItemModelSimple parent_object; GooCanvasPolylineData polyline_data; }; struct _GooCanvasPolylineModelClass { GooCanvasItemModelSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_polyline_model_get_type (void) G_GNUC_CONST; GooCanvasItemModel* goo_canvas_polyline_model_new (GooCanvasItemModel *parent, gboolean close_path, gint num_points, ...); GooCanvasItemModel* goo_canvas_polyline_model_new_line (GooCanvasItemModel *parent, gdouble x1, gdouble y1, gdouble x2, gdouble y2, ...); G_END_DECLS #endif /* __GOO_CANVAS_POLYLINE_H__ */ goocanvas-0.15/src/goocanvaswidget.c0000644000076400007640000004137311172574677014520 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaswidget.c - wrapper item for an embedded GtkWidget. */ /** * SECTION:goocanvaswidget * @Title: GooCanvasWidget * @Short_Description: an embedded widget item. * * GooCanvasWidget provides support for placing any GtkWidget in the canvas. * * The #GooCanvasWidget:width and #GooCanvasWidget:height properties specify * the widget's size. If either of them is -1, then the requested size of the * widget is used instead, which is the default for both width and height. * * Note that there are a number of limitations in the use of #GooCanvasWidget: * * * It doesn't support any transformation besides simple translation. * This means you can't scale a canvas with a #GooCanvasWidget in it. * * It doesn't support layering, so you can't place other items beneath * or above the #GooCanvasWidget. * * It doesn't support rendering of widgets to a given cairo_t, which * means you can't output the widget to a pdf or postscript file. * * It doesn't have a model/view variant like the other standard items, * so it can only be used in a simple canvas without a model. * * It can't be made a static item. * */ #include #include #include #include "goocanvas.h" #include "goocanvasatk.h" enum { PROP_0, PROP_WIDGET, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_ANCHOR, PROP_VISIBILITY }; static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_widget_dispose (GObject *object); static void goo_canvas_widget_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_widget_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasWidget, goo_canvas_widget, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_widget_init (GooCanvasWidget *witem) { /* By default we place the widget at the top-left of the canvas at its requested size. */ witem->x = 0.0; witem->y = 0.0; witem->width = -1.0; witem->height = -1.0; witem->anchor = GTK_ANCHOR_NW; } /** * goo_canvas_widget_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @widget: the widget. * @x: the x coordinate of the item. * @y: the y coordinate of the item. * @width: the width of the item, or -1 to use the widget's requested width. * @height: the height of the item, or -1 to use the widget's requested height. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new widget item. * * * * Here's an example showing how to create an entry widget centered at (100.0, * 100.0): * * * GtkWidget *entry = gtk_entry_new (); * GooCanvasItem *witem = goo_canvas_widget_new (mygroup, entry, * 100, 100, -1, -1, * "anchor", GTK_ANCHOR_CENTER, * NULL); * * * Returns: a new widget item. **/ GooCanvasItem* goo_canvas_widget_new (GooCanvasItem *parent, GtkWidget *widget, gdouble x, gdouble y, gdouble width, gdouble height, ...) { GooCanvasItem *item; GooCanvasWidget *witem; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_WIDGET, NULL); witem = (GooCanvasWidget*) item; witem->widget = widget; g_object_ref (witem->widget); g_object_set_data (G_OBJECT (witem->widget), "goo-canvas-item", witem); witem->x = x; witem->y = y; witem->width = width; witem->height = height; /* The widget defaults to being visible, like the canvas item, but this can be overridden by the object property below. */ if (widget) gtk_widget_show (widget); va_start (var_args, height); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } /* Returns the anchor position, within the given width. */ static gdouble goo_canvas_widget_anchor_horizontal_pos (GtkAnchorType anchor, gdouble width) { switch(anchor) { case GTK_ANCHOR_N: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_S: return width / 2.0; case GTK_ANCHOR_NE: case GTK_ANCHOR_E: case GTK_ANCHOR_SE: return width; default: return 0.0; } } /* Returns the anchor position, within the given height. */ static gdouble goo_canvas_widget_anchor_vertical_pos (GtkAnchorType anchor, gdouble height) { switch (anchor) { case GTK_ANCHOR_W: case GTK_ANCHOR_CENTER: case GTK_ANCHOR_E: return height / 2.0; case GTK_ANCHOR_SW: case GTK_ANCHOR_S: case GTK_ANCHOR_SE: return height; default: return 0.0; } } /* Returns the size to use for the widget, either the item's width & height properties or the widget's own requested width & height. */ static void goo_canvas_widget_get_widget_size (GooCanvasWidget *witem, gdouble *width, gdouble *height) { GtkRequisition requisition; if (witem->widget) { /* Get the widget's requested size, if we need it. */ if (witem->width < 0 || witem->height < 0) gtk_widget_size_request (witem->widget, &requisition); *width = witem->width < 0 ? requisition.width : witem->width; *height = witem->height < 0 ? requisition.height : witem->height; } else { *width = *height = 0.0; } } static void goo_canvas_widget_set_widget (GooCanvasWidget *witem, GtkWidget *widget) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) witem; if (witem->widget) { g_object_set_data (G_OBJECT (witem->widget), "goo-canvas-item", NULL); gtk_widget_unparent (witem->widget); g_object_unref (witem->widget); witem->widget = NULL; } if (widget) { witem->widget = widget; g_object_ref (witem->widget); g_object_set_data (G_OBJECT (witem->widget), "goo-canvas-item", witem); if (simple->simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE) gtk_widget_hide (widget); else gtk_widget_show (widget); if (simple->canvas) { if (GTK_WIDGET_REALIZED (simple->canvas)) gtk_widget_set_parent_window (widget, simple->canvas->canvas_window); gtk_widget_set_parent (widget, GTK_WIDGET (simple->canvas)); } } } static void goo_canvas_widget_dispose (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasWidget *witem = (GooCanvasWidget*) object; if (simple->canvas) goo_canvas_unregister_widget_item (simple->canvas, witem); goo_canvas_widget_set_widget (witem, NULL); G_OBJECT_CLASS (goo_canvas_widget_parent_class)->dispose (object); } static void goo_canvas_widget_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasWidget *witem = (GooCanvasWidget*) object; switch (prop_id) { case PROP_WIDGET: g_value_set_object (value, witem->widget); break; case PROP_X: g_value_set_double (value, witem->x); break; case PROP_Y: g_value_set_double (value, witem->y); break; case PROP_WIDTH: g_value_set_double (value, witem->width); break; case PROP_HEIGHT: g_value_set_double (value, witem->height); break; case PROP_ANCHOR: g_value_set_enum (value, witem->anchor); break; case PROP_VISIBILITY: g_value_set_enum (value, simple->simple_data->visibility); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_widget_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasWidget *witem = (GooCanvasWidget*) object; switch (prop_id) { case PROP_WIDGET: goo_canvas_widget_set_widget (witem, g_value_get_object (value)); break; case PROP_X: witem->x = g_value_get_double (value); break; case PROP_Y: witem->y = g_value_get_double (value); break; case PROP_WIDTH: witem->width = g_value_get_double (value); break; case PROP_HEIGHT: witem->height = g_value_get_double (value); break; case PROP_ANCHOR: witem->anchor = g_value_get_enum (value); break; case PROP_VISIBILITY: simple->simple_data->visibility = g_value_get_enum (value); if (simple->simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE) gtk_widget_hide (witem->widget); else gtk_widget_show (witem->widget); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_widget_set_canvas (GooCanvasItem *item, GooCanvas *canvas) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasWidget *witem = (GooCanvasWidget*) item; if (simple->canvas != canvas) { if (simple->canvas) goo_canvas_unregister_widget_item (simple->canvas, witem); simple->canvas = canvas; if (simple->canvas) { goo_canvas_register_widget_item (simple->canvas, witem); if (witem->widget) { if (GTK_WIDGET_REALIZED (simple->canvas)) gtk_widget_set_parent_window (witem->widget, simple->canvas->canvas_window); gtk_widget_set_parent (witem->widget, GTK_WIDGET (simple->canvas)); } } else { if (witem->widget) gtk_widget_unparent (witem->widget); } } } static void goo_canvas_widget_set_parent (GooCanvasItem *item, GooCanvasItem *parent) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvas *canvas; simple->parent = parent; simple->need_update = TRUE; simple->need_entire_subtree_update = TRUE; canvas = parent ? goo_canvas_item_get_canvas (parent) : NULL; goo_canvas_widget_set_canvas (item, canvas); } static void goo_canvas_widget_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasWidget *witem = (GooCanvasWidget*) simple; gdouble width, height; if (witem->widget) { goo_canvas_widget_get_widget_size (witem, &width, &height); simple->bounds.x1 = witem->x; simple->bounds.y1 = witem->y; simple->bounds.x1 -= goo_canvas_widget_anchor_horizontal_pos (witem->anchor, width); simple->bounds.y1 -= goo_canvas_widget_anchor_vertical_pos (witem->anchor, height); simple->bounds.x2 = simple->bounds.x1 + width; simple->bounds.y2 = simple->bounds.y1 + height; /* Queue a resize of the widget so it gets moved. Note that the widget is moved by goo_canvas_size_allocate(). */ gtk_widget_queue_resize (witem->widget); } else { simple->bounds.x1 = simple->bounds.y1 = 0.0; simple->bounds.x2 = simple->bounds.y2 = 0.0; } } static void goo_canvas_widget_allocate_area (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *requested_area, const GooCanvasBounds *allocated_area, gdouble x_offset, gdouble y_offset) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasWidget *witem = (GooCanvasWidget*) item; gdouble requested_width, requested_height, allocated_width, allocated_height; gdouble width_proportion, height_proportion; gdouble width, height; width = simple->bounds.x2 - simple->bounds.x1; height = simple->bounds.y2 - simple->bounds.y1; simple->bounds.x1 += x_offset; simple->bounds.y1 += y_offset; requested_width = requested_area->x2 - requested_area->x1; requested_height = requested_area->y2 - requested_area->y1; allocated_width = allocated_area->x2 - allocated_area->x1; allocated_height = allocated_area->y2 - allocated_area->y1; width_proportion = allocated_width / requested_width; height_proportion = allocated_height / requested_height; width *= width_proportion; height *= height_proportion; simple->bounds.x2 = simple->bounds.x1 + width; simple->bounds.y2 = simple->bounds.y1 + height; /* Queue a resize of the widget so it gets moved. Note that the widget is moved by goo_canvas_size_allocate(). */ gtk_widget_queue_resize (witem->widget); } static void goo_canvas_widget_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { /* Do nothing for now. Maybe render for printing in future. */ } static gboolean goo_canvas_widget_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { /* For now we just assume that the widget covers its entire bounds so we just return TRUE. In future if widget items support transforms we'll need to modify this. */ return TRUE; } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_canvas = goo_canvas_widget_set_canvas; iface->set_parent = goo_canvas_widget_set_parent; iface->allocate_area = goo_canvas_widget_allocate_area; } static void goo_canvas_widget_class_init (GooCanvasWidgetClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->dispose = goo_canvas_widget_dispose; gobject_class->get_property = goo_canvas_widget_get_property; gobject_class->set_property = goo_canvas_widget_set_property; simple_class->simple_update = goo_canvas_widget_update; simple_class->simple_paint = goo_canvas_widget_paint; simple_class->simple_is_item_at = goo_canvas_widget_is_item_at; /* Register our accessible factory, but only if accessibility is enabled. */ if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET))) { atk_registry_set_factory_type (atk_get_default_registry (), GOO_TYPE_CANVAS_WIDGET, goo_canvas_widget_accessible_factory_get_type ()); } g_object_class_install_property (gobject_class, PROP_WIDGET, g_param_spec_object ("widget", _("Widget"), _("The widget to place in the canvas"), GTK_TYPE_WIDGET, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the widget"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the widget"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the widget, or -1 to use its requested width"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the widget, or -1 to use its requested height"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ANCHOR, g_param_spec_enum ("anchor", _("Anchor"), _("How to position the widget relative to the item's x and y coordinate settings"), GTK_TYPE_ANCHOR_TYPE, GTK_ANCHOR_NW, G_PARAM_READWRITE)); g_object_class_override_property (gobject_class, PROP_VISIBILITY, "visibility"); } goocanvas-0.15/src/goocanvasgroup.c0000644000076400007640000010261611172574677014367 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasgroup.c - group item. */ /** * SECTION:goocanvasgroup * @Title: GooCanvasGroup * @Short_Description: a group of items. * * #GooCanvasGroup represents a group of items. Groups can be nested to * any depth, to create a hierarchy of items. Items are ordered within each * group, with later items being displayed above earlier items. * * #GooCanvasGroup is a subclass of #GooCanvasItemSimple and so * inherits all of the style properties such as "stroke-color", "fill-color" * and "line-width". Setting a style property on a #GooCanvasGroup will affect * all children of the #GooCanvasGroup (unless the children override the * property setting). * * #GooCanvasGroup implements the #GooCanvasItem interface, so you can use * the #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(), and the properties such as "visibility" and * "pointer-events". * * If the #GooCanvasGroup:width and #GooCanvasGroup:height properties are * set to positive values then the group is clipped to the given size. * * To create a #GooCanvasGroup use goo_canvas_group_new(). * * To get or set the properties of an existing #GooCanvasGroup, use * g_object_get() and g_object_set(). */ #include #include #include #include "goocanvasprivate.h" #include "goocanvasgroup.h" #include "goocanvasitemmodel.h" #include "goocanvas.h" #include "goocanvasmarshal.h" #include "goocanvasatk.h" typedef struct _GooCanvasGroupPrivate GooCanvasGroupPrivate; struct _GooCanvasGroupPrivate { gdouble x; gdouble y; gdouble width; gdouble height; }; #define GOO_CANVAS_GROUP_GET_PRIVATE(group) \ (G_TYPE_INSTANCE_GET_PRIVATE ((group), GOO_TYPE_CANVAS_GROUP, GooCanvasGroupPrivate)) #define GOO_CANVAS_GROUP_MODEL_GET_PRIVATE(group) \ (G_TYPE_INSTANCE_GET_PRIVATE ((group), GOO_TYPE_CANVAS_GROUP_MODEL, GooCanvasGroupPrivate)) enum { PROP_0, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT }; static void goo_canvas_group_dispose (GObject *object); static void goo_canvas_group_finalize (GObject *object); static void goo_canvas_group_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_group_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void canvas_item_interface_init (GooCanvasItemIface *iface); G_DEFINE_TYPE_WITH_CODE (GooCanvasGroup, goo_canvas_group, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_group_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the group"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the group"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the group, or -1 to use the default width"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the group, or -1 to use the default height"), -G_MAXDOUBLE, G_MAXDOUBLE, -1.0, G_PARAM_READWRITE)); } static void goo_canvas_group_class_init (GooCanvasGroupClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasGroupPrivate)); gobject_class->dispose = goo_canvas_group_dispose; gobject_class->finalize = goo_canvas_group_finalize; gobject_class->get_property = goo_canvas_group_get_property; gobject_class->set_property = goo_canvas_group_set_property; /* Register our accessible factory, but only if accessibility is enabled. */ if (!ATK_IS_NO_OP_OBJECT_FACTORY (atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET))) { atk_registry_set_factory_type (atk_get_default_registry (), GOO_TYPE_CANVAS_GROUP, goo_canvas_item_accessible_factory_get_type ()); } goo_canvas_group_install_common_properties (gobject_class); } static void goo_canvas_group_init (GooCanvasGroup *group) { GooCanvasGroupPrivate* priv = GOO_CANVAS_GROUP_GET_PRIVATE (group); group->items = g_ptr_array_sized_new (8); priv->x = 0.0; priv->y = 0.0; priv->width = -1.0; priv->height = -1.0; } /** * goo_canvas_group_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new group item. * * Return value: a new group item. **/ GooCanvasItem* goo_canvas_group_new (GooCanvasItem *parent, ...) { GooCanvasItem *item; GooCanvasGroup *group; va_list var_args; const char *first_property; item = g_object_new (GOO_TYPE_CANVAS_GROUP, NULL); group = (GooCanvasGroup*) item; va_start (var_args, parent); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (item), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_group_dispose (GObject *object) { GooCanvasGroup *group = (GooCanvasGroup*) object; gint i; /* Unref all the items in the group. */ for (i = 0; i < group->items->len; i++) { GooCanvasItem *item = group->items->pdata[i]; goo_canvas_item_set_parent (item, NULL); g_object_unref (item); } g_ptr_array_set_size (group->items, 0); G_OBJECT_CLASS (goo_canvas_group_parent_class)->dispose (object); } static void goo_canvas_group_finalize (GObject *object) { GooCanvasGroup *group = (GooCanvasGroup*) object; g_ptr_array_free (group->items, TRUE); G_OBJECT_CLASS (goo_canvas_group_parent_class)->finalize (object); } /* Gets the private data to use, from the model or from the item itself. */ static GooCanvasGroupPrivate* goo_canvas_group_get_private (GooCanvasGroup *group) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) group; if (simple->model) return GOO_CANVAS_GROUP_MODEL_GET_PRIVATE (simple->model); else return GOO_CANVAS_GROUP_GET_PRIVATE (group); } static void goo_canvas_group_get_common_property (GObject *object, GooCanvasGroupPrivate *priv, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: g_value_set_double (value, priv->x); break; case PROP_Y: g_value_set_double (value, priv->y); break; case PROP_WIDTH: g_value_set_double (value, priv->width); break; case PROP_HEIGHT: g_value_set_double (value, priv->height); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_group_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasGroup *group = (GooCanvasGroup*) object; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); goo_canvas_group_get_common_property (object, priv, prop_id, value, pspec); } static void goo_canvas_group_set_common_property (GObject *object, GooCanvasGroupPrivate *priv, guint prop_id, const GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_X: priv->x = g_value_get_double (value); break; case PROP_Y: priv->y = g_value_get_double (value); break; case PROP_WIDTH: priv->width = g_value_get_double (value); break; case PROP_HEIGHT: priv->height = g_value_get_double (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_group_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasGroup *group = (GooCanvasGroup*) object; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_group_set_common_property (object, priv, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_group_add_child (GooCanvasItem *item, GooCanvasItem *child, gint position) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; AtkObject *atk_obj, *child_atk_obj; g_object_ref (child); if (position >= 0) { goo_canvas_util_ptr_array_insert (group->items, child, position); } else { position = group->items->len; g_ptr_array_add (group->items, child); } goo_canvas_item_set_parent (child, item); goo_canvas_item_set_is_static (child, simple->simple_data->is_static); /* Emit the "children_changed" ATK signal, if ATK is enabled. */ atk_obj = atk_gobject_accessible_for_object (G_OBJECT (item)); if (!ATK_IS_NO_OP_OBJECT (atk_obj)) { child_atk_obj = atk_gobject_accessible_for_object (G_OBJECT (child)); g_signal_emit_by_name (atk_obj, "children_changed::add", position, child_atk_obj); } goo_canvas_item_request_update (item); } static void goo_canvas_group_move_child (GooCanvasItem *item, gint old_position, gint new_position) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasItem *child; GooCanvasBounds bounds; /* Request a redraw of the item's bounds. */ child = group->items->pdata[old_position]; if (simple->canvas) { goo_canvas_item_get_bounds (child, &bounds); goo_canvas_request_item_redraw (simple->canvas, &bounds, simple->simple_data->is_static); } goo_canvas_util_ptr_array_move (group->items, old_position, new_position); goo_canvas_item_request_update (item); } static void goo_canvas_group_remove_child (GooCanvasItem *item, gint child_num) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasItem *child; GooCanvasBounds bounds; AtkObject *atk_obj, *child_atk_obj; g_return_if_fail (child_num < group->items->len); /* Request a redraw of the item's bounds. */ child = group->items->pdata[child_num]; if (simple->canvas) { goo_canvas_item_get_bounds (child, &bounds); goo_canvas_request_item_redraw (simple->canvas, &bounds, simple->simple_data->is_static); } /* Emit the "children_changed" ATK signal, if ATK is enabled. */ atk_obj = atk_gobject_accessible_for_object (G_OBJECT (item)); if (!ATK_IS_NO_OP_OBJECT (atk_obj)) { child_atk_obj = atk_gobject_accessible_for_object (G_OBJECT (child)); g_signal_emit_by_name (atk_obj, "children_changed::remove", child_num, child_atk_obj); } g_ptr_array_remove_index (group->items, child_num); goo_canvas_item_set_parent (child, NULL); g_object_unref (child); goo_canvas_item_request_update (item); } static gint goo_canvas_group_get_n_children (GooCanvasItem *item) { GooCanvasGroup *group = (GooCanvasGroup*) item; return group->items->len; } static GooCanvasItem* goo_canvas_group_get_child (GooCanvasItem *item, gint child_num) { GooCanvasGroup *group = (GooCanvasGroup*) item; if (child_num < group->items->len) return group->items->pdata[child_num]; return NULL; } /* This is only used to set the canvas of the root group. It isn't normally needed by apps. */ static void goo_canvas_group_set_canvas (GooCanvasItem *item, GooCanvas *canvas) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; gint i; if (simple->canvas == canvas) return; simple->canvas = canvas; /* Recursively set the canvas of all child items. */ for (i = 0; i < group->items->len; i++) { GooCanvasItem *item = group->items->pdata[i]; goo_canvas_item_set_canvas (item, canvas); } } static void goo_canvas_group_set_is_static (GooCanvasItem *item, gboolean is_static) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGroup *group = (GooCanvasGroup*) item; gint i; if (simple_data->is_static == is_static) return; simple_data->is_static = is_static; /* Recursively set the canvas of all child items. */ for (i = 0; i < group->items->len; i++) { GooCanvasItem *item = group->items->pdata[i]; goo_canvas_item_set_is_static (item, is_static); } } static void on_model_child_added (GooCanvasGroupModel *model, gint position, GooCanvasGroup *group) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) group; GooCanvasItem *item = (GooCanvasItem*) group; GooCanvasItemModel *child_model; GooCanvasItem *child; /* Create a canvas item for the model. */ child_model = goo_canvas_item_model_get_child ((GooCanvasItemModel*) model, position); child = goo_canvas_create_item (simple->canvas, child_model); goo_canvas_item_add_child (item, child, position); g_object_unref (child); } static void on_model_child_moved (GooCanvasGroupModel *model, gint old_position, gint new_position, GooCanvasGroup *group) { goo_canvas_item_move_child ((GooCanvasItem*) group, old_position, new_position); } static void on_model_child_removed (GooCanvasGroupModel *model, gint child_num, GooCanvasGroup *group) { goo_canvas_item_remove_child ((GooCanvasItem*) group, child_num); } static void goo_canvas_group_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; gint n_children, i; /* Do the default GooCanvasItemSimple code first. */ goo_canvas_item_simple_set_model (simple, model); /* Now add our own handlers. */ g_signal_connect (model, "child-added", G_CALLBACK (on_model_child_added), group); g_signal_connect (model, "child-moved", G_CALLBACK (on_model_child_moved), group); g_signal_connect (model, "child-removed", G_CALLBACK (on_model_child_removed), group); /* Recursively create child items for any children. */ n_children = goo_canvas_item_model_get_n_children (model); for (i = 0; i < n_children; i++) on_model_child_added ((GooCanvasGroupModel*) simple->model, i, group); } static void goo_canvas_group_request_update (GooCanvasItem *item) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; if (!simple->need_update) { simple->need_update = TRUE; if (simple->parent) goo_canvas_item_request_update (simple->parent); else if (simple->canvas) goo_canvas_request_update (simple->canvas); } } static void goo_canvas_group_update (GooCanvasItem *item, gboolean entire_tree, cairo_t *cr, GooCanvasBounds *bounds) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); GooCanvasBounds child_bounds; gboolean initial_bounds = TRUE; gint i; if (entire_tree || simple->need_update) { if (simple->need_entire_subtree_update) entire_tree = TRUE; simple->need_update = FALSE; simple->need_entire_subtree_update = FALSE; goo_canvas_item_simple_check_style (simple); simple->bounds.x1 = simple->bounds.y1 = 0.0; simple->bounds.x2 = simple->bounds.y2 = 0.0; cairo_save (cr); if (simple->simple_data->transform) cairo_transform (cr, simple->simple_data->transform); cairo_translate (cr, priv->x, priv->y); for (i = 0; i < group->items->len; i++) { GooCanvasItem *child = group->items->pdata[i]; goo_canvas_item_update (child, entire_tree, cr, &child_bounds); /* If the child has non-empty bounds, compute the union. */ if (child_bounds.x1 < child_bounds.x2 && child_bounds.y1 < child_bounds.y2) { if (initial_bounds) { simple->bounds.x1 = child_bounds.x1; simple->bounds.y1 = child_bounds.y1; simple->bounds.x2 = child_bounds.x2; simple->bounds.y2 = child_bounds.y2; initial_bounds = FALSE; } else { simple->bounds.x1 = MIN (simple->bounds.x1, child_bounds.x1); simple->bounds.y1 = MIN (simple->bounds.y1, child_bounds.y1); simple->bounds.x2 = MAX (simple->bounds.x2, child_bounds.x2); simple->bounds.y2 = MAX (simple->bounds.y2, child_bounds.y2); } } } cairo_restore (cr); } *bounds = simple->bounds; } static GList* goo_canvas_group_get_items_at (GooCanvasItem *item, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event, gboolean parent_visible, GList *found_items) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); gboolean visible = parent_visible; int i; if (simple->need_update) goo_canvas_item_ensure_updated (item); /* Skip the item if the point isn't in the item's bounds. */ if (simple->bounds.x1 > x || simple->bounds.x2 < x || simple->bounds.y1 > y || simple->bounds.y2 < y) return found_items; if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold)) visible = FALSE; /* Check if the group should receive events. */ if (is_pointer_event && (simple_data->pointer_events == GOO_CANVAS_EVENTS_NONE || ((simple_data->pointer_events & GOO_CANVAS_EVENTS_VISIBLE_MASK) && !visible))) return found_items; cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, priv->x, priv->y); /* If the group has a clip path, check if the point is inside it. */ if (simple_data->clip_path_commands) { double user_x = x, user_y = y; cairo_device_to_user (cr, &user_x, &user_y); goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); if (!cairo_in_fill (cr, user_x, user_y)) { cairo_restore (cr); return found_items; } } if (priv->width > 0.0 && priv->height > 0.0) { double user_x = x, user_y = y; cairo_device_to_user (cr, &user_x, &user_y); if (user_x < 0.0 || user_x >= priv->width || user_y < 0.0 || user_y >= priv->height) { cairo_restore (cr); return found_items; } } /* Step up from the bottom of the children to the top, adding any items found to the start of the list. */ for (i = 0; i < group->items->len; i++) { GooCanvasItem *child = group->items->pdata[i]; found_items = goo_canvas_item_get_items_at (child, x, y, cr, is_pointer_event, visible, found_items); } cairo_restore (cr); return found_items; } static void goo_canvas_group_paint (GooCanvasItem *item, cairo_t *cr, const GooCanvasBounds *bounds, gdouble scale) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasItemSimpleData *simple_data = simple->simple_data; GooCanvasGroup *group = (GooCanvasGroup*) item; GooCanvasGroupPrivate *priv = goo_canvas_group_get_private (group); gint i; /* Skip the item if the bounds don't intersect the expose rectangle. */ if (simple->bounds.x1 > bounds->x2 || simple->bounds.x2 < bounds->x1 || simple->bounds.y1 > bounds->y2 || simple->bounds.y2 < bounds->y1) return; /* Check if the item should be visible. */ if (simple_data->visibility <= GOO_CANVAS_ITEM_INVISIBLE || (simple_data->visibility == GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD && simple->canvas->scale < simple_data->visibility_threshold)) return; /* Paint all the items in the group. */ cairo_save (cr); if (simple_data->transform) cairo_transform (cr, simple_data->transform); cairo_translate (cr, priv->x, priv->y); /* Clip with the group's clip path, if it is set. */ if (simple_data->clip_path_commands) { goo_canvas_create_path (simple_data->clip_path_commands, cr); cairo_set_fill_rule (cr, simple_data->clip_fill_rule); cairo_clip (cr); } if (priv->width > 0.0 && priv->height > 0.0) { cairo_rectangle (cr, 0.0, 0.0, priv->width, priv->height); cairo_clip (cr); } for (i = 0; i < group->items->len; i++) { GooCanvasItem *child = group->items->pdata[i]; goo_canvas_item_paint (child, cr, bounds, scale); } cairo_restore (cr); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_canvas = goo_canvas_group_set_canvas; iface->get_n_children = goo_canvas_group_get_n_children; iface->get_child = goo_canvas_group_get_child; iface->request_update = goo_canvas_group_request_update; iface->add_child = goo_canvas_group_add_child; iface->move_child = goo_canvas_group_move_child; iface->remove_child = goo_canvas_group_remove_child; iface->get_items_at = goo_canvas_group_get_items_at; iface->update = goo_canvas_group_update; iface->paint = goo_canvas_group_paint; iface->set_model = goo_canvas_group_set_model; iface->set_is_static = goo_canvas_group_set_is_static; } /** * SECTION:goocanvasgroupmodel * @Title: GooCanvasGroupModel * @Short_Description: a model for a group of items. * * #GooCanvasGroupModel represents a group of items. Groups can be nested to * any depth, to create a hierarchy of items. Items are ordered within each * group, with later items being displayed above earlier items. * * #GooCanvasGroupModel is a subclass of #GooCanvasItemModelSimple and so * inherits all of the style properties such as "stroke-color", "fill-color" * and "line-width". Setting a style property on a #GooCanvasGroupModel will * affect all children of the #GooCanvasGroupModel (unless the children * override the property setting). * * #GooCanvasGroupModel implements the #GooCanvasItemModel interface, so you * can use the #GooCanvasItemModel functions such as * goo_canvas_item_model_raise() and goo_canvas_item_model_rotate(), and the * properties such as "visibility" and "pointer-events". * * To create a #GooCanvasGroupModel use goo_canvas_group_model_new(). * * To get or set the properties of an existing #GooCanvasGroupModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the group you must connect * to the signal handlers of the corresponding #GooCanvasGroup objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_group_model_dispose (GObject *object); static void goo_canvas_group_model_finalize (GObject *object); static void goo_canvas_group_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void goo_canvas_group_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasGroupModel, goo_canvas_group_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_group_model_class_init (GooCanvasGroupModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasGroupPrivate)); gobject_class->dispose = goo_canvas_group_model_dispose; gobject_class->finalize = goo_canvas_group_model_finalize; gobject_class->get_property = goo_canvas_group_model_get_property; gobject_class->set_property = goo_canvas_group_model_set_property; goo_canvas_group_install_common_properties (gobject_class); } static void goo_canvas_group_model_init (GooCanvasGroupModel *gmodel) { GooCanvasGroupPrivate *priv = GOO_CANVAS_GROUP_MODEL_GET_PRIVATE (gmodel); gmodel->children = g_ptr_array_sized_new (8); priv->x = 0.0; priv->y = 0.0; priv->width = -1.0; priv->height = -1.0; } /** * goo_canvas_group_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new group item. * * Return value: a new group model. **/ GooCanvasItemModel* goo_canvas_group_model_new (GooCanvasItemModel *parent, ...) { GooCanvasItemModel *model; GooCanvasGroupModel *gmodel; va_list var_args; const char *first_property; model = g_object_new (GOO_TYPE_CANVAS_GROUP_MODEL, NULL); gmodel = (GooCanvasGroupModel*) model; va_start (var_args, parent); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist (G_OBJECT (model), first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_group_model_dispose (GObject *object) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) object; gint i; /* Unref all the items in the group. */ for (i = 0; i < gmodel->children->len; i++) { GooCanvasItemModel *child = gmodel->children->pdata[i]; goo_canvas_item_model_set_parent (child, NULL); g_object_unref (child); } g_ptr_array_set_size (gmodel->children, 0); G_OBJECT_CLASS (goo_canvas_group_model_parent_class)->dispose (object); } static void goo_canvas_group_model_finalize (GObject *object) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) object; g_ptr_array_free (gmodel->children, TRUE); G_OBJECT_CLASS (goo_canvas_group_model_parent_class)->finalize (object); } static void goo_canvas_group_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasGroupModel *model = (GooCanvasGroupModel*) object; GooCanvasGroupPrivate *priv = GOO_CANVAS_GROUP_MODEL_GET_PRIVATE (model); goo_canvas_group_get_common_property (object, priv, prop_id, value, pspec); } static void goo_canvas_group_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasGroupModel *model = (GooCanvasGroupModel*) object; GooCanvasGroupPrivate *priv = GOO_CANVAS_GROUP_MODEL_GET_PRIVATE (model); goo_canvas_group_set_common_property (object, priv, prop_id, value, pspec); g_signal_emit_by_name (model, "changed", TRUE); } extern void _goo_canvas_item_model_emit_child_added (GooCanvasItemModel *model, gint position); static void goo_canvas_group_model_add_child (GooCanvasItemModel *model, GooCanvasItemModel *child, gint position) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; g_object_ref (child); if (position >= 0) { goo_canvas_util_ptr_array_insert (gmodel->children, child, position); } else { position = gmodel->children->len; g_ptr_array_add (gmodel->children, child); } goo_canvas_item_model_set_parent (child, model); _goo_canvas_item_model_emit_child_added (model, position); } static void goo_canvas_group_model_move_child (GooCanvasItemModel *model, gint old_position, gint new_position) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; goo_canvas_util_ptr_array_move (gmodel->children, old_position, new_position); g_signal_emit_by_name (gmodel, "child-moved", old_position, new_position); } static void goo_canvas_group_model_remove_child (GooCanvasItemModel *model, gint child_num) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; GooCanvasItemModel *child; child = gmodel->children->pdata[child_num]; goo_canvas_item_model_set_parent (child, NULL); g_ptr_array_remove_index (gmodel->children, child_num); g_signal_emit_by_name (gmodel, "child-removed", child_num); g_object_unref (child); } static gint goo_canvas_group_model_get_n_children (GooCanvasItemModel *model) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; return gmodel->children->len; } static GooCanvasItemModel* goo_canvas_group_model_get_child (GooCanvasItemModel *model, gint child_num) { GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model; if (child_num < gmodel->children->len) return gmodel->children->pdata[child_num]; return NULL; } static GooCanvasItem* goo_canvas_group_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = goo_canvas_group_new (NULL, NULL); /* Note that we set the canvas before the model, since we may need the canvas to create any child items. */ goo_canvas_item_set_canvas (item, canvas); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->add_child = goo_canvas_group_model_add_child; iface->move_child = goo_canvas_group_model_move_child; iface->remove_child = goo_canvas_group_model_remove_child; iface->get_n_children = goo_canvas_group_model_get_n_children; iface->get_child = goo_canvas_group_model_get_child; iface->create_item = goo_canvas_group_model_create_item; } goocanvas-0.15/src/goocanvasellipse.c0000644000076400007640000004553611172574677014677 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasellipse.c - ellipse item. */ /** * SECTION:goocanvasellipse * @Title: GooCanvasEllipse * @Short_Description: an ellipse item. * * GooCanvasEllipse represents an ellipse item. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasEllipse use goo_canvas_ellipse_new(). * * To get or set the properties of an existing #GooCanvasEllipse, use * g_object_get() and g_object_set(). * * The ellipse can be specified either with the "center-x", "center-y", * "radius-x" and "radius-y" properties, or with the "x", "y", "width" and * "height" properties. */ #include #include #include #include #include "goocanvasellipse.h" enum { PROP_0, PROP_CENTER_X, PROP_CENTER_Y, PROP_RADIUS_X, PROP_RADIUS_Y, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT }; static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_ellipse_finalize (GObject *object); static void goo_canvas_ellipse_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_ellipse_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); static void goo_canvas_ellipse_create_path (GooCanvasItemSimple *simple, cairo_t *cr); G_DEFINE_TYPE_WITH_CODE (GooCanvasEllipse, goo_canvas_ellipse, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_ellipse_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_CENTER_X, g_param_spec_double ("center-x", _("Center X"), _("The x coordinate of the center of the ellipse"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_CENTER_Y, g_param_spec_double ("center-y", _("Center Y"), _("The y coordinate of the center of the ellipse"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RADIUS_X, g_param_spec_double ("radius-x", _("Radius X"), _("The horizontal radius of the ellipse"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_RADIUS_Y, g_param_spec_double ("radius-y", _("Radius Y"), _("The vertical radius of the ellipse"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the left side of the ellipse"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the top of the ellipse"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the ellipse"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the ellipse"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); } static void goo_canvas_ellipse_class_init (GooCanvasEllipseClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; gobject_class->finalize = goo_canvas_ellipse_finalize; gobject_class->get_property = goo_canvas_ellipse_get_property; gobject_class->set_property = goo_canvas_ellipse_set_property; simple_class->simple_create_path = goo_canvas_ellipse_create_path; goo_canvas_ellipse_install_common_properties (gobject_class); } static void goo_canvas_ellipse_init (GooCanvasEllipse *ellipse) { ellipse->ellipse_data = g_slice_new0 (GooCanvasEllipseData); } /** * goo_canvas_ellipse_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @center_x: the x coordinate of the center of the ellipse. * @center_y: the y coordinate of the center of the ellipse. * @radius_x: the horizontal radius of the ellipse. * @radius_y: the vertical radius of the ellipse. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new ellipse item. * * * * Here's an example showing how to create an ellipse centered at (100.0, * 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. * It is drawn with a red outline with a width of 5.0 and filled with blue: * * * GooCanvasItem *ellipse = goo_canvas_ellipse_new (mygroup, 100.0, 100.0, 50.0, 30.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new ellipse item. **/ GooCanvasItem* goo_canvas_ellipse_new (GooCanvasItem *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...) { GooCanvasItem *item; GooCanvasEllipse *ellipse; GooCanvasEllipseData *ellipse_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_ELLIPSE, NULL); ellipse = (GooCanvasEllipse*) item; ellipse_data = ellipse->ellipse_data; ellipse_data->center_x = center_x; ellipse_data->center_y = center_y; ellipse_data->radius_x = radius_x; ellipse_data->radius_y = radius_y; va_start (var_args, radius_y); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_ellipse_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasEllipse *ellipse = (GooCanvasEllipse*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) g_slice_free (GooCanvasEllipseData, ellipse->ellipse_data); ellipse->ellipse_data = NULL; G_OBJECT_CLASS (goo_canvas_ellipse_parent_class)->finalize (object); } static void goo_canvas_ellipse_get_common_property (GObject *object, GooCanvasEllipseData *ellipse_data, guint prop_id, GValue *value, GParamSpec *pspec) { switch (prop_id) { case PROP_CENTER_X: g_value_set_double (value, ellipse_data->center_x); break; case PROP_CENTER_Y: g_value_set_double (value, ellipse_data->center_y); break; case PROP_RADIUS_X: g_value_set_double (value, ellipse_data->radius_x); break; case PROP_RADIUS_Y: g_value_set_double (value, ellipse_data->radius_y); break; case PROP_X: g_value_set_double (value, ellipse_data->center_x - ellipse_data->radius_x); break; case PROP_Y: g_value_set_double (value, ellipse_data->center_y - ellipse_data->radius_y); break; case PROP_WIDTH: g_value_set_double (value, 2.0 * ellipse_data->radius_x); break; case PROP_HEIGHT: g_value_set_double (value, 2.0 * ellipse_data->radius_y); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_ellipse_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasEllipse *ellipse = (GooCanvasEllipse*) object; goo_canvas_ellipse_get_common_property (object, ellipse->ellipse_data, prop_id, value, pspec); } static void goo_canvas_ellipse_set_common_property (GObject *object, GooCanvasEllipseData *ellipse_data, guint prop_id, const GValue *value, GParamSpec *pspec) { gdouble x, y; switch (prop_id) { case PROP_CENTER_X: ellipse_data->center_x = g_value_get_double (value); g_object_notify (object, "x"); break; case PROP_CENTER_Y: ellipse_data->center_y = g_value_get_double (value); g_object_notify (object, "y"); break; case PROP_RADIUS_X: ellipse_data->radius_x = g_value_get_double (value); g_object_notify (object, "width"); break; case PROP_RADIUS_Y: ellipse_data->radius_y = g_value_get_double (value); g_object_notify (object, "height"); break; case PROP_X: ellipse_data->center_x = g_value_get_double (value) + ellipse_data->radius_x; g_object_notify (object, "center-x"); break; case PROP_Y: ellipse_data->center_y = g_value_get_double (value) + ellipse_data->radius_y; g_object_notify (object, "center-y"); break; case PROP_WIDTH: /* Calculate the current x coordinate. */ x = ellipse_data->center_x - ellipse_data->radius_x; /* Calculate the new radius_x, which is half the width. */ ellipse_data->radius_x = g_value_get_double (value) / 2.0; /* Now calculate the new center_x. */ ellipse_data->center_x = x + ellipse_data->radius_x; g_object_notify (object, "center-x"); g_object_notify (object, "radius-x"); break; case PROP_HEIGHT: /* Calculate the current y coordinate. */ y = ellipse_data->center_y - ellipse_data->radius_y; /* Calculate the new radius_y, which is half the height. */ ellipse_data->radius_y = g_value_get_double (value) / 2.0; /* Now calculate the new center_y. */ ellipse_data->center_y = y + ellipse_data->radius_y; g_object_notify (object, "center-y"); g_object_notify (object, "radius-y"); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_ellipse_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasEllipse *ellipse = (GooCanvasEllipse*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_ellipse_set_common_property (object, ellipse->ellipse_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static void goo_canvas_ellipse_create_path (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasEllipse *ellipse = (GooCanvasEllipse*) simple; GooCanvasEllipseData *ellipse_data = ellipse->ellipse_data; cairo_new_path (cr); cairo_save (cr); cairo_translate (cr, ellipse_data->center_x, ellipse_data->center_y); cairo_scale (cr, ellipse_data->radius_x, ellipse_data->radius_y); cairo_arc (cr, 0.0, 0.0, 1.0, 0.0, 2.0 * M_PI); cairo_restore (cr); } static void goo_canvas_ellipse_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasEllipse *ellipse = (GooCanvasEllipse*) item; GooCanvasEllipseModel *emodel = (GooCanvasEllipseModel*) model; /* If our ellipse_data was allocated, free it. */ if (!simple->model) g_slice_free (GooCanvasEllipseData, ellipse->ellipse_data); /* Now use the new model's ellipse_data instead. */ ellipse->ellipse_data = &emodel->ellipse_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_ellipse_set_model; } /** * SECTION:goocanvasellipsemodel * @Title: GooCanvasEllipseModel * @Short_Description: a model for ellipse items. * * GooCanvasEllipseModel represents a model for ellipse items. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "stroke-color", "fill-color" and "line-width". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasEllipseModel use goo_canvas_ellipse_model_new(). * * To get or set the properties of an existing #GooCanvasEllipseModel, use * g_object_get() and g_object_set(). * * The ellipse can be specified either with the "center-x", "center-y", * "radius-x" and "radius-y" properties, or with the "x", "y", "width" and * "height" properties. * * To respond to events such as mouse clicks on the ellipse you must connect * to the signal handlers of the corresponding #GooCanvasEllipse objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_ellipse_model_finalize (GObject *object); static void goo_canvas_ellipse_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_ellipse_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasEllipseModel, goo_canvas_ellipse_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_ellipse_model_class_init (GooCanvasEllipseModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; gobject_class->finalize = goo_canvas_ellipse_model_finalize; gobject_class->get_property = goo_canvas_ellipse_model_get_property; gobject_class->set_property = goo_canvas_ellipse_model_set_property; goo_canvas_ellipse_install_common_properties (gobject_class); } static void goo_canvas_ellipse_model_init (GooCanvasEllipseModel *emodel) { } /** * goo_canvas_ellipse_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @center_x: the x coordinate of the center of the ellipse. * @center_y: the y coordinate of the center of the ellipse. * @radius_x: the horizontal radius of the ellipse. * @radius_y: the vertical radius of the ellipse. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new ellipse model. * * * * Here's an example showing how to create an ellipse centered at (100.0, * 100.0), with a horizontal radius of 50.0 and a vertical radius of 30.0. * It is drawn with a red outline with a width of 5.0 and filled with blue: * * * GooCanvasItemModel *ellipse = goo_canvas_ellipse_model_new (mygroup, 100.0, 100.0, 50.0, 30.0, * "stroke-color", "red", * "line-width", 5.0, * "fill-color", "blue", * NULL); * * * Returns: a new ellipse model. **/ GooCanvasItemModel* goo_canvas_ellipse_model_new (GooCanvasItemModel *parent, gdouble center_x, gdouble center_y, gdouble radius_x, gdouble radius_y, ...) { GooCanvasItemModel *model; GooCanvasEllipseModel *emodel; GooCanvasEllipseData *ellipse_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_ELLIPSE_MODEL, NULL); emodel = (GooCanvasEllipseModel*) model; ellipse_data = &emodel->ellipse_data; ellipse_data->center_x = center_x; ellipse_data->center_y = center_y; ellipse_data->radius_x = radius_x; ellipse_data->radius_y = radius_y; va_start (var_args, radius_y); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_ellipse_model_finalize (GObject *object) { /*GooCanvasEllipseModel *emodel = (GooCanvasEllipseModel*) object;*/ G_OBJECT_CLASS (goo_canvas_ellipse_model_parent_class)->finalize (object); } static void goo_canvas_ellipse_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasEllipseModel *emodel = (GooCanvasEllipseModel*) object; goo_canvas_ellipse_get_common_property (object, &emodel->ellipse_data, prop_id, value, pspec); } static void goo_canvas_ellipse_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasEllipseModel *emodel = (GooCanvasEllipseModel*) object; goo_canvas_ellipse_set_common_property (object, &emodel->ellipse_data, prop_id, value, pspec); g_signal_emit_by_name (emodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_ellipse_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_ELLIPSE, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_ellipse_model_create_item; } goocanvas-0.15/src/goocanvasimage.c0000644000076400007640000005025611222136461014274 00000000000000/* * GooCanvas. Copyright (C) 2005 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasimage.c - image item. */ /** * SECTION:goocanvasimage * @Title: GooCanvasImage * @Short_Description: an image item. * * GooCanvasImage represents an image item. * * It is a subclass of #GooCanvasItemSimple and so inherits all of the style * properties such as "operator" and "pointer-events". * * It also implements the #GooCanvasItem interface, so you can use the * #GooCanvasItem functions such as goo_canvas_item_raise() and * goo_canvas_item_rotate(). * * To create a #GooCanvasImage use goo_canvas_image_new(). * * To get or set the properties of an existing #GooCanvasImage, use * g_object_get() and g_object_set(). */ #include #include #include #include "goocanvasprivate.h" #include "goocanvasimage.h" #include "goocanvas.h" #include "goocanvasutils.h" typedef struct _GooCanvasImagePrivate GooCanvasImagePrivate; struct _GooCanvasImagePrivate { gboolean scale_to_fit; }; #define GOO_CANVAS_IMAGE_GET_PRIVATE(image) \ (G_TYPE_INSTANCE_GET_PRIVATE ((image), GOO_TYPE_CANVAS_IMAGE, GooCanvasImagePrivate)) #define GOO_CANVAS_IMAGE_MODEL_GET_PRIVATE(image) \ (G_TYPE_INSTANCE_GET_PRIVATE ((image), GOO_TYPE_CANVAS_IMAGE_MODEL, GooCanvasImagePrivate)) enum { PROP_0, PROP_PATTERN, PROP_X, PROP_Y, PROP_WIDTH, PROP_HEIGHT, PROP_SCALE_TO_FIT, /* Convenience properties. */ PROP_PIXBUF }; static void goo_canvas_image_dispose (GObject *object); static void goo_canvas_image_finalize (GObject *object); static void canvas_item_interface_init (GooCanvasItemIface *iface); static void goo_canvas_image_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_image_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasImage, goo_canvas_image, GOO_TYPE_CANVAS_ITEM_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM, canvas_item_interface_init)) static void goo_canvas_image_install_common_properties (GObjectClass *gobject_class) { g_object_class_install_property (gobject_class, PROP_PATTERN, g_param_spec_boxed ("pattern", _("Pattern"), _("The cairo pattern to paint"), GOO_TYPE_CAIRO_PATTERN, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_X, g_param_spec_double ("x", "X", _("The x coordinate of the image"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_Y, g_param_spec_double ("y", "Y", _("The y coordinate of the image"), -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), _("The width of the image"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), _("The height of the image"), 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_SCALE_TO_FIT, g_param_spec_boolean ("scale-to-fit", _("Scale To Fit"), _("If the image is scaled to fit the width and height settings"), FALSE, G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_PIXBUF, g_param_spec_object ("pixbuf", _("Pixbuf"), _("The GdkPixbuf to display"), GDK_TYPE_PIXBUF, G_PARAM_WRITABLE)); } /* Gets the private data to use, from the model or from the item itself. */ static GooCanvasImagePrivate* goo_canvas_image_get_private (gpointer object) { GooCanvasItemSimple *simple; if (GOO_IS_CANVAS_IMAGE (object)) { simple = (GooCanvasItemSimple*) object; if (simple->model) return GOO_CANVAS_IMAGE_MODEL_GET_PRIVATE (simple->model); else return GOO_CANVAS_IMAGE_GET_PRIVATE (object); } else { return GOO_CANVAS_IMAGE_MODEL_GET_PRIVATE (object); } } static void goo_canvas_image_init (GooCanvasImage *image) { image->image_data = g_slice_new0 (GooCanvasImageData); } /** * goo_canvas_image_new: * @parent: the parent item, or %NULL. If a parent is specified, it will assume * ownership of the item, and the item will automatically be freed when it is * removed from the parent. Otherwise call g_object_unref() to free it. * @pixbuf: the #GdkPixbuf containing the image data, or %NULL. * @x: the x coordinate of the image. * @y: the y coordinate of the image. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new image item. * * * * Here's an example showing how to create an image at (100.0, 100.0), using * the given pixbuf at its natural width and height: * * * GooCanvasItem *image = goo_canvas_image_new (mygroup, pixbuf, 100.0, 100.0, * NULL); * * * Returns: a new image item. **/ GooCanvasItem* goo_canvas_image_new (GooCanvasItem *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...) { GooCanvasItem *item; GooCanvasImage *image; GooCanvasImageData *image_data; const char *first_property; va_list var_args; item = g_object_new (GOO_TYPE_CANVAS_IMAGE, NULL); image = (GooCanvasImage*) item; image_data = image->image_data; image_data->x = x; image_data->y = y; if (pixbuf) { image_data->pattern = goo_canvas_cairo_pattern_from_pixbuf (pixbuf); image_data->width = gdk_pixbuf_get_width (pixbuf); image_data->height = gdk_pixbuf_get_height (pixbuf); } va_start (var_args, y); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) item, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_add_child (parent, item, -1); g_object_unref (item); } return item; } static void goo_canvas_image_dispose (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasImage *image = (GooCanvasImage*) object; if (!simple->model) { cairo_pattern_destroy (image->image_data->pattern); image->image_data->pattern = NULL; } G_OBJECT_CLASS (goo_canvas_image_parent_class)->dispose (object); } static void goo_canvas_image_finalize (GObject *object) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasImage *image = (GooCanvasImage*) object; /* Free our data if we didn't have a model. (If we had a model it would have been reset in dispose() and simple_data will be NULL.) */ if (simple->simple_data) g_slice_free (GooCanvasImageData, image->image_data); image->image_data = NULL; G_OBJECT_CLASS (goo_canvas_image_parent_class)->finalize (object); } static void goo_canvas_image_get_common_property (GObject *object, GooCanvasImageData *image_data, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasImagePrivate *priv = goo_canvas_image_get_private (object); switch (prop_id) { case PROP_PATTERN: g_value_set_boxed (value, image_data->pattern); break; case PROP_X: g_value_set_double (value, image_data->x); break; case PROP_Y: g_value_set_double (value, image_data->y); break; case PROP_WIDTH: g_value_set_double (value, image_data->width); break; case PROP_HEIGHT: g_value_set_double (value, image_data->height); break; case PROP_SCALE_TO_FIT: g_value_set_boolean (value, priv->scale_to_fit); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_image_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasImage *image = (GooCanvasImage*) object; goo_canvas_image_get_common_property (object, image->image_data, prop_id, value, pspec); } static void goo_canvas_image_set_common_property (GObject *object, GooCanvasImageData *image_data, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasImagePrivate *priv = goo_canvas_image_get_private (object); GdkPixbuf *pixbuf; switch (prop_id) { case PROP_PATTERN: cairo_pattern_destroy (image_data->pattern); image_data->pattern = g_value_get_boxed (value); cairo_pattern_reference (image_data->pattern); break; case PROP_X: image_data->x = g_value_get_double (value); break; case PROP_Y: image_data->y = g_value_get_double (value); break; case PROP_WIDTH: image_data->width = g_value_get_double (value); break; case PROP_HEIGHT: image_data->height = g_value_get_double (value); break; case PROP_SCALE_TO_FIT: priv->scale_to_fit = g_value_get_boolean (value); break; case PROP_PIXBUF: cairo_pattern_destroy (image_data->pattern); pixbuf = g_value_get_object (value); image_data->pattern = pixbuf ? goo_canvas_cairo_pattern_from_pixbuf (pixbuf) : NULL; image_data->width = pixbuf ? gdk_pixbuf_get_width (pixbuf) : 0; image_data->height = pixbuf ? gdk_pixbuf_get_height (pixbuf) : 0; break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void goo_canvas_image_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object; GooCanvasImage *image = (GooCanvasImage*) object; if (simple->model) { g_warning ("Can't set property of a canvas item with a model - set the model property instead"); return; } goo_canvas_image_set_common_property (object, image->image_data, prop_id, value, pspec); goo_canvas_item_simple_changed (simple, TRUE); } static gboolean goo_canvas_image_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event) { GooCanvasImage *image = (GooCanvasImage*) simple; GooCanvasImageData *image_data = image->image_data; if (x < image_data->x || (x > image_data->x + image_data->width) || y < image_data->y || (y > image_data->y + image_data->height)) return FALSE; return TRUE; } static void goo_canvas_image_update (GooCanvasItemSimple *simple, cairo_t *cr) { GooCanvasImage *image = (GooCanvasImage*) simple; GooCanvasImageData *image_data = image->image_data; /* Compute the new bounds. */ simple->bounds.x1 = image_data->x; simple->bounds.y1 = image_data->y; simple->bounds.x2 = image_data->x + image_data->width; simple->bounds.y2 = image_data->y + image_data->height; } static void goo_canvas_image_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds) { GooCanvasImagePrivate *priv = goo_canvas_image_get_private (simple); GooCanvasImage *image = (GooCanvasImage*) simple; GooCanvasImageData *image_data = image->image_data; cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; cairo_surface_t *surface; gdouble width, height; if (!image_data->pattern) return; #if 1 if (priv->scale_to_fit) { if (cairo_pattern_get_surface (image_data->pattern, &surface) == CAIRO_STATUS_SUCCESS && cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_IMAGE) { width = cairo_image_surface_get_width (surface); height = cairo_image_surface_get_height (surface); cairo_matrix_scale (&matrix, width / image_data->width, height / image_data->height); } } cairo_matrix_translate (&matrix, -image_data->x, -image_data->y); cairo_pattern_set_matrix (image_data->pattern, &matrix); goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_set_source (cr, image_data->pattern); cairo_rectangle (cr, image_data->x, image_data->y, image_data->width, image_data->height); cairo_fill (cr); #else /* Using cairo_paint() used to be much slower than cairo_fill(), though they seem similar now. I'm not sure if it matters which we use. */ cairo_matrix_init_translate (&matrix, -image_data->x, -image_data->y); cairo_pattern_set_matrix (image_data->pattern, &matrix); goo_canvas_style_set_fill_options (simple->simple_data->style, cr); cairo_set_source (cr, image_data->pattern); cairo_paint (cr); #endif } static void goo_canvas_image_set_model (GooCanvasItem *item, GooCanvasItemModel *model) { GooCanvasItemSimple *simple = (GooCanvasItemSimple*) item; GooCanvasImage *image = (GooCanvasImage*) item; GooCanvasImageModel *imodel = (GooCanvasImageModel*) model; /* If our data was allocated, free it. */ if (!simple->model) { cairo_pattern_destroy (image->image_data->pattern); g_slice_free (GooCanvasImageData, image->image_data); } /* Now use the new model's data instead. */ image->image_data = &imodel->image_data; /* Let the parent GooCanvasItemSimple code do the rest. */ goo_canvas_item_simple_set_model (simple, model); } static void canvas_item_interface_init (GooCanvasItemIface *iface) { iface->set_model = goo_canvas_image_set_model; } static void goo_canvas_image_class_init (GooCanvasImageClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasImagePrivate)); gobject_class->dispose = goo_canvas_image_dispose; gobject_class->finalize = goo_canvas_image_finalize; gobject_class->get_property = goo_canvas_image_get_property; gobject_class->set_property = goo_canvas_image_set_property; simple_class->simple_update = goo_canvas_image_update; simple_class->simple_paint = goo_canvas_image_paint; simple_class->simple_is_item_at = goo_canvas_image_is_item_at; goo_canvas_image_install_common_properties (gobject_class); } /** * SECTION:goocanvasimagemodel * @Title: GooCanvasImageModel * @Short_Description: a model for image items. * * GooCanvasImageModel represent a model for image items. * * It is a subclass of #GooCanvasItemModelSimple and so inherits all of the * style properties such as "operator" and "pointer-events". * * It also implements the #GooCanvasItemModel interface, so you can use the * #GooCanvasItemModel functions such as goo_canvas_item_model_raise() and * goo_canvas_item_model_rotate(). * * To create a #GooCanvasImageModel use goo_canvas_image_model_new(). * * To get or set the properties of an existing #GooCanvasImageModel, use * g_object_get() and g_object_set(). * * To respond to events such as mouse clicks on the image you must connect * to the signal handlers of the corresponding #GooCanvasImage objects. * (See goo_canvas_get_item() and #GooCanvas::item-created.) */ static void item_model_interface_init (GooCanvasItemModelIface *iface); static void goo_canvas_image_model_dispose (GObject *object); static void goo_canvas_image_model_get_property (GObject *object, guint param_id, GValue *value, GParamSpec *pspec); static void goo_canvas_image_model_set_property (GObject *object, guint param_id, const GValue *value, GParamSpec *pspec); G_DEFINE_TYPE_WITH_CODE (GooCanvasImageModel, goo_canvas_image_model, GOO_TYPE_CANVAS_ITEM_MODEL_SIMPLE, G_IMPLEMENT_INTERFACE (GOO_TYPE_CANVAS_ITEM_MODEL, item_model_interface_init)) static void goo_canvas_image_model_class_init (GooCanvasImageModelClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; g_type_class_add_private (gobject_class, sizeof (GooCanvasImagePrivate)); gobject_class->dispose = goo_canvas_image_model_dispose; gobject_class->get_property = goo_canvas_image_model_get_property; gobject_class->set_property = goo_canvas_image_model_set_property; goo_canvas_image_install_common_properties (gobject_class); } static void goo_canvas_image_model_init (GooCanvasImageModel *emodel) { } /** * goo_canvas_image_model_new: * @parent: the parent model, or %NULL. If a parent is specified, it will * assume ownership of the item, and the item will automatically be freed when * it is removed from the parent. Otherwise call g_object_unref() to free it. * @pixbuf: the #GdkPixbuf containing the image data, or %NULL. * @x: the x coordinate of the image. * @y: the y coordinate of the image. * @...: optional pairs of property names and values, and a terminating %NULL. * * Creates a new image model. * * * * Here's an example showing how to create an image at (100.0, 100.0), using * the given pixbuf at its natural width and height: * * * GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0, * NULL); * * * Returns: a new image model. **/ GooCanvasItemModel* goo_canvas_image_model_new (GooCanvasItemModel *parent, GdkPixbuf *pixbuf, gdouble x, gdouble y, ...) { GooCanvasItemModel *model; GooCanvasImageModel *imodel; GooCanvasImageData *image_data; const char *first_property; va_list var_args; model = g_object_new (GOO_TYPE_CANVAS_IMAGE_MODEL, NULL); imodel = (GooCanvasImageModel*) model; image_data = &imodel->image_data; image_data->x = x; image_data->y = y; if (pixbuf) { image_data->pattern = goo_canvas_cairo_pattern_from_pixbuf (pixbuf); image_data->width = gdk_pixbuf_get_width (pixbuf); image_data->height = gdk_pixbuf_get_height (pixbuf); } va_start (var_args, y); first_property = va_arg (var_args, char*); if (first_property) g_object_set_valist ((GObject*) model, first_property, var_args); va_end (var_args); if (parent) { goo_canvas_item_model_add_child (parent, model, -1); g_object_unref (model); } return model; } static void goo_canvas_image_model_dispose (GObject *object) { GooCanvasImageModel *imodel = (GooCanvasImageModel*) object; cairo_pattern_destroy (imodel->image_data.pattern); imodel->image_data.pattern = NULL; G_OBJECT_CLASS (goo_canvas_image_model_parent_class)->dispose (object); } static void goo_canvas_image_model_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GooCanvasImageModel *imodel = (GooCanvasImageModel*) object; goo_canvas_image_get_common_property (object, &imodel->image_data, prop_id, value, pspec); } static void goo_canvas_image_model_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GooCanvasImageModel *imodel = (GooCanvasImageModel*) object; goo_canvas_image_set_common_property (object, &imodel->image_data, prop_id, value, pspec); g_signal_emit_by_name (imodel, "changed", TRUE); } static GooCanvasItem* goo_canvas_image_model_create_item (GooCanvasItemModel *model, GooCanvas *canvas) { GooCanvasItem *item; item = g_object_new (GOO_TYPE_CANVAS_IMAGE, NULL); goo_canvas_item_set_model (item, model); return item; } static void item_model_interface_init (GooCanvasItemModelIface *iface) { iface->create_item = goo_canvas_image_model_create_item; } goocanvas-0.15/src/Makefile.in0000644000076400007640000005511611222156057013215 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src DIST_COMMON = $(libgoocanvasinclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libgoocanvasincludedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libgoocanvas_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libgoocanvas_la_OBJECTS = goocanvasatk.lo goocanvasellipse.lo \ goocanvasenumtypes.lo goocanvasgrid.lo goocanvasgroup.lo \ goocanvasimage.lo goocanvasitem.lo goocanvasitemmodel.lo \ goocanvasitemsimple.lo goocanvasmarshal.lo \ goocanvaspolyline.lo goocanvaspath.lo goocanvasrect.lo \ goocanvasstyle.lo goocanvastable.lo goocanvastext.lo \ goocanvasutils.lo goocanvaswidget.lo goocanvas.lo libgoocanvas_la_OBJECTS = $(am_libgoocanvas_la_OBJECTS) libgoocanvas_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgoocanvas_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libgoocanvas_la_SOURCES) DIST_SOURCES = $(libgoocanvas_la_SOURCES) libgoocanvasincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(libgoocanvasinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GREP = @GREP@ GTKDOC_CHECK = @GTKDOC_CHECK@ HTML_DIR = @HTML_DIR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLLIBS = @INTLLIBS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGFMT_OPTS = @MSGFMT_OPTS@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_CFLAGS = @PACKAGE_CFLAGS@ PACKAGE_LIBS = @PACKAGE_LIBS@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ RANLIB = @RANLIB@ REBUILD = @REBUILD@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = \ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ -DG_LOG_DOMAIN=\"GooCanvas\" \ @PACKAGE_CFLAGS@ # -DG_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED \ # -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED \ # -DGTK_DISABLE_DEPRECATED lib_LTLIBRARIES = libgoocanvas.la libgoocanvas_la_LIBADD = @PACKAGE_LIBS@ $(INTLLIBS) @PLATFORM_WIN32_TRUE@no_undefined = -no-undefined libtool_opts = \ -version-info $(LT_VERSION_INFO) \ -export-dynamic $(no_undefined) \ -rpath $(libdir) libgoocanvas_la_LDFLAGS = $(libtool_opts) libgoocanvasincludedir = $(includedir)/goocanvas-1.0 libgoocanvas_public_headers = \ goocanvasellipse.h \ goocanvasgrid.h \ goocanvasgroup.h \ goocanvasimage.h \ goocanvasitem.h \ goocanvasitemmodel.h \ goocanvasitemsimple.h \ goocanvaspolyline.h \ goocanvaspath.h \ goocanvasrect.h \ goocanvasstyle.h \ goocanvastable.h \ goocanvastext.h \ goocanvasutils.h \ goocanvaswidget.h \ goocanvas.h libgoocanvas_la_SOURCES = \ goocanvasatk.h \ goocanvasatk.c \ goocanvasellipse.c \ goocanvasenumtypes.c \ goocanvasgrid.c \ goocanvasgroup.c \ goocanvasimage.c \ goocanvasitem.c \ goocanvasitemmodel.c \ goocanvasitemsimple.c \ goocanvasmarshal.c \ goocanvaspolyline.c \ goocanvaspath.c \ goocanvasprivate.h \ goocanvasrect.c \ goocanvasstyle.c \ goocanvastable.c \ goocanvastext.c \ goocanvasutils.c \ goocanvaswidget.c \ goocanvas.c libgoocanvas_extra_sources = \ goocanvasmarshal.list libgoocanvas_built_headers = \ goocanvasenumtypes.h \ goocanvasmarshal.h libgoocanvas_built_sources = \ goocanvasenumtypes.c \ goocanvasmarshal.c stamp_files = \ stamp-goocanvasmarshal.h \ stamp-goocanvasenumtypes.h libgoocanvasinclude_HEADERS = \ $(libgoocanvas_public_headers) \ $(libgoocanvas_built_headers) gen_sources = xgen-gdef xgen-gtbh xgen-gtic xgen-gmh xgen-gmc xgen-gmlh xgen-gmlc CLEANFILES = $(gen_sources) BUILT_SOURCES = $(libgoocanvas_built_headers) $(libgoocanvas_built_sources) MAINTAINERCLEANFILES = $(BUILT_SOURCES) $(stamp_files) EXTRA_DIST = $(BUILT_SOURCES) $(libgoocanvas_extra_sources) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libgoocanvas.la: $(libgoocanvas_la_OBJECTS) $(libgoocanvas_la_DEPENDENCIES) $(libgoocanvas_la_LINK) -rpath $(libdir) $(libgoocanvas_la_OBJECTS) $(libgoocanvas_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvas.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasatk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasellipse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasenumtypes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasgrid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasgroup.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasimage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasitem.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasitemmodel.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasitemsimple.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasmarshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvaspath.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvaspolyline.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasrect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasstyle.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvastable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvastext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvasutils.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/goocanvaswidget.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libgoocanvasincludeHEADERS: $(libgoocanvasinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(libgoocanvasincludedir)" || $(MKDIR_P) "$(DESTDIR)$(libgoocanvasincludedir)" @list='$(libgoocanvasinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(libgoocanvasincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(libgoocanvasincludedir)/$$f'"; \ $(libgoocanvasincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(libgoocanvasincludedir)/$$f"; \ done uninstall-libgoocanvasincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libgoocanvasinclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(libgoocanvasincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(libgoocanvasincludedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libgoocanvasincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-libgoocanvasincludeHEADERS install-dvi: install-dvi-am install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libgoocanvasincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-libgoocanvasincludeHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-libLTLIBRARIES \ uninstall-libgoocanvasincludeHEADERS # # Most of the stuff below has been pinched from the GTK+ Makefile.am, as # it is tricky to get right and we know it works for GTK+. # # all autogenerated files need to be generated in the srcdir, # so old versions get remade and are not confused with newer # versions in the build dir. thus a development setup requires # srcdir to be writable, passing --disable-rebuilds to # ../configure will supress all autogeneration rules. goocanvasmarshal.h: stamp-goocanvasmarshal.h @true stamp-goocanvasmarshal.h: @REBUILD@ goocanvasmarshal.list $(GLIB_GENMARSHAL) --prefix=goo_canvas_marshal $(srcdir)/goocanvasmarshal.list --header >> xgen-gmlh \ && (cmp -s xgen-gmlh goocanvasmarshal.h || cp xgen-gmlh goocanvasmarshal.h) \ && rm -f xgen-gmlh \ && echo timestamp > $(@F) goocanvasmarshal.c: @REBUILD@ goocanvasmarshal.list (echo "#include \"goocanvasmarshal.h\""; \ $(GLIB_GENMARSHAL) --prefix=goo_canvas_marshal $(srcdir)/goocanvasmarshal.list --body) >> xgen-gmlc \ && cp xgen-gmlc goocanvasmarshal.c \ && rm -f xgen-gmlc goocanvasenumtypes.h: stamp-goocanvasenumtypes.h @true stamp-goocanvasenumtypes.h: @REBUILD@ $(goo_canvas_public_headers) Makefile (cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#ifndef __GOO_CANVAS_ENUM_TYPES_H__\n#define __GOO_CANVAS_ENUM_TYPES_H__\n\n#include \n\nG_BEGIN_DECLS\n" \ --fprod "/* Enumerations from \"@filename@\" */\n" \ --vhead "GType @enum_name@_get_type (void);\n#define GOO_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n\n\n" \ --ftail "G_END_DECLS\n\n#endif /* __GOO_CANVAS_ENUM_TYPES_H__ */" \ $(libgoocanvas_public_headers)) >> xgen-gtbh \ && (cmp -s xgen-gtbh goocanvasenumtypes.h || cp xgen-gtbh goocanvasenumtypes.h ) \ && rm -f xgen-gtbh \ && echo timestamp > $(@F) goocanvasenumtypes.c: @REBUILD@ $(goo_canvas_public_headers) Makefile (cd $(srcdir) && $(GLIB_MKENUMS) \ --fhead "#include \n" \ --fhead "#include \"goocanvas.h\"\n" \ --fprod "\n/* Enumerations from \"@filename@\" */" \ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if( etype == 0 ) \n {\n static const G@Type@Value values[] = {" \ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \ --vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values );\n }\n return etype;\n}\n" \ $(libgoocanvas_public_headers)) > xgen-gtbc \ && cp xgen-gtbc goocanvasenumtypes.c \ && rm -f xgen-gtbc # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: goocanvas-0.15/src/goocanvaswidget.h0000644000076400007640000000373111172574677014521 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvaswidget.h - wrapper item for an embedded GtkWidget. */ #ifndef __GOO_CANVAS_WIDGET_H__ #define __GOO_CANVAS_WIDGET_H__ #include #include "goocanvasitemsimple.h" G_BEGIN_DECLS #define GOO_TYPE_CANVAS_WIDGET (goo_canvas_widget_get_type ()) #define GOO_CANVAS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_WIDGET, GooCanvasWidget)) #define GOO_CANVAS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_WIDGET, GooCanvasWidgetClass)) #define GOO_IS_CANVAS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_WIDGET)) #define GOO_IS_CANVAS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_WIDGET)) #define GOO_CANVAS_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_WIDGET, GooCanvasWidgetClass)) typedef struct _GooCanvasWidget GooCanvasWidget; typedef struct _GooCanvasWidgetClass GooCanvasWidgetClass; /** * GooCanvasWidget * * The #GooCanvasWidget-struct struct contains private data only. */ struct _GooCanvasWidget { GooCanvasItemSimple parent_object; GtkWidget *widget; gdouble x, y, width, height; GtkAnchorType anchor; }; struct _GooCanvasWidgetClass { GooCanvasItemSimpleClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_widget_get_type (void) G_GNUC_CONST; GooCanvasItem* goo_canvas_widget_new (GooCanvasItem *parent, GtkWidget *widget, gdouble x, gdouble y, gdouble width, gdouble height, ...); G_END_DECLS #endif /* __GOO_CANVAS_WIDGET_H__ */ goocanvas-0.15/src/goocanvasmarshal.list0000644000076400007640000000021011172574677015376 00000000000000VOID:VOID VOID:INT VOID:INT,INT VOID:BOOLEAN VOID:OBJECT,OBJECT BOOLEAN:BOXED BOOLEAN:OBJECT,BOXED BOOLEAN:DOUBLE,DOUBLE,BOOLEAN,OBJECT goocanvas-0.15/src/goocanvasenumtypes.c0000644000076400007640000000753311222156101015234 00000000000000 /* Generated data (by glib-mkenums) */ #include #include "goocanvas.h" /* Enumerations from "goocanvasitem.h" */ GType goo_canvas_animate_type_get_type (void) { static GType etype = 0; if( etype == 0 ) { static const GEnumValue values[] = { { GOO_CANVAS_ANIMATE_FREEZE, "GOO_CANVAS_ANIMATE_FREEZE", "freeze" }, { GOO_CANVAS_ANIMATE_RESET, "GOO_CANVAS_ANIMATE_RESET", "reset" }, { GOO_CANVAS_ANIMATE_RESTART, "GOO_CANVAS_ANIMATE_RESTART", "restart" }, { GOO_CANVAS_ANIMATE_BOUNCE, "GOO_CANVAS_ANIMATE_BOUNCE", "bounce" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCanvasAnimateType", values ); } return etype; } /* Enumerations from "goocanvasutils.h" */ GType goo_canvas_pointer_events_get_type (void) { static GType etype = 0; if( etype == 0 ) { static const GFlagsValue values[] = { { GOO_CANVAS_EVENTS_VISIBLE_MASK, "GOO_CANVAS_EVENTS_VISIBLE_MASK", "visible-mask" }, { GOO_CANVAS_EVENTS_PAINTED_MASK, "GOO_CANVAS_EVENTS_PAINTED_MASK", "painted-mask" }, { GOO_CANVAS_EVENTS_FILL_MASK, "GOO_CANVAS_EVENTS_FILL_MASK", "fill-mask" }, { GOO_CANVAS_EVENTS_STROKE_MASK, "GOO_CANVAS_EVENTS_STROKE_MASK", "stroke-mask" }, { GOO_CANVAS_EVENTS_NONE, "GOO_CANVAS_EVENTS_NONE", "none" }, { GOO_CANVAS_EVENTS_VISIBLE_PAINTED, "GOO_CANVAS_EVENTS_VISIBLE_PAINTED", "visible-painted" }, { GOO_CANVAS_EVENTS_VISIBLE_FILL, "GOO_CANVAS_EVENTS_VISIBLE_FILL", "visible-fill" }, { GOO_CANVAS_EVENTS_VISIBLE_STROKE, "GOO_CANVAS_EVENTS_VISIBLE_STROKE", "visible-stroke" }, { GOO_CANVAS_EVENTS_VISIBLE, "GOO_CANVAS_EVENTS_VISIBLE", "visible" }, { GOO_CANVAS_EVENTS_PAINTED, "GOO_CANVAS_EVENTS_PAINTED", "painted" }, { GOO_CANVAS_EVENTS_FILL, "GOO_CANVAS_EVENTS_FILL", "fill" }, { GOO_CANVAS_EVENTS_STROKE, "GOO_CANVAS_EVENTS_STROKE", "stroke" }, { GOO_CANVAS_EVENTS_ALL, "GOO_CANVAS_EVENTS_ALL", "all" }, { 0, NULL, NULL } }; etype = g_flags_register_static ("GooCanvasPointerEvents", values ); } return etype; } GType goo_canvas_item_visibility_get_type (void) { static GType etype = 0; if( etype == 0 ) { static const GEnumValue values[] = { { GOO_CANVAS_ITEM_HIDDEN, "GOO_CANVAS_ITEM_HIDDEN", "hidden" }, { GOO_CANVAS_ITEM_INVISIBLE, "GOO_CANVAS_ITEM_INVISIBLE", "invisible" }, { GOO_CANVAS_ITEM_VISIBLE, "GOO_CANVAS_ITEM_VISIBLE", "visible" }, { GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD, "GOO_CANVAS_ITEM_VISIBLE_ABOVE_THRESHOLD", "visible-above-threshold" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCanvasItemVisibility", values ); } return etype; } GType goo_canvas_path_command_type_get_type (void) { static GType etype = 0; if( etype == 0 ) { static const GEnumValue values[] = { { GOO_CANVAS_PATH_MOVE_TO, "GOO_CANVAS_PATH_MOVE_TO", "move-to" }, { GOO_CANVAS_PATH_CLOSE_PATH, "GOO_CANVAS_PATH_CLOSE_PATH", "close-path" }, { GOO_CANVAS_PATH_LINE_TO, "GOO_CANVAS_PATH_LINE_TO", "line-to" }, { GOO_CANVAS_PATH_HORIZONTAL_LINE_TO, "GOO_CANVAS_PATH_HORIZONTAL_LINE_TO", "horizontal-line-to" }, { GOO_CANVAS_PATH_VERTICAL_LINE_TO, "GOO_CANVAS_PATH_VERTICAL_LINE_TO", "vertical-line-to" }, { GOO_CANVAS_PATH_CURVE_TO, "GOO_CANVAS_PATH_CURVE_TO", "curve-to" }, { GOO_CANVAS_PATH_SMOOTH_CURVE_TO, "GOO_CANVAS_PATH_SMOOTH_CURVE_TO", "smooth-curve-to" }, { GOO_CANVAS_PATH_QUADRATIC_CURVE_TO, "GOO_CANVAS_PATH_QUADRATIC_CURVE_TO", "quadratic-curve-to" }, { GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO, "GOO_CANVAS_PATH_SMOOTH_QUADRATIC_CURVE_TO", "smooth-quadratic-curve-to" }, { GOO_CANVAS_PATH_ELLIPTICAL_ARC, "GOO_CANVAS_PATH_ELLIPTICAL_ARC", "elliptical-arc" }, { 0, NULL, NULL } }; etype = g_enum_register_static ("GooCanvasPathCommandType", values ); } return etype; } /* Generated data ends here */ goocanvas-0.15/src/goocanvasstyle.h0000644000076400007640000000700611172574677014375 00000000000000/* * GooCanvas. Copyright (C) 2005-6 Damon Chaplin. * Released under the GNU LGPL license. See COPYING for details. * * goocanvasstyle.h - cascading styles. */ #ifndef __GOO_CANVAS_STYLE_H__ #define __GOO_CANVAS_STYLE_H__ #include G_BEGIN_DECLS /* GQuarks for the basic properties. */ extern GQuark goo_canvas_style_stroke_pattern_id; extern GQuark goo_canvas_style_fill_pattern_id; extern GQuark goo_canvas_style_fill_rule_id; extern GQuark goo_canvas_style_operator_id; extern GQuark goo_canvas_style_antialias_id; extern GQuark goo_canvas_style_line_width_id; extern GQuark goo_canvas_style_line_cap_id; extern GQuark goo_canvas_style_line_join_id; extern GQuark goo_canvas_style_line_join_miter_limit_id; extern GQuark goo_canvas_style_line_dash_id; extern GQuark goo_canvas_style_font_desc_id; extern GQuark goo_canvas_style_hint_metrics_id; /** * GooCanvasStyleProperty * @id: the unique property identifier. * @value: the value of the property. * * #GooCanvasStyleProperty represents a property setting. */ typedef struct _GooCanvasStyleProperty GooCanvasStyleProperty; struct _GooCanvasStyleProperty { GQuark id; GValue value; }; #define GOO_TYPE_CANVAS_STYLE (goo_canvas_style_get_type ()) #define GOO_CANVAS_STYLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GOO_TYPE_CANVAS_STYLE, GooCanvasStyle)) #define GOO_CANVAS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GOO_TYPE_CANVAS_STYLE, GooCanvasStyleClass)) #define GOO_IS_CANVAS_STYLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GOO_TYPE_CANVAS_STYLE)) #define GOO_IS_CANVAS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GOO_TYPE_CANVAS_STYLE)) #define GOO_CANVAS_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GOO_TYPE_CANVAS_STYLE, GooCanvasStyleClass)) typedef struct _GooCanvasStyle GooCanvasStyle; typedef struct _GooCanvasStyleClass GooCanvasStyleClass; /** * GooCanvasStyle * @parent: the parent style. * @properties: an array of #GooCanvasStyleProperty property settings. * * #GooCanvasStyle holds the style properties of a canvas item, as well as a * pointer to the parent style. */ struct _GooCanvasStyle { /* */ GObject parent_object; /* */ GooCanvasStyle *parent; GArray *properties; }; struct _GooCanvasStyleClass { GObjectClass parent_class; /*< private >*/ /* Padding for future expansion */ void (*_goo_canvas_reserved1) (void); void (*_goo_canvas_reserved2) (void); void (*_goo_canvas_reserved3) (void); void (*_goo_canvas_reserved4) (void); }; GType goo_canvas_style_get_type (void) G_GNUC_CONST; GooCanvasStyle* goo_canvas_style_new (void); GooCanvasStyle* goo_canvas_style_copy (GooCanvasStyle *style); GooCanvasStyle* goo_canvas_style_get_parent (GooCanvasStyle *style); void goo_canvas_style_set_parent (GooCanvasStyle *style, GooCanvasStyle *parent); GValue* goo_canvas_style_get_property (GooCanvasStyle *style, GQuark property_id); void goo_canvas_style_set_property (GooCanvasStyle *style, GQuark property_id, const GValue *value); /* Convenience functions to set the standard cairo stroke and fill options. */ gboolean goo_canvas_style_set_stroke_options (GooCanvasStyle *style, cairo_t *cr); gboolean goo_canvas_style_set_fill_options (GooCanvasStyle *style, cairo_t *cr); G_END_DECLS #endif /* __GOO_CANVAS_STYLE_H__ */ goocanvas-0.15/config.h.in0000644000076400007640000000374011222155677012407 00000000000000/* config.h.in. Generated from configure.in by autoheader. */ /* always defined to indicate that i18n is enabled */ #undef ENABLE_NLS /* Gettext package. */ #undef GETTEXT_PACKAGE /* Define to 1 if you have the `bind_textdomain_codeset' function. */ #undef HAVE_BIND_TEXTDOMAIN_CODESET /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION