* INSTALL.android: Describe that apksigner is also required. * configure.ac: Correctly add cross/Makefile to SUBDIR_MAKEFILES. * cross/Makefile.in: (config.status): Depend on $(top_srcdir)/config.status. * doc/emacs/input.texi (On-Screen Keyboards): Document how to quit without a physical keyboard. * java/org/gnu/emacs/EmacsNative.java (EmacsNative): New function `quit'. * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): New field `lastVolumeButtonPress'. (onKeyDown): Quit if necessary. * m4/ndk-build.m4 (ndk_where_cc): Fix search if CC is not a single word. * src/android.c (android_open): Remove unused variable. (quit): New function. * src/androidmenu.c (android_process_events_for_menu): Allow quitting the menu. * src/xterm.c (handle_one_xevent, x_term_init, syms_of_xterm): Implement features described above, so they work on free operating systems. * src/xterm.h (struct x_display_info): New fields `quit_keysym', `quit_keysym_time'.
160 lines
5.4 KiB
Java
160 lines
5.4 KiB
Java
/* Communication module for Android terminals. -*- c-file-style: "GNU" -*-
|
|
|
|
Copyright (C) 2023 Free Software Foundation, Inc.
|
|
|
|
This file is part of GNU Emacs.
|
|
|
|
GNU Emacs is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or (at
|
|
your option) any later version.
|
|
|
|
GNU Emacs is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
|
|
|
|
package org.gnu.emacs;
|
|
|
|
import java.lang.System;
|
|
|
|
import android.content.res.AssetManager;
|
|
|
|
public class EmacsNative
|
|
{
|
|
/* Obtain the fingerprint of this build of Emacs. The fingerprint
|
|
can be used to determine the dump file name. */
|
|
public static native String getFingerprint ();
|
|
|
|
/* Set certain parameters before initializing Emacs.
|
|
|
|
assetManager must be the asset manager associated with the
|
|
context that is loading Emacs. It is saved and remains for the
|
|
remainder the lifetime of the Emacs process.
|
|
|
|
filesDir must be the package's data storage location for the
|
|
current Android user.
|
|
|
|
libDir must be the package's data storage location for native
|
|
libraries. It is used as PATH.
|
|
|
|
cacheDir must be the package's cache directory. It is used as
|
|
the `temporary-file-directory'.
|
|
|
|
pixelDensityX and pixelDensityY are the DPI values that will be
|
|
used by Emacs.
|
|
|
|
classPath must be the classpath of this app_process process, or
|
|
NULL.
|
|
|
|
emacsService must be the EmacsService singleton, or NULL. */
|
|
public static native void setEmacsParams (AssetManager assetManager,
|
|
String filesDir,
|
|
String libDir,
|
|
String cacheDir,
|
|
float pixelDensityX,
|
|
float pixelDensityY,
|
|
String classPath,
|
|
EmacsService emacsService);
|
|
|
|
/* Initialize Emacs with the argument array ARGV. Each argument
|
|
must contain a NULL terminated string, or else the behavior is
|
|
undefined.
|
|
|
|
DUMPFILE is the dump file to use, or NULL if Emacs is to load
|
|
loadup.el itself.
|
|
|
|
APILEVEL is the version of Android being used. */
|
|
public static native void initEmacs (String argv[], String dumpFile,
|
|
int apiLevel);
|
|
|
|
/* Abort and generate a native core dump. */
|
|
public static native void emacsAbort ();
|
|
|
|
/* Set Vquit_flag to t, resulting in Emacs quitting as soon as
|
|
possible. */
|
|
public static native void quit ();
|
|
|
|
/* Send an ANDROID_CONFIGURE_NOTIFY event. The values of all the
|
|
functions below are the serials of the events sent. */
|
|
public static native long sendConfigureNotify (short window, long time,
|
|
int x, int y, int width,
|
|
int height);
|
|
|
|
/* Send an ANDROID_KEY_PRESS event. */
|
|
public static native long sendKeyPress (short window, long time, int state,
|
|
int keyCode, int unicodeChar);
|
|
|
|
/* Send an ANDROID_KEY_RELEASE event. */
|
|
public static native long sendKeyRelease (short window, long time, int state,
|
|
int keyCode, int unicodeChar);
|
|
|
|
/* Send an ANDROID_FOCUS_IN event. */
|
|
public static native long sendFocusIn (short window, long time);
|
|
|
|
/* Send an ANDROID_FOCUS_OUT event. */
|
|
public static native long sendFocusOut (short window, long time);
|
|
|
|
/* Send an ANDROID_WINDOW_ACTION event. */
|
|
public static native long sendWindowAction (short window, int action);
|
|
|
|
/* Send an ANDROID_ENTER_NOTIFY event. */
|
|
public static native long sendEnterNotify (short window, int x, int y,
|
|
long time);
|
|
|
|
/* Send an ANDROID_LEAVE_NOTIFY event. */
|
|
public static native long sendLeaveNotify (short window, int x, int y,
|
|
long time);
|
|
|
|
/* Send an ANDROID_MOTION_NOTIFY event. */
|
|
public static native long sendMotionNotify (short window, int x, int y,
|
|
long time);
|
|
|
|
/* Send an ANDROID_BUTTON_PRESS event. */
|
|
public static native long sendButtonPress (short window, int x, int y,
|
|
long time, int state,
|
|
int button);
|
|
|
|
/* Send an ANDROID_BUTTON_RELEASE event. */
|
|
public static native long sendButtonRelease (short window, int x, int y,
|
|
long time, int state,
|
|
int button);
|
|
|
|
/* Send an ANDROID_TOUCH_DOWN event. */
|
|
public static native long sendTouchDown (short window, int x, int y,
|
|
long time, int pointerID);
|
|
|
|
/* Send an ANDROID_TOUCH_UP event. */
|
|
public static native long sendTouchUp (short window, int x, int y,
|
|
long time, int pointerID);
|
|
|
|
/* Send an ANDROID_TOUCH_MOVE event. */
|
|
public static native long sendTouchMove (short window, int x, int y,
|
|
long time, int pointerID);
|
|
|
|
/* Send an ANDROID_WHEEL event. */
|
|
public static native long sendWheel (short window, int x, int y,
|
|
long time, int state,
|
|
float xDelta, float yDelta);
|
|
|
|
/* Send an ANDROID_ICONIFIED event. */
|
|
public static native long sendIconified (short window);
|
|
|
|
/* Send an ANDROID_DEICONIFIED event. */
|
|
public static native long sendDeiconified (short window);
|
|
|
|
/* Send an ANDROID_CONTEXT_MENU event. */
|
|
public static native long sendContextMenu (short window, int menuEventID);
|
|
|
|
/* Send an ANDROID_EXPOSE event. */
|
|
public static native long sendExpose (short window, int x, int y,
|
|
int width, int height);
|
|
|
|
static
|
|
{
|
|
System.loadLibrary ("emacs");
|
|
};
|
|
};
|