dtinfo subtree dtinfo
[oweals/cde.git] / cde / programs / dtinfo / dtinfo / src / Preferences / WindowGeometryPref.hh
1 /*
2  * $XConsortium: WindowGeometryPref.hh /main/3 1996/06/11 16:31:41 cde-hal $
3  *
4  * Copyright (c) 1992 HAL Computer Systems International, Ltd.
5  * All rights reserved.  Unpublished -- rights reserved under
6  * the Copyright Laws of the United States.  USE OF A COPYRIGHT
7  * NOTICE IS PRECAUTIONARY ONLY AND DOES NOT IMPLY PUBLICATION
8  * OR DISCLOSURE.
9  * 
10  * THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE
11  * SECRETS OF HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.  USE,
12  * DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT THE
13  * PRIOR EXPRESS WRITTEN PERMISSION OF HAL COMPUTER SYSTEMS
14  * INTERNATIONAL, LTD.
15  * 
16  *                         RESTRICTED RIGHTS LEGEND
17  * Use, duplication, or disclosure by the Government is subject
18  * to the restrictions as set forth in subparagraph (c)(l)(ii)
19  * of the Rights in Technical Data and Computer Software clause
20  * at DFARS 252.227-7013.
21  *
22  *          HAL COMPUTER SYSTEMS INTERNATIONAL, LTD.
23  *                  1315 Dell Avenue
24  *                  Campbell, CA  95008
25  * 
26  */
27
28
29 class WindowGeometry
30 {
31 public:
32   WindowGeometry()
33     : ulx(0), uly(0), width(100), height(100)
34     { }
35   bool operator == (const WindowGeometry &wg)
36     { return (ulx == wg.ulx && uly == wg.uly &&
37               width == wg.width && height == wg.height); }
38   int ulx, uly;
39   unsigned int width, height;
40 };
41
42 class WindowGeometryPref : public UserPreference
43 {
44 public:
45   WindowGeometryPref (const char *name);
46
47   const WindowGeometry &value()
48     { return (f_value); }
49
50   void value (const WindowGeometry &v)
51     { f_value = v; save(); }
52
53 private:
54   void save();
55   void restore();
56
57   WindowGeometry f_value;
58 };
59
60
61 inline
62 WindowGeometryPref::WindowGeometryPref (const char *name)
63 : UserPreference(name)
64 {
65   restore();
66 }