[MSPAINT_NEW] Convert to C++, update header comments

svn path=/trunk/; revision=67600
This commit is contained in:
Benedikt Freisen 2015-05-08 16:27:46 +00:00
parent a95c9f4d03
commit ff8b29da1b
31 changed files with 109 additions and 104 deletions

View file

@ -1,19 +1,24 @@
project(MSPAINT_NEW)
set_cpp(WITH_RUNTIME)
include_directories(${REACTOS_SOURCE_DIR}/lib/atl)
list(APPEND SOURCE list(APPEND SOURCE
dialogs.c dialogs.cpp
dib.c dib.cpp
drawing.c drawing.cpp
history.c history.cpp
main.c main.cpp
mouse.c mouse.cpp
palette.c palette.cpp
registry.c registry.cpp
scrollbox.c scrollbox.cpp
selection.c selection.cpp
sizebox.c sizebox.cpp
textedit.c textedit.cpp
toolsettings.c toolsettings.cpp
winproc.c winproc.cpp
precomp.h) precomp.h)
add_executable(mspaint_new ${SOURCE} rsrc.rc) add_executable(mspaint_new ${SOURCE} rsrc.rc)

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/definitions.h * FILE: base/applications/mspaint_new/definitions.h
* PURPOSE: Defines the resource ids and other stuff * PURPOSE: Defines the resource ids and other stuff
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/dialogs.c * FILE: base/applications/mspaint_new/dialogs.cpp
* PURPOSE: Window procedures of the dialog windows plus launching functions * PURPOSE: Window procedures of the dialog windows plus launching functions
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/dialogs.h * FILE: base/applications/mspaint_new/dialogs.h
* PURPOSE: Window procedures of the dialog windows plus launching functions * PURPOSE: Window procedures of the dialog windows plus launching functions
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/dib.c * FILE: base/applications/mspaint_new/dib.cpp
* PURPOSE: Some DIB related functions * PURPOSE: Some DIB related functions
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -71,7 +71,7 @@ SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int
bi.biXPelsPerMeter = hRes; bi.biXPelsPerMeter = hRes;
bi.biYPelsPerMeter = vRes; bi.biYPelsPerMeter = vRes;
buffer = HeapAlloc(GetProcessHeap(), 0, imgDataSize); buffer = (char*) HeapAlloc(GetProcessHeap(), 0, imgDataSize);
if (!buffer) if (!buffer)
return; return;
@ -153,7 +153,7 @@ LoadDIBFromFile(HBITMAP * hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, in
if (size) if (size)
*size = GetFileSize(hFile, NULL); *size = GetFileSize(hFile, NULL);
bi = HeapAlloc(GetProcessHeap(), 0, bfh.bfOffBits - sizeof(BITMAPFILEHEADER)); bi = (BITMAPINFO*) HeapAlloc(GetProcessHeap(), 0, bfh.bfOffBits - sizeof(BITMAPFILEHEADER));
if (!bi) if (!bi)
{ {
CloseHandle(hFile); CloseHandle(hFile);

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/dib.h * FILE: base/applications/mspaint_new/dib.h
* PURPOSE: Some DIB related functions * PURPOSE: Some DIB related functions
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/drawing.c * FILE: base/applications/mspaint_new/drawing.cpp
* PURPOSE: The drawing functions used by the tools * PURPOSE: The drawing functions used by the tools
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -15,7 +15,7 @@
void void
Line(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, int thickness) Line(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, int thickness)
{ {
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, color)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, thickness, color));
MoveToEx(hdc, x1, y1, NULL); MoveToEx(hdc, x1, y1, NULL);
LineTo(hdc, x2, y2); LineTo(hdc, x2, y2);
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
@ -26,11 +26,11 @@ Rect(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int
{ {
HBRUSH oldBrush; HBRUSH oldBrush;
LOGBRUSH logbrush; LOGBRUSH logbrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID; logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
logbrush.lbColor = (style == 2) ? fg : bg; logbrush.lbColor = (style == 2) ? fg : bg;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = (HBRUSH) SelectObject(hdc, CreateBrushIndirect(&logbrush));
Rectangle(hdc, x1, y1, x2, y2); Rectangle(hdc, x1, y1, x2, y2);
DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldBrush));
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
@ -41,11 +41,11 @@ Ellp(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, int
{ {
HBRUSH oldBrush; HBRUSH oldBrush;
LOGBRUSH logbrush; LOGBRUSH logbrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID; logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
logbrush.lbColor = (style == 2) ? fg : bg; logbrush.lbColor = (style == 2) ? fg : bg;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = (HBRUSH) SelectObject(hdc, CreateBrushIndirect(&logbrush));
Ellipse(hdc, x1, y1, x2, y2); Ellipse(hdc, x1, y1, x2, y2);
DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldBrush));
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
@ -56,11 +56,11 @@ RRect(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, in
{ {
LOGBRUSH logbrush; LOGBRUSH logbrush;
HBRUSH oldBrush; HBRUSH oldBrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID; logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
logbrush.lbColor = (style == 2) ? fg : bg; logbrush.lbColor = (style == 2) ? fg : bg;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = (HBRUSH) SelectObject(hdc, CreateBrushIndirect(&logbrush));
RoundRect(hdc, x1, y1, x2, y2, 16, 16); RoundRect(hdc, x1, y1, x2, y2, 16, 16);
DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldBrush));
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
@ -71,7 +71,7 @@ Poly(HDC hdc, POINT * lpPoints, int nCount, COLORREF fg, COLORREF bg, int thic
{ {
LOGBRUSH logbrush; LOGBRUSH logbrush;
HBRUSH oldBrush; HBRUSH oldBrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
UINT oldRop = GetROP2(hdc); UINT oldRop = GetROP2(hdc);
if (inverted) if (inverted)
@ -80,7 +80,7 @@ Poly(HDC hdc, POINT * lpPoints, int nCount, COLORREF fg, COLORREF bg, int thic
logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID; logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
logbrush.lbColor = (style == 2) ? fg : bg; logbrush.lbColor = (style == 2) ? fg : bg;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = (HBRUSH) SelectObject(hdc, CreateBrushIndirect(&logbrush));
if (closed) if (closed)
Polygon(hdc, lpPoints, nCount); Polygon(hdc, lpPoints, nCount);
else else
@ -100,7 +100,7 @@ Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, COLORREF color, int thic
fourPoints[1] = p2; fourPoints[1] = p2;
fourPoints[2] = p3; fourPoints[2] = p3;
fourPoints[3] = p4; fourPoints[3] = p4;
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, color)); oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, thickness, color));
PolyBezier(hdc, fourPoints, 4); PolyBezier(hdc, fourPoints, 4);
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
@ -108,7 +108,7 @@ Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, COLORREF color, int thic
void void
Fill(HDC hdc, LONG x, LONG y, COLORREF color) Fill(HDC hdc, LONG x, LONG y, COLORREF color)
{ {
HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color)); HBRUSH oldBrush = (HBRUSH) SelectObject(hdc, CreateSolidBrush(color));
ExtFloodFill(hdc, x, y, GetPixel(hdc, x, y), FLOODFILLSURFACE); ExtFloodFill(hdc, x, y, GetPixel(hdc, x, y), FLOODFILLSURFACE);
DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldBrush));
} }
@ -118,10 +118,10 @@ Erase(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG radius)
{ {
LONG a, b; LONG a, b;
HPEN oldPen; HPEN oldPen;
HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color)); HBRUSH oldBrush = (HBRUSH) SelectObject(hdc, CreateSolidBrush(color));
b = max(1, max(abs(x2 - x1), abs(y2 - y1))); b = max(1, max(abs(x2 - x1), abs(y2 - y1)));
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color)); oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, 1, color));
for(a = 0; a <= b; a++) for(a = 0; a <= b; a++)
Rectangle(hdc, (x1 * (b - a) + x2 * a) / b - radius + 1, Rectangle(hdc, (x1 * (b - a) + x2 * a) / b - radius + 1,
(y1 * (b - a) + y2 * a) / b - radius + 1, (x1 * (b - a) + x2 * a) / b + radius + 1, (y1 * (b - a) + y2 * a) / b - radius + 1, (x1 * (b - a) + x2 * a) / b + radius + 1,
@ -159,8 +159,8 @@ Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r)
void void
Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG style) Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG style)
{ {
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, 1, color));
HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color)); HBRUSH oldBrush = (HBRUSH) SelectObject(hdc, CreateSolidBrush(color));
LONG a, b; LONG a, b;
b = max(1, max(abs(x2 - x1), abs(y2 - y1))); b = max(1, max(abs(x2 - x1), abs(y2 - y1)));
switch (style) switch (style)
@ -229,7 +229,7 @@ RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2)
{ {
HBRUSH oldBrush; HBRUSH oldBrush;
LOGBRUSH logbrush; LOGBRUSH logbrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_DOT, 1, 0x00000000)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_DOT, 1, 0x00000000));
UINT oldRop = GetROP2(hdc); UINT oldRop = GetROP2(hdc);
SetROP2(hdc, R2_NOTXORPEN); SetROP2(hdc, R2_NOTXORPEN);
@ -237,7 +237,7 @@ RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2)
logbrush.lbStyle = BS_HOLLOW; logbrush.lbStyle = BS_HOLLOW;
logbrush.lbColor = 0; logbrush.lbColor = 0;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = (HBRUSH) SelectObject(hdc, CreateBrushIndirect(&logbrush));
Rectangle(hdc, x1, y1, x2, y2); Rectangle(hdc, x1, y1, x2, y2);
DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldBrush));
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
@ -250,17 +250,17 @@ SelectionFrame(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, DWORD system_selecti
{ {
HBRUSH oldBrush; HBRUSH oldBrush;
LOGBRUSH logbrush; LOGBRUSH logbrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_DOT, 1, system_selection_color)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_DOT, 1, system_selection_color));
logbrush.lbStyle = BS_HOLLOW; logbrush.lbStyle = BS_HOLLOW;
logbrush.lbColor = 0; logbrush.lbColor = 0;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = (HBRUSH) SelectObject(hdc, CreateBrushIndirect(&logbrush));
Rectangle(hdc, x1, y1, x2, y2); /* SEL BOX FRAME */ Rectangle(hdc, x1, y1, x2, y2); /* SEL BOX FRAME */
DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldBrush));
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, system_selection_color)); oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, 1, system_selection_color));
oldBrush = SelectObject(hdc, CreateSolidBrush(system_selection_color)); oldBrush = (HBRUSH) SelectObject(hdc, CreateSolidBrush(system_selection_color));
Rectangle(hdc, x1 - 1, y1 - 1, x1 + 2, y1 + 2); Rectangle(hdc, x1 - 1, y1 - 1, x1 + 2, y1 + 2);
Rectangle(hdc, x2 - 2, y1 - 1, x2 + 2, y1 + 2); Rectangle(hdc, x2 - 2, y1 - 1, x2 + 2, y1 + 2);
Rectangle(hdc, x1 - 1, y2 - 2, x1 + 2, y2 + 1); Rectangle(hdc, x1 - 1, y2 - 2, x1 + 2, y2 + 1);
@ -281,7 +281,7 @@ Text(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF bg, LPCT
COLORREF oldColor; COLORREF oldColor;
COLORREF oldBkColor; COLORREF oldBkColor;
int oldBkMode; int oldBkMode;
oldFont = SelectObject(hdc, font); oldFont = (HFONT) SelectObject(hdc, font);
oldColor = SetTextColor(hdc, fg); oldColor = SetTextColor(hdc, fg);
oldBkColor = SetBkColor(hdc, bg); oldBkColor = SetBkColor(hdc, bg);
oldBkMode = SetBkMode(hdc, TRANSPARENT); oldBkMode = SetBkMode(hdc, TRANSPARENT);

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/drawing.h * FILE: base/applications/mspaint_new/drawing.h
* PURPOSE: The drawing functions used by the tools * PURPOSE: The drawing functions used by the tools
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/globalvar.h * FILE: base/applications/mspaint_new/globalvar.h
* PURPOSE: Declaring global variables for later initialization * PURPOSE: Declaring global variables for later initialization
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/history.c * FILE: base/applications/mspaint_new/history.cpp
* PURPOSE: Undo and redo functionality * PURPOSE: Undo and redo functionality
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -29,7 +29,7 @@ void
newReversible() newReversible()
{ {
DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]); DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]);
hBms[(currInd + 1) % HISTORYSIZE] = CopyImage(hBms[currInd], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG); hBms[(currInd + 1) % HISTORYSIZE] = (HBITMAP) CopyImage(hBms[currInd], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);
currInd = (currInd + 1) % HISTORYSIZE; currInd = (currInd + 1) % HISTORYSIZE;
if (undoSteps < HISTORYSIZE - 1) if (undoSteps < HISTORYSIZE - 1)
undoSteps++; undoSteps++;
@ -75,7 +75,7 @@ resetToU1()
{ {
DeleteObject(hBms[currInd]); DeleteObject(hBms[currInd]);
hBms[currInd] = hBms[currInd] =
CopyImage(hBms[(currInd + HISTORYSIZE - 1) % HISTORYSIZE], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG); (HBITMAP) CopyImage(hBms[(currInd + HISTORYSIZE - 1) % HISTORYSIZE], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);
SelectObject(hDrawingDC, hBms[currInd]); SelectObject(hDrawingDC, hBms[currInd]);
imgXRes = GetDIBWidth(hBms[currInd]); imgXRes = GetDIBWidth(hBms[currInd]);
imgYRes = GetDIBHeight(hBms[currInd]); imgYRes = GetDIBHeight(hBms[currInd]);
@ -119,8 +119,8 @@ cropReversible(int width, int height, int xOffset, int yOffset)
hdc = CreateCompatibleDC(hDrawingDC); hdc = CreateCompatibleDC(hDrawingDC);
SelectObject(hdc, hBms[currInd]); SelectObject(hdc, hBms[currInd]);
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, bgColor)); oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, 1, bgColor));
oldBrush = SelectObject(hdc, CreateSolidBrush(bgColor)); oldBrush = (HBRUSH) SelectObject(hdc, CreateSolidBrush(bgColor));
Rectangle(hdc, 0, 0, width, height); Rectangle(hdc, 0, 0, width, height);
BitBlt(hdc, -xOffset, -yOffset, imgXRes, imgYRes, hDrawingDC, 0, 0, SRCCOPY); BitBlt(hdc, -xOffset, -yOffset, imgXRes, imgYRes, hDrawingDC, 0, 0, SRCCOPY);
DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldBrush));

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: history.h * FILE: base/applications/mspaint_new/history.h
* PURPOSE: Undo and redo functionality * PURPOSE: Undo and redo functionality
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/main.c * FILE: base/applications/mspaint_new/main.cpp
* PURPOSE: Initializing everything * PURPOSE: Initializing everything
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -221,9 +221,9 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument
/* preloading the draw transparent/nontransparent icons for later use */ /* preloading the draw transparent/nontransparent icons for later use */
hNontranspIcon = hNontranspIcon =
LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_NONTRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR); (HICON) LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_NONTRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR);
hTranspIcon = hTranspIcon =
LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_TRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR); (HICON) LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_TRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR);
hCurFill = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_FILL)); hCurFill = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_FILL));
hCurColor = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_COLOR)); hCurColor = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_COLOR));
@ -250,7 +250,7 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument
1, -2, 50, 205, hToolBoxContainer, NULL, hThisInstance, NULL); 1, -2, 50, 205, hToolBoxContainer, NULL, hThisInstance, NULL);
hImageList = ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 0); hImageList = ImageList_Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 0);
SendMessage(hToolbar, TB_SETIMAGELIST, 0, (LPARAM) hImageList); SendMessage(hToolbar, TB_SETIMAGELIST, 0, (LPARAM) hImageList);
tempBm = LoadImage(hThisInstance, MAKEINTRESOURCE(IDB_TOOLBARICONS), IMAGE_BITMAP, 256, 16, 0); tempBm = (HBITMAP) LoadImage(hThisInstance, MAKEINTRESOURCE(IDB_TOOLBARICONS), IMAGE_BITMAP, 256, 16, 0);
ImageList_AddMasked(hImageList, tempBm, 0xff00ff); ImageList_AddMasked(hImageList, tempBm, 0xff00ff);
DeleteObject(tempBm); DeleteObject(tempBm);
SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); SendMessage(hToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
@ -447,7 +447,7 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument
/* Run the message loop. It will run until GetMessage() returns 0 */ /* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage(&messages, NULL, 0, 0)) while (GetMessage(&messages, NULL, 0, 0))
{ {
TranslateAccelerator(hwnd, haccel, &messages); TranslateAccelerator(hwnd, (HACCEL) haccel, &messages);
/* Translate virtual-key messages into character messages */ /* Translate virtual-key messages into character messages */
TranslateMessage(&messages); TranslateMessage(&messages);

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/mouse.c * FILE: base/applications/mspaint_new/mouse.cpp
* PURPOSE: Things which should not be in the mouse event handler itself * PURPOSE: Things which should not be in the mouse event handler itself
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -67,7 +67,7 @@ startPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg)
ShowWindow(hSelection, SW_HIDE); ShowWindow(hSelection, SW_HIDE);
if (ptStack != NULL) if (ptStack != NULL)
HeapFree(GetProcessHeap(), 0, ptStack); HeapFree(GetProcessHeap(), 0, ptStack);
ptStack = HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sizeof(POINT) * 1024); ptStack = (POINT*) HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sizeof(POINT) * 1024);
ptSP = 0; ptSP = 0;
ptStack[0].x = x; ptStack[0].x = x;
ptStack[0].y = y; ptStack[0].y = y;
@ -138,7 +138,7 @@ whilePaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg)
newReversible(); newReversible();
ptSP++; ptSP++;
if (ptSP % 1024 == 0) if (ptSP % 1024 == 0)
ptStack = HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, ptStack, sizeof(POINT) * (ptSP + 1024)); ptStack = (POINT*) HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, ptStack, sizeof(POINT) * (ptSP + 1024));
ptStack[ptSP].x = max(0, min(x, imgXRes)); ptStack[ptSP].x = max(0, min(x, imgXRes));
ptStack[ptSP].y = max(0, min(y, imgYRes)); ptStack[ptSP].y = max(0, min(y, imgYRes));
resetToU1(); resetToU1();
@ -261,7 +261,7 @@ endPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg)
DeleteObject(hSelMask); DeleteObject(hSelMask);
hSelMask = CreateBitmap(RECT_WIDTH(rectSel_src), RECT_HEIGHT(rectSel_src), 1, 1, NULL); hSelMask = CreateBitmap(RECT_WIDTH(rectSel_src), RECT_HEIGHT(rectSel_src), 1, 1, NULL);
DeleteObject(SelectObject(hSelDC, hSelMask)); DeleteObject(SelectObject(hSelDC, hSelMask));
ptStackCopy = HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sizeof(POINT) * (ptSP + 1)); ptStackCopy = (POINT*) HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sizeof(POINT) * (ptSP + 1));
for (i = 0; i <= ptSP; i++) for (i = 0; i <= ptSP; i++)
{ {
ptStackCopy[i].x = ptStack[i].x - rectSel_src.left; ptStackCopy[i].x = ptStack[i].x - rectSel_src.left;

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/mouse.h * FILE: base/applications/mspaint_new/mouse.h
* PURPOSE: Things which should not be in the mouse event handler itself * PURPOSE: Things which should not be in the mouse event handler itself
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/palette.c * FILE: base/applications/mspaint_new/palette.cpp
* PURPOSE: Window procedure of the palette window * PURPOSE: Window procedure of the palette window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -57,13 +57,13 @@ PalWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_TOPLEFT | BF_BOTTOMRIGHT); DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_TOPLEFT | BF_BOTTOMRIGHT);
SetRect(&rc, 11, 12, 26, 27); SetRect(&rc, 11, 12, 26, 27);
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE); DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
oldPen = SelectObject(hDC, CreatePen(PS_NULL, 0, 0)); oldPen = (HPEN) SelectObject(hDC, CreatePen(PS_NULL, 0, 0));
oldBrush = SelectObject(hDC, CreateSolidBrush(bgColor)); oldBrush = (HBRUSH) SelectObject(hDC, CreateSolidBrush(bgColor));
Rectangle(hDC, rc.left, rc.top + 2, rc.right - 1, rc.bottom - 1); Rectangle(hDC, rc.left, rc.top + 2, rc.right - 1, rc.bottom - 1);
DeleteObject(SelectObject(hDC, oldBrush)); DeleteObject(SelectObject(hDC, oldBrush));
SetRect(&rc, 4, 5, 19, 20); SetRect(&rc, 4, 5, 19, 20);
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE); DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
oldBrush = SelectObject(hDC, CreateSolidBrush(fgColor)); oldBrush = (HBRUSH) SelectObject(hDC, CreateSolidBrush(fgColor));
Rectangle(hDC, rc.left + 2, rc.top + 2, rc.right - 1, rc.bottom - 1); Rectangle(hDC, rc.left + 2, rc.top + 2, rc.right - 1, rc.bottom - 1);
DeleteObject(SelectObject(hDC, oldBrush)); DeleteObject(SelectObject(hDC, oldBrush));
DeleteObject(SelectObject(hDC, oldPen)); DeleteObject(SelectObject(hDC, oldPen));
@ -74,8 +74,8 @@ PalWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
0 + (i / 14) * 16, 16 + 31 + (i % 14) * 16, 16 + 0 + (i / 14) * 16); 0 + (i / 14) * 16, 16 + 31 + (i % 14) * 16, 16 + 0 + (i / 14) * 16);
DrawEdge(hDC, &rc, EDGE_RAISED, BF_TOPLEFT); DrawEdge(hDC, &rc, EDGE_RAISED, BF_TOPLEFT);
DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_RECT); DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_RECT);
oldPen = SelectObject(hDC, CreatePen(PS_NULL, 0, 0)); oldPen = (HPEN) SelectObject(hDC, CreatePen(PS_NULL, 0, 0));
oldBrush = SelectObject(hDC, CreateSolidBrush(palColors[i])); oldBrush = (HBRUSH) SelectObject(hDC, CreateSolidBrush(palColors[i]));
Rectangle(hDC, rc.left + 2, rc.top + 2, rc.right - 1, rc.bottom - 1); Rectangle(hDC, rc.left + 2, rc.top + 2, rc.right - 1, rc.bottom - 1);
DeleteObject(SelectObject(hDC, oldBrush)); DeleteObject(SelectObject(hDC, oldBrush));
DeleteObject(SelectObject(hDC, oldPen)); DeleteObject(SelectObject(hDC, oldPen));

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/palette.h * FILE: base/applications/mspaint_new/palette.h
* PURPOSE: Window procedure of the palette window * PURPOSE: Window procedure of the palette window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/registry.c * FILE: base/applications/mspaint_new/registry.cpp
* PURPOSE: Offering functions dealing with registry values * PURPOSE: Offering functions dealing with registry values
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/registry.h * FILE: base/applications/mspaint_new/registry.h
* PURPOSE: Offering functions dealing with registry values * PURPOSE: Offering functions dealing with registry values
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/mspaint/rsrc.rc * FILE: base/applications/mspaint_new/rsrc.rc
* PURPOSE: Managing the resources * PURPOSE: Managing the resources
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: scrollbox.c * FILE: base/applications/mspaint_new/scrollbox.cpp
* PURPOSE: Functionality surrounding the scroll box window class * PURPOSE: Functionality surrounding the scroll box window class
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: scrollbox.h * FILE: base/applications/mspaint_new/scrollbox.h
* PURPOSE: Functionality surrounding the scroll box window class * PURPOSE: Functionality surrounding the scroll box window class
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/selection.c * FILE: base/applications/mspaint_new/selection.cpp
* PURPOSE: Window procedure of the selection window * PURPOSE: Window procedure of the selection window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/selection.h * FILE: base/applications/mspaint_new/selection.h
* PURPOSE: Window procedure of the selection window * PURPOSE: Window procedure of the selection window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: sizebox.c * FILE: base/applications/mspaint_new/sizebox.cpp
* PURPOSE: Window procedure of the size boxes * PURPOSE: Window procedure of the size boxes
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/sizebox.h * FILE: base/applications/mspaint_new/sizebox.h
* PURPOSE: Window procedure of the size boxes * PURPOSE: Window procedure of the size boxes
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/textedit.c * FILE: base/applications/mspaint_new/textedit.cpp
* PURPOSE: Text editor and font chooser for the text tool * PURPOSE: Text editor and font chooser for the text tool
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -55,7 +55,7 @@ TextEditWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
HeapFree(GetProcessHeap(), 0, textToolText); HeapFree(GetProcessHeap(), 0, textToolText);
textToolTextMaxLen = GetWindowTextLength(hwndEditCtl) + 1; textToolTextMaxLen = GetWindowTextLength(hwndEditCtl) + 1;
textToolText = HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sizeof(TCHAR) * textToolTextMaxLen); textToolText = (LPTSTR) HeapAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sizeof(TCHAR) * textToolTextMaxLen);
GetWindowText(hwndEditCtl, textToolText, textToolTextMaxLen); GetWindowText(hwndEditCtl, textToolText, textToolTextMaxLen);
ForceRefreshSelectionContents(); ForceRefreshSelectionContents();
break; break;

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/textedit.h * FILE: base/applications/mspaint_new/textedit.h
* PURPOSE: Text editor and font chooser for the text tool * PURPOSE: Text editor and font chooser for the text tool
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/toolsettings.c * FILE: base/applications/mspaint_new/toolsettings.cpp
* PURPOSE: Window procedure of the tool settings window * PURPOSE: Window procedure of the tool settings window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -58,7 +58,7 @@ SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case TOOL_RECTSEL: case TOOL_RECTSEL:
case TOOL_TEXT: case TOOL_TEXT:
{ {
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
Rectangle(hdc, 2, transpBg * 31 + 2, 41, transpBg * 31 + 33); Rectangle(hdc, 2, transpBg * 31 + 2, 41, transpBg * 31 + 33);
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
@ -69,7 +69,7 @@ SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case TOOL_RUBBER: case TOOL_RUBBER:
{ {
int i; int i;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
for(i = 0; i < 4; i++) for(i = 0; i < 4; i++)
{ {
if (rubberRadius == i + 2) if (rubberRadius == i + 2)
@ -88,7 +88,7 @@ SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case TOOL_BRUSH: case TOOL_BRUSH:
{ {
int i; int i;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
Rectangle(hdc, brushStyle % 3 * 13 + 2, brushStyle / 3 * 15 + 2, brushStyle % 3 * 13 + 15, Rectangle(hdc, brushStyle % 3 * 13 + 2, brushStyle / 3 * 15 + 2, brushStyle % 3 * 13 + 15,
brushStyle / 3 * 15 + 17); brushStyle / 3 * 15 + 17);
@ -100,7 +100,7 @@ SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
} }
case TOOL_AIRBRUSH: case TOOL_AIRBRUSH:
{ {
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
switch (airBrushWidth) switch (airBrushWidth)
{ {
@ -132,7 +132,7 @@ SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case TOOL_BEZIER: case TOOL_BEZIER:
{ {
int i; int i;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
for(i = 0; i < 5; i++) for(i = 0; i < 5; i++)
{ {
if (lineWidth == i + 1) if (lineWidth == i + 1)
@ -154,7 +154,7 @@ SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case TOOL_RRECT: case TOOL_RRECT:
{ {
int i; int i;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
for(i = 0; i < 3; i++) for(i = 0; i < 3; i++)
{ {
if (shapeStyle == i) if (shapeStyle == i)

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/toolsettings.h * FILE: base/applications/mspaint_new/toolsettings.h
* PURPOSE: Window procedure of the tool settings window * PURPOSE: Window procedure of the tool settings window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/winproc.c * FILE: base/applications/mspaint_new/winproc.cpp
* PURPOSE: Window procedure of the main window and all children apart from * PURPOSE: Window procedure of the main window and all children apart from
* hPalWin, hToolSettings and hSelection * hPalWin, hToolSettings and hSelection
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
@ -115,9 +115,9 @@ drawZoomFrame(int mouseX, int mouseY)
y = max(0, min(clientRectImageArea.bottom - h, mouseY - h / 2)); y = max(0, min(clientRectImageArea.bottom - h, mouseY - h / 2));
hdc = GetDC(hImageArea); hdc = GetDC(hImageArea);
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 0, 0)); oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, 0, 0));
logbrush.lbStyle = BS_HOLLOW; logbrush.lbStyle = BS_HOLLOW;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = (HBRUSH) SelectObject(hdc, CreateBrushIndirect(&logbrush));
rop = SetROP2(hdc, R2_NOT); rop = SetROP2(hdc, R2_NOT);
Rectangle(hdc, x, y, x + w, y + h); Rectangle(hdc, x, y, x + w, y + h);
SetROP2(hdc, rop); SetROP2(hdc, rop);
@ -209,7 +209,7 @@ InsertSelectionFromHBITMAP(HBITMAP bitmap, HWND window)
SendMessage(hToolbar, TB_CHECKBUTTON, ID_RECTSEL, MAKELONG(TRUE, 0)); SendMessage(hToolbar, TB_CHECKBUTTON, ID_RECTSEL, MAKELONG(TRUE, 0));
SendMessage(window, WM_COMMAND, ID_RECTSEL, 0); SendMessage(window, WM_COMMAND, ID_RECTSEL, 0);
DeleteObject(SelectObject(hSelDC, hSelBm = CopyImage(bitmap, DeleteObject(SelectObject(hSelDC, hSelBm = (HBITMAP) CopyImage(bitmap,
IMAGE_BITMAP, 0, 0, IMAGE_BITMAP, 0, 0,
LR_COPYRETURNORG))); LR_COPYRETURNORG)));
newReversible(); newReversible();
@ -411,7 +411,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
imgYRes, SRCCOPY); imgYRes, SRCCOPY);
if (showGrid && (zoom >= 4000)) if (showGrid && (zoom >= 4000))
{ {
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, 0x00a0a0a0)); HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, 1, 0x00a0a0a0));
int counter; int counter;
for(counter = 0; counter <= imgYRes; counter++) for(counter = 0; counter <= imgYRes; counter++)
{ {
@ -522,7 +522,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
InvalidateRect(hImageArea, NULL, FALSE); InvalidateRect(hImageArea, NULL, FALSE);
if (activeTool == TOOL_COLOR) if (activeTool == TOOL_COLOR)
{ {
int tempColor = COLORREF tempColor =
GetPixel(hDrawingDC, GET_X_LPARAM(lParam) * 1000 / zoom, GET_Y_LPARAM(lParam) * 1000 / zoom); GetPixel(hDrawingDC, GET_X_LPARAM(lParam) * 1000 / zoom, GET_Y_LPARAM(lParam) * 1000 / zoom);
if (tempColor != CLR_INVALID) if (tempColor != CLR_INVALID)
fgColor = tempColor; fgColor = tempColor;
@ -542,7 +542,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
InvalidateRect(hImageArea, NULL, FALSE); InvalidateRect(hImageArea, NULL, FALSE);
if (activeTool == TOOL_COLOR) if (activeTool == TOOL_COLOR)
{ {
int tempColor = COLORREF tempColor =
GetPixel(hDrawingDC, GET_X_LPARAM(lParam) * 1000 / zoom, GET_Y_LPARAM(lParam) * 1000 / zoom); GetPixel(hDrawingDC, GET_X_LPARAM(lParam) * 1000 / zoom, GET_Y_LPARAM(lParam) * 1000 / zoom);
if (tempColor != CLR_INVALID) if (tempColor != CLR_INVALID)
bgColor = tempColor; bgColor = tempColor;
@ -788,7 +788,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
OpenClipboard(hMainWnd); OpenClipboard(hMainWnd);
if (GetClipboardData(CF_BITMAP) != NULL) if (GetClipboardData(CF_BITMAP) != NULL)
{ {
InsertSelectionFromHBITMAP(GetClipboardData(CF_BITMAP), hwnd); InsertSelectionFromHBITMAP((HBITMAP) GetClipboardData(CF_BITMAP), hwnd);
} }
CloseClipboard(); CloseClipboard();
break; break;
@ -946,7 +946,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
if (changeSizeDlg()) if (changeSizeDlg())
{ {
insertReversible(CopyImage(hBms[currInd], IMAGE_BITMAP, insertReversible((HBITMAP) CopyImage(hBms[currInd], IMAGE_BITMAP,
imgXRes * stretchSkew.percentage.x / 100, imgXRes * stretchSkew.percentage.x / 100,
imgYRes * stretchSkew.percentage.y / 100, 0)); imgYRes * stretchSkew.percentage.y / 100, 0));
updateCanvasAndScrollbars(); updateCanvasAndScrollbars();
@ -958,7 +958,7 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
InvalidateRect(hToolSettings, NULL, TRUE); InvalidateRect(hToolSettings, NULL, TRUE);
break; break;
case IDM_IMAGECROP: case IDM_IMAGECROP:
insertReversible(CopyImage(hSelBm, IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG)); insertReversible((HBITMAP) CopyImage(hSelBm, IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG));
updateCanvasAndScrollbars(); updateCanvasAndScrollbars();
break; break;

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: base/applications/paint/winproc.h * FILE: base/applications/mspaint_new/winproc.h
* PURPOSE: Window procedure of the main window and all children apart from * PURPOSE: Window procedure of the main window and all children apart from
* hPalWin, hToolSettings and hSelection * hPalWin, hToolSettings and hSelection
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen