This is the start of what will be a rather incisive surgery on
pipewire.c. Move a couple of functions to portal.c, since they're
not really related to the PipeWire code.
This is very much like previous commit, but there's a catch: there
already was an enumeration in place, which is replaced in this
commit. The obs_pw_capture_type enum was introduced before splitting
the portal code into a separate file, and the enum itself is specific
to the screencast portal, so the appropriate place to enumerate it
is in portal.h.
For completude, PORTAL_CAPTURE_TYPE_VIRTUAL was added to the enum,
even though we never used, and probably never will.
The values are still the same, since both the old and this new enum
were extracted from the screencast portal [1].
https://github.com/flatpak/xdg-desktop-portal/blob/main/data/org.freedesktop.portal.ScreenCast.xml#L290-300
The ScreenCast portal defines 3 cursor modes [1]:
* Hidden: no visible cursor (value: 1)
* Embedded: cursor is drawn in the frames (value: 2)
* Metadata: cursor is sent as stream metadata (value: 4)
The values are power-of-two due to be used as flags.
Explicitly listing these values in an enum improves legibility
of the code, so do that instead of hardcoding 1, 2, and 4.
[1] https://github.com/flatpak/xdg-desktop-portal/blob/main/data/org.freedesktop.portal.ScreenCast.xml#L302-L316
The portal.c file was introduced after the PipeWire code landed, and
handles acquiring a D-Bus connection to the portal interface, and also
has helpers to get properties from portals. The available cursor modes
property fits nicely in portal.c.
Move fetching the cursor mode to portal.c.