Branch data Line data Source code
1 : : // SPDX-License-Identifier: GPL-3.0-or-later
2 : : // SPDX-FileCopyrightText: Andy Holmes <andrew.g.r.holmes@gmail.com>
3 : :
4 : : #include "config.h"
5 : :
6 : : #include <gtk/gtk.h>
7 : : #include <libpeas.h>
8 : : #include <libportal/portal.h>
9 : : #include <valent.h>
10 : :
11 : : #include "valent-xdp-background.h"
12 : : #include "valent-xdp-input.h"
13 : : #include "valent-xdp-session.h"
14 : :
15 : :
16 : : _VALENT_EXTERN void
17 : 0 : valent_xdp_plugin_register_types (PeasObjectModule *module)
18 : : {
19 : : /* This extension only makes sense in a graphical environment. */
20 : 0 : if (gtk_is_initialized ())
21 : : {
22 : 0 : peas_object_module_register_extension_type (module,
23 : : VALENT_TYPE_INPUT_ADAPTER,
24 : : VALENT_TYPE_XDP_INPUT);
25 : : }
26 : :
27 : : /* These extensions only makes sense in a sandbox environment. */
28 : 0 : if (xdp_portal_running_under_sandbox ())
29 : : {
30 : : #ifdef HAVE_LIBPORTAL_GTK4
31 : 0 : peas_object_module_register_extension_type (module,
32 : : VALENT_TYPE_APPLICATION_PLUGIN,
33 : : VALENT_TYPE_XDP_BACKGROUND);
34 : : #endif /* HAVE_LIBPORTAL_GTK4 */
35 : :
36 : 0 : peas_object_module_register_extension_type (module,
37 : : VALENT_TYPE_SESSION_ADAPTER,
38 : : VALENT_TYPE_XDP_SESSION);
39 : : }
40 : 0 : }
41 : :
|