From 9ee9a5402ffa41e7859c81ea94f8895f3d714ef4 Mon Sep 17 00:00:00 2001 From: Sebastiano Poggi Date: Thu, 2 Nov 2023 02:12:15 +0000 Subject: [PATCH] Enable explicit API mode (#232) * Enable Explicit API mode * Fix all Explicit API errors * Improve missing composition local error * Fix after rebase * Update again after new rebase GitOrigin-RevId: ab2ca7a0ae98743b3f5c042aa88f1f4f1a67328c --- platform/jewel/.idea/codeStyles/Project.xml | 1 + platform/jewel/build.gradle.kts | 5 +- platform/jewel/buildSrc/build.gradle.kts | 3 +- platform/jewel/buildSrc/settings.gradle.kts | 1 + .../src/main/kotlin/IdeaConfiguration.kt | 14 +- .../src/main/kotlin/LocalProperties.kt | 2 +- .../src/main/kotlin/MergeSarifTask.kt | 52 +-- .../src/main/kotlin/PublishConfiguration.kt | 4 +- .../src/main/kotlin/ValidatePublicApiTask.kt | 8 +- ...droid-studio-releases-generator.gradle.kts | 16 +- .../intellij-theme-generator.gradle.kts | 30 +- .../kotlin/jewel-check-public-api.gradle.kts | 20 +- .../main/kotlin/jewel-ij-publish.gradle.kts | 12 +- .../src/main/kotlin/jewel-linting.gradle.kts | 8 +- .../src/main/kotlin/jewel-publish.gradle.kts | 4 +- .../buildSrc/src/main/kotlin/jewel.gradle.kts | 36 +- .../demodata/AndroidStudioReleases.kt | 21 +- .../demodata/AndroidStudioReleasesReader.kt | 124 ++++--- .../demodata/ApiAndroidStudioReleases.kt | 42 +-- ...IdeaReleases.kt => ApiIdeaReleasesItem.kt} | 0 .../ideversion/CheckIdeaVersionTask.kt | 63 ++-- .../theme/IntUiThemeDescriptorReader.kt | 107 +++--- .../theme/IntelliJThemeGeneratorPlugin.kt | 17 +- .../jetbrains/jewel/window/DecoratedWindow.kt | 154 +++++---- .../org/jetbrains/jewel/window/Theme.kt | 10 +- .../jetbrains/jewel/window/TitleBar.Linux.kt | 61 ++-- .../jetbrains/jewel/window/TitleBar.MacOS.kt | 37 +-- .../jewel/window/TitleBar.Windows.kt | 45 +-- .../org/jetbrains/jewel/window/TitleBar.kt | 73 ++-- .../window/styling/DecoratedWindowStyling.kt | 44 +-- .../jewel/window/styling/TitleBarStyling.kt | 99 +++--- .../jewel/window/utils/DesktopPlatform.kt | 7 +- .../jetbrains/jewel/window/utils/JnaLoader.kt | 10 +- .../jewel/window/utils/UnsafeAccessing.kt | 27 +- platform/jewel/foundation/build.gradle.kts | 3 +- .../jewel/foundation/Compatibility.kt | 15 +- .../jewel/foundation/ExperimentalJewelApi.kt | 16 +- .../jewel/foundation/GenerateDataFunctions.kt | 9 +- .../jewel/foundation/GlobalColors.kt | 44 +-- .../jewel/foundation/GlobalMetrics.kt | 16 +- .../jewel/foundation/InternalJewelApi.kt | 14 +- .../org/jetbrains/jewel/foundation/Stroke.kt | 46 ++- .../jewel/foundation/lazy/Keybindings.kt | 106 +++--- .../lazy/SelectableColumnOnKeyEvent.kt | 158 +++++---- .../foundation/lazy/SelectableLazyColumn.kt | 214 ++++++------ .../lazy/SelectableLazyListScope.kt | 36 +- .../lazy/SelectableLazyListState.kt | 231 +++---------- .../foundation/lazy/tree/BasicLazyTree.kt | 154 +++++---- .../jewel/foundation/lazy/tree/BuildTree.kt | 153 +++++---- .../lazy/tree/DefaultTreeViewKeybindings.kt | 53 +-- .../lazy/tree/DefaultTreeViewOnKeyEvent.kt | 39 ++- .../jewel/foundation/lazy/tree/KeyActions.kt | 68 ++-- .../jewel/foundation/lazy/tree/Tree.kt | 68 ++-- .../jewel/foundation/lazy/tree/TreeState.kt | 10 +- .../lazy/tree/TreeViewOnKeyEvent.kt | 10 +- .../jewel/foundation/modifier/Activation.kt | 139 ++++---- .../jewel/foundation/modifier/Border.kt | 314 ++++++++---------- .../foundation/modifier/OnHoverModifier.kt | 2 +- .../foundation/state/CommonStateBitMask.kt | 18 +- .../state/FocusableComponentState.kt | 8 +- .../state/InteractiveComponentState.kt | 16 +- .../state/SelectableComponentState.kt | 7 +- .../state/ToggleableComponentState.kt | 10 +- .../jewel/foundation/theme/JewelTheme.kt | 66 ++-- .../foundation/theme/ThemeColorPalette.kt | 82 ++--- .../jewel/foundation/theme/ThemeDefinition.kt | 16 +- .../jewel/foundation/theme/ThemeDescriptor.kt | 10 +- .../jewel/foundation/theme/ThemeIconData.kt | 35 +- .../jewel/foundation/utils/Logger.kt | 15 +- .../ide-laf-bridge/api/ide-laf-bridge.api | 5 +- .../jewel/ide-laf-bridge/build.gradle.kts | 1 + .../jetbrains/jewel/bridge/BridgeIconData.kt | 7 +- .../jetbrains/jewel/bridge/BridgeOverride.kt | 18 +- .../bridge/BridgePainterHintsProvider.kt | 28 +- .../jewel/bridge/UiThemeExtensions.kt | 6 +- .../jetbrains/jewel/bridge/BridgeIconData.kt | 2 +- .../jetbrains/jewel/bridge/BridgeOverride.kt | 2 +- .../bridge/BridgePainterHintsProvider.kt | 21 +- .../org/jetbrains/jewel/bridge/Bridge.kt | 7 +- .../jewel/bridge/BridgeResourceResolver.kt | 5 +- .../org/jetbrains/jewel/bridge/BridgeUtils.kt | 85 ++--- .../jewel/bridge/JewelBridgeException.kt | 16 +- .../jewel/bridge/SwingBridgeService.kt | 38 +-- .../org/jetbrains/jewel/bridge/SwingLafKey.kt | 12 - .../jewel/bridge/ToolWindowExtensions.kt | 12 +- .../actionSystem/DataProviderElement.kt | 4 +- .../bridge/actionSystem/DataProviderNode.kt | 22 +- .../jewel/bridge/actionSystem/ProvideData.kt | 32 +- .../jewel/bridge/theme/BridgeGlobalColors.kt | 6 +- .../jewel/bridge/theme/BridgeGlobalMetrics.kt | 2 +- .../bridge/theme/BridgeThemeColorPalette.kt | 25 +- .../jewel/bridge/theme/IntUiBridge.kt | 247 +++++++------- .../jewel/bridge/theme/SwingBridgeTheme.kt | 2 +- .../bridge/actionSystem/ProvideDataTest.kt | 18 +- .../IntUiDecoratedWindowResourceResolver.kt | 5 +- .../jewel/intui/window/IntUiTheme.kt | 31 +- .../styling/IntUiDecoratedWindowStyling.kt | 20 +- .../window/styling/IntUiTitleBarStyling.kt | 109 +++--- .../int-ui/int-ui-standalone/build.gradle.kts | 4 +- .../jewel/intui/standalone/InterFont.kt | 25 +- .../jewel/intui/standalone/PainterProvider.kt | 6 +- .../StandalonePainterHintsProvider.kt | 114 +++---- .../standalone/styling/IntUiButtonStyling.kt | 192 ++++++----- .../styling/IntUiCheckboxStyling.kt | 47 +-- .../standalone/styling/IntUiChipStyling.kt | 147 ++++---- .../styling/IntUiCircularProgressStyling.kt | 15 +- .../standalone/styling/IntUiDividerStyle.kt | 10 +- .../styling/IntUiDropdownStyling.kt | 251 +++++++------- .../styling/IntUiGroupHeaderStyling.kt | 25 +- .../IntUiHorizontalProgressBarStyling.kt | 49 +-- .../styling/IntUiIconButtonStyling.kt | 23 +- .../styling/IntUiLazyTreeStyling.kt | 86 ++--- .../standalone/styling/IntUiLinkStyling.kt | 62 ++-- .../standalone/styling/IntUiMenuStyling.kt | 168 +++++----- .../styling/IntUiRadioButtonStyling.kt | 69 ++-- .../styling/IntUiScrollbarStyling.kt | 30 +- .../standalone/styling/IntUiTabStyling.kt | 247 +++++++------- .../styling/IntUiTextAreaStyling.kt | 113 ++++--- .../styling/IntUiTextFieldStyling.kt | 113 ++++--- .../standalone/styling/IntUiTooltipStyling.kt | 32 +- .../standalone/theme/IntUiGlobalColors.kt | 50 +-- .../standalone/theme/IntUiGlobalMetrics.kt | 5 +- .../intui/standalone/theme/IntUiTheme.kt | 130 ++++---- .../src/main/kotlin/icons/JewelIcons.kt | 3 +- .../ideplugin/releasessample/ContentItem.kt | 3 +- .../jewel/samples/standalone/IntUiThemes.kt | 12 +- .../jewel/samples/standalone/Main.kt | 2 +- .../samples/standalone/view/TitleBarView.kt | 6 +- .../samples/standalone/view/WelcomeView.kt | 78 +++-- platform/jewel/ui/api/ui.api | 39 +-- platform/jewel/ui/build.gradle.kts | 3 +- .../jetbrains/jewel/ui/ComponentStyling.kt | 22 +- .../jewel/ui/DefaultComponentStyling.kt | 93 +++--- .../jetbrains/jewel/ui/DisabledColorFilter.kt | 40 +-- .../org/jetbrains/jewel/ui/NoIndication.kt | 2 +- .../org/jetbrains/jewel/ui/Orientation.kt | 14 +- .../kotlin/org/jetbrains/jewel/ui/Outline.kt | 25 +- .../jetbrains/jewel/ui/component/Button.kt | 69 ++-- .../jetbrains/jewel/ui/component/Checkbox.kt | 103 +++--- .../org/jetbrains/jewel/ui/component/Chip.kt | 91 +++-- .../ui/component/CircularProgressIndicator.kt | 95 +++--- .../jewel/ui/component/ContextMenu.kt | 34 +- .../jetbrains/jewel/ui/component/Divider.kt | 25 +- .../jetbrains/jewel/ui/component/Dropdown.kt | 112 +++---- .../jewel/ui/component/GroupHeader.kt | 3 +- .../org/jetbrains/jewel/ui/component/Icon.kt | 89 +++-- .../jewel/ui/component/IconButton.kt | 114 +++---- .../jewel/ui/component/InputField.kt | 61 ++-- .../jetbrains/jewel/ui/component/LazyTree.kt | 22 +- .../jewel/ui/component/LinearProgressBar.kt | 48 +-- .../org/jetbrains/jewel/ui/component/Link.kt | 102 +++--- .../org/jetbrains/jewel/ui/component/Menu.kt | 228 ++++++------- .../jewel/ui/component/MenuManager.kt | 31 +- .../org/jetbrains/jewel/ui/component/Popup.kt | 50 ++- .../jewel/ui/component/RadioButton.kt | 103 +++--- .../jewel/ui/component/Scrollbars.kt | 72 ++-- .../jewel/ui/component/SplitLayout.kt | 193 +++++------ .../jetbrains/jewel/ui/component/TabStrip.kt | 159 +++------ .../org/jetbrains/jewel/ui/component/Tabs.kt | 114 ++++--- .../org/jetbrains/jewel/ui/component/Text.kt | 48 +-- .../jetbrains/jewel/ui/component/TextArea.kt | 74 ++--- .../jetbrains/jewel/ui/component/TextField.kt | 55 ++- .../jetbrains/jewel/ui/component/Tooltip.kt | 77 +++-- .../ui/component/styling/ButtonStyling.kt | 133 ++++---- .../ui/component/styling/CheckboxStyling.kt | 62 ++-- .../jewel/ui/component/styling/ChipStyling.kt | 210 ++++++------ .../styling/CircularProgressStyle.kt | 16 +- .../ui/component/styling/DividerStyling.kt | 28 +- .../ui/component/styling/DropdownStyling.kt | 176 +++++----- .../component/styling/GroupHeaderStyling.kt | 28 +- .../styling/HorizontalProgressBarStyling.kt | 40 +-- .../ui/component/styling/IconButtonStyling.kt | 122 +++---- .../ui/component/styling/InputFieldStyling.kt | 145 ++++---- .../ui/component/styling/LazyTreeStyling.kt | 84 ++--- .../jewel/ui/component/styling/LinkStyling.kt | 117 +++---- .../jewel/ui/component/styling/MenuStyling.kt | 176 +++++----- .../component/styling/RadioButtonStyling.kt | 68 ++-- .../ui/component/styling/ScrollbarStyling.kt | 38 ++- .../jewel/ui/component/styling/TabStyling.kt | 231 +++++++------ .../ui/component/styling/TextAreaStyling.kt | 22 +- .../ui/component/styling/TextFieldStyling.kt | 22 +- .../ui/component/styling/TooltipStyling.kt | 67 ++-- .../jewel/ui/painter/BadgePainter.kt | 17 +- .../ui/painter/BasePainterHintsProvider.kt | 30 +- .../jewel/ui/painter/DelegatePainter.kt | 6 +- .../jetbrains/jewel/ui/painter/PainterHint.kt | 80 ++--- .../jewel/ui/painter/PainterHintsProvider.kt | 33 +- .../jewel/ui/painter/PainterProvider.kt | 15 +- .../jewel/ui/painter/PainterProviderScope.kt | 12 +- .../jewel/ui/painter/ResizedPainter.kt | 2 +- .../ui/painter/ResourcePainterProvider.kt | 108 +++--- .../jewel/ui/painter/badge/BadgeShape.kt | 6 +- .../jewel/ui/painter/badge/DotBadgeShape.kt | 39 ++- .../jetbrains/jewel/ui/painter/hints/Badge.kt | 32 +- .../jewel/ui/painter/hints/DarkOrStroke.kt | 29 +- .../jetbrains/jewel/ui/painter/hints/HiDpi.kt | 2 +- .../jewel/ui/painter/hints/Override.kt | 28 +- .../jewel/ui/painter/hints/Palette.kt | 22 +- .../jewel/ui/painter/hints/Selected.kt | 9 +- .../jetbrains/jewel/ui/painter/hints/Size.kt | 27 +- .../jewel/ui/painter/hints/Stateful.kt | 17 +- .../jetbrains/jewel/ui/theme/JewelTheme.kt | 48 +-- .../jewel/ui/util/ColorExtensions.kt | 19 +- .../org/jetbrains/jewel/ui/util/Debug.kt | 6 +- .../jewel/ui/util/ModifierExtensions.kt | 17 +- .../ui/util/SpinnerProgressIconGenerator.kt | 102 ------ .../org/jetbrains/jewel/PainterHintTest.kt | 112 +++---- 207 files changed, 5521 insertions(+), 5755 deletions(-) rename platform/jewel/buildSrc/src/main/kotlin/org/jetbrains/jewel/buildlogic/ideversion/{ApiIdeaReleases.kt => ApiIdeaReleasesItem.kt} (100%) delete mode 100644 platform/jewel/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/SwingLafKey.kt delete mode 100644 platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/util/SpinnerProgressIconGenerator.kt diff --git a/platform/jewel/.idea/codeStyles/Project.xml b/platform/jewel/.idea/codeStyles/Project.xml index 5383e2d02f005..23d15b1d51ca5 100644 --- a/platform/jewel/.idea/codeStyles/Project.xml +++ b/platform/jewel/.idea/codeStyles/Project.xml @@ -17,6 +17,7 @@