summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2010-07-21 23:36:27 +0200
committerMurray Cumming <murrayc@murrayc.com>2010-07-21 23:36:27 +0200
commit004419ab9d863a47e0b0d6dbc3b8a0658c64d002 (patch)
tree58e37cc6b0c5168cf0f9536e0f99d067030ee246
parent351a3b0a94394be3e2fb0635cdd1f181a9083eac (diff)
downloadglibmm-004419ab9d863a47e0b0d6dbc3b8a0658c64d002.tar.gz
Added DBusMessage and DBusConnection::send_message().
* gio/src/gio_methods.defs: Regenerated. * gio/src/filelist.am: * gio/src/dbusmessage.[hg|ccg]: New wrapper for GMessage, with no methods yet. * gio/src/dbusconnection.hg: Added send_message(). * tools/m4/convert_gio.m4: Added necessary conversions. * gio/src/credentials.hg: Uncommented out some methods now that the .defs are correct. * gio/src/socket.hg: Added get_credentials().
-rw-r--r--ChangeLog16
-rw-r--r--gio/src/credentials.hg6
-rw-r--r--gio/src/dbusconnection.hg11
-rw-r--r--gio/src/dbusmessage.ccg25
-rw-r--r--gio/src/dbusmessage.hg48
-rw-r--r--gio/src/filelist.am1
-rw-r--r--gio/src/gio_methods.defs80
-rw-r--r--gio/src/socket.hg6
-rw-r--r--tools/m4/convert_gio.m44
9 files changed, 176 insertions, 21 deletions
diff --git a/ChangeLog b/ChangeLog
index b8aa2ee5..3530bf7c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,18 @@
-2010-07-21 Murray Cumming <murrayc@murrayc-x61>
+2010-07-21 Murray Cumming <murrayc@murrayc.com>
+
+ Added DBusMessage and DBusConnection::send_message().
+
+ * gio/src/gio_methods.defs: Regenerated.
+ * gio/src/filelist.am:
+ * gio/src/dbusmessage.[hg|ccg]: New wrapper for GMessage, with no methods
+ yet.
+ * gio/src/dbusconnection.hg: Added send_message().
+ * tools/m4/convert_gio.m4: Added necessary conversions.
+ * gio/src/credentials.hg: Uncommented out some methods now that the .defs
+ are correct.
+ * gio/src/socket.hg: Added get_credentials().
+
+2010-07-21 Murray Cumming <murrayc@murrayc.com>
giomm: Added Credentials and DBusConnection::get_peer_credentials().
diff --git a/gio/src/credentials.hg b/gio/src/credentials.hg
index 336556b6..2bf3cbde 100644
--- a/gio/src/credentials.hg
+++ b/gio/src/credentials.hg
@@ -40,14 +40,12 @@ protected:
_IGNORE(g_credentials_new)
public:
- typedef sigc::slot<void> SlotCancelledCallback;
-
_WRAP_CREATE()
_WRAP_METHOD(Glib::ustring to_string() const, g_credentials_to_string)
- //TODO: _WRAP_METHOD(gpointer get_native(CredentialsType native_type), g_credentials_get_native)
- //TODO: _WRAP_METHOD(void set_native(CredentialsType native_type, gpointer native), g_credentials_set_native)
+ _WRAP_METHOD(gpointer get_native(CredentialsType native_type), g_credentials_get_native)
+ _WRAP_METHOD(void set_native(CredentialsType native_type, gpointer native), g_credentials_set_native)
_WRAP_METHOD(bool is_same_user(const Glib::RefPtr<const Credentials>& other_credentials), g_credentials_is_same_user, errthrow)
#ifdef G_OS_UNIX
diff --git a/gio/src/dbusconnection.hg b/gio/src/dbusconnection.hg
index 0b9ad3e2..316610f2 100644
--- a/gio/src/dbusconnection.hg
+++ b/gio/src/dbusconnection.hg
@@ -21,6 +21,7 @@
#include <giomm/iostream.h>
#include <giomm/asyncresult.h>
#include <giomm/credentials.h>
+#include <giomm/dbusmessage.h>
_DEFS(giomm,gio)
_PINCLUDE(glibmm/private/object_p.h)
@@ -30,6 +31,7 @@ namespace Gio
{
_WRAP_ENUM(DBusCapabilityFlags, GDBusCapabilityFlags, NO_GTYPE)
+_WRAP_ENUM(DBusSendMessageFlags, GDBusSendMessageFlags, NO_GTYPE)
/** TODO
*
@@ -42,7 +44,6 @@ protected:
public:
- _WRAP_METHOD(bool is_closed() const, g_dbus_connection_is_closed)
//TODO: Documentation.
void close();
@@ -83,7 +84,13 @@ public:
//TODO: Documentation.
_WRAP_METHOD(void flush_sync(const Glib::RefPtr<Cancellable>& cancellable), g_dbus_connection_flush_sync, errthrow)
-
+ //TODO: In the C API, out_serial is volatile, but gmmproc can't parse that.
+ #m4 _CONVERSION(`guint32*',`volatile guint32*',`($3)')
+ _WRAP_METHOD(bool send_message(const Glib::RefPtr<DBusMessage>& message, DBusSendMessageFlags flags, guint32* out_serial), g_dbus_connection_send_message, errthrow)
+
+ _WRAP_METHOD(void start_message_processing(), g_dbus_connection_start_message_processing)
+ _WRAP_METHOD(bool is_closed() const, g_dbus_connection_is_closed)
+
_WRAP_METHOD(Glib::RefPtr<IOStream> get_stream(), g_dbus_connection_get_stream, refreturn)
_WRAP_METHOD(Glib::RefPtr<const IOStream> get_stream() const, g_dbus_connection_get_stream, refreturn, constversion)
diff --git a/gio/src/dbusmessage.ccg b/gio/src/dbusmessage.ccg
new file mode 100644
index 00000000..555a34bc
--- /dev/null
+++ b/gio/src/dbusmessage.ccg
@@ -0,0 +1,25 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+
+namespace Gio
+{
+
+} // namespace Gio
diff --git a/gio/src/dbusmessage.hg b/gio/src/dbusmessage.hg
new file mode 100644
index 00000000..d100481e
--- /dev/null
+++ b/gio/src/dbusmessage.hg
@@ -0,0 +1,48 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm/object.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+/** TODO
+ *
+ * @newin{2,26}
+ */
+class DBusMessage : public Glib::Object
+{
+ _CLASS_GOBJECT(DBusMessage, GDBusMessage, G_DBUS_MESSAGE, Glib::Object, GObject)
+
+protected:
+ _CTOR_DEFAULT
+ _IGNORE(g_dbus_message_new)
+
+public:
+
+ _WRAP_CREATE()
+
+};
+
+
+} // namespace Gio
+
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index 536beac5..9c799c5a 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -21,6 +21,7 @@ giomm_files_any_hg = \
datainputstream.hg \
dataoutputstream.hg \
dbusconnection.hg \
+ dbusmessage.hg \
drive.hg \
emblem.hg \
emblemedicon.hg \
diff --git a/gio/src/gio_methods.defs b/gio/src/gio_methods.defs
index 0fed4745..e800c615 100644
--- a/gio/src/gio_methods.defs
+++ b/gio/src/gio_methods.defs
@@ -45,13 +45,6 @@
(gtype-id "G_TYPE_CONVERTER")
)
-(define-object s
- (in-module "GCredential")
- (parent "GObject")
- (c-name "GCredentials")
- (gtype-id "G_TYPE_CREDENTIALS")
-)
-
(define-object Proxy
(in-module "GDBus")
(parent "GObject")
@@ -1012,6 +1005,35 @@
)
)
+(define-enum SignalFlags
+ (in-module "GDBus")
+ (c-name "GDBusSignalFlags")
+ (gtype-id "G_TYPE_D_BUS_SIGNAL_FLAGS")
+ (values
+ '("none" "G_DBUS_SIGNAL_FLAGS_NONE")
+ )
+)
+
+(define-flags SendMessageFlags
+ (in-module "GDBus")
+ (c-name "GDBusSendMessageFlags")
+ (gtype-id "G_TYPE_D_BUS_SEND_MESSAGE_FLAGS")
+ (values
+ '("none" "G_DBUS_SEND_MESSAGE_FLAGS_NONE")
+ '("preserve-serial" "G_DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL")
+ )
+)
+
+(define-enum Type
+ (in-module "GCredentials")
+ (c-name "GCredentialsType")
+ (gtype-id "G_TYPE_CREDENTIALS_TYPE")
+ (values
+ '("invalid" "G_CREDENTIALS_TYPE_INVALID")
+ '("linux-ucred" "G_CREDENTIALS_TYPE_LINUX_UCRED")
+ )
+)
+
(define-flags BindFlags
(in-module "GSettings")
(c-name "GSettingsBindFlags")
@@ -2045,6 +2067,9 @@
(of-object "GCredentials")
(c-name "g_credentials_get_native")
(return-type "gpointer")
+ (parameters
+ '("GCredentialsType" "native_type")
+ )
)
(define-method set_native
@@ -2052,6 +2077,7 @@
(c-name "g_credentials_set_native")
(return-type "none")
(parameters
+ '("GCredentialsType" "native_type")
'("gpointer" "native")
)
)
@@ -2716,6 +2742,7 @@
(return-type "gboolean")
(parameters
'("GDBusMessage*" "message")
+ '("GDBusSendMessageFlags" "flags")
'("volatile-guint32*" "out_serial")
'("GError**" "error")
)
@@ -2727,6 +2754,7 @@
(return-type "none")
(parameters
'("GDBusMessage*" "message")
+ '("GDBusSendMessageFlags" "flags")
'("gint" "timeout_msec")
'("volatile-guint32*" "out_serial")
'("GCancellable*" "cancellable")
@@ -2751,6 +2779,7 @@
(return-type "GDBusMessage*")
(parameters
'("GDBusMessage*" "message")
+ '("GDBusSendMessageFlags" "flags")
'("gint" "timeout_msec")
'("volatile-guint32*" "out_serial")
'("GCancellable*" "cancellable")
@@ -2825,7 +2854,7 @@
(return-type "guint")
(parameters
'("const-gchar*" "object_path")
- '("const-GDBusInterfaceInfo*" "interface_info")
+ '("GDBusInterfaceInfo*" "interface_info")
'("const-GDBusInterfaceVTable*" "vtable")
'("gpointer" "user_data")
'("GDestroyNotify" "user_data_free_func")
@@ -2875,6 +2904,7 @@
'("const-gchar*" "member")
'("const-gchar*" "object_path")
'("const-gchar*" "arg0")
+ '("GDBusSignalFlags" "flags")
'("GDBusSignalCallback" "callback")
'("gpointer" "user_data")
'("GDestroyNotify" "user_data_free_func")
@@ -3023,7 +3053,7 @@
(c-name "g_dbus_annotation_info_lookup")
(return-type "const-gchar*")
(parameters
- '("const-GDBusAnnotationInfo**" "annotations")
+ '("GDBusAnnotationInfo**" "annotations")
'("const-gchar*" "name")
)
)
@@ -3031,7 +3061,7 @@
(define-method lookup_method
(of-object "GDBusInterfaceInfo")
(c-name "g_dbus_interface_info_lookup_method")
- (return-type "const-GDBusMethodInfo*")
+ (return-type "GDBusMethodInfo*")
(parameters
'("const-gchar*" "name")
)
@@ -3040,7 +3070,7 @@
(define-method lookup_signal
(of-object "GDBusInterfaceInfo")
(c-name "g_dbus_interface_info_lookup_signal")
- (return-type "const-GDBusSignalInfo*")
+ (return-type "GDBusSignalInfo*")
(parameters
'("const-gchar*" "name")
)
@@ -3049,7 +3079,7 @@
(define-method lookup_property
(of-object "GDBusInterfaceInfo")
(c-name "g_dbus_interface_info_lookup_property")
- (return-type "const-GDBusPropertyInfo*")
+ (return-type "GDBusPropertyInfo*")
(parameters
'("const-gchar*" "name")
)
@@ -3077,7 +3107,7 @@
(define-method lookup_interface
(of-object "GDBusNodeInfo")
(c-name "g_dbus_node_info_lookup_interface")
- (return-type "const-GDBusInterfaceInfo*")
+ (return-type "GDBusInterfaceInfo*")
(parameters
'("const-gchar*" "name")
)
@@ -7416,6 +7446,21 @@
(return-type "GType")
)
+(define-function g_dbus_signal_flags_get_type
+ (c-name "g_dbus_signal_flags_get_type")
+ (return-type "GType")
+)
+
+(define-function g_dbus_send_message_flags_get_type
+ (c-name "g_dbus_send_message_flags_get_type")
+ (return-type "GType")
+)
+
+(define-function g_credentials_type_get_type
+ (c-name "g_credentials_type_get_type")
+ (return-type "GType")
+)
+
(define-function g_settings_bind_flags_get_type
(c-name "g_settings_bind_flags_get_type")
(return-type "GType")
@@ -10103,6 +10148,15 @@
(return-type "gboolean")
)
+(define-method get_credentials
+ (of-object "GSocket")
+ (c-name "g_socket_get_credentials")
+ (return-type "GCredentials*")
+ (parameters
+ '("GError**" "error")
+ )
+)
+
;; From gsocketlistener.h
diff --git a/gio/src/socket.hg b/gio/src/socket.hg
index 0320ef8f..8b24918d 100644
--- a/gio/src/socket.hg
+++ b/gio/src/socket.hg
@@ -19,6 +19,7 @@
#include <glibmm/object.h>
#include <giomm/initable.h>
+#include <giomm/credentials.h>
#include <giomm/socketconnectable.h>
#include <giomm/socketaddress.h>
#include <giomm/enums.h>
@@ -173,7 +174,10 @@ public:
_WRAP_METHOD(SocketProtocol get_protocol() const, g_socket_get_protocol)
_WRAP_METHOD(SocketType get_socket_type() const, g_socket_get_socket_type)
_WRAP_METHOD(bool speaks_ipv4() const, g_socket_speaks_ipv4)
-
+
+ _WRAP_METHOD(Glib::RefPtr<Credentials> get_credentials(), g_socket_get_credentials, errthrow)
+ _WRAP_METHOD(Glib::RefPtr<const Credentials> get_credentials() const, g_socket_get_credentials, errthrow)
+
_WRAP_PROPERTY("blocking", bool)
_WRAP_PROPERTY("family", SocketFamily)
_WRAP_PROPERTY("fd", int)
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index ef8c808c..006258ed 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -24,7 +24,9 @@ _CONV_ENUM(G,DriveStartFlags)
_CONV_ENUM(G,DriveStartFlags)
_CONV_ENUM(G,DriveStartStopType)
_CONV_ENUM(G,SettingsBindFlags)
+_CONV_ENUM(G,CredentialsType)
_CONV_ENUM(G,DBusCapabilityFlags)
+_CONV_ENUM(G,DBusSendMessageFlags)
# AppInfo
@@ -52,6 +54,8 @@ _CONVERSION(`const Glib::RefPtr<const Credentials>&',`GCredentials*',__CONVERT_C
_CONVERSION(`GCredentials*',`Glib::RefPtr<Credentials>',`Glib::wrap($3)')
_CONVERSION(`GCredentials*',`Glib::RefPtr<const Credentials>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<DBusMessage>&',`GDBusMessage*',__CONVERT_REFPTR_TO_P)
+
# DesktopAppInfo
_CONVERSION(`GDesktopAppInfo*', `Glib::RefPtr<DesktopAppInfo>', `Glib::wrap($3)')