Files
fcitx5-m3ui/src/waylandshmwindow.h
T
justmeandClaude Sonnet 5.5 0804634dc1 Add Material 3 candidate window addon for Fcitx5
Fork of the classicui addon (Fcitx5 5.1.23) with a Material 3 look, spring
based animations and a right click action menu for candidates.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-19 21:58:54 +08:00

45 lines
1.0 KiB
C++

/*
* SPDX-FileCopyrightText: 2017-2017 CSSlayer <wengxt@gmail.com>
*
* SPDX-License-Identifier: LGPL-2.1-or-later
*
*/
#ifndef _FCITX_UI_CLASSIC_WAYLANDSHMWINDOW_H_
#define _FCITX_UI_CLASSIC_WAYLANDSHMWINDOW_H_
#include <cstdint>
#include <memory>
#include <vector>
#include <cairo.h>
#include "fcitx-utils/eventloopinterface.h"
#include "buffer.h"
#include "waylandui.h"
#include "waylandwindow.h"
namespace fcitx::m3ui {
class WaylandShmWindow : public WaylandWindow {
public:
WaylandShmWindow(WaylandUI *ui);
~WaylandShmWindow();
void destroyWindow();
cairo_surface_t *prerender() override;
void render() override;
void hide() override;
private:
void newBuffer(uint32_t width, uint32_t height);
std::shared_ptr<wayland::WlShm> shm_;
std::vector<std::unique_ptr<wayland::Buffer>> buffers_;
// Pointer to the current buffer.
wayland::Buffer *buffer_ = nullptr;
bool pending_ = false;
std::unique_ptr<EventSource> deferEvent_;
};
} // namespace fcitx::m3ui
#endif // _FCITX_UI_CLASSIC_WAYLANDSHMWINDOW_H_