summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/ghosd/ghosd-0.0.1/doc/html/ghosd-Basics.html
blob: 3076b10057a77a8c3765f92ce15b11bc718fe092 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Basics</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="index.html" title="Ghosd Manual">
<link rel="up" href="ch01.html" title="Reference">
<link rel="prev" href="ch01.html" title="Reference">
<link rel="next" href="ghosd-Main-Loop.html" title="Main Loop">
<meta name="generator" content="GTK-Doc V1.4 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Ghosd Manual</th>
<td><a accesskey="n" href="ghosd-Main-Loop.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry" lang="en">
<a name="ghosd-Basics"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Basics</span></h2>
<p>Basics &#8212; Creation, rendering, destruction.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">

#include &lt;ghosd/ghosd.h&gt;


            <a href="ghosd-Basics.html#Ghosd">Ghosd</a>;
void        (<a href="ghosd-Basics.html#GhosdRenderFunc">*GhosdRenderFunc</a>)              (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd,
                                             cairo_t *cr,
                                             void *user_data);
<a href="ghosd-Basics.html#Ghosd">Ghosd</a>*      <a href="ghosd-Basics.html#ghosd-new">ghosd_new</a>                       (void);
void        <a href="ghosd-Basics.html#ghosd-set-transparent">ghosd_set_transparent</a>           (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd,
                                             int transparent);
#define     <a href="ghosd-Basics.html#GHOSD-COORD-CENTER:CAPS">GHOSD_COORD_CENTER</a>
void        <a href="ghosd-Basics.html#ghosd-set-position">ghosd_set_position</a>              (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd,
                                             int x,
                                             int y,
                                             int width,
                                             int height);
void        <a href="ghosd-Basics.html#ghosd-set-render">ghosd_set_render</a>                (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd,
                                             <a href="ghosd-Basics.html#GhosdRenderFunc">GhosdRenderFunc</a> render_func,
                                             void *data);
void        <a href="ghosd-Basics.html#ghosd-render">ghosd_render</a>                    (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd);
void        <a href="ghosd-Basics.html#ghosd-show">ghosd_show</a>                      (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2492107"></a><h2>Description</h2>
<p>

</p>
</div>
<div class="refsect1" lang="en">
<a name="id2492118"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2492124"></a><h3>
<a name="Ghosd"></a>Ghosd</h3>
<a class="indexterm" name="id2492134"></a><pre class="programlisting">typedef struct _Ghosd Ghosd;</pre>
<p>
An opaque Ghosd object.  Think of it as the window that the content is
displayed in.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2492151"></a><h3>
<a name="GhosdRenderFunc"></a>GhosdRenderFunc ()</h3>
<a class="indexterm" name="id2492161"></a><pre class="programlisting">void        (*GhosdRenderFunc)              (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd,
                                             cairo_t *cr,
                                             void *user_data);</pre>
<p>
The type of callback called when Ghosd needs to render the content.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>ghosd</code></em>&#160;:</span></td>
<td>A <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a> object.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>cr</code></em>&#160;:</span></td>
<td>A <span class="type">cairo_t</span> to draw on.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></td>
<td>User data that was passed to <a href="ghosd-Basics.html#ghosd-set-render"><code class="function">ghosd_set_render()</code></a>.


</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2534054"></a><h3>
<a name="ghosd-new"></a>ghosd_new ()</h3>
<a class="indexterm" name="id2534064"></a><pre class="programlisting"><a href="ghosd-Basics.html#Ghosd">Ghosd</a>*      ghosd_new                       (void);</pre>
<p>
Create a new <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a> object.
</p>
<p>
Can return <code class="literal">NULL</code> if unable to connect to the X server.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
<td> a new <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a> object.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2534128"></a><h3>
<a name="ghosd-set-transparent"></a>ghosd_set_transparent ()</h3>
<a class="indexterm" name="id2534137"></a><pre class="programlisting">void        ghosd_set_transparent           (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd,
                                             int transparent);</pre>
<p>
Change the "transparent" setting.  Setting <em class="parameter"><code>transparent</code></em> to <code class="literal">FALSE</code> is
mostly useful for debugging.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>ghosd</code></em>&#160;:</span></td>
<td> a <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a> object.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>transparent</code></em>&#160;:</span></td>
<td> a boolean indicating the transparent setting.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2534227"></a><h3>
<a name="GHOSD-COORD-CENTER:CAPS"></a>GHOSD_COORD_CENTER</h3>
<a class="indexterm" name="id2534236"></a><pre class="programlisting">#define GHOSD_COORD_CENTER MAXINT
</pre>
<p>
Pass this as a coordinate to <a href="ghosd-Basics.html#ghosd-set-position"><code class="function">ghosd_set_position()</code></a> to center along that axis.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2534260"></a><h3>
<a name="ghosd-set-position"></a>ghosd_set_position ()</h3>
<a class="indexterm" name="id2534270"></a><pre class="programlisting">void        ghosd_set_position              (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd,
                                             int x,
                                             int y,
                                             int width,
                                             int height);</pre>
<p>
Position the initial <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a>.  Must be called before <a href="ghosd-Basics.html#ghosd-render"><code class="function">ghosd_render()</code></a> and
<a href="ghosd-Basics.html#ghosd-show"><code class="function">ghosd_show()</code></a>, and can only be called once.
</p>
<p>
Positive x,y are interpreted as normal coordinates.
Pass <code class="literal">GHOSD_COORD_CENTER</code> to center on a given dimension,
and negative coordinates right-align (like CSS right).</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>ghosd</code></em>&#160;:</span></td>
<td> a <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a> object.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>x</code></em>&#160;:</span></td>
<td> x coordinate in screen pixels.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>y</code></em>&#160;:</span></td>
<td> y coordinate in screen pixels.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>width</code></em>&#160;:</span></td>
<td> width in screen pixels.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>height</code></em>&#160;:</span></td>
<td> width in screen pixels.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2469726"></a><h3>
<a name="ghosd-set-render"></a>ghosd_set_render ()</h3>
<a class="indexterm" name="id2469736"></a><pre class="programlisting">void        ghosd_set_render                (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd,
                                             <a href="ghosd-Basics.html#GhosdRenderFunc">GhosdRenderFunc</a> render_func,
                                             void *data);</pre>
<p>
Register a function to draw on the <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>ghosd</code></em>&#160;:</span></td>
<td> a <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a> object.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>render_func</code></em>&#160;:</span></td>
<td> a <a href="ghosd-Basics.html#GhosdRenderFunc"><span class="type">GhosdRenderFunc</span></a> callback.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
<td> user data to pass to the callback.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556720"></a><h3>
<a name="ghosd-render"></a>ghosd_render ()</h3>
<a class="indexterm" name="id2556729"></a><pre class="programlisting">void        ghosd_render                    (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd);</pre>
<p>
Makes the Ghosd redraw itself.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>ghosd</code></em>&#160;:</span></td>
<td> a <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a> object.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2556779"></a><h3>
<a name="ghosd-show"></a>ghosd_show ()</h3>
<a class="indexterm" name="id2556787"></a><pre class="programlisting">void        ghosd_show                      (<a href="ghosd-Basics.html#Ghosd">Ghosd</a> *ghosd);</pre>
<p>
Show the <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a>.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>ghosd</code></em>&#160;:</span></td>
<td> a <a href="ghosd-Basics.html#Ghosd"><span class="type">Ghosd</span></a> object.
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="ch01.html"><b>&lt;&lt;&#160;Reference</b></a></td>
<td align="right"><a accesskey="n" href="ghosd-Main-Loop.html"><b>Main Loop&#160;&gt;&gt;</b></a></td>
</tr></table>
</body>
</html>