This source file includes following definitions.
- dup
- getFingerprint
- setEmacsParams
- initEmacs
- emacsAbort
- quit
- sendConfigureNotify
- sendKeyPress
- sendKeyRelease
- sendFocusIn
- sendFocusOut
- sendWindowAction
- sendEnterNotify
- sendLeaveNotify
- sendMotionNotify
- sendButtonPress
- sendButtonRelease
- sendTouchDown
- sendTouchUp
- sendTouchMove
- sendWheel
- sendIconified
- sendDeiconified
- sendContextMenu
- sendExpose
- getProcName
- beginSynchronous
- endSynchronous
- answerQuerySpin
- shouldForwardMultimediaButtons
- setupSystemThread
- beginBatchEdit
- endBatchEdit
- commitCompletion
- commitText
- deleteSurroundingText
- finishComposingText
- getSelectedText
- getTextAfterCursor
- getTextBeforeCursor
- setComposingText
- setComposingRegion
- setSelection
- performEditorAction
- performContextMenuAction
- getExtractedText
- requestSelectionUpdate
- requestCursorUpdates
- clearInputFlags
- getSurroundingText
- takeSnapshot
- getSelection
- blitRect
- notifyPixelsChanged
- safSyncAndReadInput
- safSync
- safPostRequest
- ftruncate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.gnu.emacs;
21
22 import android.content.res.AssetManager;
23
24 import android.graphics.Bitmap;
25
26 import android.view.inputmethod.ExtractedText;
27 import android.view.inputmethod.ExtractedTextRequest;
28 import android.view.inputmethod.SurroundingText;
29 import android.view.inputmethod.TextSnapshot;
30
31 public final class EmacsNative
32 {
33
34
35 private static final String[] libraryDeps;
36
37
38
39 public static native int dup (int fd);
40
41
42
43 public static native String getFingerprint ();
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72 public static native void setEmacsParams (AssetManager assetManager,
73 String filesDir,
74 String libDir,
75 String cacheDir,
76 float pixelDensityX,
77 float pixelDensityY,
78 float scaledDensity,
79 String classPath,
80 EmacsService emacsService,
81 int apiLevel);
82
83
84
85
86
87
88
89 public static native void initEmacs (String argv[], String dumpFile);
90
91
92 public static native void emacsAbort ();
93
94
95
96 public static native void quit ();
97
98
99
100 public static native long sendConfigureNotify (short window, long time,
101 int x, int y, int width,
102 int height);
103
104
105 public static native long sendKeyPress (short window, long time, int state,
106 int keyCode, int unicodeChar);
107
108
109 public static native long sendKeyRelease (short window, long time, int state,
110 int keyCode, int unicodeChar);
111
112
113 public static native long sendFocusIn (short window, long time);
114
115
116 public static native long sendFocusOut (short window, long time);
117
118
119 public static native long sendWindowAction (short window, int action);
120
121
122 public static native long sendEnterNotify (short window, int x, int y,
123 long time);
124
125
126 public static native long sendLeaveNotify (short window, int x, int y,
127 long time);
128
129
130 public static native long sendMotionNotify (short window, int x, int y,
131 long time);
132
133
134 public static native long sendButtonPress (short window, int x, int y,
135 long time, int state,
136 int button);
137
138
139 public static native long sendButtonRelease (short window, int x, int y,
140 long time, int state,
141 int button);
142
143
144 public static native long sendTouchDown (short window, int x, int y,
145 long time, int pointerID,
146 int flags);
147
148
149 public static native long sendTouchUp (short window, int x, int y,
150 long time, int pointerID,
151 int flags);
152
153
154 public static native long sendTouchMove (short window, int x, int y,
155 long time, int pointerID,
156 int flags);
157
158
159 public static native long sendWheel (short window, int x, int y,
160 long time, int state,
161 float xDelta, float yDelta);
162
163
164 public static native long sendIconified (short window);
165
166
167 public static native long sendDeiconified (short window);
168
169
170 public static native long sendContextMenu (short window, int menuEventID,
171 int menuEventSerial);
172
173
174 public static native long sendExpose (short window, int x, int y,
175 int width, int height);
176
177
178
179 public static native byte[] getProcName (int fd);
180
181
182
183 public static native void beginSynchronous ();
184
185
186
187 public static native void endSynchronous ();
188
189
190
191
192
193 public static native void answerQuerySpin ();
194
195
196
197 public static native boolean shouldForwardMultimediaButtons ();
198
199
200
201 public static native void setupSystemThread ();
202
203
204
205
206
207
208 public static native void beginBatchEdit (short window);
209 public static native void endBatchEdit (short window);
210 public static native void commitCompletion (short window, String text,
211 int position);
212 public static native void commitText (short window, String text,
213 int position);
214 public static native void deleteSurroundingText (short window,
215 int leftLength,
216 int rightLength);
217 public static native void finishComposingText (short window);
218 public static native String getSelectedText (short window, int flags);
219 public static native String getTextAfterCursor (short window, int length,
220 int flags);
221 public static native String getTextBeforeCursor (short window, int length,
222 int flags);
223 public static native void setComposingText (short window, String text,
224 int newCursorPosition);
225 public static native void setComposingRegion (short window, int start,
226 int end);
227 public static native void setSelection (short window, int start, int end);
228 public static native void performEditorAction (short window,
229 int editorAction);
230 public static native void performContextMenuAction (short window,
231 int contextMenuAction);
232 public static native ExtractedText getExtractedText (short window,
233 ExtractedTextRequest req,
234 int flags);
235 public static native void requestSelectionUpdate (short window);
236 public static native void requestCursorUpdates (short window, int mode);
237 public static native void clearInputFlags (short window);
238 public static native SurroundingText getSurroundingText (short window,
239 int left, int right,
240 int flags);
241 public static native TextSnapshot takeSnapshot (short window);
242
243
244
245
246 public static native int[] getSelection (short window);
247
248
249
250
251
252 public static native void blitRect (Bitmap src, Bitmap dest, int x1,
253 int y1, int x2, int y2);
254
255
256
257
258 public static native void notifyPixelsChanged (Bitmap bitmap);
259
260
261
262
263
264
265
266
267
268 public static native int safSyncAndReadInput ();
269
270
271 public static native void safSync ();
272
273
274
275 public static native void safPostRequest ();
276
277
278
279 public static native boolean ftruncate (int fd);
280
281 static
282 {
283
284
285
286
287
288
289
290
291 libraryDeps = new String[] { "png_emacs", "selinux_emacs",
292 "crypto_emacs", "pcre_emacs",
293 "packagelistparser_emacs",
294 "gnutls_emacs", "gmp_emacs",
295 "nettle_emacs", "p11-kit_emacs",
296 "tasn1_emacs", "hogweed_emacs",
297 "jansson_emacs", "jpeg_emacs",
298 "tiff_emacs", "xml2_emacs",
299 "icuuc_emacs",
300 "tree-sitter_emacs", };
301
302 for (String dependency : libraryDeps)
303 {
304 try
305 {
306 System.loadLibrary (dependency);
307 }
308 catch (UnsatisfiedLinkError exception)
309 {
310
311 }
312 }
313
314 System.loadLibrary ("emacs");
315 };
316 };