Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

New types #117

Merged
merged 2 commits into from Jul 5, 2018
Merged

New types #117

merged 2 commits into from Jul 5, 2018

Conversation

GuillaumeGomez
Copy link
Member

Fixes #74.

I don't think we can yet generate LogAttr struct for the moment but except for this one, we now have a new one.

cc @sdroege @EPashkin

@vhakulinen
Copy link

vhakulinen commented Jul 4, 2018

The Item needs to expose its Analysis: https://developer.gnome.org/pango/stable/pango-Text-Processing.html#PangoItem-struct

Thats also the only way to get a hold of analysis structure.

@sdroege
Copy link
Member

sdroege commented Jul 4, 2018

Should also expose the other fields, read-only

@GuillaumeGomez
Copy link
Member Author

Updated.

src/item.rs Outdated
use Item;

impl Item {
pub fn offset(&self) -> c_int {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want to use proper Rust types here instead of the libc ones (i32)

src/item.rs Outdated
}

pub fn analysis(&self) -> Analysis {
unsafe { Analysis::from_c((*self.to_glib_none().0).analysis) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or you simply return a reference here instead (The from_c() above must be taking new references to all the pointers inside otherwise?)

&*((*self.to_glib_none().0).analysis as *const Analysis) and put repr(C) on the Analysis struct

@GuillaumeGomez
Copy link
Member Author

Updated.

@EPashkin
Copy link
Member

EPashkin commented Jul 5, 2018

Looks good but IMHO need some squash.

@GuillaumeGomez
Copy link
Member Author

I'll squash once reviews are done to make your lifes easier. ;)

@GuillaumeGomez GuillaumeGomez force-pushed the new-types branch 2 times, most recently from ad6a20c to 13b23dd Compare July 5, 2018 15:59
@GuillaumeGomez
Copy link
Member Author

Squashed and tests passed. Merge time!

@GuillaumeGomez GuillaumeGomez merged commit abd959c into gtk-rs:master Jul 5, 2018
@GuillaumeGomez GuillaumeGomez deleted the new-types branch July 5, 2018 17:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants