0029571: Samples: build qt samples together with OCCT
[occt.git] / samples / qt / AndroidQt / src / AndroidQt_Window.cxx
CommitLineData
80eb9670 1// Copyright (c) 2014 OPEN CASCADE SAS
2//
3// This file is part of Open CASCADE Technology software library.
4//
5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
10//
11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
13
14#include <AndroidQt_Window.h>
15
80eb9670 16IMPLEMENT_STANDARD_RTTIEXT(AndroidQt_Window, Aspect_Window)
17
18// =======================================================================
19// function : AndroidQt_Window
20// purpose :
21// =======================================================================
22AndroidQt_Window::AndroidQt_Window (const int theWidth, const int theHeight,
23 const int theX1, const int theX2,
24 const int theY1, const int theY2)
25: myWidth (theWidth), myHeight(theHeight),
26 myX1 (theX1), myX2 (theX2),
27 myY1 (theY1), myY2 (theY2)
28{
29 if (myX1 == -1) myX1 = 0;
30 if (myX2 == -1) myX2 = myWidth;
31
32 if (myY1 == -1) myY1 = 0;
33 if (myY2 == -1) myY2 = myHeight;
34}
35
36// =======================================================================
37// function : Position
38// purpose :
39// =======================================================================
40void AndroidQt_Window::Position (Standard_Integer& theX1,
41 Standard_Integer& theY1,
42 Standard_Integer& theX2,
43 Standard_Integer& theY2) const
44{
45 theX1 = myX1;
46 theX2 = myX2;
47 theY1 = myY1;
48 theY2 = myY2;
49}
50
51// =======================================================================
52// function : SetPosition
53// purpose :
54// =======================================================================
55void AndroidQt_Window::SetPosition (const Standard_Integer theX1,
56 const Standard_Integer theY1,
57 const Standard_Integer theX2,
58 const Standard_Integer theY2)
59{
60 myX1 = theX1;
61 myX2 = theX2;
62 myY1 = theY1;
63 myY2 = theY2;
64}
65
66// =======================================================================
67// function : Size
68// purpose :
69// =======================================================================
70void AndroidQt_Window::Size (Standard_Integer& theWidth,
71 Standard_Integer& theHeight) const
72{
73 theWidth = myWidth;
74 theHeight = myHeight;
75}
76
77// =======================================================================
78// function : SetSize
79// purpose :
80// =======================================================================
81void AndroidQt_Window::SetSize (const Standard_Integer theWidth,
82 const Standard_Integer theHeight)
83{
84 myWidth = theWidth;
85 myHeight = theHeight;
86}