diff --git a/README.md b/README.md index 250dd2cb6..093a672b3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # The gtk-rs.org site The site is hosted on [GitHub Pages](https://pages.github.com/) powered by -[Jekyll](http://jekyllrb.com/). +[Jekyll](https://jekyllrb.com/). When authoring any changes you can try them out locally by running (requires ruby): diff --git a/_config.yml b/_config.yml index 8925a539b..ee84c9c89 100644 --- a/_config.yml +++ b/_config.yml @@ -3,7 +3,7 @@ title: Gtk-rs description: > # this means to ignore newlines until "baseurl:" Rust bindings for GTK+ and GLib-based libraries baseurl: "" # the subpath of your site, e.g. /blog/ -url: "http://gtk-rs.org" # the base hostname & protocol for your site +url: "https://gtk-rs.org" # the base hostname & protocol for your site github_username: gtk-rs permalink: /blog/:year/:month/:day/:title.html authors: diff --git a/_posts/2015-11-28-safety-first.md b/_posts/2015-11-28-safety-first.md index 1132bb0fb..02e167040 100644 --- a/_posts/2015-11-28-safety-first.md +++ b/_posts/2015-11-28-safety-first.md @@ -33,7 +33,7 @@ marked accordingly and need someone to pick them up. We've realized that we can't take the documentation from an LGPL licensed library and just slip it into an MIT-licensed one. Consequently we had to move almost all doc comments into a [separate repo][doc-comments]. We will keep -maintaining [online documentation](http://gtk-rs.org/docs-src/) and +maintaining [online documentation](https://gtk-rs.org/docs-src/) and **@GuillaumeGomez** is working on a tool, that will allow to put the doc comments back locally. diff --git a/_posts/2017-03-04-new-crates-version.md b/_posts/2017-03-04-new-crates-version.md index 6eceba21c..eb4df7244 100644 --- a/_posts/2017-03-04-new-crates-version.md +++ b/_posts/2017-03-04-new-crates-version.md @@ -16,7 +16,7 @@ Now, instead of having to write: ```rust let about_dialog = AboutDialog::new(); -about_dialog.set_website(Some("http://gtk-rs.org/blog/")); +about_dialog.set_website(Some("https://gtk-rs.org/blog/")); about_dialog.set_website(None); ``` @@ -25,7 +25,7 @@ You can write: ```rust let about_dialog = AboutDialog::new(); -about_dialog.set_website("http://gtk-rs.org/blog/"); // `Some` isn't need anymore +about_dialog.set_website("https://gtk-rs.org/blog/"); // `Some` isn't need anymore about_dialog.set_website(None); ``` diff --git a/docs-src/tutorial/cross.md b/docs-src/tutorial/cross.md index be163176e..a3dca44bc 100644 --- a/docs-src/tutorial/cross.md +++ b/docs-src/tutorial/cross.md @@ -30,7 +30,7 @@ The mingw packages are in the AUR, you can either install manually or use a help If you can't find gtk precompiled dll, you can follow these steps: -1. Download the 64 bit version of the latest precompiled gtk libraries from [here](http://win32builder.gnome.org/). +1. Download the 64 bit version of the latest precompiled gtk libraries from [here](https://win32builder.gnome.org/). 2. Unzip it in a folder. For example, to install it in `/opt/gtkwin`: `mkdir /opt/gtkwin;unzip -d /opt/gtkwin`. 3. You have to set-up the library to match the installation folder: @@ -151,7 +151,7 @@ edit /wherever/release/share/gtk-3.0/settings.ini gtk-font-name = Segoe UI 10 gtk-xft-rgba = rgb -then download the windows 10 them from http://b00merang.weebly.com/windows-10.html. +then download the windows 10 them from [https://b00merang.weebly.com/windows-10.html](https://b00merang.weebly.com/windows-10.html). unzip Windows-10-master.zip mv Windows-10-master /wherever/release/share/themes/Windows10 diff --git a/docs-src/tutorial/glade.md b/docs-src/tutorial/glade.md index 518c0ad5e..531ed0297 100644 --- a/docs-src/tutorial/glade.md +++ b/docs-src/tutorial/glade.md @@ -72,7 +72,7 @@ There isn't much to explain in here. If you don't know how to use [Glade](https: ``` -So in this file, we created a [`Window`](http://gtk-rs.org/docs/gtk/struct.Window.html) containing a [`Button`](http://gtk-rs.org/docs/gtk/struct.Button.html), as simple as that. It also created a [`MessageDialog`](http://gtk-rs.org/docs/gtk/struct.MessageDialog.html) containing a message and a [`Label`](http://gtk-rs.org/docs/gtk/struct.Label.html). Like I said, quite simple. +So in this file, we created a [`Window`](https://gtk-rs.org/docs/gtk/struct.Window.html) containing a [`Button`](https://gtk-rs.org/docs/gtk/struct.Button.html), as simple as that. It also created a [`MessageDialog`](https://gtk-rs.org/docs/gtk/struct.MessageDialog.html) containing a message and a [`Label`](https://gtk-rs.org/docs/gtk/struct.Label.html). Like I said, quite simple. Now let's see how you can use this in your Rust code: @@ -86,7 +86,7 @@ let builder = gtk::Builder::new_from_string(glade_src); gtk::main(); ``` -Simple isn't it? However, just this code won't show anything. You need to call [`show_all`](http://gtk-rs.org/docs/gtk/trait.WidgetExt.html#tymethod.show_all) method on the [`Window`](http://gtk-rs.org/docs/gtk/struct.Window.html). But for that, you need to get the [`Window`](http://gtk-rs.org/docs/gtk/struct.Window.html) first: +Simple isn't it? However, just this code won't show anything. You need to call [`show_all`](https://gtk-rs.org/docs/gtk/trait.WidgetExt.html#tymethod.show_all) method on the [`Window`](https://gtk-rs.org/docs/gtk/struct.Window.html). But for that, you need to get the [`Window`](https://gtk-rs.org/docs/gtk/struct.Window.html) first: ```rust // Our window id is "window1". @@ -94,7 +94,7 @@ let window: gtk::Window = builder.get_object("window1").unwrap(); window.show_all(); ``` -And that's all. If you need to add signal handlings, you need to do the same. For example, we want to show the [`MessageDialog`](http://gtk-rs.org/docs/gtk/struct.MessageDialog.html) when the [`Button`](http://gtk-rs.org/docs/gtk/struct.Button.html) is clicked. Let's add it: +And that's all. If you need to add signal handlings, you need to do the same. For example, we want to show the [`MessageDialog`](https://gtk-rs.org/docs/gtk/struct.MessageDialog.html) when the [`Button`](https://gtk-rs.org/docs/gtk/struct.Button.html) is clicked. Let's add it: ```rust let button: gtk::Button = builder.get_object("button1").unwrap(); diff --git a/docs-src/tutorial/gnome_and_rust.md b/docs-src/tutorial/gnome_and_rust.md index 60d3d2649..a68d75ca5 100644 --- a/docs-src/tutorial/gnome_and_rust.md +++ b/docs-src/tutorial/gnome_and_rust.md @@ -20,7 +20,7 @@ The goal is to provide a safe abstraction using Rust paradigms. First thing to note (it's very important!) is that the `Gtk-rs` objects can be cloned and it costs **nothing** more than copying a pointer, so basically nothing. The reason is quite simple (and I suppose you already guessed it): it's simply because `Gtk-rs` structs only contains a pointer to the corresponding `Gnome` objects. -Now: why is cloning safe? One thing to note before going any further: it's not thread safe (and you shouldn't try to call a `Gnome` library function inside another thread). Otherwise, when a struct is dropped, it calls internally the [`g_object_unref`](http://gtk-rs.org/docs/gobject_sys/fn.g_object_unref.html) function and calls the [`g_object_ref`](http://gtk-rs.org/docs/gobject_sys/fn.g_object_ref.html) function when you call `clone()`. +Now: why is cloning safe? One thing to note before going any further: it's not thread safe (and you shouldn't try to call a `Gnome` library function inside another thread). Otherwise, when a struct is dropped, it calls internally the [`g_object_unref`](https://gtk-rs.org/docs/gobject_sys/fn.g_object_unref.html) function and calls the [`g_object_ref`](https://gtk-rs.org/docs/gobject_sys/fn.g_object_ref.html) function when you call `clone()`. To put it simply: `Gnome` handles the resources allocation/removal for us. @@ -28,7 +28,7 @@ To put it simply: `Gnome` handles the resources allocation/removal for us. In Gtk, there is a widget hierarchy. In Rust, it's implemented through "traits inheritance" and enforced by the compiler at compile-time. So, what does that mean exactly? Let's take an example: -You have a [`Button`](http://gtk-rs.org/docs/gtk/struct.Button.html). As says the [gnome documentation](https://developer.gnome.org/gtk3/stable/GtkButton.html), a [`Button`](http://gtk-rs.org/docs/gtk/struct.Button.html) inheritance tree (a bit simplified) looks like this: +You have a [`Button`](https://gtk-rs.org/docs/gtk/struct.Button.html). As says the [gnome documentation](https://developer.gnome.org/gtk3/stable/GtkButton.html), a [`Button`](https://gtk-rs.org/docs/gtk/struct.Button.html) inheritance tree (a bit simplified) looks like this: ``` GObject @@ -38,7 +38,7 @@ You have a [`Button`](http://gtk-rs.org/docs/gtk/struct.Button.html). As says th ╰── GtkButton ``` -Which means that a [`Button`](http://gtk-rs.org/docs/gtk/struct.Button.html) can use methods from any of its parents. +Which means that a [`Button`](https://gtk-rs.org/docs/gtk/struct.Button.html) can use methods from any of its parents. So basically, you just need to import a parent's trait to be able to use its methods: @@ -57,7 +57,7 @@ As easy as that! ## Interfaces -The same goes for interfaces. The [gnome documentation](https://developer.gnome.org/gtk3/stable/GtkButton.html) also says that a [`Button`](http://gtk-rs.org/docs/gtk/struct.Button.html) implements the following interfaces: `GtkBuildable`, `GtkActionable` and `GtkActivatable`. Just like parents' methods, import the corresponding interface and then you'll be able to use the methods. +The same goes for interfaces. The [gnome documentation](https://developer.gnome.org/gtk3/stable/GtkButton.html) also says that a [`Button`](https://gtk-rs.org/docs/gtk/struct.Button.html) implements the following interfaces: `GtkBuildable`, `GtkActionable` and `GtkActivatable`. Just like parents' methods, import the corresponding interface and then you'll be able to use the methods. I think that with this, you'll be able to write anything you want without too much difficulties. Now it's time to go deeper into `Gtk-rs` usage! diff --git a/docs-src/tutorial/object_oriented.md b/docs-src/tutorial/object_oriented.md index 756d999ef..f8e1b57bd 100644 --- a/docs-src/tutorial/object_oriented.md +++ b/docs-src/tutorial/object_oriented.md @@ -6,15 +6,15 @@ layout: default Since there is an inheritance system in Gtk, it's only logical to have one as well in `Gtk-rs`. Normally, most people won't need this, but understanding how things work can help navigating the documentation a lot. -Each GTK class is split into a struct named after that class, and a trait with the same name and the suffix `Ext`, see for example [WidgetExt](http://gtk-rs.org/docs/gtk/prelude/trait.WidgetExt.html). All methods except the constructor(s) are not in the struct, but in that trait. In addition, some other methods can be found in a `…ExtManual` trait, as seen in [WidgetExtManual](http://gtk-rs.org/docs/gtk/prelude/trait.WidgetExtManual.html). This happens for implementation reasons currently. The same principle applies to GTK interfaces as well (have a look at the [Orientable](http://gtk-rs.org/docs/gtk/struct.Orientable.html) interface for an example). There are a few exceptional classes that don't follow this general pattern: one reason for this is that final classes don't need an extension trait because there can't be any subclasses of them, and thus can have their methods defined on the struct itself. +Each GTK class is split into a struct named after that class, and a trait with the same name and the suffix `Ext`, see for example [WidgetExt](https://gtk-rs.org/docs/gtk/prelude/trait.WidgetExt.html). All methods except the constructor(s) are not in the struct, but in that trait. In addition, some other methods can be found in a `…ExtManual` trait, as seen in [WidgetExtManual](https://gtk-rs.org/docs/gtk/prelude/trait.WidgetExtManual.html). This happens for implementation reasons currently. The same principle applies to GTK interfaces as well (have a look at the [Orientable](https://gtk-rs.org/docs/gtk/struct.Orientable.html) interface for an example). There are a few exceptional classes that don't follow this general pattern: one reason for this is that final classes don't need an extension trait because there can't be any subclasses of them, and thus can have their methods defined on the struct itself. ## Basic inheritance Any struct not only implements its `Ext` trait, but also all traits of its super classes. That way you can call methods of super classes directly on a struct. -The [`IsA`](http://gtk-rs.org/docs/glib/object/trait.IsA.html) trait is used to model the subtype relation of classes between structs. Every struct implements `IsA` for each of its parent classes (and its implemented interfaces). For example [FlowBox](http://gtk-rs.org/docs/gtk/struct.FlowBox.html) implements `IsA`, `IsA`, `IsA`, `IsA`. +The [`IsA`](https://gtk-rs.org/docs/glib/object/trait.IsA.html) trait is used to model the subtype relation of classes between structs. Every struct implements `IsA` for each of its parent classes (and its implemented interfaces). For example [FlowBox](https://gtk-rs.org/docs/gtk/struct.FlowBox.html) implements `IsA`, `IsA`, `IsA`, `IsA`. -Passing classes as arguments is pretty straightforward. The only rule is that when accepting a class as function argument, take a generic `IsA` instead: [`fn add>(&self, widget: &P)`](http://gtk-rs.org/docs/gtk/trait.ContainerExt.html#tymethod.add). Now the method can be not only called with structs of that type, but also with structs of any subtype (in this case, any Widget). +Passing classes as arguments is pretty straightforward. The only rule is that when accepting a class as function argument, take a generic `IsA` instead: [`fn add>(&self, widget: &P)`](https://gtk-rs.org/docs/gtk/trait.ContainerExt.html#tymethod.add). Now the method can be not only called with structs of that type, but also with structs of any subtype (in this case, any Widget). ## Upcasting @@ -25,7 +25,7 @@ let button = gtk::Button::with_label("Click me!"); let widget = button.upcast::(); ``` -Since the [`Button`](http://gtk-rs.org/docs/gtk/struct.Button.html) struct implements `IsA`, we can upcast into a [`Widget`](http://gtk-rs.org/docs/gtk/struct.Widget.html). It's important to note that the [`IsA`](http://gtk-rs.org/docs/gtk/trait.IsA.html) trait is implemented on every widget for every of its parents, which, in here, allows to [`upcast`](http://gtk-rs.org/docs/gtk/trait.Cast.html#method.upcast) the [`Button`](http://gtk-rs.org/docs/gtk/struct.Button.html) into a [`Widget`](http://gtk-rs.org/docs/gtk/struct.Widget.html). +Since the [`Button`](https://gtk-rs.org/docs/gtk/struct.Button.html) struct implements `IsA`, we can upcast into a [`Widget`](https://gtk-rs.org/docs/gtk/struct.Widget.html). It's important to note that the [`IsA`](https://gtk-rs.org/docs/gtk/trait.IsA.html) trait is implemented on every widget for every of its parents, which, in here, allows to [`upcast`](https://gtk-rs.org/docs/gtk/trait.Cast.html#method.upcast) the [`Button`](https://gtk-rs.org/docs/gtk/struct.Button.html) into a [`Widget`](https://gtk-rs.org/docs/gtk/struct.Widget.html). Let's see now a more global usage. @@ -39,11 +39,11 @@ fn is_a_box + IsA + Clone>(widget: &W) -> bool } ``` -Ok, so what's happening in there? First, you'll note the usage of the [`IsA`](http://gtk-rs.org/docs/gtk/trait.IsA.html) trait. The received `widget` needs to implement both `IsA` and `IsA`. +Ok, so what's happening in there? First, you'll note the usage of the [`IsA`](https://gtk-rs.org/docs/gtk/trait.IsA.html) trait. The received `widget` needs to implement both `IsA` and `IsA`. -We need the [`Object`](http://gtk-rs.org/docs/gtk/struct.Object.html) to be able to use the [`Cast`](http://gtk-rs.org/docs/gtk/trait.Cast.html) trait which contains both [`upcast`](http://gtk-rs.org/docs/gtk/trait.Cast.html#method.upcast) and [`downcast`](http://gtk-rs.org/docs/gtk/trait.Cast.html#method.downcast) methods (take a look to it for other methods as well). +We need the [`Object`](https://gtk-rs.org/docs/gtk/struct.Object.html) to be able to use the [`Cast`](https://gtk-rs.org/docs/gtk/trait.Cast.html) trait which contains both [`upcast`](https://gtk-rs.org/docs/gtk/trait.Cast.html#method.upcast) and [`downcast`](https://gtk-rs.org/docs/gtk/trait.Cast.html#method.downcast) methods (take a look to it for other methods as well). -We don't really need our widget to be a [`Widget`](http://gtk-rs.org/docs/gtk/struct.Widget.html), we just put it here to make things easier (so we can upcast into a [`Widget`](http://gtk-rs.org/docs/gtk/struct.Widget.html) without troubles). +We don't really need our widget to be a [`Widget`](https://gtk-rs.org/docs/gtk/struct.Widget.html), we just put it here to make things easier (so we can upcast into a [`Widget`](https://gtk-rs.org/docs/gtk/struct.Widget.html) without troubles). So the point of this function is to upcast the widget to the highest widget type and then try downcasting it into the wanted object. We could make even more generic like this: diff --git a/docs-src/tutorial/rust_and_gtk.md b/docs-src/tutorial/rust_and_gtk.md index 28f32d2ce..e7139eac7 100644 --- a/docs-src/tutorial/rust_and_gtk.md +++ b/docs-src/tutorial/rust_and_gtk.md @@ -6,7 +6,7 @@ layout: default Before going any further, if you don't know Rust at all, we recommend you to read the official [Rust Book](https://doc.rust-lang.org/book/). -Then we recommend you to learn a bit about [Cargo](http://doc.crates.io/index.html) and check the [GTK requirements](https://www.gtk.org/docs/installations/). +Then we recommend you to learn a bit about [Cargo](https://doc.crates.io/index.html) and check the [GTK requirements](https://www.gtk.org/docs/installations/). All done? Perfect! diff --git a/docs-src/tutorial/version.md b/docs-src/tutorial/version.md index 8ecf8cf8f..6d967996f 100644 --- a/docs-src/tutorial/version.md +++ b/docs-src/tutorial/version.md @@ -8,7 +8,7 @@ By default, `Gtk-rs` only provides objects and functions for the Gtk 3.4 version ## Explanations -If you don't know how `Cargo` features work, I suggest you to take a look at its [documentation](http://doc.crates.io/specifying-dependencies.html#choosing-features) first. +If you don't know how `Cargo` features work, I suggest you to take a look at its [documentation](https://doc.crates.io/specifying-dependencies.html#choosing-features) first. Now let's take a look at `Gtk-rs/gtk` crate features: diff --git a/index.md b/index.md index c7d8f8bd3..734f73b5f 100644 --- a/index.md +++ b/index.md @@ -12,7 +12,7 @@ layout: wide [Rust]: https://www.rust-lang.org/ [GLib]: https://developer.gnome.org/glib/stable/ [GTK]: https://developer.gnome.org/gtk3/stable/ -[Cairo]: http://cairographics.org/documentation/ +[Cairo]: https://cairographics.org/documentation/ [GtkSourceView]: https://wiki.gnome.org/Projects/GtkSourceView