summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/Mouse.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-01 21:23:39 +0200
committerAki <please@ignore.pl>2022-04-01 21:23:39 +0200
commit3c487c5cd69c53d6fea948643c0a76df03516605 (patch)
tree72730c7b8b26a5ef8fc9a987ec4c16129efd5aac /StarsEx/Mouse.h
parent8f353abd0bfe18baddd8a8250ab7c4f2d1c83a6e (diff)
downloadstarshatter-3c487c5cd69c53d6fea948643c0a76df03516605.zip
starshatter-3c487c5cd69c53d6fea948643c0a76df03516605.tar.gz
starshatter-3c487c5cd69c53d6fea948643c0a76df03516605.tar.bz2
Moved Stars45 to StarsEx
Diffstat (limited to 'StarsEx/Mouse.h')
-rw-r--r--StarsEx/Mouse.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/StarsEx/Mouse.h b/StarsEx/Mouse.h
new file mode 100644
index 0000000..e9f6a18
--- /dev/null
+++ b/StarsEx/Mouse.h
@@ -0,0 +1,74 @@
+/* Starshatter: The Open Source Project
+ Copyright (c) 2021-2022, Starshatter: The Open Source Project Contributors
+ Copyright (c) 2011-2012, Starshatter OpenSource Distribution Contributors
+ Copyright (c) 1997-2006, Destroyer Studios LLC.
+
+ AUTHOR: John DiCamillo
+
+
+ OVERVIEW
+ ========
+ Mouse class
+*/
+
+#ifndef Mouse_h
+#define Mouse_h
+
+#include "Types.h"
+
+// +--------------------------------------------------------------------+
+
+class Bitmap;
+class Screen;
+class Window;
+
+// +--------------------------------------------------------------------+
+
+class Mouse
+{
+ friend LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
+ friend class Game;
+
+public:
+ static const char* TYPENAME() { return "Mouse"; }
+
+ enum CURSOR { ARROW, CROSS, WAIT, NOT, DRAG, USER1, USER2, USER3 };
+ enum HOTSPOT { HOTSPOT_CTR, HOTSPOT_NW };
+
+ static int X() { return x; }
+ static int Y() { return y; }
+ static int LButton() { return l; }
+ static int MButton() { return m; }
+ static int RButton() { return r; }
+ static int Wheel() { return w; }
+
+ static void Paint();
+
+ static void SetCursorPos(int x, int y);
+ static void Show(int s=1);
+ static int SetCursor(CURSOR c);
+ static int LoadCursor(CURSOR c, const char* name, HOTSPOT hs = HOTSPOT_CTR);
+
+ static void Create(Screen* screen);
+ static void Resize(Screen* screen);
+ static void Close();
+
+private:
+ static int show;
+ static int cursor;
+
+ static int x;
+ static int y;
+ static int l;
+ static int m;
+ static int r;
+ static int w;
+
+ static Bitmap* image[8];
+ static int hotspot[8];
+
+ static Window* window;
+};
+
+#endif // Mouse_h
+