chromium/ui/base/cursor/cursor_factory.cc

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

#include "ui/base/cursor/cursor_factory.h"

#include <ostream>

#include "base/check.h"
#include "base/check_op.h"
#include "base/memory/scoped_refptr.h"
#include "base/notreached.h"
#include "base/observer_list.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
#include "ui/base/cursor/platform_cursor.h"

namespace ui {

namespace {

CursorFactory* g_instance =;

}  // namespace

CursorFactoryObserver::~CursorFactoryObserver() = default;

CursorFactory::CursorFactory() {}

CursorFactory::~CursorFactory() {}

CursorFactory* CursorFactory::GetInstance() {}

void CursorFactory::AddObserver(CursorFactoryObserver* observer) {}

void CursorFactory::RemoveObserver(CursorFactoryObserver* observer) {}

void CursorFactory::NotifyObserversOnThemeLoaded() {}

scoped_refptr<PlatformCursor> CursorFactory::GetDefaultCursor(
    mojom::CursorType type) {}

scoped_refptr<PlatformCursor> CursorFactory::GetDefaultCursor(
    mojom::CursorType type,
    float scale) {}

scoped_refptr<PlatformCursor> CursorFactory::CreateImageCursor(
    mojom::CursorType type,
    const SkBitmap& bitmap,
    const gfx::Point& hotspot,
    float scale) {}

std::optional<CursorData> CursorFactory::GetCursorData(mojom::CursorType type) {}

scoped_refptr<PlatformCursor> CursorFactory::CreateAnimatedCursor(
    mojom::CursorType type,
    const std::vector<SkBitmap>& bitmaps,
    const gfx::Point& hotspot,
    float scale,
    base::TimeDelta frame_delay) {}

void CursorFactory::ObserveThemeChanges() {}

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)

// Returns a cursor name compatible with either X11 or the FreeDesktop.org
// cursor spec ([1] and [2]), followed by fallbacks that can work as
// replacements in some environments where the original may not be available
// (e.g. desktop environments other than GNOME and KDE).
//
// TODO(hferreiro): each list starts with the FreeDesktop.org icon name but
// "ns-resize", "ew-resize", "nesw-resize", "nwse-resize", "grab", "grabbing",
// which were not available in older versions of Breeze, the default KDE theme.
//
// [1]
// https://www.x.org/releases/current/doc/libX11/libX11/libX11.html#x_font_cursors
// [2] https://www.freedesktop.org/wiki/Specifications/cursor-spec/
std::vector<std::string> CursorNamesFromType(mojom::CursorType type) {}

#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)

}  // namespace ui