]> git.sesse.net Git - vlc/commitdiff
Move configuration defines to <vlc_plugin.h>
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 20 Mar 2012 17:22:24 +0000 (19:22 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 20 Mar 2012 19:21:43 +0000 (21:21 +0200)
They are mostly used by plugin descriptors.

17 files changed:
include/vlc_config_cat.h
include/vlc_configuration.h
include/vlc_plugin.h
modules/gui/macosx/intf.m
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs_widgets.m
modules/gui/macosx/simple_prefs.m
modules/gui/qt4/components/complete_preferences.cpp
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.hpp
src/config/cmdline.c
src/config/configuration.h
src/config/core.c
src/config/file.c
src/config/help.c

index 0b5ce97565bc03ffd07f4ac95b9c84f34e273f50..f2bece6c6833360d3bfc4cb82b192aea7870f18b 100644 (file)
@@ -24,6 +24,7 @@
 
 #ifndef VLC_HELP_H
 #define VLC_HELP_H 1
+# include <vlc_plugin.h>
 
 /*
  *  First, we need help strings for the General Settings and for the
index e3b17a56d911cc86d82081c4163eeb5a5844cab5..aa8748628673d3f260026304b1c90ea9782fa207 100644 (file)
 extern "C" {
 # endif
 
-/*****************************************************************************
- * Macros used to build the configuration structure.
- *****************************************************************************/
-
-/* Configuration hint types */
-#define CONFIG_HINT_CATEGORY                0x02  /* Start of new category */
-#define CONFIG_HINT_SUBCATEGORY             0x03  /* Start of sub-category */
-#define CONFIG_HINT_SUBCATEGORY_END         0x04  /* End of sub-category */
-#define CONFIG_HINT_USAGE                   0x05  /* Usage information */
-
-#define CONFIG_CATEGORY                     0x06 /* Set category */
-#define CONFIG_SUBCATEGORY                  0x07 /* Set subcategory */
-#define CONFIG_SECTION                      0x08 /* Start of new section */
-
-/* Configuration item types */
-#define CONFIG_ITEM_FLOAT                   0x20  /* Float option */
-#define CONFIG_ITEM_INTEGER                 0x40  /* Integer option */
-#define CONFIG_ITEM_RGB                     0x41  /* RGB color option */
-#define CONFIG_ITEM_BOOL                    0x60  /* Bool option */
-#define CONFIG_ITEM_STRING                  0x80  /* String option */
-#define CONFIG_ITEM_PASSWORD                0x81  /* Password option (*) */
-#define CONFIG_ITEM_KEY                     0x82  /* Hot key option */
-#define CONFIG_ITEM_MODULE                  0x84  /* Module option */
-#define CONFIG_ITEM_MODULE_CAT              0x85  /* Module option */
-#define CONFIG_ITEM_MODULE_LIST             0x86  /* Module option */
-#define CONFIG_ITEM_MODULE_LIST_CAT         0x87  /* Module option */
-#define CONFIG_ITEM_LOADFILE                0x8C  /* Read file option */
-#define CONFIG_ITEM_SAVEFILE                0x8D  /* Written file option */
-#define CONFIG_ITEM_DIRECTORY               0x8E  /* Directory option */
-#define CONFIG_ITEM_FONT                    0x8F  /* Font option */
-
-#define CONFIG_ITEM(x) (((x) & ~0xF) != 0)
-
-/*******************************************************************
- * All predefined categories and subcategories
- *******************************************************************/
-#define CAT_INTERFACE 1
-   #define SUBCAT_INTERFACE_GENERAL 101
-   #define SUBCAT_INTERFACE_MAIN 102
-   #define SUBCAT_INTERFACE_CONTROL 103
-   #define SUBCAT_INTERFACE_HOTKEYS 104
-
-#define CAT_AUDIO 2
-   #define SUBCAT_AUDIO_GENERAL 201
-   #define SUBCAT_AUDIO_AOUT 202
-   #define SUBCAT_AUDIO_AFILTER 203
-   #define SUBCAT_AUDIO_VISUAL 204
-   #define SUBCAT_AUDIO_MISC 205
-
-#define CAT_VIDEO 3
-   #define SUBCAT_VIDEO_GENERAL 301
-   #define SUBCAT_VIDEO_VOUT 302
-   #define SUBCAT_VIDEO_VFILTER 303
-   #define SUBCAT_VIDEO_TEXT 304
-   #define SUBCAT_VIDEO_SUBPIC 305
-   #define SUBCAT_VIDEO_VFILTER2 306
-
-#define CAT_INPUT 4
-   #define SUBCAT_INPUT_GENERAL 401
-   #define SUBCAT_INPUT_ACCESS 402
-   #define SUBCAT_INPUT_DEMUX 403
-   #define SUBCAT_INPUT_VCODEC 404
-   #define SUBCAT_INPUT_ACODEC 405
-   #define SUBCAT_INPUT_SCODEC 406
-   #define SUBCAT_INPUT_STREAM_FILTER 407
-
-#define CAT_SOUT 5
-   #define SUBCAT_SOUT_GENERAL 501
-   #define SUBCAT_SOUT_STREAM 502
-   #define SUBCAT_SOUT_MUX 503
-   #define SUBCAT_SOUT_ACO 504
-   #define SUBCAT_SOUT_PACKETIZER 505
-   #define SUBCAT_SOUT_SAP 506
-   #define SUBCAT_SOUT_VOD 507
-
-#define CAT_ADVANCED 6
-   #define SUBCAT_ADVANCED_CPU 601
-   #define SUBCAT_ADVANCED_MISC 602
-   #define SUBCAT_ADVANCED_NETWORK 603
-   #define SUBCAT_ADVANCED_XML 604
-
-#define CAT_PLAYLIST 7
-   #define SUBCAT_PLAYLIST_GENERAL 701
-   #define SUBCAT_PLAYLIST_SD 702
-   #define SUBCAT_PLAYLIST_EXPORT 703
-
-#define CAT_OSD 8
-   #define SUBCAT_OSD_IMPORT 801
-
 struct config_category_t
 {
     int         i_id;
index 586d058b2bee8c35bb8328e9833c0bbbd1d99df5..b9e1ea44a7b3c9a0e28e9e4a1b7ffe8ebd58cca6 100644 (file)
@@ -102,6 +102,90 @@ enum vlc_module_properties
     /* Insert new VLC_CONFIG_* here */
 };
 
+/* Configuration hint types */
+#define CONFIG_HINT_CATEGORY                0x02  /* Start of new category */
+#define CONFIG_HINT_SUBCATEGORY             0x03  /* Start of sub-category */
+#define CONFIG_HINT_SUBCATEGORY_END         0x04  /* End of sub-category */
+#define CONFIG_HINT_USAGE                   0x05  /* Usage information */
+
+#define CONFIG_CATEGORY                     0x06 /* Set category */
+#define CONFIG_SUBCATEGORY                  0x07 /* Set subcategory */
+#define CONFIG_SECTION                      0x08 /* Start of new section */
+
+/* Configuration item types */
+#define CONFIG_ITEM_FLOAT                   0x20  /* Float option */
+#define CONFIG_ITEM_INTEGER                 0x40  /* Integer option */
+#define CONFIG_ITEM_RGB                     0x41  /* RGB color option */
+#define CONFIG_ITEM_BOOL                    0x60  /* Bool option */
+#define CONFIG_ITEM_STRING                  0x80  /* String option */
+#define CONFIG_ITEM_PASSWORD                0x81  /* Password option (*) */
+#define CONFIG_ITEM_KEY                     0x82  /* Hot key option */
+#define CONFIG_ITEM_MODULE                  0x84  /* Module option */
+#define CONFIG_ITEM_MODULE_CAT              0x85  /* Module option */
+#define CONFIG_ITEM_MODULE_LIST             0x86  /* Module option */
+#define CONFIG_ITEM_MODULE_LIST_CAT         0x87  /* Module option */
+#define CONFIG_ITEM_LOADFILE                0x8C  /* Read file option */
+#define CONFIG_ITEM_SAVEFILE                0x8D  /* Written file option */
+#define CONFIG_ITEM_DIRECTORY               0x8E  /* Directory option */
+#define CONFIG_ITEM_FONT                    0x8F  /* Font option */
+
+#define CONFIG_ITEM(x) (((x) & ~0xF) != 0)
+
+/* Categories and subcategories */
+#define CAT_INTERFACE 1
+#define SUBCAT_INTERFACE_GENERAL 101
+#define SUBCAT_INTERFACE_MAIN 102
+#define SUBCAT_INTERFACE_CONTROL 103
+#define SUBCAT_INTERFACE_HOTKEYS 104
+
+#define CAT_AUDIO 2
+#define SUBCAT_AUDIO_GENERAL 201
+#define SUBCAT_AUDIO_AOUT 202
+#define SUBCAT_AUDIO_AFILTER 203
+#define SUBCAT_AUDIO_VISUAL 204
+#define SUBCAT_AUDIO_MISC 205
+
+#define CAT_VIDEO 3
+#define SUBCAT_VIDEO_GENERAL 301
+#define SUBCAT_VIDEO_VOUT 302
+#define SUBCAT_VIDEO_VFILTER 303
+#define SUBCAT_VIDEO_TEXT 304
+#define SUBCAT_VIDEO_SUBPIC 305
+#define SUBCAT_VIDEO_VFILTER2 306
+
+#define CAT_INPUT 4
+#define SUBCAT_INPUT_GENERAL 401
+#define SUBCAT_INPUT_ACCESS 402
+#define SUBCAT_INPUT_DEMUX 403
+#define SUBCAT_INPUT_VCODEC 404
+#define SUBCAT_INPUT_ACODEC 405
+#define SUBCAT_INPUT_SCODEC 406
+#define SUBCAT_INPUT_STREAM_FILTER 407
+
+#define CAT_SOUT 5
+#define SUBCAT_SOUT_GENERAL 501
+#define SUBCAT_SOUT_STREAM 502
+#define SUBCAT_SOUT_MUX 503
+#define SUBCAT_SOUT_ACO 504
+#define SUBCAT_SOUT_PACKETIZER 505
+#define SUBCAT_SOUT_SAP 506
+#define SUBCAT_SOUT_VOD 507
+
+#define CAT_ADVANCED 6
+#define SUBCAT_ADVANCED_CPU 601
+#define SUBCAT_ADVANCED_MISC 602
+#define SUBCAT_ADVANCED_NETWORK 603
+#define SUBCAT_ADVANCED_XML 604
+
+#define CAT_PLAYLIST 7
+#define SUBCAT_PLAYLIST_GENERAL 701
+#define SUBCAT_PLAYLIST_SD 702
+#define SUBCAT_PLAYLIST_EXPORT 703
+
+#define CAT_OSD 8
+#define SUBCAT_OSD_IMPORT 801
+
+
 /**
  * Current plugin ABI version
  */
index 414e9fa57a0a83437f72fc951fcbaa975e9c2d13..f3766ceaf1f737b9631ac85057f76e0382da1995 100644 (file)
@@ -39,6 +39,7 @@
 #include <vlc_dialog.h>
 #include <vlc_url.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 #include <vlc_aout_intf.h>
 #include <vlc_vout_window.h>
 #include <unistd.h> /* execl() */
index 6b85d24ad3d4ba68314c1292a69b7845a351620b..54732f27a58d6bcb49376844afc580ddcdb7ea82 100644 (file)
@@ -59,6 +59,7 @@
 #import "prefs_widgets.h"
 #import <vlc_keys.h>
 #import <vlc_modules.h>
+#import <vlc_plugin.h>
 
 /* /!\ Warning: Unreadable code :/ */
 
index 8926eed70eb8eea05760822d5631e24fb84ce434..691d1865eeaa794ada424b05e94d18ed7459cedf 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <vlc_common.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 #include <vlc_keys.h>
 
 #include "intf.h"
index bcf772c9e12dd0a620548207f1afd8b635dfbd9b..16b183917868cfb75e272013e0e37da5cad767ff 100644 (file)
@@ -32,6 +32,7 @@
 #import <vlc_aout_intf.h>
 #import <vlc_dialog.h>
 #import <vlc_modules.h>
+#import <vlc_plugin.h>
 #import <vlc_config_cat.h>
 #import "misc.h"
 #import "intf.h"
index d14ebf691927715de385f35942171346002d801b..4c6658a29c4dc8d567c74c43ebe1689064d6be3e 100644 (file)
@@ -42,6 +42,7 @@
 #include <vlc_config_cat.h>
 #include <vlc_intf_strings.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 #include <assert.h>
 
 #define ITEM_HEIGHT 25
index 0b3abee18eefbcf85529b4722ea1e9b48efe215d..b28f9c31544d5774ad24b1de4c4719acb1172fbb 100644 (file)
@@ -49,6 +49,7 @@
 #include <vlc_vout.h>
 #include <vlc_osd.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 
 #include <vlc_charset.h> /* us_strtod */
 
index e0ccc6456f0584f7b2692bc6239e00e2e2712bc0..f05de38013aceeabaf0d980439e092576a3d8859 100644 (file)
@@ -37,6 +37,7 @@
 #include "util/qt_dirs.hpp"
 #include <vlc_intf_strings.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 #ifdef WIN32
   #include <vlc_charset.h> /* FromWide for Win32 */
 #endif
index b80b9fd715b8ee453b04cdecac4711cbbea45e37..e5da7c0f5d675ec57094884029fbc5f6ae73124f 100644 (file)
@@ -39,6 +39,7 @@
 #include <vlc_keys.h>
 #include <vlc_intf_strings.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 
 #include <QString>
 #include <QVariant>
@@ -243,6 +244,8 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
     finish( );
 }
 
+int VStringConfigControl::getType() const { return CONFIG_ITEM_STRING; }
+
 void StringConfigControl::finish()
 {
     text->setText( qfu(p_item->value.psz) );
@@ -917,6 +920,8 @@ int IntegerConfigControl::getValue() const
     return spin->value();
 }
 
+int VIntConfigControl::getType() const { return CONFIG_ITEM_INTEGER; }
+
 /********* Integer range **********/
 IntegerRangeConfigControl::IntegerRangeConfigControl( vlc_object_t *_p_this,
                                             module_config_t *_p_item,
@@ -1122,6 +1127,8 @@ BoolConfigControl::BoolConfigControl( vlc_object_t *_p_this,
     finish();
 }
 
+int BoolConfigControl::getType() const { return CONFIG_ITEM_BOOL; }
+
 void BoolConfigControl::finish()
 {
     checkbox->setChecked( p_item->value.i );
@@ -1242,6 +1249,8 @@ FloatConfigControl::FloatConfigControl( vlc_object_t *_p_this,
     }
 }
 
+int VFloatConfigControl::getType() const { return CONFIG_ITEM_FLOAT; }
+
 FloatConfigControl::FloatConfigControl( vlc_object_t *_p_this,
                                         module_config_t *_p_item,
                                         QLabel *_label,
@@ -1346,6 +1355,8 @@ KeySelectorControl::KeySelectorControl( vlc_object_t *_p_this,
              this, filter( const QString& ) );
 }
 
+int KeySelectorControl::getType() const { return CONFIG_ITEM_KEY; }
+
 void KeySelectorControl::finish()
 {
     if( label && p_item->psz_longtext )
@@ -1617,4 +1628,3 @@ void KeyInputDialog::wheelEvent( QWheelEvent *e )
     checkForConflicts( i_vlck );
     keyValue = i_vlck;
 }
-
index 485210ae2e57d687b503350c67e3ed13d02b3289..9c260d251bafd2a93ff770279aff4a03b20e4783 100644 (file)
@@ -124,7 +124,7 @@ public:
     VIntConfigControl( vlc_object_t *a, module_config_t *b ) :
                 ConfigControl(a,b) {};
     virtual int getValue() const = 0;
-    virtual int getType() const { return CONFIG_ITEM_INTEGER; }
+    virtual int getType() const;
     virtual void doApply();
 };
 
@@ -203,7 +203,7 @@ public:
     virtual int getValue() const;
     virtual void show() { checkbox->show(); }
     virtual void hide() { checkbox->hide(); }
-    virtual int getType() const { return CONFIG_ITEM_BOOL; }
+    virtual int getType() const;
 private:
     QAbstractButton *checkbox;
     void finish();
@@ -241,7 +241,7 @@ public:
     VFloatConfigControl( vlc_object_t *a, module_config_t *b ) :
                 ConfigControl(a,b) {};
     virtual float getValue() const = 0;
-    virtual int getType() const { return CONFIG_ITEM_FLOAT; }
+    virtual int getType() const;
     virtual void doApply();
 };
 
@@ -289,7 +289,7 @@ public:
     VStringConfigControl( vlc_object_t *a, module_config_t *b ) :
                 ConfigControl(a,b) {};
     virtual QString getValue() const = 0;
-    virtual int getType() const { return CONFIG_ITEM_STRING; }
+    virtual int getType() const;
     virtual void doApply();
 };
 
@@ -454,7 +454,7 @@ class KeySelectorControl : public ConfigControl
 public:
     KeySelectorControl( vlc_object_t *, module_config_t *, QWidget *,
                         QGridLayout*, int );
-    virtual int getType() const { return CONFIG_ITEM_KEY; }
+    virtual int getType() const;
     virtual void hide() { table->hide(); if( label ) label->hide(); }
     virtual void show() { table->show(); if( label ) label->show(); }
     virtual void doApply();
index 8ddfea59653577920e390a9a41757803b98916cb..258359934eedaae978089adfc8e2d7d6fea43076 100644 (file)
@@ -30,6 +30,7 @@
 #include <vlc_keys.h>
 #include <vlc_charset.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 
 #include "vlc_getopt.h"
 
index 8c694d7b81bd9c0be57c29bf953ea857ff26c38b..f20d0291488b7993a160099797133a0c763ae52e 100644 (file)
@@ -43,20 +43,12 @@ void config_UnsortConfig (void);
 
 #define CONFIG_CLASS(x) ((x) & ~0x1F)
 
-static inline bool IsConfigStringType(unsigned type)
-{
-    return (type & CONFIG_ITEM_STRING) != 0;
-}
-
-static inline bool IsConfigIntegerType (int type)
-{
-    return (type & CONFIG_ITEM_INTEGER) != 0;
-}
-
-static inline bool IsConfigFloatType (int type)
-{
-    return type == CONFIG_ITEM_FLOAT;
-}
+#define IsConfigStringType(type) \
+    (((type) & CONFIG_ITEM_STRING) != 0)
+#define IsConfigIntegerType(type) \
+    (((type) & CONFIG_ITEM_INTEGER) != 0)
+#define IsConfigFloatType(type) \
+    ((type) == CONFIG_ITEM_FLOAT)
 
 extern vlc_rwlock_t config_lock;
 
index cbef20c96c2f9805fb424edf3b001dddb5af8922..ddc688a025e5b161028a50ac4e3b01d202beacaa 100644 (file)
@@ -28,6 +28,7 @@
 #include <vlc_common.h>
 #include <vlc_keys.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 
 #include "vlc_configuration.h"
 
index 6eac3f90e9bdaf6ef07110857b2be699dc281c0e..121d214e35bde04c3c9d6c45ce2fdc2c3bf11d2d 100644 (file)
@@ -45,6 +45,7 @@
 #include <vlc_fs.h>
 #include <vlc_keys.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 
 #include "configuration.h"
 #include "modules/modules.h"
index 5791d809f16acca081b7adbc37a7be9541b1cd2b..9b73029ab5dd577beb72e7c607d4ca9f88cd1039 100644 (file)
 # include "config.h"
 #endif
 
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
 #include <vlc_common.h>
 #include <vlc_charset.h>
 #include <vlc_modules.h>
+#include <vlc_plugin.h>
 #include "modules/modules.h"
 #include "config/configuration.h"
 #include "libvlc.h"
 
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
 #if defined( WIN32 ) && !defined( UNDER_CE )
 static void ShowConsole (void);
 static void PauseConsole (void);