Commit Graph

24 Commits

Author SHA1 Message Date
Felipe Borges
14c368d9e7 Add VAPI (vala) support 2023-04-17 12:46:26 +02:00
Bilal Elmoussaoui
c7ba1c0104 build: Add an option to disable introspection 2023-03-30 13:15:00 +02:00
Bilal Elmoussaoui
89d37ada0d lib: Add missing headers & fix enums install dir 2023-03-29 13:09:33 +02:00
Christian Hergert
39a0bb2658 lib: add MksSpeaker
This isn't attached to AudioOut interface yet, but starts on the API to
be defined for that.
2023-02-18 09:44:21 -08:00
Christian Hergert
a12ee6da68 build: add -lm to library 2023-02-17 16:27:53 -08:00
Christian Hergert
edfe01bf99 lib: add inhibitor helper
This is an object which is meant to be acquired/released in response to
user input. Currently, it will inhibit the shortcuts in the display server
if possible.

Some additional things may be added eventually like relative pointers or
similar (by grabbing pointer input).
2023-02-17 15:33:40 -08:00
Christian Hergert
d0909732f4 lib: add MksDisplayPicture
This is a child widget to the MksDisplay which contains just the paintable
region of the remote screen. Doing so allows us to avoid having to handle
crossing events carefully for things like cursors.

Instead, now the MksDisplay calculates the area for the picture and
allocates it there. The MksDisplayPicture will always snapshot the
paintable using the full area it has been allocated.

Event processing can also largely move into the Picture widget which
simplifies bounds checking.
2023-02-17 11:40:47 -08:00
Christian Hergert
03f64892e5 lib: add marshallers for internal use 2023-02-15 12:15:54 -08:00
Christian Hergert
eb32afc2a9 lib: add util to check for inverted scroll
This has limited functionality because what we really need is support for
wayland!183 as it would only work unsandboxed.

But it provides a convenient abstraction point for implementing that as
well once we have it.
2023-02-15 10:32:05 -08:00
Christian Hergert
2e842f7e7f lib: add GdkDmabufPaintable
This just starts on the DMA-BUF code and abstracts MksPaintable so it can
encapsulate both MksDmabufPaintable and MksCairoFramebuffer.

Currently, the dmabuf just tailes everything (fully) but we can fix that
with snapshot work stil. Either way, want to get the abstraction landed
first before we dive deeper into that.
2023-02-14 16:27:09 -08:00
Christian Hergert
6beaf8b925 lib: encapsulate GtkPicture within MksDisplay
We don't need to do this manually now that we have GtkPicture working
correctly with content-fit. We still want to maintain our own widget to
manage things like grabs and all that though.
2023-02-14 11:18:48 -08:00
Christian Hergert
d20dcd2674 lib: start on MksDisplay widget 2023-02-13 21:53:57 -08:00
Christian Hergert
01dab99590 lib: add MksCairoFramebuffer
This adds MksCairoFramebuffer which does tessellation to get damage regions
for the framebuffer. Still some bugs involved, but good enough to get some
bits on the screen which is what I'm looking for right now.
2023-02-13 17:38:30 -08:00
Christian Hergert
ed03ea5148 lib: move PaintableListener into MksPaintable
The goal here is to keep the MksPaintableListener inside of MksPaintable
so that we don't have to create API between the two. Additionally, the
MksPaintable can own it's own G-DBus connection as we don't want to share
them for updates with anything else (as they can have large data chunks
coming across).
2023-02-10 16:14:51 -08:00
Christian Hergert
07158dfa07 lib: add a framebuffer paintable
This is intended to be the software fallback path where we have to take
Update() and Scanout() method invocations from the Qemu instance. It
implements paintable and tries to reuse a backing texture until a threshold
has been met at which point it does a full redraw.

The backing texture is reused between snapshots to increase the chance that
we may skip a followup VRAM upload to the GPU. The damage rectangles will
be re-uploaded each frame. There is some opportunity to optimize that
last part by keeping them around and adding a secondary damage region.

Of course, we would still want things to go the MksDmabufTexture path
when possible.
2023-02-10 12:47:35 -08:00
Christian Hergert
8abd0b22cf build: keep sources list near other sources 2023-02-10 12:44:50 -08:00
Christian Hergert
5e75216318 lib: stub internal listener skeleton
This is an org.qemu.Listener using the gdbus-codegen generated skeleton as
the parent type.

What will probably happen here, is that we create a MksPaintable which is
given to the listener to call internal API upon.

The paintable code will be a bit more complex than originally anticipated
in that we are going to need to do our own tessellation so that we get
damage regions which are not the whole widget. Very similar to what I did
in the GdkMacosTile for gdk/macos/.
2023-02-09 17:30:38 -08:00
Christian Hergert
9bb71b8ea8 lib: add MksScreenAttributes and mks_screen_configure()
MksScreenAttributes is an opaque type with setters so that we can
potentially extend it in the future without ABI issues.

Furthermore, this adds a configure API for both sync and async to
MksScreen.

Currently, I get NOT_SUPPORTED back from Qemu, but I think that's because
I'm not even past the bootloader/EFI stage for tests.
2023-02-09 15:39:03 -08:00
Christian Hergert
dac3fc284a lib: add MksPaintable
This is intended to be connected to a MksScreen and create a Listener to
get DMA-BUF scanout from Qemu.
2023-02-09 04:38:48 -08:00
Christian Hergert
b976580e43 session: use GDBus object manager to track objects
This changes things to use the object manager to discover the VM instance.
We'll have to add support for other wrappers to use object managers so that
they can be added to the devices list as they are seen.
2023-02-09 01:14:47 -08:00
Christian Hergert
0af4760feb build: ensure access to enums from libmks_dep 2023-02-09 00:23:37 -08:00
Christian Hergert
12edec8262 screen: add keyboard and mouse properties
Adds MksKeyboard and MksMouse types. Setup a MksScreenKind for the
MksScreen based on MksQemuConsole:type property. Currently the keyboard
and mouse are not wired up, but here for scoping out the properties.
2023-02-08 21:58:35 -08:00
Christian Hergert
0dd3cf39a2 build: include sources and headers for GIR 2023-02-08 20:25:08 -08:00
Christian Hergert
5d012259d9 initial commit
This library doesn't do much yet. It contains the scaffolding and the
rough shape of what I think the API should be in mks-types.h. Some of the
types have some skeleton implementation as well to hid the D-Bus API
behind those types.

The next steps are to fill out the other wrapper objects and see what
properties we should expose from the underlying D-Bus proxies.

Along with that, will be a GtkWidget which can have a number of properties
set on it to specify the MksScreen, MksKeyboard, and MksMouse devices. It
may make sense to attach the session + screen to the widget, so that it can
adapt to keyboard and mouse changes though.
2023-02-08 18:06:08 -08:00