4 /*****************************************************************************\
6 * Name : screen_rectangle *
7 * Author : Chris Koeritz *
9 *******************************************************************************
10 * Copyright (c) 1992-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
18 #include "rectangle.h"
19 #include "screen_rectangle.h"
21 #include <basis/mutex.h>
23 #include <structures/static_memory_gremlin.h>
25 using namespace basis;
29 SAFE_STATIC_CONST(screen_point, screen_origin, (0, 0))
34 screen_point::screen_point(const tagPOINT &original) : point<int>(original.x, original.y) {}
36 screen_point::operator tagPOINT()
37 { POINT to_return; to_return.x = x(); to_return.y = y(); return to_return; }
42 screen_rectangle::screen_rectangle(const rectangle<int> &init)
43 : rectangle<int>(init) {}
45 screen_rectangle::screen_rectangle(const screen_point &vertex_1,
46 const screen_point &vertex_2)
47 : rectangle<int>(vertex_1, vertex_2) {}
49 screen_rectangle::screen_rectangle(int x_1, int y_1, int x_2, int y_2)
50 : rectangle<int>(x_1, y_1, x_2, y_2) {}
52 screen_rectangle screen_rectangle::order() const
53 { return screen_rectangle(top_left(), bottom_right()); }
55 screen_point screen_rectangle::top_left() const
56 { return rectangle<int>::bottom_left(); }
58 screen_point screen_rectangle::bottom_left() const
59 { return rectangle<int>::top_left(); }
61 screen_point screen_rectangle::top_right() const
62 { return rectangle<int>::bottom_right(); }
64 screen_point screen_rectangle::bottom_right() const
65 { return rectangle<int>::top_right(); }
68 screen_rectangle::screen_rectangle(const tagRECT &original)
69 : rectangle<int>(original.left, original.top, original.right, original.bottom)
72 screen_rectangle::operator tagRECT() const
74 RECT to_return; to_return.left = left();
75 to_return.top = top(); to_return.right = right();
76 to_return.bottom = bottom(); return to_return;