summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-03-01 13:34:34 -0500
committerCharles Lombardo <clombardo169@gmail.com>2023-03-01 13:34:34 -0500
commit9e090c6bab25c5f0765a08bfdb92d9f1df790de4 (patch)
tree23c9cb91dcb655fff4645bd252be618035f3bc11 /Source/Android/app/src/main/java
parent5f6995fe6c840634227afd5e294fc0ecb743b4e6 (diff)
Android: Convert GraphicsMod to Kotlin
Diffstat (limited to 'Source/Android/app/src/main/java')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.java61
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.kt32
2 files changed, 32 insertions, 61 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.java
deleted file mode 100644
index 241d15093f..0000000000
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.java
+++ /dev/null
@@ -1,61 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-package org.dolphinemu.dolphinemu.features.cheats.model;
-
-import androidx.annotation.Keep;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-
-public class GraphicsMod extends ReadOnlyCheat
-{
- @Keep
- private final long mPointer;
-
- // When a C++ GraphicsModGroup object is destroyed, it also destroys the GraphicsMods it owns.
- // To avoid getting dangling pointers, we keep a reference to the GraphicsModGroup here.
- @Keep
- private final GraphicsModGroup mParent;
-
- @Keep
- private GraphicsMod(long pointer, GraphicsModGroup parent)
- {
- mPointer = pointer;
- mParent = parent;
- }
-
- public boolean supportsCreator()
- {
- return true;
- }
-
- public boolean supportsNotes()
- {
- return true;
- }
-
- public boolean supportsCode()
- {
- return false;
- }
-
- @NonNull
- public native String getName();
-
- @NonNull
- public native String getCreator();
-
- @NonNull
- public native String getNotes();
-
- public boolean getUserDefined()
- {
- // Technically graphics mods can be user defined, but we don't support editing graphics mods
- // in the GUI, and editability is what this really controls
- return false;
- }
-
- public native boolean getEnabled();
-
- @Override
- protected native void setEnabledImpl(boolean enabled);
-}
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.kt
new file mode 100644
index 0000000000..3ea8c23e43
--- /dev/null
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/GraphicsMod.kt
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+package org.dolphinemu.dolphinemu.features.cheats.model
+
+import androidx.annotation.Keep
+
+class GraphicsMod @Keep private constructor(
+ @Keep private val pointer: Long,
+ // When a C++ GraphicsModGroup object is destroyed, it also destroys the GraphicsMods it owns.
+ // To avoid getting dangling pointers, we keep a reference to the GraphicsModGroup here.
+ @Keep private val parent: GraphicsModGroup
+) : ReadOnlyCheat() {
+ override fun supportsCreator(): Boolean = true
+
+ override fun supportsNotes(): Boolean = true
+
+ override fun supportsCode(): Boolean = false
+
+ external override fun getName(): String
+
+ external override fun getCreator(): String
+
+ external override fun getNotes(): String
+
+ // Technically graphics mods can be user defined, but we don't support editing graphics mods
+ // in the GUI, and editability is what this really controls
+ override fun getUserDefined(): Boolean = false
+
+ external override fun getEnabled(): Boolean
+
+ external override fun setEnabledImpl(enabled: Boolean)
+}