mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-25 15:00:45 -08:00
Update Android port
* doc/emacs/android.texi (Android File System): Describe an easier way to disable scoped storage. * java/AndroidManifest.xml.in: Add new permission to allow that. * java/README: Add more text describing Java. * java/org/gnu/emacs/EmacsContextMenu.java (Item): New fields `isCheckable' and `isChecked'. (EmacsContextMenu, addItem): New arguments. (inflateMenuItems): Set checked status as appropriate. * java/org/gnu/emacs/EmacsCopyArea.java (perform): Disallow operations where width and height are less than or equal to zero. * lisp/menu-bar.el (menu-bar-edit-menu): Make execute-extended-command available as a menu item. * src/androidmenu.c (android_init_emacs_context_menu) (android_menu_show): * src/menu.c (have_boxes): Implement menu check boxes.
This commit is contained in:
parent
5bd38905ac
commit
198b8160cf
8 changed files with 123 additions and 16 deletions
|
|
@ -56,7 +56,7 @@ public class EmacsContextMenu
|
|||
public int itemID;
|
||||
public String itemName;
|
||||
public EmacsContextMenu subMenu;
|
||||
public boolean isEnabled;
|
||||
public boolean isEnabled, isCheckable, isChecked;
|
||||
|
||||
@Override
|
||||
public boolean
|
||||
|
|
@ -108,10 +108,15 @@ public class EmacsContextMenu
|
|||
|
||||
/* Add a normal menu item to the context menu with the id ITEMID and
|
||||
the name ITEMNAME. Enable it if ISENABLED, else keep it
|
||||
disabled. */
|
||||
disabled.
|
||||
|
||||
If this is not a submenu and ISCHECKABLE is set, make the item
|
||||
checkable. Likewise, if ISCHECKED is set, make the item
|
||||
checked. */
|
||||
|
||||
public void
|
||||
addItem (int itemID, String itemName, boolean isEnabled)
|
||||
addItem (int itemID, String itemName, boolean isEnabled,
|
||||
boolean isCheckable, boolean isChecked)
|
||||
{
|
||||
Item item;
|
||||
|
||||
|
|
@ -119,6 +124,8 @@ public class EmacsContextMenu
|
|||
item.itemID = itemID;
|
||||
item.itemName = itemName;
|
||||
item.isEnabled = isEnabled;
|
||||
item.isCheckable = isCheckable;
|
||||
item.isChecked = isChecked;
|
||||
|
||||
menuItems.add (item);
|
||||
}
|
||||
|
|
@ -198,6 +205,15 @@ public class EmacsContextMenu
|
|||
/* If the item ID is zero, then disable the item. */
|
||||
if (item.itemID == 0 || !item.isEnabled)
|
||||
menuItem.setEnabled (false);
|
||||
|
||||
/* Now make the menu item display a checkmark as
|
||||
appropriate. */
|
||||
|
||||
if (item.isCheckable)
|
||||
menuItem.setCheckable (true);
|
||||
|
||||
if (item.isChecked)
|
||||
menuItem.setChecked (true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +99,12 @@ public class EmacsCopyArea
|
|||
if (src_y + height > srcBitmap.getHeight ())
|
||||
height = srcBitmap.getHeight () - src_y;
|
||||
|
||||
/* If width and height are empty or negative, then skip the entire
|
||||
CopyArea operation lest createBitmap throw an exception. */
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
return;
|
||||
|
||||
rect = new Rect (dest_x, dest_y, dest_x + width,
|
||||
dest_y + height);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue