OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [MW_0_8_9PRE7/] [mw/] [src/] [demos/] [nxscribble/] [hre_api_internal.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 673 markom
/*
2
 *  hre_api_internal.h: API functions, used by internal clients also.
3
 *  Author:           James Kempf
4
 *  Created On:       Tue Jan 12 12:52:27 1993
5
 *  Last Modified By: James Kempf
6
 *  Last Modified On: Fri Sep 23 13:50:48 1994
7
 *  Update Count:     33
8
 *  Copyright (c) 1994 by Sun Microsystems Computer Company
9
 *  All rights reserved.
10
 *
11
 *  Use and copying of this software and preparation of
12
 *  derivative works based upon this software are permitted.
13
 *  Any distribution of this software or derivative works
14
 *  must comply with all applicable United States export control
15
 *  laws.
16
 *
17
 *  This software is made available as is, and Sun Microsystems
18
 *  Computer Company makes no warranty about the software, its
19
 *  performance, or its conformity to any specification
20
 */
21
 
22
#ifndef _HRE_API_INTERNAL_H_
23
 
24
#define _HRE_API_INTERNAL_H_
25
 
26
/*Need structs for return types.*/
27
 
28
#include <hre.h>
29
 
30
/*
31
 * ADMINISTRATION
32
*/
33
 
34
/*
35
 * recognizer_load - If directory is not NULL, then use it as a pathname
36
 * to find the recognizer. Otherwise, use the default naming conventions
37
 * to find the recognizer having file name name. The subset argument
38
 * contains a null-terminated array of names for character subsets which
39
 * the recognizer should translate.
40
*/
41
 
42
recognizer
43
recognizer_load(char* directory,char* name,char** subset);
44
 
45
/*
46
 * recognizer_unload - Unload the recognizer.
47
*/
48
 
49
int
50
recognizer_unload(recognizer rec);
51
 
52
/*
53
 * recognizer_get_info-Get a pointer to a rec_info
54
 * giving the locale and subsets supported by the recognizer, and shared
55
 * library pathname.
56
*/
57
 
58
const rec_info*
59
recognizer_get_info(recognizer rec);
60
 
61
 
62
/*
63
 * recognizer_manager_version-Return the version number string of the
64
 * recognition manager.
65
*/
66
 
67
const char* recognizer_manager_version(recognizer rec);
68
 
69
/*
70
 * recognizer_load_state-Get any recognizer state associated with name
71
 * in dir. Note that name may not be simple file name, since
72
 * there may be more than one file involved. Return 0 if successful,
73
 * -1 if not.
74
*/
75
 
76
int
77
recognizer_load_state(recognizer rec,char* dir,char* name);
78
 
79
/*
80
 * recognizer_save_state-Save any recognizer state to name
81
 * in dir. Note that name may not be a simple file name, since
82
 * there may be more than one file involved. Return 0 if successful,
83
 * -1 if not.
84
*/
85
 
86
int
87
recognizer_save_state(recognizer rec,char* dir,char* name);
88
 
89
/*
90
 * recognizer_error-Return the last error message, or NULL if none.
91
*/
92
 
93
char*
94
recognizer_error(recognizer rec);
95
 
96
/*
97
 * DICTIONARIES
98
*/
99
 
100
/* recognizer_load_dictionary-Load a dictionary from the directory
101
 * dir and file name. Return the dictionary pointer if successful,
102
 * otherwise NULL.
103
*/
104
 
105
wordset
106
recognizer_load_dictionary(recognizer rec,char* directory,char* name);
107
 
108
/* recoginzer_save_dictionary-Save the dictionary to the file. Return 0
109
 * successful, -1 if error occurs.
110
*/
111
 
112
int
113
recognizer_save_dictionary(recognizer rec,char* dir,char* name,wordset dict);
114
 
115
/*
116
 * recognizer_free_dictionary-Free the dictionary. Return 0 if successful,
117
 * -1 if error occurs.
118
*/
119
 
120
int
121
recognizer_free_dictionary(recognizer rec,wordset dict);
122
 
123
/*
124
 * recognizer_add_to_dictionary-Add the word to the dictionary. Return 0
125
 * if successful, -1 if error occurs.
126
*/
127
 
128
int
129
recognizer_add_to_dictionary(recognizer rec,letterset* word,wordset dict);
130
 
131
/*
132
 * recognizer_delete_from_dictionary-Delete the word from the dictionary.
133
 * Return 0 if successful, -1 if error occurs.
134
*/
135
 
136
int
137
recognizer_delete_from_dictionary(recognizer rec,letterset* word,wordset dict);
138
 
139
/*
140
 * TRANSLATION
141
*/
142
 
143
/* recognizer_set/get_context - Set/get the recognition context for
144
 * subsequent buffering and translation. recognizer_set_context()
145
 * returns -1 if an error occurs, otherwise 0. recognizer_get_context()
146
 * returns NULL if no context has been set. The context is copied to avoid
147
 * potential memory deallocation problems.
148
*/
149
 
150
int
151
recognizer_set_context(recognizer rec,rc* rec_xt);
152
rc*
153
recognizer_get_context(recognizer rec);
154
 
155
/* recognizer_clear - Set stroke buffer to NULL and clear the context.
156
 * Returns -1 if an error occurred, otherwise 0. Both the context and the
157
 * stroke buffer are deallocated. If delete_points_p is true, delete the
158
 * points also.
159
*/
160
 
161
int
162
recognizer_clear(recognizer rec,bool delete_points_p);
163
 
164
/* recognizer_get/set_buffer - Get/set the stroke buffer. The stroke buffer
165
 * is copied to avoid potential memory allocation problems. Returns -1 if
166
 * an error occurs, otherwise 0.
167
*/
168
 
169
int
170
 recognizer_get_buffer(recognizer rec, u_int* nstrokes,pen_stroke** strokes);
171
 
172
int
173
recognizer_set_buffer(recognizer rec,u_int nstrokes,pen_stroke* strokes);
174
 
175
/* recognizer_translate - Copy the strokes argument into the stroke buffer and
176
 * translate the buffer. If correlate_p is true, then provide stroke
177
 * correlations as well. If either nstrokes is 0 or strokes is NULL, then
178
 * just translate the stroke buffer and return the translation. Return an
179
 * array of alternative translation segmentations in the ret pointer and the
180
 * number of alternatives in nret, or NULL and 0 if there is no translation.
181
 * The direction of segmentation is as specified by the rc_direction field in
182
 * the buffered recognition context. Returns -1 if an error occurred,
183
 * otherwise 0.
184
*/
185
 
186
int
187
recognizer_translate(recognizer rec,
188
                     u_int nstrokes,
189
                     pen_stroke* strokes,
190
                     bool correlate_p,
191
                     int* nret,
192
                     rec_alternative** ret);
193
 
194
/*
195
 * recognizer_get_extension_functions-Return a null terminated array
196
 * of functions providing extended functionality. Their interfaces
197
 * will change depending on the recognizer.
198
*/
199
 
200
rec_fn*
201
recognizer_get_extension_functions(recognizer rec);
202
 
203
 
204
/*
205
 * GESTURE SUPPORT
206
*/
207
 
208
/*
209
 * recognizer_get_gesture_names - Return a null terminated array of
210
 * character strings containing the gesture names.
211
*/
212
 
213
char**
214
recognizer_get_gesture_names(recognizer rec);
215
 
216
/*
217
 * recognizer_set_gesture_action-Set the action function associated with the
218
 *  name.
219
*/
220
 
221
xgesture
222
recognizer_set_gesture_action(recognizer rec,
223
                              char* name,
224
                              xgesture fn,
225
                              void* wsinof);
226
 
227
/*
228
 * The following functions are for deleting data structures returned
229
 *   by the API functions.
230
*/
231
 
232
 
233
void
234
delete_rec_alternative_array(u_int nalter,
235
                             rec_alternative* ra,
236
                             bool delete_points_p);
237
 
238
void
239
delete_rec_correlation(rec_correlation* corr,
240
                       bool delete_points_p);
241
 
242
/*
243
 * These are used by clients to create arrays for passing to API
244
 *  functions.
245
*/
246
 
247
pen_stroke*
248
make_pen_stroke_array(u_int size);
249
pen_stroke*
250
initialize_pen_stroke(pen_stroke* ps,
251
                      u_int npts,
252
                      pen_point* pts,
253
                      u_int nstate,
254
                      u_int* trans,
255
                      pen_state* state);
256
void
257
delete_pen_stroke_array(u_int size,pen_stroke* ps,bool delete_points_p);
258
 
259
pen_point*
260
make_pen_point_array(u_int size);
261
void
262
delete_pen_point_array(pen_point* pp);
263
 
264
pen_stroke*
265
copy_pen_stroke_array(u_int nstrokes,pen_stroke* strokes);
266
pen_state*
267
copy_pen_state_array(u_int nstate,pen_state* state);
268
u_int*
269
copy_state_trans_array(u_int ntrans,u_int* trans);
270
 
271
pen_state*
272
make_pen_state_array(u_int size);
273
pen_state*
274
initialize_pen_state(pen_state* ps,
275
                     u_short button,
276
                     u_short pen,
277
                     short pressure,
278
                     double anglex,
279
                     double angley,
280
                     double barrelrotate);
281
void
282
delete_pen_state_array(pen_state* ps);
283
 
284
#endif
285
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.