diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Library/ml_wire/service.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Plugins/Library/ml_wire/service.h')
-rw-r--r-- | Src/Plugins/Library/ml_wire/service.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Src/Plugins/Library/ml_wire/service.h b/Src/Plugins/Library/ml_wire/service.h new file mode 100644 index 00000000..ad4e839e --- /dev/null +++ b/Src/Plugins/Library/ml_wire/service.h @@ -0,0 +1,69 @@ +#ifndef NULLSOFT_PODCAST_PLUGIN_SERVICE_HEADER +#define NULLSOFT_PODCAST_PLUGIN_SERVICE_HEADER + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#include <wtypes.h> +#include <atomic> + +#include "../omBrowser/ifc_omservice.h" + +class OmService; +typedef HWND (CALLBACK *SVCWNDCREATEPROC)(HWND /*hParent*/, OmService* /*service*/); + +class OmService : public ifc_omservice +{ +public: + typedef enum + { + flagRoot = 0x00000001, + flagLocal = 0x00000002, + } Flags; + +protected: + OmService( UINT nId ); + ~OmService(); + +public: + static HRESULT CreateRemote( UINT nId, LPCWSTR pszName, LPCWSTR pszIcon, LPCWSTR pszUrl, OmService **instance ); + static HRESULT CreateLocal( UINT nId, LPCWSTR pszName, LPCWSTR pszIcon, SVCWNDCREATEPROC windowCreator, OmService **instance ); + + /* Dispatchable */ + size_t AddRef(); + size_t Release(); + int QueryInterface( GUID interface_guid, void **object ); + + /* ifc_omservice */ + unsigned int GetId(); + HRESULT GetName( wchar_t *pszBuffer, int cchBufferMax ); + HRESULT GetUrl( wchar_t *pszBuffer, int cchBufferMax ); + HRESULT GetExternal( IDispatch **ppDispatch ); + HRESULT GetIcon( wchar_t *pszBuffer, int cchBufferMax ); + + HRESULT SetName( LPCWSTR pszName ); + HRESULT SetUrl( LPCWSTR pszUrl ); + HRESULT SetIcon( LPCWSTR pszIcon ); + + void SetFlags( UINT mask, UINT newFlags ); + UINT GetFlags( void ); + + HRESULT SetWindowCreator( SVCWNDCREATEPROC proc ); + HRESULT GetWindowCreator( SVCWNDCREATEPROC *proc ); + + HRESULT CreateView( HWND hParent, HWND *hView ); + +protected: + RECVS_DISPATCH; + + std::atomic<std::size_t> _ref = 1; + UINT id = 0; + LPWSTR name = NULL; + LPWSTR url = NULL; + SVCWNDCREATEPROC windowCreator = NULL; + LPWSTR icon = NULL; + UINT flags = 0; +}; + +#endif //NULLSOFT_PODCAST_PLUGIN_SERVICE_HEADER |