FreeRDP
SDL3/dialogs/sdl_button.hpp
1 #pragma once
2 
3 #include <string>
4 
5 #include "sdl_widget.hpp"
6 
7 class SdlButton : public SdlWidget
8 {
9  public:
10  SdlButton(SDL_Renderer* renderer, std::string label, int id, const SDL_FRect& rect);
11  SdlButton(SdlButton&& other) noexcept;
12  SdlButton(const SdlButton& other) = delete;
13  ~SdlButton() override;
14 
15  SdlButton& operator=(const SdlButton& other) = delete;
16  SdlButton& operator=(SdlButton&& other) = delete;
17 
18  bool highlight(SDL_Renderer* renderer);
19  bool mouseover(SDL_Renderer* renderer);
20  bool update(SDL_Renderer* renderer);
21 
22  [[nodiscard]] int id() const;
23 
24  private:
25  std::string _name;
26  int _id;
27 };