2020-01-18 05:38:21 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2020-02-06 08:07:05 -03:00
|
|
|
#include <LibGfx/Bitmap.h>
|
2020-08-12 06:54:17 -03:00
|
|
|
#include <LibGfx/ClassicStylePainter.h>
|
2020-02-06 08:04:00 -03:00
|
|
|
#include <LibGfx/Painter.h>
|
|
|
|
|
#include <LibGfx/Palette.h>
|
|
|
|
|
#include <LibGfx/StylePainter.h>
|
2019-02-10 04:11:01 -02:00
|
|
|
|
2020-02-06 07:56:38 -03:00
|
|
|
namespace Gfx {
|
|
|
|
|
|
2020-08-12 06:54:17 -03:00
|
|
|
BaseStylePainter& StylePainter::current()
|
2019-05-05 09:39:37 -03:00
|
|
|
{
|
2020-08-12 06:54:17 -03:00
|
|
|
static ClassicStylePainter style;
|
|
|
|
|
return style;
|
2019-05-05 09:39:37 -03:00
|
|
|
}
|
|
|
|
|
|
2021-07-28 15:23:31 -03:00
|
|
|
void StylePainter::paint_tab_button(Painter& painter, const IntRect& rect, const Palette& palette, bool active, bool hovered, bool enabled, bool top, bool in_active_window)
|
2019-03-27 16:48:23 -03:00
|
|
|
{
|
2021-07-28 15:23:31 -03:00
|
|
|
current().paint_tab_button(painter, rect, palette, active, hovered, enabled, top, in_active_window);
|
2019-03-27 16:48:23 -03:00
|
|
|
}
|
|
|
|
|
|
2020-12-28 08:40:48 -03:00
|
|
|
void StylePainter::paint_button(Painter& painter, const IntRect& rect, const Palette& palette, ButtonStyle button_style, bool pressed, bool hovered, bool checked, bool enabled, bool focused)
|
2019-02-10 04:11:01 -02:00
|
|
|
{
|
2020-12-28 08:40:48 -03:00
|
|
|
current().paint_button(painter, rect, palette, button_style, pressed, hovered, checked, enabled, focused);
|
2019-02-10 04:11:01 -02:00
|
|
|
}
|
2019-03-04 06:47:54 -03:00
|
|
|
|
2020-06-10 05:57:59 -03:00
|
|
|
void StylePainter::paint_frame(Painter& painter, const IntRect& rect, const Palette& palette, FrameShape shape, FrameShadow shadow, int thickness, bool skip_vertical_lines)
|
2019-04-09 22:43:46 -03:00
|
|
|
{
|
2020-08-12 06:54:17 -03:00
|
|
|
current().paint_frame(painter, rect, palette, shape, shadow, thickness, skip_vertical_lines);
|
2019-04-09 22:43:46 -03:00
|
|
|
}
|
2019-04-16 12:02:26 -03:00
|
|
|
|
2020-06-10 05:57:59 -03:00
|
|
|
void StylePainter::paint_window_frame(Painter& painter, const IntRect& rect, const Palette& palette)
|
2019-04-16 12:02:26 -03:00
|
|
|
{
|
2020-08-12 06:54:17 -03:00
|
|
|
current().paint_window_frame(painter, rect, palette);
|
2019-04-16 12:02:26 -03:00
|
|
|
}
|
2019-08-14 15:31:46 -03:00
|
|
|
|
2021-04-13 11:18:20 -03:00
|
|
|
void StylePainter::paint_progressbar(Painter& painter, const IntRect& rect, const Palette& palette, int min, int max, int value, const StringView& text, Orientation orientation)
|
2019-08-14 15:31:46 -03:00
|
|
|
{
|
2021-04-13 11:18:20 -03:00
|
|
|
current().paint_progressbar(painter, rect, palette, min, max, value, text, orientation);
|
2020-01-08 16:29:12 -03:00
|
|
|
}
|
|
|
|
|
|
2020-08-12 06:54:17 -03:00
|
|
|
void StylePainter::paint_radio_button(Painter& painter, const IntRect& rect, const Palette& palette, bool is_checked, bool is_being_pressed)
|
2020-01-08 16:29:12 -03:00
|
|
|
{
|
2020-08-12 06:54:17 -03:00
|
|
|
current().paint_radio_button(painter, rect, palette, is_checked, is_being_pressed);
|
2020-01-08 16:29:12 -03:00
|
|
|
}
|
2020-02-06 07:56:38 -03:00
|
|
|
|
2020-09-11 12:21:53 -03:00
|
|
|
void StylePainter::paint_check_box(Painter& painter, const IntRect& rect, const Palette& palette, bool is_enabled, bool is_checked, bool is_being_pressed)
|
|
|
|
|
{
|
|
|
|
|
current().paint_check_box(painter, rect, palette, is_enabled, is_checked, is_being_pressed);
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-25 11:33:12 -03:00
|
|
|
void StylePainter::paint_transparency_grid(Painter& painter, const IntRect& rect, const Palette& palette)
|
|
|
|
|
{
|
|
|
|
|
current().paint_transparency_grid(painter, rect, palette);
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-06 07:56:38 -03:00
|
|
|
}
|