Updated standard library
Diff: DisplayDefs.h
- Revision:
- 178:f21d24431d5a
- Parent:
- 177:0ff83f026bb6
--- a/DisplayDefs.h Thu Jul 11 15:24:02 2019 +0000 +++ b/DisplayDefs.h Thu Jul 11 16:00:39 2019 +0000 @@ -75,8 +75,12 @@ { loc_t x; ///< x value in the point loc_t y; ///< y value in the point - point_t(loc_t arg_x = 0, loc_t arg_y = 0) : - x(arg_x), y(arg_y) {} + + // constructors: + point_t(loc_t arg_x, loc_t arg_y) : + x(arg_x), y(arg_y) {} + point_t() : + x(0), y(0){}; }; /// Data type that manages rectangles, which are pairs of points. @@ -84,11 +88,21 @@ /// @note It is recommended that p1 contains the top-left point and p2 contains /// the bottom-right point, even though it should not matter. /// -typedef struct +struct rect_t { point_t p1; ///< p1 defines one point on the rectangle point_t p2; ///< p2 defines the opposite point on the rectangle -} rect_t; + + // constructors: + rect_t(point_t arg_p1, point_t arg_p2) : + p1(arg_p1), p2(arg_p2) {}; + + rect_t(loc_t arg_p1_x, loc_t arg_p1_y, loc_t arg_p2_x, loc_t arg_p2_y) : + p1(point_t(arg_p1_x, arg_p1_y)), p2(point_t(arg_p2_x, arg_p2_y)){}; + + rect_t() : + p1(point_t()), p2(point_t()) {}; +}; /// Data type that manages the calibration matrix for the resistive touch panel. ///