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

Missing clipboard constants #120

Closed
withoutboats opened this Issue Jun 5, 2016 · 11 comments

Comments

Projects
None yet
5 participants
@withoutboats

withoutboats commented Jun 5, 2016

As far as I can tell, this crate is missing bindings to the GDK_SELECTION_CLIPBOARD, GDK_SELECTION_PRIMARY, and GDK_SELECTION_SECONDARY constants. These constants are necessary to implement cut/copy/paste with GTK.

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jun 5, 2016

Member

Indeed, strange...

Member

GuillaumeGomez commented Jun 5, 2016

Indeed, strange...

@gkoz

This comment has been minimized.

Show comment
Hide comment
@gkoz

gkoz Jun 5, 2016

Member

Huh, that's an interesting case. Apparently these constants aren't available in gir definitions.

The way to bind the GdkAtom type has not been settled yet. I'm leaning toward not exposing it at all and converting to/from strings transparently. The significance of performance impact of this approach is not quite clear... These constants would then be strings.

Member

gkoz commented Jun 5, 2016

Huh, that's an interesting case. Apparently these constants aren't available in gir definitions.

The way to bind the GdkAtom type has not been settled yet. I'm leaning toward not exposing it at all and converting to/from strings transparently. The significance of performance impact of this approach is not quite clear... These constants would then be strings.

@withoutboats

This comment has been minimized.

Show comment
Hide comment
@withoutboats

withoutboats Jul 3, 2016

Hey I don't want to be a bother, but is there any progress on this? Copy paste is a blocker for me to release an alpha of the terminal emulator I'm working on.

If you're not ready to commit to any particular strategy for defining these constants, I'm happy to maintain something myself in my repo, but I don't understand GDK or C all that well, and my attempts to provide bindings for them have failed. :-\

withoutboats commented Jul 3, 2016

Hey I don't want to be a bother, but is there any progress on this? Copy paste is a blocker for me to release an alpha of the terminal emulator I'm working on.

If you're not ready to commit to any particular strategy for defining these constants, I'm happy to maintain something myself in my repo, but I don't understand GDK or C all that well, and my attempts to provide bindings for them have failed. :-\

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jul 4, 2016

Member

No, sorry. I'll add them by hand as soon as possible.

Member

GuillaumeGomez commented Jul 4, 2016

No, sorry. I'll add them by hand as soon as possible.

@gkoz

This comment has been minimized.

Show comment
Hide comment
@gkoz

gkoz Jul 4, 2016

Member

After thinking a bit more I suppose it's more straightforward to actually use the Atom type, implement From<&str> for it and define these constants manually. There's an issue that the generator tries to take it by reference but it should probably be passed by value (it's Copy after all).

Member

gkoz commented Jul 4, 2016

After thinking a bit more I suppose it's more straightforward to actually use the Atom type, implement From<&str> for it and define these constants manually. There's an issue that the generator tries to take it by reference but it should probably be passed by value (it's Copy after all).

@Susurrus

This comment has been minimized.

Show comment
Hide comment
@Susurrus

Susurrus Jun 12, 2017

Contributor

I'm actually looking to use the GDK_SELECTION_* constants as well, but I didn't find them in the code, just this old issue. If this was indeed implemented, what's the proper way to get GDK_SELECTION_CLIPBOARD?

Contributor

Susurrus commented Jun 12, 2017

I'm actually looking to use the GDK_SELECTION_* constants as well, but I didn't find them in the code, just this old issue. If this was indeed implemented, what's the proper way to get GDK_SELECTION_CLIPBOARD?

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jun 12, 2017

Member

Hum, I don't find either. Also not in gdk_sys file: https://github.com/gtk-rs/sys/blob/master/gdk-sys/src/lib.rs

So it just disappeared?

Member

GuillaumeGomez commented Jun 12, 2017

Hum, I don't find either. Also not in gdk_sys file: https://github.com/gtk-rs/sys/blob/master/gdk-sys/src/lib.rs

So it just disappeared?

@Susurrus

This comment has been minimized.

Show comment
Hide comment
@Susurrus

Susurrus Jun 12, 2017

Contributor

Well the commit that closed this issue never implemented it. Just implemented From<&str> I guess.

Contributor

Susurrus commented Jun 12, 2017

Well the commit that closed this issue never implemented it. Just implemented From<&str> I guess.

@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Jun 12, 2017

Member

Well, I guess it's re-generate the gdk-sys. Not sure I'll have the time today so don't hesitate to do it.

Member

GuillaumeGomez commented Jun 12, 2017

Well, I guess it's re-generate the gdk-sys. Not sure I'll have the time today so don't hesitate to do it.

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Jun 12, 2017

Member

It not in gir, so regen not work.

Seems it need implemented in https://github.com/gtk-rs/gdk/blob/master/src/atom.rs#L11 or directily in lib

Member

EPashkin commented Jun 12, 2017

It not in gir, so regen not work.

Seems it need implemented in https://github.com/gtk-rs/gdk/blob/master/src/atom.rs#L11 or directily in lib

@Susurrus

This comment has been minimized.

Show comment
Hide comment
@Susurrus

Susurrus Jun 12, 2017

Contributor

Yeah, there're several constants missing. I'll file a PR for this if it's as easy as adding them to src/atom.rs.

Contributor

Susurrus commented Jun 12, 2017

Yeah, there're several constants missing. I'll file a PR for this if it's as easy as adding them to src/atom.rs.

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