Constness changes
[melted] / src / framework / mlt_events.h
1 /**
2 * \file mlt_events.h
3 * \brief event handling
4 * \see mlt_events_struct
5 *
6 * Copyright (C) 2004-2009 Ushodaya Enterprises Limited
7 * \author Charles Yates <charles.yates@pandora.be>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24 #ifndef _MLT_EVENTS_H_
25 #define _MLT_EVENTS_H_
26
27 #include "mlt_types.h"
28
29 #if GCC_VERSION >= 40000
30 typedef void ( *mlt_transmitter )( void *, ... );
31 typedef void ( *mlt_listener )( void *, ... );
32 #else
33 /** callback function to send an event message
34 *
35 */
36 typedef void ( *mlt_transmitter )( );
37 /** event handler when receiving an event message
38 * \param the properties object on which the event was registered
39 * \param an opaque pointer to a service or really an object
40 * \param variable args supplied by the transmitter
41 */
42 typedef void ( *mlt_listener )( );
43 #endif
44
45 extern void mlt_events_init( mlt_properties self );
46 extern int mlt_events_register( mlt_properties self, char *id, mlt_transmitter transmitter );
47 extern void mlt_events_fire( mlt_properties self, const char *id, ... );
48 extern mlt_event mlt_events_listen( mlt_properties self, void *service, const char *id, mlt_listener listener );
49 extern void mlt_events_block( mlt_properties self, void *service );
50 extern void mlt_events_unblock( mlt_properties self, void *service );
51 extern void mlt_events_disconnect( mlt_properties self, void *service );
52
53 extern mlt_event mlt_events_setup_wait_for( mlt_properties self, const char *id );
54 extern void mlt_events_wait_for( mlt_properties self, mlt_event event );
55 extern void mlt_events_close_wait_for( mlt_properties self, mlt_event event );
56
57 extern void mlt_event_inc_ref( mlt_event self );
58 extern void mlt_event_block( mlt_event self );
59 extern void mlt_event_unblock( mlt_event self );
60 extern void mlt_event_close( mlt_event self );
61
62 #endif
63