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