[glibmm] Gio::UnixSocketAddress: Change UnixSocketAddressType to UnixSocketAddress::Type.



commit 75b925aba19bc9716620ca866eec8d9538172f1f
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Apr 18 18:44:44 2017 +0200

    Gio::UnixSocketAddress: Change UnixSocketAddressType to UnixSocketAddress::Type.

 gio/src/unixsocketaddress.ccg |    4 +++-
 gio/src/unixsocketaddress.hg  |   15 ++++++++-------
 tools/m4/convert_gio.m4       |    2 +-
 3 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/gio/src/unixsocketaddress.ccg b/gio/src/unixsocketaddress.ccg
index d163b03..8b5b480 100644
--- a/gio/src/unixsocketaddress.ccg
+++ b/gio/src/unixsocketaddress.ccg
@@ -19,11 +19,13 @@
 
 #include <gio/gunixsocketaddress.h>
 
+using Type = Gio::UnixSocketAddress::Type;
+
 namespace Gio
 {
 
 Glib::RefPtr<UnixSocketAddress>
-UnixSocketAddress::create(const std::string& path, UnixSocketAddressType type, int path_len)
+UnixSocketAddress::create(const std::string& path, Type type, int path_len)
 {
   return Glib::wrap(reinterpret_cast<GUnixSocketAddress*>(g_unix_socket_address_new_with_type(
     path.c_str(), path_len, static_cast<GUnixSocketAddressType>(type))));
diff --git a/gio/src/unixsocketaddress.hg b/gio/src/unixsocketaddress.hg
index 54e0fe2..2e1d754 100644
--- a/gio/src/unixsocketaddress.hg
+++ b/gio/src/unixsocketaddress.hg
@@ -25,8 +25,6 @@ _PINCLUDE(giomm/private/socketaddress_p.h)
 namespace Gio
 {
 
-_WRAP_ENUM(UnixSocketAddressType, GUnixSocketAddressType)
-
 class ByteArray;
 
 /** UnixSocketAddress - UNIX SocketAddress.
@@ -52,12 +50,15 @@ class UnixSocketAddress
   _CLASS_GOBJECT(UnixSocketAddress, GUnixSocketAddress, G_UNIX_SOCKET_ADDRESS, SocketAddress, GSocketAddress)
   _GTKMMPROC_WIN32_NO_WRAP
 
+public:
+  _WRAP_ENUM(Type, GUnixSocketAddressType)
+
 protected:
  _WRAP_CTOR(UnixSocketAddress(const std::string& path), g_unix_socket_address_new)
 
  //TODO: Possibly add when g_unix_socket_address_new_with_type() does not do
  //more than call g_object_new() (maybe file a bug).
- //_WRAP_CTOR(UnixSocketAddress(const std::string& path, int path_len = -1, UnixSocketAddressType type = 
Gio::UnixSocketAddressType::PATH), g_unix_socket_address_new_with_type)
+ //_WRAP_CTOR(UnixSocketAddress(const std::string& path, int path_len = -1, Type type = Type::PATH), 
g_unix_socket_address_new_with_type)
 
 public:
  _WRAP_METHOD_DOCS_ONLY(g_unix_socket_address_new)
@@ -66,24 +67,24 @@ public:
  //TODO: Add when the above constructor is included, removing the handwritten
  //create() method for it below.
  //_WRAP_METHOD_DOCS_ONLY(g_unix_socket_address_new_with_type)
- //_WRAP_CREATE(const std::string& path, int path_len = -1, UnixSocketAddressType type = 
Gio::UnixSocketAddressType::PATH)
+ //_WRAP_CREATE(const std::string& path, int path_len = -1, Type type = Type::PATH)
 
  _WRAP_METHOD_DOCS_ONLY(g_unix_socket_address_new_with_type)
  static Glib::RefPtr<UnixSocketAddress> create(const std::string& path,
-   UnixSocketAddressType type = Gio::UnixSocketAddressType::ABSTRACT,
+   Type type = Type::ABSTRACT,
    int path_len = -1);
 
  // Deprecated.
  _IGNORE(g_unix_socket_address_get_is_abstract)
 
- _WRAP_METHOD(UnixSocketAddressType get_address_type() const, g_unix_socket_address_get_address_type)
+ _WRAP_METHOD(Type get_address_type() const, g_unix_socket_address_get_address_type)
  _WRAP_METHOD(std::string get_path() const, g_unix_socket_address_get_path)
  _IGNORE(g_unix_socket_address_get_path_len)
 
  _WRAP_METHOD(static bool abstract_names_supported(), g_unix_socket_address_abstract_names_supported)
 
   _IGNORE_PROPERTY("abstract")
-  _WRAP_PROPERTY("address-type", UnixSocketAddressType)
+  _WRAP_PROPERTY("address-type", Type)
   _WRAP_PROPERTY("path", std::string)
   _WRAP_PROPERTY("path-as-array", Glib::RefPtr<ByteArray>)
 };
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index 91f2593..3adde7e 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -78,7 +78,7 @@ _CONV_GIO_ENUM(TlsDatabaseLookupFlags)
 _CONV_GIO_ENUM(TlsInteractionResult)
 _CONV_GIO_INCLASS_ENUM(TlsPassword,Flags)
 _CONV_GIO_ENUM(TlsRehandshakeMode)
-_CONV_GIO_ENUM(UnixSocketAddressType)
+_CONV_GIO_INCLASS_ENUM(UnixSocketAddress,Type)
 _CONV_GIO_ENUM(ZlibCompressorFormat)
 
 # Action


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]