aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-06-12 22:11:50 +1000
committernyamatongwe <unknown>2012-06-12 22:11:50 +1000
commit7d0b3f37e40cd483e011256cd47f8c276f7f20ba (patch)
tree473bdd47bf17d776fdcb9482988a61b926a16da1
parente0a3ca05480971ffacc7981a3e9835d9a7618259 (diff)
downloadscintilla-mirror-7d0b3f37e40cd483e011256cd47f8c276f7f20ba.tar.gz
Reindented as was inconsistent.
-rw-r--r--cocoa/QuartzTextStyle.h69
1 files changed, 34 insertions, 35 deletions
diff --git a/cocoa/QuartzTextStyle.h b/cocoa/QuartzTextStyle.h
index faffe7616..df5add75c 100644
--- a/cocoa/QuartzTextStyle.h
+++ b/cocoa/QuartzTextStyle.h
@@ -13,30 +13,29 @@
class QuartzTextStyle
{
public:
- QuartzTextStyle()
- {
+ QuartzTextStyle()
+ {
fontRef = NULL;
styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
characterSet = 0;
- }
-
- QuartzTextStyle(const QuartzTextStyle &other)
- {
- // Does not copy font colour attribute
- fontRef = static_cast<CTFontRef>(CFRetain(other.fontRef));
- styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
- CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
- characterSet = other.characterSet;
- }
-
-
- ~QuartzTextStyle()
- {
+ }
+
+ QuartzTextStyle(const QuartzTextStyle &other)
+ {
+ // Does not copy font colour attribute
+ fontRef = static_cast<CTFontRef>(CFRetain(other.fontRef));
+ styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+ CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
+ characterSet = other.characterSet;
+ }
+
+ ~QuartzTextStyle()
+ {
if (styleDict != NULL)
{
CFRelease(styleDict);
@@ -48,58 +47,58 @@ public:
CFRelease(fontRef);
fontRef = NULL;
}
- }
-
+ }
+
CFMutableDictionaryRef getCTStyle() const
{
return styleDict;
}
-
- void setCTStyleColor(CGColor* inColor )
+
+ void setCTStyleColor(CGColor *inColor)
{
CFDictionarySetValue(styleDict, kCTForegroundColorAttributeName, inColor);
}
-
+
float getAscent() const
{
return ::CTFontGetAscent(fontRef);
}
-
+
float getDescent() const
{
return ::CTFontGetDescent(fontRef);
}
-
+
float getLeading() const
{
return ::CTFontGetLeading(fontRef);
}
-
+
void setFontRef(CTFontRef inRef, int characterSet_)
{
fontRef = inRef;
characterSet = characterSet_;
-
+
if (styleDict != NULL)
CFRelease(styleDict);
styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
-
+ &kCFTypeDictionaryKeyCallBacks,
+ &kCFTypeDictionaryValueCallBacks);
+
CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef);
}
-
+
CTFontRef getFontRef()
{
return fontRef;
}
-
+
int getCharacterSet()
{
return characterSet;
}
-
+
private:
CFMutableDictionaryRef styleDict;
CTFontRef fontRef;