]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_structures.h
free callbacks on libvlc destruction
[vlc] / include / vlc / libvlc_structures.h
1 /*****************************************************************************
2  * libvlc.h:  libvlc_* new external API structures
3  *****************************************************************************
4  * Copyright (C) 1998-2007 the VideoLAN team
5  * $Id $
6  *
7  * Authors: Filippo Carone <littlejohn@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program 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
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _LIBVLC_STRUCTURES_H
25 #define _LIBVLC_STRUCTURES_H 1
26
27 #include <vlc/vlc.h>
28
29 # ifdef __cplusplus
30 extern "C" {
31 # endif
32
33 /** This structure is opaque. It represents a libvlc instance */
34 typedef struct libvlc_instance_t libvlc_instance_t;
35
36 /*****************************************************************************
37  * Exceptions
38  *****************************************************************************/
39
40 /** defgroup libvlc_exception Exceptions
41  * \ingroup libvlc
42  * LibVLC Exceptions handling
43  * @{
44  */
45
46 typedef struct
47 {
48     int b_raised;
49     int i_code;
50     char *psz_message;
51 } libvlc_exception_t;
52
53 /**@} */
54
55 /*****************************************************************************
56  * Playlist
57  *****************************************************************************/
58 /** defgroup libvlc_playlist Playlist
59  * \ingroup libvlc
60  * LibVLC Playlist handling
61  * @{
62  */
63
64 typedef struct {
65     int i_id;
66     char * psz_uri;
67     char * psz_name;
68
69 } libvlc_playlist_item_t;
70
71 /**@} */
72
73
74 /*****************************************************************************
75  * Video
76  *****************************************************************************/
77 /** defgroup libvlc_video Video
78  * \ingroup libvlc
79  * LibVLC Video handling
80  * @{
81  */
82     
83 /**
84 * Downcast to this general type as placeholder for a platform specific one, such as:
85 *  Drawable on X11,
86 *  CGrafPort on MacOSX,
87 *  HWND on win32
88 */
89 typedef int libvlc_drawable_t;
90
91 /**
92 * Rectangle type for video geometry
93 */
94 typedef struct
95 {
96     int top, left;
97     int bottom, right;
98 }
99 libvlc_rectangle_t;
100
101 /**@} */
102
103
104 /*****************************************************************************
105  * Message log handling
106  *****************************************************************************/
107
108 /** defgroup libvlc_log Log
109  * \ingroup libvlc
110  * LibVLC Message Logging
111  * @{
112  */
113
114 /** This structure is opaque. It represents a libvlc log instance */
115 typedef struct libvlc_log_t libvlc_log_t;
116
117 /** This structure is opaque. It represents a libvlc log iterator */
118 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
119
120 typedef struct libvlc_log_message_t
121 {
122     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
123     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
124     const char *psz_type;     /* module type */
125     const char *psz_name;     /* module name */
126     const char *psz_header;   /* optional header */
127     const char *psz_message;  /* message */
128 } libvlc_log_message_t;
129
130 /**@} */
131
132 /*****************************************************************************
133  * Callbacks handling
134  *****************************************************************************/
135
136 /** defgroup libvlc_callbacks Callbacks
137  * \ingroup libvlc
138  * LibVLC Event Callbacks
139  * @{
140  */
141     
142 /**
143  * Available events:
144  * - VOLUME_CHANGED
145  * - INPUT_POSITION_CHANGED
146  */
147 typedef enum {
148     VOLUME_CHANGED,
149     INPUT_POSITION_CHANGED,
150 } libvlc_event_type_t;
151
152 typedef struct 
153 {
154     libvlc_event_type_t type;
155     char reserved[8]; /* For future use */
156 } libvlc_event_t;
157   
158 typedef void ( *libvlc_callback_t )( struct libvlc_instance_t *, libvlc_event_t * );
159
160 /**@} */
161
162 # ifdef __cplusplus
163 }
164 # endif
165
166 #endif