26 #include "swe_types.h" 27 #include "swe_tools.h" 29 #include "swe_surface.h" 30 #include "swe_fontset.h" 31 #include "swe_events.h" 32 #include "swe_display.h" 38 typedef std::uintptr_t WindowId;
42 FlagVisible = 0x80000000, FlagModality = 0x40000000, FlagFocused = 0x20000000, FlagBroken = 0x10000000,
44 FlagKeyHandle = 0x04000000, FlagMouseTracking = 0x02000000, FlagSystemTickSkip = 0x01000000,
45 FlagLayoutHidden = 0x00800000, FlagLayoutBackground = 0x00200000, FlagLayoutForeground = 0x00100000,
48 FlagPressed = 0x00080000, FlagInformed = 0x00040000, FlagSelected = 0x00020000, FlagDisabled = 0x00010000,
49 FlagWrap = 0x00008000, FlagVertical = 0x00004000,
50 FlagFreeMask = 0x00000FFF
62 void focusHandle(
bool gain);
63 bool scrollHandle(
bool isup);
64 bool mouseMotionHandle(
const Point &, u32);
65 bool mouseButtonHandle(
const ButtonEvent & st,
bool press);
67 bool keyHandle(
const KeySym & key,
bool press);
77 void setSize(
int,
int);
78 void setPosition(
int,
int);
88 virtual Texture & targetTexture(
void);
91 virtual void textureInvalidEvent(
void) {}
92 virtual void windowMoveEvent(
const Point &) {}
93 virtual void windowResizeEvent(
const Size &) {}
94 virtual void windowVisibleEvent(
bool) {}
95 virtual void windowCreateEvent(
void) {}
96 virtual bool keyPressEvent(
const KeySym &) {
return false; }
97 virtual bool keyReleaseEvent(
const KeySym &) {
return false; }
98 virtual bool textInputEvent(
const std::string &) {
return false; }
99 virtual bool mousePressEvent(
const ButtonEvent &) {
return false; }
100 virtual bool mouseReleaseEvent(
const ButtonEvent &) {
return false; }
101 virtual bool mouseClickEvent(
const ButtonsEvent &) {
return false; }
102 virtual void mouseFocusEvent(
void) {}
103 virtual void mouseLeaveEvent(
void) {}
104 virtual void mouseTrackingEvent(
const Point &, u32 buttons) {}
105 virtual bool mouseMotionEvent(
const Point &, u32 buttons) {
return false; }
106 virtual bool scrollUpEvent(
void) {
return false; }
107 virtual bool scrollDownEvent(
void) {
return false; }
108 virtual void renderPresentEvent(u32 ms) {}
109 virtual void displayResizeEvent(
const Size &) {}
110 virtual void displayFocusEvent(
bool gain) {}
113 bool checkState(
size_t)
const;
114 void setState(
size_t);
115 void resetState(
size_t);
116 void switchedState(
size_t);
118 virtual void renderBackground(
void) {}
119 virtual void renderForeground(
void) {}
141 bool isID(
const WindowId &)
const;
142 bool isVisible(
void)
const;
143 bool isHidden(
void)
const;
144 bool isFocused(
void)
const;
145 bool isModality(
void)
const;
146 bool isKeyHandle(
void)
const;
147 bool isMouseTrack(
void)
const;
148 virtual bool isAreaPoint(
const Point &)
const;
149 WindowId id(
void)
const;
150 const Point & position(
void)
const;
151 const Size & size(
void)
const;
152 const Rect & area(
void)
const;
153 const Window* parent(
void)
const;
155 int width(
void)
const;
156 int height(
void)
const;
157 int resultCode(
void)
const;
158 Rect rect(
void)
const;
160 void setState(
size_t,
bool f);
163 void setVisible(
bool);
164 void setHidden(
bool);
165 void setModality(
bool);
166 void setKeyHandle(
bool);
167 void setMouseTrack(
bool);
168 void setResultCode(
int);
169 virtual void setSize(
const Size &);
170 virtual void setPosition(
const Point &);
178 void renderSurface(
const Surface &,
const Point &,
int flip = FlipNone);
179 void renderSurface(
const Surface &,
const Rect &,
const Point &,
int flip = FlipNone);
180 void renderTexture(
const Texture &,
const Point &,
int flip = FlipNone);
181 void renderTexture(
const Texture &,
const Rect &,
const Point &,
int flip = FlipNone);
188 virtual void renderClear(
const Color &);
189 void renderColor(
const Color &,
const Rect &);
190 void renderRect(
const Color &,
const Rect &);
192 void renderPoint(
const Color &,
const Point &);
194 virtual void renderWindow(
void) = 0;
196 const char*
className(
void)
const override {
return "SWE::Window"; }
198 JsonObject toJson(
void)
const override;
200 void dumpState(
void)
const;
201 virtual std::string toString(
void)
const;
211 void renderBackground(
void)
override;
212 void renderWindow(
void)
override {}
214 const char*
className(
void)
const override {
return "SWE::DisplayWindow"; }
216 JsonObject toJson(
void)
const override;
224 const char*
className(
void)
const override {
return "SWE::CenteredWindow"; }
230 Texture & targetTexture(
void) {
return *
this; }
Definition: swe_surface.h:154
класс объектов сцены DisplayScene, с возможностью отправки/получения сигналов
Definition: swe_events.h:56
Definition: swe_types.h:216
const char * className(void) const override
идентификацинная метка класса
Definition: swe_window.h:224
const char * className(void) const override
идентификацинная метка класса
Definition: swe_window.h:214
пространство SWE.
Definition: swe_binarybuf.cpp:30
класс прямоугольника
Definition: swe_rect.h:144
по умолчанию (используется значение заданное при инициализации)
Definition: swe_fontset.h:82
const char * className(void) const override
идентификацинная метка класса
Definition: swe_window.h:196
класс точки с двумя координатами
Definition: swe_rect.h:72
Definition: swe_inputs_keys.h:245
void disableTickEvent(bool)
функция запрета обработки tickEvent.
Definition: swe_window.cpp:206
класс цвета
Definition: swe_colors.h:65
базовый класс шрифта
Definition: swe_fontset.h:151
по левому краю
Definition: swe_fontset.h:39
Definition: swe_surface.h:210
Definition: swe_display_scene.h:86
по верхнему краю
Definition: swe_fontset.h:41
AlignType
перечисление типа выравнивания
Definition: swe_fontset.h:37
класс двухмерной размерности
Definition: swe_rect.h:36
по умолчанию (используется значение заданное при инициализации)
Definition: swe_fontset.h:94
CharRender
перечисление типа рендера
Definition: swe_fontset.h:70
Definition: swe_window.h:204
Definition: swe_surface.h:58
Definition: swe_window.h:220
по умолчанию (используется значение заданное при инициализации)
Definition: swe_fontset.h:72
CharHinting
перечисление типа сглаживания контура
Definition: swe_fontset.h:92
базовый класс графических объектов сцены DisplayScene.
Definition: swe_window.h:57
Definition: swe_window.h:227
класс unicode строки
Definition: swe_cunicode.h:41