/usr/share/gtk-doc/html/graphene/graphene-GObject-integration.html is in libgraphene-doc 1.8.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GObject integration: Graphene Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Graphene Reference Manual">
<link rel="up" href="ch01.html" title="Graphene">
<link rel="prev" href="graphene-Versioning-information.html" title="Versioning information">
<link rel="next" href="object-tree.html" title="Object Hierarchy">
<meta name="generator" content="GTK-Doc V1.27 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#graphene-GObject-integration.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="graphene-Versioning-information.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="object-tree.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="graphene-GObject-integration"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="graphene-GObject-integration.top_of_page"></a>GObject integration</span></h2>
<p>GObject integration — Types for GObject properties and signals</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="graphene-GObject-integration.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <graphene-gobject.h>
</pre>
</div>
<div class="refsect1">
<a name="graphene-GObject-integration.description"></a><h2>Description</h2>
<p>Graphene optionally provides information for using its own types with
GObject properties and signals.</p>
<div class="refsect3">
<a name="id-1.2.21.4.3"></a><h4>Using Graphene with GObject</h4>
<p>In order to discover at compile time if Graphene exposes type information
for the GType type system, you need to check if the <code class="literal">graphene-gobject-1.0</code>
pkg-config file exists. In build systems using autotools, you can use
the <code class="literal">PKG_CHECK_EXISTS</code> m4 macro, for instance:</p>
<div class="informalexample"><pre class="screen">
PKG_CHECK_EXISTS([graphene-gobject-1.0],
[action-if-found],
[action-if-not-found]
</pre></div>
<p></p>
<p>All the types provided by Graphene are boxed types, which means you
will have to use the <span class="type">GBoxed</span> API when dealing with <span class="type">GValue</span>, <span class="type">GParamSpec</span>,
and signal marshallers. For instance, to install a property in a <span class="type">GObject</span>
class that uses <a class="link" href="graphene-Rectangle.html#graphene-rect-t" title="graphene_rect_t"><span class="type">graphene_rect_t</span></a>, you can use:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="function">g_object_class_install_property</span> <span class="gtkdoc opt">(</span>object_class<span class="gtkdoc opt">,</span> PROP_BOUNDS<span class="gtkdoc opt">,</span>
<span class="function">g_param_spec_boxed</span> <span class="gtkdoc opt">(</span><span class="string">"bounds"</span><span class="gtkdoc opt">,</span> <span class="string">"Bounds"</span><span class="gtkdoc opt">,</span> <span class="string">"Bounds of an object"</span><span class="gtkdoc opt">,</span>
GRAPHENE_TYPE_RECT<span class="gtkdoc opt">,</span>
G_PARAM_READWRITE <span class="gtkdoc opt">|</span> G_PARAM_STATIC_STRINGS<span class="gtkdoc opt">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
<p>You'll then need to use <code class="function">g_value_set_boxed()</code> and <code class="function">g_value_get_boxed()</code>
in order to access the <a class="link" href="graphene-Rectangle.html#graphene-rect-t" title="graphene_rect_t"><span class="type">graphene_rect_t</span></a> pointer from the <span class="type">GValue</span> data
structure.</p>
<p>Whereas for creating a new signal that has a <a class="link" href="graphene-Point.html#graphene-point-t" title="graphene_point_t"><span class="type">graphene_point_t</span></a> parameter
you can use:</p>
<div class="informalexample">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9</pre></td>
<td class="listing_code"><pre class="programlisting">signals<span class="gtkdoc opt">[</span>HIT_TEST<span class="gtkdoc opt">] =</span>
<span class="function">g_signal_new</span> <span class="gtkdoc opt">(</span><span class="string">"hit-test"</span><span class="gtkdoc opt">,</span>
<span class="function">G_TYPE_FROM_CLASS</span> <span class="gtkdoc opt">(</span>object_class<span class="gtkdoc opt">),</span>
G_SIGNAL_RUN_LAST<span class="gtkdoc opt">,</span>
<span class="number">0</span><span class="gtkdoc opt">,</span>
g_signal_accumulator_true_handled<span class="gtkdoc opt">,</span> NULL<span class="gtkdoc opt">,</span>
marshal_BOOLEAN__BOXED<span class="gtkdoc opt">,</span>
G_TYPE_BOOLEAN<span class="gtkdoc opt">,</span> <span class="number">1</span><span class="gtkdoc opt">,</span>
GRAPHENE_TYPE_POINT<span class="gtkdoc opt">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
<p></p>
</div>
<div class="refsect3">
<a name="id-1.2.21.4.4"></a><h4>Using Graphene via GObject introspection</h4>
<p>When using Graphene with another language than C, the GObject Introspection
bindings change the type names to the CamelCase version of the C name, minus
the <code class="literal">_t</code> suffix; for instance:</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p><a class="link" href="graphene-Point.html#graphene-point-t" title="graphene_point_t"><span class="type">graphene_point_t</span></a> becomes <code class="literal">GraphenePoint</code></p></li>
<li class="listitem"><p><a class="link" href="graphene-Point3D.html#graphene-point3d-t" title="graphene_point3d_t"><span class="type">graphene_point3d_t</span></a> becomes <code class="literal">GraphenePoint3D</code></p></li>
<li class="listitem"><p><a class="link" href="graphene-Rectangle.html#graphene-rect-t" title="graphene_rect_t"><span class="type">graphene_rect_t</span></a> becomes <code class="literal">GrapheneRect</code></p></li>
<li class="listitem"><p><a class="link" href="graphene-Matrix.html#graphene-matrix-t" title="graphene_matrix_t"><span class="type">graphene_matrix_t</span></a> becomes <code class="literal">GrapheneMatrix</code></p></li>
</ul></div>
<p>There is no direct access for the low level <a class="link" href="graphene-SIMD-vector.html#graphene-simd4f-t" title="graphene_simd4f_t"><span class="type">graphene_simd4f_t</span></a> and
<a class="link" href="graphene-SIMD-matrix.html#graphene-simd4x4f-t" title="graphene_simd4x4f_t"><span class="type">graphene_simd4x4f_t</span></a> SIMD types.</p>
</div>
</div>
<div class="refsect1">
<a name="graphene-GObject-integration.functions_details"></a><h2>Functions</h2>
<p></p>
</div>
<div class="refsect1">
<a name="graphene-GObject-integration.other_details"></a><h2>Types and Values</h2>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.27</div>
</body>
</html>
|