xref: /aoo42x/main/vcl/workben/svdem.cxx (revision 3b807085)
19f62ea84SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
39f62ea84SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
49f62ea84SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
59f62ea84SAndrew Rist  * distributed with this work for additional information
69f62ea84SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
79f62ea84SAndrew Rist  * to you under the Apache License, Version 2.0 (the
89f62ea84SAndrew Rist  * "License"); you may not use this file except in compliance
99f62ea84SAndrew Rist  * with the License.  You may obtain a copy of the License at
109f62ea84SAndrew Rist  *
119f62ea84SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
129f62ea84SAndrew Rist  *
139f62ea84SAndrew Rist  * Unless required by applicable law or agreed to in writing,
149f62ea84SAndrew Rist  * software distributed under the License is distributed on an
159f62ea84SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
169f62ea84SAndrew Rist  * KIND, either express or implied.  See the License for the
179f62ea84SAndrew Rist  * specific language governing permissions and limitations
189f62ea84SAndrew Rist  * under the License.
199f62ea84SAndrew Rist  *
209f62ea84SAndrew Rist  *************************************************************/
219f62ea84SAndrew Rist 
229f62ea84SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_vcl.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <sal/main.h>
28cdf0e10cSrcweir #include <tools/extendapplicationenvironment.hxx>
29cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include <vcl/event.hxx>
32cdf0e10cSrcweir #include <vcl/svapp.hxx>
33cdf0e10cSrcweir #include <vcl/wrkwin.hxx>
34cdf0e10cSrcweir #include <vcl/msgbox.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
37cdf0e10cSrcweir #include <cppuhelper/servicefactory.hxx>
38cdf0e10cSrcweir #include <cppuhelper/bootstrap.hxx>
39cdf0e10cSrcweir 
40cdf0e10cSrcweir using namespace ::com::sun::star::uno;
41cdf0e10cSrcweir using namespace ::com::sun::star::lang;
42cdf0e10cSrcweir // -----------------------------------------------------------------------
43cdf0e10cSrcweir 
44cdf0e10cSrcweir // Forward declaration
45cdf0e10cSrcweir void Main();
46cdf0e10cSrcweir 
47cdf0e10cSrcweir // -----------------------------------------------------------------------
48cdf0e10cSrcweir 
49cdf0e10cSrcweir SAL_IMPLEMENT_MAIN()
50cdf0e10cSrcweir {
51cdf0e10cSrcweir     tools::extendApplicationEnvironment();
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     Reference< XMultiServiceFactory > xMS;
54*3b807085SPedro Giffuni     xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
55*3b807085SPedro Giffuni 
56cdf0e10cSrcweir     InitVCL( xMS );
57cdf0e10cSrcweir     ::Main();
58cdf0e10cSrcweir     DeInitVCL();
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     return 0;
61cdf0e10cSrcweir }
62cdf0e10cSrcweir 
63cdf0e10cSrcweir // -----------------------------------------------------------------------
64cdf0e10cSrcweir 
65cdf0e10cSrcweir class MyWin : public WorkWindow
66cdf0e10cSrcweir {
67cdf0e10cSrcweir public:
68cdf0e10cSrcweir 				MyWin( Window* pParent, WinBits nWinStyle );
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	void		MouseMove( const MouseEvent& rMEvt );
71cdf0e10cSrcweir 	void		MouseButtonDown( const MouseEvent& rMEvt );
72cdf0e10cSrcweir 	void		MouseButtonUp( const MouseEvent& rMEvt );
73cdf0e10cSrcweir 	void		KeyInput( const KeyEvent& rKEvt );
74cdf0e10cSrcweir 	void		KeyUp( const KeyEvent& rKEvt );
75cdf0e10cSrcweir 	void		Paint( const Rectangle& rRect );
76cdf0e10cSrcweir 	void		Resize();
77cdf0e10cSrcweir };
78cdf0e10cSrcweir 
79cdf0e10cSrcweir // -----------------------------------------------------------------------
80cdf0e10cSrcweir 
81cdf0e10cSrcweir void Main()
82cdf0e10cSrcweir {
83cdf0e10cSrcweir 	MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
84cdf0e10cSrcweir 	aMainWin.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "VCL - Workbench" ) ) );
85cdf0e10cSrcweir 	aMainWin.Show();
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 	Application::Execute();
88cdf0e10cSrcweir }
89cdf0e10cSrcweir 
90cdf0e10cSrcweir // -----------------------------------------------------------------------
91cdf0e10cSrcweir 
92cdf0e10cSrcweir MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
93cdf0e10cSrcweir 	WorkWindow( pParent, nWinStyle )
94cdf0e10cSrcweir {
95cdf0e10cSrcweir }
96cdf0e10cSrcweir 
97cdf0e10cSrcweir // -----------------------------------------------------------------------
98cdf0e10cSrcweir 
99cdf0e10cSrcweir void MyWin::MouseMove( const MouseEvent& rMEvt )
100cdf0e10cSrcweir {
101cdf0e10cSrcweir 	WorkWindow::MouseMove( rMEvt );
102cdf0e10cSrcweir }
103cdf0e10cSrcweir 
104cdf0e10cSrcweir // -----------------------------------------------------------------------
105cdf0e10cSrcweir 
106cdf0e10cSrcweir void MyWin::MouseButtonDown( const MouseEvent& rMEvt )
107cdf0e10cSrcweir {
108cdf0e10cSrcweir 	WorkWindow::MouseButtonDown( rMEvt );
109cdf0e10cSrcweir }
110cdf0e10cSrcweir 
111cdf0e10cSrcweir // -----------------------------------------------------------------------
112cdf0e10cSrcweir 
113cdf0e10cSrcweir void MyWin::MouseButtonUp( const MouseEvent& rMEvt )
114cdf0e10cSrcweir {
115cdf0e10cSrcweir 	WorkWindow::MouseButtonUp( rMEvt );
116cdf0e10cSrcweir }
117cdf0e10cSrcweir 
118cdf0e10cSrcweir // -----------------------------------------------------------------------
119cdf0e10cSrcweir 
120cdf0e10cSrcweir void MyWin::KeyInput( const KeyEvent& rKEvt )
121cdf0e10cSrcweir {
122cdf0e10cSrcweir 	WorkWindow::KeyInput( rKEvt );
123cdf0e10cSrcweir }
124cdf0e10cSrcweir 
125cdf0e10cSrcweir // -----------------------------------------------------------------------
126cdf0e10cSrcweir 
127cdf0e10cSrcweir void MyWin::KeyUp( const KeyEvent& rKEvt )
128cdf0e10cSrcweir {
129cdf0e10cSrcweir 	WorkWindow::KeyUp( rKEvt );
130cdf0e10cSrcweir }
131cdf0e10cSrcweir 
132cdf0e10cSrcweir // -----------------------------------------------------------------------
133cdf0e10cSrcweir 
134cdf0e10cSrcweir void MyWin::Paint( const Rectangle& rRect )
135cdf0e10cSrcweir {
136cdf0e10cSrcweir 	WorkWindow::Paint( rRect );
137cdf0e10cSrcweir }
138cdf0e10cSrcweir 
139cdf0e10cSrcweir // -----------------------------------------------------------------------
140cdf0e10cSrcweir 
141cdf0e10cSrcweir void MyWin::Resize()
142cdf0e10cSrcweir {
143cdf0e10cSrcweir 	WorkWindow::Resize();
144cdf0e10cSrcweir }
145