1d119d52dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3d119d52dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d119d52dSAndrew Rist * or more contributor license agreements. See the NOTICE file
5d119d52dSAndrew Rist * distributed with this work for additional information
6d119d52dSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7d119d52dSAndrew Rist * to you under the Apache License, Version 2.0 (the
8d119d52dSAndrew Rist * "License"); you may not use this file except in compliance
9d119d52dSAndrew Rist * with the License. You may obtain a copy of the License at
10d119d52dSAndrew Rist *
11d119d52dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12d119d52dSAndrew Rist *
13d119d52dSAndrew Rist * Unless required by applicable law or agreed to in writing,
14d119d52dSAndrew Rist * software distributed under the License is distributed on an
15d119d52dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d119d52dSAndrew Rist * KIND, either express or implied. See the License for the
17d119d52dSAndrew Rist * specific language governing permissions and limitations
18d119d52dSAndrew Rist * under the License.
19d119d52dSAndrew Rist *
20d119d52dSAndrew Rist *************************************************************/
21d119d52dSAndrew Rist
22cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
23cdf0e10cSrcweir #include "precompiled_sfx2.hxx"
24cdf0e10cSrcweir
25cdf0e10cSrcweir #ifndef GCC
26cdf0e10cSrcweir #endif
27cdf0e10cSrcweir
28cdf0e10cSrcweir #include "intro.hxx"
29cdf0e10cSrcweir
30cdf0e10cSrcweir #include <tools/stream.hxx>
31cdf0e10cSrcweir #include <tools/urlobj.hxx>
32cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
33cdf0e10cSrcweir #include <unotools/configmgr.hxx>
34cdf0e10cSrcweir #include <com/sun/star/uno/Any.h>
35cdf0e10cSrcweir #include <sfx2/sfxuno.hxx>
36*45fd3b9aSArmin Le Grand #include <vcl/dibtools.hxx>
37cdf0e10cSrcweir
38cdf0e10cSrcweir // -----------------------------------------------------------------------
39cdf0e10cSrcweir
Init()40cdf0e10cSrcweir void IntroWindow_Impl::Init()
41cdf0e10cSrcweir {
42cdf0e10cSrcweir Size aSize = aIntroBmp.GetSizePixel();
43cdf0e10cSrcweir SetOutputSizePixel( aSize );
44cdf0e10cSrcweir Size aScreenSize( GetDesktopRectPixel().GetSize() );
45cdf0e10cSrcweir Size aWinSize( GetSizePixel() );
46cdf0e10cSrcweir Point aWinPos( ( aScreenSize.Width() - aWinSize.Width() ) / 2,
47cdf0e10cSrcweir ( aScreenSize.Height() - aWinSize.Height() ) / 2 );
48cdf0e10cSrcweir SetPosPixel( aWinPos );
49cdf0e10cSrcweir
50cdf0e10cSrcweir if ( GetColorCount() >= 16 )
51cdf0e10cSrcweir {
52cdf0e10cSrcweir Show();
53cdf0e10cSrcweir Update();
54cdf0e10cSrcweir }
55cdf0e10cSrcweir }
56cdf0e10cSrcweir
57cdf0e10cSrcweir // -----------------------------------------------------------------------
58cdf0e10cSrcweir
IntroWindow_Impl(const Bitmap & rBmp)59cdf0e10cSrcweir IntroWindow_Impl::IntroWindow_Impl( const Bitmap& rBmp ) :
60cdf0e10cSrcweir
61cdf0e10cSrcweir WorkWindow( NULL, (WinBits)0 ),
62cdf0e10cSrcweir
63cdf0e10cSrcweir aIntroBmp( rBmp )
64cdf0e10cSrcweir
65cdf0e10cSrcweir {
66cdf0e10cSrcweir Hide();
67cdf0e10cSrcweir
68cdf0e10cSrcweir // load bitmap depends on productname ("StarOffice", "StarSuite",...)
69cdf0e10cSrcweir ::com::sun::star::uno::Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
70cdf0e10cSrcweir rtl::OUString aTmp;
71cdf0e10cSrcweir aRet >>= aTmp;
72cdf0e10cSrcweir String aBmpFileName = aTmp;
73cdf0e10cSrcweir aBmpFileName += String( DEFINE_CONST_UNICODE("_intro.bmp") );
74cdf0e10cSrcweir INetURLObject aObj( SvtPathOptions().GetModulePath(), INET_PROT_FILE );
75cdf0e10cSrcweir aObj.insertName( aBmpFileName );
76cdf0e10cSrcweir SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
77*45fd3b9aSArmin Le Grand
78*45fd3b9aSArmin Le Grand if ( !aStrm.GetError() )
79*45fd3b9aSArmin Le Grand {
80*45fd3b9aSArmin Le Grand ReadDIB(aIntroBmp, aStrm, true);
81*45fd3b9aSArmin Le Grand }
82cdf0e10cSrcweir
83cdf0e10cSrcweir Init();
84cdf0e10cSrcweir }
85cdf0e10cSrcweir
86cdf0e10cSrcweir // -----------------------------------------------------------------------
87cdf0e10cSrcweir
~IntroWindow_Impl()88cdf0e10cSrcweir IntroWindow_Impl::~IntroWindow_Impl()
89cdf0e10cSrcweir {
90cdf0e10cSrcweir Hide();
91cdf0e10cSrcweir }
92cdf0e10cSrcweir
93cdf0e10cSrcweir // -----------------------------------------------------------------------
94cdf0e10cSrcweir
Paint(const Rectangle &)95cdf0e10cSrcweir void IntroWindow_Impl::Paint( const Rectangle& )
96cdf0e10cSrcweir {
97cdf0e10cSrcweir DrawBitmap( Point(), aIntroBmp );
98cdf0e10cSrcweir Flush();
99cdf0e10cSrcweir }
100cdf0e10cSrcweir
101cdf0e10cSrcweir // -----------------------------------------------------------------------
102cdf0e10cSrcweir
Slide()103cdf0e10cSrcweir void IntroWindow_Impl::Slide()
104cdf0e10cSrcweir {
105cdf0e10cSrcweir }
106cdf0e10cSrcweir
107cdf0e10cSrcweir
108