1
<refentry id="pango-Modules">
3
<refentrytitle role="top_of_page" id="pango-Modules.top_of_page">Modules</refentrytitle>
4
<manvolnum>3</manvolnum>
5
<refmiscinfo>PANGO Library</refmiscinfo>
9
<refname>Modules</refname>
10
<refpurpose>Support for loadable modules</refpurpose>
13
<refsynopsisdiv id="pango-Modules.synopsis" role="synopsis">
14
<title role="synopsis.title">Synopsis</title>
17
<link linkend="PangoIncludedModule">PangoIncludedModule</link>;
18
<link linkend="PangoMap">PangoMap</link>;
19
<link linkend="PangoMapEntry">PangoMapEntry</link>;
20
<link linkend="PangoMap">PangoMap</link> * <link linkend="pango-find-map">pango_find_map</link> (<link linkend="PangoLanguage">PangoLanguage</link> *language,
21
<link linkend="guint">guint</link> engine_type_id,
22
<link linkend="guint">guint</link> render_type_id);
23
<link linkend="PangoEngine">PangoEngine</link> * <link linkend="pango-map-get-engine">pango_map_get_engine</link> (<link linkend="PangoMap">PangoMap</link> *map,
24
<link linkend="PangoScript">PangoScript</link> script);
25
<link linkend="void">void</link> <link linkend="pango-map-get-engines">pango_map_get_engines</link> (<link linkend="PangoMap">PangoMap</link> *map,
26
<link linkend="PangoScript">PangoScript</link> script,
27
<link linkend="GSList">GSList</link> **exact_engines,
28
<link linkend="GSList">GSList</link> **fallback_engines);
29
<link linkend="void">void</link> <link linkend="pango-module-register">pango_module_register</link> (<link linkend="PangoIncludedModule">PangoIncludedModule</link> *module);
41
<refsect1 id="pango-Modules.description" role="desc">
42
<title role="desc.title">Description</title>
44
Functions and macros in this section are used to support loading dynamic
45
modules that add engines to Pango at run time.
49
<refsect1 id="pango-Modules.details" role="details">
50
<title role="details.title">Details</title>
51
<refsect2 id="PangoIncludedModule" role="struct">
52
<title>PangoIncludedModule</title>
53
<indexterm zone="PangoIncludedModule"><primary sortas="PangoIncludedModule">PangoIncludedModule</primary></indexterm><programlisting>typedef struct {
54
void (*list) (PangoEngineInfo **engines,
56
void (*init) (GTypeModule *module);
58
PangoEngine *(*create) (const char *id);
59
} PangoIncludedModule;
62
The <link linkend="PangoIncludedModule"><type>PangoIncludedModule</type></link> structure for a statically linked module
63
contains the functions that would otherwise be loaded from a dynamically
65
</para><variablelist role="struct">
67
<term><structfield>list</structfield> ()</term>
68
<listitem><simpara>a function that lists the engines defined in this module.
72
<term><structfield>init</structfield> ()</term>
73
<listitem><simpara>a function to initialize the module.
77
<term><structfield>exit</structfield> ()</term>
78
<listitem><simpara>a function to finalize the module.
82
<term><structfield>create</structfield> ()</term>
83
<listitem><simpara>a function to create an engine, given the engine name.
86
</variablelist></refsect2>
87
<refsect2 id="PangoMap" role="struct">
88
<title>PangoMap</title>
89
<indexterm zone="PangoMap"><primary sortas="PangoMap">PangoMap</primary></indexterm><programlisting>typedef struct _PangoMap PangoMap;</programlisting>
91
A <link linkend="PangoMap"><type>PangoMap</type></link> structure can be used to determine the engine to
92
use for each character.
94
<refsect2 id="PangoMapEntry" role="struct">
95
<title>PangoMapEntry</title>
96
<indexterm zone="PangoMapEntry"><primary sortas="PangoMapEntry">PangoMapEntry</primary></indexterm><programlisting>typedef struct _PangoMapEntry PangoMapEntry;</programlisting>
98
A <link linkend="PangoMapEntry"><type>PangoMapEntry</type></link> contains information about the engine that should be used
99
for the codepoint to which this entry belongs and also whether the engine
100
matches the language tag for this entry's map exactly or just approximately.
102
<refsect2 id="pango-find-map" role="function">
103
<title>pango_find_map ()</title>
104
<indexterm zone="pango-find-map"><primary sortas="pango_find_map">pango_find_map</primary></indexterm><programlisting><link linkend="PangoMap">PangoMap</link> * pango_find_map (<link linkend="PangoLanguage">PangoLanguage</link> *language,
105
<link linkend="guint">guint</link> engine_type_id,
106
<link linkend="guint">guint</link> render_type_id);</programlisting>
108
Locate a <link linkend="PangoMap"><type>PangoMap</type></link> for a particular engine type and render
109
type. The resulting map can be used to determine the engine
110
for each character.</para>
112
</para><variablelist role="params">
113
<varlistentry><term><parameter>language</parameter> :</term>
114
<listitem><simpara> the language tag for which to find the map
115
</simpara></listitem></varlistentry>
116
<varlistentry><term><parameter>engine_type_id</parameter> :</term>
117
<listitem><simpara> the engine type for the map to find
118
</simpara></listitem></varlistentry>
119
<varlistentry><term><parameter>render_type_id</parameter> :</term>
120
<listitem><simpara> the render type for the map to find
121
</simpara></listitem></varlistentry>
122
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the suitable <link linkend="PangoMap"><type>PangoMap</type></link>.
123
</simpara></listitem></varlistentry>
124
</variablelist></refsect2>
125
<refsect2 id="pango-map-get-engine" role="function">
126
<title>pango_map_get_engine ()</title>
127
<indexterm zone="pango-map-get-engine"><primary sortas="pango_map_get_engine">pango_map_get_engine</primary></indexterm><programlisting><link linkend="PangoEngine">PangoEngine</link> * pango_map_get_engine (<link linkend="PangoMap">PangoMap</link> *map,
128
<link linkend="PangoScript">PangoScript</link> script);</programlisting>
130
Returns the best engine listed in the map for a given script</para>
132
</para><variablelist role="params">
133
<varlistentry><term><parameter>map</parameter> :</term>
134
<listitem><simpara> a <link linkend="PangoMap"><type>PangoMap</type></link>
135
</simpara></listitem></varlistentry>
136
<varlistentry><term><parameter>script</parameter> :</term>
137
<listitem><simpara> a <link linkend="PangoScript"><type>PangoScript</type></link>
138
</simpara></listitem></varlistentry>
139
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the best engine, if one is listed for the script,
140
or <link linkend="NULL--CAPS"><literal>NULL</literal></link>. The lookup may cause the engine to be loaded;
141
once an engine is loaded, it won't be unloaded. If multiple
142
engines are exact for the script, the choice of which is
143
returned is arbitrary.
144
</simpara></listitem></varlistentry>
145
</variablelist></refsect2>
146
<refsect2 id="pango-map-get-engines" role="function" condition="since:1.4">
147
<title>pango_map_get_engines ()</title>
148
<indexterm zone="pango-map-get-engines" role="1.4"><primary sortas="pango_map_get_engines">pango_map_get_engines</primary></indexterm><programlisting><link linkend="void">void</link> pango_map_get_engines (<link linkend="PangoMap">PangoMap</link> *map,
149
<link linkend="PangoScript">PangoScript</link> script,
150
<link linkend="GSList">GSList</link> **exact_engines,
151
<link linkend="GSList">GSList</link> **fallback_engines);</programlisting>
153
Finds engines in the map that handle the given script. The returned
154
lists should be freed with g_slist_free, but the engines in the
155
lists are owned by GLib and will be kept around permanently, so
156
they should not be unref'ed.</para>
158
</para><variablelist role="params">
159
<varlistentry><term><parameter>map</parameter> :</term>
160
<listitem><simpara> a <link linkend="PangoMap"><type>PangoMap</type></link>
161
</simpara></listitem></varlistentry>
162
<varlistentry><term><parameter>script</parameter> :</term>
163
<listitem><simpara> a <link linkend="PangoScript"><type>PangoScript</type></link>
164
</simpara></listitem></varlistentry>
165
<varlistentry><term><parameter>exact_engines</parameter> :</term>
166
<listitem><simpara> location to store list of engines that exactly
168
</simpara></listitem></varlistentry>
169
<varlistentry><term><parameter>fallback_engines</parameter> :</term>
170
<listitem><simpara> location to store list of engines that approximately
172
</simpara></listitem></varlistentry>
173
</variablelist><para role="since">Since 1.4</para></refsect2>
174
<refsect2 id="pango-module-register" role="function">
175
<title>pango_module_register ()</title>
176
<indexterm zone="pango-module-register"><primary sortas="pango_module_register">pango_module_register</primary></indexterm><programlisting><link linkend="void">void</link> pango_module_register (<link linkend="PangoIncludedModule">PangoIncludedModule</link> *module);</programlisting>
178
Registers a statically linked module with Pango. The
179
<link linkend="PangoIncludedModule"><type>PangoIncludedModule</type></link> structure that is passed in contains the
180
functions that would otherwise be loaded from a dynamically loaded
183
</para><variablelist role="params">
184
<varlistentry><term><parameter>module</parameter> :</term>
185
<listitem><simpara> a <link linkend="PangoIncludedModule"><type>PangoIncludedModule</type></link>
186
</simpara></listitem></varlistentry>
187
</variablelist></refsect2>