tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / vcl / unx / generic / dtrans / bmp.hxx
blob3a37158db36f117c6d729b4cfab10b48602686a2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <X11/Xlib.h>
23 #include <X11/Xutil.h>
25 #include <com/sun/star/uno/Sequence.hxx>
26 #include <sal/types.h>
28 namespace x11 {
30 // helper methods
31 sal_uInt8* X11_getBmpFromPixmap( Display* pDisplay,
32 Drawable aDrawable,
33 Colormap aColormap,
34 sal_Int32& rOutSize );
36 class PixmapHolder
38 Display* m_pDisplay;
39 Colormap m_aColormap;
40 Pixmap m_aPixmap;
41 Pixmap m_aBitmap;
42 XVisualInfo m_aInfo;
44 int m_nRedShift;
45 int m_nGreenShift;
46 int m_nBlueShift;
47 tools::ULong m_nBlueShift2Mask, m_nRedShift2Mask, m_nGreenShift2Mask;
49 // these expect data pointers to bitmapinfo header
50 void setBitmapDataTC( const sal_uInt8* pData, XImage* pImage );
51 void setBitmapDataTCDither( const sal_uInt8* pData, XImage* pImage );
52 void setBitmapDataPalette( const sal_uInt8* pData, XImage* pImage );
54 tools::ULong getTCPixel( sal_uInt8 r, sal_uInt8 g, sal_uInt8 b ) const;
55 public:
56 PixmapHolder( Display* pDisplay );
57 ~PixmapHolder();
59 // accepts bitmap file (including bitmap file header)
60 Pixmap setBitmapData( const sal_uInt8* pData );
61 bool needsConversion( const sal_uInt8* pData ) const;
63 Colormap getColormap() const { return m_aColormap; }
64 Pixmap getPixmap() const { return m_aPixmap; }
65 Pixmap getBitmap() const { return m_aBitmap; }
66 VisualID getVisualID() const { return m_aInfo.visualid; }
67 int getDepth() const { return m_aInfo.depth; }
70 css::uno::Sequence<sal_Int8> convertBitmapDepth(
71 css::uno::Sequence<sal_Int8> const & data, int depth);
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */