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

New types #224

Merged
merged 2 commits into from Jul 9, 2018

Conversation

Projects
None yet
3 participants
@GuillaumeGomez
Member

GuillaumeGomez commented Jul 1, 2018

Show outdated Hide outdated src/lib.rs
@@ -318,6 +325,9 @@ status = "generate"
name = "new"
ignore = true
[[object.function]]
pattern = "[gs]et_background_pattern"
ignore = true

This comment has been minimized.

@EPashkin

EPashkin Jul 2, 2018

Member

Please add comment, why it ignored

@EPashkin

EPashkin Jul 2, 2018

Member

Please add comment, why it ignored

This comment has been minimized.

@sdroege

sdroege Jul 2, 2018

Member

Especially if it is not manually implemented either

@sdroege

sdroege Jul 2, 2018

Member

Especially if it is not manually implemented either

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jul 2, 2018

Member

Deprecated. I'll add the comment.

@GuillaumeGomez

GuillaumeGomez Jul 2, 2018

Member

Deprecated. I'll add the comment.

This comment has been minimized.

@EPashkin

EPashkin Jul 2, 2018

Member

It deprecated in 3.22 https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#gdk-window-get-background-pattern, so it can be used even in max available on CI 3.18.
So this not good reason to ignore.

@EPashkin

EPashkin Jul 2, 2018

Member

It deprecated in 3.22 https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#gdk-window-get-background-pattern, so it can be used even in max available on CI 3.18.
So this not good reason to ignore.

This comment has been minimized.

@GuillaumeGomez

GuillaumeGomez Jul 2, 2018

Member

Damn. You're hard in business. 😛

@GuillaumeGomez

GuillaumeGomez Jul 2, 2018

Member

Damn. You're hard in business. 😛

This comment has been minimized.

@EPashkin

EPashkin Jul 2, 2018

Member

😉

@EPashkin
//}
//pub fn pango_layout_line_get_clip_region(line: /*Ignored*/&pango::LayoutLine, x_origin: i32, y_origin: i32, index_ranges: &[i32], n_ranges: i32) -> Option<cairo::Region> {
//pub fn pango_layout_line_get_clip_region(line: &pango::LayoutLine, x_origin: i32, y_origin: i32, index_ranges: &[i32], n_ranges: i32) -> Option<cairo::Region> {

This comment has been minimized.

@EPashkin

EPashkin Jul 2, 2018

Member

This function seems also need manual implementation

@EPashkin

EPashkin Jul 2, 2018

Member

This function seems also need manual implementation

This comment has been minimized.

@sdroege

sdroege Jul 2, 2018

Member

Why is it not in the commented output why a manual impl is needed?

But the index_ranges and n_ranges need some manual work here. The n_ranges is half of the elements in index_ranges, and index_ranges is array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes.

@sdroege

sdroege Jul 2, 2018

Member

Why is it not in the commented output why a manual impl is needed?

But the index_ranges and n_ranges need some manual work here. The n_ranges is half of the elements in index_ranges, and index_ranges is array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes.

//fn get_setting(&self, name: &str, value: /*Ignored*/&mut glib::Value) -> bool {
// unsafe { TODO: call ffi::gdk_screen_get_setting() }
//}
fn get_setting(&self, name: &str, value: &mut glib::Value) -> bool {

This comment has been minimized.

@sdroege

sdroege Jul 2, 2018

Member

Same as above

@sdroege

sdroege Jul 2, 2018

Member

Same as above

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 2, 2018

Member

I might need some help for the following error(s):

error[E0277]: the trait bound `cairo::Pattern + 'static: std::marker::Sized` is not satisfied
   --> src/window.rs:143:5
    |
143 |     fn get_background_pattern(&self) -> Option<cairo::Pattern>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `cairo::Pattern + 'static` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `cairo::Pattern + 'static`
    = note: required by `std::option::Option`

error[E0277]: the trait bound `cairo::Pattern + 'static: std::marker::Sized` is not satisfied
   --> src/window.rs:192:5
    |
192 | /     fn get_background_pattern(&self) -> Option<cairo::Pattern> {
193 | |         unsafe {
194 | |             let ret = ffi::gdk_window_get_background_pattern(self.to_glib_none().0);
195 | |             if ret.is_null() {
...   |
200 | |         }
201 | |     }
    | |_____^ `cairo::Pattern + 'static` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `cairo::Pattern + 'static`
    = note: required by `std::option::Option`

error: aborting due to 2 previous errors

I have absolutely no clue why cairo::Pattern's size isn't known at compile-time. Any idea what's going on?

Member

GuillaumeGomez commented Jul 2, 2018

I might need some help for the following error(s):

error[E0277]: the trait bound `cairo::Pattern + 'static: std::marker::Sized` is not satisfied
   --> src/window.rs:143:5
    |
143 |     fn get_background_pattern(&self) -> Option<cairo::Pattern>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `cairo::Pattern + 'static` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `cairo::Pattern + 'static`
    = note: required by `std::option::Option`

error[E0277]: the trait bound `cairo::Pattern + 'static: std::marker::Sized` is not satisfied
   --> src/window.rs:192:5
    |
192 | /     fn get_background_pattern(&self) -> Option<cairo::Pattern> {
193 | |         unsafe {
194 | |             let ret = ffi::gdk_window_get_background_pattern(self.to_glib_none().0);
195 | |             if ret.is_null() {
...   |
200 | |         }
201 | |     }
    | |_____^ `cairo::Pattern + 'static` does not have a constant size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `cairo::Pattern + 'static`
    = note: required by `std::option::Option`

error: aborting due to 2 previous errors

I have absolutely no clue why cairo::Pattern's size isn't known at compile-time. Any idea what's going on?

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Jul 2, 2018

Member

cairo::Pattern is a trait. You have to box it here

Member

sdroege commented Jul 2, 2018

cairo::Pattern is a trait. You have to box it here

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 2, 2018

Member

Isn't it supposed to be an enum? I must have missed something... But anyway, I already tried to box it without succeeding. I'll try again tomorrow.

Member

GuillaumeGomez commented Jul 2, 2018

Isn't it supposed to be an enum? I must have missed something... But anyway, I already tried to box it without succeeding. I'll try again tomorrow.

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Jul 3, 2018

Member

Pattern looks like enum for me https://github.com/gtk-rs/cairo/blob/master/src/patterns.rs#L48-L55 😉
But error sure from trait.

Member

EPashkin commented Jul 3, 2018

Pattern looks like enum for me https://github.com/gtk-rs/cairo/blob/master/src/patterns.rs#L48-L55 😉
But error sure from trait.

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Jul 3, 2018

Member

Indeed, I misread. That looks all as if it has a static size. I wonder also where the 'static in the compiler error comes from, that might be a hint

Member

sdroege commented Jul 3, 2018

Indeed, I misread. That looks all as if it has a static size. I wonder also where the 'static in the compiler error comes from, that might be a hint

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 8, 2018

Member

FINALLY fixed the super ultra weird bug. Talk about weird stuff...

Member

GuillaumeGomez commented Jul 8, 2018

FINALLY fixed the super ultra weird bug. Talk about weird stuff...

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Jul 8, 2018

Member

FINALLY fixed the super ultra weird bug. Talk about weird stuff...

What was it exactly? :)

Member

sdroege commented Jul 8, 2018

FINALLY fixed the super ultra weird bug. Talk about weird stuff...

What was it exactly? :)

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 8, 2018

Member

rustc bug apparently.

Member

GuillaumeGomez commented Jul 8, 2018

rustc bug apparently.

@@ -139,6 +139,10 @@ pub trait WindowExtManual {
fn offscreen_window_get_surface(&self) -> Option<Surface>;
fn get_pixbuf(&self, src_x: i32, src_y: i32, width: i32, height: i32) -> Option<gdk_pixbuf::Pixbuf>;
fn get_background_pattern(&self) -> Option<cairo::Pattern>;

This comment has been minimized.

@EPashkin

EPashkin Jul 9, 2018

Member

Information about deprecation is lost

@EPashkin

EPashkin Jul 9, 2018

Member

Information about deprecation is lost

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Jul 9, 2018

Member

rustc bug apparently

Do you have some more details? :)

Member

sdroege commented Jul 9, 2018

rustc bug apparently

Do you have some more details? :)

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 9, 2018

Member

Do you have some more details? :)

Not at all. I updated the compiler and it worked.

Member

GuillaumeGomez commented Jul 9, 2018

Do you have some more details? :)

Not at all. I updated the compiler and it worked.

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Jul 9, 2018

Member

Not at all. I updated the compiler and it worked.

From which to which version?

Member

sdroege commented Jul 9, 2018

Not at all. I updated the compiler and it worked.

From which to which version?

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 9, 2018

Member

The 7th July nightly from the one we had on CI I assume.

Member

GuillaumeGomez commented Jul 9, 2018

The 7th July nightly from the one we had on CI I assume.

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Jul 9, 2018

Member

The 7th July nightly from the one we had on CI I assume.

So it was only a transient problem with nightly, stable/beta worked all the time? Good

Member

sdroege commented Jul 9, 2018

The 7th July nightly from the one we had on CI I assume.

So it was only a transient problem with nightly, stable/beta worked all the time? Good

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 9, 2018

Member

Apparently? I'm very surprised such a bug existed in the first place...

Member

GuillaumeGomez commented Jul 9, 2018

Apparently? I'm very surprised such a bug existed in the first place...

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Jul 9, 2018

Member

Then manual get_background_pattern not needed?

Member

EPashkin commented Jul 9, 2018

Then manual get_background_pattern not needed?

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Jul 9, 2018

Member

It still needed as cairo::Pattern don't have "from_glib_XX" :(

Member

EPashkin commented Jul 9, 2018

It still needed as cairo::Pattern don't have "from_glib_XX" :(

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 9, 2018

Member

Yep. I merge then!

Member

GuillaumeGomez commented Jul 9, 2018

Yep. I merge then!

@GuillaumeGomez GuillaumeGomez merged commit 64c41b0 into gtk-rs:master Jul 9, 2018

2 checks passed

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

@GuillaumeGomez GuillaumeGomez deleted the GuillaumeGomez:new-types branch Jul 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment