x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
QuartzTextStyle.h - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\scintilla\macosx\QuartzTextStyle.h
旋转
特效
属性
历史版本
/* * QuartzTextStyle.h * wtf * * Created by Evan Jones on Wed Oct 02 2002. * Copyright (c) 2002 __MyCompanyName__. All rights reserved. * */ #include
#ifndef _QUARTZ_TEXT_STYLE_H #define _QUARTZ_TEXT_STYLE_H #include "QuartzTextStyleAttribute.h" class QuartzTextStyle { public: QuartzTextStyle() { ATSUCreateStyle( &style ); } ~QuartzTextStyle() { if ( style != NULL ) ATSUDisposeStyle( style ); style = NULL; } void setAttribute( ATSUAttributeTag tag, ByteCount size, ATSUAttributeValuePtr value ) { ATSUSetAttributes( style, 1, &tag, &size, &value ); } void setAttribute( QuartzTextStyleAttribute& attribute ) { setAttribute( attribute.getTag(), attribute.getSize(), attribute.getValuePtr() ); } void getAttribute( ATSUAttributeTag tag, ByteCount size, ATSUAttributeValuePtr value, ByteCount* actualSize ) { ATSUGetAttribute( style, tag, size, value, actualSize ); } template
T getAttribute( ATSUAttributeTag tag ) { T value; ByteCount actualSize; ATSUGetAttribute( style, tag, sizeof( T ), &value, &actualSize ); return value; } // TODO: Is calling this actually faster than calling setAttribute multiple times? void setAttributes( QuartzTextStyleAttribute* attributes[], int number ) { // Create the parallel arrays and initialize them properly ATSUAttributeTag* tags = new ATSUAttributeTag[ number ]; ByteCount* sizes = new ByteCount[ number ]; ATSUAttributeValuePtr* values = new ATSUAttributeValuePtr[ number ]; for ( int i = 0; i < number; ++ i ) { tags[i] = attributes[i]->getTag(); sizes[i] = attributes[i]->getSize(); values[i] = attributes[i]->getValuePtr(); } ATSUSetAttributes( style, number, tags, sizes, values ); // Free the arrays that were allocated delete[] tags; delete[] sizes; delete[] values; } void setFontFeature( ATSUFontFeatureType featureType, ATSUFontFeatureSelector selector ) { ATSUSetFontFeatures( style, 1, &featureType, &selector ); } const ATSUStyle& getATSUStyle() const { return style; } private: ATSUStyle style; }; #endif
QuartzTextStyle.h
网页地址
文件地址
上一页
8/20
下一页
下载
( 2 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.