sbNativeWindowManager.mm
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25  */
26 
32 #include "sbNativeWindowManager.h"
33 #include "../NativeWindowFromNode.h"
34 
35 
37 
39 {
40 }
41 
42 
44 {
45 }
46 
47 
48 NS_IMETHODIMP
49 sbNativeWindowManager::BeginResizeDrag(nsISupports *aWindow,
50  nsIDOMMouseEvent* aEvent,
51  PRInt32 aDirection)
52 {
53  return NS_ERROR_NOT_IMPLEMENTED;
54 }
55 
56 
57 NS_IMETHODIMP
58 sbNativeWindowManager::GetSupportsResizeDrag(PRBool *aSupportsResizeDrag)
59 {
60  NS_ENSURE_ARG_POINTER(aSupportsResizeDrag);
61  *aSupportsResizeDrag = PR_FALSE;
62  return NS_OK;
63 }
64 
65 
66 NS_IMETHODIMP
67 sbNativeWindowManager::SetMinimumWindowSize(nsISupports *aWindow,
68  PRInt32 aMinimumWidth,
69  PRInt32 aMinimumHeight)
70 {
71  nsresult rv = NS_OK;
72  id window = NativeWindowFromNode::get(aWindow);
73  if (window)
74  [window setMinSize:NSMakeSize(aMinimumWidth, aMinimumHeight)];
75  else
76  rv = NS_ERROR_UNEXPECTED;
77 
78  return rv;
79 }
80 
81 
82 NS_IMETHODIMP
83 sbNativeWindowManager::SetMaximumWindowSize(nsISupports *aWindow,
84  PRInt32 aMaximumWidth,
85  PRInt32 aMaximumHeight)
86 {
87  nsresult rv = NS_OK;
88  id window = NativeWindowFromNode::get(aWindow);
89  if (window)
90  [window setMaxSize:NSMakeSize(aMaximumWidth, aMaximumHeight)];
91  else
92  rv = NS_ERROR_UNEXPECTED;
93 
94  return rv;
95 }
96 
97 
98 NS_IMETHODIMP
99 sbNativeWindowManager::GetSupportsMinimumWindowSize(PRBool *aSupportsMinimumWindowSize)
100 {
101  NS_ENSURE_ARG_POINTER(aSupportsMinimumWindowSize);
102  *aSupportsMinimumWindowSize = PR_TRUE;
103  return NS_OK;
104 }
105 
106 
107 NS_IMETHODIMP
108 sbNativeWindowManager::GetSupportsMaximumWindowSize(PRBool *aSupportsMaximumWindowSize)
109 {
110  NS_ENSURE_ARG_POINTER(aSupportsMaximumWindowSize);
111  *aSupportsMaximumWindowSize = PR_TRUE;
112  return NS_OK;
113 }
114 
115 
116 NS_IMETHODIMP
117 sbNativeWindowManager::SetOnTop(nsISupports *aWindow, PRBool aOnTop)
118 {
119  NS_ENSURE_ARG_POINTER(aWindow);
120 
121  nsresult rv = NS_OK;
122  id window = NativeWindowFromNode::get(aWindow);
123  if (window)
124  [window setLevel:(aOnTop?NSStatusWindowLevel:NSNormalWindowLevel)];
125  else
126  rv = NS_ERROR_UNEXPECTED;
127 
128  return rv;
129 }
130 
131 NS_IMETHODIMP
132 sbNativeWindowManager::SetShadowing(nsISupports *aWindow, PRBool aShadowing)
133 {
134  // Not required on Mac, this is automatic thanks to a XULRunner patch.
135  return NS_ERROR_NOT_IMPLEMENTED;
136 }
137 
138 NS_IMETHODIMP
139 sbNativeWindowManager::GetSupportsOnTop(PRBool *aSupportsOnTop)
140 {
141  NS_ENSURE_ARG_POINTER(aSupportsOnTop);
142  *aSupportsOnTop = PR_TRUE;
143  return NS_OK;
144 }
145 
146 NS_IMETHODIMP
147 sbNativeWindowManager::GetSupportsShadowing(PRBool *aSupportsShadowing)
148 {
149  NS_ENSURE_ARG_POINTER(aSupportsShadowing);
150 
151  // Not required on Mac, this is automatic thanks to a XULRunner patch.
152  *aSupportsShadowing = PR_FALSE;
153 
154  return NS_OK;
155 }
return NS_OK
NS_IMPL_ISUPPORTS1(sbDeviceCapabilitiesUtils, sbIDeviceCapabilitiesUtils) sbDeviceCapabilitiesUtils
interface to the operating system's window manager This Interfaces to allows JavaScript to talk to th...
let window
static void * get(nsISupports *window)