ISchemeManager: Difference between revisions
Jump to navigation
Jump to search
m (→See Also) |
m (minoro) |
||
Line 1: | Line 1: | ||
This interface has major implementation with [[VGUI2]]. | This interface has major implementation with [[VGUI2]]. | ||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// | |||
//======================= Copyright © 1996-2005, Valve Corporation, All rights reserved. =======================// | |||
// | // | ||
// Purpose: | // Purpose: | ||
// | // | ||
// $NoKeywords: $ | // $NoKeywords: $ | ||
//=============================================================================// | //==============================================================================================================// | ||
#ifndef ISCHEME_H | #ifndef ISCHEME_H | ||
Line 32: | Line 33: | ||
public: | public: | ||
// loads a scheme from a file | // loads a scheme from a file | ||
// first scheme loaded becomes the default scheme, and all subsequent loaded scheme are | // first scheme loaded becomes the default scheme, and all subsequent loaded scheme are derivatives of that | ||
virtual HScheme [[LoadSchemeFromFile]](const char *fileName, const char *tag) = 0; | virtual HScheme [[LoadSchemeFromFile]](const char *fileName, const char *tag) = 0; | ||
Line 62: | Line 63: | ||
virtual void [[Shutdown]]( bool full = true ) = 0; | virtual void [[Shutdown]]( bool full = true ) = 0; | ||
// gets the proportional coordinates for doing screen-size | // gets the proportional coordinates for doing screen-size independent panel layouts | ||
// use these for font, image and panel size scaling (they all use the pixel height of the display for scaling) | // use these for font, image and panel size scaling (they all use the pixel height of the display for scaling) | ||
virtual int [[GetProportionalScaledValue]](int normalizedValue) = 0; | virtual int [[GetProportionalScaledValue]](int normalizedValue) = 0; | ||
Line 75: | Line 76: | ||
#endif // ISCHEME_H | #endif // ISCHEME_H | ||
==See | |||
== See also == | |||
* {{doxygen|_i_scheme_8h-source.html IScheme.h on HL2 SDK Doxygen}} | * {{doxygen|_i_scheme_8h-source.html IScheme.h on HL2 SDK Doxygen}} | ||
[[Category:Interfaces]] | [[Category:Interfaces]] |
Revision as of 14:10, 4 February 2008
This interface has major implementation with VGUI2.
//======================= Copyright © 1996-2005, Valve Corporation, All rights reserved. =======================// // // Purpose: // // $NoKeywords: $ //==============================================================================================================// #ifndef ISCHEME_H #define ISCHEME_H #ifdef _WIN32 #pragma once #endif #include <vgui/VGUI.h> #include "interface.h" class Color; namespace vgui { typedef unsigned long HScheme; typedef unsigned long HTexture; class IBorder; class IImage; class ISchemeManager: public IBaseInterface { public: // loads a scheme from a file // first scheme loaded becomes the default scheme, and all subsequent loaded scheme are derivatives of that virtual HScheme LoadSchemeFromFile(const char *fileName, const char *tag) = 0; // reloads the scheme from the file - should only be used during development virtual void ReloadSchemes() = 0; // reloads scheme fonts virtual void ReloadFonts() = 0; // returns a handle to the default (first loaded) scheme virtual HScheme GetDefaultScheme() = 0; // returns a handle to the scheme identified by "tag" virtual HScheme GetScheme(const char *tag) = 0; // returns a pointer to an image virtual IImage *GetImage(const char *imageName, bool hardwareFiltered) = 0; virtual HTexture GetImageID(const char *imageName, bool hardwareFiltered) = 0; // This can only be called at certain times, like during paint() // It will assert-fail if you call it at the wrong time... // FIXME: This interface should go away!!! It's an icky back-door // If you're using this interface, try instead to cache off the information // in ApplySchemeSettings virtual IScheme *GetIScheme( HScheme scheme ) = 0; // unload all schemes virtual void Shutdown( bool full = true ) = 0; // gets the proportional coordinates for doing screen-size independent panel layouts // use these for font, image and panel size scaling (they all use the pixel height of the display for scaling) virtual int GetProportionalScaledValue(int normalizedValue) = 0; virtual int GetProportionalNormalizedValue(int scaledValue) = 0; }; #define VGUI_SCHEME_INTERFACE_VERSION "VGUI_Scheme010" } // namespace vgui #endif // ISCHEME_H