Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-04 09:44:51

0001 /* GDBus - GLib D-Bus Library
0002  *
0003  * Copyright (C) 2008-2010 Red Hat, Inc.
0004  *
0005  * SPDX-License-Identifier: LGPL-2.1-or-later
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General
0018  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Author: David Zeuthen <davidz@redhat.com>
0021  */
0022 
0023 #ifndef __G_DBUS_NAME_OWNING_H__
0024 #define __G_DBUS_NAME_OWNING_H__
0025 
0026 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
0027 #error "Only <gio/gio.h> can be included directly."
0028 #endif
0029 
0030 #include <gio/giotypes.h>
0031 
0032 G_BEGIN_DECLS
0033 
0034 /**
0035  * GBusAcquiredCallback:
0036  * @connection: the connection to a message bus
0037  * @name: the name that is requested to be owned
0038  * @user_data: user data passed to [func@Gio.bus_own_name]
0039  *
0040  * Invoked when a connection to a message bus has been obtained.
0041  *
0042  * Since: 2.26
0043  */
0044 typedef void (*GBusAcquiredCallback) (GDBusConnection *connection,
0045                                       const gchar     *name,
0046                                       gpointer         user_data);
0047 
0048 /**
0049  * GBusNameAcquiredCallback:
0050  * @connection: the connection on which to acquired the name
0051  * @name: the name being owned
0052  * @user_data: user data passed to [func@Gio.bus_own_name] or
0053  *   [func@Gio.bus_own_name_on_connection]
0054  *
0055  * Invoked when the name is acquired.
0056  *
0057  * Since: 2.26
0058  */
0059 typedef void (*GBusNameAcquiredCallback) (GDBusConnection *connection,
0060                                           const gchar     *name,
0061                                           gpointer         user_data);
0062 
0063 /**
0064  * GBusNameLostCallback:
0065  * @connection: the connect on which to acquire the name or `NULL` if
0066  *   the connection was disconnected
0067  * @name: the name being owned
0068  * @user_data: user data passed to [func@Gio.bus_own_name] or
0069  *   [func@Gio.bus_own_name_on_connection]
0070  *
0071  * Invoked when the name is lost or @connection has been closed.
0072  *
0073  * Since: 2.26
0074  */
0075 typedef void (*GBusNameLostCallback) (GDBusConnection *connection,
0076                                       const gchar     *name,
0077                                       gpointer         user_data);
0078 
0079 GIO_AVAILABLE_IN_ALL
0080 guint g_bus_own_name                 (GBusType                  bus_type,
0081                                       const gchar              *name,
0082                                       GBusNameOwnerFlags        flags,
0083                                       GBusAcquiredCallback      bus_acquired_handler,
0084                                       GBusNameAcquiredCallback  name_acquired_handler,
0085                                       GBusNameLostCallback      name_lost_handler,
0086                                       gpointer                  user_data,
0087                                       GDestroyNotify            user_data_free_func);
0088 
0089 GIO_AVAILABLE_IN_ALL
0090 guint g_bus_own_name_on_connection   (GDBusConnection          *connection,
0091                                       const gchar              *name,
0092                                       GBusNameOwnerFlags        flags,
0093                                       GBusNameAcquiredCallback  name_acquired_handler,
0094                                       GBusNameLostCallback      name_lost_handler,
0095                                       gpointer                  user_data,
0096                                       GDestroyNotify            user_data_free_func);
0097 
0098 GIO_AVAILABLE_IN_ALL
0099 guint g_bus_own_name_with_closures   (GBusType                  bus_type,
0100                                       const gchar              *name,
0101                                       GBusNameOwnerFlags        flags,
0102                                       GClosure                 *bus_acquired_closure,
0103                                       GClosure                 *name_acquired_closure,
0104                                       GClosure                 *name_lost_closure);
0105 
0106 GIO_AVAILABLE_IN_ALL
0107 guint g_bus_own_name_on_connection_with_closures (
0108                                       GDBusConnection          *connection,
0109                                       const gchar              *name,
0110                                       GBusNameOwnerFlags        flags,
0111                                       GClosure                 *name_acquired_closure,
0112                                       GClosure                 *name_lost_closure);
0113 
0114 GIO_AVAILABLE_IN_ALL
0115 void  g_bus_unown_name               (guint                     owner_id);
0116 
0117 G_END_DECLS
0118 
0119 #endif /* __G_DBUS_NAME_OWNING_H__ */