gstreamer_core/gst/gstinterface.h
changeset 0 0e761a78d257
child 4 50e57c9016d0
equal deleted inserted replaced
-1:000000000000 0:0e761a78d257
       
     1 /* GStreamer
       
     2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
       
     3  *                    2000 Wim Taymans <wtay@chello.be>
       
     4  *
       
     5  * gstinterface.h: Declarations of interface stuff
       
     6  *
       
     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.
       
    11  *
       
    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.
       
    16  *
       
    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.
       
    21  */
       
    22 
       
    23 #ifndef __GST_IMPLEMENTS_INTERFACE_H__
       
    24 #define __GST_IMPLEMENTS_INTERFACE_H__
       
    25 
       
    26 #include <gst/gstelement.h>
       
    27 
       
    28 G_BEGIN_DECLS
       
    29 
       
    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_IMPLEMENTS_INTERFACE_CLASS(klass) \
       
    36   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_IMPLEMENTS_INTERFACE, \
       
    37 			    GstImplementsInterfaceClass))
       
    38 #define GST_IS_IMPLEMENTS_INTERFACE(obj) \
       
    39   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_IMPLEMENTS_INTERFACE))
       
    40 #define GST_IS_IMPLEMENTS_INTERFACE_CLASS(klass) \
       
    41   (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_IMPLEMENTS_INTERFACE))
       
    42 #define GST_IMPLEMENTS_INTERFACE_GET_CLASS(inst) \
       
    43   (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_IMPLEMENTS_INTERFACE, \
       
    44 				  GstImplementsInterfaceClass))
       
    45 
       
    46 /**
       
    47  * GstImplementsInterface:
       
    48  *
       
    49  * Opaque #GstImplementsInterface structure.
       
    50  */
       
    51 typedef struct _GstImplementsInterface GstImplementsInterface;
       
    52 
       
    53 typedef struct _GstImplementsInterfaceClass GstImplementsInterfaceClass;
       
    54 
       
    55 /* This small extra virtual function is here to provide an
       
    56  * interface functionality on a per-instance basis rather
       
    57  * than a per-class basis, which is the case for glib.
       
    58  */
       
    59 struct _GstImplementsInterfaceClass {
       
    60   GTypeInterface parent;
       
    61 
       
    62   /* virtual functions */
       
    63   gboolean (* supported) (GstImplementsInterface *iface,
       
    64 			  GType                   iface_type);
       
    65 
       
    66   gpointer _gst_reserved[GST_PADDING];
       
    67 };
       
    68 
       
    69 #define GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST(obj, type, cast_t) \
       
    70   ((cast_t *) gst_implements_interface_cast ((obj), (type)))
       
    71 #define GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE(obj, type) \
       
    72   (gst_implements_interface_check ((obj), (type)))
       
    73 
       
    74 GType	 gst_implements_interface_get_type    (void);
       
    75 
       
    76 /* wrapper functions to check for functionality implementation */
       
    77 #ifdef __SYMBIAN32__
       
    78 IMPORT_C
       
    79 #endif
       
    80 
       
    81 gboolean gst_element_implements_interface     (GstElement *element,
       
    82 					       GType       iface_type);
       
    83 #ifdef __SYMBIAN32__
       
    84 IMPORT_C
       
    85 #endif
       
    86 
       
    87 gpointer gst_implements_interface_cast	      (gpointer    from,
       
    88 					       GType       type);
       
    89 #ifdef __SYMBIAN32__
       
    90 IMPORT_C
       
    91 #endif
       
    92 
       
    93 gboolean gst_implements_interface_check	      (gpointer    from,
       
    94 					       GType       type);
       
    95 
       
    96 G_END_DECLS
       
    97 
       
    98 #endif /* __GST_IMPLEMENTS_INTERFACE_H__ */