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/skin/widgets/textbase.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/skin/widgets/textbase.h')
-rw-r--r-- | Src/Wasabi/api/skin/widgets/textbase.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/Src/Wasabi/api/skin/widgets/textbase.h b/Src/Wasabi/api/skin/widgets/textbase.h new file mode 100644 index 00000000..e143cf37 --- /dev/null +++ b/Src/Wasabi/api/skin/widgets/textbase.h @@ -0,0 +1,95 @@ +#ifndef NULLSOFT_WASABI_TEXTBASE_H +#define NULLSOFT_WASABI_TEXTBASE_H + +#include <api/wnd/wndclass/bufferpaintwnd.h> +#include <tataki/color/filteredcolor.h> +#include <tataki/color/skinclr.h> +#include <bfc/string/StringW.h> + +#define TEXTBASE_PARENT BufferPaintWnd + +class TextBase : public TEXTBASE_PARENT, public SkinCallbackI +{ +public: + TextBase(); + virtual ~TextBase(); + + ARGB32 GetColor(int alt=0); + void GetFontInfo(Wasabi::FontInfo *_font, int alt=0); + + void SetTextColor(ARGB32 c, int alt=0); + void SetFontSize(const wchar_t *strvalue, int alt=0); + void SetFont(const wchar_t *name, int alt=0); + void SetAntialias(int a, int alt=0); + void SetFontAlign(int al); + virtual void setDblClickParam(const wchar_t *p); + virtual const wchar_t *getDblClickParam(); + virtual void setRClickParam(const wchar_t *p); + virtual const wchar_t *getRClickParam(); +protected: + /* Virtual methods to override */ + virtual void invalidateTextBuffer()=0; + + +/*static */void CreateXMLParameters(int master_handle); +private: + StringW dblClickAction; + StringW rClickAction; + + /* Font Info */ + FilteredColor color[2]; + SkinColor scolor[2]; + int color_mode[2]; + StringW font[2]; + int bold[2]; + int italic[2]; + int antialias[2]; + int align; + +protected: + int fontsize[2]; + int lpadding, rpadding; + int grab; + +private: + /* XML Parameters */ + enum + { + TEXTBASE_SETCOLOR, + TEXTBASE_SETALTCOLOR, + TEXTBASE_SETFONTSIZE, + TEXTBASE_SETFONT, + TEXTBASE_SETALTFONT, + TEXTBASE_SETALTFONTSIZE, + TEXTBASE_SETBOLD, + TEXTBASE_SETITALIC, + TEXTBASE_SETALTBOLD, + TEXTBASE_SETALTITALIC, + TEXTBASE_SETANTIALIAS, + TEXTBASE_SETALTANTIALIAS, + TEXTBASE_SETDBLCLKACTION, + TEXTBASE_SETRCLKACTION, + TEXTBASE_SETALIGN, + TEXTBASE_SETLPADDING, + TEXTBASE_SETRPADDING, + TEXTBASE_RCLICKPARAM, + TEXTBASE_DBLCLICKPARAM, + + + }; + static XMLParamPair params[]; + int xuihandle; + StringW dblclickparam; + StringW rclickparam; +protected: + /* Methods that TextBase overrides */ + int setXuiParam(int _xuihandle, int attrid, const wchar_t *name, const wchar_t *strval); + int onInit(); + int skincb_onColorThemeChanged(const wchar_t *newcolortheme); + int onLeftButtonDblClk(int x, int y); + int onRightButtonDown(int x, int y); + virtual int wantAutoContextMenu() { return rClickAction.isempty(); } + +}; + +#endif
\ No newline at end of file |