From a2ef92fda01e93bbd6db3464d8926584c8e1f70d Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Thu, 8 Aug 2024 00:50:48 +0000 Subject: [PATCH] Removal of old and deprecated UIForm code. --- emulators/emulator-base-native/c/mle_pencil.c | 7 +- .../cc/squirreljme/vm/springcoat/MLEPencil.java | 19 -- .../java/cc/squirreljme/jvm/mle/PencilShelf.java | 20 -- .../jvm/mle/constants/BuiltInEncodingType.java | 11 + .../jvm/mle/constants/BuiltInLocaleType.java | 5 + .../jvm/mle/constants/ByteOrderType.java | 5 + .../jvm/mle/constants/LineEndingType.java | 8 + .../jvm/mle/constants/MemoryProfileType.java | 5 + .../jvm/mle/constants/MonitorResultType.java | 6 + .../jvm/mle/constants/NativeImageLoadType.java | 9 + .../jvm/mle/constants/PencilCapabilities.java | 161 --------------- .../jvm/mle/constants/PencilFontStyle.java | 1 + .../jvm/mle/constants/PencilShelfError.java | 37 ---- .../jvm/mle/constants/PhoneModelType.java | 8 + .../jvm/mle/constants/PipeErrorType.java | 6 + .../jvm/mle/constants/ProtectedPackages.java | 4 + .../jvm/mle/constants/StandardPipeType.java | 7 + .../jvm/mle/constants/TaskPipeRedirectType.java | 7 + .../jvm/mle/constants/TaskStatusType.java | 8 +- .../jvm/mle/constants/ThreadModelType.java | 7 + .../jvm/mle/constants/ThreadStatusType.java | 6 + .../squirreljme/jvm/mle/constants/UIFontFlag.java | 11 + .../squirreljme/jvm/mle/constants/UIInputFlag.java | 39 ---- .../jvm/mle/constants/UIItemPosition.java | 71 ------- .../jvm/mle/constants/UIKeyEventType.java | 39 ---- .../jvm/mle/constants/UIKeyModifier.java | 13 ++ .../squirreljme/jvm/mle/constants/UIListType.java | 7 + .../jvm/mle/constants/UIMetricType.java | 90 --------- .../jvm/mle/constants/UIMouseButton.java | 6 + .../jvm/mle/constants/UIMouseEventType.java | 42 ---- .../jvm/mle/constants/UIPixelFormat.java | 21 ++ .../jvm/mle/constants/UISpecialCode.java | 54 ----- .../jvm/mle/constants/VMDescriptionType.java | 17 ++ .../jvm/mle/constants/VMStatisticType.java | 9 + .../cc/squirreljme/jvm/mle/constants/VMType.java | 9 + .../jvm/mle/constants/VerboseDebugFlag.java | 22 ++ .../jvm/mle/exceptions/MLECallError.java | 1 + .../runtime/lcdui/mle/PencilGraphics.java | 1 - .../runtime/lcdui/scritchui/MenuAction.java | 1 - .../runtime/lcdui/scritchui/MenuActionTree.java | 2 +- .../runtime/lcdui/scritchui/StringTracker.java | 1 - .../lcdui/scritchui/__ExecObjectTracker__.java | 1 - .../lcdui/scritchui/__ExecUpdateMenuTree__.java | 1 - .../java/javax/microedition/lcdui/Command.java | 1 - .../java/javax/microedition/lcdui/Display.java | 68 ------- .../java/javax/microedition/lcdui/Displayable.java | 45 ----- .../lcdui/__ExecDisplayMenuItemActivate__.java | 2 - .../lcdui/__ExecDisplayableDefaultCommand__.java | 2 - .../microedition/lcdui/__ExecListActivate__.java | 1 - .../src/test/java/TestDisplayNoForm.java | 37 ---- .../src/test/java/lcdui/BaseDisplay.java | 57 ------ .../midp-lcdui/src/test/java/lcdui/BaseForm.java | 50 ----- .../src/test/java/lcdui/canvas/BaseCanvas.java | 87 -------- .../java/lcdui/canvas/TestCanvasFullScreen.java | 63 ------ .../java/lcdui/canvas/TestCanvasKeyTyping.java | 73 ------- .../test/java/lcdui/canvas/TestCanvasRepaint.java | 73 ------- .../src/test/java/lcdui/canvas/TestCanvasSize.java | 39 ---- .../lcdui/canvas/TestCanvasStandardKeyCodes.java | 49 ----- .../java/lcdui/canvas/TestCanvasValidActions.java | 40 ---- .../test/java/lcdui/display/TestCallSerially.java | 57 ------ .../lcdui/display/TestSetRemoveCurrentDisplay.java | 51 ----- .../src/test/java/lcdui/list/BaseList.java | 74 ------- .../src/test/java/lcdui/list/ListItem.java | 199 ------------------ .../test/java/lcdui/list/SelectionListener.java | 56 ------ .../test/java/lcdui/list/TestItemAddRemove.java | 71 ------- .../java/lcdui/list/TestSelectionCommands.java | 91 --------- .../src/test/java/lcdui/list/TestSelections.java | 77 ------- .../src/test/java/lcdui/list/package-info.java | 16 -- .../src/test/java/mleui/BaseBackend.java | 87 -------- .../src/test/java/mleui/FailingExecution.java | 30 --- .../src/test/java/mleui/TestDisplayMetrics.java | 193 ------------------ .../src/test/java/mleui/forms/BaseUIForm.java | 72 ------- .../test/java/mleui/forms/FormTestException.java | 30 --- .../src/test/java/mleui/forms/TestAllSpecial.java | 74 ------- .../src/test/java/mleui/forms/TestCreateItems.java | 46 ----- .../java/mleui/forms/TestDeleteVisibleItem.java | 50 ----- .../test/java/mleui/forms/TestFormItemCounts.java | 76 ------- .../test/java/mleui/forms/TestFormProperties.java | 222 --------------------- .../test/java/mleui/forms/TestItemDragging.java | 73 ------- .../test/java/mleui/forms/TestItemFormOwner.java | 52 ----- .../test/java/mleui/forms/TestItemRemoveShift.java | 83 -------- .../java/mleui/forms/TestShowBlankDisplay.java | 34 ---- .../src/test/java/mleui/forms/TestShowItems.java | 49 ----- .../java/mleui/forms/TestUseItemAfterDelete.java | 51 ----- .../src/test/java/mleui/forms/__Holder__.java | 34 ---- .../src/test/java/mleui/forms/package-info.java | 17 -- .../java/mleui/invalid/TestUIFormShelfInvalid.java | 196 ------------------ .../src/test/java/mleui/invalid/package-info.java | 17 -- .../src/test/java/mleui/lists/BaseList.java | 79 -------- .../src/test/java/mleui/lists/ListCallback.java | 106 ---------- .../src/test/java/mleui/lists/ListItem.java | 146 -------------- .../mleui/lists/TestInvalidListProperties.java | 47 ----- .../test/java/mleui/lists/TestListIconImage.java | 67 ------- .../test/java/mleui/lists/TestListItemReset.java | 109 ---------- .../src/test/java/mleui/lists/TestListSize.java | 59 ------ .../src/test/java/mleui/lists/package-info.java | 16 -- .../src/test/java/mleui/package-info.java | 18 -- .../resources/lcdui/canvas/TestCanvasFullScreen.in | 7 - .../resources/lcdui/canvas/TestCanvasKeyTyping.in | 4 - .../resources/lcdui/canvas/TestCanvasRepaint.in | 3 - .../test/resources/lcdui/canvas/TestCanvasSize.in | 4 - .../lcdui/canvas/TestCanvasStandardKeyCodes.in | 3 - .../lcdui/canvas/TestCanvasValidActions.in | 3 - .../resources/lcdui/display/TestCallSerially.in | 3 - .../lcdui/display/TestSetRemoveCurrentDisplay.in | 5 - .../src/test/resources/lcdui/list/BaseList.in | 2 - .../test/resources/lcdui/list/TestItemAddRemove.in | 10 - .../resources/lcdui/list/TestSelectionCommands.in | 9 - .../lcdui/list/TestSelections@EXCLUSIVE.in | 12 -- .../lcdui/list/TestSelections@IMPLICIT.in | 12 -- .../lcdui/list/TestSelections@MULTIPLE.in | 12 -- .../src/test/resources/mleui/BaseBackend.in | 5 - .../src/test/resources/mleui/TestDisplayMetrics.in | 20 -- .../src/test/resources/mleui/TestDisplayNoForm.in | 3 - .../test/resources/mleui/forms/TestAllSpecial.in | 2 - .../test/resources/mleui/forms/TestCreateItems.in | 16 -- .../resources/mleui/forms/TestDeleteVisibleItem.in | 2 - .../resources/mleui/forms/TestFormItemCounts.in | 55 ----- .../resources/mleui/forms/TestFormProperties.in | 27 --- .../test/resources/mleui/forms/TestItemDragging.in | 31 --- .../resources/mleui/forms/TestItemFormOwner.in | 6 - .../resources/mleui/forms/TestItemRemoveShift.in | 45 ----- .../resources/mleui/forms/TestShowBlankDisplay.in | 2 - .../test/resources/mleui/forms/TestShowItems.in | 16 -- .../mleui/forms/TestUseItemAfterDelete.in | 2 - .../mleui/invalid/TestUIFormShelfInvalid.in | 6 - .../mleui/lists/TestInvalidListProperties.in | 4 - .../resources/mleui/lists/TestListIconImage.in | 4 - .../resources/mleui/lists/TestListItemReset.in | 11 - .../src/test/resources/mleui/lists/TestListSize.in | 7 - .../jvm/mle/scritchui/ScritchMenuInterface.java | 4 +- 131 files changed, 222 insertions(+), 4452 deletions(-) delete mode 100644 modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilCapabilities.java delete mode 100644 modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilShelfError.java delete mode 100644 modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIInputFlag.java delete mode 100644 modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIItemPosition.java delete mode 100644 modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIKeyEventType.java delete mode 100644 modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMetricType.java delete mode 100644 modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMouseEventType.java delete mode 100644 modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UISpecialCode.java delete mode 100644 modules/midp-lcdui/src/test/java/TestDisplayNoForm.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/BaseDisplay.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/BaseForm.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/canvas/BaseCanvas.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasFullScreen.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasKeyTyping.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasRepaint.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasSize.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasStandardKeyCodes.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasValidActions.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/display/TestCallSerially.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/display/TestSetRemoveCurrentDisplay.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/list/BaseList.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/list/ListItem.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/list/SelectionListener.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/list/TestItemAddRemove.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/list/TestSelectionCommands.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/list/TestSelections.java delete mode 100644 modules/midp-lcdui/src/test/java/lcdui/list/package-info.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/BaseBackend.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/FailingExecution.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/TestDisplayMetrics.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/BaseUIForm.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/FormTestException.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestAllSpecial.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestCreateItems.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestDeleteVisibleItem.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestFormItemCounts.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestFormProperties.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestItemDragging.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestItemFormOwner.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestItemRemoveShift.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestShowBlankDisplay.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestShowItems.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/TestUseItemAfterDelete.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/__Holder__.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/forms/package-info.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/invalid/TestUIFormShelfInvalid.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/invalid/package-info.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/lists/BaseList.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/lists/ListCallback.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/lists/ListItem.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/lists/TestInvalidListProperties.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/lists/TestListIconImage.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/lists/TestListItemReset.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/lists/TestListSize.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/lists/package-info.java delete mode 100644 modules/midp-lcdui/src/test/java/mleui/package-info.java delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasFullScreen.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasKeyTyping.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasRepaint.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasSize.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasStandardKeyCodes.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasValidActions.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/display/TestCallSerially.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/display/TestSetRemoveCurrentDisplay.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/list/BaseList.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/list/TestItemAddRemove.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/list/TestSelectionCommands.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@EXCLUSIVE.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@IMPLICIT.in delete mode 100644 modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@MULTIPLE.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/BaseBackend.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/TestDisplayMetrics.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/TestDisplayNoForm.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestAllSpecial.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestCreateItems.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestDeleteVisibleItem.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestFormItemCounts.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestFormProperties.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestItemDragging.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestItemFormOwner.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestItemRemoveShift.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestShowBlankDisplay.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestShowItems.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/forms/TestUseItemAfterDelete.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/invalid/TestUIFormShelfInvalid.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/lists/TestInvalidListProperties.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/lists/TestListIconImage.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/lists/TestListItemReset.in delete mode 100644 modules/midp-lcdui/src/test/resources/mleui/lists/TestListSize.in diff --git a/emulators/emulator-base-native/c/mle_pencil.c b/emulators/emulator-base-native/c/mle_pencil.c index dee963d8a9..472cb44961 100644 --- a/emulators/emulator-base-native/c/mle_pencil.c +++ b/emulators/emulator-base-native/c/mle_pencil.c @@ -63,7 +63,6 @@ DESC_PENCIL DESC_INT DESC_INT ")" DESC_VOID /* Forwards */ -#define FORWARD_DESC_capabilities "(I)I" #define FORWARD_DESC_nativeImageLoadRGBA \ "(I[BIILcc/squirreljme/jvm/mle/callbacks/NativeImageLoadCallback;)" \ "Ljava/lang/Object;" @@ -450,10 +449,7 @@ JNIEXPORT void JNICALL FORWARD_FUNC_NAME(PencilShelf, hardwareTranslate) if (sjme_error_is(error = p->api->translate(p, x, y))) sjme_jni_throwMLECallError(env, error);\ } - -FORWARD_IMPL(PencilShelf, capabilities, jint, Integer, \ - FORWARD_IMPL_args(jint pixelFormat), \ - FORWARD_IMPL_pass(pixelFormat)) + FORWARD_IMPL(PencilShelf, nativeImageLoadRGBA, jobject, Object, \ FORWARD_IMPL_args(jint type, jbyteArray buf, jint off, jint len, \ jobject callback), \ @@ -463,7 +459,6 @@ FORWARD_IMPL(PencilShelf, nativeImageLoadTypes, jint, Integer, \ static const JNINativeMethod mlePencilMethods[] = { - FORWARD_list(PencilShelf, capabilities), FORWARD_list(PencilShelf, hardwareCopyArea), FORWARD_list(PencilShelf, hardwareDrawChars), FORWARD_list(PencilShelf, hardwareDrawHoriz), diff --git a/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLEPencil.java b/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLEPencil.java index 5e7576e4a1..f7206e7654 100644 --- a/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLEPencil.java +++ b/emulators/springcoat-vm/src/main/java/cc/squirreljme/vm/springcoat/MLEPencil.java @@ -33,25 +33,6 @@ import javax.microedition.lcdui.ScalableImage; public enum MLEPencil implements MLEFunction { - /** {@link PencilShelf#capabilities(int)}. */ - CAPABILITIES("capabilities:(I)I") - { - /** - * {@inheritDoc} - * @since 2020/09/26 - */ - @Override - public Object handle(SpringThreadWorker __thread, Object... __args) - { - int pf = (int)__args[0]; - if (pf < 0 || pf >= UIPixelFormat.NUM_PIXEL_FORMATS) - throw new SpringMLECallError("Invalid pixel format: " + - pf); - - return 0xFFFFFFFF; - } - }, - /** * {@link PencilShelf#hardwareCopyArea(PencilBracket, int, int, int, int, * int, int, int)}. diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/PencilShelf.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/PencilShelf.java index 3da6205148..4df048ade6 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/PencilShelf.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/PencilShelf.java @@ -13,8 +13,6 @@ import cc.squirreljme.jvm.mle.brackets.PencilBracket; import cc.squirreljme.jvm.mle.brackets.PencilFontBracket; import cc.squirreljme.jvm.mle.callbacks.NativeImageLoadCallback; import cc.squirreljme.jvm.mle.constants.NativeImageLoadType; -import cc.squirreljme.jvm.mle.constants.PencilCapabilities; -import cc.squirreljme.jvm.mle.constants.UIPixelFormat; import cc.squirreljme.jvm.mle.exceptions.MLECallError; import cc.squirreljme.runtime.cldc.annotation.Api; import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; @@ -45,24 +43,6 @@ public final class PencilShelf } /** - * Returns the capabilities of the native possibly hardware accelerated - * pencil graphics drawing for the given pixel format. - * - * @param __pf The {@link UIPixelFormat} being used for drawing. - * @throws MLECallError If the pixel format is not valid. - * @return The capabilities, will be the bit-field of - * {@link PencilCapabilities}. If there is not capability for this format - * then {@code 0} will be returned. - * @since 2020/09/25 - */ - @SquirrelJMEVendorApi - @CheckReturnValue - @MagicConstant(flagsFromClass = PencilCapabilities.class) - public static native int capabilities( - @MagicConstant(valuesFromClass = UIPixelFormat.class) int __pf) - throws MLECallError; - - /** * This copies one region of the image to another region. * * Copying to a display device is not permitted because it may impact how diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/BuiltInEncodingType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/BuiltInEncodingType.java index 4d0c2cfd4f..e51bb649af 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/BuiltInEncodingType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/BuiltInEncodingType.java @@ -9,42 +9,53 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Encoding IDs which are built-in to SquirrelJME. * * @since 2020/04/07 */ +@SquirrelJMEVendorApi public interface BuiltInEncodingType { /** Unspecified, use defined property or assume UTF-8. */ + @SquirrelJMEVendorApi byte UNSPECIFIED = 0; /** UTF-8. */ + @SquirrelJMEVendorApi byte UTF8 = 1; /** ASCII. */ + @SquirrelJMEVendorApi byte ASCII = 2; /** IBM037 (EBCDIC). */ + @SquirrelJMEVendorApi byte IBM037 = 3; /** ISO-8859-1. */ + @SquirrelJMEVendorApi byte ISO_8859_1 = 4; /** ISO-8859-15. */ + @SquirrelJMEVendorApi byte ISO_8859_15 = 5; /** Shift-JIS. */ + @SquirrelJMEVendorApi byte SHIFT_JIS = 6; /** The number of built-in encodings. */ + @SquirrelJMEVendorApi byte NUM_BUILTIN_ENCODINGS = 7; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/BuiltInLocaleType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/BuiltInLocaleType.java index 0ed1d365c5..9858e2381a 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/BuiltInLocaleType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/BuiltInLocaleType.java @@ -9,18 +9,23 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Represents a locale which is built-in. * * @since 2020/06/11 */ +@SquirrelJMEVendorApi public interface BuiltInLocaleType { /** Unspecified. */ + @SquirrelJMEVendorApi byte UNSPECIFIED = 0; /** English, US. */ + @SquirrelJMEVendorApi byte ENGLISH_US = 1; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ByteOrderType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ByteOrderType.java index 70fb17b1ec..5cbdb780d1 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ByteOrderType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ByteOrderType.java @@ -9,18 +9,23 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Specifies the byte order that is used. * * @since 2021/02/09 */ +@SquirrelJMEVendorApi public interface ByteOrderType { /** Big endian. */ + @SquirrelJMEVendorApi byte BIG_ENDIAN = 0; /** Little endian. */ + @SquirrelJMEVendorApi byte LITTLE_ENDIAN = 1; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/LineEndingType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/LineEndingType.java index b642ed5226..abf78ed714 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/LineEndingType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/LineEndingType.java @@ -9,30 +9,38 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Constants for line ending. * * @since 2020/06/09 */ +@SquirrelJMEVendorApi public interface LineEndingType { /** Unknown. */ + @SquirrelJMEVendorApi byte UNSPECIFIED = 0; /** LF. */ + @SquirrelJMEVendorApi byte LF = 1; /** CR. */ + @SquirrelJMEVendorApi byte CR = 2; /** CRLF. */ + @SquirrelJMEVendorApi byte CRLF = 3; /** Number of line types. */ + @SquirrelJMEVendorApi byte NUM_LINE_ENDINGS = 4; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/MemoryProfileType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/MemoryProfileType.java index f57afde7b0..1553432c1d 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/MemoryProfileType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/MemoryProfileType.java @@ -9,18 +9,23 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * The type of memory profile that is used. * * @since 2021/02/19 */ +@SquirrelJMEVendorApi public interface MemoryProfileType { /** Minimal memory. */ + @SquirrelJMEVendorApi byte MINIMAL = -1; /** Normal memory. */ + @SquirrelJMEVendorApi byte NORMAL = 0; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/MonitorResultType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/MonitorResultType.java index b451fea9f4..41cb0db0c8 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/MonitorResultType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/MonitorResultType.java @@ -9,22 +9,28 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * The type of signal generated from the monitor. * * @since 2020/06/22 */ +@SquirrelJMEVendorApi public interface MonitorResultType { /** NOT_INTERRUPTED. */ + @SquirrelJMEVendorApi byte NOT_INTERRUPTED = 1; /** Interrupted. */ + @SquirrelJMEVendorApi byte INTERRUPTED = 0; /** The object is not owned. */ + @SquirrelJMEVendorApi byte NOT_OWNED = -1; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/NativeImageLoadType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/NativeImageLoadType.java index fb37922cb9..66f7322d87 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/NativeImageLoadType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/NativeImageLoadType.java @@ -9,34 +9,43 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Represents the types of images that are supported in image load. * * @since 2021/12/05 */ +@SquirrelJMEVendorApi public interface NativeImageLoadType { /** Native loading of PNGs. */ + @SquirrelJMEVendorApi int LOAD_PNG = 1; /** Native loading of GIFs. */ + @SquirrelJMEVendorApi int LOAD_GIF = 2; /** Native loading of JPEGs. */ + @SquirrelJMEVendorApi int LOAD_JPEG = 4; /** Native loading of XPMs. */ + @SquirrelJMEVendorApi int LOAD_XPM = 8; /** SVG. */ + @SquirrelJMEVendorApi int LOAD_SVG = 16; /** All types. */ + @SquirrelJMEVendorApi int ALL_TYPES = NativeImageLoadType.LOAD_PNG | NativeImageLoadType.LOAD_GIF | NativeImageLoadType.LOAD_JPEG | diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilCapabilities.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilCapabilities.java deleted file mode 100644 index d0b78e0735..0000000000 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilCapabilities.java +++ /dev/null @@ -1,161 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package cc.squirreljme.jvm.mle.constants; - -/** - * Capabilities for the hardware accelerated pencil graphics drawing. - * - * This interface contains bit-fields. - * - * @since 2020/09/25 - */ -public interface PencilCapabilities -{ - /** - * Minimum capabilities required by the implementation, this includes all - * of that state operations such as: transforms, clips, colors, styles, - * and otherwise. - * - * Capable of the following: - * - {@code clipRect}. - * - {@code getAlpha}. - * - {@code getAlphaColor}. - * - {@code getBlendingMode}. - * - {@code getBlueComponent}. - * - {@code getClipHeight}. - * - {@code getClipWidth}. - * - {@code getClipX}. - * - {@code getClipY}. - * - {@code getColor}. - * - {@code getDisplayColor}. - * - {@code getGrayScale}. - * - {@code getGreenComponent}. - * - {@code getRedComponent}. - * - {@code getStrokeStyle}. - * - {@code getTranslateX}. - * - {@code getTranslateY}. - * - {@code setAlpha}. - * - {@code setAlphaColor}. - * - {@code setBlendingMode}. - * - {@code setClip}. - * - {@code setColor}. - * - {@code setGrayScale}. - * - {@code setStrokeStyle}. - * - {@code translate}. - */ - byte MINIMUM = - 1; - - /** - * Capable of the following: - * - {@code copyArea}. - */ - byte COPY_AREA = - 2; - - /** - * Capable of the following: - * - {@code drawARGB16}. - * - {@code drawRGB16}. - */ - byte DRAW_XRGB16_SIMPLE = - 4; - - /** - * Reserved. - */ - @Deprecated - byte RESERVED_8 = - 8; - - /** - * Capable of the following: - * - {@code drawText}. - */ - byte TEXT_ADVANCED = - 16; - - /** - * Capable of the following: - * - {@code drawRGB}. - * - {@code drawImage}. - * - {@code drawRegion}. - */ - byte DRAW_XRGB32_REGION = - 32; - - /** - * Capable of the following: - * - {@code drawArc}. - */ - byte DRAW_ARC = - 64; - - /** - * Capable of the following: - * - {@code drawLine}. - */ - short DRAW_LINE = - 128; - - /** - * Capable of the following: - * - {@code drawRect}. - */ - short DRAW_RECT = - 256; - - /** - * Capable of the following: - * - {@code drawRoundRect}. - */ - short DRAW_ROUND_RECT = - 512; - - /** - * Capable of the following: - * - {@code fillArc}. - */ - short FILL_ARC = - 1024; - - /** - * Capable of the following: - * - {@code fillRect}. - */ - short FILL_RECT = - 2048; - - /** - * Capable of the following: - * - {@code fillRoundRect}. - */ - short FILL_ROUND_RECT = - 4096; - - /** - * Capable of the following: - * - {@code fillTriangle}. - */ - short FILL_TRIANGLE = - 8192; - - /** - * Capable of the following: - * - {@code drawChar}. - * - {@code drawChars}. - * - {@code drawString}. - * - {@code drawSubstring}. - * - {@code getFont}. - * - {@code setFont}. - */ - short TEXT_BASIC = - 16384; -} diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilFontStyle.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilFontStyle.java index 5f8a85d478..3a80909533 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilFontStyle.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilFontStyle.java @@ -17,6 +17,7 @@ import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; * * @since 2024/05/17 */ +@SquirrelJMEVendorApi public interface PencilFontStyle { /** Bold text. */ diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilShelfError.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilShelfError.java deleted file mode 100644 index bfec5b4f10..0000000000 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PencilShelfError.java +++ /dev/null @@ -1,37 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// Multi-Phasic Applications: SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package cc.squirreljme.jvm.mle.constants; - -import cc.squirreljme.jvm.mle.PencilShelf; -import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; - -/** - * Errors for {@link PencilShelf}. - * - * @since 2023/02/19 - */ -@SquirrelJMEVendorApi -public interface PencilShelfError -{ - /** {@link IllegalArgumentException}. */ - @SquirrelJMEVendorApi - byte ILLEGAL_ARGUMENT = - 1; - - /** {@link IllegalStateException}. */ - @SquirrelJMEVendorApi - byte ILLEGAL_STATE = - 2; - - /** {@link java.lang.IndexOutOfBoundsException}. */ - @SquirrelJMEVendorApi - byte INDEX_OUT_OF_BOUNDS = - 3; -} diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PhoneModelType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PhoneModelType.java index 5073a987d6..a58ae29228 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PhoneModelType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PhoneModelType.java @@ -9,30 +9,38 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * This represents potential simulated phone models. * * @since 2022/02/14 */ +@SquirrelJMEVendorApi public interface PhoneModelType { /** Generic SquirrelJME. */ + @SquirrelJMEVendorApi byte GENERIC = 0; /** NTT Docomo D503i. */ + @SquirrelJMEVendorApi byte NTT_DOCOMO_D503I = 1; /** NTT Docomo F503i. */ + @SquirrelJMEVendorApi byte NTT_DOCOMO_F503I = 2; /** NTT Docomo So503i. */ + @SquirrelJMEVendorApi byte NTT_DOCOMO_SO503I = 3; /** NTT Docomo P503i. */ + @SquirrelJMEVendorApi byte NTT_DOCOMO_P503I = 4; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PipeErrorType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PipeErrorType.java index 3e796ac19b..11b11d5b95 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PipeErrorType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/PipeErrorType.java @@ -9,22 +9,28 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Represents the type of error that occurred on a pipe. * * @since 2020/07/06 */ +@SquirrelJMEVendorApi public interface PipeErrorType { /** No error. */ + @SquirrelJMEVendorApi byte NO_ERROR = 0; /** End of file reached. */ + @SquirrelJMEVendorApi byte END_OF_FILE = -1; /** Read/write error. */ + @SquirrelJMEVendorApi byte IO_EXCEPTION = -2; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ProtectedPackages.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ProtectedPackages.java index 445335e45c..d27e287d3b 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ProtectedPackages.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ProtectedPackages.java @@ -9,12 +9,15 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * This class contains all of the packages which are protected and are not * permitted to have additional classes added within. * * @since 2020/06/21 */ +@SquirrelJMEVendorApi public final class ProtectedPackages { /** @@ -38,6 +41,7 @@ public final class ProtectedPackages * @throws NullPointerException On null arguments. * @since 2020/06/21 */ + @SquirrelJMEVendorApi public static boolean isProtectedPackage(String __name) throws IllegalArgumentException, NullPointerException { diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/StandardPipeType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/StandardPipeType.java index 6bb2fe2aab..fbdca43e3a 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/StandardPipeType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/StandardPipeType.java @@ -9,26 +9,33 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Standard pipe descriptor identifiers. * * @since 2020/06/14 */ +@SquirrelJMEVendorApi public interface StandardPipeType { /** Standard input. */ + @SquirrelJMEVendorApi byte STDIN = 0; /** Standard output. */ + @SquirrelJMEVendorApi byte STDOUT = 1; /** Standard error. */ + @SquirrelJMEVendorApi byte STDERR = 2; /** The number of standard pipes. */ + @SquirrelJMEVendorApi byte NUM_STANDARD_PIPES = 3; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/TaskPipeRedirectType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/TaskPipeRedirectType.java index 8a86397acc..30d7496509 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/TaskPipeRedirectType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/TaskPipeRedirectType.java @@ -9,27 +9,34 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * This represents the types of redirects that may occur for a launched task * when it is given a pipe. * * @since 2020/07/02 */ +@SquirrelJMEVendorApi public interface TaskPipeRedirectType { /** Discard all program output. */ + @SquirrelJMEVendorApi byte DISCARD = 0; /** Buffer the resultant program's output. */ + @SquirrelJMEVendorApi byte BUFFER = 1; /** Send the output to the virtual machine's terminal output. */ + @SquirrelJMEVendorApi byte TERMINAL = 2; /** The number of redirect types. */ + @SquirrelJMEVendorApi byte NUM_REDIRECT_TYPES = 3; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/TaskStatusType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/TaskStatusType.java index 43e086518c..98854af78d 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/TaskStatusType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/TaskStatusType.java @@ -9,22 +9,28 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * This represents the status of a task. * * @since 2020/07/02 */ +@SquirrelJMEVendorApi public interface TaskStatusType { /** The task has exited. */ + @SquirrelJMEVendorApi byte EXITED = 0; /** The task is alive. */ + @SquirrelJMEVendorApi byte ALIVE = 1; /** The number of status types. */ - byte NUM_TAS_STATUSES = + @SquirrelJMEVendorApi + byte NUM_TASK_STATUSES = 2; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ThreadModelType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ThreadModelType.java index b8c1265a2d..8e72f123d3 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ThreadModelType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ThreadModelType.java @@ -9,26 +9,33 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * This represents the thread model type. * * @since 2021/05/07 */ +@SquirrelJMEVendorApi public interface ThreadModelType { /** Invalid model. */ + @SquirrelJMEVendorApi byte INVALID = 0; /** Single cooperatively threaded. */ + @SquirrelJMEVendorApi byte SINGLE_COOP_THREAD = 1; /** Simultaneous Multi-threaded. */ + @SquirrelJMEVendorApi byte SIMULTANEOUS_MULTI_THREAD = 2; /** The number of threading models. */ + @SquirrelJMEVendorApi byte NUM_MODELS = 3; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ThreadStatusType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ThreadStatusType.java index b0aeae73c6..adf36e4638 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ThreadStatusType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/ThreadStatusType.java @@ -9,22 +9,28 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * The status on what a {@link Thread} is doing. * * @since 2021/03/15 */ +@SquirrelJMEVendorApi public interface ThreadStatusType { /** Running. */ + @SquirrelJMEVendorApi byte RUNNING = 0; /** Sleeping. */ + @SquirrelJMEVendorApi byte SLEEPING = 1; /** Waiting on a monitor. */ + @SquirrelJMEVendorApi byte MONITOR_WAIT = 2; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIFontFlag.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIFontFlag.java index 2f22cf17e4..b1600dcb26 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIFontFlag.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIFontFlag.java @@ -9,42 +9,53 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Flags used for font information. * * @since 2020/11/14 */ +@SquirrelJMEVendorApi public interface UIFontFlag { /** Pixel size mask. */ + @SquirrelJMEVendorApi byte PIXEL_SIZE_MASK = 0x7F; /** The monospace font. */ + @SquirrelJMEVendorApi short FACE_MONOSPACE = 0x02_00; /** Proportional fonts. */ + @SquirrelJMEVendorApi short FACE_PROPORTIONAL = 0x01_00; /** The system font. */ + @SquirrelJMEVendorApi short FACE_SYSTEM = 0x00_00; /** Font face mask. */ + @SquirrelJMEVendorApi short FACE_MASK = 0x7F_00; /** Bold text. */ + @SquirrelJMEVendorApi int STYLE_BOLD_FLAG = 0x1000_0000; /** Italic (slanted) text. */ + @SquirrelJMEVendorApi int STYLE_ITALIC_FLAG = 0x2000_0000; /** Underlined text. */ + @SquirrelJMEVendorApi int STYLE_UNDERLINED_FLAG = 0x4000_0000; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIInputFlag.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIInputFlag.java deleted file mode 100644 index 03eee483b6..0000000000 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIInputFlag.java +++ /dev/null @@ -1,39 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package cc.squirreljme.jvm.mle.constants; - -/** - * Bit field for input types that are supported. - * - * @since 2020/10/03 - */ -public interface UIInputFlag -{ - /** Has gamepad input. */ - byte GAMEPAD = - 1; - - /** Has keyboard input. */ - byte KEYBOARD = - 2; - - /** Has pointer input. */ - byte POINTER = - 4; - - /** Has pointer motion. */ - byte POINTER_MOTION = - 8; - - /** All input types. */ - byte ALL_MASK = - UIInputFlag.GAMEPAD | UIInputFlag.KEYBOARD | - UIInputFlag.POINTER | UIInputFlag.POINTER_MOTION; -} diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIItemPosition.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIItemPosition.java deleted file mode 100644 index e90abf4e82..0000000000 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIItemPosition.java +++ /dev/null @@ -1,71 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package cc.squirreljme.jvm.mle.constants; - -/** - * These indexes in this class are the special form indexes which specify that - * certain form items be placed in a special position. - * - * All of these values are negative and there is {@link #MIN_VALUE} that - * is permitted. - * - * @since 2020/06/30 - */ -@Deprecated -public interface UIItemPosition -{ - /** The left command button. */ - @Deprecated - byte LEFT_COMMAND = - -1; - - /** The right command button. */ - @Deprecated - byte RIGHT_COMMAND = - -2; - - /** The main title which is at the top of the form always. */ - @Deprecated - byte TITLE = - -3; - - /** - * The ticker position which is always below the title, a scrolling effect - * may happen on the item. - */ - @Deprecated - byte TICKER = - -4; - - /** The body of the form, this acts as a "full-screen" view. */ - @Deprecated - byte BODY = - -5; - - /** The touch-screen control interface. */ - @Deprecated - byte TOUCH_CONTROLS = - -6; - - /** The lowest permitted value, no value can be lower than this. */ - @Deprecated - byte MIN_VALUE = - -6; - - /** The number of special items, for shifting. */ - @Deprecated - byte SPECIAL_SHIFT = - 6; - - /** The item is not on the form. */ - @Deprecated - int NOT_ON_FORM = - Integer.MIN_VALUE; -} diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIKeyEventType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIKeyEventType.java deleted file mode 100644 index 16219cd3de..0000000000 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIKeyEventType.java +++ /dev/null @@ -1,39 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package cc.squirreljme.jvm.mle.constants; - -/** - * Key events for - * {@link UIFormCallback#eventKey(cc.squirreljme.jvm.mle.brackets.UIDrawableBracket, int, int, int)}. - * - * @since 2020/07/19 - */ -public interface UIKeyEventType -{ - /** Key pressed. */ - byte KEY_PRESSED = - 0; - - /** Key released. */ - byte KEY_RELEASE = - 1; - - /** Key repeated. */ - byte KEY_REPEATED = - 2; - - /** Command activated (special). */ - byte COMMAND_ACTIVATED = - 3; - - /** The number of key events. */ - byte NUM_KEY_EVENTS = - 4; -} diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIKeyModifier.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIKeyModifier.java index f1db2d693f..af4ee7cfb2 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIKeyModifier.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIKeyModifier.java @@ -9,53 +9,66 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Modifier keys for when key and mouse events occur. * * @since 2020/08/02 */ +@SquirrelJMEVendorApi public interface UIKeyModifier { /** Alt key modifier. */ + @SquirrelJMEVendorApi int MODIFIER_ALT = 0x10000; /** Shift key modifier. */ + @SquirrelJMEVendorApi int MODIFIER_SHIFT = 0x20000; /** Control (Ctrl) key modifier. */ + @SquirrelJMEVendorApi int MODIFIER_CTRL = 0x40000; /** Left Command Button. (SquirrelJME). */ + @SquirrelJMEVendorApi int MODIFIER_LEFT_COMMAND = 0x80000; /** Right Command button. (SquirrelJME). */ + @SquirrelJMEVendorApi int MODIFIER_RIGHT_COMMAND = 0x100000; /** Command key modifier. */ + @SquirrelJMEVendorApi int MODIFIER_COMMAND = 0x400000; /** The Function key. */ + @SquirrelJMEVendorApi int MODIFIER_FUNCTION = 0x800000; /** Left and right commands, used for middle command. */ + @SquirrelJMEVendorApi int MODIFIER_LEFT_RIGHT_COMMANDS = UIKeyModifier.MODIFIER_LEFT_COMMAND | UIKeyModifier.MODIFIER_RIGHT_COMMAND; /** Mask specifically for the limits of J2ME. */ + @SquirrelJMEVendorApi int J2ME_MASK = UIKeyModifier.MODIFIER_ALT | UIKeyModifier.MODIFIER_FUNCTION | UIKeyModifier.MODIFIER_COMMAND | UIKeyModifier.MODIFIER_CTRL | UIKeyModifier.MODIFIER_SHIFT; /** Mask for all the modifier keys. */ + @SquirrelJMEVendorApi int MASK = UIKeyModifier.J2ME_MASK | UIKeyModifier.MODIFIER_LEFT_RIGHT_COMMANDS; diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIListType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIListType.java index e17829e798..c4303ef720 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIListType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIListType.java @@ -9,14 +9,18 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * The type of list to use. * * @since 2020/10/17 */ +@SquirrelJMEVendorApi public interface UIListType { /** Only one element may be selected at a time. */ + @SquirrelJMEVendorApi byte EXCLUSIVE = 0; @@ -24,14 +28,17 @@ public interface UIListType * The item that is focused is always the only one selected, pressing an * action key (like enter/space) will activate the item. */ + @SquirrelJMEVendorApi byte IMPLICIT = 1; /** Any number of items may be selected. */ + @SquirrelJMEVendorApi byte MULTIPLE = 2; /** The number of list types. */ + @SquirrelJMEVendorApi byte NUM_LIST_TYPES = 3; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMetricType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMetricType.java deleted file mode 100644 index 6308d1c192..0000000000 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMetricType.java +++ /dev/null @@ -1,90 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package cc.squirreljme.jvm.mle.constants; - -/** - * This contains information on UI metrics used by - * {@link UIFormShelf#metric(cc.squirreljme.jvm.mle.brackets.UIDisplayBracket, int)}. - * - * @since 2020/06/30 - */ -@Deprecated -public interface UIMetricType -{ - /** Is the UI form engine supported? This metric always works. */ - @Deprecated - byte UIFORMS_SUPPORTED = - 0; - - /** Background color for opaque canvases. */ - @Deprecated - byte COLOR_CANVAS_BACKGROUND = - 1; - - /** The maximum display width. */ - @Deprecated - byte DISPLAY_MAX_WIDTH = - 2; - - /** The maximum display height. */ - @Deprecated - byte DISPLAY_MAX_HEIGHT = - 3; - - /** The current display width. */ - @Deprecated - byte DISPLAY_CURRENT_WIDTH = - 4; - - /** The current display height. */ - @Deprecated - byte DISPLAY_CURRENT_HEIGHT = - 5; - - /** Is the display monochromatic? */ - @Deprecated - byte DISPLAY_MONOCHROMATIC = - 6; - - /** Returns the {@link UIPixelFormat} of the display. */ - @Deprecated - byte DISPLAY_PIXEL_FORMAT = - 7; - - /** Returns the {@link UIInputFlag} that determine how the UI controls. */ - @Deprecated - byte INPUT_FLAGS = - 8; - - /** Is vibration supported? */ - @Deprecated - byte SUPPORTS_VIBRATION = - 9; - - /** The height of list items. */ - @Deprecated - byte LIST_ITEM_HEIGHT = - 10; - - /** The height of the command bar. */ - @Deprecated - byte COMMAND_BAR_HEIGHT = - 11; - - /** Supports controlling the backlight. */ - @Deprecated - byte SUPPORTS_BACKLIGHT_CONTROL = - 12; - - /** The number of supported metrics. */ - @Deprecated - byte NUM_METRICS = - 13; -} diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMouseButton.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMouseButton.java index 544cfaaa94..9cbeb5d5bc 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMouseButton.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMouseButton.java @@ -9,22 +9,28 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Represents the mouse button that was used. * * @since 2020/07/19 */ +@SquirrelJMEVendorApi public interface UIMouseButton { /** Primary mouse button. */ + @SquirrelJMEVendorApi byte PRIMARY_BUTTON = 0; /** Secondary mouse button. */ + @SquirrelJMEVendorApi byte SECONDARY_BUTTON = 1; /** The number of buttons. */ + @SquirrelJMEVendorApi byte NUM_BUTTONS = 2; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMouseEventType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMouseEventType.java deleted file mode 100644 index 92b667ebc6..0000000000 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIMouseEventType.java +++ /dev/null @@ -1,42 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package cc.squirreljme.jvm.mle.constants; - -/** - * Mouse event for {@link UIFormCallback#eventMouse(cc.squirreljme.jvm.mle.brackets.UIDrawableBracket, int, int, int, int, int)}. - * - * @since 2020/07/19 - */ -public interface UIMouseEventType -{ - /** Mouse down. */ - byte MOUSE_DOWN = - 0; - - /** Mouse up. */ - byte MOUSE_UP = - 1; - - /** Mouse dragged. */ - byte MOUSE_DRAGGED = - 2; - - /** Mouse entered. */ - byte MOUSE_ENTERED = - 3; - - /** Mouse exited. */ - byte MOUSE_EXITED = - 4; - - /** The number of events. */ - byte NUM_MOUSE_EVENTS = - 5; -} diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIPixelFormat.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIPixelFormat.java index 72eca4334d..700a898f28 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIPixelFormat.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UIPixelFormat.java @@ -9,82 +9,103 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Pixel format used for user interface drawing and otherwise. * * @since 2020/09/20 */ +@SquirrelJMEVendorApi public interface UIPixelFormat { /** 32-bit RGBA ({@code int}) [Java ME Standard]. */ + @SquirrelJMEVendorApi byte INT_ARGB8888 = 0; /** 32-bit RGB ({@code int}) [Java ME Standard]. */ + @SquirrelJMEVendorApi byte INT_RGB888 = 1; /** 16-bit ARGB4444. ({@code short}) [Java ME Standard]. */ + @SquirrelJMEVendorApi byte SHORT_ARGB4444 = 2; /** 16-bit RGB565. ({@code short}) [Java ME Standard]. */ + @SquirrelJMEVendorApi byte SHORT_RGB565 = 3; /** 16-bit RGB555. ({@code short}). */ + @SquirrelJMEVendorApi byte SHORT_RGB555 = 4; /** 16-bit ABGR1555. ({@code short}) [PlayStation 2]. */ + @SquirrelJMEVendorApi byte SHORT_ABGR1555 = 5; /** 65536 Colors ({@code short}). */ + @SquirrelJMEVendorApi byte SHORT_INDEXED65536 = 6; /** 256 Colors ({@code byte}). */ + @SquirrelJMEVendorApi byte BYTE_INDEXED256 = 7; /** Packed 16 colors (4-bit). ({@code packed byte}) */ + @SquirrelJMEVendorApi byte PACKED_INDEXED4 = 8; /** Packed 4 Colors (2-bit). ({@code packed byte}) */ + @SquirrelJMEVendorApi byte PACKED_INDEXED2 = 9; /** Packed 2 colors (1-bit). ({@code packed byte}) */ + @SquirrelJMEVendorApi byte PACKED_INDEXED1 = 10; /** 32-bit BGRA ({@code int}). */ + @SquirrelJMEVendorApi byte INT_BGRA8888 = 11; /** 32-bit BGRX ({@code int}). */ + @SquirrelJMEVendorApi byte INT_BGRX8888 = 12; /** 32-bit XBGR ({@code int}). */ + @SquirrelJMEVendorApi byte INT_BGR888 = 13; /** 32-bit RGBX ({@code int}). */ + @SquirrelJMEVendorApi byte INT_RGBX8888 = 14; /** 24-bit RGB consisting of three bytes. */ + @SquirrelJMEVendorApi byte BYTE3_RGB888 = 15; /** 24-bit BGR consisting of three bytes. */ + @SquirrelJMEVendorApi byte BYTE3_BGR888 = 16; /** The number of pixel formats. */ + @SquirrelJMEVendorApi byte NUM_PIXEL_FORMATS = 17; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UISpecialCode.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UISpecialCode.java deleted file mode 100644 index f4bd371adc..0000000000 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/UISpecialCode.java +++ /dev/null @@ -1,54 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package cc.squirreljme.jvm.mle.constants; - -/** - * Special user interface constants. - * - * @since 2020/09/21 - */ -@Deprecated -public interface UISpecialCode -{ - /** Fire repaint. */ - @Deprecated - byte REPAINT_EXECUTE = - 0x0; - - /** Repaint X Coordinate ({@link UIWidgetProperty#INT_SIGNAL_REPAINT}. */ - @Deprecated - int REPAINT_KEY_X = - 0x1_0000000; - - /** Repaint Y Coordinate ({@link UIWidgetProperty#INT_SIGNAL_REPAINT}. */ - @Deprecated - int REPAINT_KEY_Y = - 0x2_0000000; - - /** Repaint Width ({@link UIWidgetProperty#INT_SIGNAL_REPAINT}. */ - @Deprecated - int REPAINT_KEY_WIDTH = - 0x3_0000000; - - /** Repaint Height ({@link UIWidgetProperty#INT_SIGNAL_REPAINT}. */ - @Deprecated - int REPAINT_KEY_HEIGHT = - 0x4_0000000; - - /** Repaint Key Mask ({@link UIWidgetProperty#INT_SIGNAL_REPAINT}. */ - @Deprecated - int REPAINT_KEY_MASK = - 0xF_0000000; - - /** Repaint Key Value ({@link UIWidgetProperty#INT_SIGNAL_REPAINT}. */ - @Deprecated - int REPAINT_VALUE_MASK = - 0x0_FFFFFFF; -} diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMDescriptionType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMDescriptionType.java index b8d01fc9c4..648400d3c3 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMDescriptionType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMDescriptionType.java @@ -9,6 +9,7 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; import java.security.AccessController; /** @@ -16,45 +17,56 @@ import java.security.AccessController; * * @since 2020/06/17 */ +@SquirrelJMEVendorApi public interface VMDescriptionType { /** Unspecified. */ + @SquirrelJMEVendorApi byte UNSPECIFIED = 0; /** The VM version. */ + @SquirrelJMEVendorApi byte VM_VERSION = 1; /** The VM name. */ + @SquirrelJMEVendorApi byte VM_NAME = 2; /** The VM Vendor. */ + @SquirrelJMEVendorApi byte VM_VENDOR = 3; /** The VM E-mail. */ + @SquirrelJMEVendorApi byte VM_EMAIL = 4; /** The VM URL. */ + @SquirrelJMEVendorApi byte VM_URL = 5; /** The executable path of the VM. */ + @SquirrelJMEVendorApi byte EXECUTABLE_PATH = 6; /** The operating system name. */ + @SquirrelJMEVendorApi byte OS_NAME = 7; /** The operating system version. */ + @SquirrelJMEVendorApi byte OS_VERSION = 8; /** The operating system architecture. */ + @SquirrelJMEVendorApi byte OS_ARCH = 9; @@ -62,22 +74,27 @@ public interface VMDescriptionType * The current virtual machine security policy, this is used by * {@link AccessController}. */ + @SquirrelJMEVendorApi byte VM_SECURITY_POLICY = 10; /** Single lines of legal text and copyrights used for ports. */ + @SquirrelJMEVendorApi byte THIRD_PARTY_LEGAL_LINE = 11; /** Full document of legal text, with entire licenses. */ + @SquirrelJMEVendorApi byte THIRD_PARTY_LEGAL_DOCUMENT = 12; /** The path separator used. */ + @SquirrelJMEVendorApi byte PATH_SEPARATOR = 13; /** The current number of properties. */ + @SquirrelJMEVendorApi byte NUM_TYPES = 13; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMStatisticType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMStatisticType.java index bf889cd649..2afee17e0d 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMStatisticType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMStatisticType.java @@ -9,26 +9,33 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Used to get a statistic from the VM. * * @since 2020/06/17 */ +@SquirrelJMEVendorApi public interface VMStatisticType { /** Unspecified. */ + @SquirrelJMEVendorApi byte UNSPECIFIED = 0; /** The amount of free memory. */ + @SquirrelJMEVendorApi byte MEM_FREE = 1; /** The maximum amount of memory. */ + @SquirrelJMEVendorApi byte MEM_MAX = 2; /** The amount of used memory. */ + @SquirrelJMEVendorApi byte MEM_USED = 3; @@ -37,10 +44,12 @@ public interface VMStatisticType * {@link ThreadModelType#SINGLE_COOP_THREAD} then this should always * return 1. */ + @SquirrelJMEVendorApi byte CPU_THREAD_COUNT = 4; /** The number of statistics. */ + @SquirrelJMEVendorApi byte NUM_STATISTICS = 5; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMType.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMType.java index 5e40337cd8..f61c79ef5a 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMType.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VMType.java @@ -9,6 +9,8 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * This represents the type of SquirrelJME virtual machine that is currently * being used, this is used for example to see which set of MLE calls are @@ -16,29 +18,36 @@ package cc.squirreljme.jvm.mle.constants; * * @since 2020/06/16 */ +@SquirrelJMEVendorApi public interface VMType { /** Not known. */ + @SquirrelJMEVendorApi byte UNKNOWN = 0; /** Running on Standard Java SE. */ + @SquirrelJMEVendorApi byte JAVA_SE = 1; /** Running on SpringCoat. */ + @SquirrelJMEVendorApi byte SPRINGCOAT = 2; /** Running on SummerCoat. */ + @SquirrelJMEVendorApi byte SUMMERCOAT = 3; /** Running on NanoCoat. */ + @SquirrelJMEVendorApi byte NANOCOAT = 4; /** The number of VM types. */ + @SquirrelJMEVendorApi byte NUM_VMTYPES = 5; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VerboseDebugFlag.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VerboseDebugFlag.java index 16a02cd287..63d5b3ef3a 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VerboseDebugFlag.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/constants/VerboseDebugFlag.java @@ -9,86 +9,108 @@ package cc.squirreljme.jvm.mle.constants; +import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; + /** * Verbosity flags. * * @since 2020/07/11 */ +@SquirrelJMEVendorApi public interface VerboseDebugFlag { /** All verbosity settings. */ + @SquirrelJMEVendorApi int ALL = 0xFFFF_FFFF; /** Be verbose on the called instructions. */ + @SquirrelJMEVendorApi byte INSTRUCTIONS = 0x01; /** Be verbose on the entered methods. */ + @SquirrelJMEVendorApi byte METHOD_ENTRY = 0x02; /** Be verbose on exited methods. */ + @SquirrelJMEVendorApi byte METHOD_EXIT = 0x04; /** Be verbose on MLE calls. */ + @SquirrelJMEVendorApi byte MLE_CALL = 0x08; /** Be verbose on static invocations. */ + @SquirrelJMEVendorApi byte INVOKE_STATIC = 0x10; /** Be verbose on allocations. */ + @SquirrelJMEVendorApi byte ALLOCATION = 0x20; /** Be verbose on class initializations. */ + @SquirrelJMEVendorApi byte CLASS_INITIALIZE = 0x40; /** Virtual machine exceptions. */ + @SquirrelJMEVendorApi short VM_EXCEPTION = 0x80; /** Class lookup failures. */ + @SquirrelJMEVendorApi short MISSING_CLASS = 0x100; /** Monitor entry. */ + @SquirrelJMEVendorApi short MONITOR_ENTER = 0x200; /** Monitor exit. */ + @SquirrelJMEVendorApi short MONITOR_EXIT = 0x400; /** Wait on monitor. */ + @SquirrelJMEVendorApi short MONITOR_WAIT = 0x800; /** Notify on a monitor. */ + @SquirrelJMEVendorApi short MONITOR_NOTIFY = 0x1000; /** Inherit the current verbose checks to another thread. */ + @SquirrelJMEVendorApi short INHERIT_VERBOSE_FLAGS = 0x2000; /** New thread is created. */ + @SquirrelJMEVendorApi short THREAD_NEW = 0x4000; /** Implicit exceptions being generated. */ + @SquirrelJMEVendorApi int IMPLICIT_EXCEPTION = 0x8000; /** Method with many execution cycles. */ + @SquirrelJMEVendorApi int METHOD_CYCLES = 0x1_0000; /** Ignored exception. */ + @SquirrelJMEVendorApi int IGNORED_EXCEPTION = 0x2_0000; } diff --git a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/exceptions/MLECallError.java b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/exceptions/MLECallError.java index c042cb48b0..993e582a4e 100644 --- a/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/exceptions/MLECallError.java +++ b/modules/cldc-compact/src/main/java/cc/squirreljme/jvm/mle/exceptions/MLECallError.java @@ -23,6 +23,7 @@ public class MLECallError extends VirtualMachineError { /** the distinctive error code. */ + @SquirrelJMEVendorApi public final int distinction; /** diff --git a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/mle/PencilGraphics.java b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/mle/PencilGraphics.java index af54c8b371..c537c38f2b 100644 --- a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/mle/PencilGraphics.java +++ b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/mle/PencilGraphics.java @@ -11,7 +11,6 @@ package cc.squirreljme.runtime.lcdui.mle; import cc.squirreljme.jvm.mle.PencilShelf; import cc.squirreljme.jvm.mle.brackets.PencilBracket; -import cc.squirreljme.jvm.mle.constants.PencilShelfError; import cc.squirreljme.jvm.mle.constants.UIPixelFormat; import cc.squirreljme.jvm.mle.exceptions.MLECallError; import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchPencilBracket; diff --git a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/MenuAction.java b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/MenuAction.java index 2af4615820..049dd7c787 100644 --- a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/MenuAction.java +++ b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/MenuAction.java @@ -12,7 +12,6 @@ package cc.squirreljme.runtime.lcdui.scritchui; import cc.squirreljme.jvm.mle.scritchui.ScritchEventLoopInterface; import cc.squirreljme.jvm.mle.scritchui.ScritchInterface; import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; -import cc.squirreljme.runtime.cldc.debug.Debugging; import javax.microedition.lcdui.Command; import javax.microedition.lcdui.Image; diff --git a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/MenuActionTree.java b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/MenuActionTree.java index 63811217fd..9466424caf 100644 --- a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/MenuActionTree.java +++ b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/MenuActionTree.java @@ -12,10 +12,10 @@ package cc.squirreljme.runtime.lcdui.scritchui; import cc.squirreljme.jvm.mle.scritchui.ScritchInterface; import cc.squirreljme.jvm.mle.scritchui.ScritchLabelInterface; import cc.squirreljme.jvm.mle.scritchui.ScritchMenuInterface; -import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchMenuKindBracket; import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchMenuHasChildrenBracket; import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchMenuHasLabelBracket; import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchMenuHasParentBracket; +import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchMenuKindBracket; import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; import cc.squirreljme.runtime.cldc.debug.Debugging; import java.util.ArrayList; diff --git a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/StringTracker.java b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/StringTracker.java index 9995592f1f..4f6dd2a24b 100644 --- a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/StringTracker.java +++ b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/StringTracker.java @@ -11,7 +11,6 @@ package cc.squirreljme.runtime.lcdui.scritchui; import cc.squirreljme.jvm.mle.scritchui.ScritchEventLoopInterface; import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; -import cc.squirreljme.runtime.cldc.debug.Debugging; import org.jetbrains.annotations.Async; /** diff --git a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/__ExecObjectTracker__.java b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/__ExecObjectTracker__.java index 547469ba06..43676b8c43 100644 --- a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/__ExecObjectTracker__.java +++ b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/__ExecObjectTracker__.java @@ -9,7 +9,6 @@ package cc.squirreljme.runtime.lcdui.scritchui; -import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; import org.jetbrains.annotations.Async; /** diff --git a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/__ExecUpdateMenuTree__.java b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/__ExecUpdateMenuTree__.java index 0c32205215..d17f46d118 100644 --- a/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/__ExecUpdateMenuTree__.java +++ b/modules/midp-lcdui/src/main/java/cc/squirreljme/runtime/lcdui/scritchui/__ExecUpdateMenuTree__.java @@ -10,7 +10,6 @@ package cc.squirreljme.runtime.lcdui.scritchui; import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; -import cc.squirreljme.runtime.cldc.debug.Debugging; import org.jetbrains.annotations.Async; /** diff --git a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Command.java b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Command.java index 5ead65d39c..f7d0d7ec4e 100644 --- a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Command.java +++ b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Command.java @@ -14,7 +14,6 @@ import cc.squirreljme.runtime.cldc.annotation.ImplementationNote; import cc.squirreljme.runtime.cldc.debug.Debugging; import cc.squirreljme.runtime.lcdui.scritchui.MenuAction; import cc.squirreljme.runtime.lcdui.scritchui.MenuActionHasParent; -import cc.squirreljme.runtime.lcdui.scritchui.MenuActionNodeOnly; @Api public class Command diff --git a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Display.java b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Display.java index 9671c789b9..913f330abf 100644 --- a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Display.java +++ b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Display.java @@ -9,7 +9,6 @@ package javax.microedition.lcdui; -import cc.squirreljme.jvm.mle.constants.UIItemPosition; import cc.squirreljme.jvm.mle.exceptions.MLECallError; import cc.squirreljme.jvm.mle.scritchui.ScritchInterface; import cc.squirreljme.jvm.mle.scritchui.ScritchLAFInterface; @@ -39,13 +38,6 @@ import org.jetbrains.annotations.NonBlocking; @Api public class Display { - /** The soft-key for the left command. */ - static final int _SOFTKEY_LEFT_COMMAND = - Display.SOFTKEY_BOTTOM + 1; - - /** The soft-key for the right command. */ - static final int _SOFTKEY_RIGHT_COMMAND = - Display.SOFTKEY_BOTTOM + 2; @Api public static final int ALERT = @@ -1337,65 +1329,5 @@ public class Display DisplayManager.instance().displayListenerRemove(__dl); } - - /** - * The default display capabilities. - * - * @return The default display capabilities. - * @since 2021/11/30 - */ - static int __defaultCapabilities() - { - return Display.SUPPORTS_COMMANDS | Display.SUPPORTS_FORMS | - Display.SUPPORTS_TICKER | Display.SUPPORTS_ALERTS | - Display.SUPPORTS_LISTS | Display.SUPPORTS_TEXTBOXES | - Display.SUPPORTS_FILESELECTORS | Display.SUPPORTS_TABBEDPANES | - Display.SUPPORTS_MENUS; - } - - /** - * Converts a {@link UIItemPosition} to a softkey. - * - * @param __pos The {@link UIItemPosition} to get the soft key of. - * @return The softkey position or a negative value if not valid. - * @since 2020/10/03 - */ - static int __layoutPosToSoftKey(int __pos) - { - switch (__pos) - { - case UIItemPosition.LEFT_COMMAND: - return Display._SOFTKEY_LEFT_COMMAND; - - case UIItemPosition.RIGHT_COMMAND: - return Display._SOFTKEY_RIGHT_COMMAND; - - default: - return -1; - } - } - - /** - * Returns the position where the soft key belongs. - * - * @param __softKey The soft key to get the UI position from. - * @return The {@link UIItemPosition} of the item, or - * {@link UIItemPosition#NOT_ON_FORM} if not valid. - * @since 2020/10/03 - */ - static int __layoutSoftKeyToPos(int __softKey) - { - switch (__softKey) - { - case Display._SOFTKEY_LEFT_COMMAND: - return UIItemPosition.LEFT_COMMAND; - - case Display._SOFTKEY_RIGHT_COMMAND: - return UIItemPosition.RIGHT_COMMAND; - - default: - return UIItemPosition.NOT_ON_FORM; - } - } } diff --git a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Displayable.java b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Displayable.java index 103448282d..f7bb68fcf0 100644 --- a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Displayable.java +++ b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/Displayable.java @@ -9,7 +9,6 @@ package javax.microedition.lcdui; -import cc.squirreljme.jvm.mle.constants.UIItemPosition; import cc.squirreljme.jvm.mle.scritchui.annotation.ScritchEventLoop; import cc.squirreljme.runtime.cldc.annotation.Api; import cc.squirreljme.runtime.cldc.annotation.SquirrelJMEVendorApi; @@ -739,50 +738,6 @@ public abstract class Displayable } /** - * Executes the given layout. - * - * @param __layout The layout to execute. - * @throws NullPointerException On null arguments. - * @since 2020/09/27 - */ - @SerializedEvent - @Async.Execute - private void __layoutExecute(__Layout__ __layout) - throws NullPointerException - { - if (__layout == null) - throw new NullPointerException("NARG"); - - // Left command item - this.__layoutExecute(__layout, Display._SOFTKEY_LEFT_COMMAND, - Display.__layoutSoftKeyToPos(Display._SOFTKEY_LEFT_COMMAND)); - - // Right command item - this.__layoutExecute(__layout, Display._SOFTKEY_RIGHT_COMMAND, - Display.__layoutSoftKeyToPos(Display._SOFTKEY_RIGHT_COMMAND)); - } - - /** - * Executes the given layout. - * - * @param __layout The layout to execute. - * @param __from The from position, one of the softkey positions. - * @param __to The target position, one of {@link UIItemPosition}. - * @throws NullPointerException On null arguments. - * @since 2020/09/27 - */ - @SerializedEvent - @Async.Execute - private void __layoutExecute(__Layout__ __layout, int __from, int __to) - throws NullPointerException - { - if (__layout == null) - throw new NullPointerException("NARG"); - - throw Debugging.todo(); - } - - /** * Returns a default title to use for the application. * * @return Application default title. diff --git a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecDisplayMenuItemActivate__.java b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecDisplayMenuItemActivate__.java index bec8f12f46..608cf2d2eb 100644 --- a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecDisplayMenuItemActivate__.java +++ b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecDisplayMenuItemActivate__.java @@ -12,11 +12,9 @@ package javax.microedition.lcdui; import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchMenuKindBracket; import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchWindowBracket; import cc.squirreljme.jvm.mle.scritchui.callbacks.ScritchMenuItemActivateListener; -import cc.squirreljme.runtime.cldc.debug.Debugging; import cc.squirreljme.runtime.lcdui.scritchui.DisplayState; import cc.squirreljme.runtime.lcdui.scritchui.DisplayableState; import cc.squirreljme.runtime.lcdui.scritchui.MenuActionApplicable; -import cc.squirreljme.runtime.lcdui.scritchui.MenuActionNode; import cc.squirreljme.runtime.lcdui.scritchui.MenuActionNodeOnly; import cc.squirreljme.runtime.lcdui.scritchui.MenuActionTree; diff --git a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecDisplayableDefaultCommand__.java b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecDisplayableDefaultCommand__.java index 0270a6b438..b46d528454 100644 --- a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecDisplayableDefaultCommand__.java +++ b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecDisplayableDefaultCommand__.java @@ -9,8 +9,6 @@ package javax.microedition.lcdui; -import cc.squirreljme.runtime.cldc.debug.Debugging; - /** * Executes adjustments to the default menu which contains commands. * diff --git a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecListActivate__.java b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecListActivate__.java index 595cec00dd..65dfc00fbf 100644 --- a/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecListActivate__.java +++ b/modules/midp-lcdui/src/main/java/javax/microedition/lcdui/__ExecListActivate__.java @@ -11,7 +11,6 @@ package javax.microedition.lcdui; import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchComponentBracket; import cc.squirreljme.jvm.mle.scritchui.callbacks.ScritchActivateListener; -import cc.squirreljme.runtime.cldc.debug.Debugging; import java.lang.ref.Reference; import java.lang.ref.WeakReference; diff --git a/modules/midp-lcdui/src/test/java/TestDisplayNoForm.java b/modules/midp-lcdui/src/test/java/TestDisplayNoForm.java deleted file mode 100644 index c271f1e2a8..0000000000 --- a/modules/midp-lcdui/src/test/java/TestDisplayNoForm.java +++ /dev/null @@ -1,37 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// Multi-Phasic Applications: SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.runtime.cldc.debug.Debugging; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import mleui.BaseBackend; - -/** - * Tests that a display is shown without a form. - * - * @since 2023/01/14 - */ -public class TestDisplayNoForm - extends BaseBackend -{ - /** - * {@inheritDoc} - * @since 2023/01/14 - */ - @Override - public void test(UIBackend __backend, UIDisplayBracket __display) - throws Throwable - { - // Show it - __backend.displayShow(__display, true); - - // Hide it - __backend.displayShow(__display, false); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/BaseDisplay.java b/modules/midp-lcdui/src/test/java/lcdui/BaseDisplay.java deleted file mode 100644 index da9a647cd9..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/BaseDisplay.java +++ /dev/null @@ -1,57 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.constants.UIMetricType; -import cc.squirreljme.runtime.cldc.debug.Debugging; -import javax.microedition.lcdui.Display; -import net.multiphasicapps.tac.TestConsumer; -import net.multiphasicapps.tac.UntestableException; - -/** - * Base class for display tests. - * - * @since 2020/07/26 - */ -public abstract class BaseDisplay - extends TestConsumer -{ - /** - * Tests with the given display. - * - * @param __display The display to test on. - * @param __param The parameter to use, this is optional. - * @throws Throwable On any exception. - * @since 2020/07/26 - */ - public abstract void test(Display __display, String __param) - throws Throwable; - - /** - * {@inheritDoc} - * @since 2020/07/26 - */ - @Override - public final void test(String __param) - throws Throwable - { - UIDisplayBracket[] displays = UIFormShelf.displays(); - - Debugging.todoNote("BaseDisplay::test() -- Headless check."); - if (displays == null || displays.length == 0 || - 0 == UIFormShelf.metric(displays[0], - UIMetricType.UIFORMS_SUPPORTED)) - throw new UntestableException("Native forms not supported."); - - // Forward test - this.test(Display.getDisplays(0)[0], __param); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/BaseForm.java b/modules/midp-lcdui/src/test/java/lcdui/BaseForm.java deleted file mode 100644 index 1af4fb7cfe..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/BaseForm.java +++ /dev/null @@ -1,50 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui; - -import javax.microedition.lcdui.Display; -import javax.microedition.lcdui.Form; -import net.multiphasicapps.tac.OptionalFirstParameter; - -/** - * Base class for form related tests. - * - * @since 2020/07/26 - */ -public abstract class BaseForm - extends BaseDisplay - implements OptionalFirstParameter -{ - /** - * Tests on the given form. - * - * @param __display The display being tested. - * @param __form The form to test on. - * @throws Throwable On any exception. - * @since 2020/07/26 - */ - protected abstract void test(Display __display, Form __form) - throws Throwable; - - /** - * {@inheritDoc} - * @since 2020/07/27 - */ - @Override - public final void test(Display __display, String __param) - throws Throwable - { - Form form = new Form("Test"); - - __display.setCurrent(form); - - this.test(__display, form); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/canvas/BaseCanvas.java b/modules/midp-lcdui/src/test/java/lcdui/canvas/BaseCanvas.java deleted file mode 100644 index f414ad72ae..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/canvas/BaseCanvas.java +++ /dev/null @@ -1,87 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.canvas; - -import cc.squirreljme.runtime.lcdui.mle.UIBackendFactory; -import javax.microedition.lcdui.Display; -import lcdui.BaseDisplay; -import net.multiphasicapps.tac.OptionalFirstParameter; - -/** - * Base tests for canvases. - * - * @since 2020/07/27 - */ -public abstract class BaseCanvas - extends BaseDisplay - implements OptionalFirstParameter -{ - /** The number of times to let the canvas settle before testing. */ - private static final int _SETTLE_COUNT = - 5; - - /** - * Performs the canvas test. - * - * @param __display The display being run on. - * @param __platform The canvas platform used. - * @throws Throwable On any exception. - * @since 2020/07/27 - */ - public abstract void test(Display __display, CanvasPlatform __platform) - throws Throwable; - - /** - * {@inheritDoc} - * @since 2020/07/27 - */ - @Override - public final void test(Display __display, String __param) - throws Throwable - { - CanvasPlatform platform = new CanvasPlatform(); - __display.setCurrent(platform); - - // Perform testing on the canvas - try - { - // Allow the canvas to settle and properly appear - for (int i = 0; i < BaseCanvas._SETTLE_COUNT; i++) - { - // Wait for the canvas events to settle - __display.callSerially(new __Wait__()); - - // Repaint and wait for those to appear - platform.repaint(); - platform.serviceRepaints(); - - // Flush events to settle these - UIBackendFactory.getInstance(true).flushEvents(); - - // Sleep a bit - try - { - Thread.sleep(100); - } - catch (InterruptedException ignored) - { - } - } - - // Run the test - this.test(__display, platform); - } - finally - { - if (__display.getCurrent() == platform) - __display.removeCurrent(); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasFullScreen.java b/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasFullScreen.java deleted file mode 100644 index 3479cca907..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasFullScreen.java +++ /dev/null @@ -1,63 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.canvas; - -import javax.microedition.lcdui.Canvas; -import javax.microedition.lcdui.Command; -import javax.microedition.lcdui.Display; - -/** - * Tests that a canvas is full-screen via - * {@link Canvas#setFullScreenMode(boolean)}). - * - * @since 2020/09/12 - */ -public class TestCanvasFullScreen - extends BaseCanvas -{ - /** - * {@inheritDoc} - * @since 2020/09/12 - */ - @Override - public void test(Display __display, CanvasPlatform __platform) - { - // Add a button, it should go away - __platform.addCommand( - new Command("Test button", Command.OK, 0)); - - // Request a repaint and wait for it to occur - __platform.repaint(); - __platform.serviceRepaints(); - - // Get initial sizes - int width = __platform.getWidth(); - int height = __platform.getHeight(); - - // Request full screen state - __platform.setFullScreenMode(true); - - // Request a repaint and wait for it to occur - __platform.repaint(); - __platform.serviceRepaints(); - - // Query the sizes again for checking - int newWidth = __platform.getWidth(); - int newHeight = __platform.getHeight(); - - // Full-screen should cause the canvas to grow in size - this.secondary("width", newWidth >= width); - this.secondary("height", newHeight >= height); - - // The canvas should be smaller or at the maximum display resolution - this.secondary("wdisp", newWidth <= __display.getWidth()); - this.secondary("hdisp", newHeight <= __display.getHeight()); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasKeyTyping.java b/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasKeyTyping.java deleted file mode 100644 index e728cc98fa..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasKeyTyping.java +++ /dev/null @@ -1,73 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.canvas; - -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.NonStandardKey; -import cc.squirreljme.jvm.mle.constants.UIKeyEventType; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import cc.squirreljme.runtime.lcdui.mle.UIBackendFactory; -import javax.microedition.lcdui.Display; - -/** - * Tests that canvas typing works. - * - * @since 2020/10/16 - */ -public class TestCanvasKeyTyping - extends BaseCanvas -{ - /** - * {@inheritDoc} - * @since 2020/10/16 - */ - @Override - public void test(Display __display, CanvasPlatform __platform) - throws Throwable - { - UIBackend backend = UIBackendFactory.getInstance(true); - UIFormCallback injector = backend.injector(); - - // We need to locate the canvas item before we can send events to it - UIFormBracket form = (UIFormBracket)StaticDisplayState - .locate(__platform); - UIItemBracket canvas = UIFormShelf.formItemAtPosition(form, 0); - - // Send in keys - this.__sendKey(injector, form, canvas, 'X'); - this.__sendKey(injector, form, canvas, 'e'); - this.__sendKey(injector, form, canvas, 'r'); - this.__sendKey(injector, form, canvas, NonStandardKey.SHIFT); - - // Check the string result - this.secondary("sequence", __platform.queryKeys()); - } - - /** - * Sends the specified key. - * - * @param __injector The injector. - * @param __form The form. - * @param __item The item. - * @param __c The character to inject. - * @since 2020/10/16 - */ - private void __sendKey(UIFormCallback __injector, UIFormBracket __form, - UIItemBracket __item, int __c) - { - __injector.eventKey(__item, UIKeyEventType.KEY_PRESSED, - __c, 0); - __injector.eventKey(__item, UIKeyEventType.KEY_REPEATED, - __c, 0); - __injector.eventKey(__item, UIKeyEventType.KEY_RELEASE, - __c, 0); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasRepaint.java b/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasRepaint.java deleted file mode 100644 index c2cadacd32..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasRepaint.java +++ /dev/null @@ -1,73 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.canvas; - -import javax.microedition.lcdui.Display; - -/** - * Tests that repainting works. - * - * @since 2020/07/27 - */ -public class TestCanvasRepaint - extends BaseCanvas -{ - /** The number of times to try. */ - private static final int _RETRIES = - 5; - - /** Timeout before retries. */ - private static final int _TIMEOUT = - 1000; - - /** - * {@inheritDoc} - * @since 2020/07/27 - */ - @Override - public void test(Display __display, CanvasPlatform __platform) - { - // Mark the time and request a repaint - long base = System.currentTimeMillis(); - - boolean gotRepaint = false; - - // Try multiple times, as due to loops and threading it is possible - // for this to miss - for (int i = 0; i < TestCanvasRepaint._RETRIES; i++) - { - // Try repainting... - __platform.repaint(); - __platform.serviceRepaints(); - - // Did this happen? - if (__platform.queryLastRepaint() > base) - { - gotRepaint = true; - break; - } - - // Debug - System.err.println("Waiting for a repaint..."); - - // Wait again - try - { - Thread.sleep(TestCanvasRepaint._TIMEOUT); - } - catch (InterruptedException ignored) - { - } - } - - // Hopefully this was triggered - this.secondary("repainted", gotRepaint); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasSize.java b/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasSize.java deleted file mode 100644 index 48bb315415..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasSize.java +++ /dev/null @@ -1,39 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.canvas; - -import javax.microedition.lcdui.Display; - -/** - * Tests that canvases have some size to them. - * - * @since 2020/08/02 - */ -public class TestCanvasSize - extends BaseCanvas -{ - /** - * {@inheritDoc} - * @since 2020/08/02 - */ - @Override - public void test(Display __display, CanvasPlatform __platform) - { - // Get the size - int width = __platform.getWidth(); - int height = __platform.getHeight(); - - // Debug - System.err.printf("Canvas size: (%d, %d)%n", width, height); - - this.secondary("width", width > 0); - this.secondary("height", height > 0); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasStandardKeyCodes.java b/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasStandardKeyCodes.java deleted file mode 100644 index e8fb102aba..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasStandardKeyCodes.java +++ /dev/null @@ -1,49 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.canvas; - -import javax.microedition.lcdui.Canvas; -import javax.microedition.lcdui.Display; - -/** - * Tests that the standard key codes do in fact map to game keys. - * - * @since 2020/08/02 - */ -public class TestCanvasStandardKeyCodes - extends BaseCanvas -{ - /** - * {@inheritDoc} - * @since 2020/08/02 - */ - @Override - public void test(Display __display, CanvasPlatform __platform) - { - // Set bits within the mask - long gameKeyMask = 0; - for (int i = Canvas.KEY_SELECT; i <= Canvas.KEY_DELETE; i++) - try - { - int gameKey = __platform.getGameAction(i); - - if (gameKey <= 0) - continue; - - gameKeyMask |= (1 << gameKey); - } - catch (IllegalArgumentException ignored) - { - } - - // There should have been all the game keys in this - this.secondary("mask", gameKeyMask); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasValidActions.java b/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasValidActions.java deleted file mode 100644 index 141a6bbc14..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/canvas/TestCanvasValidActions.java +++ /dev/null @@ -1,40 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.canvas; - -import javax.microedition.lcdui.Canvas; -import javax.microedition.lcdui.Display; - -/** - * Ensures that game actions do have keys. - * - * @since 2020/09/12 - */ -public class TestCanvasValidActions - extends BaseCanvas -{ - /** - * {@inheritDoc} - * @since 2020/09/12 - */ - @Override - public void test(Display __display, CanvasPlatform __platform) - { - int mask = 0; - - for (int gameKey : new int[]{Canvas.UP, Canvas.DOWN, Canvas.LEFT, - Canvas.RIGHT, Canvas.FIRE, Canvas.GAME_A, Canvas.GAME_B, - Canvas.GAME_C, Canvas.GAME_D}) - if (__platform.getKeyCode(gameKey) != 0) - mask |= (1 << gameKey); - - this.secondary("mask", mask); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/display/TestCallSerially.java b/modules/midp-lcdui/src/test/java/lcdui/display/TestCallSerially.java deleted file mode 100644 index 6048f1002b..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/display/TestCallSerially.java +++ /dev/null @@ -1,57 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.display; - -import javax.microedition.lcdui.Display; -import lcdui.BaseDisplay; -import net.multiphasicapps.tac.OptionalFirstParameter; - -/** - * Tests that serial calls happen properly. - * - * @since 2020/10/03 - */ -public class TestCallSerially - extends BaseDisplay - implements OptionalFirstParameter -{ - /** - * {@inheritDoc} - * @since 2020/10/03 - */ - @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") - @Override - public void test(Display __display, String __param) - { - __SerialRun__ run = new __SerialRun__(); - - // This call should run the code then wait for it to be completed - __display.callSerially(run); - - // Then get the result of that, should be true - for (;;) - synchronized (run) - { - if (!run._flag) - try - { - run.wait(5000); - continue; - } - catch (InterruptedException ignored) - { - return; - } - - this.secondary("flagged", run._flag); - break; - } - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/display/TestSetRemoveCurrentDisplay.java b/modules/midp-lcdui/src/test/java/lcdui/display/TestSetRemoveCurrentDisplay.java deleted file mode 100644 index 0400ea3720..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/display/TestSetRemoveCurrentDisplay.java +++ /dev/null @@ -1,51 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.display; - -import javax.microedition.lcdui.Canvas; -import javax.microedition.lcdui.Choice; -import javax.microedition.lcdui.Display; -import javax.microedition.lcdui.Displayable; -import javax.microedition.lcdui.Form; -import javax.microedition.lcdui.List; -import lcdui.BaseDisplay; -import net.multiphasicapps.tac.OptionalFirstParameter; - -/** - * Tests that setting and removing the current display is valid. - * - * @since 2020/07/26 - */ -public class TestSetRemoveCurrentDisplay - extends BaseDisplay - implements OptionalFirstParameter -{ - /** - * {@inheritDoc} - * @since 2020/07/26 - */ - @Override - public void test(Display __display, String __param) - { - // Use any kind of thing - Displayable form = new List("list", Choice.EXCLUSIVE); - - // Should not be our current item - this.secondary("not-form", form != __display.getCurrent()); - - // Should be our set form - __display.setCurrent(form); - this.secondary("after-set", form == __display.getCurrent()); - - // Remove the form, which should result in null - __display.removeCurrent(); - this.secondary("is-null", null == __display.getCurrent()); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/list/BaseList.java b/modules/midp-lcdui/src/test/java/lcdui/list/BaseList.java deleted file mode 100644 index 80d3765ac7..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/list/BaseList.java +++ /dev/null @@ -1,74 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.list; - -import javax.microedition.lcdui.Choice; -import javax.microedition.lcdui.Display; -import javax.microedition.lcdui.List; -import lcdui.BaseDisplay; - -/** - * Base class for testing LCDUI {@link List}. - * - * @since 2020/11/01 - */ -public abstract class BaseList - extends BaseDisplay -{ - /** - * Tests on the given list. - * - * @param __display The display being tested. - * @param __list The list to test on. - * @param __type The type of list used. - * @param __typeName The type name of the list. - * @throws Throwable On any exception. - * @since 2020/11/01 - */ - protected abstract void test(Display __display, List __list, int __type, - String __typeName) - throws Throwable; - - /** - * {@inheritDoc} - * @since 2020/11/11 - */ - @Override - public void test(Display __display, String __param) - throws Throwable - { - // Which type of list is used? - int listType; - switch (__param) - { - case "EXCLUSIVE": - listType = Choice.EXCLUSIVE; - break; - - case "IMPLICIT": - listType = Choice.IMPLICIT; - break; - - case "MULTIPLE": - listType = Choice.MULTIPLE; - break; - - default: - throw new IllegalArgumentException(__param); - } - - // Setup and test list - List list = new List("List " + __param, listType); - - __display.setCurrent(list); - - this.test(__display, list, listType, __param); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/list/ListItem.java b/modules/midp-lcdui/src/test/java/lcdui/list/ListItem.java deleted file mode 100644 index 01e2075fae..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/list/ListItem.java +++ /dev/null @@ -1,199 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.list; - -import java.util.Objects; -import java.util.Random; -import javax.microedition.lcdui.Font; -import javax.microedition.lcdui.Image; -import javax.microedition.lcdui.List; - -/** - * This stores information about a single list item. - * - * @since 2020/11/08 - */ -public final class ListItem -{ - /** Label. */ - public String label; - - /** Image. */ - public Image image; - - /** Font. */ - public Font font; - - /** Is this enabled? */ - public boolean enabled; - - /** Is this selected? */ - public boolean selected; - - /** - * Initializes the given list item. - * - * @param __label The label. - * @param __image The image. - * @param __font The font. - * @param __enabled Is this enabled? - * @param __selected Is this selected? - * @throws NullPointerException If there is no label. - * @since 2020/11/08 - */ - public ListItem(String __label, Image __image, Font __font, - boolean __enabled, boolean __selected) - throws NullPointerException - { - if (__label == null) - throw new NullPointerException("NARG"); - - this.label = __label; - this.image = __image; - this.font = __font; - this.enabled = __enabled; - this.selected = __selected; - } - - /** - * {@inheritDoc} - * @since 2020/11/08 - */ - @Override - public boolean equals(Object __o) - { - if (__o == this) - return true; - - if (!(__o instanceof ListItem)) - return false; - - ListItem o = (ListItem)__o; - return this.hashCode() == o.hashCode() && - this.enabled == o.enabled && - this.selected == o.selected && - Objects.equals(this.label, o.label) && - Objects.equals(this.image, o.image) && - Objects.equals(this.font, o.font); - } - - /** - * {@inheritDoc} - * @since 2020/11/08 - */ - @Override - public int hashCode() - { - int rv = 0; - - rv ^= (this.selected ? 0x8000_0000 : 0x4000_0000); - rv ^= (this.enabled ? 0x0800_0000 : 0x0400_0000); - rv ^= (this.label != null ? - (this.label.hashCode() | 0x0080_0000) : 0x0040_0000); - rv ^= (this.image != null ? - (this.image.hashCode() | 0x0008_0000) : 0x0004_0000); - rv ^= (this.font != null ? - (this.font.hashCode() | 0x0000_8000) : 0x0000_4000); - - return rv; - } - - /** - * Sets the given list item. - * - * @param __list The list to set. - * @param __dx The index to set. - * @throws NullPointerException On null arguments. - * @since 2020/11/08 - */ - public final void into(List __list, int __dx) - throws NullPointerException - { - if (__list == null) - throw new NullPointerException("NARG"); - - __list.set(__dx, this.label, this.image); - __list.setFont(__dx, this.font); - __list.setSelectedIndex(__dx, this.selected); - __list.setEnabled(__dx, this.enabled); - } - - /** - * Returns information on the given list item. - * - * @param __list The list to get from. - * @param __dx The index to read. - * @return The resulting list item. - * @throws NullPointerException On null arguments. - * @since 2020/11/08 - */ - public static ListItem of(List __list, int __dx) - throws NullPointerException - { - if (__list == null) - throw new NullPointerException("NARG"); - - return new ListItem(__list.getString(__dx), - __list.getImage(__dx), - __list.getFont(__dx), - __list.isEnabled(__dx), - __list.isSelected(__dx)); - } - - /** - * Returns a randomized item. - * - * @param __rand The randomized source. - * @return A newly randomized list item. - * @throws NullPointerException On null arguments. - * @since 2020/11/13 - */ - public static ListItem random(Random __rand) - throws NullPointerException - { - if (__rand == null) - throw new NullPointerException("NARG"); - - // Face - int face; - switch (__rand.nextInt(3)) - { - case 0: face = Font.FACE_MONOSPACE; break; - case 1: face = Font.FACE_PROPORTIONAL; break; - default: face = Font.FACE_SYSTEM; break; - } - - // Style - int style; - switch (__rand.nextInt(4)) - { - case 0: style = Font.STYLE_BOLD; break; - case 1: style = Font.STYLE_ITALIC; break; - case 2: style = Font.STYLE_PLAIN; break; - default: style = Font.STYLE_UNDERLINED; break; - } - - // Size - int size; - switch (__rand.nextInt(3)) - { - case 0: size = Font.SIZE_LARGE; break; - case 1: size = Font.SIZE_MEDIUM; break; - default: size = Font.SIZE_SMALL; break; - } - - return new ListItem( - Character.toString((char)('a' + __rand.nextInt(25))), - Image.createImage(1 + __rand.nextInt(16), - 1 + __rand.nextInt(16)), - Font.getFont(face, style, size), - __rand.nextBoolean(), __rand.nextBoolean()); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/list/SelectionListener.java b/modules/midp-lcdui/src/test/java/lcdui/list/SelectionListener.java deleted file mode 100644 index b10be65b3a..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/list/SelectionListener.java +++ /dev/null @@ -1,56 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.list; - -import cc.squirreljme.runtime.cldc.debug.Debugging; -import java.util.LinkedHashSet; -import java.util.Set; -import javax.microedition.lcdui.Command; -import javax.microedition.lcdui.CommandListener; -import javax.microedition.lcdui.Displayable; -import javax.microedition.lcdui.List; - -/** - * Listener for item selection changes in lists. - * - * @since 2020/11/13 - */ -public class SelectionListener - implements CommandListener -{ - /** Items that have been selected. */ - public final Set selectedItems = - new LinkedHashSet<>(); - - /** The last selected item. */ - public int lastSelected = - -2; - - /** - * {@inheritDoc} - * @since 2020/11/13 - */ - @Override - public void commandAction(Command __command, Displayable __displayable) - { - Debugging.debugNote("Command callback..."); - - if (__command == List.SELECT_COMMAND) - synchronized (this) - { - int index = ((List)__displayable).getSelectedIndex(); - - this.selectedItems.add(index); - this.lastSelected = index; - - Debugging.debugNote("New selection: %d", index); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/list/TestItemAddRemove.java b/modules/midp-lcdui/src/test/java/lcdui/list/TestItemAddRemove.java deleted file mode 100644 index 31ae04ca78..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/list/TestItemAddRemove.java +++ /dev/null @@ -1,71 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.list; - -import java.util.Random; -import javax.microedition.lcdui.Display; -import javax.microedition.lcdui.Image; -import javax.microedition.lcdui.List; - -/** - * Tests adding and removing items. - * - * @since 2020/11/03 - */ -public class TestItemAddRemove - extends BaseList -{ - /** - * {@inheritDoc} - * @since 2020/11/03 - */ - @Override - protected void test(Display __display, List __list, int __type, - String __typeName) - { - // Setup some baseline items for the list - Random rand = new Random(1234); - ListItem a = ListItem.random(rand); - ListItem b = ListItem.random(rand); - - // Appending a single item into the list first - __list.append("a", Image.createImage(1, 1)); - - this.secondary("append-size", __list.size()); - - // Store all properties it to double-check if it follows properly - a.into(__list, 0); - - // Adding to the start, the list should be b, a - __list.insert(0, "b", Image.createImage(2, 2)); - - // Should be the same item here - this.secondary("insert-size", __list.size()); - this.secondary("insert-a", - a.equals(ListItem.of(__list, 1))); - this.secondary("insert-nota", - a.equals(ListItem.of(__list, 0))); - - // Write B's info, to ensure that it does not mess anything else up - b.into(__list, 0); - - // Delete B, which should keep a untouched - __list.delete(0); - - this.secondary("delete-size", __list.size()); - this.secondary("delete-a", - a.equals(ListItem.of(__list, 0))); - - // Clear out everything! - __list.deleteAll(); - - this.secondary("clear-size", __list.size()); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/list/TestSelectionCommands.java b/modules/midp-lcdui/src/test/java/lcdui/list/TestSelectionCommands.java deleted file mode 100644 index 97f556be4e..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/list/TestSelectionCommands.java +++ /dev/null @@ -1,91 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.list; - -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.jvm.mle.constants.UIKeyEventType; -import cc.squirreljme.jvm.mle.constants.UIWidgetProperty; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import cc.squirreljme.runtime.lcdui.mle.UIBackendFactory; -import javax.microedition.lcdui.Choice; -import javax.microedition.lcdui.Display; -import javax.microedition.lcdui.List; -import net.multiphasicapps.tac.UntestableException; - -/** - * Tests that selection commands work properly. - * - * @since 2020/11/03 - */ -public class TestSelectionCommands - extends BaseList -{ - /** Number of list items to test. */ - public static final int NUM_ITEMS = - 3; - - /** - * {@inheritDoc} - * @since 2020/11/03 - */ - @SuppressWarnings("SynchronizationOnLocalVariableOrMethodParameter") - @Override - protected void test(Display __display, List __list, int __type, - String __typeName) - { - // This is only valid on implicit tests - if (__type != Choice.IMPLICIT) - throw new UntestableException("Implicit only."); - - // Listener used to keep track of state - SelectionListener listener = new SelectionListener(); - __list.setCommandListener(listener); - - // Add items to the list - for (int i = 0; i < TestSelectionCommands.NUM_ITEMS; i++) - __list.append(Character.toString((char)('a' + i)), null); - - // Native holders for the widgets - UIBackend backend = UIBackendFactory.getInstance(true); - UIFormBracket form = (UIFormBracket)StaticDisplayState.locate(__list, - UIItemType.FORM, backend); - UIItemBracket item = (UIItemBracket)StaticDisplayState.locate(__list, - UIItemType.LIST, backend); - - // Set items as selected, which should trigger selection - for (int i = 0; i < TestSelectionCommands.NUM_ITEMS; i++) - { - // Send event and wait for it to be flushed out - backend.injector().propertyChange(form, item, - UIWidgetProperty.INT_LIST_ITEM_SELECTED, i, 0, 1); - backend.injector().eventKey(item, - UIKeyEventType.COMMAND_ACTIVATED, i, 0); - backend.flushEvents(); - - synchronized (listener) - { - this.secondary("last-" + i, - listener.lastSelected == i); - } - } - - // Make sure they were selected - for (int i = 0; i < TestSelectionCommands.NUM_ITEMS; i++) - { - synchronized (listener) - { - this.secondary("selected-" + i, - listener.selectedItems.contains(i)); - } - } - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/list/TestSelections.java b/modules/midp-lcdui/src/test/java/lcdui/list/TestSelections.java deleted file mode 100644 index fbd4e28265..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/list/TestSelections.java +++ /dev/null @@ -1,77 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package lcdui.list; - -import javax.microedition.lcdui.Display; -import javax.microedition.lcdui.List; - -/** - * Tests the selection of items and otherwise. - * - * @since 2020/11/03 - */ -public class TestSelections - extends BaseList -{ - /** - * {@inheritDoc} - * @since 2020/11/03 - */ - @Override - protected void test(Display __display, List __list, int __type, - String __typeName) - throws Throwable - { - // Flags for checking/setting - boolean[] flags = new boolean[TestSelectionCommands.NUM_ITEMS]; - - // Add some list items - for (int i = 0; i < TestSelectionCommands.NUM_ITEMS; i++) - __list.append(Character.toString((char)('a' + i)), null); - - // Starting selection - __list.getSelectedFlags(flags); - this.secondary("start", flags); - - // Sequential set - for (int i = 0; i < TestSelectionCommands.NUM_ITEMS; i++) - { - __list.setSelectedIndex(i, true); - - __list.getSelectedFlags(flags); - this.secondary("seqset-" + i, flags); - } - - // Sequential clear - for (int i = 0; i < TestSelectionCommands.NUM_ITEMS; i++) - { - __list.setSelectedIndex(i, false); - - __list.getSelectedFlags(flags); - this.secondary("seqclear-" + i, flags); - } - - // Even/Odd - for (int i = 0; i < TestSelectionCommands.NUM_ITEMS; i++) - flags[i] = ((i % 2) == 0); - __list.setSelectedFlags(flags); - - __list.getSelectedFlags(flags); - this.secondary("evenodd", flags); - - // Nothing - for (int i = 0; i < TestSelectionCommands.NUM_ITEMS; i++) - flags[i] = false; - __list.setSelectedFlags(flags); - - __list.getSelectedFlags(flags); - this.secondary("none", flags); - } -} diff --git a/modules/midp-lcdui/src/test/java/lcdui/list/package-info.java b/modules/midp-lcdui/src/test/java/lcdui/list/package-info.java deleted file mode 100644 index 5ab3c59027..0000000000 --- a/modules/midp-lcdui/src/test/java/lcdui/list/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -/** - * This contains tests for {@link javax.microedition.lcdui.List}. - * - * @since 2020/10/31 - */ - -package lcdui.list; diff --git a/modules/midp-lcdui/src/test/java/mleui/BaseBackend.java b/modules/midp-lcdui/src/test/java/mleui/BaseBackend.java deleted file mode 100644 index 4a77fd5ebd..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/BaseBackend.java +++ /dev/null @@ -1,87 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.constants.UIMetricType; -import cc.squirreljme.jvm.mle.constants.UIPixelFormat; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import cc.squirreljme.runtime.lcdui.mle.headless.HeadlessAttachment; -import cc.squirreljme.runtime.lcdui.mle.pure.NativeUIBackend; -import net.multiphasicapps.tac.TestConsumer; -import net.multiphasicapps.tac.UntestableException; - -/** - * Base for all backend tests. - * - * @since 2020/10/09 - */ -public abstract class BaseBackend - extends TestConsumer -{ - /** - * Performs the testing of the given backend. - * - * @param __backend The backend to test. - * @param __display The display to test on. - * @throws Throwable On any exception. - * @since 2020/10/09 - */ - public abstract void test(UIBackend __backend, - UIDisplayBracket __display) - throws Throwable; - - /** - * {@inheritDoc} - * @since 2020/10/10 - */ - @Override - public void test(String __backend) - throws Throwable - { - // Debugging - /*DebugShelf.verbose(VerboseDebugFlag.ALL); - DebugShelf.verboseInternalThread(VerboseDebugFlag.ALL);*/ - - UIBackend backend = BaseBackend.__getBackend(__backend); - this.test(backend, backend.displays()[0]); - } - - /** - * Returns the backend used for tests. - * - * @param __backend The backend to get. - * @return The resultant backend. - * @throws NullPointerException On null arguments. - * @throws UntestableException If the backend is not operational. - * @since 2020/10/10 - */ - private static UIBackend __getBackend(String __backend) - throws NullPointerException, UntestableException - { - switch (__backend) - { - case "NATIVE": - UIDisplayBracket[] displays = UIFormShelf.displays(); - if (displays != null && displays.length > 0 && - 0 != UIFormShelf.metric(displays[0], - UIMetricType.UIFORMS_SUPPORTED)) - return new NativeUIBackend(); - throw new UntestableException(__backend); - - case "FRAMEBUFFER": - return new FBUIBackend(new HeadlessAttachment( - UIPixelFormat.INT_RGB888, 240, 320)); - - default: - throw new IllegalArgumentException(__backend); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/FailingExecution.java b/modules/midp-lcdui/src/test/java/mleui/FailingExecution.java deleted file mode 100644 index f059b80338..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/FailingExecution.java +++ /dev/null @@ -1,30 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui; - -/** - * Indicates that the display test is failing. - * - * @since 2020/10/10 - */ -public class FailingExecution - extends RuntimeException -{ - /** - * Initializes the exception. - * - * @param __s The message. - * @since 2020/10/10 - */ - public FailingExecution(String __s) - { - super(__s); - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/TestDisplayMetrics.java b/modules/midp-lcdui/src/test/java/mleui/TestDisplayMetrics.java deleted file mode 100644 index dc5d82cd88..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/TestDisplayMetrics.java +++ /dev/null @@ -1,193 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.constants.UIInputFlag; -import cc.squirreljme.jvm.mle.constants.UIMetricType; -import cc.squirreljme.jvm.mle.constants.UIPixelFormat; -import cc.squirreljme.jvm.mle.exceptions.MLECallError; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests that display metrics work properly. - * - * @since 2020/10/10 - */ -public class TestDisplayMetrics - extends BaseBackend -{ - /** The alpha mask for colors. */ - private static final int _ALPHA_MASK = - 0xFF_000000; - - /** - * {@inheritDoc} - * @since 2020/10/10 - */ - @Override - public void test(UIBackend __backend, UIDisplayBracket __display) - throws Throwable - { - // Check that the lower count fails - try - { - __backend.metric(__display, -1); - this.secondary("bad-lower", true); - } - catch (MLECallError e) - { - this.secondary("good-lower", true); - } - - // Check that the upper count fails - try - { - __backend.metric(__display, UIMetricType.NUM_METRICS); - this.secondary("bad-upper", true); - } - catch (MLECallError e) - { - this.secondary("good-upper", true); - } - - // Test each individual metric - int okayCount = 0; - for (int metric = 0; metric < UIMetricType.NUM_METRICS; metric++) - try - { - this.testMetric(__display, __backend, metric); - okayCount++; - } - catch (MLECallError e) - { - e.printStackTrace(); - - this.secondary("fail-" + metric, true); - } - - this.secondary("okay", okayCount); - this.secondary("total", (int)UIMetricType.NUM_METRICS); - } - - /** - * Tests that the given metrics are correctly implemented. - * - * @param __display The display to test. - * @param __backend The backend to test. - * @param __metric The {@link UIMetricType} to test. - * @since 2020/10/10 - */ - private void testMetric(UIDisplayBracket __display, UIBackend __backend, - int __metric) - { - switch (__metric) - { - case UIMetricType.UIFORMS_SUPPORTED: - this.secondary("forms-supported", 0 != __backend - .metric(__display, __metric)); - break; - - case UIMetricType.DISPLAY_MAX_WIDTH: - this.secondary("positive-max-width", __backend - .metric(__display, __metric) > 0); - break; - - case UIMetricType.DISPLAY_MAX_HEIGHT: - this.secondary("positive-max-height", __backend - .metric(__display, __metric) > 0); - break; - - case UIMetricType.DISPLAY_CURRENT_WIDTH: - this.secondary("positive-current-width", - __backend.metric(__display, __metric) > 0); - break; - - case UIMetricType.DISPLAY_CURRENT_HEIGHT: - this.secondary("positive-current-height", - __backend.metric(__display, __metric) > 0); - break; - - // Only two values are okay as this is a boolean - case UIMetricType.DISPLAY_MONOCHROMATIC: - int mono = __backend.metric(__display, __metric); - this.secondary("mono", (mono == 0 || mono == 1)); - break; - - case UIMetricType.DISPLAY_PIXEL_FORMAT: - int pf = __backend.metric(__display, __metric); - this.secondary("pf", - (pf >= 0 && pf < UIPixelFormat.NUM_PIXEL_FORMATS)); - - // These pixel formats are allowed to be monochromatic, the - // others are purely color based - this.secondary("pf-mono-okay", - TestDisplayMetrics.__canMono(pf) == (0 != - __backend.metric(__display, - UIMetricType.DISPLAY_MONOCHROMATIC))); - break; - - // These do not make sense to test, but should still result in - // success - case UIMetricType.INPUT_FLAGS: - int inputs = __backend.metric(__display, __metric); - this.secondary("inputs", - ((inputs & (~UIInputFlag.ALL_MASK)))); - break; - - // For colors, the alpha mask must never be set to anything as - // these are purely RGB colors - case UIMetricType.COLOR_CANVAS_BACKGROUND: - int color = __backend.metric(__display, __metric); - if ((color & TestDisplayMetrics._ALPHA_MASK) != 0) - this.secondary("bad-color-" + __metric, color); - break; - - // Vibration support is limited to do - case UIMetricType.SUPPORTS_VIBRATION: - int vib = __backend.metric(__display, __metric); - this.secondary("vibrate", (vib == 0 || vib == 1)); - break; - - case UIMetricType.LIST_ITEM_HEIGHT: - this.secondary("positive-list-height", - __backend.metric(__display, __metric) > 0); - break; - - case UIMetricType.COMMAND_BAR_HEIGHT: - this.secondary("positive-command-height", - __backend.metric(__display, __metric) > 0); - break; - - case UIMetricType.SUPPORTS_BACKLIGHT_CONTROL: - int bl = __backend.metric(__display, __metric); - this.secondary("backlight", (bl == 0 || bl == 1)); - break; - - default: - throw new FailingExecution("Missing " + __metric); - } - } - - /** - * Tests if the display can be monochromatic with these pixel formats. - * - * @param __pf The pixel format. - * @return If these can be mono. - * @since 2020/10/10 - */ - private static boolean __canMono(int __pf) - { - return (__pf == UIPixelFormat.BYTE_INDEXED256 || - __pf == UIPixelFormat.PACKED_INDEXED4 || - __pf == UIPixelFormat.PACKED_INDEXED2 || - __pf == UIPixelFormat.PACKED_INDEXED1); - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/BaseUIForm.java b/modules/midp-lcdui/src/test/java/mleui/forms/BaseUIForm.java deleted file mode 100644 index 9207341c26..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/BaseUIForm.java +++ /dev/null @@ -1,72 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.runtime.cldc.debug.Debugging; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import mleui.BaseBackend; - -/** - * Base tests on forms associated with a display. - * - * @since 2020/07/01 - */ -public abstract class BaseUIForm - extends BaseBackend -{ - /** - * Performs the UI test. - * - * @param __backend The backend to use for calls. - * @param __display The display. - * @param __form The form. - * @throws Throwable Any exceptions as needed. - * @since 2020/07/01 - */ - protected abstract void test(UIBackend __backend, - UIDisplayBracket __display, UIFormBracket __form) - throws Throwable; - - /** - * {@inheritDoc} - * @since 2020/07/01 - */ - @Override - public final void test(UIBackend __backend, UIDisplayBracket __display) - throws Throwable - { - UIFormBracket form = __backend.formNew(); - try - { - // We should actually display the form in order to see if it - // works - __backend.displayShow(__display, form); - __backend.flushEvents(); - - // Run the test - this.test(__backend, __display, form); - } - - // Delete the form - finally - { - // Debug - Debugging.debugNote("Cleaning up form..."); - - // Remove from the display and delete it - __backend.displayShow(__display, null); - __backend.formDelete(form); - - Debugging.debugNote("Cleaned up!"); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/FormTestException.java b/modules/midp-lcdui/src/test/java/mleui/forms/FormTestException.java deleted file mode 100644 index 7e67bf41af..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/FormTestException.java +++ /dev/null @@ -1,30 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -/** - * Used to indicate a specific exception in form tests. - * - * @since 2020/07/19 - */ -public final class FormTestException - extends RuntimeException -{ - /** - * Initializes the exception. - * - * @param __c The cause. - * @since 2020/07/19 - */ - public FormTestException(Throwable __c) - { - super(__c); - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestAllSpecial.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestAllSpecial.java deleted file mode 100644 index bee2c02e02..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestAllSpecial.java +++ /dev/null @@ -1,74 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemPosition; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests all the special slots. - * - * @since 2020/07/18 - */ -public class TestAllSpecial - extends BaseUIForm -{ - /** - * {@inheritDoc} - * @since 2020/07/18 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - { - int n = (-UIItemPosition.MIN_VALUE) + 1; - UIItemBracket[] special = new UIItemBracket[n]; - UIItemBracket[] normals = new UIItemBracket[n]; - - for (int i = 0; i < n; i++) - { - special[i] = __backend.itemNew(UIItemType.BUTTON); - normals[i] = __backend.itemNew(UIItemType.SINGLE_LINE_TEXT_BOX); - } - - // Add all the items - for (int i = 0; i < n; i++) - { - // Skip the body so it is not there - if (i > 0 && i != -UIItemPosition.BODY) - __backend.formItemPosition(__form, special[i], -i); - - // Add normal items otherwise - __backend.formItemPosition(__form, normals[i], i); - } - - // Remove all the items - for (int i = n - 1; i >= 0; i--) - { - // Skip the body so it is not there - if (i > 0 && i != -UIItemPosition.BODY) - __backend.formItemRemove(__form, -i); - - // Add normal items otherwise - __backend.formItemRemove(__form, i); - } - - // Cleanup - for (int i = 1; i < n; i++) - { - __backend.itemDelete(special[i]); - __backend.itemDelete(normals[i]); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestCreateItems.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestCreateItems.java deleted file mode 100644 index e9b05dc8a0..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestCreateItems.java +++ /dev/null @@ -1,46 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests the creation of items. - * - * @since 2020/07/18 - */ -public class TestCreateItems - extends BaseUIForm -{ - /** - * {@inheritDoc} - * @since 2020/07/18 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - { - for (int i = 0; i < UIItemType.NUM_TYPES; i++) - { - // Create the item - UIItemBracket item = __backend.itemNew(i); - - // Then quickly delete it - __backend.itemDelete(item); - - // Note it - this.secondary("did-" + i, true); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestDeleteVisibleItem.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestDeleteVisibleItem.java deleted file mode 100644 index 667d8ef680..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestDeleteVisibleItem.java +++ /dev/null @@ -1,50 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.jvm.mle.exceptions.MLECallError; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Checks that deleting visible items fails. - * - * @since 2020/07/19 - */ -public class TestDeleteVisibleItem - extends BaseUIForm -{ - /** - * {@inheritDoc} - * @since 2020/07/19 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - throws Throwable - { - // Create the item and make it visible on the form - UIItemBracket item = __backend.itemNew(UIItemType.BUTTON); - __backend.formItemPosition(__form, item, 0); - - // Attempt to delete the item - try - { - __backend.itemDelete(item); - } - catch (MLECallError e) - { - throw new FormTestException(e); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestFormItemCounts.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestFormItemCounts.java deleted file mode 100644 index 582b7b0639..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestFormItemCounts.java +++ /dev/null @@ -1,76 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemPosition; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests that item counts are correct in forms. - * - * @since 2020/07/19 - */ -public class TestFormItemCounts - extends BaseUIForm -{ - /** The number of items to add. */ - public static final int COUNT = - 16; - - /** - * {@inheritDoc} - * @since 2020/07/19 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - { - // Before adding everything - this.secondary("beforeall", __backend.formItemCount(__form)); - - // Adding to the special items should not have any effect on size - UIItemBracket left = __backend.itemNew(UIItemType.BUTTON); - __backend.formItemPosition(__form, left, - UIItemPosition.LEFT_COMMAND); - this.secondary("leftcmd", __backend.formItemCount(__form)); - - // Adding items should increase the item count - UIItemBracket[] items = new UIItemBracket[TestFormItemCounts.COUNT]; - for (int i = 0; i < TestFormItemCounts.COUNT; i++) - { - items[i] = __backend.itemNew(UIItemType.BUTTON); - - __backend.formItemPosition(__form, items[i], i); - - this.secondary("afteradd-" + i, - __backend.formItemCount(__form)); - } - - // Should be COUNT - this.secondary("afteradds", __backend.formItemCount(__form)); - - // Remove everything - for (int i = TestFormItemCounts.COUNT - 1; i >= 0; i--) - { - this.secondary("removed-same-" + i, __backend.equals( - __backend.formItemRemove(__form, i), items[i])); - - this.secondary("remove-" + i, - __backend.formItemCount(__form)); - } - - // There should be nothing left - this.secondary("afterall", __backend.formItemCount(__form)); - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestFormProperties.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestFormProperties.java deleted file mode 100644 index b624baf4a5..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestFormProperties.java +++ /dev/null @@ -1,222 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.jvm.mle.constants.UIWidgetProperty; -import cc.squirreljme.jvm.mle.exceptions.MLECallError; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import mleui.FailingExecution; - -/** - * Tests that form properties are correct. - * - * @since 2020/10/11 - */ -public class TestFormProperties - extends BaseUIForm -{ - /** Invalid string. */ - private static final String _INVALID_STRING = - "\0\0\0\0INVALID\0STRING\0\0\0\0"; - - /** - * {@inheritDoc} - * @since 2020/10/11 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - { - // Add a button to give the form some size - __backend.formItemPosition(__form, - __backend.itemNew(UIItemType.BUTTON), 0); - __backend.flushEvents(); - - // Test each individual metric - for (int prop = -1; prop <= UIWidgetProperty.NUM_PROPERTIES; prop++) - try - { - this.testProperty(__backend, __form, prop); - - // Should have failed - if (prop <= 0 || prop >= UIWidgetProperty.NUM_PROPERTIES) - this.secondary("bad-neg-pos", true); - } - catch (MLECallError e) - { - // Is okay to fail here - if (prop < 0) - this.secondary("neg-fails", true); - else if (prop == 0) - this.secondary("null-fails", true); - else if (prop >= UIWidgetProperty.NUM_PROPERTIES) - this.secondary("pos-fails", true); - - // Fails here - else - { - e.printStackTrace(); - - this.secondary("fail-" + prop, true); - } - } - - this.secondary("total", (int)UIWidgetProperty.NUM_PROPERTIES); - } - - /** - * Tests that the given property are correctly implemented. - * - * @param __backend The backend to test. - * @param __property The {@link UIWidgetProperty} to test. - * @since 2020/10/11 - */ - private void testProperty(UIBackend __backend, UIFormBracket __form, - int __property) - { - MLECallError[] exceptions = new MLECallError[2]; - - // Try to obtain the integer value - Integer iVal = null; - try - { - iVal = __backend.widgetPropertyInt(__form, __property, 0); - } - catch (MLECallError e) - { - exceptions[0] = e; - } - - // Try to obtain the string value - String sVal = TestFormProperties._INVALID_STRING; - try - { - sVal = __backend.widgetPropertyStr(__form, __property, 0); - } - catch (MLECallError e) - { - exceptions[1] = e; - } - - // This may be a possible failure, if both could not be gotten - // noinspection StringEquality - boolean noEitherGet = (iVal == null && - sVal == TestFormProperties._INVALID_STRING); - - // Do actions based on whatever the property is... - switch (__property) - { - // These are just failing properties - case -1: - case UIWidgetProperty.NULL: - case UIWidgetProperty.NUM_PROPERTIES: - break; - - case UIWidgetProperty.STRING_LABEL: - this.secondary("no-label", noEitherGet); - return; - - case UIWidgetProperty.INT_SIGNAL_REPAINT: - this.secondary("no-repaint", noEitherGet); - return; - - case UIWidgetProperty.INT_WIDTH: - if (iVal != null) - this.secondary("positive-width", iVal > 0); - break; - - case UIWidgetProperty.INT_HEIGHT: - if (iVal != null) - this.secondary("positive-height", iVal > 0); - break; - - case UIWidgetProperty.INT_X_POSITION: - this.secondary("has-x", !noEitherGet); - break; - - case UIWidgetProperty.INT_Y_POSITION: - this.secondary("has-y", !noEitherGet); - break; - - case UIWidgetProperty.INT_IS_SHOWN: - this.secondary("has-shown", !noEitherGet); - break; - - case UIWidgetProperty.INT_WIDTH_AND_HEIGHT: - this.secondary("no-wah", noEitherGet); - return; - - case UIWidgetProperty.INT_LIST_TYPE: - this.secondary("no-list-type", noEitherGet); - return; - - case UIWidgetProperty.INT_LIST_ITEM_DISABLED: - this.secondary("no-list-enabled", noEitherGet); - return; - - case UIWidgetProperty.INT_LIST_ITEM_ICON_DIMENSION: - this.secondary("no-list-paint", noEitherGet); - return; - - case UIWidgetProperty.INT_LIST_ITEM_SELECTED: - this.secondary("no-list-selected", noEitherGet); - return; - - case UIWidgetProperty.INT_NUM_ELEMENTS: - this.secondary("no-num-elements", noEitherGet); - return; - - case UIWidgetProperty.STRING_LIST_ITEM_LABEL: - this.secondary("no-list-label", noEitherGet); - return; - - case UIWidgetProperty.INT_LIST_ITEM_ID_CODE: - this.secondary("no-list-idcode", noEitherGet); - return; - - case UIWidgetProperty.INT_LIST_ITEM_FONT: - this.secondary("no-list-font", noEitherGet); - return; - - case UIWidgetProperty.INT_UIITEM_TYPE: - this.secondary("is-form", iVal == UIItemType.FORM); - break; - - case UIWidgetProperty.INT_UPDATE_LIST_SELECTION_LOCK: - this.secondary("no-selection-lock", noEitherGet); - return; - - case UIWidgetProperty.STRING_FORM_TITLE: - this.secondary("has-form-title", !noEitherGet); - return; - - case UIWidgetProperty.INT_SIGNAL_FOCUS: - this.secondary("no-signal-focus", noEitherGet); - return; - - default: - throw new FailingExecution("Missing " + __property); - } - - // Could not get either of the two values, so fail - if (noEitherGet) - { - MLECallError fail = new MLECallError("No properties."); - for (MLECallError e : exceptions) - if (e != null) - fail.addSuppressed(e); - - throw fail; - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestItemDragging.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestItemDragging.java deleted file mode 100644 index 30c088fac8..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestItemDragging.java +++ /dev/null @@ -1,73 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemPosition; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Drags an item across the form to ensure that it gets reassigned properly - * and the item only appears at the given index. - * - * @since 2020/07/19 - */ -public class TestItemDragging - extends BaseUIForm -{ - /** - * {@inheritDoc} - * @since 2020/07/19 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - { - // This item will be dragged around - UIItemBracket item = __backend.itemNew(UIItemType.BUTTON); - - // Move around each position! - int oldPos = UIItemPosition.NOT_ON_FORM; - for (int pos = UIItemPosition.MIN_VALUE; pos <= 0; pos++) - { - // Is the old position null? - if (oldPos != UIItemPosition.NOT_ON_FORM) - this.secondary("old-isnull-" + pos, __backend - .formItemAtPosition(__form, oldPos) == null); - - // The position of the item then - this.secondary("then-pos-" + pos, - __backend.formItemPosition(__form, item)); - - // Set new item position - __backend.formItemPosition(__form, item, pos); - - // Is the item at this position, this one? - this.secondary("now-isthis-" + pos, - __backend.equals(__backend.formItemAtPosition(__form, pos), - item)); - - // The position of the item now - this.secondary("now-pos-" + pos, - __backend.formItemPosition(__form, item)); - - // Old position becomes the current one - oldPos = pos; - } - - this.secondary("zero-isthis", __backend.equals( - __backend.formItemAtPosition(__form, 0), item)); - this.secondary("zero-pos", - __backend.formItemPosition(__form, item)); - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestItemFormOwner.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestItemFormOwner.java deleted file mode 100644 index fc74ea435e..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestItemFormOwner.java +++ /dev/null @@ -1,52 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests that the item on the form is the item of the given form. - * - * @since 2021/01/03 - */ -public class TestItemFormOwner - extends BaseUIForm -{ - /** - * {@inheritDoc} - * @since 2021/01/03 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - throws Throwable - { - UIItemBracket item = __backend.itemNew(UIItemType.BUTTON); - - // Should not be on the form - this.secondary("first-null", - null == __backend.itemForm(item)); - - // Placing it on the form, it should point to that form - __backend.formItemPosition(__form, item, 0); - this.secondary("set-matches", - __backend.equals(__form, __backend.itemForm(item))); - - // Replacing the item should make it go away - UIItemBracket rep = __backend.itemNew(UIItemType.LABEL); - __backend.formItemPosition(__form, rep, 0); - this.secondary("replace-null", - null == __backend.itemForm(item)); - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestItemRemoveShift.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestItemRemoveShift.java deleted file mode 100644 index a52eaa31f1..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestItemRemoveShift.java +++ /dev/null @@ -1,83 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -/** - * Tests that removing items shifts them accordingly. - * - * @since 2020/07/19 - */ -public class TestItemRemoveShift - extends BaseUIForm -{ - /** - * {@inheritDoc} - * @since 2020/07/19 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - { - // Setup all the items and add to the form beforehand - List<__Holder__> items = new ArrayList<>(); - for (int i = 0; i < UIItemType.NUM_TYPES; i++) - { - UIItemBracket item = __backend.itemNew(i); - - items.add(new __Holder__(item)); - __backend.formItemPosition(__form, item, i); - } - - // We will be removing random elements! - Random random = new Random(12); - int removalCount = 0; - while (!items.isEmpty()) - { - int count = items.size(); - - // Determine index to be removed - int dx = (count == 1 ? 0 : random.nextInt(count)); - - // Remove that item - UIItemBracket old = __backend.formItemRemove(__form, dx); - - // Should both be the same items from the list - this.secondary("same-" + removalCount, - __backend.equals(old, items.remove(dx).item)); - - // Count should be reduced by one - int subCount = count - 1; - this.secondary("subcount-" + removalCount, - subCount == __backend.formItemCount(__form)); - - // All of these should be the same item in the list - boolean[] matches = new boolean[subCount]; - for (int j = 0; j < subCount; j++) - matches[j] = __backend.equals(items.get(j).item, - __backend.formItemAtPosition(__form, j)); - this.secondary("sameitems-" + removalCount, matches); - - // For the next run (in testing) - removalCount++; - } - - // Form should be empty - this.secondary("empty", __backend.formItemCount(__form)); - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestShowBlankDisplay.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestShowBlankDisplay.java deleted file mode 100644 index 84f9491f2c..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestShowBlankDisplay.java +++ /dev/null @@ -1,34 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests that showing a blank form works properly. - * - * @since 2020/07/01 - */ -public class TestShowBlankDisplay - extends BaseUIForm -{ - /** - * {@inheritDoc} - * @since 2020/07/01 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - { - // Does nothing because the form test shows this automatically - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestShowItems.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestShowItems.java deleted file mode 100644 index 823602d2a7..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestShowItems.java +++ /dev/null @@ -1,49 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests that item showing works. - * - * @since 2020/07/18 - */ -public class TestShowItems - extends BaseUIForm -{ - /** - * {@inheritDoc} - * @since 2020/07/18 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - { - for (int i = 0; i < UIItemType.NUM_TYPES; i++) - { - // Create the item - UIItemBracket item = __backend.itemNew(i); - - // Show it - __backend.formItemPosition(__form, item, 0); - this.secondary("pos-" + i, - __backend.formItemPosition(__form, item)); - - // Then quickly delete it - __backend.formItemRemove(__form, 0); - __backend.itemDelete(item); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/TestUseItemAfterDelete.java b/modules/midp-lcdui/src/test/java/mleui/forms/TestUseItemAfterDelete.java deleted file mode 100644 index c84b939595..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/TestUseItemAfterDelete.java +++ /dev/null @@ -1,51 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.jvm.mle.exceptions.MLECallError; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests that items cannot be used after deletion. - * - * @since 2020/07/19 - */ -public class TestUseItemAfterDelete - extends BaseUIForm -{ - /** - * {@inheritDoc} - * @since 2020/07/19 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - { - // Create the item - UIItemBracket item = __backend.itemNew(UIItemType.BUTTON); - - // Quickly delete it so it is not valid - __backend.itemDelete(item); - - // Attempt to place it on the form - try - { - __backend.formItemPosition(__form, item, 0); - } - catch (MLECallError e) - { - throw new FormTestException(e); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/__Holder__.java b/modules/midp-lcdui/src/test/java/mleui/forms/__Holder__.java deleted file mode 100644 index c45c9ac126..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/__Holder__.java +++ /dev/null @@ -1,34 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.forms; - -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; - -/** - * Holds item brackets. - * - * @since 2020/10/09 - */ -final class __Holder__ -{ - /** The item to do. */ - protected final UIItemBracket item; - - /** - * Initializes the holder. - * - * @param __item The item to hold. - * @since 2020/10/09 - */ - __Holder__(UIItemBracket __item) - { - this.item = __item; - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/forms/package-info.java b/modules/midp-lcdui/src/test/java/mleui/forms/package-info.java deleted file mode 100644 index adef3d4571..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/forms/package-info.java +++ /dev/null @@ -1,17 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -/** - * This package contains the tests for - * {@link cc.squirreljme.jvm.mle.__backend}. - * - * @since 2020/07/01 - */ - -package mleui.forms; diff --git a/modules/midp-lcdui/src/test/java/mleui/invalid/TestUIFormShelfInvalid.java b/modules/midp-lcdui/src/test/java/mleui/invalid/TestUIFormShelfInvalid.java deleted file mode 100644 index f6fc7142f6..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/invalid/TestUIFormShelfInvalid.java +++ /dev/null @@ -1,196 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.invalid; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemPosition; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.jvm.mle.constants.UIMetricType; -import cc.squirreljme.jvm.mle.exceptions.MLECallError; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import mleui.BaseBackend; -import net.multiphasicapps.tac.UntestableException; - -/** - * Tests whether {@link UIBackend} fails as it should with invalid values. - * - * @since 2020/06/30 - */ -public class TestUIFormShelfInvalid - extends BaseBackend -{ - /** - * {@inheritDoc} - * @since 2020/06/22 - */ - @Override - public void test(UIBackend __backend, UIDisplayBracket __display) - throws Throwable - { - // Call sub-test methods and make sure they fail - int callCount = 0; - int errorCount = 0; - for (int i = 0;; i++) - { - // Perform the call - try - { - callCount++; - - // Run the test and stop if this is the end - if (this.test(__display, __backend, i)) - { - callCount--; - break; - } - - // Send invalid secondary to flag that something is wrong - this.secondary("not-thrown-" + i, i); - } - - // Caught exception that we want - catch (MLECallError ignored) - { - errorCount++; - } - } - - // Report the count - this.secondary("calls", callCount); - this.secondary("errors", errorCount); - } - - /** - * Runs the test. - * - * @param __display The display used. - * @param __backend The backend. - * @param __index The index. - * @since 2020/06/22 - */ - @SuppressWarnings("ResultOfMethodCallIgnored") - public boolean test(UIDisplayBracket __display, UIBackend __backend, - int __index) - throws MLECallError - { - // Check to see if forms are actually supported, if not then we cannot - // check if it is invalid - if (0 == __backend.metric(__display, UIMetricType.UIFORMS_SUPPORTED)) - throw new UntestableException("UIForms Not Supported!"); - - UIItemBracket fake; - switch (__index) - { - case 0: - __backend.metric(__display, -1); - break; - - case 1: - __backend.metric(__display, UIMetricType.NUM_METRICS); - break; - - case 2: - __backend.formItemPosition(__backend.formNew(), - __backend.itemNew(UIItemType.BUTTON), - UIItemPosition.MIN_VALUE - 1); - break; - - case 3: - __backend.formItemRemove(__backend.formNew(), - UIItemPosition.BODY); - break; - - case 4: - __backend.itemForm(null); - break; - - case 5: - __backend.displayCurrent(null); - break; - - case 6: - __backend.displayShow(null, null); - break; - - case 7: - __backend.callback(null, (UIDisplayCallback)null); - break; - - case 8: - __backend.formDelete(null); - break; - - case 9: - __backend.callback(null, (UIFormCallback)null); - break; - - case 10: - __backend.itemNew(-1); - break; - - case 11: - __backend.itemNew(UIItemType.NUM_TYPES); - break; - - case 12: - __backend.itemDelete(null); - break; - - case 13: - fake = __backend.itemNew(UIItemType.BUTTON); - __backend.itemDelete(fake); - __backend.itemDelete(fake); - break; - - case 14: - __backend.formItemCount(null); - break; - - case 15: - __backend.formItemRemove(null, 0); - break; - - case 16: - __backend.formItemRemove(__backend.formNew(), 0); - break; - - case 17: - __backend.formItemRemove(__backend.formNew(), - UIItemPosition.MIN_VALUE - 1); - break; - - case 18: - __backend.formItemAtPosition(__backend.formNew(), - UIItemPosition.MIN_VALUE - 1); - break; - - case 19: - __backend.formItemAtPosition(__backend.formNew(), - 0); - break; - - case 20: - __backend.formItemPosition(__backend.formNew(), - null, -1); - break; - - case 21: - __backend.formItemPosition(__backend.formNew(), - __backend.itemNew(UIItemType.BUTTON), 1); - break; - - default: - return true; - } - - return false; - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/invalid/package-info.java b/modules/midp-lcdui/src/test/java/mleui/invalid/package-info.java deleted file mode 100644 index beb9c6b103..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/invalid/package-info.java +++ /dev/null @@ -1,17 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -/** - * Tests that invalid inputs for the various form shelves are tests and - * properly fail. - * - * @since 2020/10/10 - */ - -package mleui.invalid; diff --git a/modules/midp-lcdui/src/test/java/mleui/lists/BaseList.java b/modules/midp-lcdui/src/test/java/mleui/lists/BaseList.java deleted file mode 100644 index ecb0f7e022..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/lists/BaseList.java +++ /dev/null @@ -1,79 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.lists; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIItemPosition; -import cc.squirreljme.jvm.mle.constants.UIItemType; -import cc.squirreljme.jvm.mle.exceptions.MLECallError; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import mleui.forms.BaseUIForm; - -/** - * This is the base class for any tests on lists. - * - * @since 2020/10/18 - */ -public abstract class BaseList - extends BaseUIForm -{ - /** - * Tests the list. - * - * @param __backend The backend used. - * @param __display The display used. - * @param __form The form used. - * @param __list The list used. - * @throws Throwable On any exception. - * @since 2020/10/18 - */ - public abstract void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form, UIItemBracket __list) - throws Throwable; - - /** - * {@inheritDoc} - * @since 2020/10/18 - */ - @Override - protected void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form) - throws Throwable - { - UIItemBracket list = __backend.itemNew(UIItemType.LIST); - try - { - // Add to the form - __backend.formItemPosition(__form, list, UIItemPosition.BODY); - __backend.flushEvents(); - - // Forward to the test - this.test(__backend, __display, __form, list); - } - - // Try deleting the item and freeing it up - finally - { - try - { - __backend.formItemRemove(__form, UIItemPosition.BODY); - __backend.itemDelete(list); - } - - // Ignored otherwise - catch (MLECallError e) - { - e.printStackTrace(); - } - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/lists/ListCallback.java b/modules/midp-lcdui/src/test/java/mleui/lists/ListCallback.java deleted file mode 100644 index e56ee552d0..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/lists/ListCallback.java +++ /dev/null @@ -1,106 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.lists; - -import cc.squirreljme.jvm.mle.brackets.UIDrawableBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.runtime.cldc.debug.Debugging; - -/** - * Callback for list events. - * - * @since 2020/10/29 - */ -public class ListCallback - implements UIFormCallback -{ - /** Painted items. */ - volatile int _painted; - - /** - * {@inheritDoc} - * @since 2020/10/29 - */ - @Override - public void eventKey(UIDrawableBracket __drawable, - int __event, int __keyCode, int __modifiers) - { - } - - /** - * {@inheritDoc} - * @since 2020/10/29 - */ - @Override - public void eventMouse(UIDrawableBracket __drawable, - int __event, int __button, int __x, int __y, int __modifiers) - { - } - - /** - * {@inheritDoc} - * @since 2020/10/29 - */ - @Override - public void exitRequest(UIDrawableBracket __drawable) - { - } - - /** - * {@inheritDoc} - * @since 2022/07/21 - */ - @Override - public void formRefresh(UIFormBracket __form, int __sx, int __sy, - int __sw, int __sh) - { - } - - /** - * {@inheritDoc} - * @since 2020/10/29 - */ - @Override - public void paint(UIDrawableBracket __drawable, int __pf, - int __bw, int __bh, Object __buf, int[] __pal, int __sx, - int __sy, int __sw, int __sh, int __special) - { - int hob = Integer.highestOneBit(Math.max(__sw, __sh)); - Debugging.debugNote("Painting icon! %dx%d (%d)", - __bw, __bh, hob); - - synchronized (this) - { - if (hob >= 1 && hob < Integer.MAX_VALUE) - this._painted |= hob; - } - } - - /** - * {@inheritDoc} - * @since 2020/10/29 - */ - @Override - public void propertyChange(UIFormBracket __form, UIItemBracket __item, - int __intProp, int __sub, int __old, int __new) - { - } - - /** - * {@inheritDoc} - * @since 2020/10/29 - */ - @Override - public void propertyChange(UIFormBracket __form, UIItemBracket __item, - int __strProp, int __sub, String __old, String __new) - { - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/lists/ListItem.java b/modules/midp-lcdui/src/test/java/mleui/lists/ListItem.java deleted file mode 100644 index d42d4f131a..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/lists/ListItem.java +++ /dev/null @@ -1,146 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.lists; - -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIWidgetProperty; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import java.util.Objects; - -/** - * Represents a single item's data on a list. - * - * @since 2020/10/27 - */ -public final class ListItem -{ - /** Is this enabled? */ - boolean _disabled; - - /** Is this selected? */ - boolean _selected; - - /** Icon dimension. */ - int _iconDimension; - - /** ID Code. */ - int _idCode; - - /** The label. */ - String _label; - - /** The font to use. */ - int _font; - - /** - * {@inheritDoc} - * @since 2020/10/27 - */ - @Override - public final boolean equals(Object __o) - { - if (__o == this) - return true; - - if (!(__o instanceof ListItem)) - return false; - - ListItem o = (ListItem)__o; - return this.hashCode() == o.hashCode() && - this._disabled == o._disabled && - this._selected == o._selected && - this._iconDimension == o._iconDimension && - this._idCode == o._idCode && - Objects.equals(this._label, o._label) && - this._font == o._font; - } - - /** - * {@inheritDoc} - * @since 2020/10/27 - */ - @Override - public final int hashCode() - { - int rv = 0; - - rv ^= (this._selected ? 0x8000_0000 : 0x4000_0000); - rv ^= (this._disabled ? 0x0800_0000 : 0x0400_0000); - rv ^= (this._label != null ? - (this._label.hashCode() | 0x0080_0000) : 0x0040_0000); - rv ^= this._iconDimension; - rv ^= this._idCode; - rv ^= this._font; - - return rv; - } - - /** - * Stores this item into the list. - * - * @param __backend The backend. - * @param __list The list to read from. - * @param __i The index to read. - * @since 2020/10/29 - */ - public void into(UIBackend __backend, UIItemBracket __list, int __i) - { - __backend.widgetProperty(__list, - UIWidgetProperty.INT_LIST_ITEM_DISABLED, __i, - (this._disabled ? 1 : 0)); - __backend.widgetProperty(__list, - UIWidgetProperty.INT_LIST_ITEM_SELECTED, __i, - (this._selected ? 1 : 0)); - __backend.widgetProperty(__list, - UIWidgetProperty.INT_LIST_ITEM_ICON_DIMENSION, __i, - this._iconDimension); - __backend.widgetProperty(__list, - UIWidgetProperty.INT_LIST_ITEM_ID_CODE, __i, - this._idCode); - - __backend.widgetProperty(__list, - UIWidgetProperty.STRING_LIST_ITEM_LABEL, __i, - this._label); - __backend.widgetProperty(__list, - UIWidgetProperty.INT_LIST_ITEM_FONT, __i, - this._font); - } - - /** - * Reads a list item from the backend. - * - * @param __backend The backend. - * @param __list The list to read from. - * @param __i The index to read. - * @return The list item for the given item. - * @since 2020/10/29 - */ - public static ListItem of(UIBackend __backend, UIItemBracket __list, - int __i) - { - ListItem rv = new ListItem(); - - rv._disabled = (0 != __backend.widgetPropertyInt(__list, - UIWidgetProperty.INT_LIST_ITEM_DISABLED, __i)); - rv._selected = (0 != __backend.widgetPropertyInt(__list, - UIWidgetProperty.INT_LIST_ITEM_SELECTED, __i)); - rv._iconDimension = __backend.widgetPropertyInt(__list, - UIWidgetProperty.INT_LIST_ITEM_ICON_DIMENSION, __i); - rv._idCode = __backend.widgetPropertyInt(__list, - UIWidgetProperty.INT_LIST_ITEM_ID_CODE, __i); - rv._font = __backend.widgetPropertyInt(__list, - UIWidgetProperty.INT_LIST_ITEM_FONT, __i); - - rv._label = __backend.widgetPropertyStr(__list, - UIWidgetProperty.STRING_LIST_ITEM_LABEL, __i); - - return rv; - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/lists/TestInvalidListProperties.java b/modules/midp-lcdui/src/test/java/mleui/lists/TestInvalidListProperties.java deleted file mode 100644 index b53487dbf5..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/lists/TestInvalidListProperties.java +++ /dev/null @@ -1,47 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.lists; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIWidgetProperty; -import cc.squirreljme.jvm.mle.exceptions.MLECallError; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests for invalid list properties. - * - * @since 2020/10/31 - */ -public class TestInvalidListProperties - extends BaseList -{ - /** - * {@inheritDoc} - * @since 2020/10/31 - */ - @Override - public void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form, UIItemBracket __list) - { - // Negative list size - try - { - __backend.widgetProperty(__list, UIWidgetProperty.INT_NUM_ELEMENTS, - 0, -1); - this.secondary("invalid-neg-size", 0); - } - catch (MLECallError e) - { - this.secondary("neg-size", true); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/lists/TestListIconImage.java b/modules/midp-lcdui/src/test/java/mleui/lists/TestListIconImage.java deleted file mode 100644 index 56e345584f..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/lists/TestListIconImage.java +++ /dev/null @@ -1,67 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.lists; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIWidgetProperty; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests that icon images are requested and drawn for list items. - * - * @since 2020/10/29 - */ -public class TestListIconImage - extends BaseList -{ - /** - * {@inheritDoc} - * @since 2020/10/29 - */ - @Override - public void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form, UIItemBracket __list) - { - // We need to register a callback and know when events occur - ListCallback lc = new ListCallback(); - __backend.callback(__form, lc); - - // Make the list able to store an element - __backend.widgetProperty(__list, UIWidgetProperty.INT_NUM_ELEMENTS, - 0, 1); - __backend.widgetProperty(__list, - UIWidgetProperty.STRING_LIST_ITEM_LABEL, - 0, "A list item!"); - __backend.flushEvents(); - - // Draw various numbers of items - ListItem item = new ListItem(); - for (int dim : new int[]{1, 2, 4, 8, 16, 32, 64}) - { - // Store item information - item._iconDimension = dim; - item.into(__backend, __list, 0); - - // Hope that it gets a draw event - __backend.flushEvents(); - } - - // Wait until drawing potentially happens - __backend.flushEvents(); - - // Icons which got painted? - synchronized (lc) - { - this.secondary("painted", lc._painted); - } - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/lists/TestListItemReset.java b/modules/midp-lcdui/src/test/java/mleui/lists/TestListItemReset.java deleted file mode 100644 index 1523dacaf6..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/lists/TestListItemReset.java +++ /dev/null @@ -1,109 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.lists; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIWidgetProperty; -import cc.squirreljme.runtime.lcdui.font.FontUtilities; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; -import javax.microedition.lcdui.Font; - -/** - * Tests resetting of list items after a list has been resized and those items - * were there. New items should be initialized to zero, while items that get - * erased away should revert back to zero. - * - * The end result of the test should be that items that get added are properly - * cleared without affecting lower items. - * - * @since 2020/10/18 - */ -public class TestListItemReset - extends BaseList -{ - /** - * {@inheritDoc} - * @since 2020/10/18 - */ - @Override - public void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form, UIItemBracket __list) - { - ListItem zeroItem = new ListItem(); - - // Newly added items are always zero! - __backend.widgetProperty(__list, UIWidgetProperty.INT_NUM_ELEMENTS, - 0, 1); - ListItem first = ListItem.of(__backend, __list, 0); - - this.secondary("first-zero", zeroItem.equals(first)); - - // If we modify the first item, we should be able to read everything - // back just fine and it should be the same! - first._idCode = 0x1234_5678; - first._iconDimension = 16; - first._selected = false; - first._disabled = true; - first._font = FontUtilities.fontToSystemFont(Font.getDefaultFont()); - first._label = "Cute Squirrel!"; - - first.into(__backend, __list, 0); - ListItem storedFirst = ListItem.of(__backend, __list, 0); - - this.secondary("first-set", first.equals(storedFirst)); - - // Adding one more entry to the list should make the first entry keep - // the same information - __backend.widgetProperty(__list, UIWidgetProperty.INT_NUM_ELEMENTS, - 0, 2); - ListItem firstPrime = ListItem.of(__backend, __list, 0); - - this.secondary("first-prime", first.equals(firstPrime)); - - // The second item should be blank! - ListItem second = ListItem.of(__backend, __list, 1); - - this.secondary("second-zero", zeroItem.equals(second)); - - // Modifying the second item should keep the first the same but have - // the second be as stored - second._idCode = 0x1834_5678; - second._iconDimension = 32; - second._selected = true; - second._disabled = false; - second._font = FontUtilities.fontToSystemFont(Font.getFont( - Font.FACE_MONOSPACE, Font.STYLE_PLAIN, Font.SIZE_LARGE)); - second._label = "Cute Squeak!"; - - second.into(__backend, __list, 1); - ListItem storedSecond = ListItem.of(__backend, __list, 1); - ListItem firstly = ListItem.of(__backend, __list, 0); - - this.secondary("firstly", first.equals(firstly)); - this.secondary("second-set", second.equals(storedSecond)); - - // Shrinking the list, the first item should be safe - __backend.widgetProperty(__list, UIWidgetProperty.INT_NUM_ELEMENTS, - 0, 1); - ListItem firstlyAgain = ListItem.of(__backend, __list, 0); - - this.secondary("firstly-again", first.equals(firstlyAgain)); - - // Adding the second item slot back should have erased the old one to - // zero - __backend.widgetProperty(__list, UIWidgetProperty.INT_NUM_ELEMENTS, - 0, 2); - ListItem secondZero = ListItem.of(__backend, __list, 1); - - this.secondary("second-last-zero", zeroItem.equals(secondZero)); - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/lists/TestListSize.java b/modules/midp-lcdui/src/test/java/mleui/lists/TestListSize.java deleted file mode 100644 index 47efe65ea8..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/lists/TestListSize.java +++ /dev/null @@ -1,59 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -package mleui.lists; - -import cc.squirreljme.jvm.mle.brackets.UIDisplayBracket; -import cc.squirreljme.jvm.mle.brackets.UIFormBracket; -import cc.squirreljme.jvm.mle.brackets.UIItemBracket; -import cc.squirreljme.jvm.mle.constants.UIWidgetProperty; -import cc.squirreljme.runtime.lcdui.mle.UIBackend; - -/** - * Tests setting of the list size. - * - * @since 2020/10/18 - */ -public class TestListSize - extends BaseList -{ - /** The size to use. */ - public static final byte SIZE = - 6; - - /** - * {@inheritDoc} - * @since 2020/10/18 - */ - @Override - public void test(UIBackend __backend, UIDisplayBracket __display, - UIFormBracket __form, UIItemBracket __list) - { - this.secondary("start-size", __backend.widgetPropertyInt(__list, - UIWidgetProperty.INT_NUM_ELEMENTS, 0)); - - // Resize the list - __backend.widgetProperty(__list, UIWidgetProperty.INT_NUM_ELEMENTS, - 0, TestListSize.SIZE); - this.secondary("first-size", __backend.widgetPropertyInt(__list, - UIWidgetProperty.INT_NUM_ELEMENTS, 0)); - - // Empty the list - __backend.widgetProperty(__list, UIWidgetProperty.INT_NUM_ELEMENTS, - 0, 0); - this.secondary("empty-size", __backend.widgetPropertyInt(__list, - UIWidgetProperty.INT_NUM_ELEMENTS, 0)); - - // Add elements back - __backend.widgetProperty(__list, UIWidgetProperty.INT_NUM_ELEMENTS, - 0, TestListSize.SIZE); - this.secondary("last-size", __backend.widgetPropertyInt(__list, - UIWidgetProperty.INT_NUM_ELEMENTS, 0)); - } -} diff --git a/modules/midp-lcdui/src/test/java/mleui/lists/package-info.java b/modules/midp-lcdui/src/test/java/mleui/lists/package-info.java deleted file mode 100644 index 68467108ec..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/lists/package-info.java +++ /dev/null @@ -1,16 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -/** - * Tests for the MLE UI lists. - * - * @since 2020/10/18 - */ - -package mleui.lists; diff --git a/modules/midp-lcdui/src/test/java/mleui/package-info.java b/modules/midp-lcdui/src/test/java/mleui/package-info.java deleted file mode 100644 index 5bdcc405de..0000000000 --- a/modules/midp-lcdui/src/test/java/mleui/package-info.java +++ /dev/null @@ -1,18 +0,0 @@ -// -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*- -// --------------------------------------------------------------------------- -// SquirrelJME -// Copyright (C) Stephanie Gawroriski -// --------------------------------------------------------------------------- -// SquirrelJME is under the Mozilla Public License Version 2.0. -// See license.mkd for licensing and copyright information. -// --------------------------------------------------------------------------- - -/** - * Tests for the various user interface backends to ensure that they are - * working properly. This includes consistency between native and - * framebuffer/headless setups. - * - * @since 2020/10/09 - */ - -package mleui; diff --git a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasFullScreen.in b/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasFullScreen.in deleted file mode 100644 index 6b1faf8945..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasFullScreen.in +++ /dev/null @@ -1,7 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -skip-on-timeout: true -secondary-width: true -secondary-height: true -secondary-wdisp: true -secondary-hdisp: true diff --git a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasKeyTyping.in b/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasKeyTyping.in deleted file mode 100644 index bbf32bf38e..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasKeyTyping.in +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-sequence: string:p88d88r88p101d101r101p114d114r114p-18d-18r-18 diff --git a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasRepaint.in b/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasRepaint.in deleted file mode 100644 index c286f7da32..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasRepaint.in +++ /dev/null @@ -1,3 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-repainted: true diff --git a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasSize.in b/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasSize.in deleted file mode 100644 index 6b1cc616d0..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasSize.in +++ /dev/null @@ -1,4 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-width: true -secondary-height: true diff --git a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasStandardKeyCodes.in b/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasStandardKeyCodes.in deleted file mode 100644 index 982ab8a732..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasStandardKeyCodes.in +++ /dev/null @@ -1,3 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-mask: long:8038 diff --git a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasValidActions.in b/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasValidActions.in deleted file mode 100644 index bddac08eeb..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/canvas/TestCanvasValidActions.in +++ /dev/null @@ -1,3 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-mask: int:8038 diff --git a/modules/midp-lcdui/src/test/resources/lcdui/display/TestCallSerially.in b/modules/midp-lcdui/src/test/resources/lcdui/display/TestCallSerially.in deleted file mode 100644 index 8b097ca83c..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/display/TestCallSerially.in +++ /dev/null @@ -1,3 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-flagged: true diff --git a/modules/midp-lcdui/src/test/resources/lcdui/display/TestSetRemoveCurrentDisplay.in b/modules/midp-lcdui/src/test/resources/lcdui/display/TestSetRemoveCurrentDisplay.in deleted file mode 100644 index bb388eebea..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/display/TestSetRemoveCurrentDisplay.in +++ /dev/null @@ -1,5 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-not--form: true -secondary-after--set: true -secondary-is--null: true \ No newline at end of file diff --git a/modules/midp-lcdui/src/test/resources/lcdui/list/BaseList.in b/modules/midp-lcdui/src/test/resources/lcdui/list/BaseList.in deleted file mode 100644 index a2adc33411..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/list/BaseList.in +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 -multi-parameters: EXCLUSIVE IMPLICIT MULTIPLE diff --git a/modules/midp-lcdui/src/test/resources/lcdui/list/TestItemAddRemove.in b/modules/midp-lcdui/src/test/resources/lcdui/list/TestItemAddRemove.in deleted file mode 100644 index 8c85d16336..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/list/TestItemAddRemove.in +++ /dev/null @@ -1,10 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-append--size: int:1 -secondary-insert--size: int:2 -secondary-insert--a: true -secondary-insert--nota: false -secondary-delete--size: int:1 -secondary-delete--a: true -secondary-clear--size: int:0 diff --git a/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelectionCommands.in b/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelectionCommands.in deleted file mode 100644 index d88955c9fe..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelectionCommands.in +++ /dev/null @@ -1,9 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-selected--0: true -secondary-last--0: true -secondary-selected--1: true -secondary-last--1: true -secondary-selected--2: true -secondary-last--2: true \ No newline at end of file diff --git a/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@EXCLUSIVE.in b/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@EXCLUSIVE.in deleted file mode 100644 index 640a0dc0d5..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@EXCLUSIVE.in +++ /dev/null @@ -1,12 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-start: boolean[3]:Tff -secondary-seqset--0: boolean[3]:Tff -secondary-seqset--1: boolean[3]:fTf -secondary-seqset--2: boolean[3]:ffT -secondary-seqclear--0: boolean[3]:ffT -secondary-seqclear--1: boolean[3]:ffT -secondary-seqclear--2: boolean[3]:Tff -secondary-evenodd: boolean[3]:Tff -secondary-none: boolean[3]:Tff diff --git a/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@IMPLICIT.in b/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@IMPLICIT.in deleted file mode 100644 index 640a0dc0d5..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@IMPLICIT.in +++ /dev/null @@ -1,12 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-start: boolean[3]:Tff -secondary-seqset--0: boolean[3]:Tff -secondary-seqset--1: boolean[3]:fTf -secondary-seqset--2: boolean[3]:ffT -secondary-seqclear--0: boolean[3]:ffT -secondary-seqclear--1: boolean[3]:ffT -secondary-seqclear--2: boolean[3]:Tff -secondary-evenodd: boolean[3]:Tff -secondary-none: boolean[3]:Tff diff --git a/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@MULTIPLE.in b/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@MULTIPLE.in deleted file mode 100644 index bd43768a15..0000000000 --- a/modules/midp-lcdui/src/test/resources/lcdui/list/TestSelections@MULTIPLE.in +++ /dev/null @@ -1,12 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-start: boolean[3]:fff -secondary-seqset--0: boolean[3]:Tff -secondary-seqset--1: boolean[3]:TTf -secondary-seqset--2: boolean[3]:TTT -secondary-seqclear--0: boolean[3]:fTT -secondary-seqclear--1: boolean[3]:ffT -secondary-seqclear--2: boolean[3]:fff -secondary-evenodd: boolean[3]:TfT -secondary-none: boolean[3]:fff diff --git a/modules/midp-lcdui/src/test/resources/mleui/BaseBackend.in b/modules/midp-lcdui/src/test/resources/mleui/BaseBackend.in deleted file mode 100644 index b02f18523e..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/BaseBackend.in +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -multi-parameters: NATIVE -disabled-multi-parameters: FRAMEBUFFER diff --git a/modules/midp-lcdui/src/test/resources/mleui/TestDisplayMetrics.in b/modules/midp-lcdui/src/test/resources/mleui/TestDisplayMetrics.in deleted file mode 100644 index 0a0d1d0980..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/TestDisplayMetrics.in +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-good--lower: true -secondary-good--upper: true -secondary-okay: int:13 -secondary-total: int:13 -secondary-forms--supported: true -secondary-positive--max--width: true -secondary-positive--max--height: true -secondary-positive--current--width: true -secondary-positive--current--height: true -secondary-positive--list--height: true -secondary-positive--command--height: true -secondary-mono: true -secondary-pf: true -secondary-pf--mono--okay: true -secondary-inputs: int:0 -secondary-vibrate: true -secondary-backlight: true diff --git a/modules/midp-lcdui/src/test/resources/mleui/TestDisplayNoForm.in b/modules/midp-lcdui/src/test/resources/mleui/TestDisplayNoForm.in deleted file mode 100644 index fc8cd849ff..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/TestDisplayNoForm.in +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestAllSpecial.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestAllSpecial.in deleted file mode 100644 index b5291f4880..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestAllSpecial.in +++ /dev/null @@ -1,2 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestCreateItems.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestCreateItems.in deleted file mode 100644 index 5f8ba111b7..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestCreateItems.in +++ /dev/null @@ -1,16 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-did--0: true -secondary-did--1: true -secondary-did--2: true -secondary-did--3: true -secondary-did--4: true -secondary-did--5: true -secondary-did--6: true -secondary-did--7: true -secondary-did--8: true -secondary-did--9: true -secondary-did--10: true -secondary-did--11: true -secondary-did--12: true -secondary-did--13: true diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestDeleteVisibleItem.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestDeleteVisibleItem.in deleted file mode 100644 index 744ac18ce6..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestDeleteVisibleItem.in +++ /dev/null @@ -1,2 +0,0 @@ -result: ExceptionThrown -thrown: throwable:mleui.forms.FormTestException diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestFormItemCounts.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestFormItemCounts.in deleted file mode 100644 index 24d3f5fe9e..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestFormItemCounts.in +++ /dev/null @@ -1,55 +0,0 @@ -MANIFEST-VERSION: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-afteradd--0: int:1 -secondary-afteradd--1: int:2 -secondary-afteradd--10: int:11 -secondary-afteradd--11: int:12 -secondary-afteradd--12: int:13 -secondary-afteradd--13: int:14 -secondary-afteradd--14: int:15 -secondary-afteradd--15: int:16 -secondary-afteradd--2: int:3 -secondary-afteradd--3: int:4 -secondary-afteradd--4: int:5 -secondary-afteradd--5: int:6 -secondary-afteradd--6: int:7 -secondary-afteradd--7: int:8 -secondary-afteradd--8: int:9 -secondary-afteradd--9: int:10 -secondary-afteradds: int:16 -secondary-afterall: int:0 -secondary-beforeall: int:0 -secondary-leftcmd: int:0 -secondary-remove--0: int:0 -secondary-remove--1: int:1 -secondary-remove--10: int:10 -secondary-remove--11: int:11 -secondary-remove--12: int:12 -secondary-remove--13: int:13 -secondary-remove--14: int:14 -secondary-remove--15: int:15 -secondary-remove--2: int:2 -secondary-remove--3: int:3 -secondary-remove--4: int:4 -secondary-remove--5: int:5 -secondary-remove--6: int:6 -secondary-remove--7: int:7 -secondary-remove--8: int:8 -secondary-remove--9: int:9 -secondary-removed--same--0: true -secondary-removed--same--1: true -secondary-removed--same--10: true -secondary-removed--same--11: true -secondary-removed--same--12: true -secondary-removed--same--13: true -secondary-removed--same--14: true -secondary-removed--same--15: true -secondary-removed--same--2: true -secondary-removed--same--3: true -secondary-removed--same--4: true -secondary-removed--same--5: true -secondary-removed--same--6: true -secondary-removed--same--7: true -secondary-removed--same--8: true -secondary-removed--same--9: true \ No newline at end of file diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestFormProperties.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestFormProperties.in deleted file mode 100644 index 3466eb549a..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestFormProperties.in +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-total: int:21 -secondary-neg--fails: true -secondary-null--fails: true -secondary-pos--fails: true -secondary-no--label: true -secondary-no--repaint: true -secondary-positive--width: true -secondary-positive--height: true -secondary-has--x: true -secondary-has--y: true -secondary-has--shown: true -secondary-no--wah: true -secondary-no--list--enabled: true -secondary-no--list--paint: true -secondary-no--list--selected: true -secondary-no--list--type: true -secondary-no--num--elements: true -secondary-no--list--label: true -secondary-no--list--idcode: true -secondary-no--list--font: true -secondary-no--selection--lock: true -secondary-is--form: true -secondary-has--form--title: true -secondary-no--signal--focus: true diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestItemDragging.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestItemDragging.in deleted file mode 100644 index d7d6021195..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestItemDragging.in +++ /dev/null @@ -1,31 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-now--isthis----1: true -secondary-now--isthis----2: true -secondary-now--isthis----3: true -secondary-now--isthis----4: true -secondary-now--isthis----5: true -secondary-now--isthis----6: true -secondary-now--isthis--0: true -secondary-now--pos----1: int:-6 -secondary-now--pos----2: int:-6 -secondary-now--pos----3: int:-6 -secondary-now--pos----4: int:-6 -secondary-now--pos----5: int:-6 -secondary-now--pos----6: int:-6 -secondary-now--pos--0: int:-6 -secondary-old--isnull----1: false -secondary-old--isnull----2: false -secondary-old--isnull----3: false -secondary-old--isnull----4: false -secondary-old--isnull----5: false -secondary-old--isnull--0: false -secondary-then--pos----1: int:-6 -secondary-then--pos----2: int:-6 -secondary-then--pos----3: int:-6 -secondary-then--pos----4: int:-6 -secondary-then--pos----5: int:-6 -secondary-then--pos----6: int:-2147483648 -secondary-then--pos--0: int:-6 -secondary-zero--isthis: true -secondary-zero--pos: int:-6 diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestItemFormOwner.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestItemFormOwner.in deleted file mode 100644 index 029f0e89f0..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestItemFormOwner.in +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-first--null: true -secondary-set--matches: true -secondary-replace--null: true diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestItemRemoveShift.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestItemRemoveShift.in deleted file mode 100644 index 54a129b20b..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestItemRemoveShift.in +++ /dev/null @@ -1,45 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-empty: int:0 -secondary-same--0: true -secondary-same--1: true -secondary-same--10: true -secondary-same--11: true -secondary-same--12: true -secondary-same--13: true -secondary-same--2: true -secondary-same--3: true -secondary-same--4: true -secondary-same--5: true -secondary-same--6: true -secondary-same--7: true -secondary-same--8: true -secondary-same--9: true -secondary-sameitems--0: boolean[13]:TTTTTTTTTTTTT -secondary-sameitems--1: boolean[12]:TTTTTTTTTTTT -secondary-sameitems--10: boolean[3]:TTT -secondary-sameitems--11: boolean[2]:TT -secondary-sameitems--12: boolean[1]:T -secondary-sameitems--13: boolean[0]: -secondary-sameitems--2: boolean[11]:TTTTTTTTTTT -secondary-sameitems--3: boolean[10]:TTTTTTTTTT -secondary-sameitems--4: boolean[9]:TTTTTTTTT -secondary-sameitems--5: boolean[8]:TTTTTTTT -secondary-sameitems--6: boolean[7]:TTTTTTT -secondary-sameitems--7: boolean[6]:TTTTTT -secondary-sameitems--8: boolean[5]:TTTTT -secondary-sameitems--9: boolean[4]:TTTT -secondary-subcount--0: true -secondary-subcount--1: true -secondary-subcount--10: true -secondary-subcount--11: true -secondary-subcount--12: true -secondary-subcount--13: true -secondary-subcount--2: true -secondary-subcount--3: true -secondary-subcount--4: true -secondary-subcount--5: true -secondary-subcount--6: true -secondary-subcount--7: true -secondary-subcount--8: true -secondary-subcount--9: true \ No newline at end of file diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestShowBlankDisplay.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestShowBlankDisplay.in deleted file mode 100644 index b5291f4880..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestShowBlankDisplay.in +++ /dev/null @@ -1,2 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestShowItems.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestShowItems.in deleted file mode 100644 index 8d82f0c0ab..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestShowItems.in +++ /dev/null @@ -1,16 +0,0 @@ -result: NoResult -thrown: NoExceptionThrown -secondary-pos--0: int:0 -secondary-pos--1: int:0 -secondary-pos--2: int:0 -secondary-pos--3: int:0 -secondary-pos--4: int:0 -secondary-pos--5: int:0 -secondary-pos--6: int:0 -secondary-pos--7: int:0 -secondary-pos--8: int:0 -secondary-pos--9: int:0 -secondary-pos--10: int:0 -secondary-pos--11: int:0 -secondary-pos--12: int:0 -secondary-pos--13: int:0 diff --git a/modules/midp-lcdui/src/test/resources/mleui/forms/TestUseItemAfterDelete.in b/modules/midp-lcdui/src/test/resources/mleui/forms/TestUseItemAfterDelete.in deleted file mode 100644 index 744ac18ce6..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/forms/TestUseItemAfterDelete.in +++ /dev/null @@ -1,2 +0,0 @@ -result: ExceptionThrown -thrown: throwable:mleui.forms.FormTestException diff --git a/modules/midp-lcdui/src/test/resources/mleui/invalid/TestUIFormShelfInvalid.in b/modules/midp-lcdui/src/test/resources/mleui/invalid/TestUIFormShelfInvalid.in deleted file mode 100644 index 519aca092a..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/invalid/TestUIFormShelfInvalid.in +++ /dev/null @@ -1,6 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -only-in: override-because-we-use-formshelf-on-javase -secondary-calls: int:22 -secondary-errors: int:22 diff --git a/modules/midp-lcdui/src/test/resources/mleui/lists/TestInvalidListProperties.in b/modules/midp-lcdui/src/test/resources/mleui/lists/TestInvalidListProperties.in deleted file mode 100644 index 402f12c424..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/lists/TestInvalidListProperties.in +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-neg--size: true diff --git a/modules/midp-lcdui/src/test/resources/mleui/lists/TestListIconImage.in b/modules/midp-lcdui/src/test/resources/mleui/lists/TestListIconImage.in deleted file mode 100644 index 04534f0125..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/lists/TestListIconImage.in +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-painted: int:127 \ No newline at end of file diff --git a/modules/midp-lcdui/src/test/resources/mleui/lists/TestListItemReset.in b/modules/midp-lcdui/src/test/resources/mleui/lists/TestListItemReset.in deleted file mode 100644 index 3e464a902a..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/lists/TestListItemReset.in +++ /dev/null @@ -1,11 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-first--zero: true -secondary-first--set: true -secondary-first--prime: true -secondary-second--zero: true -secondary-firstly: true -secondary-second--set: true -secondary-firstly--again: true -secondary-second--last--zero: true diff --git a/modules/midp-lcdui/src/test/resources/mleui/lists/TestListSize.in b/modules/midp-lcdui/src/test/resources/mleui/lists/TestListSize.in deleted file mode 100644 index 51ac32f928..0000000000 --- a/modules/midp-lcdui/src/test/resources/mleui/lists/TestListSize.in +++ /dev/null @@ -1,7 +0,0 @@ -Manifest-Version: 1.0 -result: NoResult -thrown: NoExceptionThrown -secondary-start--size: int:0 -secondary-first--size: int:6 -secondary-empty--size: int:0 -secondary-last--size: int:6 \ No newline at end of file diff --git a/modules/scritch-ui/src/main/java/cc/squirreljme/jvm/mle/scritchui/ScritchMenuInterface.java b/modules/scritch-ui/src/main/java/cc/squirreljme/jvm/mle/scritchui/ScritchMenuInterface.java index 460eca9ace..39cc82a29e 100644 --- a/modules/scritch-ui/src/main/java/cc/squirreljme/jvm/mle/scritchui/ScritchMenuInterface.java +++ b/modules/scritch-ui/src/main/java/cc/squirreljme/jvm/mle/scritchui/ScritchMenuInterface.java @@ -9,7 +9,7 @@ package cc.squirreljme.jvm.mle.scritchui; -import cc.squirreljme.jvm.mle.constants.UIKeyEventType; +import cc.squirreljme.jvm.mle.constants.NonStandardKey; import cc.squirreljme.jvm.mle.constants.UIKeyModifier; import cc.squirreljme.jvm.mle.exceptions.MLECallError; import cc.squirreljme.jvm.mle.scritchui.brackets.ScritchMenuBarBracket; @@ -82,7 +82,7 @@ public interface ScritchMenuInterface */ @SquirrelJMEVendorApi void menuItemSetKey(@NotNull ScritchMenuItemBracket __item, - @MagicConstant(valuesFromClass = UIKeyEventType.class) + @MagicConstant(valuesFromClass = NonStandardKey.class) @Range(from = 0, to = 65536) int __key, @MagicConstant(flagsFromClass = UIKeyModifier.class) int __modifier) -- 2.11.4.GIT