File indexing completed on 2026-09-09 09:10:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifndef __G_DBUS_CONNECTION_H__
0024 #define __G_DBUS_CONNECTION_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 #define G_TYPE_DBUS_CONNECTION (g_dbus_connection_get_type ())
0035 #define G_DBUS_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_DBUS_CONNECTION, GDBusConnection))
0036 #define G_IS_DBUS_CONNECTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_DBUS_CONNECTION))
0037
0038 GIO_AVAILABLE_IN_ALL
0039 GType g_dbus_connection_get_type (void) G_GNUC_CONST;
0040
0041
0042
0043 GIO_AVAILABLE_IN_ALL
0044 void g_bus_get (GBusType bus_type,
0045 GCancellable *cancellable,
0046 GAsyncReadyCallback callback,
0047 gpointer user_data);
0048 GIO_AVAILABLE_IN_ALL
0049 GDBusConnection *g_bus_get_finish (GAsyncResult *res,
0050 GError **error);
0051 GIO_AVAILABLE_IN_ALL
0052 GDBusConnection *g_bus_get_sync (GBusType bus_type,
0053 GCancellable *cancellable,
0054 GError **error);
0055
0056
0057
0058 GIO_AVAILABLE_IN_ALL
0059 void g_dbus_connection_new (GIOStream *stream,
0060 const gchar *guid,
0061 GDBusConnectionFlags flags,
0062 GDBusAuthObserver *observer,
0063 GCancellable *cancellable,
0064 GAsyncReadyCallback callback,
0065 gpointer user_data);
0066 GIO_AVAILABLE_IN_ALL
0067 GDBusConnection *g_dbus_connection_new_finish (GAsyncResult *res,
0068 GError **error);
0069 GIO_AVAILABLE_IN_ALL
0070 GDBusConnection *g_dbus_connection_new_sync (GIOStream *stream,
0071 const gchar *guid,
0072 GDBusConnectionFlags flags,
0073 GDBusAuthObserver *observer,
0074 GCancellable *cancellable,
0075 GError **error);
0076
0077 GIO_AVAILABLE_IN_ALL
0078 void g_dbus_connection_new_for_address (const gchar *address,
0079 GDBusConnectionFlags flags,
0080 GDBusAuthObserver *observer,
0081 GCancellable *cancellable,
0082 GAsyncReadyCallback callback,
0083 gpointer user_data);
0084 GIO_AVAILABLE_IN_ALL
0085 GDBusConnection *g_dbus_connection_new_for_address_finish (GAsyncResult *res,
0086 GError **error);
0087 GIO_AVAILABLE_IN_ALL
0088 GDBusConnection *g_dbus_connection_new_for_address_sync (const gchar *address,
0089 GDBusConnectionFlags flags,
0090 GDBusAuthObserver *observer,
0091 GCancellable *cancellable,
0092 GError **error);
0093
0094
0095
0096 GIO_AVAILABLE_IN_ALL
0097 void g_dbus_connection_start_message_processing (GDBusConnection *connection);
0098 GIO_AVAILABLE_IN_ALL
0099 gboolean g_dbus_connection_is_closed (GDBusConnection *connection);
0100 GIO_AVAILABLE_IN_ALL
0101 GIOStream *g_dbus_connection_get_stream (GDBusConnection *connection);
0102 GIO_AVAILABLE_IN_ALL
0103 const gchar *g_dbus_connection_get_guid (GDBusConnection *connection);
0104 GIO_AVAILABLE_IN_ALL
0105 const gchar *g_dbus_connection_get_unique_name (GDBusConnection *connection);
0106 GIO_AVAILABLE_IN_ALL
0107 GCredentials *g_dbus_connection_get_peer_credentials (GDBusConnection *connection);
0108
0109 GIO_AVAILABLE_IN_2_34
0110 guint32 g_dbus_connection_get_last_serial (GDBusConnection *connection);
0111
0112 GIO_AVAILABLE_IN_ALL
0113 gboolean g_dbus_connection_get_exit_on_close (GDBusConnection *connection);
0114 GIO_AVAILABLE_IN_ALL
0115 void g_dbus_connection_set_exit_on_close (GDBusConnection *connection,
0116 gboolean exit_on_close);
0117 GIO_AVAILABLE_IN_ALL
0118 GDBusCapabilityFlags g_dbus_connection_get_capabilities (GDBusConnection *connection);
0119 GIO_AVAILABLE_IN_2_60
0120 GDBusConnectionFlags g_dbus_connection_get_flags (GDBusConnection *connection);
0121
0122
0123
0124 GIO_AVAILABLE_IN_ALL
0125 void g_dbus_connection_close (GDBusConnection *connection,
0126 GCancellable *cancellable,
0127 GAsyncReadyCallback callback,
0128 gpointer user_data);
0129 GIO_AVAILABLE_IN_ALL
0130 gboolean g_dbus_connection_close_finish (GDBusConnection *connection,
0131 GAsyncResult *res,
0132 GError **error);
0133 GIO_AVAILABLE_IN_ALL
0134 gboolean g_dbus_connection_close_sync (GDBusConnection *connection,
0135 GCancellable *cancellable,
0136 GError **error);
0137
0138
0139
0140 GIO_AVAILABLE_IN_ALL
0141 void g_dbus_connection_flush (GDBusConnection *connection,
0142 GCancellable *cancellable,
0143 GAsyncReadyCallback callback,
0144 gpointer user_data);
0145 GIO_AVAILABLE_IN_ALL
0146 gboolean g_dbus_connection_flush_finish (GDBusConnection *connection,
0147 GAsyncResult *res,
0148 GError **error);
0149 GIO_AVAILABLE_IN_ALL
0150 gboolean g_dbus_connection_flush_sync (GDBusConnection *connection,
0151 GCancellable *cancellable,
0152 GError **error);
0153
0154
0155
0156 GIO_AVAILABLE_IN_ALL
0157 gboolean g_dbus_connection_send_message (GDBusConnection *connection,
0158 GDBusMessage *message,
0159 GDBusSendMessageFlags flags,
0160 volatile guint32 *out_serial,
0161 GError **error);
0162 GIO_AVAILABLE_IN_ALL
0163 void g_dbus_connection_send_message_with_reply (GDBusConnection *connection,
0164 GDBusMessage *message,
0165 GDBusSendMessageFlags flags,
0166 gint timeout_msec,
0167 volatile guint32 *out_serial,
0168 GCancellable *cancellable,
0169 GAsyncReadyCallback callback,
0170 gpointer user_data);
0171 GIO_AVAILABLE_IN_ALL
0172 GDBusMessage *g_dbus_connection_send_message_with_reply_finish (GDBusConnection *connection,
0173 GAsyncResult *res,
0174 GError **error);
0175 GIO_AVAILABLE_IN_ALL
0176 GDBusMessage *g_dbus_connection_send_message_with_reply_sync (GDBusConnection *connection,
0177 GDBusMessage *message,
0178 GDBusSendMessageFlags flags,
0179 gint timeout_msec,
0180 volatile guint32 *out_serial,
0181 GCancellable *cancellable,
0182 GError **error);
0183
0184
0185
0186 GIO_AVAILABLE_IN_ALL
0187 gboolean g_dbus_connection_emit_signal (GDBusConnection *connection,
0188 const gchar *destination_bus_name,
0189 const gchar *object_path,
0190 const gchar *interface_name,
0191 const gchar *signal_name,
0192 GVariant *parameters,
0193 GError **error);
0194 GIO_AVAILABLE_IN_ALL
0195 void g_dbus_connection_call (GDBusConnection *connection,
0196 const gchar *bus_name,
0197 const gchar *object_path,
0198 const gchar *interface_name,
0199 const gchar *method_name,
0200 GVariant *parameters,
0201 const GVariantType *reply_type,
0202 GDBusCallFlags flags,
0203 gint timeout_msec,
0204 GCancellable *cancellable,
0205 GAsyncReadyCallback callback,
0206 gpointer user_data);
0207 GIO_AVAILABLE_IN_ALL
0208 GVariant *g_dbus_connection_call_finish (GDBusConnection *connection,
0209 GAsyncResult *res,
0210 GError **error);
0211 GIO_AVAILABLE_IN_ALL
0212 GVariant *g_dbus_connection_call_sync (GDBusConnection *connection,
0213 const gchar *bus_name,
0214 const gchar *object_path,
0215 const gchar *interface_name,
0216 const gchar *method_name,
0217 GVariant *parameters,
0218 const GVariantType *reply_type,
0219 GDBusCallFlags flags,
0220 gint timeout_msec,
0221 GCancellable *cancellable,
0222 GError **error);
0223
0224 #ifdef G_OS_UNIX
0225
0226 GIO_AVAILABLE_IN_2_30
0227 void g_dbus_connection_call_with_unix_fd_list (GDBusConnection *connection,
0228 const gchar *bus_name,
0229 const gchar *object_path,
0230 const gchar *interface_name,
0231 const gchar *method_name,
0232 GVariant *parameters,
0233 const GVariantType *reply_type,
0234 GDBusCallFlags flags,
0235 gint timeout_msec,
0236 GUnixFDList *fd_list,
0237 GCancellable *cancellable,
0238 GAsyncReadyCallback callback,
0239 gpointer user_data);
0240 GIO_AVAILABLE_IN_2_30
0241 GVariant *g_dbus_connection_call_with_unix_fd_list_finish (GDBusConnection *connection,
0242 GUnixFDList **out_fd_list,
0243 GAsyncResult *res,
0244 GError **error);
0245 GIO_AVAILABLE_IN_2_30
0246 GVariant *g_dbus_connection_call_with_unix_fd_list_sync (GDBusConnection *connection,
0247 const gchar *bus_name,
0248 const gchar *object_path,
0249 const gchar *interface_name,
0250 const gchar *method_name,
0251 GVariant *parameters,
0252 const GVariantType *reply_type,
0253 GDBusCallFlags flags,
0254 gint timeout_msec,
0255 GUnixFDList *fd_list,
0256 GUnixFDList **out_fd_list,
0257 GCancellable *cancellable,
0258 GError **error);
0259
0260 #endif
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275
0276
0277
0278
0279
0280
0281
0282
0283
0284
0285
0286
0287
0288
0289 typedef void (*GDBusInterfaceMethodCallFunc) (GDBusConnection *connection,
0290 const gchar *sender,
0291 const gchar *object_path,
0292 const gchar *interface_name,
0293 const gchar *method_name,
0294 GVariant *parameters,
0295 GDBusMethodInvocation *invocation,
0296 gpointer user_data);
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317 typedef GVariant *(*GDBusInterfaceGetPropertyFunc) (GDBusConnection *connection,
0318 const gchar *sender,
0319 const gchar *object_path,
0320 const gchar *interface_name,
0321 const gchar *property_name,
0322 GError **error,
0323 gpointer user_data);
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333
0334
0335
0336
0337
0338
0339
0340
0341
0342
0343 typedef gboolean (*GDBusInterfaceSetPropertyFunc) (GDBusConnection *connection,
0344 const gchar *sender,
0345 const gchar *object_path,
0346 const gchar *interface_name,
0347 const gchar *property_name,
0348 GVariant *value,
0349 GError **error,
0350 gpointer user_data);
0351
0352
0353
0354
0355
0356
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385
0386
0387
0388
0389
0390
0391
0392
0393
0394
0395
0396
0397
0398
0399
0400
0401
0402 struct _GDBusInterfaceVTable
0403 {
0404 GDBusInterfaceMethodCallFunc method_call;
0405 GDBusInterfaceGetPropertyFunc get_property;
0406 GDBusInterfaceSetPropertyFunc set_property;
0407
0408
0409
0410
0411
0412
0413 gpointer padding[8];
0414 };
0415
0416 GIO_AVAILABLE_IN_ALL
0417 guint g_dbus_connection_register_object (GDBusConnection *connection,
0418 const gchar *object_path,
0419 GDBusInterfaceInfo *interface_info,
0420 const GDBusInterfaceVTable *vtable,
0421 gpointer user_data,
0422 GDestroyNotify user_data_free_func,
0423 GError **error);
0424 GIO_DEPRECATED_IN_2_84_FOR(g_dbus_connection_register_object_with_closures2)
0425 guint g_dbus_connection_register_object_with_closures (GDBusConnection *connection,
0426 const gchar *object_path,
0427 GDBusInterfaceInfo *interface_info,
0428 GClosure *method_call_closure,
0429 GClosure *get_property_closure,
0430 GClosure *set_property_closure,
0431 GError **error);
0432 GIO_AVAILABLE_IN_2_84
0433 guint g_dbus_connection_register_object_with_closures2 (GDBusConnection *connection,
0434 const gchar *object_path,
0435 GDBusInterfaceInfo *interface_info,
0436 GClosure *method_call_closure,
0437 GClosure *get_property_closure,
0438 GClosure *set_property_closure,
0439 GError **error);
0440 GIO_AVAILABLE_IN_ALL
0441 gboolean g_dbus_connection_unregister_object (GDBusConnection *connection,
0442 guint registration_id);
0443
0444
0445
0446
0447
0448
0449
0450
0451
0452
0453
0454
0455
0456
0457
0458
0459
0460
0461
0462
0463
0464
0465
0466
0467
0468
0469 typedef gchar** (*GDBusSubtreeEnumerateFunc) (GDBusConnection *connection,
0470 const gchar *sender,
0471 const gchar *object_path,
0472 gpointer user_data);
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494
0495
0496
0497
0498
0499
0500
0501
0502
0503
0504
0505 typedef GDBusInterfaceInfo ** (*GDBusSubtreeIntrospectFunc) (GDBusConnection *connection,
0506 const gchar *sender,
0507 const gchar *object_path,
0508 const gchar *node,
0509 gpointer user_data);
0510
0511
0512
0513
0514
0515
0516
0517
0518
0519
0520
0521
0522
0523
0524
0525
0526
0527
0528
0529
0530 typedef const GDBusInterfaceVTable * (*GDBusSubtreeDispatchFunc) (GDBusConnection *connection,
0531 const gchar *sender,
0532 const gchar *object_path,
0533 const gchar *interface_name,
0534 const gchar *node,
0535 gpointer *out_user_data,
0536 gpointer user_data);
0537
0538
0539
0540
0541
0542
0543
0544
0545
0546
0547
0548 struct _GDBusSubtreeVTable
0549 {
0550 GDBusSubtreeEnumerateFunc enumerate;
0551 GDBusSubtreeIntrospectFunc introspect;
0552 GDBusSubtreeDispatchFunc dispatch;
0553
0554
0555
0556
0557
0558
0559 gpointer padding[8];
0560 };
0561
0562 GIO_AVAILABLE_IN_ALL
0563 guint g_dbus_connection_register_subtree (GDBusConnection *connection,
0564 const gchar *object_path,
0565 const GDBusSubtreeVTable *vtable,
0566 GDBusSubtreeFlags flags,
0567 gpointer user_data,
0568 GDestroyNotify user_data_free_func,
0569 GError **error);
0570 GIO_AVAILABLE_IN_ALL
0571 gboolean g_dbus_connection_unregister_subtree (GDBusConnection *connection,
0572 guint registration_id);
0573
0574
0575
0576
0577
0578
0579
0580
0581
0582
0583
0584
0585
0586
0587
0588
0589
0590
0591 typedef void (*GDBusSignalCallback) (GDBusConnection *connection,
0592 const gchar *sender_name,
0593 const gchar *object_path,
0594 const gchar *interface_name,
0595 const gchar *signal_name,
0596 GVariant *parameters,
0597 gpointer user_data);
0598
0599 GIO_AVAILABLE_IN_ALL
0600 guint g_dbus_connection_signal_subscribe (GDBusConnection *connection,
0601 const gchar *sender,
0602 const gchar *interface_name,
0603 const gchar *member,
0604 const gchar *object_path,
0605 const gchar *arg0,
0606 GDBusSignalFlags flags,
0607 GDBusSignalCallback callback,
0608 gpointer user_data,
0609 GDestroyNotify user_data_free_func);
0610 GIO_AVAILABLE_IN_ALL
0611 void g_dbus_connection_signal_unsubscribe (GDBusConnection *connection,
0612 guint subscription_id);
0613
0614
0615
0616
0617
0618
0619
0620
0621
0622
0623
0624
0625
0626
0627
0628
0629
0630
0631
0632
0633
0634
0635 GLIB_AVAILABLE_STATIC_INLINE_IN_2_84
0636 static inline void g_clear_dbus_signal_subscription (guint *subscription_id_pointer,
0637 GDBusConnection *connection);
0638
0639 GLIB_AVAILABLE_STATIC_INLINE_IN_2_84
0640 static inline void
0641 g_clear_dbus_signal_subscription (guint *subscription_id_pointer,
0642 GDBusConnection *connection)
0643 {
0644 guint subscription_id;
0645
0646
0647 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
0648 subscription_id = g_steal_handle_id (subscription_id_pointer);
0649 G_GNUC_END_IGNORE_DEPRECATIONS
0650
0651 if (subscription_id > 0)
0652 g_dbus_connection_signal_unsubscribe (connection, subscription_id);
0653 }
0654
0655
0656
0657
0658
0659
0660
0661
0662
0663
0664
0665
0666
0667
0668
0669
0670
0671
0672
0673
0674
0675
0676
0677
0678
0679
0680
0681
0682
0683
0684
0685
0686
0687
0688
0689
0690
0691
0692
0693
0694
0695
0696
0697
0698
0699
0700
0701
0702
0703
0704
0705
0706
0707
0708
0709
0710
0711
0712
0713
0714
0715
0716
0717
0718
0719
0720
0721
0722
0723
0724
0725
0726
0727
0728
0729
0730
0731 typedef GDBusMessage *(*GDBusMessageFilterFunction) (GDBusConnection *connection,
0732 GDBusMessage *message,
0733 gboolean incoming,
0734 gpointer user_data);
0735
0736 GIO_AVAILABLE_IN_ALL
0737 guint g_dbus_connection_add_filter (GDBusConnection *connection,
0738 GDBusMessageFilterFunction filter_function,
0739 gpointer user_data,
0740 GDestroyNotify user_data_free_func);
0741
0742 GIO_AVAILABLE_IN_ALL
0743 void g_dbus_connection_remove_filter (GDBusConnection *connection,
0744 guint filter_id);
0745
0746
0747
0748
0749 G_END_DECLS
0750
0751 #endif