Skip to content

Commit

Permalink
add dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
luongthanhlam committed Mar 11, 2021
1 parent 93b2a73 commit e093616
Show file tree
Hide file tree
Showing 27 changed files with 8,498 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/github.com/dkolbly/wl
Submodule wl deleted from b06f57
1 change: 0 additions & 1 deletion src/github.com/dkolbly/wl-scanner
Submodule wl-scanner deleted from 635e0a
25 changes: 25 additions & 0 deletions src/github.com/dkolbly/wl-scanner/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2016, sternix
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60 changes: 60 additions & 0 deletions src/github.com/dkolbly/wl-scanner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
wl-scanner
==========

The `wl-scanner` project is designed parse and generate Go client code
from a wayland protocol file.

In its base form, it produces the `client.go` code in
`github.com/dkolbly/wl` from the canonical definition of the wayland
protocol at
https://cgit.freedesktop.org/wayland/wayland/plain/protocol/wayland.xml

It is similar in concept to the wayland-scanner tool which was
developed for generating the C client library.

This is a hobby project intended to help people understand the
wayland.xml protocol file and the generation go code, as well as to
help build client libraries for protocols around Wayland.

## Usage

```
go get github.com/dkolbly/wl-scanner
# generate a client for the base protocol
wl-scanner -source https://cgit.freedesktop.org/wayland/wayland/plain/protocol/wayland.xml \
-output $GOPATH/src/github.com/dkolbly/wl/client.go
# generate a client for the xdg-shell protocol
wl-scanner -pkg xdg \
-source https://raw.githubusercontent.com/wayland-project/wayland-protocols/master/stable/xdg-shell/xdg-shell.xml \
-output $GOPATH/src/github.com/dkolbly/wl/xdg/shell.go
```

### Unstable Protocols

Unstable protocols can be generated in a way that makes it relatively
easy to upgrade to newer versions of the protocol, under the assumption
that changes are relatively small. This is done by stripping the "_vN" suffix,
as for example:

```
wl-scanner -pkg zxdg \
-source https://raw.githubusercontent.com/wayland-project/wayland-protocols/master/unstable/xdg-shell/xdg-shell-unstable-v6.xml \
-output $GOPATH/src/github.com/dkolbly/wl/xdg-unstable-v6/shell.go
```

The `zxdg` package name is preserved, but this can be imported in the client application
as:

```
import (
xdg "github.com/dkolbly/wl/xdg-unstable-v6"
)
```

and then most code will hopefully be able to port from one major
change to another. Obviously, mileage will vary depending on the
extent of the change.


2 changes: 2 additions & 0 deletions src/github.com/dkolbly/wl-scanner/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
allow-null
bitfield
Loading

0 comments on commit e093616

Please sign in to comment.