22 #ifndef NANCY_SCRIPT_TYPES_H 23 #define NANCY_SCRIPT_TYPES_H 25 #include "common/rect.h" 26 #include "common/str.h" 46 ScriptRect(int32 l, int32 t, int32 r, int32 b) : left(l), top(t), right(r), bottom(b) {}
49 int32 width()
const {
return right - left; }
50 int32 height()
const {
return bottom - top; }
51 bool isEmpty()
const {
return right <= left || bottom <= top; }
52 bool contains(int32 x, int32 y)
const {
return x >= left && x < right && y >= top && y < bottom; }
53 void translate(int32 dx, int32 dy) { left += dx; right += dx; top += dy; bottom += dy; }
54 bool operator==(
const ScriptRect &other)
const {
55 return left == other.left && top == other.top && right == other.right && bottom == other.bottom;
86 void pushColor(
lua_State *L, uint32 argb);
87 uint32 *testColor(
lua_State *L,
int index);
88 uint32 checkColor(
lua_State *L,
int index);
102 #endif // NANCY_SCRIPT_TYPES_H
T left
Definition: rect.h:170
T right
Definition: rect.h:171
Definition: actionmanager.h:32