Horizon
Loading...
Searching...
No Matches
wx_compat.h
1#pragma once
2#include <string>
3#include <cassert>
4
5template <class... Args> void wxLogTrace(const char *mask, const char *formatString, Args &&...args)
6{
7}
8
9template <class... Args> void wxLogWarning(const char *formatString, Args &&...args)
10{
11}
12
13class wxString : public std::string {
14public:
15 wxString() = default;
16
17 wxString(const std::string &s) : std::string(s)
18 {
19 }
20
21 wxString(const char *s) : std::string(s)
22 {
23 }
24
25 std::string ToStdString() const
26 {
27 return *this;
28 }
29
30 template <class... Args> static wxString Format(const wxString &format, Args &&...args)
31 {
32 return format;
33 }
34};
35
36const wxString wxEmptyString;
37
38using wxChar = char;
39
40class wxPoint {
41public:
42 wxPoint() : x(0), y(0)
43 {
44 }
45
46 wxPoint(int ax, int ay) : x(ax), y(ay)
47 {
48 }
49
50 int x;
51 int y;
52};
53
54inline wxPoint operator+(const wxPoint &p1, const wxPoint &p2)
55{
56 return wxPoint(p1.x + p2.x, p1.y + p2.y);
57}
58
59inline wxPoint operator-(const wxPoint &p1, const wxPoint &p2)
60{
61 return wxPoint(p1.x - p2.x, p1.y - p2.y);
62}
63
64class wxSize {
65public:
66 wxSize() : x(0), y(0)
67 {
68 }
69
70 int x;
71 int y;
72};
73
74#define wxASSERT assert
75#define wxASSERT_MSG(cond, msg) assert((cond))
76#define dyn_cast dynamic_cast
77
78#define wxCHECK2_MSG(cond, op, msg) \
79 do { \
80 if (cond) { \
81 } \
82 else { \
83 op; \
84 } \
85 } while (0)
86
87
88#define wxCHECK_MSG(cond, rc, msg) wxCHECK2_MSG(cond, return rc, msg)
89#define wxCHECK_RET(cond, msg) wxCHECK2_MSG(cond, return, msg)
90#define wxCHECK(cond, rc) wxCHECK_MSG(cond, rc, (const char *)NULL)
91
92#define wxFAIL_MSG(msg) assert(false)
93#define wxT(x) x
Definition wx_compat.h:40
Definition wx_compat.h:64
Definition wx_compat.h:13
Point operator-(const Point &a, const Point &b)
Subtract two points_ component-wise.
Definition shapes.h:244