2000-01-30 10:44:33 +00:00
|
|
|
/* Gnome-Streamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <gnome.h>
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
|
|
|
#include "gsteditor.h"
|
2000-10-08 22:17:11 +00:00
|
|
|
#include "gsteditorcreate.h"
|
2000-01-30 10:44:33 +00:00
|
|
|
|
|
|
|
/* signals and args */
|
|
|
|
enum {
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum {
|
|
|
|
ARG_0,
|
|
|
|
};
|
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
static void gst_editor_canvas_class_init (GstEditorCanvasClass *klass);
|
|
|
|
static void gst_editor_canvas_init (GstEditorCanvas *editorcanvas);
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
static void gst_editor_canvas_set_arg (GtkObject *object,GtkArg *arg,guint id);
|
|
|
|
static void gst_editor_canvas_get_arg (GtkObject *object,GtkArg *arg,guint id);
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
static void gst_editor_canvas_realize (GtkWidget *widget);
|
2000-10-08 22:17:11 +00:00
|
|
|
|
2000-01-30 10:44:33 +00:00
|
|
|
|
|
|
|
//gint gst_editor_canvas_verbose_event(GtkWidget *widget,GdkEvent *event);
|
|
|
|
|
|
|
|
|
|
|
|
static GstEditorBinClass *parent_class = NULL;
|
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
GtkType
|
|
|
|
gst_editor_canvas_get_type (void)
|
|
|
|
{
|
2000-01-30 10:44:33 +00:00
|
|
|
static GtkType editor_canvas_type = 0;
|
|
|
|
|
|
|
|
if (!editor_canvas_type) {
|
|
|
|
static const GtkTypeInfo editor_canvas_info = {
|
|
|
|
"GstEditorCanvas",
|
|
|
|
sizeof(GstEditorCanvas),
|
|
|
|
sizeof(GstEditorCanvasClass),
|
|
|
|
(GtkClassInitFunc)gst_editor_canvas_class_init,
|
|
|
|
(GtkObjectInitFunc)gst_editor_canvas_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
(GtkClassInitFunc)NULL,
|
|
|
|
};
|
2000-12-25 01:33:06 +00:00
|
|
|
editor_canvas_type = gtk_type_unique (gnome_canvas_get_type (), &editor_canvas_info);
|
2000-01-30 10:44:33 +00:00
|
|
|
}
|
|
|
|
return editor_canvas_type;
|
|
|
|
}
|
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
static void
|
|
|
|
gst_editor_canvas_class_init (GstEditorCanvasClass *klass)
|
|
|
|
{
|
2000-10-08 22:17:11 +00:00
|
|
|
GtkObjectClass *object_class;
|
2000-12-25 01:33:06 +00:00
|
|
|
GtkWidgetClass *widget_class;
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2000-10-08 22:17:11 +00:00
|
|
|
object_class = (GtkObjectClass*)klass;
|
2000-12-25 01:33:06 +00:00
|
|
|
widget_class = (GtkWidgetClass *)klass;
|
2000-10-08 22:17:11 +00:00
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
parent_class = gtk_type_class (gnome_canvas_get_type ());
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2000-10-08 22:17:11 +00:00
|
|
|
object_class->set_arg = gst_editor_canvas_set_arg;
|
|
|
|
object_class->get_arg = gst_editor_canvas_get_arg;
|
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
widget_class->realize = gst_editor_canvas_realize;
|
2000-01-30 10:44:33 +00:00
|
|
|
}
|
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
static void
|
|
|
|
gst_editor_canvas_init (GstEditorCanvas *editorcanvas)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
GstEditorCanvas*
|
|
|
|
gst_editor_canvas_new (void)
|
|
|
|
{
|
|
|
|
GstEditorCanvas *editorcanvas;
|
|
|
|
|
|
|
|
editorcanvas = GST_EDITOR_CANVAS(gtk_type_new(GST_TYPE_EDITOR_CANVAS));
|
|
|
|
|
|
|
|
return editorcanvas;
|
2000-01-30 10:44:33 +00:00
|
|
|
}
|
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
GstEditorCanvas*
|
|
|
|
gst_editor_canvas_new_with_bin (GstEditorBin *bin)
|
|
|
|
{
|
2000-01-30 10:44:33 +00:00
|
|
|
GstEditorCanvas *editorcanvas;
|
|
|
|
|
2000-10-08 22:17:11 +00:00
|
|
|
g_return_val_if_fail(bin != NULL, NULL);
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
editorcanvas = gst_editor_canvas_new ();
|
|
|
|
editorcanvas->bin = bin;
|
2000-01-30 10:44:33 +00:00
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
GST_EDITOR_ELEMENT(bin)->parent = bin;
|
|
|
|
GST_EDITOR_ELEMENT(bin)->canvas = editorcanvas;
|
2000-01-30 10:44:33 +00:00
|
|
|
|
|
|
|
return editorcanvas;
|
|
|
|
}
|
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
static void
|
|
|
|
gst_editor_canvas_realize (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GstEditorCanvas *canvas = GST_EDITOR_CANVAS (widget);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS(parent_class)->realize) {
|
|
|
|
GTK_WIDGET_CLASS(parent_class)->realize(GTK_WIDGET(canvas));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (canvas->bin) {
|
|
|
|
GstEditorElementClass *element_class;
|
|
|
|
|
|
|
|
GST_EDITOR_ELEMENT(canvas->bin)->group = gnome_canvas_root(GNOME_CANVAS(canvas));
|
|
|
|
|
|
|
|
element_class = GST_EDITOR_ELEMENT_CLASS(GTK_OBJECT(canvas->bin)->klass);
|
|
|
|
|
|
|
|
if (element_class->realize) {
|
|
|
|
element_class->realize(GST_EDITOR_ELEMENT(canvas->bin));
|
|
|
|
}
|
2000-10-01 21:46:33 +00:00
|
|
|
}
|
2000-01-30 10:44:33 +00:00
|
|
|
}
|
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
static void
|
|
|
|
gst_editor_canvas_set_arg (GtkObject *object,GtkArg *arg,guint id)
|
|
|
|
{
|
2000-01-30 10:44:33 +00:00
|
|
|
GstEditorCanvas *canvas;
|
|
|
|
|
|
|
|
canvas = GST_EDITOR_CANVAS(object);
|
|
|
|
|
|
|
|
switch (id) {
|
|
|
|
default:
|
|
|
|
g_warning("gsteditorcanvas: unknown arg!");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-12-25 01:33:06 +00:00
|
|
|
static void
|
|
|
|
gst_editor_canvas_get_arg (GtkObject *object,GtkArg *arg,guint id)
|
|
|
|
{
|
2000-01-30 10:44:33 +00:00
|
|
|
GstEditorCanvas *canvas;
|
|
|
|
|
|
|
|
canvas = GST_EDITOR_CANVAS(object);
|
|
|
|
|
|
|
|
switch (id) {
|
|
|
|
default:
|
|
|
|
arg->type = GTK_TYPE_INVALID;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|