summaryrefslogtreecommitdiff
path: root/basctl/source
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2001-07-20 09:49:36 +0000
committerMathias Bauer <mba@openoffice.org>2001-07-20 09:49:36 +0000
commitdfc2e249b2a6500aa55a57c03fb51f568c3787cb (patch)
treec85589a489329ebbf632568011389ffc063023aa /basctl/source
parent577c1b52443313f4a7f196641f53be1e906630f9 (diff)
#88563#: BasicIDE on demand
Diffstat (limited to 'basctl/source')
-rw-r--r--basctl/source/basicide/basdoc.cxx13
-rw-r--r--basctl/source/basicide/basdoc.hxx7
-rw-r--r--basctl/source/basicide/basicmod.hxx93
-rw-r--r--basctl/source/basicide/basobj2.cxx6
-rw-r--r--basctl/source/basicide/iderdll.cxx78
-rw-r--r--basctl/source/basicide/makefile.mk33
6 files changed, 207 insertions, 23 deletions
diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index bfb8a9072951..bd4a2b6cd56e 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: basdoc.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: tbe $ $Date: 2001-06-15 08:45:17 $
+ * last change: $Author: mba $ $Date: 2001-07-20 10:49:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,12 +78,14 @@
#define BasicDocShell
#include <baside.hxx>
+#include "basicmod.hxx"
TYPEINIT1(BasicDocShell, SfxObjectShell);
DBG_NAME(BasicDocShell);
-
-SFX_IMPL_SIMPLE_OBJECTFACTORY( BasicDocShell, SFXOBJECTSHELL_STD_SPECIAL | SFXOBJECTSHELL_DONTREPLACE, sbasic )
+SFX_IMPL_SIMPLE_OBJECTFACTORY_LOD( BasicDocShell, BasicIDE, BASIC_MOD() )
+//SFX_IMPL_SIMPLE_OBJECTFACTORY( BasicDocShell, SFXOBJECTSHELL_STD_SPECIAL | SFXOBJECTSHELL_DONTREPLACE, sbasic )
+/*
{
Factory().SetExplorerImageId( IMG_MACROLIB );
Factory().RegisterHelpFile( String( RTL_CONSTASCII_USTRINGPARAM( "sbasic" ) ) );
@@ -91,7 +93,7 @@ SFX_IMPL_SIMPLE_OBJECTFACTORY( BasicDocShell, SFXOBJECTSHELL_STD_SPECIAL | SFXOB
Factory().RegisterMenuBar( ResId(RID_DEFAULTMENU) );
Factory().RegisterPluginMenuBar( ResId(RID_DEFAULTPLUGINMENU) );
}
-
+*/
SFX_IMPL_INTERFACE( BasicDocShell, SfxObjectShell, IDEResId( 0 ) )
{
@@ -105,6 +107,7 @@ BasicDocShell::BasicDocShell( SfxObjectCreateMode eMode ) : SfxObjectShell( eMod
{
pPrinter = 0;
SetPool( &SFX_APP()->GetPool() );
+ SetTitle( String( RTL_CONSTASCII_USTRINGPARAM("BASIC") ) );
}
diff --git a/basctl/source/basicide/basdoc.hxx b/basctl/source/basicide/basdoc.hxx
index c0911d561d1d..8d60cacf8190 100644
--- a/basctl/source/basicide/basdoc.hxx
+++ b/basctl/source/basicide/basdoc.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: basdoc.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: tbe $ $Date: 2001-06-15 08:45:17 $
+ * last change: $Author: mba $ $Date: 2001-07-20 10:49:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,7 +69,6 @@
#include <sfx2/objsh.hxx>
#endif
-
class SfxPrinter;
class BasicDocShell: public SfxObjectShell
@@ -83,7 +82,7 @@ protected:
public:
TYPEINFO();
- SFX_DECL_SIMPLE_OBJECTFACTORY( BasicDocShell );
+ SFX_DECL_SIMPLE_OBJECTFACTORY_DLL( BasicDocShell );
SFX_DECL_INTERFACE( SVX_INTERFACE_BASIDE_DOCSH );
BasicDocShell( SfxObjectCreateMode eMode = SFX_CREATE_MODE_STANDARD );
~BasicDocShell();
diff --git a/basctl/source/basicide/basicmod.hxx b/basctl/source/basicide/basicmod.hxx
new file mode 100644
index 000000000000..1617f53f5f05
--- /dev/null
+++ b/basctl/source/basicide/basicmod.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: basicmod.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: mba $ $Date: 2001-07-20 10:49:36 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef BASICMOD_HXX
+#define BASICMOD_HXX
+
+#ifndef _SFXMODULE_HXX //autogen
+#include <sfx2/module.hxx>
+#endif
+#ifndef _SHL_HXX //autogen
+#include <tools/shl.hxx>
+#endif
+
+class BasicIDEModuleDummy : public SfxModule
+{
+public:
+ // SvFactory name convention:
+ // 'p' + SfxObjectShell-subclass + 'Factory'
+ SfxObjectFactory *pBasicDocShellFactory;
+
+ BasicIDEModuleDummy(ResMgr *pMgr,
+ BOOL bDummy,
+ SfxObjectFactory *pObjFact) :
+ SfxModule(pMgr, bDummy, (SfxObjectFactory*) pObjFact, NULL),
+ pBasicDocShellFactory(pObjFact)
+ {
+ }
+
+ virtual SfxModule *Load ();
+};
+
+#define BASIC_MOD() ( *(BasicIDEModuleDummy**) GetAppData(SHL_IDE) )
+
+#endif
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index 5238f125b50f..1f7fa9b0936e 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: basobj2.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: tbe $ $Date: 2001-07-17 08:43:30 $
+ * last change: $Author: mba $ $Date: 2001-07-20 10:49:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,6 +78,7 @@
#include <moduldlg.hxx>
#include <basidesh.hxx>
#include <baside2.hxx>
+#include <basicmod.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -229,6 +230,7 @@ void BasicIDE::DecBasicDialogCount()
String BasicIDE::SelectMacro( BOOL bExecute, BOOL bChooseOnly, const String& rPreferredMacroDesciption )
{
+ BASIC_MOD()->Load();
if ( rPreferredMacroDesciption.Len() )
IDE_DLL()->GetExtraData()->GetLastMacro() = rPreferredMacroDesciption;
diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx
index 27339960661d..d3a03aedb3b7 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: iderdll.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: tbe $ $Date: 2001-07-10 09:02:59 $
+ * last change: $Author: mba $ $Date: 2001-07-20 10:49:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,26 +92,52 @@
#include <basidesh.hrc>
#include <basobj.hxx>
#include <bastypes.hxx>
+#include <basdoc.hxx>
+#include <basicmod.hxx>
#define ITEMID_SEARCH 0
#include <svx/srchitem.hxx>
-IDEResId::IDEResId( USHORT nId ):
- ResId( nId, (*(BasicIDEDLL**)GetAppData(SHL_IDE))->GetResMgr() )
+class BasicIDEModule : public BasicIDEModuleDummy
{
+public:
+ BasicIDEModule( ResMgr *pMgr, SfxObjectFactory *pObjFact) :
+ BasicIDEModuleDummy( pMgr, FALSE, (SfxObjectFactory*) pObjFact )
+ {}
+
+ virtual SfxModule *Load ();
+};
+
+SfxModule* BasicIDEModuleDummy::Load ()
+{
+ return 0;
}
+SfxModule* BasicIDEModule::Load ()
+{
+ return this;
+}
-BasicIDEDLL::BasicIDEDLL()
+static BasicIDEDLL* pBasicIDEDLL = 0;
+
+BasicIDEDLL* BasicIDEDLL::GetDLL()
{
- *(BasicIDEDLL**)GetAppData(SHL_IDE) = this;
+ return pBasicIDEDLL;
+}
- ByteString aResMgrName( "basctl" );
- aResMgrName += ByteString::CreateFromInt32( SOLARUPD );
- pResMgr = ResMgr::CreateResMgr(
- aResMgrName.GetBuffer(), Application::GetSettings().GetUILanguage() );
+SFX_IMPL_MODULE_DLL( BasicIDE )
+
+IDEResId::IDEResId( USHORT nId ):
+ ResId( nId, (*(BasicIDEModuleDummy**)GetAppData(SHL_IDE))->GetResMgr() )
+{
+}
+
+BasicIDEDLL::BasicIDEDLL()
+{
+ pBasicIDEDLL = this;
pShell = 0;
pExtraData = 0;
+
GetExtraData(); // damit GlobalErrorHdl gesetzt wird.
}
@@ -122,6 +148,38 @@ BasicIDEDLL::~BasicIDEDLL()
*(BasicIDEDLL**)GetAppData(SHL_IDE) = NULL;
}
+void BasicIDEDLL::Init()
+{
+ BasicIDEModuleDummy** ppShlPtr = (BasicIDEModuleDummy**) GetAppData(SHL_IDE);
+
+ SfxObjectFactory* pFact = (*ppShlPtr)->pBasicDocShellFactory;
+ delete (*ppShlPtr);
+
+ ByteString aResMgrName( "basctl" );
+ aResMgrName += ByteString::CreateFromInt32( SOLARUPD );
+ ResMgr* pMgr = ResMgr::CreateResMgr(
+ aResMgrName.GetBuffer(), Application::GetSettings().GetUILanguage() );
+
+ (*ppShlPtr) = new BasicIDEModule( pMgr, pFact );
+ (*ppShlPtr)->pBasicDocShellFactory = pFact;
+
+ new BasicIDEDLL;
+ SfxModule* pMod = (*ppShlPtr );
+ BasicDocShell::RegisterInterface( pMod );
+ BasicIDEShell::RegisterFactory( SVX_INTERFACE_BASIDE_VIEWSH );
+ BasicIDEShell::RegisterInterface( pMod );
+}
+
+/*************************************************************************
+|*
+|* Deinitialisierung
+|*
+\************************************************************************/
+void BasicIDEDLL::Exit()
+{
+ DELETEZ( pBasicIDEDLL );
+}
+
BasicIDEData* BasicIDEDLL::GetExtraData()
{
if ( !pExtraData )
diff --git a/basctl/source/basicide/makefile.mk b/basctl/source/basicide/makefile.mk
index d1c20f0586cf..9dbdc8144cd4 100644
--- a/basctl/source/basicide/makefile.mk
+++ b/basctl/source/basicide/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.8 $
+# $Revision: 1.9 $
#
-# last change: $Author: tbe $ $Date: 2001-07-03 16:33:31 $
+# last change: $Author: mba $ $Date: 2001-07-20 10:49:36 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -125,7 +125,36 @@ EXCEPTIONSFILES=$(SLO)$/basidesh.obj \
SRCFILES= basidesh.src macrodlg.src moptions.src moduldlg.src objdlg.src brkdlg.src tbxctl.src
+LIB2TARGET = $(SLB)$/ybctl.lib
+LIB2ARCHIV = $(LB)$/libybctl.a
+LIB2OBJFILES = $(SLO)$/basiclib.obj
+DEPOBJFILES = $(SLO)$/basiclib.obj
+
+
+.IF "$(depend)" == ""
+
+ALL: \
+ $(INCCOM)$/dllname.hxx \
+ ALLTAR
+
+$(INCCOM)$/dllname.hxx: makefile.mk
+.IF "$(GUI)"=="OS2"
+ echo #define DLL_NAME "basctl$(UPD)$(DLLPOSTFIX)" >$@
+.ELSE
+.IF "$(GUI)"=="MAC"
+ echo "$(HASHMARK)define DLL_NAME ¶"basctl$(UPD)$(DLLPOSTFIX).dll¶"" > $@
+.ELSE
+.IF "$(GUI)"=="UNX"
+ $(RM) $@
+ echo #define DLL_NAME \"libbasctl$(UPD)$(DLLPOSTFIX)$(DLLPOST)\" >$@
+.ELSE
+ echo #define DLL_NAME "basctl$(UPD)$(DLLPOSTFIX)$(DLLPOST)" >$@
+.ENDIF
+.ENDIF
+.ENDIF
+
+.ENDIF
.INCLUDE : target.mk
.IF "$(depend)" == ""