File indexing completed on 2025-01-18 09:59:55
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 typedef void (*GDBusInterfaceMethodCallFunc) (GDBusConnection *connection,
0281 const gchar *sender,
0282 const gchar *object_path,
0283 const gchar *interface_name,
0284 const gchar *method_name,
0285 GVariant *parameters,
0286 GDBusMethodInvocation *invocation,
0287 gpointer user_data);
0288
0289
0290
0291
0292
0293
0294
0295
0296
0297
0298
0299
0300
0301
0302
0303
0304
0305
0306
0307 typedef GVariant *(*GDBusInterfaceGetPropertyFunc) (GDBusConnection *connection,
0308 const gchar *sender,
0309 const gchar *object_path,
0310 const gchar *interface_name,
0311 const gchar *property_name,
0312 GError **error,
0313 gpointer user_data);
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332 typedef gboolean (*GDBusInterfaceSetPropertyFunc) (GDBusConnection *connection,
0333 const gchar *sender,
0334 const gchar *object_path,
0335 const gchar *interface_name,
0336 const gchar *property_name,
0337 GVariant *value,
0338 GError **error,
0339 gpointer user_data);
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349
0350
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 struct _GDBusInterfaceVTable
0392 {
0393 GDBusInterfaceMethodCallFunc method_call;
0394 GDBusInterfaceGetPropertyFunc get_property;
0395 GDBusInterfaceSetPropertyFunc set_property;
0396
0397
0398
0399
0400
0401
0402 gpointer padding[8];
0403 };
0404
0405 GIO_AVAILABLE_IN_ALL
0406 guint g_dbus_connection_register_object (GDBusConnection *connection,
0407 const gchar *object_path,
0408 GDBusInterfaceInfo *interface_info,
0409 const GDBusInterfaceVTable *vtable,
0410 gpointer user_data,
0411 GDestroyNotify user_data_free_func,
0412 GError **error);
0413 GIO_AVAILABLE_IN_2_46
0414 guint g_dbus_connection_register_object_with_closures (GDBusConnection *connection,
0415 const gchar *object_path,
0416 GDBusInterfaceInfo *interface_info,
0417 GClosure *method_call_closure,
0418 GClosure *get_property_closure,
0419 GClosure *set_property_closure,
0420 GError **error);
0421 GIO_AVAILABLE_IN_ALL
0422 gboolean g_dbus_connection_unregister_object (GDBusConnection *connection,
0423 guint registration_id);
0424
0425
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435
0436
0437
0438
0439
0440
0441
0442
0443
0444
0445
0446
0447
0448
0449
0450 typedef gchar** (*GDBusSubtreeEnumerateFunc) (GDBusConnection *connection,
0451 const gchar *sender,
0452 const gchar *object_path,
0453 gpointer user_data);
0454
0455
0456
0457
0458
0459
0460
0461
0462
0463
0464
0465
0466
0467
0468
0469
0470
0471
0472
0473
0474
0475
0476
0477
0478
0479
0480
0481
0482
0483
0484
0485
0486 typedef GDBusInterfaceInfo ** (*GDBusSubtreeIntrospectFunc) (GDBusConnection *connection,
0487 const gchar *sender,
0488 const gchar *object_path,
0489 const gchar *node,
0490 gpointer user_data);
0491
0492
0493
0494
0495
0496
0497
0498
0499
0500
0501
0502
0503
0504
0505
0506
0507
0508
0509
0510
0511 typedef const GDBusInterfaceVTable * (*GDBusSubtreeDispatchFunc) (GDBusConnection *connection,
0512 const gchar *sender,
0513 const gchar *object_path,
0514 const gchar *interface_name,
0515 const gchar *node,
0516 gpointer *out_user_data,
0517 gpointer user_data);
0518
0519
0520
0521
0522
0523
0524
0525
0526
0527
0528
0529 struct _GDBusSubtreeVTable
0530 {
0531 GDBusSubtreeEnumerateFunc enumerate;
0532 GDBusSubtreeIntrospectFunc introspect;
0533 GDBusSubtreeDispatchFunc dispatch;
0534
0535
0536
0537
0538
0539
0540 gpointer padding[8];
0541 };
0542
0543 GIO_AVAILABLE_IN_ALL
0544 guint g_dbus_connection_register_subtree (GDBusConnection *connection,
0545 const gchar *object_path,
0546 const GDBusSubtreeVTable *vtable,
0547 GDBusSubtreeFlags flags,
0548 gpointer user_data,
0549 GDestroyNotify user_data_free_func,
0550 GError **error);
0551 GIO_AVAILABLE_IN_ALL
0552 gboolean g_dbus_connection_unregister_subtree (GDBusConnection *connection,
0553 guint registration_id);
0554
0555
0556
0557
0558
0559
0560
0561
0562
0563
0564
0565
0566
0567
0568
0569
0570
0571
0572 typedef void (*GDBusSignalCallback) (GDBusConnection *connection,
0573 const gchar *sender_name,
0574 const gchar *object_path,
0575 const gchar *interface_name,
0576 const gchar *signal_name,
0577 GVariant *parameters,
0578 gpointer user_data);
0579
0580 GIO_AVAILABLE_IN_ALL
0581 guint g_dbus_connection_signal_subscribe (GDBusConnection *connection,
0582 const gchar *sender,
0583 const gchar *interface_name,
0584 const gchar *member,
0585 const gchar *object_path,
0586 const gchar *arg0,
0587 GDBusSignalFlags flags,
0588 GDBusSignalCallback callback,
0589 gpointer user_data,
0590 GDestroyNotify user_data_free_func);
0591 GIO_AVAILABLE_IN_ALL
0592 void g_dbus_connection_signal_unsubscribe (GDBusConnection *connection,
0593 guint subscription_id);
0594
0595
0596
0597
0598
0599
0600
0601
0602
0603
0604
0605
0606
0607
0608
0609
0610
0611
0612
0613
0614
0615
0616
0617
0618
0619
0620
0621
0622
0623
0624
0625
0626
0627
0628
0629
0630
0631
0632
0633
0634
0635
0636
0637
0638
0639
0640
0641
0642
0643
0644
0645
0646
0647
0648
0649
0650
0651
0652
0653
0654
0655
0656
0657
0658
0659
0660
0661
0662
0663
0664
0665
0666
0667
0668
0669
0670
0671 typedef GDBusMessage *(*GDBusMessageFilterFunction) (GDBusConnection *connection,
0672 GDBusMessage *message,
0673 gboolean incoming,
0674 gpointer user_data);
0675
0676 GIO_AVAILABLE_IN_ALL
0677 guint g_dbus_connection_add_filter (GDBusConnection *connection,
0678 GDBusMessageFilterFunction filter_function,
0679 gpointer user_data,
0680 GDestroyNotify user_data_free_func);
0681
0682 GIO_AVAILABLE_IN_ALL
0683 void g_dbus_connection_remove_filter (GDBusConnection *connection,
0684 guint filter_id);
0685
0686
0687
0688
0689 G_END_DECLS
0690
0691 #endif