diff Framework/Scene2D/CairoCompositor.h @ 911:64e5f3ff6360 am-dev

Merge
author Alain Mazy <alain@mazy.be>
date Thu, 18 Jul 2019 10:50:59 +0200
parents 6e79e8c9021c 7a7e4e1f558f
children 685c9a2d115f
line wrap: on
line diff
--- a/Framework/Scene2D/CairoCompositor.h	Wed Jul 17 15:33:07 2019 +0200
+++ b/Framework/Scene2D/CairoCompositor.h	Thu Jul 18 10:50:59 2019 +0200
@@ -13,7 +13,7 @@
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Affero General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Affero General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  **/
@@ -21,6 +21,7 @@
 
 #pragma once
 
+#include "ICompositor.h"
 #include "../Fonts/GlyphBitmapAlphabet.h"
 #include "../Wrappers/CairoContext.h"
 #include "Internals/CompositorHelper.h"
@@ -29,9 +30,9 @@
 namespace OrthancStone
 {
   class CairoCompositor :
-    public ICompositor,
-    private Internals::CompositorHelper::IRendererFactory,
-    private Internals::ICairoContextProvider
+      public ICompositor,
+      private Internals::CompositorHelper::IRendererFactory,
+      private Internals::ICairoContextProvider
   {
   private:
     typedef std::map<size_t, GlyphBitmapAlphabet*>   Fonts;
@@ -52,7 +53,7 @@
                     unsigned int canvasWidth,
                     unsigned int canvasHeight);
     
-    ~CairoCompositor();
+    virtual ~CairoCompositor();
 
     const CairoSurface& GetCanvas() const
     {
@@ -73,14 +74,17 @@
                  GlyphBitmapAlphabet* dict);  // Takes ownership
 
 #if ORTHANC_ENABLE_LOCALE == 1
-    void SetFont(size_t index,
-                 Orthanc::EmbeddedResources::FileResourceId resource,
-                 unsigned int fontSize,
-                 Orthanc::Encoding codepage);
+    virtual void SetFont(size_t index,
+                         Orthanc::EmbeddedResources::FileResourceId resource,
+                         unsigned int fontSize,
+                         Orthanc::Encoding codepage);
 #endif
 
     virtual void Refresh();
 
+    void UpdateSize(unsigned int canvasWidth,
+                    unsigned int canvasHeight);
+
     Orthanc::ImageAccessor* RenderText(size_t fontIndex,
                                        const std::string& utf8) const;
   };