Add g_application_command_line_get_stdin()

This returns a GInputStream corresponding to the stdin on the
commandline that caused this invocation.

The local case works on both UNIX (GUnixInputStream on stdin) and
Windows (GWin32InputStream on GetStdHandle(STD_INPUT_HANDLE)).  The
remote case works only on UNIX (by fd passing over D-Bus).

https://bugzilla.gnome.org/show_bug.cgi?id=668210
This commit is contained in:
Ryan Lortie
2012-01-18 14:37:37 -05:00
parent 3e97776276
commit 89d48d7800
4 changed files with 119 additions and 14 deletions

View File

@@ -62,12 +62,13 @@ struct _GApplicationCommandLineClass
/*< private >*/
GObjectClass parent_class;
void (* print_literal) (GApplicationCommandLine *cmdline,
const gchar *message);
void (* printerr_literal) (GApplicationCommandLine *cmdline,
const gchar *message);
void (* print_literal) (GApplicationCommandLine *cmdline,
const gchar *message);
void (* printerr_literal) (GApplicationCommandLine *cmdline,
const gchar *message);
GInputStream * (* get_stdin) (GApplicationCommandLine *cmdline);
gpointer padding[12];
gpointer padding[11];
};
GType g_application_command_line_get_type (void) G_GNUC_CONST;
@@ -75,6 +76,8 @@ GType g_application_command_line_get_type (void) G
gchar ** g_application_command_line_get_arguments (GApplicationCommandLine *cmdline,
int *argc);
GInputStream * g_application_command_line_get_stdin (GApplicationCommandLine *cmdline);
const gchar * const * g_application_command_line_get_environ (GApplicationCommandLine *cmdline);
const gchar * g_application_command_line_getenv (GApplicationCommandLine *cmdline,