salgdi.h (38754389) salgdi.h (2dae3561)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 30 unchanged lines hidden (view full) ---

39
40class AquaSalFrame;
41class AquaSalBitmap;
42class ImplDevFontAttributes;
43class ImplMacTextStyle;
44
45struct CGRect;
46
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 30 unchanged lines hidden (view full) ---

39
40class AquaSalFrame;
41class AquaSalBitmap;
42class ImplDevFontAttributes;
43class ImplMacTextStyle;
44
45struct CGRect;
46
47typedef std::vector<unsigned char> ByteVector;
48
47#ifndef CGFLOAT_TYPE
48typedef float CGFloat;
49#endif
50
51// mac specific physically available font face
52class ImplMacFontData : public ImplFontData
53{
54public:
49#ifndef CGFLOAT_TYPE
50typedef float CGFloat;
51#endif
52
53// mac specific physically available font face
54class ImplMacFontData : public ImplFontData
55{
56public:
55 ImplMacFontData( const ImplDevFontAttributes&, ATSUFontID );
57 ImplMacFontData( const ImplDevFontAttributes&, sal_IntPtr nFontID );
58 virtual ~ImplMacFontData();
56
59
57 virtual ~ImplMacFontData();
58
59 virtual ImplFontData* Clone() const;
60 virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
60 virtual ImplFontData* Clone() const = 0;
61 virtual ImplFontEntry* CreateFontInstance( ImplFontSelectData& ) const;
61 virtual sal_IntPtr GetFontId() const;
62 virtual sal_IntPtr GetFontId() const;
63
64 virtual ImplMacTextStyle* CreateMacTextStyle( const ImplFontSelectData& ) const = 0;
65 virtual int GetFontTable( const char pTagName[5], unsigned char* ) const = 0;
62
66
63 const ImplFontCharMap* GetImplFontCharMap() const;
67 const ImplFontCharMap* GetImplFontCharMap() const;
64 bool HasChar( sal_uInt32 cChar ) const;
65
66 void ReadOs2Table() const;
67 void ReadMacCmapEncoding() const;
68 bool HasCJKSupport() const;
69
68 bool HasChar( sal_uInt32 cChar ) const;
69
70 void ReadOs2Table() const;
71 void ReadMacCmapEncoding() const;
72 bool HasCJKSupport() const;
73
74protected:
75 ImplMacFontData( const ImplMacFontData&);
70private:
76private:
71 const ATSUFontID mnFontId;
77 const sal_IntPtr mnFontId;
72 mutable const ImplFontCharMap* mpCharMap;
73 mutable bool mbOs2Read; // true if OS2-table related info is valid
74 mutable bool mbHasOs2Table;
75 mutable bool mbCmapEncodingRead; // true if cmap encoding of Mac font is read
76 mutable bool mbHasCJKSupport; // #i78970# CJK fonts need extra leading
77};
78
79// abstracting quartz color instead of having to use an CGFloat[] array

--- 5 unchanged lines hidden (view full) ---

85 void SetAlpha( float fAlpha ) { mfRGBA[3] = fAlpha; }
86
87 bool IsVisible() const { return (mfRGBA[3] > 0); }
88 const CGFloat* AsArray() const { return mfRGBA; }
89 CGFloat GetRed() const { return mfRGBA[0]; }
90 CGFloat GetGreen() const { return mfRGBA[1]; }
91 CGFloat GetBlue() const { return mfRGBA[2]; }
92 CGFloat GetAlpha() const { return mfRGBA[3]; }
78 mutable const ImplFontCharMap* mpCharMap;
79 mutable bool mbOs2Read; // true if OS2-table related info is valid
80 mutable bool mbHasOs2Table;
81 mutable bool mbCmapEncodingRead; // true if cmap encoding of Mac font is read
82 mutable bool mbHasCJKSupport; // #i78970# CJK fonts need extra leading
83};
84
85// abstracting quartz color instead of having to use an CGFloat[] array

--- 5 unchanged lines hidden (view full) ---

91 void SetAlpha( float fAlpha ) { mfRGBA[3] = fAlpha; }
92
93 bool IsVisible() const { return (mfRGBA[3] > 0); }
94 const CGFloat* AsArray() const { return mfRGBA; }
95 CGFloat GetRed() const { return mfRGBA[0]; }
96 CGFloat GetGreen() const { return mfRGBA[1]; }
97 CGFloat GetBlue() const { return mfRGBA[2]; }
98 CGFloat GetAlpha() const { return mfRGBA[3]; }
93 private:
99private:
94 CGFloat mfRGBA[4]; // RGBA
95};
96
100 CGFloat mfRGBA[4]; // RGBA
101};
102
103// --------------------
104// - ImplMacTextStyle -
105// --------------------
106class ImplMacTextStyle
107{
108public:
109 explicit ImplMacTextStyle( const ImplFontSelectData& );
110 virtual ~ImplMacTextStyle( void );
111
112 virtual SalLayout* GetTextLayout( void ) const = 0;
113
114 virtual void GetFontMetric( float fPDIY, ImplFontMetricData& ) const = 0;
115 virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const = 0;
116 virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const = 0;
117
118 virtual void SetTextColor( const RGBAColor& ) = 0;
119
120//###protected:
121 const ImplMacFontData* mpFontData;
122 /// workaround to prevent overflows for huge font sizes
123 float mfFontScale;
124 /// <1.0: font is squeezed, >1.0 font is stretched, else 1.0
125 float mfFontStretch;
126 /// text rotation in radian
127 float mfFontRotation;
128};
129
130// ------------------
131// - SystemFontList -
132// TODO: move into cross-platform headers
133// ------------------
134class SystemFontList
135{
136public:
137 virtual ~SystemFontList( void );
138
139 virtual void AnnounceFonts( ImplDevFontList& ) const = 0;
140 virtual ImplMacFontData* GetFontDataFromId( sal_IntPtr nFontId ) const = 0;
141};
142
97// -------------------
98// - AquaSalGraphics -
99// -------------------
100class AquaSalGraphics : public SalGraphics
101{
102 friend class ATSLayout;
143// -------------------
144// - AquaSalGraphics -
145// -------------------
146class AquaSalGraphics : public SalGraphics
147{
148 friend class ATSLayout;
149 friend class CTLayout;
103protected:
104 AquaSalFrame* mpFrame;
105 CGLayerRef mxLayer; // Quartz graphics layer
106 CGContextRef mrContext; // Quartz drawing context
107 class XorEmulation* mpXorEmulation;
108 int mnXorMode; // 0: off 1: on 2: invert only
109 int mnWidth;
110 int mnHeight;

--- 10 unchanged lines hidden (view full) ---

121 CGMutablePathRef mxClipPath;
122
123 /// Drawing colors
124 /// pen color RGBA
125 RGBAColor maLineColor;
126 /// brush color RGBA
127 RGBAColor maFillColor;
128
150protected:
151 AquaSalFrame* mpFrame;
152 CGLayerRef mxLayer; // Quartz graphics layer
153 CGContextRef mrContext; // Quartz drawing context
154 class XorEmulation* mpXorEmulation;
155 int mnXorMode; // 0: off 1: on 2: invert only
156 int mnWidth;
157 int mnHeight;

--- 10 unchanged lines hidden (view full) ---

168 CGMutablePathRef mxClipPath;
169
170 /// Drawing colors
171 /// pen color RGBA
172 RGBAColor maLineColor;
173 /// brush color RGBA
174 RGBAColor maFillColor;
175
129 // Device Font settings
176 // Device Font settings
130 const ImplMacFontData* mpMacFontData;
177 const ImplMacFontData* mpMacFontData;
131 /// ATSU style object which carries all font attributes
132 ATSUStyle maATSUStyle;
133 /// text rotation as ATSU angle
134 Fixed mnATSUIRotation;
135 /// workaround to prevent ATSU overflows for huge font sizes
136 float mfFontScale;
137 /// <1.0: font is squeezed, >1.0 font is stretched, else 1.0
138 float mfFontStretch;
139 /// allows text to be rendered without antialiasing
140 bool mbNonAntialiasedText;
178 ImplMacTextStyle* mpMacTextStyle;
179 RGBAColor maTextColor;
180 // allows text to be rendered without antialiasing
181 bool mbNonAntialiasedText;
141
142 // Graphics types
143
144 /// is this a printer graphics
145 bool mbPrinter;
146 /// is this a virtual device graphics
147 bool mbVirDev;
148 /// is this a window graphics

--- 287 unchanged lines hidden ---
182
183 // Graphics types
184
185 /// is this a printer graphics
186 bool mbPrinter;
187 /// is this a virtual device graphics
188 bool mbVirDev;
189 /// is this a window graphics

--- 287 unchanged lines hidden ---