SO3Engine
Public Member Functions | Protected Member Functions | List of all members
SO3::SBitmapWidget Class Reference

#include <SO3BitmapWidget.h>

Inheritance diagram for SO3::SBitmapWidget:
SO3::SWidget SO3::SData

Public Member Functions

 SBitmapWidget (SScene *targetScene, const std::string &bitmapWidgetName, const int &xPos, const int &yPos, const unsigned short &widgetWidth, const unsigned short &widgetHeight, SViewPort *targetViewport, const unsigned int &widgetZOrder)
 
 SBitmapWidget (SScene *targetScene, const std::string &bitmapWidgetName, const int &xPos, const int &yPos, const unsigned short &widgetWidth, const unsigned short &widgetHeight, SViewPort *targetViewport)
 
 SBitmapWidget (SScene *targetScene, const std::string &bitmapWidgetName, const unsigned short &widgetWidth, const unsigned short &widgetHeight, SMaterial *targetMaterial, const unsigned short &targetTechnique, const unsigned short &targetPass, const unsigned short &targetTextureUnit)
 
void CommonConstructorSequence ()
 
 ~SBitmapWidget ()
 
virtual void LoadURL (const std::string &url)
 
virtual void LoadFile (const std::string &file)
 
void UpdateRawData (PtrObjBitmap scolBitmap)
 
void UpdateRawData (unsigned char *buffer, int width, int height, int bitperpixel)
 
void UpdateRawData (PtrObjBitmap scolBitmap, PtrObjBitmap scolAlphaBitmap)
 
virtual void InjectMouseMove (const int &xPos, const int &yPos, const MouseButtonId &button)
 
virtual void InjectMouseWheel (const int &scrollX, const int &scrollY, const int &relativeScroll)
 
virtual void InjectMouseDown (const int &xPos, const int &yPos, const MouseButtonId &button)
 
virtual void InjectMouseUp (const int &xPos, const int &yPos, const MouseButtonId &button)
 
virtual void InjectTouchAdd (const int &xPos, const int &yPos, const int &touchid)
 
virtual void InjectTouchRemove (const int &touchid)
 
virtual void InjectTouchUpdate (const int &xPos, const int &yPos, const int &vx, const int &vy, const int &touchid)
 
virtual void InjectKeyEvent (const UINT &msg, const ScolWindowHandle &hwnd, const WPARAM &wParam, const LPARAM &lParam)
 
virtual void InjectTextEvent (const std::string &utf8)
 
virtual void RunScriptFunction (const std::string &functionName, const std::vector< std::string > &argumentList)
 

 
virtual void loadResource (Ogre::Resource *resource)
 
- Public Member Functions inherited from SO3::SWidget
 SWidget (SScene *targetScene, const std::string &widgetName, const int &xPos, const int &yPos, const unsigned short &widgetWidth, const unsigned short &widgetHeight, SViewPort *targetViewport, const unsigned int &widgetZOrder, const std::string &widgetType)
 
 SWidget (SScene *targetScene, const std::string &widgetName, const int &xPos, const int &yPos, const unsigned short &widgetWidth, const unsigned short &widgetHeight, SViewPort *targetViewport, const std::string &widgetType)
 
 SWidget (SScene *targetScene, const std::string &widgetName, const unsigned short &widgetWidth, const unsigned short &widgetHeight, SMaterial *targetMaterial, const unsigned short &targetTechnique, const unsigned short &targetPass, const unsigned short &targetTextureUnit, const std::string &widgetType)
 
virtual ~SWidget ()
 
SSceneGetParentScene ()
 
std::string GetType ()
 
unsigned short GetWidth ()
 
unsigned short GetHeight ()
 
SPoint< unsigned short > GetSize ()
 
void SetSize (const unsigned short &newWidth, const unsigned short &newHeight)
 
void SetSize (const SPoint< unsigned short > &newSize)
 
float GetTextureRatio ()
 
void SetTextureRatio (const float &newRatio)
 
bool GetIsStereo ()
 
void SetStereo (StereoMode state)
 
void SetStereoEye (bool isleft=true)
 
SPoint< int > GetPosition ()
 
void SetPosition (const int &xPos, const int &yPos)
 
void SetPosition (const SPoint< int > &newPosition)
 
void Move (const SPoint< int > &relativeMove)
 
void SetCurrentViewport (Ogre::Viewport *vp)
 
void SetScale (const float width, const float height)
 
SPoint< float > GetScale ()
 
void SetLeftOffset (const float left)
 
void SetTopOffset (const float top)
 
SPoint< int > GetRealPixelPosition ()
 
SPoint< unsigned short > GetRealPixelSize ()
 
void Show (const bool &fade=false, const unsigned short &fadeDurationMS=300)
 
void Hide (const bool &fade=false, const unsigned short &fadeDurationMS=300)
 
bool GetVisible ()
 
void SetTransparency (const bool &enableTransparency)
 
bool GetTransparency ()
 
void SetOpacity (const float &widgetOpacity)
 
float GetOpacity ()
 
void SetIgnoreTransparentPixels (const bool &widgetIgnoreTransparentPixels, const float &tresholdColor=0.0f)
 
bool GetIgnoreTransparentPixels ()
 
float GetIgnoreTransparentPixelsTreshold ()
 
void SetZOrder (const unsigned short &newWidgetOrder)
 
unsigned short GetZOrder ()
 
void TakeFocus ()
 
void ReleaseFocus ()
 
bool HasFocus ()
 
void SetKeyboardEnable (const bool &enableKeyboardOnWidget)
 
bool GetKeyboardEnable ()
 
void SetMouseEnable (const bool &enableMouseOnWidget)
 
bool GetMouseEnable ()
 
bool GetMouseOver ()
 
bool GetInputOver (int id)
 
void SetInputOver (int id, bool state)
 
void SetForeground (const bool &enableWidgetForeground)
 
bool GetForeground ()
 
void SetTopOnFocus (const bool &enableWidgetTopOnFocus)
 
bool GetTopOnFocus ()
 
bool GetUpdateOnFocusOnly ()
 
void SetUpdateOnFocusOnly (const bool &activate)
 
bool GetIsOverlayed ()
 
bool GetIs2DRect ()
 
virtual HCURSOR GetCurrentMouseCursor ()
 
- Public Member Functions inherited from SO3::SData
 SData (const std::string &dataName)
 
virtual ~SData ()
 
std::string GetName () const
 
SUserObjectBindingsGetUserObjectBindings ()
 
const SUserObjectBindingsGetUserObjectBindings () const
 

Protected Member Functions

virtual void SetFocusImpl (const bool &focusOnWidget)
 
virtual void SetTransparencyImpl (const bool &enableTransparency)
 
virtual void SetKeyboardEnableImpl (const bool &enableKeyboardOnWidget)
 
virtual void SetMouseEnableImpl (const bool &enableMouseOnWidget)
 
virtual void SetSizeImpl (const unsigned short &newWidth, const unsigned short &newHeight)
 
virtual bool CheckPixelAlpha (const int &posX, const int &posY)
 
- Protected Member Functions inherited from SO3::SWidget
bool IsCompensateNPOT () const
 
void CreateTexture (bool alpha=true)
 
std::string CheckUrl (const std::string &url)
 

Additional Inherited Members

- Public Types inherited from SO3::SWidget
enum  StereoMode { MONO = 0 , SBS = 1 , TB = 2 , BT = 3 }
 
- Public Attributes inherited from SO3::SWidget
friend SWidgetManager
 
- Protected Attributes inherited from SO3::SWidget
std::string baseResourceName
 
int leftPos
 
int topPos
 
float leftOffset
 
float topOffset
 
unsigned short width
 
unsigned short height
 
unsigned short mTextureWidth
 The actual texture width allocated in ogre.
 
unsigned short mTextureHeight
 The actual texture height allocated in ogre.
 
float textureRatio
 Texture ratio compared to widget size, usually 1.0.
 
SScenescene
 
SViewPortviewport
 
Ogre::Viewport * currentViewport
 
Ogre::TexturePtr renderingTexture
 
bool forceRenderingUpdate
 
float transparentTresholdColor
 
bool compensateNPOT
 Use to indicate if the texture size has be rounded to an exact pow2.
 
Ogre::Vector2 xCoef
 
Ogre::Vector2 yCoef
 
- Protected Attributes inherited from SO3::SData
std::string name
 

Detailed Description

Definition at line 43 of file SO3BitmapWidget.h.

Constructor & Destructor Documentation

◆ SBitmapWidget() [1/3]

SO3::SBitmapWidget::SBitmapWidget ( SScene targetScene,
const std::string &  bitmapWidgetName,
const int &  xPos,
const int &  yPos,
const unsigned short &  widgetWidth,
const unsigned short &  widgetHeight,
SViewPort targetViewport,
const unsigned int &  widgetZOrder 
)

Definition at line 43 of file SO3BitmapWidget.cpp.

◆ SBitmapWidget() [2/3]

SO3::SBitmapWidget::SBitmapWidget ( SScene targetScene,
const std::string &  bitmapWidgetName,
const int &  xPos,
const int &  yPos,
const unsigned short &  widgetWidth,
const unsigned short &  widgetHeight,
SViewPort targetViewport 
)

Definition at line 48 of file SO3BitmapWidget.cpp.

◆ SBitmapWidget() [3/3]

SO3::SBitmapWidget::SBitmapWidget ( SScene targetScene,
const std::string &  bitmapWidgetName,
const unsigned short &  widgetWidth,
const unsigned short &  widgetHeight,
SMaterial targetMaterial,
const unsigned short &  targetTechnique,
const unsigned short &  targetPass,
const unsigned short &  targetTextureUnit 
)

Definition at line 53 of file SO3BitmapWidget.cpp.

◆ ~SBitmapWidget()

SO3::SBitmapWidget::~SBitmapWidget ( )

Destructor.

Definition at line 66 of file SO3BitmapWidget.cpp.

Member Function Documentation

◆ CheckPixelAlpha()

bool SO3::SBitmapWidget::CheckPixelAlpha ( const int &  posX,
const int &  posY 
)
protectedvirtual

return false if no pixel is under coordonates.

Implements SO3::SWidget.

Definition at line 280 of file SO3BitmapWidget.cpp.

◆ CommonConstructorSequence()

void SO3::SBitmapWidget::CommonConstructorSequence ( )

Common constructor sequence for every SBitmapWidget constructor signature.

Definition at line 58 of file SO3BitmapWidget.cpp.

◆ InjectKeyEvent()

void SO3::SBitmapWidget::InjectKeyEvent ( const UINT msg,
const ScolWindowHandle &  hwnd,
const WPARAM &  wParam,
const LPARAM &  lParam 
)
virtual

Implements SO3::SWidget.

Definition at line 241 of file SO3BitmapWidget.cpp.

◆ InjectMouseDown()

void SO3::SBitmapWidget::InjectMouseDown ( const int &  xPos,
const int &  yPos,
const MouseButtonId button 
)
virtual

Injects mouse down events into this Widget. You must supply the current coordinates of the mouse in this Widget's own local coordinate space.

Parameters
xPosThe absolute X-Value of the mouse, relative to this Widget's origin.
yPosThe absolute Y-Value of the mouse, relative to this Widget's origin.

Implements SO3::SWidget.

Definition at line 216 of file SO3BitmapWidget.cpp.

◆ InjectMouseMove()

void SO3::SBitmapWidget::InjectMouseMove ( const int &  xPos,
const int &  yPos,
const MouseButtonId button 
)
virtual

  Injects the mouse's current coordinates (in this Widget's own local coordinate space) into this Widget.
Parameters
xPosThe X-coordinate of the mouse, relative to this Widget's origin.
yPosThe Y-coordinate of the mouse, relative to this Widget's origin.

Implements SO3::SWidget.

Definition at line 206 of file SO3BitmapWidget.cpp.

◆ InjectMouseUp()

void SO3::SBitmapWidget::InjectMouseUp ( const int &  xPos,
const int &  yPos,
const MouseButtonId button 
)
virtual

Injects mouse up events into this Widget. You must supply the current coordinates of the mouse in this Widget's own local coordinate space.

Parameters
xPosThe absolute X-Value of the mouse, relative to this Widget's origin.
yPosThe absolute Y-Value of the mouse, relative to this Widget's origin.

Implements SO3::SWidget.

Definition at line 221 of file SO3BitmapWidget.cpp.

◆ InjectMouseWheel()

void SO3::SBitmapWidget::InjectMouseWheel ( const int &  scrollX,
const int &  scrollY,
const int &  relativeScroll 
)
virtual

Injects mouse wheel events into this Widget.

Parameters
scrollXscroll distance on X axis
scrollYscroll distance on Y axis

Implements SO3::SWidget.

Definition at line 211 of file SO3BitmapWidget.cpp.

◆ InjectTextEvent()

void SO3::SBitmapWidget::InjectTextEvent ( const std::string &  utf8)
virtual

Implements SO3::SWidget.

Definition at line 246 of file SO3BitmapWidget.cpp.

◆ InjectTouchAdd()

void SO3::SBitmapWidget::InjectTouchAdd ( const int &  xPos,
const int &  yPos,
const int &  touchid 
)
virtual

Injects the touch add with current coordinates (in this Widget's own local coordinate space) into this Widget.

Parameters
xPosThe X-coordinate of the touch point, relative to this Widget's origin.
yPosThe Y-coordinate of the touch point, relative to this Widget's origin.
touchidthe touch id

Implements SO3::SWidget.

Definition at line 226 of file SO3BitmapWidget.cpp.

◆ InjectTouchRemove()

void SO3::SBitmapWidget::InjectTouchRemove ( const int &  touchid)
virtual

Injects touch remove down events into this Widget.

Parameters
touchidthe touch id

Implements SO3::SWidget.

Definition at line 231 of file SO3BitmapWidget.cpp.

◆ InjectTouchUpdate()

void SO3::SBitmapWidget::InjectTouchUpdate ( const int &  xPos,
const int &  yPos,
const int &  vx,
const int &  vy,
const int &  touchid 
)
virtual

Injects the touch update with current coordinates (in this Widget's own local coordinate space) into this Widget.

Parameters
xPosThe X-coordinate of the touch point, relative to this Widget's origin.
yPosThe Y-coordinate of the touch point, relative to this Widget's origin.
vxThe X last move distance of the touch point, relative to this Widget's origin.
vyThe Y last move distance of the touch point, relative to this Widget's origin.
touchidthe touch id

Implements SO3::SWidget.

Definition at line 236 of file SO3BitmapWidget.cpp.

◆ LoadFile()

void SO3::SBitmapWidget::LoadFile ( const std::string &  file)
virtual

Loads a local file.

Note
The file should reside in a scol partition.

Implements SO3::SWidget.

Definition at line 79 of file SO3BitmapWidget.cpp.

◆ loadResource()

void SO3::SBitmapWidget::loadResource ( Ogre::Resource *  resource)
virtual

Reimplemented from SO3::SWidget.

Definition at line 356 of file SO3BitmapWidget.cpp.

◆ LoadURL()

void SO3::SBitmapWidget::LoadURL ( const std::string &  url)
virtual

Implements SO3::SWidget.

Definition at line 72 of file SO3BitmapWidget.cpp.

◆ RunScriptFunction()

void SO3::SBitmapWidget::RunScriptFunction ( const std::string &  functionName,
const std::vector< std::string > &  argumentList 
)
virtual


Execute an action script function using the parameters passed in the list.

Implements SO3::SWidget.

Definition at line 260 of file SO3BitmapWidget.cpp.

◆ SetFocusImpl()

void SO3::SBitmapWidget::SetFocusImpl ( const bool &  focusOnWidget)
protectedvirtual

Focus or unfocus widget implementation.

Implements SO3::SWidget.

Definition at line 251 of file SO3BitmapWidget.cpp.

◆ SetKeyboardEnableImpl()

void SO3::SBitmapWidget::SetKeyboardEnableImpl ( const bool &  enableKeyboardOnWidget)
protectedvirtual

Implements SO3::SWidget.

Definition at line 265 of file SO3BitmapWidget.cpp.

◆ SetMouseEnableImpl()

void SO3::SBitmapWidget::SetMouseEnableImpl ( const bool &  enableMouseOnWidget)
protectedvirtual

Enable mouse input on widget.

Implements SO3::SWidget.

Definition at line 270 of file SO3BitmapWidget.cpp.

◆ SetSizeImpl()

void SO3::SBitmapWidget::SetSizeImpl ( const unsigned short &  newWidth,
const unsigned short &  newHeight 
)
protectedvirtual

Implements SO3::SWidget.

Definition at line 275 of file SO3BitmapWidget.cpp.

◆ SetTransparencyImpl()

void SO3::SBitmapWidget::SetTransparencyImpl ( const bool &  enableTransparency)
protectedvirtual

Implements SO3::SWidget.

Definition at line 256 of file SO3BitmapWidget.cpp.

◆ UpdateRawData() [1/3]

void SO3::SBitmapWidget::UpdateRawData ( PtrObjBitmap  scolBitmap)

Blit a scol bitmap in the widget area

Definition at line 143 of file SO3BitmapWidget.cpp.

◆ UpdateRawData() [2/3]

void SO3::SBitmapWidget::UpdateRawData ( PtrObjBitmap  scolBitmap,
PtrObjBitmap  scolAlphaBitmap 
)

Blit a scol alpha bitmap in the widget area

Definition at line 172 of file SO3BitmapWidget.cpp.

◆ UpdateRawData() [3/3]

void SO3::SBitmapWidget::UpdateRawData ( unsigned char *  buffer,
int  width,
int  height,
int  bitperpixel 
)

Blit a pixel buffer in the widget area

Definition at line 86 of file SO3BitmapWidget.cpp.


The documentation for this class was generated from the following files: