xref: /aoo41x/main/vcl/aqua/source/gdi/ctfonts.hxx (revision 5b651169)
12822fc04SHerbert Dürr /**************************************************************
22822fc04SHerbert Dürr  *
32822fc04SHerbert Dürr  * Licensed to the Apache Software Foundation (ASF) under one
42822fc04SHerbert Dürr  * or more contributor license agreements.  See the NOTICE file
52822fc04SHerbert Dürr  * distributed with this work for additional information
62822fc04SHerbert Dürr  * regarding copyright ownership.  The ASF licenses this file
72822fc04SHerbert Dürr  * to you under the Apache License, Version 2.0 (the
82822fc04SHerbert Dürr  * "License"); you may not use this file except in compliance
92822fc04SHerbert Dürr  * with the License.  You may obtain a copy of the License at
102822fc04SHerbert Dürr  *
112822fc04SHerbert Dürr  *   http://www.apache.org/licenses/LICENSE-2.0
122822fc04SHerbert Dürr  *
132822fc04SHerbert Dürr  * Unless required by applicable law or agreed to in writing,
142822fc04SHerbert Dürr  * software distributed under the License is distributed on an
152822fc04SHerbert Dürr  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
162822fc04SHerbert Dürr  * KIND, either express or implied.  See the License for the
172822fc04SHerbert Dürr  * specific language governing permissions and limitations
182822fc04SHerbert Dürr  * under the License.
192822fc04SHerbert Dürr  *
202822fc04SHerbert Dürr  *************************************************************/
212822fc04SHerbert Dürr 
222822fc04SHerbert Dürr #include "aqua/salgdi.h"
232822fc04SHerbert Dürr #include "sallayout.hxx"
242822fc04SHerbert Dürr 
252822fc04SHerbert Dürr #include <ApplicationServices/ApplicationServices.h>
262822fc04SHerbert Dürr 
272822fc04SHerbert Dürr // =======================================================================
282822fc04SHerbert Dürr 
292822fc04SHerbert Dürr class CTTextStyle
302822fc04SHerbert Dürr :	public ImplMacTextStyle
312822fc04SHerbert Dürr {
322822fc04SHerbert Dürr public:
332822fc04SHerbert Dürr 	explicit	CTTextStyle( const ImplFontSelectData& );
342822fc04SHerbert Dürr 	virtual		~CTTextStyle( void );
352822fc04SHerbert Dürr 
362822fc04SHerbert Dürr 	virtual SalLayout* GetTextLayout( void ) const;
372822fc04SHerbert Dürr 
382822fc04SHerbert Dürr 	virtual void	GetFontMetric( float fDPIY, ImplFontMetricData& ) const;
392822fc04SHerbert Dürr 	virtual bool	GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const;
402822fc04SHerbert Dürr 	virtual bool	GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const;
412822fc04SHerbert Dürr 
SetTextColor(const RGBAColor &)42*5b651169SHerbert Dürr 	virtual void	SetTextColor( const RGBAColor& ) {}
432822fc04SHerbert Dürr 
442822fc04SHerbert Dürr private:
452822fc04SHerbert Dürr 	/// CoreText text style object
462822fc04SHerbert Dürr 	CFMutableDictionaryRef	mpStyleDict;
472822fc04SHerbert Dürr 
482822fc04SHerbert Dürr 	friend class CTLayout;
GetStyleDict(void) const492822fc04SHerbert Dürr 	CFMutableDictionaryRef	GetStyleDict( void ) const { return mpStyleDict; }
502822fc04SHerbert Dürr };
512822fc04SHerbert Dürr 
522822fc04SHerbert Dürr // =======================================================================
532822fc04SHerbert Dürr 
542822fc04SHerbert Dürr #ifndef DISABLE_CORETEXT_DYNLOAD
552822fc04SHerbert Dürr // the CoreText symbols may need to be loaded dynamically
562822fc04SHerbert Dürr // since platform targets like OSX 10.4 do not provide all required symbols
572822fc04SHerbert Dürr // TODO: avoid the dlsym stuff if the target platform is >= OSX10.5
582822fc04SHerbert Dürr 
592822fc04SHerbert Dürr class DynCoreTextSyms
602822fc04SHerbert Dürr {
612822fc04SHerbert Dürr public:
622822fc04SHerbert Dürr 	// dynamic symbols to access the CoreText API
632822fc04SHerbert Dürr 	uint32_t	(*GetCoreTextVersion)(void);
642822fc04SHerbert Dürr 	CTFontCollectionRef (*FontCollectionCreateFromAvailableFonts)(CFDictionaryRef);
652822fc04SHerbert Dürr 	CFArrayRef	(*FontCollectionCreateMatchingFontDescriptors)(CTFontCollectionRef);
662822fc04SHerbert Dürr 	CGPathRef	(*FontCreatePathForGlyph)(CTFontRef,CGGlyph,const CGAffineTransform*);
672822fc04SHerbert Dürr 	CGRect          (*FontGetBoundingRectsForGlyphs)(CTFontRef,CTFontOrientation,CGGlyph*,CGRect*,CFIndex);
682822fc04SHerbert Dürr 	CTLineRef	(*LineCreateJustifiedLine)(CTLineRef,CGFloat,double);
692822fc04SHerbert Dürr 	double		(*LineGetTrailingWhitespaceWidth)(CTLineRef);
702822fc04SHerbert Dürr 	CGFloat		(*LineGetOffsetForStringIndex)(CTLineRef,CFIndex,CGFloat*);
712822fc04SHerbert Dürr 	CFArrayRef	(*LineGetGlyphRuns)(CTLineRef);
722822fc04SHerbert Dürr 	CFIndex		(*RunGetGlyphCount)(CTRunRef);
732822fc04SHerbert Dürr 	const CGGlyph*	(*RunGetGlyphsPtr)(CTRunRef);
742822fc04SHerbert Dürr 	const CGPoint*	(*RunGetPositionsPtr)(CTRunRef);
752822fc04SHerbert Dürr 	const CGSize*	(*RunGetAdvancesPtr)(CTRunRef);
762822fc04SHerbert Dürr 	const CFIndex * (*RunGetStringIndicesPtr)(CTRunRef);
772822fc04SHerbert Dürr 
782822fc04SHerbert Dürr 	// singleton helpers
792822fc04SHerbert Dürr 	static const DynCoreTextSyms& get( void );
IsActive(void) const802822fc04SHerbert Dürr 	bool		IsActive( void ) const { return mbIsActive; }
812822fc04SHerbert Dürr 
822822fc04SHerbert Dürr private:
832822fc04SHerbert Dürr 	explicit	DynCoreTextSyms( void );
842822fc04SHerbert Dürr 	bool		mbIsActive;
852822fc04SHerbert Dürr };
862822fc04SHerbert Dürr 
872822fc04SHerbert Dürr #endif // DISABLE_CORETEXT_DYNLOAD
882822fc04SHerbert Dürr 
892822fc04SHerbert Dürr // =======================================================================
902822fc04SHerbert Dürr 
91