graphicstoolkit.cpp

来自「这是VCF框架的代码」· C++ 代码 · 共 891 行 · 第 1/5 页

CPP
891
字号
//GraphicsToolKit.cpp/*Copyright 2000-2004 The VCF Project.Please see License.txt in the top level directorywhere you installed the VCF.*/#include "vcf/GraphicsKit/GraphicsKit.h"#include "vcf/GraphicsKit/GraphicsKitPrivate.h"#include "vcf/GraphicsKit/JPEGLoader.h"#include "vcf/GraphicsKit/PNGLoader.h"using namespace VCF;GraphicsToolkit::GraphicsToolkit(){	GraphicsToolkit::graphicsToolkitInstance = this;	initContentTypes();	colorNameMap_       = new MapStringColorName();	systemColorNameMap_ = new MapStringColorName();	initColorMap();	fontInfoContainer_.initContainer( availableSystemFonts_ );		}GraphicsToolkit::~GraphicsToolkit(){	destroySystemColorNameMap();	std::map<unsigned long,Color*>::iterator it = systemColors_.begin();	while ( it != systemColors_.end() ){		delete it->second;		it++;	}	systemColors_.clear();	destroyColorMaps();	std::map<String,ImageLoader*>::iterator it3 = imageLoaders_.begin();	while ( it3 != imageLoaders_.end() ){		delete it3->second;		it3->second = NULL;		it3 ++;	}	imageLoaders_.clear();	availableSystemFonts_.clear();}ContextPeer* GraphicsToolkit::createContextPeer( const unsigned long& width, const unsigned long& height ){	return GraphicsToolkit::graphicsToolkitInstance->internal_createContextPeer( width, height );}ContextPeer* GraphicsToolkit::createContextPeer( OSHandleID contextID ){	return GraphicsToolkit::graphicsToolkitInstance->internal_createContextPeer( contextID );}FontPeer* GraphicsToolkit::createFontPeer( const String& fontName ){	return GraphicsToolkit::graphicsToolkitInstance->internal_createFontPeer( fontName );}FontPeer* GraphicsToolkit::createFontPeer( const String& fontName, const double& pointSize ){	return GraphicsToolkit::graphicsToolkitInstance->internal_createFontPeer( fontName, pointSize );}Image* GraphicsToolkit::createImage( const unsigned long& width, const unsigned long& height, const Image::ImageType& imageType ){	return GraphicsToolkit::graphicsToolkitInstance->internal_createImage( width, height, imageType );}Image* GraphicsToolkit::createImage( GraphicsContext* context, Rect* rect, const Image::ImageType& imageType ){	return GraphicsToolkit::graphicsToolkitInstance->internal_createImage( context, rect, imageType );}Image* GraphicsToolkit::createImage( const String& fileName ){	return GraphicsToolkit::graphicsToolkitInstance->internal_createImage( fileName );}PrintSessionPeer* GraphicsToolkit::createPrintSessionPeer(){	return GraphicsToolkit::graphicsToolkitInstance->internal_createPrintSessionPeer();}GraphicsResourceBundle* GraphicsToolkit::getResourceBundle(){	return dynamic_cast<GraphicsResourceBundle*>( System::getResourceBundle() );}void GraphicsToolkit::saveImage( const String& fileName, Image* image ){	GraphicsToolkit::graphicsToolkitInstance->internal_saveImage( fileName, image );}void GraphicsToolkit::registerImageLoader( const String& name, ImageLoader* imageLoader ){	GraphicsToolkit::graphicsToolkitInstance->internal_registerImageLoader( name, imageLoader );}ImageLoader* GraphicsToolkit::getImageLoader( const String& contentType ){	return GraphicsToolkit::graphicsToolkitInstance->internal_getImageLoader( contentType );}ImageLoader* GraphicsToolkit::getImageLoaderForFileName( const String& fileName ){	return GraphicsToolkit::graphicsToolkitInstance->internal_getImageLoaderForFileName( fileName );}Color* GraphicsToolkit::getSystemColor( const unsigned long& systemColor ){	return GraphicsToolkit::graphicsToolkitInstance->internal_getSystemColor( systemColor );}String GraphicsToolkit::getSystemColorNameFromMap( Color& color ){	return GraphicsToolkit::graphicsToolkitInstance->internal_getSystemColorNameFromMap( color );}String GraphicsToolkit::getColorNameFromMap( const Color& color ){	return GraphicsToolkit::graphicsToolkitInstance->internal_getColorNameFromMap( color );}Color* GraphicsToolkit::getColorFromColormap( const int& gray ){	return GraphicsToolkit::graphicsToolkitInstance->internal_getColorFromColormap( gray );}Color* GraphicsToolkit::getColorFromColormap( const String& colorName ){	return GraphicsToolkit::graphicsToolkitInstance->internal_getColorFromColormap( colorName );}Color* GraphicsToolkit::getColorMatchFromColormap( const Color& color ){	return GraphicsToolkit::graphicsToolkitInstance->internal_getColorMatchFromColormap( color );}void GraphicsToolkit::printColorNameMap( ){	GraphicsToolkit::graphicsToolkitInstance->internal_printColorNameMap();}Enumerator<VCF::FontInfo>* GraphicsToolkit::getAvailableSystemFonts(){	return GraphicsToolkit::graphicsToolkitInstance->internal_getAvailableSystemFonts();}Font* GraphicsToolkit::getDefaultSystemFont(){	return GraphicsToolkit::graphicsToolkitInstance->internal_getDefaultSystemFont( );}double GraphicsToolkit::getDPI( GraphicsContext* context ){	return GraphicsToolkit::graphicsToolkitInstance->internal_getDPI(context);}GraphicsResourceBundlePeer* GraphicsToolkit::createGraphicsResourceBundlePeer(){	return GraphicsToolkit::graphicsToolkitInstance->internal_createGraphicsResourceBundlePeer();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?