File: minput_get_command.3m17n

package info (click to toggle)
m17n-docs 1.6.2-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 22,492 kB
  • sloc: sh: 1,032; javascript: 635; makefile: 406; ansic: 206; perl: 108
file content (191 lines) | stat: -rw-r--r-- 4,434 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
.\" 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".
.TH "minput_get_command" 3m17n "12 Jan 2011" "Version 1.6.2" "The m17n Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
minput_get_command \- Get information about input method command(s). 


.SH SYNOPSIS
\fBMPlist\fP*
\fBminput_get_command\fP (\fBMSymbol\fP
\fIlanguage\fP, \fBMSymbol\fP
\fIname\fP, \fBMSymbol\fP
\fIcommand\fP)


.SH DESCRIPTION
Get information about input method command(s). The
.ft B
minput_get_command()
.ft R
function returns information about the command
.ft B
command
.ft R
of the input method specified by
.ft B
language
.ft R
and
.ft B
name\fP.
.ft R
An input method command is a pseudo key event to which one or more actual input key sequences are assigned.
.PP
There are two kinds of commands, global and local. A global command has a global definition, and the description and the key assignment may be inherited by a local command. Each input method defines a local command which has a local key assignment. It may also declare a local command that inherits the definition of a global command of the same name.
.PP
If
.ft B
language
.ft R
is
.ft B
Mt
.ft R
and
.ft B
name
.ft R
is
.ft B
Mnil\fP,
.ft R
this function returns information about a global command. Otherwise information about a local command is returned.
.PP
If
.ft B
command
.ft R
is
.ft B
Mnil\fP,
.ft R
information about all commands is returned.
.PP
The return value is a
.ft I
well\-formed
.ft R
plist (\fBProperty List\fP) of this format: 
.PP
.nf

  ((NAME DESCRIPTION STATUS [KEYSEQ ...]) ...)

.fi
.fi

.ft C
NAME
.ft R
is a symbol representing the command name.
.PP
\fCDESCRIPTION
.ft R
is an M\-text describing the command, or
.ft B
Mnil
.ft R
if the command has no description.
.PP
\fCSTATUS
.ft R
is a symbol representing how the key assignment is decided. The value is
.ft B
Mnil
.ft R
(the default key assignment),
.ft B
Mcustomized
.ft R
(the key assignment is customized by per\-user customization file), or
.ft B
Mconfigured
.ft R
(the key assignment is set by the call of
.ft B
minput_config_command()\fP). For a local command only, it may also be
.ft B
Minherited
.ft R
(the key assignment is inherited from the corresponding global command).
.PP
\fCKEYSEQ
.ft R
is a plist of one or more symbols representing a key sequence assigned to the command. If there's no KEYSEQ, the command is currently disabled (i.e. no key sequence can trigger actions of the command).
.PP
If
.ft B
command
.ft R
is not
.ft B
Mnil\fP,
.ft R
the first element of the returned plist contains the information about
.ft B
command\fP.
.ft R
.PP
.SH RETURN VALUE
.PP
.RS 4

.RE
.PP
If the requested information was found, a pointer to a non\-empty plist is returned. As the plist is kept in the library, the caller must not modify nor free it.
.PP
Otherwise (the specified input method or the specified command does not exist),
.ft C
NULL
.ft R
is returned.
.PP
.SH Example:
.PP

.RS 4

.PP
.nf
MText *
get_im_command_description (MSymbol language, MSymbol name, MSymbol command)
{
  /* Return a description of the command COMMAND of the input method
     specified by LANGUAGE and NAME.  */
  MPlist *cmd = minput_get_command (langauge, name, command);
  MPlist *plist;

  if (! cmds)
    return NULL;
  plist = mplist_value (cmds);  /* (NAME DESCRIPTION STATUS KEY\-SEQ ...) */
  plist = mplist_next (plist);  /* (DESCRIPTION STATUS KEY\-SEQ ...) */
  return  (mplist_key (plist) == Mtext
           ? (MText *) mplist_value (plist)
           : NULL);
}

.fi
.fi
 
.RE
.PP

.SH COPYRIGHT
Copyright (C) 2001 Information\-technology Promotion Agency (IPA)
.br
Copyright (C) 2001\-2011 National Institute of Advanced Industrial Science and Technology (AIST)
.br
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License 
<http://www.gnu.org/licenses/fdl.html>.