]> git.sesse.net Git - vlc/blobdiff - include/vlc_plugin.h
vlc-config: Add a specific flag for libs, and remove werror there.
[vlc] / include / vlc_plugin.h
index 41e3374a4f8582eeea864a464cd33576699c5bd9..53068259e6855accd85c4583d993f1fb54e69a3e 100644 (file)
@@ -2,7 +2,7 @@
  * vlc_plugin.h : Macros used from within a module.
  *****************************************************************************
  * Copyright (C) 2001-2006 the VideoLAN team
- * Copyright © 2007-2008 Rémi Denis-Courmont
+ * Copyright © 2007-2009 Rémi Denis-Courmont
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
  * This file implements plugin (module) macros used to define a vlc module.
  */
 
-VLC_EXPORT( module_t *, vlc_module_create, ( vlc_object_t * ) );
-VLC_EXPORT( module_t *, vlc_submodule_create, ( module_t * ) );
-VLC_EXPORT( int, vlc_module_set, (module_t *module, int propid, ...) );
-VLC_EXPORT( module_config_t *, vlc_config_create, (module_t *, int type) );
-VLC_EXPORT( int, vlc_config_set, (module_config_t *, int, ...) );
+VLC_EXPORT( int, vlc_plugin_set, (module_t *, module_config_t *, int, ...) );
+
+#define vlc_module_set( mod, ... ) vlc_plugin_set ((mod), NULL, __VA_ARGS__)
+#define vlc_config_set( cfg, ... ) vlc_plugin_set (NULL, (cfg), __VA_ARGS__)
 
 enum vlc_module_properties
 {
+    VLC_SUBMODULE_CREATE,
+    VLC_CONFIG_CREATE,
+
     /* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI!
      * Append new items at the end ONLY. */
-    VLC_MODULE_CPU_REQUIREMENT,
+    VLC_MODULE_CPU_REQUIREMENT=0x100,
     VLC_MODULE_SHORTCUT,
-    VLC_MODULE_SHORTNAME_NODOMAIN,
-    VLC_MODULE_DESCRIPTION_NODOMAIN,
-    VLC_MODULE_HELP_NODOMAIN,
     VLC_MODULE_CAPABILITY,
     VLC_MODULE_SCORE,
-    VLC_MODULE_PROGRAM, /* obsoleted */
     VLC_MODULE_CB_OPEN,
     VLC_MODULE_CB_CLOSE,
     VLC_MODULE_NO_UNLOAD,
@@ -54,19 +52,13 @@ enum vlc_module_properties
     VLC_MODULE_SHORTNAME,
     VLC_MODULE_DESCRIPTION,
     VLC_MODULE_HELP,
-};
+    /* Insert new VLC_MODULE_* here */
 
-enum vlc_config_properties
-{
     /* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI!
      * Append new items at the end ONLY. */
-
-    VLC_CONFIG_NAME,
+    VLC_CONFIG_NAME=0x1000,
     /* command line name (args=const char *, vlc_callback_t) */
 
-    VLC_CONFIG_DESC_NODOMAIN,
-    /* description (args=const char *, const char *) */
-
     VLC_CONFIG_VALUE,
     /* actual value (args=int/double/const char *) */
 
@@ -97,13 +89,6 @@ enum vlc_config_properties
     VLC_CONFIG_SHORTCUT,
     /* one-character (short) command line option name (args=char) */
 
-    VLC_CONFIG_LIST_NODOMAIN,
-    /* possible values list
-     * (args=size_t, const <type> *, const char *const *) */
-
-    VLC_CONFIG_ADD_ACTION_NODOMAIN,
-    /* add value change callback (args=vlc_callback_t, const char *) */
-
     VLC_CONFIG_OLDNAME,
     /* former option name (args=const char *) */
 
@@ -120,6 +105,8 @@ enum vlc_config_properties
     VLC_CONFIG_ADD_ACTION,
     /* add value change callback
      * (args=const char *, vlc_callback_t, const char *) */
+
+    /* Insert new VLC_CONFIG_* here */
 };
 
 /*****************************************************************************
@@ -132,8 +119,8 @@ enum vlc_config_properties
 /**
  * Current plugin ABI version
  */
-# define MODULE_SYMBOL 1_0_0c
-# define MODULE_SUFFIX "__1_0_0c"
+# define MODULE_SYMBOL 1_1_0b
+# define MODULE_SUFFIX "__1_1_0b"
 
 /*****************************************************************************
  * Add a few defines. You do not want to read this section. Really.
@@ -205,7 +192,8 @@ enum vlc_config_properties
     VLC_METADATA_EXPORTS
 
 #define add_submodule( ) \
-    p_submodule = vlc_submodule_create( p_module );
+    if (vlc_plugin_set (p_module, NULL, VLC_SUBMODULE_CREATE, &p_submodule)) \
+        goto error;
 
 #define add_requirement( cap ) \
     if (vlc_module_set (p_module, VLC_MODULE_CPU_REQUIREMENT, \
@@ -263,7 +251,7 @@ enum vlc_config_properties
  *****************************************************************************/
 
 #define add_type_inner( type ) \
-    p_config = vlc_config_create (p_module, type);
+    vlc_plugin_set (p_module, NULL, VLC_CONFIG_CREATE, (type), &p_config);
 
 #define add_typedesc_inner( type, text, longtext ) \
     add_type_inner( type ) \
@@ -327,6 +315,10 @@ enum vlc_config_properties
     add_string_inner( CONFIG_ITEM_DIRECTORY, name, text, longtext, advc, \
                       p_callback, value )
 
+#define add_font( name, value, p_callback, text, longtext, advc )\
+    add_string_inner( CONFIG_ITEM_FONT, name, text, longtext, advc, \
+                      p_callback, value )
+
 #define add_module( name, psz_caps, value, p_callback, text, longtext, advc ) \
     add_string_inner( CONFIG_ITEM_MODULE, name, text, longtext, advc, \
                       p_callback, value ) \
@@ -341,21 +333,29 @@ enum vlc_config_properties
 #define add_module_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \
     add_string_inner( CONFIG_ITEM_MODULE_CAT, name, text, longtext, advc, \
                       p_callback, value ) \
-    p_config->min.i = i_subcategory /* gruik */;
+    change_integer_range (i_subcategory /* gruik */, 0);
 
 #define add_module_list_cat( name, i_subcategory, value, p_callback, text, longtext, advc ) \
     add_string_inner( CONFIG_ITEM_MODULE_LIST_CAT, name, text, longtext, \
                       advc, p_callback, value ) \
-    p_config->min.i = i_subcategory /* gruik */;
+    change_integer_range (i_subcategory /* gruik */, 0);
 #endif
 
 #define add_integer( name, value, p_callback, text, longtext, advc ) \
     add_int_inner( CONFIG_ITEM_INTEGER, name, text, longtext, advc, \
                    p_callback, value )
 
+#if !defined(WIN32) && !defined(SYS_LINUX)
 #define add_key( name, value, p_callback, text, longtext, advc ) \
     add_int_inner( CONFIG_ITEM_KEY, name, text, longtext, advc, p_callback, \
                    value )
+#else
+#define add_key( name, value, p_callback, text, longtext, advc ) \
+    add_int_inner( CONFIG_ITEM_KEY, name, text, longtext, advc, \
+                   p_callback, value ) \
+    add_int_inner( CONFIG_ITEM_KEY, "global-" name, text, longtext, advc, \
+                   p_callback, KEY_UNSET )
+#endif
 
 #define add_integer_with_range( name, value, i_min, i_max, p_callback, text, longtext, advc ) \
     add_integer( name, value, p_callback, text, longtext, advc ) \
@@ -415,13 +415,6 @@ enum vlc_config_properties
                     (const char *const *)(list_text), \
                     (vlc_callback_t)(list_update_func));
 
-#define change_float_list( list, list_text, list_update_func ) \
-    vlc_config_set (p_config, VLC_CONFIG_LIST, domain, \
-                    (size_t)(sizeof (list) / sizeof (float)), \
-                    (const float *)(list), \
-                    (const char *const *)(list_text), \
-                    (vlc_callback_t)(list_update_func));
-
 #define change_integer_range( minv, maxv ) \
     vlc_config_set (p_config, VLC_CONFIG_RANGE, (int)(minv), (int)(maxv));
 
@@ -463,7 +456,7 @@ enum vlc_config_properties
     "\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\x74\x68" \
     "\x65\x20\x56\x69\x64\x65\x6f\x4c\x41\x4e\x20\x56\x4c\x43\x20\x6d" \
     "\x65\x64\x69\x61\x20\x70\x6c\x61\x79\x65\x72\x20\x64\x65\x76\x65" \
-    "\x6c\x6f\x70\x70\x65\x72\x73" )
+    "\x6c\x6f\x70\x65\x72\x73" )
 #elif !defined (VLC_COPYRIGHT_EXPORT)
 # define VLC_COPYRIGHT_EXPORT
 #endif