[Scummvm-git-logs] scummvm master -> ee592cb2f7e970e78bca34713d7525d44e811fe5
sev-
noreply at scummvm.org
Sun Feb 15 13:41:47 UTC 2026
This automated email contains information about 35 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
a49d7a90e1 COMMON: Add PrintingManager
5214c42246 WIN32: Add printman subclass
bdf1249fd6 WIN32: Use GDI based printing
a8cf9c23e4 WIN32: Consistent palette reading
ff805ee019 COMMON, WIN32: Use ManagedSurface for printing
939621dc95 COMMON: Remove overload that accepted raw buffers
3ca0fa46bd WIN32: Use TCHAR in printing code
3c02d2a2f0 CONFIGURE, CREATE_PROJECT: Make printing a feature
be944b9c17 COMMON: Add define guards for printing feature
c088c8c495 WIN32: Add define guards for printing feature
d3a73f7a17 TESTBED: Initial printing test
dd9fc67b6d COMMON: Make job name a settable variable in PrintingManager
bfd946611e GUI: Add PrintingDialog class
d734138a35 COMMON: Add PrintingManager::saveAsImage() method
dd953935e3 WIN32: PRINTMAN: Replace Escape calls with proper functions
e97ed7f9f1 GUI: Add option to choose printer name
b00499f9b0 WIN32: PRINTMAN: Implement selecting printer name
e632479fa8 GUI: Add option to choose layout type in PrintingDialog
efa71e3c26 GUI: Add pop descriptions and cancel button to PrintingDialog
a304f852ce ALL: Remove USE_PRINTING and implement no-op default print manager
bfc958113d SCUMM: HE: Inital code for plugging in printing, taken from Henke38's PR
6dd889ea30 SCUMM: HE: Declare that we have printer
5a5abd78a4 GUI: Remove redundant namespace references
2c11bb0cce GUI: Added preview to print dialog
2a566ac9f5 GUI: Relax setting of GraphicsWidget graphics
c1780320e8 SCUMM: HE: Proper code for Wiz printing
3d4c810ef6 GUI: Scale print preview image to fit in the widget
c49c86929c GUI: Render whole page canvas with imge centered on it in print dialog
36edfe7268 BACKENDS: PRINTING: Use provided image palette instead of system one
777a2d6922 SCUMM: HE: Remove unnecessary check for compression in WIZ printing
33b967fa83 SCUMM: HE: Use system-wide palette for WIZ images for now
c00fe00e0c BACKENDS: PRINTING: Fix include
ff6f71b84c SCUMM: HE: Split printing code path into 16-bit/8-bit branches
8b345a9071 GUI: Reduced padding in lowres theme and synced classic with it
ee592cb2f7 GUI: Regenerate themes
Commit: a49d7a90e180a79e60ef2259c6045cfad07fb1f9
https://github.com/scummvm/scummvm/commit/a49d7a90e180a79e60ef2259c6045cfad07fb1f9
Author: Henrik "Henke37" Andersson (henke at henke37.cjb.net)
Date: 2026-02-15T14:37:24+01:00
Commit Message:
COMMON: Add PrintingManager
Changed paths:
A backends/printing/printman.cpp
A backends/printing/printman.h
backends/module.mk
common/system.cpp
common/system.h
diff --git a/backends/module.mk b/backends/module.mk
index d1ae9063d30..ab6a74b7961 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -23,6 +23,7 @@ MODULE_OBJS := \
midi/sndio.o \
midi/stmidi.o \
midi/timidity.o \
+ printing/printman.o \
saves/savefile.o \
saves/default/default-saves.o \
timer/default/default-timer.o
diff --git a/backends/printing/printman.cpp b/backends/printing/printman.cpp
new file mode 100644
index 00000000000..712b780a654
--- /dev/null
+++ b/backends/printing/printman.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "printman.h"
+
+namespace Common {
+
+PrintingManager::~PrintingManager() {}
+
+} // End of namespace Common
diff --git a/backends/printing/printman.h b/backends/printing/printman.h
new file mode 100644
index 00000000000..460ffed8217
--- /dev/null
+++ b/backends/printing/printman.h
@@ -0,0 +1,41 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef BACKENDS_PRINTING_PRINTMAN_H
+#define BACKENDS_PRINTING_PRINTMAN_H
+
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Common {
+
+class PrintingManager {
+public:
+ virtual ~PrintingManager();
+
+ virtual void printImage(const Common::String &jobName, byte *pixels, byte *palette, uint32 width, uint32 height) = 0;
+ void printImage(byte *pixels, byte *palette, uint32 width, uint32 height) {
+ printImage("ScummVM", pixels, palette, width, height);
+ }
+};
+} // End of namespace Common
+
+#endif
diff --git a/common/system.cpp b/common/system.cpp
index 3bd581655e4..4f74e223314 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -37,6 +37,7 @@
#include "backends/audiocd/default/default-audiocd.h"
#include "backends/fs/fs-factory.h"
+#include "backends/printing/printman.h"
#include "backends/timer/default/default-timer.h"
#include "backends/dlc/store.h"
@@ -47,6 +48,7 @@ OSystem::OSystem() {
_eventManager = nullptr;
_timerManager = nullptr;
_savefileManager = nullptr;
+ _printingManager = nullptr;
#if defined(USE_TASKBAR)
_taskbarManager = nullptr;
#endif
@@ -72,6 +74,9 @@ OSystem::~OSystem() {
delete _timerManager;
_timerManager = nullptr;
+ delete _printingManager;
+ _printingManager = nullptr;
+
#if defined(USE_TASKBAR)
delete _taskbarManager;
_taskbarManager = nullptr;
diff --git a/common/system.h b/common/system.h
index b1dc6a51b7d..ffa8a21afea 100644
--- a/common/system.h
+++ b/common/system.h
@@ -69,6 +69,7 @@ class TextToSpeechManager;
#if defined(USE_SYSDIALOGS)
class DialogManager;
#endif
+class PrintingManager;
class TimerManager;
class SeekableReadStream;
class WriteStream;
@@ -264,6 +265,13 @@ protected:
*/
FilesystemFactory *_fsFactory;
+ /**
+ * No default value is provided for _printingManager by OSystem.
+ *
+ * @note _printingManager is deleted by the OSystem destructor.
+ */
+ Common::PrintingManager *_printingManager;
+
/**
* Used by the DLC Manager implementation
*/
@@ -586,6 +594,11 @@ public:
*/
kFeatureNoQuit,
+ /**
+ * Putting text and/or images on physical paper
+ */
+ kFeaturePrinting,
+
/**
* The presence of this feature indicates that the backend uses a touchscreen.
*
@@ -1792,6 +1805,15 @@ public:
return _textToSpeechManager;
}
+ /**
+ * Return the PrintingManager, used to handle printing.
+ *
+ * @return The PrintingManager for the current architecture.
+ */
+ virtual Common::PrintingManager *getPrintingManager() {
+ return _printingManager;
+ }
+
#if defined(USE_SYSDIALOGS)
/**
* Return the DialogManager, which is used to handle system dialogs.
Commit: 5214c42246be59f8664bb24db073aad97b8bac4f
https://github.com/scummvm/scummvm/commit/5214c42246be59f8664bb24db073aad97b8bac4f
Author: Henrik "Henke37" Andersson (henke at henke37.cjb.net)
Date: 2026-02-15T14:37:24+01:00
Commit Message:
WIN32: Add printman subclass
Changed paths:
A backends/printing/win32/win32-printman.cpp
A backends/printing/win32/win32-printman.h
backends/module.mk
backends/platform/sdl/win32/win32.cpp
diff --git a/backends/module.mk b/backends/module.mk
index ab6a74b7961..1363a8d5b04 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -324,6 +324,7 @@ MODULE_OBJS += \
fs/windows/windows-fs-factory.o \
midi/windows.o \
plugins/win32/win32-provider.o \
+ printing/win32/win32-printman.o \
saves/windows/windows-saves.o \
updates/win32/win32-updates.o \
taskbar/win32/win32-taskbar.o
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index a08c027b2ce..040cb6da580 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -48,6 +48,7 @@
#include "backends/taskbar/win32/win32-taskbar.h"
#include "backends/updates/win32/win32-updates.h"
#include "backends/dialogs/win32/win32-dialogs.h"
+#include "backends/printing/win32/win32-printman.h"
#include "common/memstream.h"
#include "common/ustr.h"
@@ -83,6 +84,9 @@ void OSystem_Win32::init() {
#if defined(USE_JPEG)
initializeJpegLibraryForWin95();
#endif
+
+ _printingManager = createWin32PrintingManager();
+
// Invoke parent implementation of this method
OSystem_SDL::init();
}
@@ -152,6 +156,9 @@ bool OSystem_Win32::hasFeature(Feature f) {
return true;
#endif
+ if (f == kFeaturePrinting)
+ return true;
+
return OSystem_SDL::hasFeature(f);
}
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
new file mode 100644
index 00000000000..61b2fd24397
--- /dev/null
+++ b/backends/printing/win32/win32-printman.cpp
@@ -0,0 +1,99 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifdef WIN32
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winspool.h>
+
+#include "backends/printing/printman.h"
+#include "win32-printman.h"
+#include "common/ustr.h"
+
+
+class Win32PrintingManager : public Common::PrintingManager {
+public:
+ virtual ~Win32PrintingManager();
+
+ virtual void printImage(const Common::String &jobName, byte *pixels, byte *palette, uint32 width, uint32 height);
+
+private:
+ HANDLE openDefaultPrinter();
+ //HDC createPrinterContext(HANDLE printer);
+};
+
+
+Win32PrintingManager::~Win32PrintingManager() {}
+
+void Win32PrintingManager::printImage(const Common::String &jobName, byte *pixels, byte *palette, uint32 width, uint32 height) {
+ BOOL success;
+
+ // open printer
+ HANDLE printer = openDefaultPrinter();
+
+ // create job
+ DOC_INFO_1A docInfo;
+ docInfo.pOutputFile = NULL;
+ docInfo.pDocName = const_cast<LPSTR>(jobName.c_str());
+ docInfo.pDatatype = "BITMAP";
+ DWORD job = StartDocPrinterA(printer, 1, (LPBYTE) & docInfo);
+ if (!job) {
+ ClosePrinter(printer);
+ return;
+ }
+
+ // do the page
+ success = StartPagePrinter(printer);
+
+ success = EndPagePrinter(printer);
+
+ // close job
+ success = EndDocPrinter(printer);
+
+ // close printer
+ success = ClosePrinter(printer);
+}
+
+HANDLE Win32PrintingManager::openDefaultPrinter() {
+ wchar_t szPrinter[MAX_PATH];
+ HANDLE handle;
+ DWORD cchPrinter(ARRAYSIZE(szPrinter));
+ GetDefaultPrinterW(szPrinter, &cchPrinter);
+ OpenPrinterW(szPrinter, &handle, NULL);
+
+ return handle;
+}
+
+/*
+HDC Win32PrintingManager::createPrinterContext(HANDLE printer) {
+ int size = DocumentPropertiesW(NULL, printer, szPrinter, NULL, NULL, 0);
+ DEVMODE *devmode = (DEVMODE *)malloc(size);
+ DocumentPropertiesW(NULL, printer, szPrinter, devmode, NULL, DM_OUT_BUFFER);
+ HDC printerDC = CreateDCW(L"WINSPOOL", szPrinter, NULL, devmode);
+ return printerDC;
+}*/
+
+Common::PrintingManager *createWin32PrintingManager() {
+ return new Win32PrintingManager();
+}
+
+#endif
diff --git a/backends/printing/win32/win32-printman.h b/backends/printing/win32/win32-printman.h
new file mode 100644
index 00000000000..485e354d831
--- /dev/null
+++ b/backends/printing/win32/win32-printman.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef BACKENDS_PRINTING_WIN32_PRINTMAN_H
+#define BACKENDS_PRINTING_WIN32_PRINTMAN_H
+
+#ifdef WIN32
+
+namespace Common {
+class PrintingManager;
+}
+
+/**
+ * Create an PrintingManager using the Win32 API
+ */
+Common::PrintingManager *createWin32PrintingManager();
+
+#endif
+
+#endif
Commit: bdf1249fd61b1b834515657ee082d4f1df0ab893
https://github.com/scummvm/scummvm/commit/bdf1249fd61b1b834515657ee082d4f1df0ab893
Author: Henrik "Henke37" Andersson (henke at henke37.cjb.net)
Date: 2026-02-15T14:37:25+01:00
Commit Message:
WIN32: Use GDI based printing
Changed paths:
backends/printing/win32/win32-printman.cpp
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index 61b2fd24397..72f19d227ec 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -37,60 +37,126 @@ public:
virtual void printImage(const Common::String &jobName, byte *pixels, byte *palette, uint32 width, uint32 height);
private:
- HANDLE openDefaultPrinter();
- //HDC createPrinterContext(HANDLE printer);
+ HDC createDefaultPrinterContext();
+ HDC createPrinterContext(LPWSTR devName);
+ HPALETTE buildPalette(byte *paletteData);
+ HBITMAP buildBitmap(HDC hdc, byte *pixels, byte *palette, uint width, uint height);
};
Win32PrintingManager::~Win32PrintingManager() {}
-void Win32PrintingManager::printImage(const Common::String &jobName, byte *pixels, byte *palette, uint32 width, uint32 height) {
- BOOL success;
+void Win32PrintingManager::printImage(const Common::String &jobName, byte *pixels, byte *paletteData, uint32 width, uint32 height) {
+ HDC hdcPrint = createDefaultPrinterContext();
+
+ HDC hdcImg = CreateCompatibleDC(hdcPrint);
- // open printer
- HANDLE printer = openDefaultPrinter();
-
- // create job
- DOC_INFO_1A docInfo;
- docInfo.pOutputFile = NULL;
- docInfo.pDocName = const_cast<LPSTR>(jobName.c_str());
- docInfo.pDatatype = "BITMAP";
- DWORD job = StartDocPrinterA(printer, 1, (LPBYTE) & docInfo);
- if (!job) {
- ClosePrinter(printer);
+ HPALETTE pal = buildPalette(paletteData);
+ HBITMAP bitmap = buildBitmap(hdcImg, pixels, paletteData, width, height);
+ if (!bitmap) {
+ DeleteDC(hdcImg);
return;
}
- // do the page
- success = StartPagePrinter(printer);
+ Escape(hdcPrint, STARTDOC, jobName.size(), jobName.c_str(), NULL);
- success = EndPagePrinter(printer);
+ SelectPalette(hdcImg, pal, TRUE);
+ RealizePalette(hdcImg);
+ SelectObject(hdcImg, bitmap);
- // close job
- success = EndDocPrinter(printer);
+ BitBlt(hdcPrint, 0, 0, width, height, hdcImg, 0, 0, SRCCOPY);
- // close printer
- success = ClosePrinter(printer);
+ Escape(hdcPrint, NEWFRAME, 0, NULL, NULL);
+ Escape(hdcPrint, ENDDOC, 0, NULL, NULL);
+
+ DeleteObject(bitmap);
+ DeleteDC(hdcImg);
+ DeleteDC(hdcPrint);
}
-HANDLE Win32PrintingManager::openDefaultPrinter() {
+HDC Win32PrintingManager::createDefaultPrinterContext() {
wchar_t szPrinter[MAX_PATH];
- HANDLE handle;
+ BOOL success;
DWORD cchPrinter(ARRAYSIZE(szPrinter));
- GetDefaultPrinterW(szPrinter, &cchPrinter);
- OpenPrinterW(szPrinter, &handle, NULL);
- return handle;
+ success = GetDefaultPrinterW(szPrinter, &cchPrinter);
+ if (!success)
+ return NULL;
+
+ return createPrinterContext(szPrinter);
}
-/*
-HDC Win32PrintingManager::createPrinterContext(HANDLE printer) {
- int size = DocumentPropertiesW(NULL, printer, szPrinter, NULL, NULL, 0);
+HDC Win32PrintingManager::createPrinterContext(LPWSTR devName) {
+ HANDLE handle;
+ BOOL success;
+
+ success = OpenPrinterW(devName, &handle, NULL);
+ if (!success)
+ return NULL;
+
+ int size = DocumentPropertiesW(NULL, handle, devName, NULL, NULL, 0);
DEVMODE *devmode = (DEVMODE *)malloc(size);
- DocumentPropertiesW(NULL, printer, szPrinter, devmode, NULL, DM_OUT_BUFFER);
- HDC printerDC = CreateDCW(L"WINSPOOL", szPrinter, NULL, devmode);
+ DocumentPropertiesW(NULL, handle, devName, devmode, NULL, DM_OUT_BUFFER);
+
+ ClosePrinter(handle);
+
+ HDC printerDC = CreateDCW(L"WINSPOOL", devName, NULL, devmode);
return printerDC;
-}*/
+}
+
+HPALETTE Win32PrintingManager::buildPalette(byte *paletteData) {
+ LOGPALETTE *lpal = (LOGPALETTE *)malloc(sizeof(LOGPALETTE) + (256 - 1) * sizeof(PALETTEENTRY));
+
+ if (!lpal)
+ return NULL;
+
+ lpal->palNumEntries = 256;
+ lpal->palVersion = 1;
+
+ for (uint i = 0; i < 256; ++i, paletteData += 3) {
+ lpal->palPalEntry[i].peBlue = paletteData[0];
+ lpal->palPalEntry[i].peRed = paletteData[1];
+ lpal->palPalEntry[i].peGreen = paletteData[2];
+ lpal->palPalEntry[i].peFlags = 0;
+ }
+
+ HPALETTE pal = CreatePalette(lpal);
+
+ free(lpal);
+
+ return pal;
+}
+
+HBITMAP Win32PrintingManager::buildBitmap(HDC hdc, byte *pixels, byte *palette, uint width, uint height) {
+ const uint colorCount = 256;
+ BITMAPINFO *bitmapInfo = (BITMAPINFO *)malloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD) * (colorCount - 1));
+
+ if (!bitmapInfo)
+ return NULL;
+
+ bitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bitmapInfo->bmiHeader.biWidth = width;
+ bitmapInfo->bmiHeader.biHeight = -((LONG)height);
+ bitmapInfo->bmiHeader.biPlanes = 1;
+ bitmapInfo->bmiHeader.biBitCount = 8;
+ bitmapInfo->bmiHeader.biCompression = BI_RGB;
+ bitmapInfo->bmiHeader.biSizeImage = 0;
+ bitmapInfo->bmiHeader.biClrUsed = colorCount;
+ bitmapInfo->bmiHeader.biClrImportant = colorCount;
+
+ for (uint colorIndex = 0; colorIndex < colorCount; ++colorIndex, palette += 3) {
+ bitmapInfo->bmiColors[colorIndex].rgbRed = palette[0];
+ bitmapInfo->bmiColors[colorIndex].rgbGreen = palette[1];
+ bitmapInfo->bmiColors[colorIndex].rgbBlue = palette[2];
+ bitmapInfo->bmiColors[colorIndex].rgbReserved = 0;
+ }
+
+ HBITMAP bitmap = CreateDIBitmap(hdc, &(bitmapInfo->bmiHeader), CBM_INIT, pixels, bitmapInfo, DIB_RGB_COLORS);
+
+ free(bitmapInfo);
+
+ return bitmap;
+}
Common::PrintingManager *createWin32PrintingManager() {
return new Win32PrintingManager();
Commit: a8cf9c23e4bf0e2761ca5eff5ae111b9a6ab8694
https://github.com/scummvm/scummvm/commit/a8cf9c23e4bf0e2761ca5eff5ae111b9a6ab8694
Author: Henrik "Henke37" Andersson (henke at henke37.cjb.net)
Date: 2026-02-15T14:37:25+01:00
Commit Message:
WIN32: Consistent palette reading
Changed paths:
backends/printing/win32/win32-printman.cpp
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index 72f19d227ec..9a08483bb77 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -114,9 +114,9 @@ HPALETTE Win32PrintingManager::buildPalette(byte *paletteData) {
lpal->palVersion = 1;
for (uint i = 0; i < 256; ++i, paletteData += 3) {
- lpal->palPalEntry[i].peBlue = paletteData[0];
- lpal->palPalEntry[i].peRed = paletteData[1];
- lpal->palPalEntry[i].peGreen = paletteData[2];
+ lpal->palPalEntry[i].peRed = paletteData[0];
+ lpal->palPalEntry[i].peGreen = paletteData[1];
+ lpal->palPalEntry[i].peBlue = paletteData[2];
lpal->palPalEntry[i].peFlags = 0;
}
Commit: ff805ee0197feb07a226cc7aa67682f51240bef1
https://github.com/scummvm/scummvm/commit/ff805ee0197feb07a226cc7aa67682f51240bef1
Author: Henrik "Henke37" Andersson (henke at henke37.cjb.net)
Date: 2026-02-15T14:37:25+01:00
Commit Message:
COMMON, WIN32: Use ManagedSurface for printing
The memory HDC is monochrome. The real one is in color, provided that the printer can do it.
Changed paths:
backends/printing/printman.h
backends/printing/win32/win32-printman.cpp
diff --git a/backends/printing/printman.h b/backends/printing/printman.h
index 460ffed8217..321b9a76c83 100644
--- a/backends/printing/printman.h
+++ b/backends/printing/printman.h
@@ -24,6 +24,7 @@
#include "common/scummsys.h"
#include "common/str.h"
+#include "graphics/managed_surface.h"
namespace Common {
@@ -31,10 +32,16 @@ class PrintingManager {
public:
virtual ~PrintingManager();
- virtual void printImage(const Common::String &jobName, byte *pixels, byte *palette, uint32 width, uint32 height) = 0;
- void printImage(byte *pixels, byte *palette, uint32 width, uint32 height) {
+ virtual void printImage(const Common::String &jobName, const Graphics::ManagedSurface &surf) = 0;
+
+ virtual void printImage(const Common::String &jobName, const byte *pixels, const byte *palette, uint32 width, uint32 height) = 0;
+ void printImage(const byte *pixels, const byte *palette, uint32 width, uint32 height) {
printImage("ScummVM", pixels, palette, width, height);
}
+
+ void printImage(const Graphics::ManagedSurface &surf) {
+ printImage("ScummVM", surf);
+ }
};
} // End of namespace Common
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index 9a08483bb77..f769a1c2fe9 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -34,25 +34,52 @@ class Win32PrintingManager : public Common::PrintingManager {
public:
virtual ~Win32PrintingManager();
- virtual void printImage(const Common::String &jobName, byte *pixels, byte *palette, uint32 width, uint32 height);
+ void printImage(const Common::String &jobName, const Graphics::ManagedSurface &surf) override;
+ void printImage(const Common::String &jobName, const byte *pixels, const byte *palette, uint32 width, uint32 height) override;
private:
HDC createDefaultPrinterContext();
HDC createPrinterContext(LPWSTR devName);
- HPALETTE buildPalette(byte *paletteData);
- HBITMAP buildBitmap(HDC hdc, byte *pixels, byte *palette, uint width, uint height);
+ HPALETTE buildPalette(const byte *paletteData);
+ HBITMAP buildBitmap(HDC hdc, const byte *pixels, const byte *palette, uint width, uint height);
+ HBITMAP buildBitmap(HDC hdc, const Graphics::ManagedSurface &surf);
};
Win32PrintingManager::~Win32PrintingManager() {}
-void Win32PrintingManager::printImage(const Common::String &jobName, byte *pixels, byte *paletteData, uint32 width, uint32 height) {
+void Win32PrintingManager::printImage(const Common::String &jobName, const Graphics::ManagedSurface &surf) {
+
+ HDC hdcPrint = createDefaultPrinterContext();
+
+ HDC hdcImg = CreateCompatibleDC(hdcPrint);
+
+ HBITMAP bitmap = buildBitmap(hdcPrint, surf);
+ if (!bitmap) {
+ DeleteDC(hdcImg);
+ return;
+ }
+
+ Escape(hdcPrint, STARTDOC, jobName.size(), jobName.c_str(), NULL);
+
+ SelectObject(hdcImg, bitmap);
+
+ BitBlt(hdcPrint, 0, 0, surf.w, surf.h, hdcImg, 0, 0, SRCCOPY);
+
+ Escape(hdcPrint, NEWFRAME, 0, NULL, NULL);
+ Escape(hdcPrint, ENDDOC, 0, NULL, NULL);
+
+ DeleteObject(bitmap);
+ DeleteDC(hdcImg);
+ DeleteDC(hdcPrint);
+}
+
+void Win32PrintingManager::printImage(Common::String jobName, const byte *pixels, const byte *paletteData, uint32 width, uint32 height) {
HDC hdcPrint = createDefaultPrinterContext();
HDC hdcImg = CreateCompatibleDC(hdcPrint);
- HPALETTE pal = buildPalette(paletteData);
- HBITMAP bitmap = buildBitmap(hdcImg, pixels, paletteData, width, height);
+ HBITMAP bitmap = buildBitmap(hdcPrint, pixels, paletteData, width, height);
if (!bitmap) {
DeleteDC(hdcImg);
return;
@@ -60,11 +87,10 @@ void Win32PrintingManager::printImage(const Common::String &jobName, byte *pixel
Escape(hdcPrint, STARTDOC, jobName.size(), jobName.c_str(), NULL);
- SelectPalette(hdcImg, pal, TRUE);
- RealizePalette(hdcImg);
SelectObject(hdcImg, bitmap);
BitBlt(hdcPrint, 0, 0, width, height, hdcImg, 0, 0, SRCCOPY);
+ //TransparentBlt(hdcPrint, 0, 0, width, height, hdcImg, 0, 0, width, height, transpColor);
Escape(hdcPrint, NEWFRAME, 0, NULL, NULL);
Escape(hdcPrint, ENDDOC, 0, NULL, NULL);
@@ -74,6 +100,7 @@ void Win32PrintingManager::printImage(const Common::String &jobName, byte *pixel
DeleteDC(hdcPrint);
}
+
HDC Win32PrintingManager::createDefaultPrinterContext() {
wchar_t szPrinter[MAX_PATH];
BOOL success;
@@ -104,7 +131,7 @@ HDC Win32PrintingManager::createPrinterContext(LPWSTR devName) {
return printerDC;
}
-HPALETTE Win32PrintingManager::buildPalette(byte *paletteData) {
+HPALETTE Win32PrintingManager::buildPalette(const byte *paletteData) {
LOGPALETTE *lpal = (LOGPALETTE *)malloc(sizeof(LOGPALETTE) + (256 - 1) * sizeof(PALETTEENTRY));
if (!lpal)
@@ -127,7 +154,7 @@ HPALETTE Win32PrintingManager::buildPalette(byte *paletteData) {
return pal;
}
-HBITMAP Win32PrintingManager::buildBitmap(HDC hdc, byte *pixels, byte *palette, uint width, uint height) {
+HBITMAP Win32PrintingManager::buildBitmap(HDC hdc, const byte *pixels, const byte *palette, uint width, uint height) {
const uint colorCount = 256;
BITMAPINFO *bitmapInfo = (BITMAPINFO *)malloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD) * (colorCount - 1));
@@ -158,6 +185,45 @@ HBITMAP Win32PrintingManager::buildBitmap(HDC hdc, byte *pixels, byte *palette,
return bitmap;
}
+HBITMAP Win32PrintingManager::buildBitmap(HDC hdc, const Graphics::ManagedSurface &surf) {
+ const uint colorCount = 256;
+ BITMAPINFO *bitmapInfo = (BITMAPINFO *)malloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD) * (colorCount - 1));
+
+ if (!bitmapInfo)
+ return NULL;
+
+ bitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bitmapInfo->bmiHeader.biWidth = surf.w;
+ bitmapInfo->bmiHeader.biHeight = -((LONG)surf.h);
+ bitmapInfo->bmiHeader.biPlanes = 1;
+ bitmapInfo->bmiHeader.biBitCount = (surf.format.isCLUT8() ? 8 : surf.format.bpp());
+ bitmapInfo->bmiHeader.biCompression = BI_RGB;
+ bitmapInfo->bmiHeader.biSizeImage = 0;
+ bitmapInfo->bmiHeader.biClrUsed = (surf.format.isCLUT8() ? colorCount : 0);
+ bitmapInfo->bmiHeader.biClrImportant = (surf.format.isCLUT8() ? colorCount : 0);
+
+ if (surf.hasPalette()) {
+ byte *colors = new byte[colorCount * 3];
+ surf.grabPalette(colors, 0, colorCount);
+
+ byte *palette = colors;
+ for (uint colorIndex = 0; colorIndex < colorCount; ++colorIndex, palette += 3) {
+ bitmapInfo->bmiColors[colorIndex].rgbRed = palette[0];
+ bitmapInfo->bmiColors[colorIndex].rgbGreen = palette[1];
+ bitmapInfo->bmiColors[colorIndex].rgbBlue = palette[2];
+ bitmapInfo->bmiColors[colorIndex].rgbReserved = 0;
+ }
+
+ delete[] colors;
+ }
+
+ HBITMAP bitmap = CreateDIBitmap(hdc, &(bitmapInfo->bmiHeader), CBM_INIT, surf.getPixels(), bitmapInfo, DIB_RGB_COLORS);
+
+ free(bitmapInfo);
+
+ return bitmap;
+}
+
Common::PrintingManager *createWin32PrintingManager() {
return new Win32PrintingManager();
}
Commit: 939621dc95313870d129f711fd744c84684452f3
https://github.com/scummvm/scummvm/commit/939621dc95313870d129f711fd744c84684452f3
Author: Henrik "Henke37" Andersson (henke at henke37.cjb.net)
Date: 2026-02-15T14:37:25+01:00
Commit Message:
COMMON: Remove overload that accepted raw buffers
Changed paths:
backends/printing/printman.h
backends/printing/win32/win32-printman.cpp
diff --git a/backends/printing/printman.h b/backends/printing/printman.h
index 321b9a76c83..76e8fbb3b7c 100644
--- a/backends/printing/printman.h
+++ b/backends/printing/printman.h
@@ -34,11 +34,6 @@ public:
virtual void printImage(const Common::String &jobName, const Graphics::ManagedSurface &surf) = 0;
- virtual void printImage(const Common::String &jobName, const byte *pixels, const byte *palette, uint32 width, uint32 height) = 0;
- void printImage(const byte *pixels, const byte *palette, uint32 width, uint32 height) {
- printImage("ScummVM", pixels, palette, width, height);
- }
-
void printImage(const Graphics::ManagedSurface &surf) {
printImage("ScummVM", surf);
}
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index f769a1c2fe9..828833f8793 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -35,13 +35,10 @@ public:
virtual ~Win32PrintingManager();
void printImage(const Common::String &jobName, const Graphics::ManagedSurface &surf) override;
- void printImage(const Common::String &jobName, const byte *pixels, const byte *palette, uint32 width, uint32 height) override;
private:
HDC createDefaultPrinterContext();
HDC createPrinterContext(LPWSTR devName);
- HPALETTE buildPalette(const byte *paletteData);
- HBITMAP buildBitmap(HDC hdc, const byte *pixels, const byte *palette, uint width, uint height);
HBITMAP buildBitmap(HDC hdc, const Graphics::ManagedSurface &surf);
};
@@ -74,33 +71,6 @@ void Win32PrintingManager::printImage(const Common::String &jobName, const Graph
DeleteDC(hdcPrint);
}
-void Win32PrintingManager::printImage(Common::String jobName, const byte *pixels, const byte *paletteData, uint32 width, uint32 height) {
- HDC hdcPrint = createDefaultPrinterContext();
-
- HDC hdcImg = CreateCompatibleDC(hdcPrint);
-
- HBITMAP bitmap = buildBitmap(hdcPrint, pixels, paletteData, width, height);
- if (!bitmap) {
- DeleteDC(hdcImg);
- return;
- }
-
- Escape(hdcPrint, STARTDOC, jobName.size(), jobName.c_str(), NULL);
-
- SelectObject(hdcImg, bitmap);
-
- BitBlt(hdcPrint, 0, 0, width, height, hdcImg, 0, 0, SRCCOPY);
- //TransparentBlt(hdcPrint, 0, 0, width, height, hdcImg, 0, 0, width, height, transpColor);
-
- Escape(hdcPrint, NEWFRAME, 0, NULL, NULL);
- Escape(hdcPrint, ENDDOC, 0, NULL, NULL);
-
- DeleteObject(bitmap);
- DeleteDC(hdcImg);
- DeleteDC(hdcPrint);
-}
-
-
HDC Win32PrintingManager::createDefaultPrinterContext() {
wchar_t szPrinter[MAX_PATH];
BOOL success;
@@ -131,60 +101,6 @@ HDC Win32PrintingManager::createPrinterContext(LPWSTR devName) {
return printerDC;
}
-HPALETTE Win32PrintingManager::buildPalette(const byte *paletteData) {
- LOGPALETTE *lpal = (LOGPALETTE *)malloc(sizeof(LOGPALETTE) + (256 - 1) * sizeof(PALETTEENTRY));
-
- if (!lpal)
- return NULL;
-
- lpal->palNumEntries = 256;
- lpal->palVersion = 1;
-
- for (uint i = 0; i < 256; ++i, paletteData += 3) {
- lpal->palPalEntry[i].peRed = paletteData[0];
- lpal->palPalEntry[i].peGreen = paletteData[1];
- lpal->palPalEntry[i].peBlue = paletteData[2];
- lpal->palPalEntry[i].peFlags = 0;
- }
-
- HPALETTE pal = CreatePalette(lpal);
-
- free(lpal);
-
- return pal;
-}
-
-HBITMAP Win32PrintingManager::buildBitmap(HDC hdc, const byte *pixels, const byte *palette, uint width, uint height) {
- const uint colorCount = 256;
- BITMAPINFO *bitmapInfo = (BITMAPINFO *)malloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD) * (colorCount - 1));
-
- if (!bitmapInfo)
- return NULL;
-
- bitmapInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bitmapInfo->bmiHeader.biWidth = width;
- bitmapInfo->bmiHeader.biHeight = -((LONG)height);
- bitmapInfo->bmiHeader.biPlanes = 1;
- bitmapInfo->bmiHeader.biBitCount = 8;
- bitmapInfo->bmiHeader.biCompression = BI_RGB;
- bitmapInfo->bmiHeader.biSizeImage = 0;
- bitmapInfo->bmiHeader.biClrUsed = colorCount;
- bitmapInfo->bmiHeader.biClrImportant = colorCount;
-
- for (uint colorIndex = 0; colorIndex < colorCount; ++colorIndex, palette += 3) {
- bitmapInfo->bmiColors[colorIndex].rgbRed = palette[0];
- bitmapInfo->bmiColors[colorIndex].rgbGreen = palette[1];
- bitmapInfo->bmiColors[colorIndex].rgbBlue = palette[2];
- bitmapInfo->bmiColors[colorIndex].rgbReserved = 0;
- }
-
- HBITMAP bitmap = CreateDIBitmap(hdc, &(bitmapInfo->bmiHeader), CBM_INIT, pixels, bitmapInfo, DIB_RGB_COLORS);
-
- free(bitmapInfo);
-
- return bitmap;
-}
-
HBITMAP Win32PrintingManager::buildBitmap(HDC hdc, const Graphics::ManagedSurface &surf) {
const uint colorCount = 256;
BITMAPINFO *bitmapInfo = (BITMAPINFO *)malloc(sizeof(BITMAPINFO) + sizeof(RGBQUAD) * (colorCount - 1));
Commit: 3ca0fa46bd9ac84705517213634166078e457cd7
https://github.com/scummvm/scummvm/commit/3ca0fa46bd9ac84705517213634166078e457cd7
Author: Henrik "Henke37" Andersson (henke at henke37.cjb.net)
Date: 2026-02-15T14:37:25+01:00
Commit Message:
WIN32: Use TCHAR in printing code
Changed paths:
backends/printing/win32/win32-printman.cpp
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index 828833f8793..c389399f1c8 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -38,7 +38,7 @@ public:
private:
HDC createDefaultPrinterContext();
- HDC createPrinterContext(LPWSTR devName);
+ HDC createPrinterContext(LPTSTR devName);
HBITMAP buildBitmap(HDC hdc, const Graphics::ManagedSurface &surf);
};
@@ -72,32 +72,32 @@ void Win32PrintingManager::printImage(const Common::String &jobName, const Graph
}
HDC Win32PrintingManager::createDefaultPrinterContext() {
- wchar_t szPrinter[MAX_PATH];
+ TCHAR szPrinter[MAX_PATH];
BOOL success;
DWORD cchPrinter(ARRAYSIZE(szPrinter));
- success = GetDefaultPrinterW(szPrinter, &cchPrinter);
+ success = GetDefaultPrinter(szPrinter, &cchPrinter);
if (!success)
return NULL;
return createPrinterContext(szPrinter);
}
-HDC Win32PrintingManager::createPrinterContext(LPWSTR devName) {
+HDC Win32PrintingManager::createPrinterContext(LPTSTR devName) {
HANDLE handle;
BOOL success;
- success = OpenPrinterW(devName, &handle, NULL);
+ success = OpenPrinter(devName, &handle, NULL);
if (!success)
return NULL;
- int size = DocumentPropertiesW(NULL, handle, devName, NULL, NULL, 0);
+ int size = DocumentProperties(NULL, handle, devName, NULL, NULL, 0);
DEVMODE *devmode = (DEVMODE *)malloc(size);
- DocumentPropertiesW(NULL, handle, devName, devmode, NULL, DM_OUT_BUFFER);
+ DocumentProperties(NULL, handle, devName, devmode, NULL, DM_OUT_BUFFER);
ClosePrinter(handle);
- HDC printerDC = CreateDCW(L"WINSPOOL", devName, NULL, devmode);
+ HDC printerDC = CreateDC(TEXT("WINSPOOL"), devName, NULL, devmode);
return printerDC;
}
Commit: 3c02d2a2f0b86b3c80a69c2589e1ffff7381e363
https://github.com/scummvm/scummvm/commit/3c02d2a2f0b86b3c80a69c2589e1ffff7381e363
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:25+01:00
Commit Message:
CONFIGURE, CREATE_PROJECT: Make printing a feature
Changed paths:
configure
devtools/create_project/create_project.cpp
devtools/create_project/msvc.cpp
diff --git a/configure b/configure
index 7c9a133b04b..a7d3d17b64c 100755
--- a/configure
+++ b/configure
@@ -191,6 +191,7 @@ _taskbar=auto
_updates=no
_libunity=auto
_dialogs=auto
+_printing=yes
_tts=auto
_osx_tts_backend=auto
_gtk=auto
@@ -332,6 +333,7 @@ add_feature png "PNG" "_png"
add_feature vorbis "Vorbis file support" "_vorbis _tremor"
add_feature zlib "zlib" "_zlib"
add_feature test_cxx11 "Test C++11" "_test_cxx11"
+add_feature printing "Printing" "_printing"
# Components are features which may be disabled if unused by the engines
add_component cdtoons "CDTOONS" "_cdtoons" "USE_CDTOONS"
@@ -1407,6 +1409,8 @@ for ac_option in $@; do
--disable-vkeybd) _vkeybd=no ;;
--enable-eventrecorder) _eventrec=yes ;;
--disable-eventrecorder) _eventrec=no ;;
+ --enable-printing) _printing=yes ;;
+ --disable-printing) _printing=no ;;
--enable-text-console) _text_console=yes ;;
--disable-text-console) _text_console=no ;;
--enable-ext-sse2) _ext_sse2=yes ;;
@@ -7226,6 +7230,17 @@ else
fi
define_in_config_if_yes $_taskbar 'USE_TASKBAR'
+#
+# Check whether to build printing support
+#
+echo_n "Building system printing support... "
+case $_host_os in
+mingw*)
+ echo "win32"
+ append_var LIBS '-lMsimg32'
+esac
+define_in_config_if_yes $_printing 'USE_PRINTING'
+
#
# Check whether to build system dialogs support
#
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 038f1896b7d..1cc1285ff54 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -1221,6 +1221,7 @@ const Feature s_features[] = {
{ "translation", "USE_TRANSLATION", false, true, "Translation support" },
{ "vkeybd", "ENABLE_VKEYBD", false, false, "Virtual keyboard support"},
{ "eventrecorder", "ENABLE_EVENTRECORDER", false, false, "Event recorder support"},
+ { "printing", "USE_PRINTING", false, true, "Printing support"},
{ "updates", "USE_UPDATES", false, false, "Updates support"},
{ "dialogs", "USE_SYSDIALOGS", false, true, "System dialogs support"},
{ "langdetect", "USE_DETECTLANG", false, true, "System language detection support" }, // This feature actually depends on "translation", there
diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp
index 88441a7d7e4..fafdb07b7f3 100644
--- a/devtools/create_project/msvc.cpp
+++ b/devtools/create_project/msvc.cpp
@@ -84,6 +84,7 @@ std::string MSVCProvider::getLibraryFromFeature(const char *feature, const Build
{ "updates", "WinSparkle.lib", nullptr, kSDLVersionAny, nullptr },
{ "tts", nullptr, nullptr, kSDLVersionAny, "sapi.lib" },
{ "opengl", nullptr, nullptr, kSDLVersionAny, nullptr },
+ { "printing", nullptr, nullptr, kSDLVersionAny, "Msimg32.lib" },
{ "enet", nullptr, nullptr, kSDLVersionAny, "winmm.lib ws2_32.lib" }
};
Commit: be944b9c1792ee96f99e5534dc5777bfad12798c
https://github.com/scummvm/scummvm/commit/be944b9c1792ee96f99e5534dc5777bfad12798c
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:25+01:00
Commit Message:
COMMON: Add define guards for printing feature
Changed paths:
backends/printing/printman.cpp
common/system.cpp
common/system.h
diff --git a/backends/printing/printman.cpp b/backends/printing/printman.cpp
index 712b780a654..5fea11ffab7 100644
--- a/backends/printing/printman.cpp
+++ b/backends/printing/printman.cpp
@@ -19,6 +19,8 @@
*
*/
+#ifdef USE_PRINTING
+
#include "printman.h"
namespace Common {
@@ -26,3 +28,5 @@ namespace Common {
PrintingManager::~PrintingManager() {}
} // End of namespace Common
+
+#endif
diff --git a/common/system.cpp b/common/system.cpp
index 4f74e223314..c5bde20fb20 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -48,7 +48,9 @@ OSystem::OSystem() {
_eventManager = nullptr;
_timerManager = nullptr;
_savefileManager = nullptr;
+#if defined(USE_PRINTING)
_printingManager = nullptr;
+#endif
#if defined(USE_TASKBAR)
_taskbarManager = nullptr;
#endif
@@ -74,8 +76,10 @@ OSystem::~OSystem() {
delete _timerManager;
_timerManager = nullptr;
+#if defined(USE_PRINTING)
delete _printingManager;
_printingManager = nullptr;
+#endif
#if defined(USE_TASKBAR)
delete _taskbarManager;
diff --git a/common/system.h b/common/system.h
index ffa8a21afea..4bb174ddda3 100644
--- a/common/system.h
+++ b/common/system.h
@@ -69,7 +69,9 @@ class TextToSpeechManager;
#if defined(USE_SYSDIALOGS)
class DialogManager;
#endif
+#if defined(USE_PRINTING)
class PrintingManager;
+#endif
class TimerManager;
class SeekableReadStream;
class WriteStream;
@@ -265,12 +267,14 @@ protected:
*/
FilesystemFactory *_fsFactory;
+#if defined(USE_PRINTING)
/**
* No default value is provided for _printingManager by OSystem.
*
* @note _printingManager is deleted by the OSystem destructor.
*/
Common::PrintingManager *_printingManager;
+#endif
/**
* Used by the DLC Manager implementation
@@ -1805,6 +1809,7 @@ public:
return _textToSpeechManager;
}
+#if defined(USE_PRINTING)
/**
* Return the PrintingManager, used to handle printing.
*
@@ -1813,6 +1818,7 @@ public:
virtual Common::PrintingManager *getPrintingManager() {
return _printingManager;
}
+#endif
#if defined(USE_SYSDIALOGS)
/**
Commit: c088c8c49596f389ad6355bed6887d32862aff8f
https://github.com/scummvm/scummvm/commit/c088c8c49596f389ad6355bed6887d32862aff8f
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:25+01:00
Commit Message:
WIN32: Add define guards for printing feature
Changed paths:
backends/platform/sdl/win32/win32.cpp
backends/printing/win32/win32-printman.cpp
backends/printing/win32/win32-printman.h
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 040cb6da580..7f0808c8d97 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -85,7 +85,9 @@ void OSystem_Win32::init() {
initializeJpegLibraryForWin95();
#endif
+#if defined(USE_PRINTING)
_printingManager = createWin32PrintingManager();
+#endif
// Invoke parent implementation of this method
OSystem_SDL::init();
@@ -156,8 +158,10 @@ bool OSystem_Win32::hasFeature(Feature f) {
return true;
#endif
+#ifdef USE_PRINTING
if (f == kFeaturePrinting)
return true;
+#endif
return OSystem_SDL::hasFeature(f);
}
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index c389399f1c8..333f4077cc2 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -19,6 +19,7 @@
*
*/
+#ifdef USE_PRINTING
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
@@ -145,3 +146,4 @@ Common::PrintingManager *createWin32PrintingManager() {
}
#endif
+#endif
diff --git a/backends/printing/win32/win32-printman.h b/backends/printing/win32/win32-printman.h
index 485e354d831..2f2270372c7 100644
--- a/backends/printing/win32/win32-printman.h
+++ b/backends/printing/win32/win32-printman.h
@@ -34,5 +34,4 @@ class PrintingManager;
Common::PrintingManager *createWin32PrintingManager();
#endif
-
#endif
Commit: d3a73f7a17ee588d2132c07e4f630619e17fa504
https://github.com/scummvm/scummvm/commit/d3a73f7a17ee588d2132c07e4f630619e17fa504
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:25+01:00
Commit Message:
TESTBED: Initial printing test
Changed paths:
A engines/testbed/printing.cpp
A engines/testbed/printing.h
engines/testbed/module.mk
engines/testbed/testbed.cpp
diff --git a/engines/testbed/module.mk b/engines/testbed/module.mk
index 2c002897d5b..deedd2ed5b4 100644
--- a/engines/testbed/module.mk
+++ b/engines/testbed/module.mk
@@ -11,6 +11,7 @@ MODULE_OBJS := \
midi.o \
misc.o \
networking.o \
+ printing.o \
savegame.o \
sound.o \
testbed.o \
diff --git a/engines/testbed/printing.cpp b/engines/testbed/printing.cpp
new file mode 100644
index 00000000000..094de432660
--- /dev/null
+++ b/engines/testbed/printing.cpp
@@ -0,0 +1,86 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if defined(USE_PRINTING)
+
+#include "base/version.h"
+
+#include "common/rect.h"
+#include "common/str.h"
+#include "common/system.h"
+#include "common/util.h"
+#include "common/file.h"
+
+#include "engines/engine.h"
+
+#include "graphics/pm5544.h"
+
+#include "gui/gui-manager.h"
+
+#include "backends/printing/printman.h"
+
+#include "testbed/printing.h"
+
+namespace Testbed {
+
+PrintingTestSuite::PrintingTestSuite() {
+ addTest("Print Test Page", &PrintingTests::printTestPage);
+}
+
+TestExitStatus PrintingTests::printTestPage() {
+ if (!ConfParams.isSessionInteractive()) {
+ return kTestSkipped;
+ }
+ if (!g_gui.theme()->supportsImages()) {
+ Testsuite::logPrintf("No logo to load in this theme, skipping test : printTestPage\n");
+ return kTestSkipped;
+ }
+
+ if (Testsuite::handleInteractiveInput("Print a test page?", "OK", "Skip", kOptionRight)) {
+ Testsuite::logPrintf("Info! Skipping test : printTestPage\n");
+ return kTestSkipped;
+ }
+
+ Common::PrintingManager *pm = g_system->getPrintingManager();
+ if (!pm) {
+ warning("Could not get PrintingManager!");
+ return kTestFailed;
+ }
+
+ // Print ScummVM logo
+ const Graphics::ManagedSurface *logo = g_gui.theme()->getImageSurface("logo.bmp");
+ if (!logo) {
+ warning("Failed to load the ScummVM logo.");
+ return kTestFailed;
+ }
+
+ pm->printImage(*logo);
+
+ // The test pattern is CLUT-8
+ Graphics::ManagedSurface *testPattern = Graphics::renderPM5544(800, 800);
+ pm->printImage(*testPattern);
+
+ return kTestPassed;
+}
+
+} // End of namespace Testbed
+
+#endif
diff --git a/engines/testbed/printing.h b/engines/testbed/printing.h
new file mode 100644
index 00000000000..8a33c37f3f5
--- /dev/null
+++ b/engines/testbed/printing.h
@@ -0,0 +1,56 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if defined(USE_PRINTING)
+
+#ifndef TESTBED_PRINTING_H
+#define TESTBED_PRINTING_H
+
+#include "testbed/testsuite.h"
+
+namespace Testbed {
+
+namespace PrintingTests {
+
+// Helper functions for Printing tests
+TestExitStatus printTestPage();
+
+} // End of namespace PrintingTests
+
+class PrintingTestSuite : public Testsuite {
+public:
+ PrintingTestSuite();
+ ~PrintingTestSuite() {}
+ const char *getName() const {
+ return "Printing";
+ }
+
+ const char *getDescription() const {
+ return "Printing";
+ }
+
+};
+
+} // End of namespace Testbed
+
+#endif
+
+#endif
diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp
index 3d04993888f..168c64395dc 100644
--- a/engines/testbed/testbed.cpp
+++ b/engines/testbed/testbed.cpp
@@ -51,6 +51,9 @@
#ifdef USE_SDL_NET
#include "testbed/webserver.h"
#endif
+#ifdef USE_PRINTING
+#include "testbed/printing.h"
+#endif
#ifdef USE_TTS
#include "testbed/speech.h"
#endif
@@ -172,6 +175,11 @@ void TestbedEngine::pushTestsuites(Common::Array<Testsuite *> &testsuiteList) {
// Networking
ts = new NetworkingTestSuite();
testsuiteList.push_back(ts);
+#ifdef USE_PRINTING
+ // Printing
+ ts = new PrintingTestSuite();
+ testsuiteList.push_back(ts);
+#endif
#ifdef USE_TTS
// TextToSpeech
ts = new SpeechTestSuite();
Commit: dd9fc67b6d36ff1087c90220dd3911a9639f37b7
https://github.com/scummvm/scummvm/commit/dd9fc67b6d36ff1087c90220dd3911a9639f37b7
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:26+01:00
Commit Message:
COMMON: Make job name a settable variable in PrintingManager
Changed paths:
backends/printing/printman.h
backends/printing/win32/win32-printman.cpp
diff --git a/backends/printing/printman.h b/backends/printing/printman.h
index 76e8fbb3b7c..28acce0e9cd 100644
--- a/backends/printing/printman.h
+++ b/backends/printing/printman.h
@@ -32,11 +32,20 @@ class PrintingManager {
public:
virtual ~PrintingManager();
- virtual void printImage(const Common::String &jobName, const Graphics::ManagedSurface &surf) = 0;
+ PrintingManager() {
+ _jobName = "ScummVM";
+ }
void printImage(const Graphics::ManagedSurface &surf) {
- printImage("ScummVM", surf);
+ doPrint(surf);
}
+
+ void setJobName(const Common::String &jobName) { _jobName = jobName; }
+
+protected:
+ virtual void doPrint(const Graphics::ManagedSurface &surf) = 0;
+
+ Common::String _jobName;
};
} // End of namespace Common
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index 333f4077cc2..1973bfef646 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -35,7 +35,7 @@ class Win32PrintingManager : public Common::PrintingManager {
public:
virtual ~Win32PrintingManager();
- void printImage(const Common::String &jobName, const Graphics::ManagedSurface &surf) override;
+ void doPrint(const Graphics::ManagedSurface &surf) override;
private:
HDC createDefaultPrinterContext();
@@ -46,7 +46,7 @@ private:
Win32PrintingManager::~Win32PrintingManager() {}
-void Win32PrintingManager::printImage(const Common::String &jobName, const Graphics::ManagedSurface &surf) {
+void Win32PrintingManager::doPrint(const Graphics::ManagedSurface &surf) {
HDC hdcPrint = createDefaultPrinterContext();
@@ -58,7 +58,7 @@ void Win32PrintingManager::printImage(const Common::String &jobName, const Graph
return;
}
- Escape(hdcPrint, STARTDOC, jobName.size(), jobName.c_str(), NULL);
+ Escape(hdcPrint, STARTDOC, _jobName.size(), _jobName.c_str(), NULL);
SelectObject(hdcImg, bitmap);
Commit: bfd946611eeff4b2abb330023729d9e46244922a
https://github.com/scummvm/scummvm/commit/bfd946611eeff4b2abb330023729d9e46244922a
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:26+01:00
Commit Message:
GUI: Add PrintingDialog class
Changed paths:
A gui/printing-dialog.cpp
A gui/printing-dialog.h
backends/printing/printman.cpp
backends/printing/printman.h
gui/module.mk
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
gui/themes/default.inc
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
po/POTFILES
diff --git a/backends/printing/printman.cpp b/backends/printing/printman.cpp
index 5fea11ffab7..74f651d1d20 100644
--- a/backends/printing/printman.cpp
+++ b/backends/printing/printman.cpp
@@ -23,10 +23,18 @@
#include "printman.h"
+#include "dialogs.h"
+#include "gui/printing-dialog.h"
+
namespace Common {
PrintingManager::~PrintingManager() {}
+void PrintingManager::printImage(const Graphics::ManagedSurface &surf) {
+ GUI::PrintingDialog dialog(surf);
+ dialog.runModal();
+}
+
} // End of namespace Common
#endif
diff --git a/backends/printing/printman.h b/backends/printing/printman.h
index 28acce0e9cd..790b8d8efe9 100644
--- a/backends/printing/printman.h
+++ b/backends/printing/printman.h
@@ -26,19 +26,23 @@
#include "common/str.h"
#include "graphics/managed_surface.h"
+namespace GUI {
+class PrintingDialog;
+}
+
namespace Common {
class PrintingManager {
public:
+ friend class GUI::PrintingDialog;
+
virtual ~PrintingManager();
PrintingManager() {
_jobName = "ScummVM";
}
- void printImage(const Graphics::ManagedSurface &surf) {
- doPrint(surf);
- }
+ void printImage(const Graphics::ManagedSurface &surf);
void setJobName(const Common::String &jobName) { _jobName = jobName; }
diff --git a/gui/module.mk b/gui/module.mk
index b7e9ccd5860..c5e07660cb3 100644
--- a/gui/module.mk
+++ b/gui/module.mk
@@ -22,6 +22,7 @@ MODULE_OBJS := \
object.o \
options.o \
predictivedialog.o \
+ printing-dialog.o \
saveload.o \
saveload-dialog.o \
shaderbrowser-dialog.o \
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
new file mode 100644
index 00000000000..d66fc3e10b8
--- /dev/null
+++ b/gui/printing-dialog.cpp
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if defined(USE_PRINTING)
+
+#include "common/translation.h"
+#include "common/system.h"
+
+#include "backends/printing/printman.h"
+
+#include "gui/printing-dialog.h"
+#include "gui/widget.h"
+
+namespace GUI {
+
+PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
+ : Dialog("PrintingDialog"), _surface(surface) {
+ _printButton = new GUI::ButtonWidget(this, "PrintingDialog.Print", _("Print"), Common::U32String(), kCmdPrint);
+}
+
+void PrintingDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
+ switch (cmd) {
+ case kCmdPrint:
+ g_system->getPrintingManager()->doPrint(_surface);
+ close();
+ break;
+ default:
+ Dialog::handleCommand(sender, cmd, data);
+ }
+}
+
+} // End of namespace GUI
+
+#endif
diff --git a/gui/printing-dialog.h b/gui/printing-dialog.h
new file mode 100644
index 00000000000..fc68ee869b2
--- /dev/null
+++ b/gui/printing-dialog.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#if defined(USE_PRINTING)
+
+#ifndef GUI_PRINTING_DIALOGS_H
+#define GUI_PRINTING_DIALOGS_H
+
+#include "gui/dialog.h"
+
+namespace GUI {
+class ButtonWidget;
+
+class PrintingDialog : public GUI::Dialog {
+public:
+ enum {
+ kCmdPrint = 'PRNT',
+ };
+
+ PrintingDialog(const Graphics::ManagedSurface &surface);
+
+ void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
+
+private:
+ const Graphics::ManagedSurface &_surface;
+
+ GUI::ButtonWidget *_printButton;
+};
+
+} // End of namespace GUI
+
+#endif
+
+#endif
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 162474b50d2..46dc0369792 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -2903,4 +2903,12 @@
</layout>
</dialog>
+ <dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
+ </dialog>
+
</layout_info>
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 47033187b31..d24b35f2847 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -2708,4 +2708,12 @@
</layout>
</dialog>
+ <dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
+ </dialog>
+
</layout_info>
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 7f1f56fb4fc..0e48fd83a67 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -3836,6 +3836,13 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</layout>"
"</dialog>"
+"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
+"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<widget name='Print' "
+"type='Button' "
+"/>"
+"</layout>"
+"</dialog>"
"</layout_info>"
;
const char *defaultXML4 = "<layout_info resolution='y<H'>"
@@ -6213,6 +6220,13 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</layout>"
"</dialog>"
+"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
+"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<widget name='Print' "
+"type='Button' "
+"/>"
+"</layout>"
+"</dialog>"
"</layout_info>"
;
const char *defaultXML[] = { defaultXML1, defaultXML2, defaultXML3, defaultXML4 };
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index b1f644b2796..32129b31655 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -2536,4 +2536,12 @@
</layout>
</dialog>
+ <dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
+ </dialog>
+
</layout_info>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 3defef5bed8..454f2e354e3 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -2515,4 +2515,12 @@
</layout>
</dialog>
+ <dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
+ </dialog>
+
</layout_info>
diff --git a/po/POTFILES b/po/POTFILES
index 0c6406e8d99..4b0d321e653 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -23,6 +23,7 @@ gui/message.cpp
gui/onscreendialog.cpp
gui/options.cpp
gui/predictivedialog.cpp
+gui/printing-dialog.cpp
gui/recorderdialog.cpp
gui/remotebrowser.cpp
gui/saveload-dialog.cpp
Commit: d734138a35b30eeb6e5b669c1f980e13f5643725
https://github.com/scummvm/scummvm/commit/d734138a35b30eeb6e5b669c1f980e13f5643725
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:26+01:00
Commit Message:
COMMON: Add PrintingManager::saveAsImage() method
Changed paths:
backends/printing/printman.cpp
backends/printing/printman.h
gui/printing-dialog.cpp
gui/printing-dialog.h
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
gui/themes/default.inc
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
diff --git a/backends/printing/printman.cpp b/backends/printing/printman.cpp
index 74f651d1d20..5586ef7e62d 100644
--- a/backends/printing/printman.cpp
+++ b/backends/printing/printman.cpp
@@ -21,11 +21,23 @@
#ifdef USE_PRINTING
+#include "common/config-manager.h"
+#include "common/file.h"
+#include "common/savefile.h"
+#include "common/system.h"
+
+#include "graphics/paletteman.h"
+
#include "printman.h"
-#include "dialogs.h"
#include "gui/printing-dialog.h"
+#ifdef USE_PNG
+#include "image/png.h"
+#else
+#include "image/bmp.h"
+#endif
+
namespace Common {
PrintingManager::~PrintingManager() {}
@@ -35,6 +47,47 @@ void PrintingManager::printImage(const Graphics::ManagedSurface &surf) {
dialog.runModal();
}
+void PrintingManager::saveAsImage(const Graphics::ManagedSurface &surf, const Common::String &fileName) {
+ Common::String saveName = fileName;
+ Common::String currentTarget = ConfMan.getActiveDomainName();
+
+#ifdef USE_PNG
+ const char *extension = "png";
+#else
+ const char *extension = "bmp";
+#endif
+
+ Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+
+ if (!saveName.size()) {
+ for (uint n = 0; ; n++) {
+ saveName = Common::String::format("%s-%s-%05d.%s", currentTarget.c_str(), "printout", n, extension);
+
+ if (!saveFileMan->listSavefiles(saveName).size()) {
+ break;
+ }
+ }
+ }
+
+ Common::OutSaveFile *saveFile = saveFileMan->openForSaving(saveName, false);
+ if (!saveFile) {
+ warning("PrintingManager::saveAsImage: Could not open file to save");
+ return;
+ }
+
+ byte palette[256 * 3];
+ g_system->getPaletteManager()->grabPalette(palette, 0, 256);
+
+#ifdef USE_PNG
+ Image::writePNG(*saveFile, surf, palette);
+#else
+ Image::writeBMP(*saveFile, surf, palette);
+#endif
+
+ saveFile->finalize();
+ delete saveFile;
+}
+
} // End of namespace Common
#endif
diff --git a/backends/printing/printman.h b/backends/printing/printman.h
index 790b8d8efe9..0f08e692a06 100644
--- a/backends/printing/printman.h
+++ b/backends/printing/printman.h
@@ -44,6 +44,8 @@ public:
void printImage(const Graphics::ManagedSurface &surf);
+ void saveAsImage(const Graphics::ManagedSurface &surf, const Common::String &fileName = "");
+
void setJobName(const Common::String &jobName) { _jobName = jobName; }
protected:
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
index d66fc3e10b8..98ad7d1ef59 100644
--- a/gui/printing-dialog.cpp
+++ b/gui/printing-dialog.cpp
@@ -34,14 +34,20 @@ namespace GUI {
PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
: Dialog("PrintingDialog"), _surface(surface) {
_printButton = new GUI::ButtonWidget(this, "PrintingDialog.Print", _("Print"), Common::U32String(), kCmdPrint);
+ _saveAsImageCheckbox = new GUI::CheckboxWidget(this, "PrintingDialog.SaveAsImage", _("Save as image"));
}
void PrintingDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
switch (cmd) {
- case kCmdPrint:
- g_system->getPrintingManager()->doPrint(_surface);
+ case kCmdPrint: {
+ Common::PrintingManager *printMan = g_system->getPrintingManager();
+ if (_saveAsImageCheckbox->getState()) {
+ printMan->saveAsImage(_surface);
+ }
+ printMan->doPrint(_surface);
close();
break;
+ }
default:
Dialog::handleCommand(sender, cmd, data);
}
diff --git a/gui/printing-dialog.h b/gui/printing-dialog.h
index fc68ee869b2..8db3e446901 100644
--- a/gui/printing-dialog.h
+++ b/gui/printing-dialog.h
@@ -28,6 +28,7 @@
namespace GUI {
class ButtonWidget;
+class CheckboxWidget;
class PrintingDialog : public GUI::Dialog {
public:
@@ -43,6 +44,7 @@ private:
const Graphics::ManagedSurface &_surface;
GUI::ButtonWidget *_printButton;
+ GUI::CheckboxWidget *_saveAsImageCheckbox;
};
} // End of namespace GUI
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 46dc0369792..7069b37d482 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -2905,6 +2905,11 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'SaveAsImage'
+ type = 'Checkbox'
+ width = '140'
+ />
+ <space/>
<widget name = 'Print'
type = 'Button'
/>
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index d24b35f2847..2ad649873b1 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -2710,6 +2710,11 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'SaveAsImage'
+ type = 'Checkbox'
+ width = '140'
+ />
+ <space/>
<widget name = 'Print'
type = 'Button'
/>
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 0e48fd83a67..cc2c5cc8851 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -3838,6 +3838,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</dialog>"
"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<widget name='SaveAsImage' "
+"type='Checkbox' "
+"width='140' "
+"/>"
+"<space/>"
"<widget name='Print' "
"type='Button' "
"/>"
@@ -6222,6 +6227,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</dialog>"
"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<widget name='SaveAsImage' "
+"type='Checkbox' "
+"width='140' "
+"/>"
+"<space/>"
"<widget name='Print' "
"type='Button' "
"/>"
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 32129b31655..1e81cf73531 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -2538,6 +2538,11 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'SaveAsImage'
+ type = 'Checkbox'
+ width = '140'
+ />
+ <space/>
<widget name = 'Print'
type = 'Button'
/>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 454f2e354e3..ad6c9db1f0d 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -2517,6 +2517,11 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'SaveAsImage'
+ type = 'Checkbox'
+ width = '140'
+ />
+ <space/>
<widget name = 'Print'
type = 'Button'
/>
Commit: dd953935e3556ecacb71c1976664fecb3c7ef95b
https://github.com/scummvm/scummvm/commit/dd953935e3556ecacb71c1976664fecb3c7ef95b
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:26+01:00
Commit Message:
WIN32: PRINTMAN: Replace Escape calls with proper functions
Changed paths:
backends/printing/win32/win32-printman.cpp
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index 1973bfef646..1bfeaf051d1 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -50,6 +50,13 @@ void Win32PrintingManager::doPrint(const Graphics::ManagedSurface &surf) {
HDC hdcPrint = createDefaultPrinterContext();
+ DOCINFOA info;
+ info.cbSize = sizeof(info);
+ info.fwType = 0;
+ info.lpszDatatype = nullptr;
+ info.lpszOutput = nullptr;
+ info.lpszDocName = _jobName.c_str();
+
HDC hdcImg = CreateCompatibleDC(hdcPrint);
HBITMAP bitmap = buildBitmap(hdcPrint, surf);
@@ -58,14 +65,15 @@ void Win32PrintingManager::doPrint(const Graphics::ManagedSurface &surf) {
return;
}
- Escape(hdcPrint, STARTDOC, _jobName.size(), _jobName.c_str(), NULL);
+ StartDocA(hdcPrint, &info);
+ StartPage(hdcPrint);
SelectObject(hdcImg, bitmap);
BitBlt(hdcPrint, 0, 0, surf.w, surf.h, hdcImg, 0, 0, SRCCOPY);
- Escape(hdcPrint, NEWFRAME, 0, NULL, NULL);
- Escape(hdcPrint, ENDDOC, 0, NULL, NULL);
+ EndPage(hdcPrint);
+ EndDoc(hdcPrint);
DeleteObject(bitmap);
DeleteDC(hdcImg);
Commit: e97ed7f9f11e50c917c7d38f1235c8a7111031fe
https://github.com/scummvm/scummvm/commit/e97ed7f9f11e50c917c7d38f1235c8a7111031fe
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:26+01:00
Commit Message:
GUI: Add option to choose printer name
Changed paths:
backends/printing/printman.cpp
backends/printing/printman.h
gui/printing-dialog.cpp
gui/printing-dialog.h
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
gui/themes/default.inc
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
diff --git a/backends/printing/printman.cpp b/backends/printing/printman.cpp
index 5586ef7e62d..19440ce9ebc 100644
--- a/backends/printing/printman.cpp
+++ b/backends/printing/printman.cpp
@@ -42,6 +42,14 @@ namespace Common {
PrintingManager::~PrintingManager() {}
+StringArray PrintingManager::listPrinterNames() const {
+ return StringArray();
+}
+
+Common::String PrintingManager::getDefaultPrinterName() const {
+ return Common::String();
+}
+
void PrintingManager::printImage(const Graphics::ManagedSurface &surf) {
GUI::PrintingDialog dialog(surf);
dialog.runModal();
diff --git a/backends/printing/printman.h b/backends/printing/printman.h
index 0f08e692a06..15bc01e0485 100644
--- a/backends/printing/printman.h
+++ b/backends/printing/printman.h
@@ -24,6 +24,7 @@
#include "common/scummsys.h"
#include "common/str.h"
+#include "common/str-array.h"
#include "graphics/managed_surface.h"
namespace GUI {
@@ -51,7 +52,14 @@ public:
protected:
virtual void doPrint(const Graphics::ManagedSurface &surf) = 0;
+ virtual Common::StringArray listPrinterNames() const;
+
+ virtual Common::String getDefaultPrinterName() const;
+
+ void setPrinterName(const Common::String &printerName) { _printerName = printerName; }
+
Common::String _jobName;
+ Common::String _printerName;
};
} // End of namespace Common
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
index 98ad7d1ef59..8e99cb984e3 100644
--- a/gui/printing-dialog.cpp
+++ b/gui/printing-dialog.cpp
@@ -28,6 +28,7 @@
#include "gui/printing-dialog.h"
#include "gui/widget.h"
+#include "gui/widgets/popup.h"
namespace GUI {
@@ -35,6 +36,27 @@ PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
: Dialog("PrintingDialog"), _surface(surface) {
_printButton = new GUI::ButtonWidget(this, "PrintingDialog.Print", _("Print"), Common::U32String(), kCmdPrint);
_saveAsImageCheckbox = new GUI::CheckboxWidget(this, "PrintingDialog.SaveAsImage", _("Save as image"));
+
+ _printersListPopUp = new GUI::PopUpWidget(this, "PrintingDialog.PrintersList", Common::U32String(), kCmdSelectPrinterName);
+ Common::PrintingManager *printMan = g_system->getPrintingManager();
+ Common::StringArray printerNames = printMan->listPrinterNames();
+
+ Common::String defaultPrinterName = printMan->getDefaultPrinterName();
+ uint32 defaultPrinterId = 0;
+ uint32 tag = 0;
+
+ for (auto &name : printerNames) {
+ _printersListPopUp->appendEntry(name, tag);
+ _tagToPrinterName[tag] = name;
+
+ if (name == defaultPrinterName)
+ defaultPrinterId = tag;
+
+ tag++;
+ }
+
+ _printersListPopUp->setSelectedTag(defaultPrinterId);
+ g_system->getPrintingManager()->setPrinterName(_tagToPrinterName[defaultPrinterId]);
}
void PrintingDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
@@ -48,6 +70,9 @@ void PrintingDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint3
close();
break;
}
+ case kCmdSelectPrinterName:
+ g_system->getPrintingManager()->setPrinterName(_tagToPrinterName[data]);
+ break;
default:
Dialog::handleCommand(sender, cmd, data);
}
diff --git a/gui/printing-dialog.h b/gui/printing-dialog.h
index 8db3e446901..65f7b713a52 100644
--- a/gui/printing-dialog.h
+++ b/gui/printing-dialog.h
@@ -29,11 +29,13 @@
namespace GUI {
class ButtonWidget;
class CheckboxWidget;
+class PopUpWidget;
class PrintingDialog : public GUI::Dialog {
public:
enum {
kCmdPrint = 'PRNT',
+ kCmdSelectPrinterName = 'SLPN',
};
PrintingDialog(const Graphics::ManagedSurface &surface);
@@ -45,6 +47,9 @@ private:
GUI::ButtonWidget *_printButton;
GUI::CheckboxWidget *_saveAsImageCheckbox;
+ GUI::PopUpWidget *_printersListPopUp;
+
+ Common::HashMap<uint32, Common::String> _tagToPrinterName;
};
} // End of namespace GUI
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 7069b37d482..fe3a40eab56 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -2905,6 +2905,10 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 2ad649873b1..009b65ed30c 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -2710,6 +2710,10 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index cc2c5cc8851..421276a3ed2 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -3838,6 +3838,10 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</dialog>"
"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<widget name='PrintersList' "
+"type='PopUp' "
+"width='140' "
+"/>"
"<widget name='SaveAsImage' "
"type='Checkbox' "
"width='140' "
@@ -6227,6 +6231,10 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</dialog>"
"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<widget name='PrintersList' "
+"type='PopUp' "
+"width='140' "
+"/>"
"<widget name='SaveAsImage' "
"type='Checkbox' "
"width='140' "
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 1e81cf73531..b7744e1efdf 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -2538,6 +2538,10 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index ad6c9db1f0d..fd56aaac7ee 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -2517,6 +2517,10 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
Commit: b00499f9b0e28f39e6ab29e0115adf16095f3ea8
https://github.com/scummvm/scummvm/commit/b00499f9b0e28f39e6ab29e0115adf16095f3ea8
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:26+01:00
Commit Message:
WIN32: PRINTMAN: Implement selecting printer name
Changed paths:
backends/printing/win32/win32-printman.cpp
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index 1bfeaf051d1..32cf00e21c0 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -27,6 +27,8 @@
#include <winspool.h>
#include "backends/printing/printman.h"
+#include "backends/platform/sdl/win32/win32_wrapper.h"
+
#include "win32-printman.h"
#include "common/ustr.h"
@@ -37,6 +39,10 @@ public:
void doPrint(const Graphics::ManagedSurface &surf) override;
+ Common::StringArray listPrinterNames() const override;
+
+ Common::String getDefaultPrinterName() const override;
+
private:
HDC createDefaultPrinterContext();
HDC createPrinterContext(LPTSTR devName);
@@ -48,7 +54,11 @@ Win32PrintingManager::~Win32PrintingManager() {}
void Win32PrintingManager::doPrint(const Graphics::ManagedSurface &surf) {
- HDC hdcPrint = createDefaultPrinterContext();
+ HDC hdcPrint;
+ if (!_printerName.size())
+ hdcPrint = createDefaultPrinterContext();
+ else
+ hdcPrint = createPrinterContext(Win32::stringToTchar(_printerName));
DOCINFOA info;
info.cbSize = sizeof(info);
@@ -149,6 +159,46 @@ HBITMAP Win32PrintingManager::buildBitmap(HDC hdc, const Graphics::ManagedSurfac
return bitmap;
}
+Common::StringArray Win32PrintingManager::listPrinterNames() const {
+ DWORD size;
+ DWORD numPrinterInfos;
+
+ // Get the required size
+ BOOL success = EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 4, NULL, 0, &size, &numPrinterInfos);
+
+ Common::StringArray printerNames;
+ BYTE *printerInfos = new BYTE[size];
+ success = EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 4, (LPBYTE)printerInfos, size, &size, &numPrinterInfos);
+ if (!success)
+ return Common::StringArray();
+
+ for (uint i = 0; i < numPrinterInfos; i++) {
+ PRINTER_INFO_4 info = *((PRINTER_INFO_4 *)(printerInfos + i * sizeof(PRINTER_INFO_4)));
+ TCHAR *name = (TCHAR *)info.pPrinterName;
+ printerNames.push_back(Win32::tcharToString(name));
+ }
+
+ delete[] printerInfos;
+
+ return printerNames;
+}
+
+Common::String Win32PrintingManager::getDefaultPrinterName() const {
+ DWORD size;
+ GetDefaultPrinter(NULL, &size);
+
+ TCHAR *str = new TCHAR[size];
+ BOOL success = GetDefaultPrinter(str, &size);
+ if (!success)
+ return Common::String();
+
+ Common::String name = Win32::tcharToString(str);
+
+ delete[] str;
+
+ return name;
+}
+
Common::PrintingManager *createWin32PrintingManager() {
return new Win32PrintingManager();
}
Commit: e632479fa8a3ef222965ce13d60b12296b2823a9
https://github.com/scummvm/scummvm/commit/e632479fa8a3ef222965ce13d60b12296b2823a9
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:26+01:00
Commit Message:
GUI: Add option to choose layout type in PrintingDialog
Changed paths:
backends/printing/printman.h
backends/printing/win32/win32-printman.cpp
gui/printing-dialog.cpp
gui/printing-dialog.h
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
gui/themes/default.inc
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
diff --git a/backends/printing/printman.h b/backends/printing/printman.h
index 15bc01e0485..bad36a509f9 100644
--- a/backends/printing/printman.h
+++ b/backends/printing/printman.h
@@ -31,6 +31,11 @@ namespace GUI {
class PrintingDialog;
}
+enum PageOrientation {
+ kPageOrientationPortrait,
+ kPageOrientationLandscape,
+};
+
namespace Common {
class PrintingManager {
@@ -40,6 +45,7 @@ public:
virtual ~PrintingManager();
PrintingManager() {
+ _orientation = kPageOrientationLandscape;
_jobName = "ScummVM";
}
@@ -58,6 +64,8 @@ protected:
void setPrinterName(const Common::String &printerName) { _printerName = printerName; }
+ PageOrientation _orientation;
+
Common::String _jobName;
Common::String _printerName;
};
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index 32cf00e21c0..1a5c5a253d9 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -114,6 +114,12 @@ HDC Win32PrintingManager::createPrinterContext(LPTSTR devName) {
DEVMODE *devmode = (DEVMODE *)malloc(size);
DocumentProperties(NULL, handle, devName, devmode, NULL, DM_OUT_BUFFER);
+ if (devmode->dmFields & DM_ORIENTATION) {
+ devmode->dmOrientation = (_orientation == kPageOrientationPortrait) ? DMORIENT_PORTRAIT : DMORIENT_LANDSCAPE;
+ }
+
+ DocumentProperties(NULL, handle, devName, devmode, devmode, DM_OUT_BUFFER | DM_IN_BUFFER);
+
ClosePrinter(handle);
HDC printerDC = CreateDC(TEXT("WINSPOOL"), devName, NULL, devmode);
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
index 8e99cb984e3..877f8e3fd11 100644
--- a/gui/printing-dialog.cpp
+++ b/gui/printing-dialog.cpp
@@ -57,6 +57,16 @@ PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
_printersListPopUp->setSelectedTag(defaultPrinterId);
g_system->getPrintingManager()->setPrinterName(_tagToPrinterName[defaultPrinterId]);
+
+ // Page settings
+ _orientationPopUp = new PopUpWidget(this, "PrintingDialog.Orientation", Common::U32String(), kCmdSelectOrientation);
+ _orientationPopUp->appendEntry("Portrait", kPageOrientationPortrait);
+ _orientationPopUp->appendEntry("Landscape", kPageOrientationLandscape);
+ // Pre-select orientation
+ if (surface.w > surface.h) {
+ _orientationPopUp->setSelectedTag(kPageOrientationLandscape);
+ printMan->_orientation = kPageOrientationLandscape;
+ }
}
void PrintingDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
@@ -73,6 +83,9 @@ void PrintingDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint3
case kCmdSelectPrinterName:
g_system->getPrintingManager()->setPrinterName(_tagToPrinterName[data]);
break;
+ case kCmdSelectOrientation:
+ g_system->getPrintingManager()->_orientation = (PageOrientation)data;
+ break;
default:
Dialog::handleCommand(sender, cmd, data);
}
diff --git a/gui/printing-dialog.h b/gui/printing-dialog.h
index 65f7b713a52..b45d6a2b2bb 100644
--- a/gui/printing-dialog.h
+++ b/gui/printing-dialog.h
@@ -36,6 +36,7 @@ public:
enum {
kCmdPrint = 'PRNT',
kCmdSelectPrinterName = 'SLPN',
+ kCmdSelectOrientation = 'SLOR',
};
PrintingDialog(const Graphics::ManagedSurface &surface);
@@ -49,6 +50,8 @@ private:
GUI::CheckboxWidget *_saveAsImageCheckbox;
GUI::PopUpWidget *_printersListPopUp;
+ GUI::PopUpWidget *_orientationPopUp;
+
Common::HashMap<uint32, Common::String> _tagToPrinterName;
};
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index fe3a40eab56..32b45e497f5 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -2909,6 +2909,11 @@
type = 'PopUp'
width = '140'
/>
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 009b65ed30c..933088a6945 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -2714,6 +2714,11 @@
type = 'PopUp'
width = '140'
/>
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 421276a3ed2..1f0c1e4a1ca 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -3842,6 +3842,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"type='PopUp' "
"width='140' "
"/>"
+"<space/>"
+"<widget name='Orientation' "
+"type='PopUp' "
+"width='100' "
+"/>"
"<widget name='SaveAsImage' "
"type='Checkbox' "
"width='140' "
@@ -6235,6 +6240,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"type='PopUp' "
"width='140' "
"/>"
+"<space/>"
+"<widget name='Orientation' "
+"type='PopUp' "
+"width='100' "
+"/>"
"<widget name='SaveAsImage' "
"type='Checkbox' "
"width='140' "
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index b7744e1efdf..768bcb1c260 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -2542,6 +2542,11 @@
type = 'PopUp'
width = '140'
/>
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index fd56aaac7ee..fefb82cab9b 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -2521,6 +2521,11 @@
type = 'PopUp'
width = '140'
/>
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
Commit: efa71e3c26acfa5254a3259b011cdc5b5577bdab
https://github.com/scummvm/scummvm/commit/efa71e3c26acfa5254a3259b011cdc5b5577bdab
Author: Alikhan Balpykov (luxrage1990 at gmail.com)
Date: 2026-02-15T14:37:26+01:00
Commit Message:
GUI: Add pop descriptions and cancel button to PrintingDialog
Changed paths:
gui/printing-dialog.cpp
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
gui/themes/default.inc
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
index 877f8e3fd11..0749d6b7818 100644
--- a/gui/printing-dialog.cpp
+++ b/gui/printing-dialog.cpp
@@ -37,6 +37,7 @@ PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
_printButton = new GUI::ButtonWidget(this, "PrintingDialog.Print", _("Print"), Common::U32String(), kCmdPrint);
_saveAsImageCheckbox = new GUI::CheckboxWidget(this, "PrintingDialog.SaveAsImage", _("Save as image"));
+ new GUI::StaticTextWidget(this, "PrintingDialog.PrintersListDesc", _("Printer:"));
_printersListPopUp = new GUI::PopUpWidget(this, "PrintingDialog.PrintersList", Common::U32String(), kCmdSelectPrinterName);
Common::PrintingManager *printMan = g_system->getPrintingManager();
Common::StringArray printerNames = printMan->listPrinterNames();
@@ -59,6 +60,7 @@ PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
g_system->getPrintingManager()->setPrinterName(_tagToPrinterName[defaultPrinterId]);
// Page settings
+ new GUI::StaticTextWidget(this, "PrintingDialog.OrientationDesc", _("Orientation:"));
_orientationPopUp = new PopUpWidget(this, "PrintingDialog.Orientation", Common::U32String(), kCmdSelectOrientation);
_orientationPopUp->appendEntry("Portrait", kPageOrientationPortrait);
_orientationPopUp->appendEntry("Landscape", kPageOrientationLandscape);
@@ -67,6 +69,8 @@ PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
_orientationPopUp->setSelectedTag(kPageOrientationLandscape);
printMan->_orientation = kPageOrientationLandscape;
}
+
+ new ButtonWidget(this, "PrintingDialog.Cancel", _("Cancel"), Common::U32String(), kCloseCmd);
}
void PrintingDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 32b45e497f5..20e66b6f55d 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -2905,23 +2905,41 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
- <widget name = 'PrintersList'
- type = 'PopUp'
- width = '140'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'PrintersListDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
+ </layout>
<space/>
- <widget name = 'Orientation'
- type = 'PopUp'
- width = '100'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'OrientationDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
+ </layout>
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
/>
<space/>
- <widget name = 'Print'
- type = 'Button'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'Cancel'
+ type = 'Button'
+ />
+ <space/>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
</layout>
</dialog>
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 933088a6945..b3ac0018341 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -2710,23 +2710,41 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
- <widget name = 'PrintersList'
- type = 'PopUp'
- width = '140'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'PrintersListDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
+ </layout>
<space/>
- <widget name = 'Orientation'
- type = 'PopUp'
- width = '100'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'OrientationDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
+ </layout>
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
/>
<space/>
- <widget name = 'Print'
- type = 'Button'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'Cancel'
+ type = 'Button'
+ />
+ <space/>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
</layout>
</dialog>
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 1f0c1e4a1ca..8e95b66fa36 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -3838,24 +3838,42 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</dialog>"
"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='8'>"
+"<widget name='PrintersListDesc' "
+"type='OptionsLabel' "
+"/>"
+"<space/>"
"<widget name='PrintersList' "
"type='PopUp' "
"width='140' "
"/>"
+"</layout>"
+"<space/>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='8'>"
+"<widget name='OrientationDesc' "
+"type='OptionsLabel' "
+"/>"
"<space/>"
"<widget name='Orientation' "
"type='PopUp' "
"width='100' "
"/>"
+"</layout>"
"<widget name='SaveAsImage' "
"type='Checkbox' "
"width='140' "
"/>"
"<space/>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='10'>"
+"<widget name='Cancel' "
+"type='Button' "
+"/>"
+"<space/>"
"<widget name='Print' "
"type='Button' "
"/>"
"</layout>"
+"</layout>"
"</dialog>"
"</layout_info>"
;
@@ -6236,24 +6254,42 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</dialog>"
"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='8'>"
+"<widget name='PrintersListDesc' "
+"type='OptionsLabel' "
+"/>"
+"<space/>"
"<widget name='PrintersList' "
"type='PopUp' "
"width='140' "
"/>"
+"</layout>"
+"<space/>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='8'>"
+"<widget name='OrientationDesc' "
+"type='OptionsLabel' "
+"/>"
"<space/>"
"<widget name='Orientation' "
"type='PopUp' "
"width='100' "
"/>"
+"</layout>"
"<widget name='SaveAsImage' "
"type='Checkbox' "
"width='140' "
"/>"
"<space/>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='10'>"
+"<widget name='Cancel' "
+"type='Button' "
+"/>"
+"<space/>"
"<widget name='Print' "
"type='Button' "
"/>"
"</layout>"
+"</layout>"
"</dialog>"
"</layout_info>"
;
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 768bcb1c260..439f2dcdeef 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -2538,23 +2538,41 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
- <widget name = 'PrintersList'
- type = 'PopUp'
- width = '140'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'PrintersListDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
+ </layout>
<space/>
- <widget name = 'Orientation'
- type = 'PopUp'
- width = '100'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'OrientationDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
+ </layout>
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
/>
<space/>
- <widget name = 'Print'
- type = 'Button'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'Cancel'
+ type = 'Button'
+ />
+ <space/>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
</layout>
</dialog>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index fefb82cab9b..33c2062d414 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -2517,23 +2517,41 @@
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
- <widget name = 'PrintersList'
- type = 'PopUp'
- width = '140'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'PrintersListDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
+ </layout>
<space/>
- <widget name = 'Orientation'
- type = 'PopUp'
- width = '100'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'OrientationDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
+ </layout>
<widget name = 'SaveAsImage'
type = 'Checkbox'
width = '140'
/>
<space/>
- <widget name = 'Print'
- type = 'Button'
- />
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'Cancel'
+ type = 'Button'
+ />
+ <space/>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
</layout>
</dialog>
Commit: a304f852cedc51dc2f942103f5eda120b05aa661
https://github.com/scummvm/scummvm/commit/a304f852cedc51dc2f942103f5eda120b05aa661
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:26+01:00
Commit Message:
ALL: Remove USE_PRINTING and implement no-op default print manager
WIN32-specific printing is behind --enable-system-printing configure option
Changed paths:
backends/platform/sdl/win32/win32.cpp
backends/printing/printman.cpp
backends/printing/printman.h
backends/printing/win32/win32-printman.cpp
common/system.cpp
common/system.h
configure
devtools/create_project/create_project.cpp
engines/director/debugger/dt-score.cpp
engines/testbed/printing.cpp
engines/testbed/printing.h
engines/testbed/testbed.cpp
gui/printing-dialog.cpp
gui/printing-dialog.h
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 7f0808c8d97..60b27186e97 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -85,7 +85,7 @@ void OSystem_Win32::init() {
initializeJpegLibraryForWin95();
#endif
-#if defined(USE_PRINTING)
+#if defined(USE_SYSTEM_PRINTING)
_printingManager = createWin32PrintingManager();
#endif
@@ -158,11 +158,6 @@ bool OSystem_Win32::hasFeature(Feature f) {
return true;
#endif
-#ifdef USE_PRINTING
- if (f == kFeaturePrinting)
- return true;
-#endif
-
return OSystem_SDL::hasFeature(f);
}
diff --git a/backends/printing/printman.cpp b/backends/printing/printman.cpp
index 19440ce9ebc..ea22b89f990 100644
--- a/backends/printing/printman.cpp
+++ b/backends/printing/printman.cpp
@@ -19,8 +19,6 @@
*
*/
-#ifdef USE_PRINTING
-
#include "common/config-manager.h"
#include "common/file.h"
#include "common/savefile.h"
@@ -96,6 +94,8 @@ void PrintingManager::saveAsImage(const Graphics::ManagedSurface &surf, const Co
delete saveFile;
}
-} // End of namespace Common
+void PrintingManager::doPrint(const Graphics::ManagedSurface &surf) {
+ warning("PrintingManager::doPrint: No printing support in this backend");
+}
-#endif
+} // End of namespace Common
diff --git a/backends/printing/printman.h b/backends/printing/printman.h
index bad36a509f9..2ada7a8e2f0 100644
--- a/backends/printing/printman.h
+++ b/backends/printing/printman.h
@@ -56,7 +56,7 @@ public:
void setJobName(const Common::String &jobName) { _jobName = jobName; }
protected:
- virtual void doPrint(const Graphics::ManagedSurface &surf) = 0;
+ virtual void doPrint(const Graphics::ManagedSurface &surf);
virtual Common::StringArray listPrinterNames() const;
diff --git a/backends/printing/win32/win32-printman.cpp b/backends/printing/win32/win32-printman.cpp
index 1a5c5a253d9..32a4db00fa1 100644
--- a/backends/printing/win32/win32-printman.cpp
+++ b/backends/printing/win32/win32-printman.cpp
@@ -19,7 +19,7 @@
*
*/
-#ifdef USE_PRINTING
+#ifdef USE_SYSTEM_PRINTING
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
diff --git a/common/system.cpp b/common/system.cpp
index c5bde20fb20..48fc49e3772 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -48,9 +48,7 @@ OSystem::OSystem() {
_eventManager = nullptr;
_timerManager = nullptr;
_savefileManager = nullptr;
-#if defined(USE_PRINTING)
_printingManager = nullptr;
-#endif
#if defined(USE_TASKBAR)
_taskbarManager = nullptr;
#endif
@@ -76,10 +74,8 @@ OSystem::~OSystem() {
delete _timerManager;
_timerManager = nullptr;
-#if defined(USE_PRINTING)
delete _printingManager;
_printingManager = nullptr;
-#endif
#if defined(USE_TASKBAR)
delete _taskbarManager;
@@ -126,6 +122,10 @@ void OSystem::initBackend() {
// if (!_fsFactory)
// error("Backend failed to instantiate fs factory");
+ // Initialize default printing manager unless overridden by backend
+ if (!_printingManager)
+ _printingManager = new Common::PrintingManager();
+
_backendInitialized = true;
}
diff --git a/common/system.h b/common/system.h
index 4bb174ddda3..3581ad89b22 100644
--- a/common/system.h
+++ b/common/system.h
@@ -69,9 +69,7 @@ class TextToSpeechManager;
#if defined(USE_SYSDIALOGS)
class DialogManager;
#endif
-#if defined(USE_PRINTING)
class PrintingManager;
-#endif
class TimerManager;
class SeekableReadStream;
class WriteStream;
@@ -267,14 +265,12 @@ protected:
*/
FilesystemFactory *_fsFactory;
-#if defined(USE_PRINTING)
/**
* No default value is provided for _printingManager by OSystem.
*
* @note _printingManager is deleted by the OSystem destructor.
*/
Common::PrintingManager *_printingManager;
-#endif
/**
* Used by the DLC Manager implementation
@@ -598,11 +594,6 @@ public:
*/
kFeatureNoQuit,
- /**
- * Putting text and/or images on physical paper
- */
- kFeaturePrinting,
-
/**
* The presence of this feature indicates that the backend uses a touchscreen.
*
@@ -1809,7 +1800,6 @@ public:
return _textToSpeechManager;
}
-#if defined(USE_PRINTING)
/**
* Return the PrintingManager, used to handle printing.
*
@@ -1818,7 +1808,6 @@ public:
virtual Common::PrintingManager *getPrintingManager() {
return _printingManager;
}
-#endif
#if defined(USE_SYSDIALOGS)
/**
diff --git a/configure b/configure
index a7d3d17b64c..d96e3aeb5a8 100755
--- a/configure
+++ b/configure
@@ -1409,8 +1409,8 @@ for ac_option in $@; do
--disable-vkeybd) _vkeybd=no ;;
--enable-eventrecorder) _eventrec=yes ;;
--disable-eventrecorder) _eventrec=no ;;
- --enable-printing) _printing=yes ;;
- --disable-printing) _printing=no ;;
+ --enable-system-printing) _printing=yes ;;
+ --disable-system-printing) _printing=no ;;
--enable-text-console) _text_console=yes ;;
--disable-text-console) _text_console=no ;;
--enable-ext-sse2) _ext_sse2=yes ;;
@@ -7238,8 +7238,12 @@ case $_host_os in
mingw*)
echo "win32"
append_var LIBS '-lMsimg32'
+ ;;
+*)
+ echo "no"
+ ;;
esac
-define_in_config_if_yes $_printing 'USE_PRINTING'
+define_in_config_if_yes $_printing 'USE_SYSTEM_PRINTING'
#
# Check whether to build system dialogs support
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 1cc1285ff54..67cf7a57dac 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -1221,7 +1221,7 @@ const Feature s_features[] = {
{ "translation", "USE_TRANSLATION", false, true, "Translation support" },
{ "vkeybd", "ENABLE_VKEYBD", false, false, "Virtual keyboard support"},
{ "eventrecorder", "ENABLE_EVENTRECORDER", false, false, "Event recorder support"},
- { "printing", "USE_PRINTING", false, true, "Printing support"},
+ { "printing", "USE_SYSTEM_PRINTING", false, true, "Printing support"},
{ "updates", "USE_UPDATES", false, false, "Updates support"},
{ "dialogs", "USE_SYSDIALOGS", false, true, "System dialogs support"},
{ "langdetect", "USE_DETECTLANG", false, true, "System language detection support" }, // This feature actually depends on "translation", there
diff --git a/engines/director/debugger/dt-score.cpp b/engines/director/debugger/dt-score.cpp
index 48daf2dd919..2fdeac58b9c 100644
--- a/engines/director/debugger/dt-score.cpp
+++ b/engines/director/debugger/dt-score.cpp
@@ -616,7 +616,7 @@ void showScore() {
if (ImGui::BeginCombo("##mode", selMode)) {
for (int n = 0; n < ARRAYSIZE(modes); n++) {
const bool selected = (_state->_scoreMode == n);
- if (ImGui::Selectable(modes[n], selected))
+ if (ImGui::Selectable(Common::String::format("%s##%d", modes[n], n).c_str(), selected))
_state->_scoreMode = n;
if (selected)
diff --git a/engines/testbed/printing.cpp b/engines/testbed/printing.cpp
index 094de432660..c283811d5b9 100644
--- a/engines/testbed/printing.cpp
+++ b/engines/testbed/printing.cpp
@@ -19,8 +19,6 @@
*
*/
-#if defined(USE_PRINTING)
-
#include "base/version.h"
#include "common/rect.h"
@@ -82,5 +80,3 @@ TestExitStatus PrintingTests::printTestPage() {
}
} // End of namespace Testbed
-
-#endif
diff --git a/engines/testbed/printing.h b/engines/testbed/printing.h
index 8a33c37f3f5..b179340f62e 100644
--- a/engines/testbed/printing.h
+++ b/engines/testbed/printing.h
@@ -19,8 +19,6 @@
*
*/
-#if defined(USE_PRINTING)
-
#ifndef TESTBED_PRINTING_H
#define TESTBED_PRINTING_H
@@ -52,5 +50,3 @@ public:
} // End of namespace Testbed
#endif
-
-#endif
diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp
index 168c64395dc..0a4855a1959 100644
--- a/engines/testbed/testbed.cpp
+++ b/engines/testbed/testbed.cpp
@@ -51,9 +51,7 @@
#ifdef USE_SDL_NET
#include "testbed/webserver.h"
#endif
-#ifdef USE_PRINTING
#include "testbed/printing.h"
-#endif
#ifdef USE_TTS
#include "testbed/speech.h"
#endif
@@ -111,7 +109,7 @@ void TestbedExitDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui
ConfParams.setRerunFlag(true);
cmd = GUI::kCloseCmd;
break;
- case kViewLogCmd:
+ case kViewLogCmd:
Common::Path logPath = Common::Path(ConfParams.getLogDirectory());
GUI::TextViewerDialog viewer(logPath.appendComponent(ConfParams.getLogFilename()));
viewer.runModal();
@@ -175,11 +173,9 @@ void TestbedEngine::pushTestsuites(Common::Array<Testsuite *> &testsuiteList) {
// Networking
ts = new NetworkingTestSuite();
testsuiteList.push_back(ts);
-#ifdef USE_PRINTING
// Printing
ts = new PrintingTestSuite();
testsuiteList.push_back(ts);
-#endif
#ifdef USE_TTS
// TextToSpeech
ts = new SpeechTestSuite();
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
index 0749d6b7818..61b573ecc14 100644
--- a/gui/printing-dialog.cpp
+++ b/gui/printing-dialog.cpp
@@ -19,8 +19,6 @@
*
*/
-#if defined(USE_PRINTING)
-
#include "common/translation.h"
#include "common/system.h"
@@ -96,5 +94,3 @@ void PrintingDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint3
}
} // End of namespace GUI
-
-#endif
diff --git a/gui/printing-dialog.h b/gui/printing-dialog.h
index b45d6a2b2bb..f49a96ffff5 100644
--- a/gui/printing-dialog.h
+++ b/gui/printing-dialog.h
@@ -19,8 +19,6 @@
*
*/
-#if defined(USE_PRINTING)
-
#ifndef GUI_PRINTING_DIALOGS_H
#define GUI_PRINTING_DIALOGS_H
@@ -58,5 +56,3 @@ private:
} // End of namespace GUI
#endif
-
-#endif
Commit: bfc958113d009c2b57d612092d0fd62aa8e3f04f
https://github.com/scummvm/scummvm/commit/bfc958113d009c2b57d612092d0fd62aa8e3f04f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
SCUMM: HE: Inital code for plugging in printing, taken from Henke38's PR
Changed paths:
engines/scumm/he/wiz_he.cpp
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index b068c7dbcb2..b2b58187696 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -27,6 +27,9 @@
#include "graphics/cursorman.h"
#include "graphics/primitives.h"
#include "scumm/he/font_he.h"
+
+#include "backends/printing/printman.h"
+
#include "scumm/he/logic_he.h"
#include "scumm/he/intern_he.h"
#include "scumm/resource.h"
@@ -457,7 +460,30 @@ WizPxShrdBuffer Wiz::drawAWizPrimEx(int globNum, int state, int x, int y, int z,
// Verify if it's a printing operation...
if (flags & kWRFPrint) {
- warning("Wiz::drawAWizPrimEx(): Printing not yet supported");
+ switch (srcComp) {
+ case kWCTNone:
+ {
+ Graphics::ManagedSurface surf;
+ surf.w = srcWidth;
+ surf.h = srcHeight;
+ surf.format=Graphics::PixelFormat::createFormatCLUT8();
+
+ uint8 *wizd = getWizStateDataPrim(globNum, state);
+ assert(wizd);
+ surf.setPixels(wizd);
+
+ uint8 *pal = getWizStatePaletteDataPrim(globNum, state);
+ assert(pal);
+ surf.setPalette(pal, 0, 256);
+
+ Common::PrintingManager *pm = _vm->_system->getPrintingManager();
+ pm->printImage(surf);
+
+ break;
+ }
+ default:
+ error("Printing: Unsupported compression mode %d", srcComp);
+ }
if (_vm->_game.heversion <= 99 || (flags & kWRFAlloc) == 0)
destPtr = WizPxShrdBuffer();
@@ -701,7 +727,7 @@ int Wiz::hitTestWizPrim(int globNum, int state, int x, int y, int32 flags) {
byte *dataTmp = nullptr;
int outValue = 0;
-
+
if (((ScummEngine_v90he *)_vm)->_logicHE && ((ScummEngine_v90he *)_vm)->_logicHE->overrideImageHitTest(&outValue, globNum, state, x, y, flags)) {
return outValue;
}
@@ -1784,7 +1810,7 @@ void Wiz::dwHandleComplexImageDraw(int image, int state, int x, int y, int shado
correctedAngle = (360 - correctedAngle);
}
- // Get the upper left point so that our blit matches
+ // Get the upper left point so that our blit matches
// in position the normal warp drawing function...
polyBuildBoundingRect(listOfPoints, 4, boundingRect);
x = boundingRect.left;
@@ -2332,7 +2358,7 @@ void Wiz::ensureNativeFormatImageForState(int image, int state) {
switch (compType) {
// These were in the original but they appear to be dead code.
// Not removing these just yet...
- //
+ //
// case kWCTNone16Bpp:
// newCompType += kWCTNone16BppBigEndian - kWCTNone16Bpp;
// break;
@@ -2381,7 +2407,7 @@ void Wiz::processWizImageRenderEllipseCmd(const WizImageCommand *params) {
}
int whichImage = params->image;
-
+
// Make the clipping rect for this image / state...
getWizImageDim(whichImage, whichState, width, height);
@@ -2423,7 +2449,7 @@ void Wiz::processWizImageFontEndCmd(const WizImageCommand *params) {
void Wiz::processWizImageFontCreateCmd(const WizImageCommand *params) {
// Used for TTF text in FreddisFunShop/PuttsFunShop/SamsFunShop
- if (!(((ScummEngine_v99he *)_vm)->_heFont->createFont(params->image,
+ if (!(((ScummEngine_v99he *)_vm)->_heFont->createFont(params->image,
reinterpret_cast<const char *>(params->fontProperties.fontName),
params->fontProperties.fgColor,
params->fontProperties.bgColor,
Commit: 6dd889ea30a32395f587e89be098baf4051138d6
https://github.com/scummvm/scummvm/commit/6dd889ea30a32395f587e89be098baf4051138d6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
SCUMM: HE: Declare that we have printer
Changed paths:
engines/scumm/he/script_v70he.cpp
engines/scumm/he/script_v72he.cpp
diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp
index 9ebdf4152b6..039350a4581 100644
--- a/engines/scumm/he/script_v70he.cpp
+++ b/engines/scumm/he/script_v70he.cpp
@@ -405,7 +405,7 @@ void ScummEngine_v70he::o70_readINI() {
switch (type) {
case 1: // number
if (!strcmp((char *)option, "NoPrinting")) {
- push(1);
+ push(0);
} else if (!strcmp((char *)option, "TextOn")) {
push(ConfMan.getBool("subtitles"));
} else {
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index 37b388178db..3b7896e8faf 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -2085,7 +2085,7 @@ void ScummEngine_v72he::copyArray(int dstVariable, int dstDownMin, int dstDownMa
useMemcpy = (dstAcrossMin <= srcAcrossMin);
}
-
+
if (useMemcpy) {
for (int dstDownCounter = dstDownMin; dstDownCounter <= dstDownMax; dstDownCounter++) {
memcpy(dstPtr, srcPtr, dataSize);
@@ -2140,7 +2140,7 @@ void ScummEngine_v72he::o72_readINI() {
case ScummEngine_v100he::SO_DWORD: // HE 100
case SO_DWORD: // number
if (!strcmp((char *)option, "DisablePrinting") || !strcmp((char *)option, "NoPrinting")) {
- push(1);
+ push(0);
} else if (!strcmp((char *)option, "DisableMaiaUpdates")) {
// WORKAROUND: Override the update checks.
// This gets checked in Baseball 2001 and will check for
Commit: 5a5abd78a49c776c39c2ed729ed6a368a91c450f
https://github.com/scummvm/scummvm/commit/5a5abd78a49c776c39c2ed729ed6a368a91c450f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
GUI: Remove redundant namespace references
Changed paths:
gui/printing-dialog.cpp
gui/printing-dialog.h
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
index 61b573ecc14..5d1e83d9b61 100644
--- a/gui/printing-dialog.cpp
+++ b/gui/printing-dialog.cpp
@@ -32,11 +32,11 @@ namespace GUI {
PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
: Dialog("PrintingDialog"), _surface(surface) {
- _printButton = new GUI::ButtonWidget(this, "PrintingDialog.Print", _("Print"), Common::U32String(), kCmdPrint);
- _saveAsImageCheckbox = new GUI::CheckboxWidget(this, "PrintingDialog.SaveAsImage", _("Save as image"));
+ _printButton = new ButtonWidget(this, "PrintingDialog.Print", _("Print"), Common::U32String(), kCmdPrint);
+ _saveAsImageCheckbox = new CheckboxWidget(this, "PrintingDialog.SaveAsImage", _("Save as image"));
- new GUI::StaticTextWidget(this, "PrintingDialog.PrintersListDesc", _("Printer:"));
- _printersListPopUp = new GUI::PopUpWidget(this, "PrintingDialog.PrintersList", Common::U32String(), kCmdSelectPrinterName);
+ new StaticTextWidget(this, "PrintingDialog.PrintersListDesc", _("Printer:"));
+ _printersListPopUp = new PopUpWidget(this, "PrintingDialog.PrintersList", Common::U32String(), kCmdSelectPrinterName);
Common::PrintingManager *printMan = g_system->getPrintingManager();
Common::StringArray printerNames = printMan->listPrinterNames();
@@ -58,7 +58,7 @@ PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
g_system->getPrintingManager()->setPrinterName(_tagToPrinterName[defaultPrinterId]);
// Page settings
- new GUI::StaticTextWidget(this, "PrintingDialog.OrientationDesc", _("Orientation:"));
+ new StaticTextWidget(this, "PrintingDialog.OrientationDesc", _("Orientation:"));
_orientationPopUp = new PopUpWidget(this, "PrintingDialog.Orientation", Common::U32String(), kCmdSelectOrientation);
_orientationPopUp->appendEntry("Portrait", kPageOrientationPortrait);
_orientationPopUp->appendEntry("Landscape", kPageOrientationLandscape);
@@ -71,7 +71,7 @@ PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
new ButtonWidget(this, "PrintingDialog.Cancel", _("Cancel"), Common::U32String(), kCloseCmd);
}
-void PrintingDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
+void PrintingDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
switch (cmd) {
case kCmdPrint: {
Common::PrintingManager *printMan = g_system->getPrintingManager();
diff --git a/gui/printing-dialog.h b/gui/printing-dialog.h
index f49a96ffff5..ff5bb4aec25 100644
--- a/gui/printing-dialog.h
+++ b/gui/printing-dialog.h
@@ -29,7 +29,7 @@ class ButtonWidget;
class CheckboxWidget;
class PopUpWidget;
-class PrintingDialog : public GUI::Dialog {
+class PrintingDialog : public Dialog {
public:
enum {
kCmdPrint = 'PRNT',
@@ -39,16 +39,16 @@ public:
PrintingDialog(const Graphics::ManagedSurface &surface);
- void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override;
+ void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
private:
const Graphics::ManagedSurface &_surface;
- GUI::ButtonWidget *_printButton;
- GUI::CheckboxWidget *_saveAsImageCheckbox;
- GUI::PopUpWidget *_printersListPopUp;
+ ButtonWidget *_printButton;
+ CheckboxWidget *_saveAsImageCheckbox;
+ PopUpWidget *_printersListPopUp;
- GUI::PopUpWidget *_orientationPopUp;
+ PopUpWidget *_orientationPopUp;
Common::HashMap<uint32, Common::String> _tagToPrinterName;
};
Commit: 2c11bb0ccea9dca739518c122e9f40c4415b1e03
https://github.com/scummvm/scummvm/commit/2c11bb0ccea9dca739518c122e9f40c4415b1e03
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
GUI: Added preview to print dialog
Changed paths:
gui/printing-dialog.cpp
gui/printing-dialog.h
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
index 5d1e83d9b61..ed93582cff4 100644
--- a/gui/printing-dialog.cpp
+++ b/gui/printing-dialog.cpp
@@ -32,6 +32,9 @@ namespace GUI {
PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
: Dialog("PrintingDialog"), _surface(surface) {
+ _preview = new GraphicsWidget(this, "PrintingDialog.Preview");
+ _preview->setGfx(&surface, true);
+
_printButton = new ButtonWidget(this, "PrintingDialog.Print", _("Print"), Common::U32String(), kCmdPrint);
_saveAsImageCheckbox = new CheckboxWidget(this, "PrintingDialog.SaveAsImage", _("Save as image"));
diff --git a/gui/printing-dialog.h b/gui/printing-dialog.h
index ff5bb4aec25..31c956a6c84 100644
--- a/gui/printing-dialog.h
+++ b/gui/printing-dialog.h
@@ -28,6 +28,7 @@ namespace GUI {
class ButtonWidget;
class CheckboxWidget;
class PopUpWidget;
+class GraphicsWidget;
class PrintingDialog : public Dialog {
public:
@@ -44,6 +45,7 @@ public:
private:
const Graphics::ManagedSurface &_surface;
+ GraphicsWidget *_preview;
ButtonWidget *_printButton;
CheckboxWidget *_saveAsImageCheckbox;
PopUpWidget *_printersListPopUp;
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 20e66b6f55d..dc13d253991 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -2904,41 +2904,47 @@
</dialog>
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
- <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
- <widget name = 'PrintersListDesc'
- type = 'OptionsLabel'
- />
- <space/>
- <widget name = 'PrintersList'
- type = 'PopUp'
- width = '140'
- />
- </layout>
- <space/>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
- <widget name = 'OrientationDesc'
- type = 'OptionsLabel'
- />
- <space/>
- <widget name = 'Orientation'
- type = 'PopUp'
- width = '100'
- />
- </layout>
- <widget name = 'SaveAsImage'
- type = 'Checkbox'
- width = '140'
+ <layout type = 'horizontal' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'Preview'
+ width = '300'
+ height = '400'
/>
- <space/>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
- <widget name = 'Cancel'
- type = 'Button'
- />
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'PrintersListDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
+ </layout>
<space/>
- <widget name = 'Print'
- type = 'Button'
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'OrientationDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
+ </layout>
+ <widget name = 'SaveAsImage'
+ type = 'Checkbox'
+ width = '140'
/>
+ <space/>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'Cancel'
+ type = 'Button'
+ />
+ <space/>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
</layout>
</layout>
</dialog>
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index b3ac0018341..2b740834898 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -2709,41 +2709,47 @@
</dialog>
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
- <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
- <widget name = 'PrintersListDesc'
- type = 'OptionsLabel'
- />
- <space/>
- <widget name = 'PrintersList'
- type = 'PopUp'
- width = '140'
- />
- </layout>
- <space/>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
- <widget name = 'OrientationDesc'
- type = 'OptionsLabel'
- />
- <space/>
- <widget name = 'Orientation'
- type = 'PopUp'
+ <layout type = 'horizontal' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'Preview'
width = '100'
- />
- </layout>
- <widget name = 'SaveAsImage'
- type = 'Checkbox'
- width = '140'
+ height = '133'
/>
- <space/>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
- <widget name = 'Cancel'
- type = 'Button'
- />
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'PrintersListDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
+ </layout>
<space/>
- <widget name = 'Print'
- type = 'Button'
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'OrientationDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
+ </layout>
+ <widget name = 'SaveAsImage'
+ type = 'Checkbox'
+ width = '140'
/>
+ <space/>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'Cancel'
+ type = 'Button'
+ />
+ <space/>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
</layout>
</layout>
</dialog>
Commit: 2a566ac9f53a186eebe77c9aef7fb47f40483630
https://github.com/scummvm/scummvm/commit/2a566ac9f53a186eebe77c9aef7fb47f40483630
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
GUI: Relax setting of GraphicsWidget graphics
We did not allow it when boss widget is not visible
which happens during the dialog construction.
This allows setting widget at the creation time
Changed paths:
gui/widget.cpp
diff --git a/gui/widget.cpp b/gui/widget.cpp
index e8767f7670a..cb639b4fce5 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -986,7 +986,7 @@ void GraphicsWidget::setGfx(const Graphics::ManagedSurface *gfx, bool scale) {
if (!gfx || !gfx->getPixels())
return;
- if (!isVisible() || !_boss->isVisible())
+ if (!isVisible())
return;
float sf = g_gui.getScaleFactor();
@@ -1024,7 +1024,7 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
delete _gfx;
_gfx = nullptr;
- if (!isVisible() || !_boss->isVisible())
+ if (!isVisible())
return;
if (w == -1)
Commit: c1780320e85fad9a6df417b67587070c9f9e259f
https://github.com/scummvm/scummvm/commit/c1780320e85fad9a6df417b67587070c9f9e259f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
SCUMM: HE: Proper code for Wiz printing
Changed paths:
engines/scumm/he/wiz_he.cpp
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index b2b58187696..5bbfefa5875 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -463,18 +463,9 @@ WizPxShrdBuffer Wiz::drawAWizPrimEx(int globNum, int state, int x, int y, int z,
switch (srcComp) {
case kWCTNone:
{
- Graphics::ManagedSurface surf;
- surf.w = srcWidth;
- surf.h = srcHeight;
- surf.format=Graphics::PixelFormat::createFormatCLUT8();
-
- uint8 *wizd = getWizStateDataPrim(globNum, state);
- assert(wizd);
- surf.setPixels(wizd);
-
- uint8 *pal = getWizStatePaletteDataPrim(globNum, state);
- assert(pal);
- surf.setPalette(pal, 0, 256);
+ Graphics::ManagedSurface surf(destWidth, destHeight, Graphics::PixelFormat::createFormatCLUT8());
+ surf.copyRectToSurface(destPtr(), destWidth, 0, 0, destWidth, destHeight);
+ surf.setPalette(_vm->getHEPaletteSlot(1), 0,256);
Common::PrintingManager *pm = _vm->_system->getPrintingManager();
pm->printImage(surf);
Commit: 3d4c810ef6e0bf09fc97faf2d0cd66059e482131
https://github.com/scummvm/scummvm/commit/3d4c810ef6e0bf09fc97faf2d0cd66059e482131
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
GUI: Scale print preview image to fit in the widget
Changed paths:
gui/printing-dialog.cpp
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
index ed93582cff4..898d523009a 100644
--- a/gui/printing-dialog.cpp
+++ b/gui/printing-dialog.cpp
@@ -28,12 +28,29 @@
#include "gui/widget.h"
#include "gui/widgets/popup.h"
+#include "gui/gui-manager.h"
+#include "gui/ThemeEval.h"
+
namespace GUI {
PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
: Dialog("PrintingDialog"), _surface(surface) {
_preview = new GraphicsWidget(this, "PrintingDialog.Preview");
- _preview->setGfx(&surface, true);
+
+ int16 x, y, w, h;
+
+ if (!g_gui.xmlEval()->getWidgetData("PrintingDialog.Preview", x, y, w, h))
+ error("Failed to get widget data for PrintingDialog.Preview");
+
+ // Scale the surface to fit the preview area, if needed
+ float scaleX = (float)w / surface.w;
+ float scaleY = (float)h / surface.h;
+ float scale = MIN(scaleX, scaleY);
+
+ Graphics::ManagedSurface *scaled = surface.scale((int)(surface.w * scale), (int)(surface.h * scale));
+ _preview->setGfx(scaled, false);
+
+ delete scaled;
_printButton = new ButtonWidget(this, "PrintingDialog.Print", _("Print"), Common::U32String(), kCmdPrint);
_saveAsImageCheckbox = new CheckboxWidget(this, "PrintingDialog.SaveAsImage", _("Save as image"));
Commit: c49c86929c10bbc9254712beab286d9b7c94eaf5
https://github.com/scummvm/scummvm/commit/c49c86929c10bbc9254712beab286d9b7c94eaf5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
GUI: Render whole page canvas with imge centered on it in print dialog
Changed paths:
gui/printing-dialog.cpp
diff --git a/gui/printing-dialog.cpp b/gui/printing-dialog.cpp
index 898d523009a..21de830328c 100644
--- a/gui/printing-dialog.cpp
+++ b/gui/printing-dialog.cpp
@@ -38,7 +38,6 @@ PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
_preview = new GraphicsWidget(this, "PrintingDialog.Preview");
int16 x, y, w, h;
-
if (!g_gui.xmlEval()->getWidgetData("PrintingDialog.Preview", x, y, w, h))
error("Failed to get widget data for PrintingDialog.Preview");
@@ -47,10 +46,13 @@ PrintingDialog::PrintingDialog(const Graphics::ManagedSurface &surface)
float scaleY = (float)h / surface.h;
float scale = MIN(scaleX, scaleY);
- Graphics::ManagedSurface *scaled = surface.scale((int)(surface.w * scale), (int)(surface.h * scale));
- _preview->setGfx(scaled, false);
+ // Draw page and center the image on it
+ Graphics::ManagedSurface render(w, h, g_gui.theme()->getPixelFormat());
+ render.fillRect(Common::Rect(0, 0, w, h), render.format.RGBToColor(255, 255, 255));
+ render.blitFrom(_surface, _surface.getBounds(), Common::Rect((w - _surface.w * scale) / 2, (h - _surface.h * scale) / 2,
+ (w + _surface.w * scale) / 2, (h + _surface.h * scale) / 2));
- delete scaled;
+ _preview->setGfx(&render, false);
_printButton = new ButtonWidget(this, "PrintingDialog.Print", _("Print"), Common::U32String(), kCmdPrint);
_saveAsImageCheckbox = new CheckboxWidget(this, "PrintingDialog.SaveAsImage", _("Save as image"));
Commit: 36edfe7268604fc4db3241b8ba214866a4ba6614
https://github.com/scummvm/scummvm/commit/36edfe7268604fc4db3241b8ba214866a4ba6614
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
BACKENDS: PRINTING: Use provided image palette instead of system one
Changed paths:
backends/printing/printman.cpp
diff --git a/backends/printing/printman.cpp b/backends/printing/printman.cpp
index ea22b89f990..65a43e56a00 100644
--- a/backends/printing/printman.cpp
+++ b/backends/printing/printman.cpp
@@ -24,8 +24,6 @@
#include "common/savefile.h"
#include "common/system.h"
-#include "graphics/paletteman.h"
-
#include "printman.h"
#include "gui/printing-dialog.h"
@@ -82,7 +80,7 @@ void PrintingManager::saveAsImage(const Graphics::ManagedSurface &surf, const Co
}
byte palette[256 * 3];
- g_system->getPaletteManager()->grabPalette(palette, 0, 256);
+ surf.grabPalette(palette, 0, 256);
#ifdef USE_PNG
Image::writePNG(*saveFile, surf, palette);
Commit: 777a2d692267ef204206947b6470ba9875dba113
https://github.com/scummvm/scummvm/commit/777a2d692267ef204206947b6470ba9875dba113
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:27+01:00
Commit Message:
SCUMM: HE: Remove unnecessary check for compression in WIZ printing
Changed paths:
engines/scumm/he/wiz_he.cpp
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 5bbfefa5875..3eabea4a3b8 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -460,21 +460,12 @@ WizPxShrdBuffer Wiz::drawAWizPrimEx(int globNum, int state, int x, int y, int z,
// Verify if it's a printing operation...
if (flags & kWRFPrint) {
- switch (srcComp) {
- case kWCTNone:
- {
- Graphics::ManagedSurface surf(destWidth, destHeight, Graphics::PixelFormat::createFormatCLUT8());
- surf.copyRectToSurface(destPtr(), destWidth, 0, 0, destWidth, destHeight);
- surf.setPalette(_vm->getHEPaletteSlot(1), 0,256);
+ Graphics::ManagedSurface surf(destWidth, destHeight, Graphics::PixelFormat::createFormatCLUT8());
+ surf.copyRectToSurface(destPtr(), destWidth, 0, 0, destWidth, destHeight);
+ surf.setPalette(_vm->getHEPaletteSlot(1), 0, 256);
- Common::PrintingManager *pm = _vm->_system->getPrintingManager();
- pm->printImage(surf);
-
- break;
- }
- default:
- error("Printing: Unsupported compression mode %d", srcComp);
- }
+ Common::PrintingManager *pm = _vm->_system->getPrintingManager();
+ pm->printImage(surf);
if (_vm->_game.heversion <= 99 || (flags & kWRFAlloc) == 0)
destPtr = WizPxShrdBuffer();
Commit: 33b967fa83dfb060f4bcef47cd91a61d29116a22
https://github.com/scummvm/scummvm/commit/33b967fa83dfb060f4bcef47cd91a61d29116a22
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:28+01:00
Commit Message:
SCUMM: HE: Use system-wide palette for WIZ images for now
We need to modify (stretch?) the WIS palette as it is rendered
too dark. Until this, use this rather hacky solution
Changed paths:
engines/scumm/he/wiz_he.cpp
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 3eabea4a3b8..1ba52b4208d 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -25,6 +25,7 @@
#include "common/ptr.h"
#include "common/system.h"
#include "graphics/cursorman.h"
+#include "graphics/paletteman.h"
#include "graphics/primitives.h"
#include "scumm/he/font_he.h"
@@ -462,7 +463,10 @@ WizPxShrdBuffer Wiz::drawAWizPrimEx(int globNum, int state, int x, int y, int z,
if (flags & kWRFPrint) {
Graphics::ManagedSurface surf(destWidth, destHeight, Graphics::PixelFormat::createFormatCLUT8());
surf.copyRectToSurface(destPtr(), destWidth, 0, 0, destWidth, destHeight);
- surf.setPalette(_vm->getHEPaletteSlot(1), 0, 256);
+
+ byte palette[256 * 3];
+ g_system->getPaletteManager()->grabPalette(palette, 0, 256);
+ surf.setPalette(palette, 0, 256);
Common::PrintingManager *pm = _vm->_system->getPrintingManager();
pm->printImage(surf);
Commit: c00fe00e0c421861753727933e7ef85095512aef
https://github.com/scummvm/scummvm/commit/c00fe00e0c421861753727933e7ef85095512aef
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:28+01:00
Commit Message:
BACKENDS: PRINTING: Fix include
Changed paths:
backends/printing/printman.cpp
diff --git a/backends/printing/printman.cpp b/backends/printing/printman.cpp
index 65a43e56a00..baf716b052b 100644
--- a/backends/printing/printman.cpp
+++ b/backends/printing/printman.cpp
@@ -24,7 +24,7 @@
#include "common/savefile.h"
#include "common/system.h"
-#include "printman.h"
+#include "backends/printing/printman.h"
#include "gui/printing-dialog.h"
Commit: ff6f71b84c9457373af0eabbf45570274f6bb09b
https://github.com/scummvm/scummvm/commit/ff6f71b84c9457373af0eabbf45570274f6bb09b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:28+01:00
Commit Message:
SCUMM: HE: Split printing code path into 16-bit/8-bit branches
Changed paths:
engines/scumm/he/wiz_he.cpp
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index 1ba52b4208d..c30c57fbe24 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -464,9 +464,23 @@ WizPxShrdBuffer Wiz::drawAWizPrimEx(int globNum, int state, int x, int y, int z,
Graphics::ManagedSurface surf(destWidth, destHeight, Graphics::PixelFormat::createFormatCLUT8());
surf.copyRectToSurface(destPtr(), destWidth, 0, 0, destWidth, destHeight);
- byte palette[256 * 3];
- g_system->getPaletteManager()->grabPalette(palette, 0, 256);
- surf.setPalette(palette, 0, 256);
+ byte pal[256 * 3];
+
+ if (_vm->_game.features & GF_16BIT_COLOR) {
+ WizRawPixel *wpal = (WizRawPixel *)_vm->getHEPaletteSlot(1);
+ int r, g, b;
+ for (int i = 0; i < 256; i++) {
+ rawPixelExtractComponents(wpal[i], r, g, b);
+ pal[i * 3 + 0] = r;
+ pal[i * 3 + 1] = g;
+ pal[i * 3 + 2] = b;
+ }
+ } else {
+ // Taking the current global palette. FIXME: could be not the thing we want
+ g_system->getPaletteManager()->grabPalette(pal, 0, 256);
+ }
+
+ surf.setPalette(pal, 0, 256);
Common::PrintingManager *pm = _vm->_system->getPrintingManager();
pm->printImage(surf);
Commit: 8b345a90713e0dacefdd130357cb17f880151904
https://github.com/scummvm/scummvm/commit/8b345a90713e0dacefdd130357cb17f880151904
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:28+01:00
Commit Message:
GUI: Reduced padding in lowres theme and synced classic with it
Changed paths:
gui/themes/common/lowres_layout.stx
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 2b740834898..2d2cde664b1 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -2709,12 +2709,12 @@
</dialog>
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
- <layout type = 'horizontal' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '8, 8, 8, 8' spacing = '8'>
<widget name = 'Preview'
width = '100'
height = '133'
/>
- <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'vertical' padding = '8, 8, 8, 8' spacing = '8'>
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
<widget name = 'PrintersListDesc'
type = 'OptionsLabel'
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 439f2dcdeef..3be4ef3a431 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -2537,41 +2537,47 @@
</dialog>
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
- <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
- <widget name = 'PrintersListDesc'
- type = 'OptionsLabel'
- />
- <space/>
- <widget name = 'PrintersList'
- type = 'PopUp'
- width = '140'
- />
- </layout>
- <space/>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
- <widget name = 'OrientationDesc'
- type = 'OptionsLabel'
- />
- <space/>
- <widget name = 'Orientation'
- type = 'PopUp'
- width = '100'
- />
- </layout>
- <widget name = 'SaveAsImage'
- type = 'Checkbox'
- width = '140'
+ <layout type = 'horizontal' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'Preview'
+ width = '300'
+ height = '400'
/>
- <space/>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
- <widget name = 'Cancel'
- type = 'Button'
- />
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'PrintersListDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
+ </layout>
<space/>
- <widget name = 'Print'
- type = 'Button'
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'OrientationDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
+ </layout>
+ <widget name = 'SaveAsImage'
+ type = 'Checkbox'
+ width = '140'
/>
+ <space/>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'Cancel'
+ type = 'Button'
+ />
+ <space/>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
</layout>
</layout>
</dialog>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 33c2062d414..f476d5637a9 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -2516,41 +2516,47 @@
</dialog>
<dialog name = 'PrintingDialog' overlays = 'screen_center' shading = 'dim'>
- <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
- <widget name = 'PrintersListDesc'
- type = 'OptionsLabel'
- />
- <space/>
- <widget name = 'PrintersList'
- type = 'PopUp'
- width = '140'
- />
- </layout>
- <space/>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
- <widget name = 'OrientationDesc'
- type = 'OptionsLabel'
- />
- <space/>
- <widget name = 'Orientation'
- type = 'PopUp'
+ <layout type = 'horizontal' padding = '8, 8, 8, 8' spacing = '8'>
+ <widget name = 'Preview'
width = '100'
- />
- </layout>
- <widget name = 'SaveAsImage'
- type = 'Checkbox'
- width = '140'
+ height = '133'
/>
- <space/>
- <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
- <widget name = 'Cancel'
- type = 'Button'
- />
+ <layout type = 'vertical' padding = '8, 8, 8, 8' spacing = '8'>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'PrintersListDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'PrintersList'
+ type = 'PopUp'
+ width = '140'
+ />
+ </layout>
<space/>
- <widget name = 'Print'
- type = 'Button'
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
+ <widget name = 'OrientationDesc'
+ type = 'OptionsLabel'
+ />
+ <space/>
+ <widget name = 'Orientation'
+ type = 'PopUp'
+ width = '100'
+ />
+ </layout>
+ <widget name = 'SaveAsImage'
+ type = 'Checkbox'
+ width = '140'
/>
+ <space/>
+ <layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10'>
+ <widget name = 'Cancel'
+ type = 'Button'
+ />
+ <space/>
+ <widget name = 'Print'
+ type = 'Button'
+ />
+ </layout>
</layout>
</layout>
</dialog>
Commit: ee592cb2f7e970e78bca34713d7525d44e811fe5
https://github.com/scummvm/scummvm/commit/ee592cb2f7e970e78bca34713d7525d44e811fe5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-02-15T14:37:28+01:00
Commit Message:
GUI: Regenerate themes
Changed paths:
gui/themes/default.inc
gui/themes/residualvm.zip
gui/themes/scummclassic.zip
gui/themes/scummmodern.zip
gui/themes/scummremastered.zip
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 8e95b66fa36..c450485e944 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -3837,6 +3837,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</dialog>"
"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
+"<layout type='horizontal' padding='16,16,16,16' spacing='8'>"
+"<widget name='Preview' "
+"width='300' "
+"height='400' "
+"/>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
"<layout type='horizontal' padding='0,0,0,0' spacing='8'>"
"<widget name='PrintersListDesc' "
@@ -3874,6 +3879,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"/>"
"</layout>"
"</layout>"
+"</layout>"
"</dialog>"
"</layout_info>"
;
@@ -6253,7 +6259,12 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</dialog>"
"<dialog name='PrintingDialog' overlays='screen_center' shading='dim'>"
-"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<layout type='horizontal' padding='8,8,8,8' spacing='8'>"
+"<widget name='Preview' "
+"width='100' "
+"height='133' "
+"/>"
+"<layout type='vertical' padding='8,8,8,8' spacing='8'>"
"<layout type='horizontal' padding='0,0,0,0' spacing='8'>"
"<widget name='PrintersListDesc' "
"type='OptionsLabel' "
@@ -6290,6 +6301,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"/>"
"</layout>"
"</layout>"
+"</layout>"
"</dialog>"
"</layout_info>"
;
diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip
index 021f48a828b..cb3fdc96bf5 100644
Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 71d2f8c028f..d0328f411ae 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 1b601b296ee..b3bffe4ff90 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index d7da5214761..75bfd46a1ee 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ
More information about the Scummvm-git-logs
mailing list