Commit Graph

175 Commits

Author SHA1 Message Date
Steve Lhomme 644dc6eba5 vlc_plugin: define config types based on the stored typed
Only a few values correspond to a type when using the CONFIG_CLASS mask.
2023-12-03 08:36:03 +00:00
Johannes Kauffmann 8dc0ae1205 Remove extra semicolons around vlc_module macro's 2023-04-27 06:24:26 +00:00
Steve Lhomme b437cad568 vlc_plugin: make header standalone
This can be useful for code that generates static symbols.
We don't need to include `vlc_common.h` anymore.
2023-04-20 15:55:41 +00:00
Maxim Biro faf8b85ac3 plugin: add HTML help
HTML help that is shown instead of the plain help text where appropriate
and supported by the interface. The command-line help output and the Qt
GUI plugin tooltips show the plain help text, while the Qt GUI plugin
preferences page displays the HTML help, if available, falling back to
displaying the plain help otherwise.

Allows to present the help text in a more structured and expressive way.
Also useful for out-of-tree plugins, in case they want to link to
plugin's home page, bug tracker, donation page, etc.

For the supported HTML subset, see
https://doc.qt.io/qt-6/richtext-html-subset.html

Fixes #27798
2023-03-27 12:11:10 +00:00
Steve Lhomme 0afcc30adb vlc_plugin: add a macro to declare module entries
This is the same type as vlc_plugin_cb but declaring a variable with a function
type and declaring and actual function is not the same.
2023-03-07 08:23:15 +00:00
Steve Lhomme b7340959b4 vlc_plugin: add macros to define custom entry points
This is usually the way tests with modules do it.
2023-03-07 08:23:15 +00:00
Steve Lhomme 41d6cb4695 plugin: define MODULE_STRING as the string version of MODULE_NAME
If MODULE_STRING is not defined just use a default name.
If MODULE_NAME is not set either it's a dynamic plugin and the MODULE_STRING
should be set, or it's an internal test and we don't care about the name.
2023-03-03 14:13:29 +00:00
Steve Lhomme 722c0fa260 plugins: rename __PLUGIN__ to VLC_DYNAMIC_PLUGIN
We should not use names stating with underscore for our internal code.
This is almost the same name used in the makefile for more coherence.

HAVE_DYNAMIC_PLUGINS already exists in the core. We keep a different
name to separate the 2 usages. For now they mean exactly the same thing.
2023-03-03 14:13:29 +00:00
Steve Lhomme a8ad45a9a2 vlc_plugin: make vlc_plugin_cb public
This will avoid defining it in all test files. They all include vlc_plugin.h
because they need vlc_set_cb.
2023-03-03 14:13:29 +00:00
Steve Lhomme 352ad101b3 rename __LIBVLC__ to LIBVLC_INTERNAL_
define names starting with 2 underscore are reserved.

https://devblogs.microsoft.com/oldnewthing/20230109-00/?p=107685
2023-01-17 10:37:49 +00:00
Lyndon Brown 17604330bf plugins: use helper to workaround missing c++ language feature support
The previous commit made use of compound literals. MSVC was identified
as not yet having support for compound literals in C++ though, which is
considered a blocking problem to their use. This work around was
suggested by Alexandre Janniaux.
2022-02-03 16:14:17 +00:00
Lyndon Brown e8f6a59569 plugins: add type strictness to plugin descriptor macros
I.e. check the type of the values provided, rather than just blindly
casting, and thus allow mistakes to get caught with compilation errors.

I once lost some hours tracking down the cause of a crash that this type
strictness would have prevented.

Note, now that `change_string_list()` and `change_integer_list()` use type
strictness for the value and label arrays to help make sure they're the
right types, we can more safely make use of `ARRAY_SIZE()` to more cleanly
get the length.

`set_callback[s]()` is excluded from this for obvious reasons.

I've taken the opportunity to ditch remaining use of Hungarian notation
and to fix a param name that should be singular rather than plural
(psz_caps on `add_module[_list]()`.

Re-implemented using compound literals upon excellent suggestion by
Alexandre Janniaux.
2022-02-03 16:14:17 +00:00
Lyndon Brown 44318673ac modules: add type strictness to cat/subcat types
with cats and subcats both being plain integers it's very easy to
make a mistake mixing them up, storing one in a variable for another,
or passing the wrong variable to the wrong function.

switching to enums adds type strictness to help catch such mistakes.

in switching to enums there is of course additional opportunity to
exploit sequential numbering to achieve certain optimisations that
can be gained from this, but that it not done here. here we're simply
interested in catching mistakes through type strictness.

note that we simply retain the same cat/subcat numbering as before
here.
2022-01-20 07:45:45 +00:00
Lyndon Brown 79d852d5be purge remaining set_category() artifacts
see e967f81f6a.
2021-12-20 09:45:01 +00:00
Rémi Denis-Courmont 2ee36c2f8d modules: use opaque structure type in descriptors
No effective functional or ABI changes.
2021-11-06 16:34:53 +00:00
Lyndon Brown aef8cbfe19 config: add unknown cat/subcat defines
for use in unknown/unset/invalid situations.
2021-06-30 10:48:32 +00:00
Lyndon Brown 3340d3cc0a config: move config test macros
i have a use for `CONFIG_CLASS` now in the qt prefs code, and elsewhere in
later work.

the other test macros may be useful to have publicly for preference
interface code so were moved also, and besides, having them all in one
place makes finding them and maintaining them easier. there's no harm in
exposing them to plugins.
2021-06-11 09:11:50 +00:00
Romain Vimont 3716a7da5b config: remove remaining "advanced" flags
The config "advanced" flag was unused and has been removed by
6a7a137f7b.

It has been removed from many add_*() macros, but not all. Remove it
from the remaining macros.
2021-06-06 08:42:50 +00:00
Lyndon Brown 3a82d263b5 plugins: privatise `add_category_hint()`
this is to be used exclusively by the core. mistaken use in other
modules results in issues in help output, as just fixed for the mp4
module.
2021-05-29 19:18:06 +01:00
Lyndon Brown c5f0415252 plugins: purge now unused `add_usage_hint()`
cdda and vcd were the only users, both have now been switched to use
`set_help()`.
2021-05-29 19:18:06 +01:00
Lyndon Brown fa9432f048 standardise the hidden options hack
(add common defines for specifying hidden category/subcategory)
2021-05-05 11:09:32 +00:00
Hugo Beauzée-Luyssen b3c69dd2c9 vlc_plugin.h: Declare vlc_module_name as an EXTERN_SYMBOL
We don't want the symbol to be mangled when building C++
2020-12-11 11:44:10 +01:00
Hugo Beauzée-Luyssen 47a5163805 vlc_plugin.h: Move the EXTERN_SYMBOL definition higher in the file
No functional change
2020-12-11 11:44:10 +01:00
Hugo Beauzée-Luyssen 9440b0af66 vlc_plugin.h: Cast the deactivate function pointer
Instead of initializing a function pointer using a compound literal,
which might not compile in C++
2020-12-04 11:09:06 +01:00
Lyndon Brown bc9567ccf1 purge useless audio-misc subcat
there are no in-tree modules using this subcat that actually have any
options; this moves the few that do reference it (filter/mixer modules)
to audio-filter (making no difference since no options) and removes the
unneeded subcat.

note that in the previous commit I restored an add_subcategory() call for
it to the core option set, missing since 2005, to fix organisation of
any options that may be associated with it, but since no in-tree modules
actually place any options under it, it means that there's an empty page
for it in the preferences which isn't ideal, so here we just ditch it.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2020-09-26 09:16:03 +02:00
Rémi Denis-Courmont efcc9a94c6 modules: check deactivation callback type 2019-07-25 19:45:44 +03:00
Rémi Denis-Courmont d83f26f671 plugin: remove dead enum callback code 2019-07-19 19:21:28 +03:00
Rémi Denis-Courmont 32bab3ce06 plugin: move config choice enum callbacks
...out of the descriptor, to some new place with better type safety.
2019-07-19 19:14:35 +03:00
Rémi Denis-Courmont f5461b212a plugin: drop version suffix in exported symbols
This is no longer needed.
2019-07-19 19:14:35 +03:00
Rémi Denis-Courmont 23a62109b7 plugin: add meta-data for plugin API version
This is a little bit more flexible than forcing a specific entry point
name dependent on the version.
2019-07-19 19:14:35 +03:00
Rémi Denis-Courmont cd7498d0a8 plugin: fix macro namespace 2019-07-18 22:25:16 +03:00
Rémi Denis-Courmont de772bf48b plugin: add set_callback() macro
This avoids registering NULL as a deactivate callback.
2019-07-18 18:46:12 +03:00
Rémi Denis-Courmont 4d94c12d8b plugin: bump version 2019-02-19 18:13:31 +02:00
Rémi Denis-Courmont 199d6f9dae config: remove advanced from add_key() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont 1bbbe098ff config: remove advanced from add_rgb() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont ef7feb729c config: remove advanced from add_module.*_cat() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont c86436596e config: remove advanced from add_module_list() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont e66e6b6b03 config: remove advanced from add_module() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont e51a229b1f config: remove advanced from add_font() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont 3a074f79b3 config: remove advanced from add_directory() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont 0e9e4feb7c config: remove advanced from add_savefile() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont ebaa32f561 config: remove advanced from add_loadfile() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont 776811e9f2 config: remove advanced from add_password() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont 85a0ba10f7 config: remove advanced from add_category_hint() 2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont 6a7a137f7b config: remove advanced flag
Except for the command line help, this has been unused for a decade or
so.
2018-04-24 21:36:45 +03:00
Rémi Denis-Courmont 8cb6d92a55 Bump plugin ABI 2018-04-06 20:45:10 +03:00
Rémi Denis-Courmont ff9badf5b8 Bump plugin ABI 2018-02-28 20:54:03 +02:00
Rémi Denis-Courmont 118d873487 Bump plugin ABI 2018-02-26 21:55:56 +02:00
Rémi Denis-Courmont 8f6ff46bec demux: provide full URL instead of access name (refs #18504) 2017-12-02 23:23:49 +02:00
Rémi Denis-Courmont e46fd2bfa6 messages: resolve module name at link-time
Within all the introduced static libraries, the module cannot be known
at compilation time. This moves the module name from a compilation
constant to a link time constant string symbol. That way, the same
compiled object within a static library can use a different and correct
module name depending on which plugin it is linked into.

The symbol is hidden so it does not leak between shared objects. For
non-plugins shared libraries (vlccore, vlc, vlc_pulse and
vlc_xcb_events) the module name must be defined manually, unless the
library does not use msg_* macros at all (vlc_vdpau).
2017-11-18 21:41:26 +02:00