New to Wayland, Need suggestion on a starting point
Pekka Paalanen
ppaalanen at gmail.com
Tue May 6 03:51:16 PDT 2014
On Tue, 06 May 2014 15:59:58 +0530
Srivardhan <sri.hebbar at samsung.com> wrote:
>
> > -----Original Message-----
> > From: wayland-devel [mailto:wayland-devel-
> > bounces at lists.freedesktop.org] On Behalf Of Pekka Paalanen
> > Sent: Monday, May 05, 2014 5:36 PM
> > To: Srivardhan
> > Cc: 'Jason Ekstrand'; wayland-devel at lists.freedesktop.org
> > Subject: Re: New to Wayland, Need suggestion on a starting point
> >
> > My idea is to not use libwayland at all. Instead, you would
> > duplicate all
> the
> > needed parts in a stand-alone program. The starting point would be
> > to
> relay
> > Wayland messages in both directions without parsing them at all
> > beyond the message size field. You just need to make sure to handle
> > file descriptors, otherwise it would be just a byte for byte copy.
> >
> > Once that works, you can already dump the header of each message,
> > allowing the tool to dump at least something on unknown protocol
> > extensions. The next step would be to read in the protocol XML
> > files so
> that
> > you can actually parse and print the messages. You start with
> > wl_display
> as
> > that is needed to maintain object references, and then do the rest
> > of the core protocol. Once you handle the core protocol, you also
> > handle all extensions that can ever be, as long as you have their
> > XML description.
> >
> > You could use a custom generator to convert the XML into C data
> structures,
> > but I would prefer if the tool read in the XML files directly. That
> > way
> the built
> > tool is not dependent on any particular protocol version it was
> > built with
> but
> > you can use it on everything.
> > This would be very useful when developing protocols as one would
> > not need to recompile the dumping tool all the time. The XML files
> > are installed by each project maintaining them (or should be), so
> > they would be always available in distribution -devel packages I
> > assume.
> >
> > That would make the dumping tool an independent project. In the
> > future, it could then be a basis for more sophisticated tools, like
> > an object state recorder/viewer and graphical visualization, or
> > maybe co-operate with existing protocol visualization tools.
> >
> > This project would introduce you to Wayland starting from the
> > lowest level
> of
> > the protocol. If you wish to learn how Wayland works on a higher
> > level,
> with
> > semantics, this would be a slow path, however.
> >
>
> Hi,
>
> I guess I need more knowledge on how Wayland protocol is working and
> how Weston is working to implement this. I would do more reading and
> code study of Weston and then would come back to this.
Hi,
actually no. This stuff is more Unix system programming than anything
specific to Weston or even Wayland, at least at first: how to handle
unix sockets and pass file descriptors as ancillary data. See 'man 7
unix' and SCM_RIGHTS.
I perfectly understand if you would like something that dives
more directly into Wayland things first, rather than the boring(?)
low-level socket stuff. Anyway, the protocol dumper is just one idea.
Thanks,
pq
More information about the wayland-devel
mailing list