Debian Codegraph @

src/tools/dlgedit/dlg_point.cc

raw
1 /*
2 Copyright (C) 2002 Kai Sterker <[email protected]>
3 Part of the Adonthell Project <http://adonthell.nongnu.org>
4
5 Dlgedit is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 Dlgedit is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Dlgedit. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /**
20 * @file dlg_point.cc
21 *
22 * @author Kai Sterker
23 * @brief A wrapper around GdkPoint.
24 */
25
26 #include "dlg_point.h"
27
28 // Cast DlgRect to GdkRectangle
29 DlgPoint::operator GdkPoint ()
30 {
31 GdkPoint point;
32
33 point.x = x ();
34 point.y = y ();
35
36 return point;
37 }
38
39 // move the point by a certain offset
40 DlgPoint DlgPoint::offset (DlgPoint &p) const
41 {
42 return DlgPoint (x_ + p.x (), y_ + p.y ());
43 }