mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1062112: Part 1.5: Move GeckoEditable interfaces to satisfy JDK 8. r=nalexander
This commit is contained in:
parent
6e6bc9110e
commit
b4dbd63148
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
package org.mozilla.gecko;
|
package org.mozilla.gecko;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationHandler;
|
import java.lang.reflect.InvocationHandler;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@ -37,39 +38,6 @@ import android.util.Log;
|
|||||||
import android.view.KeyCharacterMap;
|
import android.view.KeyCharacterMap;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
|
||||||
// interface for the IC thread
|
|
||||||
interface GeckoEditableClient {
|
|
||||||
void sendEvent(GeckoEvent event);
|
|
||||||
Editable getEditable();
|
|
||||||
void setUpdateGecko(boolean update);
|
|
||||||
void setSuppressKeyUp(boolean suppress);
|
|
||||||
Handler getInputConnectionHandler();
|
|
||||||
boolean setInputConnectionHandler(Handler handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* interface for the Editable to listen to the Gecko thread
|
|
||||||
and also for the IC thread to listen to the Editable */
|
|
||||||
interface GeckoEditableListener {
|
|
||||||
// IME notification type for notifyIME(), corresponding to NotificationToIME enum in Gecko
|
|
||||||
final int NOTIFY_IME_OPEN_VKB = -2;
|
|
||||||
final int NOTIFY_IME_REPLY_EVENT = -1;
|
|
||||||
final int NOTIFY_IME_OF_FOCUS = 1;
|
|
||||||
final int NOTIFY_IME_OF_BLUR = 2;
|
|
||||||
final int NOTIFY_IME_TO_COMMIT_COMPOSITION = 8;
|
|
||||||
final int NOTIFY_IME_TO_CANCEL_COMPOSITION = 9;
|
|
||||||
// IME enabled state for notifyIMEContext()
|
|
||||||
final int IME_STATE_DISABLED = 0;
|
|
||||||
final int IME_STATE_ENABLED = 1;
|
|
||||||
final int IME_STATE_PASSWORD = 2;
|
|
||||||
final int IME_STATE_PLUGIN = 3;
|
|
||||||
|
|
||||||
void notifyIME(int type);
|
|
||||||
void notifyIMEContext(int state, String typeHint,
|
|
||||||
String modeHint, String actionHint);
|
|
||||||
void onSelectionChange(int start, int end);
|
|
||||||
void onTextChange(CharSequence text, int start, int oldEnd, int newEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GeckoEditable implements only some functions of Editable
|
GeckoEditable implements only some functions of Editable
|
||||||
The field mText contains the actual underlying
|
The field mText contains the actual underlying
|
||||||
@ -1004,12 +972,12 @@ final class GeckoEditable
|
|||||||
} else if (Proxy.isProxyClass(obj.getClass())) {
|
} else if (Proxy.isProxyClass(obj.getClass())) {
|
||||||
debugAppend(sb, Proxy.getInvocationHandler(obj));
|
debugAppend(sb, Proxy.getInvocationHandler(obj));
|
||||||
} else if (obj instanceof CharSequence) {
|
} else if (obj instanceof CharSequence) {
|
||||||
sb.append("\"").append(obj.toString().replace('\n', '\u21b2')).append("\"");
|
sb.append('"').append(obj.toString().replace('\n', '\u21b2')).append('"');
|
||||||
} else if (obj.getClass().isArray()) {
|
} else if (obj.getClass().isArray()) {
|
||||||
sb.append(obj.getClass().getComponentType().getSimpleName()).append("[")
|
sb.append(obj.getClass().getComponentType().getSimpleName()).append('[')
|
||||||
.append(java.lang.reflect.Array.getLength(obj)).append("]");
|
.append(Array.getLength(obj)).append(']');
|
||||||
} else {
|
} else {
|
||||||
sb.append(obj.toString());
|
sb.append(obj);
|
||||||
}
|
}
|
||||||
return sb;
|
return sb;
|
||||||
}
|
}
|
||||||
|
21
mobile/android/base/GeckoEditableClient.java
Normal file
21
mobile/android/base/GeckoEditableClient.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
package org.mozilla.gecko;
|
||||||
|
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.text.Editable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for the IC thread.
|
||||||
|
*/
|
||||||
|
interface GeckoEditableClient {
|
||||||
|
void sendEvent(GeckoEvent event);
|
||||||
|
Editable getEditable();
|
||||||
|
void setUpdateGecko(boolean update);
|
||||||
|
void setSuppressKeyUp(boolean suppress);
|
||||||
|
Handler getInputConnectionHandler();
|
||||||
|
boolean setInputConnectionHandler(Handler handler);
|
||||||
|
}
|
30
mobile/android/base/GeckoEditableListener.java
Normal file
30
mobile/android/base/GeckoEditableListener.java
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
package org.mozilla.gecko;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface for the Editable to listen on the Gecko thread, as well as for the IC thread to listen
|
||||||
|
* to the Editable.
|
||||||
|
*/
|
||||||
|
interface GeckoEditableListener {
|
||||||
|
// IME notification type for notifyIME(), corresponding to NotificationToIME enum in Gecko
|
||||||
|
int NOTIFY_IME_OPEN_VKB = -2;
|
||||||
|
int NOTIFY_IME_REPLY_EVENT = -1;
|
||||||
|
int NOTIFY_IME_OF_FOCUS = 1;
|
||||||
|
int NOTIFY_IME_OF_BLUR = 2;
|
||||||
|
int NOTIFY_IME_TO_COMMIT_COMPOSITION = 8;
|
||||||
|
int NOTIFY_IME_TO_CANCEL_COMPOSITION = 9;
|
||||||
|
// IME enabled state for notifyIMEContext()
|
||||||
|
int IME_STATE_DISABLED = 0;
|
||||||
|
int IME_STATE_ENABLED = 1;
|
||||||
|
int IME_STATE_PASSWORD = 2;
|
||||||
|
int IME_STATE_PLUGIN = 3;
|
||||||
|
|
||||||
|
void notifyIME(int type);
|
||||||
|
void notifyIMEContext(int state, String typeHint, String modeHint, String actionHint);
|
||||||
|
void onSelectionChange(int start, int end);
|
||||||
|
void onTextChange(CharSequence text, int start, int oldEnd, int newEnd);
|
||||||
|
}
|
@ -194,6 +194,8 @@ gbjar.sources += [
|
|||||||
'GeckoBatteryManager.java',
|
'GeckoBatteryManager.java',
|
||||||
'GeckoConnectivityReceiver.java',
|
'GeckoConnectivityReceiver.java',
|
||||||
'GeckoEditable.java',
|
'GeckoEditable.java',
|
||||||
|
'GeckoEditableClient.java',
|
||||||
|
'GeckoEditableListener.java',
|
||||||
'GeckoEvent.java',
|
'GeckoEvent.java',
|
||||||
'GeckoHalDefines.java',
|
'GeckoHalDefines.java',
|
||||||
'GeckoInputConnection.java',
|
'GeckoInputConnection.java',
|
||||||
|
Loading…
Reference in New Issue
Block a user