diff options
author | Neil <nyamatongwe@gmail.com> | 2017-06-08 14:51:06 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-06-08 14:51:06 +1000 |
commit | 69870956666618aa5c8194abf6fb2967fa14d064 (patch) | |
tree | 918076df19a01bab706645855f6bcea635bb52ff /cocoa/QuartzTextStyle.h | |
parent | 37508011503a9e6b451759197754bbd04869a230 (diff) | |
download | scintilla-mirror-69870956666618aa5c8194abf6fb2967fa14d064.tar.gz |
Indented consistently by using astyle.
Diffstat (limited to 'cocoa/QuartzTextStyle.h')
-rw-r--r-- | cocoa/QuartzTextStyle.h | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/cocoa/QuartzTextStyle.h b/cocoa/QuartzTextStyle.h index 12cc0e0b2..8572f5270 100644 --- a/cocoa/QuartzTextStyle.h +++ b/cocoa/QuartzTextStyle.h @@ -10,72 +10,60 @@ #include "QuartzTextStyleAttribute.h" -class QuartzTextStyle -{ +class QuartzTextStyle { public: - QuartzTextStyle() - { + QuartzTextStyle() { fontRef = NULL; styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); characterSet = 0; } - QuartzTextStyle(const QuartzTextStyle &other) - { + QuartzTextStyle(const QuartzTextStyle &other) { // Does not copy font colour attribute fontRef = static_cast<CTFontRef>(CFRetain(other.fontRef)); styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef); characterSet = other.characterSet; } - ~QuartzTextStyle() - { - if (styleDict != NULL) - { + ~QuartzTextStyle() { + if (styleDict != NULL) { CFRelease(styleDict); styleDict = NULL; } - if (fontRef) - { + if (fontRef) { CFRelease(fontRef); fontRef = NULL; } } - CFMutableDictionaryRef getCTStyle() const - { + CFMutableDictionaryRef getCTStyle() const { return styleDict; } - void setCTStyleColor(CGColor *inColor) - { + void setCTStyleColor(CGColor *inColor) { CFDictionarySetValue(styleDict, kCTForegroundColorAttributeName, inColor); } - float getAscent() const - { + float getAscent() const { return static_cast<float>(::CTFontGetAscent(fontRef)); } - float getDescent() const - { + float getDescent() const { return static_cast<float>(::CTFontGetDescent(fontRef)); } - float getLeading() const - { + float getLeading() const { return static_cast<float>(::CTFontGetLeading(fontRef)); } - void setFontRef(CTFontRef inRef, int characterSet_) - { + void setFontRef(CTFontRef inRef, int characterSet_) { fontRef = inRef; characterSet = characterSet_; @@ -83,19 +71,17 @@ public: CFRelease(styleDict); styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, - &kCFTypeDictionaryKeyCallBacks, - &kCFTypeDictionaryValueCallBacks); + &kCFTypeDictionaryKeyCallBacks, + &kCFTypeDictionaryValueCallBacks); CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef); } - CTFontRef getFontRef() - { + CTFontRef getFontRef() { return fontRef; } - int getCharacterSet() - { + int getCharacterSet() { return characterSet; } |