Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Package.resolved
# hence it is not needed unless you have added a package configuration file to your project
.swiftpm
.build/
.build*

# CocoaPods
#
Expand Down
17 changes: 16 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import PackageDescription
/// system font, and QuickDraw's text.
/// - `GraphiteSound`: sampled sounds from 'snd ' resources and AIFF files,
/// the codecs that decode them, and the channels and mixer that play them.
/// - `GraphiteWindows`: the Window Manager: windows of every class, the
/// window list, FindWindow, zooming and collapsing, the visible and
/// update regions, and the content's buffer the host flushes.
/// - `Graphite`: re-exports the modules above.
///
/// Everything here depends only on the Swift standard library, the C
Expand Down Expand Up @@ -70,6 +73,10 @@ let package = Package(
.library(
name: "GraphiteSound",
targets: ["GraphiteSound"]
),
.library(
name: "GraphiteWindows",
targets: ["GraphiteWindows"]
)
],
// FreeType reads outline fonts; builds without it keep the bitmap font.
Expand Down Expand Up @@ -125,9 +132,13 @@ let package = Package(
name: "GraphiteSound",
dependencies: ["GraphiteBase"]
),
.target(
name: "GraphiteWindows",
dependencies: ["GraphiteBase", "GraphiteQuickDraw"]
),
.target(
name: "Graphite",
dependencies: ["GraphiteBase", "GraphiteTasks", "GraphiteFiles", "GraphiteResources", "GraphiteAppleEvents", "GraphiteQuickDraw", "GraphiteText", "GraphiteSound"]
dependencies: ["GraphiteBase", "GraphiteTasks", "GraphiteFiles", "GraphiteResources", "GraphiteAppleEvents", "GraphiteQuickDraw", "GraphiteText", "GraphiteSound", "GraphiteWindows"]
),
.testTarget(
name: "GraphiteBaseTests",
Expand Down Expand Up @@ -160,6 +171,10 @@ let package = Package(
.testTarget(
name: "GraphiteSoundTests",
dependencies: ["GraphiteSound"]
),
.testTarget(
name: "GraphiteWindowsTests",
dependencies: ["GraphiteWindows", "GraphiteQuickDraw"]
)
]
)
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Any UI it shows will be drawn with [Cacao](https://github.com/PureSwift/Cacao).

> **Status:** early development. `GraphiteBase`, `GraphiteTasks`,
> `GraphiteFiles`, `GraphiteResources`, `GraphiteAppleEvents`,
> `GraphiteQuickDraw`, `GraphiteText` and `GraphiteSound` are in place, apart
> from the MACE codecs and double-buffered sound. The Toolbox's windows, menus,
> controls and dialogs come next.
> `GraphiteQuickDraw`, `GraphiteText`, `GraphiteSound` and `GraphiteWindows`
> are in place, apart from the MACE codecs and double-buffered sound. The
> Toolbox's menus, controls and dialogs come next.

## Modules

Expand All @@ -43,6 +43,7 @@ Any UI it shows will be drawn with [Cacao](https://github.com/PureSwift/Cacao).
| `GraphiteQuickDraw` | QuickDraw's pixels (1 to 8 bits indexed, 16 and 32 bits direct, big-endian on every CPU, in memory of its own or a program's), colors and the system's color tables, regions as real regions with QuickDraw's region records, patterns, transfer modes, ports, devices and offscreen worlds; drawing rectangles, ovals, round rectangles, arcs, polygons, regions and lines with the pen, and CopyBits, CopyMask and ScrollRect between any depths; PICT pictures, version 1 and 2, with PackBits and QuickTime-compressed images through a decoder the host gives. |
| `GraphiteText` | Fonts: faces and their metrics, the Font Manager's family numbers and names with the classic fonts' and their substitutes, a built-in bitmap system font (from Pomme), and QuickDraw's text in a port's font, face, size and mode, with the styles a face hasn't drawn from its plain glyphs; ATSUI-style layouts with styled runs, line breaking, measuring, hit testing and drawing, and the text in PICT pictures; and, with the `FreeType` trait (on by default), faces from TrueType, OpenType and other outline fonts, found by family name in the system's font folders. |
| `GraphiteSound` | The Sound Manager: sampled sounds from `'snd '` resources (formats 1 and 2, with the standard, compressed and extended headers) and AIFF and AIFF-C files, read to 16-bit PCM; the µ-law, A-law and IMA4 codecs (MACE is recognized but not decoded yet); sound channels with queued commands (`SndDoCommand`) including `callBackCmd`, `waitCmd` and `syncCmd`, immediate ones, volume, pan, pitch, loops and completion; a mixer that renders them to stereo float frames, for an audio device the host provides; and the frequencies of MIDI notes. |
| `GraphiteWindows` | The Window Manager: windows of every class, from documents, dialogs and alerts to palettes, sheets and drawers, each with the standard Mac OS 8 and 9 frame or a window definition the host brings (the WDEF); the window list ordered by layer, `FrontWindow`, and the active document and the active palette; `FindWindow` and every part of a frame; showing, hiding, selecting, zooming between the user and standard states, collapsing; `MoveWindow`, `SizeWindow` and `SetWindowBounds`, with centering, cascading and the alert position; each window's content in an offscreen buffer with its visible region — what no window in front covers — its update region with `BeginUpdate` and `EndUpdate`, and the part of it the host is told to flush. |
| `Graphite` | Re-exports the modules above. |

Everything depends only on the Swift standard library, the C library
Expand Down
1 change: 1 addition & 0 deletions Sources/Graphite/Graphite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
@_exported import GraphiteQuickDraw
@_exported import GraphiteText
@_exported import GraphiteSound
@_exported import GraphiteWindows
Loading
Loading