#include "ui/ozone/platform/wayland/host/xdg_popup_wrapper_impl.h"
#include <aura-shell-client-protocol.h>
#include <xdg-shell-client-protocol.h>
#include <memory>
#include "base/bit_cast.h"
#include "base/environment.h"
#include "base/logging.h"
#include "base/nix/xdg_util.h"
#include "ui/base/ui_base_types.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/types/event_type.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/ozone/common/features.h"
#include "ui/ozone/platform/wayland/common/wayland_util.h"
#include "ui/ozone/platform/wayland/host/wayland_bubble.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
#include "ui/ozone/platform/wayland/host/wayland_event_source.h"
#include "ui/ozone/platform/wayland/host/wayland_pointer.h"
#include "ui/ozone/platform/wayland/host/wayland_popup.h"
#include "ui/ozone/platform/wayland/host/wayland_seat.h"
#include "ui/ozone/platform/wayland/host/wayland_serial_tracker.h"
#include "ui/ozone/platform/wayland/host/wayland_toplevel_window.h"
#include "ui/ozone/platform/wayland/host/wayland_window.h"
#include "ui/ozone/platform/wayland/host/wayland_zaura_shell.h"
#include "ui/ozone/platform/wayland/host/xdg_surface_wrapper_impl.h"
#include "ui/ozone/platform/wayland/host/xdg_toplevel_wrapper_impl.h"
namespace ui {
namespace {
uint32_t TranslateAnchor(OwnedWindowAnchorPosition anchor) { … }
uint32_t TranslateGravity(OwnedWindowAnchorGravity gravity) { … }
uint32_t TranslateConstraintAdjustment(
OwnedWindowConstraintAdjustment constraint_adjustment) { … }
zaura_popup_decoration_type TranslateDecorationType(
ui::PlatformWindowShadowType platformWindowShadowType) { … }
}
XDGPopupWrapperImpl::XDGPopupWrapperImpl(
std::unique_ptr<XDGSurfaceWrapperImpl> surface,
WaylandWindow* wayland_window,
WaylandConnection* connection)
: … { … }
XDGPopupWrapperImpl::~XDGPopupWrapperImpl() = default;
bool XDGPopupWrapperImpl::Initialize(const ShellPopupParams& params) { … }
void XDGPopupWrapperImpl::AckConfigure(uint32_t serial) { … }
bool XDGPopupWrapperImpl::IsConfigured() { … }
bool XDGPopupWrapperImpl::SetBounds(const gfx::Rect& new_bounds) { … }
void XDGPopupWrapperImpl::SetWindowGeometry(const gfx::Rect& bounds) { … }
void XDGPopupWrapperImpl::Grab(uint32_t serial) { … }
bool XDGPopupWrapperImpl::SupportsDecoration() { … }
void XDGPopupWrapperImpl::Decorate(ui::PlatformWindowShadowType shadow_type) { … }
void XDGPopupWrapperImpl::SetScaleFactor(float scale_factor) { … }
XDGPopupWrapperImpl* XDGPopupWrapperImpl::AsXDGPopupWrapper() { … }
wl::Object<xdg_positioner> XDGPopupWrapperImpl::CreatePositioner() { … }
void XDGPopupWrapperImpl::OnConfigure(void* data,
xdg_popup* popup,
int32_t x,
int32_t y,
int32_t width,
int32_t height) { … }
void XDGPopupWrapperImpl::OnPopupDone(void* data, xdg_popup* popup) { … }
void XDGPopupWrapperImpl::OnRepositioned(void* data,
xdg_popup* popup,
uint32_t token) { … }
XDGSurfaceWrapperImpl* XDGPopupWrapperImpl::xdg_surface_wrapper() const { … }
}