wlroots-rs icon indicating copy to clipboard operation
wlroots-rs copied to clipboard

DataDevice

Open Timidger opened this issue 7 years ago • 2 comments

This is one of the globals that the compositor needs to create at startup.

Either it needs to be provided in the constructor (like the I/O managers) or it needs to be passed in later (like the extension protocols).

I'm up for either, leaning towards the latter since this is sort of an "extension" and it's possible that a compositor may not want to implement this interface (and we should take a page out of wlroots' book and let the user decide).

Either way, it needs to live as long as the compositor and destroyed before it disconnects.

Need to also ensure only one global is registered at a time of this type.

Functions

  • [ ] send_selection Needs to only be possible if the DnD global has been made (so if an instance was made of the struct). Needs SeatClient to be made first.
  • [ ] set_selection

DataOffer

Events

  • [ ] destroy

Functions

  • [ ] dnd_actions Return bitfield, please wrap in a bitfield!
  • [ ] preferred_dnd_action`
  • [ ] in_ask
  • [ ] resource (unsafe)
  • [ ] data_source (Return DataSource)

DataSource

Events

  • [ ] destroy

Functions

  • [ ] resource (unsafe)
  • [ ] offer (Return DataOffer
  • [ ] seat_client (Return SeatClient)
  • [ ] mime_types (Wrap in Vec)
  • [ ] accepted
  • [ ] current_dnd_action
  • [ ] dnd_actions Return bitfield, like in DataOffer
  • [ ] compositor_actions Return bitfield, like in DataOffer
  • [ ] actions_set

Global Callbacks

They should be callable, setting them may be unsafe but probably not. They are already initialized in global creation. Double check because this could be safe.

  • [ ] accept
  • [ ] send
  • [ ] cancel

Global Cleanup

Timidger avatar Nov 09 '17 02:11 Timidger

For resource, do we just want to return the pointer or the wl_resource? I've got code implemented that returns the wl_resource. It's mainly semantics but mainly wondering..

SethBarberee avatar Feb 11 '19 06:02 SethBarberee

Honestly for those it's not a big deal since it'll probably never be used by the library user.

Just make an unsafe function that returns whatever is in the struct. Eg if it's a pointer don't dereference it just return it.

Timidger avatar Feb 11 '19 12:02 Timidger