aboutsummaryrefslogtreecommitdiff
path: root/Src/nu/DialogSkinner.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/nu/DialogSkinner.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/nu/DialogSkinner.h')
-rw-r--r--Src/nu/DialogSkinner.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/Src/nu/DialogSkinner.h b/Src/nu/DialogSkinner.h
new file mode 100644
index 00000000..425f2108
--- /dev/null
+++ b/Src/nu/DialogSkinner.h
@@ -0,0 +1,78 @@
+#ifndef DIALOGSKINNERH
+#define DIALOGSKINNERH
+
+#include "MediaLibraryInterface.h"
+#include "../winamp/wa_dlg.h"
+
+COLORREF GetHTMLColor( int color );
+
+class DialogSkinner
+{
+ typedef HBITMAP( *BitmapFunc )( );
+ typedef int ( *ColorFunc )( int idx ); // pass this an index, returns a RGB value (passing 0 or > 3 returns NULL)
+ typedef int ( *HandleFunc )( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
+ typedef void ( *DrawFunc )( HWND hwndDlg, int *tab, int tabsize ); // each entry in tab would be the id | DCW_*
+
+public:
+ DialogSkinner()
+ {}
+
+ int Color( int index )
+ {
+ if ( !color )
+ color = (ColorFunc)mediaLibrary.GetWADLGFunc( 1 );
+
+ return color( index );
+ }
+
+ RGBQUAD GetRGB( int index )
+ {
+ COLORREF color = Color( index );
+
+ RGBQUAD rgb;
+ rgb.rgbReserved = 0;
+ rgb.rgbBlue = GetBValue( color );
+ rgb.rgbGreen = GetGValue( color );
+ rgb.rgbRed = GetRValue( color );
+
+ return rgb;
+ }
+
+ INT_PTR Handle( HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam )
+ {
+ if ( !handle )
+ handle = (HandleFunc)mediaLibrary.GetWADLGFunc( 2 );
+
+ return handle( dlg, msg, wParam, lParam );
+ }
+
+ void Draw( HWND dlg, int *tab, int tabSize )
+ {
+ if ( !draw )
+ draw = (DrawFunc)mediaLibrary.GetWADLGFunc( 3 );
+
+ draw( dlg, tab, tabSize );
+ }
+
+ HFONT GetFont()
+ {
+ return (HFONT)mediaLibrary.GetWADLGFunc( 66 );
+ }
+
+ HBITMAP GetBitmap()
+ {
+ if ( !bitmap )
+ bitmap = (BitmapFunc)mediaLibrary.GetWADLGFunc( 4 );
+
+ return bitmap();
+ }
+
+ ColorFunc color = 0;
+ HandleFunc handle = 0;
+ DrawFunc draw = 0;
+ BitmapFunc bitmap = 0;
+};
+
+extern DialogSkinner dialogSkinner;
+
+#endif