Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ script:
cargo clippy --release;
fi
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ] && [ "$GTK" == "3.14" ] && ! [ "$ARM" == "1" ]; then
rustup component add rustfmt;
make regen_check;
fi
- if ! [ "$ARM" == "1" ]; then
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ GIR_FILES = gir-files/Glib-2.0.gir gir-files/GObject-2.0.gir

# Run `gir` generating the bindings
gir : src/auto/mod.rs src/gobject/auto/mod.rs
cargo fmt

doc: $(GIR) $(GIR_FILES)
$(GIR) -m doc -c Gir.toml
Expand All @@ -16,6 +17,7 @@ regen_check: $(GIR) $(GIR_FILES)
rm src/gobject/auto/*
$(GIR) -c Gir.toml
$(GIR) -c Gir_GObject.toml
cargo fmt
git diff -R --exit-code

src/auto/mod.rs : Gir.toml $(GIR) $(GIR_FILES)
Expand Down
10 changes: 3 additions & 7 deletions src/auto/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use ChecksumType;
use glib_sys;
use translate::*;
use ChecksumType;

glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand All @@ -19,9 +19,7 @@ glib_wrapper! {

impl Checksum {
pub fn new(checksum_type: ChecksumType) -> Checksum {
unsafe {
from_glib_full(glib_sys::g_checksum_new(checksum_type.to_glib()))
}
unsafe { from_glib_full(glib_sys::g_checksum_new(checksum_type.to_glib())) }
}

pub fn reset(&mut self) {
Expand All @@ -38,9 +36,7 @@ impl Checksum {
}

pub fn type_get_length(checksum_type: ChecksumType) -> isize {
unsafe {
glib_sys::g_checksum_type_get_length(checksum_type.to_glib())
}
unsafe { glib_sys::g_checksum_type_get_length(checksum_type.to_glib()) }
}
}

Expand Down
204 changes: 168 additions & 36 deletions src/auto/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,110 +6,242 @@ use glib_sys;
use std::ffi::CStr;

lazy_static! {
pub static ref CSET_A_2_Z: &'static str = unsafe{CStr::from_ptr(glib_sys::G_CSET_A_2_Z).to_str().unwrap()};
pub static ref CSET_A_2_Z: &'static str =
unsafe { CStr::from_ptr(glib_sys::G_CSET_A_2_Z).to_str().unwrap() };
}
lazy_static! {
pub static ref CSET_DIGITS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_CSET_DIGITS).to_str().unwrap()};
pub static ref CSET_DIGITS: &'static str =
unsafe { CStr::from_ptr(glib_sys::G_CSET_DIGITS).to_str().unwrap() };
}
lazy_static! {
pub static ref CSET_a_2_z: &'static str = unsafe{CStr::from_ptr(glib_sys::G_CSET_a_2_z).to_str().unwrap()};
pub static ref CSET_a_2_z: &'static str =
unsafe { CStr::from_ptr(glib_sys::G_CSET_a_2_z).to_str().unwrap() };
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_GROUP: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_GROUP).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_GROUP: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_GROUP)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_ACTIONS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ACTIONS).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_ACTIONS: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ACTIONS)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_CATEGORIES: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_CATEGORIES).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_CATEGORIES: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_CATEGORIES)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_COMMENT: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_COMMENT).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_COMMENT: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_COMMENT)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_EXEC: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_EXEC).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_EXEC: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_EXEC)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_FULLNAME: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_FULLNAME).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_FULLNAME: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_FULLNAME)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_GENERIC_NAME: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_GENERIC_NAME: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_HIDDEN: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_HIDDEN).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_HIDDEN: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_HIDDEN)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_ICON: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ICON).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_ICON: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ICON)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_KEYWORDS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_KEYWORDS).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_KEYWORDS: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_KEYWORDS)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_MIME_TYPE: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_MIME_TYPE).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_MIME_TYPE: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_MIME_TYPE)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_NAME: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NAME).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_NAME: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NAME)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_NO_DISPLAY: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_NO_DISPLAY: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_PATH: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_PATH).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_PATH: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_PATH)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_TERMINAL: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TERMINAL).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_TERMINAL: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TERMINAL)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_TRY_EXEC: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TRY_EXEC).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_TRY_EXEC: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TRY_EXEC)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_TYPE: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TYPE).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_TYPE: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_TYPE)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_URL: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_URL).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_URL: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_URL)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_KEY_VERSION: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_VERSION).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_KEY_VERSION: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_KEY_VERSION)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_TYPE_APPLICATION: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_APPLICATION).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_TYPE_APPLICATION: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_APPLICATION)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_TYPE_DIRECTORY: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_DIRECTORY).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_TYPE_DIRECTORY: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_DIRECTORY)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref KEY_FILE_DESKTOP_TYPE_LINK: &'static str = unsafe{CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_LINK).to_str().unwrap()};
pub static ref KEY_FILE_DESKTOP_TYPE_LINK: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_KEY_FILE_DESKTOP_TYPE_LINK)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref OPTION_REMAINING: &'static str = unsafe{CStr::from_ptr(glib_sys::G_OPTION_REMAINING).to_str().unwrap()};
pub static ref OPTION_REMAINING: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_OPTION_REMAINING)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref STR_DELIMITERS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_STR_DELIMITERS).to_str().unwrap()};
pub static ref STR_DELIMITERS: &'static str =
unsafe { CStr::from_ptr(glib_sys::G_STR_DELIMITERS).to_str().unwrap() };
}
lazy_static! {
pub static ref URI_RESERVED_CHARS_GENERIC_DELIMITERS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_URI_RESERVED_CHARS_GENERIC_DELIMITERS).to_str().unwrap()};
pub static ref URI_RESERVED_CHARS_GENERIC_DELIMITERS: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_URI_RESERVED_CHARS_GENERIC_DELIMITERS)
.to_str()
.unwrap()
};
}
lazy_static! {
pub static ref URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: &'static str = unsafe{CStr::from_ptr(glib_sys::G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS).to_str().unwrap()};
pub static ref URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS: &'static str = unsafe {
CStr::from_ptr(glib_sys::G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS)
.to_str()
.unwrap()
};
}
Loading