Skip to content

Commit 5f80465

Browse files
committed
Add more @ExperimentalComposeUiApi where appropriate
1 parent 49bfd6b commit 5f80465

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/v2/DpInsets.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class DpInsets(
7272
/**
7373
* Returns the rectangle remaining after applying the given insets.
7474
*/
75+
@ExperimentalComposeUiApi
7576
fun DpRect.withInsets(insets: DpInsets): DpRect =
7677
DpRect(
7778
top = top + insets.top,

compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/v2/WindowGeometryProviders.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ fun interface WindowScreenProvider {
6767
*/
6868
fun WindowScreenProviderScope.getScreen(): Screen
6969

70+
@ExperimentalComposeUiApi
7071
companion object {
7172
/**
7273
* Returns the default screen for a new window.
@@ -130,6 +131,7 @@ interface WindowBoundsProvider {
130131
*/
131132
fun WindowGeometryProviderScope.getBounds(): DpRect
132133

134+
@ExperimentalComposeUiApi
133135
companion object {
134136
/**
135137
* Returns the default position and size for a new window.
@@ -217,6 +219,7 @@ fun interface WindowPositionProvider {
217219
*/
218220
fun WindowGeometryProviderScope.getPosition(size: DpSize): DpOffset
219221

222+
@ExperimentalComposeUiApi
220223
companion object {
221224
/**
222225
* Returns the default position for a new window.
@@ -258,6 +261,7 @@ fun interface WindowSizeProvider {
258261
*/
259262
fun WindowGeometryProviderScope.getSize(): DpSize
260263

264+
@ExperimentalComposeUiApi
261265
companion object {
262266
/**
263267
* Returns the default size for a new window.

compose/ui/ui/src/desktopMain/kotlin/androidx/compose/ui/window/v2/WindowState.desktop.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import androidx.compose.runtime.saveable.Saver
2424
import androidx.compose.runtime.saveable.listSaver
2525
import androidx.compose.runtime.saveable.rememberSaveable
2626
import androidx.compose.runtime.setValue
27+
import androidx.compose.ui.ExperimentalComposeUiApi
2728
import androidx.compose.ui.awt.toAwtRectangleRounded
2829
import androidx.compose.ui.unit.Dp
2930
import androidx.compose.ui.unit.isSpecified
@@ -75,6 +76,7 @@ fun rememberWindowStateWithBounds(
7576
* @param initialBoundsProvider Provides the initial bounds of the window.
7677
* @param initiallyMinimized Whether the window is initially minimized.
7778
*/
79+
@ExperimentalComposeUiApi
7880
@Composable
7981
fun rememberWindowState(
8082
initialScreenProvider: WindowScreenProvider = WindowScreenProvider.Default,
@@ -105,6 +107,7 @@ fun rememberWindowState(
105107
* [DpOffset.isSpecified].
106108
* @param initiallyMinimized Whether the window is initially minimized.
107109
*/
110+
@ExperimentalComposeUiApi
108111
fun WindowStateWithBounds(
109112
initialPosition: DpOffset? = null,
110113
initialSize: DpSize? = null,
@@ -128,6 +131,7 @@ fun WindowStateWithBounds(
128131
* @param initialBoundsProvider Provides the initial bounds of the window.
129132
* @param initiallyMinimized Whether the window is initially minimized.
130133
*/
134+
@ExperimentalComposeUiApi
131135
fun WindowState(
132136
initialScreenProvider: WindowScreenProvider = WindowScreenProvider.Default,
133137
initialPlacement: WindowPlacement = WindowPlacement.Floating,
@@ -151,6 +155,7 @@ fun WindowState(
151155
* @param bounds the initial value for [WindowState._bounds]
152156
*/
153157
@Stable
158+
@ExperimentalComposeUiApi
154159
class WindowState private constructor(
155160
isInitialized: Boolean,
156161
screenId: String?,
@@ -331,6 +336,7 @@ class WindowState private constructor(
331336
)
332337
}
333338

339+
@ExperimentalComposeUiApi
334340
companion object {
335341
/**
336342
* A [Saver] implementation for [WindowState].
@@ -371,6 +377,7 @@ class WindowState private constructor(
371377
* Returns the bounds of the window, as an AWT [Rectangle]; throws [IllegalStateException] if the
372378
* window is not yet [isInitialized].
373379
*/
380+
@ExperimentalComposeUiApi
374381
val WindowState.awtBounds: Rectangle
375382
get() = bounds.toAwtRectangleRounded()
376383

0 commit comments

Comments
 (0)