Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef __I_CURSOR_CONTROL_H_INCLUDED__
00006 #define __I_CURSOR_CONTROL_H_INCLUDED__
00007
00008 #include "IReferenceCounted.h"
00009 #include "position2d.h"
00010 #include "rect.h"
00011
00012 namespace irr
00013 {
00014 namespace gui
00015 {
00016
00017 class IGUISpriteBank;
00018
00020 enum ECURSOR_ICON
00021 {
00022
00023 ECI_NORMAL,
00024 ECI_CROSS,
00025 ECI_HAND,
00026 ECI_HELP,
00027 ECI_IBEAM,
00028 ECI_NO,
00029 ECI_WAIT,
00030 ECI_SIZEALL,
00031 ECI_SIZENESW,
00032 ECI_SIZENWSE,
00033 ECI_SIZENS,
00034 ECI_SIZEWE,
00035 ECI_UP,
00036
00037
00038
00039
00040
00041 ECI_COUNT
00042 };
00043
00045 const c8* const GUICursorIconNames[ECI_COUNT+1] =
00046 {
00047 "normal",
00048 "cross",
00049 "hand",
00050 "help",
00051 "ibeam",
00052 "no",
00053 "wait",
00054 "sizeall",
00055 "sizenesw",
00056 "sizenwse",
00057 "sizens",
00058 "sizewe",
00059 "sizeup",
00060 0
00061 };
00062
00064 struct SCursorSprite
00065 {
00066 SCursorSprite()
00067 : SpriteBank(0), SpriteId(-1)
00068 {
00069 }
00070
00071 SCursorSprite( gui::IGUISpriteBank * spriteBank, s32 spriteId, const core::position2d<s32> &hotspot=(core::position2d<s32>(0,0)) )
00072 : SpriteBank(spriteBank), SpriteId(spriteId), HotSpot(hotspot)
00073 {
00074 }
00075
00076 IGUISpriteBank * SpriteBank;
00077 s32 SpriteId;
00078 core::position2d<s32> HotSpot;
00079 };
00080
00082 enum ECURSOR_PLATFORM_BEHAVIOR
00083 {
00085 ECPB_NONE = 0,
00086
00088
00093 ECPB_X11_CACHE_UPDATES = 1
00094 };
00095
00097 class ICursorControl : public virtual IReferenceCounted
00098 {
00099 public:
00100
00102
00104 virtual void setVisible(bool visible) = 0;
00105
00107
00108 virtual bool isVisible() const = 0;
00109
00111
00116 virtual void setPosition(const core::position2d<f32> &pos) = 0;
00117
00119
00125 virtual void setPosition(f32 x, f32 y) = 0;
00126
00128
00129 virtual void setPosition(const core::position2d<s32> &pos) = 0;
00130
00132
00134 virtual void setPosition(s32 x, s32 y) = 0;
00135
00137
00139 virtual const core::position2d<s32>& getPosition() = 0;
00140
00142
00146 virtual core::position2d<f32> getRelativePosition() = 0;
00147
00149
00154 virtual void setReferenceRect(core::rect<s32>* rect=0) = 0;
00155
00156
00158
00159 virtual void setActiveIcon(ECURSOR_ICON iconId) {}
00160
00162 virtual ECURSOR_ICON getActiveIcon() const { return gui::ECI_NORMAL; }
00163
00165
00166 virtual ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) { return gui::ECI_NORMAL; }
00167
00169
00173 virtual void changeIcon(ECURSOR_ICON iconId, const gui::SCursorSprite& sprite) {}
00174
00176 virtual core::dimension2di getSupportedIconSize() const { return core::dimension2di(0,0); }
00177
00179 virtual void setPlatformBehavior(ECURSOR_PLATFORM_BEHAVIOR behavior) {}
00180
00182
00184 virtual ECURSOR_PLATFORM_BEHAVIOR getPlatformBehavior() const { return ECPB_NONE; }
00185 };
00186
00187
00188 }
00189 }
00190
00191 #endif
00192