iutil/csinput.h Source File (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

iutil/csinput.h
Go to the documentation of this file.

    00001 /*
    00002     Crystal Space input library
    00003     Copyright (C) 1998,2000 by Jorrit Tyberghein
    00004     Written by Andrew Zabolotny <bit@eltech.ru>
    00005
    00006     This library is free software; you can redistribute it and/or
    00007     modify it under the terms of the GNU Library General Public
    00008     License as published by the Free Software Foundation; either
    00009     version 2 of the License, or (at your option) any later version.
    00010
    00011     This library is distributed in the hope that it will be useful,
    00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00014     Library General Public License for more details.
    00015
    00016     You should have received a copy of the GNU Library General Public
    00017     License along with this library; if not, write to the Free
    00018     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00019 */
    00020
    00021 #ifndef __CS_IUTIL_STDINPUT_H__
    00022 #define __CS_IUTIL_STDINPUT_H__
    00023
    00036 #include "csutil/scf.h"
    00037 #include "iutil/event.h"
    00038 #include "csutil/csunicode.h"
    00039
    00043 enum csKeyComposeResult
    00044 {
    00046   csComposeNoChar = -1,
    00048   csComposeNormalChar,
    00050   csComposeComposedChar,
    00055   csComposeUncomposeable
    00056 };
    00057
    00061 struct iKeyComposer : public virtual iBase
    00062 {
    00063   SCF_INTERFACE(iKeyComposer, 2,0,0);
    00078   virtual csKeyComposeResult HandleKey (const csKeyEventData& keyEventData,
    00079     utf32_char* buf, size_t bufChars, int* resultChars = 0) = 0;
    00085   virtual void ResetState () = 0;
    00086 };
    00087
    00088
    00112 struct iKeyboardDriver : public virtual iBase
    00113 {
    00114   SCF_INTERFACE(iKeyboardDriver, 2,0,1);
    00119   virtual void Reset () = 0;
    00120
    00131   virtual void DoKey (utf32_char codeRaw, utf32_char codeCooked, bool iDown,
    00132     bool autoRepeat = false, csKeyCharType charType = csKeyCharTypeNormal) = 0;
    00133
    00138   virtual bool GetKeyState (utf32_char codeRaw) const = 0;
    00139
    00143   virtual uint32 GetModifierState (utf32_char codeRaw) const = 0;
    00144
    00151   virtual csPtr<iKeyComposer> CreateKeyComposer () = 0;
    00152
    00157   virtual csEventError SynthesizeCooked (iEvent *) = 0;
    00158
    00162   virtual const csKeyModifiers& GetModifiersState () const = 0;
    00163
    00164 };
    00165
    00166
    00185 struct iMouseDriver : public virtual iBase
    00186 {
    00187   SCF_INTERFACE(iMouseDriver, 2,0,0);
    00189   virtual void SetDoubleClickTime (int iTime, size_t iDist) = 0;
    00190
    00195   virtual void Reset () = 0;
    00196
    00198   virtual int GetLastX (uint number = 0) const = 0;
    00200   virtual int GetLastY (uint number = 0) const = 0;
    00202   virtual int GetLast (uint n, uint a) const = 0;
    00204   virtual const int32 *GetLast (uint n) const = 0;
    00206   virtual bool GetLastButton (uint number, int button) const = 0;
    00207   virtual bool GetLastButton (int button) const = 0;
    00208
    00213   virtual void DoButton (uint number, int button, bool down,
    00214     const int32 *axes, uint numAxes) = 0;
    00215   virtual void DoButton (int button, bool down, int x, int y) = 0;
    00217   virtual void DoMotion (uint number, const int32 *axes, uint numAxes) = 0;
    00218   virtual void DoMotion (int x, int y) = 0;
    00219 };
    00220
    00237 struct iJoystickDriver : public virtual iBase
    00238 {
    00239   SCF_INTERFACE(iJoystickDriver, 2,1,0);
    00244   virtual void Reset () = 0;
    00245
    00247   virtual const int32 *GetLast (uint number) const = 0;
    00249   virtual int GetLast (uint number, uint axis) const = 0;
    00250
    00255   virtual bool GetLastButton (uint number, int button) const = 0;
    00256
    00261   virtual void DoButton (uint number, int button, bool down,
    00262     const int32 *axes, uint numAxes) = 0;
    00264   virtual void DoMotion (uint number, const int32 *axes, uint nunmAxes) = 0;
    00265 };
    00266
    00269 #endif // __CS_IUTIL_STDINPUT_H__