Kaydet (Commit) 9827eaea authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

force a specific DPI with SAL_FORCEDPI (GTK2 & GTK3 backends only)

Change-Id: I2c154e4df060ade36744c6aa2fbffa8c6e665629
üst 2a19bb85
...@@ -278,6 +278,14 @@ bool X11SalGraphics::GetDitherPixmap( SalColor nSalColor ) ...@@ -278,6 +278,14 @@ bool X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // const void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // const
{ {
char* pForceDpi;
if ((pForceDpi = getenv("SAL_FORCEDPI")))
{
OString sForceDPI(pForceDpi);
rDPIX = rDPIY = sForceDPI.toInt32();
return;
}
const SalDisplay *pDisplay = GetDisplay(); const SalDisplay *pDisplay = GetDisplay();
if (!pDisplay) if (!pDisplay)
{ {
......
...@@ -2102,6 +2102,14 @@ cairo_t* GtkSalGraphics::getCairoContext() const ...@@ -2102,6 +2102,14 @@ cairo_t* GtkSalGraphics::getCairoContext() const
void GtkSalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) void GtkSalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
{ {
char* pForceDpi;
if ((pForceDpi = getenv("SAL_FORCEDPI")))
{
OString sForceDPI(pForceDpi);
rDPIX = rDPIY = sForceDPI.toInt32();
return;
}
GdkScreen* pScreen = gtk_widget_get_screen(mpWindow); GdkScreen* pScreen = gtk_widget_get_screen(mpWindow);
double fResolution = -1.0; double fResolution = -1.0;
g_object_get(pScreen, "resolution", &fResolution, nullptr); g_object_get(pScreen, "resolution", &fResolution, nullptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment