1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <tools/extendapplicationenvironment.hxx>
23 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
25 #include <vcl/event.hxx>
26 #include <vcl/svapp.hxx>
27 #include <vcl/wrkwin.hxx>
28 #include <vcl/msgbox.hxx>
30 #include <comphelper/processfactory.hxx>
31 #include <cppuhelper/servicefactory.hxx>
32 #include <cppuhelper/bootstrap.hxx>
34 using namespace ::com::sun::star::uno
;
35 using namespace ::com::sun::star::lang
;
37 // Forward declaration
43 tools::extendApplicationEnvironment();
45 Reference
< XMultiServiceFactory
> xMS
;
46 xMS
= cppu::createRegistryServiceFactory( "types.rdb", "applicat.rdb", sal_True
);
48 comphelper::setProcessServiceFactory( xMS
);
58 class MyWin
: public WorkWindow
61 MyWin( Window
* pParent
, WinBits nWinStyle
);
63 void MouseMove( const MouseEvent
& rMEvt
);
64 void MouseButtonDown( const MouseEvent
& rMEvt
);
65 void MouseButtonUp( const MouseEvent
& rMEvt
);
66 void KeyInput( const KeyEvent
& rKEvt
);
67 void KeyUp( const KeyEvent
& rKEvt
);
68 void Paint( const Rectangle
& rRect
);
75 MyWin
aMainWin( NULL
, WB_APP
| WB_STDWORK
);
76 aMainWin
.SetText(OUString("VCL - Workbench"));
79 Application::Execute();
83 MyWin::MyWin( Window
* pParent
, WinBits nWinStyle
) :
84 WorkWindow( pParent
, nWinStyle
)
89 void MyWin::MouseMove( const MouseEvent
& rMEvt
)
91 WorkWindow::MouseMove( rMEvt
);
95 void MyWin::MouseButtonDown( const MouseEvent
& rMEvt
)
97 WorkWindow::MouseButtonDown( rMEvt
);
101 void MyWin::MouseButtonUp( const MouseEvent
& rMEvt
)
103 WorkWindow::MouseButtonUp( rMEvt
);
107 void MyWin::KeyInput( const KeyEvent
& rKEvt
)
109 WorkWindow::KeyInput( rKEvt
);
113 void MyWin::KeyUp( const KeyEvent
& rKEvt
)
115 WorkWindow::KeyUp( rKEvt
);
119 void MyWin::Paint( const Rectangle
& rRect
)
121 WorkWindow::Paint( rRect
);
127 WorkWindow::Resize();
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */