Initial import to Tizen
[profile/ivi/gstreamer-python.git] / gst / common.h
1 /* -*- Mode: C; ; c-file-style: "python" -*- */
2 /* gst-python
3  * Copyright (C) 2004 Johan Dahlin
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  * 
20  * Author: Johan Dahlin <johan@gnome.org>
21  */
22 #ifndef __COMMON_H__
23 #define __COMMON_H__
24
25 #include <Python.h>
26 #include <pygobject.h>
27 #include <glib.h>
28 #include <glib-object.h>
29 #include <gst/gst.h>
30
31 #include "pygstminiobject.h"
32
33 #if (defined HAVE_OLD_PYGTK && (PY_VERSION_HEX < 0x02030000))
34   typedef destructor freefunc;
35 #endif
36
37 #if PY_VERSION_HEX < 0x02050000
38 #define lenfunc inquiry
39 #define ssizeargfunc intargfunc
40 #define ssizessizeargfunc intintargfunc
41 #define ssizeobjargproc intobjargproc
42 #define ssizessizeobjargproc intintobjargproc
43 #endif
44
45 typedef struct {
46         PyGObject *pad;
47         GClosure *link_function;
48         GClosure *event_function;
49         GClosure *chain_function;
50         GClosure *get_function; 
51         GClosure *getcaps_function; 
52         GClosure *setcaps_function; 
53         GClosure *activate_function;
54         GClosure *activatepull_function;
55         GClosure *activatepush_function;
56         /* Query is not implemented as a closure to avoid refcounting
57          * making the query immutable and therefore useless */
58         PyObject *query_function;
59 } PyGstPadPrivate;
60
61 typedef struct {
62      PyObject *func, *data;
63 } PyGstCustomNotify;
64
65 typedef struct {
66     PyObject_HEAD
67     GstIterator *iter;
68 } PyGstIterator;
69
70 extern PyTypeObject PyGstIterator_Type;
71
72
73 #endif /* __COMMON_H__ */