Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new types #123

Merged
merged 2 commits into from Jun 15, 2018

Conversation

Projects
None yet
3 participants
@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Jun 12, 2018

use glib::translate::*;

impl DesktopAppInfo {
pub fn search(search_string: &str) -> Vec<Vec<String>> {

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jun 12, 2018

Author Member

A double check on this function implementation would be very useful!

This comment has been minimized.

@EPashkin

EPashkin Jun 13, 2018

Member

Looks good for me

This comment has been minimized.

@sdroege
@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jun 13, 2018

Seems DesktopAppInfo need cfg(not(windows)) it not links for me :(

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jun 13, 2018

also need add #![allow(deprecated)] to lib.rs for deprecated eject futures.

use std::ptr;

glib_wrapper! {
pub struct ZlibCompressor(Object<ffi::GZlibCompressor, ffi::GZlibCompressorClass>);

This comment has been minimized.

@sdroege

sdroege Jun 13, 2018

Member

Without GConverter this is useless

use std::ptr;

glib_wrapper! {
pub struct ZlibDecompressor(Object<ffi::GZlibDecompressor, ffi::GZlibDecompressorClass>);

This comment has been minimized.

@sdroege

sdroege Jun 13, 2018

Member

Without GConverter this is useless (for new types, check in the docs which interfaces it implements and parent classes)

@GuillaumeGomez GuillaumeGomez force-pushed the GuillaumeGomez:new-types-v3 branch from c2bb2cb to 77fc6a8 Jun 13, 2018

@GuillaumeGomez

This comment has been minimized.

Copy link
Member Author

GuillaumeGomez commented Jun 13, 2018

Updated.

@GuillaumeGomez GuillaumeGomez force-pushed the GuillaumeGomez:new-types-v3 branch from 77fc6a8 to 6e8fb02 Jun 14, 2018

@GuillaumeGomez

This comment has been minimized.

Copy link
Member Author

GuillaumeGomez commented Jun 14, 2018

Is it ok for you @sdroege and @EPashkin?

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jun 14, 2018

@GuillaumeGomez IMHO better or implement main Converter function manually (There will be some problem, I don't remember which) or remove Zlib[De]compressor

@GuillaumeGomez

This comment has been minimized.

Copy link
Member Author

GuillaumeGomez commented Jun 14, 2018

What problem? Seems like it got generated fine.

}

pub trait ConverterExt {
//fn convert(&self, inbuf: &[u8], outbuf: &[u8], flags: /*Ignored*/ConverterFlags) -> Result<(/*Ignored*/ConverterResult, usize, usize), Error>;

This comment has been minimized.

@EPashkin

EPashkin Jun 14, 2018

Member

Without this function all xxConvert unusable

This comment has been minimized.

@EPashkin

EPashkin Jun 14, 2018

Member

including [de]compressors

@GuillaumeGomez GuillaumeGomez force-pushed the GuillaumeGomez:new-types-v3 branch from 6e8fb02 to 3d5a896 Jun 14, 2018

@GuillaumeGomez

This comment has been minimized.

Copy link
Member Author

GuillaumeGomez commented Jun 14, 2018

Generated as well. Didn't see this one when checking missing types...

fn convert(&self, inbuf: &[u8], outbuf: &[u8], flags: ConverterFlags) -> Result<(ConverterResult, usize, usize), Error> {
let inbuf_size = inbuf.len() as usize;
let outbuf_size = outbuf.len() as usize;
unsafe {

This comment has been minimized.

@EPashkin

EPashkin Jun 14, 2018

Member

As I remember outbuf need be mutable as converter write data to it,
something like buffer in InputStreamExtManual::read,
inbuf also better be AsRef<[u8]> as in FileExtManual::replace_contents_async but maybe it unneeded.

This comment has been minimized.

@sdroege

sdroege Jun 15, 2018

Member

Yes, at least make it a &mut [u8] but otherwise AsRef<[u8]> / AsMut<[u8]> would be more generic. I'd suggest using references though as this function does not take ownership of the objects, and the user can always get the slice reference themselves

@sdroege

This comment has been minimized.

Copy link
Member

sdroege commented Jun 15, 2018

Looks good to me apart from the GConverter function, fix that and get it in then :)

@GuillaumeGomez

This comment has been minimized.

Copy link
Member Author

GuillaumeGomez commented Jun 15, 2018

Ok, I went with it using AsRef and AsMut. Just waiting for your confirmation and then here we go! :)

@GuillaumeGomez GuillaumeGomez force-pushed the GuillaumeGomez:new-types-v3 branch from f258e39 to bcc450f Jun 15, 2018

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Jun 15, 2018

IMHO all good, thanks

@GuillaumeGomez

This comment has been minimized.

Copy link
Member Author

GuillaumeGomez commented Jun 15, 2018

Thanks for your reviews!

@GuillaumeGomez GuillaumeGomez merged commit 54a85d8 into gtk-rs:master Jun 15, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@GuillaumeGomez GuillaumeGomez deleted the GuillaumeGomez:new-types-v3 branch Jun 15, 2018

@sdroege

This comment has been minimized.

Copy link
Member

sdroege commented Jun 16, 2018

Looks good to me too

vhdirk pushed a commit to vhdirk/gio-rs that referenced this pull request Jan 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.