[PAINT] cleanup:

- formatting for enhanced readability
- removal of superfluous variables/assignments
- corrected or added header comment in all files
- change if ... else ... to ?-operator where sensible and readable
- small bugfix in mouse.c concerning rectangle drawing
- fixed some possible string buffer overruns

svn path=/trunk/; revision=43671
This commit is contained in:
Benedikt Freisen 2009-10-21 15:44:31 +00:00
parent 9647ae1f0c
commit f2e66d0408
44 changed files with 1319 additions and 1085 deletions

View file

@ -1,8 +1,8 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: definitions.h * FILE: base/applications/paint/definitions.h
* PURPOSE: Defines the resource ids * PURPOSE: Defines the resource ids and other stuff
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -12,6 +12,7 @@
/* HISTORYSIZE = number of possible undo-steps + 1 */ /* HISTORYSIZE = number of possible undo-steps + 1 */
#define SIZEOF(a) (sizeof(a) / sizeof((a)[0])) #define SIZEOF(a) (sizeof(a) / sizeof((a)[0]))
/* sizeof for string constants; equals max. number of characters */
#define IDI_APPICON 500 #define IDI_APPICON 500
@ -72,7 +73,7 @@
#define IDM_IMAGEINVERTCOLORS 253 #define IDM_IMAGEINVERTCOLORS 253
#define IDM_IMAGEATTRIBUTES 254 #define IDM_IMAGEATTRIBUTES 254
#define IDM_IMAGEDELETEIMAGE 255 #define IDM_IMAGEDELETEIMAGE 255
#define IDM_IMAGEDRAWOPAQUE 256 #define IDM_IMAGEDRAWOPAQUE 256
#define IDM_COLORSEDITPALETTE 260 #define IDM_COLORSEDITPALETTE 260

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: dialogs.c * FILE: base/applications/paint/dialogs.c
* 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
*/ */
@ -15,7 +15,8 @@
/* FUNCTIONS ********************************************************/ /* FUNCTIONS ********************************************************/
LRESULT CALLBACK MRDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK
MRDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -63,44 +64,46 @@ LRESULT CALLBACK MRDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lP
return TRUE; return TRUE;
} }
int mirrorRotateDlg() int
mirrorRotateDlg()
{ {
return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_MIRRORROTATE), hMainWnd, (DLGPROC)MRDlgWinProc); return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_MIRRORROTATE), hMainWnd, (DLGPROC) MRDlgWinProc);
} }
LRESULT CALLBACK ATTDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK
ATTDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{
TCHAR strrc[100];
TCHAR res[100];
CheckDlgButton(hwnd, IDD_ATTRIBUTESRB3, BST_CHECKED);
CheckDlgButton(hwnd, IDD_ATTRIBUTESRB5, BST_CHECKED);
SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, imgXRes, FALSE);
SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, imgYRes, FALSE);
if (isAFile)
{ {
TCHAR strrc[100]; TCHAR date[100];
TCHAR res[100]; TCHAR size[100];
TCHAR temp[100];
CheckDlgButton(hwnd, IDD_ATTRIBUTESRB3, BST_CHECKED); GetDateFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, date, SIZEOF(date));
CheckDlgButton(hwnd, IDD_ATTRIBUTESRB5, BST_CHECKED); GetTimeFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, temp, SIZEOF(temp));
SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, imgXRes, FALSE); _tcscat(date, _T(" "));
SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, imgYRes, FALSE); _tcscat(date, temp);
LoadString(hProgInstance, IDS_FILESIZE, strrc, SIZEOF(strrc));
if (isAFile) _stprintf(size, strrc, fileSize);
{ SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT6, date);
TCHAR date[100]; SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT7, size);
TCHAR size[100];
TCHAR temp[100];
GetDateFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, date, sizeof(date));
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, temp, sizeof(temp));
_tcscat(date, _T(" "));
_tcscat(date, temp);
LoadString(hProgInstance, IDS_FILESIZE, strrc, sizeof(strrc));
_stprintf(size, strrc, fileSize);
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT6, date);
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT7, size);
}
LoadString(hProgInstance, IDS_PRINTRES, strrc, sizeof(strrc));
_stprintf(res, strrc, fileHPPM, fileVPPM);
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT8, res);
return TRUE;
} }
LoadString(hProgInstance, IDS_PRINTRES, strrc, SIZEOF(strrc));
_stprintf(res, strrc, fileHPPM, fileVPPM);
SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT8, res);
return TRUE;
}
case WM_CLOSE: case WM_CLOSE:
EndDialog(hwnd, 0); EndDialog(hwnd, 0);
break; break;
@ -108,7 +111,10 @@ LRESULT CALLBACK ATTDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
switch (LOWORD(wParam)) switch (LOWORD(wParam))
{ {
case IDOK: case IDOK:
EndDialog(hwnd, GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, NULL, FALSE) | (GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, NULL, FALSE)<<16)); EndDialog(hwnd,
GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, NULL,
FALSE) | (GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, NULL,
FALSE) << 16));
break; break;
case IDCANCEL: case IDCANCEL:
EndDialog(hwnd, 0); EndDialog(hwnd, 0);
@ -127,12 +133,14 @@ LRESULT CALLBACK ATTDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
return TRUE; return TRUE;
} }
int attributesDlg() int
attributesDlg()
{ {
return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_ATTRIBUTES), hMainWnd, (DLGPROC)ATTDlgWinProc); return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_ATTRIBUTES), hMainWnd, (DLGPROC) ATTDlgWinProc);
} }
LRESULT CALLBACK CHSIZEDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK
CHSIZEDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
{ {
@ -147,7 +155,10 @@ LRESULT CALLBACK CHSIZEDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
switch (LOWORD(wParam)) switch (LOWORD(wParam))
{ {
case IDOK: case IDOK:
EndDialog(hwnd, GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT1, NULL, FALSE) | (GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT2, NULL, FALSE)<<16)); EndDialog(hwnd,
GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT1, NULL,
FALSE) | (GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT2, NULL,
FALSE) << 16));
break; break;
case IDCANCEL: case IDCANCEL:
EndDialog(hwnd, 0); EndDialog(hwnd, 0);
@ -160,7 +171,8 @@ LRESULT CALLBACK CHSIZEDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
return TRUE; return TRUE;
} }
int changeSizeDlg() int
changeSizeDlg()
{ {
return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_CHANGESIZE), hMainWnd, (DLGPROC)CHSIZEDlgWinProc); return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_CHANGESIZE), hMainWnd, (DLGPROC) CHSIZEDlgWinProc);
} }

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: dialogs.h * FILE: base/applications/paint/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: dib.c * FILE: base/applications/paint/dib.c
* PURPOSE: Some DIB related functions * PURPOSE: Some DIB related functions
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -12,7 +12,8 @@
/* FUNCTIONS ********************************************************/ /* FUNCTIONS ********************************************************/
HBITMAP CreateDIBWithProperties(int width, int height) HBITMAP
CreateDIBWithProperties(int width, int height)
{ {
BITMAPINFO bmi; BITMAPINFO bmi;
ZeroMemory(&bmi, sizeof(BITMAPINFO)); ZeroMemory(&bmi, sizeof(BITMAPINFO));
@ -25,21 +26,24 @@ HBITMAP CreateDIBWithProperties(int width, int height)
return CreateDIBSection(NULL, &bmi, DIB_RGB_COLORS, NULL, NULL, 0); return CreateDIBSection(NULL, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
} }
int GetDIBWidth(HBITMAP hBitmap) int
GetDIBWidth(HBITMAP hBitmap)
{ {
BITMAP bm; BITMAP bm;
GetObject(hBitmap, sizeof(BITMAP), &bm); GetObject(hBitmap, sizeof(BITMAP), &bm);
return bm.bmWidth; return bm.bmWidth;
} }
int GetDIBHeight(HBITMAP hBitmap) int
GetDIBHeight(HBITMAP hBitmap)
{ {
BITMAP bm; BITMAP bm;
GetObject(hBitmap, sizeof(BITMAP), &bm); GetObject(hBitmap, sizeof(BITMAP), &bm);
return bm.bmHeight; return bm.bmHeight;
} }
void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes, int vRes) void
SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes, int vRes)
{ {
BITMAP bm; BITMAP bm;
HANDLE hFile; HANDLE hFile;
@ -47,7 +51,7 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time,
BITMAPINFOHEADER bi; BITMAPINFOHEADER bi;
int imgDataSize; int imgDataSize;
DWORD dwBytesWritten; DWORD dwBytesWritten;
char* buffer; char *buffer;
GetObject(hBitmap, sizeof(BITMAP), &bm); GetObject(hBitmap, sizeof(BITMAP), &bm);
@ -55,7 +59,7 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time,
ZeroMemory(&bi, sizeof(BITMAPINFOHEADER)); ZeroMemory(&bi, sizeof(BITMAPINFOHEADER));
imgDataSize = bm.bmWidthBytes * bm.bmHeight; imgDataSize = bm.bmWidthBytes * bm.bmHeight;
bf.bfType = 0x4d42; /* BM */ bf.bfType = 0x4d42; /* BM */
bf.bfSize = imgDataSize + 52; bf.bfSize = imgDataSize + 52;
bf.bfOffBits = 54; bf.bfOffBits = 54;
bi.biSize = sizeof(BITMAPINFOHEADER); bi.biSize = sizeof(BITMAPINFOHEADER);
@ -68,7 +72,7 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time,
bi.biYPelsPerMeter = vRes; bi.biYPelsPerMeter = vRes;
buffer = HeapAlloc(GetProcessHeap(), 0, imgDataSize); buffer = HeapAlloc(GetProcessHeap(), 0, imgDataSize);
GetDIBits(hDC, hBitmap, 0, bm.bmHeight, buffer, (LPBITMAPINFO)&bi, DIB_RGB_COLORS); GetDIBits(hDC, hBitmap, 0, bm.bmHeight, buffer, (LPBITMAPINFO) & bi, DIB_RGB_COLORS);
hFile = CreateFile(FileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL); hFile = CreateFile(FileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (hFile == INVALID_HANDLE_VALUE) if (hFile == INVALID_HANDLE_VALUE)
@ -91,18 +95,20 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time,
HeapFree(GetProcessHeap(), 0, buffer); HeapFree(GetProcessHeap(), 0, buffer);
} }
void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes) void
LoadDIBFromFile(HBITMAP * hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes)
{ {
BITMAPFILEHEADER bfh; BITMAPFILEHEADER bfh;
BITMAPINFO *bi; BITMAPINFO *bi;
PVOID pvBits; PVOID pvBits;
DWORD dwBytesRead; DWORD dwBytesRead;
HANDLE hFile; HANDLE hFile;
if (!hBitmap) if (!hBitmap)
return; return;
hFile = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL); hFile =
CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (hFile == INVALID_HANDLE_VALUE) if (hFile == INVALID_HANDLE_VALUE)
return; return;
@ -113,7 +119,7 @@ void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size
CloseHandle(hFile); CloseHandle(hFile);
return; return;
} }
if (time) if (time)
{ {
FILETIME ft; FILETIME ft;
@ -130,12 +136,12 @@ void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size
ReadFile(hFile, bi, bfh.bfOffBits - sizeof(BITMAPFILEHEADER), &dwBytesRead, NULL); ReadFile(hFile, bi, bfh.bfOffBits - sizeof(BITMAPFILEHEADER), &dwBytesRead, NULL);
*hBitmap = CreateDIBSection(NULL, bi, DIB_RGB_COLORS, &pvBits, NULL, 0); *hBitmap = CreateDIBSection(NULL, bi, DIB_RGB_COLORS, &pvBits, NULL, 0);
ReadFile(hFile, pvBits, bfh.bfSize - bfh.bfOffBits, &dwBytesRead, NULL); ReadFile(hFile, pvBits, bfh.bfSize - bfh.bfOffBits, &dwBytesRead, NULL);
if (hRes) if (hRes)
*hRes = (*bi).bmiHeader.biXPelsPerMeter; *hRes = (*bi).bmiHeader.biXPelsPerMeter;
if (vRes) if (vRes)
*vRes = (*bi).bmiHeader.biYPelsPerMeter; *vRes = (*bi).bmiHeader.biYPelsPerMeter;
CloseHandle(hFile); CloseHandle(hFile);
HeapFree(GetProcessHeap(), 0, bi); HeapFree(GetProcessHeap(), 0, bi);
} }

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: dib.h * FILE: base/applications/paint/dib.h
* PURPOSE: Some DIB related functions * PURPOSE: Some DIB related functions
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -12,6 +12,7 @@ int GetDIBWidth(HBITMAP hbm);
int GetDIBHeight(HBITMAP hbm); int GetDIBHeight(HBITMAP hbm);
void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes, int vRes); void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes,
int vRes);
void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes); void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes);

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: drawing.c * FILE: base/applications/paint/drawing.c
* PURPOSE: The drawing functions used by the tools * PURPOSE: The drawing functions used by the tools
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -12,7 +12,8 @@
/* FUNCTIONS ********************************************************/ /* FUNCTIONS ********************************************************/
void Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickness) void
Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickness)
{ {
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, color)); HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, color));
MoveToEx(hdc, x1, y1, NULL); MoveToEx(hdc, x1, y1, NULL);
@ -20,13 +21,14 @@ void Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickn
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
void Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style) void
Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
{ {
HBRUSH oldBrush; HBRUSH oldBrush;
LOGBRUSH logbrush; LOGBRUSH logbrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID; logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg; logbrush.lbColor = (style == 2) ? fg : bg;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
Rectangle(hdc, x1, y1, x2, y2); Rectangle(hdc, x1, y1, x2, y2);
@ -34,13 +36,14 @@ void Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int t
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
void Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style) void
Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
{ {
HBRUSH oldBrush; HBRUSH oldBrush;
LOGBRUSH logbrush; LOGBRUSH logbrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID; logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg; logbrush.lbColor = (style == 2) ? fg : bg;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
Ellipse(hdc, x1, y1, x2, y2); Ellipse(hdc, x1, y1, x2, y2);
@ -48,13 +51,14 @@ void Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int t
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
void RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style) void
RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
{ {
LOGBRUSH logbrush; LOGBRUSH logbrush;
HBRUSH oldBrush; HBRUSH oldBrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID; logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg; logbrush.lbColor = (style == 2) ? fg : bg;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
RoundRect(hdc, x1, y1, x2, y2, 16, 16); RoundRect(hdc, x1, y1, x2, y2, 16, 16);
@ -62,13 +66,14 @@ void RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
void Poly(HDC hdc, POINT *lpPoints, int nCount, int fg, int bg, int thickness, int style, BOOL closed) void
Poly(HDC hdc, POINT * lpPoints, int nCount, int fg, int bg, int thickness, int style, BOOL closed)
{ {
LOGBRUSH logbrush; LOGBRUSH logbrush;
HBRUSH oldBrush; HBRUSH oldBrush;
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg)); HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID; logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg; logbrush.lbColor = (style == 2) ? fg : bg;
logbrush.lbHatch = 0; logbrush.lbHatch = 0;
oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush)); oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
if (closed) if (closed)
@ -79,7 +84,8 @@ void Poly(HDC hdc, POINT *lpPoints, int nCount, int fg, int bg, int thickness, i
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thickness) void
Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thickness)
{ {
HPEN oldPen; HPEN oldPen;
POINT fourPoints[4]; POINT fourPoints[4];
@ -92,42 +98,55 @@ void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thic
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
void Fill(HDC hdc, int x, int y, int color) void
Fill(HDC hdc, int x, int y, int color)
{ {
HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color)); HBRUSH oldBrush = 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));
} }
void Erase(HDC hdc, short x1, short y1, short x2, short y2, int color, int radius) void
Erase(HDC hdc, short x1, short y1, short x2, short y2, int color, int radius)
{ {
short a; short a;
HPEN oldPen; HPEN oldPen;
HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color)); HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color));
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color)); oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color));
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
Rectangle(hdc, (x1*(100-a)+x2*a)/100-radius+1, (y1*(100-a)+y2*a)/100-radius+1, (x1*(100-a)+x2*a)/100+radius+1, (y1*(100-a)+y2*a)/100+radius+1); Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - radius + 1,
(y1 * (100 - a) + y2 * a) / 100 - radius + 1, (x1 * (100 - a) + x2 * a) / 100 + radius + 1,
(y1 * (100 - a) + y2 * a) / 100 + radius + 1);
DeleteObject(SelectObject(hdc, oldBrush)); DeleteObject(SelectObject(hdc, oldBrush));
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
void Replace(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int radius) void
Replace(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int radius)
{ {
short a, x, y; short a, x, y;
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
for (y=(y1*(100-a)+y2*a)/100-radius+1; y<(y1*(100-a)+y2*a)/100+radius+1; y++) for(y = (y1 * (100 - a) + y2 * a) / 100 - radius + 1;
for (x=(x1*(100-a)+x2*a)/100-radius+1; x<(x1*(100-a)+x2*a)/100+radius+1; x++) y < (y1 * (100 - a) + y2 * a) / 100 + radius + 1; y++)
if (GetPixel(hdc, x, y)==fg) SetPixel(hdc, x, y, bg); for(x = (x1 * (100 - a) + x2 * a) / 100 - radius + 1;
x < (x1 * (100 - a) + x2 * a) / 100 + radius + 1; x++)
if (GetPixel(hdc, x, y) == fg)
SetPixel(hdc, x, y, bg);
} }
void Airbrush(HDC hdc, short x, short y, int color, int r) void
Airbrush(HDC hdc, short x, short y, int color, int r)
{ {
short a; short a;
short b; short b;
for (b=-r; b<=r; b++) for (a=-r; a<=r; a++) if ((a*a+b*b<=r*r)&&(rand()%4==0)) SetPixel(hdc, x+a, y+b, color); for(b = -r; b <= r; b++)
for(a = -r; a <= r; a++)
if ((a * a + b * b <= r * r) && (rand() % 4 == 0))
SetPixel(hdc, x + a, y + b, color);
} }
void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style) void
Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style)
{ {
HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color)); HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color));
HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color)); HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color));
@ -135,12 +154,14 @@ void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style
switch (style) switch (style)
{ {
case 0: case 0:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
Ellipse(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100-3, (x1*(100-a)+x2*a)/100+4, (y1*(100-a)+y2*a)/100+4); Ellipse(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 - 3,
(x1 * (100 - a) + x2 * a) / 100 + 4, (y1 * (100 - a) + y2 * a) / 100 + 4);
break; break;
case 1: case 1:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
Ellipse(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100-1, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100+3); Ellipse(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 - 1,
(x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 + 3);
break; break;
case 2: case 2:
MoveToEx(hdc, x1, y1, NULL); MoveToEx(hdc, x1, y1, NULL);
@ -148,57 +169,60 @@ void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style
SetPixel(hdc, x2, y2, color); SetPixel(hdc, x2, y2, color);
break; break;
case 3: case 3:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
Rectangle(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100-3, (x1*(100-a)+x2*a)/100+5, (y1*(100-a)+y2*a)/100+5); Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 - 3,
(x1 * (100 - a) + x2 * a) / 100 + 5, (y1 * (100 - a) + y2 * a) / 100 + 5);
break; break;
case 4: case 4:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
Rectangle(hdc, (x1*(100-a)+x2*a)/100-2, (y1*(100-a)+y2*a)/100-2, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100+3); Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - 2, (y1 * (100 - a) + y2 * a) / 100 - 2,
(x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 + 3);
break; break;
case 5: case 5:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
Rectangle(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100-1, (x1*(100-a)+x2*a)/100+1, (y1*(100-a)+y2*a)/100+1); Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 - 1,
(x1 * (100 - a) + x2 * a) / 100 + 1, (y1 * (100 - a) + y2 * a) / 100 + 1);
break; break;
case 6: case 6:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
{ {
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100+5, NULL); MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 + 5, NULL);
LineTo(hdc, (x1*(100-a)+x2*a)/100+5, (y1*(100-a)+y2*a)/100-3); LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 5, (y1 * (100 - a) + y2 * a) / 100 - 3);
} }
break; break;
case 7: case 7:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
{ {
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-2, (y1*(100-a)+y2*a)/100+3, NULL); MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 2, (y1 * (100 - a) + y2 * a) / 100 + 3, NULL);
LineTo(hdc, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100-2); LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 - 2);
} }
break; break;
case 8: case 8:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
{ {
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100+1, NULL); MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 + 1, NULL);
LineTo(hdc, (x1*(100-a)+x2*a)/100+1, (y1*(100-a)+y2*a)/100-1); LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 1, (y1 * (100 - a) + y2 * a) / 100 - 1);
} }
break; break;
case 9: case 9:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
{ {
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100-3, NULL); MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 - 3, NULL);
LineTo(hdc, (x1*(100-a)+x2*a)/100+5, (y1*(100-a)+y2*a)/100+5); LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 5, (y1 * (100 - a) + y2 * a) / 100 + 5);
} }
break; break;
case 10: case 10:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
{ {
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-2, (y1*(100-a)+y2*a)/100-2, NULL); MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 2, (y1 * (100 - a) + y2 * a) / 100 - 2, NULL);
LineTo(hdc, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100+3); LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 + 3);
} }
break; break;
case 11: case 11:
for (a=0; a<=100; a++) for(a = 0; a <= 100; a++)
{ {
MoveToEx(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100-1, NULL); MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 - 1, NULL);
LineTo(hdc, (x1*(100-a)+x2*a)/100+1, (y1*(100-a)+y2*a)/100+1); LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 1, (y1 * (100 - a) + y2 * a) / 100 + 1);
} }
break; break;
} }
@ -206,7 +230,8 @@ void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
void RectSel(HDC hdc, short x1, short y1, short x2, short y2) void
RectSel(HDC hdc, short x1, short y1, short x2, short y2)
{ {
HBRUSH oldBrush; HBRUSH oldBrush;
LOGBRUSH logbrush; LOGBRUSH logbrush;
@ -220,7 +245,8 @@ void RectSel(HDC hdc, short x1, short y1, short x2, short y2)
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
} }
void SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2) void
SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2)
{ {
HBRUSH oldBrush; HBRUSH oldBrush;
LOGBRUSH logbrush; LOGBRUSH logbrush;
@ -234,14 +260,14 @@ void SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2)
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, 0x00000000)); oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, 0x00000000));
oldBrush = SelectObject(hdc, CreateSolidBrush(0x00000000)); oldBrush = SelectObject(hdc, CreateSolidBrush(0x00000000));
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);
Rectangle(hdc, x2-2, y2-2, x2+2, y2+1); Rectangle(hdc, x2 - 2, y2 - 2, x2 + 2, y2 + 1);
Rectangle(hdc, (x1+x2)/2-1, y1-1, (x1+x2)/2+2, y1+2); Rectangle(hdc, (x1 + x2) / 2 - 1, y1 - 1, (x1 + x2) / 2 + 2, y1 + 2);
Rectangle(hdc, (x1+x2)/2-1, y2-2, (x1+x2)/2+2, y2+1); Rectangle(hdc, (x1 + x2) / 2 - 1, y2 - 2, (x1 + x2) / 2 + 2, y2 + 1);
Rectangle(hdc, x1-1, (y1+y2)/2-1, x1+2, (y1+y2)/2+2); Rectangle(hdc, x1 - 1, (y1 + y2) / 2 - 1, x1 + 2, (y1 + y2) / 2 + 2);
Rectangle(hdc, x2-2, (y1+y2)/2-1, x2+1, (y1+y2)/2+2); Rectangle(hdc, x2 - 2, (y1 + y2) / 2 - 1, x2 + 1, (y1 + y2) / 2 + 2);
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: drawing.h * FILE: base/applications/paint/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: globalvar.h * FILE: base/applications/paint/globalvar.h
* PURPOSE: Declaring global variables for later initialization * PURPOSE: Declaring global variables for later initialization
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -45,13 +45,16 @@ extern HWND hImageArea;
extern HBITMAP hSelBm; extern HBITMAP hSelBm;
extern int palColors[28]; extern int palColors[28];
extern int fgColor; extern int fgColor;
extern int bgColor; extern int bgColor;
extern HWND hStatusBar; extern HWND hStatusBar;
extern HWND hScrollbox; extern HWND hScrollbox;
extern HWND hMainWnd; extern HWND hMainWnd;
extern HWND hPalWin; extern HWND hPalWin;
extern HWND hToolSettings; extern HWND hToolSettings;
extern HWND hTrackbarZoom;
extern CHOOSECOLOR choosecolor; extern CHOOSECOLOR choosecolor;
extern OPENFILENAME ofn; extern OPENFILENAME ofn;
extern OPENFILENAME sfn; extern OPENFILENAME sfn;
@ -92,9 +95,7 @@ extern HWND hSizeboxLeftBottom;
extern HWND hSizeboxCenterBottom; extern HWND hSizeboxCenterBottom;
extern HWND hSizeboxRightBottom; extern HWND hSizeboxRightBottom;
extern HWND hTrackbarZoom; /* VARIABLES declared in mouse.c ************************************/
/* VARIABLES declared in mouse.c *************************************/
extern POINT pointStack[256]; extern POINT pointStack[256];
extern short pointSP; extern short pointSP;

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: history.c * FILE: base/applications/paint/history.c
* PURPOSE: Undo and redo functionality * PURPOSE: Undo and redo functionality
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -17,9 +17,10 @@
extern void updateCanvasAndScrollbars(void); extern void updateCanvasAndScrollbars(void);
void setImgXYRes(int x, int y) void
setImgXYRes(int x, int y)
{ {
if ((imgXRes!=x)||(imgYRes!=y)) if ((imgXRes != x) || (imgYRes != y))
{ {
imgXRes = x; imgXRes = x;
imgYRes = y; imgYRes = y;
@ -27,12 +28,14 @@ void setImgXYRes(int x, int y)
} }
} }
void newReversible() void
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] = CopyImage(hBms[currInd], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);
currInd = (currInd+1)%HISTORYSIZE; currInd = (currInd + 1) % HISTORYSIZE;
if (undoSteps<HISTORYSIZE-1) undoSteps++; if (undoSteps < HISTORYSIZE - 1)
undoSteps++;
redoSteps = 0; redoSteps = 0;
SelectObject(hDrawingDC, hBms[currInd]); SelectObject(hDrawingDC, hBms[currInd]);
imgXRes = GetDIBWidth(hBms[currInd]); imgXRes = GetDIBWidth(hBms[currInd]);
@ -40,74 +43,85 @@ void newReversible()
imageSaved = FALSE; imageSaved = FALSE;
} }
void undo() void
undo()
{ {
if (undoSteps>0) if (undoSteps > 0)
{ {
ShowWindow(hSelection, SW_HIDE); ShowWindow(hSelection, SW_HIDE);
currInd = (currInd+HISTORYSIZE-1)%HISTORYSIZE; currInd = (currInd + HISTORYSIZE - 1) % HISTORYSIZE;
SelectObject(hDrawingDC, hBms[currInd]); SelectObject(hDrawingDC, hBms[currInd]);
undoSteps--; undoSteps--;
if (redoSteps<HISTORYSIZE-1) redoSteps++; if (redoSteps < HISTORYSIZE - 1)
redoSteps++;
setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd])); setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd]));
} }
} }
void redo() void
redo()
{ {
if (redoSteps>0) if (redoSteps > 0)
{ {
ShowWindow(hSelection, SW_HIDE); ShowWindow(hSelection, SW_HIDE);
currInd = (currInd+1)%HISTORYSIZE; currInd = (currInd + 1) % HISTORYSIZE;
SelectObject(hDrawingDC, hBms[currInd]); SelectObject(hDrawingDC, hBms[currInd]);
redoSteps--; redoSteps--;
if (undoSteps<HISTORYSIZE-1) undoSteps++; if (undoSteps < HISTORYSIZE - 1)
undoSteps++;
setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd])); setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd]));
} }
} }
void resetToU1() void
resetToU1()
{ {
DeleteObject(hBms[currInd]); DeleteObject(hBms[currInd]);
hBms[currInd] = CopyImage( hBms[(currInd+HISTORYSIZE-1)%HISTORYSIZE], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG); hBms[currInd] =
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]);
} }
void clearHistory() void
clearHistory()
{ {
undoSteps = 0; undoSteps = 0;
redoSteps = 0; redoSteps = 0;
} }
void insertReversible(HBITMAP hbm) void
insertReversible(HBITMAP hbm)
{ {
DeleteObject(hBms[(currInd+1)%HISTORYSIZE]); DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]);
hBms[(currInd+1)%HISTORYSIZE] = hbm; hBms[(currInd + 1) % HISTORYSIZE] = hbm;
currInd = (currInd+1)%HISTORYSIZE; currInd = (currInd + 1) % HISTORYSIZE;
if (undoSteps<HISTORYSIZE-1) undoSteps++; if (undoSteps < HISTORYSIZE - 1)
undoSteps++;
redoSteps = 0; redoSteps = 0;
SelectObject(hDrawingDC, hBms[currInd]); SelectObject(hDrawingDC, hBms[currInd]);
setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd])); setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd]));
} }
void cropReversible(int width, int height, int xOffset, int yOffset) void
cropReversible(int width, int height, int xOffset, int yOffset)
{ {
HDC hdc; HDC hdc;
HPEN oldPen; HPEN oldPen;
HBRUSH oldBrush; HBRUSH oldBrush;
SelectObject(hDrawingDC, hBms[currInd]); SelectObject(hDrawingDC, hBms[currInd]);
DeleteObject(hBms[(currInd+1)%HISTORYSIZE]); DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]);
hBms[(currInd+1)%HISTORYSIZE] = CreateDIBWithProperties(width, height); hBms[(currInd + 1) % HISTORYSIZE] = CreateDIBWithProperties(width, height);
currInd = (currInd+1)%HISTORYSIZE; currInd = (currInd + 1) % HISTORYSIZE;
if (undoSteps<HISTORYSIZE-1) undoSteps++; if (undoSteps < HISTORYSIZE - 1)
undoSteps++;
redoSteps = 0; redoSteps = 0;
hdc = CreateCompatibleDC(hDrawingDC); hdc = CreateCompatibleDC(hDrawingDC);
SelectObject(hdc, hBms[currInd]); SelectObject(hdc, hBms[currInd]);
oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, bgColor)); oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, bgColor));
oldBrush = SelectObject(hdc, CreateSolidBrush(bgColor)); oldBrush = SelectObject(hdc, CreateSolidBrush(bgColor));
Rectangle(hdc, 0, 0, width, height); Rectangle(hdc, 0, 0, width, height);
@ -116,6 +130,6 @@ void cropReversible(int width, int height, int xOffset, int yOffset)
DeleteObject(SelectObject(hdc, oldPen)); DeleteObject(SelectObject(hdc, oldPen));
DeleteDC(hdc); DeleteDC(hdc);
SelectObject(hDrawingDC, hBms[currInd]); SelectObject(hDrawingDC, hBms[currInd]);
setImgXYRes(width, height); setImgXYRes(width, height);
} }

View file

@ -1,6 +1,9 @@
/* /*
* Bulgarian Language resource file * PROJECT: PAINT for ReactOS
* Translated by: * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/bg-BG.rc
* PURPOSE: Bulgarian Language resource file
* TRANSLATORS: unknown
*/ */
LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
@ -138,9 +141,9 @@ BEGIN
LTEXT "Äàòà íà ôàéëà:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Äàòà íà ôàéëà:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Ôàéëîâ ðàçìåð:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Ôàéëîâ ðàçìåð:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Ðàçäåëèòåëíà:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Ðàçäåëèòåëíà:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Íåíàëè÷íî", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Åäèíèöè", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Åäèíèöè", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Öîëîâå", IDD_ATTRIBUTESRB1, 12, 69, 40, 10, WS_GROUP AUTORADIOBUTTON "Öîëîâå", IDD_ATTRIBUTESRB1, 12, 69, 40, 10, WS_GROUP
AUTORADIOBUTTON "ñì", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "ñì", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* FILE: ??rospaint??/lang/cs-CZ.rc /*
* TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com) * PROJECT: PAINT for ReactOS
* UPDATED: 2009-04-28 * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/cs-CZ.rc
* PURPOSE: Czech Language resource file
* TRANSLATORS: Radek Liska aka Black_Fox (radekliska at gmail dot com)
*/ */
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
@ -137,9 +140,9 @@ BEGIN
LTEXT "Datum zmìny:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Datum zmìny:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Velikost souboru:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Velikost souboru:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Rozlišení:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Rozlišení:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Jednotka", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Jednotka", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Palce", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "Palce", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "Centimetry", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "Centimetry", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* German Language resource file / Deutsche Sprachresourcendatei * PROJECT: PAINT for ReactOS
* Program's initial language / anfängliche Programmsprache, Benedikt Freisen * LICENSE: LGPL
* FILE: base/applications/paint/lang/de-DE.rc
* PURPOSE: German Language resource file (reference language file)
* TRANSLATORS: Benedikt Freisen
*/ */
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN LANGUAGE LANG_GERMAN, SUBLANG_GERMAN

View file

@ -1,6 +1,9 @@
/* /*
* British English language resource file * PROJECT: PAINT for ReactOS
* Translated by: Benedikt Freisen * LICENSE: LGPL
* FILE: base/applications/paint/lang/en-GB.rc
* PURPOSE: British English Language resource file
* TRANSLATORS: Benedikt Freisen
*/ */
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
@ -138,9 +141,9 @@ BEGIN
LTEXT "File date:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "File date:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "File size:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "File size:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Resolution:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Resolution:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Unit", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Unit", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Inch", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "Inch", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* US-English Language resource file * PROJECT: PAINT for ReactOS
* Translated by: first times touched from en-GB.rc file by Mario Kacmar * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/en-US.rc
* PURPOSE: US-English Language resource file
* TRANSLATORS: first times touched from en-GB.rc file by Mario Kacmar
*/ */
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
@ -138,9 +141,9 @@ BEGIN
LTEXT "File date:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "File date:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "File size:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "File size:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Resolution:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Resolution:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Units", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Units", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Inches", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "Inches", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* Spanish Language resource file * PROJECT: PAINT for ReactOS
* Traducido por: Gabriel Ilardi febrero 2009 * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/es-ES.rc
* PURPOSE: Spanish Language resource file
* TRANSLATORS: Gabriel Ilardi
*/ */
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
@ -138,9 +141,9 @@ BEGIN
LTEXT "Fecha modificación:", IDD_ATTRIBUTESTEXT3, 10, 5, 80, 10 LTEXT "Fecha modificación:", IDD_ATTRIBUTESTEXT3, 10, 5, 80, 10
LTEXT "Espacio en disco:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Espacio en disco:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Resolución:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Resolución:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "No disponible", IDD_ATTRIBUTESTEXT6, 73, 5, 60, 10 LTEXT "No disponible", IDD_ATTRIBUTESTEXT6, 73, 5, 80, 10
LTEXT "No disponible", IDD_ATTRIBUTESTEXT7, 73, 15, 60, 10 LTEXT "No disponible", IDD_ATTRIBUTESTEXT7, 73, 15, 80, 10
LTEXT "No disponible", IDD_ATTRIBUTESTEXT8, 73, 25, 60, 10 LTEXT "No disponible", IDD_ATTRIBUTESTEXT8, 73, 25, 80, 10
GROUPBOX "Unidades ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Unidades ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Pulgadas", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "Pulgadas", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 60, 69, 35, 10 AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 60, 69, 35, 10

View file

@ -1,4 +1,10 @@
/* Basque language resource file */ /*
* PROJECT: PAINT for ReactOS
* LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/eu-ES.rc
* PURPOSE: Basque Language resource file
* TRANSLATORS: unknown
*/
LANGUAGE LANG_BASQUE, SUBLANG_DEFAULT LANGUAGE LANG_BASQUE, SUBLANG_DEFAULT
@ -135,9 +141,9 @@ BEGIN
LTEXT "Azken gordetze-data:", IDD_ATTRIBUTESTEXT3, 10, 5, 80, 10 LTEXT "Azken gordetze-data:", IDD_ATTRIBUTESTEXT3, 10, 5, 80, 10
LTEXT "Diskoko tamaina:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Diskoko tamaina:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Bereizmena:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Bereizmena:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT6, 80, 5, 60, 10 LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT6, 80, 5, 70, 10
LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT7, 80, 15, 60, 10 LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT7, 80, 15, 70, 10
LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT8, 80, 25, 60, 10 LTEXT "Ez dago erabilgarri", IDD_ATTRIBUTESTEXT8, 80, 25, 70, 10
GROUPBOX "Unitateak ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Unitateak ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Hazbetea", IDD_ATTRIBUTESRB1, 12, 69, 42, 10, WS_GROUP AUTORADIOBUTTON "Hazbetea", IDD_ATTRIBUTESRB1, 12, 69, 42, 10, WS_GROUP
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 60, 69, 30, 10 AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 60, 69, 30, 10

View file

@ -1,6 +1,9 @@
/* /*
* FR-French Language resource file * PROJECT: PAINT for ReactOS
* Translated by: * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/fr-FR.rc
* PURPOSE: FR-French Language resource file
* TRANSLATORS: unknown
*/ */
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
@ -137,9 +140,9 @@ BEGIN
LTEXT "Dernier enregistrement du fichier :", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Dernier enregistrement du fichier :", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Taille sur le disque :", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Taille sur le disque :", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Résolution :", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Résolution :", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Non disponible", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Non disponible", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Non disponible", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Non disponible", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Non disponible", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Non disponible", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Unités", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Unités", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Pouces", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "Pouces", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "Cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "Cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* Italian Language resource file * PROJECT: PAINT for ReactOS
* Tradotto da: gabriel ilardi, febbraio 2009 * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/it-IT.rc
* PURPOSE: Italian Language resource file
* TRANSLATORS: gabriel ilardi
*/ */
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
@ -137,9 +140,9 @@ BEGIN
LTEXT "Ultimo salvataggio:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Ultimo salvataggio:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Dimensioni su disco:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Dimensioni su disco:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Risoluzione:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Risoluzione:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Non disponibile", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Unità di misura", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Unità di misura", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Pollici", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "Pollici", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "Cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "Cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* Japanese Language resource file * PROJECT: PAINT for ReactOS
* Translated by: pcds90net, Tomoya Kitagawa * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/ja-JP.rc
* PURPOSE: Japanese Language resource file
* TRANSLATORS: pcds90net, Tomoya Kitagawa
*/ */
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
@ -138,9 +141,9 @@ BEGIN
LTEXT "ファイルの日付:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "ファイルの日付:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "ファイルのサイズ:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "ファイルのサイズ:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "解像度:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "解像度:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "—˜—p•s‰Â”\\", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "単位", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "単位", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "インチ", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "インチ", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* Dutch Language resource file * PROJECT: PAINT for ReactOS
* Translated by: Wouter De Vlieger * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/nl-NL.rc
* PURPOSE: Dutch Language resource file
* TRANSLATORS: Wouter De Vlieger
*/ */
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
@ -137,9 +140,9 @@ BEGIN
LTEXT "Datum laatst gewijzigd:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Datum laatst gewijzigd:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Bestandsgrootte:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Bestandsgrootte:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Resolutie:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Resolutie:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Niet beschikbaar", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Eenheden", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Eenheden", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Inch", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "Inch", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* NO-Norwegian Language resource file * PROJECT: PAINT for ReactOS
* Translated by: first times touched from no-NO.rc file by Lars Martin Hambro * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/no-NO.rc
* PURPOSE: NO-Norwegian Language resource file
* TRANSLATORS: first times touched from no-NO.rc file by Lars Martin Hambro
*/ */
LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
@ -137,9 +140,9 @@ BEGIN
LTEXT "Fildato:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Fildato:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Filstørrelse:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Filstørrelse:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Oppløsning:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Oppløsning:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Ikke tilgjengelig", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Enheter", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Enheter", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Tommer", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "Tommer", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "Centimeter", IDD_ATTRIBUTESRB2, 52, 69, 55, 10 AUTORADIOBUTTON "Centimeter", IDD_ATTRIBUTESRB2, 52, 69, 55, 10

View file

@ -1,11 +1,11 @@
/* /*
* translated by Caemyr - Olaf Siejka (May,2009) * PROJECT: PAINT for ReactOS
* Use ReactOS forum PM or IRC to contact me * LICENSE: unknown (LGPL assumed)
* http://www.reactos.org * FILE: base/applications/paint/lang/pl-PL.rc
* IRC: irc.freenode.net #reactos-pl; * PURPOSE: Polish Language resource file
* TRANSLATORS: Caemyr - Olaf Siejka (May,2009), Use ReactOS forum PM or IRC to contact me
*/ */
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
ID_MENU MENU ID_MENU MENU
@ -140,9 +140,9 @@ BEGIN
LTEXT "Data:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Data:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Rozmiar:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Rozmiar:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "RozdzielczoϾ:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "RozdzielczoϾ:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Niedostêpny", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Jednostki", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Jednostki", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "Cale", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "Cale", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* Portuguese Brazilian Language resource file * PROJECT: PAINT for ReactOS
* Translated by: Wagner Leandro Bueno Angelo * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/pt-BR.rc
* PURPOSE: Portuguese Brazilian Language resource file
* TRANSLATORS: Wagner Leandro Bueno Angelo
*/ */
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
@ -137,9 +140,9 @@ BEGIN
LTEXT "Data do arquivo:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Data do arquivo:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Tamanho do arquivo:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Tamanho do arquivo:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Resolução:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Resolução:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "não disponível", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "não disponível", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "não disponível", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "não disponível", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "não disponível", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "não disponível", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Unidades", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Unidades", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "P&olegadas", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "P&olegadas", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "c&m", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "c&m", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* Portuguese Language resource file * PROJECT: PAINT for ReactOS
* Translated by: Manuel D V Silva * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/pt-PT.rc
* PURPOSE: Portuguese Language resource file
* TRANSLATORS: Manuel D V Silva
*/ */
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
@ -137,9 +140,9 @@ BEGIN
LTEXT "Data do arquivo:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Data do arquivo:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Tamanho do arquivo:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Tamanho do arquivo:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Resolução:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Resolução:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "não disponível", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "não disponível", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "não disponível", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "não disponível", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "não disponível", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "não disponível", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Unidades", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Unidades", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "P&olegadas", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "P&olegadas", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "c&m", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "c&m", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,6 +1,9 @@
/* /*
* Romanian Language resource file * PROJECT: PAINT for ReactOS
* Translated by: Petru Dimitriu * LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/ro-RO.rc
* PURPOSE: Romanian Language resource file
* TRANSLATORS: Petru Dimitriu
*/ */
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
@ -140,9 +143,9 @@ BEGIN
LTEXT "Dată:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Dată:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Mărime:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Mărime:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Rezoluție:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Rezoluție:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Indisponibil", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Unitate", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Unitate", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "țoli", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "țoli", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,3 +1,11 @@
/*
* PROJECT: PAINT for ReactOS
* LICENSE: unknown (LGPL assumed)
* FILE: base/applications/paint/lang/ru-RU.rc
* PURPOSE: Russian Language resource file
* TRANSLATORS: unknown
*/
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
ID_MENU MENU ID_MENU MENU
@ -132,9 +140,9 @@ BEGIN
LTEXT "Äàòà ñîõðàíåíèÿ:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Äàòà ñîõðàíåíèÿ:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Ðàçìåð íà äèñêå:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Ðàçìåð íà äèñêå:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Ðàçðåøåíèå:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Ðàçðåøåíèå:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "не доступно", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "íå äîñòóïíî", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "не доступно", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "íå äîñòóïíî", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "не доступно", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "íå äîñòóïíî", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Åäèíèöû èçìåðåíèÿ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Åäèíèöû èçìåðåíèÿ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "ä&þéìû", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "ä&þéìû", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "ñ&ì", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "ñ&ì", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,7 +1,9 @@
/* /*
* Slovak Language resource file * PROJECT: PAINT for ReactOS
* Translated by: Mário Kačmár /Mario Kacmar/ aka Kario (kario@szm.sk) * LICENSE: unknown (LGPL assumed)
* Last changed: 02-07-2009 * FILE: base/applications/paint/lang/sk-SK.rc
* PURPOSE: Slovak Language resource file
* TRANSLATORS: Mário Kačmár /Mario Kacmar/ aka Kario (kario@szm.sk)
*/ */
LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT
@ -139,9 +141,9 @@ BEGIN
LTEXT "Dátum zmeny:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 //File date LTEXT "Dátum zmeny:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 //File date
LTEXT "Ve¾kos<6F> súboru:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 //File size LTEXT "Ve¾kos<6F> súboru:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 //File size
LTEXT "Rozlíšenie:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Rozlíšenie:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Nie je k dispozícii", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Jednotky", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Jednotky", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "palce", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "palce", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,9 +1,9 @@
/* /*
* PROJECT: Paint for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: base/applications/devmgmt/lang/uk-UA.rc * FILE: base/applications/paint/lang/uk-UA.rc
* PURPOSE: Ukraianian Language File for Paint * PURPOSE: Ukraianian Language File for Paint
* TRANSLATOR: Artem Reznikov, Sakara Yevhen * TRANSLATORS: Artem Reznikov, Sakara Yevhen
*/ */
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
@ -140,9 +140,9 @@ BEGIN
LTEXT "Äàòà ôàéëà:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Äàòà ôàéëà:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10
LTEXT "Ðîçì³ð ôàéëà:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Ðîçì³ð ôàéëà:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10
LTEXT "Ðîçä³ëüíà çäàòí³ñòü:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 LTEXT "Ðîçä³ëüíà çäàòí³ñòü:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 70, 5, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 70, 15, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10
LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 70, 25, 60, 10 LTEXT "Not available", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10
GROUPBOX "Îäèíèö³ âèì³ðþâàííÿ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27 GROUPBOX "Îäèíèö³ âèì³ðþâàííÿ", IDD_ATTRIBUTESGROUP1, 6, 57, 139, 27
AUTORADIOBUTTON "äþéìè", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP AUTORADIOBUTTON "äþéìè", IDD_ATTRIBUTESRB1, 12, 69, 35, 10, WS_GROUP
AUTORADIOBUTTON "ñì", IDD_ATTRIBUTESRB2, 52, 69, 35, 10 AUTORADIOBUTTON "ñì", IDD_ATTRIBUTESRB2, 52, 69, 35, 10

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: main.c * FILE: base/applications/paint/main.c
* PURPOSE: Initializing everything * PURPOSE: Initializing everything
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -43,8 +43,6 @@ int undoSteps = 0;
int redoSteps = 0; int redoSteps = 0;
BOOL imageSaved = TRUE; BOOL imageSaved = TRUE;
// global status variables
short startX; short startX;
short startY; short startY;
short lastX; short lastX;
@ -63,25 +61,23 @@ HWND hSelection;
HWND hImageArea; HWND hImageArea;
HBITMAP hSelBm; HBITMAP hSelBm;
/* initial palette colors; may be changed by the user during execution */
// global declarations and WinMain int palColors[28] = { 0x000000, 0x464646, 0x787878, 0x300099, 0x241ced, 0x0078ff, 0x0ec2ff,
// initial palette colors; may be changed by the user during execution
int palColors[28] =
{0x000000, 0x464646, 0x787878, 0x300099, 0x241ced, 0x0078ff, 0x0ec2ff,
0x00f2ff, 0x1de6a8, 0x4cb122, 0xefb700, 0xf36d4d, 0x99362f, 0x98316f, 0x00f2ff, 0x1de6a8, 0x4cb122, 0xefb700, 0xf36d4d, 0x99362f, 0x98316f,
0xffffff, 0xdcdcdc, 0xb4b4b4, 0x3c5a9c, 0xb1a3ff, 0x7aaae5, 0x9ce4f5, 0xffffff, 0xdcdcdc, 0xb4b4b4, 0x3c5a9c, 0xb1a3ff, 0x7aaae5, 0x9ce4f5,
0xbdf9ff, 0xbcf9d3, 0x61bb9d, 0xead999, 0xd19a70, 0x8e6d54, 0xd5a5b5}; 0xbdf9ff, 0xbcf9d3, 0x61bb9d, 0xead999, 0xd19a70, 0x8e6d54, 0xd5a5b5
// foreground and background colors with initial value };
/* foreground and background colors with initial value */
int fgColor = 0x00000000; int fgColor = 0x00000000;
int bgColor = 0x00ffffff; int bgColor = 0x00ffffff;
// the current zoom in percent*10
HWND hStatusBar; HWND hStatusBar;
HWND hScrollbox; HWND hScrollbox;
HWND hMainWnd; HWND hMainWnd;
HWND hPalWin; HWND hPalWin;
HWND hToolSettings; HWND hToolSettings;
HWND hTrackbarZoom;
CHOOSECOLOR choosecolor; CHOOSECOLOR choosecolor;
OPENFILENAME ofn; OPENFILENAME ofn;
OPENFILENAME sfn; OPENFILENAME sfn;
@ -122,17 +118,20 @@ HWND hSizeboxLeftBottom;
HWND hSizeboxCenterBottom; HWND hSizeboxCenterBottom;
HWND hSizeboxRightBottom; HWND hSizeboxRightBottom;
HWND hTrackbarZoom; /* entry point */
int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument, int nFunsterStil) int WINAPI
_tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument, int nFunsterStil)
{ {
HWND hwnd; /* This is the handle for our window */ HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */ MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wclScroll; WNDCLASSEX wclScroll;
WNDCLASSEX wincl; WNDCLASSEX wincl;
WNDCLASSEX wclPal; WNDCLASSEX wclPal;
WNDCLASSEX wclSettings; WNDCLASSEX wclSettings;
WNDCLASSEX wclSelection; WNDCLASSEX wclSelection;
TCHAR progtitle[1000]; TCHAR progtitle[1000];
TCHAR resstr[100]; TCHAR resstr[100];
HMENU menu; HMENU menu;
@ -142,6 +141,7 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
HBITMAP tempBm; HBITMAP tempBm;
int i; int i;
TCHAR tooltips[16][30]; TCHAR tooltips[16][30];
TCHAR *c; TCHAR *c;
TCHAR sfnFilename[1000]; TCHAR sfnFilename[1000];
TCHAR sfnFiletitle[256]; TCHAR sfnFiletitle[256];
@ -150,9 +150,9 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
TCHAR ofnFiletitle[256]; TCHAR ofnFiletitle[256];
TCHAR ofnFilter[1000]; TCHAR ofnFilter[1000];
TCHAR miniaturetitle[100]; TCHAR miniaturetitle[100];
int custColors[16] = int custColors[16] = { 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
{0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff}; };
hProgInstance = hThisInstance; hProgInstance = hThisInstance;
@ -164,10 +164,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
wincl.lpszClassName = _T("WindowsApp"); wincl.lpszClassName = _T("WindowsApp");
wincl.lpfnWndProc = WindowProcedure; wincl.lpfnWndProc = WindowProcedure;
wincl.style = CS_DBLCLKS; wincl.style = CS_DBLCLKS;
wincl.cbSize = sizeof (WNDCLASSEX); wincl.cbSize = sizeof(WNDCLASSEX);
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION); wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (hThisInstance, MAKEINTRESOURCE(500)); wincl.hIconSm = LoadIcon(hThisInstance, MAKEINTRESOURCE(500));
wincl.hCursor = LoadCursor (NULL, IDC_ARROW); wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0; wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0; wincl.cbWndExtra = 0;
@ -179,10 +179,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
wclScroll.lpszClassName = _T("Scrollbox"); wclScroll.lpszClassName = _T("Scrollbox");
wclScroll.lpfnWndProc = WindowProcedure; wclScroll.lpfnWndProc = WindowProcedure;
wclScroll.style = 0; wclScroll.style = 0;
wclScroll.cbSize = sizeof (WNDCLASSEX); wclScroll.cbSize = sizeof(WNDCLASSEX);
wclScroll.hIcon = NULL; wclScroll.hIcon = NULL;
wclScroll.hIconSm = NULL; wclScroll.hIconSm = NULL;
wclScroll.hCursor = LoadCursor (NULL, IDC_ARROW); wclScroll.hCursor = LoadCursor(NULL, IDC_ARROW);
wclScroll.lpszMenuName = NULL; wclScroll.lpszMenuName = NULL;
wclScroll.cbClsExtra = 0; wclScroll.cbClsExtra = 0;
wclScroll.cbWndExtra = 0; wclScroll.cbWndExtra = 0;
@ -194,10 +194,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
wclPal.lpszClassName = _T("Palette"); wclPal.lpszClassName = _T("Palette");
wclPal.lpfnWndProc = PalWinProc; wclPal.lpfnWndProc = PalWinProc;
wclPal.style = CS_DBLCLKS; wclPal.style = CS_DBLCLKS;
wclPal.cbSize = sizeof (WNDCLASSEX); wclPal.cbSize = sizeof(WNDCLASSEX);
wclPal.hIcon = NULL; wclPal.hIcon = NULL;
wclPal.hIconSm = NULL; wclPal.hIconSm = NULL;
wclPal.hCursor = LoadCursor (NULL, IDC_ARROW); wclPal.hCursor = LoadCursor(NULL, IDC_ARROW);
wclPal.lpszMenuName = NULL; wclPal.lpszMenuName = NULL;
wclPal.cbClsExtra = 0; wclPal.cbClsExtra = 0;
wclPal.cbWndExtra = 0; wclPal.cbWndExtra = 0;
@ -209,10 +209,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
wclSettings.lpszClassName = _T("ToolSettings"); wclSettings.lpszClassName = _T("ToolSettings");
wclSettings.lpfnWndProc = SettingsWinProc; wclSettings.lpfnWndProc = SettingsWinProc;
wclSettings.style = CS_DBLCLKS; wclSettings.style = CS_DBLCLKS;
wclSettings.cbSize = sizeof (WNDCLASSEX); wclSettings.cbSize = sizeof(WNDCLASSEX);
wclSettings.hIcon = NULL; wclSettings.hIcon = NULL;
wclSettings.hIconSm = NULL; wclSettings.hIconSm = NULL;
wclSettings.hCursor = LoadCursor (NULL, IDC_ARROW); wclSettings.hCursor = LoadCursor(NULL, IDC_ARROW);
wclSettings.lpszMenuName = NULL; wclSettings.lpszMenuName = NULL;
wclSettings.cbClsExtra = 0; wclSettings.cbClsExtra = 0;
wclSettings.cbWndExtra = 0; wclSettings.cbWndExtra = 0;
@ -224,14 +224,14 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
wclSelection.lpszClassName = _T("Selection"); wclSelection.lpszClassName = _T("Selection");
wclSelection.lpfnWndProc = SelectionWinProc; wclSelection.lpfnWndProc = SelectionWinProc;
wclSelection.style = CS_DBLCLKS; wclSelection.style = CS_DBLCLKS;
wclSelection.cbSize = sizeof (WNDCLASSEX); wclSelection.cbSize = sizeof(WNDCLASSEX);
wclSelection.hIcon = NULL; wclSelection.hIcon = NULL;
wclSelection.hIconSm = NULL; wclSelection.hIconSm = NULL;
wclSelection.hCursor = LoadCursor (NULL, IDC_SIZEALL); wclSelection.hCursor = LoadCursor(NULL, IDC_SIZEALL);
wclSelection.lpszMenuName = NULL; wclSelection.lpszMenuName = NULL;
wclSelection.cbClsExtra = 0; wclSelection.cbClsExtra = 0;
wclSelection.cbWndExtra = 0; wclSelection.cbWndExtra = 0;
wclSelection.hbrBackground = NULL;//GetSysColorBrush(COLOR_BTNFACE); wclSelection.hbrBackground = NULL;
RegisterClassEx (&wclSelection); RegisterClassEx (&wclSelection);
/* initializing and registering the window class for the size boxes */ /* initializing and registering the window class for the size boxes */
@ -239,10 +239,10 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
wclSettings.lpszClassName = _T("Sizebox"); wclSettings.lpszClassName = _T("Sizebox");
wclSettings.lpfnWndProc = SizeboxWinProc; wclSettings.lpfnWndProc = SizeboxWinProc;
wclSettings.style = CS_DBLCLKS; wclSettings.style = CS_DBLCLKS;
wclSettings.cbSize = sizeof (WNDCLASSEX); wclSettings.cbSize = sizeof(WNDCLASSEX);
wclSettings.hIcon = NULL; wclSettings.hIcon = NULL;
wclSettings.hIconSm = NULL; wclSettings.hIconSm = NULL;
wclSettings.hCursor = LoadCursor (NULL, IDC_ARROW); wclSettings.hCursor = LoadCursor(NULL, IDC_ARROW);
wclSettings.lpszMenuName = NULL; wclSettings.lpszMenuName = NULL;
wclSettings.cbClsExtra = 0; wclSettings.cbClsExtra = 0;
wclSettings.cbWndExtra = 0; wclSettings.cbWndExtra = 0;
@ -255,10 +255,15 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
LoadString(hThisInstance, IDS_MINIATURETITLE, miniaturetitle, SIZEOF(miniaturetitle)); LoadString(hThisInstance, IDS_MINIATURETITLE, miniaturetitle, SIZEOF(miniaturetitle));
/* create main window */ /* create main window */
hwnd = CreateWindowEx (0, _T("WindowsApp"), progtitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 544, 375, HWND_DESKTOP, NULL, hThisInstance, NULL); hwnd =
CreateWindowEx(0, _T("WindowsApp"), progtitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 544,
375, HWND_DESKTOP, NULL, hThisInstance, NULL);
hMainWnd = hwnd; hMainWnd = hwnd;
hwndMiniature = CreateWindowEx(WS_EX_PALETTEWINDOW, _T("WindowsApp"), miniaturetitle, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, 180, 200, 120, 100, hwnd, NULL, hThisInstance, NULL);
hwndMiniature =
CreateWindowEx(WS_EX_PALETTEWINDOW, _T("WindowsApp"), miniaturetitle,
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, 180, 200, 120, 100, hwnd,
NULL, hThisInstance, NULL);
/* loading and setting the window menu from resource */ /* loading and setting the window menu from resource */
menu = LoadMenu(hThisInstance, MAKEINTRESOURCE(ID_MENU)); menu = LoadMenu(hThisInstance, MAKEINTRESOURCE(ID_MENU));
@ -266,94 +271,121 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
haccel = LoadAccelerators(hThisInstance, MAKEINTRESOURCE(800)); haccel = LoadAccelerators(hThisInstance, MAKEINTRESOURCE(800));
/* preloading the draw transparent/nontransparent icons for later use */ /* preloading the draw transparent/nontransparent icons for later use */
hNontranspIcon = LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_NONTRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR); hNontranspIcon =
hTranspIcon = LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_TRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR); LoadImage(hThisInstance, MAKEINTRESOURCE(IDI_NONTRANSPARENT), IMAGE_ICON, 40, 30, LR_DEFAULTCOLOR);
hTranspIcon =
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));
hCurZoom = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_ZOOM)); hCurZoom = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_ZOOM));
hCurPen = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_PEN)); hCurPen = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_PEN));
hCurAirbrush = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_AIRBRUSH)); hCurAirbrush = LoadIcon(hThisInstance, MAKEINTRESOURCE(IDC_AIRBRUSH));
CreateWindowEx (0, _T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL, hThisInstance, NULL); CreateWindowEx(0, _T("STATIC"), _T(""), WS_CHILD | WS_VISIBLE | SS_ETCHEDHORZ, 0, 0, 5000, 2, hwnd, NULL,
hThisInstance, NULL);
/* creating the 16 bitmap radio buttons and setting the bitmap */ /* creating the 16 bitmap radio buttons and setting the bitmap */
/* FIXME: Unintentionally there is a line above the tool bar. To prevent cropping of the buttons height has been increased from 200 to 205 */ /*
hToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_VERT | CCS_NORESIZE | TBSTYLE_TOOLTIPS, 3, 3, 50, 205, hwnd, NULL, hThisInstance, NULL); * FIXME: Unintentionally there is a line above the tool bar.
* To prevent cropping of the buttons height has been increased from 200 to 205
*/
hToolbar =
CreateWindowEx(0, TOOLBARCLASSNAME, NULL,
WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_VERT | CCS_NORESIZE | TBSTYLE_TOOLTIPS,
3, 3, 50, 205, hwnd, 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 = 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);
for (i=0; i<16; i++)
for(i = 0; i < 16; i++)
{ {
TBBUTTON tbbutton; TBBUTTON tbbutton;
int wrapnow = 0; int wrapnow = 0;
if (i % 2 == 1) wrapnow = TBSTATE_WRAP; if (i % 2 == 1)
wrapnow = TBSTATE_WRAP;
LoadString(hThisInstance, IDS_TOOLTIP1 + i, tooltips[i], 30); LoadString(hThisInstance, IDS_TOOLTIP1 + i, tooltips[i], 30);
ZeroMemory(&tbbutton, sizeof(TBBUTTON)); ZeroMemory(&tbbutton, sizeof(TBBUTTON));
tbbutton.iString = (INT_PTR)tooltips[i]; tbbutton.iString = (INT_PTR) tooltips[i];
tbbutton.fsStyle = TBSTYLE_CHECKGROUP; tbbutton.fsStyle = TBSTYLE_CHECKGROUP;
tbbutton.fsState = TBSTATE_ENABLED | wrapnow; tbbutton.fsState = TBSTATE_ENABLED | wrapnow;
tbbutton.idCommand = ID_FREESEL + i; tbbutton.idCommand = ID_FREESEL + i;
tbbutton.iBitmap = i; tbbutton.iBitmap = i;
SendMessage(hToolbar, TB_ADDBUTTONS, 1, (LPARAM)&tbbutton); SendMessage(hToolbar, TB_ADDBUTTONS, 1, (LPARAM) &tbbutton);
} }
/* SendMessage(hToolbar, TB_SETROWS, MAKEWPARAM(8, FALSE), (LPARAM)NULL); */
SendMessage(hToolbar, TB_CHECKBUTTON, ID_PEN, MAKELONG(TRUE, 0)); SendMessage(hToolbar, TB_CHECKBUTTON, ID_PEN, MAKELONG(TRUE, 0));
SendMessage(hToolbar, TB_SETMAXTEXTROWS, 0, 0); SendMessage(hToolbar, TB_SETMAXTEXTROWS, 0, 0);
SendMessage(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(25, 25)); SendMessage(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(25, 25));
/* SendMessage(hToolbar, TB_AUTOSIZE, 0, 0); */
/* creating the tool settings child window */ /* creating the tool settings child window */
hToolSettings = CreateWindowEx(0, _T("ToolSettings"), _T(""), WS_CHILD | WS_VISIBLE, 7, 210, 42, 140, hwnd, NULL, hThisInstance, NULL); hToolSettings =
hTrackbarZoom = CreateWindowEx(0, TRACKBAR_CLASS, _T(""), WS_CHILD | TBS_VERT | TBS_AUTOTICKS, 1, 1, 40, 64, hToolSettings, NULL, hThisInstance, NULL); CreateWindowEx(0, _T("ToolSettings"), _T(""), WS_CHILD | WS_VISIBLE, 7, 210, 42, 140, hwnd, NULL,
SendMessage(hTrackbarZoom, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 6)); hThisInstance, NULL);
SendMessage(hTrackbarZoom, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)3); hTrackbarZoom =
CreateWindowEx(0, TRACKBAR_CLASS, _T(""), WS_CHILD | TBS_VERT | TBS_AUTOTICKS, 1, 1, 40, 64,
hToolSettings, NULL, hThisInstance, NULL);
SendMessage(hTrackbarZoom, TBM_SETRANGE, (WPARAM) TRUE, (LPARAM) MAKELONG(0, 6));
SendMessage(hTrackbarZoom, TBM_SETPOS, (WPARAM) TRUE, (LPARAM) 3);
/* creating the palette child window */ /* creating the palette child window */
hPalWin = CreateWindowEx(0, _T("Palette"), _T(""), WS_CHILD | WS_VISIBLE, 56, 9, 255, 32, hwnd, NULL, hThisInstance, NULL); hPalWin =
CreateWindowEx(0, _T("Palette"), _T(""), WS_CHILD | WS_VISIBLE, 56, 9, 255, 32, hwnd, NULL,
hThisInstance, NULL);
/* creating the scroll box */ /* creating the scroll box */
hScrollbox = CreateWindowEx (WS_EX_CLIENTEDGE, _T("Scrollbox"), _T(""), WS_CHILD | WS_GROUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 56, 49, 472, 248, hwnd, NULL, hThisInstance, NULL); hScrollbox =
CreateWindowEx(WS_EX_CLIENTEDGE, _T("Scrollbox"), _T(""),
WS_CHILD | WS_GROUP | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 56, 49, 472, 248, hwnd,
NULL, hThisInstance, NULL);
/* creating the status bar */ /* creating the status bar */
hStatusBar = CreateWindowEx (0, STATUSCLASSNAME, _T(""), SBARS_SIZEGRIP | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd, NULL, hThisInstance, NULL); hStatusBar =
CreateWindowEx(0, STATUSCLASSNAME, _T(""), SBARS_SIZEGRIP | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd,
NULL, hThisInstance, NULL);
SendMessage(hStatusBar, SB_SETMINHEIGHT, 21, 0); SendMessage(hStatusBar, SB_SETMINHEIGHT, 21, 0);
hScrlClient = CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 500, 500, hScrollbox, NULL, hThisInstance, NULL); hScrlClient =
CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 500, 500, hScrollbox, NULL,
hThisInstance, NULL);
/* create selection window (initially hidden) */ /* create selection window (initially hidden) */
hSelection = CreateWindowEx(WS_EX_TRANSPARENT, _T("Selection"), _T(""), WS_CHILD | BS_OWNERDRAW, 350, 0, 100, 100, hScrlClient, NULL, hThisInstance, NULL); hSelection =
CreateWindowEx(WS_EX_TRANSPARENT, _T("Selection"), _T(""), WS_CHILD | BS_OWNERDRAW, 350, 0, 100, 100,
hScrlClient, NULL, hThisInstance, NULL);
/* creating the window inside the scroll box, on which the image in hDrawingDC's bitmap is drawn */ /* creating the window inside the scroll box, on which the image in hDrawingDC's bitmap is drawn */
hImageArea = CreateWindowEx (0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 3, 3, imgXRes, imgYRes, hScrlClient, NULL, hThisInstance, NULL); hImageArea =
CreateWindowEx(0, _T("Scrollbox"), _T(""), WS_CHILD | WS_VISIBLE, 3, 3, imgXRes, imgYRes, hScrlClient,
NULL, hThisInstance, NULL);
hDrawingDC = CreateCompatibleDC(GetDC(hImageArea)); hDrawingDC = CreateCompatibleDC(GetDC(hImageArea));
hSelDC = CreateCompatibleDC(GetDC(hImageArea)); hSelDC = CreateCompatibleDC(GetDC(hImageArea));
SelectObject(hDrawingDC, CreatePen(PS_SOLID, 0, fgColor)); SelectObject(hDrawingDC, CreatePen(PS_SOLID, 0, fgColor));
SelectObject(hDrawingDC, CreateSolidBrush(bgColor)); SelectObject(hDrawingDC, CreateSolidBrush(bgColor));
hBms[0] = CreateDIBWithProperties(imgXRes, imgYRes); hBms[0] = CreateDIBWithProperties(imgXRes, imgYRes);
SelectObject(hDrawingDC, hBms[0]); SelectObject(hDrawingDC, hBms[0]);
Rectangle(hDrawingDC, 0-1, 0-1, imgXRes+1, imgYRes+1); Rectangle(hDrawingDC, 0 - 1, 0 - 1, imgXRes + 1, imgYRes + 1);
if (lpszArgument[0] != 0) if (lpszArgument[0] != 0)
{ {
HBITMAP bmNew = NULL; HBITMAP bmNew = NULL;
LoadDIBFromFile(&bmNew, lpszArgument, &fileTime, &fileSize, &fileHPPM, &fileVPPM); LoadDIBFromFile(&bmNew, lpszArgument, &fileTime, &fileSize, &fileHPPM, &fileVPPM);
if (bmNew!=NULL) if (bmNew != NULL)
{ {
TCHAR tempstr[1000]; TCHAR tempstr[1000];
TCHAR resstr[100]; TCHAR resstr[100];
TCHAR *temp; TCHAR *temp;
insertReversible(bmNew); insertReversible(bmNew);
GetFullPathName(lpszArgument, sizeof(filepathname), filepathname, &temp); GetFullPathName(lpszArgument, SIZEOF(filepathname), filepathname, &temp);
_tcscpy(filename, temp); _tcscpy(filename, temp);
LoadString(hProgInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr)); LoadString(hProgInstance, IDS_WINDOWTITLE, resstr, SIZEOF(resstr));
_stprintf(tempstr, resstr, filename); _stprintf(tempstr, resstr, filename);
@ -364,53 +396,75 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
} }
/* initializing the CHOOSECOLOR structure for use with ChooseColor */ /* initializing the CHOOSECOLOR structure for use with ChooseColor */
choosecolor.lStructSize = sizeof(CHOOSECOLOR); choosecolor.lStructSize = sizeof(CHOOSECOLOR);
choosecolor.hwndOwner = hwnd; choosecolor.hwndOwner = hwnd;
choosecolor.hInstance = NULL; choosecolor.hInstance = NULL;
choosecolor.rgbResult = 0x00ffffff; choosecolor.rgbResult = 0x00ffffff;
choosecolor.lpCustColors = (COLORREF*)&custColors; choosecolor.lpCustColors = (COLORREF*) &custColors;
choosecolor.Flags = 0; choosecolor.Flags = 0;
choosecolor.lCustData = 0; choosecolor.lCustData = 0;
choosecolor.lpfnHook = NULL; choosecolor.lpfnHook = NULL;
choosecolor.lpTemplateName = NULL; choosecolor.lpTemplateName = NULL;
/* initializing the OPENFILENAME structure for use with GetOpenFileName and GetSaveFileName */ /* initializing the OPENFILENAME structure for use with GetOpenFileName and GetSaveFileName */
CopyMemory(ofnFilename, filename, sizeof(filename)); CopyMemory(ofnFilename, filename, sizeof(filename));
LoadString(hThisInstance, IDS_OPENFILTER, ofnFilter, SIZEOF(ofnFilter)); LoadString(hThisInstance, IDS_OPENFILTER, ofnFilter, SIZEOF(ofnFilter));
for (c = ofnFilter; *c; c++) if (*c == '\1') *c = '\0'; for(c = ofnFilter; *c; c++)
if (*c == '\1')
*c = '\0';
ZeroMemory(&ofn, sizeof(OPENFILENAME)); ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof (OPENFILENAME); ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hwnd; ofn.hwndOwner = hwnd;
ofn.hInstance = hThisInstance; ofn.hInstance = hThisInstance;
ofn.lpstrFilter = ofnFilter; ofn.lpstrFilter = ofnFilter;
ofn.lpstrFile = ofnFilename; ofn.lpstrFile = ofnFilename;
ofn.nMaxFile = SIZEOF(ofnFilename); ofn.nMaxFile = SIZEOF(ofnFilename);
ofn.lpstrFileTitle = ofnFiletitle; ofn.lpstrFileTitle = ofnFiletitle;
ofn.nMaxFileTitle = SIZEOF(ofnFiletitle); ofn.nMaxFileTitle = SIZEOF(ofnFiletitle);
ofn.Flags = OFN_HIDEREADONLY; ofn.Flags = OFN_HIDEREADONLY;
CopyMemory(sfnFilename, filename, sizeof(filename)); CopyMemory(sfnFilename, filename, sizeof(filename));
LoadString(hThisInstance, IDS_SAVEFILTER, sfnFilter, SIZEOF(sfnFilter)); LoadString(hThisInstance, IDS_SAVEFILTER, sfnFilter, SIZEOF(sfnFilter));
for (c = sfnFilter; *c; c++) if (*c == '\1') *c = '\0'; for(c = sfnFilter; *c; c++)
if (*c == '\1')
*c = '\0';
ZeroMemory(&sfn, sizeof(OPENFILENAME)); ZeroMemory(&sfn, sizeof(OPENFILENAME));
sfn.lStructSize = sizeof (OPENFILENAME); sfn.lStructSize = sizeof(OPENFILENAME);
sfn.hwndOwner = hwnd; sfn.hwndOwner = hwnd;
sfn.hInstance = hThisInstance; sfn.hInstance = hThisInstance;
sfn.lpstrFilter = sfnFilter; sfn.lpstrFilter = sfnFilter;
sfn.lpstrFile = sfnFilename; sfn.lpstrFile = sfnFilename;
sfn.nMaxFile = SIZEOF(sfnFilename); sfn.nMaxFile = SIZEOF(sfnFilename);
sfn.lpstrFileTitle = sfnFiletitle; sfn.lpstrFileTitle = sfnFiletitle;
sfn.nMaxFileTitle = SIZEOF(sfnFiletitle); sfn.nMaxFileTitle = SIZEOF(sfnFiletitle);
sfn.Flags = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY; sfn.Flags = OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
hSizeboxLeftTop = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL); /* creating the size boxes */
hSizeboxCenterTop = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL); hSizeboxLeftTop =
hSizeboxRightTop = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL); CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
hSizeboxLeftCenter = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL); hThisInstance, NULL);
hSizeboxRightCenter = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL); hSizeboxCenterTop =
hSizeboxLeftBottom = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL); CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
hSizeboxCenterBottom= CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL); hThisInstance, NULL);
hSizeboxRightBottom = CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL, hThisInstance, NULL); hSizeboxRightTop =
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
hThisInstance, NULL);
hSizeboxLeftCenter =
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
hThisInstance, NULL);
hSizeboxRightCenter =
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
hThisInstance, NULL);
hSizeboxLeftBottom =
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
hThisInstance, NULL);
hSizeboxCenterBottom =
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
hThisInstance, NULL);
hSizeboxRightBottom =
CreateWindowEx(0, _T("Sizebox"), _T(""), WS_CHILD | WS_VISIBLE, 0, 0, 3, 3, hScrlClient, NULL,
hThisInstance, NULL);
/* placing the size boxes around the image */
SendMessage(hImageArea, WM_SIZE, 0, 0); SendMessage(hImageArea, WM_SIZE, 0, 0);
/* by moving the window, the things in WM_SIZE are done */ /* by moving the window, the things in WM_SIZE are done */
@ -420,7 +474,7 @@ int WINAPI _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR l
ShowWindow (hwnd, nFunsterStil); ShowWindow (hwnd, nFunsterStil);
/* 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, &messages);

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: mouse.c * FILE: base/applications/paint/mouse.c
* 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
*/ */
@ -15,9 +15,11 @@
/* FUNCTIONS ********************************************************/ /* FUNCTIONS ********************************************************/
void placeSelWin() void
placeSelWin()
{ {
MoveWindow(hSelection, rectSel_dest[0]*zoom/1000, rectSel_dest[1]*zoom/1000, rectSel_dest[2]*zoom/1000+6, rectSel_dest[3]*zoom/1000+6, TRUE); MoveWindow(hSelection, rectSel_dest[0] * zoom / 1000, rectSel_dest[1] * zoom / 1000,
rectSel_dest[2] * zoom / 1000 + 6, rectSel_dest[3] * zoom / 1000 + 6, TRUE);
BringWindowToTop(hSelection); BringWindowToTop(hSelection);
SendMessage(hImageArea, WM_PAINT, 0, 0); SendMessage(hImageArea, WM_PAINT, 0, 0);
//SendMessage(hSelection, WM_PAINT, 0, 0); //SendMessage(hSelection, WM_PAINT, 0, 0);
@ -26,7 +28,8 @@ void placeSelWin()
POINT pointStack[256]; POINT pointStack[256];
short pointSP; short pointSP;
void startPaintingL(HDC hdc, short x, short y, int fg, int bg) void
startPaintingL(HDC hdc, short x, short y, int fg, int bg)
{ {
startX = x; startX = x;
startY = y; startY = y;
@ -37,6 +40,7 @@ void startPaintingL(HDC hdc, short x, short y, int fg, int bg)
case 1: case 1:
case 10: case 10:
case 11: case 11:
case 13:
case 15: case 15:
case 16: case 16:
newReversible(); newReversible();
@ -67,7 +71,7 @@ void startPaintingL(HDC hdc, short x, short y, int fg, int bg)
case 12: case 12:
pointStack[pointSP].x = x; pointStack[pointSP].x = x;
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
if (pointSP==0) if (pointSP == 0)
{ {
newReversible(); newReversible();
pointSP++; pointSP++;
@ -76,8 +80,9 @@ void startPaintingL(HDC hdc, short x, short y, int fg, int bg)
case 14: case 14:
pointStack[pointSP].x = x; pointStack[pointSP].x = x;
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
if (pointSP+1>=2) Poly(hdc, pointStack, pointSP+1, fg, bg, lineWidth, shapeStyle, FALSE); if (pointSP + 1 >= 2)
if (pointSP==0) Poly(hdc, pointStack, pointSP + 1, fg, bg, lineWidth, shapeStyle, FALSE);
if (pointSP == 0)
{ {
newReversible(); newReversible();
pointSP++; pointSP++;
@ -86,24 +91,25 @@ void startPaintingL(HDC hdc, short x, short y, int fg, int bg)
} }
} }
void whilePaintingL(HDC hdc, short x, short y, int fg, int bg) void
whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
{ {
switch (activeTool) switch (activeTool)
{ {
case 2: case 2:
{ {
short tempX; short tempX;
short tempY; short tempY;
resetToU1(); resetToU1();
tempX = max(0, min(x, imgXRes)); tempX = max(0, min(x, imgXRes));
tempY = max(0, min(y, imgYRes)); tempY = max(0, min(y, imgYRes));
rectSel_dest[0] = rectSel_src[0] = min(startX, tempX); rectSel_dest[0] = rectSel_src[0] = min(startX, tempX);
rectSel_dest[1] = rectSel_src[1] = min(startY, tempY); rectSel_dest[1] = rectSel_src[1] = min(startY, tempY);
rectSel_dest[2] = rectSel_src[2] = max(startX, tempX)-min(startX, tempX); rectSel_dest[2] = rectSel_src[2] = max(startX, tempX) - min(startX, tempX);
rectSel_dest[3] = rectSel_src[3] = max(startY, tempY)-min(startY, tempY); rectSel_dest[3] = rectSel_src[3] = max(startY, tempY) - min(startY, tempY);
RectSel(hdc, startX, startY, tempX, tempY); RectSel(hdc, startX, startY, tempX, tempY);
}
break; break;
}
case 3: case 3:
Erase(hdc, lastX, lastY, x, y, bg, rubberRadius); Erase(hdc, lastX, lastY, x, y, bg, rubberRadius);
break; break;
@ -126,9 +132,16 @@ void whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
switch (pointSP) switch (pointSP)
{ {
case 1: Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, fg, lineWidth); break; case 1:
case 2: Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], fg, lineWidth); break; Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, fg,
case 3: Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], fg, lineWidth); break; lineWidth);
break;
case 2:
Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], fg, lineWidth);
break;
case 3:
Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], fg, lineWidth);
break;
} }
break; break;
case 13: case 13:
@ -139,7 +152,8 @@ void whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
resetToU1(); resetToU1();
pointStack[pointSP].x = x; pointStack[pointSP].x = x;
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
if (pointSP+1>=2) Poly(hdc, pointStack, pointSP+1, fg, bg, lineWidth, shapeStyle, FALSE); if (pointSP + 1 >= 2)
Poly(hdc, pointStack, pointSP + 1, fg, bg, lineWidth, shapeStyle, FALSE);
break; break;
case 15: case 15:
resetToU1(); resetToU1();
@ -150,21 +164,25 @@ void whilePaintingL(HDC hdc, short x, short y, int fg, int bg)
RRect(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle); RRect(hdc, startX, startY, x, y, fg, bg, lineWidth, shapeStyle);
break; break;
} }
lastX = x; lastX = x;
lastY = y; lastY = y;
} }
void endPaintingL(HDC hdc, short x, short y, int fg, int bg) void
endPaintingL(HDC hdc, short x, short y, int fg, int bg)
{ {
switch (activeTool) switch (activeTool)
{ {
case 2: case 2:
resetToU1(); resetToU1();
if ((rectSel_src[2]!=0)&&(rectSel_src[3]!=0)) if ((rectSel_src[2] != 0) && (rectSel_src[3] != 0))
{ {
DeleteObject(SelectObject(hSelDC, hSelBm = (HBITMAP)CreateDIBWithProperties(rectSel_src[2], rectSel_src[3]))); DeleteObject(SelectObject
BitBlt(hSelDC, 0, 0, rectSel_src[2], rectSel_src[3], hDrawingDC, rectSel_src[0], rectSel_src[1], SRCCOPY); (hSelDC, hSelBm =
(HBITMAP) CreateDIBWithProperties(rectSel_src[2], rectSel_src[3])));
BitBlt(hSelDC, 0, 0, rectSel_src[2], rectSel_src[3], hDrawingDC, rectSel_src[0],
rectSel_src[1], SRCCOPY);
placeSelWin(); placeSelWin();
ShowWindow(hSelection, SW_SHOW); ShowWindow(hSelection, SW_SHOW);
} }
@ -182,7 +200,8 @@ void endPaintingL(HDC hdc, short x, short y, int fg, int bg)
break; break;
case 12: case 12:
pointSP++; pointSP++;
if (pointSP==4) pointSP = 0; if (pointSP == 4)
pointSP = 0;
break; break;
case 13: case 13:
resetToU1(); resetToU1();
@ -193,9 +212,10 @@ void endPaintingL(HDC hdc, short x, short y, int fg, int bg)
pointStack[pointSP].x = x; pointStack[pointSP].x = x;
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
pointSP++; pointSP++;
if (pointSP>=2) if (pointSP >= 2)
{ {
if ( (pointStack[0].x-x)*(pointStack[0].x-x) + (pointStack[0].y-y)*(pointStack[0].y-y) <= lineWidth*lineWidth+1) if ((pointStack[0].x - x) * (pointStack[0].x - x) +
(pointStack[0].y - y) * (pointStack[0].y - y) <= lineWidth * lineWidth + 1)
{ {
Poly(hdc, pointStack, pointSP, fg, bg, lineWidth, shapeStyle, TRUE); Poly(hdc, pointStack, pointSP, fg, bg, lineWidth, shapeStyle, TRUE);
pointSP = 0; pointSP = 0;
@ -205,7 +225,8 @@ void endPaintingL(HDC hdc, short x, short y, int fg, int bg)
Poly(hdc, pointStack, pointSP, fg, bg, lineWidth, shapeStyle, FALSE); Poly(hdc, pointStack, pointSP, fg, bg, lineWidth, shapeStyle, FALSE);
} }
} }
if (pointSP==255) pointSP--; if (pointSP == 255)
pointSP--;
break; break;
case 15: case 15:
resetToU1(); resetToU1();
@ -218,7 +239,8 @@ void endPaintingL(HDC hdc, short x, short y, int fg, int bg)
} }
} }
void startPaintingR(HDC hdc, short x, short y, int fg, int bg) void
startPaintingR(HDC hdc, short x, short y, int fg, int bg)
{ {
startX = x; startX = x;
startY = y; startY = y;
@ -229,6 +251,7 @@ void startPaintingR(HDC hdc, short x, short y, int fg, int bg)
case 1: case 1:
case 10: case 10:
case 11: case 11:
case 13:
case 15: case 15:
case 16: case 16:
newReversible(); newReversible();
@ -255,7 +278,7 @@ void startPaintingR(HDC hdc, short x, short y, int fg, int bg)
case 12: case 12:
pointStack[pointSP].x = x; pointStack[pointSP].x = x;
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
if (pointSP==0) if (pointSP == 0)
{ {
newReversible(); newReversible();
pointSP++; pointSP++;
@ -264,8 +287,9 @@ void startPaintingR(HDC hdc, short x, short y, int fg, int bg)
case 14: case 14:
pointStack[pointSP].x = x; pointStack[pointSP].x = x;
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
if (pointSP+1>=2) Poly(hdc, pointStack, pointSP+1, bg, fg, lineWidth, shapeStyle, FALSE); if (pointSP + 1 >= 2)
if (pointSP==0) Poly(hdc, pointStack, pointSP + 1, bg, fg, lineWidth, shapeStyle, FALSE);
if (pointSP == 0)
{ {
newReversible(); newReversible();
pointSP++; pointSP++;
@ -274,7 +298,8 @@ void startPaintingR(HDC hdc, short x, short y, int fg, int bg)
} }
} }
void whilePaintingR(HDC hdc, short x, short y, int fg, int bg) void
whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
{ {
switch (activeTool) switch (activeTool)
{ {
@ -300,9 +325,16 @@ void whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
switch (pointSP) switch (pointSP)
{ {
case 1: Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, bg, lineWidth); break; case 1:
case 2: Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], bg, lineWidth); break; Line(hdc, pointStack[0].x, pointStack[0].y, pointStack[1].x, pointStack[1].y, bg,
case 3: Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], bg, lineWidth); break; lineWidth);
break;
case 2:
Bezier(hdc, pointStack[0], pointStack[2], pointStack[2], pointStack[1], bg, lineWidth);
break;
case 3:
Bezier(hdc, pointStack[0], pointStack[2], pointStack[3], pointStack[1], bg, lineWidth);
break;
} }
break; break;
case 13: case 13:
@ -313,7 +345,8 @@ void whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
resetToU1(); resetToU1();
pointStack[pointSP].x = x; pointStack[pointSP].x = x;
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
if (pointSP+1>=2) Poly(hdc, pointStack, pointSP+1, bg, fg, lineWidth, shapeStyle, FALSE); if (pointSP + 1 >= 2)
Poly(hdc, pointStack, pointSP + 1, bg, fg, lineWidth, shapeStyle, FALSE);
break; break;
case 15: case 15:
resetToU1(); resetToU1();
@ -324,12 +357,13 @@ void whilePaintingR(HDC hdc, short x, short y, int fg, int bg)
RRect(hdc, startX, startY, x, y, bg, fg, lineWidth, shapeStyle); RRect(hdc, startX, startY, x, y, bg, fg, lineWidth, shapeStyle);
break; break;
} }
lastX = x; lastX = x;
lastY = y; lastY = y;
} }
void endPaintingR(HDC hdc, short x, short y, int fg, int bg) void
endPaintingR(HDC hdc, short x, short y, int fg, int bg)
{ {
switch (activeTool) switch (activeTool)
{ {
@ -346,7 +380,8 @@ void endPaintingR(HDC hdc, short x, short y, int fg, int bg)
break; break;
case 12: case 12:
pointSP++; pointSP++;
if (pointSP==4) pointSP = 0; if (pointSP == 4)
pointSP = 0;
break; break;
case 13: case 13:
resetToU1(); resetToU1();
@ -357,9 +392,10 @@ void endPaintingR(HDC hdc, short x, short y, int fg, int bg)
pointStack[pointSP].x = x; pointStack[pointSP].x = x;
pointStack[pointSP].y = y; pointStack[pointSP].y = y;
pointSP++; pointSP++;
if (pointSP>=2) if (pointSP >= 2)
{ {
if ( (pointStack[0].x-x)*(pointStack[0].x-x) + (pointStack[0].y-y)*(pointStack[0].y-y) <= lineWidth*lineWidth+1) if ((pointStack[0].x - x) * (pointStack[0].x - x) +
(pointStack[0].y - y) * (pointStack[0].y - y) <= lineWidth * lineWidth + 1)
{ {
Poly(hdc, pointStack, pointSP, bg, fg, lineWidth, shapeStyle, TRUE); Poly(hdc, pointStack, pointSP, bg, fg, lineWidth, shapeStyle, TRUE);
pointSP = 0; pointSP = 0;
@ -369,7 +405,8 @@ void endPaintingR(HDC hdc, short x, short y, int fg, int bg)
Poly(hdc, pointStack, pointSP, bg, fg, lineWidth, shapeStyle, FALSE); Poly(hdc, pointStack, pointSP, bg, fg, lineWidth, shapeStyle, FALSE);
} }
} }
if (pointSP==255) pointSP--; if (pointSP == 255)
pointSP--;
break; break;
case 15: case 15:
resetToU1(); resetToU1();

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: mouse.h * FILE: base/applications/paint/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: palette.c * FILE: base/applications/paint/palette.c
* PURPOSE: Window procedure of the palette window * PURPOSE: Window procedure of the palette window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -13,92 +13,94 @@
/* FUNCTIONS ********************************************************/ /* FUNCTIONS ********************************************************/
LRESULT CALLBACK PalWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK
PalWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
{ {
case WM_PAINT: case WM_PAINT:
{
RECT rc = { 0, 0, 31, 32 };
HDC hDC = GetDC(hwnd);
HPEN oldPen;
HBRUSH oldBrush;
int i, a, b;
DefWindowProc(hwnd, message, wParam, lParam);
for(b = 2; b < 30; b++)
for(a = 2; a < 29; a++)
if ((a + b) % 2 == 1)
SetPixel(hDC, a, b, GetSysColor(COLOR_BTNHILIGHT));
DrawEdge(hDC, &rc, EDGE_RAISED, BF_TOPLEFT);
DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_TOPLEFT | BF_BOTTOMRIGHT);
SetRect(&rc, 11, 12, 26, 27);
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
oldPen = SelectObject(hDC, CreatePen(PS_NULL, 0, 0));
oldBrush = SelectObject(hDC, CreateSolidBrush(bgColor));
Rectangle(hDC, rc.left, rc.top + 2, rc.right - 1, rc.bottom - 1);
DeleteObject(SelectObject(hDC, oldBrush));
SetRect(&rc, 4, 5, 19, 20);
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT | BF_MIDDLE);
oldBrush = SelectObject(hDC, CreateSolidBrush(fgColor));
Rectangle(hDC, rc.left + 2, rc.top + 2, rc.right - 1, rc.bottom - 1);
DeleteObject(SelectObject(hDC, oldBrush));
DeleteObject(SelectObject(hDC, oldPen));
for(i = 0; i < 28; i++)
{ {
RECT rc = {0, 0, 31, 32}; SetRect(&rc, 31 + (i % 14) * 16,
HDC hDC = GetDC(hwnd); 0 + (i / 14) * 16, 16 + 31 + (i % 14) * 16, 16 + 0 + (i / 14) * 16);
HPEN oldPen;
HBRUSH oldBrush;
int i, a, b;
DefWindowProc (hwnd, message, wParam, lParam);
for (b = 2; b < 30; b++)
for (a = 2; a < 29; a++)
if ((a + b) % 2 == 1)
SetPixel(hDC, a, b, GetSysColor(COLOR_BTNHILIGHT));
DrawEdge(hDC, &rc, EDGE_RAISED, BF_TOPLEFT); DrawEdge(hDC, &rc, EDGE_RAISED, BF_TOPLEFT);
DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_TOPLEFT|BF_BOTTOMRIGHT); DrawEdge(hDC, &rc, BDR_SUNKENOUTER, BF_RECT);
SetRect(&rc, 11, 12, 26, 27);
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT|BF_MIDDLE);
oldPen = SelectObject(hDC, CreatePen(PS_NULL, 0, 0)); oldPen = SelectObject(hDC, CreatePen(PS_NULL, 0, 0));
oldBrush = SelectObject(hDC, CreateSolidBrush(bgColor)); oldBrush = SelectObject(hDC, CreateSolidBrush(palColors[i]));
Rectangle(hDC, rc.left, 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));
SetRect(&rc, 4, 5, 19, 20);
DrawEdge(hDC, &rc, BDR_RAISEDINNER, BF_RECT|BF_MIDDLE);
oldBrush = SelectObject(hDC, CreateSolidBrush(fgColor));
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));
for (i=0; i<28; i++)
{
SetRect(&rc, 31 + (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, BDR_SUNKENOUTER, BF_RECT);
oldPen = SelectObject(hDC, CreatePen(PS_NULL, 0, 0));
oldBrush = SelectObject(hDC, CreateSolidBrush(palColors[i]));
Rectangle(hDC, rc.left + 2,rc.top + 2,rc.right - 1, rc.bottom - 1);
DeleteObject(SelectObject(hDC, oldBrush));
DeleteObject(SelectObject(hDC, oldPen));
}
ReleaseDC(hwnd, hDC);
} }
ReleaseDC(hwnd, hDC);
break; break;
}
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
if (LOWORD(lParam)>=31) if (LOWORD(lParam) >= 31)
{ {
fgColor = palColors[(LOWORD(lParam)-31)/16+(HIWORD(lParam)/16)*14]; fgColor = palColors[(LOWORD(lParam) - 31) / 16 + (HIWORD(lParam) / 16) * 14];
SendMessage(hwnd, WM_PAINT, 0, 0); SendMessage(hwnd, WM_PAINT, 0, 0);
} }
break; break;
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN:
if (LOWORD(lParam)>=31) if (LOWORD(lParam) >= 31)
{ {
bgColor = palColors[(LOWORD(lParam)-31)/16+(HIWORD(lParam)/16)*14]; bgColor = palColors[(LOWORD(lParam) - 31) / 16 + (HIWORD(lParam) / 16) * 14];
SendMessage(hwnd, WM_PAINT, 0, 0); SendMessage(hwnd, WM_PAINT, 0, 0);
} }
break; break;
case WM_LBUTTONDBLCLK: case WM_LBUTTONDBLCLK:
if (LOWORD(lParam)>=31) if (ChooseColor(&choosecolor)) if (LOWORD(lParam) >= 31)
{ if (ChooseColor(&choosecolor))
palColors[(LOWORD(lParam)-31)/16+(HIWORD(lParam)/16)*14] = choosecolor.rgbResult; {
fgColor = choosecolor.rgbResult; palColors[(LOWORD(lParam) - 31) / 16 + (HIWORD(lParam) / 16) * 14] =
SendMessage(hwnd, WM_PAINT, 0, 0); choosecolor.rgbResult;
} fgColor = choosecolor.rgbResult;
SendMessage(hwnd, WM_PAINT, 0, 0);
}
break; break;
case WM_RBUTTONDBLCLK: case WM_RBUTTONDBLCLK:
if (LOWORD(lParam)>=31) if (ChooseColor(&choosecolor)) if (LOWORD(lParam) >= 31)
{ if (ChooseColor(&choosecolor))
palColors[(LOWORD(lParam)-31)/16+(HIWORD(lParam)/16)*14] = choosecolor.rgbResult; {
bgColor = choosecolor.rgbResult; palColors[(LOWORD(lParam) - 31) / 16 + (HIWORD(lParam) / 16) * 14] =
SendMessage(hwnd, WM_PAINT, 0, 0); choosecolor.rgbResult;
} bgColor = choosecolor.rgbResult;
SendMessage(hwnd, WM_PAINT, 0, 0);
}
break; break;
default: default:
return DefWindowProc (hwnd, message, wParam, lParam); return DefWindowProc(hwnd, message, wParam, lParam);
} }
return 0; return 0;
} }

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: palette.h * FILE: base/applications/paint/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: registry.c * FILE: base/applications/paint/registry.c
* PURPOSE: Offering functions dealing with registry values * PURPOSE: Offering functions dealing with registry values
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -13,27 +13,30 @@
/* FUNCTIONS ********************************************************/ /* FUNCTIONS ********************************************************/
void SetWallpaper(TCHAR *FileName, DWORD dwStyle, DWORD dwTile) //FIXME: The pattern (tiled/stretched) is not set void
SetWallpaper(TCHAR * FileName, DWORD dwStyle, DWORD dwTile) //FIXME: The pattern (tiled/stretched) is not set
{ {
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (PVOID) FileName, SPIF_UPDATEINIFILE); SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (PVOID) FileName, SPIF_UPDATEINIFILE);
/*HKEY hDesktop; /*HKEY hDesktop;
TCHAR szStyle[3], szTile[3]; TCHAR szStyle[3], szTile[3];
if ((dwStyle > 2) || (dwTile > 2)) if ((dwStyle > 2) || (dwTile > 2))
return; return;
if (RegOpenKeyEx(HKEY_CURRENT_USER, if (RegOpenKeyEx(HKEY_CURRENT_USER,
_T("Control Panel\\Desktop"), 0, _T("Control Panel\\Desktop"), 0, KEY_READ | KEY_SET_VALUE, &hDesktop) == ERROR_SUCCESS)
KEY_READ | KEY_SET_VALUE, &hDesktop) == ERROR_SUCCESS)
{ {
RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName, _tcslen(FileName) * sizeof(TCHAR)); RegSetValueEx(hDesktop, _T("Wallpaper"), 0, REG_SZ, (LPBYTE) FileName,
_tcslen(FileName) * sizeof(TCHAR));
_stprintf(szStyle, _T("%i"), dwStyle); _stprintf(szStyle, _T("%i"), dwStyle);
_stprintf(szTile, _T("%i"), dwTile); _stprintf(szTile, _T("%i"), dwTile);
RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle, _tcslen(szStyle) * sizeof(TCHAR)); RegSetValueEx(hDesktop, _T("WallpaperStyle"), 0, REG_SZ, (LPBYTE) szStyle,
RegSetValueEx(hDesktop, _T("TileWallpaper"), 0, REG_SZ, (LPBYTE) szTile, _tcslen(szTile) * sizeof(TCHAR)); _tcslen(szStyle) * sizeof(TCHAR));
RegSetValueEx(hDesktop, _T("TileWallpaper"), 0, REG_SZ, (LPBYTE) szTile,
_tcslen(szTile) * sizeof(TCHAR));
RegCloseKey(hDesktop); RegCloseKey(hDesktop);
}*/ }*/

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: registry.h * FILE: base/applications/paint/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: rsrc.rc * FILE: base/applications/paint/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: selection.c * FILE: base/applications/paint/selection.c
* PURPOSE: Window procedure of the selection window * PURPOSE: Window procedure of the selection window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -20,21 +20,23 @@ BOOL moving = FALSE;
short xPos; short xPos;
short yPos; short yPos;
LRESULT CALLBACK SelectionWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK
SelectionWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
{ {
case WM_PAINT: case WM_PAINT:
{
if (!moving)
{ {
if (!moving) HDC hDC = GetDC(hwnd);
{ DefWindowProc(hwnd, message, wParam, lParam);
HDC hDC = GetDC(hwnd); SelectionFrame(hDC, 1, 1, rectSel_dest[2] * zoom / 1000 + 5,
DefWindowProc (hwnd, message, wParam, lParam); rectSel_dest[3] * zoom / 1000 + 5);
SelectionFrame(hDC, 1, 1, rectSel_dest[2]*zoom/1000+5, rectSel_dest[3]*zoom/1000+5); ReleaseDC(hwnd, hDC);
ReleaseDC(hwnd, hDC);
}
} }
break; break;
}
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
xPos = LOWORD(lParam); xPos = LOWORD(lParam);
yPos = HIWORD(lParam); yPos = HIWORD(lParam);
@ -45,15 +47,19 @@ LRESULT CALLBACK SelectionWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
if (moving) if (moving)
{ {
resetToU1(); resetToU1();
rectSel_dest[0]+=(short)LOWORD(lParam)-xPos; rectSel_dest[0] += (short)LOWORD(lParam) - xPos;
rectSel_dest[1]+=(short)HIWORD(lParam)-yPos; rectSel_dest[1] += (short)HIWORD(lParam) - yPos;
Rect(hDrawingDC, rectSel_src[0], rectSel_src[1], rectSel_src[0]+rectSel_src[2], rectSel_src[1]+rectSel_src[3], bgColor, bgColor, 0, TRUE); Rect(hDrawingDC, rectSel_src[0], rectSel_src[1], rectSel_src[0] + rectSel_src[2],
if (transpBg==0) rectSel_src[1] + rectSel_src[3], bgColor, bgColor, 0, TRUE);
BitBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3], hSelDC, 0, 0, SRCCOPY); if (transpBg == 0)
BitBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3],
hSelDC, 0, 0, SRCCOPY);
else else
BitBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3], hSelDC, 0, 0, SRCAND); BitBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3],
//TransparentBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3], hSelDC, 0, 0, rectSel_dest[2], rectSel_dest[3], bgColor); hSelDC, 0, 0, SRCAND);
//TransparentBlt(hDrawingDC, rectSel_dest[0], rectSel_dest[1], rectSel_dest[2], rectSel_dest[3],
// hSelDC, 0, 0, rectSel_dest[2], rectSel_dest[3], bgColor);
SendMessage(hImageArea, WM_PAINT, 0, 0); SendMessage(hImageArea, WM_PAINT, 0, 0);
xPos = LOWORD(lParam); xPos = LOWORD(lParam);
yPos = HIWORD(lParam); yPos = HIWORD(lParam);
@ -71,7 +77,7 @@ LRESULT CALLBACK SelectionWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
} }
break; break;
default: default:
return DefWindowProc (hwnd, message, wParam, lParam); return DefWindowProc(hwnd, message, wParam, lParam);
} }
return 0; return 0;

View file

@ -1,9 +1,9 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: selection.h * FILE: base/applications/paint/selection.h
* PURPOSE: Window procedure of the selection window * PURPOSE: Window procedure of the selection window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
LRESULT CALLBACK SelectionWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK SelectionWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

View file

@ -20,21 +20,20 @@ BOOL resizing = FALSE;
short xOrig; short xOrig;
short yOrig; short yOrig;
LRESULT CALLBACK SizeboxWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK
SizeboxWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
{ {
case WM_SETCURSOR: case WM_SETCURSOR:
{ if ((hwnd == hSizeboxLeftTop) || (hwnd == hSizeboxRightBottom))
if ((hwnd==hSizeboxLeftTop)||(hwnd==hSizeboxRightBottom)) SetCursor(LoadCursor(NULL, IDC_SIZENWSE));
SetCursor(LoadCursor(NULL, IDC_SIZENWSE)); if ((hwnd == hSizeboxLeftBottom) || (hwnd == hSizeboxRightTop))
if ((hwnd==hSizeboxLeftBottom)||(hwnd==hSizeboxRightTop)) SetCursor(LoadCursor(NULL, IDC_SIZENESW));
SetCursor(LoadCursor(NULL, IDC_SIZENESW)); if ((hwnd == hSizeboxLeftCenter) || (hwnd == hSizeboxRightCenter))
if ((hwnd==hSizeboxLeftCenter)||(hwnd==hSizeboxRightCenter)) SetCursor(LoadCursor(NULL, IDC_SIZEWE));
SetCursor(LoadCursor(NULL, IDC_SIZEWE)); if ((hwnd == hSizeboxCenterTop) || (hwnd == hSizeboxCenterBottom))
if ((hwnd==hSizeboxCenterTop)||(hwnd==hSizeboxCenterBottom)) SetCursor(LoadCursor(NULL, IDC_SIZENS));
SetCursor(LoadCursor(NULL, IDC_SIZENS));
}
break; break;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
resizing = TRUE; resizing = TRUE;
@ -48,25 +47,25 @@ LRESULT CALLBACK SizeboxWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
TCHAR sizeStr[100]; TCHAR sizeStr[100];
short xRel; short xRel;
short yRel; short yRel;
xRel = ((short)LOWORD(lParam)-xOrig)*1000/zoom; xRel = ((short)LOWORD(lParam) - xOrig) * 1000 / zoom;
yRel = ((short)HIWORD(lParam)-yOrig)*1000/zoom; yRel = ((short)HIWORD(lParam) - yOrig) * 1000 / zoom;
if (hwnd==hSizeboxLeftTop) if (hwnd == hSizeboxLeftTop)
_stprintf(sizeStr, _T("%d x %d"), imgXRes-xRel, imgYRes-yRel); _stprintf(sizeStr, _T("%d x %d"), imgXRes - xRel, imgYRes - yRel);
if (hwnd==hSizeboxCenterTop) if (hwnd == hSizeboxCenterTop)
_stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes-yRel); _stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes - yRel);
if (hwnd==hSizeboxRightTop) if (hwnd == hSizeboxRightTop)
_stprintf(sizeStr, _T("%d x %d"), imgXRes+xRel, imgYRes-yRel); _stprintf(sizeStr, _T("%d x %d"), imgXRes + xRel, imgYRes - yRel);
if (hwnd==hSizeboxLeftCenter) if (hwnd == hSizeboxLeftCenter)
_stprintf(sizeStr, _T("%d x %d"), imgXRes-xRel, imgYRes); _stprintf(sizeStr, _T("%d x %d"), imgXRes - xRel, imgYRes);
if (hwnd==hSizeboxRightCenter) if (hwnd == hSizeboxRightCenter)
_stprintf(sizeStr, _T("%d x %d"), imgXRes+xRel, imgYRes); _stprintf(sizeStr, _T("%d x %d"), imgXRes + xRel, imgYRes);
if (hwnd==hSizeboxLeftBottom) if (hwnd == hSizeboxLeftBottom)
_stprintf(sizeStr, _T("%d x %d"), imgXRes-xRel, imgYRes+yRel); _stprintf(sizeStr, _T("%d x %d"), imgXRes - xRel, imgYRes + yRel);
if (hwnd==hSizeboxCenterBottom) if (hwnd == hSizeboxCenterBottom)
_stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes+yRel); _stprintf(sizeStr, _T("%d x %d"), imgXRes, imgYRes + yRel);
if (hwnd==hSizeboxRightBottom) if (hwnd == hSizeboxRightBottom)
_stprintf(sizeStr, _T("%d x %d"), imgXRes+xRel, imgYRes+yRel); _stprintf(sizeStr, _T("%d x %d"), imgXRes + xRel, imgYRes + yRel);
SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM)sizeStr); SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) sizeStr);
} }
break; break;
case WM_LBUTTONUP: case WM_LBUTTONUP:
@ -76,30 +75,30 @@ LRESULT CALLBACK SizeboxWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM
short yRel; short yRel;
ReleaseCapture(); ReleaseCapture();
resizing = FALSE; resizing = FALSE;
xRel = ((short)LOWORD(lParam)-xOrig)*1000/zoom; xRel = ((short)LOWORD(lParam) - xOrig) * 1000 / zoom;
yRel = ((short)HIWORD(lParam)-yOrig)*1000/zoom; yRel = ((short)HIWORD(lParam) - yOrig) * 1000 / zoom;
if (hwnd==hSizeboxLeftTop) if (hwnd == hSizeboxLeftTop)
cropReversible(imgXRes-xRel, imgYRes-yRel, xRel, yRel); cropReversible(imgXRes - xRel, imgYRes - yRel, xRel, yRel);
if (hwnd==hSizeboxCenterTop) if (hwnd == hSizeboxCenterTop)
cropReversible(imgXRes, imgYRes-yRel, 0, yRel); cropReversible(imgXRes, imgYRes - yRel, 0, yRel);
if (hwnd==hSizeboxRightTop) if (hwnd == hSizeboxRightTop)
cropReversible(imgXRes+xRel, imgYRes-yRel, 0, yRel); cropReversible(imgXRes + xRel, imgYRes - yRel, 0, yRel);
if (hwnd==hSizeboxLeftCenter) if (hwnd == hSizeboxLeftCenter)
cropReversible(imgXRes-xRel, imgYRes, xRel, 0); cropReversible(imgXRes - xRel, imgYRes, xRel, 0);
if (hwnd==hSizeboxRightCenter) if (hwnd == hSizeboxRightCenter)
cropReversible(imgXRes+xRel, imgYRes, 0, 0); cropReversible(imgXRes + xRel, imgYRes, 0, 0);
if (hwnd==hSizeboxLeftBottom) if (hwnd == hSizeboxLeftBottom)
cropReversible(imgXRes-xRel, imgYRes+yRel, xRel, 0); cropReversible(imgXRes - xRel, imgYRes + yRel, xRel, 0);
if (hwnd==hSizeboxCenterBottom) if (hwnd == hSizeboxCenterBottom)
cropReversible(imgXRes, imgYRes+yRel, 0, 0); cropReversible(imgXRes, imgYRes + yRel, 0, 0);
if (hwnd==hSizeboxRightBottom) if (hwnd == hSizeboxRightBottom)
cropReversible(imgXRes+xRel, imgYRes+yRel, 0, 0); cropReversible(imgXRes + xRel, imgYRes + yRel, 0, 0);
SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM)_T("")); SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) _T(""));
} }
break; break;
default: default:
return DefWindowProc (hwnd, message, wParam, lParam); return DefWindowProc(hwnd, message, wParam, lParam);
} }
return 0; return 0;

View file

@ -1,9 +1,9 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: sizebox.h * FILE: base/applications/paint/sizebox.h
* PURPOSE: Window procedure of the size boxes * PURPOSE: Window procedure of the size boxes
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
LRESULT CALLBACK SizeboxWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK SizeboxWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

View file

@ -1,7 +1,7 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: toolsettings.c * FILE: base/applications/paint/toolsettings.c
* PURPOSE: Window procedure of the tool settings window * PURPOSE: Window procedure of the tool settings window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
@ -16,244 +16,242 @@
/* FUNCTIONS ********************************************************/ /* FUNCTIONS ********************************************************/
LRESULT CALLBACK SettingsWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) extern void zoomTo(int, int, int);
LRESULT CALLBACK
SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
{ {
case WM_VSCROLL: case WM_VSCROLL:
{ zoomTo(125 << SendMessage(hTrackbarZoom, TBM_GETPOS, 0, 0), 0, 0);
zoomTo(125<<SendMessage(hTrackbarZoom, TBM_GETPOS, 0, 0), 0, 0);
}
break; break;
case WM_PAINT: case WM_PAINT:
{
HDC hdc = GetDC(hwnd);
RECT rect1 = { 0, 0, 42, 66 };
RECT rect2 = { 0, 70, 42, 136 };
DefWindowProc(hwnd, message, wParam, lParam);
DrawEdge(hdc, &rect1, BDR_SUNKENOUTER, (activeTool == 6) ? BF_RECT : BF_RECT | BF_MIDDLE);
DrawEdge(hdc, &rect2, (activeTool >= 13) ? BDR_SUNKENOUTER : 0, BF_RECT | BF_MIDDLE);
switch (activeTool)
{ {
HDC hdc = GetDC(hwnd); case 1:
int rectang[4] = {0, 0, 42, 66}; case 2:
int rectang2[4] = {0, 70, 42, 136}; case 10:
DefWindowProc (hwnd, message, wParam, lParam);
if (activeTool!=6)
DrawEdge(hdc, (LPRECT)&rectang, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE);
else
DrawEdge(hdc, (LPRECT)&rectang, BDR_SUNKENOUTER, BF_RECT);
if (activeTool>=13)
DrawEdge(hdc, (LPRECT)&rectang2, BDR_SUNKENOUTER, BF_RECT | BF_MIDDLE);
else
DrawEdge(hdc, (LPRECT)&rectang2, 0, BF_RECT | BF_MIDDLE);
switch (activeTool)
{ {
case 1: HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
case 2: SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
case 10: Rectangle(hdc, 2, transpBg * 31 + 2, 41, transpBg * 31 + 33);
{ DeleteObject(SelectObject(hdc, oldPen));
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); DrawIconEx(hdc, 1, 2, hNontranspIcon, 40, 30, 0, NULL, DI_NORMAL);
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); DrawIconEx(hdc, 1, 33, hTranspIcon, 40, 30, 0, NULL, DI_NORMAL);
Rectangle(hdc, 2, transpBg*31+2, 41, transpBg*31+33); break;
DeleteObject(SelectObject(hdc, oldPen)); }
DrawIconEx(hdc, 1, 2, hNontranspIcon, 40, 30, 0, NULL, DI_NORMAL); case 3:
DrawIconEx(hdc, 1, 33, hTranspIcon, 40, 30, 0, NULL, DI_NORMAL); {
} int i;
break; HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
case 3: for(i = 0; i < 4; i++)
{ {
int i; if (rubberRadius == i + 2)
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); {
for (i=0; i<4; i++) SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
{ Rectangle(hdc, 14, i * 15 + 2, 29, i * 15 + 17);
if (rubberRadius==i+2) SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
{ }
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); else
Rectangle(hdc, 14, i*15+2, 29, i*15+17); SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT)); Rectangle(hdc, 19 - i, i * 14 + 7, 24 + i, i * 16 + 12);
} else SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT)); }
Rectangle(hdc, 19-i, i*14+7, 24+i, i*16+12); DeleteObject(SelectObject(hdc, oldPen));
} break;
DeleteObject(SelectObject(hdc, oldPen)); }
} case 8:
break; {
case 8: int i;
{ HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
int i; SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); Rectangle(hdc, brushStyle % 3 * 13 + 2, brushStyle / 3 * 15 + 2, brushStyle % 3 * 13 + 15,
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); brushStyle / 3 * 15 + 17);
Rectangle(hdc, brushStyle%3*13+2, brushStyle/3*15+2, brushStyle%3*13+15, brushStyle/3*15+17); DeleteObject(SelectObject(hdc, oldPen));
DeleteObject(SelectObject(hdc, oldPen)); for(i = 0; i < 12; i++)
for (i=0; i<12; i++) Brush(hdc, i % 3 * 13 + 7, i / 3 * 15 + 8, i % 3 * 13 + 7, i / 3 * 15 + 8,
if (i==brushStyle) GetSysColor((i == brushStyle) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), i);
Brush(hdc, i%3*13+7, i/3*15+8, i%3*13+7, i/3*15+8, GetSysColor(COLOR_HIGHLIGHTTEXT), i); break;
else }
Brush(hdc, i%3*13+7, i/3*15+8, i%3*13+7, i/3*15+8, GetSysColor(COLOR_WINDOWTEXT), i); case 9:
} {
break; HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
case 9: SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
{ switch (airBrushWidth)
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); {
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); case 5:
switch (airBrushWidth) Rectangle(hdc, 2, 2, 21, 31);
{ break;
case 5: case 8:
Rectangle(hdc, 2, 2, 21, 31); Rectangle(hdc, 20, 2, 41, 31);
break; break;
case 8: case 3:
Rectangle(hdc, 20, 2, 41, 31); Rectangle(hdc, 2, 30, 16, 61);
break; break;
case 3: case 12:
Rectangle(hdc, 2, 30, 16, 61); Rectangle(hdc, 15, 30, 41, 61);
break; break;
case 12: }
Rectangle(hdc, 15, 30, 41, 61); Airbrush(hdc, 10, 15,
break; GetSysColor((airBrushWidth == 5) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), 5);
} Airbrush(hdc, 30, 15,
if (airBrushWidth==5) GetSysColor((airBrushWidth == 8) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), 8);
Airbrush(hdc, 10, 15, GetSysColor(COLOR_HIGHLIGHTTEXT), 5); Airbrush(hdc, 8, 45,
else GetSysColor((airBrushWidth == 3) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), 3);
Airbrush(hdc, 10, 15, GetSysColor(COLOR_WINDOWTEXT), 5); Airbrush(hdc, 27, 45,
if (airBrushWidth==8) GetSysColor((airBrushWidth == 12) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT), 12);
Airbrush(hdc, 30, 15, GetSysColor(COLOR_HIGHLIGHTTEXT), 8); DeleteObject(SelectObject(hdc, oldPen));
else break;
Airbrush(hdc, 30, 15, GetSysColor(COLOR_WINDOWTEXT), 8); }
if (airBrushWidth==3) case 11:
Airbrush(hdc, 8, 45, GetSysColor(COLOR_HIGHLIGHTTEXT), 3); case 12:
else {
Airbrush(hdc, 8, 45, GetSysColor(COLOR_WINDOWTEXT), 3); int i;
if (airBrushWidth==12) HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
Airbrush(hdc, 27, 45, GetSysColor(COLOR_HIGHLIGHTTEXT), 12); for(i = 0; i < 5; i++)
else {
Airbrush(hdc, 27, 45, GetSysColor(COLOR_WINDOWTEXT), 12); if (lineWidth == i + 1)
DeleteObject(SelectObject(hdc, oldPen)); {
} SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
break; Rectangle(hdc, 2, i * 12 + 2, 41, i * 12 + 14);
case 11: SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
case 12: }
{ else
int i; SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); Rectangle(hdc, 5, i * 12 + 6, 38, i * 12 + 8 + i);
for (i=0; i<5; i++) }
{ DeleteObject(SelectObject(hdc, oldPen));
if (lineWidth==i+1) break;
{ }
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); case 13:
Rectangle(hdc, 2, i*12+2, 41, i*12+14); case 14:
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT)); case 15:
} else SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT)); case 16:
Rectangle(hdc, 5, i*12+6, 38, i*12+8+i); {
} int i;
DeleteObject(SelectObject(hdc, oldPen)); HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0));
} for(i = 0; i < 3; i++)
break; {
case 13: if (shapeStyle == i)
case 14: {
case 15: SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
case 16: Rectangle(hdc, 2, i * 20 + 2, 41, i * 20 + 22);
{ }
int i; }
HPEN oldPen = SelectObject(hdc, CreatePen(PS_NULL, 0, 0)); Rect(hdc, 5, 6, 37, 16,
for (i=0; i<3; i++) GetSysColor((shapeStyle == 0) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT),
{ GetSysColor(COLOR_APPWORKSPACE), 1, 0);
if (shapeStyle==i) Rect(hdc, 5, 26, 37, 36,
{ GetSysColor((shapeStyle == 1) ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT),
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT)); GetSysColor(COLOR_APPWORKSPACE), 1, 1);
Rectangle(hdc, 2, i*20+2, 41, i*20+22); Rect(hdc, 5, 46, 37, 56, GetSysColor(COLOR_APPWORKSPACE), GetSysColor(COLOR_APPWORKSPACE),
} 1, 1);
} for(i = 0; i < 5; i++)
if (shapeStyle==0) {
Rect(hdc, 5, 6, 37, 16, GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_APPWORKSPACE), 1, 0); if (lineWidth == i + 1)
else {
Rect(hdc, 5, 6, 37, 16, GetSysColor(COLOR_WINDOWTEXT), GetSysColor(COLOR_APPWORKSPACE), 1, 0); SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
if (shapeStyle==1) Rectangle(hdc, 2, i * 12 + 72, 41, i * 12 + 84);
Rect(hdc, 5, 26, 37, 36, GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_APPWORKSPACE), 1, 1); SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
else }
Rect(hdc, 5, 26, 37, 36, GetSysColor(COLOR_WINDOWTEXT), GetSysColor(COLOR_APPWORKSPACE), 1, 1); else
Rect(hdc, 5, 46, 37, 56, GetSysColor(COLOR_APPWORKSPACE), GetSysColor(COLOR_APPWORKSPACE), 1, 1); SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
for (i=0; i<5; i++) Rectangle(hdc, 5, i * 12 + 76, 38, i * 12 + 78 + i);
{ }
if (lineWidth==i+1) DeleteObject(SelectObject(hdc, oldPen));
{ break;
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
Rectangle(hdc, 2, i*12+72, 41, i*12+84);
SelectObject(hdc, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
} else SelectObject(hdc, GetSysColorBrush(COLOR_WINDOWTEXT));
Rectangle(hdc, 5, i*12+76, 38, i*12+78+i);
}
DeleteObject(SelectObject(hdc, oldPen));
}
break;
} }
ReleaseDC(hwnd, hdc);
} }
ReleaseDC(hwnd, hdc);
break; break;
}
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
{
switch (activeTool)
{ {
switch (activeTool) case 1:
{ case 2:
case 1: case 10:
case 2: if ((HIWORD(lParam) > 1) && (HIWORD(lParam) < 64))
case 10: {
if ((HIWORD(lParam)>1)&&(HIWORD(lParam)<64)) transpBg = (HIWORD(lParam) - 2) / 31;
SendMessage(hwnd, WM_PAINT, 0, 0);
}
break;
case 3:
if ((HIWORD(lParam) > 1) && (HIWORD(lParam) < 62))
{
rubberRadius = (HIWORD(lParam) - 2) / 15 + 2;
SendMessage(hwnd, WM_PAINT, 0, 0);
}
break;
case 8:
if ((LOWORD(lParam) > 1) && (LOWORD(lParam) < 40) && (HIWORD(lParam) > 1)
&& (HIWORD(lParam) < 62))
{
brushStyle = (HIWORD(lParam) - 2) / 15 * 3 + (LOWORD(lParam) - 2) / 13;
SendMessage(hwnd, WM_PAINT, 0, 0);
}
break;
case 9:
if (HIWORD(lParam) < 62)
{
if (HIWORD(lParam) < 30)
{ {
transpBg = (HIWORD(lParam)-2)/31; if (LOWORD(lParam) < 20)
SendMessage(hwnd, WM_PAINT, 0, 0); airBrushWidth = 5;
else
airBrushWidth = 8;
} }
break; else
case 3:
if ((HIWORD(lParam)>1)&&(HIWORD(lParam)<62))
{ {
rubberRadius = (HIWORD(lParam)-2)/15+2; if (LOWORD(lParam) < 15)
SendMessage(hwnd, WM_PAINT, 0, 0); airBrushWidth = 3;
else
airBrushWidth = 12;
} }
break; SendMessage(hwnd, WM_PAINT, 0, 0);
case 8: }
if ((LOWORD(lParam)>1)&&(LOWORD(lParam)<40)&&(HIWORD(lParam)>1)&&(HIWORD(lParam)<62)) break;
{ case 11:
brushStyle = (HIWORD(lParam)-2)/15*3+(LOWORD(lParam)-2)/13; case 12:
SendMessage(hwnd, WM_PAINT, 0, 0); if (HIWORD(lParam) <= 62)
} {
break; lineWidth = (HIWORD(lParam) - 2) / 12 + 1;
case 9: SendMessage(hwnd, WM_PAINT, 0, 0);
if (HIWORD(lParam)<62) }
{ break;
if (HIWORD(lParam)<30) case 13:
{ case 14:
if (LOWORD(lParam)<20) airBrushWidth=5; else airBrushWidth=8; case 15:
}else case 16:
{ if (HIWORD(lParam) <= 60)
if (LOWORD(lParam)<15) airBrushWidth=3; else airBrushWidth=12; {
} shapeStyle = (HIWORD(lParam) - 2) / 20;
SendMessage(hwnd, WM_PAINT, 0, 0); SendMessage(hwnd, WM_PAINT, 0, 0);
} }
break; if ((HIWORD(lParam) >= 70) && (HIWORD(lParam) <= 132))
case 11: {
case 12: lineWidth = (HIWORD(lParam) - 72) / 12 + 1;
if (HIWORD(lParam)<=62) SendMessage(hwnd, WM_PAINT, 0, 0);
{ }
lineWidth = (HIWORD(lParam)-2)/12+1; break;
SendMessage(hwnd, WM_PAINT, 0, 0);
}
break;
case 13:
case 14:
case 15:
case 16:
if (HIWORD(lParam)<=60)
{
shapeStyle = (HIWORD(lParam)-2)/20;
SendMessage(hwnd, WM_PAINT, 0, 0);
}
if ((HIWORD(lParam)>=70)&&(HIWORD(lParam)<=132))
{
lineWidth = (HIWORD(lParam)-72)/12+1;
SendMessage(hwnd, WM_PAINT, 0, 0);
}
break;
}
} }
break; break;
}
default: default:
return DefWindowProc (hwnd, message, wParam, lParam); return DefWindowProc(hwnd, message, wParam, lParam);
} }
return 0; return 0;
} }

View file

@ -1,9 +1,9 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: toolsettings.h * FILE: base/applications/paint/toolsettings.h
* PURPOSE: Window procedure of the tool settings window * PURPOSE: Window procedure of the tool settings window
* PROGRAMMERS: Benedikt Freisen * PROGRAMMERS: Benedikt Freisen
*/ */
LRESULT CALLBACK SettingsWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); LRESULT CALLBACK SettingsWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,10 @@
/* /*
* PROJECT: PAINT for ReactOS * PROJECT: PAINT for ReactOS
* LICENSE: LGPL * LICENSE: LGPL
* FILE: winproc.h * FILE: base/applications/paint/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
*/ */
void ZoomTo(int newZoom); LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);