yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
ui_events.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_EVENTS_UI_EVENTS_H_
2
#define YAZE_APP_EDITOR_EVENTS_UI_EVENTS_H_
3
4
#include "
app/editor/core/event_bus.h
"
5
#include <string>
6
7
namespace
yaze::editor
{
8
9
struct
StatusUpdateEvent
:
public
Event
{
10
enum class
Type
{
11
Cursor
,
12
Selection
,
13
Zoom
,
14
Mode
,
15
Message
,
16
Clear
17
};
18
19
Type
type
;
20
std::string
text
;
// For Mode, Message
21
int
x
= 0,
y
= 0;
// For Cursor
22
int
count
= 0,
width
= 0,
height
= 0;
// For Selection
23
float
zoom
= 1.0f;
// For Zoom
24
std::string
key
;
// For Custom Segments
25
26
// Helpers for construction
27
static
StatusUpdateEvent
Cursor
(
int
x
,
int
y
,
const
std::string& label =
"Pos"
) {
28
StatusUpdateEvent
e;
29
e.
type
=
Type::Cursor
;
30
e.
x
=
x
; e.
y
=
y
;
31
e.
text
= label;
32
return
e;
33
}
34
35
static
StatusUpdateEvent
Selection
(
int
count
,
int
width
= 0,
int
height
= 0) {
36
StatusUpdateEvent
e;
37
e.
type
=
Type::Selection
;
38
e.
count
=
count
;
39
e.
width
=
width
;
40
e.
height
=
height
;
41
return
e;
42
}
43
44
static
StatusUpdateEvent
ClearAll
() {
45
StatusUpdateEvent
e;
46
e.
type
=
Type::Clear
;
47
return
e;
48
}
49
};
50
51
struct
PanelToggleEvent
:
public
Event
{
52
std::string
panel_id
;
53
bool
visible
;
54
};
55
56
}
// namespace yaze::editor
57
58
#endif
// YAZE_APP_EDITOR_EVENTS_UI_EVENTS_H_
event_bus.h
yaze::editor
Editors are the view controllers for the application.
Definition
agent_chat.cc:23
yaze::Event
Definition
event_bus.h:13
yaze::editor::PanelToggleEvent
Definition
ui_events.h:51
yaze::editor::PanelToggleEvent::visible
bool visible
Definition
ui_events.h:53
yaze::editor::PanelToggleEvent::panel_id
std::string panel_id
Definition
ui_events.h:52
yaze::editor::StatusUpdateEvent
Definition
ui_events.h:9
yaze::editor::StatusUpdateEvent::text
std::string text
Definition
ui_events.h:20
yaze::editor::StatusUpdateEvent::Type
Type
Definition
ui_events.h:10
yaze::editor::StatusUpdateEvent::Type::Zoom
@ Zoom
yaze::editor::StatusUpdateEvent::Type::Message
@ Message
yaze::editor::StatusUpdateEvent::Type::Mode
@ Mode
yaze::editor::StatusUpdateEvent::Type::Selection
@ Selection
yaze::editor::StatusUpdateEvent::Type::Cursor
@ Cursor
yaze::editor::StatusUpdateEvent::Type::Clear
@ Clear
yaze::editor::StatusUpdateEvent::key
std::string key
Definition
ui_events.h:24
yaze::editor::StatusUpdateEvent::Selection
static StatusUpdateEvent Selection(int count, int width=0, int height=0)
Definition
ui_events.h:35
yaze::editor::StatusUpdateEvent::width
int width
Definition
ui_events.h:22
yaze::editor::StatusUpdateEvent::zoom
float zoom
Definition
ui_events.h:23
yaze::editor::StatusUpdateEvent::height
int height
Definition
ui_events.h:22
yaze::editor::StatusUpdateEvent::type
Type type
Definition
ui_events.h:19
yaze::editor::StatusUpdateEvent::ClearAll
static StatusUpdateEvent ClearAll()
Definition
ui_events.h:44
yaze::editor::StatusUpdateEvent::Cursor
static StatusUpdateEvent Cursor(int x, int y, const std::string &label="Pos")
Definition
ui_events.h:27
yaze::editor::StatusUpdateEvent::count
int count
Definition
ui_events.h:22
yaze::editor::StatusUpdateEvent::x
int x
Definition
ui_events.h:21
yaze::editor::StatusUpdateEvent::y
int y
Definition
ui_events.h:21
src
app
editor
events
ui_events.h
Generated by
1.10.0