libosmscout 1.1.1
Loading...
Searching...
No Matches
MapPainterGDIWindow.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_MAP_MAPPAINTERGDIWINDOW_H
2#define OSMSCOUT_MAP_MAPPAINTERGDIWINDOW_H
3
4/*
5 This source is part of the libosmscout-map-gdi library
6 Copyright (C) 2020 Transporter
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/
22
24
26
27#include <mutex>
28
29namespace osmscout {
30
32 {
33 private:
34 std::mutex m_mutex;
35
36 protected:
37 HINSTANCE m_hInstance;
38 HWND m_hWnd;
41
43 osmscout::MapParameter* m_pParameter;
44 osmscout::MapData* m_pData;
45
46 private:
47 void LogStatus();
48
49 public:
55
64 MapPainterGDIWindow(const StyleConfigRef& styleConfig, RECT position, HWND hWndParent, HINSTANCE hInstance = nullptr);
65
71
80 bool CreateCanvas(const StyleConfigRef& styleConfig, RECT position, HWND hWndParent = nullptr, HINSTANCE hInstance = nullptr);
81
93 virtual LRESULT OnWinMsg(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
94
100 virtual void OnTileUpdate();
101
109 void Set(osmscout::Projection* pProjection, osmscout::MapParameter* pParameter, osmscout::MapData* pData);
110
117 void MoveWindow(RECT position, bool bRepaint = true);
118
124
130 LRESULT CALLBACK WinMsgHandler(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
131 };
132}
133
134#endif
#define OSMSCOUT_MAP_GDI_API
Definition MapGDIImportExport.h:43
Definition MapPainterGDI.h:30
osmscout::MapPainterGDI * m_pPainter
Definition MapPainterGDIWindow.h:40
virtual LRESULT OnWinMsg(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Function for Windows message handling.
HINSTANCE m_hInstance
Definition MapPainterGDIWindow.h:37
MapPainterGDIWindow()
Default constructor.
void InvalidateWindow()
Declares the window invalid and initiates a redraw.
LRESULT CALLBACK WinMsgHandler(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Windows message handler function.
bool CreateCanvas(const StyleConfigRef &styleConfig, RECT position, HWND hWndParent=nullptr, HINSTANCE hInstance=nullptr)
Creates the drawing window.
void MoveWindow(RECT position, bool bRepaint=true)
Move current window.
virtual void OnTileUpdate()
Function to update tile data.
HWND m_hWndParent
Definition MapPainterGDIWindow.h:39
osmscout::MapParameter * m_pParameter
Definition MapPainterGDIWindow.h:43
HWND m_hWnd
Definition MapPainterGDIWindow.h:38
osmscout::Projection * m_pProjection
Definition MapPainterGDIWindow.h:42
void Set(osmscout::Projection *pProjection, osmscout::MapParameter *pParameter, osmscout::MapData *pData)
Sets data and settings for rendering.
osmscout::MapData * m_pData
Definition MapPainterGDIWindow.h:44
~MapPainterGDIWindow()
Default destructor.
MapPainterGDIWindow(const StyleConfigRef &styleConfig, RECT position, HWND hWndParent, HINSTANCE hInstance=nullptr)
Default constructor.
Definition Projection.h:46
Definition Area.h:39
std::shared_ptr< StyleConfig > StyleConfigRef
Definition StyleConfig.h:859