gst-indent run on core

Original commit message from CVS:
gst-indent run on core
parent b8edc59e

Too many changes to show.

To preserve performance only 205 of 205+ files are displayed.
2004-03-13 Thomas Vander Stichele <thomas at apestaart dot org>
* *.c, *.h: commit of gst-indent run on core
2004-03-13 Thomas Vander Stichele <thomas at apestaart dot org>
* tools/gst-indent:
......
......@@ -38,11 +38,12 @@ static BonoboGenericFactory *factory = NULL;
/*
* BonoboControl data
*/
typedef struct {
BonoboControl *bonobo_object;
BonoboUIComponent *uic;
typedef struct
{
BonoboControl *bonobo_object;
BonoboUIComponent *uic;
GstPlay *play;
GstPlay *play;
} control_data_t;
/*
......@@ -50,20 +51,20 @@ typedef struct {
* encounters a fatal CORBA exception.
*/
static void
control_system_exception_cb (BonoboControl *control, CORBA_Object corba_object,
CORBA_Environment *ev, gpointer data)
control_system_exception_cb (BonoboControl * control, CORBA_Object corba_object,
CORBA_Environment * ev, gpointer data)
{
bonobo_object_unref (BONOBO_OBJECT (control));
}
static void
control_update (control_data_t *control_data)
control_update (control_data_t * control_data)
{
gtk_widget_queue_draw (GTK_WIDGET (control_data->play));
}
static void
verb_Play_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
verb_Play_cb (BonoboUIComponent * uic, gpointer user_data, const char *cname)
{
control_data_t *control_data = (control_data_t *) user_data;
......@@ -72,7 +73,7 @@ verb_Play_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
}
static void
verb_Pause_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
verb_Pause_cb (BonoboUIComponent * uic, gpointer user_data, const char *cname)
{
control_data_t *control_data = (control_data_t *) user_data;
......@@ -81,7 +82,7 @@ verb_Pause_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
}
static void
verb_Stop_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
verb_Stop_cb (BonoboUIComponent * uic, gpointer user_data, const char *cname)
{
control_data_t *control_data = (control_data_t *) user_data;
......@@ -89,51 +90,53 @@ verb_Stop_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
control_update (control_data);
}
typedef struct {
typedef struct
{
control_data_t *control_data;
GtkFileSelection *selector;
} file_select_struct;
static void
filename_selected (GtkButton *ok, gpointer user_data)
static void
filename_selected (GtkButton * ok, gpointer user_data)
{
file_select_struct *select = (file_select_struct *) user_data;
gchar *selected_filename;
selected_filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION(select->selector));
selected_filename =
gtk_file_selection_get_filename (GTK_FILE_SELECTION (select->selector));
gst_play_set_uri (select->control_data->play, selected_filename);
gst_play_play (select->control_data->play);
control_update (select->control_data);
g_free(select);
g_free (select);
}
static void
verb_Open_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
verb_Open_cb (BonoboUIComponent * uic, gpointer user_data, const char *cname)
{
control_data_t *control_data = (control_data_t *) user_data;
file_select_struct *data = g_new0(file_select_struct, 1);
file_select_struct *data = g_new0 (file_select_struct, 1);
GtkWidget *file_selector;
file_selector = gtk_file_selection_new("Select a media file");
file_selector = gtk_file_selection_new ("Select a media file");
data->selector = GTK_FILE_SELECTION (file_selector);
data->control_data = control_data;
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->ok_button),
"clicked", GTK_SIGNAL_FUNC (filename_selected), data);
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->ok_button),
"clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
(gpointer) file_selector);
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION(file_selector)->cancel_button),
"clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
(gpointer) file_selector);
gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->
ok_button), "clicked", GTK_SIGNAL_FUNC (filename_selected), data);
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->
ok_button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
(gpointer) file_selector);
gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (file_selector)->
cancel_button), "clicked", GTK_SIGNAL_FUNC (gtk_widget_destroy),
(gpointer) file_selector);
gtk_widget_show (file_selector);
}
......@@ -142,37 +145,36 @@ verb_Open_cb (BonoboUIComponent *uic, gpointer user_data, const char *cname)
* in with our container's menus.
*/
static void
control_create_menus (control_data_t *control_data)
control_create_menus (control_data_t * control_data)
{
BonoboControl *control = control_data->bonobo_object;
Bonobo_UIContainer remote_uic;
GdkPixbuf *pixbuf;
static char ui [] =
"<Root>"
" <commands>"
" <cmd name=\"Play\" _label=\"Play\" _tip=\"Play\"/>"
" <cmd name=\"Pause\" _label=\"Pause\" _tip=\"Pause\"/>"
" <cmd name=\"Stop\" _label=\"Stop\" _tip=\"Stop\"/>"
" <cmd name=\"Open\" _label=\"Open Media\" _tip=\"Open a media stream\"/>"
" </commands>"
" <menu>"
" <submenu name=\"Player\" _label=\"_Player\">"
" <menuitem name=\"Open\" pixtype=\"stock\" pixname=\"Open\" verb=\"\"/>"
" <separator/>"
" <menuitem name=\"Play\" verb=\"\"/>"
" <menuitem name=\"Pause\" verb=\"\"/>"
" <menuitem name=\"Stop\" verb=\"\"/>"
" </submenu>"
" </menu>"
" <dockitem name=\"GstMediaPlay\">"
" <toolitem name=\"Play\" type=\"toggle\" verb=\"\"/>"
" <toolitem name=\"Pause\" type=\"toggle\" verb=\"\"/>"
" <toolitem name=\"Stop\" type=\"toggle\" verb=\"\"/>"
" </dockitem>"
"</Root>";
g_print("create menu\n");
static char ui[] =
"<Root>"
" <commands>"
" <cmd name=\"Play\" _label=\"Play\" _tip=\"Play\"/>"
" <cmd name=\"Pause\" _label=\"Pause\" _tip=\"Pause\"/>"
" <cmd name=\"Stop\" _label=\"Stop\" _tip=\"Stop\"/>"
" <cmd name=\"Open\" _label=\"Open Media\" _tip=\"Open a media stream\"/>"
" </commands>"
" <menu>"
" <submenu name=\"Player\" _label=\"_Player\">"
" <menuitem name=\"Open\" pixtype=\"stock\" pixname=\"Open\" verb=\"\"/>"
" <separator/>"
" <menuitem name=\"Play\" verb=\"\"/>"
" <menuitem name=\"Pause\" verb=\"\"/>"
" <menuitem name=\"Stop\" verb=\"\"/>"
" </submenu>"
" </menu>"
" <dockitem name=\"GstMediaPlay\">"
" <toolitem name=\"Play\" type=\"toggle\" verb=\"\"/>"
" <toolitem name=\"Pause\" type=\"toggle\" verb=\"\"/>"
" <toolitem name=\"Stop\" type=\"toggle\" verb=\"\"/>"
" </dockitem>" "</Root>";
g_print ("create menu\n");
/*
* Get our container's UIContainer server.
*/
......@@ -206,8 +208,8 @@ control_create_menus (control_data_t *control_data)
node = bonobo_ui_node_from_string (ui);
bonobo_ui_util_translate_ui (node);
bonobo_ui_util_fixup_help (control_data->uic, node,
DATADIR, "gstmediaplay");
DATADIR, "gstmediaplay");
bonobo_ui_component_set_tree (control_data->uic, "/", node, NULL);
bonobo_ui_node_free (node);
......@@ -225,11 +227,11 @@ control_create_menus (control_data_t *control_data)
bonobo_ui_util_set_pixbuf (control_data->uic, "/commands/Stop", pixbuf);
gdk_pixbuf_unref (pixbuf);
g_print("create menu done\n");
g_print ("create menu done\n");
}
static void
control_remove_menus (control_data_t *control_data)
control_remove_menus (control_data_t * control_data)
{
bonobo_ui_component_unset_container (control_data->uic);
}
......@@ -238,18 +240,18 @@ control_remove_menus (control_data_t *control_data)
* Clean up our supplementary BonoboControl data sturctures.
*/
static void
control_destroy_cb (BonoboControl *control, gpointer data)
control_destroy_cb (BonoboControl * control, gpointer data)
{
control_data_t *control_data = (control_data_t *) data;
control_data->play = NULL;
g_free (control_data);
g_free (control_data);
running_objects--;
if (running_objects > 0)
return;
/*
* When the last object has gone, unref the factory & quit.
*/
......@@ -258,7 +260,7 @@ control_destroy_cb (BonoboControl *control, gpointer data)
}
static void
control_activate_cb (BonoboControl *control, gboolean activate, gpointer data)
control_activate_cb (BonoboControl * control, gboolean activate, gpointer data)
{
control_data_t *control_data = (control_data_t *) data;
......@@ -284,17 +286,17 @@ control_activate_cb (BonoboControl *control, gboolean activate, gpointer data)
}
static void
control_set_frame_cb (BonoboControl *control, gpointer data)
control_set_frame_cb (BonoboControl * control, gpointer data)
{
control_create_menus ((control_data_t *) data);
}
static BonoboObject *
bonobo_gstmediaplay_factory (BonoboGenericFactory *this, void *data)
bonobo_gstmediaplay_factory (BonoboGenericFactory * this, void *data)
{
BonoboControl *bonobo_object;
control_data_t *control_data;
GtkWidget *vbox;
BonoboControl *bonobo_object;
control_data_t *control_data;
GtkWidget *vbox;
gst_init (NULL, NULL);
/*
......@@ -311,7 +313,7 @@ bonobo_gstmediaplay_factory (BonoboGenericFactory *this, void *data)
vbox = gtk_vbox_new (TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (control_data->play),
TRUE, TRUE, 0);
TRUE, TRUE, 0);
gtk_widget_show_all (vbox);
gst_play_set_uri (control_data->play, "/opt/data/armageddon1.mpg");
......@@ -337,39 +339,39 @@ bonobo_gstmediaplay_factory (BonoboGenericFactory *this, void *data)
* the "activate" signal.
*/
gtk_signal_connect (GTK_OBJECT (bonobo_object), "activate",
GTK_SIGNAL_FUNC (control_activate_cb), control_data);
GTK_SIGNAL_FUNC (control_activate_cb), control_data);
gtk_signal_connect (GTK_OBJECT (bonobo_object), "set_frame",
GTK_SIGNAL_FUNC (control_set_frame_cb), control_data);
GTK_SIGNAL_FUNC (control_set_frame_cb), control_data);
/*
* The "system_exception" signal is raised when the BonoboControl
* encounters a fatal CORBA exception.
*/
gtk_signal_connect (GTK_OBJECT (bonobo_object), "system_exception",
GTK_SIGNAL_FUNC (control_system_exception_cb), control_data);
GTK_SIGNAL_FUNC (control_system_exception_cb), control_data);
/*
* We'll need to be able to cleanup when this control gets
* destroyed.
*/
gtk_signal_connect (GTK_OBJECT (bonobo_object), "destroy",
GTK_SIGNAL_FUNC (control_destroy_cb), control_data);
GTK_SIGNAL_FUNC (control_destroy_cb), control_data);
bonobo_ui_component_add_verb (control_data->uic, "Play",
verb_Play_cb, control_data);
verb_Play_cb, control_data);
bonobo_ui_component_add_verb (control_data->uic, "Pause",
verb_Pause_cb, control_data);
verb_Pause_cb, control_data);
bonobo_ui_component_add_verb (control_data->uic, "Stop",
verb_Stop_cb, control_data);
verb_Stop_cb, control_data);
bonobo_ui_component_add_verb (control_data->uic, "Open",
verb_Open_cb, control_data);
verb_Open_cb, control_data);
/*
* Count the new running object
*/
running_objects++;
g_print("running objects: %d\n", running_objects);
g_print ("running objects: %d\n", running_objects);
return BONOBO_OBJECT (bonobo_object);
}
......@@ -377,9 +379,10 @@ bonobo_gstmediaplay_factory (BonoboGenericFactory *this, void *data)
static void
init_gstmediaplay_factory (void)
{
factory = bonobo_generic_factory_new (
"OAFIID:bonobo_gstmediaplay_factory:420f20ca-55d7-4a33-b327-0b246136db18",
bonobo_gstmediaplay_factory, NULL);
factory =
bonobo_generic_factory_new
("OAFIID:bonobo_gstmediaplay_factory:420f20ca-55d7-4a33-b327-0b246136db18",
bonobo_gstmediaplay_factory, NULL);
}
static void
......@@ -393,9 +396,8 @@ init_server_factory (int argc, char **argv)
CORBA_exception_init (&ev);
gnome_init_with_popt_table("bonobo-gstmediaplay", VERSION,
argc, argv,
oaf_popt_options, 0, NULL);
gnome_init_with_popt_table ("bonobo-gstmediaplay", VERSION,
argc, argv, oaf_popt_options, 0, NULL);
orb = oaf_init (argc, argv);
if (bonobo_init (orb, NULL, NULL) == FALSE)
......@@ -403,7 +405,7 @@ init_server_factory (int argc, char **argv)
CORBA_exception_free (&ev);
}
int
main (int argc, char **argv)
{
......
......@@ -27,48 +27,48 @@
#include <gst/gst.h>
#include <config.h>
static BonoboObject* gstreamer_factory (BonoboGenericFactory *factory,
gpointer user_data)
static BonoboObject *
gstreamer_factory (BonoboGenericFactory * factory, gpointer user_data)
{
return BONOBO_OBJECT (bonobo_media_gstreamer_new ());
return BONOBO_OBJECT (bonobo_media_gstreamer_new ());
}
static void init_bonobo (int argc, char **argv)
static void
init_bonobo (int argc, char **argv)
{
CORBA_ORB orb;
CORBA_ORB orb;
gnome_init_with_popt_table ("bonobo-media-gstreamer", VERSION,
argc, argv,
oaf_popt_options, 0, NULL);
gnome_init_with_popt_table ("bonobo-media-gstreamer", VERSION,
argc, argv, oaf_popt_options, 0, NULL);
orb = oaf_init (argc, argv);
orb = oaf_init (argc, argv);
if (bonobo_init (orb, NULL, NULL) == FALSE)
g_error ("Could not initialize Bonobo");
if (bonobo_init (orb, NULL, NULL) == FALSE)
g_error ("Could not initialize Bonobo");
}
static void last_unref_cb (BonoboObject *bonobo_object,
BonoboGenericFactory *factory)
static void
last_unref_cb (BonoboObject * bonobo_object, BonoboGenericFactory * factory)
{
bonobo_object_unref (BONOBO_OBJECT (factory));
gtk_main_quit ();
bonobo_object_unref (BONOBO_OBJECT (factory));
gtk_main_quit ();
}
int main (int argc, char **argv)
int
main (int argc, char **argv)
{
BonoboGenericFactory *factory;
BonoboGenericFactory *factory;
gst_init (&argc, &argv);
init_bonobo (argc, argv);
gst_init (&argc, &argv);
init_bonobo (argc, argv);
factory = bonobo_generic_factory_new (
"OAFIID:Bonobo_Media_GStreamer_Factory",
gstreamer_factory, NULL);
factory = bonobo_generic_factory_new ("OAFIID:Bonobo_Media_GStreamer_Factory",
gstreamer_factory, NULL);
gtk_signal_connect (GTK_OBJECT (bonobo_context_running_get ()), "last_unref",
GTK_SIGNAL_FUNC (last_unref_cb), factory);
gtk_signal_connect (GTK_OBJECT (bonobo_context_running_get ()), "last_unref",
GTK_SIGNAL_FUNC (last_unref_cb), factory);
bonobo_main ();
bonobo_main ();
return 0;
return 0;
}
......@@ -174,12 +174,6 @@ pipeline</ulink> and Microsoft's DirectShow for some background.
@use_threads:
<!-- ##### VARIABLE g_log_domain_gstreamer ##### -->
<para>
The variable that holds the GStreamer log domain
</para>
<!-- ##### MACRO GST_VERSION_MAJOR ##### -->
<para>
The major version of GStreamer at compile time
......
......@@ -72,6 +72,34 @@ The GstBin object
</para>
<!-- ##### SIGNAL GstBin::element-added ##### -->
<para>
</para>
@gstbin: the object which received the signal.
@arg1: the element that was added to the bin
<!-- ##### SIGNAL GstBin::element-removed ##### -->
<para>
</para>
@gstbin: the object which received the signal.
@arg1: the element that was removed from the bin
<!-- ##### SIGNAL GstBin::iterate ##### -->
<para>
This signal is emitted when a bin iterates, either automatically or
due to a #gst_bin_iterate() call. The return value is used to
determine if the object method handler processed any data.
In most normal cases, a user-provided signal handler should return
FALSE.
</para>
@gstbin: the object which received the signal.
@Returns: TRUE if the state of the bin was advanced.
<!-- ##### USER_FUNCTION GstBinPrePostIterateFunction ##### -->
<para>
The signature of the callback for the post and pre iterate function as set with
......@@ -224,31 +252,3 @@ gst_bin_set_pre_iterate_function() and gst_bin_set_post_iterate_function().
@clock:
<!-- ##### SIGNAL GstBin::element-added ##### -->
<para>
</para>
@gstbin: the object which received the signal.
@arg1: the element that was added to the bin
<!-- ##### SIGNAL GstBin::element-removed ##### -->
<para>
</para>
@gstbin: the object which received the signal.
@arg1: the element that was removed from the bin
<!-- ##### SIGNAL GstBin::iterate ##### -->
<para>
This signal is emitted when a bin iterates, either automatically or
due to a #gst_bin_iterate() call. The return value is used to
determine if the object method handler processed any data.
In most normal cases, a user-provided signal handler should return
FALSE.
</para>
@gstbin: the object which received the signal.
@Returns: TRUE if the state of the bin was advanced.
......@@ -235,6 +235,21 @@ Get the clock flags
</para>
<!-- ##### ARG GstClock:event-diff ##### -->
<para>
</para>
<!-- ##### ARG GstClock:max-diff ##### -->
<para>
Maximum allowed diff for clock sync requests against the real time.
</para>
<!-- ##### ARG GstClock:stats ##### -->
<para>
Boolean property to activate stat generation on the clock.
</para>
<!-- ##### FUNCTION gst_clock_set_speed ##### -->
<para>
......@@ -402,18 +417,3 @@ Get the clock flags
@id: