/*
 * libbrlapi - A library providing access to braille terminals for applications.
 *
 * Copyright (C) 2002-2006 by
 *   Samuel Thibault <Samuel.Thibault@ens-lyon.org>
 *   Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>
 * All rights reserved.
 *
 * libbrlapi comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU Lesser General Public License, as published by the Free Software
 * Foundation; either version 2.1 of the License,
 * or (at your option) any later version.
 * Please see the file COPYING-API for details.
 *
 * Web Page: http://mielke.cc/brltty/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

public class Brlapi {
  public final native int initializeConnection(
    BrlapiSettings clientSettings,
    BrlapiSettings usedSettings
  ) throws BrlapiError;

  public final native void closeConnection();

  public final static native byte[] loadAuthKey(String jpath);

  public final native String getDriverId() throws BrlapiError;
  public final native String getDriverName() throws BrlapiError;
  public final native BrlapiSize getDisplaySize() throws BrlapiError;
  /*public final native byte[] getDriverInfo() throws BrlapiError;*/
  
  public final native int enterTtyMode(int tty, String how) throws BrlapiError;
  public final native int getTtyPath(int ttys[], String how) throws BrlapiError;
  public final native void leaveTtyMode() throws BrlapiError;
  public final native void setFocus(int tty) throws BrlapiError;

  public final native void writeText(int cursor, String str) throws BrlapiError;
  public final native int writeDots(byte str[]) throws BrlapiError;
  public final native void write(BrlapiWriteStruct s) throws BrlapiError;

  public final native long readKey(boolean block) throws BrlapiError;
  public final native void ignoreKeyRange(long x, long y) throws BrlapiError;
  public final native void ignoreKeySet(long s[]) throws BrlapiError;
  public final native void unignoreKeyRange(long x, long y) throws BrlapiError;
  public final native void unignoreKeySet(long s[]) throws BrlapiError;

  public final native void enterRawMode(String driver) throws BrlapiError;
  public final native void leaveRawMode() throws BrlapiError;
  public final native int sendRaw(byte buf[]) throws BrlapiError;
  public final native int recvRaw(byte buf[]) throws BrlapiError;

  public final static native String packetType(long type);

  public long handle;
}

@@ -700,29 +700,298 @@
 Brlapi %7B%0A  p
-ublic
+rivate long handle;%0A  private int fileDescriptor;;%0A  private BrlapiSettings settings;%0A%0A  public Brlapi (BrlapiSettings settings) throws BrlapiError %7B%0A    this.settings = new BrlapiSettings();%0A    fileDescriptor = initializeConnection(settings, this.settings);%0A  %7D%0A%0A  private
  final nativ
@@ -1216,17 +1216,16 @@
 ing 
-j
 path);%0A%0A
   pu
@@ -1216,24 +1216,159 @@
 ing path);%0A%0A
+  public BrlapiSettings getSettings () %7B%0A    return settings;%0A  %7D%0A%0A  public int getFileDescriptor () %7B%0A    return fileDescriptor;%0A  %7D%0A%0A
   public fin
@@ -1395,16 +1395,17 @@
 DriverId
+ 
 () throw
@@ -1461,16 +1461,17 @@
 iverName
+ 
 () throw
@@ -1532,16 +1532,17 @@
 playSize
+ 
 () throw
@@ -1666,16 +1666,17 @@
 rTtyMode
+ 
 (int tty
@@ -1676,35 +1676,38 @@
 int tty, String 
-how
+driver
 ) throws BrlapiE
@@ -1748,16 +1748,17 @@
 tTtyPath
+ 
 (int tty
@@ -1773,11 +1773,14 @@
 ing 
-how
+driver
 ) th
@@ -1832,24 +1832,25 @@
 leaveTtyMode
+ 
 () throws Br
@@ -1895,16 +1895,17 @@
 setFocus
+ 
 (int tty
@@ -1963,16 +1963,17 @@
 riteText
+ 
 (int cur
@@ -2044,16 +2044,17 @@
 riteDots
+ 
 (byte st
@@ -2110,16 +2110,17 @@
 id write
+ 
 (BrlapiW
@@ -2257,32 +2257,33 @@
 d ignoreKeyRange
+ 
 (long x, long y)
@@ -2322,32 +2322,34 @@
 nal native void 
+un
 ignoreKeySet(lon
@@ -2337,36 +2337,45 @@
  unignoreKey
-Set(long s%5B%5D
+Range (long x, long y
 ) throws Brl
@@ -2403,34 +2403,32 @@
 nal native void 
-un
 ignoreKeyRange(l
@@ -2424,28 +2424,21 @@
 eKey
-Range
+Set 
 (long 
-x, long y
+s%5B%5D
 ) th
@@ -2496,16 +2496,17 @@
 reKeySet
+ 
 (long s%5B
@@ -2568,16 +2568,17 @@
 rRawMode
+ 
 (String 
@@ -2644,16 +2644,17 @@
 eRawMode
+ 
 () throw
@@ -2701,16 +2701,17 @@
  sendRaw
+ 
 (byte bu
@@ -2768,16 +2768,17 @@
  recvRaw
+ 
 (byte bu
@@ -2849,16 +2849,17 @@
 cketType
+ 
 (long ty
@@ -2866,30 +2866,7 @@
 pe);
-%0A%0A  public long handle;
 %0A%7D%0A

Change the Java bindings to invoke initializeConnection() via the constructor. (dm)