Initial commit
[fillmore] / src / fillmore / fillmore / FillmoreClassFactory.c
1 /* FillmoreClassFactory.c generated by valac, the Vala compiler
2  * generated from FillmoreClassFactory.vala, do not modify */
3
4 /* Copyright 2009-2010 Yorba Foundation
5  *
6  * This software is licensed under the GNU Lesser General Public License
7  * (version 2.1 or later).  See the COPYING file in this distribution. 
8  */
9
10 #include <glib.h>
11 #include <glib-object.h>
12 #include <gtk/gtk.h>
13 #include <marina.h>
14 #include <float.h>
15 #include <math.h>
16
17
18 #define TYPE_TRACK_SEPARATOR (track_separator_get_type ())
19 #define TRACK_SEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRACK_SEPARATOR, TrackSeparator))
20 #define TRACK_SEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRACK_SEPARATOR, TrackSeparatorClass))
21 #define IS_TRACK_SEPARATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRACK_SEPARATOR))
22 #define IS_TRACK_SEPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRACK_SEPARATOR))
23 #define TRACK_SEPARATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRACK_SEPARATOR, TrackSeparatorClass))
24
25 typedef struct _TrackSeparator TrackSeparator;
26 typedef struct _TrackSeparatorClass TrackSeparatorClass;
27 typedef struct _TrackSeparatorPrivate TrackSeparatorPrivate;
28
29 #define TYPE_FILLMORE_TRACK_VIEW (fillmore_track_view_get_type ())
30 #define FILLMORE_TRACK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FILLMORE_TRACK_VIEW, FillmoreTrackView))
31 #define FILLMORE_TRACK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FILLMORE_TRACK_VIEW, FillmoreTrackViewClass))
32 #define IS_FILLMORE_TRACK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FILLMORE_TRACK_VIEW))
33 #define IS_FILLMORE_TRACK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FILLMORE_TRACK_VIEW))
34 #define FILLMORE_TRACK_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FILLMORE_TRACK_VIEW, FillmoreTrackViewClass))
35
36 typedef struct _FillmoreTrackView FillmoreTrackView;
37 typedef struct _FillmoreTrackViewClass FillmoreTrackViewClass;
38 typedef struct _FillmoreTrackViewPrivate FillmoreTrackViewPrivate;
39 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
40
41 #define TYPE_FILLMORE_CLASS_FACTORY (fillmore_class_factory_get_type ())
42 #define FILLMORE_CLASS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FILLMORE_CLASS_FACTORY, FillmoreClassFactory))
43 #define FILLMORE_CLASS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FILLMORE_CLASS_FACTORY, FillmoreClassFactoryClass))
44 #define IS_FILLMORE_CLASS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FILLMORE_CLASS_FACTORY))
45 #define IS_FILLMORE_CLASS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FILLMORE_CLASS_FACTORY))
46 #define FILLMORE_CLASS_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FILLMORE_CLASS_FACTORY, FillmoreClassFactoryClass))
47
48 typedef struct _FillmoreClassFactory FillmoreClassFactory;
49 typedef struct _FillmoreClassFactoryClass FillmoreClassFactoryClass;
50 typedef struct _FillmoreClassFactoryPrivate FillmoreClassFactoryPrivate;
51
52 struct _TrackSeparator {
53         GtkHSeparator parent_instance;
54         TrackSeparatorPrivate * priv;
55 };
56
57 struct _TrackSeparatorClass {
58         GtkHSeparatorClass parent_class;
59 };
60
61 struct _FillmoreTrackView {
62         GtkVBox parent_instance;
63         FillmoreTrackViewPrivate * priv;
64 };
65
66 struct _FillmoreTrackViewClass {
67         GtkVBoxClass parent_class;
68 };
69
70 struct _FillmoreTrackViewPrivate {
71         TrackView* track_view;
72 };
73
74 struct _FillmoreClassFactory {
75         ClassFactory parent_instance;
76         FillmoreClassFactoryPrivate * priv;
77 };
78
79 struct _FillmoreClassFactoryClass {
80         ClassFactoryClass parent_class;
81 };
82
83
84 static gpointer track_separator_parent_class = NULL;
85 static gpointer fillmore_track_view_parent_class = NULL;
86 static TrackViewIface* fillmore_track_view_track_view_parent_iface = NULL;
87 static gpointer fillmore_class_factory_parent_class = NULL;
88
89 GType track_separator_get_type (void);
90 enum  {
91         TRACK_SEPARATOR_DUMMY_PROPERTY
92 };
93 TrackSeparator* track_separator_new (void);
94 TrackSeparator* track_separator_construct (GType object_type);
95 GType fillmore_track_view_get_type (void);
96 #define FILLMORE_TRACK_VIEW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_FILLMORE_TRACK_VIEW, FillmoreTrackViewPrivate))
97 enum  {
98         FILLMORE_TRACK_VIEW_DUMMY_PROPERTY
99 };
100 static void fillmore_track_view_on_clip_view_added (FillmoreTrackView* self, ClipView* clip_view);
101 static void _fillmore_track_view_on_clip_view_added_track_view_clip_view_added (TrackView* _sender, ClipView* clip_view, gpointer self);
102 FillmoreTrackView* fillmore_track_view_new (TrackView* track_view);
103 FillmoreTrackView* fillmore_track_view_construct (GType object_type, TrackView* track_view);
104 static void fillmore_track_view_real_move_to_top (TrackView* base, ClipView* clip_view);
105 static void fillmore_track_view_real_resize (TrackView* base);
106 static ModelTrack* fillmore_track_view_real_get_track (TrackView* base);
107 static gint fillmore_track_view_real_get_track_height (TrackView* base);
108 static GtkWidget* fillmore_track_view_real_find_child (TrackView* base, double x, double y);
109 static void fillmore_track_view_real_select_all (TrackView* base);
110 static void fillmore_track_view_finalize (GObject* obj);
111 GType fillmore_class_factory_get_type (void);
112 enum  {
113         FILLMORE_CLASS_FACTORY_DUMMY_PROPERTY
114 };
115 static TrackView* fillmore_class_factory_real_get_track_view (ClassFactory* base, ModelTrack* track, TimeLine* timeline);
116 FillmoreClassFactory* fillmore_class_factory_new (void);
117 FillmoreClassFactory* fillmore_class_factory_construct (GType object_type);
118
119
120
121 #line 7 "FillmoreClassFactory.vala"
122 TrackSeparator* track_separator_construct (GType object_type) {
123 #line 124 "FillmoreClassFactory.c"
124         TrackSeparator * self;
125         self = g_object_newv (object_type, 0, NULL);
126         return self;
127 }
128
129
130 #line 7 "FillmoreClassFactory.vala"
131 TrackSeparator* track_separator_new (void) {
132 #line 7 "FillmoreClassFactory.vala"
133         return track_separator_construct (TYPE_TRACK_SEPARATOR);
134 #line 135 "FillmoreClassFactory.c"
135 }
136
137
138 static void track_separator_class_init (TrackSeparatorClass * klass) {
139         track_separator_parent_class = g_type_class_peek_parent (klass);
140 }
141
142
143 static void track_separator_instance_init (TrackSeparator * self) {
144 }
145
146
147 GType track_separator_get_type (void) {
148         static volatile gsize track_separator_type_id__volatile = 0;
149         if (g_once_init_enter (&track_separator_type_id__volatile)) {
150                 static const GTypeInfo g_define_type_info = { sizeof (TrackSeparatorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) track_separator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackSeparator), 0, (GInstanceInitFunc) track_separator_instance_init, NULL };
151                 GType track_separator_type_id;
152                 track_separator_type_id = g_type_register_static (GTK_TYPE_HSEPARATOR, "TrackSeparator", &g_define_type_info, 0);
153                 g_once_init_leave (&track_separator_type_id__volatile, track_separator_type_id);
154         }
155         return track_separator_type_id__volatile;
156 }
157
158
159 static gpointer _g_object_ref0 (gpointer self) {
160         return self ? g_object_ref (self) : NULL;
161 }
162
163
164 #line 38 "FillmoreClassFactory.vala"
165 static void _fillmore_track_view_on_clip_view_added_track_view_clip_view_added (TrackView* _sender, ClipView* clip_view, gpointer self) {
166 #line 167 "FillmoreClassFactory.c"
167         fillmore_track_view_on_clip_view_added (self, clip_view);
168 }
169
170
171 #line 13 "FillmoreClassFactory.vala"
172 FillmoreTrackView* fillmore_track_view_construct (GType object_type, TrackView* track_view) {
173 #line 174 "FillmoreClassFactory.c"
174         FillmoreTrackView * self;
175         TrackView* _tmp0_;
176         TrackSeparator* _tmp1_;
177 #line 13 "FillmoreClassFactory.vala"
178         g_return_val_if_fail (IS_TRACK_VIEW (track_view), NULL);
179 #line 180 "FillmoreClassFactory.c"
180         self = g_object_newv (object_type, 0, NULL);
181 #line 14 "FillmoreClassFactory.vala"
182         self->priv->track_view = (_tmp0_ = _g_object_ref0 (track_view), _g_object_unref0 (self->priv->track_view), _tmp0_);
183 #line 15 "FillmoreClassFactory.vala"
184         g_signal_connect_object (track_view, "clip-view-added", (GCallback) _fillmore_track_view_on_clip_view_added_track_view_clip_view_added, self, 0);
185 #line 17 "FillmoreClassFactory.vala"
186         gtk_box_pack_start (GTK_BOX (self), GTK_WIDGET (track_view), TRUE, TRUE, (guint) 0);
187 #line 18 "FillmoreClassFactory.vala"
188         gtk_box_pack_start (GTK_BOX (self), GTK_WIDGET (_tmp1_ = g_object_ref_sink (track_separator_new ())), FALSE, FALSE, (guint) 0);
189 #line 190 "FillmoreClassFactory.c"
190         _g_object_unref0 (_tmp1_);
191 #line 19 "FillmoreClassFactory.vala"
192         g_object_set (GTK_WIDGET (self), "can-focus", FALSE, NULL);
193 #line 194 "FillmoreClassFactory.c"
194         return self;
195 }
196
197
198 #line 13 "FillmoreClassFactory.vala"
199 FillmoreTrackView* fillmore_track_view_new (TrackView* track_view) {
200 #line 13 "FillmoreClassFactory.vala"
201         return fillmore_track_view_construct (TYPE_FILLMORE_TRACK_VIEW, track_view);
202 #line 203 "FillmoreClassFactory.c"
203 }
204
205
206 #line 22 "FillmoreClassFactory.vala"
207 static void fillmore_track_view_real_move_to_top (TrackView* base, ClipView* clip_view) {
208 #line 209 "FillmoreClassFactory.c"
209         FillmoreTrackView * self;
210         self = FILLMORE_TRACK_VIEW (base);
211 #line 22 "FillmoreClassFactory.vala"
212         g_return_if_fail (IS_CLIP_VIEW (clip_view));
213 #line 23 "FillmoreClassFactory.vala"
214         track_view_move_to_top (self->priv->track_view, clip_view);
215 #line 216 "FillmoreClassFactory.c"
216 }
217
218
219 #line 26 "FillmoreClassFactory.vala"
220 static void fillmore_track_view_real_resize (TrackView* base) {
221 #line 222 "FillmoreClassFactory.c"
222         FillmoreTrackView * self;
223         self = FILLMORE_TRACK_VIEW (base);
224 #line 27 "FillmoreClassFactory.vala"
225         track_view_resize (self->priv->track_view);
226 #line 227 "FillmoreClassFactory.c"
227 }
228
229
230 #line 30 "FillmoreClassFactory.vala"
231 static ModelTrack* fillmore_track_view_real_get_track (TrackView* base) {
232 #line 233 "FillmoreClassFactory.c"
233         FillmoreTrackView * self;
234         ModelTrack* result = NULL;
235         self = FILLMORE_TRACK_VIEW (base);
236         result = track_view_get_track (self->priv->track_view);
237 #line 31 "FillmoreClassFactory.vala"
238         return result;
239 #line 240 "FillmoreClassFactory.c"
240 }
241
242
243 #line 34 "FillmoreClassFactory.vala"
244 static gint fillmore_track_view_real_get_track_height (TrackView* base) {
245 #line 246 "FillmoreClassFactory.c"
246         FillmoreTrackView * self;
247         gint result = 0;
248         self = FILLMORE_TRACK_VIEW (base);
249         result = track_view_get_track_height (self->priv->track_view);
250 #line 35 "FillmoreClassFactory.vala"
251         return result;
252 #line 253 "FillmoreClassFactory.c"
253 }
254
255
256 #line 38 "FillmoreClassFactory.vala"
257 static void fillmore_track_view_on_clip_view_added (FillmoreTrackView* self, ClipView* clip_view) {
258 #line 38 "FillmoreClassFactory.vala"
259         g_return_if_fail (IS_FILLMORE_TRACK_VIEW (self));
260 #line 38 "FillmoreClassFactory.vala"
261         g_return_if_fail (IS_CLIP_VIEW (clip_view));
262 #line 39 "FillmoreClassFactory.vala"
263         g_signal_emit_by_name (TRACK_VIEW (self), "clip-view-added", clip_view);
264 #line 265 "FillmoreClassFactory.c"
265 }
266
267
268 #line 42 "FillmoreClassFactory.vala"
269 static GtkWidget* fillmore_track_view_real_find_child (TrackView* base, double x, double y) {
270 #line 271 "FillmoreClassFactory.c"
271         FillmoreTrackView * self;
272         GtkWidget* result = NULL;
273         self = FILLMORE_TRACK_VIEW (base);
274         result = track_view_find_child (self->priv->track_view, x, y);
275 #line 43 "FillmoreClassFactory.vala"
276         return result;
277 #line 278 "FillmoreClassFactory.c"
278 }
279
280
281 #line 46 "FillmoreClassFactory.vala"
282 static void fillmore_track_view_real_select_all (TrackView* base) {
283 #line 284 "FillmoreClassFactory.c"
284         FillmoreTrackView * self;
285         self = FILLMORE_TRACK_VIEW (base);
286 #line 47 "FillmoreClassFactory.vala"
287         track_view_select_all (self->priv->track_view);
288 #line 289 "FillmoreClassFactory.c"
289 }
290
291
292 static void fillmore_track_view_class_init (FillmoreTrackViewClass * klass) {
293         fillmore_track_view_parent_class = g_type_class_peek_parent (klass);
294         g_type_class_add_private (klass, sizeof (FillmoreTrackViewPrivate));
295         G_OBJECT_CLASS (klass)->finalize = fillmore_track_view_finalize;
296 }
297
298
299 static void fillmore_track_view_track_view_interface_init (TrackViewIface * iface) {
300         fillmore_track_view_track_view_parent_iface = g_type_interface_peek_parent (iface);
301         iface->move_to_top = fillmore_track_view_real_move_to_top;
302         iface->resize = fillmore_track_view_real_resize;
303         iface->get_track = fillmore_track_view_real_get_track;
304         iface->get_track_height = fillmore_track_view_real_get_track_height;
305         iface->find_child = fillmore_track_view_real_find_child;
306         iface->select_all = fillmore_track_view_real_select_all;
307 }
308
309
310 static void fillmore_track_view_instance_init (FillmoreTrackView * self) {
311         self->priv = FILLMORE_TRACK_VIEW_GET_PRIVATE (self);
312 }
313
314
315 static void fillmore_track_view_finalize (GObject* obj) {
316         FillmoreTrackView * self;
317         self = FILLMORE_TRACK_VIEW (obj);
318         _g_object_unref0 (self->priv->track_view);
319         G_OBJECT_CLASS (fillmore_track_view_parent_class)->finalize (obj);
320 }
321
322
323 GType fillmore_track_view_get_type (void) {
324         static volatile gsize fillmore_track_view_type_id__volatile = 0;
325         if (g_once_init_enter (&fillmore_track_view_type_id__volatile)) {
326                 static const GTypeInfo g_define_type_info = { sizeof (FillmoreTrackViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) fillmore_track_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FillmoreTrackView), 0, (GInstanceInitFunc) fillmore_track_view_instance_init, NULL };
327                 static const GInterfaceInfo track_view_info = { (GInterfaceInitFunc) fillmore_track_view_track_view_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
328                 GType fillmore_track_view_type_id;
329                 fillmore_track_view_type_id = g_type_register_static (GTK_TYPE_VBOX, "FillmoreTrackView", &g_define_type_info, 0);
330                 g_type_add_interface_static (fillmore_track_view_type_id, TYPE_TRACK_VIEW, &track_view_info);
331                 g_once_init_leave (&fillmore_track_view_type_id__volatile, fillmore_track_view_type_id);
332         }
333         return fillmore_track_view_type_id__volatile;
334 }
335
336
337 #line 52 "FillmoreClassFactory.vala"
338 static TrackView* fillmore_class_factory_real_get_track_view (ClassFactory* base, ModelTrack* track, TimeLine* timeline) {
339 #line 340 "FillmoreClassFactory.c"
340         FillmoreClassFactory * self;
341         TrackView* result = NULL;
342         TrackView* track_view;
343         self = FILLMORE_CLASS_FACTORY (base);
344 #line 52 "FillmoreClassFactory.vala"
345         g_return_val_if_fail (MODEL_IS_TRACK (track), NULL);
346 #line 52 "FillmoreClassFactory.vala"
347         g_return_val_if_fail (IS_TIME_LINE (timeline), NULL);
348 #line 53 "FillmoreClassFactory.vala"
349         track_view = CLASS_FACTORY_CLASS (fillmore_class_factory_parent_class)->get_track_view (CLASS_FACTORY (self), track, timeline);
350 #line 351 "FillmoreClassFactory.c"
351         result = TRACK_VIEW (g_object_ref_sink (fillmore_track_view_new (track_view)));
352         _g_object_unref0 (track_view);
353 #line 54 "FillmoreClassFactory.vala"
354         return result;
355 #line 356 "FillmoreClassFactory.c"
356 }
357
358
359 #line 51 "FillmoreClassFactory.vala"
360 FillmoreClassFactory* fillmore_class_factory_construct (GType object_type) {
361 #line 362 "FillmoreClassFactory.c"
362         FillmoreClassFactory* self;
363 #line 51 "FillmoreClassFactory.vala"
364         self = (FillmoreClassFactory*) class_factory_construct (object_type);
365 #line 366 "FillmoreClassFactory.c"
366         return self;
367 }
368
369
370 #line 51 "FillmoreClassFactory.vala"
371 FillmoreClassFactory* fillmore_class_factory_new (void) {
372 #line 51 "FillmoreClassFactory.vala"
373         return fillmore_class_factory_construct (TYPE_FILLMORE_CLASS_FACTORY);
374 #line 375 "FillmoreClassFactory.c"
375 }
376
377
378 static void fillmore_class_factory_class_init (FillmoreClassFactoryClass * klass) {
379         fillmore_class_factory_parent_class = g_type_class_peek_parent (klass);
380         CLASS_FACTORY_CLASS (klass)->get_track_view = fillmore_class_factory_real_get_track_view;
381 }
382
383
384 static void fillmore_class_factory_instance_init (FillmoreClassFactory * self) {
385 }
386
387
388 GType fillmore_class_factory_get_type (void) {
389         static volatile gsize fillmore_class_factory_type_id__volatile = 0;
390         if (g_once_init_enter (&fillmore_class_factory_type_id__volatile)) {
391                 static const GTypeInfo g_define_type_info = { sizeof (FillmoreClassFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) fillmore_class_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FillmoreClassFactory), 0, (GInstanceInitFunc) fillmore_class_factory_instance_init, NULL };
392                 GType fillmore_class_factory_type_id;
393                 fillmore_class_factory_type_id = g_type_register_static (TYPE_CLASS_FACTORY, "FillmoreClassFactory", &g_define_type_info, 0);
394                 g_once_init_leave (&fillmore_class_factory_type_id__volatile, fillmore_class_factory_type_id);
395         }
396         return fillmore_class_factory_type_id__volatile;
397 }
398
399
400
401