initial port for Cevo game in C++ (libs)

This commit is contained in:
Geoffray Levasseur committed 2026-10-22 17:20:45 +02:00
commit 8436242032
375 files changed
+46282

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
#pragma once
#include <QPoint>
#include <QRect>
#include <QSize>
#include <QString>
namespace Dpi {
// Mirrors the role of Dpi.Common.pas / its ScreenInfo record: conversion
// between the DPI-independent coordinate space used for widget geometry
// (Qt's logical / device-independent pixels) and the native physical pixel
// space used by raw pixel buffers (QImage scanlines, screen grabs, etc.).
// Qt widgets already scale logical pixels to the physical display
// automatically, so these helpers are only needed where code must address
// physical pixels directly (e.g. custom raster rendering).
class ScreenInfo {
public:
// Effective DPI of the primary screen (96 == 100% scaling), kept for API
// parity with the Pascal ScreenInfo.Dpi property.
static int dpi();
// Multiplier from DPI-independent to native/physical pixels.
static double toNative();
// Multiplier from native/physical to DPI-independent pixels.
static double fromNative();
};
int scaleToNative(int value);
int scaleFromNative(int value);
int scaleToNativeDist(int base, int value);
QPoint scalePointToNative(const QPoint &value);
QPoint scalePointFromNative(const QPoint &value);
QSize scaleSizeToNative(const QSize &value);
QSize scaleSizeFromNative(const QSize &value);
QRect scaleRectToNative(const QRect &value);
QRect scaleRectFromNative(const QRect &value);
double scaleFloatToNative(double value);
double scaleFloatFromNative(double value);
void writeLog(const QString &text);
} // namespace Dpi