gapplicationcommandline.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright © 2010 Codethink Limited
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General
  18. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  19. *
  20. * Authors: Ryan Lortie <desrt@desrt.ca>
  21. */
  22. #ifndef __G_APPLICATION_COMMAND_LINE_H__
  23. #define __G_APPLICATION_COMMAND_LINE_H__
  24. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  25. #error "Only <gio/gio.h> can be included directly."
  26. #endif
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_APPLICATION_COMMAND_LINE (g_application_command_line_get_type ())
  30. #define G_APPLICATION_COMMAND_LINE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
  31. G_TYPE_APPLICATION_COMMAND_LINE, \
  32. GApplicationCommandLine))
  33. #define G_APPLICATION_COMMAND_LINE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
  34. G_TYPE_APPLICATION_COMMAND_LINE, \
  35. GApplicationCommandLineClass))
  36. #define G_IS_APPLICATION_COMMAND_LINE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
  37. G_TYPE_APPLICATION_COMMAND_LINE))
  38. #define G_IS_APPLICATION_COMMAND_LINE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
  39. G_TYPE_APPLICATION_COMMAND_LINE))
  40. #define G_APPLICATION_COMMAND_LINE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
  41. G_TYPE_APPLICATION_COMMAND_LINE, \
  42. GApplicationCommandLineClass))
  43. typedef struct _GApplicationCommandLinePrivate GApplicationCommandLinePrivate;
  44. typedef struct _GApplicationCommandLineClass GApplicationCommandLineClass;
  45. struct _GApplicationCommandLine
  46. {
  47. /*< private >*/
  48. GObject parent_instance;
  49. GApplicationCommandLinePrivate *priv;
  50. };
  51. struct _GApplicationCommandLineClass
  52. {
  53. /*< private >*/
  54. GObjectClass parent_class;
  55. void (* print_literal) (GApplicationCommandLine *cmdline,
  56. const gchar *message);
  57. void (* printerr_literal) (GApplicationCommandLine *cmdline,
  58. const gchar *message);
  59. GInputStream * (* get_stdin) (GApplicationCommandLine *cmdline);
  60. void (* done) (GApplicationCommandLine *cmdline);
  61. gpointer padding[10];
  62. };
  63. GIO_AVAILABLE_IN_ALL
  64. GType g_application_command_line_get_type (void) G_GNUC_CONST;
  65. GIO_AVAILABLE_IN_ALL
  66. gchar ** g_application_command_line_get_arguments (GApplicationCommandLine *cmdline,
  67. int *argc);
  68. GIO_AVAILABLE_IN_2_40
  69. GVariantDict * g_application_command_line_get_options_dict (GApplicationCommandLine *cmdline);
  70. GIO_AVAILABLE_IN_2_36
  71. GInputStream * g_application_command_line_get_stdin (GApplicationCommandLine *cmdline);
  72. GIO_AVAILABLE_IN_ALL
  73. const gchar * const * g_application_command_line_get_environ (GApplicationCommandLine *cmdline);
  74. GIO_AVAILABLE_IN_ALL
  75. const gchar * g_application_command_line_getenv (GApplicationCommandLine *cmdline,
  76. const gchar *name);
  77. GIO_AVAILABLE_IN_ALL
  78. const gchar * g_application_command_line_get_cwd (GApplicationCommandLine *cmdline);
  79. GIO_AVAILABLE_IN_ALL
  80. gboolean g_application_command_line_get_is_remote (GApplicationCommandLine *cmdline);
  81. GIO_AVAILABLE_IN_2_80
  82. void g_application_command_line_print_literal (GApplicationCommandLine *cmdline,
  83. const gchar *message);
  84. GIO_AVAILABLE_IN_2_80
  85. void g_application_command_line_printerr_literal (GApplicationCommandLine *cmdline,
  86. const gchar *message);
  87. GIO_AVAILABLE_IN_ALL
  88. void g_application_command_line_print (GApplicationCommandLine *cmdline,
  89. const gchar *format,
  90. ...) G_GNUC_PRINTF(2, 3);
  91. GIO_AVAILABLE_IN_ALL
  92. void g_application_command_line_printerr (GApplicationCommandLine *cmdline,
  93. const gchar *format,
  94. ...) G_GNUC_PRINTF(2, 3);
  95. GIO_AVAILABLE_IN_ALL
  96. int g_application_command_line_get_exit_status (GApplicationCommandLine *cmdline);
  97. GIO_AVAILABLE_IN_ALL
  98. void g_application_command_line_set_exit_status (GApplicationCommandLine *cmdline,
  99. int exit_status);
  100. GIO_AVAILABLE_IN_ALL
  101. GVariant * g_application_command_line_get_platform_data (GApplicationCommandLine *cmdline);
  102. GIO_AVAILABLE_IN_2_36
  103. GFile * g_application_command_line_create_file_for_arg (GApplicationCommandLine *cmdline,
  104. const gchar *arg);
  105. GIO_AVAILABLE_IN_2_80
  106. void g_application_command_line_done (GApplicationCommandLine *cmdline);
  107. G_END_DECLS
  108. #endif /* __G_APPLICATION_COMMAND_LINE_H__ */