ReactOS 0.4.15-dev-8191-gbc6c731
canvas.h
Go to the documentation of this file.
1/*
2 * PROJECT: PAINT for ReactOS
3 * LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
4 * PURPOSE: Providing the canvas window class
5 * COPYRIGHT: Copyright 2015 Benedikt Freisen <b.freisen@gmx.net>
6 */
7
8#pragma once
9
10class CCanvasWindow : public CWindowImpl<CCanvasWindow>
11{
12public:
15
39
41 virtual ~CCanvasWindow();
42
44
45 VOID OnEndDraw(BOOL bCancel);
47 VOID updateScrollPos(INT x = 0, INT y = 0);
48
54 VOID getNewZoomRect(CRect& rcView, INT newZoom, CPoint ptTarget);
55 VOID zoomTo(INT newZoom, LONG left = 0, LONG top = 0);
56
59 POINT m_ptOrig; // The origin of drag start
60 HBITMAP m_ahbmCached[2]; // The cached buffer bitmaps
61 CRect m_rcResizing; // Resizing rectagle
62
65 VOID DoDraw(HDC hDC, RECT& rcClient, RECT& rcPaint);
67
68 LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
72 LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
81
86};
static HDC hDC
Definition: 3dtext.c:33
#define WM_PALETTEMODELCOLORCHANGED
Definition: precomp.h:52
HITTEST
Definition: precomp.h:55
VOID OnHVScroll(WPARAM wParam, INT fnBar)
Definition: canvas.cpp:258
VOID DoDraw(HDC hDC, RECT &rcClient, RECT &rcPaint)
Definition: canvas.cpp:122
BOOL m_drawing
Definition: canvas.h:43
VOID OnEndDraw(BOOL bCancel)
Definition: canvas.cpp:701
LRESULT OnEraseBkgnd(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:684
LRESULT OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:649
LRESULT OnCaptureChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:678
LRESULT OnVScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:294
LRESULT OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:579
HITTEST m_hitCanvasSizeBox
Definition: canvas.h:58
LRESULT OnPaletteModelColorChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:715
VOID ImageToCanvas(POINT &pt)
Definition: canvas.cpp:40
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:250
LRESULT OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:689
LRESULT OnCancelMode(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:664
VOID CanvasToImage(POINT &pt)
Definition: canvas.cpp:53
VOID updateScrollPos(INT x=0, INT y=0)
Definition: canvas.cpp:244
CRect m_rcResizing
Definition: canvas.h:61
UINT m_nMouseDownMsg
Definition: canvas.h:82
DECLARE_WND_CLASS_EX(L"ReactOSPaintCanvas", CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW, COLOR_APPWORKSPACE) CCanvasWindow()
HBITMAP m_ahbmCached[2]
Definition: canvas.h:60
HITTEST CanvasHitTest(POINT pt)
Definition: canvas.cpp:71
LRESULT OnButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:513
LRESULT OnHScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:288
LRESULT OnButtonDblClk(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:372
VOID GetImageRect(RECT &rc)
Definition: canvas.cpp:66
POINT m_ptOrig
Definition: canvas.h:59
VOID updateScrollRange()
Definition: canvas.cpp:213
LRESULT OnButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:300
LRESULT OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:387
VOID getNewZoomRect(CRect &rcView, INT newZoom, CPoint ptTarget)
Definition: canvas.cpp:79
RECT GetBaseRect()
Definition: canvas.cpp:31
LRESULT OnCtlColorEdit(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:708
VOID zoomTo(INT newZoom, LONG left=0, LONG top=0)
Definition: canvas.cpp:107
LRESULT OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: canvas.cpp:673
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define pt(x, y)
Definition: drawing.c:79
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
#define MESSAGE_HANDLER(msg, func)
Definition: atlwin.h:1926
#define BEGIN_MSG_MAP(theClass)
Definition: atlwin.h:1898
#define END_MSG_MAP()
Definition: atlwin.h:1917
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
static BOOL protected
Definition: protectdata.c:37
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define WM_MOUSEWHEEL
Definition: treelist.c:96
int32_t INT
Definition: typedefs.h:58
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define WM_PAINT
Definition: winuser.h:1620
#define WM_ERASEBKGND
Definition: winuser.h:1625
#define CS_VREDRAW
Definition: winuser.h:658
#define WM_HSCROLL
Definition: winuser.h:1743
#define WM_CAPTURECHANGED
Definition: winuser.h:1808
#define WM_VSCROLL
Definition: winuser.h:1744
#define WM_SIZE
Definition: winuser.h:1611
#define WM_CANCELMODE
Definition: winuser.h:1635
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1778
#define CS_HREDRAW
Definition: winuser.h:653
#define WM_RBUTTONUP
Definition: winuser.h:1780
#define WM_RBUTTONDBLCLK
Definition: winuser.h:1781
#define WM_MOUSEMOVE
Definition: winuser.h:1775
#define CS_DBLCLKS
Definition: winuser.h:651
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define WM_RBUTTONDOWN
Definition: winuser.h:1779
#define COLOR_APPWORKSPACE
Definition: winuser.h:925
#define WM_LBUTTONUP
Definition: winuser.h:1777
#define WM_SETCURSOR
Definition: winuser.h:1636
#define WM_KEYDOWN
Definition: winuser.h:1715
#define WM_MBUTTONUP
Definition: winuser.h:1783
#define WM_CTLCOLOREDIT
Definition: winuser.h:1767
#define WM_MBUTTONDOWN
Definition: winuser.h:1782