Debian Codegraph @

src/dex-gdbus.h

raw symbols SCIP
1 /*
2 * dex-gdbus.h
3 *
4 * Copyright 2025 Red Hat, Inc.
5 *
6 * This library is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of the
9 * License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * SPDX-License-Identifier: LGPL-2.1-or-later
20 */
21
22 #pragma once
23
24 #include <gio/gio.h>
25
26 #ifdef G_OS_UNIX
27 # include <gio/gunixfdlist.h>
28 #endif
29
30 #include "dex-features.h"
31 #include "dex-future.h"
32
33 G_BEGIN_DECLS
34
35 #ifdef DEX_FEATURE_GDBUS_CODEGEN
36 /**
37 * DexDBusInterfaceSkeletonFlags:
38 * @DEX_DBUS_INTERFACE_SKELETON_FLAGS_NONE: No flags set.
39 * @DEX_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_FIBER: Each method invocation is
40 * handled in a fiber dedicated to the invocation. This means that the method implementation can
41 * use dex_await or similar. Authorization for method invocations uses the same fiber.
42 * This can not be used in combination with METHOD_INVOCATIONS_IN_THREAD and trying to do so leads
43 * to a runtime error.
44 *
45 * Flags describing the behavior of a #GDBusInterfaceSkeleton instance.
46 *
47 * Since: 1.1
48 */
49 typedef enum
50 {
51 DEX_DBUS_INTERFACE_SKELETON_FLAGS_NONE = 0,
52 DEX_DBUS_INTERFACE_SKELETON_FLAGS_HANDLE_METHOD_INVOCATIONS_IN_FIBER = (1 << 0),
53 } DexDBusInterfaceSkeletonFlags;
54
55 #define DEX_TYPE_DBUS_INTERFACE_SKELETON (dex_dbus_interface_skeleton_get_type ())
56 DEX_AVAILABLE_IN_1_1
57 G_DECLARE_DERIVABLE_TYPE (DexDBusInterfaceSkeleton,
58 dex_dbus_interface_skeleton,
59 DEX, DBUS_INTERFACE_SKELETON,
60 GDBusInterfaceSkeleton)
61
62 struct _DexDBusInterfaceSkeletonClass
63 {
64 GDBusInterfaceSkeletonClass parent_class;
65 };
66
67 DEX_AVAILABLE_IN_1_1
68 void dex_dbus_interface_skeleton_cancel (DexDBusInterfaceSkeleton *interface_);
69 DEX_AVAILABLE_IN_1_1
70 DexDBusInterfaceSkeletonFlags dex_dbus_interface_skeleton_get_flags (DexDBusInterfaceSkeleton *interface_);
71 DEX_AVAILABLE_IN_1_1
72 void dex_dbus_interface_skeleton_set_flags (DexDBusInterfaceSkeleton *interface_,
73 DexDBusInterfaceSkeletonFlags flags);
74 #endif /* DEX_FEATURE_GDBUS_CODEGEN */
75
76 DEX_AVAILABLE_IN_ALL
77 DexFuture *dex_bus_get (GBusType bus_type) G_GNUC_WARN_UNUSED_RESULT;
78 DEX_AVAILABLE_IN_1_1
79 void dex_bus_own_name_on_connection (GDBusConnection *connection,
80 const char *name,
81 GBusNameOwnerFlags flags,
82 DexFuture **out_name_acquired_future,
83 DexFuture **out_name_lost_future);
84 DEX_AVAILABLE_IN_ALL
85 DexFuture *dex_dbus_connection_call (GDBusConnection *connection,
86 const char *bus_name,
87 const char *object_path,
88 const char *interface_name,
89 const char *method_name,
90 GVariant *parameters,
91 const GVariantType *reply_type,
92 GDBusCallFlags flags,
93 int timeout_msec) G_GNUC_WARN_UNUSED_RESULT;
94 DEX_AVAILABLE_IN_ALL
95 DexFuture *dex_dbus_connection_close (GDBusConnection *connection) G_GNUC_WARN_UNUSED_RESULT;
96 DEX_AVAILABLE_IN_ALL
97 DexFuture *dex_dbus_connection_send_message_with_reply (GDBusConnection *connection,
98 GDBusMessage *message,
99 GDBusSendMessageFlags flags,
100 int timeout_msec,
101 guint32 *out_serial) G_GNUC_WARN_UNUSED_RESULT;
102 #ifdef G_OS_UNIX
103 DEX_AVAILABLE_IN_ALL
104 DexFuture *dex_dbus_connection_call_with_unix_fd_list (GDBusConnection *connection,
105 const char *bus_name,
106 const char *object_path,
107 const char *interface_name,
108 const char *method_name,
109 GVariant *parameters,
110 const GVariantType *reply_type,
111 GDBusCallFlags flags,
112 int timeout_msec,
113 GUnixFDList *fd_list) G_GNUC_WARN_UNUSED_RESULT;
114 #endif
115
116 G_END_DECLS