aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/wnd/ifc_bitmap.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/Wasabi/api/wnd/ifc_bitmap.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Wasabi/api/wnd/ifc_bitmap.h')
-rw-r--r--Src/Wasabi/api/wnd/ifc_bitmap.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/Src/Wasabi/api/wnd/ifc_bitmap.h b/Src/Wasabi/api/wnd/ifc_bitmap.h
new file mode 100644
index 00000000..560d13a4
--- /dev/null
+++ b/Src/Wasabi/api/wnd/ifc_bitmap.h
@@ -0,0 +1,51 @@
+#ifndef NULLSOFT_WASABI_IFC_BITMAP_H
+#define NULLSOFT_WASABI_IFC_BITMAP_H
+
+#include <bfc/dispatch.h>
+#include <bfc/platform/types.h>
+#include <bfc/platform/platform.h>
+
+#warning move this typedef to bfc/platform/platform.h
+#ifdef _WIN32
+typedef HBITMAP OSBITMAPHANDLE;
+#elif defined(__APPLE__)
+typedef CGImageRef OSBITMAPHANDLE;
+#else
+#error port me
+#endif
+
+class ifc_bitmap : public Dispatchable
+{
+protected:
+ ifc_bitmap() {}
+ ~ifc_bitmap() {}
+public:
+ OSBITMAPHANDLE GetBitmap();
+ uint8_t *GetBits();
+ void UpdateBits(uint8_t *bits); // call to signify that you've modified the underlying bits.
+
+ DISPATCH_CODES
+ {
+ IFC_BITMAP_GETBITMAP = 10,
+ IFC_BITMAP_GETBITS = 20,
+ IFC_BITMAP_UPDATEBITS = 30,
+ };
+};
+
+
+inline OSBITMAPHANDLE ifc_bitmap::GetBitmap()
+{
+ return _call(IFC_BITMAP_GETBITMAP, (OSBITMAPHANDLE)0);
+}
+
+inline uint8_t *ifc_bitmap::GetBits()
+{
+ return _call(IFC_BITMAP_GETBITS, (uint8_t *)0);
+}
+
+inline void ifc_bitmap::UpdateBits(uint8_t *bits)
+{
+ _voidcall(IFC_BITMAP_UPDATEBITS, bits);
+}
+
+#endif \ No newline at end of file