Skip to content

Commit

Permalink
LibGfx: Explicitly spell out headers in the module map
Browse files Browse the repository at this point in the history
This allows importing all of LibGfx into Swift files, not just Color.
  • Loading branch information
ADKaster committed Aug 4, 2024
1 parent 26b125d commit 312b639
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibGfx/Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import AK
import LibGfx.Color
import LibGfx

// FIXME: Do this without extending String with an index operation that was explicitly deleted :^)
extension Swift.String {
Expand Down
128 changes: 124 additions & 4 deletions Userland/Libraries/LibGfx/module.modulemap
Original file line number Diff line number Diff line change
@@ -1,8 +1,128 @@
module LibGfx [system] {
requires cplusplus
module LibGfx {
header "AffineTransform.h"
header "AntiAliasingPainter.h"
header "Bitmap.h"
header "BoundingBox.h"
header "CIELAB.h"
header "CMYKBitmap.h"
header "Color.h"
header "DeltaE.h"
header "DisjointRectSet.h"
header "EdgeFlagPathRasterizer.h"
header "FontCascadeList.h"
header "Forward.h"
header "FourCC.h"
header "Gradients.h"
header "ImmutableBitmap.h"
header "Line.h"
header "LineStyle.h"
header "Matrix3x3.h"
header "Matrix4x4.h"
header "Matrix.h"
header "MedianCut.h"
header "Orientation.h"
header "Painter.h"
header "PaintStyle.h"
header "Palette.h"
header "PathClipper.h"
header "Path.h"
header "Point.h"
header "Quad.h"
header "Rect.h"
header "ScalingMode.h"
header "ShareableBitmap.h"
header "Size.h"
header "StandardCursor.h"
header "SystemTheme.h"
header "TextAlignment.h"
header "TextAttributes.h"
header "TextLayout.h"
header "Triangle.h"
header "Vector2.h"
header "Vector3.h"
header "Vector4.h"
header "VectorGraphic.h"
header "VectorN.h"
header "WindingRule.h"

module Font {
header "Font/Emoji.h"
header "Font/FontDatabase.h"
header "Font/FontData.h"
header "Font/Font.h"
header "Font/FontStyleMapping.h"
header "Font/FontWeight.h"
header "Font/ScaledFont.h"
header "Font/Typeface.h"
header "Font/UnicodeRange.h"

module OpenType {
header "Font/OpenType/Cmap.h"
header "Font/OpenType/DataTypes.h"
header "Font/OpenType/Glyf.h"
header "Font/OpenType/Hinting/Opcodes.h"
header "Font/OpenType/Tables.h"
header "Font/OpenType/Typeface.h"

requires cplusplus
export *
}

module WOFF {
header "Font/WOFF/Loader.h"
requires cplusplus
export *
}
module WOFF2 {
header "Font/WOFF2/Loader.h"
requires cplusplus
export *
}
}

module ICC {
header "ICC/BinaryFormat.h"
header "ICC/BinaryWriter.h"
header "ICC/DistinctFourCC.h"
header "ICC/Enums.h"
header "ICC/Profile.h"
header "ICC/Tags.h"
header "ICC/TagTypes.h"
header "ICC/WellKnownProfiles.h"

explicit module Color {
header "Color.h"
requires cplusplus
export *
}

module ImageFormats {
header "ImageFormats/AnimationWriter.h"
header "ImageFormats/AVIFLoader.h"
header "ImageFormats/BMPLoader.h"
header "ImageFormats/BMPWriter.h"
header "ImageFormats/BooleanDecoder.h"
header "ImageFormats/CCITTDecoder.h"
header "ImageFormats/ExifOrientedBitmap.h"
header "ImageFormats/GIFLoader.h"
header "ImageFormats/GIFWriter.h"
header "ImageFormats/ICOLoader.h"
header "ImageFormats/ImageDecoder.h"
header "ImageFormats/JPEGLoader.h"
header "ImageFormats/JPEGWriter.h"
header "ImageFormats/JPEGXLLoader.h"
header "ImageFormats/PNGLoader.h"
header "ImageFormats/PNGWriter.h"
header "ImageFormats/TIFFLoader.h"
header "ImageFormats/TinyVGLoader.h"
header "ImageFormats/WebPLoader.h"
header "ImageFormats/WebPShared.h"
header "ImageFormats/WebPSharedLossless.h"
header "ImageFormats/WebPWriter.h"
header "ImageFormats/WebPWriterLossless.h"

requires cplusplus
export *
}

requires cplusplus
export *
}

0 comments on commit 312b639

Please sign in to comment.