This repository has been archived by the owner on Jun 8, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 31
Add new types #125
Merged
Merged
Add new types #125
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ce7a315
Add new types
GuillaumeGomez 3ac3424
Improve generation
GuillaumeGomez 31547f8
Update subprocesslauncherextmanual stuff
GuillaumeGomez e77fec4
Add more conditions to subprocesslauncher
GuillaumeGomez 312e5fa
Make async functions implementation manual
GuillaumeGomez 600674f
New wave of updates
GuillaumeGomez af088be
Small improvements to avoid warnings and add a bit of doc
GuillaumeGomez 2d7017a
Replace all windows conditions
GuillaumeGomez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
// This file was generated by gir (https://github.com/gtk-rs/gir) | ||
// from gir-files (https://github.com/gtk-rs/gir-files) | ||
// DO NOT EDIT | ||
|
||
use Error; | ||
use ffi; | ||
use glib::object::IsA; | ||
use glib::translate::*; | ||
use glib_ffi; | ||
use gobject_ffi; | ||
use std::fmt; | ||
use std::mem; | ||
use std::ptr; | ||
|
||
glib_wrapper! { | ||
pub struct Credentials(Object<ffi::GCredentials, ffi::GCredentialsClass>); | ||
|
||
match fn { | ||
get_type => || ffi::g_credentials_get_type(), | ||
} | ||
} | ||
|
||
impl Credentials { | ||
pub fn new() -> Credentials { | ||
unsafe { | ||
from_glib_full(ffi::g_credentials_new()) | ||
} | ||
} | ||
} | ||
|
||
impl Default for Credentials { | ||
fn default() -> Self { | ||
Self::new() | ||
} | ||
} | ||
|
||
impl fmt::Display for Credentials { | ||
#[inline] | ||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
write!(f, "{}", CredentialsExt::to_string(self)) | ||
} | ||
} | ||
|
||
pub trait CredentialsExt { | ||
//fn get_native(&self, native_type: CredentialsType) -> /*Unimplemented*/Option<Fundamental: Pointer>; | ||
|
||
#[cfg(any(unix, feature = "dox"))] | ||
#[cfg(any(feature = "v2_36", feature = "dox"))] | ||
fn get_unix_pid(&self) -> Result<i32, Error>; | ||
|
||
#[cfg(any(unix, feature = "dox"))] | ||
fn get_unix_user(&self) -> Result<(), Error>; | ||
|
||
fn is_same_user(&self, other_credentials: &Credentials) -> Result<(), Error>; | ||
|
||
//fn set_native(&self, native_type: CredentialsType, native: /*Unimplemented*/Fundamental: Pointer); | ||
|
||
#[cfg(any(unix, feature = "dox"))] | ||
fn set_unix_user(&self, uid: u32) -> Result<(), Error>; | ||
|
||
fn to_string(&self) -> String; | ||
} | ||
|
||
impl<O: IsA<Credentials>> CredentialsExt for O { | ||
//fn get_native(&self, native_type: CredentialsType) -> /*Unimplemented*/Option<Fundamental: Pointer> { | ||
// unsafe { TODO: call ffi::g_credentials_get_native() } | ||
//} | ||
|
||
#[cfg(any(unix, feature = "dox"))] | ||
#[cfg(any(feature = "v2_36", feature = "dox"))] | ||
fn get_unix_pid(&self) -> Result<i32, Error> { | ||
unsafe { | ||
let mut error = ptr::null_mut(); | ||
let ret = ffi::g_credentials_get_unix_pid(self.to_glib_none().0, &mut error); | ||
if error.is_null() { Ok(ret) } else { Err(from_glib_full(error)) } | ||
} | ||
} | ||
|
||
#[cfg(any(unix, feature = "dox"))] | ||
fn get_unix_user(&self) -> Result<(), Error> { | ||
unsafe { | ||
let mut error = ptr::null_mut(); | ||
let _ = ffi::g_credentials_get_unix_user(self.to_glib_none().0, &mut error); | ||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } | ||
} | ||
} | ||
|
||
fn is_same_user(&self, other_credentials: &Credentials) -> Result<(), Error> { | ||
unsafe { | ||
let mut error = ptr::null_mut(); | ||
let _ = ffi::g_credentials_is_same_user(self.to_glib_none().0, other_credentials.to_glib_none().0, &mut error); | ||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } | ||
} | ||
} | ||
|
||
//fn set_native(&self, native_type: CredentialsType, native: /*Unimplemented*/Fundamental: Pointer) { | ||
// unsafe { TODO: call ffi::g_credentials_set_native() } | ||
//} | ||
|
||
#[cfg(any(unix, feature = "dox"))] | ||
fn set_unix_user(&self, uid: u32) -> Result<(), Error> { | ||
unsafe { | ||
let mut error = ptr::null_mut(); | ||
let _ = ffi::g_credentials_set_unix_user(self.to_glib_none().0, uid, &mut error); | ||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } | ||
} | ||
} | ||
|
||
fn to_string(&self) -> String { | ||
unsafe { | ||
from_glib_full(ffi::g_credentials_to_string(self.to_glib_none().0)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// This file was generated by gir (https://github.com/gtk-rs/gir) | ||
// from gir-files (https://github.com/gtk-rs/gir-files) | ||
// DO NOT EDIT | ||
|
||
use File; | ||
use Icon; | ||
use LoadableIcon; | ||
use ffi; | ||
use glib; | ||
use glib::object::Downcast; | ||
use glib::object::IsA; | ||
use glib::signal::SignalHandlerId; | ||
use glib::signal::connect; | ||
use glib::translate::*; | ||
use glib_ffi; | ||
use gobject_ffi; | ||
use std::boxed::Box as Box_; | ||
use std::mem; | ||
use std::mem::transmute; | ||
use std::ptr; | ||
|
||
glib_wrapper! { | ||
pub struct FileIcon(Object<ffi::GFileIcon, ffi::GFileIconClass>): Icon, LoadableIcon; | ||
|
||
match fn { | ||
get_type => || ffi::g_file_icon_get_type(), | ||
} | ||
} | ||
|
||
impl FileIcon { | ||
pub fn new<P: IsA<File>>(file: &P) -> FileIcon { | ||
unsafe { | ||
from_glib_full(ffi::g_file_icon_new(file.to_glib_none().0)) | ||
} | ||
} | ||
} | ||
|
||
pub trait FileIconExt { | ||
fn get_file(&self) -> Option<File>; | ||
|
||
fn connect_property_file_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; | ||
} | ||
|
||
impl<O: IsA<FileIcon> + IsA<glib::object::Object>> FileIconExt for O { | ||
fn get_file(&self) -> Option<File> { | ||
unsafe { | ||
from_glib_none(ffi::g_file_icon_get_file(self.to_glib_none().0)) | ||
} | ||
} | ||
|
||
fn connect_property_file_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { | ||
unsafe { | ||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f)); | ||
connect(self.to_glib_none().0, "notify::file", | ||
transmute(notify_file_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _) | ||
} | ||
} | ||
} | ||
|
||
unsafe extern "C" fn notify_file_trampoline<P>(this: *mut ffi::GFileIcon, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) | ||
where P: IsA<FileIcon> { | ||
callback_guard!(); | ||
let f: &&(Fn(&P) + 'static) = transmute(f); | ||
f(&FileIcon::from_glib_borrow(this).downcast_unchecked()) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to ignore that one here. It is generated as a result of the non-futures function and does not exist as such in C