Skip to content

Commit

Permalink
GTK shape support WIP (#348)
Browse files Browse the repository at this point in the history
* GTK shape support

* Support for ellipsis

* Allow drawing 'outside' of current frame. Experimental.

* Correctly support Capsules (rounded rects with nil cornerSize)

* Use boundingRect.size for Path size

* Refactored GdkRGBA from AnyColorBox.ResolvedValue to be reusable

* Added 'resolveToCairo(in environment:)' extension on Color

* Create slightly lighter View type hierarchies.
  • Loading branch information
mortenbekditlevsen committed Jan 12, 2021
1 parent b55f703 commit 25e2191
Show file tree
Hide file tree
Showing 10 changed files with 685 additions and 193 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LINKER_FLAGS := $(shell pkg-config --libs gtk+-3.0)
LINKER_FLAGS := $(shell pkg-config --libs gtk+-3.0 gdk-3.0)
C_FLAGS := $(shell pkg-config --cflags gtk+-3.0)
SWIFT_LINKER_FLAGS ?= -Xlinker $(shell echo $(LINKER_FLAGS) | sed -e "s/ / -Xlinker /g" | sed -e "s/-Xlinker -Wl,-framework,/-Xlinker -framework -Xlinker /g")
SWIFT_C_FLAGS ?= -Xcc $(shell echo $(C_FLAGS) | sed -e "s/ / -Xcc /g")
Expand Down
11 changes: 10 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,22 @@ let package = Package(
.brew(["gtk+3"]),
]
),
.systemLibrary(
name: "CGDK",
pkgConfig: "gdk-3.0",
providers: [
.apt(["libgtk+-3.0", "gtk+-3.0"]),
// .yum(["gtk3-devel"]),
.brew(["gtk+3"]),
]
),
.target(
name: "TokamakGTKCHelpers",
dependencies: ["CGTK"]
),
.target(
name: "TokamakGTK",
dependencies: ["TokamakCore", "CGTK", "TokamakGTKCHelpers", "CombineShim"]
dependencies: ["TokamakCore", "CGTK", "CGDK", "TokamakGTKCHelpers", "CombineShim"]
),
.target(
name: "TokamakGTKDemo",
Expand Down
1 change: 1 addition & 0 deletions Sources/CGDK/CGDK-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <gdk/gdk.h>
8 changes: 8 additions & 0 deletions Sources/CGDK/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module CGDK {
header "./termios-Header.h"
header "./CGDK-Bridging-Header.h"

link "gdk-3"

export *
}
1 change: 1 addition & 0 deletions Sources/CGDK/termios-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <termios.h>
Loading

0 comments on commit 25e2191

Please sign in to comment.