Commit Graph

14 Commits

Author SHA1 Message Date
Philipp Zabel c6e47d177a libweston: consolidate weston_compositor_create_output(_with_head)
Add a struct weston_head parameter to weston_compositor_create_output()
and fold weston_compositor_create_output_with_head() into it.

See: https://gitlab.freedesktop.org/wayland/weston/-/issues/268

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-06-10 09:27:43 +00:00
Maxime Roussin-Bélanger 4cff869a4f doc: fix typos
Signed-off-by: Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com>
2021-02-24 10:01:25 -05:00
Leandro Ribeiro ca640d5120 libweston: fold weston_compositor_tear_down() into weston_compositor_destroy()
The only reason why we have both weston_compositor_tear_down() and
weston_compositor_destroy() is that the only we had to destroy
the log context was keeping weston_compositor alive and calling
weston_log_ctx_compositor_destroy().

After commit "weston-log: replace weston_log_ctx_compositor_destroy()
by weston_log_ctx_destroy()", it's not necessary to keep a zombie
weston_compositor just to be able to call
weston_log_ctx_compositor_destroy().

Fold weston_compositor_tear_down() into weston_compositor_destroy(),
as this split is useless now.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:15:16 -03:00
Leandro Ribeiro 4ec38d18b3 weston-log: replace weston_log_ctx_compositor_destroy() by weston_log_ctx_destroy()
The function weston_log_ctx_compositor_destroy(), which destroys struct
weston_log_context, takes weston_compositor as argument. We may have a
weston_log_context unlinked from a weston_compositor and currently there
is no way to destroy it.

Add function weston_log_ctx_destroy(), what makes the destruction of
weston_log_context independent of weston_compositor.

With this change, one could destroy a weston_compositor and keep the
related weston_log_context (since now weston_log_context can be destroyed
without the need of a weston_compositor). But if weston_compositor gets
destroyed it's also necessary to destroy weston_log_context::global,
as the debug protocol depends on the compositor. So a listener has been
added to the destroy signal of weston_compositor.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:08:54 -03:00
Leandro Ribeiro 4f13595aa7 weston-log: rename weston_log_ctx_compositor_create() to weston_log_ctx_create()
Since weston_log_ctx_compositor_create() does not have any relation
with weston_compositor, rename it to weston_log_ctx_create().

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:08:54 -03:00
Leandro Ribeiro f66685d9db weston-log: add function to avoid direct access to compositor members in non-core code
If we use the function weston_log_context_add_log_scope()
in non-core code, it's necessary to access
weston_compositor::weston_log_ctx.

This is not ideal, since the goal is to make core structs
(weston_compositor, weston_surface, weston_output, etc)
opaque.

Add function weston_compositor_add_log_scope(), so non-core
users are able to pass weston_compositor as argument instead
of weston_compositor::weston_log_ctx.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 09:55:24 +00:00
Leandro Ribeiro f014964f6f weston-log: rename the confusing function name weston_compositor_log_scope_destroy()
There's a function named weston_compositor_log_scope_destroy()
but it doesn't take a struct weston_compositor argument.

Rename it to weston_log_scope_destroy(), as the argument is a
struct weston_log_scope.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-27 13:43:24 -03:00
Leandro Ribeiro 5976dbbbb5 weston-log: rename the confusing function name weston_compositor_add_log_scope()
There's a function named weston_compositor_add_log_scope()
but it doesn't take a struct weston_compositor argument.

Rename it to weston_log_ctx_add_log_scope(), as
the log_scope is being added to a log_context.

Also, bump libweston_major to 9.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-27 13:42:42 -03:00
Pekka Paalanen 9dccfd1ef3 doc: output management sequence diagrams
When we were designing the libweston output API, I wrote a design document
as a Phabricator wiki page. Phabricator is no longer accessible so that
information needs to be migrated to a new place. Here I am converting most of
it into libweston Sphinx documentation, particularly pulling in the sequence
diagrams I drew. This should help people understand how libweston output
configuration works.

The diagrams are committed as both MSC source files and rendered PNG files. I
did not bother tinkering with the build to run mscgen automatically and then
with the CI images to install the tool.

The Sphinx configuration need numref explicitly enabled so that figures are
automatically numbered and can be referenced by their number rather than their
whole caption text(!).

The document structure is changed a little better flowing with Output
Management being the overview page and the Heads and Outputs being the API
pages.

First I wrote the struct weston_output and weston_head descriptions in Doxygen
comments in libweston.h, but then in the API page that text would have been
buried somewhere towards the end of the page. So I put that text in ReST
instead where it comes as first on the pages as it should. The doc for the
structs only contain a link to the top of the page. Yes, the comment style in
libweston.h is a little broken. If I left the asterisk there it would show up
as a bullet point in Sphinx. OTOH putting everything from \rst in a single line
did not produce anything.

Because Sphinx cannot look in two places, the images need to be copied into the
build dir too.

mscgen: http://www.mcternan.me.uk/mscgen/

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/25

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-27 12:14:14 +00:00
Marius Vlad 23d01c67a3 doc/sphinx: Add some documentation about timeline points
Use doxygen ingroup command as to show the symbols in the sphinx
documentation.

Include some basic comments and document the exported functions from
timeline.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-10-17 21:42:25 +03:00
Marius Vlad 8110e8de61 doc/sphinx: Add documentation for the logging/debugging framework
This details the logging/debugging framework with the latest changes,
making use of the groups added by "weston-log: Start adding
documentation" and "libweston/log: Add 'wlog' group".

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 13:34:04 +03:00
Marius Vlad 284d5345ad compositor: Destroy the compositor before the log scope
Destroying the compositor after destroying the log scope will not print
out the messages in the tear down/clean-up phase of the compositor, so
add a new tear_down function which allows keeping a valid reference to
the compositor. This way we can destroy the compositor before destroying
the scope and keep the debug messages.

While at it remove the log context destroy part from the clean-up
of the compositor and make it stand on its own.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 13:34:04 +03:00
Marius Vlad 57e2cc22d2 doc/sphinx: Add 'weston_compositor', 'weston_output' and 'weston_head' API
Demonstrates how to call/use the 'doxygen*' breathe directives. Make
use of previous patches that tag symbols using 'ingroup' doxygen
command.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00
Marius Vlad bbf6ea0b4f build: Add sphinx/breathe support for generating documentation
This is adds basic configuration files for doxygen and for breathe,
which is a doxygen-to-sphinx bridge that can document C symbols.

Breathe is configured with default project 'weston' and implicitly adds
:members: and :undoc-members: to breathe configuration options.
This allows a shorter way to call breathe directives without the need
specify the project and also to display implicitly all the members,
documented or not.

A 'docs' run_target to force the docs to be re-built has been added.
Initially (the first time the build system is ran) the documentation
will automatically be built, but later re-builds will require the use of
the 'docs' target. This avoid further delays in building weston but in
the same time allows the possiblity to update/improve the documentation
bits to those who want that.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00