original position of the tool to display its bound keymap as a
menu.
-If the fourth element of `touch-screen-current-tool' is `drag',
-the region is active, and the tool's initial window's selected
-buffer isn't read-only, display the on screen keyboard.
+If the fourth element of `touch-screen-current-tool' is `drag' or
+`held', the region is active, and the tool's initial window's
+selected buffer isn't read-only, display the on screen keyboard.
If the command being executed is listed in
`touch-screen-set-point-commands' also display the on-screen
(throw 'input-event
(list 'down-mouse-1
(nth 4 touch-screen-current-tool))))
- ((eq what 'drag)
+ ((or (eq what 'drag)
+ ;; Merely initiating a drag is sufficient to select a
+ ;; word if word selection is enabled.
+ (eq what 'held))
;; Display the on screen keyboard if the region is now
;; active. Check this within the window where the tool was
;; first place.
return (char *) "Android user";
return pw->pw_gecos;
-#else
+#else /* !HAVE_STRUCT_PASSWD_PW_GECOS */
return "Android user";
-#endif
+#endif /* HAVE_STRUCT_PASSWD_PW_GECOS */
}
\f
-/* Determine whether or not the specified file NAME describes a file
- in the directory DIR, which should be an absolute file name. NAME
- must be in canonical form.
-
- Value is NULL if not. Otherwise, it is a pointer to the first
- character in NAME after the part containing DIR and its trailing
- directory separator. */
+/* Return whether or not the specified file NAME designates a file in
+ the directory DIR, which should be an absolute file name. NAME
+ must be in canonical form. */
-const char *
+bool
android_is_special_directory (const char *name, const char *dir)
{
size_t len;
len = strlen (dir);
if (strncmp (name, dir, len))
- return NULL;
+ return false;
/* Now see if the character of NAME after len is either a directory
separator or a terminating NULL. */
name += len;
switch (*name)
{
- case '\0':
- /* Return the empty string if this is the end of the file
- name. */
- return name;
-
- case '/':
- /* Return NAME (with the separator removed) if it describes a
- file. */
- return name + 1;
-
- default:
- /* The file name doesn't match. */
- return NULL;
+ case '\0': /* NAME is an exact match for DIR. */
+ case '/': /* NAME is a constituent of DIR. */
+ return true;
}
+
+ /* The file name doesn't match. */
+ return false;
}
#if 0
/* File I/O operations. Many of these are defined in
androidvfs.c. */
-extern const char *android_is_special_directory (const char *, const char *);
+extern bool android_is_special_directory (const char *, const char *);
extern const char *android_get_home_directory (void);
extern void android_vfs_init (JNIEnv *, jobject);
/* Define a substitute for use during Emacs compilation. */
-#define android_is_special_directory(name, dir) ((const char *) NULL)
+#define android_is_special_directory(name, dir) (false)
#endif /* !ANDROID_STUBIFY */