summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-07 17:29:44 -0500
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-11-10 07:59:39 +0100
commit81798ea6e4461f29e35afc14e322d38da5f6c851 (patch)
tree50e8e148f4241da276b2e0bb95d7575e3211a463 /vcl/inc
parent1ef180146bf6ed390fb3e6c65da121756a0345d4 (diff)
vcl: Add GetPixmapFromScreen and RenderPixmapToScreen to X11SalGraphics
Change-Id: I007408885b5752f3abf55075ef025aa6dacbabde
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/unx/gtk/gtkgdi.hxx5
-rw-r--r--vcl/inc/unx/pixmap.hxx44
-rw-r--r--vcl/inc/unx/salgdi.h8
3 files changed, 55 insertions, 2 deletions
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index b8b145b218d0..05d763caaae8 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -114,6 +114,7 @@ private:
#else
+class GdkX11Pixmap;
class GtkSalGraphics : public X11SalGraphics
{
GtkWidget *m_pWindow;
@@ -162,8 +163,8 @@ public:
protected:
typedef std::list< Rectangle > clipList;
- GdkPixmap* NWGetPixmapFromScreen( Rectangle srcRect );
- bool NWRenderPixmapToScreen( GdkPixmap* pPixmap, Rectangle dstRect );
+ GdkX11Pixmap* NWGetPixmapFromScreen( Rectangle srcRect );
+ bool NWRenderPixmapToScreen( GdkX11Pixmap* pPixmap, Rectangle dstRect );
bool NWPaintGTKArrow( GdkDrawable* gdkDrawable, ControlType nType, ControlPart nPart,
const Rectangle& rControlRectangle,
diff --git a/vcl/inc/unx/pixmap.hxx b/vcl/inc/unx/pixmap.hxx
new file mode 100644
index 000000000000..f8b23c763f64
--- /dev/null
+++ b/vcl/inc/unx/pixmap.hxx
@@ -0,0 +1,44 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_VCL_INC_UNX_PIXMAP_HXX
+#define INCLUDED_VCL_INC_UNX_PIXMAP_HXX
+
+#include <prex.h>
+#include <postx.h>
+#include <unx/saltype.h>
+#include <vclpluginapi.h>
+
+class VCLPLUG_GEN_PUBLIC X11Pixmap
+{
+public:
+ X11Pixmap();
+ X11Pixmap( Display *pDisplay, SalX11Screen nScreen, int nWidth, int nHeight, int nDepth );
+ X11Pixmap( X11Pixmap& rOther );
+ virtual ~X11Pixmap();
+
+ Pixmap GetPixmap() const { return mpPixmap; };
+ Drawable GetDrawable() const { return mpPixmap; };
+ int GetWidth() const { return mnWidth; };
+ int GetHeight() const { return mnHeight; };
+ int GetDepth() const { return mnDepth; };
+ SalX11Screen GetScreen() const { return mnScreen; }
+
+protected:
+ Display* mpDisplay;
+ SalX11Screen mnScreen;
+ Pixmap mpPixmap;
+ int mnWidth;
+ int mnHeight;
+ int mnDepth;
+};
+
+#endif // INCLUDED_VCL_INC_UNX_PIXMAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index 549698dd272a..b4eee5f75ccb 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -42,6 +42,7 @@ class SalBitmap;
class SalColormap;
class SalDisplay;
class SalFrame;
+class X11Pixmap;
class X11SalVirtualDevice;
class X11SalGraphicsImpl;
class PspSalPrinter;
@@ -263,6 +264,13 @@ public:
virtual bool SwapBuffers() SAL_OVERRIDE;
+ // create a pixmap from a screen region
+ X11Pixmap* GetPixmapFromScreen( const Rectangle& rRect );
+
+ // render a pixmap to the screen
+ bool RenderPixmapToScreen( X11Pixmap* pPixmap, int nX, int nY );
+
+
/* use to handle GraphicsExpose/NoExpose after XCopyArea & friends
* if pFrame is not NULL, corresponding Paint events are generated
* and dispatched to pFrame