chromium/ui/qt/qt_shim.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

// IMPORTANT NOTE: All QtShim members that use `delegate_` must be decorated
// with DISABLE_CFI_VCALL.

#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) {}

// Obtain the average color of a gradient.
SkColor GradientColor(const QGradient& gradient) {}

// Obtain the average color of a texture.
SkColor TextureColor(QImage image) {}

SkColor BrushColor(const QBrush& brush) {}

QPalette::ColorRole ColorTypeToColorRole(ColorType type) {}

QPalette::ColorGroup ColorStateToColorGroup(ColorState state) {}

float GetScreenScale(const QScreen* screen) {}

}  // namespace

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 {}

}  // namespace qt

qt::QtInterface* CreateQtInterface(qt::QtInterface::Delegate* delegate,
                                   int* argc,
                                   char** argv) {}