xref: /AOO41X/main/vcl/inc/graphite_serverfont.hxx (revision ebfcd9af2ce496a86a62eef7379364d0a42a7f96)
1*ebfcd9afSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ebfcd9afSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ebfcd9afSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ebfcd9afSAndrew Rist  * distributed with this work for additional information
6*ebfcd9afSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ebfcd9afSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ebfcd9afSAndrew Rist  * "License"); you may not use this file except in compliance
9*ebfcd9afSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*ebfcd9afSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*ebfcd9afSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ebfcd9afSAndrew Rist  * software distributed under the License is distributed on an
15*ebfcd9afSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ebfcd9afSAndrew Rist  * KIND, either express or implied.  See the License for the
17*ebfcd9afSAndrew Rist  * specific language governing permissions and limitations
18*ebfcd9afSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*ebfcd9afSAndrew Rist  *************************************************************/
21*ebfcd9afSAndrew Rist 
22*ebfcd9afSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_GRAPHITESERVERFONT_HXX
25cdf0e10cSrcweir #define _SV_GRAPHITESERVERFONT_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // We need this to enable namespace support in libgrengine headers.
28cdf0e10cSrcweir #define GR_NAMESPACE
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #ifndef MSC
31cdf0e10cSrcweir #include <graphite_layout.hxx>
32cdf0e10cSrcweir #include <graphite_adaptors.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir // Modules
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC GraphiteLayoutImpl : public GraphiteLayout
37cdf0e10cSrcweir {
38cdf0e10cSrcweir public:
GraphiteLayoutImpl(const gr::Font & font,const grutils::GrFeatureParser * features,GraphiteFontAdaptor * pFont)39cdf0e10cSrcweir     GraphiteLayoutImpl(const gr::Font & font, const grutils::GrFeatureParser * features, GraphiteFontAdaptor * pFont) throw()
40cdf0e10cSrcweir     : GraphiteLayout(font, features), mpFont(pFont) {};
~GraphiteLayoutImpl()41cdf0e10cSrcweir     virtual ~GraphiteLayoutImpl() throw() {};
42cdf0e10cSrcweir     virtual sal_GlyphId getKashidaGlyph(int & width);
43cdf0e10cSrcweir private:
44cdf0e10cSrcweir     GraphiteFontAdaptor * mpFont;
45cdf0e10cSrcweir };
46cdf0e10cSrcweir 
47cdf0e10cSrcweir // This class implments the server font specific parts.
48cdf0e10cSrcweir // @author tse
49cdf0e10cSrcweir //
50cdf0e10cSrcweir class VCL_PLUGIN_PUBLIC GraphiteServerFontLayout : public ServerFontLayout
51cdf0e10cSrcweir {
52cdf0e10cSrcweir private:
53cdf0e10cSrcweir         mutable GraphiteFontAdaptor * mpFont;
54cdf0e10cSrcweir         // mutable so that the DrawOffset/DrawBase can be set
55cdf0e10cSrcweir         mutable GraphiteLayoutImpl maImpl;
56cdf0e10cSrcweir public:
57cdf0e10cSrcweir         explicit GraphiteServerFontLayout( GraphiteFontAdaptor* font ) throw();
58cdf0e10cSrcweir 
LayoutText(ImplLayoutArgs & rArgs)59cdf0e10cSrcweir         virtual bool  LayoutText( ImplLayoutArgs& rArgs) { SalLayout::AdjustLayout(rArgs); return maImpl.LayoutText(rArgs); };    // first step of layout
AdjustLayout(ImplLayoutArgs & rArgs)60cdf0e10cSrcweir         virtual void  AdjustLayout( ImplLayoutArgs& rArgs)
61cdf0e10cSrcweir         {
62cdf0e10cSrcweir             SalLayout::AdjustLayout(rArgs);
63cdf0e10cSrcweir             maImpl.DrawBase() = maDrawBase;
64cdf0e10cSrcweir             maImpl.DrawOffset() = maDrawOffset;
65cdf0e10cSrcweir             maImpl.AdjustLayout(rArgs);
66cdf0e10cSrcweir         };
GetTextWidth() const67cdf0e10cSrcweir         virtual long    GetTextWidth() const                           { return maImpl.GetTextWidth(); }
FillDXArray(sal_Int32 * dxa) const68cdf0e10cSrcweir         virtual long    FillDXArray( sal_Int32* dxa ) const                 { return maImpl.FillDXArray(dxa); }
GetTextBreak(long mw,long ce,int f) const69cdf0e10cSrcweir         virtual int     GetTextBreak( long mw, long ce, int f ) const  { return maImpl.GetTextBreak(mw, ce, f); }
GetCaretPositions(int as,sal_Int32 * cxa) const70cdf0e10cSrcweir         virtual void    GetCaretPositions( int as, sal_Int32* cxa ) const   { maImpl.GetCaretPositions(as, cxa); }
71cdf0e10cSrcweir 
72cdf0e10cSrcweir         // used by display layers
GetNextGlyphs(int l,sal_GlyphId * gia,Point & p,int & s,sal_Int32 * gaa=NULL,int * cpa=NULL) const73cdf0e10cSrcweir         virtual int     GetNextGlyphs( int l, sal_GlyphId* gia, Point& p, int& s,
74cdf0e10cSrcweir                         sal_Int32* gaa = NULL, int* cpa = NULL ) const
75cdf0e10cSrcweir         {
76cdf0e10cSrcweir             maImpl.DrawBase() = maDrawBase;
77cdf0e10cSrcweir             maImpl.DrawOffset() = maDrawOffset;
78cdf0e10cSrcweir             return maImpl.GetNextGlyphs(l, gia, p, s, gaa, cpa);
79cdf0e10cSrcweir         }
80cdf0e10cSrcweir 
MoveGlyph(int nStart,long nNewXPos)81cdf0e10cSrcweir         virtual void    MoveGlyph( int nStart, long nNewXPos ) { maImpl.MoveGlyph(nStart, nNewXPos); };
DropGlyph(int nStart)82cdf0e10cSrcweir         virtual void    DropGlyph( int nStart ) { maImpl.DropGlyph(nStart); };
Simplify(bool bIsBase)83cdf0e10cSrcweir         virtual void    Simplify( bool bIsBase ) { maImpl.Simplify(bIsBase); };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir         virtual ~GraphiteServerFontLayout() throw();
86cdf0e10cSrcweir 
87cdf0e10cSrcweir // For use with PspGraphics
88cdf0e10cSrcweir         const sal_Unicode* getTextPtr() const;
getMinCharPos() const89cdf0e10cSrcweir         int getMinCharPos() const { return mnMinCharPos; }
getMaxCharPos() const90cdf0e10cSrcweir         int getMaxCharPos() const { return mnEndCharPos; }
91cdf0e10cSrcweir };
92cdf0e10cSrcweir 
93cdf0e10cSrcweir #endif
94cdf0e10cSrcweir #endif //_SV_GRAPHITESERVERFONT_HXX
95