FifeGUI 0.2.0
A C++ GUI library designed for games.
dragevent.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
3
4#ifndef INCLUDE_FIFECHAN_EVENTS_DRAG_EVENT_HPP_
5#define INCLUDE_FIFECHAN_EVENTS_DRAG_EVENT_HPP_
6
7#include <cstdint>
8
9#include "fifechan/events/event.hpp"
10
11namespace fcn
12{
13 class Widget;
14 class DragPayload;
15
22 class FIFEGUI_API DragEvent : public Event
23 {
24 public:
28 enum class Type : std::uint8_t
29 {
30 Enter,
31 Leave,
32 Hover,
33 Drop,
34 Cancel
35 };
36
40 DragEvent(Widget* source, DragPayload const * payload, Type type, int x, int y, int screenX, int screenY);
41
45 Type getType() const;
46
50 DragPayload const * getPayload() const;
51
55 int getX() const;
56
60 int getY() const;
61
65 int getScreenX() const;
66
70 int getScreenY() const;
71
72 protected:
77
82
86 int mX;
87
91 int mY;
92
97
102
103 friend class DragHandler;
104 };
105} // namespace fcn
106
107#endif // INCLUDE_FIFECHAN_EVENTS_DRAG_EVENT_HPP_
Drag and drop event type container.
Definition dragevent.hpp:23
Type mType
The event type.
Definition dragevent.hpp:76
int mX
X coordinate relative to the widget.
Definition dragevent.hpp:86
int mY
Y coordinate relative to the widget.
Definition dragevent.hpp:91
int mScreenY
Y coordinate on the screen.
int mScreenX
X coordinate on the screen.
Definition dragevent.hpp:96
Type
Event for drag and drop actions.
Definition dragevent.hpp:29
DragPayload const * mPayload
The associated payload for this event.
Definition dragevent.hpp:81
DragEvent(Widget *source, DragPayload const *payload, Type type, int x, int y, int screenX, int screenY)
Construct a drag event.
Definition dragevent.cpp:15
Container for arbitrary data carried during a drag operation.
Definition dragdrop.hpp:83
Event(Widget *source)
Constructor.
Definition event.cpp:16
Abstract base class defining the common behavior, properties, and lifecycle of all GUI elements.
Definition widget.hpp:55
Used replacement tokens by configure_file():