Commit graph

278 commits

Author SHA1 Message Date
Andrei Miloiu c54f935918
[MSPAINT] Update Romanian (ro-RO) translation (#6364) 2024-01-15 22:05:02 +01:00
Andrei Miloiu acf170c95d
[MSPAINT] Update Romanian (ro-RO) translation (#6241) 2024-01-06 22:22:43 +01:00
Katayama Hirofumi MZ 3799d37a48 [MSPAINT] mouse.cpp: Renaming some items for human readability
CORE-19094
2023-11-25 14:14:14 +09:00
Katayama Hirofumi MZ fd38a6f788 [MSPAINT] mouse.cpp: Erase type warnings of SIZE_T vs. INT
CORE-19094
2023-11-25 14:09:20 +09:00
Katayama Hirofumi MZ b8598e095d
[MSPAINT] Improve Undo/Redo handling of selection (#6035)
Consistent behavior of the application.
- Add ShiftPtStack and BuildMaskFromPtStack
  helper functions.
- Move some codes of selectionModel to
  mouse.cpp.
CORE-19226
2023-11-25 13:44:31 +09:00
Katayama Hirofumi MZ f710e5a260
[MSPAINT] Define SelectionBaseTool and use it (#6034)
Refactoring and arrangement for selection handling.
- Move some selection-related codes in canvas.cpp to mouse.cpp.
- Add SelectionBaseTool structure for FreeSelTool and RectSelTool.
CORE-19094
2023-11-24 15:44:16 +09:00
Katayama Hirofumi MZ 898fb5f414 [MSPAINT] Move CHECKED_IF and ENABLED_IF macros and improve
Refactoring. CORE-19094
2023-11-24 10:39:16 +09:00
Katayama Hirofumi MZ e52379a61c [MSPAINT] Delete redundant comments
Refactoring. CORE-19094
2023-11-24 10:34:39 +09:00
Katayama Hirofumi MZ 2d5bb5ffbf [MSPAINT] Delete common.h and move code to precomp.h
Refactoring. CORE-19094
2023-11-24 10:25:47 +09:00
Katayama Hirofumi MZ 470d86f1e5 [MSPAINT] Delete globalvar.h and move code to precomp.h
Refactoring. CORE-19094
2023-11-24 10:12:37 +09:00
Katayama Hirofumi MZ bf13ebda44 [MSPAINT] Delete winproc.cpp and move code to main.cpp
Refactoring. This will reduce build time a little.
CORE-19094
2023-11-23 17:14:32 +09:00
Katayama Hirofumi MZ af4a3fac7d [MSPAINT] Rename winproc.h as main.h
Refactoring. CORE-19094
2023-11-23 17:06:32 +09:00
Katayama Hirofumi MZ c20b4ca29e [MSPAINT] Simplify mouse.cpp with deleting ctors
Refactoring. CORE-19094
2023-11-23 16:46:40 +09:00
Katayama Hirofumi MZ 96e48dcd01 [MSPAINT] ToolBase::m_tool is not used. Delete it
Refactoring. CORE-19094
2023-11-23 16:37:13 +09:00
Katayama Hirofumi MZ 1aeebfdacb [MSPAINT] Simplify RECT/CRect handling
Refactoring. CORE-19094
2023-11-23 15:19:50 +09:00
Katayama Hirofumi MZ f935132fbe [MSPAINT] Add selectionModel.moveSelection and use it
Refactoring. CORE-19094
2023-11-23 14:44:27 +09:00
Katayama Hirofumi MZ 58c26d3fe6 [MSPAINT] Simplify CanvasToImage
Refactoring. CORE-19094
2023-11-23 14:22:40 +09:00
Katayama Hirofumi MZ 4a52a4b04c [MSPAINT] Add selectionModel.drawFrameOnCanvas and use it
Refactoring. CORE-19094
2023-11-23 11:03:10 +09:00
Katayama Hirofumi MZ c2bb5aa01d [MSPAINT] Add selectionModel.hitTest and use it
Refactoring. CORE-19094
2023-11-23 10:31:24 +09:00
Katayama Hirofumi MZ e579220098
[MSPAINT] Introduce partial image history, Part 2 (#6005)
Follow-up to #5994. Reduce the lag and the
cost of drawing on large image.
- Introduce partial image history on
  SmoothDrawTool and ShapeTool.
- We can draw with pen smoothly even
  when the image is huge (10000x10000).
CORE-19237
2023-11-23 07:14:57 +09:00
Katayama Hirofumi MZ 72081168fb
[MSPAINT] Introduce partial image history (#5994)
- Add IMAGE_PART structure and use as history items.
- Overload ImageModel::PushImageForUndo(const RECT& rcPartial).
- Add ToolsModel::GetToolSize.
- Implement partial image history on TwoPointDrawTool.
CORE-19094
2023-11-19 12:59:39 +09:00
Katayama Hirofumi MZ 764e5505a7 [MSPAINT] Add get/putSubImage in dib.cpp and use them
CORE-19094
2023-11-18 14:25:19 +09:00
Katayama Hirofumi MZ a65ebc8a71 [MSPAINT] Fix PushImageForUndo (follow-up of 7c0615f)
CORE-19226, CORE-19237
2023-11-18 11:37:43 +09:00
Katayama Hirofumi MZ a58aee5f5b [MSPAINT] Use Swap in RegistrySettings::SetMostRecentFile
CORE-19237
2023-11-18 11:23:13 +09:00
Katayama Hirofumi MZ 7c0615fa05 [MSPAINT] Split master image from history items
CORE-19237
2023-11-18 11:19:38 +09:00
Katayama Hirofumi MZ 157739a658 [MSPAINT] s/AirBrushWidth/AirBrushRadius/
Fix logical error. CORE-19094
2023-11-16 15:45:06 +09:00
Andrei Miloiu 3285d2c769
[MSPAINT] Update Romanian (ro-RO) translation (#5913) 2023-11-08 20:01:21 +01:00
Katayama Hirofumi MZ fa4b38d902 [MSPAINT] Localize g_ptStart and g_ptEnd into mouse.cpp
And move some ToolsModel code into mouse.cpp
CORE-19094
2023-11-04 23:00:43 +09:00
Katayama Hirofumi MZ 56828b82d9
[MSPAINT] Distinguish between icons and cursors (#5884)
- Convert icons/*_cur.ico to the cursor files (*.cur).
- The hot spot is (16, 16) (default).
- Rename icons/ folder as img/.
- Use LoadCursorW instead of LoadIconW
  for cursors.
- Use CURSOR statements for cursor files
  instead of ICON statements in rsrc.rc.
- I used GIMP to convert the icon files to the PNG files.
- I used RealWorld Cursor Editor to convert the PNG files to the cursor files.
CORE-19297
2023-11-04 22:15:43 +09:00
Katayama Hirofumi MZ d21def4819
[MSPAINT] Use <winuser.rh> instead of <winuser.h> in rsrc.rc (#5883)
CORE-19094
2023-11-04 21:53:04 +09:00
Katayama Hirofumi MZ b69a7460db [MSPAINT] Fix filter string UNICODE_NULL problem
Follow-up to #5882.
Some ATL CString do not append the string if there is
a UNICODE_NULL in the middle.
CORE-19094
2023-11-04 19:50:36 +09:00
Katayama Hirofumi MZ 640d67d12a
[MSPAINT] Adapt to Unicode and <strsafe.h> (#5882)
- TCHAR --> WCHAR
- LPTSTR --> LPWSTR
- LPCTSTR --> LPCWSTR
- CString --> CStringW
- TEXT("...") --> L"..."
- _T("...") --> L"..."
- ::SendMessage( --> ::SendMessageW(
- ::GetWindowText( --> ::GetWindowTextW(
- ::SetWindowText( --> ::SetWindowTextW(
- Replace _tcscat with StringCchCatW.
- Replace _tcslen with wcslen.
etc. CORE-19094
2023-11-04 19:25:45 +09:00
Katayama Hirofumi MZ d7ece626cb
[MSPAINT] Fix Copy-To-File feature (#5877)
The Copy-To-File feature had some bugs that the user couldn't save.
- Modify SelectionModel::GetSelectionContents.
- Delete SelectionModel::CopyBitmap, SelectionModel::LockBitmap,
  and SelectionModel::UnlockBitmap functions.
CORE-19186
2023-11-04 05:56:10 +09:00
Katayama Hirofumi MZ a114169c4d
[MSPAINT] Refactor mouse moving code on canvas (#5878)
Move some mouse moving code to toolsModel.
CORE-19094
2023-11-03 22:41:06 +09:00
Katayama Hirofumi MZ a6418c848c
[MSPAINT] Simplify tool creation (#5876)
Reduce code and binary size. This will reduce 512 bytes in binary.
- Don't use cache for tool creation.
CORE-19094
2023-11-03 16:49:13 +09:00
Katayama Hirofumi MZ 37f56d2448
[MSPAINT] Commonize OnFinishDraw and OnCancelDraw (#5875)
Reduce code and binary size a bit. This will reduce 1024 bytes in binary.
Unify ToolBase::OnFinishDraw and ToolBase::OnCancelDraw to ToolBase::OnEndDraw.
CORE-19094
2023-11-03 16:20:03 +09:00
Katayama Hirofumi MZ 6d7aaaade0 [MSPAINT] Delete needless ImageModel::ResetToPrevious
CORE-19094
2023-10-31 11:13:54 +09:00
Katayama Hirofumi MZ aed376e00f [MSPAINT] Fix ImageModel::PushImageForUndo bug
CORE-19274
2023-10-30 07:41:57 +09:00
Katayama Hirofumi MZ ab199cc147
[MSPAINT] Show out-of-memory message (#5817)
- Improve ImageModel::PushImageForUndo.
- Use FormatMessage in newly added
  ShowOutOfMemory function.
- Call ShowOutOfMemory() when out of memory.
CORE-19227, CORE-19094
2023-10-25 02:35:49 +09:00
Katayama Hirofumi MZ 97e53c6963
[MSPAINT] Implement mouse middle button dragging (#5804)
- Handle WM_MBUTTONDOWN and
  WM_MBUTTONUP messages.
- Implement dragging by mouse middle button.
- Add IDC_HANDDRAG cursor resource.
CORE-19094
2023-10-17 15:58:34 +09:00
Katayama Hirofumi MZ f49919ce5d
[MSPAINT] Simplify canvas mouse message handling (#5803)
- Unify some mouse message handlers of
  CCanvasWindow.
- Add CCanvasWindow::m_nMouseDownMsg 
  member.
CORE-19094
2023-10-17 13:48:19 +09:00
Katayama Hirofumi MZ 8f1eb03ad2
[MSPAINT] Improve Zoom tool (#5798)
- Delete global zoomTo function.
- Add CCanvasWindow::zoomTo and
  CCanvasWindow::getNewZoomRect functions.
- Rename CCanvasWindow::updateScrollInfo as
  CCanvasWindow::updateScrollRange.
- Rename CCanvasWindow::resetScrollPos as
  CCanvasWindow::updateScrollPos.
- Draw the proper zoom rectangle on mouse move.
- Revert the active tool on click when the tool
  was Zoom.
CORE-19094
2023-10-17 07:25:50 +09:00
Katayama Hirofumi MZ fd1e158480
[MSPAINT] Calculate intersection to reduce bits transfer (#5795)
Drawing lines smoothly on big image.
- In CCanvasWindow::DoDraw, calculate the
  intersection to reduce bits transfer.
- Improve SmoothDrawTool in handling Shift key.
CORE-19094, CORE-19237
2023-10-16 09:09:40 +09:00
Katayama Hirofumi MZ 1c4bf2d702 [MSPAINT] Don't include useless <mapicode.h>
CORE-19094
2023-10-13 18:07:55 +09:00
Katayama Hirofumi MZ 1183e797b4
[MSPAINT] Reset scroll position in some situations (#5789)
In some situations, the scroll position should be reset.
- Add CCanvasWindow::resetScrollPos method.
- Reset the scroll position on loading a file.
- Reset the scroll position on mirroring/rotating
  the image.
CORE-19094
2023-10-12 22:59:17 +09:00
Katayama Hirofumi MZ 9a51c8e6c6
[MSPAINT][NOTEPAD][REGEDIT] Don't use CRTDBG for these apps (#5788)
Don't include <crtdbg.h>.
Don't use _CrtSetDbgFlag.
2023-10-12 22:53:02 +09:00
Katayama Hirofumi MZ 70d5c864bc [MSPAINT] Do type-cast (float) for xDpi and yDpi
CORE-19094
2023-10-12 19:43:29 +09:00
Katayama Hirofumi MZ 409df2355e [MSPAINT] Do type-cast (BYTE) for lfItalic and lfUnderline
CORE-19094
2023-10-12 19:38:41 +09:00
Katayama Hirofumi MZ 4306e261ee [MSPAINT] Do type-cast (BOOL) for TB_ISBUTTONCHECKED return
CORE-19094
2023-10-12 19:31:22 +09:00
Katayama Hirofumi MZ bc28675a44 [MSPAINT] s/WINBOOL/BOOL/
CORE-19094
2023-10-12 19:13:20 +09:00