chromium/ui/gtk/gtk_util.cc

// Copyright 2012 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

#include "ui/gtk/gtk_util.h"

#include <locale.h>
#include <stddef.h>

#include <memory>
#include <string_view>

#include "base/compiler_specific.h"
#include "base/environment.h"
#include "base/functional/callback.h"
#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gtk/gtk_compat.h"
#include "ui/gtk/gtk_types.h"
#include "ui/gtk/gtk_ui.h"
#include "ui/gtk/gtk_ui_platform.h"
#include "ui/linux/linux_ui.h"
#include "ui/native_theme/common_theme.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"

namespace gtk {

namespace {

const char kAuraTransientParent[] =;

GskRenderNode* GetRenderNodeChild(GskRenderNode* node) {}

std::vector<GskRenderNode*> GetRenderNodeChildren(GskRenderNode* node) {}

GtkCssContext AppendCssNodeToStyleContextImpl(
    GtkCssContext context,
    const std::string& name,
    const std::string& object_name,
    const std::vector<std::string>& classes,
    GtkStateFlags state,
    float scale) {}

GtkWidget* CreateDummyWindow() {}

double GetOpacityFromRenderNode(GskRenderNode* node) {}

}  // namespace

const char* GtkCssMenu() {}

const char* GtkCssMenuItem() {}

const char* GtkCssMenuScrollbar() {}

bool GtkInitFromCommandLine(int* argc, char** argv) {}

void SetGtkTransientForAura(GtkWidget* dialog, aura::Window* parent) {}

aura::Window* GetAuraTransientParent(GtkWidget* dialog) {}

void ClearAuraTransientParent(GtkWidget* dialog, aura::Window* parent) {}

base::OnceClosure DisableHostInputHandling(GtkWidget* dialog,
                                           aura::Window* parent) {}

void ParseButtonLayout(const std::string& button_string,
                       std::vector<views::FrameButton>* leading_buttons,
                       std::vector<views::FrameButton>* trailing_buttons) {}

CairoSurface::CairoSurface(SkBitmap& bitmap)
    :{}

CairoSurface::CairoSurface(const gfx::Size& size)
    :{}

CairoSurface::~CairoSurface() {}

SkColor CairoSurface::GetAveragePixelValue(bool frame) {}

GtkCssContext::GtkCssContext(GtkWidget* widget, GtkWidget* root)
    :{}

GtkCssContext::GtkCssContext(GtkStyleContext* context)
    :{}

GtkCssContext::GtkCssContext() = default;
GtkCssContext::GtkCssContext(const GtkCssContext&) = default;
GtkCssContext::GtkCssContext(GtkCssContext&&) = default;
GtkCssContext& GtkCssContext::operator=(const GtkCssContext&) = default;
GtkCssContext& GtkCssContext::operator=(GtkCssContext&&) = default;
GtkCssContext::~GtkCssContext() {}

operator _GtkStyleContext *()

GtkCssContext GtkCssContext::GetParent() {}

GtkWidget* GtkCssContext::widget() {}

GtkWidget* GtkCssContext::root() {}

GtkStateFlags StateToStateFlags(ui::NativeTheme::State state) {}

NO_SANITIZE("cfi-icall")
GtkCssContext AppendCssNodeToStyleContext(GtkCssContext context,
                                          const std::string& css_node) {}

GtkCssContext GetStyleContextFromCss(const std::string& css_selector) {}

SkColor GetBgColorFromStyleContext(GtkCssContext context) {}

SkColor GetFgColor(const std::string& css_selector) {}

ScopedCssProvider GetCssProvider(const std::string& css) {}

void ApplyCssProviderToContext(GtkCssContext context,
                               GtkCssProvider* provider) {}

void ApplyCssToContext(GtkCssContext context, const std::string& css) {}

void RenderBackground(const gfx::Size& size,
                      cairo_t* cr,
                      GtkCssContext context) {}

SkColor GetBgColor(const std::string& css_selector) {}

SkColor GetBorderColor(const std::string& css_selector) {}

SkColor GetSelectionBgColor(const std::string& css_selector) {}

bool ContextHasClass(GtkCssContext context, const std::string& style_class) {}

SkColor GetSeparatorColor(const std::string& css_selector) {}

std::string GetGtkSettingsStringProperty(GtkSettings* settings,
                                         const gchar* prop_name) {}

int BuildXkbStateFromGdkEvent(unsigned int state, unsigned char group) {}

GdkModifierType ExtractGdkEventStateFromKeyEventFlags(int flags) {}

int GetKeyEventProperty(const ui::KeyEvent& key_event,
                        const char* property_key) {}

GdkModifierType GetGdkKeyEventState(const ui::KeyEvent& key_event) {}

GdkEvent* GdkEventFromKeyEvent(const ui::KeyEvent& key_event) {}

GtkIconTheme* GetDefaultIconTheme() {}

void GtkWindowDestroy(GtkWidget* widget) {}

GtkWidget* GetDummyWindow() {}

gfx::Size GetSeparatorSize(bool horizontal) {}

float GetDeviceScaleFactor() {}

GdkTexture* GetTextureFromRenderNode(GskRenderNode* node) {}

double GetOpacityFromContext(GtkStyleContext* context) {}

}  // namespace gtk