libosmscout  1.1.1
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 
23 #ifndef UNICODE
24 #define UNICODE
25 #endif
26 #define WIN32_LEAN_AND_MEAN
27 #ifndef NOMINMAX
28 #define NOMINMAX
29 #endif
31 #include <osmscout/MapPainterGDI.h>
32 #include <mutex>
33 
34 namespace osmscout {
35 
37  {
38  private:
39  std::mutex m_mutex;
40 
41  protected:
42  HINSTANCE m_hInstance;
43  HWND m_hWnd;
46 
48  osmscout::MapParameter* m_pParameter;
49  osmscout::MapData* m_pData;
50 
51  public:
57 
66  MapPainterGDIWindow(const StyleConfigRef& styleConfig, RECT position, HWND hWndParent, HINSTANCE hInstance = NULL);
67 
73 
82  bool CreateCanvas(const StyleConfigRef& styleConfig, RECT position, HWND hWndParent = NULL, HINSTANCE hInstance = NULL);
83 
95  virtual LRESULT OnWinMsg(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
96 
102  virtual void OnTileUpdate();
103 
111  void Set(osmscout::Projection* pProjection, osmscout::MapParameter* pParameter, osmscout::MapData* pData);
112 
119  void MoveWindow(RECT position, bool bRepaint = true);
120 
125  void InvalidateWindow();
126 
132  LRESULT CALLBACK WinMsgHandler(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
133  };
134 }
135 
136 #endif
Definition: MapPainterGDIWindow.h:36
#define OSMSCOUT_MAP_GDI_API
Definition: MapGDIImportExport.h:43
osmscout::MapParameter * m_pParameter
Definition: MapPainterGDIWindow.h:48
HINSTANCE m_hInstance
Definition: MapPainterGDIWindow.h:42
Definition: Projection.h:43
Definition: Area.h:38
osmscout::Projection * m_pProjection
Definition: MapPainterGDIWindow.h:47
Definition: MapPainterGDI.h:37
std::shared_ptr< StyleConfig > StyleConfigRef
Definition: StyleConfig.h:849
osmscout::MapPainterGDI * m_pPainter
Definition: MapPainterGDIWindow.h:45
HWND m_hWnd
Definition: MapPainterGDIWindow.h:43
osmscout::MapData * m_pData
Definition: MapPainterGDIWindow.h:49
HWND m_hWndParent
Definition: MapPainterGDIWindow.h:44