[glibmm] giomm: Add the ZlibCompressor class.



commit d18411d611bf9b1f0b33cbefe361f54e97909949
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date:   Mon Sep 3 22:48:10 2012 -0400

    giomm: Add the ZlibCompressor class.
    
    	* gio/src/zlibcompressor.{ccg,hg}:
    	* gio/src/filelist.am: Add the ZlibCompressor class which derives from
    	the Converter interface wrapping the C functions and properties and
    	include the sources in the build.
    	* tools/extra_defs_gen/generate_defs_gio.cc:
    	* gio/src/gio_signals.defs: Add the GZlibCompressor GType to the
    	properties and signals generation utility and regenerate the defs
    	file.
    	* tools/m4/convert_gio.m4: Add the new enum conversion.

 ChangeLog                                 |   14 +++++++
 gio/src/filelist.am                       |    3 +-
 gio/src/gio_signals.defs                  |   29 +++++++++++++++
 gio/src/zlibcompressor.ccg                |   24 ++++++++++++
 gio/src/zlibcompressor.hg                 |   57 +++++++++++++++++++++++++++++
 tools/extra_defs_gen/generate_defs_gio.cc |    1 +
 tools/m4/convert_gio.m4                   |    1 +
 7 files changed, 128 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b218589..cb22765 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2012-09-03  Josà Alburquerque  <jaalburquerque gmail com>
+
+	giomm: Add the ZlibCompressor class.
+
+	* gio/src/zlibcompressor.{ccg,hg}:
+	* gio/src/filelist.am: Add the ZlibCompressor class which derives from
+	the Converter interface wrapping the C functions and properties and
+	include the sources in the build.
+	* tools/extra_defs_gen/generate_defs_gio.cc:
+	* gio/src/gio_signals.defs: Add the GZlibCompressor GType to the
+	properties and signals generation utility and regenerate the defs
+	file.
+	* tools/m4/convert_gio.m4: Add the new enum conversion.
+
 2012-09-02  Josà Alburquerque  <jaalburquerque gmail com>
 
 	giomm: Add the Converter interface.
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index 7871ba7..04ff1df 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -109,7 +109,8 @@ giomm_files_any_hg =			\
 	threadedsocketservice.hg	\
 	themedicon.hg			\
 	volume.hg			\
-	volumemonitor.hg
+	volumemonitor.hg		\
+	zlibcompressor.hg
 
 giomm_files_posix_hg =			\
 	desktopappinfo.hg		\
diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs
index 022d4af..2929c0a 100644
--- a/gio/src/gio_signals.defs
+++ b/gio/src/gio_signals.defs
@@ -1104,6 +1104,35 @@
   )
 )
 
+;; From GZlibCompressor
+
+(define-property format
+  (of-object "GZlibCompressor")
+  (prop-type "GParamEnum")
+  (docs "The format of the compressed data")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+(define-property level
+  (of-object "GZlibCompressor")
+  (prop-type "GParamInt")
+  (docs "The level of compression from 0 (no compression) to 9 (most compression), -1 for the default level")
+  (readable #t)
+  (writable #t)
+  (construct-only #t)
+)
+
+(define-property file-info
+  (of-object "GZlibCompressor")
+  (prop-type "GParamObject")
+  (docs "File info")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
 ;; From GInetAddress
 
 (define-property family
diff --git a/gio/src/zlibcompressor.ccg b/gio/src/zlibcompressor.ccg
new file mode 100644
index 0000000..4366e58
--- /dev/null
+++ b/gio/src/zlibcompressor.ccg
@@ -0,0 +1,24 @@
+/* Copyright (C) 2012 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>
+#include <giomm/fileinfo.h>
+
+namespace Gio
+{
+
+} // namespace Gio
diff --git a/gio/src/zlibcompressor.hg b/gio/src/zlibcompressor.hg
new file mode 100644
index 0000000..b6fd0a0
--- /dev/null
+++ b/gio/src/zlibcompressor.hg
@@ -0,0 +1,57 @@
+/* Copyright (C) 2012 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>
+#include <giomm/converter.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+_WRAP_ENUM(ZlibCompressorFormat,  GZlibCompressorFormat)
+
+class FileInfo;
+
+/** ZlibCompressor - Zlib compressor.
+ * ZlibCompressor is an implementation of Converter that compresses data using
+ * zlib.
+ * @newin{2,34}
+ */
+class ZlibCompressor : public Glib::Object, public Converter
+{
+  _CLASS_GOBJECT(ZlibCompressor, GZlibCompressor, G_ZLIB_COMPRESSOR, Glib::Object, GObject)
+  _IMPLEMENTS_INTERFACE(Converter)
+
+  _WRAP_CTOR(ZlibCompressor(ZlibCompressorFormat format, int level), g_zlib_compressor_new)
+
+public:
+  _WRAP_METHOD_DOCS_ONLY(g_zlib_compressor_new)
+  _WRAP_CREATE(ZlibCompressorFormat format, int level)
+
+  _WRAP_METHOD(Glib::RefPtr<FileInfo> get_file_info(), g_zlib_compressor_get_file_info)
+  _WRAP_METHOD(Glib::RefPtr<const FileInfo> get_file_info() const, g_zlib_compressor_get_file_info, constversion)
+
+  _WRAP_METHOD(void set_file_info(const Glib::RefPtr<FileInfo>& file_info), g_zlib_compressor_set_file_info)
+
+  _WRAP_PROPERTY("file-info", Glib::RefPtr<FileInfo>)
+  _WRAP_PROPERTY("format", ZlibCompressorFormat)
+  _WRAP_PROPERTY("level", int)
+};
+
+} // namespace Gio
diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc
index aaf251e..7285aa1 100644
--- a/tools/extra_defs_gen/generate_defs_gio.cc
+++ b/tools/extra_defs_gen/generate_defs_gio.cc
@@ -92,6 +92,7 @@ int main(int, char**)
             << get_defs(G_TYPE_VOLUME)
 
             << get_defs(G_TYPE_VOLUME_MONITOR)
+            << get_defs(G_TYPE_ZLIB_COMPRESSOR)
 
             // network IO classes
             << get_defs(G_TYPE_INET_ADDRESS)
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index c6b681f..c683db8 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -37,6 +37,7 @@ _CONV_ENUM(G,SocketMsgFlags)
 _CONV_ENUM(G,SocketProtocol)
 _CONV_ENUM(G,SocketType)
 _CONV_ENUM(G,UnixSocketAddressType)
+_CONV_ENUM(G,ZlibCompressorFormat)
 
 # Action
 _CONVERSION(`GAction*',`Glib::RefPtr<Action>',`Glib::wrap($3)')



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