From 03d480c433b50ff6f58ac62a4bce5cd2584d5104 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 14 Sep 2002 12:48:06 +0000 Subject: [PATCH] adding a section on gnome integration Original commit message from CVS: adding a section on gnome integration --- docs/manual/appendix-gnome.xml | 74 ++++++++++++++++++++++++++++++++++++ docs/manual/appendix-integration.xml | 74 ++++++++++++++++++++++++++++++++++++ docs/manual/gnome.xml | 74 ++++++++++++++++++++++++++++++++++++ docs/manual/gstreamer-manual.xml | 3 ++ 4 files changed, 225 insertions(+) create mode 100644 docs/manual/appendix-gnome.xml create mode 100644 docs/manual/appendix-integration.xml create mode 100644 docs/manual/gnome.xml diff --git a/docs/manual/appendix-gnome.xml b/docs/manual/appendix-gnome.xml new file mode 100644 index 0000000..99404e7 --- /dev/null +++ b/docs/manual/appendix-gnome.xml @@ -0,0 +1,74 @@ + + Gnome integration + + GStreamer is fairly easy to integrate with Gnome applications. + GStreamer uses libxml 2.0, GLib 2.0 and popt, as do all other + Gnome applications. + There are however some basic issues you need to address in your Gnome + applications. + + + + Command line options + + Gnome applications call gnome_program_init () to parse command-line + options and initialize the necessary gnome modules. + GStreamer applications normally call gst_init (&argc, &argv) to + do the same for GStreamer. + + + Each of these two swallows the program options passed to the program, + so we need a different way to allow both Gnome and GStreamer to parse + the command-line options. This is shown in the following example. + + + +/* example-begin gnome.c */ +#include <gnome.h> +#include <gst/gst.h> + +int +main (int argc, char **argv) +{ + struct poptOption options[] = { + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, NULL, 0, "GStreamer", NULL }, + POPT_TABLEEND + }; + GnomeProgram *program; + poptContext context; + const gchar **argvn; + + options[0].arg = (void *) gst_init_get_popt_table (); + if (! (program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, + argc, argv, + GNOME_PARAM_POPT_TABLE, options, + NULL))) + g_error ("gnome_program_init failed"); + + g_object_get (program, "popt-context", &context, NULL); + argvn = poptGetArgs (context); + if (!argvn) { + g_print ("Run this example with some arguments to see how it works.\n"); + return 0; + } + + while (*argvn) { + g_print ("argument: %s\n", *argvn); + ++argvn; + } + + return 0; +} +/* example-end gnome.c */ + + + If you try out this program, you will see that when called with + --help, it will print out both GStreamer and Gnome help arguments. + All of the arguments that didn't belong to either end up in the + argvn pointer array. + + + FIXME: flesh this out more. How do we get the GStreamer arguments + at the end ? + + diff --git a/docs/manual/appendix-integration.xml b/docs/manual/appendix-integration.xml new file mode 100644 index 0000000..99404e7 --- /dev/null +++ b/docs/manual/appendix-integration.xml @@ -0,0 +1,74 @@ + + Gnome integration + + GStreamer is fairly easy to integrate with Gnome applications. + GStreamer uses libxml 2.0, GLib 2.0 and popt, as do all other + Gnome applications. + There are however some basic issues you need to address in your Gnome + applications. + + + + Command line options + + Gnome applications call gnome_program_init () to parse command-line + options and initialize the necessary gnome modules. + GStreamer applications normally call gst_init (&argc, &argv) to + do the same for GStreamer. + + + Each of these two swallows the program options passed to the program, + so we need a different way to allow both Gnome and GStreamer to parse + the command-line options. This is shown in the following example. + + + +/* example-begin gnome.c */ +#include <gnome.h> +#include <gst/gst.h> + +int +main (int argc, char **argv) +{ + struct poptOption options[] = { + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, NULL, 0, "GStreamer", NULL }, + POPT_TABLEEND + }; + GnomeProgram *program; + poptContext context; + const gchar **argvn; + + options[0].arg = (void *) gst_init_get_popt_table (); + if (! (program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, + argc, argv, + GNOME_PARAM_POPT_TABLE, options, + NULL))) + g_error ("gnome_program_init failed"); + + g_object_get (program, "popt-context", &context, NULL); + argvn = poptGetArgs (context); + if (!argvn) { + g_print ("Run this example with some arguments to see how it works.\n"); + return 0; + } + + while (*argvn) { + g_print ("argument: %s\n", *argvn); + ++argvn; + } + + return 0; +} +/* example-end gnome.c */ + + + If you try out this program, you will see that when called with + --help, it will print out both GStreamer and Gnome help arguments. + All of the arguments that didn't belong to either end up in the + argvn pointer array. + + + FIXME: flesh this out more. How do we get the GStreamer arguments + at the end ? + + diff --git a/docs/manual/gnome.xml b/docs/manual/gnome.xml new file mode 100644 index 0000000..99404e7 --- /dev/null +++ b/docs/manual/gnome.xml @@ -0,0 +1,74 @@ + + Gnome integration + + GStreamer is fairly easy to integrate with Gnome applications. + GStreamer uses libxml 2.0, GLib 2.0 and popt, as do all other + Gnome applications. + There are however some basic issues you need to address in your Gnome + applications. + + + + Command line options + + Gnome applications call gnome_program_init () to parse command-line + options and initialize the necessary gnome modules. + GStreamer applications normally call gst_init (&argc, &argv) to + do the same for GStreamer. + + + Each of these two swallows the program options passed to the program, + so we need a different way to allow both Gnome and GStreamer to parse + the command-line options. This is shown in the following example. + + + +/* example-begin gnome.c */ +#include <gnome.h> +#include <gst/gst.h> + +int +main (int argc, char **argv) +{ + struct poptOption options[] = { + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, NULL, 0, "GStreamer", NULL }, + POPT_TABLEEND + }; + GnomeProgram *program; + poptContext context; + const gchar **argvn; + + options[0].arg = (void *) gst_init_get_popt_table (); + if (! (program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, + argc, argv, + GNOME_PARAM_POPT_TABLE, options, + NULL))) + g_error ("gnome_program_init failed"); + + g_object_get (program, "popt-context", &context, NULL); + argvn = poptGetArgs (context); + if (!argvn) { + g_print ("Run this example with some arguments to see how it works.\n"); + return 0; + } + + while (*argvn) { + g_print ("argument: %s\n", *argvn); + ++argvn; + } + + return 0; +} +/* example-end gnome.c */ + + + If you try out this program, you will see that when called with + --help, it will print out both GStreamer and Gnome help arguments. + All of the arguments that didn't belong to either end up in the + argvn pointer array. + + + FIXME: flesh this out more. How do we get the GStreamer arguments + at the end ? + + diff --git a/docs/manual/gstreamer-manual.xml b/docs/manual/gstreamer-manual.xml index 44346e7..9503d68 100644 --- a/docs/manual/gstreamer-manual.xml +++ b/docs/manual/gstreamer-manual.xml @@ -36,6 +36,7 @@ + ]> @@ -242,6 +243,8 @@ &COMPONENTS; + &GNOME; + "ES; -- 2.7.4