aboutsummaryrefslogtreecommitdiffstats
path: root/src/android.h
diff options
context:
space:
mode:
authorPo Lu2024-05-04 11:36:09 +0800
committerPo Lu2024-05-04 11:36:09 +0800
commit139931fefb4cde3132ca68c3caa6ee9c4889c1b6 (patch)
tree0d34b5ae78706d4c1345ff8f70e865f3503ead4f /src/android.h
parent7a7dd87842fde85666208b1ce26882aa83d99107 (diff)
downloademacs-139931fefb4cde3132ca68c3caa6ee9c4889c1b6.tar.gz
emacs-139931fefb4cde3132ca68c3caa6ee9c4889c1b6.zip
Simplify management of Android handle IDs
* java/org/gnu/emacs/EmacsCursor.java (EmacsCursor): * java/org/gnu/emacs/EmacsGC.java (EmacsGC): * java/org/gnu/emacs/EmacsHandleObject.java (EmacsHandleObject): Remove HANDLE argument to constructor. * java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow): * java/org/gnu/emacs/EmacsInputConnection.java (EmacsInputConnection) <windowHandle>: Change type to long. * java/org/gnu/emacs/EmacsNative.java (EmacsNative) (sendConfigureNotify, sendKeyPress, sendKeyRelease, sendFocusIn) (sendFocusOut, sendWindowAction, sendEnterNotify) (sendLeaveNotify, sendMotionNotify, sendButtonPress) (sendButtonRelease, sendTouchDown, sendTouchUp, sendTouchMove) (sendWheel, sendIconified, sendDeiconified, sendContextMenu) (sendExpose, sendDndDrag, sendDndUri, sendDndText) (beginBatchEdit, commitCompletion, endBatchEdit, commitText) (deleteSurroundingText, finishComposingText, replaceText) (getSelectedText, getTextAfterCursor, getTextBeforeCursor) (setComposingText, setComposingRegion, setSelection) (performEditorAction, performContextMenuAction, getExtractedText) (requestSelectionUpdate, requestCursorUpdates, clearInputFlags) (getSurroundingText, takeSnapshot, getSelection): Accept handles as longs, rather than shorts. All callers changed. * java/org/gnu/emacs/EmacsService.java (queryTree): Return handles as longs rather than shorts. (viewGetSelection): Take long WINDOW, not short. * src/android.c (struct android_emacs_handle): New structure. (handle_class): New variable. (android_init_emacs_service, android_init_emacs_pixmap) (android_init_emacs_gc_class, android_init_emacs_cursor): Adjust to match signature changes in constructors. (android_init_emacs_handle): New function. (initEmacs): Initialize the handle class, its fields and metods. (sendConfigureNotify, sendKeyPress, sendKeyRelease, sendFocusIn) (sendFocusOut, sendWindowAction, sendEnterNotify) (sendLeaveNotify, sendMotionNotify, sendButtonPress) (sendButtonRelease, sendTouchDown, sendTouchUp, sendTouchMove) (sendWheel, sendIconified, sendDeiconified, sendContextMenu) (sendExpose, sendDndDrag, sendDndUri, sendDndText): Update for changes to handle type. (android_alloc_id, android_resolve_handle) (android_resolve_handle2): Remove functions; replace the second with a macro that accepts one fewer argument. All callers changed. (android_destroy_handle): Cease indexing the handle list for the handle object. (android_globalize_reference): New function. (android_create_window, android_create_gc, android_create_pixmap) (android_create_font_cursor): Call android_globalize_reference to convert global references into handles. (android_free_cursor, android_destroy_window): Cease verifying the handle type. (android_copy_area): Check destination object type rather than handle entry. (android_query_tree): Adjust for changes to return types. (likely): Define __builtin_expect variant unconditionally. * src/android.h (android_resolve_handle): New macro. * src/androidgui.h (android_handle): Define to intptr_t. * src/androidterm.c (deleteSurroundingText, finishComposingText) (performEditorAction, performContextMenuAction, getExtractedText) (getSelectedText, requestSelectionUpdate, requestCursorUpdates) (clearInputFlags, getSurroundingText) (android_get_surrounding_text_internal): Accept handles as longs, not jshorts.
Diffstat (limited to 'src/android.h')
-rw-r--r--src/android.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/android.h b/src/android.h
index 7074ca2630c..a582a9b7dff 100644
--- a/src/android.h
+++ b/src/android.h
@@ -101,16 +101,9 @@ extern ssize_t android_readlinkat (int, const char *restrict, char *restrict,
101extern double android_pixel_density_x, android_pixel_density_y; 101extern double android_pixel_density_x, android_pixel_density_y;
102extern double android_scaled_pixel_density; 102extern double android_scaled_pixel_density;
103 103
104enum android_handle_type 104verify (sizeof (android_handle) == sizeof (jobject));
105 { 105#define android_resolve_handle(handle) ((jobject) (handle))
106 ANDROID_HANDLE_WINDOW, 106
107 ANDROID_HANDLE_GCONTEXT,
108 ANDROID_HANDLE_PIXMAP,
109 ANDROID_HANDLE_CURSOR,
110 };
111
112extern jobject android_resolve_handle (android_handle,
113 enum android_handle_type);
114extern unsigned char *android_lock_bitmap (android_drawable, 107extern unsigned char *android_lock_bitmap (android_drawable,
115 AndroidBitmapInfo *, 108 AndroidBitmapInfo *,
116 jobject *); 109 jobject *);