summaryrefslogtreecommitdiff
path: root/svx/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-03-15 14:35:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-03-15 15:24:53 +0000
commit188042ad5230e912f3149cc7ea1bb836e084069a (patch)
treec7e627a84aabb501f2d921f7110e9928e769599c /svx/inc
parentc97aec0d2276901c20634abe53867f739f420f50 (diff)
restore enough of XOBitmap to do fore/back color setting on escher patterns
i.e. restore the logic of setting the colors of imported escher patterns like we always did in the past. Stripping that out seems risky in the absence of definite test-cases. Change-Id: I16bbb451b053fd04a5154602f8f38ed799e21286
Diffstat (limited to 'svx/inc')
-rw-r--r--svx/inc/svx/xbitmap.hxx66
-rw-r--r--svx/inc/svx/xenum.hxx1
2 files changed, 67 insertions, 0 deletions
diff --git a/svx/inc/svx/xbitmap.hxx b/svx/inc/svx/xbitmap.hxx
new file mode 100644
index 000000000000..959ceafdbd72
--- /dev/null
+++ b/svx/inc/svx/xbitmap.hxx
@@ -0,0 +1,66 @@
+/* -*- 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 _SVX_XBITMAP_HXX
+#define _SVX_XBITMAP_HXX
+
+#include <tools/color.hxx>
+#include <vcl/bitmap.hxx>
+#include <svtools/grfmgr.hxx>
+#include <svx/xenum.hxx>
+#include "svx/svxdllapi.h"
+
+class SVX_DLLPUBLIC XOBitmap
+{
+private:
+ XBitmapType eType;
+ GraphicObject aGraphicObject;
+ sal_uInt16* pPixelArray;
+ Size aArraySize;
+ Color aPixelColor;
+ Color aBckgrColor;
+ sal_Bool bGraphicDirty;
+
+ const GraphicObject& GetGraphicObject() const;
+
+public:
+ XOBitmap( const Bitmap& rBitmap );
+ XOBitmap( const XOBitmap& rXBmp );
+ ~XOBitmap();
+
+ XOBitmap& operator=( const XOBitmap& rXOBitmap );
+ int operator==( const XOBitmap& rXOBitmap ) const;
+
+ void Bitmap2Array();
+ void Array2Bitmap();
+
+ void SetBitmapType( XBitmapType eNewType ) { eType = eNewType; }
+ void SetPixelColor( const Color& rColor ) { aPixelColor = rColor; bGraphicDirty = sal_True; }
+ void SetPixelSize( const Size& rSize ) { aArraySize = rSize; bGraphicDirty = sal_True; }
+ void SetBackgroundColor( const Color& rColor ) { aBckgrColor = rColor; bGraphicDirty = sal_True; }
+
+ XBitmapType GetBitmapType() const { return eType; }
+ Bitmap GetBitmap() const;
+ Color GetPixelColor() const { return aPixelColor; }
+ Color GetBackgroundColor() const { return aBckgrColor; }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/inc/svx/xenum.hxx b/svx/inc/svx/xenum.hxx
index 1f483273894d..df0b629d5980 100644
--- a/svx/inc/svx/xenum.hxx
+++ b/svx/inc/svx/xenum.hxx
@@ -45,6 +45,7 @@ enum XFormTextStdForm { XFTFORM_NONE = 0, XFTFORM_TOPCIRC, XFTFORM_BOTCIRC,
XFTFORM_BOTARC, XFTFORM_LFTARC, XFTFORM_RGTARC,
XFTFORM_BUTTON1, XFTFORM_BUTTON2,
XFTFORM_BUTTON3, XFTFORM_BUTTON4};
+enum XBitmapType { XBITMAP_IMPORT, XBITMAP_8X8 };
#endif // _XENUM_HXX