Remove Core library
This commit is contained in:
parent
fd29eccd68
commit
04c77831b5
@ -154,5 +154,5 @@ type_contents_order:
|
|||||||
- other_method
|
- other_method
|
||||||
|
|
||||||
excluded:
|
excluded:
|
||||||
- Sources/Core/View/Generated/
|
- Sources/Adwaita/View/Generated/
|
||||||
- .build/
|
- .build/
|
||||||
@ -17,10 +17,6 @@ let package = Package(
|
|||||||
name: "Adwaita",
|
name: "Adwaita",
|
||||||
targets: ["Adwaita"]
|
targets: ["Adwaita"]
|
||||||
),
|
),
|
||||||
.library(
|
|
||||||
name: "Core",
|
|
||||||
targets: ["Core"]
|
|
||||||
),
|
|
||||||
.library(
|
.library(
|
||||||
name: "CAdw",
|
name: "CAdw",
|
||||||
targets: ["CAdw"]
|
targets: ["CAdw"]
|
||||||
@ -41,7 +37,7 @@ let package = Package(
|
|||||||
pkgConfig: "libadwaita-1"
|
pkgConfig: "libadwaita-1"
|
||||||
),
|
),
|
||||||
.target(
|
.target(
|
||||||
name: "Core",
|
name: "Adwaita",
|
||||||
dependencies: [
|
dependencies: [
|
||||||
"CAdw",
|
"CAdw",
|
||||||
.product(name: "LevenshteinTransformations", package: "levenshtein-transformations"),
|
.product(name: "LevenshteinTransformations", package: "levenshtein-transformations"),
|
||||||
@ -49,10 +45,6 @@ let package = Package(
|
|||||||
.product(name: "MetaSQLite", package: "meta-sqlite")
|
.product(name: "MetaSQLite", package: "meta-sqlite")
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
.target(
|
|
||||||
name: "Adwaita",
|
|
||||||
dependencies: ["Core"]
|
|
||||||
),
|
|
||||||
.executableTarget(
|
.executableTarget(
|
||||||
name: "Generation",
|
name: "Generation",
|
||||||
dependencies: [
|
dependencies: [
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
//
|
|
||||||
// ActionRow+.swift
|
|
||||||
// Adwaita
|
|
||||||
//
|
|
||||||
// Created by david-swift on 16.10.24.
|
|
||||||
//
|
|
||||||
|
|
||||||
extension ActionRow {
|
|
||||||
|
|
||||||
/// Deemphasize the row title and emphasize the subtitle.
|
|
||||||
/// - Parameter active: Whether the style is currently applied.
|
|
||||||
/// - Returns: A view.
|
|
||||||
public func property(_ active: Bool = true) -> AnyView {
|
|
||||||
style("property", active: active)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -5,7 +5,6 @@
|
|||||||
// Created by david-swift on 16.10.24.
|
// Created by david-swift on 16.10.24.
|
||||||
//
|
//
|
||||||
|
|
||||||
@_exported import Core
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
extension AnyView {
|
extension AnyView {
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
//
|
|
||||||
// StatusPage+.swift
|
|
||||||
// Adwaita
|
|
||||||
//
|
|
||||||
// Created by david-swift on 16.10.24.
|
|
||||||
//
|
|
||||||
|
|
||||||
extension StatusPage {
|
|
||||||
|
|
||||||
/// Make the status page more compact.
|
|
||||||
/// - Parameter active: Whether the style is applied.
|
|
||||||
/// - Returns: A view.
|
|
||||||
public func compact(_ active: Bool = true) -> AnyView {
|
|
||||||
style("compact", active: active)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -9,7 +9,7 @@ import CAdw
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
/// The about dialog widget.
|
/// The about dialog widget.
|
||||||
public struct AboutDialog: AdwaitaWidget {
|
struct AboutDialog: AdwaitaWidget {
|
||||||
|
|
||||||
/// Whether the dialog is visible.
|
/// Whether the dialog is visible.
|
||||||
@Binding var visible: Bool
|
@Binding var visible: Bool
|
||||||
@ -42,7 +42,7 @@ public struct AboutDialog: AdwaitaWidget {
|
|||||||
/// - icon: The icon.
|
/// - icon: The icon.
|
||||||
/// - website: The website's URL.
|
/// - website: The website's URL.
|
||||||
/// - issues: The link for opening issues.
|
/// - issues: The link for opening issues.
|
||||||
public init(
|
init(
|
||||||
visible: Binding<Bool>,
|
visible: Binding<Bool>,
|
||||||
child: AnyView,
|
child: AnyView,
|
||||||
appName: String? = nil,
|
appName: String? = nil,
|
||||||
@ -67,7 +67,7 @@ public struct AboutDialog: AdwaitaWidget {
|
|||||||
/// - modifiers: Modify views before being updated.
|
/// - modifiers: Modify views before being updated.
|
||||||
/// - type: The view render data type.
|
/// - type: The view render data type.
|
||||||
/// - Returns: The view storage.
|
/// - Returns: The view storage.
|
||||||
public func container<Data>(data: WidgetData, type: Data.Type) -> ViewStorage where Data: ViewRenderData {
|
func container<Data>(data: WidgetData, type: Data.Type) -> ViewStorage where Data: ViewRenderData {
|
||||||
let storage = child.storage(data: data, type: type)
|
let storage = child.storage(data: data, type: type)
|
||||||
update(storage, data: data, updateProperties: true, type: type)
|
update(storage, data: data, updateProperties: true, type: type)
|
||||||
return storage
|
return storage
|
||||||
@ -79,7 +79,7 @@ public struct AboutDialog: AdwaitaWidget {
|
|||||||
/// - modifiers: Modify views before being updated
|
/// - modifiers: Modify views before being updated
|
||||||
/// - updateProperties: Whether to update the view's properties.
|
/// - updateProperties: Whether to update the view's properties.
|
||||||
/// - type: The view render data type.
|
/// - type: The view render data type.
|
||||||
public func update<Data>(
|
func update<Data>(
|
||||||
_ storage: ViewStorage,
|
_ storage: ViewStorage,
|
||||||
data: WidgetData,
|
data: WidgetData,
|
||||||
updateProperties: Bool,
|
updateProperties: Bool,
|
||||||
@ -43,7 +43,7 @@ public struct AlertDialog: AdwaitaWidget {
|
|||||||
/// - heading: The heading.
|
/// - heading: The heading.
|
||||||
/// - body: The body text.
|
/// - body: The body text.
|
||||||
/// - extraChild: The body view.
|
/// - extraChild: The body view.
|
||||||
public init(
|
init(
|
||||||
visible: Binding<Bool>,
|
visible: Binding<Bool>,
|
||||||
child: AnyView,
|
child: AnyView,
|
||||||
id: String,
|
id: String,
|
||||||
@ -8,7 +8,7 @@
|
|||||||
import CAdw
|
import CAdw
|
||||||
|
|
||||||
/// The dialog widget.
|
/// The dialog widget.
|
||||||
public struct Dialog: AdwaitaWidget {
|
struct Dialog: AdwaitaWidget {
|
||||||
|
|
||||||
/// Whether the dialog is visible.
|
/// Whether the dialog is visible.
|
||||||
@Binding var visible: Bool
|
@Binding var visible: Bool
|
||||||
@ -39,7 +39,7 @@ public struct Dialog: AdwaitaWidget {
|
|||||||
/// - title: The title.
|
/// - title: The title.
|
||||||
/// - width: The width.
|
/// - width: The width.
|
||||||
/// - height: The height.
|
/// - height: The height.
|
||||||
public init(
|
init(
|
||||||
visible: Binding<Bool>,
|
visible: Binding<Bool>,
|
||||||
child: AnyView,
|
child: AnyView,
|
||||||
id: String,
|
id: String,
|
||||||
@ -62,7 +62,7 @@ public struct Dialog: AdwaitaWidget {
|
|||||||
/// - modifiers: Modify views before being updated.
|
/// - modifiers: Modify views before being updated.
|
||||||
/// - type: The view render data type.
|
/// - type: The view render data type.
|
||||||
/// - Returns: The view storage.
|
/// - Returns: The view storage.
|
||||||
public func container<Data>(data: WidgetData, type: Data.Type) -> ViewStorage where Data: ViewRenderData {
|
func container<Data>(data: WidgetData, type: Data.Type) -> ViewStorage where Data: ViewRenderData {
|
||||||
let child = child.storage(data: data, type: type)
|
let child = child.storage(data: data, type: type)
|
||||||
let storage = ViewStorage(child.opaquePointer, content: [.mainContent: [child]])
|
let storage = ViewStorage(child.opaquePointer, content: [.mainContent: [child]])
|
||||||
update(storage, data: data, updateProperties: true, type: type)
|
update(storage, data: data, updateProperties: true, type: type)
|
||||||
@ -75,7 +75,7 @@ public struct Dialog: AdwaitaWidget {
|
|||||||
/// - modifiers: Modify views before being updated
|
/// - modifiers: Modify views before being updated
|
||||||
/// - updateProperties: Whether to update the view's properties.
|
/// - updateProperties: Whether to update the view's properties.
|
||||||
/// - type: The view render data type.
|
/// - type: The view render data type.
|
||||||
public func update<Data>(
|
func update<Data>(
|
||||||
_ storage: ViewStorage,
|
_ storage: ViewStorage,
|
||||||
data: WidgetData,
|
data: WidgetData,
|
||||||
updateProperties: Bool,
|
updateProperties: Bool,
|
||||||
@ -9,7 +9,7 @@ import CAdw
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
/// A structure representing a file dialog window.
|
/// A structure representing a file dialog window.
|
||||||
public struct FileDialog: AdwaitaWidget {
|
struct FileDialog: AdwaitaWidget {
|
||||||
|
|
||||||
/// The dialog type.
|
/// The dialog type.
|
||||||
var type: DialogType
|
var type: DialogType
|
||||||
@ -32,7 +32,7 @@ public struct FileDialog: AdwaitaWidget {
|
|||||||
/// - result: Run when the import or export succeeds.
|
/// - result: Run when the import or export succeeds.
|
||||||
/// - cancel: Run when the import or export is not successful.
|
/// - cancel: Run when the import or export is not successful.
|
||||||
/// - initialFolder: The initial folder.
|
/// - initialFolder: The initial folder.
|
||||||
public init(
|
init(
|
||||||
type: DialogType,
|
type: DialogType,
|
||||||
`open`: Signal,
|
`open`: Signal,
|
||||||
child: AnyView,
|
child: AnyView,
|
||||||
@ -49,7 +49,7 @@ public struct FileDialog: AdwaitaWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The different types of dialogs and their properties.
|
/// The different types of dialogs and their properties.
|
||||||
public enum DialogType {
|
enum DialogType {
|
||||||
|
|
||||||
/// An importer dialog.
|
/// An importer dialog.
|
||||||
case importer(folder: Bool, extensions: [String]?)
|
case importer(folder: Bool, extensions: [String]?)
|
||||||
@ -103,7 +103,7 @@ public struct FileDialog: AdwaitaWidget {
|
|||||||
/// - modifiers: Modify views before being updated.
|
/// - modifiers: Modify views before being updated.
|
||||||
/// - type: The view render data type.
|
/// - type: The view render data type.
|
||||||
/// - Returns: The view storage.
|
/// - Returns: The view storage.
|
||||||
public func container<Data>(data: WidgetData, type: Data.Type) -> ViewStorage where Data: ViewRenderData {
|
func container<Data>(data: WidgetData, type: Data.Type) -> ViewStorage where Data: ViewRenderData {
|
||||||
let child = child.storage(data: data, type: type)
|
let child = child.storage(data: data, type: type)
|
||||||
let storage = ViewStorage(child.opaquePointer, content: [.mainContent: [child]])
|
let storage = ViewStorage(child.opaquePointer, content: [.mainContent: [child]])
|
||||||
update(storage, data: data, updateProperties: true, type: type)
|
update(storage, data: data, updateProperties: true, type: type)
|
||||||
@ -116,7 +116,7 @@ public struct FileDialog: AdwaitaWidget {
|
|||||||
/// - modifiers: Modify views before being updated
|
/// - modifiers: Modify views before being updated
|
||||||
/// - updateProperties: Whether to update the view's properties.
|
/// - updateProperties: Whether to update the view's properties.
|
||||||
/// - type: The view render data type.
|
/// - type: The view render data type.
|
||||||
public func update<Data>(
|
func update<Data>(
|
||||||
_ storage: ViewStorage,
|
_ storage: ViewStorage,
|
||||||
data: WidgetData,
|
data: WidgetData,
|
||||||
updateProperties: Bool,
|
updateProperties: Bool,
|
||||||
@ -29,7 +29,7 @@ public struct PreferencesDialog: AdwaitaWidget {
|
|||||||
/// - visible: Whether the dialog is visible.
|
/// - visible: Whether the dialog is visible.
|
||||||
/// - child: The wrapped view.
|
/// - child: The wrapped view.
|
||||||
/// - id: An unique identifier for dialogs on the view.
|
/// - id: An unique identifier for dialogs on the view.
|
||||||
public init(
|
init(
|
||||||
visible: Binding<Bool>,
|
visible: Binding<Bool>,
|
||||||
child: AnyView,
|
child: AnyView,
|
||||||
id: String
|
id: String
|
||||||
@ -53,7 +53,7 @@ public struct PreferencesDialog: AdwaitaWidget {
|
|||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - title: The page title.
|
/// - title: The page title.
|
||||||
/// - icon: The page's icon.
|
/// - icon: The page's icon.
|
||||||
public init(_ title: String, icon: Icon) {
|
init(_ title: String, icon: Icon) {
|
||||||
self.title = title
|
self.title = title
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ public struct PreferencesDialog: AdwaitaWidget {
|
|||||||
/// - Parameter data: The widget data.
|
/// - Parameter data: The widget data.
|
||||||
/// - Returns: The preferences page pointer and the groups view storages.
|
/// - Returns: The preferences page pointer and the groups view storages.
|
||||||
func gtkPreferencesPage(data: WidgetData) -> (OpaquePointer?, [ViewStorage]) {
|
func gtkPreferencesPage(data: WidgetData) -> (OpaquePointer?, [ViewStorage]) {
|
||||||
let page = Core.PreferencesPage()
|
let page = Adwaita.PreferencesPage()
|
||||||
.title(title)
|
.title(title)
|
||||||
.iconName(icon.string)
|
.iconName(icon.string)
|
||||||
.storage(data: data.noModifiers, type: AdwaitaMainView.self)
|
.storage(data: data.noModifiers, type: AdwaitaMainView.self)
|
||||||
@ -120,7 +120,7 @@ public struct PreferencesDialog: AdwaitaWidget {
|
|||||||
/// Get the GTk preferences group.
|
/// Get the GTk preferences group.
|
||||||
/// - Parameter data: The widget data.
|
/// - Parameter data: The widget data.
|
||||||
/// - Returns: The preferences group.
|
/// - Returns: The preferences group.
|
||||||
func group(data: WidgetData) -> Core.PreferencesGroup {
|
func group(data: WidgetData) -> Adwaita.PreferencesGroup {
|
||||||
.init()
|
.init()
|
||||||
.title(title)
|
.title(title)
|
||||||
.description(description)
|
.description(description)
|
||||||
@ -14,4 +14,11 @@ extension ActionRow {
|
|||||||
self = self.title(title)
|
self = self.title(title)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Deemphasize the row title and emphasize the subtitle.
|
||||||
|
/// - Parameter active: Whether the style is currently applied.
|
||||||
|
/// - Returns: A view.
|
||||||
|
public func property(_ active: Bool = true) -> AnyView {
|
||||||
|
style("property", active: active)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user