root/src/misc/variables.h
| Revision 449fd28aaf007c6411251dae9d0dbfdc65b135d1, 2.7 kB (checked in by Pierre d'Herbemont <pdherbemont@videolan.org>, 5 months ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | /***************************************************************************** |
| 2 | * variables.h: object variables typedefs |
| 3 | ***************************************************************************** |
| 4 | * Copyright (C) 2002-2006 the VideoLAN team |
| 5 | * $Id$ |
| 6 | * |
| 7 | * Authors: Samuel Hocevar <sam@zoy.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 | #if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__) |
| 25 | # error This header file can only be included from LibVLC. |
| 26 | #endif |
| 27 | |
| 28 | #ifndef __LIBVLC_VARIABLES_H |
| 29 | # define __LIBVLC_VARIABLES_H 1 |
| 30 | |
| 31 | typedef struct callback_entry_t callback_entry_t; |
| 32 | |
| 33 | /** |
| 34 | * The structure describing a variable. |
| 35 | * \note vlc_value_t is the common union for variable values |
| 36 | */ |
| 37 | struct variable_t |
| 38 | { |
| 39 | /** The variable's exported value */ |
| 40 | vlc_value_t val; |
| 41 | |
| 42 | char * psz_name; /**< The variable unique name */ |
| 43 | uint32_t i_hash; /**< (almost) unique hashed value */ |
| 44 | int i_type; /**< The type of the variable */ |
| 45 | |
| 46 | /** The variable display name, mainly for use by the interfaces */ |
| 47 | char * psz_text; |
| 48 | |
| 49 | /** A pointer to a comparison function */ |
| 50 | int ( * pf_cmp ) ( vlc_value_t, vlc_value_t ); |
| 51 | /** A pointer to a duplication function */ |
| 52 | void ( * pf_dup ) ( vlc_value_t * ); |
| 53 | /** A pointer to a deallocation function */ |
| 54 | void ( * pf_free ) ( vlc_value_t * ); |
| 55 | |
| 56 | /** Creation count: we only destroy the variable if it reaches 0 */ |
| 57 | int i_usage; |
| 58 | |
| 59 | /** If the variable has min/max/step values */ |
| 60 | vlc_value_t min, max, step; |
| 61 | |
| 62 | /** Index of the default choice, if the variable is to be chosen in |
| 63 | * a list */ |
| 64 | int i_default; |
| 65 | /** List of choices */ |
| 66 | vlc_list_t choices; |
| 67 | /** List of friendly names for the choices */ |
| 68 | vlc_list_t choices_text; |
| 69 | |
| 70 | /** Set to TRUE if the variable is in a callback */ |
| 71 | bool b_incallback; |
| 72 | |
| 73 | /** Number of registered callbacks */ |
| 74 | int i_entries; |
| 75 | /** Array of registered callbacks */ |
| 76 | callback_entry_t * p_entries; |
| 77 | }; |
| 78 | #endif |
Note: See TracBrowser for help on using the browser.
