vcl/inc/graphic/AnimationContainer.hxx |    4 ++-
 vcl/inc/graphic/BitmapContainer.hxx    |    4 +--
 vcl/inc/graphic/SwapInfo.hxx           |   42 +++++++++++++++++++++++++++++++++
 vcl/inc/impgraph.hxx                   |   18 +-------------
 vcl/source/gdi/impgraph.cxx            |    4 +--
 5 files changed, 51 insertions(+), 21 deletions(-)

New commits:
commit 1f060b6773912c3b2da7c8af678e20ca786a4d29
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Mon Apr 14 16:49:25 2025 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Mon Apr 21 09:42:57 2025 +0200

    vcl: move SwapInfo to own header file
    
    Change-Id: Idc936b66158633de13c4d307d2d82bdb092c876a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184395
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/vcl/inc/graphic/AnimationContainer.hxx 
b/vcl/inc/graphic/AnimationContainer.hxx
index 115651d5a698..69eedd009bf0 100644
--- a/vcl/inc/graphic/AnimationContainer.hxx
+++ b/vcl/inc/graphic/AnimationContainer.hxx
@@ -12,6 +12,8 @@
 #include <vcl/dllapi.h>
 #include <vcl/animate/Animation.hxx>
 
+struct SwapInfo;
+
 class SAL_DLLPUBLIC_RTTI AnimationContainer final
 {
 public:
@@ -29,7 +31,7 @@ public:
         return maAnimation == rOther.maAnimation;
     }
 
-    void createSwapInfo(ImpSwapInfo& rSwapInfo);
+    void createSwapInfo(SwapInfo& rSwapInfo);
 
     bool isTransparent() const { return maAnimation.IsTransparent(); }
 
diff --git a/vcl/inc/graphic/BitmapContainer.hxx 
b/vcl/inc/graphic/BitmapContainer.hxx
index 81a2a4e8db5f..83ba1a7771db 100644
--- a/vcl/inc/graphic/BitmapContainer.hxx
+++ b/vcl/inc/graphic/BitmapContainer.hxx
@@ -12,7 +12,7 @@
 #include <vcl/dllapi.h>
 #include <vcl/bitmapex.hxx>
 
-struct ImpSwapInfo;
+struct SwapInfo;
 
 class SAL_DLLPUBLIC_RTTI BitmapContainer final
 {
@@ -28,7 +28,7 @@ public:
 
     bool operator==(const BitmapContainer& rOther) const { return maBitmapEx 
== rOther.maBitmapEx; }
 
-    void createSwapInfo(ImpSwapInfo& rSwapInfo);
+    void createSwapInfo(SwapInfo& rSwapInfo);
 
     bool isAlpha() { return maBitmapEx.IsAlpha(); }
 
diff --git a/vcl/inc/graphic/SwapInfo.hxx b/vcl/inc/graphic/SwapInfo.hxx
new file mode 100644
index 000000000000..e9a6fb9c001a
--- /dev/null
+++ b/vcl/inc/graphic/SwapInfo.hxx
@@ -0,0 +1,42 @@
+/* -*- 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 .
+ */
+
+#pragma once
+
+#include <vcl/dllapi.h>
+#include <vcl/GraphicExternalLink.hxx>
+
+struct SwapInfo
+{
+    MapMode maPrefMapMode = MapMode(MapUnit::Map100thMM);
+    Size maPrefSize;
+    Size maSizePixel;
+
+    bool mbIsAnimated = false;
+    bool mbIsEPS = false;
+    bool mbIsTransparent = false;
+    bool mbIsAlpha = false;
+
+    sal_uInt32 mnAnimationLoopCount = 0;
+    sal_Int32 mnPageIndex = -1;
+
+    bool operator==(SwapInfo const& rOther) const = default;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index ecaa22823c6d..6afbcd77dfbd 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -28,23 +28,9 @@
 #include "graphic/GraphicID.hxx"
 #include "graphic/BitmapContainer.hxx"
 #include "graphic/AnimationContainer.hxx"
+#include "graphic/SwapInfo.hxx"
 #include <optional>
 
-struct ImpSwapInfo
-{
-    MapMode     maPrefMapMode;
-    Size        maPrefSize;
-    Size        maSizePixel;
-
-    bool mbIsAnimated;
-    bool mbIsEPS;
-    bool mbIsTransparent;
-    bool mbIsAlpha;
-
-    sal_uInt32 mnAnimationLoopCount;
-    sal_Int32 mnPageIndex = -1;
-};
-
 class OutputDevice;
 class GfxLink;
 class ImpSwapFile;
@@ -71,7 +57,7 @@ private:
 
     /// If maBitmapEx is empty, this preferred size will be set on it when it 
gets initialized.
     Size                         maExPrefSize;
-    ImpSwapInfo                  maSwapInfo;
+    SwapInfo maSwapInfo;
     std::shared_ptr<AnimationContainer> mpAnimationContainer;
     std::shared_ptr<ImpSwapFile> mpSwapFile;
     std::shared_ptr<GfxLink>     mpGfxLink;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index bf28040c18d3..2f54037e7b09 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -326,7 +326,7 @@ const std::shared_ptr<VectorGraphicData>& 
ImpGraphic::getVectorGraphicData() con
     return maVectorGraphicData;
 }
 
-void BitmapContainer::createSwapInfo(ImpSwapInfo& rSwapInfo)
+void BitmapContainer::createSwapInfo(SwapInfo& rSwapInfo)
 {
     rSwapInfo.maSizePixel = maBitmapEx.GetSizePixel();
 
@@ -340,7 +340,7 @@ void BitmapContainer::createSwapInfo(ImpSwapInfo& rSwapInfo)
     rSwapInfo.mnPageIndex = -1;
 }
 
-void AnimationContainer::createSwapInfo(ImpSwapInfo& rSwapInfo)
+void AnimationContainer::createSwapInfo(SwapInfo& rSwapInfo)
 {
     rSwapInfo.maSizePixel = maAnimation.GetBitmapEx().GetSizePixel();
 

Reply via email to