use App;
#[cfg(any(feature = "v0_3_5", feature = "dox"))]
use AppKind;
use Error;
#[cfg(any(feature = "v0_3_1", feature = "dox"))]
use IconKind;
#[cfg(any(feature = "v0_7_8", feature = "dox"))]
use LaunchableKind;
#[cfg(any(feature = "v0_5", feature = "dox"))]
use ProvideKind;
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
use StoreLoadFlags;
use app_stream_glib_sys;
#[cfg(feature = "futures")]
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
use futures::future;
use gio;
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
use gio_sys;
use glib;
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
use glib::GString;
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
use glib::object::Cast;
use glib::object::IsA;
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
use glib::signal::SignalHandlerId;
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
use glib::signal::connect_raw;
use glib::translate::*;
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
use glib_sys;
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
use gobject_sys;
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
use std::boxed::Box as Box_;
use std::fmt;
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
use std::mem::transmute;
use std::ptr;
glib_wrapper! {
pub struct Store(Object<app_stream_glib_sys::AsStore, app_stream_glib_sys::AsStoreClass, StoreClass>);
match fn {
get_type => || app_stream_glib_sys::as_store_get_type(),
}
}
impl Store {
pub fn new() -> Store {
unsafe {
from_glib_full(app_stream_glib_sys::as_store_new())
}
}
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
pub fn error_quark() -> glib::Quark {
unsafe {
from_glib(app_stream_glib_sys::as_store_error_quark())
}
}
}
impl Default for Store {
fn default() -> Self {
Self::new()
}
}
pub const NONE_STORE: Option<&Store> = None;
pub trait StoreExt: 'static {
fn add_app<P: IsA<App>>(&self, app: &P);
#[cfg(any(feature = "v0_3_5", feature = "dox"))]
fn add_filter(&self, kind: AppKind);
#[cfg(any(feature = "v0_3", feature = "dox"))]
fn add_metadata_index(&self, key: &str);
#[cfg(any(feature = "v0_3_1", feature = "dox"))]
fn convert_icons(&self, kind: IconKind) -> Result<(), Error>;
#[cfg(any(feature = "v0_5_2", feature = "dox"))]
fn from_bytes<P: IsA<gio::Cancellable>>(&self, bytes: &glib::Bytes, cancellable: Option<&P>) -> Result<(), Error>;
fn from_file<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, file: &P, icon_root: Option<&str>, cancellable: Option<&Q>) -> Result<(), Error>;
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn from_xml(&self, data: &str, icon_root: Option<&str>) -> Result<(), Error>;
#[cfg(any(feature = "v0_2_2", feature = "dox"))]
fn get_add_flags(&self) -> u32;
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn get_api_version(&self) -> f64;
fn get_app_by_id(&self, id: &str) -> Option<App>;
#[cfg(any(feature = "v0_5_12", feature = "dox"))]
fn get_app_by_id_ignore_prefix(&self, id: &str) -> Option<App>;
#[cfg(any(feature = "v0_4_1", feature = "dox"))]
fn get_app_by_id_with_fallbacks(&self, id: &str) -> Option<App>;
#[cfg(any(feature = "v0_7_8", feature = "dox"))]
fn get_app_by_launchable(&self, kind: LaunchableKind, value: &str) -> Option<App>;
fn get_app_by_pkgname(&self, pkgname: &str) -> Option<App>;
#[cfg(any(feature = "v0_5", feature = "dox"))]
fn get_app_by_provide(&self, kind: ProvideKind, value: &str) -> Option<App>;
#[cfg(any(feature = "v0_6_1", feature = "dox"))]
fn get_app_by_unique_id(&self, unique_id: &str, search_flags: u32) -> Option<App>;
#[cfg(any(feature = "v0_2_5", feature = "dox"))]
fn get_builder_id(&self) -> Option<GString>;
#[cfg(any(feature = "v0_2_4", feature = "dox"))]
fn get_destdir(&self) -> Option<GString>;
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn get_origin(&self) -> Option<GString>;
#[cfg(any(feature = "v0_6_13", feature = "dox"))]
fn get_search_match(&self) -> u16;
fn get_size(&self) -> u32;
#[cfg(any(feature = "v0_4_2", feature = "dox"))]
fn get_watch_flags(&self) -> u32;
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
fn load<P: IsA<gio::Cancellable>>(&self, flags: u32, cancellable: Option<&P>) -> Result<(), Error>;
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
fn load_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<(), Error>) + Send + 'static>(&self, flags: StoreLoadFlags, cancellable: Option<&P>, callback: Q);
#[cfg(feature = "futures")]
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
fn load_async_future(&self, flags: StoreLoadFlags) -> Box_<dyn future::Future<Output = Result<(), Error>> + std::marker::Unpin>;
#[cfg(any(feature = "v0_2_2", feature = "dox"))]
fn load_path<P: IsA<gio::Cancellable>>(&self, path: &str, cancellable: Option<&P>) -> Result<(), Error>;
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
fn load_path_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<(), Error>) + Send + 'static>(&self, path: &str, cancellable: Option<&P>, callback: Q);
#[cfg(feature = "futures")]
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
fn load_path_async_future(&self, path: &str) -> Box_<dyn future::Future<Output = Result<(), Error>> + std::marker::Unpin>;
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn load_search_cache(&self);
#[cfg(any(feature = "v0_2_5", feature = "dox"))]
fn remove_all(&self);
fn remove_app<P: IsA<App>>(&self, app: &P);
#[cfg(any(feature = "v0_3", feature = "dox"))]
fn remove_app_by_id(&self, id: &str);
#[cfg(any(feature = "v0_5_13", feature = "dox"))]
fn remove_apps_with_veto(&self);
#[cfg(any(feature = "v0_3_5", feature = "dox"))]
fn remove_filter(&self, kind: AppKind);
#[cfg(any(feature = "v0_2_2", feature = "dox"))]
fn set_add_flags(&self, add_flags: u32);
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn set_api_version(&self, api_version: f64);
#[cfg(any(feature = "v0_2_5", feature = "dox"))]
fn set_builder_id(&self, builder_id: &str);
#[cfg(any(feature = "v0_2_4", feature = "dox"))]
fn set_destdir(&self, destdir: &str);
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn set_origin(&self, origin: &str);
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn set_search_match(&self, search_match: u16);
#[cfg(any(feature = "v0_4_2", feature = "dox"))]
fn set_watch_flags(&self, watch_flags: u32);
fn to_file<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, file: &P, flags: u32, cancellable: Option<&Q>) -> Result<(), Error>;
fn to_xml(&self, flags: u32) -> Option<glib::String>;
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn connect_app_added<F: Fn(&Self, &App) + 'static>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn connect_app_changed<F: Fn(&Self, &App) + 'static>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn connect_app_removed<F: Fn(&Self, &App) + 'static>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<Store>> StoreExt for O {
fn add_app<P: IsA<App>>(&self, app: &P) {
unsafe {
app_stream_glib_sys::as_store_add_app(self.as_ref().to_glib_none().0, app.as_ref().to_glib_none().0);
}
}
#[cfg(any(feature = "v0_3_5", feature = "dox"))]
fn add_filter(&self, kind: AppKind) {
unsafe {
app_stream_glib_sys::as_store_add_filter(self.as_ref().to_glib_none().0, kind.to_glib());
}
}
#[cfg(any(feature = "v0_3", feature = "dox"))]
fn add_metadata_index(&self, key: &str) {
unsafe {
app_stream_glib_sys::as_store_add_metadata_index(self.as_ref().to_glib_none().0, key.to_glib_none().0);
}
}
#[cfg(any(feature = "v0_3_1", feature = "dox"))]
fn convert_icons(&self, kind: IconKind) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = app_stream_glib_sys::as_store_convert_icons(self.as_ref().to_glib_none().0, kind.to_glib(), &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v0_5_2", feature = "dox"))]
fn from_bytes<P: IsA<gio::Cancellable>>(&self, bytes: &glib::Bytes, cancellable: Option<&P>) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = app_stream_glib_sys::as_store_from_bytes(self.as_ref().to_glib_none().0, bytes.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
fn from_file<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, file: &P, icon_root: Option<&str>, cancellable: Option<&Q>) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = app_stream_glib_sys::as_store_from_file(self.as_ref().to_glib_none().0, file.as_ref().to_glib_none().0, icon_root.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn from_xml(&self, data: &str, icon_root: Option<&str>) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = app_stream_glib_sys::as_store_from_xml(self.as_ref().to_glib_none().0, data.to_glib_none().0, icon_root.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v0_2_2", feature = "dox"))]
fn get_add_flags(&self) -> u32 {
unsafe {
app_stream_glib_sys::as_store_get_add_flags(self.as_ref().to_glib_none().0)
}
}
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn get_api_version(&self) -> f64 {
unsafe {
app_stream_glib_sys::as_store_get_api_version(self.as_ref().to_glib_none().0)
}
}
fn get_app_by_id(&self, id: &str) -> Option<App> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_app_by_id(self.as_ref().to_glib_none().0, id.to_glib_none().0))
}
}
#[cfg(any(feature = "v0_5_12", feature = "dox"))]
fn get_app_by_id_ignore_prefix(&self, id: &str) -> Option<App> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_app_by_id_ignore_prefix(self.as_ref().to_glib_none().0, id.to_glib_none().0))
}
}
#[cfg(any(feature = "v0_4_1", feature = "dox"))]
fn get_app_by_id_with_fallbacks(&self, id: &str) -> Option<App> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_app_by_id_with_fallbacks(self.as_ref().to_glib_none().0, id.to_glib_none().0))
}
}
#[cfg(any(feature = "v0_7_8", feature = "dox"))]
fn get_app_by_launchable(&self, kind: LaunchableKind, value: &str) -> Option<App> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_app_by_launchable(self.as_ref().to_glib_none().0, kind.to_glib(), value.to_glib_none().0))
}
}
fn get_app_by_pkgname(&self, pkgname: &str) -> Option<App> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_app_by_pkgname(self.as_ref().to_glib_none().0, pkgname.to_glib_none().0))
}
}
#[cfg(any(feature = "v0_5", feature = "dox"))]
fn get_app_by_provide(&self, kind: ProvideKind, value: &str) -> Option<App> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_app_by_provide(self.as_ref().to_glib_none().0, kind.to_glib(), value.to_glib_none().0))
}
}
#[cfg(any(feature = "v0_6_1", feature = "dox"))]
fn get_app_by_unique_id(&self, unique_id: &str, search_flags: u32) -> Option<App> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_app_by_unique_id(self.as_ref().to_glib_none().0, unique_id.to_glib_none().0, search_flags))
}
}
#[cfg(any(feature = "v0_2_5", feature = "dox"))]
fn get_builder_id(&self) -> Option<GString> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_builder_id(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v0_2_4", feature = "dox"))]
fn get_destdir(&self) -> Option<GString> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_destdir(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn get_origin(&self) -> Option<GString> {
unsafe {
from_glib_none(app_stream_glib_sys::as_store_get_origin(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v0_6_13", feature = "dox"))]
fn get_search_match(&self) -> u16 {
unsafe {
app_stream_glib_sys::as_store_get_search_match(self.as_ref().to_glib_none().0)
}
}
fn get_size(&self) -> u32 {
unsafe {
app_stream_glib_sys::as_store_get_size(self.as_ref().to_glib_none().0)
}
}
#[cfg(any(feature = "v0_4_2", feature = "dox"))]
fn get_watch_flags(&self) -> u32 {
unsafe {
app_stream_glib_sys::as_store_get_watch_flags(self.as_ref().to_glib_none().0)
}
}
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
fn load<P: IsA<gio::Cancellable>>(&self, flags: u32, cancellable: Option<&P>) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = app_stream_glib_sys::as_store_load(self.as_ref().to_glib_none().0, flags, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
fn load_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<(), Error>) + Send + 'static>(&self, flags: StoreLoadFlags, cancellable: Option<&P>, callback: Q) {
let user_data: Box<Q> = Box::new(callback);
unsafe extern "C" fn load_async_trampoline<Q: FnOnce(Result<(), Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) {
let mut error = ptr::null_mut();
let _ = app_stream_glib_sys::as_store_load_finish(_source_object as *mut _, res, &mut error);
let result = if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) };
let callback: Box<Q> = Box::from_raw(user_data as *mut _);
callback(result);
}
let callback = load_async_trampoline::<Q>;
unsafe {
app_stream_glib_sys::as_store_load_async(self.as_ref().to_glib_none().0, flags.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box::into_raw(user_data) as *mut _);
}
}
#[cfg(feature = "futures")]
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
fn load_async_future(&self, flags: StoreLoadFlags) -> Box_<dyn future::Future<Output = Result<(), Error>> + std::marker::Unpin> {
use gio::GioFuture;
use fragile::Fragile;
GioFuture::new(self, move |obj, send| {
let cancellable = gio::Cancellable::new();
let send = Fragile::new(send);
obj.load_async(
flags,
Some(&cancellable),
move |res| {
let _ = send.into_inner().send(res);
},
);
cancellable
})
}
#[cfg(any(feature = "v0_2_2", feature = "dox"))]
fn load_path<P: IsA<gio::Cancellable>>(&self, path: &str, cancellable: Option<&P>) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = app_stream_glib_sys::as_store_load_path(self.as_ref().to_glib_none().0, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
fn load_path_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<(), Error>) + Send + 'static>(&self, path: &str, cancellable: Option<&P>, callback: Q) {
let user_data: Box<Q> = Box::new(callback);
unsafe extern "C" fn load_path_async_trampoline<Q: FnOnce(Result<(), Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) {
let mut error = ptr::null_mut();
let _ = app_stream_glib_sys::as_store_load_path_finish(_source_object as *mut _, res, &mut error);
let result = if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) };
let callback: Box<Q> = Box::from_raw(user_data as *mut _);
callback(result);
}
let callback = load_path_async_trampoline::<Q>;
unsafe {
app_stream_glib_sys::as_store_load_path_async(self.as_ref().to_glib_none().0, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box::into_raw(user_data) as *mut _);
}
}
#[cfg(feature = "futures")]
#[cfg(any(feature = "v0_7_11", feature = "dox"))]
fn load_path_async_future(&self, path: &str) -> Box_<dyn future::Future<Output = Result<(), Error>> + std::marker::Unpin> {
use gio::GioFuture;
use fragile::Fragile;
let path = String::from(path);
GioFuture::new(self, move |obj, send| {
let cancellable = gio::Cancellable::new();
let send = Fragile::new(send);
obj.load_path_async(
&path,
Some(&cancellable),
move |res| {
let _ = send.into_inner().send(res);
},
);
cancellable
})
}
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn load_search_cache(&self) {
unsafe {
app_stream_glib_sys::as_store_load_search_cache(self.as_ref().to_glib_none().0);
}
}
#[cfg(any(feature = "v0_2_5", feature = "dox"))]
fn remove_all(&self) {
unsafe {
app_stream_glib_sys::as_store_remove_all(self.as_ref().to_glib_none().0);
}
}
fn remove_app<P: IsA<App>>(&self, app: &P) {
unsafe {
app_stream_glib_sys::as_store_remove_app(self.as_ref().to_glib_none().0, app.as_ref().to_glib_none().0);
}
}
#[cfg(any(feature = "v0_3", feature = "dox"))]
fn remove_app_by_id(&self, id: &str) {
unsafe {
app_stream_glib_sys::as_store_remove_app_by_id(self.as_ref().to_glib_none().0, id.to_glib_none().0);
}
}
#[cfg(any(feature = "v0_5_13", feature = "dox"))]
fn remove_apps_with_veto(&self) {
unsafe {
app_stream_glib_sys::as_store_remove_apps_with_veto(self.as_ref().to_glib_none().0);
}
}
#[cfg(any(feature = "v0_3_5", feature = "dox"))]
fn remove_filter(&self, kind: AppKind) {
unsafe {
app_stream_glib_sys::as_store_remove_filter(self.as_ref().to_glib_none().0, kind.to_glib());
}
}
#[cfg(any(feature = "v0_2_2", feature = "dox"))]
fn set_add_flags(&self, add_flags: u32) {
unsafe {
app_stream_glib_sys::as_store_set_add_flags(self.as_ref().to_glib_none().0, add_flags);
}
}
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn set_api_version(&self, api_version: f64) {
unsafe {
app_stream_glib_sys::as_store_set_api_version(self.as_ref().to_glib_none().0, api_version);
}
}
#[cfg(any(feature = "v0_2_5", feature = "dox"))]
fn set_builder_id(&self, builder_id: &str) {
unsafe {
app_stream_glib_sys::as_store_set_builder_id(self.as_ref().to_glib_none().0, builder_id.to_glib_none().0);
}
}
#[cfg(any(feature = "v0_2_4", feature = "dox"))]
fn set_destdir(&self, destdir: &str) {
unsafe {
app_stream_glib_sys::as_store_set_destdir(self.as_ref().to_glib_none().0, destdir.to_glib_none().0);
}
}
#[cfg(any(feature = "v0_1_1", feature = "dox"))]
fn set_origin(&self, origin: &str) {
unsafe {
app_stream_glib_sys::as_store_set_origin(self.as_ref().to_glib_none().0, origin.to_glib_none().0);
}
}
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn set_search_match(&self, search_match: u16) {
unsafe {
app_stream_glib_sys::as_store_set_search_match(self.as_ref().to_glib_none().0, search_match);
}
}
#[cfg(any(feature = "v0_4_2", feature = "dox"))]
fn set_watch_flags(&self, watch_flags: u32) {
unsafe {
app_stream_glib_sys::as_store_set_watch_flags(self.as_ref().to_glib_none().0, watch_flags);
}
}
fn to_file<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, file: &P, flags: u32, cancellable: Option<&Q>) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = app_stream_glib_sys::as_store_to_file(self.as_ref().to_glib_none().0, file.as_ref().to_glib_none().0, flags, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
fn to_xml(&self, flags: u32) -> Option<glib::String> {
unsafe {
from_glib_full(app_stream_glib_sys::as_store_to_xml(self.as_ref().to_glib_none().0, flags))
}
}
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn connect_app_added<F: Fn(&Self, &App) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn app_added_trampoline<P, F: Fn(&P, &App) + 'static>(this: *mut app_stream_glib_sys::AsStore, app: *mut app_stream_glib_sys::AsApp, f: glib_sys::gpointer)
where P: IsA<Store>
{
let f: &F = &*(f as *const F);
f(&Store::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(app))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"app-added\0".as_ptr() as *const _,
Some(transmute(app_added_trampoline::<Self, F> as usize)), Box_::into_raw(f))
}
}
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn connect_app_changed<F: Fn(&Self, &App) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn app_changed_trampoline<P, F: Fn(&P, &App) + 'static>(this: *mut app_stream_glib_sys::AsStore, app: *mut app_stream_glib_sys::AsApp, f: glib_sys::gpointer)
where P: IsA<Store>
{
let f: &F = &*(f as *const F);
f(&Store::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(app))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"app-changed\0".as_ptr() as *const _,
Some(transmute(app_changed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
}
}
#[cfg(any(feature = "v0_6_5", feature = "dox"))]
fn connect_app_removed<F: Fn(&Self, &App) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn app_removed_trampoline<P, F: Fn(&P, &App) + 'static>(this: *mut app_stream_glib_sys::AsStore, app: *mut app_stream_glib_sys::AsApp, f: glib_sys::gpointer)
where P: IsA<Store>
{
let f: &F = &*(f as *const F);
f(&Store::from_glib_borrow(this).unsafe_cast(), &from_glib_borrow(app))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"app-removed\0".as_ptr() as *const _,
Some(transmute(app_removed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
}
}
#[cfg(any(feature = "v0_1_2", feature = "dox"))]
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn changed_trampoline<P, F: Fn(&P) + 'static>(this: *mut app_stream_glib_sys::AsStore, f: glib_sys::gpointer)
where P: IsA<Store>
{
let f: &F = &*(f as *const F);
f(&Store::from_glib_borrow(this).unsafe_cast())
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"changed\0".as_ptr() as *const _,
Some(transmute(changed_trampoline::<Self, F> as usize)), Box_::into_raw(f))
}
}
}
impl fmt::Display for Store {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Store")
}
}