/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2013 by The BRLTTY Developers.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU General Public License, as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any
 * later version. Please see the file LICENSE-GPL for details.
 *
 * Web Page: http://mielke.cc/brltty/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

package org.a11y.brltty.core;

public class CoreWrapper {
  public static native int construct (String[] arguments);
  public static native boolean update ();
  public static native void destruct ();

  private static volatile boolean stop = false;

  public static void stop () {
    stop = true;
  }

  public static int run (String[] arguments) {
    int exitStatus = construct(arguments);

    if (exitStatus == ProgramExitStatus.SUCCESS.value) {
      while (update()) {
        if (stop) {
          break;
        }
      }
    } else if (exitStatus == ProgramExitStatus.FORCE.value) {
      exitStatus = ProgramExitStatus.SUCCESS.value;
    }

    destruct();
    return exitStatus;
  }

  public static void main (String[] arguments) {
    System.exit(run(arguments));
  }

  static {
    System.loadLibrary("brltty_core");
    System.loadLibrary("brltty_jni");
  }
}

@@ -663,16 +663,98 @@
 .core;%0A%0A
+import java.util.AbstractQueue;%0Aimport java.util.concurrent.LinkedBlockingDeque;%0A%0A
 public c
@@ -915,16 +915,644 @@
 ct ();%0A%0A
+  public static native boolean changeLogLevel (String logLevel);%0A  public static native boolean changeTextTable (String textTable);%0A  public static native boolean changeAttributesTable (String attributesTable);%0A  public static native boolean changeContractionTable (String contractionTable);%0A%0A  private static final AbstractQueue%3CRunnable%3E runQueue = new LinkedBlockingDeque%3CRunnable%3E();%0A%0A  public static boolean runOnCoreThread (Runnable runnable) %7B%0A    return runQueue.offer(runnable);%0A  %7D%0A%0A  public static void processRunQueue () %7B%0A    Runnable runnable;%0A    while ((runnable = runQueue.poll()) != null) runnable.run();%0A  %7D%0A%0A
   privat
@@ -1839,20 +1839,8 @@
 top)
- %7B%0A         
  bre
@@ -1847,25 +1847,42 @@
 ak;%0A        
-%7D
+processRunQueue();
 %0A      %7D%0A   

Add methods for changing the text,attributes,contraction tables via the core thread. (dm)