Add beginning of input capture API

This API aims to provide a way for users to capture input devices under
certain conditions, for example when a pointer crosses a specified
barrier.

So far only part of the API is implemented, specifially the session
management as well as zone advertisement, where a zone refers to a
region in the compositor which edges will eventually be made available
for barrier placement.

So far the remote access handle is created while the session is enable,
despite the input capturing isn't actually active yet. This will change
in the future once it can actually become active.

v2: Remove absolute/relative pointer, keep only pointer (ofourdan)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2628>
This commit is contained in:
Jonas Ådahl
2022-03-30 17:27:51 +02:00
committed by Carlos Garnacho
parent 2305efa990
commit a8b013b006
11 changed files with 1396 additions and 0 deletions

View File

@ -0,0 +1,42 @@
/*
* Copyright (C) 2022 Red Hat 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 of the
* License, 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef META_INPUT_CAPTURE_SESSION_H
#define META_INPUT_CAPTURE_SESSION_H
#include <glib-object.h>
#include "backends/meta-input-capture.h"
#include "meta/meta-remote-access-controller.h"
#define META_TYPE_INPUT_CAPTURE_SESSION (meta_input_capture_session_get_type ())
G_DECLARE_FINAL_TYPE (MetaInputCaptureSession, meta_input_capture_session,
META, INPUT_CAPTURE_SESSION,
MetaDBusInputCaptureSessionSkeleton)
#define META_TYPE_INPUT_CAPTURE_SESSION_HANDLE (meta_input_capture_session_handle_get_type ())
G_DECLARE_FINAL_TYPE (MetaInputCaptureSessionHandle,
meta_input_capture_session_handle,
META, INPUT_CAPTURE_SESSION_HANDLE,
MetaRemoteAccessHandle)
char *meta_input_capture_session_get_object_path (MetaInputCaptureSession *session);
#endif /* META_INPUT_CAPTURE_SESSION_H */