<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/feed.xml" rel="self" type="application/atom+xml" /><link href="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/" rel="alternate" type="text/html" /><updated>2019-08-13T18:14:49+00:00</updated><id>https://sfanxiang.github.io/gsoc-2019/gsoc-2019/feed.xml</id><title type="html">GSoC 2019 Blogs</title><subtitle>Xiang Fan</subtitle><entry><title type="html">gtk4-rs: GTK 4 Rust Bindings Final Report</title><link href="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/08/12/post-6.html" rel="alternate" type="text/html" title="gtk4-rs: GTK 4 Rust Bindings Final Report" /><published>2019-08-12T00:00:00+00:00</published><updated>2019-08-12T00:00:00+00:00</updated><id>https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/08/12/post-6</id><content type="html" xml:base="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/08/12/post-6.html">&lt;p&gt;This is the final report on &lt;a href=&quot;https://summerofcode.withgoogle.com/projects/#5172521249275904&quot;&gt;GTK 4 Rust Bindings&lt;/a&gt;. You can find project links and repositories on &lt;a href=&quot;https://sfanxiang.github.io/gsoc-2019/about/&quot;&gt;the about page&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;describe-my-work-briefly&quot;&gt;Describe my work briefly&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Add Rust support to the gtk4 toolkit, including
    &lt;ul&gt;
      &lt;li&gt;gtk4&lt;/li&gt;
      &lt;li&gt;gsk4&lt;/li&gt;
      &lt;li&gt;gdk4&lt;/li&gt;
      &lt;li&gt;graphene&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Port gtk3 Rust examples to gtk4.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;what-is-done&quot;&gt;What is done&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;gtk4-rs: &lt;a href=&quot;https://github.com/gtk-rs/gtk4&quot;&gt;https://github.com/gtk-rs/gtk4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The is the main API for gtk4 software development. Changes in gtk4 are reflected here, including new layout managers, deprecation of child properties, and new/removed widgets.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;gsk4-rs: &lt;a href=&quot;https://github.com/gtk-rs/gsk4&quot;&gt;https://github.com/gtk-rs/gsk4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The new GTK Scene Kit API callable from Rust, featuring the extensive render nodes type system highlighted in previous posts.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;gdk4-rs: &lt;a href=&quot;https://github.com/gtk-rs/gdk4&quot;&gt;https://github.com/gtk-rs/gdk4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;gdk4 has undergone a lot of changes since its last version, with refined interaction between gtk. It’s overhauled event system was specially bound in Rust too.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;graphene-rs: &lt;a href=&quot;https://github.com/gtk-rs/graphene&quot;&gt;https://github.com/gtk-rs/graphene&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;examples: &lt;a href=&quot;https://github.com/sfanxiang/gtk-rs-examples4&quot;&gt;https://github.com/sfanxiang/gtk-rs-examples4&lt;/a&gt; (will be upstreamed)&lt;/li&gt;
  &lt;li&gt;Low-level, unsafe bindings: &lt;a href=&quot;https://github.com/gtk-rs/sys/pull/145&quot;&gt;https://github.com/gtk-rs/sys/pull/145&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Automatic creation of gtk4 dependency bundle: &lt;a href=&quot;https://github.com/sfanxiang/gtk-bootstrap&quot;&gt;https://github.com/sfanxiang/gtk-bootstrap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;future-work&quot;&gt;Future work&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Improve Rust-specific documentation in https://github.com/gtk-rs/lgpl-docs.&lt;/li&gt;
  &lt;li&gt;More bindings. There’s always more we can do.&lt;/li&gt;
  &lt;li&gt;CI support for OSX and Windows.&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><summary type="html">This is the final report on GTK 4 Rust Bindings. You can find project links and repositories on the about page.</summary></entry><entry><title type="html">gtk4-rs: GTK 4 Rust Bindings Report 5</title><link href="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/08/02/post-5.html" rel="alternate" type="text/html" title="gtk4-rs: GTK 4 Rust Bindings Report 5" /><published>2019-08-02T00:00:00+00:00</published><updated>2019-08-02T00:00:00+00:00</updated><id>https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/08/02/post-5</id><content type="html" xml:base="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/08/02/post-5.html">&lt;p&gt;This is the fifth post in a series of reports on the progress of &lt;a href=&quot;https://summerofcode.withgoogle.com/projects/#5172521249275904&quot;&gt;GTK 4 Rust Bindings&lt;/a&gt;. You can find project links and repositories on &lt;a href=&quot;https://sfanxiang.github.io/gsoc-2019/about/&quot;&gt;the about page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Apart from preparing to upstream the crates, I’ve been keeping the shared code of gtk4-rs and gtk3-rs in sync and adding more types to gdk4-rs.&lt;/p&gt;

&lt;h2 id=&quot;merging-graphene-and-graphene-sys-in-one-repo&quot;&gt;Merging graphene and graphene-sys in one repo&lt;/h2&gt;

&lt;p&gt;The idea came from my mentor, Jordan Petridis. Managing graphene and graphene-sys in one place will make these relatively self-contained crates easier to maintain. A build system was set up for them. The graphene repo is now ready for upstreaming.&lt;/p&gt;

&lt;h2 id=&quot;additions-to-gdk4-rs&quot;&gt;Additions to gdk4-rs&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;ContentDeserializer&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;ContentDeserializer&lt;/code&gt;, along with their helper functions, are implemented.&lt;/li&gt;
  &lt;li&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;Event&lt;/code&gt; typing system is implemented. It was determined from gdk4 source code whether a method applies to a subtype.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;rebasing-examples&quot;&gt;Rebasing examples&lt;/h2&gt;

&lt;p&gt;A lot of changes after gtk4 examples branched were merged to gtk4 examples. New examples from upstream, namely &lt;code class=&quot;highlighter-rouge&quot;&gt;builders&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;clipboard_simple&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;entry_completion&lt;/code&gt;, are implemented in gtk4.&lt;/p&gt;</content><author><name></name></author><summary type="html">This is the fifth post in a series of reports on the progress of GTK 4 Rust Bindings. You can find project links and repositories on the about page.</summary></entry><entry><title type="html">gtk4-rs: GTK 4 Rust Bindings Report 4</title><link href="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/07/19/post-4.html" rel="alternate" type="text/html" title="gtk4-rs: GTK 4 Rust Bindings Report 4" /><published>2019-07-19T00:00:00+00:00</published><updated>2019-07-19T00:00:00+00:00</updated><id>https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/07/19/post-4</id><content type="html" xml:base="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/07/19/post-4.html">&lt;p&gt;This is the fourth post in a series of reports on the progress of &lt;a href=&quot;https://summerofcode.withgoogle.com/projects/#5172521249275904&quot;&gt;GTK 4 Rust Bindings&lt;/a&gt;. You can find project links and repositories on &lt;a href=&quot;https://sfanxiang.github.io/gsoc-2019/about/&quot;&gt;the about page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since the last post, the progress has been focused on adding in more objects to all of the gtk4 family. We’re also working to integrate gtk4 into the existing gtk-rs ecosystem, starting from &lt;code class=&quot;highlighter-rouge&quot;&gt;gir-files&lt;/code&gt;, the root dependency of all crates.&lt;/p&gt;

&lt;h2 id=&quot;upstreaming-builder-signals&quot;&gt;Upstreaming builder signals&lt;/h2&gt;

&lt;p&gt;Although the pull request is still under review, once it’s merged, we will be able to designate signal handlers in the builder file with &lt;code class=&quot;highlighter-rouge&quot;&gt;Builder::connect_signals()&lt;/code&gt;. Unlike the GModule magic often used in C, the Rust version asks you to provide a callback to map each handler name to the handler to avoid breaking safety guarantees. We also plan to add an example similar to &lt;a href=&quot;https://github.com/sfanxiang/gtk-rs-examples4/blob/6ee2e6b3087c01cdc3a766feafb3d5520cd8ca01/src/bin/builder_signal.rs&quot;&gt;this&lt;/a&gt; to demonstrate its use.&lt;/p&gt;

&lt;h2 id=&quot;additions-in-gdk4-rs&quot;&gt;Additions in gdk4-rs&lt;/h2&gt;

&lt;p&gt;The following are implemented:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;DrawContext::get_frame_region()
pango_layout_get_clip_region()
pango_layout_line_get_clip_region()
Surface::create_similar_surface()
Surface::set_opaque_region()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;cairo::Region&lt;/code&gt; is added to gdk4.&lt;/p&gt;

&lt;p&gt;GDK events in gdk4 have been made into opaque types. I’m working on a simple typing system for them, similar to the one created for &lt;code class=&quot;highlighter-rouge&quot;&gt;RenderNode&lt;/code&gt; in gsk4-rs.&lt;/p&gt;

&lt;h2 id=&quot;integration-with-gtk-rs&quot;&gt;Integration with gtk-rs&lt;/h2&gt;

&lt;p&gt;The ultimate goal of this project is, of course, to integrate all the work back into &lt;a href=&quot;https://gtk-rs.org/&quot;&gt;the gtk-rs ecosystem&lt;/a&gt;. The relevant gir files from gtk 3.96 (gtk4 development version) have been merged in &lt;a href=&quot;https://github.com/gtk-rs/gir-files/pull/39&quot;&gt;#39&lt;/a&gt;. The next step is to merge sys crates (low-level API) in &lt;a href=&quot;https://github.com/gtk-rs/sys/pull/145&quot;&gt;#145&lt;/a&gt;, and eventually upstream all the crates.&lt;/p&gt;</content><author><name></name></author><summary type="html">This is the fourth post in a series of reports on the progress of GTK 4 Rust Bindings. You can find project links and repositories on the about page.</summary></entry><entry><title type="html">gtk4-rs: GTK 4 Rust Bindings Report 3</title><link href="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/07/05/post-3.html" rel="alternate" type="text/html" title="gtk4-rs: GTK 4 Rust Bindings Report 3" /><published>2019-07-05T00:00:00+00:00</published><updated>2019-07-05T00:00:00+00:00</updated><id>https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/07/05/post-3</id><content type="html" xml:base="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/07/05/post-3.html">&lt;p&gt;This is the third post in a series of reports on the progress of &lt;a href=&quot;https://summerofcode.withgoogle.com/projects/#5172521249275904&quot;&gt;GTK 4 Rust Bindings&lt;/a&gt;. You can find project links and repositories on &lt;a href=&quot;https://sfanxiang.github.io/gsoc-2019/about/&quot;&gt;the about page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;gtk4-rs, by now, should be relatively complete, with a few remaining functions to manually investigate and implement. All additions listed below are imported to the other crates as well if needed.&lt;/p&gt;

&lt;h2 id=&quot;gtk4-rs&quot;&gt;gtk4-rs&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;AccelMap::foreach()&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;AccelMap::foreach_unfiltered()&lt;/code&gt; are implemented.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Actionable::set_action_target()&lt;/code&gt; is implemented and upstreamed to gtk3.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Builder::connect_signals_full()&lt;/code&gt; is implemented. This addition will make it possible to designate which signal handler to use in builder files. It’s planned to be upstreamed to gtk3 too.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Editable::delegate_get_property()&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;Editable::delegate_set_property()&lt;/code&gt; are implemented.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Text&lt;/code&gt; signals are implemented.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;gdk4-rs&quot;&gt;gdk4-rs&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Geometry&lt;/code&gt; is implemented.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;KeymapKey&lt;/code&gt; is implemented.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Rectangle&lt;/code&gt; is implemented and added to gtk4-rs.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;TimeCoord&lt;/code&gt; is implemented and added to gtk4-rs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;gsk4-rs&quot;&gt;gsk4-rs&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;ColorStop&lt;/code&gt; is implemented and added to gtk4-rs.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;RenderNode&lt;/code&gt; is implemented and added to gtk4-rs. It uses an &lt;em&gt;ad hoc&lt;/em&gt; subtyping system for different types of render nodes, similar to &lt;a href=&quot;https://github.com/gtk-rs/cairo/blob/804aad8b2fc00eaa99644bc03a381c7bd6a88d5c/src/patterns.rs&quot;&gt;cairo patterns&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;RoundedRect&lt;/code&gt; is implemented and added to gtk4-rs.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;Shadow&lt;/code&gt; is implemented and added to gtk4-rs.&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><summary type="html">This is the third post in a series of reports on the progress of GTK 4 Rust Bindings. You can find project links and repositories on the about page.</summary></entry><entry><title type="html">gtk4-rs: GTK 4 Rust Bindings Report 2</title><link href="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/06/21/post-2.html" rel="alternate" type="text/html" title="gtk4-rs: GTK 4 Rust Bindings Report 2" /><published>2019-06-21T00:00:00+00:00</published><updated>2019-06-21T00:00:00+00:00</updated><id>https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/06/21/post-2</id><content type="html" xml:base="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/06/21/post-2.html">&lt;p&gt;This is the second post in a series of reports on the progress of &lt;a href=&quot;https://summerofcode.withgoogle.com/projects/#5172521249275904&quot;&gt;GTK 4 Rust Bindings&lt;/a&gt;. You can find project links and repositories on &lt;a href=&quot;https://sfanxiang.github.io/gsoc-2019/about/&quot;&gt;the about page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This development cycle focuses on gtk4-rs itself, while I continue to add more objects from gdk4 and gsk4 where needed. Another highlight is setting up continuous integration.&lt;/p&gt;

&lt;h2 id=&quot;gtk4-rs&quot;&gt;gtk4-rs&lt;/h2&gt;

&lt;p&gt;The original plan for gtk4-rs includes adding some remaining objects that initially prevented gir codegen (mostly &lt;code class=&quot;highlighter-rouge&quot;&gt;missing memory management&lt;/code&gt;), but many of them turned out to be private objects, implementation details, or otherwise supposed to be used within C. Objects that are useful among them were implemented manually.&lt;/p&gt;

&lt;p&gt;Another part of the change is integrating existing manually-implemented bindings from gtk3. Despite differences between gtk3 and gtk4, they do share a considerable amount of code.&lt;/p&gt;

&lt;h2 id=&quot;continuous-integration&quot;&gt;Continuous Integration&lt;/h2&gt;

&lt;p&gt;It became neccessary to set up CI when the project structure began to stabilize. After some try-and-error, I enabled CI for linux targets with gtk 3.96 (pre-release version), and rust 1.34.0 (stable), beta, and nightly. Without the distro providing gtk4, the entire gtk dependencies are built from source and stored in this &lt;a href=&quot;https://github.com/sfanxiang/gtk-bootstrap&quot;&gt;repo&lt;/a&gt;. Apart from keeping the project coherent itself, CI also helps track upstream changes. Many errors were found immediately after it went up.&lt;/p&gt;

&lt;h2 id=&quot;misc&quot;&gt;Misc.&lt;/h2&gt;

&lt;p&gt;Other changes include retroactive bugfixes in gtk3-rs &amp;amp; gtk4-rs, and adapting to new upstream &lt;code class=&quot;highlighter-rouge&quot;&gt;Boxed&lt;/code&gt; models.&lt;/p&gt;</content><author><name></name></author><summary type="html">This is the second post in a series of reports on the progress of GTK 4 Rust Bindings. You can find project links and repositories on the about page.</summary></entry><entry><title type="html">gtk4-rs: GTK 4 Rust Bindings Report 1</title><link href="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/06/07/post-1.html" rel="alternate" type="text/html" title="gtk4-rs: GTK 4 Rust Bindings Report 1" /><published>2019-06-07T00:00:00+00:00</published><updated>2019-06-07T00:00:00+00:00</updated><id>https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/06/07/post-1</id><content type="html" xml:base="https://sfanxiang.github.io/gsoc-2019/gsoc-2019/2019/06/07/post-1.html">&lt;p&gt;Hi and welcome to my GSoC blog! This is the first post in a series of reports on the progress of &lt;a href=&quot;https://summerofcode.withgoogle.com/projects/#5172521249275904&quot;&gt;GTK 4 Rust Bindings&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The initial development is driven by making simple programs and existing examples work, so that we have a set of core features to develop from.&lt;/p&gt;

&lt;h2 id=&quot;examples&quot;&gt;Examples&lt;/h2&gt;

&lt;p&gt;You can find example gtk4-rs programs at &lt;a href=&quot;https://github.com/sfanxiang/gtk-rs-examples4&quot;&gt;https://github.com/sfanxiang/gtk-rs-examples4&lt;/a&gt;. It’s based on &lt;a href=&quot;https://github.com/gtk-rs/examples&quot;&gt;gtk-rs examples&lt;/a&gt;. Available examples include:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;accessibility
basic
builder_basics
cairotest
cairo_threads
clock
css
drag_and_drop
drag_and_drop_textview
grid
gtktest
listbox_model
list_store
menu_bar
menu_bar_system
multithreading_context
multi_windows
notebook
overlay
pango_attributes
progress_tracker
simple_treeview
sync_widgets
text_viewer
transparent_main_window
tree_model_sort
treeview
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;gtk4-rs&quot;&gt;gtk4-rs&lt;/h2&gt;

&lt;p&gt;The gtk4-rs repository is at &lt;a href=&quot;https://github.com/sfanxiang/gtk-rs-gtk4&quot;&gt;https://github.com/sfanxiang/gtk-rs-gtk4&lt;/a&gt;. Currently this is a work in progress. Changes here most closely follows upstream gtk4. If there’s anything special to point out, I’ll note it in a future post.&lt;/p&gt;

&lt;h2 id=&quot;graphene-rs&quot;&gt;graphene-rs&lt;/h2&gt;

&lt;p&gt;The repository is at &lt;a href=&quot;https://github.com/sfanxiang/gtk-rs-graphene&quot;&gt;https://github.com/sfanxiang/gtk-rs-graphene&lt;/a&gt;. It’s feature-complete, with the exception of simd4f and simd4x4f. These are C structures and do not use the glib model.&lt;/p&gt;</content><author><name></name></author><summary type="html">Hi and welcome to my GSoC blog! This is the first post in a series of reports on the progress of GTK 4 Rust Bindings.</summary></entry></feed>