mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 11:57:35 +00:00
WebContent: Add IPC for setting 'device pixels per CSS pixel'
This commit is contained in:
parent
075b4ca4d0
commit
f3b6b50ee0
4 changed files with 9 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org>
|
||||||
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
|
||||||
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
|
* Copyright (c) 2021-2023, Linus Groh <linusg@serenityos.org>
|
||||||
* Copyright (c) 2022, Tobias Christiansen <tobyase@serenityos.org>
|
* Copyright (c) 2022, Tobias Christiansen <tobyase@serenityos.org>
|
||||||
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
|
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
|
||||||
*
|
*
|
||||||
|
@ -530,6 +530,11 @@ void ConnectionFromClient::set_is_scripting_enabled(bool is_scripting_enabled)
|
||||||
m_page_host->set_is_scripting_enabled(is_scripting_enabled);
|
m_page_host->set_is_scripting_enabled(is_scripting_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConnectionFromClient::set_device_pixels_per_css_pixel(float device_pixels_per_css_pixel)
|
||||||
|
{
|
||||||
|
m_page_host->set_device_pixels_per_css_pixel(device_pixels_per_css_pixel);
|
||||||
|
}
|
||||||
|
|
||||||
void ConnectionFromClient::set_window_position(Gfx::IntPoint position)
|
void ConnectionFromClient::set_window_position(Gfx::IntPoint position)
|
||||||
{
|
{
|
||||||
m_page_host->set_window_position(position.to_type<Web::DevicePixels>());
|
m_page_host->set_window_position(position.to_type<Web::DevicePixels>());
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||||
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
|
* Copyright (c) 2021-2023, Linus Groh <linusg@serenityos.org>
|
||||||
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
|
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
@ -76,6 +76,7 @@ private:
|
||||||
virtual void set_preferred_color_scheme(Web::CSS::PreferredColorScheme const&) override;
|
virtual void set_preferred_color_scheme(Web::CSS::PreferredColorScheme const&) override;
|
||||||
virtual void set_has_focus(bool) override;
|
virtual void set_has_focus(bool) override;
|
||||||
virtual void set_is_scripting_enabled(bool) override;
|
virtual void set_is_scripting_enabled(bool) override;
|
||||||
|
virtual void set_device_pixels_per_css_pixel(float) override;
|
||||||
virtual void set_window_position(Gfx::IntPoint) override;
|
virtual void set_window_position(Gfx::IntPoint) override;
|
||||||
virtual void set_window_size(Gfx::IntSize) override;
|
virtual void set_window_size(Gfx::IntSize) override;
|
||||||
virtual void handle_file_return(i32 error, Optional<IPC::File> const& file, i32 request_id) override;
|
virtual void handle_file_return(i32 error, Optional<IPC::File> const& file, i32 request_id) override;
|
||||||
|
|
|
@ -109,7 +109,6 @@ private:
|
||||||
RefPtr<Gfx::PaletteImpl> m_palette_impl;
|
RefPtr<Gfx::PaletteImpl> m_palette_impl;
|
||||||
Web::DevicePixelRect m_screen_rect;
|
Web::DevicePixelRect m_screen_rect;
|
||||||
Web::DevicePixelSize m_content_size;
|
Web::DevicePixelSize m_content_size;
|
||||||
// FIXME: Actually set this based on the device's pixel ratio.
|
|
||||||
float m_device_pixels_per_css_pixel { 1.0f };
|
float m_device_pixels_per_css_pixel { 1.0f };
|
||||||
bool m_should_show_line_box_borders { false };
|
bool m_should_show_line_box_borders { false };
|
||||||
bool m_has_focus { false };
|
bool m_has_focus { false };
|
||||||
|
|
|
@ -56,6 +56,7 @@ endpoint WebContentServer
|
||||||
set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme) =|
|
set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme) =|
|
||||||
set_has_focus(bool has_focus) =|
|
set_has_focus(bool has_focus) =|
|
||||||
set_is_scripting_enabled(bool is_scripting_enabled) =|
|
set_is_scripting_enabled(bool is_scripting_enabled) =|
|
||||||
|
set_device_pixels_per_css_pixel(float device_pixels_per_css_pixel) =|
|
||||||
|
|
||||||
set_window_position(Gfx::IntPoint position) =|
|
set_window_position(Gfx::IntPoint position) =|
|
||||||
set_window_size(Gfx::IntSize size) =|
|
set_window_size(Gfx::IntSize size) =|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue