2020-03-29 19:01:55 +03:00
|
|
|
|
/*
|
2020-12-25 14:15:16 +03:00
|
|
|
|
* Copyright (c) 2020, Hüseyin Aslıtürk <asliturk@hotmail.com>
|
2020-03-29 19:01:55 +03:00
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
|
*
|
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
|
*
|
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibGUI/Widget.h>
|
|
|
|
|
|
2020-12-30 04:44:03 +03:00
|
|
|
|
namespace DisplaySettings {
|
|
|
|
|
|
2020-03-29 19:01:55 +03:00
|
|
|
|
class MonitorWidget final : public GUI::Widget {
|
|
|
|
|
C_OBJECT(MonitorWidget);
|
|
|
|
|
|
|
|
|
|
public:
|
2020-06-27 12:04:43 +03:00
|
|
|
|
bool set_wallpaper(String path);
|
2020-03-29 19:01:55 +03:00
|
|
|
|
String wallpaper();
|
|
|
|
|
|
|
|
|
|
void set_wallpaper_mode(String mode);
|
|
|
|
|
String wallpaper_mode();
|
|
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
|
void set_desktop_resolution(Gfx::IntSize resolution);
|
|
|
|
|
Gfx::IntSize desktop_resolution();
|
2020-03-29 19:01:55 +03:00
|
|
|
|
|
2021-01-16 03:02:17 +03:00
|
|
|
|
void set_desktop_scale_factor(int scale_factor) { m_desktop_scale_factor = scale_factor; }
|
|
|
|
|
int desktop_scale_factor() const { return m_desktop_scale_factor; }
|
|
|
|
|
|
2020-03-29 19:01:55 +03:00
|
|
|
|
void set_background_color(Gfx::Color background_color);
|
|
|
|
|
Gfx::Color background_color();
|
|
|
|
|
|
|
|
|
|
private:
|
2020-12-30 04:44:03 +03:00
|
|
|
|
MonitorWidget();
|
|
|
|
|
|
2020-03-29 19:01:55 +03:00
|
|
|
|
virtual void paint_event(GUI::PaintEvent& event) override;
|
|
|
|
|
|
2020-06-10 11:57:59 +03:00
|
|
|
|
Gfx::IntRect m_monitor_rect;
|
2020-03-29 19:01:55 +03:00
|
|
|
|
RefPtr<Gfx::Bitmap> m_monitor_bitmap;
|
|
|
|
|
|
|
|
|
|
String m_desktop_wallpaper_path;
|
|
|
|
|
RefPtr<Gfx::Bitmap> m_desktop_wallpaper_bitmap;
|
|
|
|
|
String m_desktop_wallpaper_mode;
|
2020-06-10 11:57:59 +03:00
|
|
|
|
Gfx::IntSize m_desktop_resolution;
|
2021-01-16 03:02:17 +03:00
|
|
|
|
int m_desktop_scale_factor { 1 };
|
2020-03-29 19:01:55 +03:00
|
|
|
|
Gfx::Color m_desktop_color;
|
|
|
|
|
};
|
2020-12-30 04:44:03 +03:00
|
|
|
|
|
|
|
|
|
}
|