<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Yes, we seem to have uncovered some....uhhhhh.....difficulties.<div><br></div><div>Was anyone else aware that stuff like this is a wild-goose chase until now?<br><br><div><hr id="stopSpelling">Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br>From: harlan@harlanhaskins.com<br>Date: Fri, 11 Dec 2015 22:38:42 -0500<br>CC: max.howell@apple.com; jackl@apple.com; swift-users@swift.org<br>To: gagemorgan@outlook.com<br><br><div>Gotta rename test.swift to main.swift, otherwise it'll try to compile it as a module.</div><div id="ecxAppleMailSignature"><br></div><div id="ecxAppleMailSignature">This seems to be unintuitive -- we should probably file some structural bug reports to make this process more straightforward.<br><br>Sent from my iPhone</div><div><br>On Dec 11, 2015, at 10:36 PM, Gage Morgan &lt;<a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a>&gt; wrote:<br><br></div><blockquote><div>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}

--></style>
<div dir="ltr">Just when I think I make a breakthrough...Cairo and CCairo build, but this test file separates methods from wrappers still won't:<div><br></div><div><div>Compiling Swift Module 'test' (1 sources)</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:4:1: error: expressions are not allowed at the top level</div><div>surface.scale(10.0, y: 10.0)</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:5:1: error: expressions are not allowed at the top level</div><div>surface.moveTo(29.0, y: 14.7)</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:6:1: error: expressions are not allowed at the top level</div><div>surface.lineTo(37.6, y: 13.0)</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:7:1: error: expressions are not allowed at the top level</div><div>surface.moveTo(37.6, y: 13.0)</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:8:1: error: expressions are not allowed at the top level</div><div>surface.lineTo(30.4, y: 22.2)</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:9:1: error: expressions are not allowed at the top level</div><div>surface.moveTo(30.4, y: 22.2)</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:10:1: error: expressions are not allowed at the top level</div><div>surface.lineTo(29.0, y: 14.7)</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:11:1: error: expressions are not allowed at the top level</div><div>surface.setLineWidth(0.1)</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:12:1: error: expressions are not allowed at the top level</div><div>surface.stroke()</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:13:1: error: expressions are not allowed at the top level</div><div>surface.surfaceWriteToPNG("boobs.png")</div><div>^</div><div>/home/mgage/swift-cairo-bindings/test/test.swift:3:15: error: use of unresolved identifier 'Surface'</div><div>let surface = Surface(format: CAIRO_FORMAT_ARGB32, width: 421, height: 410)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~~~</div><div>&lt;unknown&gt;:0: error: build had 1 command failures</div><div>swift-build: exit(1): ["/home/mgage/Downloads/swift/usr/bin/swift-build-tool", "-f", "/home/mgage/swift-cairo-bindings/test/.build/debug/test.o/llbuild.yaml"]</div><div><br></div><div>What is this "top level" thing? Not the first time I've seen it.</div><br><div><hr id="ecxstopSpelling">Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br>From: <a href="mailto:harlan@harlanhaskins.com">harlan@harlanhaskins.com</a><br>Date: Fri, 11 Dec 2015 22:30:25 -0500<br>CC: <a href="mailto:max.howell@apple.com">max.howell@apple.com</a>; <a href="mailto:jackl@apple.com">jackl@apple.com</a>; <a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>To: <a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a><br><br><div>Gotta make sure to make a git tag</div><div id="ecxAppleMailSignature"><br></div><div id="ecxAppleMailSignature">git tag 1.0.0</div><div id="ecxAppleMailSignature">git push --tags<br><br>Sent from my iPhone</div><div><br>On Dec 11, 2015, at 10:29 PM, Gage Morgan &lt;<a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a>&gt; wrote:<br><br></div><blockquote><div>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}


--></style>
<div dir="ltr">Okay, so I've gone in and noticed that yes, it does create a library. How do I use that? Dependency graph won't check out for some strange reason.<br><br><div><hr id="ecxstopSpelling">Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br>From: <a href="mailto:max.howell@apple.com">max.howell@apple.com</a><br>Date: Fri, 11 Dec 2015 19:02:41 -0800<br>CC: <a href="mailto:jackl@apple.com">jackl@apple.com</a>; <a href="mailto:swift-users@swift.org">swift-users@swift.org</a>; <a href="mailto:harlan@harlanhaskins.com">harlan@harlanhaskins.com</a><br>To: <a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a><br><br><div></div><div>Your Cairo module is an executable and not a library. Don't call files main.swift for libraries.</div><div><br></div><div>I'll open a ticket to ensure swift build warns for this in future.</div><div><br>On Dec 11, 2015, at 6:54 PM, Gage Morgan &lt;<a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a>&gt; wrote:<br><br></div><blockquote><div>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}


--></style>
<div dir="ltr">Here's what is inhibited when using swift build -v:<div><br><div><div>mgage@mgage:~/swift-cairo-bindings/test$ swift build -v</div><div>/home/mgage/Downloads/swift/usr/bin/swiftc -o /home/mgage/swift-cairo-bindings/test/.build/debug/test /home/mgage/swift-cairo-bindings/test/.build/debug/test.o/main.swift.o -g -L/usr/local/lib</div><div>/home/mgage/swift-cairo-bindings/test/.build/debug/test.o/main.swift.o: In function `main':</div><div>/home/mgage/swift-cairo-bindings/test/main.swift:4: undefined reference to `_TMaC5Cairo7Surface'</div><div>/home/mgage/swift-cairo-bindings/test/main.swift:4: undefined reference to `_TFC5Cairo7SurfaceCfT6formatVSC13_cairo_format5widthSi6heightSi_S0_'</div><div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div><div>&lt;unknown&gt;:0: error: link command failed with exit code 1 (use -v to see invocation)</div><div>&lt;unknown&gt;:0: error: build had 1 command failures</div><div>swift-build: exit(1): ["/home/mgage/Downloads/swift/usr/bin/swift-build-tool", "-v", "-f", "/home/mgage/swift-cairo-bindings/test/.build/debug/test.o/llbuild.yaml"]</div><div><br></div><div>I'm going to attempt to create a repo, but GitHub and I don't always get along ;)</div><div><br></div><br><div><hr id="ecxstopSpelling">Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br>From: <a href="mailto:max.howell@apple.com">max.howell@apple.com</a><br>Date: Fri, 11 Dec 2015 18:51:09 -0800<br>CC: <a href="mailto:jackl@apple.com">jackl@apple.com</a>; <a href="mailto:swift-users@swift.org">swift-users@swift.org</a>; <a href="mailto:harlan@harlanhaskins.com">harlan@harlanhaskins.com</a><br>To: <a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a><br><br><div></div><div>The link failure is for the constructor for your Cairo class.</div><div><br></div><div>I'll have to test this out myself. Can't for a few hours at least.</div><div><br></div><div>In the mean time try `swift build -v` for some more information.</div><div><br>On Dec 11, 2015, at 6:42 PM, Gage Morgan via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br><br></div><blockquote><div>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}


--></style>
<div dir="ltr">I have no idea what happened here, but:<div><br></div><div><div>Cloning Packages/CCairo</div><div>Cloning Packages/Cairo</div><div>Compiling Swift Module 'Cairo' (1 sources)</div><div>Linking Executable: &nbsp;.build/debug/Cairo</div><div>Compiling Swift Module 'test' (1 sources)</div><div>Linking Executable: &nbsp;.build/debug/test</div><div>/home/mgage/swift-cairo-bindings/test/.build/debug/test.o/main.swift.o: In function `main':</div><div>/home/mgage/swift-cairo-bindings/test/main.swift:4: undefined reference to `_TMaC5Cairo7Surface'</div><div>/home/mgage/swift-cairo-bindings/test/main.swift:4: undefined reference to `_TFC5Cairo7SurfaceCfT6formatVSC13_cairo_format5widthSi6heightSi_S0_'</div><div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div><div>&lt;unknown&gt;:0: error: link command failed with exit code 1 (use -v to see invocation)</div><div>&lt;unknown&gt;:0: error: build had 1 command failures</div><div>swift-build: exit(1): ["/home/mgage/Downloads/swift/usr/bin/swift-build-tool", "-f", "/home/mgage/swift-cairo-bindings/test/.build/debug/test.o/llbuild.yaml"]</div><div><br></div><div>I've made everything public, and I think the initializer needs to be public or something like that. That said, I have no idea what I need to do for this to work. Deinit doesn't seem to want to be public, so leaving that alone. I need to know why the reference to Surface won't come up.</div><div><br></div><div>Here's the bits for the actual Cairo module (wrappings, etc.) and all:</div><div><a href="https://gist.github.com/anonymous/72c4d2db7953c0d832c7" target="_blank">https://gist.github.com/anonymous/72c4d2db7953c0d832c7</a></div><div><br></div><div>And this is the one in the "test" directory where I'm trying to get the methods in the above file to work without complaint outside of the directory:</div><div><a href="https://gist.github.com/anonymous/11691be627d619066b8b" target="_blank">https://gist.github.com/anonymous/11691be627d619066b8b</a></div><div><br></div><div>I'm hoping someone can tell me what I'm doing wrong, because I'm trying to do whatever possible. Also, I did upgrade the Swift components earlier when released.</div><br><div><hr id="ecxstopSpelling">To: <a href="mailto:jackl@apple.com">jackl@apple.com</a><br>Date: Fri, 11 Dec 2015 21:21:06 -0500<br>CC: <a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br>From: <a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br><br>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}


--></style>
<div dir="ltr">I'm going to. Now, does this mean anything labelled func inside the struct needs tacked on as well?<br><br><div><hr id="ecxstopSpelling">Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br>From: <a href="mailto:jackl@apple.com">jackl@apple.com</a><br>Date: Fri, 11 Dec 2015 18:19:55 -0800<br>CC: <a href="mailto:harlan@harlanhaskins.com">harlan@harlanhaskins.com</a>; <a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>To: <a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a><br><br>Did you make the class and its methods public?<div><br></div><div>Jack<br><div><blockquote><div>On Dec 11, 2015, at 6:16 PM, Gage Morgan &lt;<a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a>&gt; wrote:</div><br class="ecxApple-interchange-newline"><div><div dir="ltr" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">Here's what I'm getting:<div><br></div><div><div>/home/mgage/swift-cairo-bindings/test/main.swift:4:15: error: module 'Cairo' has no member named 'Surface'</div><div>let surface = Cairo.Surface(format: CAIRO_FORMAT_ARGB32, width: 421, height: 410)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^~~~~ ~~~~~~~</div><div>&lt;unknown&gt;:0: error: build had 1 command failures</div><div><br></div><div>So what I'm trying to do is to put all wrappings in a separate module named Cairo. Then, I want to use those methods outside of the module named Cairo. I renamed the class to Surface and fixed all references, but for some reason it keeps saying something about Surface not present. I need to look into whether a git repo may be needed.</div><br><div><hr id="ecxstopSpelling">Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br>From: <a href="mailto:harlan@harlanhaskins.com">harlan@harlanhaskins.com</a><br>Date: Fri, 11 Dec 2015 20:31:20 -0500<br>CC: <a href="mailto:jackl@apple.com">jackl@apple.com</a>; <a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>To: <a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a><br><br>Nope, but you’ll need a way to specify the class inside the module (the fully-qualified type name)<div><br></div><div><font face="Menlo">Cairo.Cairo</font><span class="ecxApple-converted-space">&nbsp;</span>should work fine.</div><div><br><div><blockquote><div>On Dec 11, 2015, at 8:14 PM, Gage Morgan &lt;<a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a>&gt; wrote:</div><br class="ecxApple-interchange-newline"><div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">The module is Cairo. Do I need to change something (I'm assuming by struct you mean the name of the class containing wrappings). The class is named Cairo as well. Could renaming the module to ModCairo fix this?<br><br><div class="ecxacompli_signature">Sent from<span class="ecxApple-converted-space">&nbsp;</span><a href="https://aka.ms/qtex0l" target="_blank">Outlook Mobile</a></div><br></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><div class="ecxgmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">On Fri, Dec 11, 2015 at 5:11 PM -0800, "Harlan Haskins"<span class="ecxApple-converted-space">&nbsp;</span><span dir="ltr">&lt;<a href="mailto:harlan@harlanhaskins.com" target="_blank">harlan@harlanhaskins.com</a>&gt;</span><span class="ecxApple-converted-space">&nbsp;</span>wrote:<br><br></div><div dir="auto" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><div>Is your struct named Cairo or Surface?</div><div id="ecxx_AppleMailSignature"><br></div><div id="ecxx_AppleMailSignature">If Cairo is the module name, you're trying to instantiate the module.<br><br></div><div id="ecxx_AppleMailSignature">- Harlan</div><div><br>On Dec 11, 2015, at 7:55 PM, Gage Morgan &lt;<a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a>&gt; wrote:<br><br></div><blockquote><div><div dir="ltr"><span style="font-size:15px;line-height:21.3px;background-color:rgb(255, 255, 255);">How would you use things like cairo.moveTo() outside of the wrapping file? I've gone as far as writing a module named "Cairo," taking the methods as mentioned above out, and moving them to their own directory "tests." I have added "Cairo" as a dependency for "tests," but there appears to be something wrong when I try to call:</span><div style="line-height:21.3px;font-size:15px;background-color:rgb(255, 255, 255);"><br style="line-height:21.3px;"></div><div style="line-height:21.3px;font-size:15px;background-color:rgb(255, 255, 255);">let cairo = Cairo(format: CAIRO_FORMAT_ARGB32, width: 421, height: 410)</div><div style="line-height:21.3px;font-size:15px;background-color:rgb(255, 255, 255);"><br style="line-height:21.3px;"></div><div style="line-height:21.3px;font-size:15px;background-color:rgb(255, 255, 255);">Why can I not call Cairo()? The error:</div><div style="line-height:21.3px;font-size:15px;background-color:rgb(255, 255, 255);"><br style="line-height:21.3px;"></div><div style="line-height:21.3px;font-size:15px;background-color:rgb(255, 255, 255);"><div style="line-height:21.3px;">Compiling Swift Module 'test' (1 sources)</div><div style="line-height:21.3px;">/home/mgage/swift-cairo-bindings/test/main.swift:4:18: error: cannot call value of non-function type 'module&lt;Cairo&gt;'</div><div style="line-height:21.3px;">let cairo = Cairo(format: CAIRO_FORMAT_ARGB32, width: 421, height: 410)</div><div style="line-height:21.3px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ~~~~~^</div><div style="line-height:21.3px;">&lt;unknown&gt;:0: error: build had 1 command failures</div><div style="line-height:21.3px;">swift-build: exit(1): ["/home/mgage/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin/swift-build-tool", "-f", "/home/mgage/swift-cairo-bindings/test/.build/debug/test.o/llbuild.yaml"]</div><div style="line-height:21.3px;"><br></div><div style="line-height:21.3px;">I don't know whether or not I want to translate methods into straight-up properties yet.</div><div style="line-height:21.3px;"><br style="line-height:21.3px;"></div><div style="line-height:21.3px;">Thanks, support here has been great so far. Cheers!</div><div style="line-height:21.3px;">--MGage--</div><div><br></div></div><br><div><hr id="ecxx_stopSpelling">Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br>From:<span class="ecxApple-converted-space">&nbsp;</span><a href="mailto:harlan@harlanhaskins.com">harlan@harlanhaskins.com</a><br>Date: Fri, 11 Dec 2015 19:35:46 -0500<br>CC:<span class="ecxApple-converted-space">&nbsp;</span><a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a>;<span class="ecxApple-converted-space">&nbsp;</span><a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>To:<span class="ecxApple-converted-space">&nbsp;</span><a href="mailto:jackl@apple.com">jackl@apple.com</a><br><br><div>I considered that but couldn't find a cairo_get_font_scale function quickly to complement the setter<span class="ecxApple-converted-space">&nbsp;</span><img src="https://a.gfx.ms/emoji_1F605.png" class="ecxx_Emoji$1F605$AD4 ecxx_RenderedEmoji" title="Smiling face with open mouth and cold sweat" alt="Smiling face with open mouth and cold sweat"></div><div id="ecxx_ecxAppleMailSignature"><br></div><div id="ecxx_ecxAppleMailSignature">But yes, a full wrapper would transparently handle getting and setting.<br><br></div><div id="ecxx_ecxAppleMailSignature">- Harlan</div><div><br>On Dec 11, 2015, at 7:28 PM, Jack Lawrence &lt;<a href="mailto:jackl@apple.com">jackl@apple.com</a>&gt; wrote:<br><br></div><blockquote><div>For getter-setter pairs like `setLineWidth`, you might consider turning them into properties:<div><br></div><div><span style="font-family:Calibri;font-size:16px;">cairo.setLineWidth(0.1) // old</span></div><div><span style="font-family:Calibri;font-size:16px;">cairo.lineWidth = 0.1 // new</span></div><div><div><br><div><blockquote><div>On Dec 11, 2015, at 4:22 PM, Gage Morgan via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:</div><br class="ecxx_ecxApple-interchange-newline"><div><div dir="ltr" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">Harlan,<div><br></div><div>The answer is yes. I even managed to get a couple you didn't list on my own:</div><div><br></div><div><div>let cairo = Cairo(format: CAIRO_FORMAT_ARGB32, width: 421, height: 410)</div><div>cairo.scale(10.0, y: 10.0)</div><div>cairo.moveTo(29.0, y: 14.7)</div><div>cairo.lineTo(37.6, y: 13.0)</div><div>cairo.moveTo(37.6, y: 13.0)</div><div>cairo.lineTo(30.4, y: 22.2)</div><div>cairo.moveTo(30.4, y: 22.2)</div><div>cairo.lineTo(29.0, y: 14.7)</div><div>cairo.setLineWidth(0.1)</div><div>cairo.stroke()</div><div>cairo.surfaceWriteToPNG("boobs.png")</div><div><br></div><div>Swift is both really neat and really frustrating when learning it.&nbsp;</div><br><div><hr id="ecxx_ecxstopSpelling">Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br>From:<span class="ecxx_ecxApple-converted-space">&nbsp;</span><a href="mailto:harlan@harlanhaskins.com">harlan@harlanhaskins.com</a><br>Date: Fri, 11 Dec 2015 17:21:38 -0500<br>CC:<span class="ecxx_ecxApple-converted-space">&nbsp;</span><a href="mailto:kwame.bryan@gmail.com">kwame.bryan@gmail.com</a>;<span class="ecxx_ecxApple-converted-space">&nbsp;</span><a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>To:<span class="ecxx_ecxApple-converted-space">&nbsp;</span><a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a><br><br>Gage,<div><br></div><div>Sorry, I just got back from class.</div><div><br></div><div>I’ll respond in line!</div><div><br><div><blockquote><div>On Dec 11, 2015, at 5:09 PM, Gage Morgan &lt;<a href="mailto:gagemorgan@outlook.com">gagemorgan@outlook.com</a>&gt; wrote:</div><br class="ecxx_ecxApple-interchange-newline"><div><div><div>Harlan,</div><div><br></div><div>I read on<span class="ecxx_ecxApple-converted-space">&nbsp;</span><a dir="ltr" href="http://cairographics.org/" target="_blank">cairographics.org</a><span class="ecxx_ecxApple-converted-space">&nbsp;</span>about bindings awhile back. I think they want cairo, not surface, so we would have something like:</div><div><br></div><div>let cairo = Surface(format: CAIRO_FORMAT_ARGB32, width: 240, height: 80)</div><div>cairo.setFontFace("serif", weight: CAIRO_FONT_WEIGHT_BOLD)</div><div>cairo.setFontSize(32.0)</div><div>cairo.setSourceRGB(0.0, g: 0.0, b: 1.0)</div><div>cairo.moveTo(x: 10, y: 50)</div><div>cairo.showText("Hello, World!")</div><div>cairo.writeToPNG("hello.png")</div><div><br></div><div>Would this work the same as before without "surface" but instead "cairo”?<br></div></div></div></blockquote><div><br></div><div>Absolutely! That’s just a variable name — it could be called ‘puppies’, though that’s not very readable.</div><br><blockquote><div><div><div><br><div class="ecxx_ecxacompli_signature">Sent from<span class="ecxx_ecxApple-converted-space">&nbsp;</span><a href="https://aka.ms/qtex0l" target="_blank">Outlook Mobile</a></div><br></div><br><br><br><div class="ecxx_ecxgmail_quote">On Fri, Dec 11, 2015 at 2:00 PM -0800, "Gage Morgan via swift-users"<span class="ecxx_ecxApple-converted-space">&nbsp;</span><span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span><span class="ecxx_ecxApple-converted-space">&nbsp;</span>wrote:<br><br></div><div><div>I went and looked at it, and even now it looks like I want to take every function I've used in Cairo and translate it to Swift. Swift is such a...simple language compared to everything else. That being said, as a result of the specs, it is also much more verbose in terms of writing the code. Compared to other languages, it is written out instead of shoved onto a few lines.&nbsp;</div><div><br></div><div>Is there a way to import modules into other modules? Because it looks like a weekend project that will eventually get posted by myself at<span class="ecxx_ecxApple-converted-space">&nbsp;</span><a href="http://github.com/Christoffen-Corporation" target="_blank">http://github.com/Christoffen-Corporation</a>.&nbsp;<br><br><div class="ecxx_ecxx_acompli_signature">Sent from<span class="ecxx_ecxApple-converted-space">&nbsp;</span><a href="https://aka.ms/qtex0l" target="_blank">Outlook Mobile</a></div></div></div></div></div></blockquote><div><br></div><div>I’d recommend having a look at the Swift package manager example again —&nbsp;<a href="https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md" target="_blank">https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md</a></div><div><br></div><div>There’s an example of using those modules together.</div><br><blockquote><div><div><div><br><div class="ecxx_ecxx_gmail_quote">On Fri, Dec 11, 2015 at 1:52 PM -0800, "Gage Morgan via swift-users"<span class="ecxx_ecxApple-converted-space">&nbsp;</span><span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span><span class="ecxx_ecxApple-converted-space">&nbsp;</span>wrote:<br><br></div><div><div>I meant the code posted in the Gist link above. I don't know jack squat about qsort. I'm hoping that if I can reverse-engineer code already produced, I can apply it to other parts of Cairo.&nbsp;<br><br><div class="ecxx_ecxx_x_acompli_signature">Sent from<span class="ecxx_ecxApple-converted-space">&nbsp;</span><a href="https://aka.ms/qtex0l" target="_blank">Outlook Mobile</a></div></div></div></div></div></div></blockquote><div><br></div><div>I’ll go ahead and comment it, but I think it’s simplistic enough that it should be readable with a grasp of some Swift concepts. Perhaps it’s a good idea to look through The Swift Programming Language to figure out some of the constructs I used — they’re fairly basic constructs.</div><br><blockquote><div><div><div><div><br><div class="ecxx_ecxx_x_gmail_quote">On Fri, Dec 11, 2015 at 1:34 PM -0800, "Kwame Bryan"<span dir="ltr">&lt;<a href="mailto:kwame.bryan@gmail.com" target="_blank">kwame.bryan@gmail.com</a>&gt;</span><span class="ecxx_ecxApple-converted-space">&nbsp;</span>wrote:<br><br></div><div style="word-wrap:break-word;">Tutorial on the subject.&nbsp;<a href="http://chris.eidhof.nl/posts/swift-c-interop.html" target="_blank">http://chris.eidhof.nl/posts/swift-c-interop.html</a>&nbsp;<div><br></div><div>Regards</div><div>Kwame</div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=-2FcgwiRAxmHDdptrhrsAJKMBtNqQpWV-2BwUfjpvH9AIapmo3-2BHsnvTus94jzsAd9QbgrzJUOBMUGL1vbZcJzhtyVp8DdIXzqymeEFv78CU98Vyvkel-2BZ9jAScwY1YDPFzrfK4k0wzAL0RYvODDsxuakhZXZY7WUvtIDD6jT8hO1G12IjFAP4zcPGisA85WWuoE0N2vgQ90Wpd69-2B1PAy-2FgJ6kuPbhfqVCSq9RdDYqcqzU-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0px !important;padding:0px !important;"></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=-2FcgwiRAxmHDdptrhrsAJKMBtNqQpWV-2BwUfjpvH9AIapEPR-2FCXY9amYXSxN3Pbi2XrZMfHEN794BjyOKzqKEN1I5HM69Lqapv6DjsA6FzE8d9q3N3v71RBohhpxfFJmwu-2FppXm9-2F5fp7k5-2B6DDHtFIR52wVygcHpVKdRV8liNPtLvkthJRTxyuxSppBSc-2BI5r-2B9L8DyZNdiOAXPmJzd91Fd8lk3drIZ4JVKfkyoAcyrw-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0px !important;padding:0px !important;"></div></div><span id="ecxx_ecxcid:CAD42AA7-159A-44FE-8B20-00668767F2BB@student.rit.edu.">&lt;Mail Attachment.txt&gt;</span><span id="ecxx_ecxcid:0E99C342-6109-49EF-9D11-9ADA11D25B61@student.rit.edu.">&lt;Mail Attachment.txt&gt;</span></div></blockquote></div><br></div></div></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=fPHCHxM8OEqkFI0LoY8YMuXDKRTx6ILsXcJMmyHEOCK1g2WPDrZyFsR7DLDlbrRiEA6-2FGdzFprAFvdEcY7UBE0x-2BFtj95YctjkpAVfe-2Bq7SV4xEdQv70imgp6XrHB8UEaqlZ4BYO9LAYgBuaTOwze-2B3ZnRJhC4BIQTgABw48xeW5yEF4z8bM-2F5EoYoKcqCRXbycyP-2Frx8zSSDmVf9vC2vt-2BHI1Qh6R8GHcjxzdgIsXQ-3D" alt="" width="1" height="1" border="0" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;height:1px !important;width:1px !important;border-width:0px !important;padding:0px !important;"><span style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline !important;"><span class="ecxx_ecxApple-converted-space">&nbsp;</span></span><span style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline !important;">_______________________________________________</span><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><span style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline !important;">swift-users mailing list</span><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><a href="mailto:swift-users@swift.org" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">swift-users@swift.org</a><br style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;"><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank" style="font-family:Calibri;font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;">https://lists.swift.org/mailman/listinfo/swift-users</a></div></blockquote></div></div></div></div></blockquote></div></div></div></blockquote></div></div></blockquote></div></div></div></div></div></div></blockquote></div><br></div></div>                                               </div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=-2FcgwiRAxmHDdptrhrsAJKMBtNqQpWV-2BwUfjpvH9AIar0YVIZALj1v8fawqyXMOyB119hS-2BosMCwE68uzAQhhr3dyG36NJPc4UdAZE6btJ1O6A2DXNqsQI2nWhLzdphYOEOYn5JsUKMyNdVF1GEnN9-2BKrzcGvPPFRknFScMabtK-2F2t5dgk5zhkYBGqx2Nxo6IXG9PnnY9FpNiljgYRtsfcIbKBuKOfjaIWEs4Jg6Xp9g-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;">


<br>_______________________________________________
swift-users mailing list
<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a></div></div>                                               </div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=cbMbdH1LnH6O78Q-2BHw3jtU8ikibH470Fh9meAJKpwSodoCK5h0Ej9bJNro-2BI8fvCMei8ePlf-2BB-2FYeYsh6PQfVA-2BrjyY4B021bZAtIhd3qR8kmeWlJFl-2B46FMYPFoA6M-2BAf-2FSSU00UDpsNHN45pEQaid7dQw4fFkcXYlXVXBOIWoOK6XxrmEINMusQEcz7v3mRiCecKBDRw8b7-2F2MN3VNFqkwiQk1qR-2Fy31JdKg1qfFE-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;">


</div></blockquote><blockquote><div><span>_______________________________________________</span><br><span>swift-users mailing list</span><br><span><a href="mailto:swift-users@swift.org">swift-users@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a></span><br></div></blockquote></div></div></div>                                               </div>
</div></blockquote></div>                                               </div>
</div></blockquote></div></div>                                               </div>
</div></blockquote></div></div>                                               </div></body>
</html>