From c90895ffeff34bab88b2bad25c2686b17a54e087 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 24 Sep 2011 16:18:16 +1000 Subject: Removing Carbon platform layer in favour of Cocoa. --- macosx/QuartzTextStyle.h | 94 ------------------------------------------------ 1 file changed, 94 deletions(-) delete mode 100644 macosx/QuartzTextStyle.h (limited to 'macosx/QuartzTextStyle.h') diff --git a/macosx/QuartzTextStyle.h b/macosx/QuartzTextStyle.h deleted file mode 100644 index 80c06b76e..000000000 --- a/macosx/QuartzTextStyle.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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 - -- cgit v1.2.3