Age | Commit message (Collapse) | Author | Files | Lines |
|
The test suite did not cover wl_interface_equal, so add one test that
specifically tests this method. Add the new test to Makefile.am.
Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
[Pekka: add assert(&wl_registry_interface != ©);]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
Put also test programs into noinst_PROGRAMS so that they get always
built. In check_PROGRAMS they are built for 'make check' but not for
'make'.
This makes it harder to accidentally break the test programs.
v2: also change check_LTLIBRARIES to noinst_LTLIBRARIES
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
|
|
If you assign TESTS into check_PROGRAMS, you cannot add a test that is
not built from source files.
Instead, use a temporary variable built_test_programs to hold the names
that are both programs built from source files and tests to execute.
This change is required by the following patch adding wayland-scanner
test script.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The new wl_display_add_protocol_logger allows to set a function as
a logger, which will get called when a new request is received or an
event is sent.
This is akin to setting WAYLAND_DEBUG=1, but more powerful because it
can be enabled at run time and allows to show the log e.g. in a UI view.
A test is added for the new functionality.
Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
Using display object, Emit a signal if a new client is created.
In the server-side, we can get the destroy event of a client,
But there is no way to get the created event of it.
Of course, we can get the client object from the global registry
binding callbacks.
But it can be called several times with same client object.
And even if A client creates display object,
(so there is a connection), The server could not know that.
There could be more use-cases not only for this.
Giulio: a test is added for the new functionality
Signed-off-by: Sung-jae Park <nicesj@nicesj.com>
Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
When configured with --disable-dtd-validation:
CPPAS src/dtddata.o
src/dtddata.S: Assembler messages:
src/dtddata.S:39: Error: file not found: src/wayland.dtd.embed
Makefile:1520: recipe for target 'src/dtddata.o' failed
This is because the variable name used does not match the implicit
variable name in autoconf.
Fix the variable name, making both --disable-dtd-validation and
--enable-dtd-validation to what they should.
Do not try to build dtddata.S if dtd-validation is disabled. It depends
on wayland.dtd.embed which is created by configure only if
dtd-validation is enabled.
If not building dtddata.S, also make sure the extern definitions in
scanner.c are compiled out.
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=575212
Reported-by: leio@gentoo.org
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
This reverts commit 8125919b0d8e7c776652e4f1d829b9edfa6c4a68.
This makes things far more annoying than intended, especially since
the list of default warnings isn't consistent from distro to distro.
|
|
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
Automake seems to have its own rules for compiling an .o from an .S.
Essentially it does the same as our hand-crafted rule, but adds some
things like dependency file generation.
Remove our hand-crafted rule to use the automake rule, it is less
surprising.
http://www.gnu.org/software/automake/manual/html_node/Assembly-Support.html
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Víctor Jáquez <vjaquez@igalia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Embed the wayland.dtd protocol data into the scanner binary so we can validate
external protocol files without requiring makefile changes. Hat-tip to Pekka
Paalanen for the embedding trick.
The embedding trick doesn't work well if the to-be-embedded file is in a
different location than the source file, so copy/link it during configure and
then build it in from the local directory.
The current expat parser is not a validating parser, moving scanner.c to
another parser has the risk of breaking compatibility. This patch adds libxml2
as extra (optional) dependency, but that also requires parsing the input
twice.
If the protocol fails validation a warning is printed but no error is returned
otherwise.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
This reverts commit 06fb8bd371403d43bc192577abd6b0a0c8b29c59.
Having a DTD hooked up gives an indication of what we expect the protocol to
be, which is a clearer documentation than the current "whatever scanner.c
manages to parse".
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
The wayland scanner defines the protocol. The DTD specification is not used.
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Nils Christopher Brause <nilschrbrause@googlemail.com>
|
|
This splits the bulk of libwayland-util into libwayland-private.
libwayland-util (which is just wayland-util.c) is for use with the scanner.
libwayland-private is everything else.
Most things will want to link both libs.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
The previous idiom for building a cross-compiled Wayland is to build once for
the build host (with --enable-scanner --disable-libraries) to get a
wayland-scanner binary that can then be used in a cross-compile (with
--disable-scanner). The problem with this is that the cross wayland is missing
a wayland-scanner binary, which means you then can't do any Wayland development
on the target.
Instead, always build wayland-scanner for the target and change
--enable/disable-scanner to --with/without-host-scanner. Normal builds use the
default of --without-host-scanner and run the wayland-scanner it just built, and
cross-compiled builds pass --with-host-scanner to use a previously built host
scanner but still get a wayland-scanner to install.
(a theoretically neater solution would be to build two scanners if required (one
to run and one to install), but automake makes this overly complicated)
[daniels: Bikeshedded naming with Ross's OK.]
Signed-off-by: Ross Burton <ross.burton@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
|
|
This will make it easier if we ever want to add new flags to everything
in the future.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
The scanner doesn't need anything but wayland-util.c/.h so we can
shrink wayland-util when not building the main libraries.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
When cross-compiling it may be useful to build only the wayland-scanner
natively. This patch makes it possible to disable build of the libraries.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
AM_CFLAGS are the defaults passed to anything that doesn't specify its own
_CFLAGS, so instead of putting FFI_CFLAGS there, let's just add that to
anything that actually needs it.
The only thing that needs it but didn't have it specifically was
libwayland_util (for connection.c)
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
AM_CFLAGS and AM_CPPFLAGS aren't positional, so putting them at a
random place in Makefile.am can be misleading.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
Some newer versions of doxygen are generating this file now, and if
we don't clean it up distcheck will fail.
Known to affect doxygen 1.8.8 from debian jessie.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Tested-by: Jon A. Cruz <jonc@osg.samsung.com>
|
|
This test checks that the protocol and library headers include only what
they are supposed to include. That is, that the core headers do not
include the protocol headers and that the core protocol headers do not
include the non core library headers.
The build process now generates core protocol headers, but they are only
used in the test and don't get installed.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
The new core header doesn't include any other header, since it really
is not needed.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
wayland-client.h and wayland-server.h include the protocol headers generated
at build time. This means that a libwayland user cannot generate and use
protocol code created from a wayland.xml newer than the installed libwayland,
because it is not possible to only include the API header.
Another use case is language bindings, which would generate their own protocol
code and which only need to use the library ABI, not the generated C code.
This commit adds wayland-client-core.h and wayland-server-core.h which do not
include the protocol headers or any deprecated code.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
This is now done in the same way as the libffi dependency and still
allows the library to be installed in a non-standard location (with
PKG_CONFIG_PATH).
|
|
This test includes one of wayland headers, which produced
error with C++ compiler. C compiler can't be used for this test,
because it issues only a warning[1] and only when wayland headers
are not installed in system headers path (/usr/include).
[1] wayland-server-protocol.h:201:2: warning: implicit declaration of function ‘wl_resource_post_event’
[daniels: Merged in Marek's follow-up to check for a C++ compiler.]
Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
|
|
This patch introduces a set of functions that can create a display
and clients for tests.
On server side the user can use functions:
display_create()
display_destroy()
create_client()
display_run()
display_resume()
and on client side the user can use:
client_connect()
client_disconnect()
stop_display()
The stop_display() and display_resume() are functions that serve as a barrier
and also allow the display to take some action after the display_run() was called,
because after the display is stopped, it can run arbitrary code until it calls
display_resume().
client_connect() function connects to wayland display and creates a proxy to
test_compositor global object, so it can ask for stopping the display later
using stop_display().
An example:
void
client_main()
{
/* or client can use wl_display_connect(NULL)
* and do all the stuff manually */
struct client *c = client_connect();
/* do some stuff, ... */
/* stop the display so that it can
* do some other stuff */
stop_display(c, 1);
/* ... */
client_disconnect(c);
}
TEST(dummy_tst)
{
struct display *d = display_create();
/* set up the display */
wl_global_create(d->wl_display, ...);
/* ... */
create_client(d, client_main);
display_run();
/* if we are here, the display has been stopped
* and we can do some code, i. e. create another global or so */
wl_global_create(d->wl_display, ...);
/* ... */
display_resume(d); /* resume display and clients */
display_destroy(d);
}
v2:
added/changed message in few asserts that were not clear
fixed codying style issues and typo
client_create_with_name: fixed a condition in an assert
get_socket_name: use also pid
check_error: fix errno -> err
[Pekka Paalanen: added test-compositor.h to SOURCES, added
WL_HIDE_DEPRECATED to get rid of deprecated defs and lots of warnings,
fixed one unchecked return value from write().]
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
When an error occurs, wl_display_get_error() does not
provide any way of getting know if it was a local error or if it was
an error event, respectively what object caused the error and what
the error was.
This patch introduces a new function wl_display_get_protocol_error()
which will return error code, interface and id of the object that
generated the error.
wl_display_get_error() will work the same way as before.
wl_display_get_protocol_error() DOES NOT indicate that a non-protocol
error happened. It returns valid information only in that case that
(protocol) error occurred, so it should be used after calling
wl_display_get_error() with positive result.
[Pekka Paalanen] Applied another hunk of Bryce's comments to docs,
added libtool version bump.
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
|
|
The wayland-server-protocol.h and wayland-client-protocol.h headers are
currently being shipped in tarballs created using make dist. This causes
out-of-tree builds to fail since make will detect that the headers exist
by looking at the source directory (via VPATH) and not regenerate them.
But as opposed to ${top_builddir}/protocol, ${top_srcdir}/protocol is
not part of the include path and therefore the shipped files can't be
found during compilation.
Two solutions exist to this problem: 1) add ${top_srcdir}/protocol to
the include path to allow shipped files to be used if available or 2)
don't ship these generated files in release tarballs. The latter seems
the most appropriate. wayland-scanner is already a prerequisite in order
to generate wayland-protocol.c, so it is either built as part of the
package or provided externally. Generating all files from the protocol
definition at build time also ensures that they don't get out of sync.
Both of the generated headers are already listed in Makefile.am as
nodist_*_SOURCES, but at the same time they appear in include_HEADERS,
which will cause them to be added to the list of distributable files
after all. To prevent that, split them off into nodist_include_HEADERS.
Note that this problem will be hidden if a previous version of wayland
has been installed, since these files will exist in /usr/include and be
included from there. So this build error will only show for out-of-tree
builds on systems that don't have wayland installed yet.
Signed-off-by: Thierry Reding <treding@nvidia.com>
|
|
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
|
|
Solves this build error:
tests/fixed-benchmark.o: In function `benchmark':
./wayland/tests/fixed-benchmark.c:82: undefined reference to `clock_gettime'
./wayland/tests/fixed-benchmark.c:84: undefined reference to `clock_gettime'
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
|
|
Fixes the build failure where the protocol headers were not generated at
all before compiling src/.libs/libwayland_server_la-wayland-server.o.
The failure was reproducable by starting fresh with 'git clean -dxf' and
not having any wayland headers installed system-wide.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
|
|
|
|
Fix up the references in include_HEADERS.
|
|
|
|
|
|
|
|
|
|
A small step towards non-recursive build system for wayland too.
|
|
The scanner is not very forgiving if the protocol doesn't match it's
expectations and crashes without much of a notice. Thus, validate the protocol
against a DTD.
Move the protocol subdir forward so we validate first before trying anything
else, and install the DTD so we can validate weston's protocols as well.
|
|
To allow user program to include wayland-scanner.m4 in tarball, move
the path variables from it into wayland-scanner.pc.
|
|
|
|
5909dddc78573774bd3a93c280831a7d18d82994 removed protocol/Makefile.am
which meant protocol/wayland.xml no longer got included in the tarball.
Add back protocol/Makefile.am and configure.ac bits and add protocol to
subdirs in Makefile.am to fix this.
|
|
This was added previously (commit 015c42e1) when we didn't have docbook
formatted documentation. Now it became quite useless.
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
|
|
Also, now doxygen is mandatory for building the documentation (looks
reasonable because both man-pages and publican will need it).
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
|
|
The purpose of this library is to be the equivalent of libXcursor in
the X world. This library is compatible with X cursor themes and loads
them directly into an shm pool making it easy for the clients to get
buffer for each cursor image.
The code for handling the X cursor theme was taken from libXcursor. The
files cursor/xcursor.[ch] are a stripped down version of that library
containing only the interfaces necessary for implementing the wayland
counterpart.
|
|
Artie spotted this.
|
|
automake doesn't seem to provide a sensible method to install a directory of
stuff in $(docdir). Do it manually then.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
Includes rudimentary styling only.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|