00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CS_CSMOUSE_H__
00021 #define __CS_CSMOUSE_H__
00022
00031 #include "ivideo/texture.h"
00032 #include "iengine/texture.h"
00033 #include "csutil/parray.h"
00034 #include "csws/csgfxppl.h"
00035
00036 class csMouse;
00037 struct iEvent;
00038
00042 class csMousePointer
00043 {
00044 private:
00045 friend class csMouse;
00046
00048 int id;
00050 int tX, tY, tW, tH, hsX, hsY;
00052 csMouse *parent;
00053
00054 public:
00056 csMousePointer (csMouse *iParent, int ID,
00057 int x, int y, int w, int h, int hsx, int hsy);
00058
00060 void Draw (int x, int y, csImageArea *&Under);
00061 };
00062
00067 class csMouse
00068 {
00069 private:
00070 friend class csMousePointer;
00071
00073 int MouseX, MouseY;
00075 int VirtualX, VirtualY;
00077 int Visible;
00079 bool invisible;
00081 bool AppFocused;
00083 bool LastVirtual;
00085 csImageArea *Under [MAX_SYNC_PAGES];
00087 csApp *app;
00089 csPDelArray<csMousePointer> Pointers;
00091 csMousePointer *ActiveCursor;
00093 iTextureHandle *Texture;
00094
00095 public:
00097 csMouse (csApp *iApp);
00099 ~csMouse ();
00100
00102 bool HandleEvent (iEvent &Event);
00103
00105 void Move (int x, int y);
00106
00107 void GetPosition (int &x, int &y)
00108 { x = MouseX; y = MouseY; }
00109
00114 void Show ()
00115 { Visible++; }
00116
00118 void Hide ()
00119 { Visible--; }
00120
00122 bool SetCursor (csMouseCursorID ID);
00123
00125 void Setup ();
00126
00128 void SetVirtualPosition (int x, int y)
00129 { VirtualX = x; VirtualY = y; }
00130
00131 private:
00132 friend class csApp;
00133 friend class csGraphicsPipeline;
00134
00136 void Draw (int Page);
00138 void Undraw (int Page);
00139
00141 void NewPointer (const char *id, const char *posdef);
00142
00144 void ClearPointers ();
00145 };
00146
00149 #endif // __CS_CSMOUSE_H__