File: Hierarchy.chs

package info (click to toggle)
haskell-gstreamer 0.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 720 kB
  • sloc: haskell: 635; ansic: 116; makefile: 11; sh: 7
file content (968 lines) | stat: -rw-r--r-- 31,144 bytes parent folder | download | duplicates (2)
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
{-# OPTIONS_HADDOCK hide #-}
-- -*-haskell-*-
-- -------------------- automatically generated file - do not edit ----------
--  Object hierarchy for the GIMP Toolkit (GTK) Binding for Haskell
--
--  Author : Axel Simon
--
--  Copyright (C) 2001-2005 Axel Simon
--
--  This library is free software; you can redistribute it and/or
--  modify it under the terms of the GNU Lesser General Public
--  License as published by the Free Software Foundation; either
--  version 2.1 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
--  Lesser General Public License for more details.
--
-- #hide

-- |
-- Maintainer  : gtk2hs-users@lists.sourceforge.net
-- Stability   : provisional
-- Portability : portable (depends on GHC)
--
-- This file reflects the Gtk+ object hierarchy in terms of Haskell classes.
--
-- Note: the mk... functions were originally meant to simply be an alias
-- for the constructor. However, in order to communicate the destructor
-- of an object to objectNew, the mk... functions are now a tuple containing
-- Haskell constructor and the destructor function pointer. This hack avoids
-- changing all modules that simply pass mk... to objectNew.
--
module Media.Streaming.GStreamer.Core.Hierarchy (

  module System.Glib.GObject,
  Object(Object), ObjectClass,
  toObject, 
  mkObject, unObject,
  castToObject, gTypeObject,
  Pad(Pad), PadClass,
  toPad, 
  mkPad, unPad,
  castToPad, gTypePad,
  GhostPad(GhostPad), GhostPadClass,
  toGhostPad, 
  mkGhostPad, unGhostPad,
  castToGhostPad, gTypeGhostPad,
  PluginFeature(PluginFeature), PluginFeatureClass,
  toPluginFeature, 
  mkPluginFeature, unPluginFeature,
  castToPluginFeature, gTypePluginFeature,
  ElementFactory(ElementFactory), ElementFactoryClass,
  toElementFactory, 
  mkElementFactory, unElementFactory,
  castToElementFactory, gTypeElementFactory,
  TypeFindFactory(TypeFindFactory), TypeFindFactoryClass,
  toTypeFindFactory, 
  mkTypeFindFactory, unTypeFindFactory,
  castToTypeFindFactory, gTypeTypeFindFactory,
  IndexFactory(IndexFactory), IndexFactoryClass,
  toIndexFactory, 
  mkIndexFactory, unIndexFactory,
  castToIndexFactory, gTypeIndexFactory,
  Element(Element), ElementClass,
  toElement, 
  mkElement, unElement,
  castToElement, gTypeElement,
  Bin(Bin), BinClass,
  toBin, 
  mkBin, unBin,
  castToBin, gTypeBin,
  Pipeline(Pipeline), PipelineClass,
  toPipeline, 
  mkPipeline, unPipeline,
  castToPipeline, gTypePipeline,
  ImplementsInterface(ImplementsInterface), ImplementsInterfaceClass,
  toImplementsInterface, 
  mkImplementsInterface, unImplementsInterface,
  castToImplementsInterface, gTypeImplementsInterface,
  TagSetter(TagSetter), TagSetterClass,
  toTagSetter, 
  mkTagSetter, unTagSetter,
  castToTagSetter, gTypeTagSetter,
  BaseSrc(BaseSrc), BaseSrcClass,
  toBaseSrc, 
  mkBaseSrc, unBaseSrc,
  castToBaseSrc, gTypeBaseSrc,
  PushSrc(PushSrc), PushSrcClass,
  toPushSrc, 
  mkPushSrc, unPushSrc,
  castToPushSrc, gTypePushSrc,
  BaseSink(BaseSink), BaseSinkClass,
  toBaseSink, 
  mkBaseSink, unBaseSink,
  castToBaseSink, gTypeBaseSink,
  BaseTransform(BaseTransform), BaseTransformClass,
  toBaseTransform, 
  mkBaseTransform, unBaseTransform,
  castToBaseTransform, gTypeBaseTransform,
  Plugin(Plugin), PluginClass,
  toPlugin, 
  mkPlugin, unPlugin,
  castToPlugin, gTypePlugin,
  Registry(Registry), RegistryClass,
  toRegistry, 
  mkRegistry, unRegistry,
  castToRegistry, gTypeRegistry,
  Bus(Bus), BusClass,
  toBus, 
  mkBus, unBus,
  castToBus, gTypeBus,
  Clock(Clock), ClockClass,
  toClock, 
  mkClock, unClock,
  castToClock, gTypeClock,
  AudioClock(AudioClock), AudioClockClass,
  toAudioClock, 
  mkAudioClock, unAudioClock,
  castToAudioClock, gTypeAudioClock,
  SystemClock(SystemClock), SystemClockClass,
  toSystemClock, 
  mkSystemClock, unSystemClock,
  castToSystemClock, gTypeSystemClock,
  NetClientClock(NetClientClock), NetClientClockClass,
  toNetClientClock, 
  mkNetClientClock, unNetClientClock,
  castToNetClientClock, gTypeNetClientClock,
  Index(Index), IndexClass,
  toIndex, 
  mkIndex, unIndex,
  castToIndex, gTypeIndex,
  PadTemplate(PadTemplate), PadTemplateClass,
  toPadTemplate, 
  mkPadTemplate, unPadTemplate,
  castToPadTemplate, gTypePadTemplate,
  Task(Task), TaskClass,
  toTask, 
  mkTask, unTask,
  castToTask, gTypeTask,
  XML(XML), XMLClass,
  toXML, 
  mkXML, unXML,
  castToXML, gTypeXML,
  ChildProxy(ChildProxy), ChildProxyClass,
  toChildProxy, 
  mkChildProxy, unChildProxy,
  castToChildProxy, gTypeChildProxy,
  CollectPads(CollectPads), CollectPadsClass,
  toCollectPads, 
  mkCollectPads, unCollectPads,
  castToCollectPads, gTypeCollectPads,
  URIHandler(URIHandler), URIHandlerClass,
  toURIHandler, 
  mkURIHandler, unURIHandler,
  castToURIHandler, gTypeURIHandler,
  Adapter(Adapter), AdapterClass,
  toAdapter, 
  mkAdapter, unAdapter,
  castToAdapter, gTypeAdapter,
  Controller(Controller), ControllerClass,
  toController, 
  mkController, unController,
  castToController, gTypeController
  ) where

import Foreign.ForeignPtr (ForeignPtr, castForeignPtr, unsafeForeignPtrToPtr)
import Foreign.C.Types    (CULong, CUInt)
import System.Glib.GType	(GType, typeInstanceIsA)
{#import System.Glib.GObject#}

{# context lib="gstreamer" prefix="gtk" #}

-- The usage of foreignPtrToPtr should be safe as the evaluation will only be
-- forced if the object is used afterwards
--
castTo :: (GObjectClass obj, GObjectClass obj') => GType -> String
                                                -> (obj -> obj')
castTo gtype objTypeName obj =
  case toGObject obj of
    gobj@(GObject objFPtr)
      | typeInstanceIsA ((unsafeForeignPtrToPtr.castForeignPtr) objFPtr) gtype
                  -> unsafeCastGObject gobj
      | otherwise -> error $ "Cannot cast object to " ++ objTypeName


-- ********************************************************************* Object

{#pointer *GstObject as Object foreign newtype #} deriving (Eq,Ord)

mkObject = (Object, objectUnref)
unObject (Object o) = o

class GObjectClass o => ObjectClass o
toObject :: ObjectClass o => o -> Object
toObject = unsafeCastGObject . toGObject

instance ObjectClass Object
instance GObjectClass Object where
  toGObject = GObject . castForeignPtr . unObject
  unsafeCastGObject = Object . castForeignPtr . unGObject

castToObject :: GObjectClass obj => obj -> Object
castToObject = castTo gTypeObject "Object"

gTypeObject :: GType
gTypeObject =
  {# call fun unsafe gst_object_get_type #}

-- ************************************************************************ Pad

{#pointer *GstPad as Pad foreign newtype #} deriving (Eq,Ord)

mkPad = (Pad, objectUnref)
unPad (Pad o) = o

class ObjectClass o => PadClass o
toPad :: PadClass o => o -> Pad
toPad = unsafeCastGObject . toGObject

instance PadClass Pad
instance ObjectClass Pad
instance GObjectClass Pad where
  toGObject = GObject . castForeignPtr . unPad
  unsafeCastGObject = Pad . castForeignPtr . unGObject

castToPad :: GObjectClass obj => obj -> Pad
castToPad = castTo gTypePad "Pad"

gTypePad :: GType
gTypePad =
  {# call fun unsafe gst_pad_get_type #}

-- ******************************************************************* GhostPad

{#pointer *GstGhostPad as GhostPad foreign newtype #} deriving (Eq,Ord)

mkGhostPad = (GhostPad, objectUnref)
unGhostPad (GhostPad o) = o

class PadClass o => GhostPadClass o
toGhostPad :: GhostPadClass o => o -> GhostPad
toGhostPad = unsafeCastGObject . toGObject

instance GhostPadClass GhostPad
instance PadClass GhostPad
instance ObjectClass GhostPad
instance GObjectClass GhostPad where
  toGObject = GObject . castForeignPtr . unGhostPad
  unsafeCastGObject = GhostPad . castForeignPtr . unGObject

castToGhostPad :: GObjectClass obj => obj -> GhostPad
castToGhostPad = castTo gTypeGhostPad "GhostPad"

gTypeGhostPad :: GType
gTypeGhostPad =
  {# call fun unsafe gst_ghost_pad_get_type #}

-- ************************************************************** PluginFeature

{#pointer *GstPluginFeature as PluginFeature foreign newtype #} deriving (Eq,Ord)

mkPluginFeature = (PluginFeature, objectUnref)
unPluginFeature (PluginFeature o) = o

class ObjectClass o => PluginFeatureClass o
toPluginFeature :: PluginFeatureClass o => o -> PluginFeature
toPluginFeature = unsafeCastGObject . toGObject

instance PluginFeatureClass PluginFeature
instance ObjectClass PluginFeature
instance GObjectClass PluginFeature where
  toGObject = GObject . castForeignPtr . unPluginFeature
  unsafeCastGObject = PluginFeature . castForeignPtr . unGObject

castToPluginFeature :: GObjectClass obj => obj -> PluginFeature
castToPluginFeature = castTo gTypePluginFeature "PluginFeature"

gTypePluginFeature :: GType
gTypePluginFeature =
  {# call fun unsafe gst_plugin_feature_get_type #}

-- ************************************************************* ElementFactory

{#pointer *GstElementFactory as ElementFactory foreign newtype #} deriving (Eq,Ord)

mkElementFactory = (ElementFactory, objectUnref)
unElementFactory (ElementFactory o) = o

class PluginFeatureClass o => ElementFactoryClass o
toElementFactory :: ElementFactoryClass o => o -> ElementFactory
toElementFactory = unsafeCastGObject . toGObject

instance ElementFactoryClass ElementFactory
instance PluginFeatureClass ElementFactory
instance ObjectClass ElementFactory
instance GObjectClass ElementFactory where
  toGObject = GObject . castForeignPtr . unElementFactory
  unsafeCastGObject = ElementFactory . castForeignPtr . unGObject

castToElementFactory :: GObjectClass obj => obj -> ElementFactory
castToElementFactory = castTo gTypeElementFactory "ElementFactory"

gTypeElementFactory :: GType
gTypeElementFactory =
  {# call fun unsafe gst_element_factory_get_type #}

-- ************************************************************ TypeFindFactory

{#pointer *GstTypeFindFactory as TypeFindFactory foreign newtype #} deriving (Eq,Ord)

mkTypeFindFactory = (TypeFindFactory, objectUnref)
unTypeFindFactory (TypeFindFactory o) = o

class PluginFeatureClass o => TypeFindFactoryClass o
toTypeFindFactory :: TypeFindFactoryClass o => o -> TypeFindFactory
toTypeFindFactory = unsafeCastGObject . toGObject

instance TypeFindFactoryClass TypeFindFactory
instance PluginFeatureClass TypeFindFactory
instance ObjectClass TypeFindFactory
instance GObjectClass TypeFindFactory where
  toGObject = GObject . castForeignPtr . unTypeFindFactory
  unsafeCastGObject = TypeFindFactory . castForeignPtr . unGObject

castToTypeFindFactory :: GObjectClass obj => obj -> TypeFindFactory
castToTypeFindFactory = castTo gTypeTypeFindFactory "TypeFindFactory"

gTypeTypeFindFactory :: GType
gTypeTypeFindFactory =
  {# call fun unsafe gst_type_find_factory_get_type #}

-- *************************************************************** IndexFactory

{#pointer *GstIndexFactory as IndexFactory foreign newtype #} deriving (Eq,Ord)

mkIndexFactory = (IndexFactory, objectUnref)
unIndexFactory (IndexFactory o) = o

class PluginFeatureClass o => IndexFactoryClass o
toIndexFactory :: IndexFactoryClass o => o -> IndexFactory
toIndexFactory = unsafeCastGObject . toGObject

instance IndexFactoryClass IndexFactory
instance PluginFeatureClass IndexFactory
instance ObjectClass IndexFactory
instance GObjectClass IndexFactory where
  toGObject = GObject . castForeignPtr . unIndexFactory
  unsafeCastGObject = IndexFactory . castForeignPtr . unGObject

castToIndexFactory :: GObjectClass obj => obj -> IndexFactory
castToIndexFactory = castTo gTypeIndexFactory "IndexFactory"

gTypeIndexFactory :: GType
gTypeIndexFactory =
  {# call fun unsafe gst_index_factory_get_type #}

-- ******************************************************************** Element

{#pointer *GstElement as Element foreign newtype #} deriving (Eq,Ord)

mkElement = (Element, objectUnref)
unElement (Element o) = o

class ObjectClass o => ElementClass o
toElement :: ElementClass o => o -> Element
toElement = unsafeCastGObject . toGObject

instance ElementClass Element
instance ObjectClass Element
instance GObjectClass Element where
  toGObject = GObject . castForeignPtr . unElement
  unsafeCastGObject = Element . castForeignPtr . unGObject

castToElement :: GObjectClass obj => obj -> Element
castToElement = castTo gTypeElement "Element"

gTypeElement :: GType
gTypeElement =
  {# call fun unsafe gst_element_get_type #}

-- ************************************************************************ Bin

{#pointer *GstBin as Bin foreign newtype #} deriving (Eq,Ord)

mkBin = (Bin, objectUnref)
unBin (Bin o) = o

class ElementClass o => BinClass o
toBin :: BinClass o => o -> Bin
toBin = unsafeCastGObject . toGObject

instance BinClass Bin
instance ElementClass Bin
instance ObjectClass Bin
instance GObjectClass Bin where
  toGObject = GObject . castForeignPtr . unBin
  unsafeCastGObject = Bin . castForeignPtr . unGObject

castToBin :: GObjectClass obj => obj -> Bin
castToBin = castTo gTypeBin "Bin"

gTypeBin :: GType
gTypeBin =
  {# call fun unsafe gst_bin_get_type #}

-- ******************************************************************* Pipeline

{#pointer *GstPipeline as Pipeline foreign newtype #} deriving (Eq,Ord)

mkPipeline = (Pipeline, objectUnref)
unPipeline (Pipeline o) = o

class BinClass o => PipelineClass o
toPipeline :: PipelineClass o => o -> Pipeline
toPipeline = unsafeCastGObject . toGObject

instance PipelineClass Pipeline
instance BinClass Pipeline
instance ElementClass Pipeline
instance ObjectClass Pipeline
instance GObjectClass Pipeline where
  toGObject = GObject . castForeignPtr . unPipeline
  unsafeCastGObject = Pipeline . castForeignPtr . unGObject

castToPipeline :: GObjectClass obj => obj -> Pipeline
castToPipeline = castTo gTypePipeline "Pipeline"

gTypePipeline :: GType
gTypePipeline =
  {# call fun unsafe gst_pipeline_get_type #}

-- ******************************************************** ImplementsInterface

{#pointer *GstImplementsInterface as ImplementsInterface foreign newtype #} deriving (Eq,Ord)

mkImplementsInterface = (ImplementsInterface, objectUnref)
unImplementsInterface (ImplementsInterface o) = o

class ElementClass o => ImplementsInterfaceClass o
toImplementsInterface :: ImplementsInterfaceClass o => o -> ImplementsInterface
toImplementsInterface = unsafeCastGObject . toGObject

instance ImplementsInterfaceClass ImplementsInterface
instance ElementClass ImplementsInterface
instance ObjectClass ImplementsInterface
instance GObjectClass ImplementsInterface where
  toGObject = GObject . castForeignPtr . unImplementsInterface
  unsafeCastGObject = ImplementsInterface . castForeignPtr . unGObject

castToImplementsInterface :: GObjectClass obj => obj -> ImplementsInterface
castToImplementsInterface = castTo gTypeImplementsInterface "ImplementsInterface"

gTypeImplementsInterface :: GType
gTypeImplementsInterface =
  {# call fun unsafe gst_implements_interface_get_type #}

-- ****************************************************************** TagSetter

{#pointer *GstTagSetter as TagSetter foreign newtype #} deriving (Eq,Ord)

mkTagSetter = (TagSetter, objectUnref)
unTagSetter (TagSetter o) = o

class ElementClass o => TagSetterClass o
toTagSetter :: TagSetterClass o => o -> TagSetter
toTagSetter = unsafeCastGObject . toGObject

instance TagSetterClass TagSetter
instance ElementClass TagSetter
instance ObjectClass TagSetter
instance GObjectClass TagSetter where
  toGObject = GObject . castForeignPtr . unTagSetter
  unsafeCastGObject = TagSetter . castForeignPtr . unGObject

castToTagSetter :: GObjectClass obj => obj -> TagSetter
castToTagSetter = castTo gTypeTagSetter "TagSetter"

gTypeTagSetter :: GType
gTypeTagSetter =
  {# call fun unsafe gst_tag_setter_get_type #}

-- ******************************************************************** BaseSrc

{#pointer *GstBaseSrc as BaseSrc foreign newtype #} deriving (Eq,Ord)

mkBaseSrc = (BaseSrc, objectUnref)
unBaseSrc (BaseSrc o) = o

class ElementClass o => BaseSrcClass o
toBaseSrc :: BaseSrcClass o => o -> BaseSrc
toBaseSrc = unsafeCastGObject . toGObject

instance BaseSrcClass BaseSrc
instance ElementClass BaseSrc
instance ObjectClass BaseSrc
instance GObjectClass BaseSrc where
  toGObject = GObject . castForeignPtr . unBaseSrc
  unsafeCastGObject = BaseSrc . castForeignPtr . unGObject

castToBaseSrc :: GObjectClass obj => obj -> BaseSrc
castToBaseSrc = castTo gTypeBaseSrc "BaseSrc"

gTypeBaseSrc :: GType
gTypeBaseSrc =
  {# call fun unsafe gst_base_src_get_type #}

-- ******************************************************************** PushSrc

{#pointer *GstPushSrc as PushSrc foreign newtype #} deriving (Eq,Ord)

mkPushSrc = (PushSrc, objectUnref)
unPushSrc (PushSrc o) = o

class BaseSrcClass o => PushSrcClass o
toPushSrc :: PushSrcClass o => o -> PushSrc
toPushSrc = unsafeCastGObject . toGObject

instance PushSrcClass PushSrc
instance BaseSrcClass PushSrc
instance ElementClass PushSrc
instance ObjectClass PushSrc
instance GObjectClass PushSrc where
  toGObject = GObject . castForeignPtr . unPushSrc
  unsafeCastGObject = PushSrc . castForeignPtr . unGObject

castToPushSrc :: GObjectClass obj => obj -> PushSrc
castToPushSrc = castTo gTypePushSrc "PushSrc"

gTypePushSrc :: GType
gTypePushSrc =
  {# call fun unsafe gst_push_src_get_type #}

-- ******************************************************************* BaseSink

{#pointer *GstBaseSink as BaseSink foreign newtype #} deriving (Eq,Ord)

mkBaseSink = (BaseSink, objectUnref)
unBaseSink (BaseSink o) = o

class ElementClass o => BaseSinkClass o
toBaseSink :: BaseSinkClass o => o -> BaseSink
toBaseSink = unsafeCastGObject . toGObject

instance BaseSinkClass BaseSink
instance ElementClass BaseSink
instance ObjectClass BaseSink
instance GObjectClass BaseSink where
  toGObject = GObject . castForeignPtr . unBaseSink
  unsafeCastGObject = BaseSink . castForeignPtr . unGObject

castToBaseSink :: GObjectClass obj => obj -> BaseSink
castToBaseSink = castTo gTypeBaseSink "BaseSink"

gTypeBaseSink :: GType
gTypeBaseSink =
  {# call fun unsafe gst_base_sink_get_type #}

-- ************************************************************** BaseTransform

{#pointer *GstBaseTransform as BaseTransform foreign newtype #} deriving (Eq,Ord)

mkBaseTransform = (BaseTransform, objectUnref)
unBaseTransform (BaseTransform o) = o

class ElementClass o => BaseTransformClass o
toBaseTransform :: BaseTransformClass o => o -> BaseTransform
toBaseTransform = unsafeCastGObject . toGObject

instance BaseTransformClass BaseTransform
instance ElementClass BaseTransform
instance ObjectClass BaseTransform
instance GObjectClass BaseTransform where
  toGObject = GObject . castForeignPtr . unBaseTransform
  unsafeCastGObject = BaseTransform . castForeignPtr . unGObject

castToBaseTransform :: GObjectClass obj => obj -> BaseTransform
castToBaseTransform = castTo gTypeBaseTransform "BaseTransform"

gTypeBaseTransform :: GType
gTypeBaseTransform =
  {# call fun unsafe gst_base_transform_get_type #}

-- ********************************************************************* Plugin

{#pointer *GstPlugin as Plugin foreign newtype #} deriving (Eq,Ord)

mkPlugin = (Plugin, objectUnref)
unPlugin (Plugin o) = o

class ObjectClass o => PluginClass o
toPlugin :: PluginClass o => o -> Plugin
toPlugin = unsafeCastGObject . toGObject

instance PluginClass Plugin
instance ObjectClass Plugin
instance GObjectClass Plugin where
  toGObject = GObject . castForeignPtr . unPlugin
  unsafeCastGObject = Plugin . castForeignPtr . unGObject

castToPlugin :: GObjectClass obj => obj -> Plugin
castToPlugin = castTo gTypePlugin "Plugin"

gTypePlugin :: GType
gTypePlugin =
  {# call fun unsafe gst_plugin_get_type #}

-- ******************************************************************* Registry

{#pointer *GstRegistry as Registry foreign newtype #} deriving (Eq,Ord)

mkRegistry = (Registry, objectUnref)
unRegistry (Registry o) = o

class ObjectClass o => RegistryClass o
toRegistry :: RegistryClass o => o -> Registry
toRegistry = unsafeCastGObject . toGObject

instance RegistryClass Registry
instance ObjectClass Registry
instance GObjectClass Registry where
  toGObject = GObject . castForeignPtr . unRegistry
  unsafeCastGObject = Registry . castForeignPtr . unGObject

castToRegistry :: GObjectClass obj => obj -> Registry
castToRegistry = castTo gTypeRegistry "Registry"

gTypeRegistry :: GType
gTypeRegistry =
  {# call fun unsafe gst_registry_get_type #}

-- ************************************************************************ Bus

{#pointer *GstBus as Bus foreign newtype #} deriving (Eq,Ord)

mkBus = (Bus, objectUnref)
unBus (Bus o) = o

class ObjectClass o => BusClass o
toBus :: BusClass o => o -> Bus
toBus = unsafeCastGObject . toGObject

instance BusClass Bus
instance ObjectClass Bus
instance GObjectClass Bus where
  toGObject = GObject . castForeignPtr . unBus
  unsafeCastGObject = Bus . castForeignPtr . unGObject

castToBus :: GObjectClass obj => obj -> Bus
castToBus = castTo gTypeBus "Bus"

gTypeBus :: GType
gTypeBus =
  {# call fun unsafe gst_bus_get_type #}

-- ********************************************************************** Clock

{#pointer *GstClock as Clock foreign newtype #} deriving (Eq,Ord)

mkClock = (Clock, objectUnref)
unClock (Clock o) = o

class ObjectClass o => ClockClass o
toClock :: ClockClass o => o -> Clock
toClock = unsafeCastGObject . toGObject

instance ClockClass Clock
instance ObjectClass Clock
instance GObjectClass Clock where
  toGObject = GObject . castForeignPtr . unClock
  unsafeCastGObject = Clock . castForeignPtr . unGObject

castToClock :: GObjectClass obj => obj -> Clock
castToClock = castTo gTypeClock "Clock"

gTypeClock :: GType
gTypeClock =
  {# call fun unsafe gst_clock_get_type #}

-- ***************************************************************** AudioClock

{#pointer *GstAudioClock as AudioClock foreign newtype #} deriving (Eq,Ord)

mkAudioClock = (AudioClock, objectUnref)
unAudioClock (AudioClock o) = o

class ClockClass o => AudioClockClass o
toAudioClock :: AudioClockClass o => o -> AudioClock
toAudioClock = unsafeCastGObject . toGObject

instance AudioClockClass AudioClock
instance ClockClass AudioClock
instance ObjectClass AudioClock
instance GObjectClass AudioClock where
  toGObject = GObject . castForeignPtr . unAudioClock
  unsafeCastGObject = AudioClock . castForeignPtr . unGObject

castToAudioClock :: GObjectClass obj => obj -> AudioClock
castToAudioClock = castTo gTypeAudioClock "AudioClock"

gTypeAudioClock :: GType
gTypeAudioClock =
  {# call fun unsafe gst_audio_clock_get_type #}

-- **************************************************************** SystemClock

{#pointer *GstSystemClock as SystemClock foreign newtype #} deriving (Eq,Ord)

mkSystemClock = (SystemClock, objectUnref)
unSystemClock (SystemClock o) = o

class ClockClass o => SystemClockClass o
toSystemClock :: SystemClockClass o => o -> SystemClock
toSystemClock = unsafeCastGObject . toGObject

instance SystemClockClass SystemClock
instance ClockClass SystemClock
instance ObjectClass SystemClock
instance GObjectClass SystemClock where
  toGObject = GObject . castForeignPtr . unSystemClock
  unsafeCastGObject = SystemClock . castForeignPtr . unGObject

castToSystemClock :: GObjectClass obj => obj -> SystemClock
castToSystemClock = castTo gTypeSystemClock "SystemClock"

gTypeSystemClock :: GType
gTypeSystemClock =
  {# call fun unsafe gst_system_clock_get_type #}

-- ************************************************************* NetClientClock

{#pointer *GstNetClientClock as NetClientClock foreign newtype #} deriving (Eq,Ord)

mkNetClientClock = (NetClientClock, objectUnref)
unNetClientClock (NetClientClock o) = o

class ClockClass o => NetClientClockClass o
toNetClientClock :: NetClientClockClass o => o -> NetClientClock
toNetClientClock = unsafeCastGObject . toGObject

instance NetClientClockClass NetClientClock
instance ClockClass NetClientClock
instance ObjectClass NetClientClock
instance GObjectClass NetClientClock where
  toGObject = GObject . castForeignPtr . unNetClientClock
  unsafeCastGObject = NetClientClock . castForeignPtr . unGObject

castToNetClientClock :: GObjectClass obj => obj -> NetClientClock
castToNetClientClock = castTo gTypeNetClientClock "NetClientClock"

gTypeNetClientClock :: GType
gTypeNetClientClock =
  {# call fun unsafe gst_net_client_clock_get_type #}

-- ********************************************************************** Index

{#pointer *GstIndex as Index foreign newtype #} deriving (Eq,Ord)

mkIndex = (Index, objectUnref)
unIndex (Index o) = o

class ObjectClass o => IndexClass o
toIndex :: IndexClass o => o -> Index
toIndex = unsafeCastGObject . toGObject

instance IndexClass Index
instance ObjectClass Index
instance GObjectClass Index where
  toGObject = GObject . castForeignPtr . unIndex
  unsafeCastGObject = Index . castForeignPtr . unGObject

castToIndex :: GObjectClass obj => obj -> Index
castToIndex = castTo gTypeIndex "Index"

gTypeIndex :: GType
gTypeIndex =
  {# call fun unsafe gst_index_get_type #}

-- **************************************************************** PadTemplate

{#pointer *GstPadTemplate as PadTemplate foreign newtype #} deriving (Eq,Ord)

mkPadTemplate = (PadTemplate, objectUnref)
unPadTemplate (PadTemplate o) = o

class ObjectClass o => PadTemplateClass o
toPadTemplate :: PadTemplateClass o => o -> PadTemplate
toPadTemplate = unsafeCastGObject . toGObject

instance PadTemplateClass PadTemplate
instance ObjectClass PadTemplate
instance GObjectClass PadTemplate where
  toGObject = GObject . castForeignPtr . unPadTemplate
  unsafeCastGObject = PadTemplate . castForeignPtr . unGObject

castToPadTemplate :: GObjectClass obj => obj -> PadTemplate
castToPadTemplate = castTo gTypePadTemplate "PadTemplate"

gTypePadTemplate :: GType
gTypePadTemplate =
  {# call fun unsafe gst_pad_template_get_type #}

-- *********************************************************************** Task

{#pointer *GstTask as Task foreign newtype #} deriving (Eq,Ord)

mkTask = (Task, objectUnref)
unTask (Task o) = o

class ObjectClass o => TaskClass o
toTask :: TaskClass o => o -> Task
toTask = unsafeCastGObject . toGObject

instance TaskClass Task
instance ObjectClass Task
instance GObjectClass Task where
  toGObject = GObject . castForeignPtr . unTask
  unsafeCastGObject = Task . castForeignPtr . unGObject

castToTask :: GObjectClass obj => obj -> Task
castToTask = castTo gTypeTask "Task"

gTypeTask :: GType
gTypeTask =
  {# call fun unsafe gst_task_get_type #}

-- ************************************************************************ XML

{#pointer *GstXML as XML foreign newtype #} deriving (Eq,Ord)

mkXML = (XML, objectUnref)
unXML (XML o) = o

class ObjectClass o => XMLClass o
toXML :: XMLClass o => o -> XML
toXML = unsafeCastGObject . toGObject

instance XMLClass XML
instance ObjectClass XML
instance GObjectClass XML where
  toGObject = GObject . castForeignPtr . unXML
  unsafeCastGObject = XML . castForeignPtr . unGObject

castToXML :: GObjectClass obj => obj -> XML
castToXML = castTo gTypeXML "XML"

gTypeXML :: GType
gTypeXML =
  {# call fun unsafe gst_xml_get_type #}

-- ***************************************************************** ChildProxy

{#pointer *GstChildProxy as ChildProxy foreign newtype #} deriving (Eq,Ord)

mkChildProxy = (ChildProxy, objectUnref)
unChildProxy (ChildProxy o) = o

class ObjectClass o => ChildProxyClass o
toChildProxy :: ChildProxyClass o => o -> ChildProxy
toChildProxy = unsafeCastGObject . toGObject

instance ChildProxyClass ChildProxy
instance ObjectClass ChildProxy
instance GObjectClass ChildProxy where
  toGObject = GObject . castForeignPtr . unChildProxy
  unsafeCastGObject = ChildProxy . castForeignPtr . unGObject

castToChildProxy :: GObjectClass obj => obj -> ChildProxy
castToChildProxy = castTo gTypeChildProxy "ChildProxy"

gTypeChildProxy :: GType
gTypeChildProxy =
  {# call fun unsafe gst_child_proxy_get_type #}

-- **************************************************************** CollectPads

{#pointer *GstCollectPads as CollectPads foreign newtype #} deriving (Eq,Ord)

mkCollectPads = (CollectPads, objectUnref)
unCollectPads (CollectPads o) = o

class ObjectClass o => CollectPadsClass o
toCollectPads :: CollectPadsClass o => o -> CollectPads
toCollectPads = unsafeCastGObject . toGObject

instance CollectPadsClass CollectPads
instance ObjectClass CollectPads
instance GObjectClass CollectPads where
  toGObject = GObject . castForeignPtr . unCollectPads
  unsafeCastGObject = CollectPads . castForeignPtr . unGObject

castToCollectPads :: GObjectClass obj => obj -> CollectPads
castToCollectPads = castTo gTypeCollectPads "CollectPads"

gTypeCollectPads :: GType
gTypeCollectPads =
  {# call fun unsafe gst_collect_pads_get_type #}

-- ***************************************************************** URIHandler

{#pointer *GstURIHandler as URIHandler foreign newtype #} deriving (Eq,Ord)

mkURIHandler = (URIHandler, objectUnref)
unURIHandler (URIHandler o) = o

class GObjectClass o => URIHandlerClass o
toURIHandler :: URIHandlerClass o => o -> URIHandler
toURIHandler = unsafeCastGObject . toGObject

instance URIHandlerClass URIHandler
instance GObjectClass URIHandler where
  toGObject = GObject . castForeignPtr . unURIHandler
  unsafeCastGObject = URIHandler . castForeignPtr . unGObject

castToURIHandler :: GObjectClass obj => obj -> URIHandler
castToURIHandler = castTo gTypeURIHandler "URIHandler"

gTypeURIHandler :: GType
gTypeURIHandler =
  {# call fun unsafe gst_uri_handler_get_type #}

-- ******************************************************************** Adapter

{#pointer *GstAdapter as Adapter foreign newtype #} deriving (Eq,Ord)

mkAdapter = (Adapter, objectUnref)
unAdapter (Adapter o) = o

class GObjectClass o => AdapterClass o
toAdapter :: AdapterClass o => o -> Adapter
toAdapter = unsafeCastGObject . toGObject

instance AdapterClass Adapter
instance GObjectClass Adapter where
  toGObject = GObject . castForeignPtr . unAdapter
  unsafeCastGObject = Adapter . castForeignPtr . unGObject

castToAdapter :: GObjectClass obj => obj -> Adapter
castToAdapter = castTo gTypeAdapter "Adapter"

gTypeAdapter :: GType
gTypeAdapter =
  {# call fun unsafe gst_adapter_get_type #}

-- ***************************************************************** Controller

{#pointer *GstController as Controller foreign newtype #} deriving (Eq,Ord)

mkController = (Controller, objectUnref)
unController (Controller o) = o

class GObjectClass o => ControllerClass o
toController :: ControllerClass o => o -> Controller
toController = unsafeCastGObject . toGObject

instance ControllerClass Controller
instance GObjectClass Controller where
  toGObject = GObject . castForeignPtr . unController
  unsafeCastGObject = Controller . castForeignPtr . unGObject

castToController :: GObjectClass obj => obj -> Controller
castToController = castTo gTypeController "Controller"

gTypeController :: GType
gTypeController =
  {# call fun unsafe gst_controller_get_type #}