-
-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
I just realized that I didn't implement |
src/rgba.rs
Outdated
|
||
fn parse(&mut self, spec: &str) -> bool { | ||
impl Eq for RGBA {} |
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.
move this after PartialEq
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.
I had just arranged everything alphabetically, but I'll move this if you like.
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.
Actually, better move FromStr
, Hash
, PartiallyEq
here. This way all xGlibPtrx will go to one place
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.
At minimum better not separate Eq and Partial Eq
with this Gtks
and both function of |
About usage |
also cc @GuillaumeGomez
|
unsafe fn set_value(value: &mut glib::Value, this: &Self) { Shouldn't |
This as defined in glib:
may to be same as
|
Hum ok, too bad... |
So what needs to be done to wrap up this PR? From your comments it looks like:
Is that it? |
For me it seems complete list. |
Alright, that should all be implemented. Local code that I have is still working correctly. I also updated gtk-rs/gtk#462 so that it's now dependent on this PR. |
@Susurrus, Thanks @GuillaumeGomez, what you think: this PR or #139 ? |
Code seems ok to me but CIs errors seem legit. |
Whose? |
check_init |
@GuillaumeGomez you right.
|
Whoops, forgot I left those out and meant to ask about what functions actually needed them. Good catch! So I've pushed a new version with fixes. |
I pushed another version that fixes a minor style issue and also exports the |
Ping |
Oups, forgot about it... Thanks! |
That takes into account all the conversation over in #139 and implements RGBA as a custom struct. The end-use usability between this and #139 is vastly improved. Basically every function supported by RGBA corresponds to an existing trait in Rust.
I've done some testing of some of the various code here as I have GTK working with these changes and my own application using both. I don't fully understand the memory management done by GTK for the
GdkRGBA
struct behind the scenes but I haven't run into crashes here.Do note that there is one outstanding issue here and that's the error type to use for the
FromStr
trait. Since the GTK interface just uses anOption
type but this trait usesResult
I had to make up an error type. It looks like Glib has some error types but none of them looked appropriate. I think it's good to implement this trait but I don't think this is the best way to do the error type. Anyone have any ideas?