libshumate 0.2.0

Rust bindings for libshumate
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use crate::DataSource;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::StaticType;
use std::fmt;

glib::wrapper! {
    #[doc(alias = "ShumateTileDownloader")]
    pub struct TileDownloader(Object<ffi::ShumateTileDownloader, ffi::ShumateTileDownloaderClass>) @extends DataSource;

    match fn {
        type_ => || ffi::shumate_tile_downloader_get_type(),
    }
}

impl TileDownloader {
    #[doc(alias = "shumate_tile_downloader_new")]
    pub fn new(url_template: &str) -> TileDownloader {
        assert_initialized_main_thread!();
        unsafe {
            from_glib_full(ffi::shumate_tile_downloader_new(
                url_template.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "url-template")]
    pub fn url_template(&self) -> Option<glib::GString> {
        glib::ObjectExt::property(self, "url-template")
    }
}

impl fmt::Display for TileDownloader {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("TileDownloader")
    }
}