1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
31 #include <tools/extendapplicationenvironment.hxx>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34 #include <vcl/event.hxx>
35 #include <vcl/svapp.hxx>
36 #include <vcl/wrkwin.hxx>
37 #include <vcl/msgbox.hxx>
39 #include <comphelper/processfactory.hxx>
40 #include <cppuhelper/servicefactory.hxx>
41 #include <cppuhelper/bootstrap.hxx>
43 using namespace ::com::sun::star::uno
;
44 using namespace ::com::sun::star::lang
;
45 // -----------------------------------------------------------------------
47 // Forward declaration
50 // -----------------------------------------------------------------------
54 tools::extendApplicationEnvironment();
56 Reference
< XMultiServiceFactory
> xMS
;
57 xMS
= cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True
);
66 // -----------------------------------------------------------------------
68 class MyWin
: public WorkWindow
71 MyWin( Window
* pParent
, WinBits nWinStyle
);
73 void MouseMove( const MouseEvent
& rMEvt
);
74 void MouseButtonDown( const MouseEvent
& rMEvt
);
75 void MouseButtonUp( const MouseEvent
& rMEvt
);
76 void KeyInput( const KeyEvent
& rKEvt
);
77 void KeyUp( const KeyEvent
& rKEvt
);
78 void Paint( const Rectangle
& rRect
);
82 // -----------------------------------------------------------------------
86 MyWin
aMainWin( NULL
, WB_APP
| WB_STDWORK
);
87 aMainWin
.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "VCL - Workbench" ) ) );
90 Application::Execute();
93 // -----------------------------------------------------------------------
95 MyWin::MyWin( Window
* pParent
, WinBits nWinStyle
) :
96 WorkWindow( pParent
, nWinStyle
)
100 // -----------------------------------------------------------------------
102 void MyWin::MouseMove( const MouseEvent
& rMEvt
)
104 WorkWindow::MouseMove( rMEvt
);
107 // -----------------------------------------------------------------------
109 void MyWin::MouseButtonDown( const MouseEvent
& rMEvt
)
111 WorkWindow::MouseButtonDown( rMEvt
);
114 // -----------------------------------------------------------------------
116 void MyWin::MouseButtonUp( const MouseEvent
& rMEvt
)
118 WorkWindow::MouseButtonUp( rMEvt
);
121 // -----------------------------------------------------------------------
123 void MyWin::KeyInput( const KeyEvent
& rKEvt
)
125 WorkWindow::KeyInput( rKEvt
);
128 // -----------------------------------------------------------------------
130 void MyWin::KeyUp( const KeyEvent
& rKEvt
)
132 WorkWindow::KeyUp( rKEvt
);
135 // -----------------------------------------------------------------------
137 void MyWin::Paint( const Rectangle
& rRect
)
139 WorkWindow::Paint( rRect
);
142 // -----------------------------------------------------------------------
146 WorkWindow::Resize();
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */