summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2011-03-04 09:40:36 +0100
committerMurray Cumming <murrayc@murrayc.com>2011-03-04 09:40:36 +0100
commitd7673615ec159cc7d1a56b79d8ef2317b57e8f2d (patch)
treecc6131631b3f092cdeeb106ceb23bd5939c196ed
parent22d4e2370000a7739cc990bac15106ee82592a2c (diff)
downloadglibmm-d7673615ec159cc7d1a56b79d8ef2317b57e8f2d.tar.gz
Gio::Application: Added get_environ().
* gio/src/gio_others.defs: Add a hand-written definition for this, because h2defs.py ignores functions with this return type. * gio/src/applicationcommandline.hg: Wrap the function.
-rw-r--r--ChangeLog8
-rw-r--r--gio/src/applicationcommandline.hg5
-rw-r--r--gio/src/gio_others.defs8
3 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index af0d8575..7021b21c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2011-03-04 Murray Cumming <murrayc@murrayc.com>
+ Gio::Application: Added get_environ().
+
+ * gio/src/gio_others.defs: Add a hand-written definition for this, because
+ h2defs.py ignores functions with this return type.
+ * gio/src/applicationcommandline.hg: Wrap the function.
+
+2011-03-04 Murray Cumming <murrayc@murrayc.com>
+
ApplicationCommandLine: Use std::string instead of ustring in some API.
* gio/src/applicationcommandline.hg: The C documentation says that some
diff --git a/gio/src/applicationcommandline.hg b/gio/src/applicationcommandline.hg
index 02e02a02..bb95fe51 100644
--- a/gio/src/applicationcommandline.hg
+++ b/gio/src/applicationcommandline.hg
@@ -38,8 +38,9 @@ public:
//We use std::string instead of ustring because the C documentation says that it may be non-UTF-8 data:
_WRAP_METHOD(std::string get_cwd() const, g_application_command_line_get_cwd)
- // it seems that h2defs.py has trouble parsing the const gchar * const * type
- //_WRAP_METHOD(std::vector<std::string> get_environ() const, g_application_command_line_get_environ)
+ //We use std::string instead of ustring because the C documentation says that it may be non-UTF-8 data:
+#m4 _CONVERSION(`const gchar*const*',`std::vector<std::string>',`Glib::ArrayHandler<std::string>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
+ _WRAP_METHOD(std::vector<std::string> get_environ() const, g_application_command_line_get_environ)
//We use std::string instead of ustring because the C documentation says that it may be non-UTF-8 data:
_WRAP_METHOD(std::string getenv(const Glib::ustring& name) const, g_application_command_line_getenv)
diff --git a/gio/src/gio_others.defs b/gio/src/gio_others.defs
index 7330612b..312c73cf 100644
--- a/gio/src/gio_others.defs
+++ b/gio/src/gio_others.defs
@@ -4,6 +4,13 @@
(return-type "const-char*const*")
)
+; h2defs failed to generate this murrayc:
+(define-method get_environ
+ (of-object "GApplicationCommandLine")
+ (c-name "g_application_command_line_get_environ")
+ (return-type "const-gchar*const*")
+)
+
; extra_defs does not generate these, for some reason. murrayc:
(define-signal changed
@@ -32,3 +39,4 @@
)
+