diff options
Diffstat (limited to 'gio/src')
-rw-r--r-- | gio/src/applicationcommandline.hg | 28 | ||||
-rw-r--r-- | gio/src/filelist.am | 1 | ||||
-rw-r--r-- | gio/src/gio_vfuncs.defs | 22 | ||||
-rw-r--r-- | gio/src/remoteactiongroup.ccg | 23 | ||||
-rw-r--r-- | gio/src/remoteactiongroup.hg | 49 |
5 files changed, 123 insertions, 0 deletions
diff --git a/gio/src/applicationcommandline.hg b/gio/src/applicationcommandline.hg index 58d11397..023d27d2 100644 --- a/gio/src/applicationcommandline.hg +++ b/gio/src/applicationcommandline.hg @@ -24,6 +24,34 @@ _PINCLUDE(glibmm/private/object_p.h) namespace Gio { +/** ApplicationCommandLine - A command-line invocation of an application. + * ApplicationCommandLine represents a command-line invocation of an + * application. It is created by Application and emitted in the "command-line" + * signal and virtual function. + * + * The class contains the list of arguments that the program was invoked with. + * It is also possible to query if the commandline invocation was local (ie: + * the current process is running in direct response to the invocation) or + * remote (ie: some other process forwarded the commandline to this process). + * + * The ApplicationCommandLine object can provide the argc and argv parameters + * for use with the Glib::OptionContext command-line parsing API, with the + * get_arguments() method. + * + * The exit status of the originally-invoked process may be set and messages + * can be printed to stdout or stderr of that process. The lifecycle of the + * originally-invoked process is tied to the lifecycle of this object (ie: the + * process exits when the last reference is dropped). + * + * The main use for ApplicationCommandline (and the "command-line" signal) is + * 'Emacs server' like use cases: You can set the EDITOR environment variable + * to have e.g. git use your favourite editor to edit commit messages, and if + * you already have an instance of the editor running, the editing will happen + * in the running instance, instead of opening a new one. An important aspect + * of this use case is that the process that gets started by git does not + * return until the editing is done. + * @newin{2,32} + */ class ApplicationCommandLine : public Glib::Object { _CLASS_GOBJECT(ApplicationCommandLine, GApplicationCommandLine, G_APPLICATION_COMMAND_LINE, Glib::Object, GObject) diff --git a/gio/src/filelist.am b/gio/src/filelist.am index 567b5a3c..582c5d37 100644 --- a/gio/src/filelist.am +++ b/gio/src/filelist.am @@ -77,6 +77,7 @@ giomm_files_any_hg = \ proxy.hg \ proxyaddress.hg \ proxyresolver.hg \ + remoteactiongroup.hg \ resolver.hg \ seekable.hg \ settings.hg \ diff --git a/gio/src/gio_vfuncs.defs b/gio/src/gio_vfuncs.defs index b3bf4acb..ed7d3597 100644 --- a/gio/src/gio_vfuncs.defs +++ b/gio/src/gio_vfuncs.defs @@ -501,6 +501,28 @@ ) ) +; GRemoteActionGroup + +(define-vfunc activate_action_full + (of-object "GRemoteActionGroup") + (return-type "void") + (parameters + '("const-gchar*" "action_name") + '("GVariant*" "parameter") + '("GVariant*" "platform_data") + ) +) + +(define-vfunc change_action_state_full + (of-object "GRemoteActionGroup") + (return-type "void") + (parameters + '("const-gchar*" "action_name") + '("GVariant*" "value") + '("GVariant*" "platform_data") + ) +) + ; GSocketControlMessage (define-vfunc deserialize diff --git a/gio/src/remoteactiongroup.ccg b/gio/src/remoteactiongroup.ccg new file mode 100644 index 00000000..be265e59 --- /dev/null +++ b/gio/src/remoteactiongroup.ccg @@ -0,0 +1,23 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* 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. + */ + +namespace Gio +{ + +} // namespace Gio diff --git a/gio/src/remoteactiongroup.hg b/gio/src/remoteactiongroup.hg new file mode 100644 index 00000000..13a3b733 --- /dev/null +++ b/gio/src/remoteactiongroup.hg @@ -0,0 +1,49 @@ +// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- + +/* 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/interface.h> + +_DEFS(giomm,gio) +_PINCLUDE(glibmm/private/interface_p.h) +_PINCLUDE(gio/gio.h) + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef struct _GRemoteActionGroupInterface GRemoteActionGroupInterface; +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + +namespace Gio +{ + +/** TODO (When the C API docs is available). + */ +class RemoteActionGroup : public Glib::Interface +{ + _CLASS_INTERFACE(RemoteActionGroup, GRemoteActionGroup, G_REMOTE_ACTION_GROUP, GRemoteActionGroupInterface) + +public: + _WRAP_METHOD(void activate_action(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data), g_remote_action_group_activate_action_full) + _WRAP_METHOD(void change_action_state(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data), g_remote_action_group_change_action_state_full) + +#m4 _CONVERSION(`GVariant*',`const Glib::VariantBase&',`Glib::wrap($3, true)') + + _WRAP_VFUNC(void activate_action(const Glib::ustring& action_name, const Glib::VariantBase& parameter, const Glib::VariantBase& platform_data), "activate_action_full") + _WRAP_VFUNC(void change_action_state(const Glib::ustring& action_name, const Glib::VariantBase& value, const Glib::VariantBase& platform_data), "change_action_state_full") +}; + +} // namespace Gio |