[glibmm] Add Gio::ApplicationCommandLine



commit bffb7ceaeea7af2e06394850d8862a089671b5d5
Author: Jonathon Jongsma <jonathon quotidian org>
Date:   Sat Nov 13 20:47:57 2010 -0600

    Add Gio::ApplicationCommandLine

 ChangeLog                          |   11 ++++++++
 gio/giomm.h                        |    1 +
 gio/src/application.hg             |    4 ++-
 gio/src/applicationcommandline.ccg |    5 +++
 gio/src/applicationcommandline.hg  |   50 ++++++++++++++++++++++++++++++++++++
 gio/src/filelist.am                |    1 +
 tools/m4/convert_gio.m4            |    1 +
 7 files changed, 72 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 98498c0..1986384 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 939bf9c..f79d870 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 16128bb..5c087cb 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 0000000..881f17c
--- /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 0000000..5f1ea4d
--- /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 4a96daa..b0a840c 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 8c4cb38..36e0fe7 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)



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