[glibmm/gmmproc-refactor] Fix some errors in glibmm templates.



commit 225def88bd0fd230c824e8ee31807a0f46c467b9
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Thu Jul 12 18:33:33 2012 +0200

    Fix some errors in glibmm templates.
    
    But I don't know if they compile for now.

 glib/src/datetime.hg    |    2 +
 glib/src/fileutils.hg   |   48 +++++++++++++++++++++++-----------------------
 glib/src/iochannel.hg   |   20 +++++++++---------
 glib/src/keyfile.hg     |    5 +++-
 glib/src/markup.hg      |    2 +-
 glib/src/module.hg      |    2 +
 glib/src/optionentry.hg |   10 ++++----
 glib/src/spawn.hg       |    2 +-
 glib/src/variant.hg     |    2 +
 glib/src/varianttype.hg |    4 +++
 10 files changed, 55 insertions(+), 42 deletions(-)
---
diff --git a/glib/src/datetime.hg b/glib/src/datetime.hg
index ea56465..315cd20 100644
--- a/glib/src/datetime.hg
+++ b/glib/src/datetime.hg
@@ -94,7 +94,9 @@ public:
   _WRAP_METHOD(DateTime add_full(int years, int months, int days, int hours, int minutes, double seconds) const, g_date_time_add_full)
   _WRAP_METHOD(TimeSpan difference(const DateTime& other) const, g_date_time_difference)
 
+  _PUSH_NAMED_CONV(datetime_to_gconstpointer, const DateTime&, gconstpointer, static_cast<gconstpointer>(Glib::unwrap(##ARG##)), NONE, static_cast<gconstpointer>(Glib::unwrap_copy(##ARG##)))
   _WRAP_METHOD(int compare(const DateTime& other) const, g_date_time_compare)
+  _POP_NAMED_CONV(datetime_to_gconstpointer)
   _WRAP_METHOD(guint hash() const, g_date_time_hash)
   _WRAP_METHOD(bool equal(const DateTime& other) const, g_date_time_equal)
 
diff --git a/glib/src/fileutils.hg b/glib/src/fileutils.hg
index a614fc9..4ac46aa 100644
--- a/glib/src/fileutils.hg
+++ b/glib/src/fileutils.hg
@@ -41,30 +41,30 @@ _WRAP_ENUM(FileTest, GFileTest, NO_GTYPE)
 /** Exception class for file-related errors.
  * @ingroup FileUtils
  */
-_WRAP_GERROR(FileError, GFileError, G_FILE_ERROR, NO_GTYPE,
-    s#^EXIST$#EXISTS#,
-    s#^ISDIR$#IS_DIRECTORY#,
-    s#^ACCES$#ACCESS_DENIED#,
-    s#^NAMETOOLONG$#NAME_TOO_LONG#,
-    s#^NOENT$#NO_SUCH_ENTITY#,
-    s#^NOTDIR$#NOT_DIRECTORY#,
-    s#^NXIO$#NO_SUCH_DEVICE#,
-    s#^NODEV$#NOT_DEVICE#,
-    s#^ROFS$#READONLY_FILESYSTEM#,
-    s#^TXTBSY$#TEXT_FILE_BUSY#,
-    s#^FAULT$#FAULTY_ADDRESS#,
-    s#^LOOP$#SYMLINK_LOOP#,
-    s#^NOSPC$#NO_SPACE_LEFT#,
-    s#^NOMEM$#NOT_ENOUGH_MEMORY#,
-    s#^MFILE$#TOO_MANY_OPEN_FILES#,
-    s#^NFILE$#FILE_TABLE_OVERFLOW#,
-    s#^BADF$#BAD_FILE_DESCRIPTOR#,
-    s#^INVAL$#INVALID_ARGUMENT#,
-    s#^PIPE$#BROKEN_PIPE#,
-    s#^AGAIN$#TRYAGAIN#,
-    s#^INTR$#INTERRUPTED#,
-    s#^IO$#IO_ERROR#,
-    s#^PERM$#NOT_OWNER#
+_WRAP_GERROR(FileError, GFileError, G_FILE_ERROR,
+    sed s#^EXIST$#EXISTS#,
+    sed s#^ISDIR$#IS_DIRECTORY#,
+    sed s#^ACCES$#ACCESS_DENIED#,
+    sed s#^NAMETOOLONG$#NAME_TOO_LONG#,
+    sed s#^NOENT$#NO_SUCH_ENTITY#,
+    sed s#^NOTDIR$#NOT_DIRECTORY#,
+    sed s#^NXIO$#NO_SUCH_DEVICE#,
+    sed s#^NODEV$#NOT_DEVICE#,
+    sed s#^ROFS$#READONLY_FILESYSTEM#,
+    sed s#^TXTBSY$#TEXT_FILE_BUSY#,
+    sed s#^FAULT$#FAULTY_ADDRESS#,
+    sed s#^LOOP$#SYMLINK_LOOP#,
+    sed s#^NOSPC$#NO_SPACE_LEFT#,
+    sed s#^NOMEM$#NOT_ENOUGH_MEMORY#,
+    sed s#^MFILE$#TOO_MANY_OPEN_FILES#,
+    sed s#^NFILE$#FILE_TABLE_OVERFLOW#,
+    sed s#^BADF$#BAD_FILE_DESCRIPTOR#,
+    sed s#^INVAL$#INVALID_ARGUMENT#,
+    sed s#^PIPE$#BROKEN_PIPE#,
+    sed s#^AGAIN$#TRYAGAIN#,
+    sed s#^INTR$#INTERRUPTED#,
+    sed s#^IO$#IO_ERROR#,
+    sed s#^PERM$#NOT_OWNER#
 )
 
 /** @enum FileError::Code
diff --git a/glib/src/iochannel.hg b/glib/src/iochannel.hg
index 7f54f48..bfb6d70 100644
--- a/glib/src/iochannel.hg
+++ b/glib/src/iochannel.hg
@@ -40,22 +40,22 @@ namespace Glib
 class Source;
 class IOSource;
 
-_WRAP_ENUM(SeekType, GSeekType, NO_GTYPE, s#^SEEK_#SEEK_TYPE_#)
+_WRAP_ENUM(SeekType, GSeekType, NO_GTYPE, sed s#^SEEK_#SEEK_TYPE_#)
 _WRAP_ENUM(IOStatus, GIOStatus, NO_GTYPE)
 _WRAP_ENUM(IOFlags, GIOFlags, NO_GTYPE)
 
 /** Exception class for IOChannel errors.
  */
 _WRAP_GERROR(IOChannelError, GIOChannelError, G_IO_CHANNEL_ERROR, NO_GTYPE,
-    s#^INVAL$#INVALID_ARGUMENT#,
-    s#^ISDIR$#IS_DIRECTORY#,
-    s#^PIPE$#BROKEN_PIPE#,
-    s#^NOSPC$#NO_SPACE_LEFT#,
-    s#^NXIO$#NO_SUCH_DEVICE#,
-    s#^ACCES$#ACCESS_DENIED#,
-    s#^FBIG$#FILE_TOO_BIG#,
-    s#^IO$#IO_ERROR#,
-    s#^OVERFLOW$#OVERFLOWN#)
+    sed s#^INVAL$#INVALID_ARGUMENT#,
+    sed s#^ISDIR$#IS_DIRECTORY#,
+    sed s#^PIPE$#BROKEN_PIPE#,
+    sed s#^NOSPC$#NO_SPACE_LEFT#,
+    sed s#^NXIO$#NO_SUCH_DEVICE#,
+    sed s#^ACCES$#ACCESS_DENIED#,
+    sed s#^FBIG$#FILE_TOO_BIG#,
+    sed s#^IO$#IO_ERROR#,
+    sed s#^OVERFLOW$#OVERFLOWN#)
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 class GlibmmIOChannel;
diff --git a/glib/src/keyfile.hg b/glib/src/keyfile.hg
index 8a7b50f..ff9450a 100644
--- a/glib/src/keyfile.hg
+++ b/glib/src/keyfile.hg
@@ -135,7 +135,10 @@ public:
 
 #m4 _CONVERSION(`const Glib::ArrayHandle<std::string>&', `const gchar**', `const_cast<const gchar**>($3.data())')
 #m4 _CONVERSION(`Glib::ArrayHandle<std::string>&', `gchar**', `const_cast<gchar**>($3.data())')
-  _WRAP_METHOD(bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, Glib::ArrayHandle<std::string>& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE), g_key_file_load_from_dirs, errthrow)
+  // TODO: This is wrong - full_path should be a std::string& (an out param).
+  //_WRAP_METHOD(bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, Glib::ArrayHandle<std::string>& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE), g_key_file_load_from_dirs, errthrow)
+  // This has to be wrapped by hand.
+  //_WRAP_METHOD(bool load_from_dirs(const std::string& file, const Glib::ArrayHandle<std::string>& search_dirs, std::string& full_path, KeyFileFlags flags = Glib::KEY_FILE_NONE, g_key_file_load_from_dirs)
 
   /** Looks for a KeyFile named @a file in the paths returned from
    * g_get_user_data_dir() and g_get_system_data_dirs() and loads them
diff --git a/glib/src/markup.hg b/glib/src/markup.hg
index 908da76..f997590 100644
--- a/glib/src/markup.hg
+++ b/glib/src/markup.hg
@@ -119,7 +119,7 @@ Glib::ustring escape_text(const Glib::ustring& text);
  * the flags argument to all functions (this should be the default argument
  * anyway).
  */
-_WRAP_ENUM(ParseFlags, GMarkupParseFlags, NO_GTYPE, s#^MARKUP_##)
+_WRAP_ENUM(ParseFlags, GMarkupParseFlags, NO_GTYPE, sed s#^MARKUP_##)
 
 /*! @var Markup::ParseFlags DO_NOT_USE_THIS_UNSUPPORTED_FLAG
  * Flag you should not use.
diff --git a/glib/src/module.hg b/glib/src/module.hg
index 2d9a77b..9f93fe1 100644
--- a/glib/src/module.hg
+++ b/glib/src/module.hg
@@ -99,12 +99,14 @@ public:
    */
   _WRAP_METHOD(static std::string get_last_error(), g_module_error)
 
+  _PUSH_NAMED_CONV(void_to_gpointer, void*&, gpointer*, &(##ARG##), NONE, NONE)
   /** Gets a symbol pointer from the module.
    * @param symbol_name The name of the symbol to lookup
    * @param symbol A pointer to set to the symbol
    * @returns True if the symbol was found, false otherwise.
    */
   _WRAP_METHOD(bool get_symbol(const std::string& symbol_name, void*& symbol) const, g_module_symbol)
+  _POP_NAMED_CONV(void_to_gpointer)
 
   /** Get the name of the module.
    * @returns The name of the module
diff --git a/glib/src/optionentry.hg b/glib/src/optionentry.hg
index 06beae1..945e752 100644
--- a/glib/src/optionentry.hg
+++ b/glib/src/optionentry.hg
@@ -69,25 +69,25 @@ public:
 
   //#m4 _CONVERSION(`Glib::ustring',`const gchar*',`($3).empty() ? NULL : g_strdup(($3).c_str())')
   
-  _MEMBER_GET(long_name, long_name, Glib::ustring, const char*)
+  _MEMBER_GET(long_name, long_name, Glib::ustring, const gchar*)
 
   void set_long_name(const Glib::ustring& value);
   
   _MEMBER_GET(short_name, short_name, gchar, gchar)
   _MEMBER_SET(short_name, short_name, gchar, gchar)
   
-  _MEMBER_GET(flags, flags, int, int)
+  _MEMBER_GET(flags, flags, int, gint)
   /** Set one or more OptionEntry::Flags.
    * Do not set FLAG_FILENAME. Character encoding is chosen when the OptionEntry
    * is added to an OptionGroup.
    */
-  _MEMBER_SET(flags, flags, int, int)
+  _MEMBER_SET(flags, flags, int, gint)
   
-  _MEMBER_GET(description, description, Glib::ustring, const char*)
+  _MEMBER_GET(description, description, Glib::ustring, const gchar*)
 
   void set_description(const Glib::ustring& value);
   
-  _MEMBER_GET(arg_description, arg_description, Glib::ustring, const char*)
+  _MEMBER_GET(arg_description, arg_description, Glib::ustring, const gchar*)
 
   void set_arg_description(const Glib::ustring& value);
   
diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg
index 8db538c..352bebe 100644
--- a/glib/src/spawn.hg
+++ b/glib/src/spawn.hg
@@ -41,7 +41,7 @@ _WRAP_ENUM(SpawnFlags, GSpawnFlags, NO_GTYPE)
 
 /** Exception class for errors occuring when spawning processes.
  */
-_WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, NO_GTYPE, s#^2BIG$#TOOBIG#)
+_WRAP_GERROR(SpawnError, GSpawnError, G_SPAWN_ERROR, sed s#^2BIG$#TOOBIG#)
 
 /** Executes a child program asynchronously (your program will not
  * block waiting for the child to exit). The child program is
diff --git a/glib/src/variant.hg b/glib/src/variant.hg
index f1897a6..f751a7c 100644
--- a/glib/src/variant.hg
+++ b/glib/src/variant.hg
@@ -114,7 +114,9 @@ public:
 
   #m4 _CONVERSION(`const VariantBase&',`gconstpointer',`const_cast<GVariant*>(($3).gobj())')
   _WRAP_METHOD(guint hash() const, g_variant_hash)
+  _PUSH_NAMED_CONV(variantbase_to_gconstpointer, const VariantBase&, gconstpointer, static_cast<gconstpointer>(Glib::unwrap(##ARG##)), NONE, static_cast<gconstpointer>(Glib::unwrap_copy(##ARG##)))
   _WRAP_METHOD(bool equal(const VariantBase& other) const, g_variant_equal)
+  _POP_NAMED_CONV(variantbase_to_gconstpointer)
 
   /** Gets a VariantBase instance that has the same value as this variant and
    * is trusted to be in normal form.
diff --git a/glib/src/varianttype.hg b/glib/src/varianttype.hg
index 843f3d0..999e1fb 100644
--- a/glib/src/varianttype.hg
+++ b/glib/src/varianttype.hg
@@ -112,7 +112,9 @@ public:
 //The C parameters are actually const, but gmmproc doesn't understand that,
 //so we add a m4 conversion to satisfy it:
 #m4 _CONVERSION(`const VariantType&',`GVariantType*',`($3).gobj()')
+  // FIXME: That need fixing in gir - g_variant_type_new_array is treated there as a method instead of constructor, so first parameter is not stored at all.
   _WRAP_METHOD(static VariantType create_array(const VariantType& element), g_variant_type_new_array)
+  // FIXME: That need fixing in gir - g_variant_type_new_maybe is treated there as a method instead of constructor, so first parameter is not stored at all.
   _WRAP_METHOD(static VariantType create_maybe(const VariantType& element), g_variant_type_new_maybe)
 
   //TODO: Use a single list parameter:
@@ -136,7 +138,9 @@ public:
 
   #m4 _CONVERSION(`const VariantType&',`gconstpointer',`const_cast<GVariantType*>(($3).gobj())')
   _WRAP_METHOD(guint hash() const, g_variant_type_hash)
+  _PUSH_NAMED_CONV(varianttype_to_gconstpointer, const VariantType&, gconstpointer, static_cast<gconstpointer>(Glib::unwrap(##ARG##)), NONE, static_cast<gconstpointer>(Glib::unwrap_copy(##ARG##)))
   _WRAP_METHOD(bool equal(const VariantType& other) const, g_variant_type_equal)
+  _POP_NAMED_CONV(varianttype_to_gconstpointer)
 
   _WRAP_METHOD(bool is_subtype_of(const VariantType& supertype) const, g_variant_type_is_subtype_of)
 



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