[goocanvas: 22/22] Merge branch 'introspection'
- From: Damon Chaplin <damon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goocanvas: 22/22] Merge branch 'introspection'
- Date: Sat, 1 Oct 2011 14:50:20 +0000 (UTC)
commit 47df397f0c472c7c97f7fb7051fd52e8c9e50111
Merge: c17e4bd b0d3b48
Author: Damon Chaplin <damon gnome org>
Date: Sat Oct 1 15:50:11 2011 +0100
Merge branch 'introspection'
Conflicts:
src/goocanvasimage.c
.gitignore | 3 +
Makefile.am | 4 +-
bindings/Makefile.am | 1 +
bindings/gjs/demo.js | 300 +++++++++++++++++++++++++++++++++++++++++
bindings/python/GooCanvas.py | 39 ++++++
bindings/python/Makefile.am | 5 +
bindings/python/demo.py | 248 ++++++++++++++++++++++++++++++++++
bindings/seed/demo.js | 301 ++++++++++++++++++++++++++++++++++++++++++
configure.in | 29 ++++
src/Makefile.am | 26 ++++
src/goocanvas.c | 57 ++++----
src/goocanvasellipse.c | 8 +-
src/goocanvasgrid.c | 10 +-
src/goocanvasgroup.c | 8 +-
src/goocanvasimage.c | 12 +-
src/goocanvasitem.c | 46 ++++---
src/goocanvasitemmodel.c | 20 ++--
src/goocanvaspath.c | 8 +-
src/goocanvaspolyline.c | 53 ++++++--
src/goocanvaspolyline.h | 3 +-
src/goocanvasrect.c | 8 +-
src/goocanvasstyle.c | 6 +-
src/goocanvastable.c | 8 +-
src/goocanvastext.c | 8 +-
src/goocanvasutils.c | 2 +-
src/goocanvaswidget.c | 4 +-
26 files changed, 1107 insertions(+), 110 deletions(-)
---
diff --cc .gitignore
index 592f385,cf8c855..41417c2
--- a/.gitignore
+++ b/.gitignore
@@@ -43,6 -41,6 +43,7 @@@ Makefile.i
/ltmain.sh
/missing
/mkinstalldirs
++/py-compile
/po/POTFILES
/po/Makefile.in.in
/po/goocanvas2.pot
diff --cc src/goocanvasimage.c
index 85fab38,910825c..b5879ac
--- a/src/goocanvasimage.c
+++ b/src/goocanvasimage.c
@@@ -179,39 -173,12 +179,39 @@@ goo_canvas_image_init (GooCanvasImage *
}
+/*
+ * Convert the width and height to the canvas's units, from the pixbuf's size
+ * in pixels.
+ */
+static void
+goo_canvas_image_convert_pixbuf_sizes (GooCanvasItem *item,
+ GooCanvasImageData *image_data)
+{
+ GooCanvasImagePrivate *priv = goo_canvas_image_get_private (item);
+
+ const double original_width = image_data->width;
+
+ GooCanvas *canvas = goo_canvas_item_get_canvas (item);
+ if (canvas)
+ {
+ goo_canvas_convert_units_from_pixels (canvas,
+ &(image_data->width),
+ &(image_data->height));
+ }
+
+ if(image_data->width) /* Avoid division by zero. */
+ priv->scale_to_units = original_width / image_data->width;
+ else
+ priv->scale_to_units = 1.0f;
+}
+
+
/**
* goo_canvas_image_new:
- * @parent: the parent item, or %NULL. If a parent is specified, it will assume
+ * @parent: (skip): 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.
+ * @pixbuf: (allow-none): 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.
@@@ -228,17 -195,7 +228,17 @@@
* NULL);
* </programlisting></informalexample>
*
+ * This example creates an image scaled to a size of 200x200:
+ *
+ * <informalexample><programlisting>
+ * GooCanvasItem *image = goo_canvas_image_new (mygroup, pixbuf, 100.0, 100.0,
+ * "width", 200.0,
+ * "height", 200.0,
+ * "scale-to-fit", TRUE,
+ * NULL);
+ * </programlisting></informalexample>
+ *
- * Returns: a new image item.
+ * Returns: (transfer full): a new image item.
**/
GooCanvasItem*
goo_canvas_image_new (GooCanvasItem *parent,
@@@ -706,17 -630,7 +706,17 @@@ goo_canvas_image_model_init (GooCanvasI
* NULL);
* </programlisting></informalexample>
*
+ * This example creates an image scaled to a size of 200x200:
+ *
+ * <informalexample><programlisting>
+ * GooCanvasItemModel *image = goo_canvas_image_model_new (mygroup, pixbuf, 100.0, 100.0,
+ * "width", 200.0,
+ * "height", 200.0,
+ * "scale-to-fit", TRUE,
+ * NULL);
+ * </programlisting></informalexample>
+ *
- * Returns: a new image model.
+ * Returns: (transfer full): a new image model.
**/
GooCanvasItemModel*
goo_canvas_image_model_new (GooCanvasItemModel *parent,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]