goocanvas 0.90.6-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. data/ChangeLog +87 -0
  2. data/README +37 -0
  3. data/Rakefile +14 -0
  4. data/ext/goocanvas/depend +5 -0
  5. data/ext/goocanvas/extconf.rb +66 -0
  6. data/ext/goocanvas/goocanvas.def +2 -0
  7. data/ext/goocanvas/rbgoocairo.c +74 -0
  8. data/ext/goocanvas/rbgoocanvas.c +236 -0
  9. data/ext/goocanvas/rbgoocanvas.h +66 -0
  10. data/ext/goocanvas/rbgoocanvasellipse.c +50 -0
  11. data/ext/goocanvas/rbgoocanvasgroup.c +41 -0
  12. data/ext/goocanvas/rbgoocanvasimage.c +45 -0
  13. data/ext/goocanvas/rbgoocanvasitem.c +358 -0
  14. data/ext/goocanvas/rbgoocanvaspolyline.c +102 -0
  15. data/ext/goocanvas/rbgoocanvasrect.c +47 -0
  16. data/ext/goocanvas/rbgoocanvasstyle.c +61 -0
  17. data/ext/goocanvas/rbgoocanvastable.c +41 -0
  18. data/ext/goocanvas/rbgoocanvastext.c +58 -0
  19. data/ext/goocanvas/rbgoocanvaswidget.c +48 -0
  20. data/ext/goocanvas/rbgooutils.c +44 -0
  21. data/extconf.rb +49 -0
  22. data/lib/1.8/goocanvas.so +0 -0
  23. data/lib/1.9/goocanvas.so +0 -0
  24. data/lib/goocanvas.rb +145 -0
  25. data/sample/demo-arrowhead.rb +315 -0
  26. data/sample/demo-fifteen.rb +218 -0
  27. data/sample/demo-primitives.rb +720 -0
  28. data/sample/demo.rb +84 -0
  29. data/sample/flower.png +0 -0
  30. data/sample/scalability-demo.rb +130 -0
  31. data/sample/simple-demo.rb +35 -0
  32. data/sample/table-demo.rb +137 -0
  33. data/sample/toroid.png +0 -0
  34. data/sample/units-demo.rb +80 -0
  35. data/sample/widgets-demo.rb +197 -0
  36. data/vendor/local/bin/libgoocanvas-3.dll +0 -0
  37. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvas.h +334 -0
  38. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasatk.h +22 -0
  39. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasellipse.h +120 -0
  40. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasenumtypes.h +33 -0
  41. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasgrid.h +153 -0
  42. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasgroup.h +109 -0
  43. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasimage.h +121 -0
  44. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasitem.h +479 -0
  45. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasitemmodel.h +275 -0
  46. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasitemsimple.h +247 -0
  47. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasmarshal.h +61 -0
  48. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvaspath.h +116 -0
  49. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvaspolyline.h +176 -0
  50. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasprivate.h +59 -0
  51. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasrect.h +121 -0
  52. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasstyle.h +110 -0
  53. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvastable.h +139 -0
  54. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvastext.h +133 -0
  55. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvasutils.h +333 -0
  56. data/vendor/local/include/goocanvas-1.0.0/goocanvas/goocanvaswidget.h +66 -0
  57. data/vendor/local/include/goocanvas-1.0.0/goocanvas/stamp-goocanvasmarshal.h +1 -0
  58. data/vendor/local/lib/libgoocanvas.a +0 -0
  59. data/vendor/local/lib/libgoocanvas.dll.a +0 -0
  60. data/vendor/local/lib/pkgconfig/goocanvas.pc +13 -0
  61. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvas.html +1982 -0
  62. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasEllipse.html +269 -0
  63. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasEllipseModel.html +274 -0
  64. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasGrid.html +469 -0
  65. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasGridModel.html +476 -0
  66. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasGroup.html +183 -0
  67. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasGroupModel.html +184 -0
  68. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasImage.html +247 -0
  69. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasImageModel.html +252 -0
  70. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasItem.html +3014 -0
  71. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasItemModel.html +1764 -0
  72. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasItemModelSimple.html +298 -0
  73. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasItemSimple.html +809 -0
  74. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasPath.html +279 -0
  75. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasPathModel.html +280 -0
  76. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasPolyline.html +369 -0
  77. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasPolylineModel.html +375 -0
  78. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasRect.html +247 -0
  79. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasRectModel.html +252 -0
  80. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasStyle.html +489 -0
  81. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasTable.html +452 -0
  82. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasTableModel.html +452 -0
  83. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasText.html +324 -0
  84. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasTextModel.html +287 -0
  85. data/vendor/local/share/gtk-doc/html/goocanvas/GooCanvasWidget.html +266 -0
  86. data/vendor/local/share/gtk-doc/html/goocanvas/ch01.html +53 -0
  87. data/vendor/local/share/gtk-doc/html/goocanvas/ch02.html +50 -0
  88. data/vendor/local/share/gtk-doc/html/goocanvas/ch03.html +62 -0
  89. data/vendor/local/share/gtk-doc/html/goocanvas/ch04.html +60 -0
  90. data/vendor/local/share/gtk-doc/html/goocanvas/ch05.html +33 -0
  91. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-GooCanvas-Types.html +815 -0
  92. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-architecture.html +157 -0
  93. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-coordinates.html +106 -0
  94. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-creating-items.html +420 -0
  95. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-model-view-canvas.html +246 -0
  96. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-overview.html +106 -0
  97. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-simple-canvas.html +238 -0
  98. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas-wysiwyg.html +84 -0
  99. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas.devhelp +608 -0
  100. data/vendor/local/share/gtk-doc/html/goocanvas/goocanvas.devhelp2 +639 -0
  101. data/vendor/local/share/gtk-doc/html/goocanvas/home.png +0 -0
  102. data/vendor/local/share/gtk-doc/html/goocanvas/index.html +138 -0
  103. data/vendor/local/share/gtk-doc/html/goocanvas/index.sgml +814 -0
  104. data/vendor/local/share/gtk-doc/html/goocanvas/left.png +0 -0
  105. data/vendor/local/share/gtk-doc/html/goocanvas/right.png +0 -0
  106. data/vendor/local/share/gtk-doc/html/goocanvas/style.css +257 -0
  107. data/vendor/local/share/gtk-doc/html/goocanvas/up.png +0 -0
  108. data/vendor/local/share/gtk-doc/tmpl/goocanvas/dummy.sgml +0 -0
  109. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvas-unused.sgml +0 -0
  110. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvas.sgml +536 -0
  111. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasellipse.sgml +82 -0
  112. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasellipsemodel.sgml +82 -0
  113. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasgrid.sgml +176 -0
  114. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasgridmodel.sgml +176 -0
  115. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasgroup.sgml +58 -0
  116. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasgroupmodel.sgml +58 -0
  117. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasimage.sgml +81 -0
  118. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasimagemodel.sgml +81 -0
  119. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasitem.sgml +773 -0
  120. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasitemmodel.sgml +490 -0
  121. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasitemmodelsimple.sgml +135 -0
  122. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasitemsimple.sgml +254 -0
  123. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaspath.sgml +64 -0
  124. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaspathmodel.sgml +64 -0
  125. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaspolyline.sgml +109 -0
  126. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaspolylinemodel.sgml +109 -0
  127. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasrect.sgml +72 -0
  128. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasrectmodel.sgml +72 -0
  129. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasstyle.sgml +186 -0
  130. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvastable.sgml +158 -0
  131. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvastablemodel.sgml +158 -0
  132. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvastext.sgml +103 -0
  133. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvastextmodel.sgml +93 -0
  134. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvasutils.sgml +241 -0
  135. data/vendor/local/share/gtk-doc/tmpl/goocanvas/goocanvaswidget.sgml +73 -0
  136. metadata +218 -0
@@ -0,0 +1,157 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title>Underlying Architecture</title>
6
+ <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
+ <link rel="home" href="index.html" title="GooCanvas Reference Manual">
8
+ <link rel="up" href="ch01.html" title="Introduction">
9
+ <link rel="prev" href="goocanvas-model-view-canvas.html" title="Model/View Canvas Example">
10
+ <link rel="next" href="goocanvas-coordinates.html" title="Coordinate Spaces and Limits">
11
+ <meta name="generator" content="GTK-Doc V1.14 (XML mode)">
12
+ <link rel="stylesheet" href="style.css" type="text/css">
13
+ </head>
14
+ <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
+ <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
16
+ <td><a accesskey="p" href="goocanvas-model-view-canvas.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
17
+ <td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
18
+ <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
19
+ <th width="100%" align="center">GooCanvas Reference Manual</th>
20
+ <td><a accesskey="n" href="goocanvas-coordinates.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
21
+ </tr></table>
22
+ <div class="refentry" title="Underlying Architecture">
23
+ <a name="goocanvas-architecture"></a><div class="titlepage"></div>
24
+ <div class="refnamediv"><table width="100%"><tr>
25
+ <td valign="top">
26
+ <h2><span class="refentrytitle">Underlying Architecture</span></h2>
27
+ <p>Underlying Architecture — how the canvas fits together.</p>
28
+ </td>
29
+ <td valign="top" align="right"></td>
30
+ </tr></table></div>
31
+ <div class="refsect1" title="Underlying Architecture">
32
+ <a name="architecture"></a><h2>Underlying Architecture</h2>
33
+ <div class="refsect2" title="The GooCanvas Widget">
34
+ <a name="widget"></a><h3>The GooCanvas Widget</h3>
35
+ <p>
36
+ <a class="link" href="GooCanvas.html" title="GooCanvas"><span class="type">GooCanvas</span></a> is a <span class="type">GtkWidget</span> (it is actually a subclass of
37
+ <span class="type">GtkContainer</span>), and so can be placed in an interface just like
38
+ any normal widget. Usually a <a class="link" href="GooCanvas.html" title="GooCanvas"><span class="type">GooCanvas</span></a> widget would be placed inside
39
+ a <span class="type">GtkScrolledWindow</span> in order to enable scrolling of the canvas.
40
+ </p>
41
+ <p>
42
+ The size of the canvas can be set explicitly using
43
+ <a class="link" href="GooCanvas.html#goo-canvas-set-bounds" title="goo_canvas_set_bounds ()"><code class="function">goo_canvas_set_bounds()</code></a>, or if the <a class="link" href="GooCanvas.html#GooCanvas--automatic-bounds" title='The "automatic-bounds" property'><span class="type">"automatic-bounds"</span></a>
44
+ property is set to <code class="literal">TRUE</code> the bounds will be automatically calculated
45
+ to include all of the canvas items. The units used in the canvas can
46
+ be set with the <a class="link" href="GooCanvas.html#GooCanvas--units" title='The "units" property'><span class="type">"units"</span></a> property. The canvas units can be
47
+ pixels, points, inches or millimeters and apply to the canvas and
48
+ all items.
49
+ </p>
50
+ </div>
51
+ <hr>
52
+ <div class="refsect2" title="The Structure of the Simple Canvas">
53
+ <a name="simple-structure"></a><h3>The Structure of the Simple Canvas</h3>
54
+ <p>
55
+ The simple canvas consists of a hierarchy of canvas items.
56
+ The root item is automatically created by the canvas and can be
57
+ accessed using <a class="link" href="GooCanvas.html#goo-canvas-get-root-item" title="goo_canvas_get_root_item ()"><code class="function">goo_canvas_get_root_item()</code></a>. New items and groups can
58
+ then be created and added to the root item.
59
+ </p>
60
+ <p>
61
+ Each item in the canvas keeps a <a class="link" href="goocanvas-GooCanvas-Types.html#GooCanvasBounds" title="GooCanvasBounds"><span class="type">GooCanvasBounds</span></a> structure which
62
+ stores the bounding rectangle of the item and all of its descendants.
63
+ This makes it easy to find out which items in the canvas need repainting
64
+ or which item the mouse is over. (The bounds are stored in the canvas
65
+ coordinate space, which is the coordinate space of the entire canvas,
66
+ after any item transformation matrices have been applied.)
67
+ </p>
68
+ </div>
69
+ <hr>
70
+ <div class="refsect2" title="The Structure of the Model/View Canvas">
71
+ <a name="model-view-structure"></a><h3>The Structure of the Model/View Canvas</h3>
72
+ <p>
73
+ The model/view canvas consists of a hierarchy of item models, and an
74
+ identical hierarchy of canvas items, with each canvas item
75
+ corresponding to one item model.
76
+ </p>
77
+ <p>
78
+ The hierarchy of item models can be used in several <a class="link" href="GooCanvas.html" title="GooCanvas"><span class="type">GooCanvas</span></a>
79
+ widgets, to allow multiple views of the same model.
80
+ Though different canvas items will be used in each <a class="link" href="GooCanvas.html" title="GooCanvas"><span class="type">GooCanvas</span></a>.
81
+ </p>
82
+ <p>
83
+ The root item model is set with <a class="link" href="GooCanvas.html#goo-canvas-set-root-item-model" title="goo_canvas_set_root_item_model ()"><code class="function">goo_canvas_set_root_item_model()</code></a>.
84
+ The canvas will automatically create canvas items to display
85
+ the hierarchy of item models, and will automatically add and
86
+ remove canvas items as the item model hierarchy is changed.
87
+ </p>
88
+ </div>
89
+ <hr>
90
+ <div class="refsect2" title="The Update Procedure">
91
+ <a name="updates"></a><h3>The Update Procedure</h3>
92
+ <p>
93
+ When items are added to the canvas or their properties are changed
94
+ they may need to recalculate their bounds. To do this they set an
95
+ internal flag such as <em class="parameter"><code>need_update</code></em>, and make a call to
96
+ <a class="link" href="GooCanvasItem.html#goo-canvas-item-request-update" title="goo_canvas_item_request_update ()"><code class="function">goo_canvas_item_request_update()</code></a>.
97
+ </p>
98
+ <p>
99
+ <a class="link" href="GooCanvas.html" title="GooCanvas"><span class="type">GooCanvas</span></a> handles all the update requests at once, to avoid multiple
100
+ redraws of the same parts of the canvas. To do this it installs
101
+ an idle handler, <code class="function">goo_canvas_idle_handler()</code>, which is called as soon
102
+ as the application is idle (and before any part of the canvas is
103
+ redrawn).
104
+ </p>
105
+ <p>
106
+ The idle handler calls <a class="link" href="GooCanvasItem.html#goo-canvas-item-update" title="goo_canvas_item_update ()"><code class="function">goo_canvas_item_update()</code></a> on the root item,
107
+ which recursively calls <a class="link" href="GooCanvasItem.html#goo-canvas-item-update" title="goo_canvas_item_update ()"><code class="function">goo_canvas_item_update()</code></a> on any items as
108
+ necessary, recalculating their bounds and requesting redraws as
109
+ appropriate.
110
+ </p>
111
+ <p>
112
+ If a container item (e.g. <a class="link" href="GooCanvasGroup.html" title="GooCanvasGroup"><span class="type">GooCanvasGroup</span></a>) is changed it needs to
113
+ ensure that all descendants recalculate their bounds so it
114
+ calls <a class="link" href="GooCanvasItem.html#goo-canvas-item-update" title="goo_canvas_item_update ()"><code class="function">goo_canvas_item_update()</code></a> for all of its children with the
115
+ <em class="parameter"><code>entire_tree</code></em> argument set to <code class="literal">TRUE</code>.
116
+ </p>
117
+ </div>
118
+ <hr>
119
+ <div class="refsect2" title="How Changes to Items are Handled">
120
+ <a name="simple-updates"></a><h3>How Changes to Items are Handled</h3>
121
+ <p>
122
+ When an item is changed (e.g. if the <a class="link" href="GooCanvasRect.html#GooCanvasRect--x" title='The "x" property'><span class="type">"x"</span></a> property of
123
+ a <a class="link" href="GooCanvasRect.html" title="GooCanvasRect"><span class="type">GooCanvasRect</span></a> is changed), the item calls
124
+ <a class="link" href="GooCanvasItemSimple.html#goo-canvas-item-simple-changed" title="goo_canvas_item_simple_changed ()"><code class="function">goo_canvas_item_simple_changed()</code></a> with a flag indicating if the
125
+ bounds of the item need to be recalculated.
126
+ </p>
127
+ <p>
128
+ If the bounds don't need to be recalculated, then
129
+ <a class="link" href="GooCanvas.html#goo-canvas-request-redraw" title="goo_canvas_request_redraw ()"><code class="function">goo_canvas_request_redraw()</code></a> is called to simply request that the
130
+ item is redrawn. This results in a call to <code class="function">gdk_window_invalidate_rect()</code>
131
+ and the redraw proceeds just like a normal <span class="type">GtkWidget</span>.
132
+ </p>
133
+ <p>
134
+ However, if the bounds do need to be recalculated then
135
+ <a class="link" href="GooCanvasItem.html#goo-canvas-item-request-update" title="goo_canvas_item_request_update ()"><code class="function">goo_canvas_item_request_update()</code></a> is called to request that the item
136
+ be updated the next time the canvas performs an update.
137
+ </p>
138
+ </div>
139
+ <hr>
140
+ <div class="refsect2" title="How Changes are Handled in the Model/View Canvas">
141
+ <a name="model-view-updates"></a><h3>How Changes are Handled in the Model/View Canvas</h3>
142
+ <p>
143
+ In the Model/View canvas it is the underlying item models which are
144
+ initially changed. The item models emit "changed" signals which the
145
+ items respond to. For the standard canvas items the
146
+ <code class="function">goo_canvas_item_model_simple_changed()</code> signal handler is called,
147
+ which calls <a class="link" href="GooCanvasItemSimple.html#goo-canvas-item-simple-changed" title="goo_canvas_item_simple_changed ()"><code class="function">goo_canvas_item_simple_changed()</code></a> and the
148
+ procedure continues as in the simple canvas case above.
149
+ </p>
150
+ </div>
151
+ </div>
152
+ </div>
153
+ <div class="footer">
154
+ <hr>
155
+ Generated by GTK-Doc V1.14</div>
156
+ </body>
157
+ </html>
@@ -0,0 +1,106 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title>Coordinate Spaces and Limits</title>
6
+ <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
+ <link rel="home" href="index.html" title="GooCanvas Reference Manual">
8
+ <link rel="up" href="ch01.html" title="Introduction">
9
+ <link rel="prev" href="goocanvas-architecture.html" title="Underlying Architecture">
10
+ <link rel="next" href="goocanvas-creating-items.html" title="Creating New Items">
11
+ <meta name="generator" content="GTK-Doc V1.14 (XML mode)">
12
+ <link rel="stylesheet" href="style.css" type="text/css">
13
+ </head>
14
+ <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
+ <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
16
+ <td><a accesskey="p" href="goocanvas-architecture.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
17
+ <td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
18
+ <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
19
+ <th width="100%" align="center">GooCanvas Reference Manual</th>
20
+ <td><a accesskey="n" href="goocanvas-creating-items.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
21
+ </tr></table>
22
+ <div class="refentry" title="Coordinate Spaces and Limits">
23
+ <a name="goocanvas-coordinates"></a><div class="titlepage"></div>
24
+ <div class="refnamediv"><table width="100%"><tr>
25
+ <td valign="top">
26
+ <h2><span class="refentrytitle">Coordinate Spaces and Limits</span></h2>
27
+ <p>Coordinate Spaces and Limits — how coordinates are used.</p>
28
+ </td>
29
+ <td valign="top" align="right"></td>
30
+ </tr></table></div>
31
+ <div class="refsect1" title="Coordinate Spaces">
32
+ <a name="coordinates"></a><h2>Coordinate Spaces</h2>
33
+ <p>
34
+ Items in the canvas typically have a number of properties specifying
35
+ their location and size. For example the <a class="link" href="GooCanvasRect.html" title="GooCanvasRect"><span class="type">GooCanvasRect</span></a> item has
36
+ <a class="link" href="GooCanvasRect.html#GooCanvasRect--x" title='The "x" property'><span class="type">"x"</span></a>, <a class="link" href="GooCanvasRect.html#GooCanvasRect--y" title='The "y" property'><span class="type">"y"</span></a>, <a class="link" href="GooCanvasRect.html#GooCanvasRect--width" title='The "width" property'><span class="type">"width"</span></a> and
37
+ <a class="link" href="GooCanvasRect.html#GooCanvasRect--height" title='The "height" property'><span class="type">"height"</span></a> properties.
38
+ </p>
39
+ <p>
40
+ However, items can also have a transformation matrix (e.g. the
41
+ <a class="link" href="GooCanvasItem.html#GooCanvasItem--transform" title='The "transform" property'><span class="type">"transform"</span></a> property).
42
+ Transformation matrices modify the item's coordinate space in some
43
+ way. Modifications include translation (moving the origin), rotation,
44
+ scaling, and skewing, or combinations of these. Thus the final
45
+ position of the item on the canvas can be altered dramatically.
46
+ </p>
47
+ <p>
48
+ The simple animation features in <a class="link" href="GooCanvas.html" title="GooCanvas"><span class="type">GooCanvas</span></a> are accomplished by
49
+ modifying the item's transformation matrix over time.
50
+ (See <a class="link" href="GooCanvasItem.html#goo-canvas-item-animate" title="goo_canvas_item_animate ()"><code class="function">goo_canvas_item_animate()</code></a>.)
51
+ </p>
52
+ <p>
53
+ Since items are in a hierarchy it is possible to move or rotate an
54
+ entire group of items by simply changing the transformation matrix
55
+ of the group containing them.
56
+ </p>
57
+ <p>
58
+ The coordinate space used within the item itself (e.g. where the
59
+ <a class="link" href="GooCanvasRect.html#GooCanvasRect--x" title='The "x" property'><span class="type">"x"</span></a> and <a class="link" href="GooCanvasRect.html#GooCanvasRect--y" title='The "y" property'><span class="type">"y"</span></a> properties of a <a class="link" href="GooCanvasRect.html" title="GooCanvasRect"><span class="type">GooCanvasRect</span></a>
60
+ are specified)
61
+ is referred to as "Item Space". The coordinate space used by
62
+ the entire canvas is referred to as "Canvas Space" (or "Device Space").
63
+ "Item Space" and "Canvas Space" may or may not be the same, depending
64
+ on whether
65
+ the item or any of its ancestors have a transformation matrix set.
66
+ (Note that the entire canvas may also be scrolled and/or zoomed,
67
+ which means that there may be additional transformations above
68
+ "Canvas Space".)
69
+ </p>
70
+ <p>
71
+ Functions are provided to convert between coordinate spaces,
72
+ e.g. <a class="link" href="GooCanvas.html#goo-canvas-convert-to-item-space" title="goo_canvas_convert_to_item_space ()"><code class="function">goo_canvas_convert_to_item_space()</code></a> and
73
+ <a class="link" href="GooCanvas.html#goo-canvas-convert-from-item-space" title="goo_canvas_convert_from_item_space ()"><code class="function">goo_canvas_convert_from_item_space()</code></a> convert canvas space coordinates
74
+ to item space and vice versa.
75
+ </p>
76
+ <div class="refsect2" title="Coordinate Limits">
77
+ <a name="coordinate-limits"></a><h3>Coordinate Limits</h3>
78
+ <p>
79
+ GooCanvas uses the Cairo graphics library to render canvas items.
80
+ For performance reasons Cairo uses 32-bit fixed point integers
81
+ internally when rendering graphics, with 24 bits used for the integer
82
+ part of values and 8 bits used for the fractional part.
83
+ This means that values are limited to roughly +/- 8,388,608.
84
+ (Prior to Cairo 1.6 16 bits were used for the integer part and 16 bits
85
+ for the fractional part, meaning values were limited to +/- 32,768.)
86
+ </p>
87
+ <p>
88
+ GooCanvas includes code to work around the Cairo limits to some extent.
89
+ Subclasses of GooCanvasItemSimple (including all builtin items) can
90
+ use any desired translation using a transformation matrix.
91
+ But item space coordinates (modified by any scale, rotation or skew)
92
+ must be within the Cairo limits.
93
+ </p>
94
+ <p>
95
+ It is possible to create new canvas items that avoid the Cairo
96
+ limits completely. For an example of this see the "Large Items" page
97
+ in the GooCanvas demo application, and the corresponding code.
98
+ </p>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ <div class="footer">
103
+ <hr>
104
+ Generated by GTK-Doc V1.14</div>
105
+ </body>
106
+ </html>