variables.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * variables.h: object variables typedefs
00003  *****************************************************************************
00004  * Copyright (C) 2002-2006 VLC authors and VideoLAN
00005  * $Id: 2ab9a1e09c7b5c9ae2f4d02861677c666b60d38e $
00006  *
00007  * Authors: Samuel Hocevar <sam@zoy.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify it
00010  * under the terms of the GNU Lesser General Public License as published by
00011  * the Free Software Foundation; either version 2.1 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017  * GNU Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public License
00020  * along with this program; if not, write to the Free Software Foundation,
00021  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef LIBVLC_VARIABLES_H
00025 # define LIBVLC_VARIABLES_H 1
00026 
00027 typedef struct callback_entry_t callback_entry_t;
00028 
00029 typedef struct variable_ops_t
00030 {
00031     int  (*pf_cmp) ( vlc_value_t, vlc_value_t );
00032     void (*pf_dup) ( vlc_value_t * );
00033     void (*pf_free) ( vlc_value_t * );
00034 } variable_ops_t;
00035 
00036 /**
00037  * The structure describing a variable.
00038  * \note vlc_value_t is the common union for variable values
00039  */
00040 struct variable_t
00041 {
00042     char *       psz_name; /**< The variable unique name (must be first) */
00043 
00044     /** The variable's exported value */
00045     vlc_value_t  val;
00046 
00047     /** The variable display name, mainly for use by the interfaces */
00048     char *       psz_text;
00049 
00050     const variable_ops_t *ops;
00051 
00052     int          i_type;   /**< The type of the variable */
00053     unsigned     i_usage;  /**< Reference count */
00054 
00055     /** If the variable has min/max/step values */
00056     vlc_value_t  min, max, step;
00057 
00058     /** Index of the default choice, if the variable is to be chosen in
00059      * a list */
00060     int          i_default;
00061     /** List of choices */
00062     vlc_list_t   choices;
00063     /** List of friendly names for the choices */
00064     vlc_list_t   choices_text;
00065 
00066     /** Set to TRUE if the variable is in a callback */
00067     bool   b_incallback;
00068 
00069     /** Number of registered callbacks */
00070     int                i_entries;
00071     /** Array of registered callbacks */
00072     callback_entry_t * p_entries;
00073 };
00074 
00075 extern void var_DestroyAll( vlc_object_t * );
00076 
00077 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines