blob: cf9e7bc12231eaafc7592706f60e10f02488ab44 [file] [log] [blame]
Constantin Kaplinsky729598c2006-05-25 05:12:25 +00001/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18
19// -=- DIBSectionBuffer.h
20
21// A DIBSectionBuffer acts much like a standard PixelBuffer, but is associated
22// with a particular window on-screen and can be drawn into that window if
23// required, using the standard Win32 drawing operations.
24
25#ifndef __RFB_WIN32_DIB_SECTION_BUFFER_H__
26#define __RFB_WIN32_DIB_SECTION_BUFFER_H__
27
28#include <windows.h>
29#include <rfb/PixelBuffer.h>
30#include <rfb/Region.h>
Constantin Kaplinsky729598c2006-05-25 05:12:25 +000031#include <rfb/Exception.h>
32
33namespace rfb {
34
35 namespace win32 {
36
37 //
38 // -=- DIBSectionBuffer
39 //
40
Pierre Ossmanb6b4dc62014-01-20 15:05:21 +010041 class DIBSectionBuffer : public FullFramePixelBuffer {
Constantin Kaplinsky729598c2006-05-25 05:12:25 +000042 public:
43 DIBSectionBuffer(HWND window);
44 DIBSectionBuffer(HDC device);
45 virtual ~DIBSectionBuffer();
46
47 virtual void setPF(const PixelFormat &pf);
48 virtual void setSize(int w, int h);
49
Constantin Kaplinsky729598c2006-05-25 05:12:25 +000050 // *** virtual void copyRect(const Rect &dest, const Point &move_by_delta);
51 public:
52 HBITMAP bitmap;
53 protected:
54 void recreateBuffer();
Constantin Kaplinsky729598c2006-05-25 05:12:25 +000055 HWND window;
56 HDC device;
57 };
58
59 };
60
61};
62
63#endif // __RFB_WIN32_DIB_SECTION_BUFFER_H__