Spinning Topp Logo BlackTopp Studios
inc
screen.cpp
1 // © Copyright 2010 - 2016 BlackTopp Studios Inc.
2 /* This file is part of The Mezzanine Engine.
3 
4  The Mezzanine Engine is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  The Mezzanine Engine is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with The Mezzanine Engine. If not, see <http://www.gnu.org/licenses/>.
16 */
17 /* The original authors have included a copy of the license specified above in the
18  'Docs' folder. See 'gpl.txt'
19 */
20 /* We welcome the use of the Mezzanine engine to anyone, including companies who wish to
21  Build professional software and charge for their product.
22 
23  However there are some practical restrictions, so if your project involves
24  any of the following you should contact us and we will try to work something
25  out:
26  - DRM or Copy Protection of any kind(except Copyrights)
27  - Software Patents You Do Not Wish to Freely License
28  - Any Kind of Linking to Non-GPL licensed Works
29  - Are Currently In Violation of Another Copyright Holder's GPL License
30  - If You want to change our code and not add a few hundred MB of stuff to
31  your distribution
32 
33  These and other limitations could cause serious legal problems if you ignore
34  them, so it is best to simply contact us or the Free Software Foundation, if
35  you have any questions.
36 
37  Joseph Toppi - toppij@gmail.com
38  John Blackwood - makoenergy02@gmail.com
39 */
40 #ifndef _uiscreen_cpp
41 #define _uiscreen_cpp
42 
43 #include "UI/uimanager.h"
44 #include "UI/screen.h"
45 #include "UI/textureatlas.h"
46 #include "UI/mousehoverstrategy.h"
47 #include "UI/brutestrategy.h"
48 #include "UI/layoutstrategy.h"
49 
50 #include "UI/button.h"
51 #include "UI/checkbox.h"
52 #include "UI/dropdownlist.h"
53 #include "UI/editbox.h"
54 #include "UI/gridcontainer.h"
55 #include "UI/horizontalcontainer.h"
56 #include "UI/horizontalscrollbar.h"
57 #include "UI/linelist.h"
58 #include "UI/listbox.h"
59 #include "UI/menuentry.h"
60 #include "UI/radiobutton.h"
61 #include "UI/scrollbar.h"
62 #include "UI/spinner.h"
63 #include "UI/stackbutton.h"
64 #include "UI/tabset.h"
65 #include "UI/verticalcontainer.h"
66 #include "UI/verticalscrollbar.h"
67 #include "UI/widget.h"
68 #include "UI/window.h"
69 
70 #include "Graphics/gamewindow.h"
71 #include "Graphics/viewport.h"
72 #include "Graphics/cameraproxy.h"
73 #include "Graphics/graphicsmanager.h"
74 #include "Graphics/scenemanager.h"
75 
76 #include "MathTools/mathtools.h"
77 #include "exception.h"
78 
79 #include <OgreRoot.h>
80 #include <OgreMatrix4.h>
81 #include <OgreRenderSystem.h>
82 #include <OgreRenderOperation.h>
83 #include <OgreHardwareBufferManager.h>
84 #include <OgreHardwareVertexBuffer.h>
85 #include <OgreRenderQueueListener.h>
86 
87 namespace Mezzanine
88 {
89  namespace UI
90  {
91  ///////////////////////////////////////////////////////////////////////////////
92  // Child Processing Functors
93 
94  // Keeps this file form being documented by doxygen
95  /// @cond DontDocumentInternal
96 
97  ///////////////////////////////////////////////////////////////////////////////
98  /// @brief Simple functor for appending all vertices in the renderable tree to a vector.
99  /// @details
100  ///////////////////////////////////////
101  class VertexCollectFunctor
102  {
103  public:
104  /// @brief A pointer to the buffer storing Vertex data to be rendered.
105  ScreenRenderData* Data;
106 
107  /// @brief Class constructor.
108  /// @param pData A pointer to the buffer that Vertex data will be appended to.
109  VertexCollectFunctor(ScreenRenderData* pData) : Data(pData) {}
110  /// @brief Class constructor.
111  ~VertexCollectFunctor() {}
112 
113  /// @brief Function Operator.
114  /// @param Quad The QuadRenderable to have it's Vertex data appended to the buffer.
115  Boole operator()(QuadRenderable* Quad)
116  {
117  Quad->_AppendRenderData(*Data);
118  return false;
119  }
120  };//VertexCollectFunctor
121 
122  ///////////////////////////////////////////////////////////////////////////////
123  // OgreVertex
124 
125  ///////////////////////////////////////////////////////////////////////////////
126  /// @brief Simple class that facilitates conversions when inserting vertex's into the video buffer.
127  /// @details
128  ///////////////////////////////////////
129  struct OgreVertex
130  {
131  /// @brief Vertex Position. Z component should almost always be 0.
132  Ogre::Vector3 Position;
133  /// @brief Vertex Colour. Can tint Quads using images or be used as a flat colour.
134  Ogre::ColourValue Colour;
135  /// @brief Texture Coordinates. How a texture should be mapped onto the quad.
136  Ogre::Vector2 UV;
137  };
138 
139  ///////////////////////////////////////////////////////////////////////////////
140  // ScreenInternalData Methods
141 
142  ///////////////////////////////////////////////////////////////////////////////
143  /// @brief Basic struct holding some of the internal bits of this class that could not be placed on the class directly.
144  /// @details
145  ///////////////////////////////////////
146  struct ScreenInternalData : public Ogre::RenderQueueListener
147  {
148  /// @brief A pointer to the Screen this is listening for.
149  Screen* ParentScreen;
150  /// @brief The render operation to be passed into the render system to draw the Screen.
151  Ogre::RenderOperation RenderOp;
152  /// @brief A pointer to the actual render system that will be doing the rendering.
153  Ogre::RenderSystem* RenderSys;
154  /// @brief A pointer to the hardware buffer containing the UI vertex data.
155  Ogre::HardwareVertexBufferSharedPtr VertexBuffer;
156 
157  /// @brief Callback for when a specific group in the render queue has started render operations.
158  void renderQueueStarted(Ogre::uint8, const Ogre::String&, bool&) { }
159  /// @brief Callback for when a specific group in the render queue has ended render operations.
160  /// @param queueGroupId The render queue group that has ended rendering.
161  void renderQueueEnded(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& repeatThisInvocation)
162  {
163  if( queueGroupId == Ogre::RENDER_QUEUE_OVERLAY && this->RenderSys->_getViewport() == this->ParentScreen->GetViewport()->_GetOgreViewport() ) {
164  if( this->ParentScreen->IsVisible() ) {
165  this->ParentScreen->_RenderScreen();
166  }
167  }
168  }
169  };//ScreenInternalData
170 
171  /// @endcond
172 
173  ///////////////////////////////////////////////////////////////////////////////
174  // ScreenRenderData Methods
175 
177  { this->Vertices.clear(); }
178 
180  { return this->Vertices.size(); }
181 
183  { this->Vertices.insert(this->Vertices.end(),OtherData.Vertices.begin(),OtherData.Vertices.end()); }
184 
186  { return this->Vertices.at(Index); }
187 
188  ///////////////////////////////////////////////////////////////////////////////
189  // Screen Methods
190 
191  Screen::Screen(const String& RendName, const String& Atlas, Graphics::Viewport* WindowViewport, UIManager* Manager) :
192  QuadRenderable(RendName,this),
193 
194  PrimaryAtlas(Atlas),
195  Scale(1,1,1),
196  MouseHitPosition(-1,-1),
197 
198  UIMan(Manager),
199  GameViewport(WindowViewport),
200  MouseStrat(NULL),
201 
202  Orientation(Mezzanine::OM_Degree_0)
203  {
205  /*this->ActDims.Size.X = (Real)this->GameViewport->GetActualWidth();
206  this->ActDims.Size.Y = (Real)this->GameViewport->GetActualHeight();
207  this->InverseSize.X = 1 / this->ActDims.Size.X;
208  this->InverseSize.Y = 1 / this->ActDims.Size.Y;// */
209 
210  this->SID = new ScreenInternalData();
211  this->SID->RenderSys = Ogre::Root::getSingletonPtr()->getRenderSystem();
212  this->SID->ParentScreen = this;
213 
214  Graphics::SceneManager* SceneMan = this->GetSceneManager();
215  if(SceneMan)
216  SceneMan->_GetGraphicsWorldPointer()->addRenderQueueListener(SID);
217 
218  this->VertexTransform.SetTransform(Vector3(0,0,0),this->Scale,Quaternion(0,0,0,1));
219  this->CreateVertexBuffer(32 * 6);
220 
221  this->SetMousePassthrough(true);
223  this->_SetLayoutStrat(new LayoutStrategy());
224  }
225 
226  Screen::Screen(const XML::Node& XMLNode, UIManager* Manager) :
227  QuadRenderable(this),
228  Scale(1,1,1),
229  MouseHitPosition(-1,-1),
230  UIMan(Manager),
231  GameViewport(NULL),
232  MouseStrat(NULL),
233  Orientation(Mezzanine::OM_Degree_0)
234  {
236 
237  this->SID = new ScreenInternalData();
238  this->SID->RenderSys = Ogre::Root::getSingletonPtr()->getRenderSystem();
239  this->SID->ParentScreen = this;
240 
241  Graphics::SceneManager* SceneMan = this->GetSceneManager();
242  if(SceneMan)
243  SceneMan->_GetGraphicsWorldPointer()->addRenderQueueListener(SID);
244 
245  this->CreateVertexBuffer(32 * 6);
247  this->_SetLayoutStrat(new LayoutStrategy());
248 
249  this->ProtoDeSerialize(XMLNode);
250  }
251 
253  {
254  this->DestroyAllWidgets();
255  }
256 
258  {
259  /// @todo This function exists (as opposed to storing a pointer that doesn't change) so that if changes in the
260  /// viewport configuration occur this will pick up on that. However the render queue listener that is added in
261  /// this class' constructor never gets re-assigned. This needs to be fixed. Until then if a change does occur
262  /// the UI will be rendered at a different time then it needs to be, potentially overwritten by the scene render.
263  if( GameViewport ) {
265  if( Cam ) {
266  Graphics::SceneManager* SceneMan = static_cast<Graphics::SceneManager*>( Cam->GetCreator() );
267  if( SceneMan ) return SceneMan;
268  else return NULL;
269  }else return NULL;
270  }else return NULL;
271  }
272 
274  {
275  WidgetFactoryIterator WidFactIt = this->WidgetFactories.find( WidgetTypeName );
276  if( WidFactIt != this->WidgetFactories.end() ) {
277  return (*WidFactIt).second;
278  }else{
279  MEZZ_EXCEPTION(ExceptionBase::INVALID_STATE_EXCEPTION,"Attempting to create a " + WidgetTypeName + " Widget without it's factory registered.");
280  }
281  }
282 
284  {
285  String WidgetName = ToInsert->GetName();
286  std::pair<WidgetIterator,Boole> InsertReturn = this->Widgets.insert( std::pair<String,Widget*>(WidgetName,ToInsert) );
287  if( !InsertReturn.second )
288  { MEZZ_EXCEPTION(ExceptionBase::II_DUPLICATE_IDENTITY_EXCEPTION,"Widget with name \"" + WidgetName + "\" already exists."); }
289  return ToInsert;
290  }
291 
293  {
294  this->SID->RenderSys->_setWorldMatrix( Ogre::Matrix4::IDENTITY );
295  this->SID->RenderSys->_setProjectionMatrix( Ogre::Matrix4::IDENTITY );
296  this->SID->RenderSys->_setViewMatrix( Ogre::Matrix4::IDENTITY );
298  if(SceneMan)
299  SceneMan->_GetGraphicsWorldPointer()->_setPass( UIManager::GetSingletonPtr()->GetAtlas(PrimaryAtlas)->_Get2DPass() );
300  }
301 
302  void Screen::CreateVertexBuffer(const Whole& InitialSize)
303  {
304  this->SID->RenderOp.vertexData = OGRE_NEW Ogre::VertexData;
305  this->SID->RenderOp.vertexData->vertexStart = 0;
306 
307  Ogre::VertexDeclaration* VertexDecl = this->SID->RenderOp.vertexData->vertexDeclaration;
308  size_t Offset = 0;
309 
310  // Position.
311  VertexDecl->addElement(0,0,Ogre::VET_FLOAT3,Ogre::VES_POSITION);
312  Offset += Ogre::VertexElement::getTypeSize(Ogre::VET_FLOAT3);
313 
314  // Colour
315  VertexDecl->addElement(0,Offset,Ogre::VET_FLOAT4,Ogre::VES_DIFFUSE);
316  Offset += Ogre::VertexElement::getTypeSize(Ogre::VET_FLOAT4);
317 
318  // Texture Coordinates
319  VertexDecl->addElement(0,Offset,Ogre::VET_FLOAT2, Ogre::VES_TEXTURE_COORDINATES);
320 
321  this->SID->VertexBuffer = Ogre::HardwareBufferManager::getSingletonPtr()->createVertexBuffer(
322  VertexDecl->getVertexSize(0),
323  InitialSize,
324  Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE,
325  false);
326 
327  this->SID->RenderOp.vertexData->vertexBufferBinding->setBinding(0,this->SID->VertexBuffer);
328  this->SID->RenderOp.operationType = Ogre::RenderOperation::OT_TRIANGLE_LIST;
329  this->SID->RenderOp.useIndexes = false;
330  }
331 
333  {
334  OGRE_DELETE this->SID->RenderOp.vertexData;
335  this->SID->RenderOp.vertexData = 0;
336  this->SID->VertexBuffer.setNull();
337  }
338 
339  void Screen::ResizeVertexBuffer(const Whole& RequestedSize)
340  {
341  if( this->SID->VertexBuffer.isNull() )
342  this->CreateVertexBuffer(RequestedSize);
343 
344  if(RequestedSize > this->SID->VertexBuffer->getNumVertices() ) {
345  // Update only by powers of 2
346  Whole NewVertexBufferSize = 1;
347  while(NewVertexBufferSize < RequestedSize)
348  NewVertexBufferSize <<= 1;
349 
350  this->SID->VertexBuffer = Ogre::HardwareBufferManager::getSingletonPtr()->createVertexBuffer(
351  this->SID->RenderOp.vertexData->vertexDeclaration->getVertexSize(0),
352  NewVertexBufferSize,
353  Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE,
354  false);
355 
356  this->SID->RenderOp.vertexData->vertexStart = 0;
357  this->SID->RenderOp.vertexData->vertexBufferBinding->setBinding(0,this->SID->VertexBuffer);
358  }
359  }
360 
361  ///////////////////////////////////////////////////////////////////////////////
362  // Utility and Visibility Methods
363 
365  { this->Visible = CanSee; }
366 
368  { return this->Visible; }
369 
371  { return this->Visible; }
372 
374  { this->SetVisible(true); }
375 
377  { this->SetVisible(false); }
378 
380  { return Renderable::RT_Screen; }
381 
383  { return this->ActDims.Size; }
384 
386  {
387  Vector2 CurrentSize((Real)this->GameViewport->GetActualWidth(),(Real)this->GameViewport->GetActualHeight());
388  if( this->ActDims.Size != CurrentSize || ( this->InverseSize.X == 0.0 || this->InverseSize.Y == 0.0 ) ) {
389  Rect OldRect(this->ActDims);
390  Rect NewRect(Vector2(0,0),CurrentSize);
391  this->UpdateDimensions(OldRect,NewRect);
392 
393  this->InverseSize.X = 1.0 / this->ActDims.Size.X;
394  this->InverseSize.Y = 1.0 / this->ActDims.Size.Y;
395  }
396  }
397 
399  { return this->GameViewport; }
400 
402  { return this->UIMan; }
403 
404  ///////////////////////////////////////////////////////////////////////////////
405  // Mouse Hover Methods
406 
408  {
409  if(this->MouseStrat) {
410  delete this->MouseStrat;
411  this->MouseStrat = NULL;
412  }
413  this->MouseStrat = Strategy;
414  this->MouseStrat->_SetScreen(this);
415  }
416 
418  {
419  return this->MouseStrat;
420  }
421 
423  {
424  if( this->GetVisible() ) {
425  Widget* Ret = this->MouseStrat->FindHoveredWidget(MousePos);
426  if( Ret != NULL ) this->MouseHitPosition = MousePos;
427  else this->MouseHitPosition.SetValues(-1,-1);
428 
429  return Ret;
430  }
431  return NULL;
432  }
433 
435  {
436  return this->MouseHitPosition;
437  }
438 
439  ///////////////////////////////////////////////////////////////////////////////
440  // WidgetFactory Management
441 
443  {
444  this->WidgetFactories.insert( std::pair<String,WidgetFactory*>(ToBeAdded->GetWidgetTypeName(),ToBeAdded) );
445  }
446 
448  {
449  this->RemoveWidgetFactory( ToBeRemoved->GetWidgetTypeName() );
450  }
451 
452  void Screen::RemoveWidgetFactory(const String& ImplName)
453  {
454  WidgetFactoryIterator FactIt = this->WidgetFactories.find( ImplName );
455  if( FactIt != this->WidgetFactories.end() ) {
456  this->WidgetFactories.erase(FactIt);
457  }
458  }
459 
461  {
462  this->DestroyWidgetFactory( ToBeDestroyed->GetWidgetTypeName() );
463  }
464 
465  void Screen::DestroyWidgetFactory(const String& ImplName)
466  {
467  WidgetFactoryIterator FactIt = this->WidgetFactories.find( ImplName );
468  if( FactIt != this->WidgetFactories.end() ) {
469  delete (*FactIt).second;
470  this->WidgetFactories.erase(FactIt);
471  }
472  }
473 
475  {
476  for( WidgetFactoryIterator FactIt = this->WidgetFactories.begin() ; FactIt != this->WidgetFactories.end() ; ++FactIt )
477  {
478  delete (*FactIt).second;
479  }
480  this->WidgetFactories.clear();
481  }
482 
484  {
485  WidgetFactoryIterator FactIt;
486  // Generic Widget
487  FactIt = this->WidgetFactories.find( Widget::TypeName );
488  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new GenericWidgetFactory() );
489  // Button
490  FactIt = this->WidgetFactories.find( Button::TypeName );
491  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new ButtonFactory() );
492  // StackButton
493  FactIt = this->WidgetFactories.find( StackButton::TypeName );
494  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new StackButtonFactory() );
495  // RadioButton
496  FactIt = this->WidgetFactories.find( RadioButton::TypeName );
497  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new RadioButtonFactory() );
498  // CheckBox
499  FactIt = this->WidgetFactories.find( CheckBox::TypeName );
500  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new CheckBoxFactory() );
501  // EditBox
502  FactIt = this->WidgetFactories.find( EditBox::TypeName );
503  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new EditBoxFactory() );
504 
505  // HorizontalScrollbar
506  FactIt = this->WidgetFactories.find( HorizontalScrollbar::TypeName );
507  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new HorizontalScrollbarFactory() );
508  // VerticalScrollbar
509  FactIt = this->WidgetFactories.find( VerticalScrollbar::TypeName );
510  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new VerticalScrollbarFactory() );
511  // Spinner
512  FactIt = this->WidgetFactories.find( Spinner::TypeName );
513  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new SpinnerFactory() );
514 
515  // MenuEntry
516  FactIt = this->WidgetFactories.find( MenuEntry::TypeName );
517  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new MenuEntryFactory() );
518  // TabSet
519  FactIt = this->WidgetFactories.find( TabSet::TypeName );
520  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new TabSetFactory() );
521  // ListBox
522  FactIt = this->WidgetFactories.find( ListBox::TypeName );
523  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new ListBoxFactory() );
524  // DropDownList
525  FactIt = this->WidgetFactories.find( DropDownList::TypeName );
526  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new DropDownListFactory() );
527 
528  // HorizontalContainer
529  FactIt = this->WidgetFactories.find( HorizontalContainer::TypeName );
530  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new HorizontalContainerFactory() );
531  // VerticalContainer
532  FactIt = this->WidgetFactories.find( VerticalContainer::TypeName );
533  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new VerticalContainerFactory() );
534  // GridContainer
535  FactIt = this->WidgetFactories.find( GridContainer::TypeName );
536  if( FactIt == this->WidgetFactories.end() ) this->AddWidgetFactory( new GridContainerFactory() );
537  }
538 
539  ///////////////////////////////////////////////////////////////////////////////
540  // Widget Management
541 
543  {
544  String TypeName = WidgetNode.Name();
545  WidgetFactoryIterator FactIt = this->WidgetFactories.find( TypeName );
546  if( FactIt != this->WidgetFactories.end() ) {
547  return this->CheckAndInsertExcept( (*FactIt).second->CreateWidget(WidgetNode,this) );
548  }else{
549  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_INVALID_EXCEPTION,"Attempting to create widget of type \"" + TypeName + "\", which has no factory registered.");
550  }
551  }
552 
553  Widget* Screen::CreateWidget(const String& TypeName, const String& RendName, const NameValuePairMap& Params)
554  {
555  WidgetFactoryIterator FactIt = this->WidgetFactories.find( TypeName );
556  if( FactIt != this->WidgetFactories.end() ) {
557  return this->CheckAndInsertExcept( (*FactIt).second->CreateWidget(RendName,Params,this) );
558  }else{
559  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_INVALID_EXCEPTION,"Attempting to create widget of type \"" + TypeName + "\", which has no factory registered.");
560  }
561  }
562 
563  Widget* Screen::CreateWidget(const String& TypeName, const String& RendName, const UnifiedRect& RendRect, const NameValuePairMap& Params)
564  {
565  WidgetFactoryIterator FactIt = this->WidgetFactories.find( TypeName );
566  if( FactIt != this->WidgetFactories.end() ) {
567  return this->CheckAndInsertExcept( (*FactIt).second->CreateWidget(RendName,RendRect,Params,this) );
568  }else{
569  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_INVALID_EXCEPTION,"Attempting to create widget of type \"" + TypeName + "\", which has no factory registered.");
570  }
571  }
572 
574  {
575  WidgetIterator WidIt = this->Widgets.find(Name);
576  if( WidIt != this->Widgets.end() ) return (*WidIt).second;
577  else return NULL;
578  }
579 
581  {
582  return this->Widgets.size();
583  }
584 
585  void Screen::DestroyWidget(Widget* ToBeDestroyed)
586  {
587  // Remove the widget from the Widget container.
588  WidgetIterator WidIt = this->Widgets.find( ToBeDestroyed->GetName() );
589  if( WidIt != this->Widgets.end() )
590  this->Widgets.erase(WidIt);
591 
592  // Delete the Widget
593  WidgetFactoryIterator FactIt = this->WidgetFactories.find( ToBeDestroyed->GetTypeName() );
594  if( FactIt != this->WidgetFactories.end() ) {
595  (*FactIt).second->DestroyWidget( ToBeDestroyed );
596  }
597  }
598 
600  {
601  for( ChildIterator ChildIt = this->ChildWidgets.begin() ; ChildIt != this->ChildWidgets.end() ; ++ChildIt )
602  {
603  (*ChildIt)->_NotifyParenthood(NULL);
604  WidgetFactoryIterator FactIt = this->WidgetFactories.find( (*ChildIt)->GetTypeName() );
605  if( FactIt != this->WidgetFactories.end() ) {
606  (*FactIt).second->DestroyWidget( (*ChildIt) );
607  }
608  }
609  this->ChildWidgets.clear();
610  this->Widgets.clear();
611  }
612 
613  ///////////////////////////////////////////////////////////////////////////////
614  // Convenience Widget Creation Methods
615 
617  {
618  Widget* NewWidget = static_cast<GenericWidgetFactory*>( this->GetWidgetFactoryExcept( Widget::TypeName ) )->CreateWidget( RendName, this );
619  this->CheckAndInsertExcept( NewWidget );
620  return NewWidget;
621  }
622 
623  Widget* Screen::CreateWidget(const String& RendName, const UnifiedRect& RendRect)
624  {
625  Widget* NewWidget = static_cast<GenericWidgetFactory*>( this->GetWidgetFactoryExcept( Widget::TypeName ) )->CreateWidget( RendName, RendRect, this );
626  this->CheckAndInsertExcept( NewWidget );
627  return NewWidget;
628  }
629 
631  {
632  Button* NewButton = static_cast<ButtonFactory*>( this->GetWidgetFactoryExcept( Button::TypeName ) )->CreateButton( RendName, this );
633  this->CheckAndInsertExcept( NewButton );
634  return NewButton;
635  }
636 
637  Button* Screen::CreateButton(const String& RendName, const UnifiedRect& RendRect)
638  {
639  Button* NewButton = static_cast<ButtonFactory*>( this->GetWidgetFactoryExcept( Button::TypeName ) )->CreateButton( RendName, RendRect, this );
640  this->CheckAndInsertExcept( NewButton );
641  return NewButton;
642  }
643 
645  {
646  StackButton* NewButton = static_cast<StackButtonFactory*>( this->GetWidgetFactoryExcept( StackButton::TypeName ) )->CreateStackButton( RendName, this );
647  this->CheckAndInsertExcept( NewButton );
648  return NewButton;
649  }
650 
651  StackButton* Screen::CreateStackButton(const String& RendName, const UnifiedRect& RendRect)
652  {
653  StackButton* NewButton = static_cast<StackButtonFactory*>( this->GetWidgetFactoryExcept( StackButton::TypeName ) )->CreateStackButton( RendName, RendRect, this );
654  this->CheckAndInsertExcept( NewButton );
655  return NewButton;
656  }
657 
659  {
660  RadioButton* NewButton = static_cast<RadioButtonFactory*>( this->GetWidgetFactoryExcept( RadioButton::TypeName ) )->CreateRadioButton( RendName, this );
661  this->CheckAndInsertExcept( NewButton );
662  return NewButton;
663  }
664 
665  RadioButton* Screen::CreateRadioButton(const String& RendName, const UnifiedRect& RendRect)
666  {
667  RadioButton* NewButton = static_cast<RadioButtonFactory*>( this->GetWidgetFactoryExcept( RadioButton::TypeName ) )->CreateRadioButton( RendName, RendRect, this );
668  this->CheckAndInsertExcept( NewButton );
669  return NewButton;
670  }
671 
673  {
674  CheckBox* NewCheckBox = static_cast<CheckBoxFactory*>( this->GetWidgetFactoryExcept( CheckBox::TypeName ) )->CreateCheckBox( RendName, this );
675  this->CheckAndInsertExcept( NewCheckBox );
676  return NewCheckBox;
677  }
678 
679  CheckBox* Screen::CreateCheckBox(const String& RendName, const UnifiedRect& RendRect)
680  {
681  CheckBox* NewCheckBox = static_cast<CheckBoxFactory*>( this->GetWidgetFactoryExcept( CheckBox::TypeName ) )->CreateCheckBox( RendName, RendRect, this );
682  this->CheckAndInsertExcept( NewCheckBox );
683  return NewCheckBox;
684  }
685 
686  EditBox* Screen::CreateEditBox(const String& RendName, const RenderLayerType EditLayerType, FontData* EditFont)
687  {
688  EditBox* NewEdit = static_cast<EditBoxFactory*>( this->GetWidgetFactoryExcept( EditBox::TypeName ) )->CreateEditBox( RendName, EditLayerType, EditFont, this );
689  this->CheckAndInsertExcept( NewEdit );
690  return NewEdit;
691  }
692 
693  EditBox* Screen::CreateEditBox(const String& RendName, const RenderLayerType EditLayerType, const String& EditFontName)
694  {
695  EditBox* NewEdit = static_cast<EditBoxFactory*>( this->GetWidgetFactoryExcept( EditBox::TypeName ) )->CreateEditBox( RendName, EditLayerType, EditFontName, this );
696  this->CheckAndInsertExcept( NewEdit );
697  return NewEdit;
698  }
699 
700  EditBox* Screen::CreateEditBox(const String& RendName, const UnifiedRect& RendRect, const RenderLayerType EditLayerType, FontData* EditFont)
701  {
702  EditBox* NewEdit = static_cast<EditBoxFactory*>( this->GetWidgetFactoryExcept( EditBox::TypeName ) )->CreateEditBox( RendName, RendRect, EditLayerType, EditFont, this );
703  this->CheckAndInsertExcept( NewEdit );
704  return NewEdit;
705  }
706 
707  EditBox* Screen::CreateEditBox(const String& RendName, const UnifiedRect& RendRect, const RenderLayerType EditLayerType, const String& EditFontName)
708  {
709  EditBox* NewEdit = static_cast<EditBoxFactory*>( this->GetWidgetFactoryExcept( EditBox::TypeName ) )->CreateEditBox( RendName, RendRect, EditLayerType, EditFontName, this );
710  this->CheckAndInsertExcept( NewEdit );
711  return NewEdit;
712  }
713 
715  {
717  this->CheckAndInsertExcept( NewHScroll );
718  return NewHScroll;
719  }
720 
722  {
723  HorizontalScrollbar* NewHScroll = static_cast<HorizontalScrollbarFactory*>( this->GetWidgetFactoryExcept( HorizontalScrollbar::TypeName ) )->CreateHorizontalScrollbar( RendName, RendRect, Style, this );
724  this->CheckAndInsertExcept( NewHScroll );
725  return NewHScroll;
726  }
727 
729  {
730  VerticalScrollbar* NewVScroll = static_cast<VerticalScrollbarFactory*>( this->GetWidgetFactoryExcept( VerticalScrollbar::TypeName ) )->CreateVerticalScrollbar( RendName, Style, this );
731  this->CheckAndInsertExcept( NewVScroll );
732  return NewVScroll;
733  }
734 
736  {
737  VerticalScrollbar* NewVScroll = static_cast<VerticalScrollbarFactory*>( this->GetWidgetFactoryExcept( VerticalScrollbar::TypeName ) )->CreateVerticalScrollbar( RendName, RendRect, Style, this );
738  this->CheckAndInsertExcept( NewVScroll );
739  return NewVScroll;
740  }
741 
742  Spinner* Screen::CreateSpinner(const String& RendName, const SpinnerStyle SpinStyle, FontData* EditFont)
743  {
744  Spinner* NewSpin = static_cast<SpinnerFactory*>( this->GetWidgetFactoryExcept( Spinner::TypeName ) )->CreateSpinner( RendName, SpinStyle, EditFont, this );
745  this->CheckAndInsertExcept( NewSpin );
746  return NewSpin;
747  }
748 
749  Spinner* Screen::CreateSpinner(const String& RendName, const SpinnerStyle SpinStyle, const String& EditFontName)
750  {
751  Spinner* NewSpin = static_cast<SpinnerFactory*>( this->GetWidgetFactoryExcept( Spinner::TypeName ) )->CreateSpinner( RendName, SpinStyle, EditFontName, this );
752  this->CheckAndInsertExcept( NewSpin );
753  return NewSpin;
754  }
755 
756  Spinner* Screen::CreateSpinner(const String& RendName, const UnifiedRect& RendRect, const SpinnerStyle SpinStyle, FontData* EditFont)
757  {
758  Spinner* NewSpin = static_cast<SpinnerFactory*>( this->GetWidgetFactoryExcept( Spinner::TypeName ) )->CreateSpinner( RendName, RendRect, SpinStyle, EditFont, this );
759  this->CheckAndInsertExcept( NewSpin );
760  return NewSpin;
761  }
762 
763  Spinner* Screen::CreateSpinner(const String& RendName, const UnifiedRect& RendRect, const SpinnerStyle SpinStyle, const String& EditFontName)
764  {
765  Spinner* NewSpin = static_cast<SpinnerFactory*>( this->GetWidgetFactoryExcept( Spinner::TypeName ) )->CreateSpinner( RendName, RendRect, SpinStyle, EditFontName, this );
766  this->CheckAndInsertExcept( NewSpin );
767  return NewSpin;
768  }
769 
771  {
772  MenuEntry* NewEntry = static_cast<MenuEntryFactory*>( this->GetWidgetFactoryExcept( MenuEntry::TypeName ) )->CreateMenuEntry( RendName, this );
773  this->CheckAndInsertExcept( NewEntry );
774  return NewEntry;
775  }
776 
777  MenuEntry* Screen::CreateMenuEntry(const String& RendName, const UnifiedRect& RendRect)
778  {
779  MenuEntry* NewEntry = static_cast<MenuEntryFactory*>( this->GetWidgetFactoryExcept( MenuEntry::TypeName ) )->CreateMenuEntry( RendName, RendRect, this );
780  this->CheckAndInsertExcept( NewEntry );
781  return NewEntry;
782  }
783 
785  {
786  TabSet* NewTab = static_cast<TabSetFactory*>( this->GetWidgetFactoryExcept( TabSet::TypeName ) )->CreateTabSet( RendName, this );
787  this->CheckAndInsertExcept( NewTab );
788  return NewTab;
789  }
790 
791  TabSet* Screen::CreateTabSet(const String& RendName, const UnifiedRect& RendRect)
792  {
793  TabSet* NewTab = static_cast<TabSetFactory*>( this->GetWidgetFactoryExcept( TabSet::TypeName ) )->CreateTabSet( RendName, RendRect, this );
794  this->CheckAndInsertExcept( NewTab );
795  return NewTab;
796  }
797 
799  {
800  ListBox* NewList = static_cast<ListBoxFactory*>( this->GetWidgetFactoryExcept( ListBox::TypeName ) )->CreateListBox( RendName, Style, this );
801  this->CheckAndInsertExcept( NewList );
802  return NewList;
803  }
804 
805  ListBox* Screen::CreateListBox(const String& RendName, const UnifiedRect& RendRect, const UI::ScrollbarStyle Style)
806  {
807  ListBox* NewList = static_cast<ListBoxFactory*>( this->GetWidgetFactoryExcept( ListBox::TypeName ) )->CreateListBox( RendName, RendRect, Style, this );
808  this->CheckAndInsertExcept( NewList );
809  return NewList;
810  }
811 
813  {
814  DropDownList* NewList = static_cast<DropDownListFactory*>( this->GetWidgetFactoryExcept( DropDownList::TypeName ) )->CreateDropDownList( RendName, Style, this );
815  this->CheckAndInsertExcept( NewList );
816  return NewList;
817  }
818 
819  DropDownList* Screen::CreateDropDownList(const String& RendName, const UnifiedRect& RendRect, const UI::ScrollbarStyle Style)
820  {
821  DropDownList* NewList = static_cast<DropDownListFactory*>( this->GetWidgetFactoryExcept( DropDownList::TypeName ) )->CreateDropDownList( RendName, RendRect, Style, this );
822  this->CheckAndInsertExcept( NewList );
823  return NewList;
824  }
825 
827  {
829  this->CheckAndInsertExcept( NewHContain );
830  return NewHContain;
831  }
832 
834  {
835  HorizontalContainer* NewHContain = static_cast<HorizontalContainerFactory*>( this->GetWidgetFactoryExcept( HorizontalContainer::TypeName ) )->CreateHorizontalContainer( RendName, RendRect, this );
836  this->CheckAndInsertExcept( NewHContain );
837  return NewHContain;
838  }
839 
841  {
843  this->CheckAndInsertExcept( NewVContain );
844  return NewVContain;
845  }
846 
848  {
849  VerticalContainer* NewVContain = static_cast<VerticalContainerFactory*>( this->GetWidgetFactoryExcept( VerticalContainer::TypeName ) )->CreateVerticalContainer( RendName, RendRect, this );
850  this->CheckAndInsertExcept( NewVContain );
851  return NewVContain;
852  }
853 
855  {
856  GridContainer* NewGridContain = static_cast<GridContainerFactory*>( this->GetWidgetFactoryExcept( GridContainer::TypeName ) )->CreateGridContainer( RendName, this );
857  this->CheckAndInsertExcept( NewGridContain );
858  return NewGridContain;
859  }
860 
861  GridContainer* Screen::CreateGridContainer(const String& RendName, const UnifiedRect& RendRect)
862  {
863  GridContainer* NewGridContain = static_cast<GridContainerFactory*>( this->GetWidgetFactoryExcept( GridContainer::TypeName ) )->CreateGridContainer( RendName, RendRect, this );
864  this->CheckAndInsertExcept( NewGridContain );
865  return NewGridContain;
866  }
867 
868 
869  /*Window* Screen::CreateWidgetWindow(ConstString& Name, const Rect& RendRect)
870  {
871  return static_cast<Window*>( this->CheckAndInsert( ExtendedRenderableFactory::CreateWidgetWindow(Name,RendRect) ) );
872  }// */
873 
874  ///////////////////////////////////////////////////////////////////////////////
875  // Atlas Query
876 
877  void Screen::SetPrimaryAtlas(const String& Atlas)
878  { this->PrimaryAtlas = Atlas; }
879 
881  { return this->PrimaryAtlas; }
882 
884  { return this->GetAtlas(Atlas)->GetWhitePixel(); }
885 
886  Sprite* Screen::GetSprite(const String& SpriteName,const String& Atlas) const
887  { return this->GetAtlas(Atlas)->GetSprite(SpriteName); }
888 
889  FontData* Screen::GetFont(const String& FontName,const String& Atlas) const
890  { return this->GetAtlas(Atlas)->GetFont(FontName); }
891 
893  { return this->GetAtlas(Atlas)->GetTextureSize(); }
894 
895  TextureAtlas* Screen::GetAtlas(const String& Atlas) const
896  { return this->UIMan->GetAtlas(Atlas); }
897 
899  { return this->SID->RenderSys->getHorizontalTexelOffset(); }
900 
902  { return this->SID->RenderSys->getVerticalTexelOffset(); }
903 
904  ///////////////////////////////////////////////////////////////////////////////
905  // Other Query
906 
907  bool Screen::IsMarkupParserRegistered(const String& ParserName) const
908  { return this->UIMan->IsMarkupParserRegistered(ParserName); }
909 
910  MarkupParser* Screen::GetMarkupParser(const String& ParserName) const
911  { return this->UIMan->GetMarkupParser(ParserName); }
912 
913  ///////////////////////////////////////////////////////////////////////////////
914  // Serialization
915 
917  {
919  XML::Node PropertiesNode = SelfRoot.AppendChild( Screen::GetSerializableName() + "Properties" );
920 
921  if( PropertiesNode.AppendAttribute("Version").SetValue("1") &&
922  PropertiesNode.AppendAttribute("WindowTitle").SetValue( this->GameViewport->GetParentWindow()->GetWindowCaption() ) &&
923  PropertiesNode.AppendAttribute("ViewportZOrder").SetValue( this->GameViewport->GetZOrder() ) &&
924  PropertiesNode.AppendAttribute("PriAtlas").SetValue( this->PrimaryAtlas ) )
925  {
926  XML::Node VertexTransformNode = PropertiesNode.AppendChild("VertexTransform");
927  this->VertexTransform.ProtoSerialize( VertexTransformNode );
928  XML::Node ScaleNode = PropertiesNode.AppendChild("Scale");
929  this->Scale.ProtoSerialize( ScaleNode );
930 
931  return;
932  }else{
933  SerializeError("Create XML Attribute Values",Screen::GetSerializableName() + "Properties",true);
934  }
935  }
936 
938  {
940 
941  XML::Attribute CurrAttrib;
942  XML::Node PropertiesNode = SelfRoot.GetChild( Screen::GetSerializableName() + "Properties" );
943 
944  if( !PropertiesNode.Empty() ) {
945  if(PropertiesNode.GetAttribute("Version").AsInt() == 1) {
946  String WindowTitle;
947  Whole ViewZOrder = 0;
948 
949  // Get the single data type properties
950  CurrAttrib = PropertiesNode.GetAttribute("PriAtlas");
951  if( !CurrAttrib.Empty() )
952  this->PrimaryAtlas = CurrAttrib.AsString();
953 
954  CurrAttrib = PropertiesNode.GetAttribute("WindowTitle");
955  if( !CurrAttrib.Empty() )
956  WindowTitle = CurrAttrib.AsString();
957 
958  CurrAttrib = PropertiesNode.GetAttribute("ViewportZOrder");
959  if( !CurrAttrib.Empty() )
960  ViewZOrder = CurrAttrib.AsWhole();
961 
962  // Get the properties that need their own nodes
963  XML::Node VertexTransformNode = PropertiesNode.GetChild("VertexTransform").GetFirstChild();
964  if( !VertexTransformNode.Empty() )
965  this->VertexTransform.ProtoDeSerialize(VertexTransformNode);
966 
967  XML::Node ScaleNode = PropertiesNode.GetChild("Scale").GetFirstChild();
968  if( !ScaleNode.Empty() )
969  this->Scale.ProtoDeSerialize(ScaleNode);
970 
971  if( !WindowTitle.empty() ) {
973  Graphics::GameWindow* NamedWindow = GraphicsMan->GetGameWindow(WindowTitle);
974  if( NamedWindow != NULL ) {
975  this->GameViewport = NamedWindow->GetViewportByZOrder(ViewZOrder);
976  if( this->GameViewport != NULL ) {
977  this->ActDims.Size.X = (Real)this->GameViewport->GetActualWidth();
978  this->ActDims.Size.Y = (Real)this->GameViewport->GetActualHeight();
979  this->InverseSize.X = 1 / this->ActDims.Size.X;
980  this->InverseSize.Y = 1 / this->ActDims.Size.Y;
981  }else{
982  MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,"The Viewport specified via ZOrder was not found in the named GameWindow.");
983  }
984  }else{
985  MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,"The named GameWindow to be used by UI Screen was not found.");
986  }
987  }else{
988  MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,"A GameWindow Title/Caption was not specified for UI Screen.");
989  }
990  }else{
991  MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + (Screen::GetSerializableName() + "Properties") + ": Not Version 1.");
992  }
993  }else{
994  MEZZ_EXCEPTION(ExceptionBase::II_IDENTITY_NOT_FOUND_EXCEPTION,Screen::GetSerializableName() + "Properties" + " was not found in the provided XML node, which was expected.");
995  }
996  }
997 
999  { return Screen::GetSerializableName(); }
1000 
1002  { return "Screen"; }
1003 
1004  ///////////////////////////////////////////////////////////////////////////////
1005  // Internal Functions
1006 
1008  {
1009  this->Dirty = true;
1010  this->MouseStrat->_NotifyScreenDirty();
1011  }
1012 
1014  {
1015  if( this->Dirty && this->AllLayersDirty )
1016  return;
1017 
1018  this->Dirty = true;
1019  this->AllLayersDirty = true;
1020  }
1021 
1023  {
1024  Boole Force = false;
1025  if(Orientation != this->GameViewport->GetOrientationMode() ) {
1027  if(this->Orientation == Mezzanine::OM_Degree_90)
1028  VertexTransform.SetTransform(Vector3(0,0,0),Scale,Quaternion(MathTools::GetHalfPi(),Vector3::Unit_Z()));
1029  else if(this->Orientation == Mezzanine::OM_Degree_180)
1030  VertexTransform.SetTransform(Vector3(0,0,0),Scale,Quaternion(MathTools::GetPi(),Vector3::Unit_Z()));
1031  else if(this->Orientation == Mezzanine::OM_Degree_270)
1032  VertexTransform.SetTransform(Vector3(0,0,0),Scale,Quaternion(MathTools::GetPi() * 1.5,Vector3::Unit_Z()));
1033  else
1035  Force = true;
1036  }
1037  this->CheckViewportSize();
1038  this->_RenderVertices(Force);
1039  size_t KnownVertexCount = this->SID->RenderOp.vertexData->vertexCount;
1040  if(this->SID->RenderOp.vertexData->vertexCount) {
1041  if(this->TextureByVertex.size() == 0) {
1042  AtlasAndPosition MyObject;
1043  MyObject.RenderStart = 0;
1044  MyObject.RenderEnd = KnownVertexCount;
1045  MyObject.Atlas = this->PrimaryAtlas;
1046  this->TextureByVertex.push_back(MyObject);
1047  }
1048  this->PrepareRenderSystem();
1049  String CurrAtlas = this->PrimaryAtlas;
1050  for( Whole TexIndex = 0 ; TexIndex < this->TextureByVertex.size() ; ++TexIndex )
1051  {
1052  String& CurrVertAtlas = this->TextureByVertex[TexIndex].Atlas;
1053  if(CurrVertAtlas.empty()) {
1054  CurrVertAtlas = this->PrimaryAtlas;
1055  }
1056  if(CurrVertAtlas != CurrAtlas) {
1057  CurrAtlas = CurrVertAtlas;
1058  Ogre::TexturePtr TextureUse = this->UIMan->GetAtlas(CurrAtlas)->_GetTexture();
1059  this->SID->RenderSys->_setTexture(0,true,TextureUse);
1060  }
1061  this->SID->RenderOp.vertexData->vertexCount = this->TextureByVertex[TexIndex].RenderEnd - TextureByVertex[TexIndex].RenderStart;
1062  this->SID->RenderOp.vertexData->vertexStart = this->TextureByVertex[TexIndex].RenderStart;
1063  this->SID->RenderSys->_render(this->SID->RenderOp);
1064  }
1065  }
1066  }
1067 
1069  {
1070  this->Orientation = Mode;
1071  if( this->Orientation == Mezzanine::OM_Degree_90 || this->Orientation == Mezzanine::OM_Degree_270 ) {
1072  std::swap(this->ActDims.Size.X,this->ActDims.Size.Y);
1073  std::swap(this->InverseSize.X,this->InverseSize.Y);
1074  }
1075  }
1076 
1077  void Screen::_Transform(ScreenRenderData& RenderData, const Whole& Begin, const Whole& End)
1078  {
1079  static const Matrix4x4 Iden;
1080  Whole X;
1081  if( Begin != End ) {
1082  for( X = Begin ; X < End ; X++ )
1083  {
1084  RenderData[X].Vert.Position.X = ( ( RenderData[X].Vert.Position.X * this->InverseSize.X ) * 2 ) - 1;
1085  RenderData[X].Vert.Position.Y = ( ( RenderData[X].Vert.Position.Y * this->InverseSize.Y ) * -2 ) + 1;
1086  }
1087  }
1088  if( this->VertexTransform != Iden ) {
1089  for( X = Begin ; X < End ; X++ )
1090  RenderData[X].Vert.Position = this->VertexTransform * RenderData[X].Vert.Position;
1091  }
1092  }
1093 
1094  void Screen::_RenderVertices(bool Force)
1095  {
1096  if( !this->Dirty )
1097  return;
1098 
1099  Whole KnownVertexCount = 0;
1100  String CurrentName = this->PrimaryAtlas;
1101  AtlasAndPosition MyObject(this->PrimaryAtlas);
1102  this->TextureByVertex.clear();
1103 
1104  ScreenRenderData TempVertexCache;
1105  this->_AppendRenderDataCascading(TempVertexCache);
1106  KnownVertexCount = TempVertexCache.Size();
1107  this->_Transform(TempVertexCache,0,KnownVertexCount);
1108 
1109  this->ResizeVertexBuffer(KnownVertexCount);
1110  Vertex* WriteIterator = (Vertex*) this->SID->VertexBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD);
1111  for( Whole Index = 0 ; Index < TempVertexCache.Size() ; ++Index )
1112  {
1113  if( TempVertexCache[Index].Atlas.empty() ) {
1114  MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,"Null or Empty String Atlas found when rendering UI.");
1115  }
1116  if( TempVertexCache[Index].Atlas != CurrentName ) {
1117  if( Index != 0 ) {
1118  MyObject.RenderEnd = Index;
1119  this->TextureByVertex.push_back(MyObject);
1120  }
1121  MyObject.Atlas = TempVertexCache[Index].Atlas;
1122  MyObject.RenderStart = Index;
1123  CurrentName = TempVertexCache[Index].Atlas;
1124  }
1125 
1126  const Vertex& NewVertex = TempVertexCache[Index].Vert;
1127  *WriteIterator++ = NewVertex;
1128  }
1129  MyObject.RenderEnd = KnownVertexCount;
1130  MyObject.Atlas = CurrentName;
1131  this->TextureByVertex.push_back(MyObject);
1132 
1133  this->SID->VertexBuffer->unlock();
1134  this->SID->RenderOp.vertexData->vertexCount = KnownVertexCount;
1135 
1136  this->Dirty = false;
1137  }
1138  }//UI
1139 }//Mezzanine
1140 
1141 #endif
This is the factory implementation for generic widgets.
Definition: widget.h:392
static const String TypeName
String containing the type name for this class: "CheckBox".
Definition: checkbox.h:71
Attribute AppendAttribute(const Char8 *Name)
Creates an Attribute and puts it at the end of this Nodes attributes.
Thrown when duplicates of teh same identity string exist.
Definition: exception.h:95
This class represents a collection of Glyphs in a common visual style.
Definition: font.h:55
void _MarkDirty()
Marks this renderable as dirty, and informs other renderables if needed.
Definition: screen.cpp:1007
Vector2 GetTextureSize() const
Gets the size of the TextureAtlas.
const String & GetName() const
Gets the name of this renderable.
Definition: renderable.cpp:77
void Clear()
Clears all Vertex vectors.
Definition: screen.cpp:176
static const String TypeName
String containing the type name for this class: "TabSet".
Definition: tabset.h:67
A light-weight handle for manipulating attributes in DOM tree.
Definition: attribute.h:74
static const String TypeName
String containing the type name for this class: "GenericWidget".
Definition: widget.h:174
void _NotifyScreenDirty()
Notifies this that it's parent screen was altered.
This is a base class for the algorithms used by QuadRenderables to determine how they should update t...
TextureAtlas * GetAtlas(const String &AtlasName)
Gets a loaded Atlas being stored in this manager.
Definition: uimanager.cpp:286
static const String TypeName
String containing the type name for this class: "GricContainer".
This is the factory implementation for DropDownList widgets.
Definition: dropdownlist.h:173
Matrix4x4 VertexTransform
The transformation matrix used to update vertex transforms if needed.
Definition: screen.h:179
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
Definition: matrix4x4.cpp:485
This is the factory implementation for MenuEntry widgets.
Definition: menuentry.h:224
void AddWidgetFactory(WidgetFactory *ToBeAdded)
Adds/registers a widget factory with this Screen, allowing it to be constructed through this API...
Definition: screen.cpp:442
Boole IsMarkupParserRegistered(const String &ParserName) const
Checks to see if a MarkupParser has already been registsered under a specific name.
Definition: uimanager.cpp:484
std::vector< VertexData > Vertices
Container storing all of the vertices to be rendered.
Definition: screen.h:119
Graphics::Viewport * GameViewport
A pointer to the viewport this screen is bound to.
Definition: screen.h:202
bool Boole
Generally acts a single bit, true or false.
Definition: datatypes.h:173
virtual Widget * FindHoveredWidget(const Vector2 &MousePos)
Gets the quad the mouse is over if any.
Definition: screen.cpp:422
String Atlas
The name of the atlas to be rendered with.
Definition: screen.h:92
This class contains utilities and functions to allow the manipulation of the Graphical scene...
Definition: scenemanager.h:85
This is the factory implementation for GridContainer widgets.
Basic class describing a vertex in the UI to be rendered.
Definition: vertex.h:53
const String & GetWindowCaption() const
Gets the the text in the titlebar.
Definition: gamewindow.cpp:379
virtual RadioButton * CreateRadioButton(const String &RendName)
Creates a RadioButton.
Definition: screen.cpp:658
virtual Graphics::SceneManager * GetSceneManager() const
Gets a pointer to the SceneManager connected to this screens viewport.
Definition: screen.cpp:257
This is the factory implementation for ListBox widgets.
Definition: listbox.h:282
virtual void SetPrimaryAtlas(const String &Atlas)
Sets the Atlas to be assumed when one isn't provided for atlas related tasks.
Definition: screen.cpp:877
Ogre::TexturePtr _GetTexture()
Gets the texture being used by this Atlas.
This is the factory implementation for HorizontalScrollbar widgets.
void _RenderVertices(bool Force=false)
Prepares all vertices for rendering to the screen.
Definition: screen.cpp:1094
virtual VerticalContainer * CreateVerticalContainer(const String &RendName)
Creates a widget container aligned on the Y axis.
Definition: screen.cpp:840
This is a container class for placing child objects on a 2 dimensional grid.
Vector2 GetTextureSize(const String &Atlas) const
Gets the texture size of the specified Atlas.
Definition: screen.cpp:892
SpinnerStyle
Used by the spinner class to determine what styling should be used for the spinner.
Vector2 Size
Vector2 representing the width and height of the rect.
Definition: rect.h:71
virtual Boole IsVisible() const
Gets whether or not this renderable is being drawn.
Definition: screen.cpp:370
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
static const String TypeName
String containing the type name for this class: "MenuEntry".
Definition: menuentry.h:77
static const String TypeName
String containing the type name for this class: "ListBox".
Definition: listbox.h:77
GameWindow * GetGameWindow(const Whole &Index) const
Gets a game window by index.
virtual Whole GetNumWidgets()
Gets the number of widgets being used in this screen.
Definition: screen.cpp:580
This is the factory implementation for StackButton widgets.
Definition: stackbutton.h:125
Whole Size()
Gets the combined size of all Vertex vectors.
Definition: screen.cpp:179
UIManager * UIMan
A pointer to the UIManager that owns this screen.
Definition: screen.h:199
virtual const String & GetTypeName() const
Gets the type of widget this is.
Definition: widget.cpp:156
virtual CheckBox * CreateCheckBox(const String &RendName)
Creates a CheckBox.
Definition: screen.cpp:672
Thrown when the requested identity could not be found.
Definition: exception.h:94
virtual EditBox * CreateEditBox(const String &RendName, const RenderLayerType EditLayerType, FontData *EditFont)
Creates a EditBox.
Definition: screen.cpp:686
Integer GetZOrder() const
Gets the Zorder assigned to this viewport.
Definition: viewport.cpp:96
Node GetFirstChild() const
Get the first child Node of this Node.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
Definition: exception.h:3048
void Append(ScreenRenderData &OtherData)
Appends the contents of another ScreenRenderData to the end of this.
Definition: screen.cpp:182
virtual TabSet * CreateTabSet(const String &RendName)
Creates a TabSet.
Definition: screen.cpp:784
virtual void SetMousePassthrough(Boole Enable)
Sets whether or not this quad should be skipped when determining if the mouse is hovered over this qu...
This class stores how the calls to Render are to be done.
Definition: screen.h:89
This is a button with additional data used to track the binding to a StackedContainer which can be se...
Definition: stackbutton.h:54
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
Definition: exception.h:112
Vector3 Scale
The scaling to be applied to all vertices that are generated by this screen.
Definition: screen.h:186
static const String TypeName
String containing the type name for this class: "RadioButton".
Definition: radiobutton.h:134
const Char8 * AsString(const Char8 *def="") const
Attempts to convert the value of the attribute to a String and returns the results.
virtual WorldManager * GetCreator() const
Gets a pointer to this proxies creator.
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
virtual void CreateVertexBuffer(const Whole &InitialSize)
Creates a new Vertex Buffer for vertices generated by the UI system.
Definition: screen.cpp:302
Boole Visible
Stores whether this Renderable is to be rendered (also dependent on parent visibility).
Definition: renderable.h:75
A 4x4 matrix math class for the representation of full transforms.
Definition: matrix4x4.h:59
virtual void SetMouseHoverStrategy(MouseHoverStrategy *Strategy)
Sets the strategy to use when detect which object the mouse is hovered over.
Definition: screen.cpp:407
This is a collection of smaller textures packed into a larger texture, intended to increase UI perfor...
Definition: textureatlas.h:71
virtual void Hide()
Forces this renderable to hide.
Definition: screen.cpp:376
WidgetContainer::iterator WidgetIterator
Iterator type for Widget instances stored by this class.
Definition: screen.h:148
FontData * GetFont(const String &FontName, const String &Atlas) const
Gets the specified FontData from an Atlas.
Definition: screen.cpp:889
void _SetScreen(Screen *Parent)
Sets the parent screen.
This class represents a box shaped area on the screen.
Definition: rect.h:55
virtual UIManager * GetManager() const
Gets the UIManager this screen belongs to.
Definition: screen.cpp:401
ScrollbarStyle
Used by the scrollbar class to determine what styling should be used for the scrollbar.
This is a widget that stores sets of renderables but only displays one at a time. ...
Definition: tabset.h:54
bool Empty() const
Is this storing anything at all?
Whole GetActualWidth() const
Gets the width of the viewport in pixels.
Definition: viewport.cpp:147
This implements the exception hiearchy for Mezzanine.
virtual const Vector2 & GetViewportDimensions() const
Gets the current viewport dimensions.
Definition: screen.cpp:382
This is a simple widget for a numeric variable in a box.
Definition: spinner.h:130
Boole AllLayersDirty
Determines whether or not this Quad needs all of it's layers refreshed. Usually after a transform upd...
ChildContainer ChildWidgets
This is a container storing all the children that belong to this Quad.
This is the factory implementation for CheckBox widgets.
Definition: checkbox.h:150
This is the factory implementation for VerticalScrollbar widgets.
virtual void SetVisible(Boole CanSee)
Sets the visibility of this renderable.
Definition: screen.cpp:364
Rect ActDims
The actual (pixel) position and size of this Quad on the screen it belongs to.
This is the factory implementation for RadioButton widgets.
Definition: radiobutton.h:221
float Real
A Datatype used to represent a real floating point number.
Definition: datatypes.h:141
virtual void Show()
Forces this renderable to be shown.
Definition: screen.cpp:373
bool SetValue(const Char8 *rhs)
Set the value of this.
String PrimaryAtlas
The name of the this screens primary atlas for texture lookups.
Definition: screen.h:182
void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
Definition: matrix4x4.cpp:513
This class represents a 2D rect which can express the size and position of a renderable on screen...
Definition: unifieddim.h:661
Whole AsWhole(Whole def=0) const
Attempts to convert the value of the attribute to a Whole and returns the results.
virtual void DestroyVertexBuffer()
Destroys the Vertex Buffer storing all the UI vertices generated by this screen.
Definition: screen.cpp:332
void _Transform(ScreenRenderData &RenderData, const Whole &Begin, const Whole &End)
Updates the vertex positions so they are in front of the camera in world space.
Definition: screen.cpp:1077
void DestroyAllWidgetFactories()
Destroys all widget factories in this Screen.
Definition: screen.cpp:474
static UIManager * GetSingletonPtr()
Fetches a pointer to the singleton.
Definition: singleton.h:97
This class is for creating and managing viewports within a game window.
Definition: viewport.h:65
Vector2 GetWhitePixel(const String &Atlas) const
Gets the position of the white pixel from an Atlas.
Definition: screen.cpp:883
Real Y
Coordinate on the Y vector.
Definition: vector2.h:69
This is the base class for a method of finding which quad the mouse is hovered over.
This strategy uses a brute force reverse search for the hovered quad.
Definition: brutestrategy.h:55
This file contains the declaration for the World proxy wrapping camera functionality.
virtual void DestroyWidget(Widget *ToBeDestroyed)
Destroys a widget.
Definition: screen.cpp:585
static const String TypeName
String containing the type name for this class: "VerticalContainer".
void _SetOrientation(const Mezzanine::OrientationMode &Mode)
Forces an orientation mode change for this screen.
Definition: screen.cpp:1068
A light-weight handle for manipulating nodes in DOM tree.
Definition: node.h:89
Whole RenderEnd
The index of the last verticy to be rendered.
Definition: screen.h:98
static const String TypeName
String containing the type name for this class: "DropDownList".
Definition: dropdownlist.h:63
virtual DropDownList * CreateDropDownList(const String &RendName, const UI::ScrollbarStyle Style)
Creates a DropDownList.
Definition: screen.cpp:812
GameWindow * GetParentWindow() const
Gets the game window this viewport belongs to.
Definition: viewport.cpp:90
static const String TypeName
String containing the type name for this class: "StackButton".
Definition: stackbutton.h:58
Real X
Coordinate on the X vector.
Definition: vector2.h:67
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
Vector2 MouseHitPosition
The pixel position on this screen where the mouse clicked on a Widget.
Definition: screen.h:189
This is used to represent a point on a 2 dimentional area, such as a screen.
Definition: vector2.h:63
static const String TypeName
String containing the type name for this class: "EditBox".
Definition: editbox.h:64
bool Empty() const
Is this storing anything at all?
virtual WidgetFactory * GetWidgetFactoryExcept(const String &WidgetTypeName)
Gets a registered WidgetFactory that creates the specified type of widget. a widget factor of the spe...
Definition: screen.cpp:273
This is the base class for all widgets.
Definition: widget.h:126
Sprite * GetSprite(const String &SpriteName, const String &Atlas) const
Gets a sprite from an Atlas.
Definition: screen.cpp:886
static const String TypeName
String containing the type name for this class: "Button".
Definition: button.h:91
virtual void ProtoSerializeProperties(XML::Node &SelfRoot) const
Convert the properties of this class to an XML::Node ready for serialization.
Definition: screen.cpp:916
This is the factory implementation for TabSet widgets.
Definition: tabset.h:184
virtual Spinner * CreateSpinner(const String &RendName, const SpinnerStyle SpinStyle, FontData *EditFont)
Creates a Spinner.
Definition: screen.cpp:742
VertexData & operator[](const Whole &Index)
Array access operator spanning all 3 Vertex vectors.
Definition: screen.cpp:185
Whole GetActualHeight() const
Gets the height of the viewport in pixels.
Definition: viewport.cpp:150
virtual RenderableType GetRenderableType() const
Gets the type of renderable this is.
Definition: screen.cpp:379
static const String TypeName
String containing the type name for this class: "HorizontalScrollbar".
ScreenInternalData * SID
A pointer to the class storing all sensative internal data THAT IS NOT FOR YOUR EYES! ...
Definition: screen.h:196
virtual void ProtoDeSerializeProperties(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite the properties of this object with it...
Definition: screen.cpp:937
Real GetTexelOffsetX() const
Gets the X axis Texel Offset for the current rendersystem.
Definition: screen.cpp:898
virtual GridContainer * CreateGridContainer(const String &RendName)
Creates a widget container for the placement of widgets on a 2D grid.
Definition: screen.cpp:854
This is the factory implementation for VerticalContainer widgets.
TextureAtlas * GetAtlas(const String &Atlas) const
Gets an atlas that has been loaded.
Definition: screen.cpp:895
A layout container that aligns it's children along a common Y axis.
void SetValues(const Real &x, const Real &y)
Sets the X and Y values of this vector2.
Definition: vector2.cpp:105
This is a scrollbar class aligned on the X axis.
This class is an entry for a single window/widget in a menu.
Definition: menuentry.h:57
Screen(const String &RendName, const String &Atlas, Graphics::Viewport *WindowViewport, UIManager *Manager)
Internal constructor.
Definition: screen.cpp:191
Thrown when the available information should have worked but failed for unknown reasons.
Definition: exception.h:113
MouseHoverStrategy * MouseStrat
A pointer to the strategy to be used when detecting the hovered widget.
Definition: screen.h:205
virtual void ResizeVertexBuffer(const Whole &RequestedSize)
Resizes the Vertex Buffer.
Definition: screen.cpp:339
WidgetFactoryContainer WidgetFactories
A container storing all the factories for the widgets supported by this screen.
Definition: screen.h:172
void AddAllDefaultWidgetFactories()
Adds all the default widget factories provided by the engine to the Screen.
Definition: screen.cpp:483
virtual void _AppendRenderDataCascading(ScreenRenderData &RenderData)
Appends the vertices of this renderable to another vector, and then does the same for this renderable...
Thrown when parameters are checked at runtime and found invalid.
Definition: exception.h:108
virtual void _SetLayoutStrat(LayoutStrategy *ToSet)
Sets a new LayoutStrategy for this quad to use.
virtual void CheckViewportSize()
Checks to see if the viewport has changed in size. If so it updates all the UI elements on the screen...
Definition: screen.cpp:385
This is the proxy class for placing and manipulating a camera in the scene.
Definition: cameraproxy.h:65
virtual Widget * FindHoveredWidget(const Vector2 &MousePos)=0
Finds the hovered quad for the parent screen.
Basic class describing a vertex in the UI to be rendered.
Definition: vertex.h:65
void ProtoDeSerialize(const XML::Node &OneNode)
Take the data stored in an XML and overwrite this instance of this object with it.
Definition: vector3.cpp:614
This is the factory implementation for Spinner widgets.
Definition: spinner.h:319
virtual MenuEntry * CreateMenuEntry(const String &RendName)
Creates a MenuEntry.
Definition: screen.cpp:770
virtual HorizontalScrollbar * CreateHorizontalScrollbar(const String &RendName, const UI::ScrollbarStyle Style)
Creates a Scrollbar aligned on the X axis.
Definition: screen.cpp:714
virtual String GetPrimaryAtlas()
Gets the currently set primary atlas.
Definition: screen.cpp:880
static Vector3 Unit_Z()
Gets a vector representing the Z unit of a Vector3.
Definition: vector3.cpp:137
CameraProxy * GetCamera() const
Gets the CameraProxy associated with this viewport.
Definition: viewport.cpp:87
virtual void _MarkAllLayersDirty()
Tells this QuadRenderable that all of it's layers are dirty.
Definition: screen.cpp:1013
virtual Graphics::Viewport * GetViewport() const
Gets the Viewport this screen is currently rendering to.
Definition: screen.cpp:398
Thrown when the identity string wasn't valid at all.
Definition: exception.h:93
RenderLayerType
This enum describes the type of RenderLayer this is for use in casting.
Ogre::SceneManager * _GetGraphicsWorldPointer() const
Gets the internal Ogre Scene Manager pointer.
This is used to represent a point in space, or a vector through space.
Definition: vector3.h:77
virtual ListBox * CreateListBox(const String &RendName, const UI::ScrollbarStyle Style)
Creates a ListBox.
Definition: screen.cpp:798
This class is responsible for any and all user interactions with the User interface/HUD.
Definition: uimanager.h:114
virtual Widget * GetWidget(const String &Name)
Gets a widget in this screen by name.
Definition: screen.cpp:573
This is intended to store basic graphics setting for the user.
virtual Button * CreateButton(const String &RendName)
Creates a Button.
Definition: screen.cpp:630
Sprite * GetSprite(const String &SpriteName) const
Gets a Sprite by name.
MarkupParser * GetMarkupParser(const String &ParserName) const
Gets a MarkupParser by it's registered name.
Definition: uimanager.cpp:490
The bulk of the engine components go in this namspace.
Definition: actor.cpp:56
This class stores all vertices pertaining to a layer sorted by their priority for rendering...
Definition: screen.h:115
OrientationMode
Simple enum for communicating the orientation the UI and Camera have relative to the world it is rend...
Definition: enumerations.h:66
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
Definition: datatypes.h:151
A layout container that aligns it's children along a common X axis.
void RemoveWidgetFactory(WidgetFactory *ToBeRemoved)
Removes a widget factory from this Screen.
Definition: screen.cpp:447
static const String TypeName
String containing the type name for this class: "VerticalScrollbar".
virtual String GetDerivedSerializableName() const
Gets the most derived serializable name of this Renderable.
Definition: screen.cpp:998
virtual Boole GetVisible() const
Gets the visibility setting of this renderable.
Definition: screen.cpp:367
WidgetContainer Widgets
A container storing all the created Widgets owned by this screen.
Definition: screen.h:175
ChildContainer::iterator ChildIterator
Iterator type for Widget instances stored by this class.
virtual void PrepareRenderSystem()
Sets up all the necessary projection and world matrices for UI rendering.
Definition: screen.cpp:292
virtual const Vector2 & GetMouseHitPosition() const
Gets the mouse position from the last call to "FindHoveredQuad(const Vector2&).
Definition: screen.cpp:434
This class is a helper class, specifically for use as a button.
Definition: button.h:66
virtual void ProtoDeSerialize(const XML::Node &SelfRoot)
Take the data stored in an XML Node and overwrite this object with it.
Boole Dirty
Stores whether this Renderables vertices need to be regenerated.
Definition: renderable.h:78
Vector2 GetWhitePixel() const
Gets the location of the WhitePixel on the TextureAtlas.
This is the factory implementation for EditBox widgets.
Definition: editbox.h:207
FontData * GetFont(const String &FontName) const
Gets the set of Glyphs of the specified name.
This is a base class for the parsing of markup texts contained in text layers.
Definition: markupparser.h:126
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
This is a simple widget for storing a bool value.
Definition: checkbox.h:55
Mezzanine::OrientationMode Orientation
The current orientation mode of this screen.
Definition: screen.h:209
This is a scrollbar class aligned on the Y axis.
This is used to store information about rotation in 3d space.
Definition: quaternion.h:68
Whole RenderStart
The index of the first verticy to be rendered.
Definition: screen.h:96
This represents a nestable quad for an object in a GUI layout.
static const String TypeName
String containing the type name for this class: "Spinner".
Definition: spinner.h:134
virtual String GetWidgetTypeName() const =0
Gets the name of the Widget that is created by this factory.
virtual void UpdateDimensions()
Updates the dimensions of this QuadRenderable based on the transform of it's parent.
This is a simple widget where only one of it's selections can be selected at a time.
Definition: radiobutton.h:130
void _RenderScreen()
Manually calls the UI system to render this screen.
Definition: screen.cpp:1022
void SerializeError(const String &FailedTo, const String &ClassName, Boole SOrD)
Simply does some string concatenation, then throws an Exception.
This is the factory implementation for HorizontalContainer widgets.
virtual void DestroyAllWidgets()
Destroys all widgets being stored by this screen.
Definition: screen.cpp:599
virtual ~Screen()
Class destructor.
Definition: screen.cpp:252
virtual VerticalScrollbar * CreateVerticalScrollbar(const String &RendName, const UI::ScrollbarStyle Style)
Creates a Scrollbar aligned on the Y axis.
Definition: screen.cpp:728
TextureVertexContainer TextureByVertex
A container storing a mapping of the textures needed to render each section of vertices.
Definition: screen.h:166
bool IsMarkupParserRegistered(const String &ParserName) const
Checks to see if a MarkupParser has already been registsered under a specific name.
Definition: screen.cpp:907
virtual Widget * CheckAndInsertExcept(Widget *ToInsert)
Verifies uniqueness of a widget and inserts it if it is. a widget with the same name already exists i...
Definition: screen.cpp:283
Node AppendChild(NodeType Type=NodeElement)
Creates a Node and makes it a child of this one.
std::map< String, String > NameValuePairMap
This is a datatype mostly used for describing settings or parameters that can't be declared in advanc...
Definition: datatypes.h:209
WidgetFactoryContainer::iterator WidgetFactoryIterator
Iterator type for Widget instances stored by this class.
Definition: screen.h:154
This is the factory implementation for Button widgets.
Definition: button.h:239
void DestroyWidgetFactory(WidgetFactory *ToBeDestroyed)
Removes and destroys a widget factory in this Screen.
Definition: screen.cpp:460
Basic class used to describe a portion of a texture to be applied to a Quad.
Definition: sprite.h:55
std::string String
A datatype used to a series of characters.
Definition: datatypes.h:159
virtual StackButton * CreateStackButton(const String &RendName)
Creates a StackButton.
Definition: screen.cpp:644
Real GetTexelOffsetY() const
Gets the Y axis Texel Offset for the current rendersystem.
Definition: screen.cpp:901
RenderableType
A small enum to describe the type of renderable this is.
Definition: renderable.h:62
UI::MarkupParser * GetMarkupParser(const String &ParserName) const
Gets a MarkupParser by it's registered name.
Definition: screen.cpp:910
Viewport * GetViewportByZOrder(const Integer ZOrder) const
Gets a viewport by ZOrder.
Definition: gamewindow.cpp:218
static String GetSerializableName()
Get the name of the the XML tag the Renderable class will leave behind as its instances are serialize...
Definition: screen.cpp:1001
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.
void SetTransform(const Vector3 &Position, const Vector3 &Scale, const Quaternion &Rotation)
Sets the Matrix based on a provided position, scale, and rotation.
Definition: matrix4x4.cpp:84
This class is for creating and managing game windows.
Definition: gamewindow.h:63
static const String TypeName
String containing the type name for this class: "HorizontalContainer".
This is a base class for factories that construct the widgets available to the UI subsystem...
Definition: widgetfactory.h:61
Mezzanine::OrientationMode GetOrientationMode() const
Gets the current Orientation of the viewport.
Definition: viewport.cpp:99
Vector2 InverseSize
The inverse size (1/size) of the viewport this screen is bound to in pixels.
Definition: screen.h:192
void ProtoSerialize(XML::Node &CurrentRoot) const
Convert this class to an XML::Node ready for serialization.
Definition: vector3.cpp:588
This is a widget that displays one selection from a list that can have it's visibility toggled...
Definition: dropdownlist.h:59
Node GetChild(const Char8 *Name) const
Attempt to get a child Node with a given name.
This is a widget for displaying a list of captions in a box.
Definition: listbox.h:63
virtual MouseHoverStrategy * GetMouseHoverStrategy() const
Gets the MouseHoverStrategy currently being used by this screen.
Definition: screen.cpp:417
virtual Widget * CreateWidget(const XML::Node &WidgetNode)
Creates a widget from an XML::Node.
Definition: screen.cpp:542
virtual HorizontalContainer * CreateHorizontalContainer(const String &RendName)
Creates a widget container aligned on the X axis.
Definition: screen.cpp:826
Widget for handling the input and manipulation of text.
Definition: editbox.h:60