Skip to content

Commit

Permalink
updated for Swift 3
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed May 7, 2016
1 parent 738f4ef commit cace3d0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Sources/Cairo/Context.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public final class Context {

// MARK: - Internal Properties

internal var internalPointer: COpaquePointer
internal var internalPointer: OpaquePointer

// MARK: - Initialization

Expand Down Expand Up @@ -95,12 +95,12 @@ public final class Context {
cairo_pop_group_to_source(internalPointer)
}

public func setSourceColor(red red: Double, green: Double, blue: Double) {
public func setSourceColor(red: Double, green: Double, blue: Double) {

cairo_set_source_rgb(internalPointer, red, green, blue)
}

public func setSourceColor(red red: Double, green: Double, blue: Double, alpha: Double) {
public func setSourceColor(red: Double, green: Double, blue: Double, alpha: Double) {

cairo_set_source_rgba(internalPointer, red, green, blue, alpha)
}
Expand Down Expand Up @@ -128,7 +128,7 @@ public final class Context {
}

/// Adds a closed sub-path rectangle of the given size to the current path at position (x , y ) in user-space coordinates.
public func addRectangle(x x: Double, y: Double, width: Double, height: Double) {
public func addRectangle(x: Double, y: Double, width: Double, height: Double) {

cairo_rectangle(internalPointer, x, y, width, height)
}
Expand Down
2 changes: 0 additions & 2 deletions Sources/Cairo/Path.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public final class Path {

internal init(_ internalPointer: UnsafeMutablePointer<cairo_path_t>) {

assert(internalPointer != nil)

self.internalPointer = internalPointer
}
}
6 changes: 2 additions & 4 deletions Sources/Cairo/Pattern.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public final class Pattern {

// MARK: - Internal Properties

internal var internalPointer: COpaquePointer
internal var internalPointer: OpaquePointer

// MARK: - Initialization

Expand All @@ -24,9 +24,7 @@ public final class Pattern {
cairo_pattern_destroy(internalPointer)
}

internal init(_ internalPointer: COpaquePointer) {

assert(internalPointer != nil, "Internal pointer must not be nil")
internal init(_ internalPointer: OpaquePointer) {

self.internalPointer = internalPointer
}
Expand Down
10 changes: 3 additions & 7 deletions Sources/Cairo/Surface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@ public final class Surface {

// MARK: - Internal Properties

internal var internalPointer: COpaquePointer
internal var internalPointer: OpaquePointer

// MARK: - Initialization

deinit {

assert(internalPointer != nil, "Internal pointer of deallocating object is nil")

cairo_surface_destroy(internalPointer)
}

internal init(_ internalPointer: COpaquePointer) {

assert(internalPointer != nil, "Internal pointer is nil")

internal init(_ internalPointer: OpaquePointer) {

self.internalPointer = internalPointer
}

Expand Down

0 comments on commit cace3d0

Please sign in to comment.