summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathon Jongsma <jonathon@quotidian.org>2010-11-13 20:47:57 -0600
committerJonathon Jongsma <jonathon@quotidian.org>2010-11-13 20:47:57 -0600
commitbffb7ceaeea7af2e06394850d8862a089671b5d5 (patch)
treeac7db74367f326dc52dad166db89c167480e4e4e
parent93179324198684926203b20b3bb2ecc8bb4bded2 (diff)
downloadglibmm-bffb7ceaeea7af2e06394850d8862a089671b5d5.tar.gz
Add Gio::ApplicationCommandLine
-rw-r--r--ChangeLog11
-rw-r--r--gio/giomm.h1
-rw-r--r--gio/src/application.hg4
-rw-r--r--gio/src/applicationcommandline.ccg5
-rw-r--r--gio/src/applicationcommandline.hg50
-rw-r--r--gio/src/filelist.am1
-rw-r--r--tools/m4/convert_gio.m41
7 files changed, 72 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 98498c03..19863848 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-11-13 Jonathon Jongsma <jjongsma@gnome.org>
+
+ Add Gio::ApplicationCommandLine
+
+ * gio/giomm.h:
+ * gio/src/application.hg:
+ * gio/src/applicationcommandline.ccg:
+ * gio/src/applicationcommandline.hg:
+ * gio/src/filelist.am:
+ * tools/m4/convert_gio.m4:
+
2010-11-12 Jonathon Jongsma <jjongsma@gnome.org>
Miscellaneous Gio::Application fixes
diff --git a/gio/giomm.h b/gio/giomm.h
index 939bf9c0..f79d8700 100644
--- a/gio/giomm.h
+++ b/gio/giomm.h
@@ -23,6 +23,7 @@
#include <giomm/actiongroup.h>
#include <giomm/appinfo.h>
#include <giomm/application.h>
+#include <giomm/applicationcommandline.h>
#include <giomm/asyncresult.h>
#include <giomm/bufferedinputstream.h>
#include <giomm/bufferedoutputstream.h>
diff --git a/gio/src/application.hg b/gio/src/application.hg
index 16128bb7..5c087cbd 100644
--- a/gio/src/application.hg
+++ b/gio/src/application.hg
@@ -17,6 +17,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <giomm/applicationcommandline.h>
#include <giomm/file.h>
#include <glibmm/object.h>
#include <glibmm/variant.h>
@@ -149,7 +150,8 @@ public:
_WRAP_SIGNAL(void startup(), "startup")
_WRAP_SIGNAL(void activate(), "activate")
//TODO: _WRAP_SIGNAL(void open(GFile** files, int n_files, const Glib::ustring& hint), "open")
- //TODO: Wrap ApplicationCommandLine: _WRAP_SIGNAL(void command_line(const Glib::RefPtr<ApplicationCommandLine>& command_line), "command-line")
+#m4 _CONVERSION(`GApplicationCommandLine*', `const Glib::RefPtr<ApplicationCommandLine>&',`Glib::wrap($3, true)')
+ _WRAP_SIGNAL(bool command_line(const Glib::RefPtr<ApplicationCommandLine>& command_line), "command-line")
};
diff --git a/gio/src/applicationcommandline.ccg b/gio/src/applicationcommandline.ccg
new file mode 100644
index 00000000..881f17c4
--- /dev/null
+++ b/gio/src/applicationcommandline.ccg
@@ -0,0 +1,5 @@
+#include <gio/gio.h>
+
+namespace Gio
+{
+}
diff --git a/gio/src/applicationcommandline.hg b/gio/src/applicationcommandline.hg
new file mode 100644
index 00000000..5f1ea4d9
--- /dev/null
+++ b/gio/src/applicationcommandline.hg
@@ -0,0 +1,50 @@
+/* Copyright (C) 2010 Jonathon Jongsma <jonathon@quotidian.org>
+ *
+ * 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 <glibmm/variant.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+class ApplicationCommandLine : public Glib::Object
+{
+ _CLASS_GOBJECT(ApplicationCommandLine, GApplicationCommandLine, G_APPLICATION_COMMAND_LINE, Glib::Object, GObject)
+
+protected:
+ _CTOR_DEFAULT
+
+public:
+
+ _WRAP_METHOD(char** get_arguments(int& argc) const, g_application_command_line_get_arguments);
+ _WRAP_METHOD(Glib::ustring 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<Glib::ustring> get_environ() const, g_application_command_line_get_environ)
+ _WRAP_METHOD(Glib::ustring getenv(const Glib::ustring& name) const, g_application_command_line_getenv)
+ _WRAP_METHOD(bool is_remote() const, g_application_command_line_get_is_remote)
+ //GVariant * g_application_command_line_get_platform_data
+ _WRAP_METHOD(void set_exit_status(int exit_status), g_application_command_line_set_exit_status)
+ _WRAP_METHOD(int get_exit_status() const, g_application_command_line_get_exit_status)
+ _WRAP_METHOD(void print(const Glib::ustring& message), g_application_command_line_print)
+ _WRAP_METHOD(void printerr(const Glib::ustring& message), g_application_command_line_printerr)
+};
+
+
+} // namespace Gio
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index 4a96daa1..b0a840cd 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -16,6 +16,7 @@ giomm_files_any_hg = \
actiongroup.hg \
appinfo.hg \
application.hg \
+ applicationcommandline.hg \
asyncinitable.hg \
asyncresult.hg \
bufferedinputstream.hg \
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index 8c4cb380..36e0fe7f 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -48,6 +48,7 @@ _CONVERSION(`GAppInfo*',`const Glib::RefPtr<AppInfo>&',`Glib::wrap($3)')
_CONVERSION(`const Glib::ListHandle< Glib::RefPtr<Gio::File> >&',`GList*',`$3.data()')
_CONVERSION(`GApplication*',`Glib::RefPtr<Application>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<ApplicationCommandLine>&',`GApplicationCommandLine*',__CONVERT_CONST_REFPTR_TO_P)
# AsyncResult
_CONVERSION(`Glib::RefPtr<Glib::Object>',`GObject*',__CONVERT_REFPTR_TO_P)