File: m17nExProg.html

package info (click to toggle)
m17n-docs 1.6.2-2.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 22,492 kB
  • sloc: sh: 1,032; javascript: 635; makefile: 406; ansic: 206; perl: 108
file content (391 lines) | stat: -rw-r--r-- 15,003 bytes parent folder | download | duplicates (3)
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>The m17n Library: Sample Programs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="contents">


<h1><a class="anchor" id="m17nExProg">Sample Programs </a></h1><p>This section describes these example programs. They are to demonstrate the usage of the m17n library, not for practical use.</p>
<ul>
<li>
<a class="el" href="m17nExProg.html#m17n-conv">m17n-conv</a> -- convert file code </li>
<li>
<a class="el" href="m17nExProg.html#m17n-view">m17n-view</a> -- view file </li>
<li>
<a class="el" href="m17nExProg.html#m17n-date">m17n-date</a> -- display date and time </li>
<li>
<a class="el" href="m17nExProg.html#m17n-dump">m17n-dump</a> -- dump text image </li>
<li>
<a class="el" href="m17nExProg.html#m17n-edit">m17n-edit</a> -- edit multilingual text </li>
<li>
<a class="el" href="m17nExProg.html#mimx-anthy">mimx-anthy</a> -- external module for the input method &lt;ja, anthy&gt; </li>
<li>
<a class="el" href="m17nExProg.html#mimx-ispell">mimx-ispell</a> -- external module for the input method &lt;en, ispell&gt; </li>
</ul>
<h2><a class="anchor" id="m17n-conv">
m17n-conv -- convert file code</a></h2>
<h3><a class="anchor" id="m17n-conv-synopsis">
SYNOPSIS</a></h3>
<p>m17n-conv [ OPTION ... ] [ INFILE [ OUTFILE ] ]</p>
<h3><a class="anchor" id="m17n-conv-description">
DESCRIPTION</a></h3>
<p>Convert encoding of given files from one to another.</p>
<p>If INFILE is omitted, the input is taken from standard input. If OUTFILE is omitted, the output written to standard output.</p>
<p>The following OPTIONs are available.</p>
<ul>
<li>
<p class="startli">-f FROMCODE</p>
<p>FROMCODE is the encoding of INFILE (defaults to UTF-8).</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-t TOCODE</p>
<p>TOCODE is the encoding of OUTFILE (defaults to UTF-8).</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-k</p>
<p>Do not stop conversion on error.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-s</p>
<p>Suppress warnings.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-v</p>
<p>Print progress information.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-l</p>
<p>List available encodings.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">--version</p>
<p>Print version number.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-h, --help</p>
<p>Print this message.</p>
<p class="endli"></p>
</li>
</ul>
<h2><a class="anchor" id="m17n-view">
m17n-view -- view file</a></h2>
<h3><a class="anchor" id="m17n-view-synopsis">
SYNOPSIS</a></h3>
<p>m17n-view [ XT-OPTION ...] [ OPTION ... ] [ FILE ]</p>
<h3><a class="anchor" id="m17n-view-description">
DESCRIPTION</a></h3>
<p>Display FILE on a window.</p>
<p>If FILE is omitted, the input is taken from standard input.</p>
<p>XT-OPTIONs are standard Xt arguments (e.g. -fn, -fg).</p>
<p>The following OPTIONs are available.</p>
<ul>
<li>
<p class="startli">-e ENCODING</p>
<p>ENCODING is the encoding of FILE (defaults to UTF-8).</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-s FONTSIZE</p>
<p>FONTSIZE is the fontsize in point. If omitted, it defaults to the size of the default font defined in X resource.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">--version</p>
<p>Print version number.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-h, --help</p>
<p>Print this message.</p>
<p class="endli"></p>
</li>
</ul>
<h2><a class="anchor" id="m17n-date">
m17n-date -- display date and time</a></h2>
<h3><a class="anchor" id="m17n-date-synopsis">
SYNOPSIS</a></h3>
<p>m17n-date [ OPTION ... ]</p>
<h3><a class="anchor" id="m17n-date-description">
DESCRIPTION</a></h3>
<p>Display the system date and time in many locales on a window.</p>
<p>The following OPTIONs are available.</p>
<ul>
<li>
<p class="startli">--version</p>
<p>Print version number.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-h, --help</p>
<p class="endli">Print this message. </p>
</li>
</ul>
<h2><a class="anchor" id="m17n-dump">
m17n-dump -- dump text image</a></h2>
<h3><a class="anchor" id="m17n-dump-synopsis">
SYNOPSIS</a></h3>
<p>m17n-dump [ OPTION ... ] [ FILE ]</p>
<h3><a class="anchor" id="m17n-dump-description">
DESCRIPTION</a></h3>
<p>Dump a text as PNG image file.</p>
<p>The PNG file is written to a file created in the current directory with the name "BASE.png" where BASE is the basename of FILE. If FILE is omitted, text is read from standard input, and the image is dumped into the file "output.png".</p>
<p>The following OPTIONs are available.</p>
<ul>
<li>
<p class="startli">-s SIZE</p>
<p>SIZE is the font size in point. The default font size is 12 point.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-d DPI</p>
<p>DPI is the resolution in dots per inch. The default resolution is 300 dpi.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-p PAPER</p>
<p>PAPER is the paper size: a4, a4r, a5, a5r, b5, b5r, letter, WxH, or W. In the case of WxH, W and H are the width and height in millimeter. In the case of W, W is the width in millimeter. If this option is specified, PAPER limits the image size. If FILE is too large for a single page, multiple files with the names "BASE.01.png", "BASE.02.png", etc. are created.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-m MARGIN</p>
<p>MARGIN is the horizontal and vertical margin in millimeter. The default margin is 20 mm. It is ignored when PAPER is not specified.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-c POS</p>
<p>POS is the character position of cursor to draw. By default, cursor is not drawn.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-x</p>
<p>FILE is assumed to be an XML file generated by the serialize facility of the m17n library, and FILE is deserialized before an image is created.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-w</p>
<p>Each line is broken at word boundary.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-f FILTER</p>
<p>FILTER is a string containing a shell command line. If this option is specified, the PNG image is not written info a file but is given to FILTER as standard input. If FILTER contains "%s", that part is replaced by a basename of FILE. So, the default behaviour is the same as specifying "cat &gt;
    %s.png" as FILTER.</p>
<p>If FILTER is just "-", the PNG image is written to stdout.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-a</p>
<p>Enable anti-alias drawing.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">--family FAMILY</p>
<p>Prefer a font whose family name is FAMILY.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">--language LANG</p>
<p>Prefer a font specified for the language LANG. LANG must be a 2-letter code of ISO 630 (e.g. "en" for English).</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-fg FOREGROUND</p>
<p>Specify the text color. The supported color names are those of HTML 4.0 and "#RRGGBB" notation.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-bg BACKGROUND</p>
<p>Specify the background color. The supported color names are the same as FOREGROUND, except that if "transparent" is specified, make the background transparent.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-r</p>
<p>Specify that the orientation of the text is right-to-left.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-q</p>
<p>Quiet mode. Don't print any messages.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">--version</p>
<p>Print the version number.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-h, --help</p>
<p>Print this message.</p>
<p class="endli"></p>
</li>
</ul>
<h2><a class="anchor" id="m17n-edit">
m17n-edit -- edit multilingual text</a></h2>
<h3><a class="anchor" id="m17n-edit-synopsis">
SYNOPSIS</a></h3>
<p>m17n-edit [ XT-OPTION ...] [ OPTION ... ] FILE</p>
<h3><a class="anchor" id="m17n-edit-description">
DESCRIPTION</a></h3>
<p>Display FILE on a window and allow users to edit it.</p>
<p>XT-OPTIONs are standard Xt arguments (e.g. -fn, -fg).</p>
<p>The following OPTIONs are available.</p>
<ul>
<li>
<p class="startli">--version</p>
<p>Print version number.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">-h, --help</p>
<p>Print this message.</p>
<p class="endli"></p>
</li>
</ul>
<p>This program is to demonstrate how to use the m17n GUI API. Although m17n-edit directly uses the GUI API, the API is mainly for toolkit libraries or to implement XOM (X Output Method), not for direct use from application programs.</p>
<h2><a class="anchor" id="mimx-anthy">
mimx-anthy -- external module for the input method &lt;ja, anthy&gt;</a></h2>
<h3><a class="anchor" id="mimx-anthy-description">
DESCRIPTION</a></h3>
<p>The shared library mimx-anthy.so is an external module used by the input method &lt;ja, anthy&gt;. It exports these functions.</p>
<ul>
<li>
<p class="startli">init</p>
<p>Initialize this module.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">fini</p>
<p>Finalize this module.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">convert</p>
<p>Convert the current preedit text (Hiragana sequence) into Kana-Kanji mixed text.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">change</p>
<p>Record the change of candidate of the current segment.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">resize</p>
<p>Enlarge or shorten the length of the current segment.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">commit</p>
<p>Commit the lastly selected candidates of all the segments.</p>
<p class="endli"></p>
</li>
</ul>
<h3><a class="anchor" id="mimx-anthy-seealso">
See also</a></h3>
<p><a class="el" href="m17nDBFormat.html#mdbIM">Input Method</a></p>
<h2><a class="anchor" id="mimx-ispell">
mimx-ispell -- external module for the input method &lt;en, ispell&gt;</a></h2>
<h3><a class="anchor" id="mimx-ispell-description">
DESCRIPTION</a></h3>
<p>The shared library mimx-ispell.so is an external module used by the input method &lt;en, ispell&gt;. It exports these functions.</p>
<ul>
<li>
<p class="startli">init</p>
<p>Initialize this library.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">fini</p>
<p>Finalize this library.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">ispell_word</p>
<p>Check the spell of the current preedit text (English) and, if the spell is incorrect, return a list of candidates.</p>
<p class="endli"></p>
</li>
</ul>
<p>This program is just for demonstrating how to write an external module for an m17n input method, not for an actual use.</p>
<h3><a class="anchor" id="mimx-ispell-seealso">
See also</a></h3>
<p><a class="el" href="m17nDBFormat.html#mdbIM">Input Method</a> </p>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr>

<ADDRESS>
<a href="http://www.m17n.org/m17n-lib-en/index.html" target="mulewindow"><img src="parrot.png" align=bottom alt="m17n-lib Home" border=0></a>
</ADDRESS>
</body>
</HTML>

<!-- Copyright information

Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011
  National Institute of Advanced Industrial Science and Technology (AIST)

This file is part of the m17n library documentation.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Section, no Front-Cover Texts,
and no Back-Cover Texts.  A copy of the license is included in the
appendix entitled "GNU Free Documentation License".
-->