update dev300-m58
[ooovba.git] / vcl / aqua / source / app / salsys.cxx
blobd252db5291f73fd3491c07883ea99b27649b0556
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: salsys.cxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_vcl.hxx"
34 #include "tools/rc.hxx"
35 #include "vcl/svids.hrc"
37 #include "salsys.h"
38 #include "saldata.hxx"
39 #include "rtl/ustrbuf.hxx"
41 using namespace rtl;
43 // =======================================================================
45 AquaSalSystem::~AquaSalSystem()
49 unsigned int AquaSalSystem::GetDisplayScreenCount()
51 NSArray* pScreens = [NSScreen screens];
52 return pScreens ? [pScreens count] : 1;
55 bool AquaSalSystem::IsMultiDisplay()
57 return false;
60 unsigned int AquaSalSystem::GetDefaultDisplayNumber()
62 return 0;
65 Rectangle AquaSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
67 NSArray* pScreens = [NSScreen screens];
68 Rectangle aRet;
69 NSScreen* pScreen = nil;
70 if( pScreens && nScreen < [pScreens count] )
71 pScreen = [pScreens objectAtIndex: nScreen];
72 else
73 pScreen = [NSScreen mainScreen];
75 if( pScreen )
77 NSRect aFrame = [pScreen frame];
78 aRet = Rectangle( Point( static_cast<long int>(aFrame.origin.x), static_cast<long int>(aFrame.origin.y) ),
79 Size( static_cast<long int>(aFrame.size.width), static_cast<long int>(aFrame.size.height) ) );
81 return aRet;
84 Rectangle AquaSalSystem::GetDisplayWorkAreaPosSizePixel( unsigned int nScreen )
86 NSArray* pScreens = [NSScreen screens];
87 Rectangle aRet;
88 NSScreen* pScreen = nil;
89 if( pScreens && nScreen < [pScreens count] )
90 pScreen = [pScreens objectAtIndex: nScreen];
91 else
92 pScreen = [NSScreen mainScreen];
94 if( pScreen )
96 NSRect aFrame = [pScreen visibleFrame];
97 aRet = Rectangle( Point( static_cast<long int>(aFrame.origin.x), static_cast<long int>(aFrame.origin.y) ),
98 Size( static_cast<long int>(aFrame.size.width), static_cast<long int>(aFrame.size.height) ) );
100 return aRet;
103 rtl::OUString AquaSalSystem::GetScreenName( unsigned int nScreen )
105 NSArray* pScreens = [NSScreen screens];
106 OUString aRet;
107 if( nScreen < [pScreens count] )
109 ResMgr* pMgr = ImplGetResMgr();
110 if( pMgr )
112 String aScreenName( ResId( SV_MAC_SCREENNNAME, *pMgr ) );
113 aScreenName.SearchAndReplaceAllAscii( "%d", String::CreateFromInt32( nScreen ) );
114 aRet = aScreenName;
117 return aRet;
120 int AquaSalSystem::ShowNativeDialog( const String& rTitle,
121 const String& rMessage,
122 const std::list< String >& rButtons,
123 int nDefButton )
125 return 0;
128 int AquaSalSystem::ShowNativeMessageBox( const String& rTitle,
129 const String& rMessage,
130 int nButtonCombination,
131 int nDefaultButton)
133 return 0;