This is in preparation for the new Source Engine plugin which will add a few common functions.
This commit also improves the functions arguments so that they are passed by reference and marked as const (when possible).
A new data type called procid_t is created, intended to be a replacement for pid_t (Linux) and DWORD (Windows).
This commit removes the architecture-specific headers, by keeping only the OS-specific ones.
The different headers were needed to keep the legacy Windows header, after we created the "procptr32_t" (4 bytes) and "procptr64_t" (8 bytes) variables.
We created these variables because the "peekProc" functions read as many bytes as the variable can hold. A pointer is 4 bytes on 32 bit platforms and 8 bytes on 64 bit ones.
Now there's a new variable, called "procptr_t" and with a size of 8 bytes (unsigned long long).
We had a "peekProc" template function which returned the value stored at the specified memory address, but it has been used only to read pointers so far.
Since we needed a new function that checks the process architecture and sets the correct size of the memory to read, I decided to "recycle" it.
This allows plugins to use MUMBLE_PLUGIN_EXPORT
instead of __declspec(dllexport) -- but get the
same behavior on MSVC/Windows.
This is part of the effort to allow Windows PA
plugins to work with Wine games on Linux.
The mumble_plugin.h header is used in more places than on Windows,
but the HWND type is Windows-specific.
This has caused problems in the past, forcing all users of mumble_plugin.h
to define a fake HWND type.
We recently began passing 0 to the about() and config() plugin functions
unconditionally -- so they are practically unused.
Therefore, it makes no sense to use the HWND type anymore.
Because of that, this commit changes the HWND type to void *.
It is ABI compatible with HWND.
If a plugin implements MumblePluginQt, it is a signal to Mumble
that the plugin wishes to use Qt-based about and config dialogs.
The MmublePluginQt interface includes two methods: "about" and
"config".
Mumble will call these methods with a pointer to a QWidget that
is suitable to be the parent for the plugin's about and/or config
dialogs.
The MumblePluginQt interface is only useful for plugins that use Qt.
That, for now, is only the "manual" plugin. In general, plugins can't
really use Qt unless they're very tightly coupled to Mumble.
Add all previous magic values we've used since at least 1.2.0.
(Though I think the MUMBLE_PLUGIN_MAGIC value for MSVS2008 x86
goes back even further!)
This also adds a new magic value for the MSVS2013 x64 ABI, and
a generic default for "unsupported" ABIs.
Unsupported in this context means platforms/ABIs that we aren't
distributing plugins for via the auto-update mechanism. Those
platforms typically only have a single plugin, which is the
"link" plugin distributed with Mumble itself.
Mumble 1.3.0 on Windows will be built with MSVS 2013. That means
that old plugins will no longer load into it (Mumble will crash
if we try), because of C++ ABI differences between MSVS 2010
and MSVS 2013.
To combat this, we switch our plugin magics such that no ABI
mismatches can happen: Old clients will refuse to load new plugins,
and new clients will refuse to load old plugins.
We have a precedent for doing this. See dac82c99 (MSVS 2010 switch-over).