]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_structures.h
initial structures for libvlc callbacks (code adapted from git pdherbemont_branch)
[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 /** defgroup libvlc_exception Exceptions
36  * \ingroup libvlc
37  * LibVLC Exceptions handling
38  * @{
39  */
40
41 typedef struct
42 {
43     int b_raised;
44     int i_code;
45     char *psz_message;
46 } libvlc_exception_t;
47
48 /**@} */
49
50 /*****************************************************************************
51  * Playlist
52  *****************************************************************************/
53 /** defgroup libvlc_playlist Playlist
54  * \ingroup libvlc
55  * LibVLC Playlist handling
56  * @{
57  */
58
59
60 typedef struct {
61     int i_id;
62     char * psz_uri;
63     char * psz_name;
64
65 } libvlc_playlist_item_t;
66
67 /**@} */
68
69
70 /*****************************************************************************
71  * Video
72  *****************************************************************************/
73 /** defgroup libvlc_video Video
74  * \ingroup libvlc
75  * LibVLC Video handling
76  * @{
77  */
78     
79 /**
80 * Downcast to this general type as placeholder for a platform specific one, such as:
81 *  Drawable on X11,
82 *  CGrafPort on MacOSX,
83 *  HWND on win32
84 */
85 typedef int libvlc_drawable_t;
86
87 /**
88 * Rectangle type for video geometry
89 */
90 typedef struct
91 {
92     int top, left;
93     int bottom, right;
94 }
95 libvlc_rectangle_t;
96
97 /**@} */
98
99
100 /*****************************************************************************
101  * Message log handling
102  *****************************************************************************/
103
104 /** defgroup libvlc_log Log
105  * \ingroup libvlc
106  * LibVLC Message Logging
107  * @{
108  */
109
110 /** This structure is opaque. It represents a libvlc log instance */
111 typedef struct libvlc_log_t libvlc_log_t;
112
113 /** This structure is opaque. It represents a libvlc log iterator */
114 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
115
116 typedef struct libvlc_log_message_t
117 {
118     unsigned    sizeof_msg;   /* sizeof() of message structure, must be filled in by user */
119     int         i_severity;   /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
120     const char *psz_type;     /* module type */
121     const char *psz_name;     /* module name */
122     const char *psz_header;   /* optional header */
123     const char *psz_message;  /* message */
124 } libvlc_log_message_t;
125
126 /**@} */
127
128 /*****************************************************************************
129  * Callbacks handling
130  *****************************************************************************/
131
132 /** defgroup libvlc_callbacks Callbacks
133  * \ingroup libvlc
134  * LibVLC Event Callbacks
135  * @{
136  */
137     
138 /**
139  * Available events:
140  * - VOLUME_CHANGED
141  * - INPUT_POSITION_CHANGED
142  */
143 typedef enum {
144     VOLUME_CHANGED,
145     INPUT_POSITION_CHANGED,
146 } libvlc_event_type_t;
147
148 typedef struct 
149 {
150     libvlc_event_type_t type;
151     char reserved[8]; /* For future use */
152 } libvlc_event_t;
153   
154 typedef void ( *libvlc_callback_t )( struct libvlc_instance_t *, libvlc_event_t * );
155
156 /**@} */
157
158 # ifdef __cplusplus
159 }
160 # endif
161
162 #endif