{"action":"created","issue":{"url":"https://api.github.com/repos/gtk-rs/gdk/issues/140","repository_url":"https://api.github.com/repos/gtk-rs/gdk","labels_url":"https://api.github.com/repos/gtk-rs/gdk/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/gtk-rs/gdk/issues/140/comments","events_url":"https://api.github.com/repos/gtk-rs/gdk/issues/140/events","html_url":"https://github.com/gtk-rs/gdk/pull/140","id":212580137,"number":140,"title":"Alternate rgba implementation","user":{"login":"Susurrus","id":206363,"avatar_url":"https://avatars2.githubusercontent.com/u/206363?v=3","gravatar_id":"","url":"https://api.github.com/users/Susurrus","html_url":"https://github.com/Susurrus","followers_url":"https://api.github.com/users/Susurrus/followers","following_url":"https://api.github.com/users/Susurrus/following{/other_user}","gists_url":"https://api.github.com/users/Susurrus/gists{/gist_id}","starred_url":"https://api.github.com/users/Susurrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Susurrus/subscriptions","organizations_url":"https://api.github.com/users/Susurrus/orgs","repos_url":"https://api.github.com/users/Susurrus/repos","events_url":"https://api.github.com/users/Susurrus/events{/privacy}","received_events_url":"https://api.github.com/users/Susurrus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-03-07T22:32:31Z","updated_at":"2017-03-08T10:43:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/gtk-rs/gdk/pulls/140","html_url":"https://github.com/gtk-rs/gdk/pull/140","diff_url":"https://github.com/gtk-rs/gdk/pull/140.diff","patch_url":"https://github.com/gtk-rs/gdk/pull/140.patch"},"body":"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.\r\n\r\nI'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.\r\n\r\nDo 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 an `Option` type but this trait uses `Result` 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?"},"comment":{"url":"https://api.github.com/repos/gtk-rs/gdk/issues/comments/285008191","html_url":"https://github.com/gtk-rs/gdk/pull/140#issuecomment-285008191","issue_url":"https://api.github.com/repos/gtk-rs/gdk/issues/140","id":285008191,"user":{"login":"EPashkin","id":584258,"avatar_url":"https://avatars1.githubusercontent.com/u/584258?v=3","gravatar_id":"","url":"https://api.github.com/users/EPashkin","html_url":"https://github.com/EPashkin","followers_url":"https://api.github.com/users/EPashkin/followers","following_url":"https://api.github.com/users/EPashkin/following{/other_user}","gists_url":"https://api.github.com/users/EPashkin/gists{/gist_id}","starred_url":"https://api.github.com/users/EPashkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EPashkin/subscriptions","organizations_url":"https://api.github.com/users/EPashkin/orgs","repos_url":"https://api.github.com/users/EPashkin/repos","events_url":"https://api.github.com/users/EPashkin/events{/privacy}","received_events_url":"https://api.github.com/users/EPashkin/received_events","type":"User","site_admin":false},"created_at":"2017-03-08T10:43:33Z","updated_at":"2017-03-08T10:43:33Z","body":"This as defined in glib:\r\n```\r\n/// Sets a value.\r\npub trait SetValue: StaticType {\r\n    unsafe fn set_value(&mut Value, &Self);\r\n}\r\n```\r\nmay to be same as \r\n```\r\npub trait SetValueOptional: SetValue {\r\n    unsafe fn set_value_optional(&mut Value, Option<&Self>);\r\n}\r\n```\r\n```"}}
{"actor":{"display_login":"EPashkin"}}