mirror of
https://github.com/openharmony/third_party_wayland_standard.git
synced 2026-07-01 20:54:02 -04:00
update OpenHarmony 2.0 Canary
This commit is contained in:
@@ -0,0 +1,260 @@
|
||||
import("//build/ohos.gni")
|
||||
import("//third_party/wayland_standard/wayland_protocol.gni")
|
||||
|
||||
config("wayland_default_config") {
|
||||
cflags = [
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
"-Wno-cast-qual",
|
||||
"-Wno-pointer-arith",
|
||||
"-Wno-unused-parameter",
|
||||
"-Wno-unused-variable",
|
||||
]
|
||||
}
|
||||
|
||||
## Generate Wayland Version {{{
|
||||
action("wayland_version") {
|
||||
script = "gen_wayland_version_header_wrapper.sh"
|
||||
inputs = [ "src/wayland-version.h.in" ]
|
||||
outputs = [ "$root_gen_dir/" + rebase_path(get_path_info(inputs[0], "dir"), "//") + "/wayland-version.h" ]
|
||||
args = [
|
||||
rebase_path("gen_wayland_version_header.sh", root_build_dir),
|
||||
rebase_path("configure.ac", root_build_dir),
|
||||
rebase_path(inputs[0], root_build_dir),
|
||||
rebase_path(outputs[0], root_build_dir),
|
||||
]
|
||||
}
|
||||
## Generate Wayland Version }}}
|
||||
|
||||
## Build wayland_scanner {{{
|
||||
config("wayland_scanner_config") {
|
||||
visibility = [ ":*" ]
|
||||
|
||||
include_dirs = [
|
||||
".",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
"-Wno-int-conversion",
|
||||
"-Wno-implicit-function-declaration",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_executable("wayland_scanner") {
|
||||
install_enable = false
|
||||
|
||||
sources = [
|
||||
"src/scanner.c",
|
||||
]
|
||||
|
||||
configs = [
|
||||
":wayland_scanner_config",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//third_party/expat:expat",
|
||||
":wayland_util",
|
||||
]
|
||||
|
||||
part_name = "graphic_standard"
|
||||
subsystem_name = "graphic"
|
||||
}
|
||||
## Build wayland_scanner }}}
|
||||
|
||||
## Generate Wayland Protocols {{{
|
||||
wayland_protocol("wayland_core_protocol") {
|
||||
sources = [ "protocol/wayland.xml" ]
|
||||
}
|
||||
## Generate Wayland Protocols }}}
|
||||
|
||||
## Build wayland_util.a {{{
|
||||
config("wayland_util_config") {
|
||||
visibility = [ ":*" ]
|
||||
|
||||
include_dirs = [
|
||||
]
|
||||
|
||||
cflags = [
|
||||
]
|
||||
}
|
||||
|
||||
config("wayland_util_public_config") {
|
||||
include_dirs = [
|
||||
"include/src",
|
||||
"include/protocol",
|
||||
"src",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
"-Wno-macro-redefined",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_static_library("wayland_util") {
|
||||
sources = [
|
||||
"src/wayland-private.h",
|
||||
"src/wayland-util.c",
|
||||
"src/wayland-util.h",
|
||||
]
|
||||
|
||||
configs = [
|
||||
":wayland_util_config",
|
||||
":wayland_default_config",
|
||||
]
|
||||
|
||||
public_configs = [
|
||||
":wayland_util_public_config",
|
||||
]
|
||||
|
||||
deps = [
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
]
|
||||
}
|
||||
## Build wayland_util.a }}}
|
||||
|
||||
## Build libwayland_cursor.a {{{
|
||||
config("libwayland_cursor_config") {
|
||||
visibility = [ ":*" ]
|
||||
|
||||
include_dirs = [
|
||||
".",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
"-Wno-macro-redefined",
|
||||
]
|
||||
}
|
||||
|
||||
config("libwayland_cursor_public_config") {
|
||||
include_dirs = [
|
||||
"cursor",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
]
|
||||
}
|
||||
|
||||
ohos_static_library("libwayland_cursor") {
|
||||
sources = [
|
||||
"cursor/wayland-cursor.c",
|
||||
"cursor/os-compatibility.c",
|
||||
"cursor/xcursor.c",
|
||||
]
|
||||
|
||||
configs = [
|
||||
":wayland_default_config",
|
||||
":libwayland_cursor_config",
|
||||
]
|
||||
|
||||
public_configs = [
|
||||
":libwayland_cursor_public_config",
|
||||
]
|
||||
|
||||
deps = [
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
":wayland_core_protocol",
|
||||
]
|
||||
}
|
||||
## Build libwayland_cursor.a }}}
|
||||
|
||||
## Build libwayland_client.a {{{
|
||||
config("libwayland_client_config") {
|
||||
visibility = [ ":*" ]
|
||||
|
||||
include_dirs = [
|
||||
]
|
||||
|
||||
cflags = [
|
||||
]
|
||||
}
|
||||
|
||||
config("libwayland_client_public_config") {
|
||||
include_dirs = [
|
||||
"src",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
]
|
||||
}
|
||||
|
||||
ohos_static_library("libwayland_client") {
|
||||
sources = [
|
||||
"src/connection.c",
|
||||
"src/wayland-client.c",
|
||||
"src/wayland-os.c",
|
||||
]
|
||||
|
||||
configs = [
|
||||
":wayland_default_config",
|
||||
":libwayland_client_config",
|
||||
]
|
||||
|
||||
public_configs = [
|
||||
":libwayland_client_public_config",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//third_party/libffi:ffi",
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
":wayland_core_protocol",
|
||||
":wayland_version",
|
||||
]
|
||||
}
|
||||
## Build libwayland_client.a }}}
|
||||
|
||||
## Build libwayland_server.a {{{
|
||||
config("libwayland_server_config") {
|
||||
visibility = [ ":*" ]
|
||||
|
||||
include_dirs = [
|
||||
"src",
|
||||
".",
|
||||
]
|
||||
|
||||
cflags = [
|
||||
"-Wno-macro-redefined",
|
||||
]
|
||||
}
|
||||
|
||||
config("libwayland_server_public_config") {
|
||||
include_dirs = [
|
||||
]
|
||||
|
||||
cflags = [
|
||||
]
|
||||
}
|
||||
|
||||
ohos_static_library("libwayland_server") {
|
||||
sources = [
|
||||
"src/connection.c",
|
||||
"src/wayland-os.c",
|
||||
"src/wayland-server.c",
|
||||
"src/wayland-shm.c",
|
||||
"src/event-loop.c",
|
||||
]
|
||||
|
||||
configs = [
|
||||
":wayland_default_config",
|
||||
":libwayland_server_config",
|
||||
]
|
||||
|
||||
public_configs = [
|
||||
":libwayland_server_public_config",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//third_party/libffi:ffi",
|
||||
":wayland_util",
|
||||
]
|
||||
|
||||
public_deps = [
|
||||
":wayland_core_protocol",
|
||||
]
|
||||
}
|
||||
## Build libwayland_server.a }}}
|
||||
+344
@@ -0,0 +1,344 @@
|
||||
Contributing to Wayland
|
||||
=======================
|
||||
|
||||
Sending patches
|
||||
---------------
|
||||
|
||||
Patches should be sent via
|
||||
[GitLab merge requests](https://docs.gitlab.com/ce/gitlab-basics/add-merge-request.html).
|
||||
Wayland is
|
||||
[hosted on freedesktop.org's GitLab](https://gitlab.freedesktop.org/wayland/wayland/):
|
||||
in order to submit code, you should create an account on this GitLab instance,
|
||||
fork the core Wayland repository, push your changes to a branch in your new
|
||||
repository, and then submit these patches for review through a merge request.
|
||||
|
||||
Wayland formerly accepted patches via `git-send-email`, sent to
|
||||
**wayland-devel@lists.freedesktop.org**; these were
|
||||
[tracked using Patchwork](https://patchwork.freedesktop.org/project/wayland/).
|
||||
Some old patches continue to be sent this way, and we may accept small new
|
||||
patches sent to the list, but please send all new patches through GitLab merge
|
||||
requests.
|
||||
|
||||
|
||||
Formatting and separating commits
|
||||
---------------------------------
|
||||
|
||||
Unlike many projects using GitHub and GitLab, Wayland has a
|
||||
[linear, 'recipe' style history](http://www.bitsnbites.eu/git-history-work-log-vs-recipe/).
|
||||
This means that every commit should be small, digestible, stand-alone, and
|
||||
functional. Rather than a purely chronological commit history like this:
|
||||
|
||||
connection: plug a fd leak
|
||||
plug another fd leak
|
||||
connection: init fds to -1
|
||||
close all fds
|
||||
refactor checks into a new function
|
||||
don't close fds we handed out
|
||||
|
||||
we aim to have a clean history which only reflects the final state, broken up
|
||||
into functional groupings:
|
||||
|
||||
connection: Refactor out closure allocation
|
||||
connection: Clear fds we shouldn't close to -1
|
||||
connection: Make wl_closure_destroy() close fds of undispatched closures
|
||||
|
||||
This ensures that the final patch series only contains the final state,
|
||||
without the changes and missteps taken along the development process.
|
||||
|
||||
The first line of a commit message should contain a prefix indicating
|
||||
what part is affected by the patch followed by one sentence that
|
||||
describes the change. For examples:
|
||||
|
||||
protocol: Support scaled outputs and surfaces
|
||||
|
||||
and
|
||||
|
||||
doc: generate server documentation from XML too
|
||||
|
||||
If in doubt what prefix to use, look at other commits that change the
|
||||
same file(s) as the patch being sent.
|
||||
|
||||
The body of the commit message should describe what the patch changes
|
||||
and why, and also note any particular side effects. This shouldn't be
|
||||
empty on most of the cases. It shouldn't take a lot of effort to write
|
||||
a commit message for an obvious change, so an empty commit message
|
||||
body is only acceptable if the questions "What?" and "Why?" are already
|
||||
answered on the one-line summary.
|
||||
|
||||
The lines of the commit message should have at most 76 characters, to
|
||||
cope with the way git log presents them.
|
||||
|
||||
See [notes on commit messages] for a recommended reading on writing commit
|
||||
messages.
|
||||
|
||||
Your patches should also include a Signed-off-by line with your name and
|
||||
email address. If you're not the patch's original author, you should
|
||||
also gather S-o-b's by them (and/or whomever gave the patch to you.) The
|
||||
significance of this is that it certifies that you created the patch,
|
||||
that it was created under an appropriate open source license, or
|
||||
provided to you under those terms. This lets us indicate a chain of
|
||||
responsibility for the copyright status of the code.
|
||||
|
||||
We won't reject patches that lack S-o-b, but it is strongly recommended.
|
||||
|
||||
When you re-send patches, revised or not, it would be very good to document the
|
||||
changes compared to the previous revision in the commit message and/or the
|
||||
merge request. If you have already received Reviewed-by or Acked-by tags, you
|
||||
should evaluate whether they still apply and include them in the respective
|
||||
commit messages. Otherwise the tags may be lost, reviewers miss the credit they
|
||||
deserve, and the patches may cause redundant review effort.
|
||||
|
||||
|
||||
Tracking patches and following up
|
||||
---------------------------------
|
||||
|
||||
Once submitted to GitLab, your patches will be reviewed by the Wayland
|
||||
development team on GitLab. Review may be entirely positive and result in your
|
||||
code landing instantly, in which case, great! You're done. However, we may ask
|
||||
you to make some revisions: fixing some bugs we've noticed, working to a
|
||||
slightly different design, or adding documentation and tests.
|
||||
|
||||
If you do get asked to revise the patches, please bear in mind the notes above.
|
||||
You should use `git rebase -i` to make revisions, so that your patches follow
|
||||
the clear linear split documented above. Following that split makes it easier
|
||||
for reviewers to understand your work, and to verify that the code you're
|
||||
submitting is correct.
|
||||
|
||||
A common request is to split single large patch into multiple patches. This can
|
||||
happen, for example, if when adding a new feature you notice a bug elsewhere
|
||||
which you need to fix to progress. Separating these changes into separate
|
||||
commits will allow us to verify and land the bugfix quickly, pushing part of
|
||||
your work for the good of everyone, whilst revision and discussion continues on
|
||||
the larger feature part. It also allows us to direct you towards reviewers who
|
||||
best understand the different areas you are working on.
|
||||
|
||||
When you have made any requested changes, please rebase the commits, verify
|
||||
that they still individually look good, then force-push your new branch to
|
||||
GitLab. This will update the merge request and notify everyone subscribed to
|
||||
your merge request, so they can review it again.
|
||||
|
||||
There are also
|
||||
[many GitLab CLI clients](https://about.gitlab.com/applications/#cli-clients),
|
||||
if you prefer to avoid the web interface. It may be difficult to follow review
|
||||
comments without using the web interface though, so we do recommend using this
|
||||
to go through the review process, even if you use other clients to track the
|
||||
list of available patches.
|
||||
|
||||
|
||||
Coding style
|
||||
------------
|
||||
|
||||
You should follow the style of the file you're editing. In general, we
|
||||
try to follow the rules below.
|
||||
|
||||
**Note: this file uses spaces due to markdown rendering issues for tabs.
|
||||
Code must be implemented using tabs.**
|
||||
|
||||
- indent with tabs, and a tab is always 8 characters wide
|
||||
- opening braces are on the same line as the if statement;
|
||||
- no braces in an if-body with just one statement;
|
||||
- if one of the branches of an if-else condition has braces, then the
|
||||
other branch should also have braces;
|
||||
- there is always an empty line between variable declarations and the
|
||||
code;
|
||||
|
||||
```c
|
||||
static int
|
||||
my_function(void)
|
||||
{
|
||||
int a = 0;
|
||||
|
||||
if (a)
|
||||
b();
|
||||
else
|
||||
c();
|
||||
|
||||
if (a) {
|
||||
b();
|
||||
c();
|
||||
} else {
|
||||
d();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- lines should be less than 80 characters wide;
|
||||
- when breaking lines with functions calls, the parameters are aligned
|
||||
with the opening parentheses;
|
||||
- when assigning a variable with the result of a function call, if the
|
||||
line would be longer we break it around the equal '=' sign if it makes
|
||||
sense;
|
||||
|
||||
```c
|
||||
long_variable_name =
|
||||
function_with_a_really_long_name(parameter1, parameter2,
|
||||
parameter3, parameter4);
|
||||
|
||||
x = function_with_a_really_long_name(parameter1, parameter2,
|
||||
parameter3, parameter4);
|
||||
```
|
||||
|
||||
Conduct
|
||||
=======
|
||||
|
||||
As a freedesktop.org project, Wayland follows the Contributor Covenant,
|
||||
found at:
|
||||
https://www.freedesktop.org/wiki/CodeOfConduct
|
||||
|
||||
Please conduct yourself in a respectful and civilised manner when
|
||||
interacting with community members on mailing lists, IRC, or bug
|
||||
trackers. The community represents the project as a whole, and abusive
|
||||
or bullying behaviour is not tolerated by the project.
|
||||
|
||||
|
||||
Licensing
|
||||
=========
|
||||
|
||||
Wayland is licensed with the intention to be usable anywhere X.org is.
|
||||
Originally, X.org was covered under the MIT X11 license, but changed to
|
||||
the MIT Expat license. Similarly, Wayland was covered initially as MIT
|
||||
X11 licensed, but changed to the MIT Expat license, following in X.org's
|
||||
footsteps. Other than wording, the two licenses are substantially the
|
||||
same, with the exception of a no-advertising clause in X11 not included
|
||||
in Expat.
|
||||
|
||||
New source code files should specify the MIT Expat license in their
|
||||
boilerplate, as part of the copyright statement.
|
||||
|
||||
|
||||
Review
|
||||
======
|
||||
|
||||
All patches, even trivial ones, require at least one positive review
|
||||
(Reviewed-by). Additionally, if no Reviewed-by's have been given by
|
||||
people with commit access, there needs to be at least one Acked-by from
|
||||
someone with commit access. A person with commit access is expected to be
|
||||
able to evaluate the patch with respect to the project scope and architecture.
|
||||
|
||||
The below review guidelines are intended to be interpreted in spirit, not by
|
||||
the letter. There may be circumstances where some guidelines are better
|
||||
ignored. We rely very much on the judgement of reviewers and commit rights
|
||||
holders.
|
||||
|
||||
During review, the following matters should be checked:
|
||||
|
||||
- The commit message explains why the change is being made.
|
||||
|
||||
- The code fits the project's scope.
|
||||
|
||||
- The code license is the same MIT licence the project generally uses.
|
||||
|
||||
- Stable ABI or API is not broken.
|
||||
|
||||
- Stable ABI or API additions must be justified by actual use cases, not only
|
||||
by speculation. They must also be documented, and it is strongly recommended to
|
||||
include tests exercising the additions in the test suite.
|
||||
|
||||
- The code fits the existing software architecture, e.g. no layering
|
||||
violations.
|
||||
|
||||
- The code is correct and does not introduce new failures for existing users,
|
||||
does not add new corner-case bugs, and does not introduce new compiler
|
||||
warnings.
|
||||
|
||||
- The patch does what it says in the commit message and changes nothing else.
|
||||
|
||||
- The patch is a single logical change. If the commit message addresses
|
||||
multiple points, it is a hint that the commit might need splitting up.
|
||||
|
||||
- A bug fix should target the underlying root cause instead of hiding symptoms.
|
||||
If a complete fix is not practical, partial fixes are acceptable if they come
|
||||
with code comments and filed Gitlab issues for the remaining bugs.
|
||||
|
||||
- The bug root cause rule applies to external software components as well, e.g.
|
||||
do not work around kernel driver issues in userspace.
|
||||
|
||||
- The test suite passes.
|
||||
|
||||
- The code does not depend on API or ABI which has no working free open source
|
||||
implementation.
|
||||
|
||||
- The code is not dead or untestable. E.g. if there are no free open source
|
||||
software users for it then it is effectively dead code.
|
||||
|
||||
- The code is written to be easy to understand, or if code cannot be clear
|
||||
enough on its own there are code comments to explain it.
|
||||
|
||||
- The code is minimal, i.e. prefer refactor and re-use when possible unless
|
||||
clarity suffers.
|
||||
|
||||
- The code adheres to the style guidelines.
|
||||
|
||||
- In a patch series, every intermediate step adheres to the above guidelines.
|
||||
|
||||
|
||||
Commit rights
|
||||
=============
|
||||
|
||||
Commit rights will be granted to anyone who requests them and fulfills the
|
||||
below criteria:
|
||||
|
||||
- Submitted some (10 as a rule of thumb) non-trivial (not just simple
|
||||
spelling fixes and whitespace adjustment) patches that have been merged
|
||||
already.
|
||||
|
||||
- Are actively participating in public discussions about their work (on the
|
||||
mailing list or IRC). This should not be interpreted as a requirement to
|
||||
review other peoples patches but just make sure that patch submission isn't
|
||||
one-way communication. Cross-review is still highly encouraged.
|
||||
|
||||
- Will be regularly contributing further patches. This includes regular
|
||||
contributors to other parts of the open source graphics stack who only
|
||||
do the occasional development in this project.
|
||||
|
||||
- Agrees to use their commit rights in accordance with the documented merge
|
||||
criteria, tools, and processes.
|
||||
|
||||
To apply for commit rights, create a new issue in gitlab for the respective
|
||||
project and give it the "accounts" label.
|
||||
|
||||
Committers are encouraged to request their commit rights get removed when they
|
||||
no longer contribute to the project. Commit rights will be reinstated when they
|
||||
come back to the project.
|
||||
|
||||
Maintainers and committers should encourage contributors to request commit
|
||||
rights, especially junior contributors tend to underestimate their skills.
|
||||
|
||||
|
||||
Stabilising for releases
|
||||
========================
|
||||
|
||||
A release cycle ends with a stable release which also starts a new cycle and
|
||||
lifts any code freezes. Gradual code freezing towards a stable release starts
|
||||
with an alpha release. The release stages of a cycle are:
|
||||
|
||||
- **Alpha release**:
|
||||
Signified by version number #.#.91.
|
||||
Major features must have landed before this. Major features include
|
||||
invasive code motion and refactoring, high risk changes, and new stable
|
||||
library ABI.
|
||||
|
||||
- **Beta release**:
|
||||
Signified by version number #.#.92.
|
||||
Minor features must have landed before this. Minor features include all
|
||||
new features that are not major, low risk changes, clean-ups, and
|
||||
documentation. Stable ABI that was new in the alpha release can be removed
|
||||
before a beta release if necessary.
|
||||
|
||||
- **Release candidates (RC)**:
|
||||
Signified by version number #.#.93 and up to #.#.99.
|
||||
Bug fixes that are not release critical must have landed before this.
|
||||
Release critical bug fixes can still be landed after this, but they may
|
||||
call for another RC.
|
||||
|
||||
- **Stable release**:
|
||||
Signified by version number #.#.0.
|
||||
Ideally no changes since the last RC.
|
||||
|
||||
Mind that version #.#.90 is never released. It is used during development when
|
||||
no code freeze is in effect. Stable branches and point releases are not covered
|
||||
by the above.
|
||||
|
||||
|
||||
[git documentation]: http://git-scm.com/documentation
|
||||
[notes on commit messages]: http://who-t.blogspot.de/2009/12/on-commit-messages.html
|
||||
@@ -0,0 +1,29 @@
|
||||
Copyright © 2008-2012 Kristian Høgsberg
|
||||
Copyright © 2010-2012 Intel Corporation
|
||||
Copyright © 2011 Benjamin Franzke
|
||||
Copyright © 2012 Collabora, Ltd.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
The above is the version of the MIT "Expat" License used by X.org:
|
||||
|
||||
http://cgit.freedesktop.org/xorg/xserver/tree/COPYING
|
||||
+341
@@ -0,0 +1,341 @@
|
||||
if BUILD_DOCS
|
||||
SUBDIRS = doc
|
||||
endif
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_builddir)/src \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_builddir)/protocol
|
||||
|
||||
AM_CFLAGS = $(GCC_CFLAGS)
|
||||
|
||||
aclocaldir = $(datadir)/aclocal
|
||||
dist_aclocal_DATA = wayland-scanner.m4
|
||||
|
||||
dist_pkgdata_DATA = \
|
||||
wayland-scanner.mk \
|
||||
protocol/wayland.xml \
|
||||
protocol/wayland.dtd
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA =
|
||||
|
||||
bin_PROGRAMS = wayland-scanner
|
||||
wayland_scanner_SOURCES = src/scanner.c
|
||||
wayland_scanner_CPPFLAGS = $(AM_CPPFLAGS) -include config.h
|
||||
wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(LIBXML_CFLAGS) $(AM_CFLAGS)
|
||||
wayland_scanner_LDADD = $(EXPAT_LIBS) $(LIBXML_LIBS) libwayland-util.la
|
||||
pkgconfig_DATA += src/wayland-scanner.pc
|
||||
|
||||
if DTD_VALIDATION
|
||||
wayland_scanner_SOURCES += src/dtddata.S
|
||||
endif
|
||||
src/dtddata.o: protocol/wayland.dtd
|
||||
|
||||
if USE_HOST_SCANNER
|
||||
wayland_scanner = wayland-scanner
|
||||
else
|
||||
$(BUILT_SOURCES) : wayland-scanner
|
||||
wayland_scanner = $(top_builddir)/wayland-scanner
|
||||
endif
|
||||
|
||||
libwayland_util_la_CFLAGS = $(AM_CFLAGS)
|
||||
libwayland_util_la_SOURCES = \
|
||||
src/wayland-util.c \
|
||||
src/wayland-util.h
|
||||
|
||||
noinst_LTLIBRARIES = libwayland-util.la
|
||||
|
||||
if ENABLE_LIBRARIES
|
||||
noinst_LTLIBRARIES += libwayland-private.la
|
||||
lib_LTLIBRARIES = libwayland-server.la libwayland-client.la
|
||||
|
||||
libwayland_private_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS)
|
||||
libwayland_private_la_SOURCES = \
|
||||
src/connection.c \
|
||||
src/wayland-os.c \
|
||||
src/wayland-os.h \
|
||||
src/wayland-private.h \
|
||||
src/wayland-server-private.h
|
||||
|
||||
include_HEADERS = \
|
||||
src/wayland-util.h \
|
||||
src/wayland-server.h \
|
||||
src/wayland-server-core.h \
|
||||
src/wayland-client.h \
|
||||
src/wayland-client-core.h \
|
||||
src/wayland-version.h
|
||||
|
||||
nodist_include_HEADERS = \
|
||||
protocol/wayland-server-protocol.h \
|
||||
protocol/wayland-client-protocol.h
|
||||
|
||||
libwayland_server_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
|
||||
libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la $(RT_LIBS) -lm
|
||||
libwayland_server_la_LDFLAGS = -version-info 1:0:1
|
||||
libwayland_server_la_SOURCES = \
|
||||
src/wayland-server.c \
|
||||
src/wayland-shm.c \
|
||||
src/event-loop.c
|
||||
|
||||
nodist_libwayland_server_la_SOURCES = \
|
||||
protocol/wayland-server-protocol.h \
|
||||
protocol/wayland-protocol.c
|
||||
|
||||
libwayland_client_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread
|
||||
libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la $(RT_LIBS) -lm
|
||||
libwayland_client_la_LDFLAGS = -version-info 3:0:3
|
||||
libwayland_client_la_SOURCES = \
|
||||
src/wayland-client.c
|
||||
|
||||
nodist_libwayland_client_la_SOURCES = \
|
||||
protocol/wayland-client-protocol.h \
|
||||
protocol/wayland-protocol.c
|
||||
|
||||
pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
|
||||
|
||||
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
|
||||
if USE_HOST_SCANNER
|
||||
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s code $< $@
|
||||
else
|
||||
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s public-code $< $@
|
||||
endif
|
||||
|
||||
protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml
|
||||
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s server-header $< $@
|
||||
|
||||
protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml
|
||||
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s client-header $< $@
|
||||
|
||||
protocol/%-server-protocol-core.h : $(top_srcdir)/protocol/%.xml
|
||||
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s server-header -c < $< > $@
|
||||
|
||||
protocol/%-client-protocol-core.h : $(top_srcdir)/protocol/%.xml
|
||||
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) -s client-header -c < $< > $@
|
||||
|
||||
BUILT_SOURCES = \
|
||||
$(nodist_libwayland_server_la_SOURCES) \
|
||||
$(nodist_libwayland_client_la_SOURCES) \
|
||||
$(nodist_headers_test_SOURCES) \
|
||||
$(nodist_display_test_SOURCES)
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES) doc/doxygen/doxygen_sqlite3.db
|
||||
DISTCLEANFILES = src/wayland-version.h
|
||||
EXTRA_DIST = CONTRIBUTING.md
|
||||
|
||||
|
||||
|
||||
lib_LTLIBRARIES += libwayland-cursor.la
|
||||
|
||||
include_HEADERS += cursor/wayland-cursor.h
|
||||
|
||||
libwayland_cursor_la_SOURCES = \
|
||||
cursor/wayland-cursor.c \
|
||||
cursor/os-compatibility.c \
|
||||
cursor/os-compatibility.h \
|
||||
cursor/cursor-data.h \
|
||||
cursor/xcursor.c \
|
||||
cursor/xcursor.h
|
||||
libwayland_cursor_la_LIBADD = libwayland-client.la
|
||||
|
||||
pkgconfig_DATA += cursor/wayland-cursor.pc
|
||||
|
||||
libwayland_cursor_la_CFLAGS = \
|
||||
$(AM_CFLAGS) \
|
||||
-I$(top_builddir)/src \
|
||||
-I$(top_srcdir)/src \
|
||||
-DICONDIR=\"$(ICONDIR)\"
|
||||
|
||||
lib_LTLIBRARIES += libwayland-egl.la
|
||||
|
||||
include_HEADERS += egl/wayland-egl.h
|
||||
include_HEADERS += egl/wayland-egl-core.h
|
||||
|
||||
libwayland_egl_la_SOURCES = egl/wayland-egl.c
|
||||
libwayland_egl_la_LDFLAGS = -version-info 1
|
||||
|
||||
pkgconfig_DATA += egl/wayland-egl.pc
|
||||
|
||||
## XXX: backend interface
|
||||
include_HEADERS += egl/wayland-egl-backend.h
|
||||
pkgconfig_DATA += egl/wayland-egl-backend.pc
|
||||
|
||||
built_test_programs = \
|
||||
array-test \
|
||||
client-test \
|
||||
display-test \
|
||||
connection-test \
|
||||
event-loop-test \
|
||||
fixed-test \
|
||||
interface-test \
|
||||
list-test \
|
||||
map-test \
|
||||
os-wrappers-test \
|
||||
sanity-test \
|
||||
socket-test \
|
||||
queue-test \
|
||||
proxy-test \
|
||||
signal-test \
|
||||
newsignal-test \
|
||||
resources-test \
|
||||
message-test \
|
||||
headers-test \
|
||||
compositor-introspection-test \
|
||||
protocol-logger-test \
|
||||
wayland-egl-abi-check
|
||||
|
||||
EXTRA_DIST += egl/wayland-egl-symbols-check
|
||||
|
||||
check_PROGRAMS = wayland-egl-abi-check
|
||||
wayland_egl_abi_check_SOURCES = egl/wayland-egl-abi-check.c
|
||||
|
||||
if ENABLE_CPP_TEST
|
||||
built_test_programs += cpp-compile-test
|
||||
endif
|
||||
|
||||
AM_TESTS_ENVIRONMENT = \
|
||||
export WAYLAND_SCANNER='$(top_builddir)/wayland-scanner' \
|
||||
TEST_DATA_DIR='$(top_srcdir)/tests/data' \
|
||||
TEST_OUTPUT_DIR='$(top_builddir)/tests/output' \
|
||||
WAYLAND_EGL_LIB='$(top_builddir)/.libs/libwayland-egl.so' \
|
||||
SED=$(SED) \
|
||||
NM='$(NM)' \
|
||||
;
|
||||
|
||||
TESTS = $(built_test_programs) \
|
||||
egl/wayland-egl-symbols-check \
|
||||
tests/scanner-test.sh
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
$(built_test_programs) \
|
||||
exec-fd-leak-checker \
|
||||
fixed-benchmark
|
||||
|
||||
noinst_LTLIBRARIES += \
|
||||
libtest-runner.la \
|
||||
libtest-helpers.la
|
||||
|
||||
libtest_helpers_la_SOURCES = tests/test-helpers.c
|
||||
|
||||
libtest_runner_la_SOURCES = \
|
||||
tests/test-runner.c \
|
||||
tests/test-runner.h \
|
||||
tests/test-compositor.h \
|
||||
tests/test-compositor.c
|
||||
libtest_runner_la_LIBADD = \
|
||||
libwayland-private.la \
|
||||
libwayland-util.la \
|
||||
libwayland-client.la \
|
||||
libwayland-server.la \
|
||||
libtest-helpers.la \
|
||||
$(RT_LIBS) $(DL_LIBS) $(FFI_LIBS)
|
||||
|
||||
array_test_SOURCES = tests/array-test.c
|
||||
array_test_LDADD = libtest-runner.la
|
||||
client_test_SOURCES = tests/client-test.c
|
||||
client_test_LDADD = libtest-runner.la
|
||||
display_test_CFLAGS = -pthread
|
||||
display_test_SOURCES = tests/display-test.c
|
||||
display_test_LDADD = libtest-runner.la
|
||||
nodist_display_test_SOURCES = \
|
||||
protocol/tests-server-protocol.h \
|
||||
protocol/tests-client-protocol.h \
|
||||
protocol/tests-protocol.c
|
||||
connection_test_SOURCES = tests/connection-test.c
|
||||
connection_test_LDADD = libtest-runner.la
|
||||
event_loop_test_SOURCES = tests/event-loop-test.c
|
||||
event_loop_test_LDADD = libtest-runner.la
|
||||
fixed_test_SOURCES = tests/fixed-test.c
|
||||
fixed_test_LDADD = libtest-runner.la
|
||||
interface_test_SOURCES = tests/interface-test.c
|
||||
interface_test_LDADD = libtest-runner.la
|
||||
list_test_SOURCES = tests/list-test.c
|
||||
list_test_LDADD = libtest-runner.la
|
||||
map_test_SOURCES = tests/map-test.c
|
||||
map_test_LDADD = libtest-runner.la
|
||||
sanity_test_SOURCES = tests/sanity-test.c
|
||||
sanity_test_LDADD = libtest-runner.la
|
||||
socket_test_SOURCES = tests/socket-test.c
|
||||
socket_test_LDADD = libtest-runner.la
|
||||
queue_test_SOURCES = tests/queue-test.c
|
||||
queue_test_LDADD = libtest-runner.la
|
||||
proxy_test_SOURCES = tests/proxy-test.c
|
||||
proxy_test_LDADD = libtest-runner.la
|
||||
signal_test_SOURCES = tests/signal-test.c
|
||||
signal_test_LDADD = libtest-runner.la
|
||||
# wayland-server.c is needed here to access wl_priv_* functions
|
||||
newsignal_test_SOURCES = tests/newsignal-test.c src/wayland-server.c
|
||||
newsignal_test_LDADD = libtest-runner.la
|
||||
resources_test_SOURCES = tests/resources-test.c
|
||||
resources_test_LDADD = libtest-runner.la
|
||||
message_test_SOURCES = tests/message-test.c
|
||||
message_test_LDADD = libtest-runner.la
|
||||
compositor_introspection_test_SOURCES = tests/compositor-introspection-test.c
|
||||
compositor_introspection_test_LDADD = libtest-runner.la
|
||||
protocol_logger_test_SOURCES = tests/protocol-logger-test.c
|
||||
protocol_logger_test_LDADD = libtest-runner.la
|
||||
headers_test_SOURCES = tests/headers-test.c \
|
||||
tests/headers-protocol-test.c \
|
||||
tests/headers-protocol-core-test.c
|
||||
nodist_headers_test_SOURCES = \
|
||||
protocol/wayland-server-protocol-core.h \
|
||||
protocol/wayland-client-protocol-core.h
|
||||
|
||||
if ENABLE_CPP_TEST
|
||||
cpp_compile_test_SOURCES = tests/cpp-compile-test.cpp
|
||||
endif
|
||||
|
||||
fixed_benchmark_SOURCES = tests/fixed-benchmark.c
|
||||
fixed_benchmark_LDADD = $(RT_LIBS)
|
||||
|
||||
os_wrappers_test_SOURCES = tests/os-wrappers-test.c
|
||||
os_wrappers_test_LDADD = libtest-runner.la
|
||||
|
||||
exec_fd_leak_checker_SOURCES = tests/exec-fd-leak-checker.c
|
||||
exec_fd_leak_checker_LDADD = libtest-helpers.la
|
||||
|
||||
EXTRA_DIST += tests/scanner-test.sh \
|
||||
protocol/tests.xml \
|
||||
tests/data/bad-identifier-arg.xml \
|
||||
tests/data/bad-identifier-entry.xml \
|
||||
tests/data/bad-identifier-enum.xml \
|
||||
tests/data/bad-identifier-event.xml \
|
||||
tests/data/bad-identifier-interface.xml \
|
||||
tests/data/bad-identifier-protocol.xml \
|
||||
tests/data/bad-identifier-request.xml \
|
||||
tests/data/example.xml \
|
||||
tests/data/example-client.h \
|
||||
tests/data/example-server.h \
|
||||
tests/data/example-code.c \
|
||||
tests/data/small.xml \
|
||||
tests/data/small-code.c \
|
||||
tests/data/small-client.h \
|
||||
tests/data/small-server.h \
|
||||
tests/data/small-code-core.c \
|
||||
tests/data/small-client-core.h \
|
||||
tests/data/small-server-core.h \
|
||||
tests/data/small-private-code.c \
|
||||
meson.build \
|
||||
meson_options.txt \
|
||||
cursor/meson.build \
|
||||
doc/meson.build \
|
||||
doc/doxygen/mainpage.dox \
|
||||
doc/doxygen/meson.build \
|
||||
doc/doxygen/gen-doxygen.py \
|
||||
doc/doxygen/xml/meson.build \
|
||||
doc/doxygen/xml/Client/meson.build \
|
||||
doc/doxygen/xml/Server/meson.build \
|
||||
doc/publican/meson.build \
|
||||
doc/publican/sources/meson.build \
|
||||
egl/meson.build \
|
||||
src/meson.build \
|
||||
tests/meson.build
|
||||
|
||||
tests/scanner-test.sh: $(top_builddir)/wayland-scanner
|
||||
|
||||
clean-local:
|
||||
-rm -rf tests/output
|
||||
|
||||
endif #ENABLE_LIBRARIES
|
||||
+3043
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Notes:
|
||||
This is project config file for OpenHarmony OSS Audit Tool, if you have any questions or concerns, please email chenyaxun.
|
||||
-->
|
||||
<!-- OAT(OSS Audit Tool) configuration guide:
|
||||
basedir: Root dir, the basedir + project path is the real source file location.
|
||||
licensefile:
|
||||
1.If the project don't have "LICENSE" in root dir, please define all the license files in this project in , OAT will check license files according to this rule.
|
||||
|
||||
tasklist(only for batch mode):
|
||||
1. task: Define oat check thread, each task will start a new thread.
|
||||
2. task name: Only an name, no practical effect.
|
||||
3. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist.
|
||||
4. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist.
|
||||
5. task project: Projects to be checked, the path field define the source root dir of the project.
|
||||
|
||||
|
||||
policyList:
|
||||
1. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process.
|
||||
2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
|
||||
<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
|
||||
3. policyitem type:
|
||||
"compatibility" is used to check license compatibility in the specified path;
|
||||
"license" is used to check source license header in the specified path;
|
||||
"copyright" is used to check source copyright header in the specified path;
|
||||
"import" is used to check source dependency in the specified path, such as import ... ,include ...
|
||||
"filetype" is used to check file type in the specified path, supported file types: archive, binary
|
||||
"filename" is used to check whether the specified file exists in the specified path(support projectroot in default OAT.xml), supported file names: LICENSE, README, README.OpenSource
|
||||
|
||||
4. policyitem name: This field is used for define the license, copyright, "*" means match all, the "!" prefix means could not match this value. For example, "!GPL" means can not use GPL license.
|
||||
5. policyitem path: This field is used for define the source file scope to apply this policyitem, the "!" prefix means exclude the files. For example, "!.*/lib/.*" means files in lib dir will be exclude while process this policyitem.
|
||||
6. policyitem rule and group: These two fields are used together to merge policy results. "may" policyitems in the same group means any one in this group passed, the result will be passed.
|
||||
7. policyitem filefilter: Used to bind filefilter which define filter rules.
|
||||
8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
|
||||
|
||||
Note:If the text contains special characters, please escape them according to the following rules:
|
||||
" == >
|
||||
& == >
|
||||
' == >
|
||||
< == >
|
||||
> == >
|
||||
-->
|
||||
<configuration>
|
||||
<oatconfig>
|
||||
<licensefile>COPYING</licensefile>
|
||||
<policylist>
|
||||
<policy name="projectPolicy" desc="">
|
||||
<policyitem type="compatibility" name="GPLStyleLicense" path="compile" desc="not use in OHOS"/>
|
||||
<policyitem type="compatibility" name="GPLStyleLicense" path="config.guess" desc="not use in OHOS"/>
|
||||
<policyitem type="compatibility" name="GPLStyleLicense" path="config.sub" desc="not use in OHOS"/>
|
||||
<policyitem type="compatibility" name="GPLStyleLicense" path="depcomp" desc="not use in OHOS"/>
|
||||
<policyitem type="compatibility" name="GPLStyleLicense" path="ltmain.sh" desc="not use in OHOS"/>
|
||||
<policyitem type="compatibility" name="GPLStyleLicense" path="missing" desc="not use in OHOS"/>
|
||||
<policyitem type="compatibility" name="GPLStyleLicense" path="test-driver" desc="not use in OHOS"/>
|
||||
</policy>
|
||||
</policylist>
|
||||
<filefilterlist>
|
||||
<filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
|
||||
<filteritem type="filename" name="README.OpenSource"/>
|
||||
<filteritem type="filename" name="README"/>
|
||||
<filteritem type="filepath" name="m4/.*" desc="not use in OHOS"/>
|
||||
<filteritem type="filepath" name="doc/publican/sources/.*" desc="not use in OHOS"/>
|
||||
</filefilter>
|
||||
<filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies" >
|
||||
<filteritem type="filename" name="README.OpenSource"/>
|
||||
<filteritem type="filename" name="README"/>
|
||||
</filefilter>
|
||||
</filefilterlist>
|
||||
</oatconfig>
|
||||
</configuration>
|
||||
@@ -0,0 +1,34 @@
|
||||
What is Wayland?
|
||||
|
||||
Wayland is a project to define a protocol for a compositor to talk to
|
||||
its clients as well as a library implementation of the protocol. The
|
||||
compositor can be a standalone display server running on Linux kernel
|
||||
modesetting and evdev input devices, an X application, or a wayland
|
||||
client itself. The clients can be traditional applications, X servers
|
||||
(rootless or fullscreen) or other display servers.
|
||||
|
||||
The wayland protocol is essentially only about input handling and
|
||||
buffer management. The compositor receives input events and forwards
|
||||
them to the relevant client. The clients creates buffers and renders
|
||||
into them and notifies the compositor when it needs to redraw. The
|
||||
protocol also handles drag and drop, selections, window management and
|
||||
other interactions that must go through the compositor. However, the
|
||||
protocol does not handle rendering, which is one of the features that
|
||||
makes wayland so simple. All clients are expected to handle rendering
|
||||
themselves, typically through cairo or OpenGL.
|
||||
|
||||
The weston compositor is a reference implementation of a wayland
|
||||
compositor and the weston repository also includes a few example
|
||||
clients.
|
||||
|
||||
Building the wayland libraries is fairly simple, aside from libffi,
|
||||
they don't have many dependencies:
|
||||
|
||||
$ git clone https://gitlab.freedesktop.org/wayland/wayland
|
||||
$ cd wayland
|
||||
$ meson build/ --prefix=PREFIX
|
||||
$ ninja -C build/ install
|
||||
|
||||
where PREFIX is where you want to install the libraries. See
|
||||
https://wayland.freedesktop.org for more complete build instructions
|
||||
for wayland, weston, xwayland and various toolkits.
|
||||
@@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"Name": "wayland",
|
||||
"License": "MIT license",
|
||||
"License File": "COPYING",
|
||||
"Version Number": "1.19.0",
|
||||
"Owner": "lizheng2@huawei.com",
|
||||
"Upstream URL": "https://wayland.freedesktop.org/releases/wayland-1.19.0.tar.xz",
|
||||
"Description": "Wayland is a protocol for a compositor to talk to its clients as well as a C library implementation of that protocol"
|
||||
}
|
||||
]
|
||||
@@ -1,36 +0,0 @@
|
||||
# third_party_wayland_standard
|
||||
|
||||
#### Description
|
||||
Third-party open-source software wayland_standard | 三方开源软件wayland_standard
|
||||
|
||||
#### Software Architecture
|
||||
Software architecture description
|
||||
|
||||
#### Installation
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Instructions
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Contribution
|
||||
|
||||
1. Fork the repository
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
|
||||
#### Gitee Feature
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
@@ -1,37 +0,0 @@
|
||||
# third_party_wayland_standard
|
||||
|
||||
#### 介绍
|
||||
Third-party open-source software wayland_standard | 三方开源软件wayland_standard
|
||||
|
||||
#### 软件架构
|
||||
软件架构说明
|
||||
|
||||
|
||||
#### 安装教程
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 使用说明
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 参与贡献
|
||||
|
||||
1. Fork 本仓库
|
||||
2. 新建 Feat_xxx 分支
|
||||
3. 提交代码
|
||||
4. 新建 Pull Request
|
||||
|
||||
|
||||
#### 特技
|
||||
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
@@ -0,0 +1,146 @@
|
||||
Core wayland protocol
|
||||
|
||||
- Maybe try to make remote wayland actually happen, to see if there
|
||||
is something in the protocol/architecture that makes it harder than
|
||||
it should be.
|
||||
|
||||
ICCCM
|
||||
|
||||
- mime-type guidelines for data_source (ie, both dnd and selection):
|
||||
recommended types for text or images, types that a clipboard
|
||||
manager must support, mime-types must be listed in preferred order
|
||||
|
||||
- we need a "no kb focus please" mechanism. Or should this be
|
||||
implicit in a specific surface type?
|
||||
|
||||
EWMH
|
||||
|
||||
- configure should provide dx_left, dx_right, dy_top, dy_bottom, or
|
||||
dx, dy, width and height.
|
||||
|
||||
- move to workspace, keep on top, on all workspaces, minimize etc
|
||||
requests for implementing client side window menu? or just make a
|
||||
"show window menu" request to let the compositor display and manage
|
||||
a popup window?
|
||||
|
||||
- window move and resize functionality for kb and touch.
|
||||
|
||||
- Protocol for specifying title bar rectangle (for moving
|
||||
unresponsive apps). Rectangle for close button, so we can popup
|
||||
force-close dialog if application doesn't respond to ping event
|
||||
when user clicks there. We could use the region mechanism here
|
||||
too.
|
||||
|
||||
- popup placement protocol logic.
|
||||
|
||||
- subsurface mechanism. we need this for cases where we would use an
|
||||
X subwindow for gl or video other different visual type.
|
||||
|
||||
EGL/gbm
|
||||
|
||||
- Land Robert Braggs EGL extensions: frame age, swap with damage
|
||||
|
||||
- Make it possible to share buffers from compositor to clients.
|
||||
Tricky part here is how to indicate to EGL on the server side that
|
||||
it should make an EGLImage available to a client. We'll need a
|
||||
"create a wl_buffer for this EGLImage for this client" kind of
|
||||
entry point.
|
||||
|
||||
- Protocol for arbitrating access to scanout buffers (physically
|
||||
contiguous memory). When a client goes fullscreen (or ideally as
|
||||
the compositor starts the animation that will make it fullscreen)
|
||||
we send a "give up your scanout buffer" to the current fullscreen
|
||||
client (if any) and when the client acks that we send a "try to
|
||||
allocate a scanout buffer now" event to the fullscreen-to-be
|
||||
client.
|
||||
|
||||
|
||||
Misc
|
||||
|
||||
- glyph cache
|
||||
|
||||
- Needs a mechanism to pass buffers to client.
|
||||
|
||||
buffer = drm.create_buffer(); /* buffer with stuff in it */
|
||||
|
||||
cache.upload(buffer, x, y, width, height, int hash)
|
||||
|
||||
drm.buffer: id, name, stride etc /* event to announce cache buffer */
|
||||
|
||||
cache.image: hash, buffer, x, y, stride /* event to announce
|
||||
* location in cache */
|
||||
|
||||
cache.reject: hash /* no upload for you! */
|
||||
|
||||
cache.retire: buffer /* cache has stopped using buffer, please
|
||||
* reupload whatever you had in that buffer */
|
||||
|
||||
- A "please suspend" event from the compositor, to indicate to an
|
||||
application that it's no longer visible/active. Or maybe discard
|
||||
buffer, as in "wayland discarded your buffer, it's no longer
|
||||
visible, you can stop updating it now.", reattach, as in "oh hey,
|
||||
I'm about to show your buffer that I threw away, what was it
|
||||
again?". for wayland system compositor vt switcing, for example,
|
||||
to be able to throw away the surfaces in the session we're
|
||||
switching away from. for minimized windows that we don't want live
|
||||
thumb nails for. etc.
|
||||
|
||||
|
||||
Clients and ports
|
||||
|
||||
- port gtk+
|
||||
|
||||
- draw window decorations in gtkwindow.c
|
||||
|
||||
- Details about pointer grabs. wayland doesn't have active grabs,
|
||||
menus will behave subtly different. Under X, clicking a menu
|
||||
open grabs the pointer and clicking outside the window pops down
|
||||
the menu and swallows the click. without active grabs we can't
|
||||
swallow the click. I'm sure there much more...
|
||||
|
||||
- dnd, copy-paste
|
||||
|
||||
- Investigate DirectFB on Wayland (or is that Wayland on DirectFB?)
|
||||
|
||||
|
||||
Ideas
|
||||
|
||||
- A wayland settings protocol to tell clients about themes (icons,
|
||||
cursors, widget themes), fonts details (family, hinting
|
||||
preferences) etc. Just send all settings at connect time, send
|
||||
updates when a setting change. Getting a little close to gconf
|
||||
here, but could be pretty simple:
|
||||
|
||||
interface "settings":
|
||||
event int_value(string name, int value)
|
||||
event string_value(string name, string value)
|
||||
|
||||
but maybe it's better to just require that clients get that from
|
||||
somewhere else (gconf/dbus).
|
||||
|
||||
|
||||
Crazy ideas
|
||||
|
||||
- AF_WAYLAND - A new socket type. Eliminate compositor context
|
||||
switch by making kernel understand enough of wayland that it can
|
||||
forward input events as wayland events and do page flipping in
|
||||
response to surface_attach requests:
|
||||
|
||||
- ioctl(wayland_fd, "surface_attach to object 5 should do a kms page
|
||||
flip on ctrc 2");
|
||||
|
||||
- what about multiple crtcs? what about frame event for other
|
||||
clients?
|
||||
|
||||
- forward these input devices to the client
|
||||
|
||||
- "scancode 124 pressed or released with scan codes 18,22 and 30
|
||||
held down gives control back to userspace wayland.
|
||||
|
||||
- what about maintaining cursor position? what about pointer
|
||||
acceleration? maybe this only works in "client cursor mode",
|
||||
where wayland hides the cursor and only sends relative events?
|
||||
Solves the composited cursor problem. How does X show its
|
||||
cursor then?
|
||||
|
||||
- Probably not worth it.
|
||||
Vendored
+1507
File diff suppressed because it is too large
Load Diff
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#! /bin/sh
|
||||
|
||||
test -n "$srcdir" || srcdir=`dirname "$0"`
|
||||
test -n "$srcdir" || srcdir=.
|
||||
(
|
||||
cd "$srcdir" &&
|
||||
autoreconf --force -v --install
|
||||
) || exit
|
||||
test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
|
||||
@@ -0,0 +1,348 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
|
||||
# We need space, tab and new line, in precisely that order. Quoting is
|
||||
# there to prevent tools from complaining about whitespace usage.
|
||||
IFS=" "" $nl"
|
||||
|
||||
file_conv=
|
||||
|
||||
# func_file_conv build_file lazy
|
||||
# Convert a $build file to $host form and store it in $file
|
||||
# Currently only supports Windows hosts. If the determined conversion
|
||||
# type is listed in (the comma separated) LAZY, no conversion will
|
||||
# take place.
|
||||
func_file_conv ()
|
||||
{
|
||||
file=$1
|
||||
case $file in
|
||||
/ | /[!/]*) # absolute file, and not a UNC file
|
||||
if test -z "$file_conv"; then
|
||||
# lazily determine how to convert abs files
|
||||
case `uname -s` in
|
||||
MINGW*)
|
||||
file_conv=mingw
|
||||
;;
|
||||
CYGWIN* | MSYS*)
|
||||
file_conv=cygwin
|
||||
;;
|
||||
*)
|
||||
file_conv=wine
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $file_conv/,$2, in
|
||||
*,$file_conv,*)
|
||||
;;
|
||||
mingw/*)
|
||||
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
|
||||
;;
|
||||
cygwin/* | msys/*)
|
||||
file=`cygpath -m "$file" || echo "$file"`
|
||||
;;
|
||||
wine/*)
|
||||
file=`winepath -w "$file" || echo "$file"`
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_cl_dashL linkdir
|
||||
# Make cl look for libraries in LINKDIR
|
||||
func_cl_dashL ()
|
||||
{
|
||||
func_file_conv "$1"
|
||||
if test -z "$lib_path"; then
|
||||
lib_path=$file
|
||||
else
|
||||
lib_path="$lib_path;$file"
|
||||
fi
|
||||
linker_opts="$linker_opts -LIBPATH:$file"
|
||||
}
|
||||
|
||||
# func_cl_dashl library
|
||||
# Do a library search-path lookup for cl
|
||||
func_cl_dashl ()
|
||||
{
|
||||
lib=$1
|
||||
found=no
|
||||
save_IFS=$IFS
|
||||
IFS=';'
|
||||
for dir in $lib_path $LIB
|
||||
do
|
||||
IFS=$save_IFS
|
||||
if $shared && test -f "$dir/$lib.dll.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.dll.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/$lib.lib"; then
|
||||
found=yes
|
||||
lib=$dir/$lib.lib
|
||||
break
|
||||
fi
|
||||
if test -f "$dir/lib$lib.a"; then
|
||||
found=yes
|
||||
lib=$dir/lib$lib.a
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS=$save_IFS
|
||||
|
||||
if test "$found" != yes; then
|
||||
lib=$lib.lib
|
||||
fi
|
||||
}
|
||||
|
||||
# func_cl_wrapper cl arg...
|
||||
# Adjust compile command to suit cl
|
||||
func_cl_wrapper ()
|
||||
{
|
||||
# Assume a capable shell
|
||||
lib_path=
|
||||
shared=:
|
||||
linker_opts=
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.[oO][bB][jJ])
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fo"$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
func_file_conv "$2"
|
||||
set x "$@" -Fe"$file"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I)
|
||||
eat=1
|
||||
func_file_conv "$2" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-I*)
|
||||
func_file_conv "${1#-I}" mingw
|
||||
set x "$@" -I"$file"
|
||||
shift
|
||||
;;
|
||||
-l)
|
||||
eat=1
|
||||
func_cl_dashl "$2"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-l*)
|
||||
func_cl_dashl "${1#-l}"
|
||||
set x "$@" "$lib"
|
||||
shift
|
||||
;;
|
||||
-L)
|
||||
eat=1
|
||||
func_cl_dashL "$2"
|
||||
;;
|
||||
-L*)
|
||||
func_cl_dashL "${1#-L}"
|
||||
;;
|
||||
-static)
|
||||
shared=false
|
||||
;;
|
||||
-Wl,*)
|
||||
arg=${1#-Wl,}
|
||||
save_ifs="$IFS"; IFS=','
|
||||
for flag in $arg; do
|
||||
IFS="$save_ifs"
|
||||
linker_opts="$linker_opts $flag"
|
||||
done
|
||||
IFS="$save_ifs"
|
||||
;;
|
||||
-Xlinker)
|
||||
eat=1
|
||||
linker_opts="$linker_opts $2"
|
||||
;;
|
||||
-*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
|
||||
func_file_conv "$1"
|
||||
set x "$@" -Tp"$file"
|
||||
shift
|
||||
;;
|
||||
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
|
||||
func_file_conv "$1" mingw
|
||||
set x "$@" "$file"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if test -n "$linker_opts"; then
|
||||
linker_opts="-link$linker_opts"
|
||||
fi
|
||||
exec "$@" $linker_opts
|
||||
exit 1
|
||||
}
|
||||
|
||||
eat=
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: compile [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Wrapper for compilers which do not understand '-c -o'.
|
||||
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
|
||||
arguments, and rename the output as expected.
|
||||
|
||||
If you are trying to build a whole package this is not the
|
||||
right script to run: please start by reading the file 'INSTALL'.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
|
||||
for arg
|
||||
do
|
||||
if test -n "$eat"; then
|
||||
eat=
|
||||
else
|
||||
case $1 in
|
||||
-o)
|
||||
# configure might choose to run compile as 'compile cc -o foo foo.c'.
|
||||
# So we strip '-o arg' only if arg is an object.
|
||||
eat=1
|
||||
case $2 in
|
||||
*.o | *.obj)
|
||||
ofile=$2
|
||||
;;
|
||||
*)
|
||||
set x "$@" -o "$2"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set x "$@" "$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if test -z "$ofile" || test -z "$cfile"; then
|
||||
# If no '-o' option was seen then we might have been invoked from a
|
||||
# pattern rule where we don't need one. That is ok -- this is a
|
||||
# normal compilation that the losing compiler can handle. If no
|
||||
# '.c' file was seen then we are probably linking. That is also
|
||||
# ok.
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
|
||||
# that we are using for the .o file. Also, base the name on the expected
|
||||
# object file name, since that is what matters with a parallel build.
|
||||
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
|
||||
while true; do
|
||||
if mkdir "$lockdir" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir '$lockdir'; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$@"
|
||||
ret=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
|
||||
elif test -f "${cofile}bj"; then
|
||||
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir "$lockdir"
|
||||
exit $ret
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
Vendored
+1698
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2015, The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// This is used by wayland-os.c
|
||||
#define HAVE_ACCEPT4
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the `accept4' function. */
|
||||
#undef HAVE_ACCEPT4
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* libxml-2.0 is available */
|
||||
#undef HAVE_LIBXML
|
||||
|
||||
/* Define to 1 if you have the `memfd_create' function. */
|
||||
#undef HAVE_MEMFD_CREATE
|
||||
|
||||
/* Define to 1 if you have the `mkostemp' function. */
|
||||
#undef HAVE_MKOSTEMP
|
||||
|
||||
/* Define to 1 if you have the `posix_fallocate' function. */
|
||||
#undef HAVE_POSIX_FALLOCATE
|
||||
|
||||
/* Define to 1 if you have the `prctl' function. */
|
||||
#undef HAVE_PRCTL
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdio.h> header file. */
|
||||
#undef HAVE_STDIO_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
#undef HAVE_STRNDUP
|
||||
|
||||
/* Define to 1 if you have the <sys/prctl.h> header file. */
|
||||
#undef HAVE_SYS_PRCTL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory where libtool stores uninstalled libraries. */
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if all of the C90 standard headers exist (not just the ones
|
||||
required in a freestanding environment). This macro is provided for
|
||||
backward compatibility; new code need not use it. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
Vendored
+1854
File diff suppressed because it is too large
Load Diff
+202
@@ -0,0 +1,202 @@
|
||||
AC_PREREQ([2.64])
|
||||
|
||||
m4_define([wayland_major_version], [1])
|
||||
m4_define([wayland_minor_version], [19])
|
||||
m4_define([wayland_micro_version], [0])
|
||||
m4_define([wayland_version],
|
||||
[wayland_major_version.wayland_minor_version.wayland_micro_version])
|
||||
|
||||
AC_INIT([wayland],
|
||||
[wayland_version],
|
||||
[https://gitlab.freedesktop.org/wayland/wayland/issues/],
|
||||
[wayland],
|
||||
[https://wayland.freedesktop.org/])
|
||||
|
||||
AC_SUBST([WAYLAND_VERSION_MAJOR], [wayland_major_version])
|
||||
AC_SUBST([WAYLAND_VERSION_MINOR], [wayland_minor_version])
|
||||
AC_SUBST([WAYLAND_VERSION_MICRO], [wayland_micro_version])
|
||||
AC_SUBST([WAYLAND_VERSION], [wayland_version])
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects])
|
||||
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
# Check for programs
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_GREP
|
||||
AM_PROG_AS
|
||||
AC_PROG_NM
|
||||
|
||||
# check if we have C++ compiler. This is hacky workaround,
|
||||
# for a reason why it is this way see
|
||||
# http://lists.gnu.org/archive/html/bug-autoconf/2010-05/msg00001.html
|
||||
have_cpp_compiler=yes
|
||||
|
||||
if ! which "$CXX" &>/dev/null; then
|
||||
have_cpp_compiler=no
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(ENABLE_CPP_TEST, test "x$have_cpp_compiler" = "xyes")
|
||||
|
||||
# Initialize libtool
|
||||
LT_PREREQ([2.2])
|
||||
LT_INIT([disable-static])
|
||||
|
||||
PKG_PROG_PKG_CONFIG()
|
||||
|
||||
AC_ARG_ENABLE([fatal-warnings],
|
||||
AC_HELP_STRING([--enable-fatal-warnings],
|
||||
[Build with -Werror]),
|
||||
[enable_fatal_warnings=$enableval],
|
||||
[enable_fatal_warnings=no])
|
||||
AS_IF([test x"$enable_fatal_warnings" != "xno"], [
|
||||
WERROR_CFLAGS="-Werror"
|
||||
])
|
||||
|
||||
if test "x$GCC" = "xyes"; then
|
||||
GCC_CFLAGS="$WERROR_CFLAGS -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden"
|
||||
fi
|
||||
AC_SUBST(GCC_CFLAGS)
|
||||
|
||||
AC_CHECK_HEADERS([sys/prctl.h])
|
||||
AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate prctl memfd_create strndup])
|
||||
|
||||
# *BSD don't have libdl, but they have its functions in libc
|
||||
WESTON_SEARCH_LIBS([DL], [dl], [dlsym])
|
||||
|
||||
# OpenBSD doesn't have librt, but it has its functions in libc
|
||||
WESTON_SEARCH_LIBS([RT], [rt], [clock_gettime])
|
||||
|
||||
AC_ARG_ENABLE([libraries],
|
||||
[AC_HELP_STRING([--disable-libraries],
|
||||
[Disable compilation of wayland libraries])],
|
||||
[],
|
||||
[enable_libraries=yes])
|
||||
|
||||
AC_ARG_WITH([host-scanner],
|
||||
[AC_HELP_STRING([--with-host-scanner],
|
||||
[Use installed wayland-scanner from host PATH during build])],
|
||||
[],
|
||||
[with_host_scanner=no])
|
||||
|
||||
AC_ARG_ENABLE([documentation],
|
||||
[AC_HELP_STRING([--disable-documentation],
|
||||
[Disable building the documentation])],
|
||||
[],
|
||||
[enable_documentation=yes])
|
||||
|
||||
AC_ARG_ENABLE([dtd-validation],
|
||||
[AC_HELP_STRING([--disable-dtd-validation],
|
||||
[Disable DTD validation of the protocol])],
|
||||
[],
|
||||
[enable_dtd_validation=yes])
|
||||
|
||||
AM_CONDITIONAL(USE_HOST_SCANNER, test "x$with_host_scanner" = xyes)
|
||||
|
||||
AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)
|
||||
|
||||
AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
|
||||
[ ICONDIR=$withval],
|
||||
[ ICONDIR=${datadir}/icons])
|
||||
AC_SUBST([ICONDIR])
|
||||
|
||||
if test "x$enable_libraries" = "xyes"; then
|
||||
PKG_CHECK_MODULES(FFI, [libffi])
|
||||
AC_CHECK_DECL(SFD_CLOEXEC,[],
|
||||
[AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland libraries")],
|
||||
[[#include <sys/signalfd.h>]])
|
||||
AC_CHECK_DECL(TFD_CLOEXEC,[],
|
||||
[AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland libraries")],
|
||||
[[#include <sys/timerfd.h>]])
|
||||
AC_CHECK_DECL(CLOCK_MONOTONIC,[],
|
||||
[AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland libraries")],
|
||||
[[#include <time.h>]])
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES(EXPAT, [expat])
|
||||
|
||||
AM_CONDITIONAL([DTD_VALIDATION], [test "x$enable_dtd_validation" = "xyes"])
|
||||
if test "x$enable_dtd_validation" = "xyes"; then
|
||||
PKG_CHECK_MODULES(LIBXML, [libxml-2.0])
|
||||
AC_DEFINE(HAVE_LIBXML, 1, [libxml-2.0 is available])
|
||||
AC_CONFIG_LINKS([src/wayland.dtd.embed:protocol/wayland.dtd])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(XSLTPROC, xsltproc)
|
||||
AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
|
||||
|
||||
|
||||
AM_CONDITIONAL(BUILD_DOCS, [test x$enable_documentation = xyes])
|
||||
if test "x$enable_documentation" = "xyes"; then
|
||||
AC_PATH_PROG(DOXYGEN, doxygen)
|
||||
|
||||
if test "x$DOXYGEN" = "x"; then
|
||||
AC_MSG_ERROR([Documentation build requested but doxygen not found. Install doxygen or disable the documentation using --disable-documentation])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for compatible doxygen version])
|
||||
doxygen_version=`$DOXYGEN --version`
|
||||
AS_VERSION_COMPARE([$doxygen_version], [1.6.0],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Doxygen $doxygen_version too old. Doxygen 1.6+ required for documentation build. Install required doxygen version or disable the documentation using --disable-documentation])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([yes])])
|
||||
|
||||
AC_PATH_PROG(XMLTO, xmlto)
|
||||
|
||||
if test "x$XMLTO" = "x"; then
|
||||
AC_MSG_ERROR([Documentation build requested but xmlto not found. Install xmlto or disable the documentation using --disable-documentation])
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(DOT, dot)
|
||||
if test "x$DOT" = "x"; then
|
||||
AC_MSG_ERROR([Documentation build requested but graphviz's dot not found. Install graphviz or disable the documentation using --disable-documentation])
|
||||
fi
|
||||
AC_MSG_CHECKING([for compatible dot version])
|
||||
dot_version=`$DOT -V 2>&1|$GREP -o ['[0-9]*\.[0-9]*\.[0-9]*']`
|
||||
AS_VERSION_COMPARE([$dot_version], [2.26.0],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Graphviz dot $dot_version too old. Graphviz 2.26+ required for documentation build. Install required graphviz version or disable the documentation using --disable-documentation])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[AC_MSG_RESULT([yes])])
|
||||
|
||||
AC_MSG_CHECKING([for docbook stylesheets])
|
||||
DOCS_STYLESHEET=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
|
||||
AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
|
||||
AS_IF([`"$ac_path_XSLTPROC_TMP" --nonet "$DOCS_STYLESHEET" > /dev/null 2>&1`],
|
||||
[HAVE_DOCS_STYLESHEET=yes]))
|
||||
if test "x$HAVE_DOCS_STYLESHEET" != "xyes"; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Documentation build requested but docbook-xsl stylesheets are not found. Install the docbook-xsl package or disable the documentation using --disable-documentation])
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_SUBST(DOCS_STYLESHEET)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
doc/doxygen/wayland.doxygen
|
||||
])
|
||||
|
||||
fi
|
||||
AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" != "x"])
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
cursor/wayland-cursor.pc
|
||||
cursor/wayland-cursor-uninstalled.pc
|
||||
doc/Makefile
|
||||
doc/publican/Makefile
|
||||
doc/doxygen/Makefile
|
||||
egl/wayland-egl.pc
|
||||
egl/wayland-egl-backend.pc
|
||||
src/wayland-server-uninstalled.pc
|
||||
src/wayland-client-uninstalled.pc
|
||||
src/wayland-scanner-uninstalled.pc
|
||||
src/wayland-server.pc
|
||||
src/wayland-client.pc
|
||||
src/wayland-scanner.pc
|
||||
src/wayland-version.h])
|
||||
AC_OUTPUT
|
||||
Executable
+547
@@ -0,0 +1,547 @@
|
||||
/*
|
||||
* Copyright © 2012 Philipp Brüschweiler
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a small, hacky tool to extract cursors from a .pcf file.
|
||||
* The information about the file format has been gathered from
|
||||
* http://fontforge.org/pcf-format.html
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
struct glyph {
|
||||
char *name;
|
||||
int16_t left_bearing, right_bearing, ascent, descent;
|
||||
|
||||
int16_t width, height;
|
||||
int16_t hotx, hoty;
|
||||
|
||||
int32_t data_format;
|
||||
char *data;
|
||||
};
|
||||
|
||||
static struct {
|
||||
int count;
|
||||
struct glyph *glyphs;
|
||||
} extracted_font = {0, NULL};
|
||||
|
||||
#define PCF_PROPERTIES (1<<0)
|
||||
#define PCF_ACCELERATORS (1<<1)
|
||||
#define PCF_METRICS (1<<2)
|
||||
#define PCF_BITMAPS (1<<3)
|
||||
#define PCF_INK_METRICS (1<<4)
|
||||
#define PCF_BDF_ENCODINGS (1<<5)
|
||||
#define PCF_SWIDTHS (1<<6)
|
||||
#define PCF_GLYPH_NAMES (1<<7)
|
||||
#define PCF_BDF_ACCELERATORS (1<<8)
|
||||
|
||||
#define PCF_DEFAULT_FORMAT 0x00000000
|
||||
#define PCF_INKBOUNDS 0x00000200
|
||||
#define PCF_ACCEL_W_INKBOUNDS 0x00000100
|
||||
#define PCF_COMPRESSED_METRICS 0x00000100
|
||||
|
||||
#define PCF_FORMAT_MASK 0xffffff00
|
||||
|
||||
struct pcf_header {
|
||||
char header[4];
|
||||
int32_t table_count;
|
||||
struct toc_entry {
|
||||
int32_t type;
|
||||
int32_t format;
|
||||
int32_t size;
|
||||
int32_t offset;
|
||||
} tables[0];
|
||||
};
|
||||
|
||||
struct compressed_metrics {
|
||||
uint8_t left_sided_bearing;
|
||||
uint8_t right_side_bearing;
|
||||
uint8_t character_width;
|
||||
uint8_t character_ascent;
|
||||
uint8_t character_descent;
|
||||
};
|
||||
|
||||
struct uncompressed_metrics {
|
||||
int16_t left_sided_bearing;
|
||||
int16_t right_side_bearing;
|
||||
int16_t character_width;
|
||||
int16_t character_ascent;
|
||||
int16_t character_descent;
|
||||
uint16_t character_attributes;
|
||||
};
|
||||
|
||||
struct metrics {
|
||||
int32_t format;
|
||||
union {
|
||||
struct {
|
||||
int16_t count;
|
||||
struct compressed_metrics compressed_metrics[0];
|
||||
} compressed;
|
||||
struct {
|
||||
int32_t count;
|
||||
struct uncompressed_metrics uncompressed_metrics[0];
|
||||
} uncompressed;
|
||||
};
|
||||
};
|
||||
|
||||
struct glyph_names {
|
||||
int32_t format;
|
||||
int32_t glyph_count;
|
||||
int32_t offsets[0];
|
||||
};
|
||||
|
||||
struct bitmaps {
|
||||
int32_t format;
|
||||
int32_t glyph_count;
|
||||
int32_t offsets[0];
|
||||
};
|
||||
|
||||
static void
|
||||
handle_compressed_metrics(int32_t count, struct compressed_metrics *m)
|
||||
{
|
||||
printf("metrics count: %d\n", count);
|
||||
extracted_font.count = count;
|
||||
extracted_font.glyphs = calloc(count, sizeof(struct glyph));
|
||||
|
||||
int i;
|
||||
for (i = 0; i < count; ++i) {
|
||||
struct glyph *glyph = &extracted_font.glyphs[i];
|
||||
glyph->left_bearing =
|
||||
((int16_t) m[i].left_sided_bearing) - 0x80;
|
||||
glyph->right_bearing =
|
||||
((int16_t) m[i].right_side_bearing) - 0x80;
|
||||
glyph->width = ((int16_t) m[i].character_width) - 0x80;
|
||||
glyph->ascent = ((int16_t) m[i].character_ascent) - 0x80;
|
||||
glyph->descent = ((int16_t) m[i].character_descent) - 0x80;
|
||||
|
||||
/* computed stuff */
|
||||
glyph->height = glyph->ascent + glyph->descent;
|
||||
|
||||
glyph->hotx = -glyph->left_bearing;
|
||||
glyph->hoty = glyph->ascent;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_metrics(void *metricbuf)
|
||||
{
|
||||
struct metrics *metrics = metricbuf;
|
||||
printf("metric format: %x\n", metrics->format);
|
||||
|
||||
if ((metrics->format & PCF_FORMAT_MASK) == PCF_DEFAULT_FORMAT) {
|
||||
printf("todo...\n");
|
||||
} else if ((metrics->format & PCF_FORMAT_MASK) ==
|
||||
PCF_COMPRESSED_METRICS) {
|
||||
handle_compressed_metrics(
|
||||
metrics->compressed.count,
|
||||
&metrics->compressed.compressed_metrics[0]);
|
||||
} else {
|
||||
printf("incompatible format\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_glyph_names(struct glyph_names *names)
|
||||
{
|
||||
printf("glyph count %d\n", names->glyph_count);
|
||||
|
||||
if (names->glyph_count != extracted_font.count) {
|
||||
abort();
|
||||
}
|
||||
|
||||
printf("glyph names format %x\n", names->format);
|
||||
|
||||
void *names_start = ((void*) names) + sizeof(struct glyph_names)
|
||||
+ (names->glyph_count + 1) * sizeof(int32_t);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < names->glyph_count; ++i) {
|
||||
int32_t start = names->offsets[i];
|
||||
int32_t end = names->offsets[i+1];
|
||||
char *name = names_start + start;
|
||||
extracted_font.glyphs[i].name = calloc(1, end - start + 1);
|
||||
memcpy(extracted_font.glyphs[i].name, name, end - start);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_bitmaps(struct bitmaps *bitmaps)
|
||||
{
|
||||
printf("bitmaps count %d\n", bitmaps->glyph_count);
|
||||
|
||||
if (bitmaps->glyph_count != extracted_font.count) {
|
||||
abort();
|
||||
}
|
||||
|
||||
printf("format %x\n", bitmaps->format);
|
||||
|
||||
if (bitmaps->format != 2) {
|
||||
printf("format not yet supported\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
void *bitmaps_start = ((void*) bitmaps) + sizeof(struct bitmaps)
|
||||
+ (bitmaps->glyph_count + 4) * sizeof(int32_t);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < bitmaps->glyph_count; ++i) {
|
||||
int32_t offset = bitmaps->offsets[i];
|
||||
struct glyph *glyph = &extracted_font.glyphs[i];
|
||||
glyph->data_format = bitmaps->format;
|
||||
|
||||
glyph->data = bitmaps_start + offset;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_pcf(void *fontbuf)
|
||||
{
|
||||
struct pcf_header *header = fontbuf;
|
||||
printf("tablecount %d\n", header->table_count);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < header->table_count; ++i) {
|
||||
struct toc_entry *entry = &header->tables[i];
|
||||
printf("type: %d\n", entry->type);
|
||||
if (entry->type == PCF_METRICS) {
|
||||
handle_metrics(fontbuf + entry->offset);
|
||||
} else if (entry->type == PCF_GLYPH_NAMES) {
|
||||
handle_glyph_names(fontbuf + entry->offset);
|
||||
} else if (entry->type == PCF_BITMAPS) {
|
||||
handle_bitmaps(fontbuf + entry->offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static char
|
||||
get_glyph_pixel(struct glyph *glyph, int x, int y)
|
||||
{
|
||||
int absx = glyph->hotx + x;
|
||||
int absy = glyph->hoty + y;
|
||||
|
||||
if (absx < 0 || absx >= glyph->width ||
|
||||
absy < 0 || absy >= glyph->height)
|
||||
return 0;
|
||||
|
||||
int stride = (glyph->width + 31) / 32 * 4;
|
||||
unsigned char block = glyph->data[absy * stride + (absx/8)];
|
||||
int idx = absx % 8;
|
||||
return (block >> idx) & 1;
|
||||
}
|
||||
|
||||
static struct {
|
||||
uint32_t *data;
|
||||
size_t capacity, size;
|
||||
} data_buffer;
|
||||
|
||||
static void
|
||||
init_data_buffer()
|
||||
{
|
||||
data_buffer.data = malloc(sizeof(uint32_t) * 10);
|
||||
data_buffer.capacity = 10;
|
||||
data_buffer.size = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
add_pixel(uint32_t pixel)
|
||||
{
|
||||
if (data_buffer.size == data_buffer.capacity) {
|
||||
data_buffer.capacity *= 2;
|
||||
data_buffer.data =
|
||||
realloc(data_buffer.data,
|
||||
sizeof(uint32_t) * data_buffer.capacity);
|
||||
}
|
||||
data_buffer.data[data_buffer.size++] = pixel;
|
||||
}
|
||||
|
||||
struct reconstructed_glyph {
|
||||
int32_t width, height;
|
||||
int32_t hotspot_x, hotspot_y;
|
||||
size_t offset;
|
||||
char *name;
|
||||
};
|
||||
|
||||
static void
|
||||
reconstruct_glyph(struct glyph *cursor, struct glyph *mask, char *name,
|
||||
struct reconstructed_glyph *glyph)
|
||||
{
|
||||
int minx = min(-cursor->hotx, -mask->hotx);
|
||||
int maxx = max(cursor->right_bearing, mask->right_bearing);
|
||||
|
||||
int miny = min(-cursor->hoty, -mask->hoty);
|
||||
int maxy = max(cursor->height - cursor->hoty,
|
||||
mask->height - mask->hoty);
|
||||
|
||||
int width = maxx - minx;
|
||||
int height = maxy - miny;
|
||||
|
||||
glyph->name = strdup(name);
|
||||
glyph->width = width;
|
||||
glyph->height = height;
|
||||
glyph->hotspot_x = -minx;
|
||||
glyph->hotspot_y = -miny;
|
||||
glyph->offset = data_buffer.size;
|
||||
|
||||
int x, y;
|
||||
for (y = miny; y < maxy; ++y) {
|
||||
for (x = minx; x < maxx; ++x) {
|
||||
char alpha = get_glyph_pixel(mask, x, y);
|
||||
if (alpha) {
|
||||
char color = get_glyph_pixel(cursor, x, y);
|
||||
if (color)
|
||||
add_pixel(0xff000000);
|
||||
else
|
||||
add_pixel(0xffffffff);
|
||||
} else {
|
||||
add_pixel(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Originally from
|
||||
* http://cgit.freedesktop.org/xorg/lib/libXfont/tree/src/builtins/fonts.c
|
||||
* Changed to the MIT "Expat" style license for Wayland..
|
||||
*/
|
||||
static const char cursor_licence[] =
|
||||
"/*\n"
|
||||
"* Copyright 1999 SuSE, Inc.\n"
|
||||
"*\n"
|
||||
"* Permission is hereby granted, free of charge, to any person obtaining\n"
|
||||
"* a copy of this software and associated documentation files (the\n"
|
||||
"* \"Software\"), to deal in the Software without restriction, including\n"
|
||||
"* without limitation the rights to use, copy, modify, merge, publish,\n"
|
||||
"* distribute, sublicense, and/or sell copies of the Software, and to\n"
|
||||
"* permit persons to whom the Software is furnished to do so, subject to\n"
|
||||
"* the following conditions:\n"
|
||||
"*\n"
|
||||
"* The above copyright notice and this permission notice (including the\n"
|
||||
"* next paragraph) shall be included in all copies or substantial\n"
|
||||
"* portions of the Software.\n"
|
||||
"*\n"
|
||||
"* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
|
||||
"* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n"
|
||||
"* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n"
|
||||
"* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n"
|
||||
"* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n"
|
||||
"* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n"
|
||||
"* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n"
|
||||
"* SOFTWARE.\n"
|
||||
"*\n"
|
||||
"* Author: Keith Packard, SuSE, Inc.\n"
|
||||
"*/\n";
|
||||
|
||||
static void
|
||||
write_output_file(struct reconstructed_glyph *glyphs, int n)
|
||||
{
|
||||
int i, j, counter, size;
|
||||
FILE *file = fopen("cursor-data.h", "w");
|
||||
uint32_t *data;
|
||||
|
||||
fprintf(file, "%s\n", cursor_licence);
|
||||
|
||||
fprintf(file, "static uint32_t cursor_data[] = {\n\t");
|
||||
|
||||
counter = 0;
|
||||
for (i = 0; i < n; ++i) {
|
||||
data = data_buffer.data + glyphs[i].offset;
|
||||
size = glyphs[i].width * glyphs[i].height;
|
||||
|
||||
for (j = 0; j < size; ++j) {
|
||||
fprintf(file, "0x%08x, ", data[j]);
|
||||
if (++counter % 6 == 0)
|
||||
fprintf(file, "\n\t");
|
||||
}
|
||||
}
|
||||
fprintf(file, "\n};\n\n");
|
||||
|
||||
fprintf(file,
|
||||
"static struct {\n"
|
||||
"\tchar *name;\n"
|
||||
"\tint width, height;\n"
|
||||
"\tint hotspot_x, hotspot_y;\n"
|
||||
"\tsize_t offset;\n"
|
||||
"} cursor_metadata[] = {\n");
|
||||
|
||||
for (i = 0; i < n; ++i)
|
||||
fprintf(file, "\t{ \"%s\", %d, %d, %d, %d, %zu },\n",
|
||||
glyphs[i].name,
|
||||
glyphs[i].width, glyphs[i].height,
|
||||
glyphs[i].hotspot_x, glyphs[i].hotspot_y,
|
||||
glyphs[i].offset);
|
||||
|
||||
fprintf(file, "};");
|
||||
|
||||
fclose(file);
|
||||
}
|
||||
|
||||
struct glyph *
|
||||
find_mask_glyph(char *name)
|
||||
{
|
||||
const char mask[] = "_mask";
|
||||
const int masklen = strlen(mask);
|
||||
|
||||
int len = strlen(name);
|
||||
int i;
|
||||
for (i = 0; i < extracted_font.count; ++i) {
|
||||
struct glyph *g = &extracted_font.glyphs[i];
|
||||
int l2 = strlen(g->name);
|
||||
if ((l2 == len + masklen) &&
|
||||
(memcmp(g->name, name, len) == 0) &&
|
||||
(memcmp(g->name + len, mask, masklen) == 0)) {
|
||||
return g;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
output_all_cursors()
|
||||
{
|
||||
int i, j;
|
||||
struct reconstructed_glyph *glyphs =
|
||||
malloc(sizeof(struct reconstructed_glyph) *
|
||||
extracted_font.count/2);
|
||||
j = 0;
|
||||
|
||||
for (i = 0; i < extracted_font.count; ++i) {
|
||||
struct glyph *g = &extracted_font.glyphs[i];
|
||||
if (strstr(g->name, "_mask"))
|
||||
continue;
|
||||
|
||||
struct glyph *mask = find_mask_glyph(g->name);
|
||||
|
||||
reconstruct_glyph(g, mask, g->name, &glyphs[j]);
|
||||
j++;
|
||||
}
|
||||
|
||||
write_output_file(glyphs, extracted_font.count/2);
|
||||
}
|
||||
|
||||
static void
|
||||
find_cursor_and_mask(const char *name,
|
||||
struct glyph **cursor,
|
||||
struct glyph **mask)
|
||||
{
|
||||
int i;
|
||||
char mask_name[100];
|
||||
sprintf(mask_name, "%s_mask", name);
|
||||
|
||||
*cursor = *mask = NULL;
|
||||
|
||||
for (i = 0; i < extracted_font.count && (!*mask || !*cursor); ++i) {
|
||||
struct glyph *g = &extracted_font.glyphs[i];
|
||||
if (!strcmp(name, g->name))
|
||||
*cursor = g;
|
||||
else if (!strcmp(mask_name, g->name))
|
||||
*mask = g;
|
||||
}
|
||||
}
|
||||
|
||||
static struct {
|
||||
char *target_name, *source_name;
|
||||
} interesting_cursors[] = {
|
||||
{ "bottom_left_corner", "bottom_left_corner" },
|
||||
{ "bottom_right_corner", "bottom_right_corner" },
|
||||
{ "bottom_side", "bottom_side" },
|
||||
{ "grabbing", "fleur" },
|
||||
{ "left_ptr", "left_ptr" },
|
||||
{ "left_side", "left_side" },
|
||||
{ "right_side", "right_side" },
|
||||
{ "top_left_corner", "top_left_corner" },
|
||||
{ "top_right_corner", "top_right_corner" },
|
||||
{ "top_side", "top_side" },
|
||||
{ "xterm", "xterm" },
|
||||
{ "hand1", "hand1" },
|
||||
{ "watch", "watch" }
|
||||
};
|
||||
|
||||
static void
|
||||
output_interesting_cursors()
|
||||
{
|
||||
int i;
|
||||
int n = sizeof(interesting_cursors) / sizeof(interesting_cursors[0]);
|
||||
struct reconstructed_glyph *glyphs =
|
||||
malloc(n * sizeof(*glyphs));
|
||||
|
||||
if (!glyphs) {
|
||||
printf("reconstructed_glyph malloc failed\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
for (i = 0; i < n; ++i) {
|
||||
struct glyph *cursor, *mask;
|
||||
find_cursor_and_mask(interesting_cursors[i].source_name,
|
||||
&cursor, &mask);
|
||||
if (!cursor) {
|
||||
printf("no cursor for %s\n",
|
||||
interesting_cursors[i].source_name);
|
||||
abort();
|
||||
}
|
||||
if (!mask) {
|
||||
printf("no mask for %s\n",
|
||||
interesting_cursors[i].source_name);
|
||||
abort();
|
||||
}
|
||||
reconstruct_glyph(cursor, mask,
|
||||
interesting_cursors[i].target_name,
|
||||
&glyphs[i]);
|
||||
}
|
||||
|
||||
write_output_file(glyphs, n);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
const char filename[] = "cursor.pcf";
|
||||
|
||||
int fd = open(filename, O_RDONLY);
|
||||
struct stat filestat;
|
||||
|
||||
fstat(fd, &filestat);
|
||||
|
||||
void *fontbuf = mmap(NULL, filestat.st_size, PROT_READ,
|
||||
MAP_PRIVATE, fd, 0);
|
||||
|
||||
handle_pcf(fontbuf);
|
||||
|
||||
init_data_buffer();
|
||||
|
||||
//output_all_cursors();
|
||||
output_interesting_cursors();
|
||||
}
|
||||
@@ -0,0 +1,554 @@
|
||||
/*
|
||||
* Copyright 1999 SuSE, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* Author: Keith Packard, SuSE, Inc.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static uint32_t cursor_data[] = {
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0x00000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0xff000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff,
|
||||
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xffffffff,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff,
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000,
|
||||
0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000,
|
||||
0x00000000, 0x00000000,
|
||||
};
|
||||
|
||||
static struct cursor_metadata {
|
||||
char *name;
|
||||
int width, height;
|
||||
int hotspot_x, hotspot_y;
|
||||
size_t offset;
|
||||
} cursor_metadata[] = {
|
||||
{ "bottom_left_corner", 16, 16, 1, 14, 0 },
|
||||
{ "bottom_right_corner", 16, 16, 14, 14, 256 },
|
||||
{ "bottom_side", 15, 16, 7, 14, 512 },
|
||||
{ "grabbing", 16, 16, 8, 8, 752 },
|
||||
{ "left_ptr", 10, 16, 1, 1, 1008 },
|
||||
{ "left_side", 16, 15, 1, 7, 1168 },
|
||||
{ "right_side", 16, 15, 14, 7, 1408 },
|
||||
{ "top_left_corner", 16, 16, 1, 1, 1648 },
|
||||
{ "top_right_corner", 16, 16, 14, 1, 1904 },
|
||||
{ "top_side", 15, 16, 7, 1, 2160 },
|
||||
{ "xterm", 9, 16, 4, 8, 2400 },
|
||||
{ "hand1", 13, 16, 12, 0, 2544 },
|
||||
{ "watch", 16, 16, 15, 9, 2752 },
|
||||
};
|
||||
Executable
BIN
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
icondir = get_option('icon_directory')
|
||||
if icondir == ''
|
||||
icondir = join_paths(get_option('prefix'), get_option('datadir'), 'icons')
|
||||
endif
|
||||
|
||||
wayland_cursor = library(
|
||||
'wayland-cursor',
|
||||
sources: [
|
||||
'wayland-cursor.c',
|
||||
'os-compatibility.c',
|
||||
'xcursor.c',
|
||||
],
|
||||
version: '0.0.0',
|
||||
dependencies: [ wayland_client_dep ],
|
||||
c_args: [ '-DICONDIR="@0@"'.format(icondir) ],
|
||||
install: true,
|
||||
)
|
||||
|
||||
install_headers('wayland-cursor.h')
|
||||
|
||||
pkgconfig.generate(
|
||||
name: 'Wayland Cursor',
|
||||
description: 'Wayland cursor helper library',
|
||||
version: meson.project_version(),
|
||||
libraries: wayland_cursor,
|
||||
filebase: 'wayland-cursor',
|
||||
)
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* Copyright © 2012 Collabora, Ltd.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef HAVE_MEMFD_CREATE
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include "os-compatibility.h"
|
||||
|
||||
#ifndef HAVE_MKOSTEMP
|
||||
static int
|
||||
set_cloexec_or_close(int fd)
|
||||
{
|
||||
long flags;
|
||||
|
||||
if (fd == -1)
|
||||
return -1;
|
||||
|
||||
flags = fcntl(fd, F_GETFD);
|
||||
if (flags == -1)
|
||||
goto err;
|
||||
|
||||
if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) == -1)
|
||||
goto err;
|
||||
|
||||
return fd;
|
||||
|
||||
err:
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
create_tmpfile_cloexec(char *tmpname)
|
||||
{
|
||||
int fd;
|
||||
|
||||
#ifdef HAVE_MKOSTEMP
|
||||
fd = mkostemp(tmpname, O_CLOEXEC);
|
||||
if (fd >= 0)
|
||||
unlink(tmpname);
|
||||
#else
|
||||
fd = mkstemp(tmpname);
|
||||
if (fd >= 0) {
|
||||
fd = set_cloexec_or_close(fd);
|
||||
unlink(tmpname);
|
||||
}
|
||||
#endif
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a new, unique, anonymous file of the given size, and
|
||||
* return the file descriptor for it. The file descriptor is set
|
||||
* CLOEXEC. The file is immediately suitable for mmap()'ing
|
||||
* the given size at offset zero.
|
||||
*
|
||||
* The file should not have a permanent backing store like a disk,
|
||||
* but may have if XDG_RUNTIME_DIR is not properly implemented in OS.
|
||||
*
|
||||
* The file name is deleted from the file system.
|
||||
*
|
||||
* The file is suitable for buffer sharing between processes by
|
||||
* transmitting the file descriptor over Unix sockets using the
|
||||
* SCM_RIGHTS methods.
|
||||
*
|
||||
* If the C library implements posix_fallocate(), it is used to
|
||||
* guarantee that disk space is available for the file at the
|
||||
* given size. If disk space is insufficient, errno is set to ENOSPC.
|
||||
* If posix_fallocate() is not supported, program may receive
|
||||
* SIGBUS on accessing mmap()'ed file contents instead.
|
||||
*
|
||||
* If the C library implements memfd_create(), it is used to create the
|
||||
* file purely in memory, without any backing file name on the file
|
||||
* system, and then sealing off the possibility of shrinking it. This
|
||||
* can then be checked before accessing mmap()'ed file contents, to
|
||||
* make sure SIGBUS can't happen. It also avoids requiring
|
||||
* XDG_RUNTIME_DIR.
|
||||
*/
|
||||
int
|
||||
os_create_anonymous_file(off_t size)
|
||||
{
|
||||
static const char template[] = "/wayland-cursor-shared-XXXXXX";
|
||||
const char *path;
|
||||
char *name;
|
||||
int fd;
|
||||
|
||||
#ifdef HAVE_MEMFD_CREATE
|
||||
fd = memfd_create("wayland-cursor", MFD_CLOEXEC | MFD_ALLOW_SEALING);
|
||||
if (fd >= 0) {
|
||||
/* We can add this seal before calling posix_fallocate(), as
|
||||
* the file is currently zero-sized anyway.
|
||||
*
|
||||
* There is also no need to check for the return value, we
|
||||
* couldn't do anything with it anyway.
|
||||
*/
|
||||
fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_SEAL);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
path = getenv("XDG_RUNTIME_DIR");
|
||||
if (!path) {
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
name = malloc(strlen(path) + sizeof(template));
|
||||
if (!name)
|
||||
return -1;
|
||||
|
||||
strcpy(name, path);
|
||||
strcat(name, template);
|
||||
|
||||
fd = create_tmpfile_cloexec(name);
|
||||
|
||||
free(name);
|
||||
|
||||
if (fd < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (os_resize_anonymous_file(fd, size) < 0) {
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
int
|
||||
os_resize_anonymous_file(int fd, off_t size)
|
||||
{
|
||||
#ifdef HAVE_POSIX_FALLOCATE
|
||||
/*
|
||||
* Filesystems that do support fallocate will return EINVAL or
|
||||
* EOPNOTSUPP. In this case we need to fall back to ftruncate
|
||||
*/
|
||||
errno = posix_fallocate(fd, 0, size);
|
||||
if (errno == 0)
|
||||
return 0;
|
||||
else if (errno != EINVAL && errno != EOPNOTSUPP)
|
||||
return -1;
|
||||
#endif
|
||||
if (ftruncate(fd, size) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright © 2012 Collabora, Ltd.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef OS_COMPATIBILITY_H
|
||||
#define OS_COMPATIBILITY_H
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
int
|
||||
os_create_anonymous_file(off_t size);
|
||||
|
||||
int
|
||||
os_resize_anonymous_file(int fd, off_t size);
|
||||
|
||||
#endif /* OS_COMPATIBILITY_H */
|
||||
@@ -0,0 +1,8 @@
|
||||
libdir=@abs_builddir@/.libs
|
||||
includedir=@abs_srcdir@
|
||||
|
||||
Name: Wayland Cursor
|
||||
Description: Wayland cursor helper library (not installed)
|
||||
Version: @WAYLAND_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lwayland-cursor
|
||||
@@ -0,0 +1,523 @@
|
||||
/*
|
||||
* Copyright © 2012 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "xcursor.h"
|
||||
#include "wayland-cursor.h"
|
||||
#include "wayland-client.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "os-compatibility.h"
|
||||
|
||||
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
||||
|
||||
struct shm_pool {
|
||||
struct wl_shm_pool *pool;
|
||||
int fd;
|
||||
unsigned int size;
|
||||
unsigned int used;
|
||||
char *data;
|
||||
};
|
||||
|
||||
static struct shm_pool *
|
||||
shm_pool_create(struct wl_shm *shm, int size)
|
||||
{
|
||||
struct shm_pool *pool;
|
||||
|
||||
pool = malloc(sizeof *pool);
|
||||
if (!pool)
|
||||
return NULL;
|
||||
|
||||
pool->fd = os_create_anonymous_file(size);
|
||||
if (pool->fd < 0)
|
||||
goto err_free;
|
||||
|
||||
pool->data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
pool->fd, 0);
|
||||
|
||||
if (pool->data == MAP_FAILED)
|
||||
goto err_close;
|
||||
|
||||
pool->pool = wl_shm_create_pool(shm, pool->fd, size);
|
||||
pool->size = size;
|
||||
pool->used = 0;
|
||||
|
||||
return pool;
|
||||
|
||||
err_close:
|
||||
close(pool->fd);
|
||||
err_free:
|
||||
free(pool);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
shm_pool_resize(struct shm_pool *pool, int size)
|
||||
{
|
||||
if (os_resize_anonymous_file(pool->fd, size) < 0)
|
||||
return 0;
|
||||
|
||||
wl_shm_pool_resize(pool->pool, size);
|
||||
|
||||
munmap(pool->data, pool->size);
|
||||
|
||||
pool->data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
pool->fd, 0);
|
||||
if (pool->data == (void *)-1)
|
||||
return 0;
|
||||
pool->size = size;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
shm_pool_allocate(struct shm_pool *pool, int size)
|
||||
{
|
||||
int offset;
|
||||
|
||||
if (pool->used + size > pool->size)
|
||||
if (!shm_pool_resize(pool, 2 * pool->size + size))
|
||||
return -1;
|
||||
|
||||
offset = pool->used;
|
||||
pool->used += size;
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
static void
|
||||
shm_pool_destroy(struct shm_pool *pool)
|
||||
{
|
||||
munmap(pool->data, pool->size);
|
||||
wl_shm_pool_destroy(pool->pool);
|
||||
close(pool->fd);
|
||||
free(pool);
|
||||
}
|
||||
|
||||
|
||||
struct wl_cursor_theme {
|
||||
unsigned int cursor_count;
|
||||
struct wl_cursor **cursors;
|
||||
struct wl_shm *shm;
|
||||
struct shm_pool *pool;
|
||||
char *name;
|
||||
int size;
|
||||
};
|
||||
|
||||
struct cursor_image {
|
||||
struct wl_cursor_image image;
|
||||
struct wl_cursor_theme *theme;
|
||||
struct wl_buffer *buffer;
|
||||
int offset; /* data offset of this image in the shm pool */
|
||||
};
|
||||
|
||||
struct cursor {
|
||||
struct wl_cursor cursor;
|
||||
uint32_t total_delay; /* length of the animation in ms */
|
||||
};
|
||||
|
||||
/** Get an shm buffer for a cursor image
|
||||
*
|
||||
* \param image The cursor image
|
||||
* \return An shm buffer for the cursor image. The user should not destroy
|
||||
* the returned buffer.
|
||||
*/
|
||||
WL_EXPORT struct wl_buffer *
|
||||
wl_cursor_image_get_buffer(struct wl_cursor_image *_img)
|
||||
{
|
||||
struct cursor_image *image = (struct cursor_image *) _img;
|
||||
struct wl_cursor_theme *theme = image->theme;
|
||||
|
||||
if (!image->buffer) {
|
||||
image->buffer =
|
||||
wl_shm_pool_create_buffer(theme->pool->pool,
|
||||
image->offset,
|
||||
_img->width, _img->height,
|
||||
_img->width * 4,
|
||||
WL_SHM_FORMAT_ARGB8888);
|
||||
};
|
||||
|
||||
return image->buffer;
|
||||
}
|
||||
|
||||
static void
|
||||
wl_cursor_image_destroy(struct wl_cursor_image *_img)
|
||||
{
|
||||
struct cursor_image *image = (struct cursor_image *) _img;
|
||||
|
||||
if (image->buffer)
|
||||
wl_buffer_destroy(image->buffer);
|
||||
|
||||
free(image);
|
||||
}
|
||||
|
||||
static void
|
||||
wl_cursor_destroy(struct wl_cursor *cursor)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < cursor->image_count; i++)
|
||||
wl_cursor_image_destroy(cursor->images[i]);
|
||||
|
||||
free(cursor->images);
|
||||
free(cursor->name);
|
||||
free(cursor);
|
||||
}
|
||||
|
||||
#include "cursor-data.h"
|
||||
|
||||
static struct wl_cursor *
|
||||
wl_cursor_create_from_data(struct cursor_metadata *metadata,
|
||||
struct wl_cursor_theme *theme)
|
||||
{
|
||||
struct cursor *cursor;
|
||||
struct cursor_image *image;
|
||||
int size;
|
||||
|
||||
cursor = malloc(sizeof *cursor);
|
||||
if (!cursor)
|
||||
return NULL;
|
||||
|
||||
cursor->cursor.image_count = 1;
|
||||
cursor->cursor.images = malloc(sizeof *cursor->cursor.images);
|
||||
if (!cursor->cursor.images)
|
||||
goto err_free_cursor;
|
||||
|
||||
cursor->cursor.name = strdup(metadata->name);
|
||||
cursor->total_delay = 0;
|
||||
|
||||
image = malloc(sizeof *image);
|
||||
if (!image)
|
||||
goto err_free_images;
|
||||
|
||||
cursor->cursor.images[0] = (struct wl_cursor_image *) image;
|
||||
image->theme = theme;
|
||||
image->buffer = NULL;
|
||||
image->image.width = metadata->width;
|
||||
image->image.height = metadata->height;
|
||||
image->image.hotspot_x = metadata->hotspot_x;
|
||||
image->image.hotspot_y = metadata->hotspot_y;
|
||||
image->image.delay = 0;
|
||||
|
||||
size = metadata->width * metadata->height * sizeof(uint32_t);
|
||||
image->offset = shm_pool_allocate(theme->pool, size);
|
||||
|
||||
if (image->offset < 0)
|
||||
goto err_free_image;
|
||||
|
||||
memcpy(theme->pool->data + image->offset,
|
||||
cursor_data + metadata->offset, size);
|
||||
|
||||
return &cursor->cursor;
|
||||
|
||||
err_free_image:
|
||||
free(image);
|
||||
|
||||
err_free_images:
|
||||
free(cursor->cursor.name);
|
||||
free(cursor->cursor.images);
|
||||
|
||||
err_free_cursor:
|
||||
free(cursor);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
load_default_theme(struct wl_cursor_theme *theme)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
free(theme->name);
|
||||
theme->name = strdup("default");
|
||||
|
||||
theme->cursor_count = ARRAY_LENGTH(cursor_metadata);
|
||||
theme->cursors = malloc(theme->cursor_count * sizeof(*theme->cursors));
|
||||
|
||||
if (theme->cursors == NULL) {
|
||||
theme->cursor_count = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < theme->cursor_count; ++i) {
|
||||
theme->cursors[i] =
|
||||
wl_cursor_create_from_data(&cursor_metadata[i], theme);
|
||||
|
||||
if (theme->cursors[i] == NULL)
|
||||
break;
|
||||
}
|
||||
theme->cursor_count = i;
|
||||
}
|
||||
|
||||
static struct wl_cursor *
|
||||
wl_cursor_create_from_xcursor_images(XcursorImages *images,
|
||||
struct wl_cursor_theme *theme)
|
||||
{
|
||||
struct cursor *cursor;
|
||||
struct cursor_image *image;
|
||||
int i, size;
|
||||
|
||||
cursor = malloc(sizeof *cursor);
|
||||
if (!cursor)
|
||||
return NULL;
|
||||
|
||||
cursor->cursor.images =
|
||||
malloc(images->nimage * sizeof cursor->cursor.images[0]);
|
||||
if (!cursor->cursor.images) {
|
||||
free(cursor);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cursor->cursor.name = strdup(images->name);
|
||||
cursor->total_delay = 0;
|
||||
|
||||
for (i = 0; i < images->nimage; i++) {
|
||||
image = malloc(sizeof *image);
|
||||
if (image == NULL)
|
||||
break;
|
||||
|
||||
image->theme = theme;
|
||||
image->buffer = NULL;
|
||||
|
||||
image->image.width = images->images[i]->width;
|
||||
image->image.height = images->images[i]->height;
|
||||
image->image.hotspot_x = images->images[i]->xhot;
|
||||
image->image.hotspot_y = images->images[i]->yhot;
|
||||
image->image.delay = images->images[i]->delay;
|
||||
|
||||
size = image->image.width * image->image.height * 4;
|
||||
image->offset = shm_pool_allocate(theme->pool, size);
|
||||
if (image->offset < 0) {
|
||||
free(image);
|
||||
break;
|
||||
}
|
||||
|
||||
/* copy pixels to shm pool */
|
||||
memcpy(theme->pool->data + image->offset,
|
||||
images->images[i]->pixels, size);
|
||||
cursor->total_delay += image->image.delay;
|
||||
cursor->cursor.images[i] = (struct wl_cursor_image *) image;
|
||||
}
|
||||
cursor->cursor.image_count = i;
|
||||
|
||||
if (cursor->cursor.image_count == 0) {
|
||||
free(cursor->cursor.name);
|
||||
free(cursor->cursor.images);
|
||||
free(cursor);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &cursor->cursor;
|
||||
}
|
||||
|
||||
static void
|
||||
load_callback(XcursorImages *images, void *data)
|
||||
{
|
||||
struct wl_cursor_theme *theme = data;
|
||||
struct wl_cursor *cursor;
|
||||
|
||||
if (wl_cursor_theme_get_cursor(theme, images->name)) {
|
||||
XcursorImagesDestroy(images);
|
||||
return;
|
||||
}
|
||||
|
||||
cursor = wl_cursor_create_from_xcursor_images(images, theme);
|
||||
|
||||
if (cursor) {
|
||||
theme->cursor_count++;
|
||||
theme->cursors =
|
||||
realloc(theme->cursors,
|
||||
theme->cursor_count * sizeof theme->cursors[0]);
|
||||
|
||||
if (theme->cursors == NULL) {
|
||||
theme->cursor_count--;
|
||||
free(cursor);
|
||||
} else {
|
||||
theme->cursors[theme->cursor_count - 1] = cursor;
|
||||
}
|
||||
}
|
||||
|
||||
XcursorImagesDestroy(images);
|
||||
}
|
||||
|
||||
/** Load a cursor theme to memory shared with the compositor
|
||||
*
|
||||
* \param name The name of the cursor theme to load. If %NULL, the default
|
||||
* theme will be loaded.
|
||||
* \param size Desired size of the cursor images.
|
||||
* \param shm The compositor's shm interface.
|
||||
*
|
||||
* \return An object representing the theme that should be destroyed with
|
||||
* wl_cursor_theme_destroy() or %NULL on error. If no theme with the given
|
||||
* name exists, a default theme will be loaded.
|
||||
*/
|
||||
WL_EXPORT struct wl_cursor_theme *
|
||||
wl_cursor_theme_load(const char *name, int size, struct wl_shm *shm)
|
||||
{
|
||||
struct wl_cursor_theme *theme;
|
||||
|
||||
theme = malloc(sizeof *theme);
|
||||
if (!theme)
|
||||
return NULL;
|
||||
|
||||
if (!name)
|
||||
name = "default";
|
||||
|
||||
theme->name = strdup(name);
|
||||
if (!theme->name)
|
||||
goto out_error_name;
|
||||
theme->size = size;
|
||||
theme->cursor_count = 0;
|
||||
theme->cursors = NULL;
|
||||
|
||||
theme->pool = shm_pool_create(shm, size * size * 4);
|
||||
if (!theme->pool)
|
||||
goto out_error_pool;
|
||||
|
||||
xcursor_load_theme(name, size, load_callback, theme);
|
||||
|
||||
if (theme->cursor_count == 0)
|
||||
load_default_theme(theme);
|
||||
|
||||
return theme;
|
||||
|
||||
out_error_pool:
|
||||
free(theme->name);
|
||||
out_error_name:
|
||||
free(theme);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Destroys a cursor theme object
|
||||
*
|
||||
* \param theme The cursor theme to be destroyed
|
||||
*/
|
||||
WL_EXPORT void
|
||||
wl_cursor_theme_destroy(struct wl_cursor_theme *theme)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < theme->cursor_count; i++)
|
||||
wl_cursor_destroy(theme->cursors[i]);
|
||||
|
||||
shm_pool_destroy(theme->pool);
|
||||
|
||||
free(theme->name);
|
||||
free(theme->cursors);
|
||||
free(theme);
|
||||
}
|
||||
|
||||
/** Get the cursor for a given name from a cursor theme
|
||||
*
|
||||
* \param theme The cursor theme
|
||||
* \param name Name of the desired cursor
|
||||
* \return The theme's cursor of the given name or %NULL if there is no
|
||||
* such cursor
|
||||
*/
|
||||
WL_EXPORT struct wl_cursor *
|
||||
wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
|
||||
const char *name)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < theme->cursor_count; i++) {
|
||||
if (strcmp(name, theme->cursors[i]->name) == 0)
|
||||
return theme->cursors[i];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/** Find the frame for a given elapsed time in a cursor animation
|
||||
* as well as the time left until next cursor change.
|
||||
*
|
||||
* \param cursor The cursor
|
||||
* \param time Elapsed time in ms since the beginning of the animation
|
||||
* \param duration pointer to uint32_t to store time left for this image or
|
||||
* zero if the cursor won't change.
|
||||
*
|
||||
* \return The index of the image that should be displayed for the
|
||||
* given time in the cursor animation.
|
||||
*/
|
||||
WL_EXPORT int
|
||||
wl_cursor_frame_and_duration(struct wl_cursor *_cursor, uint32_t time,
|
||||
uint32_t *duration)
|
||||
{
|
||||
struct cursor *cursor = (struct cursor *) _cursor;
|
||||
uint32_t t;
|
||||
int i;
|
||||
|
||||
if (cursor->cursor.image_count == 1) {
|
||||
if (duration)
|
||||
*duration = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
t = time % cursor->total_delay;
|
||||
|
||||
/* If there is a 0 delay in the image set then this
|
||||
* loop breaks on it and we display that cursor until
|
||||
* time % cursor->total_delay wraps again.
|
||||
* Since a 0 delay is silly, and we've never actually
|
||||
* seen one in a cursor file, we haven't bothered to
|
||||
* "fix" this.
|
||||
*/
|
||||
while (t - cursor->cursor.images[i]->delay < t)
|
||||
t -= cursor->cursor.images[i++]->delay;
|
||||
|
||||
if (!duration)
|
||||
return i;
|
||||
|
||||
/* Make sure we don't accidentally tell the caller this is
|
||||
* a static cursor image.
|
||||
*/
|
||||
if (t >= cursor->cursor.images[i]->delay)
|
||||
*duration = 1;
|
||||
else
|
||||
*duration = cursor->cursor.images[i]->delay - t;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/** Find the frame for a given elapsed time in a cursor animation
|
||||
*
|
||||
* \param cursor The cursor
|
||||
* \param time Elapsed time in ms since the beginning of the animation
|
||||
*
|
||||
* \return The index of the image that should be displayed for the
|
||||
* given time in the cursor animation.
|
||||
*/
|
||||
WL_EXPORT int
|
||||
wl_cursor_frame(struct wl_cursor *_cursor, uint32_t time)
|
||||
{
|
||||
return wl_cursor_frame_and_duration(_cursor, time, NULL);
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Copyright © 2012 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef WAYLAND_CURSOR_H
|
||||
#define WAYLAND_CURSOR_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct wl_cursor_theme;
|
||||
struct wl_buffer;
|
||||
struct wl_shm;
|
||||
|
||||
/** A still image part of a cursor
|
||||
*
|
||||
* Use `wl_cursor_image_get_buffer()` to get the corresponding `struct
|
||||
* wl_buffer` to attach to your `struct wl_surface`. */
|
||||
struct wl_cursor_image {
|
||||
/** Actual width */
|
||||
uint32_t width;
|
||||
|
||||
/** Actual height */
|
||||
uint32_t height;
|
||||
|
||||
/** Hot spot x (must be inside image) */
|
||||
uint32_t hotspot_x;
|
||||
|
||||
/** Hot spot y (must be inside image) */
|
||||
uint32_t hotspot_y;
|
||||
|
||||
/** Animation delay to next frame (ms) */
|
||||
uint32_t delay;
|
||||
};
|
||||
|
||||
/** A cursor, as returned by `wl_cursor_theme_get_cursor()` */
|
||||
struct wl_cursor {
|
||||
/** How many images there are in this cursor’s animation */
|
||||
unsigned int image_count;
|
||||
|
||||
/** The array of still images composing this animation */
|
||||
struct wl_cursor_image **images;
|
||||
|
||||
/** The name of this cursor */
|
||||
char *name;
|
||||
};
|
||||
|
||||
struct wl_cursor_theme *
|
||||
wl_cursor_theme_load(const char *name, int size, struct wl_shm *shm);
|
||||
|
||||
void
|
||||
wl_cursor_theme_destroy(struct wl_cursor_theme *theme);
|
||||
|
||||
struct wl_cursor *
|
||||
wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
|
||||
const char *name);
|
||||
|
||||
struct wl_buffer *
|
||||
wl_cursor_image_get_buffer(struct wl_cursor_image *image);
|
||||
|
||||
int
|
||||
wl_cursor_frame(struct wl_cursor *cursor, uint32_t time);
|
||||
|
||||
int
|
||||
wl_cursor_frame_and_duration(struct wl_cursor *cursor, uint32_t time,
|
||||
uint32_t *duration);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,10 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: Wayland Cursor
|
||||
Description: Wayland cursor helper library
|
||||
Version: @WAYLAND_VERSION@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lwayland-cursor
|
||||
@@ -0,0 +1,978 @@
|
||||
/*
|
||||
* Copyright © 2002 Keith Packard
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "xcursor.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <dirent.h>
|
||||
|
||||
/*
|
||||
* From libXcursor/include/X11/extensions/Xcursor.h
|
||||
*/
|
||||
|
||||
#define XcursorTrue 1
|
||||
#define XcursorFalse 0
|
||||
|
||||
/*
|
||||
* Cursor files start with a header. The header
|
||||
* contains a magic number, a version number and a
|
||||
* table of contents which has type and offset information
|
||||
* for the remaining tables in the file.
|
||||
*
|
||||
* File minor versions increment for compatible changes
|
||||
* File major versions increment for incompatible changes (never, we hope)
|
||||
*
|
||||
* Chunks of the same type are always upward compatible. Incompatible
|
||||
* changes are made with new chunk types; the old data can remain under
|
||||
* the old type. Upward compatible changes can add header data as the
|
||||
* header lengths are specified in the file.
|
||||
*
|
||||
* File:
|
||||
* FileHeader
|
||||
* LISTofChunk
|
||||
*
|
||||
* FileHeader:
|
||||
* CARD32 magic magic number
|
||||
* CARD32 header bytes in file header
|
||||
* CARD32 version file version
|
||||
* CARD32 ntoc number of toc entries
|
||||
* LISTofFileToc toc table of contents
|
||||
*
|
||||
* FileToc:
|
||||
* CARD32 type entry type
|
||||
* CARD32 subtype entry subtype (size for images)
|
||||
* CARD32 position absolute file position
|
||||
*/
|
||||
|
||||
#define XCURSOR_MAGIC 0x72756358 /* "Xcur" LSBFirst */
|
||||
|
||||
/*
|
||||
* Current Xcursor version number. Will be substituted by configure
|
||||
* from the version in the libXcursor configure.ac file.
|
||||
*/
|
||||
|
||||
#define XCURSOR_LIB_MAJOR 1
|
||||
#define XCURSOR_LIB_MINOR 1
|
||||
#define XCURSOR_LIB_REVISION 13
|
||||
#define XCURSOR_LIB_VERSION ((XCURSOR_LIB_MAJOR * 10000) + \
|
||||
(XCURSOR_LIB_MINOR * 100) + \
|
||||
(XCURSOR_LIB_REVISION))
|
||||
|
||||
/*
|
||||
* This version number is stored in cursor files; changes to the
|
||||
* file format require updating this version number
|
||||
*/
|
||||
#define XCURSOR_FILE_MAJOR 1
|
||||
#define XCURSOR_FILE_MINOR 0
|
||||
#define XCURSOR_FILE_VERSION ((XCURSOR_FILE_MAJOR << 16) | (XCURSOR_FILE_MINOR))
|
||||
#define XCURSOR_FILE_HEADER_LEN (4 * 4)
|
||||
#define XCURSOR_FILE_TOC_LEN (3 * 4)
|
||||
|
||||
typedef struct _XcursorFileToc {
|
||||
XcursorUInt type; /* chunk type */
|
||||
XcursorUInt subtype; /* subtype (size for images) */
|
||||
XcursorUInt position; /* absolute position in file */
|
||||
} XcursorFileToc;
|
||||
|
||||
typedef struct _XcursorFileHeader {
|
||||
XcursorUInt magic; /* magic number */
|
||||
XcursorUInt header; /* byte length of header */
|
||||
XcursorUInt version; /* file version number */
|
||||
XcursorUInt ntoc; /* number of toc entries */
|
||||
XcursorFileToc *tocs; /* table of contents */
|
||||
} XcursorFileHeader;
|
||||
|
||||
/*
|
||||
* The rest of the file is a list of chunks, each tagged by type
|
||||
* and version.
|
||||
*
|
||||
* Chunk:
|
||||
* ChunkHeader
|
||||
* <extra type-specific header fields>
|
||||
* <type-specific data>
|
||||
*
|
||||
* ChunkHeader:
|
||||
* CARD32 header bytes in chunk header + type header
|
||||
* CARD32 type chunk type
|
||||
* CARD32 subtype chunk subtype
|
||||
* CARD32 version chunk type version
|
||||
*/
|
||||
|
||||
#define XCURSOR_CHUNK_HEADER_LEN (4 * 4)
|
||||
|
||||
typedef struct _XcursorChunkHeader {
|
||||
XcursorUInt header; /* bytes in chunk header */
|
||||
XcursorUInt type; /* chunk type */
|
||||
XcursorUInt subtype; /* chunk subtype (size for images) */
|
||||
XcursorUInt version; /* version of this type */
|
||||
} XcursorChunkHeader;
|
||||
|
||||
/*
|
||||
* Here's a list of the known chunk types
|
||||
*/
|
||||
|
||||
/*
|
||||
* Comments consist of a 4-byte length field followed by
|
||||
* UTF-8 encoded text
|
||||
*
|
||||
* Comment:
|
||||
* ChunkHeader header chunk header
|
||||
* CARD32 length bytes in text
|
||||
* LISTofCARD8 text UTF-8 encoded text
|
||||
*/
|
||||
|
||||
#define XCURSOR_COMMENT_TYPE 0xfffe0001
|
||||
#define XCURSOR_COMMENT_VERSION 1
|
||||
#define XCURSOR_COMMENT_HEADER_LEN (XCURSOR_CHUNK_HEADER_LEN + (1 *4))
|
||||
#define XCURSOR_COMMENT_COPYRIGHT 1
|
||||
#define XCURSOR_COMMENT_LICENSE 2
|
||||
#define XCURSOR_COMMENT_OTHER 3
|
||||
#define XCURSOR_COMMENT_MAX_LEN 0x100000
|
||||
|
||||
typedef struct _XcursorComment {
|
||||
XcursorUInt version;
|
||||
XcursorUInt comment_type;
|
||||
char *comment;
|
||||
} XcursorComment;
|
||||
|
||||
/*
|
||||
* Each cursor image occupies a separate image chunk.
|
||||
* The length of the image header follows the chunk header
|
||||
* so that future versions can extend the header without
|
||||
* breaking older applications
|
||||
*
|
||||
* Image:
|
||||
* ChunkHeader header chunk header
|
||||
* CARD32 width actual width
|
||||
* CARD32 height actual height
|
||||
* CARD32 xhot hot spot x
|
||||
* CARD32 yhot hot spot y
|
||||
* CARD32 delay animation delay
|
||||
* LISTofCARD32 pixels ARGB pixels
|
||||
*/
|
||||
|
||||
#define XCURSOR_IMAGE_TYPE 0xfffd0002
|
||||
#define XCURSOR_IMAGE_VERSION 1
|
||||
#define XCURSOR_IMAGE_HEADER_LEN (XCURSOR_CHUNK_HEADER_LEN + (5*4))
|
||||
#define XCURSOR_IMAGE_MAX_SIZE 0x7fff /* 32767x32767 max cursor size */
|
||||
|
||||
typedef struct _XcursorFile XcursorFile;
|
||||
|
||||
struct _XcursorFile {
|
||||
void *closure;
|
||||
int (*read) (XcursorFile *file, unsigned char *buf, int len);
|
||||
int (*write) (XcursorFile *file, unsigned char *buf, int len);
|
||||
int (*seek) (XcursorFile *file, long offset, int whence);
|
||||
};
|
||||
|
||||
typedef struct _XcursorComments {
|
||||
int ncomment; /* number of comments */
|
||||
XcursorComment **comments; /* array of XcursorComment pointers */
|
||||
} XcursorComments;
|
||||
|
||||
/*
|
||||
* From libXcursor/src/file.c
|
||||
*/
|
||||
|
||||
static XcursorImage *
|
||||
XcursorImageCreate (int width, int height)
|
||||
{
|
||||
XcursorImage *image;
|
||||
|
||||
if (width < 0 || height < 0)
|
||||
return NULL;
|
||||
if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE)
|
||||
return NULL;
|
||||
|
||||
image = malloc (sizeof (XcursorImage) +
|
||||
width * height * sizeof (XcursorPixel));
|
||||
if (!image)
|
||||
return NULL;
|
||||
image->version = XCURSOR_IMAGE_VERSION;
|
||||
image->pixels = (XcursorPixel *) (image + 1);
|
||||
image->size = width > height ? width : height;
|
||||
image->width = width;
|
||||
image->height = height;
|
||||
image->delay = 0;
|
||||
return image;
|
||||
}
|
||||
|
||||
static void
|
||||
XcursorImageDestroy (XcursorImage *image)
|
||||
{
|
||||
free (image);
|
||||
}
|
||||
|
||||
static XcursorImages *
|
||||
XcursorImagesCreate (int size)
|
||||
{
|
||||
XcursorImages *images;
|
||||
|
||||
images = malloc (sizeof (XcursorImages) +
|
||||
size * sizeof (XcursorImage *));
|
||||
if (!images)
|
||||
return NULL;
|
||||
images->nimage = 0;
|
||||
images->images = (XcursorImage **) (images + 1);
|
||||
images->name = NULL;
|
||||
return images;
|
||||
}
|
||||
|
||||
void
|
||||
XcursorImagesDestroy (XcursorImages *images)
|
||||
{
|
||||
int n;
|
||||
|
||||
if (!images)
|
||||
return;
|
||||
|
||||
for (n = 0; n < images->nimage; n++)
|
||||
XcursorImageDestroy (images->images[n]);
|
||||
if (images->name)
|
||||
free (images->name);
|
||||
free (images);
|
||||
}
|
||||
|
||||
static void
|
||||
XcursorImagesSetName (XcursorImages *images, const char *name)
|
||||
{
|
||||
char *new;
|
||||
|
||||
if (!images || !name)
|
||||
return;
|
||||
|
||||
new = malloc (strlen (name) + 1);
|
||||
|
||||
if (!new)
|
||||
return;
|
||||
|
||||
strcpy (new, name);
|
||||
if (images->name)
|
||||
free (images->name);
|
||||
images->name = new;
|
||||
}
|
||||
|
||||
static XcursorBool
|
||||
_XcursorReadUInt (XcursorFile *file, XcursorUInt *u)
|
||||
{
|
||||
unsigned char bytes[4];
|
||||
|
||||
if (!file || !u)
|
||||
return XcursorFalse;
|
||||
|
||||
if ((*file->read) (file, bytes, 4) != 4)
|
||||
return XcursorFalse;
|
||||
|
||||
*u = ((XcursorUInt)(bytes[0]) << 0) |
|
||||
((XcursorUInt)(bytes[1]) << 8) |
|
||||
((XcursorUInt)(bytes[2]) << 16) |
|
||||
((XcursorUInt)(bytes[3]) << 24);
|
||||
return XcursorTrue;
|
||||
}
|
||||
|
||||
static void
|
||||
_XcursorFileHeaderDestroy (XcursorFileHeader *fileHeader)
|
||||
{
|
||||
free (fileHeader);
|
||||
}
|
||||
|
||||
static XcursorFileHeader *
|
||||
_XcursorFileHeaderCreate (int ntoc)
|
||||
{
|
||||
XcursorFileHeader *fileHeader;
|
||||
|
||||
if (ntoc > 0x10000)
|
||||
return NULL;
|
||||
fileHeader = malloc (sizeof (XcursorFileHeader) +
|
||||
ntoc * sizeof (XcursorFileToc));
|
||||
if (!fileHeader)
|
||||
return NULL;
|
||||
fileHeader->magic = XCURSOR_MAGIC;
|
||||
fileHeader->header = XCURSOR_FILE_HEADER_LEN;
|
||||
fileHeader->version = XCURSOR_FILE_VERSION;
|
||||
fileHeader->ntoc = ntoc;
|
||||
fileHeader->tocs = (XcursorFileToc *) (fileHeader + 1);
|
||||
return fileHeader;
|
||||
}
|
||||
|
||||
static XcursorFileHeader *
|
||||
_XcursorReadFileHeader (XcursorFile *file)
|
||||
{
|
||||
XcursorFileHeader head, *fileHeader;
|
||||
XcursorUInt skip;
|
||||
unsigned int n;
|
||||
|
||||
if (!file)
|
||||
return NULL;
|
||||
|
||||
if (!_XcursorReadUInt (file, &head.magic))
|
||||
return NULL;
|
||||
if (head.magic != XCURSOR_MAGIC)
|
||||
return NULL;
|
||||
if (!_XcursorReadUInt (file, &head.header))
|
||||
return NULL;
|
||||
if (!_XcursorReadUInt (file, &head.version))
|
||||
return NULL;
|
||||
if (!_XcursorReadUInt (file, &head.ntoc))
|
||||
return NULL;
|
||||
skip = head.header - XCURSOR_FILE_HEADER_LEN;
|
||||
if (skip)
|
||||
if ((*file->seek) (file, skip, SEEK_CUR) == EOF)
|
||||
return NULL;
|
||||
fileHeader = _XcursorFileHeaderCreate (head.ntoc);
|
||||
if (!fileHeader)
|
||||
return NULL;
|
||||
fileHeader->magic = head.magic;
|
||||
fileHeader->header = head.header;
|
||||
fileHeader->version = head.version;
|
||||
fileHeader->ntoc = head.ntoc;
|
||||
for (n = 0; n < fileHeader->ntoc; n++)
|
||||
{
|
||||
if (!_XcursorReadUInt (file, &fileHeader->tocs[n].type))
|
||||
break;
|
||||
if (!_XcursorReadUInt (file, &fileHeader->tocs[n].subtype))
|
||||
break;
|
||||
if (!_XcursorReadUInt (file, &fileHeader->tocs[n].position))
|
||||
break;
|
||||
}
|
||||
if (n != fileHeader->ntoc)
|
||||
{
|
||||
_XcursorFileHeaderDestroy (fileHeader);
|
||||
return NULL;
|
||||
}
|
||||
return fileHeader;
|
||||
}
|
||||
|
||||
static XcursorBool
|
||||
_XcursorSeekToToc (XcursorFile *file,
|
||||
XcursorFileHeader *fileHeader,
|
||||
int toc)
|
||||
{
|
||||
if (!file || !fileHeader || \
|
||||
(*file->seek) (file, fileHeader->tocs[toc].position, SEEK_SET) == EOF)
|
||||
return XcursorFalse;
|
||||
return XcursorTrue;
|
||||
}
|
||||
|
||||
static XcursorBool
|
||||
_XcursorFileReadChunkHeader (XcursorFile *file,
|
||||
XcursorFileHeader *fileHeader,
|
||||
int toc,
|
||||
XcursorChunkHeader *chunkHeader)
|
||||
{
|
||||
if (!file || !fileHeader || !chunkHeader)
|
||||
return XcursorFalse;
|
||||
if (!_XcursorSeekToToc (file, fileHeader, toc))
|
||||
return XcursorFalse;
|
||||
if (!_XcursorReadUInt (file, &chunkHeader->header))
|
||||
return XcursorFalse;
|
||||
if (!_XcursorReadUInt (file, &chunkHeader->type))
|
||||
return XcursorFalse;
|
||||
if (!_XcursorReadUInt (file, &chunkHeader->subtype))
|
||||
return XcursorFalse;
|
||||
if (!_XcursorReadUInt (file, &chunkHeader->version))
|
||||
return XcursorFalse;
|
||||
/* sanity check */
|
||||
if (chunkHeader->type != fileHeader->tocs[toc].type ||
|
||||
chunkHeader->subtype != fileHeader->tocs[toc].subtype)
|
||||
return XcursorFalse;
|
||||
return XcursorTrue;
|
||||
}
|
||||
|
||||
#define dist(a,b) ((a) > (b) ? (a) - (b) : (b) - (a))
|
||||
|
||||
static XcursorDim
|
||||
_XcursorFindBestSize (XcursorFileHeader *fileHeader,
|
||||
XcursorDim size,
|
||||
int *nsizesp)
|
||||
{
|
||||
unsigned int n;
|
||||
int nsizes = 0;
|
||||
XcursorDim bestSize = 0;
|
||||
XcursorDim thisSize;
|
||||
|
||||
if (!fileHeader || !nsizesp)
|
||||
return 0;
|
||||
|
||||
for (n = 0; n < fileHeader->ntoc; n++)
|
||||
{
|
||||
if (fileHeader->tocs[n].type != XCURSOR_IMAGE_TYPE)
|
||||
continue;
|
||||
thisSize = fileHeader->tocs[n].subtype;
|
||||
if (!bestSize || dist (thisSize, size) < dist (bestSize, size))
|
||||
{
|
||||
bestSize = thisSize;
|
||||
nsizes = 1;
|
||||
}
|
||||
else if (thisSize == bestSize)
|
||||
nsizes++;
|
||||
}
|
||||
*nsizesp = nsizes;
|
||||
return bestSize;
|
||||
}
|
||||
|
||||
static int
|
||||
_XcursorFindImageToc (XcursorFileHeader *fileHeader,
|
||||
XcursorDim size,
|
||||
int count)
|
||||
{
|
||||
unsigned int toc;
|
||||
XcursorDim thisSize;
|
||||
|
||||
if (!fileHeader)
|
||||
return 0;
|
||||
|
||||
for (toc = 0; toc < fileHeader->ntoc; toc++)
|
||||
{
|
||||
if (fileHeader->tocs[toc].type != XCURSOR_IMAGE_TYPE)
|
||||
continue;
|
||||
thisSize = fileHeader->tocs[toc].subtype;
|
||||
if (thisSize != size)
|
||||
continue;
|
||||
if (!count)
|
||||
break;
|
||||
count--;
|
||||
}
|
||||
if (toc == fileHeader->ntoc)
|
||||
return -1;
|
||||
return toc;
|
||||
}
|
||||
|
||||
static XcursorImage *
|
||||
_XcursorReadImage (XcursorFile *file,
|
||||
XcursorFileHeader *fileHeader,
|
||||
int toc)
|
||||
{
|
||||
XcursorChunkHeader chunkHeader;
|
||||
XcursorImage head;
|
||||
XcursorImage *image;
|
||||
int n;
|
||||
XcursorPixel *p;
|
||||
|
||||
if (!file || !fileHeader)
|
||||
return NULL;
|
||||
|
||||
if (!_XcursorFileReadChunkHeader (file, fileHeader, toc, &chunkHeader))
|
||||
return NULL;
|
||||
if (!_XcursorReadUInt (file, &head.width))
|
||||
return NULL;
|
||||
if (!_XcursorReadUInt (file, &head.height))
|
||||
return NULL;
|
||||
if (!_XcursorReadUInt (file, &head.xhot))
|
||||
return NULL;
|
||||
if (!_XcursorReadUInt (file, &head.yhot))
|
||||
return NULL;
|
||||
if (!_XcursorReadUInt (file, &head.delay))
|
||||
return NULL;
|
||||
/* sanity check data */
|
||||
if (head.width > XCURSOR_IMAGE_MAX_SIZE ||
|
||||
head.height > XCURSOR_IMAGE_MAX_SIZE)
|
||||
return NULL;
|
||||
if (head.width == 0 || head.height == 0)
|
||||
return NULL;
|
||||
if (head.xhot > head.width || head.yhot > head.height)
|
||||
return NULL;
|
||||
|
||||
/* Create the image and initialize it */
|
||||
image = XcursorImageCreate (head.width, head.height);
|
||||
if (image == NULL)
|
||||
return NULL;
|
||||
if (chunkHeader.version < image->version)
|
||||
image->version = chunkHeader.version;
|
||||
image->size = chunkHeader.subtype;
|
||||
image->xhot = head.xhot;
|
||||
image->yhot = head.yhot;
|
||||
image->delay = head.delay;
|
||||
n = image->width * image->height;
|
||||
p = image->pixels;
|
||||
while (n--)
|
||||
{
|
||||
if (!_XcursorReadUInt (file, p))
|
||||
{
|
||||
XcursorImageDestroy (image);
|
||||
return NULL;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
return image;
|
||||
}
|
||||
|
||||
static XcursorImages *
|
||||
XcursorXcFileLoadImages (XcursorFile *file, int size)
|
||||
{
|
||||
XcursorFileHeader *fileHeader;
|
||||
XcursorDim bestSize;
|
||||
int nsize;
|
||||
XcursorImages *images;
|
||||
int n;
|
||||
int toc;
|
||||
|
||||
if (!file || size < 0)
|
||||
return NULL;
|
||||
fileHeader = _XcursorReadFileHeader (file);
|
||||
if (!fileHeader)
|
||||
return NULL;
|
||||
bestSize = _XcursorFindBestSize (fileHeader, (XcursorDim) size, &nsize);
|
||||
if (!bestSize)
|
||||
{
|
||||
_XcursorFileHeaderDestroy (fileHeader);
|
||||
return NULL;
|
||||
}
|
||||
images = XcursorImagesCreate (nsize);
|
||||
if (!images)
|
||||
{
|
||||
_XcursorFileHeaderDestroy (fileHeader);
|
||||
return NULL;
|
||||
}
|
||||
for (n = 0; n < nsize; n++)
|
||||
{
|
||||
toc = _XcursorFindImageToc (fileHeader, bestSize, n);
|
||||
if (toc < 0)
|
||||
break;
|
||||
images->images[images->nimage] = _XcursorReadImage (file, fileHeader,
|
||||
toc);
|
||||
if (!images->images[images->nimage])
|
||||
break;
|
||||
images->nimage++;
|
||||
}
|
||||
_XcursorFileHeaderDestroy (fileHeader);
|
||||
if (images->nimage != nsize)
|
||||
{
|
||||
XcursorImagesDestroy (images);
|
||||
images = NULL;
|
||||
}
|
||||
return images;
|
||||
}
|
||||
|
||||
static int
|
||||
_XcursorStdioFileRead (XcursorFile *file, unsigned char *buf, int len)
|
||||
{
|
||||
FILE *f = file->closure;
|
||||
return fread (buf, 1, len, f);
|
||||
}
|
||||
|
||||
static int
|
||||
_XcursorStdioFileWrite (XcursorFile *file, unsigned char *buf, int len)
|
||||
{
|
||||
FILE *f = file->closure;
|
||||
return fwrite (buf, 1, len, f);
|
||||
}
|
||||
|
||||
static int
|
||||
_XcursorStdioFileSeek (XcursorFile *file, long offset, int whence)
|
||||
{
|
||||
FILE *f = file->closure;
|
||||
return fseek (f, offset, whence);
|
||||
}
|
||||
|
||||
static void
|
||||
_XcursorStdioFileInitialize (FILE *stdfile, XcursorFile *file)
|
||||
{
|
||||
file->closure = stdfile;
|
||||
file->read = _XcursorStdioFileRead;
|
||||
file->write = _XcursorStdioFileWrite;
|
||||
file->seek = _XcursorStdioFileSeek;
|
||||
}
|
||||
|
||||
static XcursorImages *
|
||||
XcursorFileLoadImages (FILE *file, int size)
|
||||
{
|
||||
XcursorFile f;
|
||||
|
||||
if (!file)
|
||||
return NULL;
|
||||
|
||||
_XcursorStdioFileInitialize (file, &f);
|
||||
return XcursorXcFileLoadImages (&f, size);
|
||||
}
|
||||
|
||||
/*
|
||||
* From libXcursor/src/library.c
|
||||
*/
|
||||
|
||||
#ifndef ICONDIR
|
||||
#define ICONDIR "/usr/X11R6/lib/X11/icons"
|
||||
#endif
|
||||
|
||||
#ifndef XCURSORPATH
|
||||
#define XCURSORPATH "~/.icons:/usr/share/icons:/usr/share/pixmaps:~/.cursors:/usr/share/cursors/xorg-x11:"ICONDIR
|
||||
#endif
|
||||
|
||||
static const char *
|
||||
XcursorLibraryPath (void)
|
||||
{
|
||||
static const char *path;
|
||||
|
||||
if (!path)
|
||||
{
|
||||
path = getenv ("XCURSOR_PATH");
|
||||
if (!path)
|
||||
path = XCURSORPATH;
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
static void
|
||||
_XcursorAddPathElt (char *path, const char *elt, int len)
|
||||
{
|
||||
int pathlen = strlen (path);
|
||||
|
||||
/* append / if the path doesn't currently have one */
|
||||
if (path[0] == '\0' || path[pathlen - 1] != '/')
|
||||
{
|
||||
strcat (path, "/");
|
||||
pathlen++;
|
||||
}
|
||||
if (len == -1)
|
||||
len = strlen (elt);
|
||||
/* strip leading slashes */
|
||||
while (len && elt[0] == '/')
|
||||
{
|
||||
elt++;
|
||||
len--;
|
||||
}
|
||||
strncpy (path + pathlen, elt, len);
|
||||
path[pathlen + len] = '\0';
|
||||
}
|
||||
|
||||
static char *
|
||||
_XcursorBuildThemeDir (const char *dir, const char *theme)
|
||||
{
|
||||
const char *colon;
|
||||
const char *tcolon;
|
||||
char *full;
|
||||
char *home;
|
||||
int dirlen;
|
||||
int homelen;
|
||||
int themelen;
|
||||
int len;
|
||||
|
||||
if (!dir || !theme)
|
||||
return NULL;
|
||||
|
||||
colon = strchr (dir, ':');
|
||||
if (!colon)
|
||||
colon = dir + strlen (dir);
|
||||
|
||||
dirlen = colon - dir;
|
||||
|
||||
tcolon = strchr (theme, ':');
|
||||
if (!tcolon)
|
||||
tcolon = theme + strlen (theme);
|
||||
|
||||
themelen = tcolon - theme;
|
||||
|
||||
home = NULL;
|
||||
homelen = 0;
|
||||
if (*dir == '~')
|
||||
{
|
||||
home = getenv ("HOME");
|
||||
if (!home)
|
||||
return NULL;
|
||||
homelen = strlen (home);
|
||||
dir++;
|
||||
dirlen--;
|
||||
}
|
||||
|
||||
/*
|
||||
* add space for any needed directory separators, one per component,
|
||||
* and one for the trailing null
|
||||
*/
|
||||
len = 1 + homelen + 1 + dirlen + 1 + themelen + 1;
|
||||
|
||||
full = malloc (len);
|
||||
if (!full)
|
||||
return NULL;
|
||||
full[0] = '\0';
|
||||
|
||||
if (home)
|
||||
_XcursorAddPathElt (full, home, -1);
|
||||
_XcursorAddPathElt (full, dir, dirlen);
|
||||
_XcursorAddPathElt (full, theme, themelen);
|
||||
return full;
|
||||
}
|
||||
|
||||
static char *
|
||||
_XcursorBuildFullname (const char *dir, const char *subdir, const char *file)
|
||||
{
|
||||
char *full;
|
||||
|
||||
if (!dir || !subdir || !file)
|
||||
return NULL;
|
||||
|
||||
full = malloc (strlen (dir) + 1 + strlen (subdir) + 1 + strlen (file) + 1);
|
||||
if (!full)
|
||||
return NULL;
|
||||
full[0] = '\0';
|
||||
_XcursorAddPathElt (full, dir, -1);
|
||||
_XcursorAddPathElt (full, subdir, -1);
|
||||
_XcursorAddPathElt (full, file, -1);
|
||||
return full;
|
||||
}
|
||||
|
||||
static const char *
|
||||
_XcursorNextPath (const char *path)
|
||||
{
|
||||
char *colon = strchr (path, ':');
|
||||
|
||||
if (!colon)
|
||||
return NULL;
|
||||
return colon + 1;
|
||||
}
|
||||
|
||||
#define XcursorWhite(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
|
||||
#define XcursorSep(c) ((c) == ';' || (c) == ',')
|
||||
|
||||
static char *
|
||||
_XcursorThemeInherits (const char *full)
|
||||
{
|
||||
char line[8192];
|
||||
char *result = NULL;
|
||||
FILE *f;
|
||||
|
||||
if (!full)
|
||||
return NULL;
|
||||
|
||||
f = fopen (full, "r");
|
||||
if (f)
|
||||
{
|
||||
while (fgets (line, sizeof (line), f))
|
||||
{
|
||||
if (!strncmp (line, "Inherits", 8))
|
||||
{
|
||||
char *l = line + 8;
|
||||
char *r;
|
||||
while (*l == ' ') l++;
|
||||
if (*l != '=') continue;
|
||||
l++;
|
||||
while (*l == ' ') l++;
|
||||
result = malloc (strlen (l) + 1);
|
||||
if (result)
|
||||
{
|
||||
r = result;
|
||||
while (*l)
|
||||
{
|
||||
while (XcursorSep(*l) || XcursorWhite (*l)) l++;
|
||||
if (!*l)
|
||||
break;
|
||||
if (r != result)
|
||||
*r++ = ':';
|
||||
while (*l && !XcursorWhite(*l) &&
|
||||
!XcursorSep(*l))
|
||||
*r++ = *l++;
|
||||
}
|
||||
*r++ = '\0';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose (f);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static FILE *
|
||||
XcursorScanTheme (const char *theme, const char *name)
|
||||
{
|
||||
FILE *f = NULL;
|
||||
char *full;
|
||||
char *dir;
|
||||
const char *path;
|
||||
char *inherits = NULL;
|
||||
const char *i;
|
||||
|
||||
if (!theme || !name)
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* Scan this theme
|
||||
*/
|
||||
for (path = XcursorLibraryPath ();
|
||||
path && f == NULL;
|
||||
path = _XcursorNextPath (path))
|
||||
{
|
||||
dir = _XcursorBuildThemeDir (path, theme);
|
||||
if (dir)
|
||||
{
|
||||
full = _XcursorBuildFullname (dir, "cursors", name);
|
||||
if (full)
|
||||
{
|
||||
f = fopen (full, "r");
|
||||
free (full);
|
||||
}
|
||||
if (!f && !inherits)
|
||||
{
|
||||
full = _XcursorBuildFullname (dir, "", "index.theme");
|
||||
if (full)
|
||||
{
|
||||
inherits = _XcursorThemeInherits (full);
|
||||
free (full);
|
||||
}
|
||||
}
|
||||
free (dir);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Recurse to scan inherited themes
|
||||
*/
|
||||
for (i = inherits; i && f == NULL; i = _XcursorNextPath (i))
|
||||
f = XcursorScanTheme (i, name);
|
||||
if (inherits != NULL)
|
||||
free (inherits);
|
||||
return f;
|
||||
}
|
||||
|
||||
XcursorImages *
|
||||
XcursorLibraryLoadImages (const char *file, const char *theme, int size)
|
||||
{
|
||||
FILE *f = NULL;
|
||||
XcursorImages *images = NULL;
|
||||
|
||||
if (!file)
|
||||
return NULL;
|
||||
|
||||
if (theme)
|
||||
f = XcursorScanTheme (theme, file);
|
||||
if (!f)
|
||||
f = XcursorScanTheme ("default", file);
|
||||
if (f)
|
||||
{
|
||||
images = XcursorFileLoadImages (f, size);
|
||||
if (images)
|
||||
XcursorImagesSetName (images, file);
|
||||
fclose (f);
|
||||
}
|
||||
return images;
|
||||
}
|
||||
|
||||
static void
|
||||
load_all_cursors_from_dir(const char *path, int size,
|
||||
void (*load_callback)(XcursorImages *, void *),
|
||||
void *user_data)
|
||||
{
|
||||
FILE *f;
|
||||
DIR *dir = opendir(path);
|
||||
struct dirent *ent;
|
||||
char *full;
|
||||
XcursorImages *images;
|
||||
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
for(ent = readdir(dir); ent; ent = readdir(dir)) {
|
||||
#ifdef _DIRENT_HAVE_D_TYPE
|
||||
if (ent->d_type != DT_UNKNOWN &&
|
||||
(ent->d_type != DT_REG && ent->d_type != DT_LNK))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
full = _XcursorBuildFullname(path, "", ent->d_name);
|
||||
if (!full)
|
||||
continue;
|
||||
|
||||
f = fopen(full, "r");
|
||||
if (!f) {
|
||||
free(full);
|
||||
continue;
|
||||
}
|
||||
|
||||
images = XcursorFileLoadImages(f, size);
|
||||
|
||||
if (images) {
|
||||
XcursorImagesSetName(images, ent->d_name);
|
||||
load_callback(images, user_data);
|
||||
}
|
||||
|
||||
fclose (f);
|
||||
free(full);
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
}
|
||||
|
||||
/** Load all the cursor of a theme
|
||||
*
|
||||
* This function loads all the cursor images of a given theme and its
|
||||
* inherited themes. Each cursor is loaded into an XcursorImages object
|
||||
* which is passed to the caller's load callback. If a cursor appears
|
||||
* more than once across all the inherited themes, the load callback
|
||||
* will be called multiple times, with possibly different XcursorImages
|
||||
* object which have the same name. The user is expected to destroy the
|
||||
* XcursorImages objects passed to the callback with
|
||||
* XcursorImagesDestroy().
|
||||
*
|
||||
* \param theme The name of theme that should be loaded
|
||||
* \param size The desired size of the cursor images
|
||||
* \param load_callback A callback function that will be called
|
||||
* for each cursor loaded. The first parameter is the XcursorImages
|
||||
* object representing the loaded cursor and the second is a pointer
|
||||
* to data provided by the user.
|
||||
* \param user_data The data that should be passed to the load callback
|
||||
*/
|
||||
void
|
||||
xcursor_load_theme(const char *theme, int size,
|
||||
void (*load_callback)(XcursorImages *, void *),
|
||||
void *user_data)
|
||||
{
|
||||
char *full, *dir;
|
||||
char *inherits = NULL;
|
||||
const char *path, *i;
|
||||
|
||||
if (!theme)
|
||||
theme = "default";
|
||||
|
||||
for (path = XcursorLibraryPath();
|
||||
path;
|
||||
path = _XcursorNextPath(path)) {
|
||||
dir = _XcursorBuildThemeDir(path, theme);
|
||||
if (!dir)
|
||||
continue;
|
||||
|
||||
full = _XcursorBuildFullname(dir, "cursors", "");
|
||||
|
||||
if (full) {
|
||||
load_all_cursors_from_dir(full, size, load_callback,
|
||||
user_data);
|
||||
free(full);
|
||||
}
|
||||
|
||||
if (!inherits) {
|
||||
full = _XcursorBuildFullname(dir, "", "index.theme");
|
||||
if (full) {
|
||||
inherits = _XcursorThemeInherits(full);
|
||||
free(full);
|
||||
}
|
||||
}
|
||||
|
||||
free(dir);
|
||||
}
|
||||
|
||||
for (i = inherits; i; i = _XcursorNextPath(i))
|
||||
xcursor_load_theme(i, size, load_callback, user_data);
|
||||
|
||||
if (inherits)
|
||||
free(inherits);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright © 2002 Keith Packard
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef XCURSOR_H
|
||||
#define XCURSOR_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int XcursorBool;
|
||||
typedef uint32_t XcursorUInt;
|
||||
|
||||
typedef XcursorUInt XcursorDim;
|
||||
typedef XcursorUInt XcursorPixel;
|
||||
|
||||
typedef struct _XcursorImage {
|
||||
XcursorUInt version; /* version of the image data */
|
||||
XcursorDim size; /* nominal size for matching */
|
||||
XcursorDim width; /* actual width */
|
||||
XcursorDim height; /* actual height */
|
||||
XcursorDim xhot; /* hot spot x (must be inside image) */
|
||||
XcursorDim yhot; /* hot spot y (must be inside image) */
|
||||
XcursorUInt delay; /* animation delay to next frame (ms) */
|
||||
XcursorPixel *pixels; /* pointer to pixels */
|
||||
} XcursorImage;
|
||||
|
||||
/*
|
||||
* Other data structures exposed by the library API
|
||||
*/
|
||||
typedef struct _XcursorImages {
|
||||
int nimage; /* number of images */
|
||||
XcursorImage **images; /* array of XcursorImage pointers */
|
||||
char *name; /* name used to load images */
|
||||
} XcursorImages;
|
||||
|
||||
XcursorImages *
|
||||
XcursorLibraryLoadImages (const char *file, const char *theme, int size);
|
||||
|
||||
void
|
||||
XcursorImagesDestroy (XcursorImages *images);
|
||||
|
||||
void
|
||||
xcursor_load_theme(const char *theme, int size,
|
||||
void (*load_callback)(XcursorImages *, void *),
|
||||
void *user_data);
|
||||
#endif
|
||||
@@ -0,0 +1,791 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1999-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try '$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by 'PROGRAMS ARGS'.
|
||||
object Object file output by 'PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputting dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get the directory component of the given path, and save it in the
|
||||
# global variables '$dir'. Note that this directory component will
|
||||
# be either empty or ending with a '/' character. This is deliberate.
|
||||
set_dir_from ()
|
||||
{
|
||||
case $1 in
|
||||
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
|
||||
*) dir=;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Get the suffix-stripped basename of the given path, and save it the
|
||||
# global variable '$base'.
|
||||
set_base_from ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
|
||||
}
|
||||
|
||||
# If no dependency file was actually created by the compiler invocation,
|
||||
# we still have to create a dummy depfile, to avoid errors with the
|
||||
# Makefile "include basename.Plo" scheme.
|
||||
make_dummy_depfile ()
|
||||
{
|
||||
echo "#dummy" > "$depfile"
|
||||
}
|
||||
|
||||
# Factor out some common post-processing of the generated depfile.
|
||||
# Requires the auxiliary global variable '$tmpdepfile' to be set.
|
||||
aix_post_process_depfile ()
|
||||
{
|
||||
# If the compiler actually managed to produce a dependency file,
|
||||
# post-process it.
|
||||
if test -f "$tmpdepfile"; then
|
||||
# Each line is of the form 'foo.o: dependency.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# $object: dependency.h
|
||||
# and one to simply output
|
||||
# dependency.h:
|
||||
# which is needed to avoid the deleted-header problem.
|
||||
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
|
||||
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
|
||||
} > "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
}
|
||||
|
||||
# A tabulation character.
|
||||
tab=' '
|
||||
# A newline character.
|
||||
nl='
|
||||
'
|
||||
# Character ranges might be problematic outside the C locale.
|
||||
# These definitions help.
|
||||
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
lower=abcdefghijklmnopqrstuvwxyz
|
||||
digits=0123456789
|
||||
alpha=${upper}${lower}
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Avoid interferences from the environment.
|
||||
gccflag= dashmflag=
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
cygpath_u="cygpath -u -f -"
|
||||
if test "$depmode" = msvcmsys; then
|
||||
# This is just like msvisualcpp but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvisualcpp
|
||||
fi
|
||||
|
||||
if test "$depmode" = msvc7msys; then
|
||||
# This is just like msvc7 but w/o cygpath translation.
|
||||
# Just convert the backslash-escaped backslashes to single forward
|
||||
# slashes to satisfy depend.m4
|
||||
cygpath_u='sed s,\\\\,/,g'
|
||||
depmode=msvc7
|
||||
fi
|
||||
|
||||
if test "$depmode" = xlc; then
|
||||
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
|
||||
gccflag=-qmakedep=gcc,-MF
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
|
||||
## the command line argument order; so add the flags where they
|
||||
## appear in depend2.am. Note that the slowdown incurred here
|
||||
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
|
||||
*) set fnord "$@" "$arg" ;;
|
||||
esac
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
done
|
||||
"$@"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
|
||||
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
|
||||
## (see the conditional assignment to $gccflag above).
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say). Also, it might not be
|
||||
## supported by the other compilers which use the 'gcc' depmode.
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The second -e expression handles DOS-style file names with drive
|
||||
# letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the "deleted header file" problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
## Some versions of gcc put a space before the ':'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well. hp depmode also adds that space, but also prefixes the VPATH
|
||||
## to the object. Take care to not repeat it in the output.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like '#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
|
||||
| tr "$nl" ' ' >> "$depfile"
|
||||
echo >> "$depfile"
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
xlc)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts '$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$base.u
|
||||
tmpdepfile3=$dir.libs/$base.u
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
tmpdepfile1=$dir$base.u
|
||||
tmpdepfile2=$dir$base.u
|
||||
tmpdepfile3=$dir$base.u
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
tcc)
|
||||
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
|
||||
# FIXME: That version still under development at the moment of writing.
|
||||
# Make that this statement remains true also for stable, released
|
||||
# versions.
|
||||
# It will wrap lines (doesn't matter whether long or short) with a
|
||||
# trailing '\', as in:
|
||||
#
|
||||
# foo.o : \
|
||||
# foo.c \
|
||||
# foo.h \
|
||||
#
|
||||
# It will put a trailing '\' even on the last line, and will use leading
|
||||
# spaces rather than leading tabs (at least since its commit 0394caf7
|
||||
# "Emit spaces for -MD").
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
|
||||
# We have to change lines of the first kind to '$object: \'.
|
||||
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
|
||||
# And for each line of the second kind, we have to emit a 'dep.h:'
|
||||
# dummy dependency, to avoid the deleted-header problem.
|
||||
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
## The order of this option in the case statement is important, since the
|
||||
## shell code in configure will try each of these formats in the order
|
||||
## listed in this file. A plain '-MD' option would be understood by many
|
||||
## compilers, so we must ensure this comes after the gcc and icc options.
|
||||
pgcc)
|
||||
# Portland's C compiler understands '-MD'.
|
||||
# Will always output deps to 'file.d' where file is the root name of the
|
||||
# source file under compilation, even if file resides in a subdirectory.
|
||||
# The object file name does not affect the name of the '.d' file.
|
||||
# pgcc 10.2 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using '\' :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
set_dir_from "$object"
|
||||
# Use the source, not the object, to determine the base name, since
|
||||
# that's sadly what pgcc will do too.
|
||||
set_base_from "$source"
|
||||
tmpdepfile=$base.d
|
||||
|
||||
# For projects that build the same source file twice into different object
|
||||
# files, the pgcc approach of using the *source* file root name can cause
|
||||
# problems in parallel builds. Use a locking strategy to avoid stomping on
|
||||
# the same $tmpdepfile.
|
||||
lockdir=$base.d-lock
|
||||
trap "
|
||||
echo '$0: caught signal, cleaning up...' >&2
|
||||
rmdir '$lockdir'
|
||||
exit 1
|
||||
" 1 2 13 15
|
||||
numtries=100
|
||||
i=$numtries
|
||||
while test $i -gt 0; do
|
||||
# mkdir is a portable test-and-set.
|
||||
if mkdir "$lockdir" 2>/dev/null; then
|
||||
# This process acquired the lock.
|
||||
"$@" -MD
|
||||
stat=$?
|
||||
# Release the lock.
|
||||
rmdir "$lockdir"
|
||||
break
|
||||
else
|
||||
# If the lock is being held by a different process, wait
|
||||
# until the winning process is done or we timeout.
|
||||
while test -d "$lockdir" && test $i -gt 0; do
|
||||
sleep 1
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
fi
|
||||
i=`expr $i - 1`
|
||||
done
|
||||
trap - 1 2 13 15
|
||||
if test $i -le 0; then
|
||||
echo "$0: failed to acquire lock after $numtries attempts" >&2
|
||||
echo "$0: check lockdir '$lockdir'" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp2)
|
||||
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
|
||||
# compilers, which have integrated preprocessors. The correct option
|
||||
# to use with these is +Maked; it writes dependencies to a file named
|
||||
# 'foo.d', which lands next to the object file, wherever that
|
||||
# happens to be.
|
||||
# Much of this is similar to the tru64 case; see comments there.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
if test "$libtool" = yes; then
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir.libs/$base.d
|
||||
"$@" -Wc,+Maked
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
"$@" +Maked
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
|
||||
# Add 'dependent.h:' lines.
|
||||
sed -ne '2,${
|
||||
s/^ *//
|
||||
s/ \\*$//
|
||||
s/$/:/
|
||||
p
|
||||
}' "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
make_dummy_depfile
|
||||
fi
|
||||
rm -f "$tmpdepfile" "$tmpdepfile2"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in 'foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
set_dir_from "$object"
|
||||
set_base_from "$object"
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# Libtool generates 2 separate objects for the 2 libraries. These
|
||||
# two compilations output dependencies in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
|
||||
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
# Same post-processing that is required for AIX mode.
|
||||
aix_post_process_depfile
|
||||
;;
|
||||
|
||||
msvc7)
|
||||
if test "$libtool" = yes; then
|
||||
showIncludes=-Wc,-showIncludes
|
||||
else
|
||||
showIncludes=-showIncludes
|
||||
fi
|
||||
"$@" $showIncludes > "$tmpdepfile"
|
||||
stat=$?
|
||||
grep -v '^Note: including file: ' "$tmpdepfile"
|
||||
if test $stat -ne 0; then
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
# The first sed program below extracts the file names and escapes
|
||||
# backslashes for cygpath. The second sed program outputs the file
|
||||
# name when reading, but also accumulates all include files in the
|
||||
# hold buffer in order to output them again at the end. This only
|
||||
# works with sed implementations that can handle large buffers.
|
||||
sed < "$tmpdepfile" -n '
|
||||
/^Note: including file: *\(.*\)/ {
|
||||
s//\1/
|
||||
s/\\/\\\\/g
|
||||
p
|
||||
}' | $cygpath_u | sort -u | sed -n '
|
||||
s/ /\\ /g
|
||||
s/\(.*\)/'"$tab"'\1 \\/p
|
||||
s/.\(.*\) \\/\1:/
|
||||
H
|
||||
$ {
|
||||
s/.*/'"$tab"'/
|
||||
G
|
||||
p
|
||||
}' >> "$depfile"
|
||||
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvc7msys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for ':'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this sed invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
tr ' ' "$nl" < "$tmpdepfile" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no eat=no
|
||||
for arg
|
||||
do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
if test $eat = yes; then
|
||||
eat=no
|
||||
continue
|
||||
fi
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-arch)
|
||||
eat=yes ;;
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix=`echo "$object" | sed 's/^.*\././'`
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
# makedepend may prepend the VPATH from the source file name to the object.
|
||||
# No need to regex-escape $object, excess matching of '.' is harmless.
|
||||
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process the last invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed '1,2d' "$tmpdepfile" \
|
||||
| tr ' ' "$nl" \
|
||||
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
|
||||
| sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove '-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E \
|
||||
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
| sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test "X$1" != 'X--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E 2>/dev/null |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
|
||||
echo "$tab" >> "$depfile"
|
||||
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvcmsys)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -0,0 +1 @@
|
||||
SUBDIRS = doxygen publican
|
||||
+648
@@ -0,0 +1,648 @@
|
||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = doc
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/weston.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
||||
install-data-recursive install-dvi-recursive \
|
||||
install-exec-recursive install-html-recursive \
|
||||
install-info-recursive install-pdf-recursive \
|
||||
install-ps-recursive install-recursive installcheck-recursive \
|
||||
installdirs-recursive pdf-recursive ps-recursive \
|
||||
tags-recursive uninstall-recursive
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
am__recursive_targets = \
|
||||
$(RECURSIVE_TARGETS) \
|
||||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
distdir distdir-am
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
# *not* preserved.
|
||||
am__uniquify_input = $(AWK) '\
|
||||
BEGIN { nonempty = 0; } \
|
||||
{ items[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in items) print i; }; } \
|
||||
'
|
||||
# Make sure the list of sources is unique. This is necessary because,
|
||||
# e.g., the same source file might be shared among _SOURCES variables
|
||||
# for different programs/libraries.
|
||||
am__define_uniq_tagged_files = \
|
||||
list='$(am__tagged_files)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DL_LIBS = @DL_LIBS@
|
||||
DOCS_STYLESHEET = @DOCS_STYLESHEET@
|
||||
DOT = @DOT@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXPAT_CFLAGS = @EXPAT_CFLAGS@
|
||||
EXPAT_LIBS = @EXPAT_LIBS@
|
||||
FFI_CFLAGS = @FFI_CFLAGS@
|
||||
FFI_LIBS = @FFI_LIBS@
|
||||
FGREP = @FGREP@
|
||||
GCC_CFLAGS = @GCC_CFLAGS@
|
||||
GREP = @GREP@
|
||||
ICONDIR = @ICONDIR@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBXML_CFLAGS = @LIBXML_CFLAGS@
|
||||
LIBXML_LIBS = @LIBXML_LIBS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RT_LIBS = @RT_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
WAYLAND_VERSION = @WAYLAND_VERSION@
|
||||
WAYLAND_VERSION_MAJOR = @WAYLAND_VERSION_MAJOR@
|
||||
WAYLAND_VERSION_MICRO = @WAYLAND_VERSION_MICRO@
|
||||
WAYLAND_VERSION_MINOR = @WAYLAND_VERSION_MINOR@
|
||||
XMLTO = @XMLTO@
|
||||
XSLTPROC = @XSLTPROC@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
SUBDIRS = doxygen publican
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign doc/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run 'make' without going through this Makefile.
|
||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
||||
$(am__recursive_targets):
|
||||
@fail=; \
|
||||
if $(am__make_keepgoing); then \
|
||||
failcom='fail=yes'; \
|
||||
else \
|
||||
failcom='exit 1'; \
|
||||
fi; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
ID: $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
||||
tags: tags-recursive
|
||||
TAGS: tags
|
||||
|
||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
$(am__define_uniq_tagged_files); \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: ctags-recursive
|
||||
|
||||
CTAGS: ctags
|
||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
||||
$(am__define_uniq_tagged_files); \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
cscopelist: cscopelist-recursive
|
||||
|
||||
cscopelist-am: $(am__tagged_files)
|
||||
list='$(am__tagged_files)'; \
|
||||
case "$(srcdir)" in \
|
||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
||||
esac; \
|
||||
for i in $$list; do \
|
||||
if test -f "$$i"; then \
|
||||
echo "$(subdir)/$$i"; \
|
||||
else \
|
||||
echo "$$sdir/$$i"; \
|
||||
fi; \
|
||||
done >> $(top_builddir)/cscope.files
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
$(am__make_dryrun) \
|
||||
|| test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(am__recursive_targets) install-am install-strip
|
||||
|
||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
|
||||
check-am clean clean-generic clean-libtool cscopelist-am ctags \
|
||||
ctags-am distclean distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags tags-am uninstall uninstall-am
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
doxygen_sqlite3.db
|
||||
html/
|
||||
wayland.doxygen
|
||||
@@ -0,0 +1,113 @@
|
||||
|
||||
.SUFFIXES = .gv .png .map
|
||||
|
||||
noinst_DATA = \
|
||||
xml/Client/index.xml \
|
||||
xml/Cursor/index.xml \
|
||||
xml/Server/index.xml \
|
||||
html/Client/index.html \
|
||||
html/Cursor/index.html \
|
||||
html/Server/index.html
|
||||
dist_noinst_DATA = wayland.doxygen.in
|
||||
|
||||
scanned_src_files_shared = \
|
||||
$(top_srcdir)/src/wayland-util.h
|
||||
|
||||
scanned_src_files_Client = \
|
||||
$(scanned_src_files_shared) \
|
||||
$(top_srcdir)/src/wayland-client.c \
|
||||
$(top_srcdir)/src/wayland-client.h \
|
||||
$(top_srcdir)/src/wayland-client-core.h
|
||||
|
||||
scanned_src_files_Cursor = \
|
||||
$(top_srcdir)/cursor/wayland-cursor.c \
|
||||
$(top_srcdir)/cursor/wayland-cursor.h
|
||||
|
||||
scanned_src_files_Server = \
|
||||
$(scanned_src_files_shared) \
|
||||
$(top_srcdir)/src/event-loop.c \
|
||||
$(top_srcdir)/src/wayland-server.c \
|
||||
$(top_srcdir)/src/wayland-server.h \
|
||||
$(top_srcdir)/src/wayland-server-core.h \
|
||||
$(top_srcdir)/src/wayland-shm.c
|
||||
|
||||
scanned_src_files_man = \
|
||||
$(scanned_src_files_Server) \
|
||||
$(top_srcdir)/src/wayland-client.c \
|
||||
$(top_srcdir)/src/wayland-client.h \
|
||||
$(top_srcdir)/src/wayland-client-core.h
|
||||
|
||||
extra_doxygen = \
|
||||
mainpage.dox
|
||||
|
||||
extra_doxygen_Server = \
|
||||
$(top_builddir)/protocol/wayland-server-protocol.h \
|
||||
$(extra_doxygen)
|
||||
|
||||
extra_doxygen_Client = \
|
||||
$(top_builddir)/protocol/wayland-client-protocol.h \
|
||||
$(extra_doxygen)
|
||||
|
||||
extra_doxygen_Cursor = \
|
||||
$(extra_doxygen)
|
||||
|
||||
diagramsdir := $(srcdir)/dot
|
||||
diagramssrc := $(wildcard $(diagramsdir)/*.gv)
|
||||
diagrams := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.png))
|
||||
diagram_maps := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.map))
|
||||
|
||||
# find all man/man3/wl_foo.3 pages
|
||||
# for this to work, we need to create them before the man target (hence
|
||||
# all-local below)
|
||||
dist_man3_MANS = $(shell test -d man && find man/man3 -name "wl_*.3" -printf "man/man3/%P\n")
|
||||
|
||||
# Listing various directories that might need to be created.
|
||||
alldirsrel := xml xml/Client xml/Server xml/Cursor man/man3 html/Client html/Server html/Cursor
|
||||
alldirs := $(patsubst %,$(CURDIR)/%,$(alldirsrel))
|
||||
|
||||
$(diagrams): $(diagramssrc)
|
||||
|
||||
$(diagram_maps): $(diagramssrc)
|
||||
|
||||
xml/%/index.xml: $(top_srcdir)/src/scanner.c $(scanned_src_files_%) wayland.doxygen $(diagrams) $(diagram_maps) | $(CURDIR)/xml/%
|
||||
$(AM_V_GEN)(cat wayland.doxygen; \
|
||||
echo "GENERATE_XML=YES"; \
|
||||
echo "XML_OUTPUT=xml/$*"; \
|
||||
echo "INPUT= $(scanned_src_files_$*)"; \
|
||||
) | $(DOXYGEN) -
|
||||
|
||||
html/%/index.html: $(scanned_src_files_%) wayland.doxygen $(diagrams) $(diagram_maps) | $(CURDIR)/html/%
|
||||
$(AM_V_GEN)(cat wayland.doxygen; \
|
||||
echo "PROJECT_NAME=\"Wayland $* API\""; \
|
||||
echo "GENERATE_HTML=YES"; \
|
||||
echo "HTML_OUTPUT=html/$*"; \
|
||||
echo "INPUT= $(scanned_src_files_$*) $(extra_doxygen_$*)"; \
|
||||
) | $(DOXYGEN) -
|
||||
|
||||
man/man3/wl_display.3: $(top_srcdir)/src/scanner.c $(scanned_src_files_man) wayland.doxygen | $(CURDIR)/man/man3
|
||||
$(AM_V_GEN)(cat wayland.doxygen; \
|
||||
echo "GENERATE_MAN=YES"; \
|
||||
echo "MAN_OUTPUT=man"; \
|
||||
echo "JAVADOC_AUTOBRIEF=NO"; \
|
||||
echo "INPUT= $(scanned_src_files_man)"; \
|
||||
) | $(DOXYGEN) -
|
||||
|
||||
xml/%.png: $(diagramsdir)/%.gv | $(CURDIR)/xml
|
||||
$(AM_V_GEN)$(DOT) -Tpng -o$@ $<
|
||||
|
||||
xml/%.map: $(diagramsdir)/%.gv | $(CURDIR)/xml
|
||||
$(AM_V_GEN)$(DOT) -Tcmapx_np -o$@ $<
|
||||
|
||||
# general rule to create one of the listed directories.
|
||||
$(alldirs):
|
||||
$(AM_V_GEN)$(MKDIR_P) $@
|
||||
|
||||
# there is no man-local
|
||||
all-local: man/man3/wl_display.3
|
||||
|
||||
clean-local:
|
||||
rm -rf xml/
|
||||
rm -rf html/
|
||||
rm -rf man/
|
||||
|
||||
EXTRA_DIST = $(diagramssrc)
|
||||
@@ -0,0 +1,661 @@
|
||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = doc/doxygen
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/weston.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(dist_noinst_DATA) \
|
||||
$(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES = wayland.doxygen
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__uninstall_files_from_dir = { \
|
||||
test -z "$$files" \
|
||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
||||
}
|
||||
man3dir = $(mandir)/man3
|
||||
am__installdirs = "$(DESTDIR)$(man3dir)"
|
||||
NROFF = nroff
|
||||
MANS = $(dist_man3_MANS)
|
||||
DATA = $(dist_noinst_DATA) $(noinst_DATA)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(dist_man3_MANS) $(srcdir)/Makefile.in \
|
||||
$(srcdir)/wayland.doxygen.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DL_LIBS = @DL_LIBS@
|
||||
DOCS_STYLESHEET = @DOCS_STYLESHEET@
|
||||
DOT = @DOT@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXPAT_CFLAGS = @EXPAT_CFLAGS@
|
||||
EXPAT_LIBS = @EXPAT_LIBS@
|
||||
FFI_CFLAGS = @FFI_CFLAGS@
|
||||
FFI_LIBS = @FFI_LIBS@
|
||||
FGREP = @FGREP@
|
||||
GCC_CFLAGS = @GCC_CFLAGS@
|
||||
GREP = @GREP@
|
||||
ICONDIR = @ICONDIR@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBXML_CFLAGS = @LIBXML_CFLAGS@
|
||||
LIBXML_LIBS = @LIBXML_LIBS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RT_LIBS = @RT_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
WAYLAND_VERSION = @WAYLAND_VERSION@
|
||||
WAYLAND_VERSION_MAJOR = @WAYLAND_VERSION_MAJOR@
|
||||
WAYLAND_VERSION_MICRO = @WAYLAND_VERSION_MICRO@
|
||||
WAYLAND_VERSION_MINOR = @WAYLAND_VERSION_MINOR@
|
||||
XMLTO = @XMLTO@
|
||||
XSLTPROC = @XSLTPROC@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
.SUFFIXES = .gv .png .map
|
||||
noinst_DATA = \
|
||||
xml/Client/index.xml \
|
||||
xml/Cursor/index.xml \
|
||||
xml/Server/index.xml \
|
||||
html/Client/index.html \
|
||||
html/Cursor/index.html \
|
||||
html/Server/index.html
|
||||
|
||||
dist_noinst_DATA = wayland.doxygen.in
|
||||
scanned_src_files_shared = \
|
||||
$(top_srcdir)/src/wayland-util.h
|
||||
|
||||
scanned_src_files_Client = \
|
||||
$(scanned_src_files_shared) \
|
||||
$(top_srcdir)/src/wayland-client.c \
|
||||
$(top_srcdir)/src/wayland-client.h \
|
||||
$(top_srcdir)/src/wayland-client-core.h
|
||||
|
||||
scanned_src_files_Cursor = \
|
||||
$(top_srcdir)/cursor/wayland-cursor.c \
|
||||
$(top_srcdir)/cursor/wayland-cursor.h
|
||||
|
||||
scanned_src_files_Server = \
|
||||
$(scanned_src_files_shared) \
|
||||
$(top_srcdir)/src/event-loop.c \
|
||||
$(top_srcdir)/src/wayland-server.c \
|
||||
$(top_srcdir)/src/wayland-server.h \
|
||||
$(top_srcdir)/src/wayland-server-core.h \
|
||||
$(top_srcdir)/src/wayland-shm.c
|
||||
|
||||
scanned_src_files_man = \
|
||||
$(scanned_src_files_Server) \
|
||||
$(top_srcdir)/src/wayland-client.c \
|
||||
$(top_srcdir)/src/wayland-client.h \
|
||||
$(top_srcdir)/src/wayland-client-core.h
|
||||
|
||||
extra_doxygen = \
|
||||
mainpage.dox
|
||||
|
||||
extra_doxygen_Server = \
|
||||
$(top_builddir)/protocol/wayland-server-protocol.h \
|
||||
$(extra_doxygen)
|
||||
|
||||
extra_doxygen_Client = \
|
||||
$(top_builddir)/protocol/wayland-client-protocol.h \
|
||||
$(extra_doxygen)
|
||||
|
||||
extra_doxygen_Cursor = \
|
||||
$(extra_doxygen)
|
||||
|
||||
diagramsdir := $(srcdir)/dot
|
||||
diagramssrc := $(wildcard $(diagramsdir)/*.gv)
|
||||
diagrams := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.png))
|
||||
diagram_maps := $(patsubst $(diagramsdir)/%,xml/%,$(diagramssrc:.gv=.map))
|
||||
|
||||
# find all man/man3/wl_foo.3 pages
|
||||
# for this to work, we need to create them before the man target (hence
|
||||
# all-local below)
|
||||
dist_man3_MANS = $(shell test -d man && find man/man3 -name "wl_*.3" -printf "man/man3/%P\n")
|
||||
|
||||
# Listing various directories that might need to be created.
|
||||
alldirsrel := xml xml/Client xml/Server xml/Cursor man/man3 html/Client html/Server html/Cursor
|
||||
alldirs := $(patsubst %,$(CURDIR)/%,$(alldirsrel))
|
||||
EXTRA_DIST = $(diagramssrc)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/doxygen/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign doc/doxygen/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
wayland.doxygen: $(top_builddir)/config.status $(srcdir)/wayland.doxygen.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-man3: $(dist_man3_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list1='$(dist_man3_MANS)'; \
|
||||
list2=''; \
|
||||
test -n "$(man3dir)" \
|
||||
&& test -n "`echo $$list1$$list2`" \
|
||||
|| exit 0; \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
|
||||
{ for i in $$list1; do echo "$$i"; done; \
|
||||
if test -n "$$list2"; then \
|
||||
for i in $$list2; do echo "$$i"; done \
|
||||
| sed -n '/\.3[a-z]*$$/p'; \
|
||||
fi; \
|
||||
} | while read p; do \
|
||||
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; echo "$$p"; \
|
||||
done | \
|
||||
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
|
||||
sed 'N;N;s,\n, ,g' | { \
|
||||
list=; while read file base inst; do \
|
||||
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
|
||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
|
||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
|
||||
fi; \
|
||||
done; \
|
||||
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
|
||||
done; }
|
||||
|
||||
uninstall-man3:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(dist_man3_MANS)'; test -n "$(man3dir)" || exit 0; \
|
||||
files=`{ for i in $$list; do echo "$$i"; done; \
|
||||
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
||||
dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(MANS) $(DATA) all-local
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(man3dir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man: install-man3
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-man
|
||||
|
||||
uninstall-man: uninstall-man3
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am all-local check check-am clean clean-generic \
|
||||
clean-libtool clean-local cscopelist-am ctags-am distclean \
|
||||
distclean-generic distclean-libtool distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-man3 install-pdf \
|
||||
install-pdf-am install-ps install-ps-am install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
|
||||
uninstall-am uninstall-man uninstall-man3
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
$(diagrams): $(diagramssrc)
|
||||
|
||||
$(diagram_maps): $(diagramssrc)
|
||||
|
||||
xml/%/index.xml: $(top_srcdir)/src/scanner.c $(scanned_src_files_%) wayland.doxygen $(diagrams) $(diagram_maps) | $(CURDIR)/xml/%
|
||||
$(AM_V_GEN)(cat wayland.doxygen; \
|
||||
echo "GENERATE_XML=YES"; \
|
||||
echo "XML_OUTPUT=xml/$*"; \
|
||||
echo "INPUT= $(scanned_src_files_$*)"; \
|
||||
) | $(DOXYGEN) -
|
||||
|
||||
html/%/index.html: $(scanned_src_files_%) wayland.doxygen $(diagrams) $(diagram_maps) | $(CURDIR)/html/%
|
||||
$(AM_V_GEN)(cat wayland.doxygen; \
|
||||
echo "PROJECT_NAME=\"Wayland $* API\""; \
|
||||
echo "GENERATE_HTML=YES"; \
|
||||
echo "HTML_OUTPUT=html/$*"; \
|
||||
echo "INPUT= $(scanned_src_files_$*) $(extra_doxygen_$*)"; \
|
||||
) | $(DOXYGEN) -
|
||||
|
||||
man/man3/wl_display.3: $(top_srcdir)/src/scanner.c $(scanned_src_files_man) wayland.doxygen | $(CURDIR)/man/man3
|
||||
$(AM_V_GEN)(cat wayland.doxygen; \
|
||||
echo "GENERATE_MAN=YES"; \
|
||||
echo "MAN_OUTPUT=man"; \
|
||||
echo "JAVADOC_AUTOBRIEF=NO"; \
|
||||
echo "INPUT= $(scanned_src_files_man)"; \
|
||||
) | $(DOXYGEN) -
|
||||
|
||||
xml/%.png: $(diagramsdir)/%.gv | $(CURDIR)/xml
|
||||
$(AM_V_GEN)$(DOT) -Tpng -o$@ $<
|
||||
|
||||
xml/%.map: $(diagramsdir)/%.gv | $(CURDIR)/xml
|
||||
$(AM_V_GEN)$(DOT) -Tcmapx_np -o$@ $<
|
||||
|
||||
# general rule to create one of the listed directories.
|
||||
$(alldirs):
|
||||
$(AM_V_GEN)$(MKDIR_P) $@
|
||||
|
||||
# there is no man-local
|
||||
all-local: man/man3/wl_display.3
|
||||
|
||||
clean-local:
|
||||
rm -rf xml/
|
||||
rm -rf html/
|
||||
rm -rf man/
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,36 @@
|
||||
digraph arch_wayland {
|
||||
edge[
|
||||
fontname="DejaVu Sans",
|
||||
dir="both",
|
||||
arrowtail="dot",
|
||||
arrowsize=.5,
|
||||
fontname="DejaVu Sans",
|
||||
fontsize="18",
|
||||
]
|
||||
|
||||
node[
|
||||
color=none,
|
||||
margin=0,
|
||||
fontname="DejaVu Sans",
|
||||
fontsize="18",
|
||||
]
|
||||
|
||||
c1 [label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD>Wayland Client</TD></TR></TABLE>>, URL="#c1"]
|
||||
c2 [label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD>Wayland Client</TD></TR></TABLE>>, URL="#c2"]
|
||||
|
||||
comp [tooltip="Wayland Compositor", label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD><BR/>Wayland<BR/>Compositor<BR/><BR/></TD></TR></TABLE>>, URL="#comp"]
|
||||
|
||||
impl [tooltip="KMS evdev Kernel", label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD>KMS</TD><TD>evdev</TD></TR><TR><TD COLSPAN="2">Kernel</TD></TR></TABLE>>, URL="#impl"]
|
||||
|
||||
c1 -> comp [taillabel="③", labeldistance=2.5, URL="#step_3"];
|
||||
c2 -> comp;
|
||||
|
||||
comp -> c1 [label="②", URL="#step_2"];
|
||||
comp -> c2;
|
||||
|
||||
comp -> impl [xlabel = "④", URL="#step_4"];
|
||||
comp -> impl [style = invis, label=" "];
|
||||
impl -> comp [xlabel = "①", URL="#step_1"];
|
||||
|
||||
c1 -> c2 [style=invis];
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
digraph arch_x {
|
||||
edge[
|
||||
fontname="DejaVu Sans",
|
||||
dir="both",
|
||||
arrowtail="dot",
|
||||
arrowsize=.5,
|
||||
fontname="DejaVu Sans",
|
||||
fontsize="18",
|
||||
]
|
||||
|
||||
node[
|
||||
shape="none",
|
||||
color=none,
|
||||
margin=0,
|
||||
fontname="DejaVu Sans",
|
||||
fontsize="18",
|
||||
]
|
||||
|
||||
{
|
||||
rank=same;
|
||||
c1 [label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD>X Client</TD></TR></TABLE>>, URL="#c1"]
|
||||
c3 [label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD>X Client</TD></TR></TABLE>>, URL="#c3"]
|
||||
}
|
||||
c2 [label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD>X Client</TD></TR></TABLE>>, URL="#c2"]
|
||||
|
||||
{
|
||||
rank=same;
|
||||
xserver [tooltip="X Server", label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD><BR/>X Server<BR/><BR/></TD></TR></TABLE>>, URL="#xserver"]
|
||||
comp [tooltip="Compositor", label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD><BR/>Compositor<BR/><BR/></TD></TR></TABLE>>, URL="#comp"]
|
||||
}
|
||||
|
||||
impl [tooltip="KMS evdev Kernel", label=<<TABLE STYLE="rounded" BGCOLOR="#ffbc00"><TR><TD>KMS</TD><TD>evdev</TD></TR><TR><TD COLSPAN="2">Kernel</TD></TR></TABLE>>, URL="#impl"]
|
||||
|
||||
c1 -> xserver [taillabel="③", labeldistance=2, URL="#step_3"];
|
||||
c2 -> xserver;
|
||||
c3 -> xserver;
|
||||
|
||||
xserver -> c1 [taillabel="②", labeldistance=2, URL="#step_2"];
|
||||
xserver -> c2;
|
||||
xserver -> c3;
|
||||
|
||||
xserver -> impl [taillabel="⑥", labeldistance=1.75, URL="#step_6"];
|
||||
xserver -> impl [style=invis, label=" "];
|
||||
impl -> xserver [taillabel="①", labeldistance=1.75, URL="#step_1"];
|
||||
|
||||
xserver -> comp [style=invis];
|
||||
xserver -> comp [taillabel="④", labeldistance=1.75, labelangle=-45, URL="#step_4"];
|
||||
comp -> xserver [taillabel="⑤", URL="#step_5"];
|
||||
comp -> xserver [style=invis]
|
||||
|
||||
c1 -> c2 [style=invis];
|
||||
c3 -> c2 [style=invis];
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import errno
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# Custom configuration for each documentation format
|
||||
doxygen_templates = {
|
||||
'xml': [
|
||||
'GENERATE_XML=YES\n',
|
||||
'XML_OUTPUT={format}/{section}\n',
|
||||
'INPUT= {files}\n',
|
||||
],
|
||||
'html': [
|
||||
'GENERATE_HTML=YES\n',
|
||||
'HTML_OUTPUT={format}/{section}\n',
|
||||
'PROJECT_NAME=\"Wayland {section} API\"\n',
|
||||
'INPUT= {files}\n',
|
||||
],
|
||||
'man': [
|
||||
'GENERATE_MAN=YES\n',
|
||||
'MAN_OUTPUT={format}\n',
|
||||
'MAN_SUBDIR=.\n',
|
||||
'JAVADOC_AUTOBRIEF=NO\n',
|
||||
'INPUT= {files}\n',
|
||||
],
|
||||
}
|
||||
|
||||
def load_doxygen_file(doxyfile):
|
||||
with open(doxyfile, 'r') as f:
|
||||
res = f.readlines()
|
||||
return res
|
||||
|
||||
def get_template(outformat):
|
||||
for (k,v) in doxygen_templates.items():
|
||||
if outformat.startswith(k):
|
||||
return v
|
||||
|
||||
def gen_doxygen_file(data, outformat, section, files):
|
||||
for l in get_template(outformat):
|
||||
data.append(l.format(format=outformat, section=section, files=' '.join(files)))
|
||||
return data
|
||||
|
||||
parser = argparse.ArgumentParser(description='Generate docs with Doxygen')
|
||||
parser.add_argument('doxygen_file',
|
||||
help='The doxygen file to use')
|
||||
parser.add_argument('files',
|
||||
help='The list of files to parse',
|
||||
metavar='FILES',
|
||||
nargs='+')
|
||||
parser.add_argument('--builddir',
|
||||
help='The build directory',
|
||||
metavar='DIR',
|
||||
default='.')
|
||||
parser.add_argument('--section',
|
||||
help='The section to build',
|
||||
metavar='NAME',
|
||||
default='Client')
|
||||
parser.add_argument('--output-format',
|
||||
help='The output format: xml, html, man',
|
||||
metavar='FORMAT',
|
||||
default='xml')
|
||||
parser.add_argument('--stamp',
|
||||
help='Stamp file to output',
|
||||
metavar='STAMP_FILE',
|
||||
nargs='?',
|
||||
type=argparse.FileType('w'))
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Merge the doxyfile with our custom templates
|
||||
conf = load_doxygen_file(args.doxygen_file)
|
||||
conf = gen_doxygen_file(conf, args.output_format, args.section, args.files)
|
||||
|
||||
# Doxygen is not clever enough to create the directories it
|
||||
# needs beforehand
|
||||
try:
|
||||
os.makedirs(os.path.join(args.builddir, args.output_format))
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
raise e
|
||||
|
||||
# Run Doxygen with the generated doxyfile
|
||||
cmd = subprocess.Popen(['doxygen', '-'], stdin=subprocess.PIPE)
|
||||
cmd.stdin.write(''.join(conf).encode('utf-8'))
|
||||
cmd.stdin.close()
|
||||
if cmd.wait() != 0:
|
||||
sys.exit(1)
|
||||
|
||||
# This is a bit of a hack; Doxygen will generate way more files than we
|
||||
# want to install, but there's no way to know how many at configuration
|
||||
# time. Since we want to install only the wl_* man pages anyway, we can
|
||||
# delete the other files and let Meson install the whole man3 subdirectory
|
||||
if args.output_format.startswith('man'):
|
||||
manpath = os.path.join(args.builddir, args.output_format)
|
||||
for filename in os.listdir(manpath):
|
||||
full_path = os.path.join(manpath, filename)
|
||||
if not filename.startswith('wl_'):
|
||||
os.remove(full_path)
|
||||
|
||||
if args.stamp:
|
||||
args.stamp.write(str(datetime.datetime.now()))
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @mainpage
|
||||
* Wayland protocol API documentation.
|
||||
*
|
||||
* This documentation is available for the Server- and the Client-side APIs.
|
||||
*
|
||||
* - <a href="../Server/index.html">Server-side API</a>
|
||||
* - <a href="../Client/index.html">Client-side API</a>
|
||||
* - <a href="../Cursor/index.html">Cursor helper library API</a>
|
||||
*
|
||||
* Further documentation about the architecture and principles of Wayland is
|
||||
* available in the
|
||||
* <a href="https://wayland.freedesktop.org/docs/html">Wayland Book</a>
|
||||
*
|
||||
* @section ifaces Interfaces
|
||||
* For the list of available interfaces, please see the
|
||||
* <a href="modules.html">modules</a> list.
|
||||
*
|
||||
* @section protocols Protocols
|
||||
* For the list of protocols, please see the
|
||||
* <a href="pages.html">Related Pages</a>.
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,115 @@
|
||||
# Here be dragons
|
||||
|
||||
dot_gv = {
|
||||
'wayland-architecture': files('dot/wayland-architecture.gv'),
|
||||
'x-architecture': files('dot/x-architecture.gv'),
|
||||
}
|
||||
|
||||
# This is a workaround for Meson's custom_target() directive, which
|
||||
# currently does not support outputs pointing to a sub-directory
|
||||
# XXX: try turning these into maps, so they can be indexed with picture name
|
||||
dot_png = []
|
||||
dot_map = []
|
||||
|
||||
doxygen_conf = configuration_data()
|
||||
doxygen_conf.set('VERSION', meson.project_version())
|
||||
doxygen_conf.set('top_builddir', meson.build_root())
|
||||
wayland_doxygen = configure_file(
|
||||
input: 'wayland.doxygen.in',
|
||||
output: 'wayland.doxygen',
|
||||
configuration: doxygen_conf,
|
||||
)
|
||||
|
||||
shared_files = files([
|
||||
'../../src/wayland-util.h',
|
||||
])
|
||||
|
||||
client_files = files([
|
||||
'../../src/wayland-client.c',
|
||||
'../../src/wayland-client.h',
|
||||
'../../src/wayland-client-core.h',
|
||||
])
|
||||
|
||||
server_files = files([
|
||||
'../../src/event-loop.c',
|
||||
'../../src/wayland-server.c',
|
||||
'../../src/wayland-server.h',
|
||||
'../../src/wayland-server-core.h',
|
||||
'../../src/wayland-shm.c',
|
||||
])
|
||||
|
||||
cursor_files = files([
|
||||
'../../cursor/wayland-cursor.c',
|
||||
'../../cursor/wayland-cursor.h',
|
||||
])
|
||||
|
||||
extra_client_files = [
|
||||
'mainpage.dox',
|
||||
wayland_client_protocol_h,
|
||||
]
|
||||
|
||||
extra_server_files = [
|
||||
'mainpage.dox',
|
||||
wayland_server_protocol_h,
|
||||
]
|
||||
|
||||
extra_cursor_files = [
|
||||
'mainpage.dox',
|
||||
]
|
||||
|
||||
gen_doxygen = find_program('gen-doxygen.py')
|
||||
|
||||
subdir('xml')
|
||||
|
||||
formats = {
|
||||
'html': {
|
||||
'Client': shared_files + client_files + extra_client_files,
|
||||
'Server': shared_files + server_files + extra_server_files,
|
||||
'Cursor': shared_files + cursor_files + extra_cursor_files,
|
||||
},
|
||||
}
|
||||
|
||||
foreach f_name, sections: formats
|
||||
foreach s_name, s_files: sections
|
||||
t_name = '@0@-@1@-doc'.format(f_name, s_name)
|
||||
|
||||
# We do not really need an output file, but Meson
|
||||
# will complain if one is not set, so we use a
|
||||
# dummy 'stamp' file
|
||||
custom_target(
|
||||
t_name,
|
||||
command: [
|
||||
gen_doxygen,
|
||||
# XXX pass doxygen path as argument
|
||||
'--builddir=@OUTDIR@',
|
||||
'--section=@0@'.format(s_name),
|
||||
'--output-format=@0@'.format(f_name),
|
||||
'--stamp=doc/doxygen/@0@.stamp'.format(t_name),
|
||||
wayland_doxygen,
|
||||
'@INPUT@',
|
||||
],
|
||||
input: s_files,
|
||||
output: '@0@.stamp'.format(t_name),
|
||||
depends: [dot_png, dot_map],
|
||||
build_by_default: true,
|
||||
)
|
||||
endforeach
|
||||
endforeach
|
||||
|
||||
man_files = shared_files + server_files + client_files + cursor_files
|
||||
custom_target(
|
||||
'man-pages-3',
|
||||
command: [
|
||||
gen_doxygen,
|
||||
'--builddir=@OUTDIR@',
|
||||
'--output-format=man3',
|
||||
'--stamp=doc/doxygen/man3.stamp',
|
||||
wayland_doxygen,
|
||||
'@INPUT@',
|
||||
],
|
||||
input: man_files,
|
||||
output: 'man3',
|
||||
build_by_default: true,
|
||||
install: true,
|
||||
install_dir: join_paths(get_option('prefix'), get_option('mandir')),
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
# Wayland-specific overrides
|
||||
PROJECT_NAME = "Wayland"
|
||||
PROJECT_NUMBER = @VERSION@
|
||||
OUTPUT_DIRECTORY = @top_builddir@/doc/doxygen
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
TAB_SIZE = 8
|
||||
QUIET = YES
|
||||
HTML_TIMESTAMP = YES
|
||||
GENERATE_LATEX = NO
|
||||
MAN_LINKS = NO
|
||||
PREDEFINED = WL_EXPORT= \
|
||||
WL_PRINTF(x,y)=
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
DOT_MULTI_TARGETS = YES
|
||||
ALIASES += comment{1}="/* \1 *<!-- -->/"
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_STATIC = YES
|
||||
# These must be set in the Makefile
|
||||
GENERATE_HTML = NO
|
||||
GENERATE_XML = NO
|
||||
GENERATE_MAN = NO
|
||||
@@ -0,0 +1,18 @@
|
||||
tgt = custom_target(
|
||||
'xml-Client-doc',
|
||||
command: [
|
||||
gen_doxygen,
|
||||
# XXX pass doxygen path as argument
|
||||
'--builddir=@OUTDIR@',
|
||||
'--section=Client',
|
||||
'--output-format=xml',
|
||||
wayland_doxygen,
|
||||
'@INPUT@',
|
||||
],
|
||||
input: [ shared_files, client_files ],
|
||||
output: [ 'combine.xslt', 'index.xml' ],
|
||||
depends: [dot_png, dot_map]
|
||||
)
|
||||
|
||||
doxygen_Client_combine_xslt = tgt[0]
|
||||
doxygen_Client_index_xml = tgt[1]
|
||||
@@ -0,0 +1,18 @@
|
||||
tgt = custom_target(
|
||||
'xml-Server-doc',
|
||||
command: [
|
||||
gen_doxygen,
|
||||
# XXX pass doxygen path as argument
|
||||
'--builddir=@OUTDIR@',
|
||||
'--section=Server',
|
||||
'--output-format=xml',
|
||||
wayland_doxygen,
|
||||
'@INPUT@',
|
||||
],
|
||||
input: [ shared_files, server_files ],
|
||||
output: [ 'combine.xslt', 'index.xml' ],
|
||||
depends: [dot_png, dot_map]
|
||||
)
|
||||
|
||||
doxygen_Server_combine_xslt = tgt[0]
|
||||
doxygen_Server_index_xml = tgt[1]
|
||||
@@ -0,0 +1,22 @@
|
||||
# dot_png: list of PNG targets
|
||||
# dot_map: list of MAP targets
|
||||
foreach name, infile: dot_gv
|
||||
dot_png += custom_target(
|
||||
name + '.png',
|
||||
command: [ dot, '-Tpng', '-o@OUTPUT@', '@INPUT@' ],
|
||||
input: infile,
|
||||
output: name + '.png',
|
||||
install: true,
|
||||
install_dir: join_paths(publican_install_prefix, publican_html_dir, 'images')
|
||||
)
|
||||
|
||||
dot_map += custom_target(
|
||||
name + '.map',
|
||||
command: [ dot, '-Tcmapx_np', '-o@OUTPUT@', '@INPUT@' ],
|
||||
input: infile,
|
||||
output: name + '.map',
|
||||
)
|
||||
endforeach
|
||||
|
||||
subdir('Client')
|
||||
subdir('Server')
|
||||
@@ -0,0 +1,37 @@
|
||||
dot = find_program('dot')
|
||||
doxygen = find_program('doxygen')
|
||||
xsltproc = find_program('xsltproc')
|
||||
xmlto = find_program('xmlto')
|
||||
|
||||
cmd = run_command(doxygen, '--version', check: true)
|
||||
message('doxygen: ' + cmd.stdout().strip())
|
||||
vers = cmd.stdout().strip()
|
||||
if vers.version_compare('< 1.6.0')
|
||||
error('Doxygen 1.6 or later is required for building documentation, found @0@.'.format(vers))
|
||||
endif
|
||||
|
||||
cmd = run_command(dot, '-V', check: true)
|
||||
message('dot: ' + cmd.stderr().strip())
|
||||
vers = cmd.stderr().split('version')[1].strip().split(' ')[0]
|
||||
if vers.version_compare('< 2.26.0')
|
||||
error('Dot (Graphviz) 2.26 or later is required for building documentation, found @0@.'.format(vers))
|
||||
endif
|
||||
|
||||
manpage_xsl = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
|
||||
cmd = run_command(xsltproc, '--nonet', manpage_xsl)
|
||||
if cmd.returncode() != 0
|
||||
error('The style sheet for man pages providing "@0@" was not found.'.format(manpage_xsl))
|
||||
endif
|
||||
|
||||
publican_install_prefix = join_paths(
|
||||
get_option('prefix'),
|
||||
get_option('datadir'),
|
||||
'doc',
|
||||
meson.project_name(),
|
||||
'Wayland', 'en-US'
|
||||
)
|
||||
|
||||
publican_html_dir = 'html'
|
||||
|
||||
subdir('doxygen')
|
||||
subdir('publican')
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
Wayland
|
||||
en-US/
|
||||
publican-copy.cfg
|
||||
@@ -0,0 +1,169 @@
|
||||
# Documentation is built with xmlto, but some of the recipes in here are
|
||||
# leftovers from building with Publican (https://fedorahosted.org/publican/)
|
||||
#
|
||||
# How this build works:
|
||||
# * the main target is Wayland, documentation ends up in $(builddir)/Wayland/
|
||||
# * hand-written chapters and CSS files are located in sources. These are
|
||||
# copied into $(builddir)/en-US/
|
||||
# * ProtocolSpec.xml is generated from $(top_srcdir)/protocol/wayland.xml,
|
||||
# changed into docbook via XSLT and saved in $(builddir)/en-US/
|
||||
# * ProtocolInterfaces.xml, same as above, uses a different XSLT
|
||||
# * *API.xml is generated from the doxygen output and saved in
|
||||
# $(builddir)/en-US
|
||||
# * run xmlto on $(builddir)/en-US, output to $(builddir)/Wayland/en-US
|
||||
|
||||
doxydir := $(top_builddir)/doc/doxygen
|
||||
html_destdir := $(builddir)/Wayland/en-US/html
|
||||
|
||||
publican_sources = \
|
||||
$(srcdir)/sources/Wayland.ent \
|
||||
$(srcdir)/sources/Wayland.xml \
|
||||
$(srcdir)/sources/Book_Info.xml \
|
||||
$(srcdir)/sources/Author_Group.xml \
|
||||
$(srcdir)/sources/Foreword.xml \
|
||||
$(srcdir)/sources/Preface.xml \
|
||||
$(srcdir)/sources/Revision_History.xml \
|
||||
$(srcdir)/sources/Protocol.xml \
|
||||
$(srcdir)/sources/Xwayland.xml \
|
||||
$(srcdir)/sources/Compositors.xml \
|
||||
$(srcdir)/sources/images/icon.svg \
|
||||
$(srcdir)/sources/images/wayland.png \
|
||||
$(srcdir)/sources/images/xwayland-architecture.png \
|
||||
$(srcdir)/sources/Client.xml \
|
||||
$(srcdir)/sources/Server.xml
|
||||
|
||||
processed_sources := \
|
||||
$(srcdir)/sources/Architecture.xml \
|
||||
$(srcdir)/sources/Introduction.xml
|
||||
|
||||
css_sources = \
|
||||
$(srcdir)/sources/css/brand.css \
|
||||
$(srcdir)/sources/css/common.css \
|
||||
$(srcdir)/sources/css/default.css \
|
||||
$(srcdir)/sources/css/epub.css \
|
||||
$(srcdir)/sources/css/print.css
|
||||
|
||||
img_sources = \
|
||||
$(srcdir)/sources/images/icon.svg \
|
||||
$(srcdir)/sources/images/wayland.png \
|
||||
$(srcdir)/sources/images/xwayland-architecture.png
|
||||
|
||||
doxygen_img_sources := \
|
||||
$(doxydir)/xml/wayland-architecture.png \
|
||||
$(doxydir)/xml/x-architecture.png
|
||||
|
||||
map_sources := \
|
||||
$(doxydir)/xml/x-architecture.map \
|
||||
$(doxydir)/xml/wayland-architecture.map
|
||||
|
||||
if HAVE_XMLTO
|
||||
if HAVE_XSLTPROC
|
||||
noinst_DATA = $(builddir)/Wayland $(publican_targets)
|
||||
XMLTO_PARAM = \
|
||||
--skip-validation \
|
||||
--stringparam chunk.section.depth=0 \
|
||||
--stringparam toc.section.depth=1 \
|
||||
--stringparam html.stylesheet=css/default.css
|
||||
|
||||
# Listing various directories that might need to be created.
|
||||
alldirs := $(builddir)/en-US $(builddir)/en-US/images $(html_destdir) $(html_destdir)/css $(html_destdir)/images
|
||||
|
||||
|
||||
html_css_targets = $(addprefix $(html_destdir)/css/,$(notdir $(css_sources)))
|
||||
html_img_targets = $(addprefix $(html_destdir)/images/,$(notdir $(img_sources)))
|
||||
doxygen_img_targets := $(doxygen_img_sources:$(doxydir)/xml/%=$(html_destdir)/images/%)
|
||||
map_targets := $(map_sources:$(doxydir)/xml/%=$(builddir)/en-US/images/%)
|
||||
processed_targets := $(processed_sources:$(srcdir)/sources/%=$(builddir)/en-US/%)
|
||||
|
||||
$(builddir)/Wayland: $(publican_targets) $(html_css_targets) $(html_img_targets) $(processed_targets) $(doxygen_img_targets) | $(builddir)/en-US
|
||||
$(AM_V_GEN)$(XMLTO) $(XMLTO_PARAM) html $(builddir)/en-US/Wayland.xml -o $(html_destdir)
|
||||
@touch $@
|
||||
|
||||
$(html_destdir)/css/%: $(srcdir)/sources/css/% | $(html_destdir)/css
|
||||
$(AM_V_GEN)cp -f $< $@
|
||||
|
||||
$(html_destdir)/images/%: $(srcdir)/sources/images/% | $(html_destdir)/images
|
||||
$(AM_V_GEN)cp -f $< $@
|
||||
|
||||
$(html_destdir)/images/%: $(doxydir)/xml/% | $(html_destdir)/images
|
||||
$(AM_V_GEN)cp -f $< $@
|
||||
|
||||
pubdir = $(docdir)/Wayland/en-US
|
||||
|
||||
publican_targets = $(publican_sources:$(srcdir)/sources/%=$(builddir)/en-US/%) \
|
||||
$(builddir)/en-US/ProtocolSpec.xml \
|
||||
$(builddir)/en-US/ProtocolInterfaces.xml \
|
||||
$(builddir)/en-US/ClientAPI.xml \
|
||||
$(builddir)/en-US/ServerAPI.xml
|
||||
|
||||
# The Protocol.xml is purely generated and required before running publican
|
||||
$(builddir)/en-US/ProtocolSpec.xml: $(top_srcdir)/protocol/wayland.xml $(srcdir)/protocol-to-docbook.xsl | $(builddir)/en-US
|
||||
$(AM_V_GEN)$(XSLTPROC) $(srcdir)/protocol-to-docbook.xsl \
|
||||
$(top_srcdir)/protocol/wayland.xml > $@
|
||||
|
||||
$(builddir)/en-US/ProtocolInterfaces.xml: $(top_srcdir)/protocol/wayland.xml $(srcdir)/protocol-interfaces-to-docbook.xsl | $(builddir)/en-US
|
||||
$(AM_V_GEN)$(XSLTPROC) $(srcdir)/protocol-interfaces-to-docbook.xsl \
|
||||
$(top_srcdir)/protocol/wayland.xml > $@
|
||||
|
||||
# * use doxygen's combine.xslt to merge the xml files into one single file
|
||||
# * pipe that through the doxygen-to-publican stylesheet
|
||||
$(builddir)/en-US/%API.xml: $(doxydir)/xml/%/index.xml $(srcdir)/doxygen-to-publican.xsl | $(builddir)/en-US
|
||||
$(AM_V_GEN)$(XSLTPROC) $(doxydir)/xml/$*/combine.xslt \
|
||||
$(doxydir)/xml/$*/index.xml | \
|
||||
$(XSLTPROC) --stringparam which $* \
|
||||
$(srcdir)/doxygen-to-publican.xsl - > $@
|
||||
|
||||
# Copy the sources source files into en-US destination
|
||||
# This is required for out-of-source-tree build as publican does not allow us
|
||||
# to specify the location of the source code.
|
||||
$(builddir)/en-US/%: $(srcdir)/sources/% $(publican_sources) | $(builddir)/en-US/images
|
||||
$(AM_V_GEN)cp -f $< $@
|
||||
$(AM_V_at)chmod a+w $@
|
||||
|
||||
$(builddir)/en-US/images/%: $(doxydir)/xml/% | $(builddir)/en-US/images
|
||||
$(AM_V_GEN)cp -f $< $@
|
||||
$(AM_V_at)chmod a+w $@
|
||||
|
||||
# More specific rule to override explicitly listed targets and perform xslt
|
||||
# modifications on them.
|
||||
# Note that we can't use $< as all targets must be there
|
||||
$(processed_targets): $(processed_sources) $(map_targets) $(srcdir)/merge-mapcoords.xsl | $(builddir)/en-US/images
|
||||
$(AM_V_GEN)$(XSLTPROC) --stringparam basedir $(builddir)/en-US \
|
||||
$(srcdir)/merge-mapcoords.xsl $(addprefix $(srcdir)/sources/,$(notdir $@)) > $@
|
||||
|
||||
# general rule to create one of the listed directories.
|
||||
$(alldirs):
|
||||
$(AM_V_GEN)$(MKDIR_P) $@
|
||||
|
||||
CLEANFILES = $(publican_targets)
|
||||
|
||||
clean-local:
|
||||
$(AM_V_at)rm -fr $(builddir)/en-US
|
||||
$(AM_V_at)rm -fr $(builddir)/Wayland
|
||||
|
||||
install-data-local:
|
||||
test -z "$(pubdir)/html/css" || $(mkdir_p) "$(DESTDIR)$(pubdir)/html/css"
|
||||
test -z "$(pubdir)/html/images" || $(mkdir_p) "$(DESTDIR)$(pubdir)/html/images"
|
||||
list=`find $(builddir)/Wayland/en-US -type f`; \
|
||||
for p in $$list; do \
|
||||
echo " $(INSTALL_DATA) '$$p' '$(DESTDIR)$(docdir)/$$p'"; \
|
||||
$(INSTALL_DATA) "$$p" "$(DESTDIR)$(docdir)/$$p"; \
|
||||
done;
|
||||
|
||||
uninstall-local:
|
||||
@if test -n $(DESTDIR)$(docdir); then \
|
||||
if test -d $(DESTDIR)$(docdir); then \
|
||||
echo " rm -fr $(DESTDIR)$(docdir)/Wayland;"; \
|
||||
rm -fr $(DESTDIR)$(docdir)/Wayland; \
|
||||
fi; \
|
||||
fi;
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(publican_sources) $(processed_sources) $(css_sources) $(img_sources) \
|
||||
protocol-to-docbook.xsl \
|
||||
protocol-interfaces-to-docbook.xsl \
|
||||
doxygen-to-publican.xsl \
|
||||
merge-mapcoords.xsl
|
||||
@@ -0,0 +1,637 @@
|
||||
# Makefile.in generated by automake 1.16.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2020 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
# Documentation is built with xmlto, but some of the recipes in here are
|
||||
# leftovers from building with Publican (https://fedorahosted.org/publican/)
|
||||
#
|
||||
# How this build works:
|
||||
# * the main target is Wayland, documentation ends up in $(builddir)/Wayland/
|
||||
# * hand-written chapters and CSS files are located in sources. These are
|
||||
# copied into $(builddir)/en-US/
|
||||
# * ProtocolSpec.xml is generated from $(top_srcdir)/protocol/wayland.xml,
|
||||
# changed into docbook via XSLT and saved in $(builddir)/en-US/
|
||||
# * ProtocolInterfaces.xml, same as above, uses a different XSLT
|
||||
# * *API.xml is generated from the doxygen output and saved in
|
||||
# $(builddir)/en-US
|
||||
# * run xmlto on $(builddir)/en-US, output to $(builddir)/Wayland/en-US
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__is_gnu_make = { \
|
||||
if test -z '$(MAKELEVEL)'; then \
|
||||
false; \
|
||||
elif test -n '$(MAKE_HOST)'; then \
|
||||
true; \
|
||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
||||
true; \
|
||||
else \
|
||||
false; \
|
||||
fi; \
|
||||
}
|
||||
am__make_running_with_option = \
|
||||
case $${target_option-} in \
|
||||
?) ;; \
|
||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
||||
"target option '$${target_option-}' specified" >&2; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
has_opt=no; \
|
||||
sane_makeflags=$$MAKEFLAGS; \
|
||||
if $(am__is_gnu_make); then \
|
||||
sane_makeflags=$$MFLAGS; \
|
||||
else \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
bs=\\; \
|
||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
||||
esac; \
|
||||
fi; \
|
||||
skip_next=no; \
|
||||
strip_trailopt () \
|
||||
{ \
|
||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
||||
}; \
|
||||
for flg in $$sane_makeflags; do \
|
||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
||||
case $$flg in \
|
||||
*=*|--*) continue;; \
|
||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
||||
-*I?*) strip_trailopt 'I';; \
|
||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
||||
-*O?*) strip_trailopt 'O';; \
|
||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
||||
-*l?*) strip_trailopt 'l';; \
|
||||
-[dEDm]) skip_next=yes;; \
|
||||
-[JT]) skip_next=yes;; \
|
||||
esac; \
|
||||
case $$flg in \
|
||||
*$$target_option*) has_opt=yes; break;; \
|
||||
esac; \
|
||||
done; \
|
||||
test $$has_opt = yes
|
||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = doc/publican
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/weston.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_P = $(am__v_P_@AM_V@)
|
||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
||||
am__v_P_0 = false
|
||||
am__v_P_1 = :
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
am__v_GEN_1 =
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
DATA = $(noinst_DATA)
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DL_LIBS = @DL_LIBS@
|
||||
DOCS_STYLESHEET = @DOCS_STYLESHEET@
|
||||
DOT = @DOT@
|
||||
DOXYGEN = @DOXYGEN@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXPAT_CFLAGS = @EXPAT_CFLAGS@
|
||||
EXPAT_LIBS = @EXPAT_LIBS@
|
||||
FFI_CFLAGS = @FFI_CFLAGS@
|
||||
FFI_LIBS = @FFI_LIBS@
|
||||
FGREP = @FGREP@
|
||||
GCC_CFLAGS = @GCC_CFLAGS@
|
||||
GREP = @GREP@
|
||||
ICONDIR = @ICONDIR@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBXML_CFLAGS = @LIBXML_CFLAGS@
|
||||
LIBXML_LIBS = @LIBXML_LIBS@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
RANLIB = @RANLIB@
|
||||
RT_LIBS = @RT_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
WAYLAND_VERSION = @WAYLAND_VERSION@
|
||||
WAYLAND_VERSION_MAJOR = @WAYLAND_VERSION_MAJOR@
|
||||
WAYLAND_VERSION_MICRO = @WAYLAND_VERSION_MICRO@
|
||||
WAYLAND_VERSION_MINOR = @WAYLAND_VERSION_MINOR@
|
||||
XMLTO = @XMLTO@
|
||||
XSLTPROC = @XSLTPROC@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
doxydir := $(top_builddir)/doc/doxygen
|
||||
html_destdir := $(builddir)/Wayland/en-US/html
|
||||
publican_sources = \
|
||||
$(srcdir)/sources/Wayland.ent \
|
||||
$(srcdir)/sources/Wayland.xml \
|
||||
$(srcdir)/sources/Book_Info.xml \
|
||||
$(srcdir)/sources/Author_Group.xml \
|
||||
$(srcdir)/sources/Foreword.xml \
|
||||
$(srcdir)/sources/Preface.xml \
|
||||
$(srcdir)/sources/Revision_History.xml \
|
||||
$(srcdir)/sources/Protocol.xml \
|
||||
$(srcdir)/sources/Xwayland.xml \
|
||||
$(srcdir)/sources/Compositors.xml \
|
||||
$(srcdir)/sources/images/icon.svg \
|
||||
$(srcdir)/sources/images/wayland.png \
|
||||
$(srcdir)/sources/images/xwayland-architecture.png \
|
||||
$(srcdir)/sources/Client.xml \
|
||||
$(srcdir)/sources/Server.xml
|
||||
|
||||
processed_sources := \
|
||||
$(srcdir)/sources/Architecture.xml \
|
||||
$(srcdir)/sources/Introduction.xml
|
||||
|
||||
css_sources = \
|
||||
$(srcdir)/sources/css/brand.css \
|
||||
$(srcdir)/sources/css/common.css \
|
||||
$(srcdir)/sources/css/default.css \
|
||||
$(srcdir)/sources/css/epub.css \
|
||||
$(srcdir)/sources/css/print.css
|
||||
|
||||
img_sources = \
|
||||
$(srcdir)/sources/images/icon.svg \
|
||||
$(srcdir)/sources/images/wayland.png \
|
||||
$(srcdir)/sources/images/xwayland-architecture.png
|
||||
|
||||
doxygen_img_sources := \
|
||||
$(doxydir)/xml/wayland-architecture.png \
|
||||
$(doxydir)/xml/x-architecture.png
|
||||
|
||||
map_sources := \
|
||||
$(doxydir)/xml/x-architecture.map \
|
||||
$(doxydir)/xml/wayland-architecture.map
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@noinst_DATA = $(builddir)/Wayland $(publican_targets)
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@XMLTO_PARAM = \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ --skip-validation \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ --stringparam chunk.section.depth=0 \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ --stringparam toc.section.depth=1 \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ --stringparam html.stylesheet=css/default.css
|
||||
|
||||
|
||||
# Listing various directories that might need to be created.
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@alldirs := $(builddir)/en-US $(builddir)/en-US/images $(html_destdir) $(html_destdir)/css $(html_destdir)/images
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@html_css_targets = $(addprefix $(html_destdir)/css/,$(notdir $(css_sources)))
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@html_img_targets = $(addprefix $(html_destdir)/images/,$(notdir $(img_sources)))
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@doxygen_img_targets := $(doxygen_img_sources:$(doxydir)/xml/%=$(html_destdir)/images/%)
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@map_targets := $(map_sources:$(doxydir)/xml/%=$(builddir)/en-US/images/%)
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@processed_targets := $(processed_sources:$(srcdir)/sources/%=$(builddir)/en-US/%)
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@pubdir = $(docdir)/Wayland/en-US
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@publican_targets = $(publican_sources:$(srcdir)/sources/%=$(builddir)/en-US/%) \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(builddir)/en-US/ProtocolSpec.xml \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(builddir)/en-US/ProtocolInterfaces.xml \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(builddir)/en-US/ClientAPI.xml \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(builddir)/en-US/ServerAPI.xml
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@CLEANFILES = $(publican_targets)
|
||||
EXTRA_DIST = \
|
||||
$(publican_sources) $(processed_sources) $(css_sources) $(img_sources) \
|
||||
protocol-to-docbook.xsl \
|
||||
protocol-interfaces-to-docbook.xsl \
|
||||
doxygen-to-publican.xsl \
|
||||
merge-mapcoords.xsl
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/publican/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign doc/publican/Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
tags TAGS:
|
||||
|
||||
ctags CTAGS:
|
||||
|
||||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(DATA)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
@HAVE_XMLTO_FALSE@uninstall-local:
|
||||
@HAVE_XSLTPROC_FALSE@uninstall-local:
|
||||
@HAVE_XMLTO_FALSE@clean-local:
|
||||
@HAVE_XSLTPROC_FALSE@clean-local:
|
||||
@HAVE_XMLTO_FALSE@install-data-local:
|
||||
@HAVE_XSLTPROC_FALSE@install-data-local:
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-data-local
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-local
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
|
||||
clean-local cscopelist-am ctags-am distclean distclean-generic \
|
||||
distclean-libtool distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am \
|
||||
install-data-local install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
|
||||
uninstall-am uninstall-local
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(builddir)/Wayland: $(publican_targets) $(html_css_targets) $(html_img_targets) $(processed_targets) $(doxygen_img_targets) | $(builddir)/en-US
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)$(XMLTO) $(XMLTO_PARAM) html $(builddir)/en-US/Wayland.xml -o $(html_destdir)
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ @touch $@
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(html_destdir)/css/%: $(srcdir)/sources/css/% | $(html_destdir)/css
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)cp -f $< $@
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(html_destdir)/images/%: $(srcdir)/sources/images/% | $(html_destdir)/images
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)cp -f $< $@
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(html_destdir)/images/%: $(doxydir)/xml/% | $(html_destdir)/images
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)cp -f $< $@
|
||||
|
||||
# The Protocol.xml is purely generated and required before running publican
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(builddir)/en-US/ProtocolSpec.xml: $(top_srcdir)/protocol/wayland.xml $(srcdir)/protocol-to-docbook.xsl | $(builddir)/en-US
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)$(XSLTPROC) $(srcdir)/protocol-to-docbook.xsl \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(top_srcdir)/protocol/wayland.xml > $@
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(builddir)/en-US/ProtocolInterfaces.xml: $(top_srcdir)/protocol/wayland.xml $(srcdir)/protocol-interfaces-to-docbook.xsl | $(builddir)/en-US
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)$(XSLTPROC) $(srcdir)/protocol-interfaces-to-docbook.xsl \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(top_srcdir)/protocol/wayland.xml > $@
|
||||
|
||||
# * use doxygen's combine.xslt to merge the xml files into one single file
|
||||
# * pipe that through the doxygen-to-publican stylesheet
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(builddir)/en-US/%API.xml: $(doxydir)/xml/%/index.xml $(srcdir)/doxygen-to-publican.xsl | $(builddir)/en-US
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)$(XSLTPROC) $(doxydir)/xml/$*/combine.xslt \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(doxydir)/xml/$*/index.xml | \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(XSLTPROC) --stringparam which $* \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(srcdir)/doxygen-to-publican.xsl - > $@
|
||||
|
||||
# Copy the sources source files into en-US destination
|
||||
# This is required for out-of-source-tree build as publican does not allow us
|
||||
# to specify the location of the source code.
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(builddir)/en-US/%: $(srcdir)/sources/% $(publican_sources) | $(builddir)/en-US/images
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)cp -f $< $@
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_at)chmod a+w $@
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(builddir)/en-US/images/%: $(doxydir)/xml/% | $(builddir)/en-US/images
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)cp -f $< $@
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_at)chmod a+w $@
|
||||
|
||||
# More specific rule to override explicitly listed targets and perform xslt
|
||||
# modifications on them.
|
||||
# Note that we can't use $< as all targets must be there
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(processed_targets): $(processed_sources) $(map_targets) $(srcdir)/merge-mapcoords.xsl | $(builddir)/en-US/images
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)$(XSLTPROC) --stringparam basedir $(builddir)/en-US \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(srcdir)/merge-mapcoords.xsl $(addprefix $(srcdir)/sources/,$(notdir $@)) > $@
|
||||
|
||||
# general rule to create one of the listed directories.
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@$(alldirs):
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_GEN)$(MKDIR_P) $@
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@clean-local:
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_at)rm -fr $(builddir)/en-US
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(AM_V_at)rm -fr $(builddir)/Wayland
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@install-data-local:
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ test -z "$(pubdir)/html/css" || $(mkdir_p) "$(DESTDIR)$(pubdir)/html/css"
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ test -z "$(pubdir)/html/images" || $(mkdir_p) "$(DESTDIR)$(pubdir)/html/images"
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ list=`find $(builddir)/Wayland/en-US -type f`; \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ for p in $$list; do \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ echo " $(INSTALL_DATA) '$$p' '$(DESTDIR)$(docdir)/$$p'"; \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ $(INSTALL_DATA) "$$p" "$(DESTDIR)$(docdir)/$$p"; \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ done;
|
||||
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@uninstall-local:
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ @if test -n $(DESTDIR)$(docdir); then \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ if test -d $(DESTDIR)$(docdir); then \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ echo " rm -fr $(DESTDIR)$(docdir)/Wayland;"; \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ rm -fr $(DESTDIR)$(docdir)/Wayland; \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ fi; \
|
||||
@HAVE_XMLTO_TRUE@@HAVE_XSLTPROC_TRUE@ fi;
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" ?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
|
||||
<xsl:param name="which" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="/doxygen/compounddef[@kind!='file' and @kind!='dir']" />
|
||||
|
||||
<section id="{$which}-Functions">
|
||||
<title>Functions</title>
|
||||
<para />
|
||||
<variablelist>
|
||||
<xsl:apply-templates select="/doxygen/compounddef[@kind='file']/sectiondef/memberdef" />
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="parameteritem">
|
||||
<varlistentry>
|
||||
<term>
|
||||
<xsl:apply-templates select="parameternamelist/parametername"/>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara><xsl:apply-templates select="parameterdescription"/></simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="parameterlist">
|
||||
<xsl:if test="parameteritem">
|
||||
<variablelist>
|
||||
<xsl:apply-templates select="parameteritem" />
|
||||
</variablelist>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ref">
|
||||
<link linkend="{$which}-{@refid}"><xsl:value-of select="." /></link>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="simplesect[@kind='return']">
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>Returns:</term>
|
||||
<listitem>
|
||||
<simpara><xsl:apply-templates /></simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="simplesect[@kind='see']">
|
||||
See also: <xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="simplesect[@kind='since']">
|
||||
Since: <xsl:apply-templates />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="simplesect[@kind='note']">
|
||||
<emphasis>Note: <xsl:apply-templates /></emphasis>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="sp">
|
||||
<xsl:text> </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="programlisting">
|
||||
<programlisting><xsl:apply-templates /></programlisting>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="itemizedlist">
|
||||
<itemizedlist><xsl:apply-templates select="listitem" /></itemizedlist>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="listitem">
|
||||
<listitem><simpara><xsl:apply-templates /></simpara></listitem>
|
||||
</xsl:template>
|
||||
|
||||
<!-- stops cross-references in the section titles -->
|
||||
<xsl:template match="briefdescription">
|
||||
<xsl:value-of select="." />
|
||||
</xsl:template>
|
||||
|
||||
<!-- this opens a para for each detaileddescription/para. I could not find a
|
||||
way to extract the right text for the description from the
|
||||
source otherwise. Downside: we can't use para for return value, "see
|
||||
also", etc. because they're already inside a para. So they're lists.
|
||||
|
||||
It also means we don't control the order of when something is added to
|
||||
the output, it matches the input file
|
||||
-->
|
||||
<xsl:template match="detaileddescription/para">
|
||||
<para><xsl:apply-templates /></para>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="detaileddescription">
|
||||
<xsl:apply-templates select="para" />
|
||||
</xsl:template>
|
||||
|
||||
<!-- methods -->
|
||||
<xsl:template match="memberdef" >
|
||||
<xsl:if test="@kind = 'function' and @static = 'no' and @prot = 'public' or
|
||||
@kind !='function' and normalize-space(briefdescription) != ''">
|
||||
<varlistentry id="{$which}-{@id}">
|
||||
<term>
|
||||
<xsl:value-of select="name"/>
|
||||
<xsl:if test="normalize-space(briefdescription) != ''">
|
||||
- <xsl:apply-templates select="briefdescription" />
|
||||
</xsl:if>
|
||||
</term>
|
||||
<listitem>
|
||||
<synopsis>
|
||||
<xsl:apply-templates select="definition"/><xsl:apply-templates select="argsstring"/>
|
||||
</synopsis>
|
||||
<xsl:apply-templates select="detaileddescription" />
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!-- classes -->
|
||||
<xsl:template match="compounddef" >
|
||||
<section id="{$which}-{@id}">
|
||||
<title>
|
||||
<xsl:value-of select="compoundname" />
|
||||
<xsl:if test="normalize-space(briefdescription) != ''">
|
||||
- <xsl:apply-templates select="briefdescription" />
|
||||
</xsl:if>
|
||||
</title>
|
||||
<xsl:choose>
|
||||
<xsl:when test="normalize-space(detaileddescription) != ''">
|
||||
<xsl:apply-templates select="detaileddescription" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<para />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:if test="sectiondef/memberdef[@kind='function' and @static='no']">
|
||||
<variablelist>
|
||||
<xsl:apply-templates select="sectiondef/memberdef" />
|
||||
</variablelist>
|
||||
</xsl:if>
|
||||
</section>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,64 @@
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:param name="basedir"/>
|
||||
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
|
||||
<!-- -->
|
||||
<!-- Template for the root so we can add a DOCTYPE -->
|
||||
<xsl:template match="/">
|
||||
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
]]></xsl:text>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:template>
|
||||
<!-- -->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
<!-- -->
|
||||
<!-- suppress existing image map areas -->
|
||||
<xsl:template match="area"/>
|
||||
<!-- -->
|
||||
<xsl:template match="areaspec[area][name(..)='imageobjectco']">
|
||||
<xsl:element name="areaspec">
|
||||
<xsl:apply-templates select="@*"/>
|
||||
<xsl:text>
</xsl:text>
|
||||
<xsl:variable name="pngfile" select="../imageobject/imagedata/@fileref"/>
|
||||
<xsl:variable name="mapfile" select="concat(substring($pngfile, 1, string-length($pngfile)-3), 'map')"/>
|
||||
<xsl:variable name="maproot" select="document(concat($basedir, '/', $mapfile))"/>
|
||||
<!-- -->
|
||||
<!-- now emit the needed areas -->
|
||||
<xsl:for-each select="area">
|
||||
<xsl:variable name="anchor" select="."/>
|
||||
<xsl:variable name="other" select="($maproot)//area[@href=($anchor)/@x_steal]"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$other">
|
||||
<xsl:text>	 </xsl:text>
|
||||
<xsl:element name="area">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="linkends">
|
||||
<xsl:value-of select="@linkends"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="coords">
|
||||
<xsl:value-of select="($other)/@coords"/>
|
||||
</xsl:attribute>
|
||||
</xsl:element>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>	 </xsl:text>
|
||||
<xsl:comment>
|
||||
<xsl:value-of select="concat('Warning: unable to locate area tagged ', ($anchor)/@x_steal)"/>
|
||||
</xsl:comment>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text>
</xsl:text>
|
||||
</xsl:for-each>
|
||||
<!-- -->
|
||||
<xsl:text>	 </xsl:text>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
@@ -0,0 +1,31 @@
|
||||
merge_mapcoords_xsl = files('merge-mapcoords.xsl')
|
||||
|
||||
subdir('sources')
|
||||
|
||||
custom_target(
|
||||
'Wayland-docbook-html',
|
||||
command: [
|
||||
xmlto,
|
||||
'--skip-validation',
|
||||
'--stringparam', 'chunk.section.depth=0',
|
||||
'--stringparam', 'toc.section.depth=1',
|
||||
'--stringparam', 'generate.consistent.ids=1',
|
||||
'--stringparam', 'html.stylesheet=css/default.css',
|
||||
'-o', '@OUTPUT@',
|
||||
'html',
|
||||
'@INPUT@'
|
||||
],
|
||||
input: publican_processed_main,
|
||||
output: publican_html_dir,
|
||||
depend_files: publican_copied_sources,
|
||||
depends: [
|
||||
publican_processed_targets,
|
||||
ClientAPI_xml,
|
||||
ServerAPI_xml,
|
||||
ProtocolSpec_xml,
|
||||
ProtocolInterfaces_xml
|
||||
],
|
||||
build_by_default: true,
|
||||
install: true,
|
||||
install_dir: publican_install_prefix
|
||||
)
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" ?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<!-- insert docbook's DOCTYPE blurb -->
|
||||
<xsl:text disable-output-escaping = "yes"><![CDATA[
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
]]></xsl:text>
|
||||
|
||||
<section id="sect-Protocol-Interfaces">
|
||||
<title>Interfaces</title>
|
||||
<para>
|
||||
The protocol includes several interfaces which are used for
|
||||
interacting with the server. Each interface provides requests,
|
||||
events, and errors (which are really just special events) as described
|
||||
above. Specific compositor implementations may have their own
|
||||
interfaces provided as extensions, but there are several which are
|
||||
always expected to be present.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Core interfaces:
|
||||
<variablelist>
|
||||
<xsl:apply-templates select="protocol/interface" />
|
||||
</variablelist>
|
||||
</para>
|
||||
</section>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Interfaces summary -->
|
||||
<xsl:template match="interface" >
|
||||
<varlistentry>
|
||||
<term>
|
||||
<link linkend="protocol-spec-{@name}">
|
||||
<xsl:value-of select="@name" />
|
||||
</link>
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<xsl:value-of select="description/@summary" />
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
<!-- vim: set expandtab shiftwidth=2: -->
|
||||
@@ -0,0 +1,223 @@
|
||||
<?xml version="1.0" ?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<!-- insert docbook's DOCTYPE blurb -->
|
||||
<xsl:text disable-output-escaping = "yes"><![CDATA[
|
||||
<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
]]></xsl:text>
|
||||
|
||||
<appendix id="appe-Wayland-Protocol">
|
||||
<title>Wayland Protocol Specification</title>
|
||||
<xsl:apply-templates select="protocol/copyright" />
|
||||
|
||||
<xsl:apply-templates select="protocol/interface" />
|
||||
</appendix>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Break text blocks separated by two new lines into paragraphs -->
|
||||
<xsl:template name="break">
|
||||
<xsl:param name="text" />
|
||||
<xsl:param name="linebreak" select="' '" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($text,$linebreak)">
|
||||
<para>
|
||||
<xsl:value-of select="substring-before($text,$linebreak)" />
|
||||
</para>
|
||||
<xsl:call-template name="break">
|
||||
<xsl:with-param name="text" select="substring-after($text,$linebreak)" />
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<para><xsl:value-of select="$text" /></para>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Copyright blurb -->
|
||||
<xsl:template match="copyright">
|
||||
<para>
|
||||
<literallayout>
|
||||
<xsl:value-of select="." disable-output-escaping="yes"/>
|
||||
</literallayout>
|
||||
</para>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Interface descriptions -->
|
||||
<xsl:template match="interface" >
|
||||
<section id="protocol-spec-{@name}">
|
||||
<title>
|
||||
<xsl:value-of select="@name" />
|
||||
<!-- only show summary if it exists -->
|
||||
<xsl:if test="description/@summary">
|
||||
- <xsl:value-of select="description/@summary" />
|
||||
</xsl:if>
|
||||
</title>
|
||||
<xsl:call-template name="break">
|
||||
<xsl:with-param name="text" select="description" />
|
||||
</xsl:call-template>
|
||||
<xsl:if test="request">
|
||||
<section>
|
||||
<title>Requests provided by <xsl:value-of select="@name" /></title>
|
||||
<xsl:apply-templates select="request" />
|
||||
</section>
|
||||
</xsl:if>
|
||||
<xsl:if test="event">
|
||||
<section>
|
||||
<title>Events provided by <xsl:value-of select="@name" /></title>
|
||||
<xsl:apply-templates select="event" />
|
||||
</section>
|
||||
</xsl:if>
|
||||
<xsl:if test="enum">
|
||||
<section>
|
||||
<title>Enums provided by <xsl:value-of select="@name" /></title>
|
||||
<xsl:apply-templates select="enum" />
|
||||
</section>
|
||||
</xsl:if>
|
||||
</section>
|
||||
</xsl:template>
|
||||
|
||||
<!-- table contents for enum values -->
|
||||
<xsl:template match="entry">
|
||||
<varlistentry>
|
||||
<term><xsl:value-of select="@name"/></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<xsl:value-of select="@value"/>
|
||||
<xsl:if test="@summary" >
|
||||
- <xsl:value-of select="@summary"/>
|
||||
</xsl:if>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:template>
|
||||
|
||||
<!-- table contents for request/event arguments -->
|
||||
<xsl:template match="arg">
|
||||
<varlistentry>
|
||||
<term><xsl:value-of select="@name"/></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<xsl:value-of select="@type"/>
|
||||
<xsl:if test="@summary" >
|
||||
- <xsl:value-of select="@summary"/>
|
||||
</xsl:if>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:template>
|
||||
|
||||
<!-- id arguments -->
|
||||
<xsl:template match="arg[@type='object' and @interface]">
|
||||
<varlistentry>
|
||||
<term><xsl:value-of select="@name"/></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<link linkend="protocol-spec-{@interface}">
|
||||
<xsl:value-of select="@interface"/>
|
||||
</link>
|
||||
<xsl:if test="@summary" >
|
||||
- <xsl:value-of select="@summary"/>
|
||||
</xsl:if>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:template>
|
||||
|
||||
<!-- new_id arguments -->
|
||||
<xsl:template match="arg[@type='new_id' and @interface]">
|
||||
<varlistentry>
|
||||
<term><xsl:value-of select="@name"/></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
id for the new
|
||||
<link linkend="protocol-spec-{@interface}">
|
||||
<xsl:value-of select="@interface"/>
|
||||
</link>
|
||||
<xsl:if test="@summary" >
|
||||
- <xsl:value-of select="@summary"/>
|
||||
</xsl:if>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:template>
|
||||
|
||||
<!-- enum and bitfield arguments -->
|
||||
<xsl:template match="arg[@enum]">
|
||||
<varlistentry>
|
||||
<term><xsl:value-of select="@name"/></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(@enum, '.')">
|
||||
<link linkend="protocol-spec-{substring-before(@enum, '.')}-enum-{substring-after(@enum, '.')}">
|
||||
<xsl:value-of select="substring-before(@enum, '.')"/>
|
||||
<xsl:text>::</xsl:text>
|
||||
<xsl:value-of select="substring-after(@enum, '.')"/>
|
||||
</link>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<link linkend="protocol-spec-{../../@name}-enum-{@enum}">
|
||||
<xsl:value-of select="../../@name"/>
|
||||
<xsl:text>::</xsl:text>
|
||||
<xsl:value-of select="@enum"/>
|
||||
</link>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
(<xsl:value-of select="@type"/>)
|
||||
<xsl:if test="@summary" >
|
||||
- <xsl:value-of select="@summary"/>
|
||||
</xsl:if>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Request/event list -->
|
||||
<xsl:template match="request|event">
|
||||
<section id="protocol-spec-{../@name}-{name()}-{@name}">
|
||||
<title>
|
||||
<xsl:value-of select="../@name"/>::<xsl:value-of select="@name" />
|
||||
<xsl:if test="description/@summary">
|
||||
- <xsl:value-of select="description/@summary" />
|
||||
</xsl:if>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<xsl:apply-templates select="arg"/>
|
||||
</variablelist>
|
||||
</para>
|
||||
<xsl:call-template name="break">
|
||||
<xsl:with-param name="text" select="description" />
|
||||
</xsl:call-template>
|
||||
</section>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Enumeration -->
|
||||
<xsl:template match="enum">
|
||||
<section id="protocol-spec-{../@name}-enum-{@name}">
|
||||
<title>
|
||||
<xsl:value-of select="../@name"/>::<xsl:value-of select="@name" />
|
||||
<xsl:if test="@bitfield">
|
||||
- bitfield
|
||||
</xsl:if>
|
||||
<xsl:if test="description/@summary">
|
||||
- <xsl:value-of select="description/@summary" />
|
||||
</xsl:if>
|
||||
</title>
|
||||
<xsl:call-template name="break">
|
||||
<xsl:with-param name="text" select="description" />
|
||||
</xsl:call-template>
|
||||
<variablelist>
|
||||
<xsl:apply-templates select="entry"/>
|
||||
</variablelist>
|
||||
</section>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
<!-- vim: set expandtab shiftwidth=2: -->
|
||||
@@ -0,0 +1,344 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<chapter id="chap-Wayland-Architecture">
|
||||
<title>Wayland Architecture</title>
|
||||
<section id="sect-Wayland-Architecture-wayland_architecture">
|
||||
<title>X vs. Wayland Architecture</title>
|
||||
<para>
|
||||
A good way to understand the Wayland architecture
|
||||
and how it is different from X is to follow an event
|
||||
from the input device to the point where the change
|
||||
it affects appears on screen.
|
||||
</para>
|
||||
<para>
|
||||
This is where we are now with X:
|
||||
</para>
|
||||
<figure>
|
||||
<title>X architecture diagram</title>
|
||||
<mediaobjectco>
|
||||
<imageobjectco>
|
||||
<areaspec id="map1" units="other" otherunits="imagemap">
|
||||
<area id="area1_1" linkends="x_flow_1" x_steal="#step_1"/>
|
||||
<area id="area1_2" linkends="x_flow_2" x_steal="#step_2"/>
|
||||
<area id="area1_3" linkends="x_flow_3" x_steal="#step_3"/>
|
||||
<area id="area1_4" linkends="x_flow_4" x_steal="#step_4"/>
|
||||
<area id="area1_5" linkends="x_flow_5" x_steal="#step_5"/>
|
||||
<area id="area1_6" linkends="x_flow_6" x_steal="#step_6"/>
|
||||
</areaspec>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/x-architecture.png" format="PNG" />
|
||||
</imageobject>
|
||||
</imageobjectco>
|
||||
</mediaobjectco>
|
||||
</figure>
|
||||
<para>
|
||||
<orderedlist>
|
||||
<listitem id="x_flow_1">
|
||||
<para>
|
||||
The kernel gets an event from an input
|
||||
device and sends it to X through the evdev
|
||||
input driver. The kernel does all the hard
|
||||
work here by driving the device and
|
||||
translating the different device specific
|
||||
event protocols to the linux evdev input
|
||||
event standard.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem id="x_flow_2">
|
||||
<para>
|
||||
The X server determines which window the
|
||||
event affects and sends it to the clients
|
||||
that have selected for the event in question
|
||||
on that window. The X server doesn't
|
||||
actually know how to do this right, since
|
||||
the window location on screen is controlled
|
||||
by the compositor and may be transformed in
|
||||
a number of ways that the X server doesn't
|
||||
understand (scaled down, rotated, wobbling,
|
||||
etc).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem id="x_flow_3">
|
||||
<para>
|
||||
The client looks at the event and decides
|
||||
what to do. Often the UI will have to change
|
||||
in response to the event - perhaps a check
|
||||
box was clicked or the pointer entered a
|
||||
button that must be highlighted. Thus the
|
||||
client sends a rendering request back to the
|
||||
X server.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem id="x_flow_4">
|
||||
<para>
|
||||
When the X server receives the rendering
|
||||
request, it sends it to the driver to let it
|
||||
program the hardware to do the rendering.
|
||||
The X server also calculates the bounding
|
||||
region of the rendering, and sends that to
|
||||
the compositor as a damage event.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem id="x_flow_5">
|
||||
<para>
|
||||
The damage event tells the compositor that
|
||||
something changed in the window and that it
|
||||
has to recomposite the part of the screen
|
||||
where that window is visible. The compositor
|
||||
is responsible for rendering the entire
|
||||
screen contents based on its scenegraph and
|
||||
the contents of the X windows. Yet, it has
|
||||
to go through the X server to render this.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem id="x_flow_6">
|
||||
<para>
|
||||
The X server receives the rendering requests
|
||||
from the compositor and either copies the
|
||||
compositor back buffer to the front buffer
|
||||
or does a pageflip. In the general case, the
|
||||
X server has to do this step so it can
|
||||
account for overlapping windows, which may
|
||||
require clipping and determine whether or
|
||||
not it can page flip. However, for a
|
||||
compositor, which is always fullscreen, this
|
||||
is another unnecessary context switch.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
<para>
|
||||
As suggested above, there are a few problems with this
|
||||
approach. The X server doesn't have the information to
|
||||
decide which window should receive the event, nor can it
|
||||
transform the screen coordinates to window-local
|
||||
coordinates. And even though X has handed responsibility for
|
||||
the final painting of the screen to the compositing manager,
|
||||
X still controls the front buffer and modesetting. Most of
|
||||
the complexity that the X server used to handle is now
|
||||
available in the kernel or self contained libraries (KMS,
|
||||
evdev, mesa, fontconfig, freetype, cairo, Qt etc). In
|
||||
general, the X server is now just a middle man that
|
||||
introduces an extra step between applications and the
|
||||
compositor and an extra step between the compositor and the
|
||||
hardware.
|
||||
</para>
|
||||
<para>
|
||||
In Wayland the compositor is the display server. We transfer
|
||||
the control of KMS and evdev to the compositor. The Wayland
|
||||
protocol lets the compositor send the input events directly
|
||||
to the clients and lets the client send the damage event
|
||||
directly to the compositor:
|
||||
</para>
|
||||
<figure>
|
||||
<title>Wayland architecture diagram</title>
|
||||
<mediaobjectco>
|
||||
<imageobjectco>
|
||||
<areaspec id="mapB" units="other" otherunits="imagemap">
|
||||
<area id="areaB_1" linkends="wayland_flow_1" x_steal="#step_1"/>
|
||||
<area id="areaB_2" linkends="wayland_flow_2" x_steal="#step_2"/>
|
||||
<area id="areaB_3" linkends="wayland_flow_3" x_steal="#step_3"/>
|
||||
<area id="areaB_4" linkends="wayland_flow_4" x_steal="#step_4"/>
|
||||
</areaspec>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/wayland-architecture.png" format="PNG" />
|
||||
</imageobject>
|
||||
</imageobjectco>
|
||||
</mediaobjectco>
|
||||
</figure>
|
||||
<para>
|
||||
<orderedlist>
|
||||
<listitem id="wayland_flow_1">
|
||||
<para>
|
||||
The kernel gets an event and sends
|
||||
it to the compositor. This
|
||||
is similar to the X case, which is
|
||||
great, since we get to reuse all the
|
||||
input drivers in the kernel.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem id="wayland_flow_2">
|
||||
<para>
|
||||
The compositor looks through its
|
||||
scenegraph to determine which window
|
||||
should receive the event. The
|
||||
scenegraph corresponds to what's on
|
||||
screen and the compositor
|
||||
understands the transformations that
|
||||
it may have applied to the elements
|
||||
in the scenegraph. Thus, the
|
||||
compositor can pick the right window
|
||||
and transform the screen coordinates
|
||||
to window-local coordinates, by
|
||||
applying the inverse
|
||||
transformations. The types of
|
||||
transformation that can be applied
|
||||
to a window is only restricted to
|
||||
what the compositor can do, as long
|
||||
as it can compute the inverse
|
||||
transformation for the input events.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem id="wayland_flow_3">
|
||||
<para>
|
||||
As in the X case, when the client
|
||||
receives the event, it updates the
|
||||
UI in response. But in the Wayland
|
||||
case, the rendering happens in the
|
||||
client, and the client just sends a
|
||||
request to the compositor to
|
||||
indicate the region that was
|
||||
updated.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem id="wayland_flow_4">
|
||||
<para>
|
||||
The compositor collects damage
|
||||
requests from its clients and then
|
||||
recomposites the screen. The
|
||||
compositor can then directly issue
|
||||
an ioctl to schedule a pageflip with
|
||||
KMS.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
</orderedlist>
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Wayland-Architecture-wayland_rendering">
|
||||
<title>Wayland Rendering</title>
|
||||
<para>
|
||||
One of the details I left out in the above overview
|
||||
is how clients actually render under Wayland. By
|
||||
removing the X server from the picture we also
|
||||
removed the mechanism by which X clients typically
|
||||
render. But there's another mechanism that we're
|
||||
already using with DRI2 under X: direct rendering.
|
||||
With direct rendering, the client and the server
|
||||
share a video memory buffer. The client links to a
|
||||
rendering library such as OpenGL that knows how to
|
||||
program the hardware and renders directly into the
|
||||
buffer. The compositor in turn can take the buffer
|
||||
and use it as a texture when it composites the
|
||||
desktop. After the initial setup, the client only
|
||||
needs to tell the compositor which buffer to use and
|
||||
when and where it has rendered new content into it.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
This leaves an application with two ways to update its window contents:
|
||||
</para>
|
||||
<para>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
Render the new content into a new buffer and tell the compositor
|
||||
to use that instead of the old buffer. The application can
|
||||
allocate a new buffer every time it needs to update the window
|
||||
contents or it can keep two (or more) buffers around and cycle
|
||||
between them. The buffer management is entirely under
|
||||
application control.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Render the new content into the buffer that it previously
|
||||
told the compositor to to use. While it's possible to just
|
||||
render directly into the buffer shared with the compositor,
|
||||
this might race with the compositor. What can happen is that
|
||||
repainting the window contents could be interrupted by the
|
||||
compositor repainting the desktop. If the application gets
|
||||
interrupted just after clearing the window but before
|
||||
rendering the contents, the compositor will texture from a
|
||||
blank buffer. The result is that the application window will
|
||||
flicker between a blank window or half-rendered content. The
|
||||
traditional way to avoid this is to render the new content
|
||||
into a back buffer and then copy from there into the
|
||||
compositor surface. The back buffer can be allocated on the
|
||||
fly and just big enough to hold the new content, or the
|
||||
application can keep a buffer around. Again, this is under
|
||||
application control.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</para>
|
||||
<para>
|
||||
In either case, the application must tell the compositor
|
||||
which area of the surface holds new contents. When the
|
||||
application renders directly to the shared buffer, the
|
||||
compositor needs to be noticed that there is new content.
|
||||
But also when exchanging buffers, the compositor doesn't
|
||||
assume anything changed, and needs a request from the
|
||||
application before it will repaint the desktop. The idea
|
||||
that even if an application passes a new buffer to the
|
||||
compositor, only a small part of the buffer may be
|
||||
different, like a blinking cursor or a spinner.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Wayland-Architecture-wayland_hw_enabling">
|
||||
<title>Hardware Enabling for Wayland</title>
|
||||
<para>
|
||||
Typically, hardware enabling includes modesetting/display
|
||||
and EGL/GLES2. On top of that Wayland needs a way to share
|
||||
buffers efficiently between processes. There are two sides
|
||||
to that, the client side and the server side.
|
||||
</para>
|
||||
<para>
|
||||
On the client side we've defined a Wayland EGL platform. In
|
||||
the EGL model, that consists of the native types
|
||||
(EGLNativeDisplayType, EGLNativeWindowType and
|
||||
EGLNativePixmapType) and a way to create those types. In
|
||||
other words, it's the glue code that binds the EGL stack and
|
||||
its buffer sharing mechanism to the generic Wayland API. The
|
||||
EGL stack is expected to provide an implementation of the
|
||||
Wayland EGL platform. The full API is in the wayland-egl.h
|
||||
header. The open source implementation in the mesa EGL stack
|
||||
is in wayland-egl.c and platform_wayland.c.
|
||||
</para>
|
||||
<para>
|
||||
Under the hood, the EGL stack is expected to define a
|
||||
vendor-specific protocol extension that lets the client side
|
||||
EGL stack communicate buffer details with the compositor in
|
||||
order to share buffers. The point of the wayland-egl.h API
|
||||
is to abstract that away and just let the client create an
|
||||
EGLSurface for a Wayland surface and start rendering. The
|
||||
open source stack uses the drm Wayland extension, which lets
|
||||
the client discover the drm device to use and authenticate
|
||||
and then share drm (GEM) buffers with the compositor.
|
||||
</para>
|
||||
<para>
|
||||
The server side of Wayland is the compositor and core UX for
|
||||
the vertical, typically integrating task switcher, app
|
||||
launcher, lock screen in one monolithic application. The
|
||||
server runs on top of a modesetting API (kernel modesetting,
|
||||
OpenWF Display or similar) and composites the final UI using
|
||||
a mix of EGL/GLES2 compositor and hardware overlays if
|
||||
available. Enabling modesetting, EGL/GLES2 and overlays is
|
||||
something that should be part of standard hardware bringup.
|
||||
The extra requirement for Wayland enabling is the
|
||||
EGL_WL_bind_wayland_display extension that lets the
|
||||
compositor create an EGLImage from a generic Wayland shared
|
||||
buffer. It's similar to the EGL_KHR_image_pixmap extension
|
||||
to create an EGLImage from an X pixmap.
|
||||
</para>
|
||||
<para>
|
||||
The extension has a setup step where you have to bind the
|
||||
EGL display to a Wayland display. Then as the compositor
|
||||
receives generic Wayland buffers from the clients (typically
|
||||
when the client calls eglSwapBuffers), it will be able to
|
||||
pass the struct wl_buffer pointer to eglCreateImageKHR as
|
||||
the EGLClientBuffer argument and with EGL_WAYLAND_BUFFER_WL
|
||||
as the target. This will create an EGLImage, which can then
|
||||
be used by the compositor as a texture or passed to the
|
||||
modesetting code to use as an overlay plane. Again, this is
|
||||
implemented by the vendor specific protocol extension, which
|
||||
on the server side will receive the driver specific details
|
||||
about the shared buffer and turn that into an EGL image when
|
||||
the user calls eglCreateImageKHR.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname>Kristian</firstname>
|
||||
<surname>Høgsberg</surname>
|
||||
<affiliation>
|
||||
<orgname>Intel Corporation</orgname>
|
||||
</affiliation>
|
||||
<email>krh@bitplanet.net</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<bookinfo id="book-Wayland-Wayland">
|
||||
<title>Wayland</title>
|
||||
<subtitle>The Wayland Protocol</subtitle>
|
||||
<productname>Documentation</productname>
|
||||
<productnumber>0.1</productnumber>
|
||||
<edition>1</edition>
|
||||
<pubsnumber>0</pubsnumber>
|
||||
<abstract>
|
||||
<para>
|
||||
Wayland is a protocol for a compositor to talk to
|
||||
its clients as well as a C library implementation of
|
||||
that protocol. The compositor can be a standalone
|
||||
display server running on Linux kernel modesetting
|
||||
and evdev input devices, an X application, or a
|
||||
Wayland client itself. The clients can be
|
||||
traditional applications, X servers (rootless or
|
||||
fullscreen) or other display servers.
|
||||
</para>
|
||||
</abstract>
|
||||
<corpauthor>
|
||||
<inlinemediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/wayland.png" format="PNG" />
|
||||
</imageobject>
|
||||
<textobject>
|
||||
<phrase>
|
||||
Wayland logo
|
||||
</phrase>
|
||||
</textobject>
|
||||
</inlinemediaobject>
|
||||
</corpauthor>
|
||||
|
||||
<legalnotice lang="en-US">
|
||||
<para>
|
||||
Copyright <trademark class="copyright"></trademark> &YEAR; &HOLDER;
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
</para>
|
||||
</legalnotice>
|
||||
|
||||
|
||||
<xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
</bookinfo>
|
||||
@@ -0,0 +1,92 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
<!ENTITY doxygen SYSTEM "ClientAPI.xml">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<appendix id="sect-Library-Client">
|
||||
<title>Client API</title>
|
||||
<section><title>Introduction</title>
|
||||
<para>
|
||||
The open-source reference implementation of Wayland protocol is
|
||||
split in two C libraries, libwayland-client and <link
|
||||
linkend="sect-Library-Server">libwayland-server</link>. Their main
|
||||
responsibility is to handle the Inter-process communication
|
||||
(<emphasis>IPC</emphasis>) with each other, therefore guaranteeing
|
||||
the protocol objects marshaling and messages synchronization.
|
||||
</para>
|
||||
<para>
|
||||
A client uses libwayland-client to communicate with one or more
|
||||
wayland servers. A <link
|
||||
linkend="Client-classwl__display">wl_display</link> object is
|
||||
created and manages each open connection to a server. At least one
|
||||
<link linkend="Client-classwl__event__queue">wl_event_queue</link>
|
||||
object is created for each wl_display, this holds events as they
|
||||
are received from the server until they can be
|
||||
processed. Multi-threading is supported by creating an additional
|
||||
wl_event_queue for each additional thread, each object can have
|
||||
it's events placed in a particular queue, so potentially a
|
||||
different thread could be made to handle the events for each
|
||||
object created.
|
||||
</para>
|
||||
<para>
|
||||
Though some convenience functions are provided, libwayland-client
|
||||
is designed to allow the calling code to wait for events, so that
|
||||
different polling mechanisms can be used. A file descriptor is
|
||||
provided, when it becomes ready for reading the calling code can
|
||||
ask libwayland-client to read the available events from it into
|
||||
the wl_event_queue objects.
|
||||
</para>
|
||||
<para>
|
||||
The library only provides low-level access to the wayland objects.
|
||||
Each object created by the client is represented by a <link
|
||||
linkend="Client-classwl__proxy">wl_proxy</link> object that this
|
||||
library creates. This includes the id that is actually
|
||||
communicated over the socket to the server, a void* data pointer
|
||||
that is intended to point at a client's representation of the
|
||||
object, and a pointer to a static <link
|
||||
linkend="Client-structwl__interface">wl_interface</link> object,
|
||||
which is generated from the xml and identifies the object's class
|
||||
and can be used for introspection into the messages and events.
|
||||
</para>
|
||||
<para>
|
||||
Messages are sent by calling wl_proxy_marshal. This will write a
|
||||
message to the socket, by using the message id and the
|
||||
wl_interface to identify the types of each argument and convert
|
||||
them into stream format. Most software will call type-safe
|
||||
wrappers generated from the xml description of the <link
|
||||
linkend="appe-Wayland-Protocol">Wayland protocols</link>. For
|
||||
instance the C header file generated from the xml defines the
|
||||
following inline function to transmit the <link
|
||||
linkend="protocol-spec-wl_surface-request-attach">wl_surface::attach</link>
|
||||
message:
|
||||
</para>
|
||||
<programlisting>static inline void
|
||||
wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y)
|
||||
{
|
||||
wl_proxy_marshal((struct wl_proxy *) wl_surface, WL_SURFACE_ATTACH, buffer, x, y);
|
||||
}</programlisting>
|
||||
<para>
|
||||
Events (messages from the server) are handled by calling a
|
||||
"dispatcher" callback the client stores in the wl_proxy for each
|
||||
event. A language binding for a string-based interpreter, such as
|
||||
CPython, might have a dispatcher that uses the event name from the
|
||||
wl_interface to identify the function to call. The default
|
||||
dispatcher uses the message id number to index an array of
|
||||
functions pointers, called a wl_listener, and the wl_interface to
|
||||
convert data from the stream into arguments to the function. The
|
||||
C header file generated from the xml defines a per-class structure
|
||||
that forces the function pointers to be of the correct type, for
|
||||
instance the <link
|
||||
linkend="protocol-spec-wl_surface-event-enter">wl_surface::enter</link>
|
||||
event defines this pointer in the wl_surface_listener object:
|
||||
</para>
|
||||
<programlisting>struct wl_surface_listener {
|
||||
void (*enter)(void *data, struct wl_surface *, struct wl_output *);
|
||||
...
|
||||
}</programlisting>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
&doxygen;
|
||||
</appendix>
|
||||
@@ -0,0 +1,128 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<chapter id="chap-Compositors">
|
||||
<title>Types of Compositors</title>
|
||||
|
||||
<para>
|
||||
Compositors come in different types, depending on which
|
||||
role they play in the overall architecture of the OS.
|
||||
For instance, a
|
||||
<link linkend="sect-Compositors-System-Compositor">system compositor</link>
|
||||
can be used for booting the system, handling multiple user switching, a
|
||||
possible console terminal emulator and so forth. A different compositor, a
|
||||
<link linkend="sect-Compositors-Session-Compositor">session compositor</link>
|
||||
would provide the actual desktop environment. There are many ways for
|
||||
different types of compositors to co-exist.
|
||||
</para>
|
||||
<para>
|
||||
In this section, we introduce three types of Wayland compositors relying
|
||||
on <link linkend="sect-Library-Server">libwayland-server</link>.
|
||||
</para>
|
||||
|
||||
<section id="sect-Compositors-System-Compositor">
|
||||
<title>System Compositor</title>
|
||||
<para>
|
||||
A system compositor can run from early boot until shutdown.
|
||||
It effectively replaces the kernel vt system, and can tie in
|
||||
with the systems graphical boot setup and multiseat support.
|
||||
</para>
|
||||
<para>
|
||||
A system compositor can host different types of session
|
||||
compositors, and let us switch between multiple sessions
|
||||
(fast user switching, or secure/personal desktop switching).
|
||||
</para>
|
||||
<para>
|
||||
A linux implementation of a system compositor will typically
|
||||
use libudev, egl, kms, evdev and cairo.
|
||||
</para>
|
||||
<para>
|
||||
For fullscreen clients, the system compositor can reprogram the
|
||||
video scanout address to read directly from the client provided
|
||||
buffer.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Compositors-Session-Compositor">
|
||||
<title>Session Compositor</title>
|
||||
<para>
|
||||
A session compositor is responsible for a single user session.
|
||||
If a system compositor is present, the session compositor will
|
||||
run nested under the system compositor. Nesting is feasible because
|
||||
the protocol is asynchronous; roundtrips would be too expensive
|
||||
when nesting is involved. If no system compositor is present, a
|
||||
session compositor can run directly on the hardware.
|
||||
</para>
|
||||
<para>
|
||||
X applications can continue working under a session compositor
|
||||
by means of a root-less X server that is activated on demand.
|
||||
</para>
|
||||
<para>
|
||||
Possible examples for session compositors include
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
gnome-shell
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
moblin
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
kwin
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
kmscon
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
rdp session
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Weston with X11 or Wayland backend is a session compositor nested
|
||||
in another session compositor.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
fullscreen X session under Wayland
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Compositors-Embedding-Compositor">
|
||||
<title>Embedding Compositor</title>
|
||||
<para>
|
||||
X11 lets clients embed windows from other clients, or lets clients
|
||||
copy pixmap contents rendered by another client into their window.
|
||||
This is often used for applets in a panel, browser plugins and similar.
|
||||
Wayland doesn't directly allow this, but clients can communicate GEM
|
||||
buffer names out-of-band, for example, using D-Bus, or command line
|
||||
arguments when the panel launches the applet. Another option is to
|
||||
use a nested Wayland instance. For this, the Wayland server will have
|
||||
to be a library that the host application links to. The host
|
||||
application will then pass the Wayland server socket name to the
|
||||
embedded application, and will need to implement the Wayland
|
||||
compositor interface. The host application composites the client
|
||||
surfaces as part of it's window, that is, in the web page or in the
|
||||
panel. The benefit of nesting the Wayland server is that it provides
|
||||
the requests the embedded client needs to inform the host about buffer
|
||||
updates and a mechanism for forwarding input events from the host
|
||||
application.
|
||||
</para>
|
||||
<para>
|
||||
An example for this kind of setup is firefox embedding the flash
|
||||
player as a kind of special-purpose compositor.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
|
||||
<preface>
|
||||
<title>Preface</title>
|
||||
|
||||
<para>
|
||||
This document describes the (i) Wayland architecture, (ii) Wayland model of
|
||||
operation and (iii) its library API. Also, the Wayland protocol specification is shown
|
||||
in the Appendix. This document is aimed primarily at Wayland developers and
|
||||
those looking to program with it; it does not cover application development.
|
||||
</para>
|
||||
<para>
|
||||
There have been many contributors to this document and since this is only the
|
||||
first edition many errors are expected to be found. We appreciate
|
||||
corrections.
|
||||
</para>
|
||||
<literallayout>
|
||||
Yours,
|
||||
|
||||
the Wayland open-source community
|
||||
November 2012
|
||||
</literallayout>
|
||||
</preface>
|
||||
@@ -0,0 +1,116 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<chapter id="chap-Introduction">
|
||||
<title>Introduction</title>
|
||||
<section id="sect-Motivation">
|
||||
<title>Motivation</title>
|
||||
<para>
|
||||
Most Linux and Unix-based systems rely on the X Window System (or
|
||||
simply <emphasis>X</emphasis>) as the low-level protocol for building
|
||||
bitmap graphics interfaces. On these systems, the X stack has grown to
|
||||
encompass functionality arguably belonging in client libraries,
|
||||
helper libraries, or the host operating system kernel. Support for
|
||||
things like PCI resource management, display configuration management,
|
||||
direct rendering, and memory management has been integrated into the X
|
||||
stack, imposing limitations like limited support for standalone
|
||||
applications, duplication in other projects (e.g. the Linux fb layer
|
||||
or the DirectFB project), and high levels of complexity for systems
|
||||
combining multiple elements (for example radeon memory map handling
|
||||
between the fb driver and X driver, or VT switching).
|
||||
</para>
|
||||
<para>
|
||||
Moreover, X has grown to incorporate modern features like offscreen
|
||||
rendering and scene composition, but subject to the limitations of the
|
||||
X architecture. For example, the X implementation of composition adds
|
||||
additional context switches and makes things like input redirection
|
||||
difficult.
|
||||
</para>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/x-architecture.png" format="PNG" />
|
||||
</imageobject>
|
||||
<textobject>
|
||||
<phrase>
|
||||
X architecture diagram
|
||||
</phrase>
|
||||
</textobject>
|
||||
</mediaobject>
|
||||
<para>
|
||||
The diagram above illustrates the central role of the X server and
|
||||
compositor in operations, and the steps required to get contents on to
|
||||
the screen.
|
||||
</para>
|
||||
<para>
|
||||
Over time, X developers came to understand the shortcomings of this
|
||||
approach and worked to split things up. Over the past several years,
|
||||
a lot of functionality has moved out of the X server and into
|
||||
client-side libraries or kernel drivers. One of the first components
|
||||
to move out was font rendering, with freetype and fontconfig providing
|
||||
an alternative to the core X fonts. Direct rendering OpenGL as a
|
||||
graphics driver in a client side library went through some iterations,
|
||||
ending up as DRI2, which abstracted most of the direct rendering
|
||||
buffer management from client code. Then cairo came along and provided
|
||||
a modern 2D rendering library independent of X, and compositing
|
||||
managers took over control of the rendering of the desktop as toolkits
|
||||
like GTK+ and Qt moved away from using X APIs for rendering. Recently,
|
||||
memory and display management have moved to the Linux kernel, further
|
||||
reducing the scope of X and its driver stack. The end result is a
|
||||
highly modular graphics stack.
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
<section id="sect-Compositing-manager-display-server">
|
||||
<title>The compositing manager as the display server</title>
|
||||
<para>
|
||||
Wayland is a new display server and compositing protocol, and Weston
|
||||
is the implementation of this protocol which builds on top of all the
|
||||
components above. We are trying to distill out the functionality in
|
||||
the X server that is still used by the modern Linux desktop. This
|
||||
turns out to be not a whole lot. Applications can allocate their own
|
||||
off-screen buffers and render their window contents directly, using
|
||||
hardware accelerated libraries like libGL, or high quality software
|
||||
implementations like those found in Cairo. In the end, what’s needed
|
||||
is a way to present the resulting window surface for display, and a
|
||||
way to receive and arbitrate input among multiple clients. This is
|
||||
what Wayland provides, by piecing together the components already in
|
||||
the eco-system in a slightly different way.
|
||||
</para>
|
||||
<para>
|
||||
X will always be relevant, in the same way Fortran compilers and VRML
|
||||
browsers are, but it’s time that we think about moving it out of the
|
||||
critical path and provide it as an optional component for legacy
|
||||
applications.
|
||||
</para>
|
||||
<para>
|
||||
Overall, the philosophy of Wayland is to provide clients with a way to
|
||||
manage windows and how their contents is displayed. Rendering is left
|
||||
to clients, and system wide memory management interfaces are used to
|
||||
pass buffer handles between clients and the compositing manager.
|
||||
</para>
|
||||
<mediaobject>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/wayland-architecture.png" format="PNG" />
|
||||
</imageobject>
|
||||
<textobject>
|
||||
<phrase>
|
||||
Wayland architecture diagram
|
||||
</phrase>
|
||||
</textobject>
|
||||
</mediaobject>
|
||||
<para>
|
||||
The figure above illustrates how Wayland clients interact with a
|
||||
Wayland server. Note that window management and composition are
|
||||
handled entirely in the server, significantly reducing complexity
|
||||
while marginally improving performance through reduced context
|
||||
switching. The resulting system is easier to build and extend than a
|
||||
similar X system, because often changes need only be made in one
|
||||
place. Or in the case of protocol extensions, two (rather than 3 or 4
|
||||
in the X case where window management and/or composition handling may
|
||||
also need to be updated).
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
|
||||
<preface>
|
||||
<title>Acknowledgments</title>
|
||||
|
||||
<para>
|
||||
TODO: Kristian has to fill up this with one or two paragraphs and a small
|
||||
"thank you": http://en.wikipedia.org/wiki/Preface
|
||||
</para>
|
||||
<literallayout>
|
||||
Best,
|
||||
|
||||
Kristian Høgsberg
|
||||
</literallayout>
|
||||
</preface>
|
||||
@@ -0,0 +1,572 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<chapter id="chap-Protocol">
|
||||
<title>Wayland Protocol and Model of Operation</title>
|
||||
<section id="sect-Protocol-Basic-Principles">
|
||||
<title>Basic Principles</title>
|
||||
<para>
|
||||
The Wayland protocol is an asynchronous object oriented protocol. All
|
||||
requests are method invocations on some object. The requests include
|
||||
an object ID that uniquely identifies an object on the server. Each
|
||||
object implements an interface and the requests include an opcode that
|
||||
identifies which method in the interface to invoke.
|
||||
</para>
|
||||
<para>
|
||||
The protocol is message-based. A message sent by a client to the server
|
||||
is called request. A message from the server to a client is called event.
|
||||
A message has a number of arguments, each of which has a certain type (see
|
||||
<xref linkend="sect-Protocol-Wire-Format"/> for a list of argument types).
|
||||
</para>
|
||||
<para>
|
||||
Additionally, the protocol can specify <type>enum</type>s which associate
|
||||
names to specific numeric enumeration values. These are primarily just
|
||||
descriptive in nature: at the wire format level enums are just integers.
|
||||
But they also serve a secondary purpose to enhance type safety or
|
||||
otherwise add context for use in language bindings or other such code.
|
||||
This latter usage is only supported so long as code written before these
|
||||
attributes were introduced still works after; in other words, adding an
|
||||
enum should not break API, otherwise it puts backwards compatibility at
|
||||
risk.
|
||||
</para>
|
||||
<para>
|
||||
<type>enum</type>s can be defined as just a set of integers, or as
|
||||
bitfields. This is specified via the <type>bitfield</type> boolean
|
||||
attribute in the <type>enum</type> definition. If this attribute is true,
|
||||
the enum is intended to be accessed primarily using bitwise operations,
|
||||
for example when arbitrarily many choices of the enum can be ORed
|
||||
together; if it is false, or the attribute is omitted, then the enum
|
||||
arguments are a just a sequence of numerical values.
|
||||
</para>
|
||||
<para>
|
||||
The <type>enum</type> attribute can be used on either <type>uint</type>
|
||||
or <type>int</type> arguments, however if the <type>enum</type> is
|
||||
defined as a <type>bitfield</type>, it can only be used on
|
||||
<type>uint</type> args.
|
||||
</para>
|
||||
<para>
|
||||
The server sends back events to the client, each event is emitted from
|
||||
an object. Events can be error conditions. The event includes the
|
||||
object ID and the event opcode, from which the client can determine
|
||||
the type of event. Events are generated both in response to requests
|
||||
(in which case the request and the event constitutes a round trip) or
|
||||
spontaneously when the server state changes.
|
||||
</para>
|
||||
<para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
State is broadcast on connect, events are sent
|
||||
out when state changes. Clients must listen for
|
||||
these changes and cache the state.
|
||||
There is no need (or mechanism) to query server state.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The server will broadcast the presence of a number of global objects,
|
||||
which in turn will broadcast their current state.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-Code-Generation">
|
||||
<title>Code Generation</title>
|
||||
<para>
|
||||
The interfaces, requests and events are defined in
|
||||
<filename>protocol/wayland.xml</filename>.
|
||||
This xml is used to generate the function prototypes that can be used by
|
||||
clients and compositors.
|
||||
</para>
|
||||
<para>
|
||||
The protocol entry points are generated as inline functions which just
|
||||
wrap the <function>wl_proxy_*</function> functions. The inline functions aren't
|
||||
part of the library ABI and language bindings should generate their
|
||||
own stubs for the protocol entry points from the xml.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-Wire-Format">
|
||||
<title>Wire Format</title>
|
||||
<para>
|
||||
The protocol is sent over a UNIX domain stream socket, where the endpoint
|
||||
usually is named <systemitem class="service">wayland-0</systemitem>
|
||||
(although it can be changed via <emphasis>WAYLAND_DISPLAY</emphasis>
|
||||
in the environment). Beginning in Wayland 1.15, implementations can
|
||||
optionally support server socket endpoints located at arbitrary
|
||||
locations in the filesystem by setting <emphasis>WAYLAND_DISPLAY</emphasis>
|
||||
to the absolute path at which the server endpoint listens.
|
||||
</para>
|
||||
<para>
|
||||
Every message is structured as 32-bit words; values are represented in the
|
||||
host's byte-order. The message header has 2 words in it:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
The first word is the sender's object ID (32-bit).
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The second has 2 parts of 16-bit. The upper 16-bits are the message
|
||||
size in bytes, starting at the header (i.e. it has a minimum value of 8).The lower is the request/event opcode.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
The payload describes the request/event arguments. Every argument is always
|
||||
aligned to 32-bits. Where padding is required, the value of padding bytes is
|
||||
undefined. There is no prefix that describes the type, but it is
|
||||
inferred implicitly from the xml specification.
|
||||
</para>
|
||||
<para>
|
||||
|
||||
The representation of argument types are as follows:
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>int</term>
|
||||
<term>uint</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The value is the 32-bit value of the signed/unsigned
|
||||
int.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>fixed</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Signed 24.8 decimal numbers. It is a signed decimal type which
|
||||
offers a sign bit, 23 bits of integer precision and 8 bits of
|
||||
decimal precision. This is exposed as an opaque struct with
|
||||
conversion helpers to and from double and int on the C API side.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>string</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Starts with an unsigned 32-bit length, followed by the
|
||||
string contents, including terminating null byte, then padding
|
||||
to a 32-bit boundary.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>object</term>
|
||||
<listitem>
|
||||
<para>
|
||||
32-bit object ID.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>new_id</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The 32-bit object ID. Generally, the interface used for the new
|
||||
object is inferred from the xml, but in the case where it's not
|
||||
specified, a new_id is preceded by a <code>string</code> specifying
|
||||
the interface name, and a <code>uint</code> specifying the version.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>array</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Starts with 32-bit array size in bytes, followed by the array
|
||||
contents verbatim, and finally padding to a 32-bit boundary.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>fd</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The file descriptor is not stored in the message buffer, but in
|
||||
the ancillary data of the UNIX domain socket message (msg_control).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</section>
|
||||
<xi:include href="ProtocolInterfaces.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<section id="sect-Protocol-Versioning">
|
||||
<title>Versioning</title>
|
||||
<para>
|
||||
Every interface is versioned and every protocol object implements a
|
||||
particular version of its interface. For global objects, the maximum
|
||||
version supported by the server is advertised with the global and the
|
||||
actual version of the created protocol object is determined by the
|
||||
version argument passed to wl_registry.bind(). For objects that are
|
||||
not globals, their version is inferred from the object that created
|
||||
them.
|
||||
</para>
|
||||
<para>
|
||||
In order to keep things sane, this has a few implications for
|
||||
interface versions:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
The object creation hierarchy must be a tree. Otherwise,
|
||||
inferring object versions from the parent object becomes a much
|
||||
more difficult to properly track.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
When the version of an interface increases, so does the version
|
||||
of its parent (recursively until you get to a global interface)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
A global interface's version number acts like a counter for all
|
||||
of its child interfaces. Whenever a child interface gets
|
||||
modified, the global parent's interface version number also
|
||||
increases (see above). The child interface then takes on the
|
||||
same version number as the new version of its parent global
|
||||
interface.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
To illustrate the above, consider the wl_compositor interface. It
|
||||
has two children, wl_surface and wl_region. As of wayland version
|
||||
1.2, wl_surface and wl_compositor are both at version 3. If
|
||||
something is added to the wl_region interface, both wl_region and
|
||||
wl_compositor will get bumpped to version 4. If, afterwards,
|
||||
wl_surface is changed, both wl_compositor and wl_surface will be at
|
||||
version 5. In this way the global interface version is used as a
|
||||
sort of "counter" for all of its child interfaces. This makes it
|
||||
very simple to know the version of the child given the version of its
|
||||
parent. The child is at the highest possible interface version that
|
||||
is less than or equal to its parent's version.
|
||||
</para>
|
||||
<para>
|
||||
It is worth noting a particular exception to the above versioning
|
||||
scheme. The wl_display (and, by extension, wl_registry) interface
|
||||
cannot change because it is the core protocol object and its version
|
||||
is never advertised nor is there a mechanism to request a different
|
||||
version.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-Connect-Time">
|
||||
<title>Connect Time</title>
|
||||
<para>
|
||||
There is no fixed connection setup information, the server emits
|
||||
multiple events at connect time, to indicate the presence and
|
||||
properties of global objects: outputs, compositor, input devices.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-Security-and-Authentication">
|
||||
<title>Security and Authentication</title>
|
||||
<para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
mostly about access to underlying buffers, need new drm auth
|
||||
mechanism (the grant-to ioctl idea), need to check the cmd stream?
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
getting the server socket depends on the compositor type, could
|
||||
be a system wide name, through fd passing on the session dbus.
|
||||
or the client is forked by the compositor and the fd is
|
||||
already opened.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-Creating-Objects">
|
||||
<title>Creating Objects</title>
|
||||
<para>
|
||||
Each object has a unique ID. The IDs are allocated by the entity
|
||||
creating the object (either client or server). IDs allocated by the
|
||||
client are in the range [1, 0xfeffffff] while IDs allocated by the
|
||||
server are in the range [0xff000000, 0xffffffff]. The 0 ID is
|
||||
reserved to represent a null or non-existent object.
|
||||
|
||||
For efficiency purposes, the IDs are densely packed in the sense that
|
||||
the ID N will not be used until N-1 has been used. Any ID allocation
|
||||
algorithm that does not maintain this property is incompatible with
|
||||
the implementation in libwayland.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-Compositor">
|
||||
<title>Compositor</title>
|
||||
<para>
|
||||
The compositor is a global object, advertised at connect time.
|
||||
</para>
|
||||
<para>
|
||||
See <xref linkend="protocol-spec-wl_compositor"/> for the
|
||||
protocol description.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-Surface">
|
||||
<title>Surfaces</title>
|
||||
<para>
|
||||
A surface manages a rectangular grid of pixels that clients create
|
||||
for displaying their content to the screen. Clients don't know
|
||||
the global position of their surfaces, and cannot access other
|
||||
clients' surfaces.
|
||||
</para>
|
||||
<para>
|
||||
Once the client has finished writing pixels, it 'commits' the
|
||||
buffer; this permits the compositor to access the buffer and read
|
||||
the pixels. When the compositor is finished, it releases the
|
||||
buffer back to the client.
|
||||
</para>
|
||||
<para>
|
||||
See <xref linkend="protocol-spec-wl_surface"/> for the protocol
|
||||
description.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-Input">
|
||||
<title>Input</title>
|
||||
<para>
|
||||
A seat represents a group of input devices including mice,
|
||||
keyboards and touchscreens. It has a keyboard and pointer
|
||||
focus. Seats are global objects. Pointer events are delivered
|
||||
in surface-local coordinates.
|
||||
</para>
|
||||
<para>
|
||||
The compositor maintains an implicit grab when a button is
|
||||
pressed, to ensure that the corresponding button release
|
||||
event gets delivered to the same surface. But there is no way
|
||||
for clients to take an explicit grab. Instead, surfaces can
|
||||
be mapped as 'popup', which combines transient window semantics
|
||||
with a pointer grab.
|
||||
</para>
|
||||
<para>
|
||||
To avoid race conditions, input events that are likely to
|
||||
trigger further requests (such as button presses, key events,
|
||||
pointer motions) carry serial numbers, and requests such as
|
||||
wl_surface.set_popup require that the serial number of the
|
||||
triggering event is specified. The server maintains a
|
||||
monotonically increasing counter for these serial numbers.
|
||||
</para>
|
||||
<para>
|
||||
Input events also carry timestamps with millisecond granularity.
|
||||
Their base is undefined, so they can't be compared against
|
||||
system time (as obtained with clock_gettime or gettimeofday).
|
||||
They can be compared with each other though, and for instance
|
||||
be used to identify sequences of button presses as double
|
||||
or triple clicks.
|
||||
</para>
|
||||
<para>
|
||||
See <xref linkend="protocol-spec-wl_seat"/> for the
|
||||
protocol description.
|
||||
</para>
|
||||
<para>
|
||||
Talk about:
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
keyboard map, change events
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
xkb on Wayland
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
multi pointer Wayland
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
<para>
|
||||
A surface can change the pointer image when the surface is the pointer
|
||||
focus of the input device. Wayland doesn't automatically change the
|
||||
pointer image when a pointer enters a surface, but expects the
|
||||
application to set the cursor it wants in response to the pointer
|
||||
focus and motion events. The rationale is that a client has to manage
|
||||
changing pointer images for UI elements within the surface in response
|
||||
to motion events anyway, so we'll make that the only mechanism for
|
||||
setting or changing the pointer image. If the server receives a request
|
||||
to set the pointer image after the surface loses pointer focus, the
|
||||
request is ignored. To the client this will look like it successfully
|
||||
set the pointer image.
|
||||
</para>
|
||||
<para>
|
||||
Setting the pointer image to NULL causes the cursor to be hidden.
|
||||
</para>
|
||||
<para>
|
||||
The compositor will revert the pointer image back to a default image
|
||||
when no surface has the pointer focus for that device.
|
||||
</para>
|
||||
<para>
|
||||
What if the pointer moves from one window which has set a special
|
||||
pointer image to a surface that doesn't set an image in response to
|
||||
the motion event? The new surface will be stuck with the special
|
||||
pointer image. We can't just revert the pointer image on leaving a
|
||||
surface, since if we immediately enter a surface that sets a different
|
||||
image, the image will flicker. If a client does not set a pointer image
|
||||
when the pointer enters a surface, the pointer stays with the image set
|
||||
by the last surface that changed it, possibly even hidden. Such a client
|
||||
is likely just broken.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-Output">
|
||||
<title>Output</title>
|
||||
<para>
|
||||
An output is a global object, advertised at connect time or as it
|
||||
comes and goes.
|
||||
</para>
|
||||
<para>
|
||||
See <xref linkend="protocol-spec-wl_output"/> for the protocol
|
||||
description.
|
||||
</para>
|
||||
<para>
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
laid out in a big (compositor) coordinate system
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
basically xrandr over Wayland
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
geometry needs position in compositor coordinate system
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
events to advertise available modes, requests to move and change
|
||||
modes
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section id="sect-Protocol-data-sharing">
|
||||
<title>Data sharing between clients</title>
|
||||
<para>
|
||||
The Wayland protocol provides clients a mechanism for sharing
|
||||
data that allows the implementation of copy-paste and
|
||||
drag-and-drop. The client providing the data creates a
|
||||
<function>wl_data_source</function> object and the clients
|
||||
obtaining the data will see it as <function>wl_data_offer</function>
|
||||
object. This interface allows the clients to agree on a mutually
|
||||
supported mime type and transfer the data via a file descriptor
|
||||
that is passed through the protocol.
|
||||
</para>
|
||||
<para>
|
||||
The next section explains the negotiation between data source and
|
||||
data offer objects. <xref linkend="sect-Protocol-data-sharing-devices"/>
|
||||
explains how these objects are created and passed to different
|
||||
clients using the <function>wl_data_device</function> interface
|
||||
that implements copy-paste and drag-and-drop support.
|
||||
</para>
|
||||
<para>
|
||||
See <xref linkend="protocol-spec-wl_data_offer"/>,
|
||||
<xref linkend="protocol-spec-wl_data_source"/>,
|
||||
<xref linkend="protocol-spec-wl_data_device"/> and
|
||||
<xref linkend="protocol-spec-wl_data_device_manager"/> for
|
||||
protocol descriptions.
|
||||
</para>
|
||||
<para>
|
||||
MIME is defined in RFC's 2045-2049. A
|
||||
<ulink url="https://www.iana.org/assignments/media-types/media-types.xhtml">
|
||||
registry of MIME types</ulink> is maintained by the Internet Assigned
|
||||
Numbers Authority (IANA).
|
||||
</para>
|
||||
<section>
|
||||
<title>Data negotiation</title>
|
||||
<para>
|
||||
A client providing data to other clients will create a <function>wl_data_source</function>
|
||||
object and advertise the mime types for the formats it supports for
|
||||
that data through the <function>wl_data_source.offer</function>
|
||||
request. On the receiving end, the data offer object will generate one
|
||||
<function>wl_data_offer.offer</function> event for each supported mime
|
||||
type.
|
||||
</para>
|
||||
<para>
|
||||
The actual data transfer happens when the receiving client sends a
|
||||
<function>wl_data_offer.receive</function> request. This request takes
|
||||
a mime type and a file descriptor as arguments. This request will generate a
|
||||
<function>wl_data_source.send</function> event on the sending client
|
||||
with the same arguments, and the latter client is expected to write its
|
||||
data to the given file descriptor using the chosen mime type.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-Protocol-data-sharing-devices">
|
||||
<title>Data devices</title>
|
||||
<para>
|
||||
Data devices glue data sources and offers together. A data device is
|
||||
associated with a <function>wl_seat</function> and is obtained by the clients using the
|
||||
<function>wl_data_device_manager</function> factory object, which is also responsible for
|
||||
creating data sources.
|
||||
</para>
|
||||
<para>
|
||||
Clients are informed of new data offers through the
|
||||
<function>wl_data_device.data_offer</function> event. After this
|
||||
event is generated the data offer will advertise the available mime
|
||||
types. New data offers are introduced prior to their use for
|
||||
copy-paste or drag-and-drop.
|
||||
</para>
|
||||
<section>
|
||||
<title>Selection</title>
|
||||
<para>
|
||||
Each data device has a selection data source. Clients create a data
|
||||
source object using the device manager and may set it as the
|
||||
current selection for a given data device. Whenever the current
|
||||
selection changes, the client with keyboard focus receives a
|
||||
<function>wl_data_device.selection</function> event. This event is
|
||||
also generated on a client immediately before it receives keyboard
|
||||
focus.
|
||||
</para>
|
||||
<para>
|
||||
The data offer is introduced with
|
||||
<function>wl_data_device.data_offer</function> event before the
|
||||
selection event.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Drag and Drop</title>
|
||||
<para>
|
||||
A drag-and-drop operation is started using the
|
||||
<function>wl_data_device.start_drag</function> request. This
|
||||
requests causes a pointer grab that will generate enter, motion and
|
||||
leave events on the data device. A data source is supplied as
|
||||
argument to start_drag, and data offers associated with it are
|
||||
supplied to clients surfaces under the pointer in the
|
||||
<function>wl_data_device.enter</function> event. The data offer
|
||||
is introduced to the client prior to the enter event with the
|
||||
<function>wl_data_device.data_offer</function> event.
|
||||
</para>
|
||||
<para>
|
||||
Clients are expected to provide feedback to the data sending client
|
||||
by calling the <function>wl_data_offer.accept</function> request with
|
||||
a mime type it accepts. If none of the advertised mime types is
|
||||
supported by the receiving client, it should supply NULL to the
|
||||
accept request. The accept request causes the sending client to
|
||||
receive a <function>wl_data_source.target</function> event with the
|
||||
chosen mime type.
|
||||
</para>
|
||||
<para>
|
||||
When the drag ends, the receiving client receives a
|
||||
<function>wl_data_device.drop</function> event at which it is expected
|
||||
to transfer the data using the
|
||||
<function>wl_data_offer.receive</function> request.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
@@ -0,0 +1,7 @@
|
||||
<revhistory>
|
||||
<revision>
|
||||
<revnumber>1-0</revnumber>
|
||||
<authorinitials>krh</authorinitials>
|
||||
<revremark>Initial version</revremark>
|
||||
</revision>
|
||||
</revhistory>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
<!ENTITY doxygen SYSTEM "ServerAPI.xml">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<appendix id="sect-Library-Server">
|
||||
<title>Server API</title>
|
||||
<section><title>Introduction</title>
|
||||
<para>
|
||||
The open-source reference implementation of Wayland protocol is
|
||||
split in two C libraries, <link
|
||||
linkend="sect-Library-Client">libwayland-client</link> and
|
||||
libwayland-server. Their main responsibility is to handle the
|
||||
Inter-process communication (<emphasis>IPC</emphasis>) with each
|
||||
other, therefore guaranteeing the protocol objects marshaling and
|
||||
messages synchronization.
|
||||
</para>
|
||||
<para>
|
||||
The server library is designed to work much like libwayland-client,
|
||||
although it is considerably complicated due to the server needing
|
||||
to support multiple versions of the protocol. It is best to learn
|
||||
libwayland-client first.
|
||||
</para>
|
||||
<para>
|
||||
Each open socket to a client is represented by a <link
|
||||
linkend="Server-structwl__client">wl_client</link>. The equivalent
|
||||
of the <link linkend="Client-classwl__proxy">wl_proxy</link> that
|
||||
libwayland-client uses to represent an object is <link
|
||||
linkend="Server-structwl__resource">wl_resource</link> for
|
||||
client-created objects, and <link
|
||||
linkend="Server-structwl__global">wl_global</link> for objects
|
||||
created by the server.
|
||||
</para>
|
||||
<para>
|
||||
Often a server is also a client for another Wayland server, and
|
||||
thus must link with both libwayland-client and libwayland-server.
|
||||
This produces some type name conflicts (such as the <link
|
||||
linkend="Client-classwl__display">client wl_display</link> and
|
||||
<link linkend="Server-structwl__display">server wl_display</link>,
|
||||
but the duplicate-but-not-the-same types are opaque, and accessed
|
||||
only inside the correct library where it came from. Naturally that
|
||||
means that the program writer needs to always know if a pointer to
|
||||
a wl_display is for the server or client side and use the
|
||||
corresponding functions.
|
||||
</para>
|
||||
</section>
|
||||
&doxygen;
|
||||
</appendix>
|
||||
@@ -0,0 +1,4 @@
|
||||
<!ENTITY PRODUCT "Documentation">
|
||||
<!ENTITY BOOKID "Wayland">
|
||||
<!ENTITY YEAR "2012">
|
||||
<!ENTITY HOLDER "Kristian Høgsberg, Intel Corporation">
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<book>
|
||||
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="Foreword.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="Introduction.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="Compositors.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="Architecture.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="Protocol.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="Xwayland.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="ProtocolSpec.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
|
||||
<xi:include href="Client.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="Server.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
</book>
|
||||
@@ -0,0 +1,170 @@
|
||||
<?xml version='1.0' encoding='utf-8' ?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % BOOK_ENTITIES SYSTEM "Wayland.ent">
|
||||
%BOOK_ENTITIES;
|
||||
]>
|
||||
<chapter id="chap-X11-Application-Support">
|
||||
<title>X11 Application Support</title>
|
||||
<section id="sect-X11-Application-Support-introduction">
|
||||
<title>Introduction</title>
|
||||
<para>
|
||||
Being able to run existing X11 applications is crucial for the adoption
|
||||
of Wayland, especially on desktops, as there will always be X11
|
||||
applications that have not been or cannot be converted into Wayland
|
||||
applications, and throwing them all away would be prohibitive.
|
||||
Therefore a Wayland compositor often needs to support running X11
|
||||
applications.
|
||||
</para>
|
||||
<para>
|
||||
X11 and Wayland are different enough that there is no "simple" way to
|
||||
translate between them. Most of X11 is uninteresting to a Wayland
|
||||
compositor. That, combined with the gigantic implementation effort needed
|
||||
to support X11, makes it intractable to just write X11 support directly in
|
||||
a Wayland compositor. The implementation would be nothing short of a
|
||||
real X11 server.
|
||||
</para>
|
||||
<para>
|
||||
Therefore, Wayland compositors should use Xwayland, the X11 server that
|
||||
lives in the Xorg server source code repository and shares most of the
|
||||
implementation with the Xorg server. Xwayland is a complete X11 server,
|
||||
just like Xorg is, but instead of driving the displays and opening input
|
||||
devices, it acts as a Wayland client. The rest of this chapter talks
|
||||
about how Xwayland works.
|
||||
</para>
|
||||
<para>
|
||||
For integration and architecture reasons, while Xwayland is a Wayland
|
||||
client of the Wayland compositor, the Wayland compositor is an X11 client
|
||||
of Xwayland. This circular dependency requires special care from the
|
||||
Wayland compositor.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-X11-Application-Support-two-modes">
|
||||
<title>Two Modes for Foreign Windows</title>
|
||||
<para>
|
||||
In general, windows from a foreign window system can be presented in one
|
||||
of two ways: rootless and rootful (not rootless).
|
||||
</para>
|
||||
<para>
|
||||
In rootful mode, the foreign window system as a whole is represented as a
|
||||
window (or more) of its own. You have a native window, inside which all
|
||||
the foreign windows are. The advantage of this approach in Xwayland's
|
||||
case is that you can run your favourite X11 window manager to manage your
|
||||
X11 applications. The disadvantage is that the foreign windows do not
|
||||
integrate with the native desktop. Therefore this mode is not usually
|
||||
used.
|
||||
</para>
|
||||
<para>
|
||||
In rootless mode, each foreign window is a first-class resident among the
|
||||
native windows. Foreign windows are not confined inside a native window
|
||||
but act as if they were native windows. The advantage is that one can
|
||||
freely stack and mix native and foreign windows, which is not possible in
|
||||
rootful mode. The disadvantage is that this mode is harder to implement
|
||||
and fundamental differences in window systems may prevent some things
|
||||
from working. With rootless Xwayland, the Wayland compositor must take
|
||||
the role as the X11 window manager, and one cannot use any other X11
|
||||
window manager in its place.
|
||||
</para>
|
||||
<para>
|
||||
This chapter concentrates on the rootless mode, and ignores the rootful
|
||||
mode.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-X11-Application-Support-architecture">
|
||||
<title>Architecture</title>
|
||||
<para>
|
||||
A Wayland compositor usually takes care of launching Xwayland.
|
||||
Xwayland works in cooperation with a Wayland compositor as follows:
|
||||
</para>
|
||||
<figure>
|
||||
<title>Xwayland architecture diagram</title>
|
||||
<mediaobjectco>
|
||||
<imageobjectco>
|
||||
<imageobject>
|
||||
<imagedata fileref="images/xwayland-architecture.png" format="PNG" />
|
||||
</imageobject>
|
||||
</imageobjectco>
|
||||
</mediaobjectco>
|
||||
</figure>
|
||||
<para>
|
||||
An X11 application connects to Xwayland just like it would connect to any
|
||||
X server. Xwayland processes all the X11 requests. On the other end,
|
||||
Xwayland is a Wayland client that connects to the Wayland compositor.
|
||||
</para>
|
||||
<para>
|
||||
The X11 window manager (XWM) is an integral part of the Wayland
|
||||
compositor. XWM uses the usual X11 window management protocol to manage
|
||||
all X11 windows in Xwayland. Most importantly, XWM acts as a bridge
|
||||
between Xwayland window state and the Wayland compositor's window manager
|
||||
(WWM). This way WWM can manage all windows, both native Wayland and X11
|
||||
(Xwayland) windows. This is very important for a coherent user
|
||||
experience.
|
||||
</para>
|
||||
<para>
|
||||
Since Xwayland uses Wayland for input and output, it does not have any
|
||||
use for the device drivers that Xorg uses. None of the xf86-video-* or
|
||||
xf86-input-* modules are used. There also is no configuration file for
|
||||
the Xwayland server. For optional hardware accelerated rendering,
|
||||
Xwayland uses GLAMOR.
|
||||
</para>
|
||||
<para>
|
||||
A Wayland compositor usually spawns only one Xwayland instance. This is
|
||||
because many X11 applications assume they can communicate with other X11
|
||||
applications through the X server, and this requires a shared X server
|
||||
instance. This also means that Xwayland does not protect nor isolate X11
|
||||
clients from each other, unless the Wayland compositor specifically
|
||||
chooses to break the X11 client intercommunications by spawning
|
||||
application specific Xwayland instances. X11 clients are naturally
|
||||
isolated from Wayland clients.
|
||||
</para>
|
||||
<para>
|
||||
Xwayland compatibility compared to a native X server will probably never
|
||||
reach 100%. Desktop environment (DE) components, specifically X11 window
|
||||
managers, are practically never supported. An X11 window manager would
|
||||
not know about native Wayland windows, so it could manage only X11
|
||||
windows. On the other hand, there must be an XWM that reserves the
|
||||
exclusive window manager role so that the Wayland compositor could show
|
||||
the X11 windows appropriately. For other DE components, like pagers and
|
||||
panels, adding the necessary interfaces to support them in WWM through XWM
|
||||
is often considered not worthwhile.
|
||||
</para>
|
||||
</section>
|
||||
<section id="sect-X11-Application-Support-xwm">
|
||||
<title>X Window Manager (XWM)</title>
|
||||
<para>
|
||||
From the X11 point of view, the X window manager (XWM) living inside a
|
||||
Wayland compositor is just like any other window manager. The difference
|
||||
is mostly in which process it resides in, and the few extra conventions
|
||||
in the X11 protocol to support Wayland window management (WWM)
|
||||
specifically.
|
||||
</para>
|
||||
<para>
|
||||
There are two separate asynchronous communication channels between
|
||||
Xwayland and a Wayland compositor: one uses the Wayland protocol, and the
|
||||
other one, solely for XWM, uses X11 protocol. This setting demands great
|
||||
care from the XWM implementation to avoid (random) deadlocks with
|
||||
Xwayland. It is often nearly impossible to prove that synchronous or
|
||||
blocking X11 calls from XWM cannot cause a deadlock, and therefore it is
|
||||
strongly recommended to make all X11 communications asynchronous. All
|
||||
Wayland communications are already asynchronous by design.
|
||||
</para>
|
||||
<section id="sect-X11-Application-Support-xwm-window-identification">
|
||||
<title>Window identification</title>
|
||||
<para>
|
||||
In Xwayland, an X11 window may have a corresponding wl_surface object
|
||||
in Wayland. The wl_surface object is used for input and output: it is
|
||||
referenced by input events and used to provide the X11 window content
|
||||
to the Wayland compositor. The X11 window and the wl_surface live in
|
||||
different protocol streams, and they need to be matched for XWM to do
|
||||
its job.
|
||||
</para>
|
||||
<para>
|
||||
When Xwayland creates a wl_surface on Wayland, it will also send an X11
|
||||
ClientMessage of type atom "WL_SURFACE_ID" to the X11 window carrying
|
||||
the wl_surface Wayland object ID as the first 32-bit data element. This
|
||||
is how XWM can associate a wl_surface with an X11 window. Note that
|
||||
the request to create a wl_surface and the ID message may arrive in any
|
||||
order in the Wayland compositor.
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
@@ -0,0 +1,14 @@
|
||||
/*headings*/
|
||||
h1, h2, h3, h4, h5, h6,
|
||||
div.producttitle,
|
||||
div.subtitle,
|
||||
div.author div.author,
|
||||
div.translator div.translator,
|
||||
div.othercredit div.othercredit,
|
||||
div.editor div.editor,
|
||||
div.contrib div.contrib,
|
||||
.title,
|
||||
.titlepage .edition,
|
||||
.titlepage .releaseinfo {
|
||||
color: #336699;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
@import url("common.css");
|
||||
@import url("overrides.css");
|
||||
@import url("lang.css");
|
||||
@@ -0,0 +1,115 @@
|
||||
/*headings*/
|
||||
h1, h2, h3, h4, h5, h6,
|
||||
div.producttitle,
|
||||
div.subtitle,
|
||||
div.author div.author,
|
||||
div.translator div.translator,
|
||||
div.othercredit div.othercredit,
|
||||
div.editor div.editor,
|
||||
div.contrib div.contrib,
|
||||
.title,
|
||||
.titlepage .edition {
|
||||
}
|
||||
|
||||
div.para {
|
||||
margin-top: 1em;
|
||||
}
|
||||
/* inline syntax highlighting */
|
||||
.perl_Alert {
|
||||
color: #0000ff;
|
||||
}
|
||||
|
||||
.perl_BaseN {
|
||||
color: #007f00;
|
||||
}
|
||||
|
||||
.perl_BString {
|
||||
color: #5C3566;
|
||||
}
|
||||
|
||||
.perl_Char {
|
||||
color: #ff00ff;
|
||||
}
|
||||
|
||||
.perl_Comment {
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
|
||||
.perl_DataType {
|
||||
color: #0000ff;
|
||||
}
|
||||
|
||||
|
||||
.perl_DecVal {
|
||||
color: #00007f;
|
||||
}
|
||||
|
||||
|
||||
.perl_Error {
|
||||
color: #ff0000;
|
||||
}
|
||||
|
||||
|
||||
.perl_Float {
|
||||
color: #00007f;
|
||||
}
|
||||
|
||||
|
||||
.perl_Function {
|
||||
color: #007f00;
|
||||
}
|
||||
|
||||
|
||||
.perl_IString {
|
||||
color: #5C3566;
|
||||
}
|
||||
|
||||
|
||||
.perl_Keyword {
|
||||
color: #002F5D;
|
||||
}
|
||||
|
||||
|
||||
.perl_Operator {
|
||||
color: #ffa500;
|
||||
}
|
||||
|
||||
|
||||
.perl_Others {
|
||||
color: #b03060;
|
||||
}
|
||||
|
||||
|
||||
.perl_RegionMarker {
|
||||
color: #96b9ff;
|
||||
}
|
||||
|
||||
|
||||
.perl_Reserved {
|
||||
color: #9b30ff;
|
||||
}
|
||||
|
||||
|
||||
.perl_String {
|
||||
color: #5C3566;
|
||||
}
|
||||
|
||||
|
||||
.perl_Variable {
|
||||
color: #0000ff;
|
||||
}
|
||||
|
||||
|
||||
.perl_Warning {
|
||||
color: #0000ff;
|
||||
}
|
||||
|
||||
b, strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
code.command {
|
||||
font-family: monospace;
|
||||
font-weight: bolder;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
@import url("common.css");
|
||||
@import url("overrides.css");
|
||||
@import url("lang.css");
|
||||
|
||||
#tocframe {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.toc_embeded {
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.producttitle {
|
||||
color: #336699;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" width="32" height="32" id="svg3017">
|
||||
<defs id="defs3019">
|
||||
<linearGradient id="linearGradient2381">
|
||||
<stop id="stop2383" style="stop-color:#ffffff;stop-opacity:1" offset="0"/>
|
||||
<stop id="stop2385" style="stop-color:#ffffff;stop-opacity:0" offset="1"/>
|
||||
</linearGradient>
|
||||
<linearGradient x1="296.4996" y1="188.81061" x2="317.32471" y2="209.69398" id="linearGradient2371" xlink:href="#linearGradient2381" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.90776,0,0,0.90776,24.35648,49.24131)"/>
|
||||
</defs>
|
||||
<g transform="matrix(0.437808,-0.437808,0.437808,0.437808,-220.8237,43.55311)" id="g5089">
|
||||
<path d="m 8.4382985,-6.28125 c -0.6073916,0 -4.3132985,5.94886271 -4.3132985,8.25 l 0,26.71875 c 0,0.846384 0.5818159,1.125 1.15625,1.125 l 25.5625,0 c 0.632342,0 1.125001,-0.492658 1.125,-1.125 l 0,-5.21875 0.28125,0 c 0.49684,0 0.906249,-0.409411 0.90625,-0.90625 l 0,-27.9375 c 0,-0.4968398 -0.40941,-0.90625 -0.90625,-0.90625 l -23.8117015,0 z" transform="translate(282.8327,227.1903)" id="path5091" style="fill:#5c5c4f;stroke:#000000;stroke-width:3.23021388;stroke-miterlimit:4;stroke-dasharray:none"/>
|
||||
<rect width="27.85074" height="29.369793" rx="1.1414107" ry="1.1414107" x="286.96509" y="227.63805" id="rect5093" style="fill:#032c87"/>
|
||||
<path d="m 288.43262,225.43675 25.2418,0 0,29.3698 -26.37615,0.0241 1.13435,-29.39394 z" id="rect5095" style="fill:#ffffff"/>
|
||||
<path d="m 302.44536,251.73726 c 1.38691,7.85917 -0.69311,11.28365 -0.69311,11.28365 2.24384,-1.60762 3.96426,-3.47694 4.90522,-5.736 0.96708,2.19264 1.83294,4.42866 4.27443,5.98941 0,0 -1.59504,-7.2004 -1.71143,-11.53706 l -6.77511,0 z" id="path5097" style="fill:#a70000;fill-opacity:1;stroke-width:2"/>
|
||||
<rect width="25.241802" height="29.736675" rx="0.89682275" ry="0.89682275" x="290.73544" y="220.92249" id="rect5099" style="fill:#809cc9"/>
|
||||
<path d="m 576.47347,725.93939 6.37084,0.41502 0.4069,29.51809 c -1.89202,-1.31785 -6.85427,-3.7608 -8.26232,-1.68101 l 0,-26.76752 c 0,-0.82246 0.66212,-1.48458 1.48458,-1.48458 z" transform="matrix(0.499065,-0.866565,0,1,0,0)" id="rect5101" style="fill:#4573b3;fill-opacity:1"/>
|
||||
<path d="m 293.2599,221.89363 20.73918,0 c 0.45101,0 0.8141,0.3631 0.8141,0.81411 0.21547,6.32836 -19.36824,21.7635 -22.36739,17.59717 l 0,-17.59717 c 0,-0.45101 0.3631,-0.81411 0.81411,-0.81411 z" id="path5103" style="opacity:0.65536726;fill:url(#linearGradient2371);fill-opacity:1"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
@@ -0,0 +1,113 @@
|
||||
ProtocolSpec_xml = custom_target(
|
||||
'ProtocolSpec.xml',
|
||||
command: [ xsltproc, '-o', '@OUTPUT@', files('../protocol-to-docbook.xsl'), '@INPUT@' ],
|
||||
input: wayland_protocol_xml,
|
||||
output: 'ProtocolSpec.xml'
|
||||
)
|
||||
|
||||
ProtocolInterfaces_xml = custom_target(
|
||||
'ProtocolInterfaces.xml',
|
||||
command: [ xsltproc, '-o', '@OUTPUT@', files('../protocol-interfaces-to-docbook.xsl'), '@INPUT@' ],
|
||||
input: wayland_protocol_xml,
|
||||
output: 'ProtocolInterfaces.xml'
|
||||
)
|
||||
|
||||
ClientAPI_combined = custom_target(
|
||||
'ClientAPI-combined',
|
||||
command: [ xsltproc, '-o', '@OUTPUT@', '@INPUT@' ],
|
||||
input: [ doxygen_Client_combine_xslt, doxygen_Client_index_xml ],
|
||||
output: 'ClientAPI-combined.xml'
|
||||
)
|
||||
|
||||
to_publican_xsl = files('../doxygen-to-publican.xsl')
|
||||
|
||||
ClientAPI_xml = custom_target(
|
||||
'ClientAPI.xml',
|
||||
command: [ xsltproc, '-o', '@OUTPUT@', '--stringparam', 'which', 'Client', to_publican_xsl, '@INPUT@' ],
|
||||
input: ClientAPI_combined,
|
||||
output: 'ClientAPI.xml'
|
||||
)
|
||||
|
||||
ServerAPI_combined = custom_target(
|
||||
'ServerAPI-combined',
|
||||
command: [ xsltproc, '-o', '@OUTPUT@', '@INPUT@' ],
|
||||
input: [ doxygen_Server_combine_xslt, doxygen_Server_index_xml ],
|
||||
output: 'ServerAPI-combined.xml'
|
||||
)
|
||||
|
||||
ServerAPI_xml = custom_target(
|
||||
'ServerAPI.xml',
|
||||
command: [ xsltproc, '-o', '@OUTPUT@', '--stringparam', 'which', 'Server', to_publican_xsl, '@INPUT@' ],
|
||||
input: ServerAPI_combined,
|
||||
output: 'ServerAPI.xml'
|
||||
)
|
||||
|
||||
|
||||
publican_sources = [
|
||||
'Wayland.ent',
|
||||
# 'Wayland.xml', # handled specially
|
||||
'Book_Info.xml',
|
||||
'Author_Group.xml',
|
||||
'Foreword.xml',
|
||||
'Preface.xml',
|
||||
'Revision_History.xml',
|
||||
'Protocol.xml',
|
||||
'Xwayland.xml',
|
||||
'Compositors.xml',
|
||||
'Client.xml',
|
||||
'Server.xml'
|
||||
]
|
||||
|
||||
publican_processed_main = configure_file(
|
||||
input: 'Wayland.xml',
|
||||
output: 'Wayland.xml',
|
||||
copy: true
|
||||
)
|
||||
|
||||
publican_copied_sources = []
|
||||
foreach src: publican_sources
|
||||
publican_copied_sources += configure_file(
|
||||
input: src,
|
||||
output: src,
|
||||
copy: true
|
||||
)
|
||||
endforeach
|
||||
|
||||
publican_processed_sources = [
|
||||
'Architecture.xml',
|
||||
'Introduction.xml'
|
||||
]
|
||||
|
||||
publican_processed_targets = []
|
||||
foreach src: publican_processed_sources
|
||||
publican_processed_targets += custom_target(
|
||||
src,
|
||||
command: [ xsltproc, '-o', '@OUTPUT@', '--stringparam', 'basedir', '.', merge_mapcoords_xsl, '@INPUT@' ],
|
||||
input: src,
|
||||
output: src
|
||||
)
|
||||
endforeach
|
||||
|
||||
publican_css_sources = files([
|
||||
'css/brand.css',
|
||||
'css/common.css',
|
||||
'css/default.css',
|
||||
'css/epub.css',
|
||||
'css/print.css'
|
||||
])
|
||||
|
||||
install_data(
|
||||
publican_css_sources,
|
||||
install_dir: join_paths(publican_install_prefix, publican_html_dir, 'css')
|
||||
)
|
||||
|
||||
publican_img_sources = files([
|
||||
'images/icon.svg',
|
||||
'images/wayland.png',
|
||||
'images/xwayland-architecture.png'
|
||||
])
|
||||
|
||||
install_data(
|
||||
publican_img_sources,
|
||||
install_dir: join_paths(publican_install_prefix, publican_html_dir, 'images')
|
||||
)
|
||||
@@ -0,0 +1,43 @@
|
||||
wayland_egl = library(
|
||||
'wayland-egl',
|
||||
sources: [
|
||||
'wayland-egl.c',
|
||||
wayland_client_protocol_h
|
||||
],
|
||||
include_directories: src_inc,
|
||||
version: '1.0.0',
|
||||
install: true
|
||||
)
|
||||
|
||||
executable('wayland-egl-abi-check', 'wayland-egl-abi-check.c')
|
||||
|
||||
nm_path = find_program('nm').path()
|
||||
|
||||
test(
|
||||
'wayland-egl symbols check',
|
||||
find_program('wayland-egl-symbols-check'),
|
||||
env: [
|
||||
'WAYLAND_EGL_LIB=@0@'.format(wayland_egl.full_path()),
|
||||
'NM=@0@'.format(nm_path)
|
||||
]
|
||||
)
|
||||
|
||||
install_headers([
|
||||
'wayland-egl.h',
|
||||
'wayland-egl-core.h',
|
||||
'wayland-egl-backend.h'
|
||||
])
|
||||
|
||||
pkgconfig.generate(
|
||||
name: 'wayland-egl',
|
||||
description: 'Frontend wayland-egl library',
|
||||
version: '18.1.0',
|
||||
requires: 'wayland-client',
|
||||
libraries: wayland_egl
|
||||
)
|
||||
|
||||
pkgconfig.generate(
|
||||
name: 'wayland-egl-backend',
|
||||
description: 'Backend wayland-egl interface',
|
||||
version: '3'
|
||||
)
|
||||
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stddef.h> /* offsetof */
|
||||
#include <stdio.h> /* printf */
|
||||
|
||||
#include "wayland-egl-backend.h" /* Current struct wl_egl_window implementation */
|
||||
|
||||
/*
|
||||
* Following are previous implementations of wl_egl_window.
|
||||
*
|
||||
* DO NOT EVER CHANGE!
|
||||
*/
|
||||
|
||||
/* From: 214fc6e850 - Benjamin Franzke : egl: Implement libwayland-egl */
|
||||
struct wl_egl_window_v0 {
|
||||
struct wl_surface *surface;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int dx;
|
||||
int dy;
|
||||
|
||||
int attached_width;
|
||||
int attached_height;
|
||||
};
|
||||
|
||||
/* From: ca3ed3e024 - Ander Conselvan de Oliveira : egl/wayland: Don't invalidate drawable on swap buffers */
|
||||
struct wl_egl_window_v1 {
|
||||
struct wl_surface *surface;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int dx;
|
||||
int dy;
|
||||
|
||||
int attached_width;
|
||||
int attached_height;
|
||||
|
||||
void *private;
|
||||
void (*resize_callback)(struct wl_egl_window *, void *);
|
||||
};
|
||||
|
||||
/* From: 690ead4a13 - Stencel, Joanna : egl/wayland-egl: Fix for segfault in dri2_wl_destroy_surface. */
|
||||
#define WL_EGL_WINDOW_VERSION_v2 2
|
||||
struct wl_egl_window_v2 {
|
||||
struct wl_surface *surface;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int dx;
|
||||
int dy;
|
||||
|
||||
int attached_width;
|
||||
int attached_height;
|
||||
|
||||
void *private;
|
||||
void (*resize_callback)(struct wl_egl_window *, void *);
|
||||
void (*destroy_window_callback)(void *);
|
||||
};
|
||||
|
||||
/* From: 2d5d61bc49 - Miguel A. Vico : wayland-egl: Make wl_egl_window a versioned struct */
|
||||
#define WL_EGL_WINDOW_VERSION_v3 3
|
||||
struct wl_egl_window_v3 {
|
||||
const intptr_t version;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int dx;
|
||||
int dy;
|
||||
|
||||
int attached_width;
|
||||
int attached_height;
|
||||
|
||||
void *driver_private;
|
||||
void (*resize_callback)(struct wl_egl_window *, void *);
|
||||
void (*destroy_window_callback)(void *);
|
||||
|
||||
struct wl_surface *surface;
|
||||
};
|
||||
|
||||
|
||||
/* This program checks we keep a backwards-compatible struct wl_egl_window
|
||||
* definition whenever it is modified in wayland-egl-backend.h.
|
||||
*
|
||||
* The previous definition should be added above as a new struct
|
||||
* wl_egl_window_vN, and the appropriate checks should be added below
|
||||
*/
|
||||
|
||||
#define MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
|
||||
|
||||
#define CHECK_RENAMED_MEMBER(a_ver, b_ver, a_member, b_member) \
|
||||
do { \
|
||||
if (offsetof(struct wl_egl_window ## a_ver, a_member) != \
|
||||
offsetof(struct wl_egl_window ## b_ver, b_member)) { \
|
||||
printf("Backwards incompatible change detected!\n " \
|
||||
"offsetof(struct wl_egl_window" #a_ver "::" #a_member ") != " \
|
||||
"offsetof(struct wl_egl_window" #b_ver "::" #b_member ")\n"); \
|
||||
return 1; \
|
||||
} \
|
||||
\
|
||||
if (MEMBER_SIZE(struct wl_egl_window ## a_ver, a_member) != \
|
||||
MEMBER_SIZE(struct wl_egl_window ## b_ver, b_member)) { \
|
||||
printf("Backwards incompatible change detected!\n " \
|
||||
"MEMBER_SIZE(struct wl_egl_window" #a_ver "::" #a_member ") != " \
|
||||
"MEMBER_SIZE(struct wl_egl_window" #b_ver "::" #b_member ")\n"); \
|
||||
return 1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define CHECK_MEMBER(a_ver, b_ver, member) CHECK_RENAMED_MEMBER(a_ver, b_ver, member, member)
|
||||
#define CHECK_MEMBER_CURRENT(a_ver, member) CHECK_MEMBER(a_ver,, member)
|
||||
|
||||
#define CHECK_SIZE(a_ver, b_ver) \
|
||||
do { \
|
||||
if (sizeof(struct wl_egl_window ## a_ver) > \
|
||||
sizeof(struct wl_egl_window ## b_ver)) { \
|
||||
printf("Backwards incompatible change detected!\n " \
|
||||
"sizeof(struct wl_egl_window" #a_ver ") > " \
|
||||
"sizeof(struct wl_egl_window" #b_ver ")\n"); \
|
||||
return 1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define CHECK_SIZE_CURRENT(a_ver) \
|
||||
do { \
|
||||
if (sizeof(struct wl_egl_window ## a_ver) != \
|
||||
sizeof(struct wl_egl_window)) { \
|
||||
printf("Backwards incompatible change detected!\n " \
|
||||
"sizeof(struct wl_egl_window" #a_ver ") != " \
|
||||
"sizeof(struct wl_egl_window)\n"); \
|
||||
return 1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define CHECK_VERSION(a_ver, b_ver) \
|
||||
do { \
|
||||
if ((WL_EGL_WINDOW_VERSION ## a_ver) >= \
|
||||
(WL_EGL_WINDOW_VERSION ## b_ver)) { \
|
||||
printf("Backwards incompatible change detected!\n " \
|
||||
"WL_EGL_WINDOW_VERSION" #a_ver " >= " \
|
||||
"WL_EGL_WINDOW_VERSION" #b_ver "\n"); \
|
||||
return 1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define CHECK_VERSION_CURRENT(a_ver) \
|
||||
do { \
|
||||
if ((WL_EGL_WINDOW_VERSION ## a_ver) != \
|
||||
(WL_EGL_WINDOW_VERSION)) { \
|
||||
printf("Backwards incompatible change detected!\n " \
|
||||
"WL_EGL_WINDOW_VERSION" #a_ver " != " \
|
||||
"WL_EGL_WINDOW_VERSION\n"); \
|
||||
return 1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/* Check wl_egl_window_v1 ABI against wl_egl_window_v0 */
|
||||
CHECK_MEMBER(_v0, _v1, surface);
|
||||
CHECK_MEMBER(_v0, _v1, width);
|
||||
CHECK_MEMBER(_v0, _v1, height);
|
||||
CHECK_MEMBER(_v0, _v1, dx);
|
||||
CHECK_MEMBER(_v0, _v1, dy);
|
||||
CHECK_MEMBER(_v0, _v1, attached_width);
|
||||
CHECK_MEMBER(_v0, _v1, attached_height);
|
||||
|
||||
CHECK_SIZE(_v0, _v1);
|
||||
|
||||
/* Check wl_egl_window_v2 ABI against wl_egl_window_v1 */
|
||||
CHECK_MEMBER(_v1, _v2, surface);
|
||||
CHECK_MEMBER(_v1, _v2, width);
|
||||
CHECK_MEMBER(_v1, _v2, height);
|
||||
CHECK_MEMBER(_v1, _v2, dx);
|
||||
CHECK_MEMBER(_v1, _v2, dy);
|
||||
CHECK_MEMBER(_v1, _v2, attached_width);
|
||||
CHECK_MEMBER(_v1, _v2, attached_height);
|
||||
CHECK_MEMBER(_v1, _v2, private);
|
||||
CHECK_MEMBER(_v1, _v2, resize_callback);
|
||||
|
||||
CHECK_SIZE(_v1, _v2);
|
||||
|
||||
/* Check wl_egl_window_v3 ABI against wl_egl_window_v2 */
|
||||
CHECK_RENAMED_MEMBER(_v2, _v3, surface, version);
|
||||
CHECK_MEMBER (_v2, _v3, width);
|
||||
CHECK_MEMBER (_v2, _v3, height);
|
||||
CHECK_MEMBER (_v2, _v3, dx);
|
||||
CHECK_MEMBER (_v2, _v3, dy);
|
||||
CHECK_MEMBER (_v2, _v3, attached_width);
|
||||
CHECK_MEMBER (_v2, _v3, attached_height);
|
||||
CHECK_RENAMED_MEMBER(_v2, _v3, private, driver_private);
|
||||
CHECK_MEMBER (_v2, _v3, resize_callback);
|
||||
CHECK_MEMBER (_v2, _v3, destroy_window_callback);
|
||||
|
||||
CHECK_SIZE (_v2, _v3);
|
||||
CHECK_VERSION(_v2, _v3);
|
||||
|
||||
/* Check current wl_egl_window ABI against wl_egl_window_v3 */
|
||||
CHECK_MEMBER_CURRENT(_v3, version);
|
||||
CHECK_MEMBER_CURRENT(_v3, width);
|
||||
CHECK_MEMBER_CURRENT(_v3, height);
|
||||
CHECK_MEMBER_CURRENT(_v3, dx);
|
||||
CHECK_MEMBER_CURRENT(_v3, dy);
|
||||
CHECK_MEMBER_CURRENT(_v3, attached_width);
|
||||
CHECK_MEMBER_CURRENT(_v3, attached_height);
|
||||
CHECK_MEMBER_CURRENT(_v3, driver_private);
|
||||
CHECK_MEMBER_CURRENT(_v3, resize_callback);
|
||||
CHECK_MEMBER_CURRENT(_v3, destroy_window_callback);
|
||||
CHECK_MEMBER_CURRENT(_v3, surface);
|
||||
|
||||
CHECK_SIZE_CURRENT (_v3);
|
||||
CHECK_VERSION_CURRENT(_v3);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright © 2011 Benjamin Franzke
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Benjamin Franzke <benjaminfranzke@googlemail.com>
|
||||
*/
|
||||
|
||||
#ifndef _WAYLAND_EGL_PRIV_H
|
||||
#define _WAYLAND_EGL_PRIV_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NOTE: This version must be kept in sync with the Version field in the
|
||||
* wayland-egl-backend.pc.in file.
|
||||
*/
|
||||
#define WL_EGL_WINDOW_VERSION 3
|
||||
|
||||
struct wl_surface;
|
||||
|
||||
struct wl_egl_window {
|
||||
const intptr_t version;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int dx;
|
||||
int dy;
|
||||
|
||||
int attached_width;
|
||||
int attached_height;
|
||||
|
||||
void *driver_private;
|
||||
void (*resize_callback)(struct wl_egl_window *, void *);
|
||||
void (*destroy_window_callback)(void *);
|
||||
|
||||
struct wl_surface *surface;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,9 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: wayland-egl-backend
|
||||
Description: Backend wayland-egl interface
|
||||
Version: 3
|
||||
Libs:
|
||||
Cflags: -I${includedir}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright © 2011 Kristian Høgsberg
|
||||
* Copyright © 2011 Benjamin Franzke
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef WAYLAND_EGL_CORE_H
|
||||
#define WAYLAND_EGL_CORE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define WL_EGL_PLATFORM 1
|
||||
|
||||
struct wl_egl_window;
|
||||
struct wl_surface;
|
||||
|
||||
struct wl_egl_window *
|
||||
wl_egl_window_create(struct wl_surface *surface,
|
||||
int width, int height);
|
||||
|
||||
void
|
||||
wl_egl_window_destroy(struct wl_egl_window *egl_window);
|
||||
|
||||
void
|
||||
wl_egl_window_resize(struct wl_egl_window *egl_window,
|
||||
int width, int height,
|
||||
int dx, int dy);
|
||||
|
||||
void
|
||||
wl_egl_window_get_attached_size(struct wl_egl_window *egl_window,
|
||||
int *width, int *height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
RET=0
|
||||
LIB=${WAYLAND_EGL_LIB}
|
||||
|
||||
if ! test -f "$LIB"; then
|
||||
echo "Test binary \"$LIB\" does not exist"
|
||||
exit 99
|
||||
fi
|
||||
|
||||
if ! test -n "$NM"; then
|
||||
echo "nm environment variable not set"
|
||||
exit 99
|
||||
fi
|
||||
|
||||
AVAIL_FUNCS="$($NM -D --format=bsd --defined-only $LIB | awk '{print $3}')"
|
||||
|
||||
# Official ABI, taken from the header.
|
||||
REQ_FUNCS="wl_egl_window_resize
|
||||
wl_egl_window_create
|
||||
wl_egl_window_destroy
|
||||
wl_egl_window_get_attached_size
|
||||
"
|
||||
|
||||
NEW_ABI=$(echo "$AVAIL_FUNCS" | while read func; do
|
||||
echo "$func" | grep -q "^_" && continue
|
||||
echo "$REQ_FUNCS" | grep -q "^$func$" && continue
|
||||
|
||||
echo $func
|
||||
done)
|
||||
|
||||
if test -n "$NEW_ABI"; then
|
||||
echo "New ABI detected - If intentional, update the test."
|
||||
echo "$NEW_ABI"
|
||||
RET=1
|
||||
fi
|
||||
|
||||
REMOVED_ABI=$(echo "$REQ_FUNCS" | while read func; do
|
||||
echo "$AVAIL_FUNCS" | grep -q "^$func$" && continue
|
||||
|
||||
echo $func
|
||||
done)
|
||||
|
||||
if test -n "$REMOVED_ABI"; then
|
||||
echo "ABI break detected - Required symbol(s) no longer exported!"
|
||||
echo "$REMOVED_ABI"
|
||||
RET=1
|
||||
fi
|
||||
|
||||
exit $RET
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Copyright © 2011 Kristian Høgsberg
|
||||
* Copyright © 2011 Benjamin Franzke
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Kristian Høgsberg <krh@bitplanet.net>
|
||||
* Benjamin Franzke <benjaminfranzke@googlemail.com>
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "wayland-egl.h"
|
||||
#include "wayland-egl-backend.h"
|
||||
#include "wayland-util.h"
|
||||
|
||||
|
||||
WL_EXPORT void
|
||||
wl_egl_window_resize(struct wl_egl_window *egl_window,
|
||||
int width, int height,
|
||||
int dx, int dy)
|
||||
{
|
||||
if (width <= 0 || height <= 0)
|
||||
return;
|
||||
|
||||
egl_window->width = width;
|
||||
egl_window->height = height;
|
||||
egl_window->dx = dx;
|
||||
egl_window->dy = dy;
|
||||
|
||||
if (egl_window->resize_callback)
|
||||
egl_window->resize_callback(egl_window, egl_window->driver_private);
|
||||
}
|
||||
|
||||
WL_EXPORT struct wl_egl_window *
|
||||
wl_egl_window_create(struct wl_surface *surface,
|
||||
int width, int height)
|
||||
{
|
||||
struct wl_egl_window *egl_window;
|
||||
|
||||
if (width <= 0 || height <= 0)
|
||||
return NULL;
|
||||
|
||||
egl_window = calloc(1, sizeof *egl_window);
|
||||
if (!egl_window)
|
||||
return NULL;
|
||||
|
||||
/* Cast away the constness to set the version number.
|
||||
*
|
||||
* We want the const notation since it gives an explicit
|
||||
* feedback to the backend implementation, should it try to
|
||||
* change it.
|
||||
*
|
||||
* The latter in itself is not too surprising as these days APIs
|
||||
* tend to provide bidirectional version field.
|
||||
*/
|
||||
intptr_t *version = (intptr_t *)&egl_window->version;
|
||||
*version = WL_EGL_WINDOW_VERSION;
|
||||
|
||||
egl_window->surface = surface;
|
||||
|
||||
egl_window->width = width;
|
||||
egl_window->height = height;
|
||||
|
||||
return egl_window;
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
wl_egl_window_destroy(struct wl_egl_window *egl_window)
|
||||
{
|
||||
if (egl_window->destroy_window_callback)
|
||||
egl_window->destroy_window_callback(egl_window->driver_private);
|
||||
free(egl_window);
|
||||
}
|
||||
|
||||
WL_EXPORT void
|
||||
wl_egl_window_get_attached_size(struct wl_egl_window *egl_window,
|
||||
int *width, int *height)
|
||||
{
|
||||
if (width)
|
||||
*width = egl_window->attached_width;
|
||||
if (height)
|
||||
*height = egl_window->attached_height;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright © 2011 Kristian Høgsberg
|
||||
* Copyright © 2011 Benjamin Franzke
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial
|
||||
* portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef WAYLAND_EGL_H
|
||||
#define WAYLAND_EGL_H
|
||||
|
||||
#include <wayland-client.h>
|
||||
#include "wayland-egl-core.h"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: wayland-egl
|
||||
Description: Frontend wayland-egl library
|
||||
Version: 18.1.0
|
||||
Requires: wayland-client
|
||||
Libs: -L${libdir} -lwayland-egl
|
||||
Cflags: -I${includedir}
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2017 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
if [[ $# -ne 1 ]]; then
|
||||
echo "Usage: gen_wayland_version_header.sh <path_to_configure.ac>\
|
||||
< wayland_version.h.in > wayland_version.h" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
CONFIGURE_AC="$1"
|
||||
WAYLAND_VERSION_MAJOR="$(grep -o -E 'define..wayland_major_version.+' ${CONFIGURE_AC} | grep -o -E '[0-9]+')"
|
||||
WAYLAND_VERSION_MINOR="$(grep -o -E 'define..wayland_minor_version.+' ${CONFIGURE_AC} | grep -o -E '[0-9]+')"
|
||||
WAYLAND_VERSION_MICRO="$(grep -o -E 'define..wayland_micro_version.+' ${CONFIGURE_AC} | grep -o -E '[0-9]+')"
|
||||
WAYLAND_VERSION="${WAYLAND_VERSION_MAJOR}.${WAYLAND_VERSION_MINOR}.${WAYLAND_VERSION_MICRO}" ; \
|
||||
sed \
|
||||
-e s/@WAYLAND_VERSION_MAJOR@/${WAYLAND_VERSION_MAJOR}/ \
|
||||
-e s/@WAYLAND_VERSION_MINOR@/${WAYLAND_VERSION_MINOR}/ \
|
||||
-e s/@WAYLAND_VERSION_MICRO@/${WAYLAND_VERSION_MICRO}/ \
|
||||
-e s/@WAYLAND_VERSION_MICRO@/${WAYLAND_VERSION_MICRO}/ \
|
||||
-e s/@WAYLAND_VERSION@/${WAYLAND_VERSION}/
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
bash $1 $2 < $3 > $4
|
||||
+541
@@ -0,0 +1,541 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2020-11-14.01; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
doit=${DOITPROG-}
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
# Create dirs (including intermediate dirs) using mode 755.
|
||||
# This is like GNU 'install' as of coreutils 8.32 (2020).
|
||||
mkdir_umask=22
|
||||
|
||||
backupsuffix=
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-p pass -p to $cpprog.
|
||||
-s $stripprog installed files.
|
||||
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
|
||||
By default, rm is invoked with -f; when overridden with RMPROG,
|
||||
it's up to you to specify -f if you want it.
|
||||
|
||||
If -S is not specified, no backups are attempted.
|
||||
|
||||
Email bug reports to bug-automake@gnu.org.
|
||||
Automake home page: https://www.gnu.org/software/automake/
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-p) cpprog="$cpprog -p";;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-S) backupsuffix="$2"
|
||||
shift;;
|
||||
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
# Don't chown directories that already exist.
|
||||
if test $dstdir_status = 0; then
|
||||
chowncmd=""
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename.
|
||||
if test -d "$dst"; then
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dstbase=`basename "$src"`
|
||||
case $dst in
|
||||
*/) dst=$dst$dstbase;;
|
||||
*) dst=$dst/$dstbase;;
|
||||
esac
|
||||
dstdir_status=0
|
||||
else
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
case $dstdir in
|
||||
*/) dstdirslash=$dstdir;;
|
||||
*) dstdirslash=$dstdir/;;
|
||||
esac
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
# The $RANDOM variable is not portable (e.g., dash). Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
|
||||
trap '
|
||||
ret=$?
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
|
||||
exit $ret
|
||||
' 0
|
||||
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p'.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=${dstdirslash}_inst.$$_
|
||||
rmtmp=${dstdirslash}_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask &&
|
||||
{ test -z "$stripcmd" || {
|
||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
||||
# which would cause strip to fail.
|
||||
if test -z "$doit"; then
|
||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
||||
else
|
||||
$doit touch "$dsttmp"
|
||||
fi
|
||||
}
|
||||
} &&
|
||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# If $backupsuffix is set, and the file being installed
|
||||
# already exists, attempt a backup. Don't worry if it fails,
|
||||
# e.g., if mv doesn't support -f.
|
||||
if test -n "$backupsuffix" && test -f "$dst"; then
|
||||
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
libtool.m4
|
||||
ltoptions.m4
|
||||
ltsugar.m4
|
||||
ltversion.m4
|
||||
lt~obsolete.m4
|
||||
Vendored
+8393
File diff suppressed because it is too large
Load Diff
Vendored
+437
@@ -0,0 +1,437 @@
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004-2005, 2007-2009, 2011-2018 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8 ltoptions.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
|
||||
|
||||
|
||||
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ------------------------------------------
|
||||
m4_define([_LT_MANGLE_OPTION],
|
||||
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ---------------------------------------
|
||||
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
|
||||
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
|
||||
# saved as a flag.
|
||||
m4_define([_LT_SET_OPTION],
|
||||
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
|
||||
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
[m4_warning([Unknown $1 option '$2'])])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
|
||||
# ------------------------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
m4_define([_LT_IF_OPTION],
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
|
||||
|
||||
|
||||
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
|
||||
# -------------------------------------------------------
|
||||
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
|
||||
# are set.
|
||||
m4_define([_LT_UNLESS_OPTIONS],
|
||||
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
|
||||
[m4_define([$0_found])])])[]dnl
|
||||
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
|
||||
])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
|
||||
# ----------------------------------------
|
||||
# OPTION-LIST is a space-separated list of Libtool options associated
|
||||
# with MACRO-NAME. If any OPTION has a matching handler declared with
|
||||
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
|
||||
# the unknown option and exit.
|
||||
m4_defun([_LT_SET_OPTIONS],
|
||||
[# Set options
|
||||
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[_LT_SET_OPTION([$1], _LT_Option)])
|
||||
|
||||
m4_if([$1],[LT_INIT],[
|
||||
dnl
|
||||
dnl Simply set some default values (i.e off) if boolean options were not
|
||||
dnl specified:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
|
||||
])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
|
||||
])
|
||||
dnl
|
||||
dnl If no reference was made to various pairs of opposing options, then
|
||||
dnl we run the default mode handler for the pair. For example, if neither
|
||||
dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
|
||||
dnl archives by default:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
|
||||
[_LT_ENABLE_FAST_INSTALL])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
|
||||
[_LT_WITH_AIX_SONAME([aix])])
|
||||
])
|
||||
])# _LT_SET_OPTIONS
|
||||
|
||||
|
||||
## --------------------------------- ##
|
||||
## Macros to handle LT_INIT options. ##
|
||||
## --------------------------------- ##
|
||||
|
||||
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
|
||||
# -----------------------------------------
|
||||
m4_define([_LT_MANGLE_DEFUN],
|
||||
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
|
||||
# -----------------------------------------------
|
||||
m4_define([LT_OPTION_DEFINE],
|
||||
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
|
||||
])# LT_OPTION_DEFINE
|
||||
|
||||
|
||||
# dlopen
|
||||
# ------
|
||||
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_DLOPEN],
|
||||
[_LT_SET_OPTION([LT_INIT], [dlopen])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the 'dlopen' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
|
||||
|
||||
|
||||
# win32-dll
|
||||
# ---------
|
||||
# Declare package support for building win32 dll's.
|
||||
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
|
||||
[enable_win32_dll=yes
|
||||
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
esac
|
||||
|
||||
test -z "$AS" && AS=as
|
||||
_LT_DECL([], [AS], [1], [Assembler program])dnl
|
||||
|
||||
test -z "$DLLTOOL" && DLLTOOL=dlltool
|
||||
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
|
||||
|
||||
test -z "$OBJDUMP" && OBJDUMP=objdump
|
||||
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
|
||||
])# win32-dll
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
_LT_SET_OPTION([LT_INIT], [win32-dll])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the 'win32-dll' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
|
||||
|
||||
|
||||
# _LT_ENABLE_SHARED([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-shared flag, and supports the 'shared' and
|
||||
# 'disable-shared' LT_INIT options.
|
||||
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
|
||||
m4_define([_LT_ENABLE_SHARED],
|
||||
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([shared],
|
||||
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
|
||||
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
|
||||
for pkg in $enableval; do
|
||||
IFS=$lt_save_ifs
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS=$lt_save_ifs
|
||||
;;
|
||||
esac],
|
||||
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
|
||||
|
||||
_LT_DECL([build_libtool_libs], [enable_shared], [0],
|
||||
[Whether or not to build shared libraries])
|
||||
])# _LT_ENABLE_SHARED
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-shared])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
|
||||
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_STATIC([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-static flag, and support the 'static' and
|
||||
# 'disable-static' LT_INIT options.
|
||||
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
|
||||
m4_define([_LT_ENABLE_STATIC],
|
||||
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([static],
|
||||
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
|
||||
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
|
||||
for pkg in $enableval; do
|
||||
IFS=$lt_save_ifs
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS=$lt_save_ifs
|
||||
;;
|
||||
esac],
|
||||
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
|
||||
|
||||
_LT_DECL([build_old_libs], [enable_static], [0],
|
||||
[Whether or not to build static libraries])
|
||||
])# _LT_ENABLE_STATIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-static])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
|
||||
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
|
||||
# ----------------------------------
|
||||
# implement the --enable-fast-install flag, and support the 'fast-install'
|
||||
# and 'disable-fast-install' LT_INIT options.
|
||||
# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
|
||||
m4_define([_LT_ENABLE_FAST_INSTALL],
|
||||
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([fast-install],
|
||||
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
|
||||
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
|
||||
for pkg in $enableval; do
|
||||
IFS=$lt_save_ifs
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS=$lt_save_ifs
|
||||
;;
|
||||
esac],
|
||||
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
|
||||
|
||||
_LT_DECL([fast_install], [enable_fast_install], [0],
|
||||
[Whether or not to optimize for fast installation])dnl
|
||||
])# _LT_ENABLE_FAST_INSTALL
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
|
||||
|
||||
# Old names:
|
||||
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the 'fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the 'disable-fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
|
||||
|
||||
|
||||
# _LT_WITH_AIX_SONAME([DEFAULT])
|
||||
# ----------------------------------
|
||||
# implement the --with-aix-soname flag, and support the `aix-soname=aix'
|
||||
# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
|
||||
# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
|
||||
m4_define([_LT_WITH_AIX_SONAME],
|
||||
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
|
||||
shared_archive_member_spec=
|
||||
case $host,$enable_shared in
|
||||
power*-*-aix[[5-9]]*,yes)
|
||||
AC_MSG_CHECKING([which variant of shared library versioning to provide])
|
||||
AC_ARG_WITH([aix-soname],
|
||||
[AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
|
||||
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
|
||||
[case $withval in
|
||||
aix|svr4|both)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unknown argument to --with-aix-soname])
|
||||
;;
|
||||
esac
|
||||
lt_cv_with_aix_soname=$with_aix_soname],
|
||||
[AC_CACHE_VAL([lt_cv_with_aix_soname],
|
||||
[lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
|
||||
with_aix_soname=$lt_cv_with_aix_soname])
|
||||
AC_MSG_RESULT([$with_aix_soname])
|
||||
if test aix != "$with_aix_soname"; then
|
||||
# For the AIX way of multilib, we name the shared archive member
|
||||
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
|
||||
# and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
|
||||
# Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
|
||||
# the AIX toolchain works better with OBJECT_MODE set (default 32).
|
||||
if test 64 = "${OBJECT_MODE-32}"; then
|
||||
shared_archive_member_spec=shr_64
|
||||
else
|
||||
shared_archive_member_spec=shr
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
with_aix_soname=aix
|
||||
;;
|
||||
esac
|
||||
|
||||
_LT_DECL([], [shared_archive_member_spec], [0],
|
||||
[Shared archive member basename, for filename based shared library versioning on AIX])dnl
|
||||
])# _LT_WITH_AIX_SONAME
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
|
||||
|
||||
|
||||
# _LT_WITH_PIC([MODE])
|
||||
# --------------------
|
||||
# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
|
||||
# LT_INIT options.
|
||||
# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
|
||||
m4_define([_LT_WITH_PIC],
|
||||
[AC_ARG_WITH([pic],
|
||||
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
|
||||
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
|
||||
[lt_p=${PACKAGE-default}
|
||||
case $withval in
|
||||
yes|no) pic_mode=$withval ;;
|
||||
*)
|
||||
pic_mode=default
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
|
||||
for lt_pkg in $withval; do
|
||||
IFS=$lt_save_ifs
|
||||
if test "X$lt_pkg" = "X$lt_p"; then
|
||||
pic_mode=yes
|
||||
fi
|
||||
done
|
||||
IFS=$lt_save_ifs
|
||||
;;
|
||||
esac],
|
||||
[pic_mode=m4_default([$1], [default])])
|
||||
|
||||
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
|
||||
])# _LT_WITH_PIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
|
||||
|
||||
# Old name:
|
||||
AU_DEFUN([AC_LIBTOOL_PICMODE],
|
||||
[_LT_SET_OPTION([LT_INIT], [pic-only])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the 'pic-only' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
|
||||
|
||||
## ----------------- ##
|
||||
## LTDL_INIT Options ##
|
||||
## ----------------- ##
|
||||
|
||||
m4_define([_LTDL_MODE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
|
||||
[m4_define([_LTDL_MODE], [nonrecursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
|
||||
[m4_define([_LTDL_MODE], [recursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
|
||||
[m4_define([_LTDL_MODE], [subproject])])
|
||||
|
||||
m4_define([_LTDL_TYPE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [installable],
|
||||
[m4_define([_LTDL_TYPE], [installable])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
|
||||
[m4_define([_LTDL_TYPE], [convenience])])
|
||||
Vendored
+124
@@ -0,0 +1,124 @@
|
||||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004-2005, 2007-2008, 2011-2018 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6 ltsugar.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
|
||||
|
||||
|
||||
# lt_join(SEP, ARG1, [ARG2...])
|
||||
# -----------------------------
|
||||
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
|
||||
# associated separator.
|
||||
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
|
||||
# versions in m4sugar had bugs.
|
||||
m4_define([lt_join],
|
||||
[m4_if([$#], [1], [],
|
||||
[$#], [2], [[$2]],
|
||||
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
m4_define([_lt_join],
|
||||
[m4_if([$#$2], [2], [],
|
||||
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
|
||||
|
||||
# lt_car(LIST)
|
||||
# lt_cdr(LIST)
|
||||
# ------------
|
||||
# Manipulate m4 lists.
|
||||
# These macros are necessary as long as will still need to support
|
||||
# Autoconf-2.59, which quotes differently.
|
||||
m4_define([lt_car], [[$1]])
|
||||
m4_define([lt_cdr],
|
||||
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
|
||||
[$#], 1, [],
|
||||
[m4_dquote(m4_shift($@))])])
|
||||
m4_define([lt_unquote], $1)
|
||||
|
||||
|
||||
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
|
||||
# ------------------------------------------
|
||||
# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
|
||||
# Note that neither SEPARATOR nor STRING are expanded; they are appended
|
||||
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
|
||||
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
|
||||
# than defined and empty).
|
||||
#
|
||||
# This macro is needed until we can rely on Autoconf 2.62, since earlier
|
||||
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
|
||||
m4_define([lt_append],
|
||||
[m4_define([$1],
|
||||
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
|
||||
|
||||
|
||||
|
||||
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
|
||||
# ----------------------------------------------------------
|
||||
# Produce a SEP delimited list of all paired combinations of elements of
|
||||
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
|
||||
# has the form PREFIXmINFIXSUFFIXn.
|
||||
# Needed until we can rely on m4_combine added in Autoconf 2.62.
|
||||
m4_define([lt_combine],
|
||||
[m4_if(m4_eval([$# > 3]), [1],
|
||||
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
|
||||
[[m4_foreach([_Lt_prefix], [$2],
|
||||
[m4_foreach([_Lt_suffix],
|
||||
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
|
||||
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
|
||||
|
||||
|
||||
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
|
||||
# -----------------------------------------------------------------------
|
||||
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
|
||||
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
|
||||
m4_define([lt_if_append_uniq],
|
||||
[m4_ifdef([$1],
|
||||
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
|
||||
[lt_append([$1], [$2], [$3])$4],
|
||||
[$5])],
|
||||
[lt_append([$1], [$2], [$3])$4])])
|
||||
|
||||
|
||||
# lt_dict_add(DICT, KEY, VALUE)
|
||||
# -----------------------------
|
||||
m4_define([lt_dict_add],
|
||||
[m4_define([$1($2)], [$3])])
|
||||
|
||||
|
||||
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
|
||||
# --------------------------------------------
|
||||
m4_define([lt_dict_add_subkey],
|
||||
[m4_define([$1($2:$3)], [$4])])
|
||||
|
||||
|
||||
# lt_dict_fetch(DICT, KEY, [SUBKEY])
|
||||
# ----------------------------------
|
||||
m4_define([lt_dict_fetch],
|
||||
[m4_ifval([$3],
|
||||
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
|
||||
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
|
||||
|
||||
|
||||
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
|
||||
# -----------------------------------------------------------------
|
||||
m4_define([lt_if_dict_fetch],
|
||||
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
|
||||
[$5],
|
||||
[$6])])
|
||||
|
||||
|
||||
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
|
||||
# --------------------------------------------------------------
|
||||
m4_define([lt_dict_filter],
|
||||
[m4_if([$5], [], [],
|
||||
[lt_join(m4_quote(m4_default([$4], [[, ]])),
|
||||
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
|
||||
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
|
||||
])
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004, 2011-2018 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# @configure_input@
|
||||
|
||||
# serial 4221 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.6.42-b88ce-dirty])
|
||||
m4_define([LT_PACKAGE_REVISION], [2.4.6.42])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.4.6.42-b88ce-dirty'
|
||||
macro_revision='2.4.6.42'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
||||
Vendored
+99
@@ -0,0 +1,99 @@
|
||||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004-2005, 2007, 2009, 2011-2018 Free Software
|
||||
# Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5 lt~obsolete.m4
|
||||
|
||||
# These exist entirely to fool aclocal when bootstrapping libtool.
|
||||
#
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
|
||||
# which have later been changed to m4_define as they aren't part of the
|
||||
# exported API, or moved to Autoconf or Automake where they belong.
|
||||
#
|
||||
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
|
||||
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
|
||||
# using a macro with the same name in our local m4/libtool.m4 it'll
|
||||
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
|
||||
# and doesn't know about Autoconf macros at all.)
|
||||
#
|
||||
# So we provide this file, which has a silly filename so it's always
|
||||
# included after everything else. This provides aclocal with the
|
||||
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
|
||||
# because those macros already exist, or will be overwritten later.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
#
|
||||
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
|
||||
# Yes, that means every name once taken will need to remain here until
|
||||
# we give up compatibility with versions before 1.7, at which point
|
||||
# we need to keep only those names which we still refer to.
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
|
||||
|
||||
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
|
||||
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
|
||||
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
|
||||
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
|
||||
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
|
||||
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
|
||||
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
|
||||
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
|
||||
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
|
||||
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
|
||||
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
|
||||
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
|
||||
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
|
||||
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
|
||||
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
|
||||
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
|
||||
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
|
||||
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
|
||||
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
|
||||
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
|
||||
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
|
||||
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
|
||||
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
|
||||
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
|
||||
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
|
||||
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
|
||||
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
|
||||
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
|
||||
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
|
||||
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
|
||||
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
|
||||
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
|
||||
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
|
||||
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
|
||||
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
||||
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
||||
@@ -0,0 +1,37 @@
|
||||
dnl
|
||||
dnl Copyright © 2016 Quentin “Sardem FF7” Glidic
|
||||
dnl
|
||||
dnl Permission is hereby granted, free of charge, to any person obtaining a
|
||||
dnl copy of this software and associated documentation files (the "Software"),
|
||||
dnl to deal in the Software without restriction, including without limitation
|
||||
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
dnl and/or sell copies of the Software, and to permit persons to whom the
|
||||
dnl Software is furnished to do so, subject to the following conditions:
|
||||
dnl
|
||||
dnl The above copyright notice and this permission notice (including the next
|
||||
dnl paragraph) shall be included in all copies or substantial portions of the
|
||||
dnl Software.
|
||||
dnl
|
||||
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
dnl DEALINGS IN THE SOFTWARE.
|
||||
dnl
|
||||
|
||||
dnl WESTON_SEARCH_LIBS(PREFIX, search-libs, function, [action-if-found], [action-if-not-found], [other-libraries])
|
||||
dnl WESTON_SEARCH_LIBS is a wrapper around AC_SEARCH_LIBS with a little difference:
|
||||
dnl action-if-found is called even if no library is required
|
||||
AC_DEFUN([WESTON_SEARCH_LIBS], [
|
||||
weston_save_LIBS=${LIBS}
|
||||
AC_SEARCH_LIBS([$3], [$2], [$4], [$5], [$6])
|
||||
AS_CASE([${ac_cv_search_][$3][}],
|
||||
['none required'], [$4],
|
||||
[no], [],
|
||||
[$1][_LIBS=${ac_cv_search_][$3][}]
|
||||
)
|
||||
AC_SUBST([$1][_LIBS])
|
||||
LIBS=${weston_save_LIBS}
|
||||
])
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user