diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/hlfaceposer/choreowidget.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'utils/hlfaceposer/choreowidget.h')
| -rw-r--r-- | utils/hlfaceposer/choreowidget.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/utils/hlfaceposer/choreowidget.h b/utils/hlfaceposer/choreowidget.h new file mode 100644 index 0000000..275ea40 --- /dev/null +++ b/utils/hlfaceposer/choreowidget.h @@ -0,0 +1,79 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// +#ifndef CHOREOWIDGET_H +#define CHOREOWIDGET_H +#ifdef _WIN32 +#pragma once +#endif + +#include <mxtk/mx.h> + +class CChoreoView; +class CChoreoScene; +class CChoreoWidgetDrawHelper; + +//----------------------------------------------------------------------------- +// Purpose: CChoreoWidgets are mxWindows that we show in the Choreography view area +// so that we can manipulate them with the mouse. The widgets follow the scene +// hierarchy of actors/channels/events, without having to hang off of the underlying +// data. They are just for the UI. +//----------------------------------------------------------------------------- +class CChoreoWidget +{ +public: + // memory handling, uses calloc so members are zero'd out on instantiation + void *operator new( size_t stAllocateBlock ); + void operator delete( void *pMem ); + + CChoreoWidget( CChoreoWidget *parent ); + virtual ~CChoreoWidget( void ); + + // All widgets implement these pure virtuals + + // Called to force a widget to create its children based on the scene data + virtual void Create( void ) = 0; + // Force widget to redo layout of self and any children + virtual void Layout( RECT& rc ) = 0; + // Redraw the widget + virtual void redraw( CChoreoWidgetDrawHelper& drawHelper ) = 0; + // Don't overdraw background + virtual bool PaintBackground( void ) { return false; }; + // Determine height to reserver for widget ( Actors can be expanded or collapsed, e.g. ) + virtual int GetItemHeight( void ); + + virtual void LocalToScreen( int& mx, int& my ); + + virtual bool IsSelected( void ); + virtual void SetSelected( bool selected ); + + virtual void setBounds( int x, int y, int w, int h ); + virtual int x( void ); + virtual int y( void ); + virtual int w( void ); + virtual int h( void ); + virtual CChoreoWidget *getParent( void ); + virtual void setVisible( bool visible ); + virtual bool getVisible( void ); + + virtual void getBounds( RECT& bounds ); + virtual RECT &getBounds( void ); + + // Globally accessible scene and view pointers + static CChoreoScene *m_pScene; + static CChoreoView *m_pView; + +private: + bool m_bSelected; + bool m_bVisible; + + RECT m_rcBounds; + +protected: + CChoreoWidget *m_pParent; +}; + +#endif // CHOREOWIDGET_H |