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,238 @@
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>Simple Canvas Example</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-overview.html" title="Overview">
10
+ <link rel="next" href="goocanvas-model-view-canvas.html" title="Model/View Canvas Example">
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-overview.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-model-view-canvas.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
21
+ </tr></table>
22
+ <div class="refentry" title="Simple Canvas Example">
23
+ <a name="goocanvas-simple-canvas"></a><div class="titlepage"></div>
24
+ <div class="refnamediv"><table width="100%"><tr>
25
+ <td valign="top">
26
+ <h2><span class="refentrytitle">Simple Canvas Example</span></h2>
27
+ <p>Simple Canvas Example — how to create a simple canvas.</p>
28
+ </td>
29
+ <td valign="top" align="right"></td>
30
+ </tr></table></div>
31
+ <div class="refsect1" title="Simple Canvas Example">
32
+ <a name="simple-canvas-example"></a><h2>Simple Canvas Example</h2>
33
+ <p>
34
+ Here's a complete example application that creates a <a class="link" href="GooCanvas.html" title="GooCanvas"><span class="type">GooCanvas</span></a> with a
35
+ rectangle and a text item in it:
36
+ </p>
37
+ <div class="informalexample">
38
+ <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
39
+ <tbody>
40
+ <tr>
41
+ <td class="listing_lines" align="right"><pre>1
42
+ 2
43
+ 3
44
+ 4
45
+ 5
46
+ 6
47
+ 7
48
+ 8
49
+ 9
50
+ 10
51
+ 11
52
+ 12
53
+ 13
54
+ 14
55
+ 15
56
+ 16
57
+ 17
58
+ 18
59
+ 19
60
+ 20
61
+ 21
62
+ 22
63
+ 23
64
+ 24
65
+ 25
66
+ 26
67
+ 27
68
+ 28
69
+ 29
70
+ 30
71
+ 31
72
+ 32
73
+ 33
74
+ 34
75
+ 35
76
+ 36
77
+ 37
78
+ 38
79
+ 39
80
+ 40
81
+ 41
82
+ 42
83
+ 43
84
+ 44
85
+ 45
86
+ 46
87
+ 47
88
+ 48
89
+ 49
90
+ 50
91
+ 51
92
+ 52
93
+ 53
94
+ 54
95
+ 55
96
+ 56
97
+ 57
98
+ 58
99
+ 59
100
+ 60
101
+ 61
102
+ 62
103
+ 63
104
+ 64
105
+ 65
106
+ 66
107
+ 67
108
+ 68
109
+ 69
110
+ 70
111
+ 71
112
+ 72
113
+ 73
114
+ 74
115
+ 75
116
+ 76
117
+ 77
118
+ 78
119
+ 79
120
+ 80
121
+ 81
122
+ 82
123
+ 83
124
+ 84
125
+ 85
126
+ 86
127
+ 87
128
+ 88
129
+ 89
130
+ 90
131
+ 91
132
+ 92
133
+ 93</pre></td>
134
+ <td class="listing_code"><pre class="programlisting"><span class="preproc">#include</span><span class="normal"> </span><span class="string">&lt;stdlib.h&gt;</span>
135
+ <span class="preproc">#include</span><span class="normal"> </span><span class="string">&lt;goocanvas.h&gt;</span>
136
+
137
+
138
+ <span class="keyword">static</span><span class="normal"> gboolean </span><span class="function">on_rect_button_press</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GooCanvasItem.html">GooCanvasItem</a> </span><span class="symbol">*</span><span class="normal">view</span><span class="symbol">,</span>
139
+ <span class="normal"> <a href="GooCanvasItem.html">GooCanvasItem</a> </span><span class="symbol">*</span><span class="normal">target</span><span class="symbol">,</span>
140
+ <span class="normal"> GdkEventButton </span><span class="symbol">*</span><span class="normal">event</span><span class="symbol">,</span>
141
+ <span class="normal"> gpointer data</span><span class="symbol">);</span>
142
+
143
+ <span class="keyword">static</span><span class="normal"> gboolean </span><span class="function">on_delete_event</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkWidget </span><span class="symbol">*</span><span class="normal">window</span><span class="symbol">,</span>
144
+ <span class="normal"> GdkEvent </span><span class="symbol">*</span><span class="normal">event</span><span class="symbol">,</span>
145
+ <span class="normal"> gpointer unused_data</span><span class="symbol">);</span>
146
+
147
+
148
+ <span class="type">int</span>
149
+ <span class="function">main</span><span class="normal"> </span><span class="symbol">(</span><span class="type">int</span><span class="normal"> argc</span><span class="symbol">,</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">argv</span><span class="symbol">[])</span>
150
+ <span class="cbracket">{</span>
151
+ <span class="normal"> GtkWidget </span><span class="symbol">*</span><span class="normal">window</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">scrolled_win</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">canvas</span><span class="symbol">;</span>
152
+ <span class="normal"> <a href="GooCanvasItem.html">GooCanvasItem</a> </span><span class="symbol">*</span><span class="normal">root</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">rect_item</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">text_item</span><span class="symbol">;</span>
153
+
154
+ <span class="normal"> </span><span class="comment">/* Initialize GTK+. */</span>
155
+ <span class="normal"> gtk_set_locale </span><span class="symbol">();</span>
156
+ <span class="normal"> </span><span class="function">gtk_init</span><span class="normal"> </span><span class="symbol">(&amp;</span><span class="normal">argc</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&amp;</span><span class="normal">argv</span><span class="symbol">);</span>
157
+
158
+ <span class="normal"> </span><span class="comment">/* Create the window and widgets. */</span>
159
+ <span class="normal"> window </span><span class="symbol">=</span><span class="normal"> </span><span class="function">gtk_window_new</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GTK_WINDOW_TOPLEVEL</span><span class="symbol">);</span>
160
+ <span class="normal"> </span><span class="function">gtk_window_set_default_size</span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_WINDOW</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">window</span><span class="symbol">),</span><span class="normal"> </span><span class="number">640</span><span class="symbol">,</span><span class="normal"> </span><span class="number">600</span><span class="symbol">);</span>
161
+ <span class="normal"> </span><span class="function">gtk_widget_show</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">window</span><span class="symbol">);</span>
162
+ <span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">window</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"delete_event"</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkSignalFunc</span><span class="symbol">)</span><span class="normal"> on_delete_event</span><span class="symbol">,</span>
163
+ <span class="normal"> NULL</span><span class="symbol">);</span>
164
+
165
+ <span class="normal"> scrolled_win </span><span class="symbol">=</span><span class="normal"> </span><span class="function">gtk_scrolled_window_new</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">NULL</span><span class="symbol">,</span><span class="normal"> NULL</span><span class="symbol">);</span>
166
+ <span class="normal"> </span><span class="function">gtk_scrolled_window_set_shadow_type</span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_SCROLLED_WINDOW</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">scrolled_win</span><span class="symbol">),</span>
167
+ <span class="normal"> GTK_SHADOW_IN</span><span class="symbol">);</span>
168
+ <span class="normal"> </span><span class="function">gtk_widget_show</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">scrolled_win</span><span class="symbol">);</span>
169
+ <span class="normal"> </span><span class="function">gtk_container_add</span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">window</span><span class="symbol">),</span><span class="normal"> scrolled_win</span><span class="symbol">);</span>
170
+
171
+ <span class="normal"> canvas </span><span class="symbol">=</span><span class="normal"> goo_canvas_new </span><span class="symbol">();</span>
172
+ <span class="normal"> </span><span class="function">gtk_widget_set_size_request</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">canvas</span><span class="symbol">,</span><span class="normal"> </span><span class="number">600</span><span class="symbol">,</span><span class="normal"> </span><span class="number">450</span><span class="symbol">);</span>
173
+ <span class="normal"> </span><span class="function"><a href="GooCanvas.html#goo-canvas-set-bounds">goo_canvas_set_bounds</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GOO_CANVAS</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">canvas</span><span class="symbol">),</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> </span><span class="number">0</span><span class="symbol">,</span><span class="normal"> </span><span class="number">1000</span><span class="symbol">,</span><span class="normal"> </span><span class="number">1000</span><span class="symbol">);</span>
174
+ <span class="normal"> </span><span class="function">gtk_widget_show</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">canvas</span><span class="symbol">);</span>
175
+ <span class="normal"> </span><span class="function">gtk_container_add</span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">scrolled_win</span><span class="symbol">),</span><span class="normal"> canvas</span><span class="symbol">);</span>
176
+
177
+ <span class="normal"> root </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GooCanvas.html#goo-canvas-get-root-item">goo_canvas_get_root_item</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GOO_CANVAS</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">canvas</span><span class="symbol">));</span>
178
+
179
+ <span class="normal"> </span><span class="comment">/* Add a few simple items. */</span>
180
+ <span class="normal"> rect_item </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GooCanvasRect.html#goo-canvas-rect-new">goo_canvas_rect_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">root</span><span class="symbol">,</span><span class="normal"> </span><span class="number">100</span><span class="symbol">,</span><span class="normal"> </span><span class="number">100</span><span class="symbol">,</span><span class="normal"> </span><span class="number">400</span><span class="symbol">,</span><span class="normal"> </span><span class="number">400</span><span class="symbol">,</span>
181
+ <span class="normal"> </span><span class="string">"line-width"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">10.0</span><span class="symbol">,</span>
182
+ <span class="normal"> </span><span class="string">"radius-x"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">20.0</span><span class="symbol">,</span>
183
+ <span class="normal"> </span><span class="string">"radius-y"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">10.0</span><span class="symbol">,</span>
184
+ <span class="normal"> </span><span class="string">"stroke-color"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"yellow"</span><span class="symbol">,</span>
185
+ <span class="normal"> </span><span class="string">"fill-color"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"red"</span><span class="symbol">,</span>
186
+ <span class="normal"> NULL</span><span class="symbol">);</span>
187
+
188
+ <span class="normal"> text_item </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GooCanvasText.html#goo-canvas-text-new">goo_canvas_text_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">root</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Hello World"</span><span class="symbol">,</span><span class="normal"> </span><span class="number">300</span><span class="symbol">,</span><span class="normal"> </span><span class="number">300</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">-</span><span class="number">1</span><span class="symbol">,</span>
189
+ <span class="normal"> GTK_ANCHOR_CENTER</span><span class="symbol">,</span>
190
+ <span class="normal"> </span><span class="string">"font"</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"Sans 24"</span><span class="symbol">,</span>
191
+ <span class="normal"> NULL</span><span class="symbol">);</span>
192
+ <span class="normal"> </span><span class="function"><a href="GooCanvasItem.html#goo-canvas-item-rotate">goo_canvas_item_rotate</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">text_item</span><span class="symbol">,</span><span class="normal"> </span><span class="number">45</span><span class="symbol">,</span><span class="normal"> </span><span class="number">300</span><span class="symbol">,</span><span class="normal"> </span><span class="number">300</span><span class="symbol">);</span>
193
+
194
+ <span class="normal"> </span><span class="comment">/* Connect a signal handler for the rectangle item. */</span>
195
+ <span class="normal"> </span><span class="function">g_signal_connect</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">rect_item</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"button_press_event"</span><span class="symbol">,</span>
196
+ <span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkSignalFunc</span><span class="symbol">)</span><span class="normal"> on_rect_button_press</span><span class="symbol">,</span><span class="normal"> NULL</span><span class="symbol">);</span>
197
+
198
+ <span class="normal"> </span><span class="comment">/* Pass control to the GTK+ main event loop. */</span>
199
+ <span class="normal"> gtk_main </span><span class="symbol">();</span>
200
+
201
+ <span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
202
+ <span class="cbracket">}</span>
203
+
204
+
205
+ <span class="comment">/* This handles button presses in item views. We simply output a message to</span>
206
+ <span class="comment"> the console. */</span>
207
+ <span class="keyword">static</span><span class="normal"> gboolean</span>
208
+ <span class="function">on_rect_button_press</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GooCanvasItem.html">GooCanvasItem</a> </span><span class="symbol">*</span><span class="normal">item</span><span class="symbol">,</span>
209
+ <span class="normal"> <a href="GooCanvasItem.html">GooCanvasItem</a> </span><span class="symbol">*</span><span class="normal">target</span><span class="symbol">,</span>
210
+ <span class="normal"> GdkEventButton </span><span class="symbol">*</span><span class="normal">event</span><span class="symbol">,</span>
211
+ <span class="normal"> gpointer data</span><span class="symbol">)</span>
212
+ <span class="cbracket">{</span>
213
+ <span class="normal"> </span><span class="function">g_print</span><span class="normal"> </span><span class="symbol">(</span><span class="string">"rect item received button press event</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">);</span>
214
+ <span class="normal"> </span><span class="keyword">return</span><span class="normal"> TRUE</span><span class="symbol">;</span>
215
+ <span class="cbracket">}</span>
216
+
217
+
218
+ <span class="comment">/* This is our handler for the "delete-event" signal of the window, which</span>
219
+ <span class="comment"> is emitted when the 'x' close button is clicked. We just exit here. */</span>
220
+ <span class="keyword">static</span><span class="normal"> gboolean</span>
221
+ <span class="function">on_delete_event</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">GtkWidget </span><span class="symbol">*</span><span class="normal">window</span><span class="symbol">,</span>
222
+ <span class="normal"> GdkEvent </span><span class="symbol">*</span><span class="normal">event</span><span class="symbol">,</span>
223
+ <span class="normal"> gpointer unused_data</span><span class="symbol">)</span>
224
+ <span class="cbracket">{</span>
225
+ <span class="normal"> </span><span class="function">exit</span><span class="normal"> </span><span class="symbol">(</span><span class="number">0</span><span class="symbol">);</span>
226
+ <span class="cbracket">}</span></pre></td>
227
+ </tr>
228
+ </tbody>
229
+ </table>
230
+ </div>
231
+
232
+ </div>
233
+ </div>
234
+ <div class="footer">
235
+ <hr>
236
+ Generated by GTK-Doc V1.14</div>
237
+ </body>
238
+ </html>
@@ -0,0 +1,84 @@
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>WYSIWYG Printing</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-creating-items.html" title="Creating New Items">
10
+ <link rel="next" href="ch02.html" title="Core Objects">
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-creating-items.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="ch02.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
21
+ </tr></table>
22
+ <div class="refentry" title="WYSIWYG Printing">
23
+ <a name="goocanvas-wysiwyg"></a><div class="titlepage"></div>
24
+ <div class="refnamediv"><table width="100%"><tr>
25
+ <td valign="top">
26
+ <h2><span class="refentrytitle">WYSIWYG Printing</span></h2>
27
+ <p>WYSIWYG Printing — how to use the canvas to create accurate printed output.</p>
28
+ </td>
29
+ <td valign="top" align="right"></td>
30
+ </tr></table></div>
31
+ <div class="refsect1" title="WYSIWYG Printing">
32
+ <a name="wysiwyg"></a><h2>WYSIWYG Printing</h2>
33
+ <div class="refsect2" title="Screen Resolution">
34
+ <a name="resolution"></a><h3>Screen Resolution</h3>
35
+ <p>
36
+ The GooCanvas <a class="link" href="GooCanvas.html#GooCanvas--resolution-x" title='The "resolution-x" property'><span class="type">"resolution-x"</span></a> and <a class="link" href="GooCanvas.html#GooCanvas--resolution-y" title='The "resolution-y" property'><span class="type">"resolution-y"</span></a>
37
+ properties must be set correctly. They both default to 96dpi, which
38
+ corresponds to a typical monitor. To get a more accurate figure you
39
+ might be able to use <code class="function">gdk_screen_get_resolution()</code>, but this isn't always
40
+ guaranteed to be correct. If accuracy is very important a method should
41
+ be provided for the user to calibrate the screen.
42
+ </p>
43
+ </div>
44
+ <hr>
45
+ <div class="refsect2" title="Units">
46
+ <a name="units"></a><h3>Units</h3>
47
+ <p>
48
+ The GooCanvas <a class="link" href="GooCanvas.html#GooCanvas--units" title='The "units" property'><span class="type">"units"</span></a> property must be set to one of <code class="literal">GTK_UNIT_MM</code>,
49
+ <code class="literal">GTK_UNIT_POINTS</code> or <code class="literal">GTK_UNIT_INCH</code> (it defaults to <code class="literal">GTK_UNIT_PIXEL</code>).
50
+ All values used within the canvas are assumed to be in the specified
51
+ units, including font sizes.
52
+ </p>
53
+ </div>
54
+ <hr>
55
+ <div class="refsect2" title="Font Sizes">
56
+ <a name="fonts"></a><h3>Font Sizes</h3>
57
+ <p>
58
+ Absolute font sizes must be used (to prevent the fonts being mistakenly
59
+ scaled by Pango as well as by GooCanvas). To specify absolute font sizes
60
+ add "px" after the font size, e.g. instead of "Sans 9" use "Sans 9px".
61
+ </p>
62
+ <p>
63
+ Font sizes must be converted to the units used by the canvas.
64
+ For example, if a 9 point "Sans" font is desired but <a class="link" href="GooCanvas.html#GooCanvas--units" title='The "units" property'><span class="type">"units"</span></a>
65
+ is set to <code class="literal">GTK_UNIT_MM</code>, then the size must first be converted into
66
+ millimeters: (9 / 72) * 25.4 = 3.175mm.
67
+ So the font used would be "Sans 3.175px".
68
+ </p>
69
+ </div>
70
+ <hr>
71
+ <div class="refsect2" title="Example Code">
72
+ <a name="example"></a><h3>Example Code</h3>
73
+ <p>
74
+ The units-demo application that comes with the GooCanvas source code
75
+ demonstrates the use of different units and absolute font sizes.
76
+ </p>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ <div class="footer">
81
+ <hr>
82
+ Generated by GTK-Doc V1.14</div>
83
+ </body>
84
+ </html>