ReactOS 0.4.15-dev-6057-gd708c79
winproc.cpp File Reference
#include "precomp.h"
#include <assert.h>
Include dependency graph for winproc.cpp:

Go to the source code of this file.

Macros

#define SPI_GETWHEELSCROLLCHARS   0x006C
 
#define MAX_RECENT_PATHNAME_DISPLAY   30
 

Typedefs

typedef HWND(WINAPIFN_HtmlHelpW) (HWND, LPCWSTR, UINT, DWORD_PTR)
 

Functions

static HWND DoHtmlHelpW (HWND hwndCaller, LPCWSTR pszFile, UINT uCommand, DWORD_PTR dwData)
 
BOOL zoomTo (int newZoom, int mouseX, int mouseY)
 

Variables

static HINSTANCE s_hHHCTRL_OCX = NULL
 
static FN_HtmlHelpW s_pHtmlHelpW = NULL
 
HWND hStatusBar = NULL
 

Macro Definition Documentation

◆ MAX_RECENT_PATHNAME_DISPLAY

#define MAX_RECENT_PATHNAME_DISPLAY   30

◆ SPI_GETWHEELSCROLLCHARS

#define SPI_GETWHEELSCROLLCHARS   0x006C

Typedef Documentation

◆ FN_HtmlHelpW

typedef HWND(WINAPI * FN_HtmlHelpW) (HWND, LPCWSTR, UINT, DWORD_PTR)

Definition at line 15 of file winproc.cpp.

Function Documentation

◆ DoHtmlHelpW()

static HWND DoHtmlHelpW ( HWND  hwndCaller,
LPCWSTR  pszFile,
UINT  uCommand,
DWORD_PTR  dwData 
)
static

Definition at line 25 of file winproc.cpp.

26{
28
29 if (!s_hHHCTRL_OCX && (uCommand != HH_CLOSE_ALL))
30 {
31 // The function loads the system library, not local
33 wcscat(szPath, L"\\hhctrl.ocx");
35 if (s_hHHCTRL_OCX)
37 }
38
39 if (!s_pHtmlHelpW)
40 return NULL;
41
42 return s_pHtmlHelpW(hwndCaller, pszFile, uCommand, dwData);
43}
#define NULL
Definition: types.h:112
#define GetProcAddress(x, y)
Definition: compat.h:753
#define MAX_PATH
Definition: compat.h:34
#define LoadLibraryW(x)
Definition: compat.h:747
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
#define HH_CLOSE_ALL
Definition: htmlhelp.h:41
LPCWSTR szPath
Definition: env.c:37
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define L(x)
Definition: ntvdm.h:50
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define _countof(array)
Definition: sndvol32.h:68
HWND(WINAPI * FN_HtmlHelpW)(HWND, LPCWSTR, UINT, DWORD_PTR)
Definition: winproc.cpp:15
static HINSTANCE s_hHHCTRL_OCX
Definition: winproc.cpp:17
static FN_HtmlHelpW s_pHtmlHelpW
Definition: winproc.cpp:18
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CMainWindow::OnCommand(), and CMainWindow::OnDestroy().

◆ zoomTo()

BOOL zoomTo ( int  newZoom,
int  mouseX,
int  mouseY 
)

Definition at line 46 of file winproc.cpp.

47{
48 int x, y, w, h;
49 RECT clientRectScrollbox;
50 canvasWindow.GetClientRect(&clientRectScrollbox);
51
52 RECT clientRectImageArea;
53 ::SetRect(&clientRectImageArea, 0, 0, imageModel.GetWidth(), imageModel.GetHeight());
54 Zoomed(clientRectImageArea);
55
56 w = clientRectImageArea.right * newZoom / toolsModel.GetZoom();
57 h = clientRectImageArea.bottom * newZoom / toolsModel.GetZoom();
58 if (!w || !h)
59 {
60 return FALSE;
61 }
62 w = clientRectImageArea.right * clientRectScrollbox.right / w;
63 h = clientRectImageArea.bottom * clientRectScrollbox.bottom / h;
64 x = max(0, min(clientRectImageArea.right - w, mouseX - w / 2)) * newZoom / toolsModel.GetZoom();
65 y = max(0, min(clientRectImageArea.bottom - h, mouseY - h / 2)) * newZoom / toolsModel.GetZoom();
66
67 toolsModel.SetZoom(newZoom);
68
69 canvasWindow.Invalidate(TRUE);
70
73 return TRUE;
74}
CCanvasWindow canvasWindow
Definition: canvas.cpp:11
int GetWidth() const
Definition: history.cpp:215
int GetHeight() const
Definition: history.cpp:220
int GetZoom() const
Definition: toolsmodel.cpp:148
void SetZoom(int nZoom)
Definition: toolsmodel.cpp:153
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
ToolsModel toolsModel
Definition: toolsmodel.cpp:11
ImageModel imageModel
Definition: history.cpp:11
#define min(a, b)
Definition: monoChain.cc:55
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
#define max(a, b)
Definition: svc.c:63
static int Zoomed(int xy)
Definition: toolsmodel.h:126
#define MAKEWPARAM(l, h)
Definition: winuser.h:3999
#define WM_HSCROLL
Definition: winuser.h:1733
#define WM_VSCROLL
Definition: winuser.h:1734
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define SB_THUMBPOSITION
Definition: winuser.h:572

Referenced by ZoomTool::OnButtonDown(), CMainWindow::OnCommand(), CMainWindow::OnMouseWheel(), and CToolSettingsWindow::OnVScroll().

Variable Documentation

◆ hStatusBar

HWND hStatusBar = NULL

Definition at line 20 of file winproc.cpp.

◆ s_hHHCTRL_OCX

HINSTANCE s_hHHCTRL_OCX = NULL
static

Definition at line 17 of file winproc.cpp.

Referenced by DoHtmlHelpW(), and CMainWindow::OnDestroy().

◆ s_pHtmlHelpW

FN_HtmlHelpW s_pHtmlHelpW = NULL
static

Definition at line 18 of file winproc.cpp.

Referenced by DoHtmlHelpW(), and CMainWindow::OnDestroy().