1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
/* 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"
#include "gsteditorcreate.h"
/* signals and args */
enum {
LAST_SIGNAL
};
enum {
ARG_0,
};
static void gst_editor_canvas_class_init (GstEditorCanvasClass *klass);
static void gst_editor_canvas_init (GstEditorCanvas *editorcanvas);
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);
static void gst_editor_canvas_realize (GtkWidget *widget);
//gint gst_editor_canvas_verbose_event(GtkWidget *widget,GdkEvent *event);
static GstEditorBinClass *parent_class = NULL;
GtkType
gst_editor_canvas_get_type (void)
{
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,
};
editor_canvas_type = gtk_type_unique (gnome_canvas_get_type (), &editor_canvas_info);
}
return editor_canvas_type;
}
static void
gst_editor_canvas_class_init (GstEditorCanvasClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
object_class = (GtkObjectClass*)klass;
widget_class = (GtkWidgetClass *)klass;
parent_class = gtk_type_class (gnome_canvas_get_type ());
object_class->set_arg = gst_editor_canvas_set_arg;
object_class->get_arg = gst_editor_canvas_get_arg;
widget_class->realize = gst_editor_canvas_realize;
}
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;
}
GstEditorCanvas*
gst_editor_canvas_new_with_bin (GstEditorBin *bin)
{
GstEditorCanvas *editorcanvas;
g_return_val_if_fail(bin != NULL, NULL);
editorcanvas = gst_editor_canvas_new ();
editorcanvas->bin = bin;
GST_EDITOR_ELEMENT(bin)->parent = bin;
GST_EDITOR_ELEMENT(bin)->canvas = editorcanvas;
return editorcanvas;
}
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));
}
}
}
static void
gst_editor_canvas_set_arg (GtkObject *object,GtkArg *arg,guint id)
{
GstEditorCanvas *canvas;
canvas = GST_EDITOR_CANVAS(object);
switch (id) {
default:
g_warning("gsteditorcanvas: unknown arg!");
break;
}
}
static void
gst_editor_canvas_get_arg (GtkObject *object,GtkArg *arg,guint id)
{
GstEditorCanvas *canvas;
canvas = GST_EDITOR_CANVAS(object);
switch (id) {
default:
arg->type = GTK_TYPE_INVALID;
break;
}
}
|