AaronCameron.net
I care not for your petty politics.
Not a Member? - Login or Create an Account
Sunday the 20th of May 2012 @ 04:43pm
Front Page Journal Projects Your Profile About
[]

LibN2L-4 Library Code Reference

Classes
Compounds
Files
Members
Method Index
Full Reference

cGuiCanvas.h

Go to the documentation of this file.
00001 /************************************************************************
00002 Nova-2 Library (libN2L, or simply n2l) Game development C++ Library
00003 Copyright (C) 2002  Aaron Cameron
00004 
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation; either
00008 version 2.1 of the License, or (at your option) any later version.
00009 
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 Lesser General Public License for more details.
00014 
00015 You should have received a copy of the GNU Lesser General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00018 
00019 A copy of the GNU Lesser General Public License has been provided with
00020 this library in the file 'COPYING'.
00021 
00022 Contact information for the author of this library has been provided
00023 with this library in the file 'AUTHOR'.
00024 ************************************************************************/
00025 #ifndef _n2l4_cGuiCanvas_H
00026 #define _n2l4_cGuiCanvas_H
00027 
00028 #include <map>
00029 #include <vector>
00030 
00031 #include "n2l/n2l.h"
00032 
00033 #include "gui/types.h"
00034 #include "gui/cGuiElement.h"
00035 
00036 namespace n2l
00037 {
00038     class cVfsNodeInterface;
00039     class cDynVar;
00040 
00041     /**************************************************************************/
00045     class cGuiCanvas : public cGuiElement
00046     {
00047     public:
00048         cGuiCanvas();
00049         cGuiCanvas( const tGuiPos &iPos, const tGuiPos &iSize );
00050 
00051         cGuiCanvas( const cVfsNodeInterface &iNode );
00052         cGuiCanvas( const cDynVar &iDefinition );
00053 
00054         virtual ~cGuiCanvas();
00055 
00056         void load( const cVfsNodeInterface &iNode );
00057         void load( const cDynVar &iDefinition );
00058 
00059         void add( const tGuiName &iName,
00060             const cAutoPtr<cGuiElement> &i_ioElement );
00061 
00062         virtual const cAutoPtr<cGuiElement> remove( const tGuiName &iName );
00063 
00064         virtual const cAutoPtr<cGuiElement> get( const tGuiName &iName );
00065 
00066         virtual tOElementList getByType( const type_info &iType );
00067 
00068         virtual tOElementList &getByType( tOElementList &oList,
00069             const type_info &iType );
00070 
00073         void clipping( const tBool iClip );
00074 
00077         const tBool clipping() const;
00078 
00081         void innerOffset( const tGuiPos &iPos );
00082 
00085         const tGuiPos & innerOffset() const;
00086 
00089         void clear();
00090 
00091         virtual void systemEvent(
00092             const cAutoPtr<const cEventInterface> &i_iEvent );
00093 
00094         virtual void systemEventOutside(
00095             const cAutoPtr<const cEventInterface> &i_iEvent );
00096 
00097         virtual void update( const tUint iTimePassed );
00098 
00103         virtual void dropAllFocus( const cGuiElement *const ioFrom );
00104 
00108         virtual void focusForward();
00109 
00113         virtual void focusBack();
00114 
00115         virtual void draw() const;
00116 
00117         virtual const cAutoPtr<cGuiElement> clone() const;
00118 
00119         virtual const tBool hasChildren() const;
00120 
00121         virtual void enabled( const tBool iEnabled );
00122         virtual const tBool enabled() const { return mEnabled; }
00123 
00124         virtual void prop( const tString &iName, const cDynVar &iVal,
00125             const tString &iInnerKey = "" );
00126         virtual const cDynVar prop( const tString &iName,
00127             const tString &iInnerKey = "" ) const;
00128 
00129 
00130     protected:
00131         virtual void cloneInto(
00132             const cAutoPtr<cGuiCanvas> &i_ioElement ) const;
00133 
00134     private:
00135         typedef std::map<tGuiName,tUint > tElementLookup;
00136         typedef std::vector<cAutoPtr<cGuiElement> > tElementFocusOrder;
00137         typedef std::vector<cAutoPtr<cGuiElement> > tElementList;
00138         typedef std::vector<tUint> tElementIDList;
00139         typedef std::map<tSint,tElementIDList> tRenderOrder;
00140 
00141         tElementList mElements;
00142         tElementLookup mElementLookup;
00143         tElementFocusOrder mFocusOrder;
00144         tRenderOrder mRenderOrder;
00145 
00150         tGuiPos mInnerOffset;
00151 
00160         tBool mClipping;
00161 
00166         tBool mEnabled;
00167 
00168 #       ifdef N2L_PASSIVE_GUI_REG
00169             static tBool smRegistered;
00170 #       endif
00171 
00172 
00173         virtual void _real_remove( const tGuiName &iName );
00174      }; // class cGuiCanvas
00175 
00176 } // namespace n2l
00177 
00178 #endif
©2012 Aaron Cameron