summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-01-19 14:22:05 +0200
committerTor Lillqvist <tml@iki.fi>2013-01-19 15:49:50 +0200
commitbae655a7c2c5bb7e612b068eea34ec5780c58513 (patch)
tree5bacb417176829a2665007c4f86d485e9e75c42d /vcl
parentc34cad49fadd376a61904e2201d85fbe908c348b (diff)
De-duplication of CoreText code and headers for OS X and iOS
Nominally renamed the AquaSalGraphics class to QuartzSalGraphics, as it isn't now then "Aqua" (Mac OS X) specific any more. Actually, for Mac OS X, because lots of code in vcl/aqua expects it to be called AquaSalGraphics (just like the alternative class used when using the obsolete ATSUI API on Mac OS X), use a #define to make it still be called AquaSalGraphics to the compiler's eyes. For iOS it can be called QuartzSalGraphics.
Diffstat (limited to 'vcl')
-rw-r--r--vcl/Library_vcl.mk16
-rw-r--r--vcl/aqua/source/gdi/coretext/salcoretextlayout.cxx469
-rw-r--r--vcl/aqua/source/gdi/coretext/salcoretextstyle.cxx112
-rw-r--r--vcl/aqua/source/gdi/coretext/salgdi.cxx263
-rw-r--r--vcl/coretext/salcoretextfontutils.cxx (renamed from vcl/aqua/source/gdi/coretext/salcoretextfontutils.cxx)16
-rw-r--r--vcl/coretext/salcoretextlayout.cxx (renamed from vcl/ios/source/gdi/salcoretextlayout.cxx)30
-rw-r--r--vcl/coretext/salcoretextstyle.cxx (renamed from vcl/ios/source/gdi/salcoretextstyle.cxx)7
-rw-r--r--vcl/coretext/salgdi.cxx (renamed from vcl/ios/source/gdi/salgdi.cxx)64
-rw-r--r--vcl/inc/aqua/common.h43
-rw-r--r--vcl/inc/aqua/coretext/salcoretextfontutils.hxx84
-rw-r--r--vcl/inc/aqua/salbmp.h1
-rw-r--r--vcl/inc/aqua/salgdi.h4
-rw-r--r--vcl/inc/aqua/salgdicommon.hxx2
-rw-r--r--vcl/inc/coretext/common.h (renamed from vcl/inc/ios/common.h)15
-rw-r--r--vcl/inc/coretext/salcoretextfontutils.hxx (renamed from vcl/inc/ios/salcoretextfontutils.hxx)9
-rw-r--r--vcl/inc/coretext/salcoretextlayout.hxx (renamed from vcl/inc/aqua/coretext/salcoretextlayout.hxx)15
-rw-r--r--vcl/inc/coretext/salcoretextstyle.hxx (renamed from vcl/inc/aqua/coretext/salcoretextstyle.hxx)12
-rw-r--r--vcl/inc/coretext/salgdi.h (renamed from vcl/inc/aqua/coretext/salgdi.h)84
-rw-r--r--vcl/inc/ios/salbmp.h3
-rw-r--r--vcl/inc/ios/salcoretextlayout.hxx81
-rw-r--r--vcl/inc/ios/salcoretextstyle.hxx59
-rw-r--r--vcl/inc/ios/salframe.h4
-rw-r--r--vcl/inc/ios/salgdi.h307
-rw-r--r--vcl/inc/ios/salgdicommon.hxx2
-rw-r--r--vcl/inc/ios/salvd.h8
-rw-r--r--vcl/inc/vcl/sysdata.hxx5
-rw-r--r--vcl/ios/source/gdi/salcoretextfontutils.cxx613
-rw-r--r--vcl/ios/source/gdi/salgdicommon.cxx102
-rw-r--r--vcl/ios/source/gdi/salgdiutils.cxx26
-rw-r--r--vcl/ios/source/gdi/salnativewidgets.cxx18
-rw-r--r--vcl/ios/source/gdi/salvd.cxx10
-rw-r--r--vcl/ios/source/window/salframe.cxx4
-rw-r--r--vcl/ios/source/window/salframeview.mm4
33 files changed, 266 insertions, 2226 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index ed843bf10971..29f764fddba9 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -361,10 +361,10 @@ $(eval $(call gb_Library_add_defs,vcl,\
))
$(eval $(call gb_Library_add_exception_objects,vcl,\
- vcl/aqua/source/gdi/coretext/salcoretextfontutils \
- vcl/aqua/source/gdi/coretext/salcoretextlayout \
- vcl/aqua/source/gdi/coretext/salcoretextstyle \
- vcl/aqua/source/gdi/coretext/salgdi \
+ vcl/coretext/salcoretextfontutils \
+ vcl/coretext/salcoretextlayout \
+ vcl/coretext/salcoretextstyle \
+ vcl/coretext/salgdi \
))
ifeq ($(MACOSX_SDK_VERSION),1070)
@@ -602,11 +602,11 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/ios/source/dtrans/iOSTransferable \
vcl/ios/source/dtrans/ios_clipboard \
vcl/ios/source/dtrans/service_entry \
- vcl/ios/source/gdi/salcoretextfontutils \
- vcl/ios/source/gdi/salcoretextlayout \
- vcl/ios/source/gdi/salcoretextstyle \
+ vcl/coretext/salcoretextfontutils \
+ vcl/coretext//salcoretextlayout \
+ vcl/coretext//salcoretextstyle \
vcl/ios/source/gdi/salbmp \
- vcl/ios/source/gdi/salgdi \
+ vcl/coretext/salgdi \
vcl/ios/source/gdi/salgdicommon \
vcl/ios/source/gdi/salnativewidgets \
vcl/ios/source/gdi/salgdiutils \
diff --git a/vcl/aqua/source/gdi/coretext/salcoretextlayout.cxx b/vcl/aqua/source/gdi/coretext/salcoretextlayout.cxx
deleted file mode 100644
index e20bcbac9afc..000000000000
--- a/vcl/aqua/source/gdi/coretext/salcoretextlayout.cxx
+++ /dev/null
@@ -1,469 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "aqua/common.h"
-#include "aqua/coretext/salcoretextstyle.hxx"
-#include "aqua/coretext/salcoretextlayout.hxx"
-#include "aqua/coretext/salgdi.h"
-
-
-CoreTextLayout::CoreTextLayout(AquaSalGraphics* graphics, CoreTextStyleInfo* style) :
- m_graphics(graphics),
- m_style(style),
- m_glyphs_count(-1),
- m_chars_count(-1),
- m_chars2glyphs(NULL),
- m_glyphs2chars(NULL),
- m_glyphs(NULL),
- m_char_widths(NULL),
- m_glyph_advances(NULL),
- m_glyph_positions(NULL),
- m_typesetter(NULL),
- m_line(NULL),
- m_has_bound_rec(false),
- m_base_advance(0),
- m_cached_width(0.0F),
- m_current_run_index(0),
- m_current_glyph_index(0),
- m_current_glyphrun_index(0),
- m_runs(NULL)
-{
-}
-
-CoreTextLayout::~CoreTextLayout()
-{
- Clean();
-}
-
-void CoreTextLayout::AdjustLayout( ImplLayoutArgs& /*rArgs*/ )
-{
- SAL_INFO( "vcl.coretext.layout", "-->" );
- SAL_INFO( "vcl.coretext.layout", "<--" );
- /* TODO */
-}
-
-void CoreTextLayout::Clean()
-{
- SAL_INFO( "vcl.coretext.layout", "-->" );
- if(m_glyphs)
- {
- delete[] m_glyphs;
- m_glyphs = NULL;
- }
- if(m_chars2glyphs)
- {
- delete[] m_chars2glyphs;
- m_chars2glyphs = NULL;
- }
- if(m_glyphs2chars)
- {
- delete[] m_glyphs2chars;
- m_glyphs2chars = NULL;
- }
- if(m_char_widths)
- {
- delete[] m_char_widths;
- m_char_widths = NULL;
- }
- if(m_glyph_advances)
- {
- delete[] m_glyph_advances;
- m_glyph_advances = NULL;
- }
- if(m_glyph_positions)
- {
- delete[] m_glyph_positions;
- m_glyph_positions = NULL;
- }
- SafeCFRelease(m_typesetter);
- SafeCFRelease(m_line);
- m_has_bound_rec = false;
- SAL_INFO( "vcl.coretext.layout", "<--" );
-}
-
-void CoreTextLayout::DrawText( SalGraphics& rGraphics ) const
-{
- SAL_INFO( "vcl.coretext.layout", "-->" );
- AquaSalGraphics& gr = static_cast<AquaSalGraphics&>(rGraphics);
- if(m_chars_count <= 0 || !gr.CheckContext())
- {
- return;
- }
- CGContextSaveGState( gr.mrContext );
- Point pos = GetDrawPosition(Point(0,0));
-#if 0
- SAL_INFO( "vcl.coretext.layout", "at pos (" << pos.X() << "," << pos.Y() << ")" );
- CGContextSetTextMatrix(gr.mrContext, CGAffineTransformMakeScale(1.0, -1.0));
- CGContextSetShouldAntialias( gr.mrContext, !gr.mbNonAntialiasedText );
- CGContextSetTextPosition(gr.mrContext, pos.X(), pos.Y());
- CTLineDraw(m_line, gr.mrContext);
-#else
- InitGIA();
- SAL_INFO( "vcl.coretext.layout", "at pos (" << pos.X() << "," << pos.Y() <<") ctfont=" << m_style->GetFont() );
- CGFontRef cg_font = CTFontCopyGraphicsFont(m_style->GetFont(), NULL);
- if(!cg_font)
- {
- SAL_INFO( "vcl.coretext.layout", "Error cg_font is NULL" );
- return;
- }
- CGContextSetFont(gr.mrContext, cg_font);
- CGContextSetFontSize(gr.mrContext, CTFontGetSize(m_style->GetFont()));
- CGContextSetTextDrawingMode(gr.mrContext, kCGTextFill);
- CGContextSetShouldAntialias( gr.mrContext, true );
- if(m_style->GetColor())
- {
- CGContextSetFillColorWithColor(gr.mrContext, m_style->GetColor());
- CGContextSetStrokeColorWithColor(gr.mrContext, m_style->GetColor());
- }
- else
- {
- CGContextSetRGBFillColor(gr.mrContext, 0.0, 0.0, 0.0, 1.0);
- }
- CFRelease(cg_font);
- CGContextSetTextMatrix(gr.mrContext, CGAffineTransformMakeScale(1.0, -1.0));
- CGContextSetShouldAntialias( gr.mrContext, !gr.mbNonAntialiasedText );
- CGContextTranslateCTM(gr.mrContext, pos.X(), pos.Y());
- CGContextShowGlyphs(gr.mrContext, m_glyphs, m_glyphs_count);
-#endif
- // restore the original graphic context transformations
- CGContextRestoreGState( gr.mrContext );
- SAL_INFO( "vcl.coretext.layout", "<--" );
-
-}
-
-// not needed. CoreText manage fallback directly
-void CoreTextLayout::DropGlyph( int /*nStart*/ ) {}
-
-long CoreTextLayout::FillDXArray( sal_Int32* pDXArray ) const
-{
- SAL_INFO( "vcl.coretext.layout", "-->" );
- // short circuit requests which don't need full details
- if( !pDXArray )
- {
- return GetTextWidth();
- }
-
- // initialize details about the resulting layout
- InitGIA();
-
- // distribute the widths among the string elements
- long width = 0;
- float scale = m_style->GetFontStretchFactor();
- m_cached_width = 0;
-
- for( int i = 0; i < m_chars_count; ++i )
- {
- // convert and adjust for accumulated rounding errors
- m_cached_width += m_char_widths[i];
- const long old_width = width;
- width = round_to_long(m_cached_width * scale);
- pDXArray[i] = width - old_width;
- }
- SAL_INFO( "vcl.coretext.layout", " width=" << width << " <--" );
- return width;
-}
-
-bool CoreTextLayout::GetBoundRect( SalGraphics& rGraphics, Rectangle& rVCLRect ) const
-{
-
- SAL_INFO( "vcl.coretext.layout", "-->" );
- if ( !m_has_bound_rec )
- {
- AquaSalGraphics& gr = static_cast<AquaSalGraphics&>(rGraphics);
- CGRect bound_rect = CTLineGetImageBounds( m_line, gr.mrContext );
- if ( !CGRectIsNull( bound_rect ) )
- {
- m_bound_rect = Rectangle(
- Point( round_to_long(bound_rect.origin.x * m_style->GetFontStretchFactor()),
- round_to_long(bound_rect.origin.y - bound_rect.size.height )),
- Size( round_to_long(bound_rect.size.width * m_style->GetFontStretchFactor()), round_to_long(bound_rect.size.height)));
- m_bound_rect.Justify();
- }
- m_has_bound_rec = true;
- }
- rVCLRect = m_bound_rect;
- SAL_INFO( "vcl.coretext.layout", "<--" );
- return true;
-}
-
-void CoreTextLayout::GetCaretPositions( int max_index, sal_Int32* caret_position) const
-{
- SAL_INFO( "vcl.coretext.layout", "max_index " << max_index << " -->" );
- int local_max = max_index < m_chars_count * 2 ? max_index : m_chars_count;
- for(int i = 0 ; i < max_index - 1; i+=2)
- {
- CGFloat primary, secondary;
- primary = CTLineGetOffsetForStringIndex(m_line, i >> 1, &secondary);
- caret_position[i] = round_to_long(m_base_advance + primary);
- caret_position[i+1] = round_to_long(m_base_advance + secondary);
- i += 2;
- }
- for(int i = local_max ; i < max_index ; ++i)
- {
- caret_position[i] = -1;
- }
- SAL_INFO( "vcl.coretext.layout", "<--" );
-}
-
-bool CoreTextLayout::GetGlyphOutlines( SalGraphics&, PolyPolyVector& ) const { return false; }
-
-int CoreTextLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int& nStart,
- sal_Int32* pGlyphAdvances, int* pCharIndexes ) const
-{
- SAL_INFO( "vcl.coretext.layout", "nLen=" << nLen << " nStart=" << nStart << " -->");
- // get glyph measurements
- InitGIA();
-
- if( nStart < 0 ) // first glyph requested?
- {
- nStart = 0;
- m_current_run_index = 0;
- m_current_glyph_index = 0;
- m_current_glyphrun_index = 0;
- }
- else if(nStart >= m_glyphs_count)
- {
- m_current_run_index = 0;
- m_current_glyph_index = 0;
- m_current_glyphrun_index = 0;
- return 0;
- }
- if(!m_runs)
- {
- m_runs = CTLineGetGlyphRuns(m_line);
- }
- CFIndex nb_runs = CFArrayGetCount( m_runs );
- CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex( m_runs, m_current_run_index );
- CFIndex nb_glyphs = CTRunGetGlyphCount( run );
-
- int i = 0;
- bool first = true;
- while(i < nLen)
- {
- if(m_current_glyphrun_index >= nb_glyphs)
- {
- m_current_run_index += 1;
- if(m_current_run_index >= nb_runs)
- {
- break;
- }
- run = (CTRunRef)CFArrayGetValueAtIndex( m_runs, m_current_run_index );
- nb_glyphs = CTRunGetGlyphCount( run );
- m_current_glyphrun_index = 0;
- }
- if(first)
- {
- CGPoint first_pos;
- CTRunGetPositions(run, CFRangeMake(m_current_glyphrun_index,1), &first_pos);
- Point pos(first_pos.x, first_pos.y);
- rPos = GetDrawPosition(pos);
- SAL_INFO( "vcl.coretext.layout", "rPos(" << rPos.X() << "," << rPos.Y() << ")" );
- first = false;
- }
- pGlyphIDs[i] = m_glyphs[m_current_glyph_index];
- if(pGlyphAdvances)
- {
- pGlyphAdvances[i] = m_glyph_advances[m_current_glyph_index];
- }
- if(pCharIndexes)
- {
- pCharIndexes[i] = m_glyphs2chars[m_current_glyph_index];
- }
- m_current_glyph_index += 1;
- m_current_glyphrun_index += 1;
- i += 1;
- nStart += 1;
- }
- SAL_INFO( "vcl.coretext.layout", "i=" << i << " <--" );
- return i;
-}
-
-int CoreTextLayout::GetTextBreak( long /*nMaxWidth*/, long /*nCharExtra*/, int /*nFactor*/ ) const
-{
- /* TODO */
- return false;
-}
-
-long CoreTextLayout::GetTextWidth() const
-{
- SAL_INFO( "vcl.coretext.layout", "-->" );
-
- CGRect bound_rect = CTLineGetImageBounds(m_line, m_graphics->GetContext());
- long w = round_to_long(bound_rect.size.width * m_style->GetFontStretchFactor());
- SAL_INFO( "vcl.coretext.layout", "w=" << w << " <--" );
- return w;
-}
-
-// not needed. CoreText manage fallback directly
-void CoreTextLayout::InitFont() const
-{
- SAL_INFO( "vcl.coretext.layout", "<-->" );
-}
-
-bool CoreTextLayout::InitGIA() const
-{
- SAL_INFO( "vcl.coretext.layout", "count=" << m_chars_count << "-->" );
-
- if( m_chars_count <= 0)
- {
- return false;
- }
- if(m_glyphs)
- {
- return true;
- }
-
- m_glyphs = new CGGlyph[m_glyphs_count];
- m_char_widths = new int[ m_chars_count ];
- m_chars2glyphs = new int[ m_chars_count ];
- for( int i = 0; i < m_chars_count; ++i)
- {
- m_char_widths[i] = 0.0;
- m_chars2glyphs[i] = -1;
- }
- m_glyphs2chars = new int[m_glyphs_count];
- m_glyph_advances = new int[m_glyphs_count];
- m_glyph_positions = new CGPoint[m_glyphs_count];
-
-
- CFArrayRef runs = CTLineGetGlyphRuns( m_line );
- CFIndex nb_runs = CFArrayGetCount( runs );
- int p = 0;
- for( CFIndex i = 0; i < nb_runs; ++i )
- {
- CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex( runs, i );
- if( run )
- {
- CFIndex nb_glyphs = CTRunGetGlyphCount( run );
- if(nb_glyphs)
- {
- CFRange text_range = CTRunGetStringRange( run );
- if( text_range.location != kCFNotFound && text_range.length > 0 )
- {
- CFIndex indices[ nb_glyphs ];
- CGGlyph glyphs[ nb_glyphs ];
- CTRunGetStringIndices( run, CFRangeMake( 0, 0 ), indices );
- CTRunGetGlyphs( run, CFRangeMake( 0, 0 ), glyphs );
- CTRunGetPositions( run, CFRangeMake( 0, 0 ), &m_glyph_positions[p] );
- bool is_vertical_run = false;
- CFDictionaryRef aDict = CTRunGetAttributes( run );
- if ( aDict )
- {
- const CFBooleanRef aValue = (const CFBooleanRef)CFDictionaryGetValue( aDict, kCTVerticalFormsAttributeName );
- is_vertical_run = (aValue == kCFBooleanTrue) ? true : false;
- }
-
- for (CFIndex j = 0 ; j < nb_glyphs; ++p, ++j )
- {
- m_glyphs[ p ] = glyphs[ j ];
- SAL_INFO( "vcl.coretext.layout", "m_glyphys[" << p << "]=glyphs[" << j << "] run " << i << " : 0x" << std::hex << glyphs[j] << std::dec );
- CFIndex k = indices[ j ];
- m_glyphs2chars[p] = k;
- m_chars2glyphs[k] = p;
-
- if ( j < nb_glyphs - 1 )
- {
- m_char_widths[ k ] += m_glyph_positions[ p + 1 ].x - m_glyph_positions[ p ].x;
- }
- if( p > 0)
- {
- m_glyph_advances[p - 1] = m_glyph_positions[ p ].x - m_glyph_positions[p - 1].x;
- }
- }
- }
- }
- }
- }
- SAL_INFO( "vcl.coretext.layout", "<--" );
- return true;
-}
-
-bool CoreTextLayout::LayoutText(ImplLayoutArgs& args)
-{
- SAL_INFO( "vcl.coretext.layout", "m_style=" << m_style << " font=" << m_style->GetFont() << " -->" );
- Clean();
- m_style->SetColor();
- /* retreive MinCharPos EndCharPos Flags and Orientation */
- SalLayout::AdjustLayout(args);
- m_chars_count = mnEndCharPos - mnMinCharPos;
-
- /* don't layout emptty (or worse negative size) strings */
- if(m_chars_count <= 0)
- {
- return false;
- }
- /* c0 and c1 are construction objects */
- CFStringRef c0 = CFStringCreateWithCharactersNoCopy( NULL, &(args.mpStr[args.mnMinCharPos]), m_chars_count, kCFAllocatorNull );
- if ( !c0 )
- {
- Clean();
- return false;
- }
-
- CFStringRef keys[6];
- CFTypeRef values[6];
- int nb_attributes = 0;
-
- keys[nb_attributes]= kCTFontAttributeName;
- values[nb_attributes] = m_style->GetFont();
- nb_attributes += 1;
-
- CFDictionaryRef attributes = CFDictionaryCreate(kCFAllocatorDefault,
- (const void**)&keys,
- (const void**)&values,
- nb_attributes,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks);
-
-
- CFAttributedStringRef string = CFAttributedStringCreate( NULL, c0, attributes );
- CFRelease( c0 );
- CFRelease( attributes );
- if ( !string )
- {
- Clean();
- return false;
- }
- m_typesetter = CTTypesetterCreateWithAttributedString(string);
- CFRelease(string);
- if(!m_typesetter)
- {
- Clean();
- return false;
- }
- m_line = CTTypesetterCreateLine(m_typesetter, CFRangeMake(0, 0));
- if(!m_line)
- {
- Clean();
- return false;
- }
- m_glyphs_count = CTLineGetGlyphCount(m_line);
-
- SAL_INFO( "vcl.coretext.layout", "glyph_count=" << m_glyphs_count << " <--" );
- return true;
-}
-
-// not needed. CoreText manage fallback directly
-void CoreTextLayout::MoveGlyph( int /*nStart*/, long /*nNewXPos*/ ) {}
-
-// not needed. CoreText manage fallback directly
-void CoreTextLayout::Simplify( bool /*bIsBase*/ ) {}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-
diff --git a/vcl/aqua/source/gdi/coretext/salcoretextstyle.cxx b/vcl/aqua/source/gdi/coretext/salcoretextstyle.cxx
deleted file mode 100644
index 2b67ca12fe0d..000000000000
--- a/vcl/aqua/source/gdi/coretext/salcoretextstyle.cxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "aqua/common.h"
-#include "outfont.hxx"
-#include "aqua/coretext/salcoretextfontutils.hxx"
-#include "aqua/coretext/salcoretextstyle.hxx"
-
-CoreTextStyleInfo::CoreTextStyleInfo() :
- m_fake_bold(false),
- m_fake_italic(false),
- m_matrix(CGAffineTransformIdentity),
- m_stretch_factor(1.0),
- m_CTParagraphStyle(NULL),
- m_CTFont(NULL),
- m_color(NULL),
- m_font_face(NULL)
-{
- SAL_INFO( "vcl.coretext.style", "create <-->" );
-}
-
-CoreTextStyleInfo::~CoreTextStyleInfo()
-{
- SAL_INFO( "vcl.coretext.style", "destroy (font:" << m_CTFont << ") <-->" );
- SafeCFRelease(m_CTFont);
- SafeCFRelease(m_CTParagraphStyle);
- SafeCFRelease(m_color);
-}
-
-long CoreTextStyleInfo::GetFontStretchedSize() const
-{
- CGFloat size = CTFontGetSize(m_CTFont);
- return static_cast<long>(size * m_stretch_factor + 0.5);
-}
-
-void CoreTextStyleInfo::SetFont(FontSelectPattern* requested_font)
-{
- SAL_INFO( "vcl.coretext.style", "req(" << requested_font << ") release font " << m_CTFont << " -->" );
-
- if(!requested_font)
- {
- SafeCFRelease(m_CTFont);
- m_font_face = NULL;
- return;
- }
- m_font_face = (CoreTextPhysicalFontFace*)(requested_font->mpFontData);
-
- m_matrix = CGAffineTransformIdentity;
- CGFloat font_size = (CGFloat)requested_font->mfExactHeight;
-
- // enable bold-emulation if needed
- if( (requested_font->GetWeight() >= WEIGHT_BOLD) &&
- (m_font_face->GetWeight() < WEIGHT_SEMIBOLD) )
- {
- /* FIXME: add support for fake bold */
- m_fake_bold = true;
- }
- if( ((requested_font->GetSlant() == ITALIC_NORMAL) || (requested_font->GetSlant() == ITALIC_OBLIQUE)) &&
- !((m_font_face->GetSlant() == ITALIC_NORMAL) || (m_font_face->GetSlant() == ITALIC_OBLIQUE)) )
- {
-#define kRotationForItalicText 10
- m_fake_italic = true;
- /* about 6 degree of slant */
- m_matrix = CGAffineTransformMake( 1, 0, -tanf( kRotationForItalicText * acosf(0) / 90 ), 1, 0, 0);
- }
-
- // prepare font stretching
- if( (requested_font->mnWidth != 0) && (requested_font->mnWidth != requested_font->mnHeight) )
- {
- m_stretch_factor = (float)requested_font->mnWidth / requested_font->mnHeight;
- m_matrix = CGAffineTransformScale(m_matrix, m_stretch_factor, 1.0F );
- }
-
- SafeCFRelease(m_CTFont);
-
- /* FIXME: pass attribute to take into accout 'VerticalStyle' */
- /* FIXME: how to deal with 'rendering options' i.e anti-aliasing, does it even matter in CoreText ? */
- m_CTFont = CTFontCreateCopyWithAttributes(m_font_face->GetCTFont(), font_size, &m_matrix, NULL);
- SAL_INFO( "vcl.coretext.style", "font " << m_CTFont << " <--" );
-}
-
-void CoreTextStyleInfo::SetColor(SalColor color)
-{
- SAL_INFO( "vcl.coretext.style", "r:" << SALCOLOR_RED(color) << ",g:" << SALCOLOR_GREEN(color) << ",b:" << SALCOLOR_BLUE(color) );
- SafeCFRelease(m_color);
- m_color = CGColorCreateGenericRGB(SALCOLOR_RED(color) / 255.0, SALCOLOR_GREEN(color) / 255.0, SALCOLOR_BLUE(color) / 255.0, 1.0);
- SAL_INFO( "vcl.coretext.style", "color=" << m_color << " <--" );
-}
-
-void CoreTextStyleInfo::SetColor(void)
-{
- SAL_INFO( "vcl.coretext.style", "null -->" );
- SafeCFRelease(m_color);
- SAL_INFO( "vcl.coretext.style", "color=" << m_color << " <--" );
-}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/gdi/coretext/salgdi.cxx b/vcl/aqua/source/gdi/coretext/salgdi.cxx
deleted file mode 100644
index 31cdb2060e59..000000000000
--- a/vcl/aqua/source/gdi/coretext/salgdi.cxx
+++ /dev/null
@@ -1,263 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "aqua/common.h"
-
-#include "aqua/salframe.h"
-
-#include "aqua/coretext/salgdi.h"
-#include "aqua/coretext/salcoretextstyle.hxx"
-#include "aqua/coretext/salcoretextlayout.hxx"
-
-AquaSalGraphics::AquaSalGraphics()
- : mpFrame( NULL )
- , mxLayer( NULL )
- , mrContext( NULL )
- , mpXorEmulation( NULL )
- , mnXorMode( 0 )
- , mnWidth( 0 )
- , mnHeight( 0 )
- , mnBitmapDepth( 0 )
- , mnRealDPIX( 0 )
- , mnRealDPIY( 0 )
- , mfFakeDPIScale( 1.0 )
- , mxClipPath( NULL )
- , maLineColor( COL_WHITE )
- , maFillColor( COL_BLACK )
- , mbNonAntialiasedText( false )
- , mbPrinter( false )
- , mbVirDev( false )
- , mbWindow( false )
-{
- SAL_INFO( "vcl.coretext.gr", "-->" );
- m_style = new CoreTextStyleInfo();
- SAL_INFO( "vcl.coretext.gr", "m_style=" << m_style << " <--" );
-}
-
-AquaSalGraphics::~AquaSalGraphics()
-{
- SAL_INFO( "vcl.coretext.gr", "-->" );
- if(m_style)
- {
- delete m_style;
- m_style = NULL;
- }
- SAL_INFO( "vcl.coretext.gr", "<--" );
-}
-
-inline bool AquaSalGraphics::AddTempDevFont( ImplDevFontList*,
- const rtl::OUString& ,
- const rtl::OUString& )
-{
- OSL_ASSERT( FALSE );
- return false;
-}
-
-void AquaSalGraphics::DrawServerFontLayout( const ServerFontLayout& )
-{
-}
-
-void AquaSalGraphics::FreeEmbedFontData( const void* pData, long /*nDataLen*/ )
-{
- // TODO: implementing this only makes sense when the implementation of
- // AquaSalGraphics::GetEmbedFontData() returns non-NULL
- (void)pData;
- DBG_ASSERT( (pData!=NULL), "AquaSalGraphics::FreeEmbedFontData() is not implemented\n");
-}
-
-void AquaSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
-{
- DBG_ASSERT( pFontList, "AquaSalGraphics::GetDevFontList(NULL) !");
-
- SalData* pSalData = GetSalData();
- if (pSalData->mpFontList == NULL)
- {
- pSalData->mpFontList = new SystemFontList();
- }
- // Copy all PhysicalFontFace objects contained in the SystemFontList
- pSalData->mpFontList->AnnounceFonts( *pFontList );
-}
-
-void AquaSalGraphics::ClearDevFontCache()
-{
- SalData* pSalData = GetSalData();
- delete pSalData->mpFontList;
- pSalData->mpFontList = NULL;
-}
-
-void AquaSalGraphics::GetDevFontSubstList( OutputDevice* )
-{
- // nothing to do since there are no device-specific fonts on Aqua
-}
-
-const void* AquaSalGraphics::GetEmbedFontData( const PhysicalFontFace*,
- const sal_Ucs* /*pUnicodes*/,
- sal_Int32* /*pWidths*/,
- FontSubsetInfo&,
- long* /*pDataLen*/ )
-{
- return NULL;
-}
-
-const Ucs2SIntMap* AquaSalGraphics::GetFontEncodingVector(const PhysicalFontFace*,
- const Ucs2OStrMap** /*ppNonEncoded*/ )
-{
- return NULL;
-}
-
-void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
-{
- (void)nFallbackLevel; // glyph-fallback on CoreText is done differently -> no fallback level
-
- pMetric->mbScalableFont = true;
- pMetric->mbKernableFont = true;
- CTFontRef font = m_style->GetFont();
- DBG_ASSERT(font, "GetFontMetric without font set in style");
-
- pMetric->mnAscent = static_cast<long>( CTFontGetAscent(font) * mfFakeDPIScale + 0.5);
- pMetric->mnDescent = static_cast<long>(CTFontGetDescent(font) * mfFakeDPIScale + 0.5);
- const long nExtDescent = static_cast<long>((CTFontGetLeading(font) + CTFontGetDescent(font)) *
- mfFakeDPIScale + 0.5);
- pMetric->mnExtLeading = nExtDescent + pMetric->mnDescent;
- pMetric->mnIntLeading = 0;
- pMetric->mnWidth = m_style->GetFontStretchedSize();
- SAL_INFO( "vcl.coretext.gr", "ascent=" << pMetric->mnAscent<< ", descent=" << pMetric->mnDescent << ", extleading=" << pMetric->mnExtLeading << ", intleading=" << pMetric->mnIntLeading << ", w=" << pMetric->mnWidth );
-}
-
-sal_Bool AquaSalGraphics::GetGlyphBoundRect( sal_GlyphId /*nGlyphId*/, Rectangle& /*rRect*/ )
-{
- /* TODO: create a Ghyph iterator to keep track ot 'state' between call */
- return false;
-}
-
-sal_Bool AquaSalGraphics::GetGlyphOutline( sal_GlyphId /*nGlyphId*/, basegfx::B2DPolyPolygon& /*rPolyPoly*/ )
-{
- /* TODO */
- return false;
-}
-
-void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* /*pFontData*/, bool /*bVertical*/,
- Int32Vector& /*rGlyphWidths*/, Ucs2UIntMap& /*rUnicodeEnc*/ )
-{
-}
-
-sal_uLong AquaSalGraphics::GetKernPairs( sal_uLong, ImplKernPairData* )
-{
- return 0;
-}
-
-bool AquaSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
-{
- if( !m_style )
- {
- return false;
- }
- CoreTextPhysicalFontFace* font_face = m_style->GetFontFace();
- if( !font_face)
- {
- return false;
- }
- return font_face->GetImplFontCapabilities(rFontCapabilities);
-}
-
-const ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const
-{
- if( !m_style )
- {
- return NULL;
- }
- CoreTextPhysicalFontFace* font_face = m_style->GetFontFace();
- if( !font_face)
- {
- return ImplFontCharMap::GetDefaultMap();
- }
- return font_face->GetImplFontCharMap();
-}
-
-bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontFace,
- std::vector<unsigned char>& rBuffer, bool* pJustCFF )
-{
- const CoreTextPhysicalFontFace* font_face = static_cast<const CoreTextPhysicalFontFace*>(pFontFace);
-
- return font_face->GetRawFontData(rBuffer, pJustCFF);
-}
-
-SystemFontData AquaSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
-{
- SAL_INFO( "vcl.coretext.gr", "-->" );
- SystemFontData aSysFontData;
- aSysFontData.nSize = sizeof( SystemFontData );
- aSysFontData.bAntialias = true;
-
- CTFontRef font = CTFontCreateUIFontForLanguage(kCTFontSystemFontType, 0.0, NULL);
- font = (CTFontRef)CFRetain(font);
- aSysFontData.rCTFont = (void*)font;
-
- CTFontRef italic_font = CTFontCreateCopyWithSymbolicTraits( font,
- 0.0,
- NULL,
- kCTFontItalicTrait,
- kCTFontItalicTrait + kCTFontBoldTrait);
- aSysFontData.bFakeItalic = italic_font ? false : true;
- SafeCFRelease(italic_font);
-
- CTFontRef bold_font = CTFontCreateCopyWithSymbolicTraits( font,
- 0.0,
- NULL,
- kCTFontBoldTrait,
- kCTFontItalicTrait + kCTFontBoldTrait);
- aSysFontData.bFakeBold = bold_font ? false : true;
- SafeCFRelease(bold_font);
-
- CTFontRef vertical_font = CTFontCreateCopyWithSymbolicTraits( font,
- 0.0,
- NULL,
- kCTFontVerticalTrait,
- kCTFontVerticalTrait);
- aSysFontData.bVerticalCharacterType = vertical_font ? true : false;
- SafeCFRelease(vertical_font);
-
- SAL_INFO( "vcl.coretext.gr", "<--" );
- return aSysFontData;
-}
-
-SalLayout* AquaSalGraphics::GetTextLayout( ImplLayoutArgs&, int /*nFallbackLevel*/ )
-{
- SAL_INFO( "vcl.coretext.gr", "-->" );
- CoreTextLayout* layout = new CoreTextLayout( this, m_style );
- SAL_INFO( "vcl.coretext.gr", "layout:" << layout << " <--" );
- return layout;
-}
-
-sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbackLevel*/ )
-{
- SAL_INFO( "vcl.coretext.gr", "m_style=" << m_style << " -->" );
- m_style->SetFont(pReqFont);
- SAL_INFO( "vcl.coretext.gr", "<--" );
- return 0;
-}
-
-void AquaSalGraphics::SetTextColor( SalColor nSalColor )
-{
- SAL_INFO( "vcl.coretext.gr", "m_style=" << m_style << " -->" );
- m_style->SetColor(nSalColor);
- SAL_INFO( "vcl.coretext.gr", "<--" );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/aqua/source/gdi/coretext/salcoretextfontutils.cxx b/vcl/coretext/salcoretextfontutils.cxx
index f14e9c715a0f..a9c0871e0157 100644
--- a/vcl/aqua/source/gdi/coretext/salcoretextfontutils.cxx
+++ b/vcl/coretext/salcoretextfontutils.cxx
@@ -17,14 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "aqua/common.h"
+#include "coretext/common.h"
-#include "aqua/coretext/salcoretextfontutils.hxx"
-#include "aqua/coretext/salgdi.h"
+#include "coretext/salcoretextfontutils.hxx"
+#include "coretext/salgdi.h"
#include "sft.hxx"
-#include "aqua/salinst.h"
+#ifdef MACOSX
+#include "aqua/salinst.h"
+#else // IOS
+#include "ios/salinst.h"
+#endif
static bool GetDevFontAttributes( CTFontDescriptorRef font_descriptor, ImplDevFontAttributes& rDFA )
{
@@ -41,7 +45,7 @@ static bool GetDevFontAttributes( CTFontDescriptorRef font_descriptor, ImplDevFo
rDFA.mbDevice = true;
rDFA.mnQuality = 0;
-#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+#if defined(MACOSX) && MAC_OS_X_VERSION_MIN_REQUIRED < 1060
CTFontRef font = CTFontCreateWithFontDescriptor(font_descriptor, 0.0, NULL);
CFDataRef rHeadTable = CTFontCopyTable(font, kCTFontTableHead, kCTFontTableOptionNoOptions);
CFRelease(font);
@@ -621,3 +625,5 @@ bool CoreTextPhysicalFontFace::HasCJKSupport( void )
}
return m_bHasCJKSupport;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/source/gdi/salcoretextlayout.cxx b/vcl/coretext/salcoretextlayout.cxx
index 8f9d550c0513..f57d6c8814c0 100644
--- a/vcl/ios/source/gdi/salcoretextlayout.cxx
+++ b/vcl/coretext/salcoretextlayout.cxx
@@ -17,13 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "ios/common.h"
-#include "ios/salcoretextstyle.hxx"
-#include "ios/salcoretextlayout.hxx"
-#include "ios/salgdi.h"
+#include "coretext/common.h"
+#include "coretext/salcoretextstyle.hxx"
+#include "coretext/salcoretextlayout.hxx"
+#include "coretext/salgdi.h"
-
-CoreTextLayout::CoreTextLayout(IosSalGraphics* graphics, CoreTextStyleInfo* style) :
+CoreTextLayout::CoreTextLayout(QuartzSalGraphics* graphics, CoreTextStyleInfo* style) :
m_graphics(graphics),
m_style(style),
m_glyphs_count(-1),
@@ -100,7 +99,7 @@ void CoreTextLayout::Clean()
void CoreTextLayout::DrawText( SalGraphics& rGraphics ) const
{
SAL_INFO( "vcl.coretext.layout", "-->" );
- IosSalGraphics& gr = static_cast<IosSalGraphics&>(rGraphics);
+ QuartzSalGraphics& gr = static_cast<QuartzSalGraphics&>(rGraphics);
if(m_chars_count <= 0 || !gr.CheckContext())
{
return;
@@ -150,7 +149,7 @@ void CoreTextLayout::DrawText( SalGraphics& rGraphics ) const
// not needed. CoreText manage fallback directly
void CoreTextLayout::DropGlyph( int /*nStart*/ ) {}
-long CoreTextLayout::FillDXArray( long* pDXArray ) const
+long CoreTextLayout::FillDXArray( sal_Int32* pDXArray ) const
{
SAL_INFO( "vcl.coretext.layout", "-->" );
// short circuit requests which don't need full details
@@ -179,13 +178,13 @@ long CoreTextLayout::FillDXArray( long* pDXArray ) const
return width;
}
-bool CoreTextLayout::GetBoundRect( SalGraphics &rGraphics, Rectangle& rVCLRect ) const
+bool CoreTextLayout::GetBoundRect( SalGraphics& rGraphics, Rectangle& rVCLRect ) const
{
SAL_INFO( "vcl.coretext.layout", "-->" );
if ( !m_has_bound_rec )
{
- IosSalGraphics& gr = static_cast<IosSalGraphics&>(rGraphics);
+ QuartzSalGraphics& gr = static_cast<QuartzSalGraphics&>(rGraphics);
CGRect bound_rect = CTLineGetImageBounds( m_line, gr.mrContext );
if ( !CGRectIsNull( bound_rect ) )
{
@@ -202,7 +201,7 @@ bool CoreTextLayout::GetBoundRect( SalGraphics &rGraphics, Rectangle& rVCLRect )
return true;
}
-void CoreTextLayout::GetCaretPositions( int max_index, long* caret_position) const
+void CoreTextLayout::GetCaretPositions( int max_index, sal_Int32* caret_position) const
{
SAL_INFO( "vcl.coretext.layout", "max_index " << max_index << " -->" );
int local_max = max_index < m_chars_count * 2 ? max_index : m_chars_count;
@@ -311,7 +310,7 @@ long CoreTextLayout::GetTextWidth() const
}
// not needed. CoreText manage fallback directly
-void CoreTextLayout::InitFont() const
+void CoreTextLayout::InitFont() const
{
SAL_INFO( "vcl.coretext.layout", "<-->" );
}
@@ -409,17 +408,22 @@ bool CoreTextLayout::LayoutText(ImplLayoutArgs& args)
return false;
}
+#ifdef IOS
+ // This might be caused by some red herring and be unnecessary
+ // once the CoreText code actually works;)
+
// If the string contains U+FFFD ("REPLACEMENT CHARACTER"), which
// happens at least for the ooo80484-1.slk document in
// sc_filters_test, the CTTypesetterCreateWithAttributedString()
// call below crashes, at least in the iOS simulator. Go figure.
// (In that case the string consists of *only* such characters,
- // but play it safe.
+ // but play it safe.)
for (int i = 0; i < m_chars_count; i++)
{
if (args.mpStr[args.mnMinCharPos+i] == 0xFFFD)
return false;
}
+#endif
/* c0 and c1 are construction objects */
CFStringRef c0 = CFStringCreateWithCharactersNoCopy( NULL, &(args.mpStr[args.mnMinCharPos]), m_chars_count, kCFAllocatorNull );
diff --git a/vcl/ios/source/gdi/salcoretextstyle.cxx b/vcl/coretext/salcoretextstyle.cxx
index baa4a7debea0..b468b89782a8 100644
--- a/vcl/ios/source/gdi/salcoretextstyle.cxx
+++ b/vcl/coretext/salcoretextstyle.cxx
@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "ios/common.h"
+#include "coretext/common.h"
#include "outfont.hxx"
-#include "ios/salcoretextfontutils.hxx"
-#include "ios/salcoretextstyle.hxx"
+#include "coretext/salcoretextfontutils.hxx"
+#include "coretext/salcoretextstyle.hxx"
CoreTextStyleInfo::CoreTextStyleInfo() :
m_fake_bold(false),
@@ -117,4 +117,5 @@ void CoreTextStyleInfo::SetColor(void)
SafeCFRelease(m_color);
SAL_INFO( "vcl.coretext.style", "color=" << m_color << " <--" );
}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/source/gdi/salgdi.cxx b/vcl/coretext/salgdi.cxx
index 766412f006bc..ab864913a137 100644
--- a/vcl/ios/source/gdi/salgdi.cxx
+++ b/vcl/coretext/salgdi.cxx
@@ -17,15 +17,19 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "ios/common.h"
+#include "coretext/common.h"
+#ifdef MACOSX
+#include "aqua/salframe.h"
+#else
#include "ios/salframe.h"
+#endif
-#include "ios/salgdi.h"
-#include "ios/salcoretextstyle.hxx"
-#include "ios/salcoretextlayout.hxx"
+#include "coretext/salgdi.h"
+#include "coretext/salcoretextstyle.hxx"
+#include "coretext/salcoretextlayout.hxx"
-IosSalGraphics::IosSalGraphics()
+QuartzSalGraphics::QuartzSalGraphics()
: mpFrame( NULL )
, mxLayer( NULL )
, mrContext( NULL )
@@ -50,7 +54,7 @@ IosSalGraphics::IosSalGraphics()
SAL_INFO( "vcl.coretext.gr", "m_style=" << m_style << " <--" );
}
-IosSalGraphics::~IosSalGraphics()
+QuartzSalGraphics::~QuartzSalGraphics()
{
SAL_INFO( "vcl.coretext.gr", "-->" );
if(m_style)
@@ -61,7 +65,7 @@ IosSalGraphics::~IosSalGraphics()
SAL_INFO( "vcl.coretext.gr", "<--" );
}
-inline bool IosSalGraphics::AddTempDevFont( ImplDevFontList*,
+inline bool QuartzSalGraphics::AddTempDevFont( ImplDevFontList*,
const rtl::OUString& ,
const rtl::OUString& )
{
@@ -69,21 +73,21 @@ inline bool IosSalGraphics::AddTempDevFont( ImplDevFontList*,
return false;
}
-void IosSalGraphics::DrawServerFontLayout( const ServerFontLayout& )
+void QuartzSalGraphics::DrawServerFontLayout( const ServerFontLayout& )
{
}
-void IosSalGraphics::FreeEmbedFontData( const void* pData, long /*nDataLen*/ )
+void QuartzSalGraphics::FreeEmbedFontData( const void* pData, long /*nDataLen*/ )
{
// TODO: implementing this only makes sense when the implementation of
- // IosSalGraphics::GetEmbedFontData() returns non-NULL
+ // QuartzSalGraphics::GetEmbedFontData() returns non-NULL
(void)pData;
- DBG_ASSERT( (pData!=NULL), "IosSalGraphics::FreeEmbedFontData() is not implemented\n");
+ DBG_ASSERT( (pData!=NULL), "QuartzSalGraphics::FreeEmbedFontData() is not implemented\n");
}
-void IosSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
+void QuartzSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
{
- DBG_ASSERT( pFontList, "IosSalGraphics::GetDevFontList(NULL) !");
+ DBG_ASSERT( pFontList, "QuartzSalGraphics::GetDevFontList(NULL) !");
SalData* pSalData = GetSalData();
if (pSalData->mpFontList == NULL)
@@ -94,19 +98,19 @@ void IosSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
pSalData->mpFontList->AnnounceFonts( *pFontList );
}
-void IosSalGraphics::ClearDevFontCache()
+void QuartzSalGraphics::ClearDevFontCache()
{
SalData* pSalData = GetSalData();
delete pSalData->mpFontList;
pSalData->mpFontList = NULL;
}
-void IosSalGraphics::GetDevFontSubstList( OutputDevice* )
+void QuartzSalGraphics::GetDevFontSubstList( OutputDevice* )
{
- // nothing to do since there are no device-specific fonts on Ios
+ // nothing to do since there are no device-specific fonts on Aqua
}
-const void* IosSalGraphics::GetEmbedFontData( const PhysicalFontFace*,
+const void* QuartzSalGraphics::GetEmbedFontData( const PhysicalFontFace*,
const sal_Ucs* /*pUnicodes*/,
sal_Int32* /*pWidths*/,
FontSubsetInfo&,
@@ -115,13 +119,13 @@ const void* IosSalGraphics::GetEmbedFontData( const PhysicalFontFace*,
return NULL;
}
-const Ucs2SIntMap* IosSalGraphics::GetFontEncodingVector(const PhysicalFontFace*,
+const Ucs2SIntMap* QuartzSalGraphics::GetFontEncodingVector(const PhysicalFontFace*,
const Ucs2OStrMap** /*ppNonEncoded*/ )
{
return NULL;
}
-void IosSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
+void QuartzSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLevel )
{
(void)nFallbackLevel; // glyph-fallback on CoreText is done differently -> no fallback level
@@ -140,29 +144,29 @@ void IosSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLe
SAL_INFO( "vcl.coretext.gr", "ascent=" << pMetric->mnAscent<< ", descent=" << pMetric->mnDescent << ", extleading=" << pMetric->mnExtLeading << ", intleading=" << pMetric->mnIntLeading << ", w=" << pMetric->mnWidth );
}
-sal_Bool IosSalGraphics::GetGlyphBoundRect( sal_GlyphId /*nGlyphId*/, Rectangle& /*rRect*/ )
+sal_Bool QuartzSalGraphics::GetGlyphBoundRect( sal_GlyphId /*nGlyphId*/, Rectangle& /*rRect*/ )
{
/* TODO: create a Ghyph iterator to keep track ot 'state' between call */
return false;
}
-sal_Bool IosSalGraphics::GetGlyphOutline( sal_GlyphId /*nGlyphId*/, basegfx::B2DPolyPolygon& /*rPolyPoly*/ )
+sal_Bool QuartzSalGraphics::GetGlyphOutline( sal_GlyphId /*nGlyphId*/, basegfx::B2DPolyPolygon& /*rPolyPoly*/ )
{
/* TODO */
return false;
}
-void IosSalGraphics::GetGlyphWidths( const PhysicalFontFace* /*pFontData*/, bool /*bVertical*/,
+void QuartzSalGraphics::GetGlyphWidths( const PhysicalFontFace* /*pFontData*/, bool /*bVertical*/,
Int32Vector& /*rGlyphWidths*/, Ucs2UIntMap& /*rUnicodeEnc*/ )
{
}
-sal_uLong IosSalGraphics::GetKernPairs( sal_uLong, ImplKernPairData* )
+sal_uLong QuartzSalGraphics::GetKernPairs( sal_uLong, ImplKernPairData* )
{
return 0;
}
-bool IosSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
+bool QuartzSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
{
if( !m_style )
{
@@ -176,7 +180,7 @@ bool IosSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabil
return font_face->GetImplFontCapabilities(rFontCapabilities);
}
-const ImplFontCharMap* IosSalGraphics::GetImplFontCharMap() const
+const ImplFontCharMap* QuartzSalGraphics::GetImplFontCharMap() const
{
if( !m_style )
{
@@ -190,7 +194,7 @@ const ImplFontCharMap* IosSalGraphics::GetImplFontCharMap() const
return font_face->GetImplFontCharMap();
}
-bool IosSalGraphics::GetRawFontData( const PhysicalFontFace* pFontFace,
+bool QuartzSalGraphics::GetRawFontData( const PhysicalFontFace* pFontFace,
std::vector<unsigned char>& rBuffer, bool* pJustCFF )
{
const CoreTextPhysicalFontFace* font_face = static_cast<const CoreTextPhysicalFontFace*>(pFontFace);
@@ -198,7 +202,7 @@ bool IosSalGraphics::GetRawFontData( const PhysicalFontFace* pFontFace,
return font_face->GetRawFontData(rBuffer, pJustCFF);
}
-SystemFontData IosSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
+SystemFontData QuartzSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
{
SAL_INFO( "vcl.coretext.gr", "-->" );
SystemFontData aSysFontData;
@@ -237,7 +241,7 @@ SystemFontData IosSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
return aSysFontData;
}
-SalLayout* IosSalGraphics::GetTextLayout( ImplLayoutArgs&, int /*nFallbackLevel*/ )
+SalLayout* QuartzSalGraphics::GetTextLayout( ImplLayoutArgs&, int /*nFallbackLevel*/ )
{
SAL_INFO( "vcl.coretext.gr", "-->" );
CoreTextLayout* layout = new CoreTextLayout( this, m_style );
@@ -245,7 +249,7 @@ SalLayout* IosSalGraphics::GetTextLayout( ImplLayoutArgs&, int /*nFallbackLevel*
return layout;
}
-sal_uInt16 IosSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbackLevel*/ )
+sal_uInt16 QuartzSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbackLevel*/ )
{
SAL_INFO( "vcl.coretext.gr", "m_style=" << m_style << " -->" );
m_style->SetFont(pReqFont);
@@ -253,7 +257,7 @@ sal_uInt16 IosSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallback
return 0;
}
-void IosSalGraphics::SetTextColor( SalColor nSalColor )
+void QuartzSalGraphics::SetTextColor( SalColor nSalColor )
{
SAL_INFO( "vcl.coretext.gr", "m_style=" << m_style << " -->" );
m_style->SetColor(nSalColor);
diff --git a/vcl/inc/aqua/common.h b/vcl/inc/aqua/common.h
deleted file mode 100644
index 22cd5f7c88d8..000000000000
--- a/vcl/inc/aqua/common.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _VCL_AQUA_COMMON_H
-#define _VCL_AQUA_COMMON_H
-
-#include <sal/types.h>
-#include <premac.h>
-#include <ApplicationServices/ApplicationServices.h>
-#include <postmac.h>
-#include <tools/debug.hxx>
-
-// CoreFoundation designers, in their wisdom, decided that CFRelease of NULL
-// cause a Crash, yet few API can return NULL when asking for the creation
-// of an object, which force us to peper the code with egly if construct everywhere
-// and open the door to very nasty crash on rare occasion
-// this macro hide the mess
-#define SafeCFRelease(a) do { if(a) { CFRelease(a); (a)=NULL; } } while(false)
-
-
-#define round_to_long(a) ((a) >= 0 ? ((long)((a) + 0.5)) : ((long)((a) - 0.5)))
-
-#include "vcl/salgtype.hxx"
-
-#endif /* _VCL_AQUA_COMMON_H */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/aqua/coretext/salcoretextfontutils.hxx b/vcl/inc/aqua/coretext/salcoretextfontutils.hxx
deleted file mode 100644
index a0b06807c69e..000000000000
--- a/vcl/inc/aqua/coretext/salcoretextfontutils.hxx
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _VCL_AQUA_CORETEXT_SALCORETEXTFONTUTILS_HXX
-#define _VCL_AQUA_CORETEXT_SALCORETEXTFONTUTILS_HXX
-
-class CoreTextPhysicalFontFace;
-class ImplDevFontList;
-
-#include <boost/unordered_map.hpp>
-
-#include <vcl/fontcapabilities.hxx>
-
-#include "outfont.hxx"
-#include "impfont.hxx"
-
-class CoreTextPhysicalFontFace : public PhysicalFontFace
-{
-public:
- CoreTextPhysicalFontFace(const ImplDevFontAttributes&, CTFontRef font);
- virtual ~CoreTextPhysicalFontFace();
- virtual PhysicalFontFace* Clone() const;
- virtual ImplFontEntry* CreateFontInstance( FontSelectPattern& ) const;
- virtual sal_IntPtr GetFontId() const { return (sal_IntPtr)m_CTFontRef;};
- CTFontRef GetCTFont() const { return m_CTFontRef; };
- const ImplFontCharMap* GetImplFontCharMap();
- bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities);
- bool HasChar( sal_uInt32 cChar ) const;
- void ReadOs2Table();
- void ReadIosCmapEncoding();
- bool HasCJKSupport();
- bool GetRawFontData( std::vector<unsigned char>& rBuffer, bool* pJustCFF ) const;
-
-private:
- void DetermineCJKSupport_OS2(CFDataRef rOS2Table);
- void DetermineCJKSupport_cmap(CFDataRef rCmapTable);
- CTFontRef m_CTFontRef;
- mutable const ImplFontCharMap* m_pCharMap;
- mutable vcl::FontCapabilities m_aFontCapabilities;
- mutable bool m_bHasOs2Table;
- mutable bool m_bOs2TableRead;
- mutable bool m_bCmapTableRead; // true if cmap encoding of Mac font is read
- mutable bool m_bHasCJKSupport; // #i78970# CJK fonts need extra leading
- mutable bool m_bFontCapabilitiesRead;
-};
-
-/* This class has the responsibility of assembling a list of CoreText
- fonts available on the system and enabling access to that list.
- */
-class SystemFontList
-{
-public:
- SystemFontList();
- ~SystemFontList();
-
- void AnnounceFonts( ImplDevFontList& ) const;
- CoreTextPhysicalFontFace* GetFontDataFromRef( CTFontRef ) const;
-
-private:
- typedef boost::unordered_map<CTFontRef,CoreTextPhysicalFontFace*> CoreTextFontContainer;
- CoreTextFontContainer m_aFontContainer;
-
- void InitGlyphFallbacks();
-};
-
-#endif // _VCL_AQUA_CORETEXT_SALCORETEXTFONTUTILS_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/aqua/salbmp.h b/vcl/inc/aqua/salbmp.h
index 18716117df28..0f18c91d5d8c 100644
--- a/vcl/inc/aqua/salbmp.h
+++ b/vcl/inc/aqua/salbmp.h
@@ -45,7 +45,6 @@ struct BitmapBuffer;
class BitmapColor;
class BitmapPalette;
class AquaSalVirtualDevice;
-class AquaSalGraphics;
class AquaSalBitmap : public SalBitmap
{
diff --git a/vcl/inc/aqua/salgdi.h b/vcl/inc/aqua/salgdi.h
index d0a457290ee9..20d4588925de 100644
--- a/vcl/inc/aqua/salgdi.h
+++ b/vcl/inc/aqua/salgdi.h
@@ -6,10 +6,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+
#ifdef ENABLE_CORETEXT
-# include "aqua/coretext/salgdi.h"
+# include "coretext/salgdi.h"
#else
# include "aqua/atsui/salgdi.h"
#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/aqua/salgdicommon.hxx b/vcl/inc/aqua/salgdicommon.hxx
index 436b55048c95..2d4f611b168d 100644
--- a/vcl/inc/aqua/salgdicommon.hxx
+++ b/vcl/inc/aqua/salgdicommon.hxx
@@ -20,6 +20,8 @@
#ifndef _VCL_AQUA_SALGDICOMMON_H
#define _VCL_AQUA_SALGDICOMMON_H
+#include <vcl/salgtype.hxx>
+
// abstracting quartz color instead of having to use an CGFloat[] array
class RGBAColor
{
diff --git a/vcl/inc/ios/common.h b/vcl/inc/coretext/common.h
index e37804ca3925..f00ebf7fe174 100644
--- a/vcl/inc/ios/common.h
+++ b/vcl/inc/coretext/common.h
@@ -17,15 +17,21 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef _VCL_IOS_COMMON_H
-#define _VCL_IOS_COMMON_H
+#ifndef _VCL_CORETEXT_COMMON_H
+#define _VCL_CORETEXT_COMMON_H
#include <sal/types.h>
#include <premac.h>
+
+#ifdef MACOSX
+#include <ApplicationServices/ApplicationServices.h>
+#else
#include <CoreGraphics/CoreGraphics.h>
#include <CoreText/CoreText.h>
-#include <UIKit/UIKit.h>
+#endif
+
#include <postmac.h>
+
#include <tools/debug.hxx>
// CoreFoundation designers, in their wisdom, decided that CFRelease of NULL
@@ -35,11 +41,10 @@
// this macro hide the mess
#define SafeCFRelease(a) do { if(a) { CFRelease(a); (a)=NULL; } } while(false)
-
#define round_to_long(a) ((a) >= 0 ? ((long)((a) + 0.5)) : ((long)((a) - 0.5)))
#include "vcl/salgtype.hxx"
-#endif/* _VCL_IOS_COMMON_H */
+#endif /* _VCL_CORETEXT_COMMON_H */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salcoretextfontutils.hxx b/vcl/inc/coretext/salcoretextfontutils.hxx
index 6293392e8cd1..00c61aa14e1d 100644
--- a/vcl/inc/ios/salcoretextfontutils.hxx
+++ b/vcl/inc/coretext/salcoretextfontutils.hxx
@@ -17,11 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef _VCL_IOS_CORETEXT_SALCORETEXTFONTUTILS_HXX
-#define _VCL_IOS_CORETEXT_SALCORETEXTFONTUTILS_HXX
-
-class CoreTextPhysicalFontFace;
-class ImplDevFontList;
+#ifndef _VCL_CORETEXT_SALCORETEXTFONTUTILS_HXX
+#define _VCL_CORETEXT_SALCORETEXTFONTUTILS_HXX
#include <boost/unordered_map.hpp>
@@ -79,6 +76,6 @@ private:
void InitGlyphFallbacks();
};
-#endif // _VCL_IOS_CORETEXT_SALCORETEXTFONTUTILS_HXX
+#endif // _VCL_CORETEXT_SALCORETEXTFONTUTILS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/aqua/coretext/salcoretextlayout.hxx b/vcl/inc/coretext/salcoretextlayout.hxx
index 2b73c691e49a..1a4009568b99 100644
--- a/vcl/inc/aqua/coretext/salcoretextlayout.hxx
+++ b/vcl/inc/coretext/salcoretextlayout.hxx
@@ -17,20 +17,19 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef _VCL_AQUA_CORETEXT_SALCORETEXTLAYOUT_HXX
-#define _VCL_AQUA_CORETEXT_SALCORETEXTLAYOUT_HXX
+#ifndef _VCL_CORETEXT_SALCORETEXTLAYOUT_HXX
+#define _VCL_CORETEXT_SALCORETEXTLAYOUT_HXX
#include <tools/poly.hxx>
#include "sallayout.hxx"
-
-class AquaSalGraphics;
-class CoreTextStyleInfo;
+#include "coretext/salgdi.h"
+#include "coretext/salcoretextstyle.hxx"
class CoreTextLayout : public SalLayout
{
public:
- CoreTextLayout( AquaSalGraphics* graphics, CoreTextStyleInfo* style);
+ CoreTextLayout( QuartzSalGraphics* graphics, CoreTextStyleInfo* style);
virtual ~CoreTextLayout();
virtual void AdjustLayout( ImplLayoutArgs& );
@@ -53,7 +52,7 @@ private:
void Clean();
bool InitGIA() const;
- AquaSalGraphics* m_graphics;
+ QuartzSalGraphics* m_graphics;
CoreTextStyleInfo* m_style;
mutable int m_glyphs_count;
mutable int m_chars_count;
@@ -76,6 +75,6 @@ private:
};
-#endif // _VCL_AQUA_CORETEXT_SALCORETEXTLAYOUT_HXX
+#endif // _VCL_CORETEXT_SALCORETEXTLAYOUT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/aqua/coretext/salcoretextstyle.hxx b/vcl/inc/coretext/salcoretextstyle.hxx
index 0f5dda202eea..245e08f42db1 100644
--- a/vcl/inc/aqua/coretext/salcoretextstyle.hxx
+++ b/vcl/inc/coretext/salcoretextstyle.hxx
@@ -17,13 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef _VCL_AQUA_CORETEXT_SALCORETEXTSTYLE_HXX
-#define _VCL_AQUA_CORETEXT_SALCORETEXTSTYLE_HXX
+#ifndef _VCL_CORETEXT_SALCORETEXTSTYLE_HXX
+#define _VCL_CORETEXT_SALCORETEXTSTYLE_HXX
+#ifdef MACOSX
#include "aqua/salgdicommon.hxx"
+#else // IOS
+#include "ios/salgdicommon.hxx"
+#endif
-class FontSelectPattern;
-class CoreTextPhysicalFontFace;
+#include "coretext/salcoretextfontutils.hxx"
+#include "outfont.hxx"
class CoreTextStyleInfo
{
diff --git a/vcl/inc/aqua/coretext/salgdi.h b/vcl/inc/coretext/salgdi.h
index cb8179c5072b..7ef49d5a1ddc 100644
--- a/vcl/inc/aqua/coretext/salgdi.h
+++ b/vcl/inc/coretext/salgdi.h
@@ -17,30 +17,52 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef _VCL_AQUA_CORETEXT_SALGDI_H
-#define _VCL_AQUA_CORETEXT_SALGDI_H
+#ifndef _VCL_CORETEXT_SALGDI_H
+#define _VCL_CORETEXT_SALGDI_H
+#ifdef MACOSX
#include "premac.h"
#include <ApplicationServices/ApplicationServices.h>
#include "postmac.h"
+#endif
+#ifdef MACOSX
#include "aqua/aquavcltypes.h"
-#include "aqua/coretext/salcoretextfontutils.hxx"
-#include "aqua/salframe.h"
-#include "salgdi.hxx"
+#else
+#include "ios/iosvcltypes.h"
+#endif
+
+#include "coretext/salcoretextfontutils.hxx"
+#ifdef MACOSX
+#include "aqua/salframe.h"
#include "aqua/salgdicommon.hxx"
+#else
+#include "ios/salframe.h"
+#include "ios/salgdicommon.hxx"
+#endif
+
+#include "salgdi.hxx"
class CoreTextStyleInfo;
// -------------------
-// - AquaSalGraphics -
+// - QuartzSalGraphics -
// -------------------
-class AquaSalGraphics : public SalGraphics
+
+#ifdef MACOSX
+#define QuartzSalGraphics AquaSalGraphics
+#endif
+
+class QuartzSalGraphics : public SalGraphics
{
friend class CoreTextLayout;
protected:
+#ifdef MACOSX
AquaSalFrame* mpFrame;
+#else
+ IosSalFrame* mpFrame;
+#endif
CGLayerRef mxLayer; //< Quartz graphics layer
CGContextRef mrContext; //< Quartz drawing context
class XorEmulation* mpXorEmulation;
@@ -57,7 +79,6 @@ protected:
double mfFakeDPIScale;
double mfFontScale;
-
CGMutablePathRef mxClipPath; //< path representing current clip region
/// Drawing colors
@@ -72,38 +93,57 @@ protected:
bool mbVirDev; //< is this a virtual device graphics
bool mbWindow; //< is this a window graphics
+#ifdef MACOSX
RGBColor m_TextColor;
+#endif
public:
- AquaSalGraphics();
- virtual ~AquaSalGraphics();
+ QuartzSalGraphics();
+ virtual ~QuartzSalGraphics();
bool IsPenVisible() const { return maLineColor.IsVisible(); }
bool IsBrushVisible() const { return maFillColor.IsVisible(); }
+#ifdef MACOSX
void SetWindowGraphics( AquaSalFrame* pFrame );
+ AquaSalFrame* getGraphicsFrame() const { return mpFrame; }
+ void setGraphicsFrame( AquaSalFrame* pFrame ) { mpFrame = pFrame; }
+ void initResolution( NSWindow* );
+#else
+ void SetWindowGraphics( IosSalFrame* pFrame );
+ IosSalFrame* getGraphicsFrame() const { return mpFrame; }
+ void setGraphicsFrame( IosSalFrame* pFrame ) { mpFrame = pFrame; }
+ void initResolution( UIWindow* );
+#endif
+
void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY, double fFakeScale );
void SetVirDevGraphics( CGLayerRef, CGContextRef, int nBitDepth = 0 );
- void initResolution( NSWindow* );
- void copyResolution( AquaSalGraphics& );
+ void copyResolution( QuartzSalGraphics& );
void updateResolution();
bool IsWindowGraphics() const { return mbWindow; }
bool IsPrinterGraphics() const { return mbPrinter; }
bool IsVirDevGraphics() const { return mbVirDev; }
- AquaSalFrame* getGraphicsFrame() const { return mpFrame; }
- void setGraphicsFrame( AquaSalFrame* pFrame ) { mpFrame = pFrame; }
void ImplDrawPixel( long nX, long nY, const RGBAColor& ); // helper to draw single pixels
bool CheckContext();
CGContextRef GetContext();
+
+#ifdef MACOSX
void UpdateWindow( NSRect& ); // delivered in NSView coordinates
-#if !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)
+#else
+ void UpdateWindow( CGRect& ); // delivered in UIView coordinates
+#endif
+
+#if (defined(MACOSX) && !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)) || defined(IOS)
void RefreshRect( const CGRect& );
#endif
+
+#ifdef MACOSX
void RefreshRect( const NSRect& );
+#endif
void RefreshRect(float lX, float lY, float lWidth, float lHeight);
void SetState();
@@ -304,18 +344,24 @@ private:
bool* pJustCFF );
};
-#if !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)
-inline void AquaSalGraphics::RefreshRect( const CGRect& rRect )
+#if (defined(MACOSX) && !defined(__LP64__) && !defined(NS_BUILD_32_LIKE_64)) || defined(IOS)
+
+inline void QuartzSalGraphics::RefreshRect( const CGRect& rRect )
{
RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height );
}
+
#endif
-inline void AquaSalGraphics::RefreshRect( const NSRect& rRect )
+#ifdef MACOSX
+
+inline void QuartzSalGraphics::RefreshRect( const NSRect& rRect )
{
RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height );
}
-#endif /* _VCL_AQUA_CORETEXT_SALGDI_H */
+#endif
+
+#endif /* _VCL_CORETEXT_SALGDI_H */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salbmp.h b/vcl/inc/ios/salbmp.h
index 6f61b21d5482..816e5231184e 100644
--- a/vcl/inc/ios/salbmp.h
+++ b/vcl/inc/ios/salbmp.h
@@ -27,7 +27,7 @@
#include "vcl/salbtype.hxx"
#include "ios/salconst.h"
-#include "ios/salgdi.h"
+#include "coretext/salgdi.h"
#include "saldata.hxx"
#include "salinst.hxx"
@@ -45,7 +45,6 @@ struct BitmapBuffer;
class BitmapColor;
class BitmapPalette;
class IosSalVirtualDevice;
-class IosSalGraphics;
class IosSalBitmap : public SalBitmap
{
diff --git a/vcl/inc/ios/salcoretextlayout.hxx b/vcl/inc/ios/salcoretextlayout.hxx
deleted file mode 100644
index 5898066e586a..000000000000
--- a/vcl/inc/ios/salcoretextlayout.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _VCL_IOS_CORETEXT_SALCORETEXTLAYOUT_HXX
-#define _VCL_IOS_CORETEXT_SALCORETEXTLAYOUT_HXX
-
-#include <tools/poly.hxx>
-
-#include "sallayout.hxx"
-
-class IosSalGraphics;
-class CoreTextStyleInfo;
-
-class CoreTextLayout : public SalLayout
-{
-public:
- CoreTextLayout( IosSalGraphics* graphics, CoreTextStyleInfo* style);
- virtual ~CoreTextLayout();
-
- virtual void AdjustLayout( ImplLayoutArgs& );
- virtual void DrawText( SalGraphics& ) const;
- virtual void DropGlyph( int nStart );
- virtual long FillDXArray( long* pDXArray ) const;
- virtual bool GetBoundRect( SalGraphics&, Rectangle& ) const;
- virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const;
- virtual bool GetGlyphOutlines( SalGraphics&, PolyPolyVector& ) const;
- virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
- sal_Int32* pGlyphAdvances, int* pCharIndexes ) const;
- virtual int GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const;
- virtual long GetTextWidth() const;
- virtual void InitFont() const;
- virtual bool LayoutText( ImplLayoutArgs& );
- virtual void MoveGlyph( int nStart, long nNewXPos );
- virtual void Simplify( bool bIsBase );
-
-private:
- void Clean();
- bool InitGIA() const;
-
- IosSalGraphics* m_graphics;
- CoreTextStyleInfo* m_style;
- mutable int m_glyphs_count;
- mutable int m_chars_count;
- mutable int* m_chars2glyphs;
- mutable int* m_glyphs2chars;
- mutable CGGlyph* m_glyphs;
- mutable int* m_char_widths;
- mutable int* m_glyph_advances;
- mutable CGPoint* m_glyph_positions;
- CTTypesetterRef m_typesetter;
- CTLineRef m_line;
- mutable bool m_has_bound_rec;
- mutable Rectangle m_bound_rect;
- CGFloat m_base_advance;
- mutable CGFloat m_cached_width;
- mutable CFIndex m_current_run_index;
- mutable CFIndex m_current_glyph_index;
- mutable CFIndex m_current_glyphrun_index;
- mutable CFArrayRef m_runs;
-
-};
-
-#endif // _VCL_IOS_CORETEXT_SALCORETEXTLAYOUT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salcoretextstyle.hxx b/vcl/inc/ios/salcoretextstyle.hxx
deleted file mode 100644
index eafba5144226..000000000000
--- a/vcl/inc/ios/salcoretextstyle.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _VCL_AQUA_CORETEXT_SALCORETEXTSTYLE_HXX
-#define _VCL_AQUA_CORETEXT_SALCORETEXTSTYLE_HXX
-
-#include "ios/salgdicommon.hxx"
-
-class FontSelectPattern;
-class CoreTextPhysicalFontFace;
-
-class CoreTextStyleInfo
-{
-public:
- CoreTextStyleInfo();
- ~CoreTextStyleInfo();
- CTFontRef GetFont() const { return m_CTFont; };
- CoreTextPhysicalFontFace* GetFontFace() const { return m_font_face; };
- long GetFontStretchedSize() const;
- float GetFontStretchFactor() const { return m_stretch_factor; };
- CTParagraphStyleRef GetParagraphStyle() const { return m_CTParagraphStyle; } ;
- CGSize GetSize() const;
- CGColorRef GetColor() const { return m_color; } ;
- void SetColor(SalColor color);
- void SetColor(void);
- void SetFont(FontSelectPattern* requested_font);
-
-private:
- bool m_fake_bold;
- bool m_fake_italic;
- CGAffineTransform m_matrix;
- float m_stretch_factor;
- float m_font_scale;
- float m_fake_dpi_scale;
- CTParagraphStyleRef m_CTParagraphStyle;
- CTFontRef m_CTFont;
- CGColorRef m_color;
- CoreTextPhysicalFontFace* m_font_face;
-};
-
-#endif // _VCL_AQUA_CORETEXT_SALCORETEXTSTYLE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salframe.h b/vcl/inc/ios/salframe.h
index b3d64389ca0b..9ca4fe72f4ed 100644
--- a/vcl/inc/ios/salframe.h
+++ b/vcl/inc/ios/salframe.h
@@ -34,7 +34,7 @@
#include <boost/shared_ptr.hpp>
-class IosSalGraphics;
+class QuartzSalGraphics;
class IosSalFrame;
class IosSalTimer;
class IosSalInstance;
@@ -53,7 +53,7 @@ public:
UIWindow* mpWindow;
UIView* mpView;
CGRect maScreenRect; // for mirroring purposes
- IosSalGraphics* mpGraphics;
+ QuartzSalGraphics* mpGraphics;
IosSalFrame* mpParent;
SystemEnvData maSysData;
int mnMinWidth; // min. client width in pixels
diff --git a/vcl/inc/ios/salgdi.h b/vcl/inc/ios/salgdi.h
deleted file mode 100644
index ac00f8c7918e..000000000000
--- a/vcl/inc/ios/salgdi.h
+++ /dev/null
@@ -1,307 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _VCL_IOS_SALGDI_H
-#define _VCL_IOS_SALGDI_H
-
-#include "basegfx/polygon/b2dpolypolygon.hxx"
-
-#include "ios/iosvcltypes.h"
-#include "ios/salcoretextfontutils.hxx"
-#include "ios/salframe.h"
-#include "salgdi.hxx"
-
-#include "ios/salgdicommon.hxx"
-
-class CoreTextStyleInfo;
-
-// -------------------
-// - IosSalGraphics -
-// -------------------
-class IosSalGraphics : public SalGraphics
-{
- friend class CoreTextLayout;
-protected:
- IosSalFrame* mpFrame;
- CGLayerRef mxLayer; //< Quartz graphics layer
- CGContextRef mrContext; //< Quartz drawing context
- class XorEmulation* mpXorEmulation;
- int mnXorMode; //< 0: off 1: on 2: invert only
- int mnWidth;
- int mnHeight;
- int mnBitmapDepth; //< zero unless bitmap
- long mnRealDPIX; //< device X-resolution of this graphics
- long mnRealDPIY; //< device Y-resolution of this graphics
-
- /// some graphics implementations (e.g. IosSalInfoPrinter) scale
- /// everything down by a factor (see SetupPrinterGraphics for details)
- /// so we have to compensate for it with the inverse factor
- double mfFakeDPIScale;
- double mfFontScale;
-
-
- CGMutablePathRef mxClipPath; //< path representing current clip region
-
- /// Drawing colors
- RGBAColor maLineColor; //< pen color RGBA
- RGBAColor maFillColor; //< brush color RGBA
-
- bool mbNonAntialiasedText; //< allows text to be rendered without antialiasing
-
- // Graphics types
-
- bool mbPrinter; //< is this a printer graphics
- bool mbVirDev; //< is this a virtual device graphics
- bool mbWindow; //< is this a window graphics
-
- CoreTextStyleInfo* m_style;
-
-public:
- IosSalGraphics();
- virtual ~IosSalGraphics();
-
- bool IsPenVisible() const { return maLineColor.IsVisible(); }
- bool IsBrushVisible() const { return maFillColor.IsVisible(); }
-
- void SetWindowGraphics( IosSalFrame* pFrame );
- void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY, double fFakeScale );
- void SetVirDevGraphics( CGLayerRef, CGContextRef, int nBitDepth = 0 );
-
- void initResolution( UIWindow* );
- void copyResolution( IosSalGraphics& );
- void updateResolution();
-
- bool IsWindowGraphics() const { return mbWindow; }
- bool IsPrinterGraphics() const { return mbPrinter; }
- bool IsVirDevGraphics() const { return mbVirDev; }
- IosSalFrame* getGraphicsFrame() const { return mpFrame; }
- void setGraphicsFrame( IosSalFrame* pFrame ) { mpFrame = pFrame; }
-
- void ImplDrawPixel( long nX, long nY, const RGBAColor& ); // helper to draw single pixels
-
- bool CheckContext();
- CGContextRef GetContext();
- void UpdateWindow( CGRect& ); // delivered in UIView coordinates
- void RefreshRect( const CGRect& );
- void RefreshRect(float lX, float lY, float lWidth, float lHeight);
-
- void SetState();
- void UnsetState();
- // InvalidateContext does an UnsetState and sets mrContext to 0
- void InvalidateContext();
-
- virtual bool setClipRegion( const Region& );
-
- // draw --> LineColor and FillColor and RasterOp and ClipRegion
- virtual void drawPixel( long nX, long nY );
- virtual void drawPixel( long nX, long nY, SalColor nSalColor );
- virtual void drawLine( long nX1, long nY1, long nX2, long nY2 );
- virtual void drawRect( long nX, long nY, long nWidth, long nHeight );
- virtual void drawPolyLine( sal_uLong nPoints, const SalPoint* pPtAry );
- virtual void drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry );
- virtual void drawPolyPolygon( sal_uLong nPoly, const sal_uLong* pPoints, PCONSTSALPOINT* pPtAry );
- virtual bool drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, double fTransparency );
- virtual sal_Bool drawPolyLineBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolygonBezier( sal_uLong nPoints, const SalPoint* pPtAry, const sal_uInt8* pFlgAry );
- virtual sal_Bool drawPolyPolygonBezier( sal_uLong nPoly, const sal_uLong* pPoints,
- const SalPoint* const* pPtAry, const sal_uInt8* const* pFlgAry );
- virtual bool drawPolyLine(
- const ::basegfx::B2DPolygon&,
- double fTransparency,
- const ::basegfx::B2DVector& rLineWidths,
- basegfx::B2DLineJoin,
- com::sun::star::drawing::LineCap eLineCap);
-
- // CopyArea --> No RasterOp, but ClipRegion
- virtual void copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth,
- long nSrcHeight, sal_uInt16 nFlags );
-
- // CopyBits and DrawBitmap --> RasterOp and ClipRegion
- // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
- virtual void copyBits( const SalTwoRect* pPosAry, SalGraphics* pSrcGraphics );
- virtual void drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
- const SalBitmap& rSalBitmap,
- SalColor nTransparentColor );
- virtual void drawBitmap( const SalTwoRect* pPosAry,
- const SalBitmap& rSalBitmap,
- const SalBitmap& rTransparentBitmap );
- virtual void drawMask( const SalTwoRect* pPosAry,
- const SalBitmap& rSalBitmap,
- SalColor nMaskColor );
-
- virtual SalBitmap* getBitmap( long nX, long nY, long nWidth, long nHeight );
- virtual SalColor getPixel( long nX, long nY );
-
- // invert --> ClipRegion (only Windows or VirDevs)
- virtual void invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags);
- virtual void invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nFlags );
-
- virtual sal_Bool drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize );
-
- virtual bool drawAlphaBitmap( const SalTwoRect&,
- const SalBitmap& rSourceBitmap,
- const SalBitmap& rAlphaBitmap );
-
- virtual bool drawAlphaRect( long nX, long nY, long nWidth,
- long nHeight, sal_uInt8 nTransparency );
-
- CGPoint* makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry);
- // native widget rendering methods that require mirroring
- virtual sal_Bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- const Point& aPos, sal_Bool& rIsInside );
- virtual sal_Bool drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- ControlState nState, const ImplControlValue& aValue,
- const rtl::OUString& aCaption );
- virtual sal_Bool getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
- ControlState nState, const ImplControlValue& aValue,
- const rtl::OUString& aCaption,
- Rectangle &rNativeBoundingRegion,
- Rectangle &rNativeContentRegion );
-
- // get device resolution
- virtual void GetResolution( long& rDPIX, long& rDPIY );
- // get the depth of the device
- virtual sal_uInt16 GetBitCount() const;
- // get the width of the device
- virtual long GetGraphicsWidth() const;
-
- // set the clip region to empty
- virtual void ResetClipRegion();
-
- // set the line color to transparent (= don't draw lines)
- virtual void SetLineColor();
- // set the line color to a specific color
- virtual void SetLineColor( SalColor nSalColor );
- // set the fill color to transparent (= don't fill)
- virtual void SetFillColor();
- // set the fill color to a specific color, shapes will be
- // filled accordingly
- virtual void SetFillColor( SalColor nSalColor );
- // enable/disable XOR drawing
- virtual void SetXORMode( bool bSet, bool bInvertOnly );
- // set line color for raster operations
- virtual void SetROPLineColor( SalROPColor nROPColor );
- // set fill color for raster operations
- virtual void SetROPFillColor( SalROPColor nROPColor );
- // set the text color to a specific color
- virtual void SetTextColor( SalColor nSalColor );
- // set the font
- virtual sal_uInt16 SetFont( FontSelectPattern*, int nFallbackLevel );
- // get the current font's etrics
- virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
- // get kernign pairs of the current font
- // return only PairCount if (pKernPairs == NULL)
- virtual sal_uLong GetKernPairs( sal_uLong nPairs, ImplKernPairData* pKernPairs );
- // get the repertoire of the current font
- virtual const ImplFontCharMap* GetImplFontCharMap() const;
- virtual bool GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
- // graphics must fill supplied font list
- virtual void GetDevFontList( ImplDevFontList* );
- // graphics must drop any cached font info
- virtual void ClearDevFontCache();
- // graphics should call ImplAddDevFontSubstitute on supplied
- // OutputDevice for all its device specific preferred font substitutions
- virtual void GetDevFontSubstList( OutputDevice* );
- virtual bool AddTempDevFont( ImplDevFontList*, const rtl::OUString& rFileURL,
- const rtl::OUString& rFontName );
- // CreateFontSubset: a method to get a subset of glyhps of a font
- // inside a new valid font file
- // returns TRUE if creation of subset was successfull
- // parameters: rToFile: contains a osl file URL to write the subset to
- // pFont: describes from which font to create a subset
- // pGlyphIDs: the glyph ids to be extracted
- // pEncoding: the character code corresponding to each glyph
- // pWidths: the advance widths of the correspoding glyphs (in PS font units)
- // nGlyphs: the number of glyphs
- // rInfo: additional outgoing information
- // implementation note: encoding 0 with glyph id 0 should be added implicitly
- // as "undefined character"
- virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
- const PhysicalFontFace* pFont,
- long* pGlyphIDs,
- sal_uInt8* pEncoding,
- sal_Int32* pWidths,
- int nGlyphs,
- FontSubsetInfo& rInfo);
-
- // GetFontEncodingVector: a method to get the encoding map Unicode
- // to font encoded character; this is only used for type1 fonts and
- // may return NULL in case of unknown encoding vector
- // if ppNonEncoded is set and non encoded characters (that is type1
- // glyphs with only a name) exist it is set to the corresponding
- // map for non encoded glyphs; the encoding vector contains -1
- // as encoding for these cases
- virtual const Ucs2SIntMap* GetFontEncodingVector( const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded );
-
- // GetEmbedFontData: gets the font data for a font marked
- // embeddable by GetDevFontList or NULL in case of error
- // parameters: pFont: describes the font in question
- // pWidths: the widths of all glyphs from char code 0 to 255
- // pWidths MUST support at least 256 members;
- // rInfo: additional outgoing information
- // pDataLen: out parameter, contains the byte length of the returned buffer
- virtual const void* GetEmbedFontData( const PhysicalFontFace*,
- const sal_Ucs* pUnicodes,
- sal_Int32* pWidths,
- FontSubsetInfo& rInfo,
- long* pDataLen );
- // frees the font data again
- virtual void FreeEmbedFontData( const void* pData, long nDataLen );
-
- virtual void GetGlyphWidths( const PhysicalFontFace*,
- bool bVertical,
- Int32Vector& rWidths,
- Ucs2UIntMap& rUnicodeEnc );
-
- virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& );
- virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& );
-
- virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel );
- virtual void DrawServerFontLayout( const ServerFontLayout& );
- virtual bool supportsOperation( OutDevSupportType ) const;
-
- // Query the platform layer for control support
- virtual sal_Bool IsNativeControlSupported( ControlType nType, ControlPart nPart );
-
- virtual SystemGraphicsData GetGraphicsData() const;
- virtual SystemFontData GetSysFontData( int /* nFallbacklevel */ ) const;
-
-private:
- // differences between VCL, Quartz and kHiThemeOrientation coordinate systems
- // make some graphics seem to be vertically-mirrored from a VCL perspective
- bool IsFlipped() const { return mbWindow; };
-
- void ApplyXorContext();
- void Pattern50Fill();
- UInt32 getState( ControlState nState );
- UInt32 getTrackState( ControlState nState );
- bool GetRawFontData( const PhysicalFontFace* pFontData,
- std::vector<unsigned char>& rBuffer,
- bool* pJustCFF );
-};
-
-inline void IosSalGraphics::RefreshRect( const CGRect& rRect )
-{
- RefreshRect( rRect.origin.x, rRect.origin.y, rRect.size.width, rRect.size.height );
-}
-
-#endif // _VCL_IOS_SALGDI_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/ios/salgdicommon.hxx b/vcl/inc/ios/salgdicommon.hxx
index c27ebef8d987..6d8edcfd95db 100644
--- a/vcl/inc/ios/salgdicommon.hxx
+++ b/vcl/inc/ios/salgdicommon.hxx
@@ -20,6 +20,8 @@
#ifndef _VCL_IOS_SALGDICOMMON_H
#define _VCL_IOS_SALGDICOMMON_H
+#include <vcl/salgtype.hxx>
+
// abstracting quartz color instead of having to use an CGFloat[] array
class RGBAColor
{
diff --git a/vcl/inc/ios/salvd.h b/vcl/inc/ios/salvd.h
index e82423acefc4..792b9d6d8732 100644
--- a/vcl/inc/ios/salvd.h
+++ b/vcl/inc/ios/salvd.h
@@ -21,7 +21,7 @@
#define _SV_SALVD_H
#include "ios/salcolorutils.hxx"
-#include "ios/salgdi.h"
+#include "coretext/salgdi.h"
#include "salvd.hxx"
@@ -39,8 +39,6 @@ typedef SalVirDevDataPtr *SalVirDevDataHandle;
// =======================================================================
-class IosSalGraphics;
-
class IosSalVirtualDevice : public SalVirtualDevice
{
private:
@@ -49,12 +47,12 @@ private:
CGContextRef mxBitmapContext;
int mnBitmapDepth;
CGLayerRef mxLayer; // Quartz layer
- IosSalGraphics* mpGraphics; // current VirDev graphics
+ QuartzSalGraphics* mpGraphics; // current VirDev graphics
void Destroy();
public:
- IosSalVirtualDevice( IosSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData );
+ IosSalVirtualDevice( QuartzSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData );
virtual ~IosSalVirtualDevice();
virtual SalGraphics* GetGraphics();
diff --git a/vcl/inc/vcl/sysdata.hxx b/vcl/inc/vcl/sysdata.hxx
index b032a0401ddd..c23e486adf66 100644
--- a/vcl/inc/vcl/sysdata.hxx
+++ b/vcl/inc/vcl/sysdata.hxx
@@ -27,6 +27,9 @@
// predeclare the native classes to avoid header/include problems
typedef struct CGContext *CGContextRef;
typedef struct CGLayer *CGLayerRef;
+#ifdef ENABLE_CORETEXT
+typedef const struct __CTFont * CTFontRef;
+#endif
#ifdef __OBJC__
@class NSView;
#else
@@ -199,7 +202,7 @@ struct SystemFontData
HFONT hFont; // native font object
#elif defined( MACOSX )
#ifdef ENABLE_CORETEXT
- void* rCTFont;
+ CTFontRef rCTFont; // native font object
#else
void* aATSUFontID; // native font object
#endif
diff --git a/vcl/ios/source/gdi/salcoretextfontutils.cxx b/vcl/ios/source/gdi/salcoretextfontutils.cxx
deleted file mode 100644
index 3175d0816d23..000000000000
--- a/vcl/ios/source/gdi/salcoretextfontutils.cxx
+++ /dev/null
@@ -1,613 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "ios/common.h"
-
-#include "ios/salcoretextfontutils.hxx"
-#include "ios/salgdi.h"
-
-#include "sft.hxx"
-#include "ios/salinst.h"
-
-
-static bool GetDevFontAttributes( CTFontDescriptorRef font_descriptor, ImplDevFontAttributes& rDFA )
-{
- int value = 0;
-
- // reset the attributes
- rDFA.SetFamilyType( FAMILY_DONTKNOW );
- rDFA.SetPitch( PITCH_VARIABLE );
- rDFA.SetWidthType( WIDTH_NORMAL );
- rDFA.SetWeight( WEIGHT_NORMAL );
- rDFA.SetItalic( ITALIC_NONE );
- rDFA.SetSymbolFlag( false );
- rDFA.mbOrientation = true;
- rDFA.mbDevice = true;
- rDFA.mnQuality = 0;
-
- CFNumberRef format = (CFNumberRef)CTFontDescriptorCopyAttribute(font_descriptor, kCTFontFormatAttribute);
- CFNumberGetValue(format, kCFNumberIntType, &value);
- CFRelease(format);
-
- if(value == kCTFontFormatBitmap)
- {
- /* we don't want bitmap fonts */
- return false;
- }
- rDFA.mbSubsettable = true;
- rDFA.mbEmbeddable = false;
-
- CFStringRef family_name = (CFStringRef)CTFontDescriptorCopyAttribute(font_descriptor, kCTFontFamilyNameAttribute);
- rDFA.SetFamilyName( GetOUString(family_name) );
- CFRelease(family_name);
-
- CFDictionaryRef traits = (CFDictionaryRef)CTFontDescriptorCopyAttribute(font_descriptor, kCTFontTraitsAttribute);
- CFNumberRef symbolics = (CFNumberRef)CFDictionaryGetValue(traits, kCTFontSymbolicTrait);
- CFNumberGetValue(symbolics, kCFNumberIntType, &value);
- CFRelease(symbolics);
-
- if(value & kCTFontMonoSpaceTrait)
- {
- rDFA.SetPitch( PITCH_FIXED );
- }
-
- if(value & kCTFontItalicTrait)
- {
- rDFA.SetItalic( ITALIC_NORMAL );
- }
-
- if(value & kCTFontBoldTrait)
- {
- rDFA.SetWeight( WEIGHT_BOLD );
- }
-
- if(value & kCTFontCondensedTrait)
- {
- rDFA.SetWidthType( WIDTH_CONDENSED );
- }
- else if(value & kCTFontExpandedTrait)
- {
- rDFA.SetWidthType( WIDTH_EXPANDED );
- }
- switch(value & kCTFontClassMaskTrait)
- {
- case kCTFontOldStyleSerifsClass:
- rDFA.SetFamilyType( FAMILY_ROMAN );
- break;
- case kCTFontTransitionalSerifsClass:
- case kCTFontModernSerifsClass:
- case kCTFontClarendonSerifsClass:
- case kCTFontSlabSerifsClass:
- case kCTFontFreeformSerifsClass:
- break;
- case kCTFontSansSerifClass:
- rDFA.SetFamilyType( FAMILY_SWISS );
- case kCTFontOrnamentalsClass:
- rDFA.SetFamilyType( FAMILY_DECORATIVE );
- break;
- case kCTFontScriptsClass:
- rDFA.SetFamilyType( FAMILY_SCRIPT );
- break;
- case kCTFontSymbolicClass:
- rDFA.SetSymbolFlag( true );
- break;
- }
-
- CFNumberRef weight = (CFNumberRef)CFDictionaryGetValue(traits, kCTFontWeightTrait);
- float fdval = 0.0;
- CFNumberGetValue(weight, kCFNumberFloatType, &fdval);
- if(fdval > 0.6)
- {
- rDFA.SetWeight( WEIGHT_BLACK );
- }
- else if(fdval > 0.4)
- {
- rDFA.SetWeight( WEIGHT_ULTRABOLD );
- }
- else if (fdval > 0.3)
- {
- rDFA.SetWeight( WEIGHT_BOLD );
- }
- else if (fdval > 0.0)
- {
- rDFA.SetWeight( WEIGHT_SEMIBOLD );
- }
- else if (fdval <= -0.8)
- {
- rDFA.SetWeight( WEIGHT_ULTRALIGHT );
- }
- else if (fdval <= -0.4)
- {
- rDFA.SetWeight( WEIGHT_LIGHT );
- }
- else if (fdval <= -0.3)
- {
- rDFA.SetWeight( WEIGHT_SEMILIGHT );
- }
- else if (fdval <= -0.2)
- {
- rDFA.SetWeight( WEIGHT_THIN );
- }
- else
- {
- rDFA.SetWeight( WEIGHT_NORMAL );
- }
-
- CFStringRef string_ref = (CFStringRef)CTFontDescriptorCopyAttribute(font_descriptor, kCTFontStyleNameAttribute);
- rtl::OUString font_name = GetOUString(string_ref);
- rtl::OUString font_name_lc(font_name.toAsciiLowerCase());
- CFRelease(string_ref);
-
- // heuristics to adjust font slant
- if( (font_name_lc.indexOf("oblique") != -1) ||
- (font_name_lc.indexOf("inclined") != -1) ||
- (font_name_lc.indexOf("slanted") != -1) )
- {
- rDFA.SetItalic( ITALIC_OBLIQUE );
- }
-
- // heuristics to adjust font width
- if (font_name_lc.indexOf("narrow") != -1)
- {
- rDFA.SetWidthType( WIDTH_SEMI_CONDENSED );
- }
-
- // heuristics for font family type
- if( (font_name_lc.indexOf("script") != -1) ||
- (font_name_lc.indexOf("chancery") != -1) ||
- (font_name_lc.indexOf("zapfino") != -1))
- {
- rDFA.SetFamilyType( FAMILY_SCRIPT );
- }
- else if( (font_name_lc.indexOf("comic") != -1) ||
- (font_name_lc.indexOf("outline") != -1) ||
- (font_name_lc.indexOf("pinpoint") != -1) )
- {
- rDFA.SetFamilyType( FAMILY_DECORATIVE );
- }
- else if( (font_name_lc.indexOf("sans") != -1) ||
- (font_name_lc.indexOf("arial") != -1) )
- {
- rDFA.SetFamilyType( FAMILY_SWISS );
- }
- else if( (font_name_lc.indexOf("roman") != -1) ||
- (font_name_lc.indexOf("times") != -1) )
- {
- rDFA.SetFamilyType( FAMILY_ROMAN );
- }
- return true;
-}
-
-SystemFontList::SystemFontList()
-{
- CTFontCollectionRef font_collection = CTFontCollectionCreateFromAvailableFonts(NULL);
- if(font_collection)
- {
- CFArrayRef font_descriptors = CTFontCollectionCreateMatchingFontDescriptors(font_collection);
-
- if(font_descriptors)
- {
- for(int i = 0; i < CFArrayGetCount(font_descriptors); i++)
- {
- CTFontDescriptorRef font_descriptor = (CTFontDescriptorRef)CFArrayGetValueAtIndex(font_descriptors, i);
- CTFontRef font = CTFontCreateWithFontDescriptor(font_descriptor, 0, NULL);
- if(font)
- {
- ImplDevFontAttributes devfont_attr;
- if(GetDevFontAttributes( font_descriptor, devfont_attr ) )
- {
- CoreTextPhysicalFontFace* font_face = new CoreTextPhysicalFontFace(devfont_attr, font);
- if(font_face && font_face->GetCTFont())
- {
- m_aFontContainer [ font_face->GetCTFont() ] = font_face;
- }
- }
- CFRelease(font);
- }
- }
- CFRelease(font_descriptors);
- }
- CFRelease(font_collection);
- }
-
-}
-
-SystemFontList::~SystemFontList()
-{
- CoreTextFontContainer::const_iterator it = m_aFontContainer.begin();
- for(; it != m_aFontContainer.end(); ++it )
- delete (*it).second;
- m_aFontContainer.clear();
-}
-
-CoreTextPhysicalFontFace* SystemFontList::GetFontDataFromRef( CTFontRef font ) const
-{
- CoreTextFontContainer::const_iterator it = m_aFontContainer.find( font );
- return it == m_aFontContainer.end() ? NULL : (*it).second;
-}
-
-
-void SystemFontList::AnnounceFonts( ImplDevFontList& rFontList ) const
-{
- CoreTextFontContainer::const_iterator it = m_aFontContainer.begin();
- for(; it != m_aFontContainer.end(); ++it )
- {
- rFontList.Add( (*it).second->Clone() );
- }
-}
-
-CoreTextPhysicalFontFace::CoreTextPhysicalFontFace( const ImplDevFontAttributes& rDFA, CTFontRef font )
-: PhysicalFontFace( rDFA, 0 )
-, m_CTFontRef((CTFontRef)CFRetain(font))
-, m_pCharMap( NULL )
-, m_bHasOs2Table( false )
-, m_bOs2TableRead( false )
-, m_bCmapTableRead( false )
-, m_bHasCJKSupport( false )
-, m_bFontCapabilitiesRead( false )
-{
- SAL_INFO( "vcl.coretext.font", "retain " << font << " as " << m_CTFontRef );
-}
-
-CoreTextPhysicalFontFace::~CoreTextPhysicalFontFace()
-{
- if( m_pCharMap )
- {
- m_pCharMap->DeReference();
- }
- SAL_INFO( "vcl.coretext.font", "release " << m_CTFontRef );
- SafeCFRelease(m_CTFontRef);
-}
-
-PhysicalFontFace* CoreTextPhysicalFontFace::Clone() const
-{
- CoreTextPhysicalFontFace* pClone = new CoreTextPhysicalFontFace(*this);
- if( m_pCharMap )
- {
- m_pCharMap->AddReference();
- }
- if( m_CTFontRef )
- {
- pClone->m_CTFontRef = (CTFontRef)CFRetain(m_CTFontRef);
- SAL_INFO( "vcl.coretext.font", "clone " << m_CTFontRef << " into " << pClone->m_CTFontRef );
- }
- return pClone;
-}
-
-ImplFontEntry* CoreTextPhysicalFontFace::CreateFontInstance(FontSelectPattern& rFSD) const
-{
- return new ImplFontEntry(rFSD);
-}
-
-const ImplFontCharMap* CoreTextPhysicalFontFace::GetImplFontCharMap()
-{
- // return the cached charmap
- if( m_pCharMap )
- {
- return m_pCharMap;
- }
- // set the default charmap
- m_pCharMap = ImplFontCharMap::GetDefaultMap();
- m_pCharMap->AddReference();
-
- // get the CMAP byte size
- CFDataRef rCmapTable = CTFontCopyTable( m_CTFontRef, kCTFontTableCmap, kCTFontTableOptionNoOptions);
- if(!rCmapTable)
- {
- return m_pCharMap;
- }
- if(!m_bCmapTableRead)
- {
- m_bCmapTableRead = true;
- DetermineCJKSupport_cmap(rCmapTable);
- }
- // parse the CMAP
- CmapResult aCmapResult;
- if(ParseCMAP( CFDataGetBytePtr(rCmapTable), CFDataGetLength(rCmapTable), aCmapResult ) )
- {
- m_pCharMap = new ImplFontCharMap( aCmapResult );
- m_pCharMap->AddReference();
- }
- CFRelease(rCmapTable);
- return m_pCharMap;
-}
-
-bool CoreTextPhysicalFontFace::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabilities)
-{
- // read this only once per font
- if( m_bFontCapabilitiesRead )
- {
- rFontCapabilities = m_aFontCapabilities;
- return !rFontCapabilities.maUnicodeRange.empty() || !rFontCapabilities.maCodePageRange.empty();
- }
- m_bFontCapabilitiesRead = true;
-
- // get the GSUB table raw data
- CFDataRef rGSUBTable = CTFontCopyTable( m_CTFontRef, kCTFontTableGSUB, kCTFontTableOptionNoOptions);
- if(rGSUBTable)
- {
-
- vcl::getTTScripts(m_aFontCapabilities.maGSUBScriptTags,
- CFDataGetBytePtr(rGSUBTable), CFDataGetLength(rGSUBTable));
- CFRelease(rGSUBTable);
- }
- CFDataRef OS2_Table = CTFontCopyTable( m_CTFontRef, kCTFontTableOS2, kCTFontTableOptionNoOptions);
- if(OS2_Table)
- {
- vcl::getTTCoverage(
- m_aFontCapabilities.maUnicodeRange,
- m_aFontCapabilities.maCodePageRange,
- CFDataGetBytePtr(OS2_Table), CFDataGetLength(OS2_Table));
- /* while we are at it let's solve HasCJK for the same price */
- if(!m_bOs2TableRead )
- {
- m_bOs2TableRead = true;
- m_bHasOs2Table = true;
- DetermineCJKSupport_OS2(OS2_Table);
- }
- CFRelease(OS2_Table);
- }
- rFontCapabilities = m_aFontCapabilities;
- return !rFontCapabilities.maUnicodeRange.empty() || !rFontCapabilities.maCodePageRange.empty();
-}
-
-struct font_table
-{
- unsigned char* table;
- unsigned char* dir_entry;
- unsigned char* cursor;
-};
-
-void addTable(struct font_table* table, CTFontTableTag tag, CFDataRef data)
-{
- if(data && CFDataGetLength(data) > 0)
- {
- *(uint32_t*)table->dir_entry = CFSwapInt32HostToBig(tag);
- table->dir_entry += 4;
- *(uint32_t*)table->dir_entry = 0; /* TODO: checksum */
- table->dir_entry += 4;
- *(uint32_t*)table->dir_entry = CFSwapInt32HostToBig((uint32_t)((uintptr_t)table->cursor - (uintptr_t)table));
- table->dir_entry += 4;
- *(uint32_t*)table->dir_entry = CFSwapInt32HostToBig(CFDataGetLength(data));
- table->dir_entry += 4;
-
- memcpy(table->cursor, CFDataGetBytePtr(data), CFDataGetLength(data));
- table->cursor += CFDataGetLength(data);
- }
-}
-
-bool CoreTextPhysicalFontFace::GetRawFontData( std::vector<unsigned char>& rBuffer, bool* pJustCFF ) const
-{
- bool rc;
- int table_count = 0;
-
- CFDataRef CFF_table = CTFontCopyTable( m_CTFontRef, kCTFontTableCFF, kCTFontTableOptionNoOptions);
- if(pJustCFF)
- {
- if(CFF_table)
- {
- *pJustCFF = CFDataGetLength(CFF_table) ? true : false;
- CFRelease(CFF_table);
- return true;
- }
- else
- {
- return false;
- }
- }
- size_t total_len = 0;
- CFDataRef head_table = CTFontCopyTable( m_CTFontRef, kCTFontTableHead, kCTFontTableOptionNoOptions);
- CFDataRef maxp_table = CTFontCopyTable( m_CTFontRef, kCTFontTableMaxp, kCTFontTableOptionNoOptions);
- CFDataRef cmap_table = CTFontCopyTable( m_CTFontRef, kCTFontTableHead, kCTFontTableOptionNoOptions);
- CFDataRef name_table = CTFontCopyTable( m_CTFontRef, kCTFontTableName, kCTFontTableOptionNoOptions);
- CFDataRef hhea_table = CTFontCopyTable( m_CTFontRef, kCTFontTableHhea, kCTFontTableOptionNoOptions);
- CFDataRef hmtx_table = CTFontCopyTable( m_CTFontRef, kCTFontTableHmtx, kCTFontTableOptionNoOptions);
- rc = false;
- if(head_table && maxp_table && cmap_table && name_table && hhea_table && hmtx_table)
- {
- if(CFDataGetLength(head_table) &&
- CFDataGetLength(maxp_table) &&
- CFDataGetLength(name_table) &&
- CFDataGetLength(hhea_table) &&
- CFDataGetLength(hmtx_table))
- {
- table_count += 6;
- total_len = CFDataGetLength(head_table) +
- CFDataGetLength(maxp_table) +
- CFDataGetLength(name_table) +
- CFDataGetLength(hhea_table) +
- CFDataGetLength(hmtx_table);
- rc = true;
- }
- }
-
- CFDataRef loca_table = NULL;
- CFDataRef glyf_table = NULL;
- CFDataRef prep_table = NULL;
- CFDataRef cvt_table = NULL;
- CFDataRef fpgm_table = NULL;
- if(rc)
- {
- if(!CFF_table || CFDataGetLength(CFF_table) == 0)
- {
- loca_table = CTFontCopyTable( m_CTFontRef, kCTFontTableLoca, kCTFontTableOptionNoOptions);
- glyf_table = CTFontCopyTable( m_CTFontRef, kCTFontTableGlyf, kCTFontTableOptionNoOptions);
- if(!loca_table || !glyf_table || !CFDataGetLength(loca_table) || !CFDataGetLength(glyf_table))
- {
- rc = false;
- }
- else
- {
- table_count += 2;
- total_len += CFDataGetLength(loca_table) + CFDataGetLength(glyf_table);
- prep_table = CTFontCopyTable( m_CTFontRef, kCTFontTablePrep, kCTFontTableOptionNoOptions);
- cvt_table = CTFontCopyTable( m_CTFontRef, kCTFontTableCvt, kCTFontTableOptionNoOptions);
- fpgm_table = CTFontCopyTable( m_CTFontRef, kCTFontTableFpgm, kCTFontTableOptionNoOptions);
- if(prep_table || CFDataGetLength(prep_table) > 0)
- {
- table_count += 1;
- total_len += CFDataGetLength(prep_table);
- }
- if(cvt_table || CFDataGetLength(cvt_table) > 0)
- {
- table_count += 1;
- total_len += CFDataGetLength(cvt_table);
- }
- if(fpgm_table || CFDataGetLength(fpgm_table) > 0)
- {
- table_count += 1;
- total_len += CFDataGetLength(fpgm_table);
- }
- }
- }
- else
- {
- table_count += 1;
- total_len += CFDataGetLength(CFF_table);
- }
- }
- if(rc)
- {
- total_len += 12 + 16 * table_count;
- rBuffer.resize(total_len);
- struct font_table table;
- unsigned char* cursor = &rBuffer[0];
- int nLog2 = 0;
-
- while( (table_count >> nLog2) > 1 ) ++nLog2;
-
- table.table = cursor;
- *(uint16_t*)cursor = CFSwapInt16HostToBig(1);
- cursor += 2;
- *(uint16_t*)cursor = 0;
- cursor += 2;
- *(uint16_t*)cursor = CFSwapInt16HostToBig(table_count);
- cursor += 2;
- *(uint16_t*)cursor = CFSwapInt16HostToBig(nLog2 * 16);
- cursor += 2;
- *(uint16_t*)cursor = CFSwapInt16HostToBig(nLog2);
- cursor += 2;
- *(uint16_t*)cursor = CFSwapInt16HostToBig((table_count - nLog2) * 16); // rangeShift
- cursor += 2;
- table.dir_entry = cursor;
- cursor += (16 * table_count);
- table.cursor = cursor;
- addTable(&table, kCTFontTableCmap, cmap_table);
- addTable(&table, kCTFontTableCvt, cvt_table);
- addTable(&table, kCTFontTableFpgm, fpgm_table);
- addTable(&table, kCTFontTableCFF, CFF_table);
- addTable(&table, kCTFontTableGlyf, glyf_table);
- addTable(&table, kCTFontTableLoca, loca_table);
- addTable(&table, kCTFontTableHead, head_table);
- addTable(&table, kCTFontTableHhea, hhea_table);
- addTable(&table, kCTFontTableHmtx, hmtx_table);
- addTable(&table, kCTFontTableMaxp, maxp_table);
- addTable(&table, kCTFontTableName, name_table);
- addTable(&table, kCTFontTablePrep, prep_table);
- }
- SafeCFRelease(cmap_table);
- SafeCFRelease(cvt_table);
- SafeCFRelease(fpgm_table);
- SafeCFRelease(CFF_table);
- SafeCFRelease(glyf_table);
- SafeCFRelease(loca_table);
- SafeCFRelease(head_table);
- SafeCFRelease(hhea_table);
- SafeCFRelease(hmtx_table);
- SafeCFRelease(maxp_table);
- SafeCFRelease(name_table);
- SafeCFRelease(prep_table);
-
- return rc;
-}
-
-void CoreTextPhysicalFontFace::DetermineCJKSupport_OS2(CFDataRef rOS2Table)
-{
- if(CFDataGetLength(rOS2Table) >= 48)
- {
- const unsigned short* pOS2buffer = (const unsigned short*)CFDataGetBytePtr(rOS2Table);
- const unsigned short version = CFSwapInt16BigToHost(pOS2buffer[0]);
- if( version >= 1)
- {
- const unsigned short unicode_range = CFSwapInt16BigToHost(pOS2buffer[23]);
- if( unicode_range & 0x2DF0)
- {
- m_bHasCJKSupport = true;
- }
- }
- }
-}
-
-void CoreTextPhysicalFontFace::DetermineCJKSupport_cmap(CFDataRef rCmapTable)
-{
- int table_len = CFDataGetLength(rCmapTable) / 2;
- if(table_len >= 12)
- {
- const unsigned short* pCmap = (const unsigned short*)CFDataGetBytePtr(rCmapTable);
- if(pCmap[0] == 0)
- {
- short nb_sub_tables = CFSwapInt16BigToHost(pCmap[1]);
- for(int i = 2; --nb_sub_tables >= 0 && i < table_len; i += 4)
- {
- short platform = CFSwapInt16BigToHost(pCmap[i]);
- if( platform == kFontMacintoshPlatform )
- {
- short encoding = CFSwapInt16BigToHost(pCmap[i+1]);
- if( encoding == kFontJapaneseScript ||
- encoding == kFontTraditionalChineseScript ||
- encoding == kFontKoreanScript ||
- encoding == kFontSimpleChineseScript )
- {
- m_bHasCJKSupport = true;
- break;
- }
- }
- }
- }
- }
-}
-
-bool CoreTextPhysicalFontFace::HasCJKSupport( void )
-{
- // read this only once per font
- if(!m_bOs2TableRead )
- {
- m_bOs2TableRead = true;
- CFDataRef rOS2Table = CTFontCopyTable( m_CTFontRef, kCTFontTableOS2, kCTFontTableOptionNoOptions);
- if(rOS2Table)
- {
- m_bHasOs2Table = true;
- DetermineCJKSupport_OS2(rOS2Table);
- CFRelease(rOS2Table);
- }
- }
- if( !m_bCmapTableRead && !m_bHasOs2Table && !m_bHasCJKSupport )
- {
- m_bCmapTableRead = true;
- CFDataRef rCmapTable = CTFontCopyTable( m_CTFontRef, kCTFontTableCmap, kCTFontTableOptionNoOptions);
- if(rCmapTable)
- {
- DetermineCJKSupport_cmap(rCmapTable);
- CFRelease(rCmapTable);
- }
- }
- return m_bHasCJKSupport;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/ios/source/gdi/salgdicommon.cxx b/vcl/ios/source/gdi/salgdicommon.cxx
index 615852c812ce..bb6ec7045869 100644
--- a/vcl/ios/source/gdi/salgdicommon.cxx
+++ b/vcl/ios/source/gdi/salgdicommon.cxx
@@ -23,7 +23,7 @@
#include "basegfx/polygon/b2dpolygon.hxx"
#include "ios/salbmp.h"
-#include "ios/salgdi.h"
+#include "coretext/salgdi.h"
#include "fontsubset.hxx"
#include "region.h"
@@ -134,7 +134,7 @@ static void AddPolyPolygonToPath( CGMutablePathRef xPath,
}
}
-sal_Bool IosSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
+sal_Bool QuartzSalGraphics::CreateFontSubset( const rtl::OUString& rToFile,
const PhysicalFontFace* pFontData,
long* pGlyphIDs, sal_uInt8* pEncoding,
sal_Int32* pGlyphWidths, int nGlyphCount,
@@ -275,7 +275,7 @@ static inline void alignLinePoint( const SalPoint* i_pIn, float& o_fX, float& o_
o_fY = static_cast<float>(i_pIn->mnY ) + 0.5;
}
-void IosSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGraphics )
+void QuartzSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGraphics )
{
if( !pSrcGraphics )
{
@@ -292,7 +292,7 @@ void IosSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGraph
}
// accelerate trivial operations
- /*const*/ IosSalGraphics* pSrc = static_cast<IosSalGraphics*>(pSrcGraphics);
+ /*const*/ QuartzSalGraphics* pSrc = static_cast<QuartzSalGraphics*>(pSrcGraphics);
const bool bSameGraphics = (this == pSrc) ||
(mbWindow && mpFrame && pSrc->mbWindow && (mpFrame == pSrc->mpFrame));
if( bSameGraphics &&
@@ -312,7 +312,7 @@ void IosSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGraph
ApplyXorContext();
pSrc->ApplyXorContext();
- DBG_ASSERT( pSrc->mxLayer!=NULL, "IosSalGraphics::copyBits() from non-layered graphics" );
+ DBG_ASSERT( pSrc->mxLayer!=NULL, "QuartzSalGraphics::copyBits() from non-layered graphics" );
const CGPoint aDstPoint = { static_cast<CGFloat>(+pPosAry->mnDestX - pPosAry->mnSrcX), static_cast<CGFloat>(pPosAry->mnDestY - pPosAry->mnSrcY) };
if( (pPosAry->mnSrcWidth == pPosAry->mnDestWidth &&
@@ -414,7 +414,7 @@ static SalColor ImplGetROPSalColor( SalROPColor nROPColor )
}
// apply the XOR mask to the target context if active and dirty
-void IosSalGraphics::ApplyXorContext()
+void QuartzSalGraphics::ApplyXorContext()
{
if( !mpXorEmulation )
{
@@ -426,12 +426,12 @@ void IosSalGraphics::ApplyXorContext()
}
}
-void IosSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
+void QuartzSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
long nSrcWidth, long nSrcHeight, sal_uInt16 /*nFlags*/ )
{
ApplyXorContext();
- DBG_ASSERT( mxLayer!=NULL, "IosSalGraphics::copyArea() for non-layered graphics" );
+ DBG_ASSERT( mxLayer!=NULL, "QuartzSalGraphics::copyArea() for non-layered graphics" );
// in XOR mode the drawing context is redirected to the XOR mask
// copyArea() always works on the target context though
@@ -474,7 +474,7 @@ void IosSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
}
-void IosSalGraphics::copyResolution( IosSalGraphics& rGraphics )
+void QuartzSalGraphics::copyResolution( QuartzSalGraphics& rGraphics )
{
if( !rGraphics.mnRealDPIY && rGraphics.mbWindow && rGraphics.mpFrame )
{
@@ -485,7 +485,7 @@ void IosSalGraphics::copyResolution( IosSalGraphics& rGraphics )
mfFakeDPIScale = rGraphics.mfFakeDPIScale;
}
-bool IosSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
+bool QuartzSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
const SalBitmap& rSrcBitmap,
const SalBitmap& rAlphaBmp )
{
@@ -521,7 +521,7 @@ bool IosSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
return true;
}
-bool IosSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
+bool QuartzSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency )
{
if( !CheckContext() )
@@ -549,7 +549,7 @@ bool IosSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
return true;
}
-void IosSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap )
+void QuartzSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap )
{
if( !CheckContext() )
{
@@ -569,13 +569,13 @@ void IosSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSa
RefreshRect( aDstRect );
}
-void IosSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap,SalColor )
+void QuartzSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap,SalColor )
{
OSL_FAIL("not implemented for color masking!");
drawBitmap( pPosAry, rSalBitmap );
}
-void IosSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap,
+void QuartzSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap )
{
if( !CheckContext() )
@@ -597,13 +597,13 @@ void IosSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSa
RefreshRect( aDstRect );
}
-sal_Bool IosSalGraphics::drawEPS( long /*nX*/, long /*nY*/, long /*nWidth*/, long /*nHeight*/,
+sal_Bool QuartzSalGraphics::drawEPS( long /*nX*/, long /*nY*/, long /*nWidth*/, long /*nHeight*/,
void* /*pEpsData*/, sal_uLong /*nByteCount*/ )
{
return sal_False;
}
-void IosSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 )
+void QuartzSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 )
{
if( nX1 == nX2 && nY1 == nY2 )
{
@@ -624,7 +624,7 @@ void IosSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 )
Rectangle aRefreshRect( nX1, nY1, nX2, nY2 );
}
-void IosSalGraphics::drawMask( const SalTwoRect* pPosAry,
+void QuartzSalGraphics::drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSalBitmap,
SalColor nMaskColor )
{
@@ -647,19 +647,19 @@ void IosSalGraphics::drawMask( const SalTwoRect* pPosAry,
RefreshRect( aDstRect );
}
-void IosSalGraphics::drawPixel( long nX, long nY )
+void QuartzSalGraphics::drawPixel( long nX, long nY )
{
// draw pixel with current line color
ImplDrawPixel( nX, nY, maLineColor );
}
-void IosSalGraphics::drawPixel( long nX, long nY, SalColor nSalColor )
+void QuartzSalGraphics::drawPixel( long nX, long nY, SalColor nSalColor )
{
const RGBAColor aPixelColor( nSalColor );
ImplDrawPixel( nX, nY, aPixelColor );
}
-bool IosSalGraphics::drawPolyLine(
+bool QuartzSalGraphics::drawPolyLine(
const ::basegfx::B2DPolygon& rPolyLine,
double fTransparency,
const ::basegfx::B2DVector& rLineWidths,
@@ -750,12 +750,12 @@ bool IosSalGraphics::drawPolyLine(
return true;
}
-sal_Bool IosSalGraphics::drawPolyLineBezier( sal_uLong, const SalPoint*, const sal_uInt8* )
+sal_Bool QuartzSalGraphics::drawPolyLineBezier( sal_uLong, const SalPoint*, const sal_uInt8* )
{
return sal_False;
}
-bool IosSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly,
+bool QuartzSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly,
double fTransparency )
{
// short circuit if there is nothing to do
@@ -803,7 +803,7 @@ bool IosSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly
return true;
}
-void IosSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pPoints, PCONSTSALPOINT *ppPtAry )
+void QuartzSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pPoints, PCONSTSALPOINT *ppPtAry )
{
if( nPolyCount <= 0 )
return;
@@ -902,7 +902,7 @@ void IosSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pPo
RefreshRect( leftX, topY, maxWidth, maxHeight );
}
-void IosSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint *pPtAry )
+void QuartzSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint *pPtAry )
{
if( nPoints <= 1 )
return;
@@ -957,18 +957,18 @@ void IosSalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint *pPtAry )
RefreshRect( nX, nY, nWidth, nHeight );
}
-sal_Bool IosSalGraphics::drawPolygonBezier( sal_uLong, const SalPoint*, const sal_uInt8* )
+sal_Bool QuartzSalGraphics::drawPolygonBezier( sal_uLong, const SalPoint*, const sal_uInt8* )
{
return sal_False;
}
-sal_Bool IosSalGraphics::drawPolyPolygonBezier( sal_uLong, const sal_uLong*,
+sal_Bool QuartzSalGraphics::drawPolyPolygonBezier( sal_uLong, const sal_uLong*,
const SalPoint* const*, const sal_uInt8* const* )
{
return sal_False;
}
-void IosSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
+void QuartzSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
{
if( !CheckContext() )
{
@@ -995,7 +995,7 @@ void IosSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
}
-void IosSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
+void QuartzSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
if( nPoints < 1 )
{
@@ -1024,15 +1024,15 @@ void IosSalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
RefreshRect( nX, nY, nWidth, nHeight );
}
-sal_uInt16 IosSalGraphics::GetBitCount() const
+sal_uInt16 QuartzSalGraphics::GetBitCount() const
{
sal_uInt16 nBits = mnBitmapDepth ? mnBitmapDepth : 32;//24;
return nBits;
}
-SalBitmap* IosSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
+SalBitmap* QuartzSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
{
- DBG_ASSERT( mxLayer, "IosSalGraphics::getBitmap() with no layer" );
+ DBG_ASSERT( mxLayer, "QuartzSalGraphics::getBitmap() with no layer" );
ApplyXorContext();
@@ -1046,7 +1046,7 @@ SalBitmap* IosSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY )
return pBitmap;
}
-SystemGraphicsData IosSalGraphics::GetGraphicsData() const
+SystemGraphicsData QuartzSalGraphics::GetGraphicsData() const
{
SystemGraphicsData aRes;
aRes.nSize = sizeof(aRes);
@@ -1054,7 +1054,7 @@ SystemGraphicsData IosSalGraphics::GetGraphicsData() const
return aRes;
}
-long IosSalGraphics::GetGraphicsWidth() const
+long QuartzSalGraphics::GetGraphicsWidth() const
{
long w = 0;
if( mrContext && (mbWindow || mbVirDev) )
@@ -1072,7 +1072,7 @@ long IosSalGraphics::GetGraphicsWidth() const
return w;
}
-SalColor IosSalGraphics::getPixel( long nX, long nY )
+SalColor QuartzSalGraphics::getPixel( long nX, long nY )
{
// return default value on printers or when out of bounds
if( !mxLayer || (nX < 0) || (nX >= mnWidth) ||
@@ -1111,7 +1111,7 @@ SalColor IosSalGraphics::getPixel( long nX, long nY )
return nSalColor;
}
-void IosSalGraphics::GetResolution( long& rDPIX, long& rDPIY )
+void QuartzSalGraphics::GetResolution( long& rDPIX, long& rDPIY )
{
if( !mnRealDPIY )
{
@@ -1122,7 +1122,7 @@ void IosSalGraphics::GetResolution( long& rDPIX, long& rDPIY )
rDPIY = static_cast<long>(mfFakeDPIScale * mnRealDPIY);
}
-void IosSalGraphics::ImplDrawPixel( long nX, long nY, const RGBAColor& rColor )
+void QuartzSalGraphics::ImplDrawPixel( long nX, long nY, const RGBAColor& rColor )
{
if( !CheckContext() )
{
@@ -1138,7 +1138,7 @@ void IosSalGraphics::ImplDrawPixel( long nX, long nY, const RGBAColor& rColor )
CGContextSetFillColor( mrContext, maFillColor.AsArray() );
}
-void IosSalGraphics::initResolution( UIWindow* )
+void QuartzSalGraphics::initResolution( UIWindow* )
{
// #i100617# read DPI only once; there is some kind of weird caching going on
// if the main screen changes
@@ -1172,7 +1172,7 @@ void IosSalGraphics::initResolution( UIWindow* )
mfFakeDPIScale = 1.0;
}
-void IosSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags )
+void QuartzSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags )
{
if ( CheckContext() )
{
@@ -1206,7 +1206,7 @@ void IosSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
}
}
-void IosSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
+void QuartzSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInvert nSalFlags )
{
CGPoint* CGpoints ;
if ( CheckContext() )
@@ -1241,7 +1241,7 @@ void IosSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInve
}
}
-void IosSalGraphics::Pattern50Fill()
+void QuartzSalGraphics::Pattern50Fill()
{
static const float aFillCol[4] = { 1,1,1,1 };
static const CGPatternCallbacks aCallback = { 0, &DrawPattern50, NULL };
@@ -1262,7 +1262,7 @@ void IosSalGraphics::Pattern50Fill()
}
-void IosSalGraphics::ResetClipRegion()
+void QuartzSalGraphics::ResetClipRegion()
{
// release old path and indicate no clipping
if( mxClipPath )
@@ -1276,7 +1276,7 @@ void IosSalGraphics::ResetClipRegion()
}
}
-void IosSalGraphics::SetLineColor()
+void QuartzSalGraphics::SetLineColor()
{
maLineColor.SetAlpha( 0.0 ); // transparent
if( CheckContext() )
@@ -1285,7 +1285,7 @@ void IosSalGraphics::SetLineColor()
}
}
-void IosSalGraphics::SetLineColor( SalColor nSalColor )
+void QuartzSalGraphics::SetLineColor( SalColor nSalColor )
{
maLineColor = RGBAColor( nSalColor );
if( CheckContext() )
@@ -1294,7 +1294,7 @@ void IosSalGraphics::SetLineColor( SalColor nSalColor )
}
}
-void IosSalGraphics::SetFillColor()
+void QuartzSalGraphics::SetFillColor()
{
maFillColor.SetAlpha( 0.0 ); // transparent
if( CheckContext() )
@@ -1303,7 +1303,7 @@ void IosSalGraphics::SetFillColor()
}
}
-void IosSalGraphics::SetFillColor( SalColor nSalColor )
+void QuartzSalGraphics::SetFillColor( SalColor nSalColor )
{
maFillColor = RGBAColor( nSalColor );
if( CheckContext() )
@@ -1312,7 +1312,7 @@ void IosSalGraphics::SetFillColor( SalColor nSalColor )
}
}
-bool IosSalGraphics::supportsOperation( OutDevSupportType eType ) const
+bool QuartzSalGraphics::supportsOperation( OutDevSupportType eType ) const
{
bool bRet = false;
switch( eType )
@@ -1327,7 +1327,7 @@ bool IosSalGraphics::supportsOperation( OutDevSupportType eType ) const
return bRet;
}
-bool IosSalGraphics::setClipRegion( const Region& i_rClip )
+bool QuartzSalGraphics::setClipRegion( const Region& i_rClip )
{
// release old clip path
if( mxClipPath )
@@ -1366,19 +1366,19 @@ bool IosSalGraphics::setClipRegion( const Region& i_rClip )
return true;
}
-void IosSalGraphics::SetROPFillColor( SalROPColor nROPColor )
+void QuartzSalGraphics::SetROPFillColor( SalROPColor nROPColor )
{
if( ! mbPrinter )
SetFillColor( ImplGetROPSalColor( nROPColor ) );
}
-void IosSalGraphics::SetROPLineColor( SalROPColor nROPColor )
+void QuartzSalGraphics::SetROPLineColor( SalROPColor nROPColor )
{
if( ! mbPrinter )
SetLineColor( ImplGetROPSalColor( nROPColor ) );
}
-void IosSalGraphics::SetXORMode( bool bSet, bool bInvertOnly )
+void QuartzSalGraphics::SetXORMode( bool bSet, bool bInvertOnly )
{
// return early if XOR mode remains unchanged
if( mbPrinter )
@@ -1433,7 +1433,7 @@ void IosSalGraphics::SetXORMode( bool bSet, bool bInvertOnly )
}
}
-void IosSalGraphics::updateResolution()
+void QuartzSalGraphics::updateResolution()
{
DBG_ASSERT( mbWindow, "updateResolution on inappropriate graphics" );
diff --git a/vcl/ios/source/gdi/salgdiutils.cxx b/vcl/ios/source/gdi/salgdiutils.cxx
index f433bbe798a4..fc499e450743 100644
--- a/vcl/ios/source/gdi/salgdiutils.cxx
+++ b/vcl/ios/source/gdi/salgdiutils.cxx
@@ -29,13 +29,13 @@
#include "vcl/svapp.hxx"
-#include "ios/salgdi.h"
+#include "coretext/salgdi.h"
#include "ios/salframe.h"
#include "ios/saldata.hxx"
// ----------------------------------------------------------------------
-void IosSalGraphics::SetWindowGraphics( IosSalFrame* pFrame )
+void QuartzSalGraphics::SetWindowGraphics( IosSalFrame* pFrame )
{
mpFrame = pFrame;
@@ -44,7 +44,7 @@ void IosSalGraphics::SetWindowGraphics( IosSalFrame* pFrame )
mbVirDev = false;
}
-void IosSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, long nDPIY, double fScale )
+void QuartzSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, long nDPIY, double fScale )
{
mbWindow = false;
mbPrinter = true;
@@ -71,7 +71,7 @@ void IosSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, long
}
}
-void IosSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContext,
+void QuartzSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContext,
int nBitmapDepth )
{
mbWindow = false;
@@ -120,7 +120,7 @@ void IosSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContext
// ----------------------------------------------------------------------
-void IosSalGraphics::InvalidateContext()
+void QuartzSalGraphics::InvalidateContext()
{
UnsetState();
mrContext = 0;
@@ -128,7 +128,7 @@ void IosSalGraphics::InvalidateContext()
// ----------------------------------------------------------------------
-void IosSalGraphics::UnsetState()
+void QuartzSalGraphics::UnsetState()
{
if( mrContext )
{
@@ -142,7 +142,7 @@ void IosSalGraphics::UnsetState()
}
}
-void IosSalGraphics::SetState()
+void QuartzSalGraphics::SetState()
{
CGContextRestoreGState( mrContext );
CGContextSaveGState( mrContext );
@@ -165,7 +165,7 @@ void IosSalGraphics::SetState()
// ----------------------------------------------------------------------
-bool IosSalGraphics::CheckContext()
+bool QuartzSalGraphics::CheckContext()
{
if( mbWindow && mpFrame != NULL )
{
@@ -222,11 +222,11 @@ bool IosSalGraphics::CheckContext()
CGContextRelease( rReleaseContext );
}
- DBG_ASSERT( mrContext || mbPrinter, "<<<WARNING>>> IosSalGraphics::CheckContext() FAILED!!!!\n" );
+ DBG_ASSERT( mrContext || mbPrinter, "<<<WARNING>>> QuartzSalGraphics::CheckContext() FAILED!!!!\n" );
return (mrContext != NULL);
}
-CGContextRef IosSalGraphics::GetContext()
+CGContextRef QuartzSalGraphics::GetContext()
{
if(!mrContext)
{
@@ -235,7 +235,7 @@ CGContextRef IosSalGraphics::GetContext()
return mrContext;
}
-void IosSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeight)
+void QuartzSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeight)
{
if( ! mbWindow ) // view only on Window graphics
return;
@@ -252,7 +252,7 @@ void IosSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeight
}
}
-CGPoint* IosSalGraphics::makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry)
+CGPoint* QuartzSalGraphics::makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry)
{
CGPoint *CGpoints = new CGPoint[nPoints];
if ( CGpoints )
@@ -268,7 +268,7 @@ CGPoint* IosSalGraphics::makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAr
// -----------------------------------------------------------------------
-void IosSalGraphics::UpdateWindow( CGRect& )
+void QuartzSalGraphics::UpdateWindow( CGRect& )
{
#if 0 // Sigh, this is just basically a copy of the "aqua" code and not
// applicable to iOS.
diff --git a/vcl/ios/source/gdi/salnativewidgets.cxx b/vcl/ios/source/gdi/salnativewidgets.cxx
index 0bdf0be0c638..7b4beb5000c9 100644
--- a/vcl/ios/source/gdi/salnativewidgets.cxx
+++ b/vcl/ios/source/gdi/salnativewidgets.cxx
@@ -23,7 +23,7 @@
#include "vcl/timer.hxx"
#include "ios/salconst.h"
-#include "ios/salgdi.h"
+#include "coretext/salgdi.h"
#include "ios/saldata.hxx"
#include "ios/salframe.h"
@@ -39,7 +39,7 @@
* drawing of the control defined by nPart.
*
*/
-sal_Bool IosSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
+sal_Bool QuartzSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
{
bool bOk = sal_False;
@@ -173,7 +173,7 @@ sal_Bool IosSalGraphics::IsNativeControlSupported( ControlType nType, ControlPar
* aPos was or was not inside the native widget specified by the
* nType/nPart combination.
*/
-sal_Bool IosSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
+sal_Bool QuartzSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion,
const Point& rPos, sal_Bool& rIsInside )
{
(void) nType;
@@ -184,13 +184,13 @@ sal_Bool IosSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nP
return sal_False;
}
-UInt32 IosSalGraphics::getState( ControlState nState )
+UInt32 QuartzSalGraphics::getState( ControlState nState )
{
(void) nState;
return 0;
}
-UInt32 IosSalGraphics::getTrackState( ControlState nState )
+UInt32 QuartzSalGraphics::getTrackState( ControlState nState )
{
(void) nState;
return 0;
@@ -205,7 +205,7 @@ UInt32 IosSalGraphics::getTrackState( ControlState nState )
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-sal_Bool IosSalGraphics::drawNativeControl(ControlType nType,
+sal_Bool QuartzSalGraphics::drawNativeControl(ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
@@ -233,9 +233,9 @@ sal_Bool IosSalGraphics::drawNativeControl(ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* aCaption: A caption or title string (like button text etc)
*/
-sal_Bool IosSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState /*nState*/,
- const ImplControlValue& aValue, const rtl::OUString&,
- Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
+sal_Bool QuartzSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState /*nState*/,
+ const ImplControlValue& aValue, const rtl::OUString&,
+ Rectangle &rNativeBoundingRegion, Rectangle &rNativeContentRegion )
{
(void) nType;
diff --git a/vcl/ios/source/gdi/salvd.cxx b/vcl/ios/source/gdi/salvd.cxx
index bf345415f333..6e32a22126e3 100644
--- a/vcl/ios/source/gdi/salvd.cxx
+++ b/vcl/ios/source/gdi/salvd.cxx
@@ -23,7 +23,7 @@
#include "ios/salvd.h"
#include "ios/salinst.h"
-#include "ios/salgdi.h"
+#include "coretext/salgdi.h"
#include "ios/saldata.hxx"
#include "ios/salframe.h"
@@ -35,7 +35,7 @@ SalVirtualDevice* IosSalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
// #i92075# can be called first in a thread
SalData::ensureThreadAutoreleasePool();
- return new IosSalVirtualDevice( static_cast< IosSalGraphics* >( pGraphics ), nDX, nDY, nBitCount, pData );
+ return new IosSalVirtualDevice( static_cast< QuartzSalGraphics* >( pGraphics ), nDX, nDY, nBitCount, pData );
}
// -----------------------------------------------------------------------
@@ -47,7 +47,7 @@ void IosSalInstance::DestroyVirtualDevice( SalVirtualDevice* pDevice )
// =======================================================================
-IosSalVirtualDevice::IosSalVirtualDevice( IosSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
+IosSalVirtualDevice::IosSalVirtualDevice( QuartzSalGraphics* pGraphic, long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
: mbGraphicsUsed( false )
, mxBitmapContext( NULL )
, mnBitmapDepth( 0 )
@@ -58,14 +58,14 @@ IosSalVirtualDevice::IosSalVirtualDevice( IosSalGraphics* pGraphic, long nDX, lo
// Create virtual device based on existing SystemGraphicsData
// We ignore nDx and nDY, as the desired size comes from the SystemGraphicsData
mbForeignContext = true; // the mxContext is from pData
- mpGraphics = new IosSalGraphics( /*pGraphic*/ );
+ mpGraphics = new QuartzSalGraphics( /*pGraphic*/ );
mpGraphics->SetVirDevGraphics( mxLayer, pData->rCGContext );
}
else
{
// create empty new virtual device
mbForeignContext = false; // the mxContext is created within VCL
- mpGraphics = new IosSalGraphics(); // never fails
+ mpGraphics = new QuartzSalGraphics(); // never fails
mnBitmapDepth = nBitCount;
// inherit resolution from reference device
diff --git a/vcl/ios/source/window/salframe.cxx b/vcl/ios/source/window/salframe.cxx
index 241d58e86cac..e619111ac768 100644
--- a/vcl/ios/source/window/salframe.cxx
+++ b/vcl/ios/source/window/salframe.cxx
@@ -29,7 +29,7 @@
#include "vcl/timer.hxx"
#include "ios/saldata.hxx"
-#include "ios/salgdi.h"
+#include "coretext/salgdi.h"
#include "ios/salframe.h"
#include "ios/salmenu.h"
#include "ios/saltimer.h"
@@ -205,7 +205,7 @@ SalGraphics* IosSalFrame::GetGraphics()
if ( !mpGraphics )
{
- mpGraphics = new IosSalGraphics;
+ mpGraphics = new QuartzSalGraphics;
mpGraphics->SetWindowGraphics( this );
}
diff --git a/vcl/ios/source/window/salframeview.mm b/vcl/ios/source/window/salframeview.mm
index ea108934ecfa..0ca3441fe814 100644
--- a/vcl/ios/source/window/salframeview.mm
+++ b/vcl/ios/source/window/salframeview.mm
@@ -25,7 +25,7 @@
#include "vcl/svapp.hxx"
#include "ios/salinst.h"
-#include "ios/salgdi.h"
+#include "coretext/salgdi.h"
#include "ios/salframe.h"
#include "ios/salframeview.h"
@@ -238,7 +238,7 @@ private:
{
// NOTE: the mpFrame access below is not guarded yet!
// TODO: mpFrame et al need to be guarded by an independent mutex
- IosSalGraphics* pGraphics = (mpFrame && IosSalFrame::isAlive(mpFrame)) ? mpFrame->mpGraphics : NULL;
+ QuartzSalGraphics* pGraphics = (mpFrame && IosSalFrame::isAlive(mpFrame)) ? mpFrame->mpGraphics : NULL;
if( pGraphics )
{
pGraphics->RefreshRect( aRect );