1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <unx/x11/x11cairotextrender.hxx>
22 #include <unx/glyphcache.hxx>
23 #include <X11/Xregion.h>
25 #include <salframe.hxx>
28 X11CairoTextRender::X11CairoTextRender(X11SalGraphics
& rParent
)
33 cairo_t
* X11CairoTextRender::getCairoContext()
35 return mrParent
.getCairoContext();
38 void X11CairoTextRender::getSurfaceOffset( double& nDX
, double& nDY
)
44 void X11CairoTextRender::clipRegion(cairo_t
* cr
)
46 Region pClipRegion
= mrParent
.mpClipRegion
;
47 if( pClipRegion
&& !XEmptyRegion( pClipRegion
) )
49 for (tools::Long i
= 0; i
< pClipRegion
->numRects
; ++i
)
52 pClipRegion
->rects
[i
].x1
,
53 pClipRegion
->rects
[i
].y1
,
54 pClipRegion
->rects
[i
].x2
- pClipRegion
->rects
[i
].x1
,
55 pClipRegion
->rects
[i
].y2
- pClipRegion
->rects
[i
].y1
);
61 size_t X11CairoTextRender::GetWidth() const
63 SalGeometryProvider
*pProvider
= mrParent
.m_pFrame
;
65 pProvider
= mrParent
.m_pVDev
;
68 return pProvider
->GetWidth();
73 size_t X11CairoTextRender::GetHeight() const
75 SalGeometryProvider
*pProvider
= mrParent
.m_pFrame
;
77 pProvider
= mrParent
.m_pVDev
;
80 return pProvider
->GetHeight();
85 void X11CairoTextRender::releaseCairoContext(cairo_t
* cr
)
87 X11SalGraphics::releaseCairoContext(cr
);
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */