#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/qt/qt_shim.h"
#include <cmath>
#include <QApplication>
#include <QFont>
#include <QIcon>
#include <QMimeDatabase>
#include <QMimeType>
#include <QPainter>
#include <QPalette>
#include <QScreen>
#include <QStyle>
#include <QStyleOptionTitleBar>
namespace qt {
namespace {
bool IsStyleItalic(QFont::Style style) { … }
FontHinting QtHintingToFontHinting(QFont::HintingPreference hinting) { … }
SkColor GradientColor(const QGradient& gradient) { … }
SkColor TextureColor(QImage image) { … }
SkColor BrushColor(const QBrush& brush) { … }
QPalette::ColorRole ColorTypeToColorRole(ColorType type) { … }
QPalette::ColorGroup ColorStateToColorGroup(ColorState state) { … }
float GetScreenScale(const QScreen* screen) { … }
}
QtShim::QtShim(QtInterface::Delegate* delegate, int* argc, char** argv)
: … { … }
QtShim::~QtShim() = default;
size_t QtShim::GetMonitorConfig(MonitorScale** monitors, float* primary_scale) { … }
FontRenderParams QtShim::GetFontRenderParams() const { … }
FontDescription QtShim::GetFontDescription() const { … }
Image QtShim::GetIconForContentType(const String& content_type,
int size) const { … }
SkColor QtShim::GetColor(ColorType role, ColorState state) const { … }
SkColor QtShim::GetFrameColor(ColorState state, bool use_custom_frame) const { … }
int QtShim::GetCursorBlinkIntervalMs() const { … }
int QtShim::GetAnimationDurationMs() const { … }
DISABLE_CFI_VCALL
void QtShim::FontChanged(const QFont& font) { … }
DISABLE_CFI_VCALL
void QtShim::PaletteChanged(const QPalette& palette) { … }
DISABLE_CFI_VCALL
void QtShim::ScreenAdded(QScreen* screen) { … }
DISABLE_CFI_VCALL
void QtShim::ScreenRemoved(QScreen* screen) { … }
DISABLE_CFI_VCALL
void QtShim::LogicalDotsPerInchChanged(qreal dpi) { … }
DISABLE_CFI_VCALL
void QtShim::PhysicalDotsPerInchChanged(qreal dpi) { … }
Image QtShim::DrawHeader(int width,
int height,
SkColor default_color,
ColorState state,
bool use_custom_frame) const { … }
QImage QtShim::DrawHeaderImpl(int width,
int height,
SkColor default_color,
ColorState state,
bool use_custom_frame) const { … }
}
qt::QtInterface* CreateQtInterface(qt::QtInterface::Delegate* delegate,
int* argc,
char** argv) { … }