2 * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3 * 2000 Wim Taymans <wtay@chello.be>
5 * gstinterface.h: Declarations of interface stuff
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
23 #ifndef __GST_IMPLEMENTS_INTERFACE_H__
24 #define __GST_IMPLEMENTS_INTERFACE_H__
26 #include <gst/gstelement.h>
30 #define GST_TYPE_IMPLEMENTS_INTERFACE \
31 (gst_implements_interface_get_type ())
32 #define GST_IMPLEMENTS_INTERFACE(obj) \
33 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_IMPLEMENTS_INTERFACE, \
34 GstImplementsInterface))
35 #define GST_IS_IMPLEMENTS_INTERFACE(obj) \
36 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_IMPLEMENTS_INTERFACE))
37 #define GST_IMPLEMENTS_INTERFACE_GET_CLASS(inst) \
38 (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_IMPLEMENTS_INTERFACE, \
39 GstImplementsInterfaceClass))
42 * GstImplementsInterface:
44 * Opaque #GstImplementsInterface structure.
46 typedef struct _GstImplementsInterface GstImplementsInterface;
48 typedef struct _GstImplementsInterfaceClass GstImplementsInterfaceClass;
50 /* This small extra virtual function is here to provide an
51 * interface functionality on a per-instance basis rather
52 * than a per-class basis, which is the case for glib.
54 struct _GstImplementsInterfaceClass {
55 GTypeInterface parent;
57 /* virtual functions */
58 gboolean (* supported) (GstImplementsInterface *iface,
61 gpointer _gst_reserved[GST_PADDING];
64 #define GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST(obj, type, cast_t) \
65 ((cast_t *) gst_implements_interface_cast ((obj), (type)))
66 #define GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE(obj, type) \
67 (gst_implements_interface_check ((obj), (type)))
69 GType gst_implements_interface_get_type (void);
71 /* wrapper functions to check for functionality implementation */
72 gboolean gst_element_implements_interface (GstElement *element,
74 gpointer gst_implements_interface_cast (gpointer from,
76 gboolean gst_implements_interface_check (gpointer from,
81 #endif /* __GST_IMPLEMENTS_INTERFACE_H__ */