diff --git a/desktopApp/build.gradle.kts b/desktopApp/build.gradle.kts new file mode 100644 index 00000000..ddcaf47f --- /dev/null +++ b/desktopApp/build.gradle.kts @@ -0,0 +1,43 @@ +import org.jetbrains.compose.desktop.application.dsl.TargetFormat + +plugins { + alias(libs.plugins.kotlin.multiplatform) + alias(libs.plugins.compose.compiler) + alias(libs.plugins.compose.multiplatform) +} + +kotlin { + jvm() + sourceSets { + jvmMain.dependencies { + implementation(compose.desktop.currentOs) + implementation(project(":shared")) + } + } +} + +compose.desktop { + application { + mainClass = "com.kgurgul.cpuinfo.MainKt" + + nativeDistributions { + targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) + packageName = "CPUInfo" + packageVersion = "1.0.0" + + /* val iconsRoot = project.file("desktop-icons") + macOS { + iconFile.set(iconsRoot.resolve("icon-mac.icns")) + } + windows { + iconFile.set(iconsRoot.resolve("icon-windows.ico")) + menuGroup = "Compose Examples" + // see https://wixtoolset.org/documentation/manual/v3/howtos/general/generate_guids.html + upgradeUuid = "18159995-d967-4CD2-8885-77BFA97CFA9F" + } + linux { + iconFile.set(iconsRoot.resolve("icon-linux.png")) + }*/ + } + } +} \ No newline at end of file diff --git a/desktopApp/src/jvmMain/kotlin/com/kgurgul/cpuinfo/main.kt b/desktopApp/src/jvmMain/kotlin/com/kgurgul/cpuinfo/main.kt new file mode 100644 index 00000000..5972f484 --- /dev/null +++ b/desktopApp/src/jvmMain/kotlin/com/kgurgul/cpuinfo/main.kt @@ -0,0 +1,17 @@ +package com.kgurgul.cpuinfo + +import androidx.compose.ui.window.Window +import androidx.compose.ui.window.application +import com.kgurgul.cpuinfo.di.initKoin + +fun main() { + initKoin() + return application { + Window( + onCloseRequest = ::exitApplication, + title = "CPU Info", + ) { + DesktopApp() + } + } +} diff --git a/gradle.properties b/gradle.properties index 9ed78164..4e34d0eb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,4 +10,5 @@ android.nonTransitiveRClass=true android.useAndroidX=true #Kotlin Multiplatform kotlin.native.ignoreDisabledTargets=true -kotlin.mpp.enableCInteropCommonization=true \ No newline at end of file +kotlin.mpp.androidGradlePluginCompatibility.nowarn=true +kotlin.mpp.enableCInteropCommonization=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3f153ac3..cf249d51 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -61,6 +61,7 @@ koin-compose-viewodel = { module = "io.insert-koin:koin-compose-viewmodel", vers koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } koin-kspCompiler = { module = "io.insert-koin:koin-ksp-compiler", version.ref = "koinAnnotations" } kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" } +kotlinx-coroutines-swing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-swing", version.ref = "kotlinxCoroutines" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" } kotlinx-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "kotlinxImmutable" } material3-windowSize = { module = "dev.chrisbanes.material3:material3-window-size-class-multiplatform", version.ref = "windowSize" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 7c3cc511..728f1f91 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,5 +17,6 @@ dependencyResolutionManagement { } include(":androidApp") -include(":shared") include(":androidApp:baselineprofile") +include(":desktopApp") +include(":shared") diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 09bc366a..c55bf297 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -53,6 +53,8 @@ kotlin { } } + jvm("desktop") + applyDefaultHierarchyTemplate() sourceSets { @@ -98,6 +100,12 @@ kotlin { implementation(libs.koin.android) } + val desktopMain by getting + desktopMain.dependencies { + implementation(compose.desktop.currentOs) + implementation(libs.kotlinx.coroutines.swing) + } + commonTest.dependencies { implementation(kotlin("test")) implementation(kotlin("test-common")) diff --git a/shared/src/commonMain/kotlin/com/kgurgul/cpuinfo/features/HostScreen.kt b/shared/src/commonMain/kotlin/com/kgurgul/cpuinfo/features/HostScreen.kt index 6f9e0a9e..0fd20abf 100644 --- a/shared/src/commonMain/kotlin/com/kgurgul/cpuinfo/features/HostScreen.kt +++ b/shared/src/commonMain/kotlin/com/kgurgul/cpuinfo/features/HostScreen.kt @@ -85,8 +85,10 @@ fun HostScreen( ?.any { it.route == item.route } == true, onClick = { navController.navigate(item.route) { - popUpTo(navController.graph.findStartDestination().id) { - saveState = true + navController.graph.findStartDestination().route?.let { + popUpTo(it) { + saveState = true + } } launchSingleTop = true restoreState = true diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/DesktopApp.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/DesktopApp.kt new file mode 100644 index 00000000..c09950af --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/DesktopApp.kt @@ -0,0 +1,23 @@ +package com.kgurgul.cpuinfo + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.kgurgul.cpuinfo.features.HostScreen +import com.kgurgul.cpuinfo.features.HostViewModel +import com.kgurgul.cpuinfo.ui.shouldUseDarkTheme +import com.kgurgul.cpuinfo.ui.theme.CpuInfoTheme +import org.koin.compose.viewmodel.koinViewModel + +@Composable +fun DesktopApp( + hostViewModel: HostViewModel = koinViewModel() +) { + val uiState by hostViewModel.uiStateFlow.collectAsStateWithLifecycle() + val darkTheme = shouldUseDarkTheme(uiState) + CpuInfoTheme( + useDarkTheme = darkTheme + ) { + HostScreen(hostViewModel) + } +} diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/components/RamCleanupComponent.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/components/RamCleanupComponent.kt new file mode 100644 index 00000000..c68ba5df --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/components/RamCleanupComponent.kt @@ -0,0 +1,17 @@ +package com.kgurgul.cpuinfo.components + +import org.koin.core.annotation.Factory + +@Factory +actual class RamCleanupComponent actual constructor() { + + actual fun cleanup() { + System.runFinalization() + Runtime.getRuntime().gc() + System.gc() + } + + actual fun isCleanupActionAvailable(): Boolean { + return false + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/ApplicationsDataProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/ApplicationsDataProvider.kt new file mode 100644 index 00000000..e096bffe --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/ApplicationsDataProvider.kt @@ -0,0 +1,16 @@ +package com.kgurgul.cpuinfo.data.provider + +import com.kgurgul.cpuinfo.domain.model.ExtendedApplicationData +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class ApplicationsDataProvider actual constructor() : KoinComponent { + + actual fun getInstalledApplications(withSystemApps: Boolean): List { + return emptyList() + } + + actual fun areApplicationsSupported() = false + +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/CpuDataNativeProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/CpuDataNativeProvider.kt new file mode 100644 index 00000000..e424b865 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/CpuDataNativeProvider.kt @@ -0,0 +1,43 @@ +package com.kgurgul.cpuinfo.data.provider + +import org.koin.core.annotation.Single + +@Single(createdAtStart = true) +actual class CpuDataNativeProvider actual constructor() { + + actual fun initLibrary() { + + } + + actual fun getCpuName(): String { + return "Desktop CPU" + } + + actual fun hasArmNeon(): Boolean { + return false + } + + actual fun getL1dCaches(): IntArray? { + return null + } + + actual fun getL1iCaches(): IntArray? { + return null + } + + actual fun getL2Caches(): IntArray? { + return null + } + + actual fun getL3Caches(): IntArray? { + return null + } + + actual fun getL4Caches(): IntArray? { + return null + } + + actual fun getNumberOfCores(): Int { + return 0 + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/CpuDataProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/CpuDataProvider.kt new file mode 100644 index 00000000..3349ab52 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/CpuDataProvider.kt @@ -0,0 +1,23 @@ +package com.kgurgul.cpuinfo.data.provider + +import org.koin.core.annotation.Factory + +@Factory +actual class CpuDataProvider actual constructor() { + + actual fun getAbi(): String { + return "" + } + + actual fun getNumberOfCores(): Int { + return -1 + } + + actual fun getCurrentFreq(coreNumber: Int): Long { + return -1 + } + + actual fun getMinMaxFreq(coreNumber: Int): Pair { + return Pair(-1, -1) + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/GpuDataProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/GpuDataProvider.kt new file mode 100644 index 00000000..966b87ef --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/GpuDataProvider.kt @@ -0,0 +1,18 @@ +package com.kgurgul.cpuinfo.data.provider + +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class GpuDataProvider actual constructor() : KoinComponent { + + actual fun getGlEsVersion(): String { + return "" + } + + actual fun getVulkanVersion(): String { + return "" + } + + actual fun getMetalVersion() = "" +} diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/HardwareDataProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/HardwareDataProvider.kt new file mode 100644 index 00000000..e6d287f4 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/HardwareDataProvider.kt @@ -0,0 +1,28 @@ +/* + * Copyright 2017 KG Soft + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.kgurgul.cpuinfo.data.provider + +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class HardwareDataProvider actual constructor() : KoinComponent { + + actual suspend fun getData(): List> { + return emptyList() + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/OsDataProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/OsDataProvider.kt new file mode 100644 index 00000000..9832fbf9 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/OsDataProvider.kt @@ -0,0 +1,12 @@ +package com.kgurgul.cpuinfo.data.provider + +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class OsDataProvider actual constructor() : KoinComponent { + + actual suspend fun getData(): List> { + return emptyList() + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/PackageNameProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/PackageNameProvider.kt new file mode 100644 index 00000000..0ef8db34 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/PackageNameProvider.kt @@ -0,0 +1,12 @@ +package com.kgurgul.cpuinfo.data.provider + +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class PackageNameProvider actual constructor() : KoinComponent { + + actual suspend fun getPackageName(): String { + return "com.kgurgul.cpuinfo" + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/ProcessesProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/ProcessesProvider.kt new file mode 100644 index 00000000..aa312279 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/ProcessesProvider.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2017 KG Soft + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.kgurgul.cpuinfo.data.provider + +import com.kgurgul.cpuinfo.domain.model.ProcessItem +import org.koin.core.annotation.Factory + +@Factory +actual class ProcessesProvider actual constructor() { + + actual fun areProcessesSupported() = false + + actual fun getProcessList(): List { + return emptyList() + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/RamDataProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/RamDataProvider.kt new file mode 100644 index 00000000..a9502f21 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/RamDataProvider.kt @@ -0,0 +1,20 @@ +package com.kgurgul.cpuinfo.data.provider + +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class RamDataProvider actual constructor() : KoinComponent { + + actual fun getTotalBytes(): Long { + return -1L + } + + actual fun getAvailableBytes(): Long { + return -1L + } + + actual fun getThreshold(): Long { + return -1L + } +} diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/ScreenDataProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/ScreenDataProvider.kt new file mode 100644 index 00000000..4aa8827e --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/ScreenDataProvider.kt @@ -0,0 +1,16 @@ +package com.kgurgul.cpuinfo.data.provider + +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.emptyFlow +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class ScreenDataProvider actual constructor() : KoinComponent { + + actual suspend fun getData(): List> { + return emptyList() + } + + actual fun getOrientationFlow(): Flow = emptyFlow() +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/SensorsInfoProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/SensorsInfoProvider.kt new file mode 100644 index 00000000..3a1c30c6 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/SensorsInfoProvider.kt @@ -0,0 +1,13 @@ +package com.kgurgul.cpuinfo.data.provider + +import com.kgurgul.cpuinfo.domain.model.SensorData +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.emptyFlow +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class SensorsInfoProvider actual constructor() : KoinComponent { + + actual fun getSensorData(): Flow> = emptyFlow() +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/StorageDataProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/StorageDataProvider.kt new file mode 100644 index 00000000..5e8e0c92 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/StorageDataProvider.kt @@ -0,0 +1,12 @@ +package com.kgurgul.cpuinfo.data.provider + +import com.kgurgul.cpuinfo.domain.model.StorageItem +import org.koin.core.annotation.Factory + +@Factory +actual class StorageDataProvider actual constructor() { + + actual fun getStorageInfo(): List { + return emptyList() + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/TemperatureProvider.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/TemperatureProvider.kt new file mode 100644 index 00000000..b0f72134 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/data/provider/TemperatureProvider.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2017 KG Soft + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.kgurgul.cpuinfo.data.provider + +import com.kgurgul.cpuinfo.domain.model.TemperatureItem +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.emptyFlow +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class TemperatureProvider actual constructor() : KoinComponent { + + actual val sensorsFlow: Flow = emptyFlow() + + actual fun getBatteryTemperature(): Float? { + return null + } + + actual fun findCpuTemperatureLocation(): String? { + return null + } + + actual fun getCpuTemp(path: String): Float? { + return null + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/di/DesktopModule.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/di/DesktopModule.kt new file mode 100644 index 00000000..9d1a2f73 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/di/DesktopModule.kt @@ -0,0 +1,13 @@ +package com.kgurgul.cpuinfo.di + +import androidx.datastore.preferences.core.PreferenceDataStoreFactory +import okio.Path.Companion.toPath +import org.koin.dsl.module + +val desktopModule = module { + single { + PreferenceDataStoreFactory.createWithPath( + produceFile = { "$USER_PREFERENCES_NAME.preferences_pb".toPath() } + ) + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/di/Injector.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/di/Injector.kt new file mode 100644 index 00000000..7d1470bc --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/di/Injector.kt @@ -0,0 +1,12 @@ +package com.kgurgul.cpuinfo.di + +import org.koin.core.context.startKoin + +fun initKoin() { + startKoin { + modules( + desktopModule, + sharedModule, + ) + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/domain/action/ExternalAppAction.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/domain/action/ExternalAppAction.kt new file mode 100644 index 00000000..03e6ba55 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/domain/action/ExternalAppAction.kt @@ -0,0 +1,24 @@ +package com.kgurgul.cpuinfo.domain.action + +import org.koin.core.annotation.Factory +import org.koin.core.component.KoinComponent + +@Factory +actual class ExternalAppAction actual constructor() : KoinComponent { + + actual fun launch(packageName: String): Result { + return Result.success(Unit) + } + + actual fun openSettings(packageName: String): Result { + return Result.success(Unit) + } + + actual fun uninstall(packageName: String): Result { + return Result.success(Unit) + } + + actual fun searchOnWeb(phrase: String): Result { + return Result.success(Unit) + } +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/applications/UninstallListener.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/applications/UninstallListener.kt new file mode 100644 index 00000000..f7c5eef5 --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/applications/UninstallListener.kt @@ -0,0 +1,8 @@ +package com.kgurgul.cpuinfo.features.applications + +import androidx.compose.runtime.Composable + +@Composable +actual fun registerUninstallListener(onRefresh: () -> Unit) { + +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/information/gpu/InternalGLSurfaceView.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/information/gpu/InternalGLSurfaceView.kt new file mode 100644 index 00000000..93da3dec --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/information/gpu/InternalGLSurfaceView.kt @@ -0,0 +1,8 @@ +package com.kgurgul.cpuinfo.features.information.gpu + +import androidx.compose.runtime.Composable + +@Composable +actual fun InternalGLSurfaceView(onGlInfoReceived: (String, String, String) -> Unit) { + +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/information/hardware/PowerPlugListener.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/information/hardware/PowerPlugListener.kt new file mode 100644 index 00000000..1191b11a --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/information/hardware/PowerPlugListener.kt @@ -0,0 +1,8 @@ +package com.kgurgul.cpuinfo.features.information.hardware + +import androidx.compose.runtime.Composable + +@Composable +actual fun registerPowerPlugListener(onRefresh: () -> Unit) { + +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/information/storage/StorageDataListener.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/information/storage/StorageDataListener.kt new file mode 100644 index 00000000..8800587d --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/features/information/storage/StorageDataListener.kt @@ -0,0 +1,8 @@ +package com.kgurgul.cpuinfo.features.information.storage + +import androidx.compose.runtime.Composable + +@Composable +actual fun registerStorageMountingListener(onRefresh: () -> Unit) { + +} \ No newline at end of file diff --git a/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/utils/PlatformExtensions.kt b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/utils/PlatformExtensions.kt new file mode 100644 index 00000000..f980e89d --- /dev/null +++ b/shared/src/desktopMain/kotlin/com/kgurgul/cpuinfo/utils/PlatformExtensions.kt @@ -0,0 +1,10 @@ +package com.kgurgul.cpuinfo.utils + +import java.text.Collator + +actual fun smartCompare(a: String, b: String): Int { + val collator = Collator.getInstance().apply { + strength = Collator.SECONDARY + } + return collator.compare(a.lowercase(), b.lowercase()) +} \ No newline at end of file