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 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 xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True ); 56 57 InitVCL( xMS ); 58 ::Main(); 59 DeInitVCL(); 60 61 return 0; 62 } 63 64 // ----------------------------------------------------------------------- 65 66 class MyWin : public WorkWindow 67 { 68 public: 69 MyWin( Window* pParent, WinBits nWinStyle ); 70 71 void MouseMove( const MouseEvent& rMEvt ); 72 void MouseButtonDown( const MouseEvent& rMEvt ); 73 void MouseButtonUp( const MouseEvent& rMEvt ); 74 void KeyInput( const KeyEvent& rKEvt ); 75 void KeyUp( const KeyEvent& rKEvt ); 76 void Paint( const Rectangle& rRect ); 77 void Resize(); 78 }; 79 80 // ----------------------------------------------------------------------- 81 82 void Main() 83 { 84 MyWin aMainWin( NULL, WB_APP | WB_STDWORK ); 85 aMainWin.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "VCL - Workbench" ) ) ); 86 aMainWin.Show(); 87 88 Application::Execute(); 89 } 90 91 // ----------------------------------------------------------------------- 92 93 MyWin::MyWin( Window* pParent, WinBits nWinStyle ) : 94 WorkWindow( pParent, nWinStyle ) 95 { 96 } 97 98 // ----------------------------------------------------------------------- 99 100 void MyWin::MouseMove( const MouseEvent& rMEvt ) 101 { 102 WorkWindow::MouseMove( rMEvt ); 103 } 104 105 // ----------------------------------------------------------------------- 106 107 void MyWin::MouseButtonDown( const MouseEvent& rMEvt ) 108 { 109 WorkWindow::MouseButtonDown( rMEvt ); 110 } 111 112 // ----------------------------------------------------------------------- 113 114 void MyWin::MouseButtonUp( const MouseEvent& rMEvt ) 115 { 116 WorkWindow::MouseButtonUp( rMEvt ); 117 } 118 119 // ----------------------------------------------------------------------- 120 121 void MyWin::KeyInput( const KeyEvent& rKEvt ) 122 { 123 WorkWindow::KeyInput( rKEvt ); 124 } 125 126 // ----------------------------------------------------------------------- 127 128 void MyWin::KeyUp( const KeyEvent& rKEvt ) 129 { 130 WorkWindow::KeyUp( rKEvt ); 131 } 132 133 // ----------------------------------------------------------------------- 134 135 void MyWin::Paint( const Rectangle& rRect ) 136 { 137 WorkWindow::Paint( rRect ); 138 } 139 140 // ----------------------------------------------------------------------- 141 142 void MyWin::Resize() 143 { 144 WorkWindow::Resize(); 145 } 146