xref: /aoo41x/main/vcl/workben/svdem.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_vcl.hxx"
30 
31 #include <sal/main.h>
32 #include <tools/extendapplicationenvironment.hxx>
33 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34 
35 #include <vcl/event.hxx>
36 #include <vcl/svapp.hxx>
37 #include <vcl/wrkwin.hxx>
38 #include <vcl/msgbox.hxx>
39 
40 #include <comphelper/processfactory.hxx>
41 #include <cppuhelper/servicefactory.hxx>
42 #include <cppuhelper/bootstrap.hxx>
43 
44 using namespace ::com::sun::star::uno;
45 using namespace ::com::sun::star::lang;
46 // -----------------------------------------------------------------------
47 
48 // Forward declaration
49 void Main();
50 
51 // -----------------------------------------------------------------------
52 
53 SAL_IMPLEMENT_MAIN()
54 {
55     tools::extendApplicationEnvironment();
56 
57     Reference< XMultiServiceFactory > xMS;
58     xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
59 
60     InitVCL( xMS );
61     ::Main();
62     DeInitVCL();
63 
64     return 0;
65 }
66 
67 // -----------------------------------------------------------------------
68 
69 class MyWin : public WorkWindow
70 {
71 public:
72 				MyWin( Window* pParent, WinBits nWinStyle );
73 
74 	void		MouseMove( const MouseEvent& rMEvt );
75 	void		MouseButtonDown( const MouseEvent& rMEvt );
76 	void		MouseButtonUp( const MouseEvent& rMEvt );
77 	void		KeyInput( const KeyEvent& rKEvt );
78 	void		KeyUp( const KeyEvent& rKEvt );
79 	void		Paint( const Rectangle& rRect );
80 	void		Resize();
81 };
82 
83 // -----------------------------------------------------------------------
84 
85 void Main()
86 {
87 	MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
88 	aMainWin.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "VCL - Workbench" ) ) );
89 	aMainWin.Show();
90 
91 	Application::Execute();
92 }
93 
94 // -----------------------------------------------------------------------
95 
96 MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
97 	WorkWindow( pParent, nWinStyle )
98 {
99 }
100 
101 // -----------------------------------------------------------------------
102 
103 void MyWin::MouseMove( const MouseEvent& rMEvt )
104 {
105 	WorkWindow::MouseMove( rMEvt );
106 }
107 
108 // -----------------------------------------------------------------------
109 
110 void MyWin::MouseButtonDown( const MouseEvent& rMEvt )
111 {
112 	WorkWindow::MouseButtonDown( rMEvt );
113 }
114 
115 // -----------------------------------------------------------------------
116 
117 void MyWin::MouseButtonUp( const MouseEvent& rMEvt )
118 {
119 	WorkWindow::MouseButtonUp( rMEvt );
120 }
121 
122 // -----------------------------------------------------------------------
123 
124 void MyWin::KeyInput( const KeyEvent& rKEvt )
125 {
126 	WorkWindow::KeyInput( rKEvt );
127 }
128 
129 // -----------------------------------------------------------------------
130 
131 void MyWin::KeyUp( const KeyEvent& rKEvt )
132 {
133 	WorkWindow::KeyUp( rKEvt );
134 }
135 
136 // -----------------------------------------------------------------------
137 
138 void MyWin::Paint( const Rectangle& rRect )
139 {
140 	WorkWindow::Paint( rRect );
141 }
142 
143 // -----------------------------------------------------------------------
144 
145 void MyWin::Resize()
146 {
147 	WorkWindow::Resize();
148 }
149