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/Wasabi/api/wndmgr/guistatuscb.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/Wasabi/api/wndmgr/guistatuscb.h')
-rw-r--r-- | Src/Wasabi/api/wndmgr/guistatuscb.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Src/Wasabi/api/wndmgr/guistatuscb.h b/Src/Wasabi/api/wndmgr/guistatuscb.h new file mode 100644 index 00000000..f35a4d9f --- /dev/null +++ b/Src/Wasabi/api/wndmgr/guistatuscb.h @@ -0,0 +1,83 @@ +#ifndef _GUISTATUSCB_H +#define _GUISTATUSCB_H + +#include <bfc/dispatch.h> + +class AppCmds; +class ifc_dependent; + +class GuiStatusCallback : public Dispatchable { + public: + void onSetStatusText(const wchar_t *text, int overlay); + void onAddAppCmds(AppCmds *commands); + void onRemoveAppCmds(AppCmds *commands); + void pushCompleted(int max=100); + void incCompleted(int add=1); + void setCompleted(int pos); + void popCompleted(); + + api_dependent *status_getDependencyPtr(); + enum { + STATUS_ONSETTEXT = 101, + STATUS_GETDEP = 200, + STATUS_ADDCTXTCMDS = 300, + STATUS_REMCTXTCMDS = 400, + STATUS_PUSHCOMPLETED = 500, + STATUS_INCCOMPLETED = 600, + STATUS_SETCOMPLETED = 700, + STATUS_POPCOMPLETED = 800, + }; +}; + +inline void GuiStatusCallback ::onSetStatusText(const wchar_t *text, int overlay) { + _voidcall(STATUS_ONSETTEXT, text, overlay); +} + +inline api_dependent *GuiStatusCallback ::status_getDependencyPtr() { + return _call(STATUS_GETDEP, (api_dependent *)NULL); +} + +inline void GuiStatusCallback ::onAddAppCmds(AppCmds *commands) { + _voidcall(STATUS_ADDCTXTCMDS, commands); +} + +inline void GuiStatusCallback ::onRemoveAppCmds(AppCmds *commands) { + _voidcall(STATUS_REMCTXTCMDS, commands); +} + +inline +void GuiStatusCallback::pushCompleted(int max) { + _voidcall(STATUS_PUSHCOMPLETED, max); +} + +inline +void GuiStatusCallback::incCompleted(int add) { + _voidcall(STATUS_INCCOMPLETED, add); +} + +inline +void GuiStatusCallback::setCompleted(int pos) { + _voidcall(STATUS_SETCOMPLETED, pos); +} + +inline +void GuiStatusCallback::popCompleted() { + _voidcall(STATUS_POPCOMPLETED); +} + +class GuiStatusCallbackI : public GuiStatusCallback { + public: + virtual void onSetStatusText(const wchar_t *text, int overlay)=0; + virtual api_dependent *status_getDependencyPtr()=0; + virtual void onAddAppCmds(AppCmds *commands)=0; + virtual void onRemoveAppCmds(AppCmds *commands)=0; + virtual void pushCompleted(int max=100)=0; + virtual void incCompleted(int add=1)=0; + virtual void setCompleted(int pos)=0; + virtual void popCompleted()=0; + + protected: + RECVS_DISPATCH; +}; + +#endif |