• Home
  • Raw
  • Download

Lines Matching +full:fill +full:- +full:range

1 /* sane - Scanner Access Now Easy.
40 ** Sane.c - Native methods for the SANE Java API.
42 ** Written: 10/9/97 - JSF
63 jint *versionCodeBody; /* Gets ->array. */ in Java_Sane_init()
68 len = (*env)->GetArrayLength(env, versionCode); in Java_Sane_init()
69 versionCodeBody = (*env)->GetIntArrayElements(env, versionCode, 0); in Java_Sane_init()
72 (*env)->ReleaseIntArrayElements(env, versionCode, versionCodeBody, 0); in Java_Sane_init()
109 devListLen = (*env)->GetArrayLength(env, devList); in Java_Sane_getDevicesNative()
111 for (i = 0; i < devListLen - 1 && device_list[i]; i++) in Java_Sane_getDevicesNative()
114 devObj = (*env)->GetObjectArrayElement(env, devList, i); in Java_Sane_getDevicesNative()
115 devClass = (*env)->GetObjectClass(env, devObj); in Java_Sane_getDevicesNative()
116 /* Fill in each member. */ in Java_Sane_getDevicesNative()
117 fid = (*env)->GetFieldID(env, devClass, "name", in Java_Sane_getDevicesNative()
119 (*env)->SetObjectField(env, devObj, fid, in Java_Sane_getDevicesNative()
120 (*env)->NewStringUTF(env, device_list[i]->name)); in Java_Sane_getDevicesNative()
121 fid = (*env)->GetFieldID(env, devClass, "vendor", in Java_Sane_getDevicesNative()
123 (*env)->SetObjectField(env, devObj, fid, in Java_Sane_getDevicesNative()
124 (*env)->NewStringUTF(env, device_list[i]->vendor)); in Java_Sane_getDevicesNative()
125 fid = (*env)->GetFieldID(env, devClass, "model", in Java_Sane_getDevicesNative()
127 (*env)->SetObjectField(env, devObj, fid, in Java_Sane_getDevicesNative()
128 (*env)->NewStringUTF(env, device_list[i]->model)); in Java_Sane_getDevicesNative()
129 fid = (*env)->GetFieldID(env, devClass, "type", in Java_Sane_getDevicesNative()
131 (*env)->SetObjectField(env, devObj, fid, in Java_Sane_getDevicesNative()
132 (*env)->NewStringUTF(env, device_list[i]->type)); in Java_Sane_getDevicesNative()
135 (*env)->SetObjectArrayElement(env, devList, i, 0); in Java_Sane_getDevicesNative()
152 device_name = (*env)->GetStringUTFChars(env, deviceName, 0); in Java_Sane_open()
155 (*env)->ReleaseStringUTFChars(env, deviceName, device_name); in Java_Sane_open()
158 (*env)->SetIntArrayRegion(env, handle, 0, 1, &s_handle); in Java_Sane_open()
189 optClass = (*env)->GetObjectClass(env, optObj); in Java_Sane_getOptionNative()
190 /* Fill in each member. */ in Java_Sane_getOptionNative()
191 fid = (*env)->GetFieldID(env, optClass, "name", "Ljava/lang/String;"); in Java_Sane_getOptionNative()
194 (*env)->SetObjectField(env, optObj, fid, 0); in Java_Sane_getOptionNative()
198 (*env)->SetObjectField(env, optObj, fid, in Java_Sane_getOptionNative()
199 (*env)->NewStringUTF(env, sopt->name)); in Java_Sane_getOptionNative()
201 fid = (*env)->GetFieldID(env, optClass, "title", "Ljava/lang/String;"); in Java_Sane_getOptionNative()
202 str = sopt->title ? (*env)->NewStringUTF(env, sopt->title) : 0; in Java_Sane_getOptionNative()
203 (*env)->SetObjectField(env, optObj, fid, str); in Java_Sane_getOptionNative()
205 fid = (*env)->GetFieldID(env, optClass, "desc", "Ljava/lang/String;"); in Java_Sane_getOptionNative()
206 (*env)->SetObjectField(env, optObj, fid, in Java_Sane_getOptionNative()
207 (*env)->NewStringUTF(env, sopt->desc)); in Java_Sane_getOptionNative()
209 fid = (*env)->GetFieldID(env, optClass, "type", "I"); in Java_Sane_getOptionNative()
210 (*env)->SetIntField(env, optObj, fid, sopt->type); in Java_Sane_getOptionNative()
212 fid = (*env)->GetFieldID(env, optClass, "unit", "I"); in Java_Sane_getOptionNative()
213 (*env)->SetIntField(env, optObj, fid, sopt->unit); in Java_Sane_getOptionNative()
215 fid = (*env)->GetFieldID(env, optClass, "size", "I"); in Java_Sane_getOptionNative()
216 (*env)->SetIntField(env, optObj, fid, sopt->size); in Java_Sane_getOptionNative()
218 fid = (*env)->GetFieldID(env, optClass, "cap", "I"); in Java_Sane_getOptionNative()
219 (*env)->SetIntField(env, optObj, fid, sopt->cap); in Java_Sane_getOptionNative()
221 fid = (*env)->GetFieldID(env, optClass, "constraintType", "I"); in Java_Sane_getOptionNative()
222 (*env)->SetIntField(env, optObj, fid, sopt->constraint_type); in Java_Sane_getOptionNative()
226 if (sopt->constraint_type == SANE_CONSTRAINT_RANGE) in Java_Sane_getOptionNative()
228 /* Create range object. */ in Java_Sane_getOptionNative()
229 jclass rangeClass = (*env)->FindClass(env, "SaneRange"); in Java_Sane_getOptionNative()
230 jobject range = (*env)->AllocObject(env, rangeClass); in Java_Sane_getOptionNative() local
231 /* Fill in fields. */ in Java_Sane_getOptionNative()
232 fid = (*env)->GetFieldID(env, rangeClass, "min", "I"); in Java_Sane_getOptionNative()
233 (*env)->SetIntField(env, range, fid, in Java_Sane_getOptionNative()
234 sopt->constraint.range->min); in Java_Sane_getOptionNative()
235 fid = (*env)->GetFieldID(env, rangeClass, "max", "I"); in Java_Sane_getOptionNative()
236 (*env)->SetIntField(env, range, fid, in Java_Sane_getOptionNative()
237 sopt->constraint.range->max); in Java_Sane_getOptionNative()
238 fid = (*env)->GetFieldID(env, rangeClass, "quant", "I"); in Java_Sane_getOptionNative()
239 (*env)->SetIntField(env, range, fid, in Java_Sane_getOptionNative()
240 sopt->constraint.range->quant); in Java_Sane_getOptionNative()
241 fid = (*env)->GetFieldID(env, optClass, "rangeConstraint", in Java_Sane_getOptionNative()
243 /* Store range. */ in Java_Sane_getOptionNative()
244 (*env)->SetObjectField(env, optObj, fid, range); in Java_Sane_getOptionNative()
246 else if (sopt->constraint_type == SANE_CONSTRAINT_WORD_LIST) in Java_Sane_getOptionNative()
252 wordList = (*env)->NewIntArray(env, in Java_Sane_getOptionNative()
253 sopt->constraint.word_list[0]); in Java_Sane_getOptionNative()
255 elements = (*env)->GetIntArrayElements(env, wordList, 0); in Java_Sane_getOptionNative()
256 for (i = 0; i < sopt->constraint.word_list[0]; i++) in Java_Sane_getOptionNative()
257 elements[i] = sopt->constraint.word_list[i]; in Java_Sane_getOptionNative()
258 (*env)->ReleaseIntArrayElements(env, wordList, elements, 0); in Java_Sane_getOptionNative()
260 fid = (*env)->GetFieldID(env, optClass, "wordListConstraint", in Java_Sane_getOptionNative()
262 (*env)->SetObjectField(env, optObj, fid, wordList); in Java_Sane_getOptionNative()
264 else if (sopt->constraint_type == SANE_CONSTRAINT_STRING_LIST) in Java_Sane_getOptionNative()
266 jclass stringClass = (*env)->FindClass(env, "java/lang/String"); in Java_Sane_getOptionNative()
271 for (len = 0; sopt->constraint.string_list[len]; len++) in Java_Sane_getOptionNative()
273 stringList = (*env)->NewObjectArray(env, len + 1, in Java_Sane_getOptionNative()
278 (*env)->SetObjectArrayElement(env, stringList, i, in Java_Sane_getOptionNative()
279 (*env)->NewStringUTF(env, in Java_Sane_getOptionNative()
280 sopt->constraint.string_list[i])); in Java_Sane_getOptionNative()
283 (*env)->SetObjectArrayElement(env, stringList, len, 0); in Java_Sane_getOptionNative()
285 fid = (*env)->GetFieldID(env, optClass, in Java_Sane_getOptionNative()
287 (*env)->SetObjectField(env, optObj, fid, stringList); in Java_Sane_getOptionNative()
307 (*env)->SetIntArrayRegion(env, value, 0, 1, &v); in Java_Sane_getControlOption__II_3I_3I()
309 (*env)->SetIntArrayRegion(env, info, 0, 1, &i); in Java_Sane_getControlOption__II_3I_3I()
326 str = (*env)->GetByteArrayElements(env, value, 0); in Java_Sane_getControlOption__II_3B_3I()
329 (*env)->ReleaseByteArrayElements(env, value, str, 0); in Java_Sane_getControlOption__II_3B_3I()
331 (*env)->SetIntArrayRegion(env, info, 0, 1, &i); in Java_Sane_getControlOption__II_3B_3I()
349 (*env)->SetIntArrayRegion(env, info, 0, 1, &i); in Java_Sane_setControlOption__IIII_3I()
366 return ((int) (ptr - str)); in String_length()
384 valuep = (*env)->GetStringUTFChars(env, value, 0); in Java_Sane_setControlOption__IIILjava_lang_String_2_3I()
387 len = sizeof(buf) - 1; in Java_Sane_setControlOption__IIILjava_lang_String_2_3I()
389 buf[len] = 0; /* Insure it's 0-delimited. */ in Java_Sane_setControlOption__IIILjava_lang_String_2_3I()
393 (*env)->ReleaseStringUTFChars(env, value, valuep); in Java_Sane_setControlOption__IIILjava_lang_String_2_3I()
395 (*env)->SetIntArrayRegion(env, info, 0, 1, &i); in Java_Sane_setControlOption__IIILjava_lang_String_2_3I()
414 paramsClass = (*env)->GetObjectClass(env, paramsObj); in Java_Sane_getParameters()
415 /* Fill in each member. */ in Java_Sane_getParameters()
416 fid = (*env)->GetFieldID(env, paramsClass, "format", "I"); in Java_Sane_getParameters()
417 (*env)->SetIntField(env, paramsObj, fid, params.format); in Java_Sane_getParameters()
418 fid = (*env)->GetFieldID(env, paramsClass, "lastFrame", "Z"); in Java_Sane_getParameters()
419 (*env)->SetBooleanField(env, paramsObj, fid, params.last_frame); in Java_Sane_getParameters()
420 fid = (*env)->GetFieldID(env, paramsClass, "bytesPerLine", "I"); in Java_Sane_getParameters()
421 (*env)->SetIntField(env, paramsObj, fid, params.bytes_per_line); in Java_Sane_getParameters()
422 fid = (*env)->GetFieldID(env, paramsClass, "pixelsPerLine", "I"); in Java_Sane_getParameters()
423 (*env)->SetIntField(env, paramsObj, fid, params.pixels_per_line); in Java_Sane_getParameters()
424 fid = (*env)->GetFieldID(env, paramsClass, "lines", "I"); in Java_Sane_getParameters()
425 (*env)->SetIntField(env, paramsObj, fid, params.lines); in Java_Sane_getParameters()
426 fid = (*env)->GetFieldID(env, paramsClass, "depth", "I"); in Java_Sane_getParameters()
427 (*env)->SetIntField(env, paramsObj, fid, params.depth); in Java_Sane_getParameters()
456 dataElements = (*env)->GetByteArrayElements(env, data, 0); in Java_Sane_read()
460 (*env)->ReleaseByteArrayElements(env, data, dataElements, 0); in Java_Sane_read()
462 (*env)->SetIntArrayRegion(env, length, 0, 1, &read_len); in Java_Sane_read()
486 return ((*env)->NewStringUTF(env, str)); in Java_Sane_strstatus()