Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / widget / src / beos / nsScreenBeOS.cpp
blobd1760528a40c2b8fd1debd0feaa25ed8c76fc16e
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 2000
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsScreenBeOS.h"
40 #include <Screen.h>
42 nsScreenBeOS :: nsScreenBeOS ( )
44 // nothing else to do. I guess we could cache a bunch of information
45 // here, but we want to ask the device at runtime in case anything
46 // has changed.
50 nsScreenBeOS :: ~nsScreenBeOS()
52 // nothing to see here.
56 // addref, release, QI
57 NS_IMPL_ISUPPORTS1(nsScreenBeOS, nsIScreen)
60 NS_IMETHODIMP
61 nsScreenBeOS :: GetRect(PRInt32 *outLeft, PRInt32 *outTop, PRInt32 *outWidth, PRInt32 *outHeight)
63 BScreen screen;
65 *outTop = 0;
66 *outLeft = 0;
67 *outWidth = PRInt32(screen.Frame().Width()+1);
68 *outHeight = PRInt32(screen.Frame().Height()+1);
70 return NS_OK;
72 } // GetRect
75 NS_IMETHODIMP
76 nsScreenBeOS :: GetAvailRect(PRInt32 *outLeft, PRInt32 *outTop, PRInt32 *outWidth, PRInt32 *outHeight)
78 BScreen screen;
80 *outTop = 0;
81 *outLeft = 0;
82 *outWidth = PRInt32(screen.Frame().Width()+1);
83 *outHeight = PRInt32(screen.Frame().Height()+1);
85 return NS_OK;
87 } // GetAvailRect
90 NS_IMETHODIMP
91 nsScreenBeOS :: GetPixelDepth(PRInt32 *aPixelDepth)
93 BScreen screen;
95 color_space depth;
96 PRInt32 pixelDepth;
98 depth = screen.ColorSpace();
99 switch(depth)
101 case B_CMAP8:
102 pixelDepth = 8;
103 break;
104 case B_RGB32:
105 pixelDepth = 32;
106 break;
107 case B_RGB15:
108 pixelDepth = 15;
109 break;
110 case B_RGB16:
111 pixelDepth = 16;
112 break;
113 default:
114 NS_NOTREACHED("FIXME: Please add this screen depth to the code nsScreenBeOS.cpp");
115 pixelDepth = 32;
116 break;
118 *aPixelDepth = pixelDepth;
120 return NS_OK;
122 } // GetPixelDepth
125 NS_IMETHODIMP
126 nsScreenBeOS :: GetColorDepth(PRInt32 *aColorDepth)
128 return GetPixelDepth ( aColorDepth );
130 } // GetColorDepth