2018-11-18 12:20:16 +00:00
|
|
|
// Copyright (C) 2016-2018 Sebastian Dröge <sebastian@centricular.com>
|
|
|
|
// 2016 Luis de Bethencourt <luisbg@osg.samsung.com>
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
pub mod error;
|
|
|
|
#[macro_use]
|
|
|
|
pub mod plugin;
|
|
|
|
|
2018-11-19 16:37:00 +00:00
|
|
|
pub mod bin;
|
2018-11-18 14:36:28 +00:00
|
|
|
pub mod child_proxy;
|
2018-11-18 12:20:16 +00:00
|
|
|
pub mod element;
|
2018-11-18 14:36:28 +00:00
|
|
|
pub mod uri_handler;
|
2018-11-18 12:20:16 +00:00
|
|
|
|
|
|
|
pub mod prelude {
|
2018-11-19 16:37:00 +00:00
|
|
|
pub use super::bin::BinImpl;
|
2018-11-18 14:36:28 +00:00
|
|
|
pub use super::child_proxy::ChildProxyImpl;
|
2018-11-18 12:20:16 +00:00
|
|
|
pub use super::element::{ElementClassSubclassExt, ElementImpl, ElementImplExt};
|
2018-11-18 14:10:58 +00:00
|
|
|
pub use super::uri_handler::URIHandlerImpl;
|
2018-11-18 12:20:16 +00:00
|
|
|
pub use super::PanicPoison;
|
|
|
|
pub use glib::subclass::prelude::*;
|
|
|
|
}
|
|
|
|
|
|
|
|
use self::prelude::*;
|
|
|
|
use glib;
|
|
|
|
use std::sync::atomic::AtomicBool;
|
|
|
|
|
|
|
|
#[repr(C)]
|
|
|
|
pub struct ElementInstanceStruct<T: ObjectSubclass> {
|
|
|
|
parent: <T::ParentType as glib::wrapper::Wrapper>::GlibType,
|
|
|
|
panicked: AtomicBool,
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe impl<T: ObjectSubclass> InstanceStruct for ElementInstanceStruct<T> {
|
|
|
|
type Type = T;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait PanicPoison {
|
|
|
|
fn panicked(&self) -> &AtomicBool;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: ObjectSubclass> PanicPoison for ElementInstanceStruct<T> {
|
|
|
|
fn panicked(&self) -> &AtomicBool {
|
|
|
|
&self.panicked
|
|
|
|
}
|
|
|
|
}
|