diff options
Diffstat (limited to 'basic')
126 files changed, 53647 insertions, 0 deletions
diff --git a/basic/inc/basrid.hxx b/basic/inc/basrid.hxx new file mode 100644 index 000000000000..ef7a886441d2 --- /dev/null +++ b/basic/inc/basrid.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * $RCSfile: basrid.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:07 $ + * + * 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 _BASRID_HXX +#define _BASRID_HXX + +#ifndef _TOOLS_RESID_HXX //autogen +#include <tools/resid.hxx> +#endif + +class BasicResId: public ResId +{ +public: + BasicResId( USHORT nId ); +}; + +#endif //_BASRID_HXX diff --git a/basic/inc/sb.hrc b/basic/inc/sb.hrc new file mode 100644 index 000000000000..c7d7c2bc6697 --- /dev/null +++ b/basic/inc/sb.hrc @@ -0,0 +1,81 @@ +/************************************************************************* + * + * $RCSfile: sb.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:07 $ + * + * 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 _SB_HRC +#define _SB_HRC + +#include <svtools/solar.hrc> + +#ifndef IDS_SBERR_START + #define IDS_SBERR_START RID_BASIC_START +#endif + +#define IDS_SBERR_TERMINATED IDS_SBERR_START+2000 +#define IDS_SBERR_STOREREF IDS_SBERR_START+2001 + +// #define IDS_SBERR_LIBLOAD IDS_SBERR_START+2002 +// #define IDS_SBERR_LIBSAVE IDS_SBERR_START+2003 +// #define IDS_SBERR_MGROPEN IDS_SBERR_START+2004 +// #define IDS_SBERR_MGRSAVE IDS_SBERR_START+2005 +// #define IDS_SBERR_REMOVELIB IDS_SBERR_START+2006 +// #define IDS_SBERR_UNLOADLIB IDS_SBERR_START+2007 + +#endif diff --git a/basic/inc/sb.hxx b/basic/inc/sb.hxx new file mode 100644 index 000000000000..5cae2d1ebefe --- /dev/null +++ b/basic/inc/sb.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * $RCSfile: sb.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:07 $ + * + * 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 _SB_HXX +#define _SB_HXX + +#ifndef _SBERRORS_HXX + #include "sberrors.hxx" +#endif + + +#include <sbdef.hxx> +#include <sbmeth.hxx> +#include <sbmod.hxx> +#include <sbprop.hxx> +#include <sbstar.hxx> + +#endif diff --git a/basic/inc/testtool.hrc b/basic/inc/testtool.hrc new file mode 100644 index 000000000000..28f82508fa0e --- /dev/null +++ b/basic/inc/testtool.hrc @@ -0,0 +1,70 @@ +/************************************************************************* + * + * $RCSfile: testtool.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:07 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#define S_INVALID_KEYCODE 257 +#define S_MANDATORY_FILE 258 +#define S_READING_LONGNAMES 259 +#define S_READING_SLOT_IDS 260 +#define S_READING_CONTROLS 261 +#define S_READING_BASIC_MODULE 262 +#define S_STARTING_APPLICATION 263 + + + diff --git a/basic/inc/ttmsg.hrc b/basic/inc/ttmsg.hrc new file mode 100644 index 000000000000..3e7074566708 --- /dev/null +++ b/basic/inc/ttmsg.hrc @@ -0,0 +1,147 @@ +/************************************************************************* + * + * $RCSfile: ttmsg.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:07 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#include <svtools/ttglobal.hrc> + + +// Hier sind die Messages aus dem Verzeichnis /basic/source/testtool enhalten + + +/////////////////////////////// +// Fehlermeldungen, die in das Resultfile gelangen. +// ********************* +// *** !!ACHTUNG!! *** +// ********************* +// Die Nummern drfen sich NIE! ndern, +// da sie in den Resultfiles gespeichert sind, und bei erneutem Anzeigen +// statdessen die entsprechenden neuen oder garkeine Strings angzeigt werden. +/////////////////////////////// + +#define S_NAME_NOT_THERE ( TT_START + 0 ) +#define S_DOUBLE_NAME ( TT_START + 1 ) +#define S_READING_FILE ( TT_START + 2 ) +#define S_CANNOT_OPEN_FILE ( TT_START + 3 ) +#define S_INVALID_LINE ( TT_START + 4 ) +#define S_SHORTNAME_UNKNOWN ( TT_START + 5 ) +#define S_LONGNAME_UNKNOWN ( TT_START + 6 ) +#define S_FIRST_SHORTNAME_REQ_ASTRX ( TT_START + 7 ) +#define S_TIMOUT_WAITING ( TT_START + 8 ) +#define S_APPLICATION_RESTARTED ( TT_START + 9 ) +#define S_APPLICATION_START_FAILED ( TT_START + 10 ) +#define S_TIMOUT_SENDING ( TT_START + 11 ) +#define S_NO_CONNECTION ( TT_START + 12 ) +#define S_NO_FILES_FOUND ( TT_START + 13 ) +#define S_ERRORS_DETECTED ( TT_START + 14 ) +#define S_NO_ERRORS_DETECTED ( TT_START + 15 ) +#define S_WARNINGS_DETECTED ( TT_START + 16 ) +#define S_NO_WARNINGS_DETECTED ( TT_START + 17 ) +#define S_UNKNOWN_SLOT_CONTROL ( TT_START + 18 ) +#define S_RETURN_SEQUENCE_MISSMATCH ( TT_START + 19 ) +#define S_RETURNED_VALUE_ID_MISSMATCH ( TT_START + 20 ) +#define S_RETURNED_VALUE_NO_RECEIVER ( TT_START + 21 ) +#define S_UNKNOWN_METHOD ( TT_START + 22 ) +#define S_INCLUDE_FILE_WARNINGS_DETECTED ( TT_START + 23 ) +#define S_NO_INCLUDE_FILE_WARNINGS_DETECTED ( TT_START + 24 ) + + +// Stings + + +/* +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +*/ diff --git a/basic/prj/d.lst b/basic/prj/d.lst new file mode 100644 index 000000000000..bde728a2833c --- /dev/null +++ b/basic/prj/d.lst @@ -0,0 +1,44 @@ +touch: ..\%__SRC%\misc\basic.hid %_DEST%\bin%_EXT%\basic.hid +..\%__SRC%\lib\basic.lib %_DEST%\lib%_EXT%\basic.lib +..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so +..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a +..\%__SRC%\slb\sb.lib %_DEST%\lib%_EXT%\xsb.lib +..\%__SRC%\srs\classes.srs %_DEST%\res%_EXT%\basic.srs +..\%__SRC%\res\*.srs %_DEST%\res%_EXT%\*.srs +..\%__SRC%\bin\sb?????.dll %_DEST%\bin%_EXT%\sb?????.dll +..\%__SRC%\bin\sb?????.sym %_DEST%\bin%_EXT%\sb?????.sym +..\%__SRC%\misc\sb?????.map %_DEST%\bin%_EXT%\sb?????.map +..\%__SRC%\bin\testtool.exe %_DEST%\bin%_EXT%\testtool.exe +..\%__SRC%\bin\testtool %_DEST%\bin%_EXT%\testtool.bin +..\%__SRC%\bin\stt%UPD%49.res %_DEST%\bin%_EXT%\testtool.res +..\%__SRC%\bin\stt*.res %_DEST%\bin%_EXT%\stt*.res +..\%__SRC%\inc\classes %_DEST%\bin%_EXT%\classes +..\%__SRC%\inc\keycodes %_DEST%\bin%_EXT%\keycodes +..\%__SRC%\inc\res_type %_DEST%\bin%_EXT%\res_type +..\%__SRC%\lib\app.lib %_DEST%\lib%_EXT%\app.lib +..\%__SRC%\lib\libapp.a %_DEST%\lib%_EXT%\libapp.a +..\%__SRC%\lib\sample.lib %_DEST%\lib%_EXT%\sample.lib +..\%__SRC%\lib\libsample.a %_DEST%\lib%_EXT%\libsample.a + +mkdir: %_DEST%\inc%_EXT%\basic +hedabu: ..\inc\sbdef.hxx %_DEST%\inc%_EXT%\basic\sbdef.hxx +hedabu: ..\inc\sbmod.hxx %_DEST%\inc%_EXT%\basic\sbmod.hxx +hedabu: ..\inc\sbjsmod.hxx %_DEST%\inc%_EXT%\basic\sbjsmod.hxx +hedabu: ..\inc\sbmeth.hxx %_DEST%\inc%_EXT%\basic\sbmeth.hxx +hedabu: ..\inc\sbprop.hxx %_DEST%\inc%_EXT%\basic\sbprop.hxx +hedabu: ..\inc\sbstar.hxx %_DEST%\inc%_EXT%\basic\sbstar.hxx +hedabu: ..\inc\sbuno.hxx %_DEST%\inc%_EXT%\basic\sbuno.hxx +hedabu: ..\inc\basmgr.hxx %_DEST%\inc%_EXT%\basic\basmgr.hxx +hedabu: ..\inc\sberrors.hxx %_DEST%\inc%_EXT%\basic\sberrors.hxx +hedabu: ..\inc\basrdll.hxx %_DEST%\inc%_EXT%\basic\basrdll.hxx +hedabu: ..\inc\stdobj1.hxx %_DEST%\inc%_EXT%\basic\sbstdobj.hxx +hedabu: ..\inc\hilight.hxx %_DEST%\inc%_EXT%\basic\hilight.hxx +hedabu: ..\inc\process.hxx %_DEST%\inc%_EXT%\basic\process.hxx +hedabu: ..\inc\testtool.hrc %_DEST%\inc%_EXT%\basic\testtool.hrc +hedabu: ..\inc\ttmsg.hrc %_DEST%\inc%_EXT%\basic\ttmsg.hrc +hedabu: ..\inc\mybasic.hxx %_DEST%\inc%_EXT%\basic\mybasic.hxx +hedabu: ..\inc\testtool.hxx %_DEST%\inc%_EXT%\basic\testtool.hxx +hedabu: ..\inc\basicrt.hxx %_DEST%\inc%_EXT%\basic\basicrt.hxx +hedabu: ..\inc\dispdefs.hxx %_DEST%\inc%_EXT%\basic\dispdefs.hxx +hedabu: ..\inc\ttstrhlp.hxx %_DEST%\inc%_EXT%\basic\ttstrhlp.hxx + diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx new file mode 100644 index 000000000000..35a50b904abd --- /dev/null +++ b/basic/source/app/app.cxx @@ -0,0 +1,1580 @@ +/************************************************************************* + * + * $RCSfile: app.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _FSYS_HXX //autogen +#include <tools/fsys.hxx> +#endif +#ifndef _SV_FILEDLG_HXX //autogen +#include <svtools/filedlg.hxx> +#endif +#ifndef _SV_CONFIG_HXX //autogen +#include <vcl/config.hxx> +#endif + +#include <vcl/system.hxx> + +#include <vcl/font.hxx> + +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif + +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifdef VCL +#include <svtools/filedlg.hxx> +#endif + +#include "basic.hrc" +#include "app.hxx" +#include "printer.hxx" +#include "status.hxx" +#include "appedit.hxx" +#include "appbased.hxx" +#include "apperror.hxx" +#include "mybasic.hxx" +#include "ttbasic.hxx" +#include "dialogs.hxx" +#include "basrdll.hxx" + +#ifndef _RUNTIME_HXX +#include "runtime.hxx" +#endif + +#ifndef _SB_INTERN_HXX +#include "sbintern.hxx" +#endif + +#ifdef _USE_UNO +#include <ucbhelper/contentbroker.hxx> +#include <ucbhelper/registerucb.hxx> +#include <unotools/regpathhelper.hxx> +#include <unotools/processfactory.hxx> + +#include <cppuhelper/servicefactory.hxx> +#include <com/sun/star/registry/XImplementationRegistration.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/ucb/XContentProviderManager.hpp> +#include <com/sun/star/ucb/ContentProviderServiceInfo2.hpp> + +using namespace utl; +using namespace ucb; +using namespace cppu; +using namespace rtl; +using namespace com::sun::star::uno; +using namespace com::sun::star::lang; +using namespace com::sun::star::registry; +using namespace com::sun::star::ucb; + +#endif /* _USE_UNO */ + + +BasicApp aBasicApp; // Applikations-Instanz + +#ifdef _USE_UNO +Reference< XContentProviderManager > InitializeUCB( std::vector< ucb::ContentProviderRegistrationInfo > &rRegisteredProviders ) +{ + ////////////////////////////////////////////////////////////////////// + // Bootstrap service factory, set global factory + Reference< XMultiServiceFactory > xSMgr( createRegistryServiceFactory( getPathToSystemRegistry() ) ); + setProcessServiceFactory( xSMgr ); + + ////////////////////////////////////////////////////////////////////// + // Create UCB. + Reference< XImplementationRegistration > + xIR( xSMgr->createInstance( OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ) ), UNO_QUERY ); + xIR->registerImplementation( OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), + OUString::createFromAscii( "ucb1.dll" ), + Reference< XSimpleRegistry >() ); + xIR->registerImplementation( OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), + OUString::createFromAscii( "ucpfile1.dll" ), + Reference< XSimpleRegistry >() ); + xIR->registerImplementation( OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ), + OUString::createFromAscii( "fileacc.dll" ), + Reference< XSimpleRegistry >() ); + + // Create unconfigured Ucb: + Sequence< Any > aArgs(1); + aArgs[0] <<= sal_False; + ucb::ContentBroker::initialize( xSMgr, aArgs ); + Reference< XContentProviderManager > xUcb = ucb::ContentBroker::get()->getContentProviderManagerInterface(); + /* + Reference< XContentProviderManager > xUcb( + xSMgr->createInstanceWithArguments( + OUString::createFromAscii( + "com.sun.star.ucb.UniversalContentBroker" ), + aArgs ), + UNO_QUERY ); + */ + // Configure Ucb (use only file content provider): + Sequence< ContentProviderServiceInfo2 > aProviders(1); + aProviders[0].Service + = OUString::createFromAscii( + "com.sun.star.ucb.FileContentProvider"); + aProviders[0].Scheme = OUString::createFromAscii("file"); + aProviders[0].ReplaceExisting = false; + ucb::registerAtUcb(xUcb, xSMgr, aProviders, &rRegisteredProviders); + return xUcb; +} +#endif + +void BasicApp::Main( ) +{ +#ifdef _USE_UNO + std::vector< ucb::ContentProviderRegistrationInfo > aRegisteredProviders; + Reference< XContentProviderManager > xUcb = InitializeUCB( aRegisteredProviders ); +#endif + { + LanguageType aRequestedLanguage; + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + + // 1033 = LANGUAGE_ENGLISH_US + // 1031 = LANGUAGE_GERMAN + aConf.SetGroup("Misc"); + ByteString aLang = aConf.ReadKey( "Language", ByteString::CreateFromInt32( LANGUAGE_SYSTEM ) ); + aRequestedLanguage = LanguageType( aLang.ToInt32() ); + + AllSettings aSettings = GetSettings(); + International aInternational; + aInternational = GetSettings().GetInternational(); + aInternational = International( aRequestedLanguage ); + aSettings.SetInternational( aInternational ); + SetSettings( aSettings ); + aInternational = GetSettings().GetInternational(); + } + + +// ResMgr::CreateResMgr( CREATEVERSIONRESMGR( stt ), ) +//const char* ResMgr::GetLang( LanguageType& nType, USHORT nPrio ) + + Resource::SetResManager( CREATEVERSIONRESMGR( stt ) ); +// ResMgr::CreateResMgr( CREATEVERSIONRESMGR( stt ) +// ResMgr *pRes = new ResMgr( "testtool.res" ); +// Resource::SetResManager( pRes ); + + BasicDLL aBasicDLL; + nWait = 0; + + // Hilfe: +// pHelp = new Help; +// SetHelp( pHelp ); +// Help::EnableContextHelp(); +// Help::EnableExtHelp(); +// DeactivateExtHelp(); + + // Acceleratoren + Accelerator aAccel( ResId( MAIN_ACCEL ) ); + InsertAccel( &aAccel ); + pMainAccel = &aAccel; + + // Frame Window: + pFrame = new BasicFrame; + aAccel.SetSelectHdl( LINK( pFrame, BasicFrame, Accel ) ); + + pFrame->Show(); + + GetpApp()->PostUserEvent( LINK( this, BasicApp, LateInit ) ); + Execute(); + + // Loeschen der Members: +// delete pHelp; + delete pFrame; + + RemoveAccel( pMainAccel ); +#ifdef _USE_UNO + ucb::deregisterFromUcb(xUcb, aRegisteredProviders); +#endif +} + +void BasicApp::LoadIniFile() +{ + pFrame->LoadIniFile(); +} + +void BasicApp::SetFocus() +{ + if( pFrame->pWork && pFrame->pWork->ISA(AppEdit) ) + ((AppEdit*)pFrame->pWork)->pDataEdit->GrabFocus(); +} + +IMPL_LINK( BasicApp, LateInit, void *, pDummy ) +{ + BOOL bFileLoaded = FALSE; + for ( int i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) + { + if ( Application::GetCommandLineParam( i ).Copy(0,1).CompareToAscii("-") != COMPARE_EQUAL ) + { + pFrame->LoadFile( Application::GetCommandLineParam( i ) ); + bFileLoaded = TRUE; + } + else + { + if ( Application::GetCommandLineParam( i ).Copy(0,4).CompareIgnoreCaseToAscii("-run") == COMPARE_EQUAL ) + pFrame->SetAutoRun( TRUE ); + } + } + + if ( !bFileLoaded ) + { + AppWin *pWin = new AppBasEd( pFrame, NULL ); + pWin->Show(); + } + + pFrame->pStatus->SetStatusSize( pFrame->pStatus->GetStatusSize()+1 ); + pFrame->pStatus->SetStatusSize( pFrame->pStatus->GetStatusSize()-1 ); + + if ( pFrame->IsAutoRun() ) + { + pFrame->Command( RID_RUNSTART ); + } + + if ( pFrame->IsAutoRun() ) + pFrame->Command( RID_QUIT ); + + return 0; +} + +////////////////////////////////////////////////////////////////////////// + +class FloatingExecutionStatus : public FloatingWindow +{ +public: + FloatingExecutionStatus( Window * pParent ); + void SetStatus( String aW ); + void SetAdditionalInfo( String aF ); + +private: + Timer aAusblend; + DECL_LINK(HideNow, FloatingExecutionStatus* ); + FixedText aStatus; + FixedText aAdditionalInfo; +}; + + +FloatingExecutionStatus::FloatingExecutionStatus( Window * pParent ) + : FloatingWindow( pParent, ResId(LOAD_CONF) ), + aStatus( this, ResId( WORK ) ), + aAdditionalInfo( this, ResId( FILENAME ) ) +{ + FreeResource(); + aAusblend.SetTimeoutHdl( LINK(this, FloatingExecutionStatus, HideNow ) ); + aAusblend.SetTimeout(5000); // in ms + aAusblend.Start(); +} + +void FloatingExecutionStatus::SetStatus( String aW ) +{ + Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + ToTop( TOTOP_NOGRABFOCUS ); + aAusblend.Start(); + aStatus.SetText( aW ); +} + +void FloatingExecutionStatus::SetAdditionalInfo( String aF ) +{ + Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + ToTop( TOTOP_NOGRABFOCUS ); + aAusblend.Start(); + aAdditionalInfo.SetText( aF ); +} + +IMPL_LINK(FloatingExecutionStatus, HideNow, FloatingExecutionStatus*, pFLC ) +{ + Hide(); + return 0; +} + +////////////////////////////////////////////////////////////////////////// + +TYPEINIT1(TTExecutionStatusHint, SfxSimpleHint); + +BasicFrame::BasicFrame() : WorkWindow( NULL, + WinBits( WB_APP | WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ) +, bIsAutoRun ( FALSE ) +, pDisplayHidDlg( NULL ) +, pBasic( NULL ) +, pWork( NULL ) +, pExecutionStatus( NULL ) +{ + + pBasic = TTBasic::CreateMyBasic(); // depending on what was linked to the executable + bInBreak = FALSE; + bDisas = FALSE; + nFlags = 0; +// Icon aAppIcon; + + if ( pBasic->pTestObject ) // also sid wir testtool + { +// aAppIcon = Icon( ResId( RID_APPICON2 ) ); + aAppName = String( ResId( IDS_APPNAME2 ) ); + } + else + { +// aAppIcon = Icon( ResId( RID_APPICON ) ); + aAppName = String( ResId( IDS_APPNAME ) ); + } + + // Menu: + MenuBar *pBar = new MenuBar( ResId( RID_APPMENUBAR ) ); + SetMenuBar( pBar ); + + pBar->SetHighlightHdl( LINK( this, BasicFrame, HighlightMenu ) ); + + + // Menu Handler: + PopupMenu* pFileMenu = pBar->GetPopupMenu( RID_APPFILE ); + pFileMenu->SetSelectHdl( LINK( this, BasicFrame, MenuCommand ) ); + pFileMenu->SetHighlightHdl( LINK( this, BasicFrame, HighlightMenu ) ); + pFileMenu->SetActivateHdl( LINK( this, BasicFrame, InitMenu ) ); + pFileMenu->SetDeactivateHdl( LINK( this, BasicFrame, DeInitMenu ) ); + if (Basic().pTestObject ) // Wir sind also TestTool + { + pFileMenu->RemoveItem( pFileMenu->GetItemPos( RID_FILELOADLIB ) -1 ); // Der Trenner davor + pFileMenu->RemoveItem( pFileMenu->GetItemPos( RID_FILELOADLIB ) ); + pFileMenu->RemoveItem( pFileMenu->GetItemPos( RID_FILESAVELIB ) ); + } + + PopupMenu* pEditMenu = pBar->GetPopupMenu( RID_APPEDIT ); + pEditMenu->SetSelectHdl( LINK( this, BasicFrame, MenuCommand ) ); + pEditMenu->SetHighlightHdl( LINK( this, BasicFrame, HighlightMenu ) ); + pEditMenu->SetActivateHdl( LINK( this, BasicFrame, InitMenu ) ); + pEditMenu->SetDeactivateHdl( LINK( this, BasicFrame, DeInitMenu ) ); + PopupMenu* pRunMenu = pBar->GetPopupMenu( RID_APPRUN ); + pRunMenu->SetSelectHdl( LINK( this, BasicFrame, MenuCommand ) ); + pRunMenu->SetHighlightHdl( LINK( this, BasicFrame, HighlightMenu ) ); + pRunMenu->SetActivateHdl( LINK( this, BasicFrame, InitMenu ) ); + pRunMenu->SetDeactivateHdl( LINK( this, BasicFrame, DeInitMenu ) ); + if (Basic().pTestObject ) // Wir sind also TestTool + { + pRunMenu->RemoveItem( pRunMenu->GetItemPos( RID_RUNDISAS ) ); + } + + PopupMenu *pExtras; + if (Basic().pTestObject ) // Wir sind also TestTool + { + pExtras = new PopupMenu( ResId( RID_TT_EXTRAS ) ); + pBar->InsertItem( RID_TT_EXTRAS, String( ResId( RID_TT_EXTRAS_NAME ) ), 0, pBar->GetItemPos( RID_APPWINDOW ) ); + pBar->SetPopupMenu( RID_TT_EXTRAS, pExtras ); + + pExtras->SetSelectHdl( LINK( this, BasicFrame, MenuCommand ) ); + pExtras->SetHighlightHdl( LINK( this, BasicFrame, HighlightMenu ) ); + pExtras->SetDeactivateHdl( LINK( this, BasicFrame, DeInitMenu ) ); + } + + PopupMenu* pWinMenu = pBar->GetPopupMenu( RID_APPWINDOW ); + pWinMenu->SetSelectHdl( LINK( this, BasicFrame, MenuCommand ) ); + pWinMenu->SetHighlightHdl( LINK( this, BasicFrame, HighlightMenu ) ); + pWinMenu->SetDeactivateHdl( LINK( this, BasicFrame, DeInitMenu ) ); + PopupMenu* pHelpMenu = pBar->GetPopupMenu( RID_APPHELP ); + pHelpMenu->SetSelectHdl( LINK( this, BasicFrame, MenuCommand ) ); + pHelpMenu->SetHighlightHdl( LINK( this, BasicFrame, HighlightMenu ) ); + pHelpMenu->SetActivateHdl( LINK( this, BasicFrame, InitMenu ) ); + pHelpMenu->SetDeactivateHdl( LINK( this, BasicFrame, DeInitMenu ) ); + + LoadLRU(); + + LoadIniFile(); + +#ifndef UNX + pPrn = new BasicPrinter; +#else + pPrn = NULL; +#endif + pList = new EditList; + pStatus = new StatusLine( this ); + + UpdateTitle(); +// SetIcon( aAppIcon ); + + // Groesse: halbe Breite, dreiviertel Hoehe minus 2 * IconSize + { + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup("WinGeom"); + SetWindowState( aConf.ReadKey("WinParams", "") ); + } + +// pWork = new AppEdit( this, NULL ); +// pWork->Show(); +// pWork->Close(); + + aLineNum.SetTimeoutHdl( LINK( this, BasicFrame, ShowLineNr ) ); + aLineNum.SetTimeout(200); + aLineNum.Start(); + + + aCheckFiles.SetTimeout( 10000 ); + aCheckFiles.SetTimeoutHdl( LINK( this, BasicFrame, CheckAllFiles ) ); + aCheckFiles.Start(); + + GetMenuBar()->SetCloserHdl( LINK( this, BasicFrame, CloseButtonClick ) ); + GetMenuBar()->SetFloatButtonClickHdl( LINK( this, BasicFrame, FloatButtonClick ) ); + GetMenuBar()->SetHideButtonClickHdl( LINK( this, BasicFrame, HideButtonClick ) ); +} + +void BasicFrame::LoadIniFile() +{ + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup("Misc"); + + ByteString aTemp = aConf.ReadKey( "AutoReload", "0" ); + bAutoReload = ( aTemp.CompareTo("1") == COMPARE_EQUAL ); + + if ( pBasic ) + pBasic->LoadIniFile(); +} + +BasicFrame::~BasicFrame() +{ + AppWin* p = pList->First(); + if( p ) while( (p = pList->Remove() ) != NULL ) delete p; + delete pStatus; + delete pPrn; + delete pList; +// delete pExecutionStatus; +// delete pBasic; + pBasic.Clear(); // Da jetzt REF +} + +void BasicFrame::UpdateTitle() +{ + String aTitle; + aTitle += aAppName; + if ( aAppMode.Len() ) + { + aTitle.AppendAscii(" ["); + aTitle += aAppMode; + aTitle.AppendAscii("]"); + } + aTitle.AppendAscii(" - "); + aTitle += aAppFile; + SetText( aTitle ); +} + +IMPL_LINK( BasicFrame, CheckAllFiles, Timer*, pTimer ) +{ + if ( pWork ) + { + AppWin* pStartWin = pWork; + Window* pFocusWin = Application::GetFocusWindow(); + for ( int i = pList->Count()-1 ; i >= 0 ; i-- ) + pList->GetObject( i )->CheckReload(); + + if ( pWork != pStartWin ) + { + pWork = pStartWin; + pWork->ToTop(); + } + if ( pFocusWin ) + pFocusWin->GrabFocus(); + } + pTimer->Start(); + return 0; +} + +BOOL BasicFrame::IsAutoRun() +{ + return bIsAutoRun; +} + +void BasicFrame::SetAutoRun( BOOL bAuto ) +{ + bIsAutoRun = bAuto; +} + +void BasicFrame::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, + const SfxHint& rHint, const TypeId& ) +{ + if ( rHint.ISA( TTExecutionStatusHint ) ) + { + TTExecutionStatusHint *pStatusHint = ( TTExecutionStatusHint* )&rHint; + switch ( pStatusHint->GetType() ) + { + case TT_EXECUTION_ENTERWAIT: + { + EnterWait(); + } + break; + case TT_EXECUTION_LEAVEWAIT: + { + LeaveWait(); + } + break; + case TT_EXECUTION_SHOW_ACTION: + { + if ( !pExecutionStatus ) + pExecutionStatus = new FloatingExecutionStatus( this ); + pExecutionStatus->SetStatus( pStatusHint->GetExecutionStatus() ); + pExecutionStatus->SetAdditionalInfo( pStatusHint->GetAdditionalExecutionStatus() ); + } + break; + } + } + + + Broadcast( rHint ); +} + +void BasicFrame::Resize() +{ + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup("WinGeom"); + aConf.WriteKey("WinParams",GetWindowState()); + + // Statusbar + Size aOutSize = GetOutputSizePixel(); + Size aStatusSize = pStatus->GetSizePixel(); + Point aStatusPos( 0, aOutSize.Height() - aStatusSize.Height() ); + aStatusSize.Width() = aOutSize.Width(); + + pStatus->SetPosPixel( aStatusPos ); + pStatus->SetSizePixel( aStatusSize ); + + + // Eventuell Maximized window resizen + ULONG i; + for( i = pList->Count(); i > 0 ; i-- ) + { + if ( pList->GetObject( i-1 )->GetWinState() == TT_WIN_STATE_MAX ) + pList->GetObject( i-1 )->Maximize(); // resized auch + } +} + +void BasicFrame::Move() +{ + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup("WinGeom"); + aConf.WriteKey("WinParams",GetWindowState()); +} + +IMPL_LINK( BasicFrame, CloseButtonClick, void*, EMPTYARG ) +{ + AppWin* p; + for ( p = pList->Last() ; p && p->GetWinState() != TT_WIN_STATE_MAX ; p = pList->Prev() ) + {}; + if ( p ) + p->GrabFocus(); + return Command( RID_FILECLOSE, FALSE ); +} + +IMPL_LINK( BasicFrame, FloatButtonClick, void*, EMPTYARG ) +{ + AppWin* p; + for ( p = pList->Last() ; p && p->GetWinState() != TT_WIN_STATE_MAX ; p = pList->Prev() ) + {}; + if ( p ) + p->TitleButtonClick( TITLE_BUTTON_DOCKING ); + return 1; +} + +IMPL_LINK( BasicFrame, HideButtonClick, void*, EMPTYARG ) +{ + AppWin* p; + for ( p = pList->Last() ; p && p->GetWinState() != TT_WIN_STATE_MAX ; p = pList->Prev() ) + {}; + if ( p ) + p->TitleButtonClick( TITLE_BUTTON_HIDE ); + return 1; +} + +void BasicFrame::WinShow_Hide() +{ + if ( !pList->Count() ) + return; + + AppWin* p; + BOOL bWasFullscreen = FALSE; + for ( p = pList->Last() ; p ; p = pList->Prev() ) + { + if ( p->pDataEdit ) + { + if ( p->GetWinState() & TT_WIN_STATE_HIDE // Versteckt + || ( bWasFullscreen + && ( !p->IsPined() || p->GetWinState() & TT_WIN_STATE_MAX ) + ) + ) + p->Hide( SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + else + p->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + } + bWasFullscreen |= p->GetWinState() == TT_WIN_STATE_MAX; + } +} + +void BasicFrame::WinMax_Restore() +{ + // Die ApplicationButtons + AppWin* p; + BOOL bHasFullscreenWin = FALSE; + for( p = pList->First(); p && !bHasFullscreenWin ; p = pList->Next() ) + bHasFullscreenWin |= ( p->GetWinState() == TT_WIN_STATE_MAX ); + GetMenuBar()->ShowButtons( bHasFullscreenWin, bHasFullscreenWin, bHasFullscreenWin ); + WinShow_Hide(); +} + +void BasicFrame::RemoveWindow( AppWin *pWin ) +{ +// delete pIcon; + pList->Remove( pWin ); + pWork = pList->Last(); + + WinShow_Hide(); + + if ( pWork ) + pWork->ToTop(); + + WinMax_Restore(); + + Menu* pMenu = GetMenuBar(); + if( pList->Count() == 0 ) { + pMenu->EnableItem( RID_APPEDIT, FALSE ); + pMenu->EnableItem( RID_APPRUN, FALSE ); + pMenu->EnableItem( RID_APPWINDOW, FALSE ); + } + + PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); + + pWinMenu->RemoveItem( pWinMenu->GetItemPos( pWin->GetWinId() ) ); + + // Trenner entfernen + if ( pWinMenu->GetItemType( pWinMenu->GetItemCount() - 1 ) == MENUITEM_SEPARATOR ) + pWinMenu->RemoveItem( pWinMenu->GetItemCount() - 1 ); + + pStatus->LoadTaskToolBox(); +} + +void BasicFrame::AddWindow( AppWin *pWin ) +{ + // Eintragen: + pList->Insert( pWin, LIST_APPEND ); + pWork = pWin; + + WinMax_Restore(); + + // Hauptmenue aktivieren: + MenuBar* pMenu = GetMenuBar(); + if( pList->Count() > 0 ) { + pMenu->EnableItem( RID_APPEDIT, TRUE ); + pMenu->EnableItem( RID_APPRUN, TRUE ); + pMenu->EnableItem( RID_APPWINDOW, TRUE ); + } + + PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); + USHORT nLastID = pWinMenu->GetItemId( pWinMenu->GetItemCount() - 1 ); + + // Trenner erforderlich + if ( nLastID < RID_WIN_FILE1 && pWinMenu->GetItemType( pWinMenu->GetItemCount() - 1 ) != MENUITEM_SEPARATOR ) + pWinMenu->InsertSeparator(); + + // Freie ID finden + USHORT nFreeID = RID_WIN_FILE1; + while ( pWinMenu->GetItemPos( nFreeID ) != MENU_ITEM_NOTFOUND && nFreeID < RID_WIN_FILEn ) + nFreeID++; + + pWin->SetWinId( nFreeID ); + pWinMenu->InsertItem( nFreeID, pWin->GetText() ); +} + +void BasicFrame::WindowRenamed( AppWin *pWin ) +{ + MenuBar* pMenu = GetMenuBar(); + PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); + + pWinMenu->SetItemText( pWin->GetWinId(), pWin->GetText() ); + + pStatus->LoadTaskToolBox(); + + aAppFile = pWin->GetText(); + UpdateTitle(); +} + +void BasicFrame::FocusWindow( AppWin *pWin ) +{ + pWork = pWin; + pList->Remove( pWin ); + pList->Insert( pWin, LIST_APPEND ); + pWin->Minimize( FALSE ); + + aAppFile = pWin->GetText(); + UpdateTitle(); + + WinShow_Hide(); + pStatus->LoadTaskToolBox(); +} + +BOOL BasicFrame::Close() +{ + if( bInBreak || Basic().IsRunning() ) + if( RET_NO == QueryBox( this, ResId( IDS_RUNNING ) ).Execute() ) + return FALSE; + + StarBASIC::Stop(); + bInBreak = FALSE; + if( CloseAll() ) + { + aLineNum.Stop(); + + // Alle brigen Dialoge schliessen um assertions zu vermeiden!! + while ( GetWindow( WINDOW_OVERLAP )->GetWindow( WINDOW_FIRSTOVERLAP ) ) + { + delete GetWindow( WINDOW_OVERLAP )->GetWindow( WINDOW_FIRSTOVERLAP )->GetWindow( WINDOW_CLIENT ); + } + + WorkWindow::Close(); + + return TRUE; + } else return FALSE; +} + +BOOL BasicFrame::CloseAll() +{ + while ( pList->Count() ) + if ( !pList->Last()->Close() ) + return FALSE; + return TRUE; +} + +BOOL BasicFrame::CompileAll() +{ + AppWin* p; + for( p = pList->First(); p; p = pList->Next() ) + if( p->ISA(AppBasEd) && !((AppBasEd*)p)->Compile() ) return FALSE; + return TRUE; +} + +// Menu aufsetzen + +#define MENU2FILENAME Copy(3) +#define FILENAME2MENU( Nr, Name ) CUniString("~").Append( UniString::CreateFromInt32(i) ).AppendAscii(" ").Append( Name ) +#define LRUNr( nNr ) CByteString("LRU").Append( ByteString::CreateFromInt32(nNr) ) +void BasicFrame::AddToLRU(String const& aFile) +{ + Config aConfig(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + PopupMenu *pPopup = GetMenuBar()->GetPopupMenu(RID_APPFILE); + + aConfig.SetGroup("LRU"); + DirEntry aFileEntry( aFile ); + USHORT i,nLastMove = 4; + + for ( i = 1 ; i<4 && nLastMove == 4 ; i++ ) + { + if ( DirEntry( UniString( aConfig.ReadKey(LRUNr(i),""), RTL_TEXTENCODING_UTF8 ) ) == aFileEntry ) + nLastMove = i; + } + + for ( i = nLastMove ; i>1 ; i-- ) + { + aConfig.WriteKey(LRUNr(i), aConfig.ReadKey(LRUNr(i-1),"")); + pPopup->SetItemText(IDM_FILE_LRU1 + i-1,FILENAME2MENU( i, pPopup->GetItemText(IDM_FILE_LRU1 + i-1-1).MENU2FILENAME )); + } + aConfig.WriteKey(LRUNr(1), ByteString( aFile, RTL_TEXTENCODING_UTF8 ) ); + pPopup->SetItemText(IDM_FILE_LRU1,FILENAME2MENU( 1, aFile) ); +} + +void BasicFrame::LoadLRU() +{ + Config aConfig(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + PopupMenu *pPopup = GetMenuBar()->GetPopupMenu(RID_APPFILE); + BOOL bAddSep = TRUE; + + aConfig.SetGroup("LRU"); + + for (int i=1; i<=4 && pPopup!=NULL; i++) + { + String aFile = UniString( aConfig.ReadKey(LRUNr(i)), RTL_TEXTENCODING_UTF8 ); + + if (aFile.Len() != 0) + { + if (bAddSep) + { + pPopup->InsertSeparator(); + bAddSep = FALSE; + } + + pPopup->InsertItem(IDM_FILE_LRU1 + i-1, FILENAME2MENU( i, aFile )); + } + } +} + +IMPL_LINK( BasicFrame, InitMenu, Menu *, pMenu ) +{ + BOOL bNormal = BOOL( !bInBreak ); + pMenu->EnableItem( RID_RUNCOMPILE, bNormal ); + + BOOL bHasEdit = BOOL( /*bNormal &&*/ pWork != NULL ); + +// pMenu->EnableItem( RID_FILENEW, bNormal ); // immer mglich +// pMenu->EnableItem( RID_FILEOPEN, bNormal ); + pMenu->EnableItem( RID_FILECLOSE, bHasEdit ); + pMenu->EnableItem( RID_FILESAVE, bHasEdit ); + pMenu->EnableItem( RID_FILESAVEAS, bHasEdit ); + pMenu->EnableItem( RID_FILEPRINT, bHasEdit ); + pMenu->EnableItem( RID_FILESETUP, bHasEdit ); + pMenu->EnableItem( RID_FILELOADLIB, bNormal ); + pMenu->EnableItem( RID_FILESAVELIB, bHasEdit ); + + BOOL bHasErr = BOOL( bNormal && pBasic->GetErrors() != 0 ); + BOOL bNext = bHasErr & bNormal; + BOOL bPrev = bHasErr & bNormal; + if( bHasErr ) { + short n = (short) pBasic->aErrors.GetCurPos(); + if( n == 0 ) bPrev = FALSE; + if( n ==( pBasic->GetErrors() - 1 ) ) bNext = FALSE; + } + pMenu->EnableItem( RID_RUNNEXTERR, bNext ); + pMenu->EnableItem( RID_RUNPREVERR, bPrev ); + pMenu->CheckItem( RID_RUNDISAS, bDisas ); + if( pWork ) pWork->InitMenu( pMenu ); + + return TRUE; +} + +IMPL_LINK_INLINE_START( BasicFrame, DeInitMenu, Menu *, pMenu ) +{ + pMenu->EnableItem( RID_RUNCOMPILE ); + + pMenu->EnableItem( RID_FILECLOSE ); + pMenu->EnableItem( RID_FILESAVE ); + pMenu->EnableItem( RID_FILESAVEAS ); + pMenu->EnableItem( RID_FILEPRINT ); + pMenu->EnableItem( RID_FILESETUP ); + pMenu->EnableItem( RID_FILELOADLIB ); + pMenu->EnableItem( RID_FILESAVELIB ); + + pMenu->EnableItem( RID_RUNNEXTERR ); + pMenu->EnableItem( RID_RUNPREVERR ); + if( pWork ) pWork->DeInitMenu( pMenu ); + + + SetAutoRun( FALSE ); + String aString; + pStatus->Message( aString ); + return 0L; +} +IMPL_LINK_INLINE_END( BasicFrame, DeInitMenu, Menu *, pMenu ) + +IMPL_LINK_INLINE_START( BasicFrame, HighlightMenu, Menu *, pMenu ) +{ + String s = pMenu->GetHelpText( pMenu->GetCurItemId() ); + pStatus->Message( s ); + return 0L; +} +IMPL_LINK_INLINE_END( BasicFrame, HighlightMenu, Menu *, pMenu ) + +IMPL_LINK_INLINE_START( BasicFrame, MenuCommand, Menu *, pMenu ) +{ + USHORT nId = pMenu->GetCurItemId(); + BOOL bChecked = pMenu->IsItemChecked( nId ); + return Command( nId, bChecked ); +} +IMPL_LINK_INLINE_END( BasicFrame, MenuCommand, Menu *, pMenu ) + +IMPL_LINK_INLINE_START( BasicFrame, Accel, Accelerator*, pAcc ) +{ + SetAutoRun( FALSE ); + return Command( pAcc->GetCurItemId() ); +} +IMPL_LINK_INLINE_END( BasicFrame, Accel, Accelerator*, pAcc ) + +IMPL_LINK_INLINE_START( BasicFrame, ShowLineNr, AutoTimer *, pTimer ) +{ + String aPos; + if ( pWork ) + { + aPos = String::CreateFromInt32(pWork->GetLineNr()); + } + pStatus->Pos( aPos ); + return 0L; +} +IMPL_LINK_INLINE_END( BasicFrame, ShowLineNr, AutoTimer *, pTimer ) + + +MsgEdit* BasicFrame::GetMsgTree( String aLogFileName ) +{ + if ( FindErrorWin( aLogFileName ) ) + { + return FindErrorWin( aLogFileName )->GetMsgTree(); + } + else + { // create new Window on the fly + AppError *pNewWindow = new AppError( this, aLogFileName ); + pNewWindow->Show(); + pNewWindow->GrabFocus(); + return pNewWindow->GetMsgTree(); + } +} + +IMPL_LINK( BasicFrame, Log, TTLogMsg *, pLogMsg ) +{ + GetMsgTree( pLogMsg->aLogFileName )->AddAnyMsg( pLogMsg ); + return 0L; +} + +IMPL_LINK( BasicFrame, WinInfo, WinInfoRec*, pWinInfo ) +{ + if ( !pDisplayHidDlg ) + pDisplayHidDlg = new DisplayHidDlg( this ); + if ( pDisplayHidDlg ) + { + pDisplayHidDlg->AddData( pWinInfo ); + pDisplayHidDlg->Show(); + } + return 0; +} + +BOOL BasicFrame::LoadFile( String aFilename ) +{ + BOOL bIsResult = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("RES") == COMPARE_EQUAL; + BOOL bIsBasic = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("BAS") == COMPARE_EQUAL; + bIsBasic |= DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("INC") == COMPARE_EQUAL; + + AppWin* p; + if ( bIsResult ) + { + p = new AppError( this, aFilename ); + } + else if ( bIsBasic ) + { + p = new AppBasEd( this, NULL ); + p->Load( aFilename ); + } + else + { + p = new AppEdit( this ); + p->Load( aFilename ); + } + p->Show(); + p->GrabFocus(); + return TRUE; +} + +// Kommando ausfuehren + +long BasicFrame::Command( short nID, BOOL bChecked ) +{ + BasicError* pErr; + + switch( nID ) { + case RID_FILENEW: { + AppBasEd* p = new AppBasEd( this, NULL ); + p->Show(); + p->GrabFocus(); + // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); + } break; + case RID_FILEOPEN: + { + String s; + if( QueryFileName( s, FT_BASIC_SOURCE | FT_RESULT_FILE, FALSE ) ) { + AddToLRU( s ); + LoadFile( s ); +// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); + } + } break; + case RID_FILELOADLIB: + LoadLibrary(); + break; + case RID_FILESAVELIB: + SaveLibrary(); + break; + case RID_FILECLOSE: + if( pWork && pWork->Close() ){}; +// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); + break; + case RID_FILEPRINT: +#ifndef UNX + if( pWork ) + pPrn->Print( pWork->GetText(), pWork->pDataEdit->GetText(), this ); +#else + InfoBox( this, ResId( IDS_NOPRINTERERROR ) ).Execute(); +#endif + break; + case RID_FILESETUP: +#ifndef UNX + pPrn->Setup(); +#else + InfoBox( this, ResId( IDS_NOPRINTERERROR ) ).Execute(); +#endif + break; + case RID_QUIT: + if( Close() ) aBasicApp.Quit(); + break; + case IDM_FILE_LRU1: + case IDM_FILE_LRU2: + case IDM_FILE_LRU3: + case IDM_FILE_LRU4: + { + String s = GetMenuBar()->GetPopupMenu(RID_APPFILE)->GetItemText(nID).MENU2FILENAME; + + AddToLRU( s ); + LoadFile( s ); +// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); + } + break; + + + case RID_RUNSTART: + nFlags = SbDEBUG_BREAK; + goto start; + case RID_RUNSTEPOVER: + nFlags = SbDEBUG_STEPINTO | SbDEBUG_STEPOVER; + goto start; + case RID_RUNSTEPINTO: + nFlags = SbDEBUG_STEPINTO; + goto start; + case RID_RUNTOCURSOR: + if ( pWork && pWork->ISA(AppBasEd) && ((AppBasEd*)pWork)->GetModule()->SetBP(pWork->GetLineNr()) ) + { + SbModule *pModule = ((AppBasEd*)pWork)->GetModule(); +#ifdef DEBUG + USHORT x; + x = pWork->GetLineNr(); + x = ((AppBasEd*)pWork)->GetModule()->GetBPCount(); + if ( !x ) + x = pModule->SetBP(pWork->GetLineNr()); + x = pModule->GetBPCount(); +#endif + + for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + { + SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); + DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); + pMethod->SetDebugFlags( pMethod->GetDebugFlags() | SbDEBUG_BREAK ); + } + } + nFlags = SbDEBUG_BREAK; + goto start; + start: { +// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); + if ( !Basic().IsRunning() || bInBreak ) + { + AppBasEd* p = NULL; + if( pWork && pWork->ISA(AppBasEd) ) + { + p = ((AppBasEd*)pWork); + p->ToTop(); + } + else + SetAutoRun( FALSE ); // Wenn kein Programm geladen wurde, dann auch nicht beenden + + if( bInBreak ) + // Nur das Flag zuruecksetzen + bInBreak = FALSE; + else + { + if( !SaveAll() ) break; + if( !CompileAll() ) break; + String aString; + pStatus->Message( aString ); + if( p ) + { + BasicDLL::SetDebugMode( TRUE ); + Basic().ClearGlobalVars(); + p->Run(); + BasicDLL::SetDebugMode( FALSE ); + // Falls waehrend Interactive=FALSE abgebrochen +// BasicDLL::EnableBreak( TRUE ); + } + }} + } +// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); // nach run + break; + case RID_RUNCOMPILE: + if( pWork && pWork->ISA(AppBasEd) && SaveAll() ) + { + ((AppBasEd*)pWork)->Compile(); + pWork->ToTop(); + pWork->GrabFocus(); + } + break; + case RID_RUNDISAS: + bDisas = BOOL( !bChecked ); + break; + case RID_RUNBREAK: + if ( Basic().IsRunning() && !bInBreak ) + { +// pINST->CalcBreakCallLevel(SbDEBUG_STEPINTO); + pINST->nBreakCallLvl = pINST->nCallLvl; + } + break; + case RID_RUNSTOP: + Basic().Stop(); + bInBreak = FALSE; + break; + case RID_RUNNEXTERR: + pErr = pBasic->aErrors.Next(); + if( pErr ) pErr->Show(); + break; + case RID_RUNPREVERR: + pErr = pBasic->aErrors.Prev(); + if( pErr ) pErr->Show(); + break; + + case RID_OPTIONS: + { + new OptionsDialog( this, ResId(IDD_OPTIONS_DLG) ); + } + break; + case RID_DECLARE_HELPER: + InfoBox( this, ResId( IDS_NOT_YET_IMPLEMENTED ) ).Execute(); + break; + + case RID_WINTILE: + { + WindowArrange aArange; + for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + { + aArange.AddWindow( pList->GetObject( i ) ); + pList->GetObject( i )->Restore(); + } + + + long nTitleHeight; + { + long nDummy1, nDummy2, nDummy3; + GetBorder( nDummy1, nTitleHeight, nDummy2, nDummy3 ); + } + + Size aSize = GetOutputSizePixel(); + aSize.Height() -= nTitleHeight; + Rectangle aRect( Point( 0, nTitleHeight ), aSize ); + + aArange.Arrange( WINDOWARRANGE_TILE, aRect ); + + } + break; + case RID_WINTILEHORZ: + { + WindowArrange aArange; + for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + { + aArange.AddWindow( pList->GetObject( i ) ); + pList->GetObject( i )->Restore(); + } + + + long nTitleHeight; + { + long nDummy1, nDummy2, nDummy3; + GetBorder( nDummy1, nTitleHeight, nDummy2, nDummy3 ); + } + + Size aSize = GetOutputSizePixel(); + aSize.Height() -= nTitleHeight; + Rectangle aRect( Point( 0, nTitleHeight ), aSize ); + + aArange.Arrange( WINDOWARRANGE_HORZ, aRect ); + + } + break; + case RID_WINTILEVERT: +//#define WINDOWARRANGE_TILE 1 +//#define WINDOWARRANGE_HORZ 2 +//#define WINDOWARRANGE_VERT 3 +//#define WINDOWARRANGE_CASCADE 4 + { + WindowArrange aArange; + for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + { + aArange.AddWindow( pList->GetObject( i ) ); + pList->GetObject( i )->Restore(); + } + + + long nTitleHeight; + { + long nDummy1, nDummy2, nDummy3; + GetBorder( nDummy1, nTitleHeight, nDummy2, nDummy3 ); + } + + Size aSize = GetOutputSizePixel(); + aSize.Height() -= nTitleHeight; + Rectangle aRect( Point( 0, nTitleHeight ), aSize ); + + aArange.Arrange( WINDOWARRANGE_VERT, aRect ); + + } + break; + case RID_WINCASCADE: + { + for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + { + pList->GetObject( i )->Cascade( i ); + } + } + break; + +/* case RID_HELPTOPIC: + if( pWork ) pWork->Help(); + break; + case RID_HELPKEYS: + aBasicApp.pHelp->Start( CUniString( "Keyboard" ) ); + break; + case RID_HELPINDEX: + aBasicApp.pHelp->Start( HELP_INDEX ); + break; + case RID_HELPINTRO: + aBasicApp.pHelp->Start( HELP_HELPONHELP ); + break; +*/ case RID_HELPABOUT: + { + ResId aResId( IDD_ABOUT_DIALOG ); + if ( Basic().pTestObject ) // Wir sind also TestTool + aResId = ResId( IDD_TT_ABOUT_DIALOG ); + else + aResId = ResId( IDD_ABOUT_DIALOG ); + AboutDialog( this, aResId ).Execute(); + } + break; + case RID_POPUPEDITVAR: + { + new VarEditDialog( this, pEditVar ); + } + break; + default: + if ( nID >= RID_WIN_FILE1 && nID <= RID_WIN_FILEn ) + { + MenuBar* pMenu = GetMenuBar(); + PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); + String aName = pWinMenu->GetItemText( nID ); + AppWin* pWin = FindWin( aName ); + if ( pWin ) + pWin->ToTop(); + } + else + { +// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPEDIT )); // So da Delete richtig ist + if( pWork ) + pWork->Command( CommandEvent( Point(), nID ) ); +// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPEDIT )); // So da Delete richtig ist + } + } + return TRUE; +} + +BOOL BasicFrame::SaveAll() +{ + AppWin* p, *q = pWork; + for( p = pList->First(); p; p = pList->Next() ) + { + USHORT nRes = p->QuerySave( QUERY_DISK_CHANGED ); + if( (( nRes == SAVE_RES_ERROR ) && QueryBox(this,ResId(IDS_ASKSAVEERROR)).Execute() == RET_NO ) + || ( nRes == SAVE_RES_CANCEL ) ) + return FALSE; + } + if ( q ) + q->ToTop(); + return TRUE; +} + +IMPL_LINK( BasicFrame, ModuleWinExists, String*, pFilename ) +{ + return FindModuleWin( *pFilename ) != NULL; +} + +AppBasEd* BasicFrame::FindModuleWin( const String& rName ) +{ + AppWin* p; + for( p = pList->First(); p; p = pList->Next() ) + { + if( p->ISA(AppBasEd) && ((AppBasEd*)p)->GetModName() == rName ) + return ((AppBasEd*)p); + } + return NULL; +} + +AppError* BasicFrame::FindErrorWin( const String& rName ) +{ + AppWin* p; + for( p = pList->First(); p; p = pList->Next() ) + { + if( p->ISA(AppError) && ((AppError*)p)->GetText() == rName ) + return ((AppError*)p); + } + return NULL; +} + +AppWin* BasicFrame::FindWin( const String& rName ) +{ + AppWin* p; + for( p = pList->First(); p; p = pList->Next() ) + { + if( p->GetText() == rName ) + return p; + } + return NULL; +} + +AppWin* BasicFrame::FindWin( USHORT nWinId ) +{ + AppWin* p; + for( p = pList->First(); p; p = pList->Next() ) + { + if( p->GetWinId() == nWinId ) + return p; + } + return NULL; +} + +class NewFileDialog : public FileDialog +{ +private: + String aLastPath; +public: + ByteString aPathName; + NewFileDialog( Window* pParent, WinBits nWinStyle ):FileDialog( pParent, nWinStyle ){}; + virtual short Execute(); + virtual void FilterSelect(); +}; + +void NewFileDialog::FilterSelect() +{ + String aTemp = GetPath(); + if ( aLastPath.Len() == 0 ) + aLastPath = DirEntry( GetPath() ).GetPath().GetFull(); + if ( aLastPath.CompareIgnoreCaseToAscii( DirEntry( GetPath() ).GetPath().GetFull() ) != COMPARE_EQUAL ) + return; // Der Benutzer entscheidet sich nachdem er den Pfad gendert hat. + + String aCurFilter = GetCurFilter(); + USHORT nFilterNr = 0; + while ( nFilterNr < GetFilterCount() && aCurFilter != GetFilterName( nFilterNr ) ) + { + nFilterNr++; + } + aPathName = ByteString( GetFilterType( nFilterNr ), RTL_TEXTENCODING_UTF8 ); + + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup( "Path" ); + aLastPath = UniString( aConf.ReadKey( aPathName, aConf.ReadKey( "Basisverzeichnis" ) ), RTL_TEXTENCODING_UTF8 ); + SetPath( aLastPath ); +// if ( IsInExecute() ) +// SetPath( "" ); +} + +short NewFileDialog::Execute() +{ + BOOL bRet = FileDialog::Execute(); + if ( bRet ) + { + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup( "Path" ); + aConf.WriteKey( aPathName, ByteString( DirEntry( GetPath() ).GetPath().GetFull(), RTL_TEXTENCODING_UTF8 ) ); + } + return bRet; +} + +BOOL BasicFrame::QueryFileName + (String& rName, FileType nFileType, BOOL bSave ) +{ + NewFileDialog aDlg( this, bSave ? WinBits( WB_SAVEAS ) : + WinBits( WB_OPEN ) ); + aDlg.SetText( String( ResId( bSave ? IDS_SAVEDLG : IDS_LOADDLG ) ) ); + + if ( nFileType & FT_RESULT_FILE ) + { + aDlg.SetDefaultExt( String( ResId( IDS_RESFILE ) ) ); + aDlg.AddFilter( String( ResId( IDS_RESFILTER ) ), String( ResId( IDS_RESFILE ) ) ); + aDlg.AddFilter( String( ResId( IDS_TXTFILTER ) ), String( ResId( IDS_TXTFILE ) ) ); + aDlg.SetCurFilter( ResId( IDS_RESFILTER ) ); + } + + if ( nFileType & FT_BASIC_SOURCE ) + { + aDlg.SetDefaultExt( String( ResId( IDS_NONAMEFILE ) ) ); + aDlg.AddFilter( String( ResId( IDS_BASFILTER ) ), String( ResId( IDS_NONAMEFILE ) ) ); + aDlg.AddFilter( String( ResId( IDS_INCFILTER ) ), String( ResId( IDS_INCFILE ) ) ); + aDlg.SetCurFilter( ResId( IDS_BASFILTER ) ); + } + + if ( nFileType & FT_BASIC_LIBRARY ) + { + aDlg.SetDefaultExt( String( ResId( IDS_LIBFILE ) ) ); + aDlg.AddFilter( String( ResId( IDS_LIBFILTER ) ), String( ResId( IDS_LIBFILE ) ) ); + aDlg.SetCurFilter( ResId( IDS_LIBFILTER ) ); + } + + + aDlg.FilterSelect(); // Setzt den Pfad vom letzten mal. +// if ( bSave ) + if ( rName.Len() > 0 ) + aDlg.SetPath( rName ); + + if( aDlg.Execute() ) + { + rName = aDlg.GetPath(); +/* rExtension = aDlg.GetCurrentFilter(); + var i:integer; + for ( i = 0 ; i < aDlg.GetFilterCount() ; i++ ) + if ( rExtension == aDlg.GetFilterName( i ) ) + rExtension = aDlg.GetFilterType( i ); +*/ + return TRUE; + } else return FALSE; +} + +USHORT BasicFrame::BreakHandler() +{ + bInBreak = TRUE; +// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); +// MenuBar aBar( ResId( RID_APPMENUBAR ) ); +// aBar.EnableItem( RID_APPEDIT, FALSE ); + SetAppMode( String( ResId ( IDS_APPMODE_BREAK ) ) ); + while( bInBreak ) +#if SUPD >= 357 + GetpApp()->Yield(); +#else + GetpApp()->Reschedule(); +#endif + SetAppMode( String( ResId ( IDS_APPMODE_RUN ) ) ); +// aBar.EnableItem( RID_APPEDIT, TRUE ); +// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); + return nFlags; +} + +void BasicFrame::LoadLibrary() +{ + String s; + if( QueryFileName( s, FT_BASIC_LIBRARY, FALSE ) ) + { + CloseAll(); + SvFileStream aStrm( s, STREAM_STD_READ ); + MyBasic* pNew = (MyBasic*) SbxBase::Load( aStrm ); + if( pNew && pNew->ISA( MyBasic ) ) + { + pBasic = pNew; + // Alle Inhalte - sofern vorhanden - anzeigen + SbxArray* pMods = pBasic->GetModules(); + for( USHORT i = 0; i < pMods->Count(); i++ ) + { + SbModule* pMod = (SbModule*) pMods->Get( i ); + AppWin* p = new AppBasEd( this, pMod ); + p->Show(); + } + } + else + { + delete pNew; + ErrorBox( this, ResId( IDS_READERROR ) ).Execute(); + } + } +} + +void BasicFrame::SaveLibrary() +{ + String s; + if( QueryFileName( s, FT_BASIC_LIBRARY, TRUE ) ) + { + SvFileStream aStrm( s, STREAM_STD_WRITE ); + if( !Basic().Store( aStrm ) ) + ErrorBox( this, ResId( IDS_WRITEERROR ) ).Execute(); + } +} + +String BasicFrame::GenRealString( const String &aResString ) +{ + xub_StrLen nStart,nGleich,nEnd,nStartPos = 0; + String aType,aValue,aResult(aResString); + String aString; + xub_StrLen nInsertPos; + BOOL bFound; + + while ( (nStart = aResult.Search(StartKenn,nStartPos)) != STRING_NOTFOUND && + (nGleich = aResult.SearchAscii("=",nStart+StartKenn.Len())) != STRING_NOTFOUND && + (nEnd = aResult.Search(EndKenn,nGleich+1)) != STRING_NOTFOUND) + { + aType = aResult.Copy(nStart,nGleich-nStart); + aValue = aResult.Copy(nGleich+1,nEnd-nGleich-1); + bFound = FALSE; + if ( aType.CompareTo(ResKenn) == COMPARE_EQUAL ) + { +// if ( Resource::GetResManager()->IsAvailable( ResId( aValue ) ) ) + aString = String( ResId( aValue.ToInt32() ) ); +// else + { +// DBG_ERROR( "Ressource konnte nicht geladen werden" ); +// return aResString; + } + nInsertPos = nStart; + nStartPos = nStart; + aResult.Erase( nStart, nEnd-nStart+1 ); + } + else if ( aType.Search(BaseArgKenn) == 0 ) // Fngt mit BaseArgKenn an + { + USHORT nArgNr = aType.Copy( BaseArgKenn.Len() ).ToInt32(); + DBG_ASSERT( aString.Search( CUniString("($Arg").Append( String::CreateFromInt32(nArgNr) ).AppendAscii(")") ) != STRING_NOTFOUND, "Extra Argument given in String"); + aString.SearchAndReplace( CUniString("($Arg").Append( String::CreateFromInt32(nArgNr) ).AppendAscii(")"), aValue ); + nStartPos = nStart; + aResult.Erase( nStart, nEnd-nStart+1 ); + } + else + { + DBG_ERROR( CByteString("Unknown replacement in String: ").Append( ByteString( aResult.Copy(nStart,nEnd-nStart), RTL_TEXTENCODING_UTF8 ) ).GetBuffer() ); + nStartPos += StartKenn.Len(); + } + } + DBG_ASSERT( aString.SearchAscii( "($Arg" ) == STRING_NOTFOUND, "Argument missing in String"); + aResult.Insert( aString, nInsertPos ); + return aResult; +} + + diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx new file mode 100644 index 000000000000..c65a6f126abd --- /dev/null +++ b/basic/source/app/app.hxx @@ -0,0 +1,228 @@ +/************************************************************************* + * + * $RCSfile: app.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _BASICAPP_HXX +#define _BASICAPP_HXX + +#ifndef _SV_SVAPP_HXX +#include <vcl/svapp.hxx> +#endif +#ifndef _HELP_HXX //autogen +#include <vcl/help.hxx> +#endif +#ifndef _MENU_HXX //autogen +#include <vcl/menu.hxx> +#endif +#ifndef _WRKWIN_HXX //autogen +#include <vcl/wrkwin.hxx> +#endif +#ifndef _TIMER_HXX //autogen +#include <vcl/timer.hxx> +#endif +#ifndef _SFXBRDCST_HXX +#include <svtools/brdcst.hxx> +#endif +#ifndef _SFXLSTNER_HXX +#include <svtools/lstner.hxx> +#endif + +class BasicFrame; +#include "mybasic.hxx" + +class EditList; +class AppWin; +class AppEdit; +class AppBasEd; +class MsgEdit; +class AppError; +class StatusLine; +class BasicPrinter; +struct TTLogMsg; + +class BasicApp : public Application { + short nWait; // Wait-Zaehler +public: +// Help* pHelp; // Hilfesystem + BasicFrame* pFrame; // Frame Window +// MenuBar* pMainMenu; // Hauptmenue + Accelerator* pMainAccel; // Acceleratoren + +#ifndef VCL + void Main( int, char*[] ); +#else + void Main( ); +#endif + + void LoadIniFile(); + void SetFocus(); + void Wait( BOOL ); + DECL_LINK( LateInit, void * ); +}; + + +typedef USHORT FileType; + +#define FT_NO_FILE (FileType)0x00 // Ein Fehler ist aufgetreten ... +#define FT_BASIC_SOURCE (FileType)0x01 +#define FT_BASIC_INCLUDE (FileType)0x02 +#define FT_RESULT_FILE (FileType)0x04 +#define FT_RESULT_FILE_TXT (FileType)0x08 +#define FT_BASIC_LIBRARY (FileType)0x10 + +struct WinInfoRec; +class DisplayHidDlg; + +class FloatingExecutionStatus; + +class BasicFrame : public WorkWindow, public SfxBroadcaster, public SfxListener +{ +virtual BOOL Close(); // Schliessen + BOOL CloseAll(); // Alle Fenster schliessen + BOOL CompileAll(); // Alle Texte compilieren + AutoTimer aLineNum; // Zeigt die Zeilennummer an +virtual void Resize(); +virtual void Move(); + void LoadLibrary(); + void SaveLibrary(); + BOOL bIsAutoRun; + DisplayHidDlg* pDisplayHidDlg; + +// BreakPoint *pRunToCursorBP; + + SbxVariable *pEditVar; + + + + Timer aCheckFiles; // Prfen der Dateien auf nderungen + BOOL bAutoReload; + DECL_LINK( CheckAllFiles, Timer* ); + + MyBasicRef pBasic; // BASIC-Engine + + String aAppName; // Inhalt der Titelteile der App: + String aAppFile; // AppName AppFile [AppMode] + String aAppMode; + void UpdateTitle(); + DECL_LINK( CloseButtonClick, void* ); + DECL_LINK( FloatButtonClick, void* ); + DECL_LINK( HideButtonClick, void* ); + + FloatingExecutionStatus *pExecutionStatus; + +public: + BOOL IsAutoRun(); + void SetAutoRun( BOOL bAuto ); + BOOL bInBreak; // TRUE, wenn im Break-Handler + StatusLine* pStatus; // Statuszeile + EditList* pList; // List der Edit-Fenster + AppWin* pWork; // aktuelles Edit-Fenster + BasicPrinter* pPrn; // Drucker + BOOL bDisas; // TRUE: disassemble + USHORT nFlags; // Debugging-Flags + USHORT nMaximizedWindows; // Anzahl der Fenster, die maximized sind + void FocusWindow( AppWin *pWin ); + void WinMax_Restore(); + void WinShow_Hide(); + void RemoveWindow( AppWin *pWin ); + void AddWindow( AppWin *pWin ); + void WindowRenamed( AppWin *pWin ); + + BasicFrame(); + ~BasicFrame(); + MyBasic& Basic() { return *pBasic; } + void AddToLRU(String const& aFile); + void LoadLRU(); + DECL_LINK( InitMenu, Menu * ); + DECL_LINK( DeInitMenu, Menu * ); + DECL_LINK( HighlightMenu, Menu * ); + DECL_LINK( MenuCommand, Menu * ); + DECL_LINK( Accel, Accelerator * ); + DECL_LINK( ShowLineNr, AutoTimer * ); + MsgEdit* GetMsgTree( String aLogFileName ); + DECL_LINK( Log, TTLogMsg * ); + DECL_LINK( WinInfo, WinInfoRec * ); + BOOL LoadFile( String aFilename ); + long Command( short,BOOL=FALSE );// Kommando-Handler + BOOL SaveAll(); // Alle Fenster speichern + BOOL QueryFileName( String& rName, FileType nFileType, BOOL bSave );// Dateinamen ermitteln + DECL_LINK( ModuleWinExists, String* ); + AppBasEd* FindModuleWin( const String& ); + AppError* FindErrorWin( const String& ); + AppWin* FindWin( const String& ); + AppWin* FindWin( USHORT nWinId ); + USHORT BreakHandler(); // Break-Handler-Callback + + void SetEditVar( SbxVariable *pVar ){ pEditVar = pVar;} + SbxVariable* GetEditVar(){ return pEditVar;} + BOOL IsAutoReload() { return bAutoReload; } + void LoadIniFile(); + + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + void SetAppMode( const String &aNewMode ){ aAppMode = aNewMode; UpdateTitle(); } + + String GenRealString( const String &aResString ); + +}; + +extern BasicApp aBasicApp; + +#endif diff --git a/basic/source/app/appbased.cxx b/basic/source/app/appbased.cxx new file mode 100644 index 000000000000..47b22bd795cb --- /dev/null +++ b/basic/source/app/appbased.cxx @@ -0,0 +1,338 @@ +/************************************************************************* + * + * $RCSfile: appbased.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef _TEXTENG_HXX //autogen +#include <svtools/texteng.hxx> +#endif +#ifndef _TEXTVIEW_HXX //autogen +#include <svtools/textview.hxx> +#endif +#ifndef _SB_SBMETH_HXX //autogen +#include <sbmeth.hxx> +#endif + +#ifndef _CLIP_HXX //autogen +#include <vcl/clip.hxx> +#endif + +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif + +#include "basic.hrc" +#include "status.hxx" +#include "appbased.hxx" +#include "brkpnts.hxx" +#include "testtool.hxx" // defines fr das Syntaxhighlighting + + +TYPEINIT1(AppBasEd,AppEdit); +AppBasEd::AppBasEd( BasicFrame* pParent, SbModule* p ) +: AppEdit( pParent ) +, pBreakpoints( NULL ) +{ + pBreakpoints = new BreakpointWindow( this ); + pBreakpoints->SetFont( ((TextEdit*)pDataEdit)->GetTextEditImp().pTextEngine->GetFont() ); + + pBreakpoints->Show(); + + + ((TextEdit*)pDataEdit)->GetTextEditImp().pTextView->SetAutoIndentMode( TRUE ); + ((TextEdit*)pDataEdit)->GetTextEditImp().pTextEngine->SetMaxTextLen( STRING_MAXLEN ); + ((TextEdit*)pDataEdit)->GetTextEditImp().pTextEngine->SetWordDelimiters( CUniString(" ,.;:(){}[]\"'+-*/<>^\\") ); + ((TextEdit*)pDataEdit)->GetTextEditImp().SyntaxHighlight( TRUE ); + ((TextEdit*)pDataEdit)->SaveAsUTF8( TRUE ); + + String aEmpty; + + pMod = p; + if( !pMod ) + { + String aModName = *pNoName; + aModName += String::CreateFromInt32( nCount ); + pMod = pFrame->Basic().MakeModule( aModName, aEmpty ); + } + bCompiled = pMod->IsCompiled(); + + pBreakpoints->SetModule( pMod ); + + // Icon definieren: +// pIcon = new Icon( ResId( RID_WORKICON ) ); +// if( pIcon ) SetIcon( *pIcon ); + + SetText( pMod->GetName() ); + pDataEdit->SetText( pMod->GetSource() ); + + // Wurde ein Modul bergeben, dann den Quelltext von Platte laden + if ( p ) + LoadSource(); + + // Erst nach Laden des Quelltextes die Events weiterleiten + ((TextEdit*)pDataEdit)->SetBreakpointWindow( pBreakpoints ); + + // Compiled-Flag pflegen: + pDataEdit->SetModifyHdl( LINK( this, AppBasEd, EditChange ) ); + +} + +AppBasEd::~AppBasEd() +{ + pBreakpoints->SaveBreakpoints( GetText() ); + delete pBreakpoints; + pMod->SetName( CUniString("--").Append( pMod->GetName() ) ); +} + +void AppBasEd::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, + const SfxHint& rHint, const TypeId& ) +{ + const SfxSimpleHint* p = PTR_CAST(SfxSimpleHint,&rHint); + if( p ) + { + ULONG nHintId = p->GetId(); + if( nHintId == SBX_HINT_LANGUAGE_EXTENSION_LOADED ) + { + ((TextEdit*)pDataEdit)->GetTextEditImp().InvalidateSyntaxHighlight(); + } + } +} + +FileType AppBasEd::GetFileType() +{ + return FT_BASIC_SOURCE; +} + +IMPL_LINK_INLINE_START( AppBasEd, EditChange, void *, p ) +{ + bCompiled = FALSE; + return TRUE; +} +IMPL_LINK_INLINE_END( AppBasEd, EditChange, void *, p ) + +// Set up the menu +long AppBasEd::InitMenu( Menu* pMenu ) +{ + AppEdit::InitMenu (pMenu ); + BOOL bRunning = pFrame->Basic().IsRunning(); + pMenu->EnableItem( RID_RUNCOMPILE, !bCompiled && !bRunning ); + return TRUE; +} + +long AppBasEd::DeInitMenu( Menu* pMenu ) +{ + AppEdit::DeInitMenu (pMenu ); + pMenu->EnableItem( RID_RUNCOMPILE ); + return TRUE; +} + +// Menu Handler + +void AppBasEd::Command( const CommandEvent& rCEvt ) +{ + switch( rCEvt.GetCommand() ) { + case RID_TOGLEBRKPNT: + ((TextEdit*)pDataEdit)->GetBreakpointWindow()->ToggleBreakpoint( pDataEdit->GetLineNr() ); + break; + default: + AppEdit::Command( rCEvt ); + } +} + +// Sourcecode-Datei laden + +void AppBasEd::Resize() +{ + if( pDataEdit ) { + AppEdit::Resize(); + + // Breakpoint window einfgen + Size aEditSize = pDataEdit->GetSizePixel(); + Point aEditPos = pDataEdit->GetPosPixel(); + + pBreakpoints->SetPosPixel( aEditPos ); + + aEditPos.X() += BREAKPOINTSWIDTH; + pDataEdit->SetPosPixel( aEditPos ); + aEditSize.Width() -= BREAKPOINTSWIDTH; + pDataEdit->SetSizePixel( aEditSize ); + + aEditSize.Width() = BREAKPOINTSWIDTH; + pBreakpoints->SetSizePixel( aEditSize ); + } +} + +void AppBasEd::PostLoad() +{ + pMod->SetName( GetText() ); + pMod->Clear(); + pMod->SetSource( pDataEdit->GetText() ); + AppEdit::PostLoad(); + + pBreakpoints->LoadBreakpoints( GetText() ); +} + +USHORT AppBasEd::ImplSave() +{ + pBreakpoints->SaveBreakpoints( GetText() ); + return AppEdit::ImplSave(); +} + +void AppBasEd::Reload() +{ + TextSelection aSelMemo = pDataEdit->GetSelection(); + LoadSource(); + pDataEdit->SetSelection( aSelMemo ); +} + +// Sourcecode-Datei nach nderung auf Platte neu laden +void AppBasEd::LoadSource() +{ + BOOL bErr; + +// if( pDataEdit->GetText().Len() != 0 ) return; + String aName = pMod->GetName(); + bErr = !pDataEdit->Load( aName ); + pBreakpoints->LoadBreakpoints( GetText() ); + if( bErr ) + ErrorBox( this, ResId( IDS_READERROR ) ).Execute(); + else + UpdateFileInfo( HAS_BEEN_LOADED ); +} + +// mit neuem Namen speichern +void AppBasEd::PostSaveAs() +{ + pMod->SetName( GetText() ); + AppEdit::PostSaveAs(); +} + +// Compilieren + +BOOL AppBasEd::Compile() +{ + if( !pDataEdit->HasText() || bCompiled ) + return TRUE; + pMod->SetSource( pDataEdit->GetText() ); + BOOL bRes = FALSE; + if( pFrame->Basic().Compile( pMod ) ) + { + bRes = TRUE; + if( pFrame->bDisas ) + Disassemble(); + TextSelection aSel( pDataEdit->GetSelection() ); + String aString; + pFrame->pStatus->Message( aString ); + if( aSel.HasRange() ) + aSel.GetStart() = aSel.GetEnd(), pDataEdit->SetSelection( aSel ); + + pBreakpoints->SetBPsInModule(); + } + else + { + BasicError* pErr = pFrame->Basic().aErrors.First(); + if( pErr ) pErr->Show(); + } + return bCompiled = bRes; +} + +void AppBasEd::Disassemble() +{ + String aText; + if( pFrame->Basic().Disassemble( pMod, aText ) ) + Clipboard::CopyString( aText ); +} + +void AppBasEd::Run() +{ + SbxArray* pAllModules = pFrame->Basic().GetModules(); + for (USHORT i = 0; i < pAllModules->Count(); i++) + { + if ( (pAllModules->Get(i)->GetName()).Copy(0,2).CompareToAscii( "--" ) == COMPARE_EQUAL ) + { + SbxVariableRef pMod = pAllModules->Get(i); // Kleiner Hack um ums basic rumzukommen. Sollte demnchst wieder dirkt gehen. + pFrame->Basic().Remove(pMod); + i--; + } + } + + SbMethod* pMain = (SbMethod*) pMod->Find( CUniString("Main"), SbxCLASS_METHOD ); + if( pMain ) + { + pMain->SetDebugFlags( pFrame->nFlags ); + // Loest Call aus! + pFrame->SetAppMode( String( ResId ( IDS_APPMODE_RUN ) ) ); + pMain->Run(); + if (aBasicApp.pFrame) + { + BasicError* pErr = aBasicApp.pFrame->Basic().aErrors.First(); + if( pErr ) pErr->Show(); + aBasicApp.pFrame->SetAppMode( String() ); + } + pMain->SetDebugFlags( 0 ); + } +} + + diff --git a/basic/source/app/appbased.hxx b/basic/source/app/appbased.hxx new file mode 100644 index 000000000000..b51974852afb --- /dev/null +++ b/basic/source/app/appbased.hxx @@ -0,0 +1,108 @@ +/************************************************************************* + * + * $RCSfile: appbased.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _APPBASED_HXX +#define _APPBASED_HXX + +#ifndef _SB_SBMOD_HXX //autogen +#include <sbmod.hxx> +#endif +#ifndef _SB_APPEDIT_HXX +#include "appedit.hxx" +#endif +#ifndef _SB_TEXTEDIT_HXX +#include "textedit.hxx" +#endif + +class BasicFrame; +class BreakpointWindow; + +class AppBasEd : public AppEdit { // Editor-Window: + SbModuleRef pMod; // compiliertes Modul + BOOL bCompiled; // TRUE, wenn compiliert +protected: + DECL_LINK( EditChange, void * ); +#define BREAKPOINTSWIDTH 15 + BreakpointWindow *pBreakpoints; + virtual USHORT ImplSave(); // Datei speichern + +public: + TYPEINFO(); + AppBasEd( BasicFrame*, SbModule* ); + ~AppBasEd(); + FileType GetFileType(); // Liefert den Filetype + SbModule* GetModule() { return pMod; } + long InitMenu( Menu* ); // Initialisierung des Menues + virtual long DeInitMenu( Menu* ); // rcksetzen, so da wieder alle Shortcuts enabled sind + virtual void Command( const CommandEvent& rCEvt ); // Kommando-Handler + virtual void Resize(); // Bercksichtigt die Breakpointleiste + virtual void PostLoad(); // Nachbearbeiten des geladenen (Source am Modul setzen) + virtual void PostSaveAs(); // Nachbearbeiten des Modils ... + void Reload(); + void LoadSource(); // Quelltext zu Objekt laden + BOOL Compile(); // Text compilieren + void Run(); // Image laufenlassen + void Disassemble(); // Image disassemblieren + const String& GetModName() const { return pMod->GetName(); } + virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); +}; + +#endif diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx new file mode 100644 index 000000000000..c21f8dd3c5a0 --- /dev/null +++ b/basic/source/app/appedit.cxx @@ -0,0 +1,286 @@ +/************************************************************************* + * + * $RCSfile: appedit.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _TEXTVIEW_HXX //autogen +#include <svtools/textview.hxx> +#endif + +#ifndef _TEXTENG_HXX //autogen +#include <svtools/texteng.hxx> +#endif + +#ifndef _UNDO_HXX +#include <svtools/undo.hxx> +#endif + +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif + +#include "basic.hrc" +#include "appedit.hxx" +#include "brkpnts.hxx" + +TYPEINIT1(AppEdit,AppWin); +AppEdit::AppEdit( BasicFrame* pParent ) +: AppWin( pParent ) +, nCurTextWidth(5) +, pVScroll( NULL ) +, pHScroll( NULL ) +{ + String aEmpty; + // evtl. den Untitled-String laden: + + pDataEdit = new TextEdit( this, WB_LEFT ); + // Icon definieren: +// pIcon = new Icon( ResId( RID_WORKICON ) ); +// if( pIcon ) SetIcon( *pIcon ); + + pDataEdit->SetText( aEmpty ); + + pDataEdit->Show(); + + pVScroll = new ScrollBar( this, WB_VSCROLL|WB_DRAG ); + pVScroll->Show(); + pVScroll->SetScrollHdl( LINK( this, AppEdit, Scroll ) ); + pHScroll = new ScrollBar( this, WB_HSCROLL|WB_DRAG ); + pHScroll->Show(); + pHScroll->SetScrollHdl( LINK( this, AppEdit, Scroll ) ); + + InitScrollBars(); +} + +AppEdit::~AppEdit() +{ + DataEdit *pHold = pDataEdit; + pDataEdit = NULL; // Erst abklemmen, dann lschen + delete pHold; + delete pHScroll; + delete pVScroll; +} + +IMPL_LINK( AppEdit, Scroll, ScrollBar*, pScroll ) +{ + if ( !pHScroll || !pVScroll ) + return 0; + + TextView *pTextView = ((TextEdit*)pDataEdit)->aEdit.pTextView; + pTextView->SetStartDocPos( Point( pHScroll->GetThumbPos(), pVScroll->GetThumbPos() ) ); + pTextView->Invalidate(); + + if ( ((TextEdit*)pDataEdit)->GetBreakpointWindow() ) + ((TextEdit*)pDataEdit)->GetBreakpointWindow()->Scroll( 0, ((TextEdit*)pDataEdit)->GetBreakpointWindow()->GetCurYOffset() - pTextView->GetStartDocPos().Y() ); + + return 0L; +} + + +void AppEdit::InitScrollBars() +{ + if ( !pHScroll || !pVScroll ) + return; + + TextView *pTextView = ((TextEdit*)pDataEdit)->aEdit.pTextView; +// Kopiert und angepasst. + SetScrollBarRanges(); + + Size aOutSz( pTextView->GetWindow()->GetOutputSizePixel() ); + pVScroll->SetVisibleSize( aOutSz.Height() ); + pVScroll->SetPageSize( aOutSz.Height() * 8 / 10 ); + pVScroll->SetLineSize( GetTextHeight() ); + pVScroll->SetThumbPos( pTextView->GetStartDocPos().Y() ); + pVScroll->Show(); + + pHScroll->SetVisibleSize( aOutSz.Width() ); + pHScroll->SetPageSize( aOutSz.Width() * 8 / 10 ); + pHScroll->SetLineSize( GetTextWidth( CUniString("x") ) ); + pHScroll->SetThumbPos( pTextView->GetStartDocPos().X() ); + pHScroll->Show(); +} + +void AppEdit::SetScrollBarRanges() +{ + // Extra-Methode, nicht InitScrollBars, da auch fuer EditEngine-Events. + + if ( !pHScroll || !pVScroll ) + return; + + pHScroll->SetRange( Range( 0, nCurTextWidth ) ); + + pVScroll->SetRange( Range( 0, ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetTextHeight() ) ); +} + + + +USHORT AppEdit::GetLineNr(){ return pDataEdit->GetLineNr(); } + +FileType AppEdit::GetFileType() +{ + return FT_BASIC_SOURCE; +} + +// Set up the menu +long AppEdit::InitMenu( Menu* pMenu ) +{ + AppWin::InitMenu (pMenu ); + + USHORT UndoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetUndoActionCount(); + USHORT RedoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetRedoActionCount(); + + pMenu->EnableItem( RID_EDITUNDO, UndoCount > 0 ); + pMenu->EnableItem( RID_EDITREDO, RedoCount > 0 ); + + return TRUE; +} + +long AppEdit::DeInitMenu( Menu* pMenu ) +{ + AppWin::DeInitMenu (pMenu ); + + pMenu->EnableItem( RID_EDITUNDO ); + pMenu->EnableItem( RID_EDITREDO ); + + return TRUE; +} + +// Sourcecode-Datei laden + +void AppEdit::Resize() +{ + if( !pDataEdit ) + return; + + Point rHStart,rVStart; + Size rHSize,rVSize; + Size rNewSize( GetOutputSizePixel() ); + + if ( pHScroll ) + { + rHSize = pHScroll->GetSizePixel(); + ULONG nHieght = rHSize.Height(); + rNewSize.Height() -= nHieght; + rHStart.Y() = rNewSize.Height(); + } + + if ( pVScroll ) + { + rVSize = pVScroll->GetSizePixel(); + ULONG nWidth = rVSize.Width(); + rNewSize.Width() -= nWidth; + rVStart.X() = rNewSize.Width(); + } + + rHSize.Width() = rNewSize.Width(); + rVSize.Height() = rNewSize.Height(); + + if ( pHScroll ) + { + pHScroll->SetPosPixel( rHStart ); + pHScroll->SetSizePixel( rHSize ); + } + + if ( pVScroll ) + { + pVScroll->SetPosPixel( rVStart ); + pVScroll->SetSizePixel( rVSize ); + } + pDataEdit->SetPosPixel( Point() ); + pDataEdit->SetSizePixel( rNewSize ); + + + TextView *pTextView = ((TextEdit*)pDataEdit)->aEdit.pTextView; +// Kopiert und adaptiert + long nVisY = pTextView->GetStartDocPos().Y(); + pTextView->ShowCursor(); + Size aOutSz( pTextView->GetWindow()->GetOutputSizePixel() ); + long nMaxVisAreaStart = pTextView->GetTextEngine()->GetTextHeight() - aOutSz.Height(); + if ( nMaxVisAreaStart < 0 ) + nMaxVisAreaStart = 0; + if ( pTextView->GetStartDocPos().Y() > nMaxVisAreaStart ) + { + Point aStartDocPos( pTextView->GetStartDocPos() ); + aStartDocPos.Y() = nMaxVisAreaStart; + pTextView->SetStartDocPos( aStartDocPos ); + pTextView->ShowCursor(); +// pModulWindow->GetBreakPointWindow().GetCurYOffset() = aStartDocPos.Y(); + } + InitScrollBars(); + if ( nVisY != pTextView->GetStartDocPos().Y() ) + pTextView->GetWindow()->Invalidate(); + +} + +void AppEdit::PostLoad() +{ +} + +// mit neuem Namen speichern + +void AppEdit::PostSaveAs() +{ +} + +void AppEdit::Highlight( USHORT nLine, USHORT nCol1, USHORT nCol2 ) +{ + ((TextEdit*)pDataEdit)->Highlight( nLine, nCol1, nCol2 ); + ToTop(); +} + diff --git a/basic/source/app/appedit.hxx b/basic/source/app/appedit.hxx new file mode 100644 index 000000000000..812c642c419a --- /dev/null +++ b/basic/source/app/appedit.hxx @@ -0,0 +1,101 @@ +/************************************************************************* + * + * $RCSfile: appedit.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _APPEDIT_HXX +#define _APPEDIT_HXX + +#ifndef _SCRBAR_HXX //autogen +#include <vcl/scrbar.hxx> +#endif + +#include "appwin.hxx" +#include "textedit.hxx" + +class BasicFrame; + +class AppEdit : public AppWin { // Editor-Window: +public: + ScrollBar *pVScroll; + ScrollBar *pHScroll; + void SetScrollBarRanges(); + ULONG nCurTextWidth; +private: + void InitScrollBars(); +protected: + DECL_LINK( Scroll, ScrollBar* ); +public: + TYPEINFO(); + AppEdit( BasicFrame* ); + ~AppEdit(); + USHORT GetLineNr(); // Aktuelle Zeilennummer + FileType GetFileType(); // Liefert den Filetype + virtual long InitMenu( Menu* ); // Initialisierung des Menues + virtual long DeInitMenu( Menu* ); // rcksetzen, so da wieder alle Shortcuts enabled sind +// long Command( short ); // Kommando-Handler + void Resize(); + void PostLoad(); // Nachbearbeiten des geladenen (Source am Modul setzen) + void PostSaveAs(); // Nachbearbeiten des Modils ... + void Mark( short, short, short );// Text markieren + void Highlight( USHORT nLine, USHORT nCol1, USHORT nCol2 ); + virtual BOOL ReloadAllowed(){ return !StarBASIC::IsRunning(); } +}; + +#endif diff --git a/basic/source/app/apperror.cxx b/basic/source/app/apperror.cxx new file mode 100644 index 000000000000..15b6cb4e53fc --- /dev/null +++ b/basic/source/app/apperror.cxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * $RCSfile: apperror.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "basic.hrc" +#include "apperror.hxx" + +TYPEINIT1(AppError,AppWin); +AppError::AppError( BasicFrame* pParent, String aFileName ) +: AppWin( pParent ) +{ + SetText( aFileName ); // Mu vor new MsgEdit stehen!! + pDataEdit = new MsgEdit( this, pParent, WB_HSCROLL | WB_VSCROLL | WB_LEFT ); + DirEntry aEntry( aFileName ); + UpdateFileInfo( HAS_BEEN_LOADED ); + // Icon definieren: +// pIcon = new Icon( ResId( RID_WORKICON ) ); +// if( pIcon ) SetIcon( *pIcon ); + + pDataEdit->Show(); + GrabFocus(); +} + +AppError::~AppError() +{ + DataEdit* pTemp = pDataEdit; + pDataEdit = NULL; + delete pTemp; +} + +// Set up the menu +long AppError::InitMenu( Menu* pMenu ) +{ + AppWin::InitMenu (pMenu ); + + pMenu->EnableItem( RID_EDITUNDO, FALSE ); + pMenu->EnableItem( RID_EDITREDO, FALSE ); + + return TRUE; +} + +long AppError::DeInitMenu( Menu* pMenu ) +{ + AppWin::DeInitMenu (pMenu ); + + pMenu->EnableItem( RID_EDITUNDO ); + pMenu->EnableItem( RID_EDITREDO ); + + return TRUE; +} + +USHORT AppError::GetLineNr(){ return pDataEdit->GetLineNr(); } + +FileType AppError::GetFileType() +{ + return FT_RESULT_FILE; +} + diff --git a/basic/source/app/apperror.hxx b/basic/source/app/apperror.hxx new file mode 100644 index 000000000000..a806175deaac --- /dev/null +++ b/basic/source/app/apperror.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * $RCSfile: apperror.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <appwin.hxx> +#include <msgedit.hxx> + +class AppError : public AppWin +{ +protected: + DECL_LINK( EditChange, MsgEdit * ); +public: + TYPEINFO(); + AppError( BasicFrame*, String ); + ~AppError(); +// long Command( short nID ); + virtual long InitMenu( Menu* ); // Initialisierung des Menues + virtual long DeInitMenu( Menu* ); // rcksetzen, so da wieder alle Shortcuts enabled sind + USHORT GetLineNr(); // Aktuelle Zeilennummer + FileType GetFileType(); // Liefert den Filetype + MsgEdit* GetMsgTree() { return ((MsgEdit*)pDataEdit); } + virtual BOOL ReloadAllowed(){ return !StarBASIC::IsRunning(); } +}; + diff --git a/basic/source/app/appwin.cxx b/basic/source/app/appwin.cxx new file mode 100644 index 000000000000..2cd1cc4196bf --- /dev/null +++ b/basic/source/app/appwin.cxx @@ -0,0 +1,647 @@ +/************************************************************************* + * + * $RCSfile: appwin.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _FSYS_HXX //autogen +#include <tools/fsys.hxx> +#endif +#ifndef _CLIP_HXX //autogen +#include <vcl/clip.hxx> +#endif + +#include "basic.hrc" +#include "app.hxx" +#include "mybasic.hxx" +#include "status.hxx" +#include "appwin.hxx" +#include "dataedit.hxx" +#include "dialogs.hxx" + +String *AppWin::pNoName = NULL; // enthaelt den "Untitled"-String +short AppWin::nNumber = 0; // fortlaufende Nummer +short AppWin::nCount = 0; // Anzahl Editfenster + +TYPEINIT0(AppWin); +AppWin::AppWin( BasicFrame* pParent ) +: DockingWindow( pParent, WB_SIZEMOVE | WB_CLOSEABLE | WB_PINABLE ) +, pDataEdit(NULL) +, nSkipReload(0) +, bHasFile( FALSE ) +, bReloadAborted( FALSE ) +, bFind( TRUE ) +, pFrame( pParent ) +{ + // evtl. den Untitled-String laden: + if( !pNoName ) + pNoName = new String( ResId( IDS_NONAME ) ); + nCount++; + + // Maximized Status von aktuellem Fenster holen + USHORT nInitialWinState; + if ( pFrame->pWork ) + { + nInitialWinState = pFrame->pWork->GetWinState(); + nInitialWinState &= TT_WIN_STATE_MAX | TT_WIN_STATE_FLOAT; + } + else + nInitialWinState = TT_WIN_STATE_MAX; + + StartListening( *pFrame ); + pFrame->AddWindow( this ); + + ShowTitleButton( TITLE_BUTTON_DOCKING ); + ShowTitleButton( TITLE_BUTTON_HIDE ); + SetActivateMode( ACTIVATE_MODE_GRABFOCUS ); + + Cascade( nCount ); + if ( TT_WIN_STATE_MAX == nInitialWinState ) + Maximize(); +} + +AppWin::~AppWin() +{ + nCount--; + pFrame->RemoveWindow( this ); + pFrame = NULL; // So da nach BasicRun nicht mehr versucht wird Fenstertext zu setzen +} + +void AppWin::SetText( const XubString& rStr ) +{ + DockingWindow::SetText( rStr ); + pFrame->WindowRenamed( this ); +} + +void AppWin::TitleButtonClick( USHORT nButton ) +{ + if ( TITLE_BUTTON_DOCKING == nButton ) + if ( TT_WIN_STATE_MAX != nWinState ) + Maximize(); + else + Restore(); + else // if ( TITLE_BUTTON_HIDE == nButton ) + Minimize( TRUE ); +} + +void AppWin::Maximize() +{ + if ( TT_WIN_STATE_MAX != nWinState ) + { + nNormalPos = GetPosPixel(); + nNormalSize = GetSizePixel(); + + SetFloatingMode( FALSE ); + + pFrame->nMaximizedWindows++; + nWinState = TT_WIN_STATE_MAX; + } + long nTitleHeight; + { + long nDummy1, nDummy2, nDummy3; + pFrame->GetBorder( nDummy1, nTitleHeight, nDummy2, nDummy3 ); + } + + Size aSize = pFrame->GetOutputSizePixel(); + aSize.Height() -= nTitleHeight; + aSize.Height() -= 2; + aSize.Width() -= 2; + SetSizePixel( aSize ); + SetPosPixel( Point( 1,1 ) ); + pFrame->WinMax_Restore(); +} + +void AppWin::Restore() +{ + SetFloatingMode( TRUE ); + SetPosSizePixel( nNormalPos, nNormalSize ); + + if ( TT_WIN_STATE_MAX == nWinState ) + pFrame->nMaximizedWindows--; + + nWinState = TT_WIN_STATE_FLOAT; + pFrame->WinMax_Restore(); +} + +void AppWin::Minimize( BOOL bMinimize ) +{ + if ( bMinimize ) + nWinState |= TT_WIN_STATE_HIDE; + else + nWinState &= ~TT_WIN_STATE_HIDE; + pFrame->WinMax_Restore(); +} + +void AppWin::Cascade( USHORT nNr ) +{ + Restore(); + + nNr--; + nNr %= 10; + nNr++; + + long nTitleHeight; + { + long nDummy1, nDummy2, nDummy3; + pFrame->GetBorder( nDummy1, nTitleHeight, nDummy2, nDummy3 ); + } + + Size aWinSize = pFrame->GetOutputSizePixel(); + aWinSize.Width() -= aWinSize.Width() / 5; // auf 80 % reduzieren + aWinSize.Height() -= nTitleHeight * nNr; // Unten entsprechen krzen + aWinSize.Height() -= 2; + + Point nPos( nTitleHeight * nNr, nTitleHeight * nNr ); + + SetPosSizePixel( nPos, aWinSize ); +} + +void AppWin::RequestHelp( const HelpEvent& ) +{ + Help(); +} + +void AppWin::Help() +{ + String s = pDataEdit->GetSelected(); + if( s.Len() ) { + // Leerstellen davor weg: + while( s.GetChar(0) == ' ' ) s.Erase( 0, 1 ); +// aBasicApp.pHelp->Start( s ); + } else { +// aBasicApp.pHelp->Start( HELP_INDEX ); + } +} + +void AppWin::Resize() +{ + if( pDataEdit ) + { + pDataEdit->SetPosPixel( Point( 0, 0 ) ); + pDataEdit->SetSizePixel( GetOutputSizePixel() ); + } +} + +void AppWin::GetFocus() +{ + pFrame->FocusWindow( this ); + if( pDataEdit ) // Im Destruktor wird GetFocus gerufen, daher diese Abfrage + { + pDataEdit->GrabFocus(); +// InitMenu(GetpApp()->GetAppMenu()->GetPopupMenu( RID_APPEDIT )); // So da Delete richtig ist + } +} + +long AppWin::PreNotify( NotifyEvent& rNEvt ) +{ + + if ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) + Activate(); + if ( rNEvt.GetType() == EVENT_GETFOCUS ) + if ( pFrame->pList->Last() != this ) + Activate(); + return FALSE; // Der event soll weiter verarbeitet werden +} + +void AppWin::Activate() +{ + GrabFocus(); +} + +// Set up the menu +long AppWin::InitMenu( Menu* pMenu ) +{ + Clipboard cb; + TextSelection r = pDataEdit->GetSelection(); + BOOL bMarked = r.HasRange(); + pMenu->EnableItem( RID_EDITREPEAT, (aFind.Len() != 0 ) ); + pMenu->EnableItem( RID_EDITCUT, bMarked ); + pMenu->EnableItem( RID_EDITCOPY, bMarked ); +// pMenu->EnableItem( RID_EDITPASTE, (cb.GetDataLen( FORMAT_STRING ) != 0 ) ); + pMenu->EnableItem( RID_EDITPASTE, (cb.HasFormat( FORMAT_STRING ) ) ); + pMenu->EnableItem( RID_EDITDEL, bMarked ); +// pMenu->EnableItem( RID_HELPTOPIC, bMarked ); + + BOOL bHasText = pDataEdit->HasText(); + BOOL bRunning = pFrame->Basic().IsRunning(); + BOOL bCanExecute = BOOL( (!bRunning && bHasText) || pFrame->bInBreak ); + pMenu->EnableItem( RID_RUNSTART, bCanExecute ); + pMenu->EnableItem( RID_RUNBREAK, bRunning && !pFrame->bInBreak); + pMenu->EnableItem( RID_RUNSTOP, bRunning ); + pMenu->EnableItem( RID_RUNTOCURSOR, bCanExecute ); + pMenu->EnableItem( RID_RUNSTEPINTO, bCanExecute ); + pMenu->EnableItem( RID_RUNSTEPOVER, bCanExecute ); + return TRUE; +} + +long AppWin::DeInitMenu( Menu* pMenu ) +{ + pMenu->EnableItem( RID_EDITREPEAT ); + pMenu->EnableItem( RID_EDITCUT ); + pMenu->EnableItem( RID_EDITCOPY ); + pMenu->EnableItem( RID_EDITPASTE ); + pMenu->EnableItem( RID_EDITDEL ); + + pMenu->EnableItem( RID_RUNSTART ); + pMenu->EnableItem( RID_RUNBREAK ); + pMenu->EnableItem( RID_RUNSTOP ); + pMenu->EnableItem( RID_RUNTOCURSOR ); + pMenu->EnableItem( RID_RUNSTEPINTO ); + pMenu->EnableItem( RID_RUNSTEPOVER ); + return TRUE; +} + +// Menu Handler + +void AppWin::Command( const CommandEvent& rCEvt ) +{ + TextSelection r = pDataEdit->GetSelection(); + BOOL bHasMark = r.HasRange(); + switch( rCEvt.GetCommand() ) { + case RID_FILESAVE: + QuerySave( QUERY_DISK_CHANGED | SAVE_NOT_DIRTY ); break; + case RID_FILESAVEAS: + SaveAs(); break; + case RID_EDITSEARCH: + Find(); break; + case RID_EDITREPLACE: + Replace(); break; + case RID_EDITREPEAT: + Repeat(); break; + case RID_EDITCUT: + if( bHasMark ) pDataEdit->Cut(); break; + case RID_EDITCOPY: + if( bHasMark ) pDataEdit->Copy(); break; + case RID_EDITPASTE: + if( Clipboard::HasFormat( FORMAT_STRING ) ) pDataEdit->Paste(); break; + case RID_EDITDEL: + /*if( bHasMark ) */pDataEdit->Delete(); + break; + case RID_EDITUNDO: + pDataEdit->Undo(); + break; + case RID_EDITREDO: + pDataEdit->Redo(); + break; + case COMMAND_CONTEXTMENU: + { + PopupMenu *pKontext = NULL; + pDataEdit->BuildKontextMenu( pKontext ); + if ( pKontext ) + { + USHORT nRes = pKontext->Execute( this, GetPointerPosPixel() ); + if ( nRes ) + pFrame->Command( nRes ); + delete pKontext; + } + } + } +} + + +BOOL AppWin::IsSkipReload() +{ + return nSkipReload != 0; +} + +void AppWin::SkipReload( BOOL bSkip ) +{ + DBG_ASSERT( bSkip || nSkipReload, "SkipReload aufgehoben ohne es zu aktivieren"); + if ( bSkip ) + nSkipReload++; + else + nSkipReload--; +} + +BOOL AppWin::DiskFileChanged( USHORT nWhat ) +{ + if ( !bHasFile ) + return FALSE; + + switch ( nWhat ) + { + case SINCE_LAST_LOAD: + { + if ( bReloadAborted ) + return TRUE; + else + return DiskFileChanged( SINCE_LAST_ASK_RELOAD ); + } + break; + case SINCE_LAST_ASK_RELOAD: + { + String aFilename( GetText() ); + + DirEntry aFile( aFilename ); + FileStat aStat( aFile ); + + return ( !aLastAccess.GetError() != !aStat.GetError() ) + || aLastAccess.IsYounger( aStat ) || aStat.IsYounger( aLastAccess ); + } + break; + default: + DBG_ERROR("Not Implemented in AppWin::DiskFileChanged"); + } + return TRUE; +} + +void AppWin::UpdateFileInfo( USHORT nWhat ) +{ + switch ( nWhat ) + { + case HAS_BEEN_LOADED: + { + bReloadAborted = FALSE; + UpdateFileInfo( ASKED_RELOAD ); + + } + break; + case ASKED_RELOAD: + { + String aFilename( GetText() ); + + DirEntry aFile( aFilename ); + aLastAccess.Update( aFile ); + } + break; + default: + DBG_ERROR("Not Implemented in AppWin::UpdateFileInfo"); + } +} + +void AppWin::CheckReload() +{ + if ( IsSkipReload() || !bHasFile ) + return; + + String aFilename( GetText() ); + DirEntry aFile( aFilename ); + if ( !aFilename.Len() ) + return; + + if ( !aFile.Exists() ) + return; + +// FileStat aStat( aFile ); + + if ( DiskFileChanged( SINCE_LAST_ASK_RELOAD ) && ReloadAllowed() ) + { + UpdateFileInfo( ASKED_RELOAD ); + ToTop(); + Update(); + if ( (IsModified() && QueryBox( this, ResId( IDS_ASKDIRTYRELOAD ) ).Execute() == RET_YES ) + || ( !IsModified() && ( pFrame->IsAutoReload() || QueryBox( this, ResId( IDS_ASKRELOAD ) ).Execute() == RET_YES ) ) ) + { + Reload(); + } + else + { + bReloadAborted = TRUE; + } + } +} + +void AppWin::Reload() +{ + SkipReload(); + TextSelection aSelMemo = pDataEdit->GetSelection(); + Load( GetText() ); + pDataEdit->SetSelection( aSelMemo ); + SkipReload( FALSE ); +} + +// Datei laden + +void AppWin::Load( const String& aName ) +{ + SkipReload(); + BOOL bErr; + +// if( !QuerySave() ) +// return; + bErr = !pDataEdit->Load( aName ); + if( bErr ) + ErrorBox( this, ResId( IDS_READERROR ) ).Execute(); + else + { + DirEntry aEntry( aName ); + String aModName = aEntry.GetFull(); + SetText( aModName ); + UpdateFileInfo( HAS_BEEN_LOADED ); + PostLoad(); + bHasFile = TRUE; + } + SkipReload( FALSE ); +} + +// Datei speichern + +USHORT AppWin::ImplSave() +{ + SkipReload(); + BOOL bResult = SAVE_RES_NOT_SAVED; + String s1 = *pNoName; + String s2 = GetText().Copy( 0, s1.Len() ); + if( s1 == s2 ) + bResult = SaveAs(); + else { + String aName = GetText(); + if ( pDataEdit->Save( aName ) ) + { + bResult = SAVE_RES_SAVED; + bHasFile = TRUE; + } + else + { + bResult = SAVE_RES_ERROR; + ErrorBox( this, ResId( IDS_WRITEERROR ) ).Execute(); + } + UpdateFileInfo( HAS_BEEN_LOADED ); + } + SkipReload( FALSE ); + return bResult; +} + +// mit neuem Namen speichern + +USHORT AppWin::SaveAs() +{ + SkipReload(); + String s1 = *pNoName; + String s2 = GetText().Copy( 0, s1.Len() ); + if( s1 == s2 ) s2.Erase(); + else s2 = GetText(); + if( pFrame->QueryFileName( s2, GetFileType(), TRUE ) ) + { + SetText( s2 ); + PostSaveAs(); + SkipReload( FALSE ); + return ImplSave(); + } + else + { + SkipReload( FALSE ); + return SAVE_RES_CANCEL; + } +} + +// Soll gespeichert werden? + +USHORT AppWin::QuerySave( QueryBits nBits ) +{ + BOOL bQueryDirty = ( nBits & QUERY_DIRTY ) != 0; + BOOL bQueryDiskChanged = ( nBits & QUERY_DISK_CHANGED ) != 0; + BOOL bSaveNotDirty = ( nBits & SAVE_NOT_DIRTY ) != 0; + + SkipReload(); + short nResult; + if ( IsModified() || bSaveNotDirty ) + nResult = RET_YES; + else + nResult = RET_NO; + + if( ( ( IsModified() || bSaveNotDirty ) && bQueryDirty ) || ( DiskFileChanged( SINCE_LAST_LOAD ) && bQueryDiskChanged ) ) + { + ToTop(); + if ( ( ( IsModified() && bQueryDirty ) && DiskFileChanged( SINCE_LAST_LOAD ) ) + || ( IsModified() && ( DiskFileChanged( SINCE_LAST_LOAD ) && bQueryDiskChanged ) ) ) + nResult = QueryBox( this, ResId( IDS_ASK_DIRTY_AND_DISKCHANGE_SAVE ) ).Execute(); + else if ( ( IsModified() && bQueryDirty ) ) + nResult = QueryBox( this, ResId( IDS_ASK_DIRTY_SAVE ) ).Execute(); + else + nResult = QueryBox( this, ResId( IDS_ASK_DISKCHANGE_SAVE ) ).Execute(); + } + + + USHORT nReturn; + switch( nResult ) + { + case RET_YES: + nReturn = ImplSave(); + break; + case RET_NO: + nReturn = SAVE_RES_NOT_SAVED; + break; + case RET_CANCEL: + nReturn = SAVE_RES_CANCEL; + break; + } + SkipReload( FALSE ); + return nReturn; +} + +BOOL AppWin::Close() +{ + switch ( QuerySave( QUERY_DIRTY ) ) + { + case SAVE_RES_NOT_SAVED: + case SAVE_RES_SAVED: + { + DockingWindow::Close(); + delete this; + return TRUE; + } + break; + case SAVE_RES_ERROR: // Fehlermeldung schon ausgegeben + return FALSE; + break; + case SAVE_RES_CANCEL: + return FALSE; + break; + default: + DBG_ERROR("Not Implemented in AppWin::Close") + return FALSE; + } +} + +// Text suchen + +void AppWin::Find() +{ + ResId aResId( IDD_FIND_DIALOG ); + FindDialog aDlg( this, aResId, aFind ); + if( aDlg.Execute() ) { + bFind = TRUE; + Repeat(); + } +} + +// Text ersetzen + +void AppWin::Replace() +{ + ResId aResId( IDD_REPLACE_DIALOG ); + ReplaceDialog* pDlg = new ReplaceDialog + (this, aResId, aFind, aReplace ); + if( pDlg->Execute() ) { + bFind = FALSE; + Repeat(); + } +} + +// Suchen/ersetzen wiederholen + +void AppWin::Repeat() +{ + if( (aFind.Len() != 0 ) && ( pDataEdit->Find( aFind ) || (ErrorBox(this,ResId(IDS_PATTERNNOTFOUND)).Execute() && FALSE) ) && !bFind ) + pDataEdit->ReplaceSelected( aReplace ); +} + diff --git a/basic/source/app/appwin.hxx b/basic/source/app/appwin.hxx new file mode 100644 index 000000000000..2a8c953acf32 --- /dev/null +++ b/basic/source/app/appwin.hxx @@ -0,0 +1,175 @@ +/************************************************************************* + * + * $RCSfile: appwin.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _APPWIN_HXX +#define _APPWIN_HXX + +//#include <sb.hxx> +#ifndef _SV_DOCKWIN_HXX +#include <vcl/dockwin.hxx> +#endif +#ifndef _FSYS_HXX //autogen +#include <tools/fsys.hxx> +#endif + +#include "app.hxx" +#include "dataedit.hxx" + +typedef USHORT QueryBits; +#define QUERY_NONE ( QueryBits ( 0x00 ) ) +#define QUERY_DIRTY ( QueryBits ( 0x01 ) ) +#define QUERY_DISK_CHANGED ( QueryBits ( 0x02 ) ) +#define QUERY_ALL ( QUERY_DIRTY | QUERY_DISK_CHANGED ) +#define SAVE_NOT_DIRTY ( QueryBits ( 0x04 ) ) + +#define SAVE_RES_SAVED TRUE +#define SAVE_RES_NOT_SAVED FALSE +#define SAVE_RES_ERROR 3 +#define SAVE_RES_CANCEL 4 + + +#define SINCE_LAST_LOAD 1 +#define SINCE_LAST_ASK_RELOAD 2 + +#define HAS_BEEN_LOADED 1 // includes ASKED_RELOAD +#define ASKED_RELOAD 2 + + +#define TT_WIN_STATE_MAX 0x01 +#define TT_WIN_STATE_FLOAT 0x02 +#define TT_WIN_STATE_HIDE 0x04 + +class BasicFrame; + +class AppWin : public DockingWindow, public SfxListener // Dokumentfenster +{ + friend MsgEdit; +protected: + static short nNumber; // fortlaufende Nummer + static short nCount; // Anzahl Editfenster + static String *pNoName; // "Untitled" + FileStat aLastAccess; // Wann wurde die geladene Dateiversion verndert + USHORT nSkipReload; // Manchmal darf kein Reload erfolgen + BOOL bHasFile; // Ansonsten hat reload auch keinen Sinn + BOOL bReloadAborted; // Wird gesetzt, wenn reload abgelehnt wurde, so da beim Schlieen nochmal gefragt werden kann + + short nId; // ID-Nummer( "Unbenannt n" ) + BasicFrame* pFrame; // Parent-Window +// Icon* pIcon; // Dokument-Icon + String aFind; // Suchstring + String aReplace; // Ersetze-String + BOOL bFind; // TRUE, wenn Suchen und nicht Ersetzen + void RequestHelp( const HelpEvent& );// Hilfe-Handler + void GetFocus(); // aktivieren + virtual USHORT ImplSave(); // Datei speichern + USHORT nWinState; // Maximized, Iconized oder Normal + Point nNormalPos; // Position wenn Normal + Size nNormalSize; // Gre wenn Normal + virtual long PreNotify( NotifyEvent& rNEvt ); + USHORT nWinId; + +public: + TYPEINFO(); + AppWin( BasicFrame* ); + ~AppWin(); + DataEdit* pDataEdit; // Daten-Flaeche + virtual USHORT GetLineNr()=0; // Aktuelle Zeilennummer + virtual long InitMenu( Menu* ); // Initialisierung des Menues + virtual long DeInitMenu( Menu* ); // rcksetzen, so da wieder alle Shortcuts enabled sind + virtual void Command( const CommandEvent& rCEvt ); // Kommando-Handler + virtual void Resize(); // Aenderung Fenstergroesse + virtual void Help(); // Hilfe aktivieren + virtual void Load( const String& ); // Datei laden + virtual void PostLoad(){} // Nachbearbeiten des geladenen (Source am Modul setzen) + virtual USHORT SaveAs(); // Datei unter neuem Namen speichern + virtual void PostSaveAs(){} // Nachbearbeiten des Moduls ... + virtual void Find(); // Text suchen + virtual void Replace(); // Text ersetzen + virtual void Repeat(); // Suche wiederholen + virtual BOOL Close(); // Fenster schliessen + virtual void Activate(); // Fenster wurde aktiviert + virtual FileType GetFileType()=0; // Liefert den Filetype + virtual BOOL ReloadAllowed(){ return TRUE; } // Ermglicht dem Dok temporr NEIN zu sagen + virtual void Reload(); // Reload nach nderung auf Platte + void CheckReload(); // Prft und Fragt ob reloaded werden soll + BOOL DiskFileChanged( USHORT nWhat ); // Prft ob die Datei sich verndert hat + void UpdateFileInfo( USHORT nWhat ); // Merkt sich den aktuellen Zustand der Datei + BOOL IsSkipReload(); // Soll reload getestet werden + void SkipReload( BOOL bSkip = TRUE ); + USHORT GetWinState(){ return nWinState; } + void Maximize(); + void Restore(); + void Minimize( BOOL bMinimize ); + void Cascade( USHORT nNr ); + + USHORT QuerySave( QueryBits nBits = QUERY_ALL ); // Speichern + BOOL IsModified() { return pDataEdit->IsModified(); } + BasicFrame* GetBasicFrame() { return pFrame; } + virtual void TitleButtonClick( USHORT nButton ); + virtual void SetText( const XubString& rStr ); + + USHORT GetWinId() { return nWinId; } + void SetWinId( USHORT nId ) { nWinId = nId; } +}; + +DECLARE_LIST( EditList, AppWin* ); + +#endif diff --git a/basic/source/app/basic.hrc b/basic/source/app/basic.hrc new file mode 100644 index 000000000000..2b49303e3c33 --- /dev/null +++ b/basic/source/app/basic.hrc @@ -0,0 +1,218 @@ +/************************************************************************* + * + * $RCSfile: basic.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#define RID_OPTLIST 101 +#define RID_OPTLINES 102 +#define RID_OPTPACKS 103 +#define RID_OPTPACKD 104 +#define RID_OPTWARN1 105 +#define RID_OPTWARN2 106 +#define RID_OPTVIRT 107 +#define RID_PARAMS 108 +#define RID_RETTYPE 109 +#define RID_RETVAL 110 +//#define RID_APPICON 500 +//#define RID_APPICON2 501 +//#define RID_WORKICON 502 +//#define RID_LOADICON 503 +//#define RID_SAVEICON 504 +#define RID_APPMENUBAR 1000 +#define RID_APPFILE 1001 +#define RID_APPEDIT 1002 +#define RID_APPRUN 1003 +#define RID_APPWINDOW 1004 +#define RID_APPHELP 1005 +#define RID_FILE 1100 +#define RID_FILENEW 1101 +#define RID_FILEOPEN 1102 +#define RID_FILECLOSE 1103 +#define RID_FILESAVE 1104 +#define RID_FILESAVEAS 1105 +#define RID_FILELOADLIB 1106 +#define RID_FILESAVELIB 1107 +#define RID_FILEPRINT 1109 +#define RID_FILESETUP 1110 +#define RID_QUIT 1111 +#define IDM_FILE_LRU1 1112 +#define IDM_FILE_LRU2 (IDM_FILE_LRU1 + 1) +#define IDM_FILE_LRU3 (IDM_FILE_LRU2 + 1) +#define IDM_FILE_LRU4 (IDM_FILE_LRU3 + 1) +#define RID_EDIT 1200 +#define RID_EDITUNDO 1201 +#define RID_EDITREDO 1202 +#define RID_EDITCUT 1203 +#define RID_EDITCOPY 1204 +#define RID_EDITPASTE 1205 +#define RID_EDITDEL 1206 +#define RID_EDITSEARCH 1207 +#define RID_EDITREPLACE 1208 +#define RID_EDITREPEAT 1209 +#define RID_RUN 1300 +#define RID_RUNCOMPILE 1301 +#define RID_RUNSTART 1302 +#define RID_RUNBREAK 1304 +#define RID_RUNSTOP 1303 +#define RID_RUNNEXTERR 1307 +#define RID_RUNPREVERR 1308 +#define RID_RUNDISAS 1310 +#define RID_RUNSTEPINTO 1311 +#define RID_RUNSTEPOVER 1312 +#define RID_RUNTOCURSOR 1313 +#define RID_TOGLEBRKPNT 1314 +#define RID_TT_EXTRAS_NAME 1400 +#define RID_TT_EXTRAS 1401 +#define RID_OPTIONS 1402 +#define RID_DECLARE_HELPER 1403 +#define RID_WINDOW 1501 +#define RID_WINTILE 1502 +#define RID_WINTILEHORZ 1503 +#define RID_WINTILEVERT 1504 +#define RID_WINCASCADE 1505 +#define RID_WIN_FILE1 1520 +#define RID_WIN_FILEn 1599 + +#define RID_HELP 1601 +//#define RID_HELPINDEX 1602 +//#define RID_HELPKEYS 1603 +//#define RID_HELPINTRO 1604 +//#define RID_HELPTOPIC 1605 +#define RID_HELPABOUT 1606 +#define RID_POPUP 1700 +#define RID_POPUPEDITVAR 1701 + + + +#define IDS_APPNAME 2000 +#define IDS_APPNAME2 2001 +#define IDS_APPMODE_BREAK 2002 +#define IDS_APPMODE_RUN 2003 +#define IDS_NONAME 2100 +#define IDS_NONAMEFILE 2101 +#define IDS_INCFILE 2102 +#define IDS_LIBFILE 2103 +#define IDS_RESFILE 2104 +#define IDS_TXTFILE 2105 +#define IDS_READERROR 2103 +#define IDS_WRITEERROR 2104 +#define IDS_COMPERROR 2105 +#define IDS_CONTINUE 2106 +#define IDS_CANCEL 2107 +#define IDS_NOPRINTERERROR 2108 +#define IDS_PATTERNNOTFOUND 2109 +#define IDS_INVALID_VALUE 2110 +#define IDS_ASK_DIRTY_SAVE 2200 +#define IDS_ASK_DISKCHANGE_SAVE 2201 +#define IDS_ASK_DIRTY_AND_DISKCHANGE_SAVE 2202 +#define IDS_ASKSAVEERROR 2203 +#define IDS_ASKRELOAD 2204 +#define IDS_ASKDIRTYRELOAD 2205 +#define IDS_LOADDLG 2300 +#define IDS_SAVEDLG 2301 +#define IDS_BASFILTER 2304 +#define IDS_LIBFILTER 2305 +#define IDS_INCFILTER 2306 +#define IDS_RESFILTER 2307 +#define IDS_TXTFILTER 2308 +#define IDS_PAGE 2401 +#define IDS_PRINTMSG 2402 +#define IDS_CANTLOAD 2501 +#define IDS_CANTSAVE 2502 +#define IDS_ERROR1 2601 +#define IDS_ERROR2 2602 +#define IDS_WARNING1 2603 +#define IDS_NO_LONGNAME 2604 +#define IDS_WARNING_PREFIX 2605 +#define IDS_OBJECT 2606 +#define IDS_EDIT_VAR 2607 + +#define IDS_NOMAINPGM 2701 +#define IDS_DISASWIN 2702 +#define IDS_RUNNING 2703 +#define IDS_NOT_YET_IMPLEMENTED 2704 +#define IDS_LOSS_OF_INFORMATION 2705 + +#define RID_ACCEL 3000 + +#define IDD_LOADSAVE_DIALOG 4001 +#define IDD_ABOUT_DIALOG 4002 +#define IDD_TT_ABOUT_DIALOG 4003 +#define IDD_FIND_DIALOG 4004 +#define IDD_REPLACE_DIALOG 4005 +#define IDD_PRINT_DIALOG 4006 +#define IDD_OPTIONS_DLG 4007 +#define RID_TP_SPECIAL 4008 +#define RID_TP_GENERIC 4009 +#define IDD_DISPLAY_HID 4010 +#define IDD_EDIT_VAR 4010 + + +//#define RID_APPFONT 5000 +//#define RID_APPEDITFONT 5001 +//#define RID_DLGBRUSH 5002 +#define RID_CALLDLG 6001 +#define MBP_PLUS 8001 +#define MBP_MINUS 8002 +#define MBP_ASSERT 8003 +#define RID_IMGLST_LAYOUT 8004 +#define MAIN_ACCEL 9001 + +#define LOAD_CONF 10001 +#define WORK 10002 +#define FILENAME 10003 diff --git a/basic/source/app/basic.src b/basic/source/app/basic.src new file mode 100644 index 000000000000..f96d5641ddd1 --- /dev/null +++ b/basic/source/app/basic.src @@ -0,0 +1,4089 @@ +/************************************************************************* + * + * $RCSfile: basic.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "basic.hrc" +#include "resids.hrc" + +ModalDialog RID_CALLDLG { + Text = "Dynamischer Link Nr. "; + Text [ english_us ] = "Dynamic Link No. "; + PosSize = MAP_SYSFONT (18,18,142,142); + SVLook = TRUE; + MOVEABLE = TRUE; + CLOSEABLE = TRUE; +// WinChilds = { +// FixedText { +// Text = "Aktuelle Parameter"; +// Text [ english_us ] = "Aktuelle Parameter"; +// PosSize = MAP_SYSFONT (10,10,120,8); +// }; +// }; + FixedText RID_RETTYPE { + PosSize = MAP_SYSFONT (10,70,120,8); + }; + Edit RID_RETVAL { + PosSize = MAP_SYSFONT (10,85,120,12); + Border = TRUE; + TabStop = TRUE; + }; + ListBox RID_PARAMS { + PosSize = MAP_SYSFONT (10,25,120,40); + TabStop = TRUE; + Border = TRUE; + }; + OKButton RID_OK { + PosSize = MAP_SYSFONT (50,105,40,14); + TabStop = TRUE; + DefButton = TRUE; + }; + Text[ portuguese ] = "Ligao dinmica n. "; + Text[ russian ] = "Dynamic Link No. "; + Text[ greek ] = "Dynamic Link No. "; + Text[ dutch ] = "Dynamische link no. "; + Text[ french ] = "Lien dynamique No. "; + Text[ spanish ] = "Vnculo dinmico nm.: "; + Text[ italian ] = "Dynamic Link No. "; + Text[ danish ] = "Dynamic Link No. "; + Text[ swedish ] = "Dynamic link No. "; + Text[ polish ] = "Dynamic Link No. "; + Text[ portuguese_brazilian ] = "Dynamischer Link Nr. "; + Text[ japanese ] = "Dynamic Link No. "; + Text[ korean ] = " ũ ȣ "; + Text[ chinese_simplified ] = "Dynamischer Link Nr. "; + Text[ chinese_traditional ] = "Dynamic Link No. "; + Text[ arabic ] = "Dynamic Link No. "; + Text[ turkish ] = "Dinamik balant no. "; +}; + +ModalDialog IDD_ABOUT_DIALOG { + Pos = MAP_APPFONT( 58, 17 ); + Size = MAP_APPFONT( 155, 106 ); + SVLook = TRUE; +/* + WINCHILDS = { + FixedText { + Pos = MAP_APPFONT( 40, 5 ); + Size = MAP_APPFONT( 110, 10 ); + TEXT = "StarBasic"; + TEXT [ english_us ] = "StarBasic"; + CENTER = TRUE; + }; + FixedText { + Pos = MAP_APPFONT( 40, 20 ); + Size = MAP_APPFONT( 110, 20 ); + TEXT = "Ojektorientiertes BASIC-Entwicklungssystem"; + TEXT [ english_us ] = "Ojektorientiertes BASIC-Entwicklungssystem"; + CENTER = TRUE; + }; + FixedText { + Pos = MAP_APPFONT( 40, 45 ); + Size = MAP_APPFONT( 110, 10 ); + TEXT = "Version 2.0 Mai 1995"; + TEXT [ english_us ] = "Version 2.0 Mai 1995"; + CENTER = TRUE; + }; + FixedText { + Pos = MAP_APPFONT( 40, 60 ); + Size = MAP_APPFONT( 110, 10 ); + TEXT = "1995 Sun Microsystems, Inc."; + TEXT [ english_us ] = "1995 Sun Microsystems, Inc."; + CENTER = TRUE; + }; + }; +*/ +// FixedIcon RID_ICON { +// Pos = MAP_APPFONT( 20, 26 ); +// Size = MAP_APPFONT( 20, 20 ); +// FIXED = Icon { +// FILE = "basic.ico"; +// }; +// }; + OKButton RID_OK { + Pos = MAP_APPFONT( 55, 80 ); + Size = MAP_APPFONT( 40, 14 ); + DefButton = TRUE; + }; +}; + +ModalDialog IDD_TT_ABOUT_DIALOG { + Pos = MAP_APPFONT( 58, 17 ); + Size = MAP_APPFONT( 155, 106 ); + SVLook = TRUE; + FixedText 1 { + Pos = MAP_APPFONT( 40, 5 ); + Size = MAP_APPFONT( 110, 10 ); + TEXT = "StarTestTool"; + TEXT [ english_us ] = "StarTestTool"; + CENTER = TRUE; + TEXT[ portuguese ] = "StarTestTool"; + TEXT[ russian ] = "StarTestTool"; + TEXT[ greek ] = "StarTestTool"; + TEXT[ dutch ] = "StarTestTool"; + TEXT[ french ] = "StarTestTool"; + TEXT[ spanish ] = "StarTestTool"; + TEXT[ italian ] = "StarTestTool"; + TEXT[ danish ] = "StarTestTool"; + TEXT[ swedish ] = "StarTestTool"; + TEXT[ polish ] = "StarTestTool"; + TEXT[ portuguese_brazilian ] = "StarTestTool"; + TEXT[ japanese ] = "StarTestTool"; + TEXT[ korean ] = "StarTestTool"; + TEXT[ chinese_simplified ] = "StarTestTool"; + TEXT[ chinese_traditional ] = "StarTestTool"; + TEXT[ arabic ] = "StarTestTool"; + TEXT[ turkish ] = "StarTestTool"; + }; + FixedText 3 { + Pos = MAP_APPFONT( 40, 45 ); + Size = MAP_APPFONT( 110, 10 ); + TEXT = "Version 1.0"; + TEXT [ english_us ] = "Version 1.0"; + CENTER = TRUE; + TEXT[ portuguese ] = "Verso 1.0"; + TEXT[ russian ] = "Version 1.0"; + TEXT[ greek ] = "Version 1.0"; + TEXT[ dutch ] = "Versie 1.0"; + TEXT[ french ] = "Version 1.0"; + TEXT[ spanish ] = "Versin 1.0"; + TEXT[ italian ] = "Version 1.0"; + TEXT[ danish ] = "Version 1.0"; + TEXT[ swedish ] = "Version 1.0"; + TEXT[ polish ] = "Version 1.0"; + TEXT[ portuguese_brazilian ] = "Version 1.0"; + TEXT[ japanese ] = "Version 1.0"; + TEXT[ korean ] = " 1.0"; + TEXT[ chinese_simplified ] = "Version 1.0"; + TEXT[ chinese_traditional ] = "Version 1.0"; + TEXT[ arabic ] = "Version 1.0"; + TEXT[ turkish ] = "Srm 1.0"; + }; + FixedText RID_VERSIONSTRING { + Pos = MAP_APPFONT( 40, 55 ); + Size = MAP_APPFONT( 110, 10 ); + Text = UPDVER; + CENTER = TRUE; + }; + FixedText 4 { + Pos = MAP_APPFONT( 40, 70 ); + Size = MAP_APPFONT( 110, 10 ); + TEXT = "1995-1998 Sun Microsystems, Inc."; + TEXT [ english_us ] = "1995-1998 Sun Microsystems, Inc."; + CENTER = TRUE; + TEXT[ portuguese ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ russian ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ greek ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ dutch ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ french ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ spanish ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ italian ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ danish ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ swedish ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ polish ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ portuguese_brazilian ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ japanese ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ korean ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ chinese_simplified ] = "?995-1998 Sun Microsystems, Inc."; + TEXT[ chinese_traditional ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ arabic ] = "1995-1998 Sun Microsystems, Inc."; + TEXT[ turkish ] = "1995-1998 Sun Microsystems, Inc."; + }; +// FixedIcon RID_ICON { +// Pos = MAP_APPFONT( 20, 26 ); +// Size = MAP_APPFONT( 20, 20 ); +// FIXED = Icon { +// FILE = "basic.ico"; +// }; +// }; + OKButton RID_OK { + Pos = MAP_APPFONT( 55, 85 ); + Size = MAP_APPFONT( 40, 14 ); + DefButton = TRUE; + }; +}; + +ModalDialog IDD_FIND_DIALOG { + Pos = MAP_APPFONT( 69, 30 ); + Size = MAP_APPFONT( 185, 70 ); + SVLook = TRUE; + TEXT = "StarBasic: Text suchen"; + TEXT [ english_us ] = "StarBasic: Find Text"; + MOVEABLE = TRUE; + // CLOSEABLE = TRUE; // Hat cancelbutton + + FixedText RID_FIXEDTEXT1 { + Pos = MAP_APPFONT( 5, 10 ); + Size = MAP_APPFONT( 30, 10 ); + TEXT = "~Text"; + TEXT [ english_us ] = "~Text"; + TEXT[ portuguese ] = "~Texto"; + TEXT[ russian ] = "~Text"; + TEXT[ greek ] = "~Text"; + TEXT[ dutch ] = "~Tekst"; + TEXT[ french ] = "~Texte"; + TEXT[ spanish ] = "Te~xto"; + TEXT[ italian ] = "~Text"; + TEXT[ danish ] = "~Text"; + TEXT[ swedish ] = "~Text"; + TEXT[ polish ] = "~Text"; + TEXT[ portuguese_brazilian ] = "~Text"; + TEXT[ japanese ] = ""; + TEXT[ korean ] = "ؽƮ(~T)"; + TEXT[ chinese_simplified ] = "~Text"; + TEXT[ chinese_traditional ] = "~Text"; + TEXT[ arabic ] = "~Text"; + TEXT[ turkish ] = "~Metin"; + }; + Edit RID_FIND { + BORDER = TRUE; + Pos = MAP_APPFONT( 40, 8 ); + Size = MAP_APPFONT( 135, 12 ); + TABSTOP = TRUE; + }; + OKButton RID_OK { + Pos = MAP_APPFONT( 30, 30 ); + Size = MAP_APPFONT( 50, 14 ); + TEXT = "~Suchen"; + TEXT [ english_us ] = "~Find"; + TABSTOP = TRUE; + DefButton = TRUE; + TEXT[ portuguese ] = "~Procurar"; + TEXT[ russian ] = "~Find"; + TEXT[ greek ] = "~Find"; + TEXT[ dutch ] = "~Zoeken"; + TEXT[ french ] = "~Rechercher"; + TEXT[ spanish ] = "~Buscar"; + TEXT[ italian ] = "~Find"; + TEXT[ danish ] = "~Find"; + TEXT[ swedish ] = "~Find"; + TEXT[ polish ] = "~Find"; + TEXT[ portuguese_brazilian ] = "~Suchen"; + TEXT[ japanese ] = ""; + TEXT[ korean ] = "ã(~F)"; + TEXT[ chinese_simplified ] = "~Suchen"; + TEXT[ chinese_traditional ] = "~Find"; + TEXT[ arabic ] = "~Find"; + TEXT[ turkish ] = "~Ara"; + }; + CancelButton RID_CANCEL { + Pos = MAP_APPFONT( 105, 30 ); + Size = MAP_APPFONT( 50, 14 ); + TEXT = "~Abbruch"; + TEXT [ english_us ] = "~Cancel"; + TABSTOP = TRUE; + TEXT[ portuguese ] = "~Cancelar"; + TEXT[ russian ] = "~Cancel"; + TEXT[ greek ] = "~Cancel"; + TEXT[ dutch ] = "~Annuleren"; + TEXT[ french ] = "~Annuler"; + TEXT[ spanish ] = "~Cancelar"; + TEXT[ italian ] = "~Cancel"; + TEXT[ danish ] = "~Cancel"; + TEXT[ swedish ] = "~Cancel"; + TEXT[ polish ] = "~Cancel"; + TEXT[ portuguese_brazilian ] = "~Abbruch"; + TEXT[ japanese ] = "ݾ"; + TEXT[ korean ] = "(~C)"; + TEXT[ chinese_simplified ] = "~Abbruch"; + TEXT[ chinese_traditional ] = "~Cancel"; + TEXT[ arabic ] = "~Cancel"; + TEXT[ turkish ] = "~ptal"; + }; + TEXT[ portuguese ] = "StarOffice Basic: Procurar texto"; + TEXT[ russian ] = "StarBasic: Find Text"; + TEXT[ greek ] = "StarBasic: Find Text"; + TEXT[ dutch ] = "StarOffice Basic: tekst zoeken"; + TEXT[ french ] = "StarBasic: Recherche de texte"; + TEXT[ spanish ] = "StarBasic: Buscar texto"; + TEXT[ italian ] = "StarOffice Basic: Find Text"; + TEXT[ danish ] = "StarBasic: Find Text"; + TEXT[ swedish ] = "StarOffice Basic: Find Text"; + TEXT[ polish ] = "StarBasic: Find Text"; + TEXT[ portuguese_brazilian ] = "StarBasic: Text suchen"; + TEXT[ japanese ] = "StarBasic: ̌"; + TEXT[ korean ] = "StarBasic: ؽƮ ã"; + TEXT[ chinese_simplified ] = "StarBasic: Text suchen"; + TEXT[ chinese_traditional ] = "StarOffice BasicGFind Text"; + TEXT[ arabic ] = "StarBasic: Find Text"; + TEXT[ turkish ] = "StarBasic: Metni ara"; +}; + +ModalDialog IDD_REPLACE_DIALOG { + Pos = MAP_APPFONT( 69, 30 ); + Size = MAP_APPFONT( 185, 88 ); + SVLook = TRUE; + TEXT = "StarBasic: Text ersetzen"; + TEXT [ english_us ] = "StarBasic: Replace Text"; + MOVEABLE = TRUE; + // CLOSEABLE = TRUE; // Hat cancelbutton + FixedText RID_FIXEDTEXT1 { + Pos = MAP_APPFONT( 5, 10 ); + Size = MAP_APPFONT( 55, 10 ); + TEXT = "~Alter Text"; + TEXT [ english_us ] = "~Previous text"; + TEXT[ portuguese ] = "~Antigo texto"; + TEXT[ russian ] = "~Previous text"; + TEXT[ greek ] = "~Previous text"; + TEXT[ dutch ] = "~Oude tekst"; + TEXT[ french ] = "~Ancien texte"; + TEXT[ spanish ] = "~Antiguo texto"; + TEXT[ italian ] = "~Previous text"; + TEXT[ danish ] = "~Previous text"; + TEXT[ swedish ] = "~Previous text"; + TEXT[ polish ] = "~Previous text "; + TEXT[ portuguese_brazilian ] = "~Alter Text"; + TEXT[ japanese ] = ""; + TEXT[ korean ] = " ؽƮ(~P)"; + TEXT[ chinese_simplified ] = "~Alter Text"; + TEXT[ chinese_traditional ] = "~Previous text"; + TEXT[ arabic ] = "~Previous text"; + TEXT[ turkish ] = "~Eski metin"; + }; + FixedText RID_FIXEDTEXT2 { + Pos = MAP_APPFONT( 5, 30 ); + Size = MAP_APPFONT( 55, 10 ); + TEXT = "~Neuer Text"; + TEXT [ english_us ] = "~New text"; + TEXT[ portuguese ] = "~Texto novo"; + TEXT[ russian ] = "~New text"; + TEXT[ greek ] = "~New text"; + TEXT[ dutch ] = "~Nieuwe tekst"; + TEXT[ french ] = "~Nouveau texte"; + TEXT[ spanish ] = "~Nuevo texto"; + TEXT[ italian ] = "~New text"; + TEXT[ danish ] = "~New text"; + TEXT[ swedish ] = "~New text"; + TEXT[ polish ] = "~New text "; + TEXT[ portuguese_brazilian ] = "~Neuer Text"; + TEXT[ japanese ] = "V"; + TEXT[ korean ] = " ؽƮ(~N)"; + TEXT[ chinese_simplified ] = "~Neuer Text"; + TEXT[ chinese_traditional ] = "~New text"; + TEXT[ arabic ] = "~New text"; + TEXT[ turkish ] = "~Yeni metin"; + }; + Edit RID_FIND { + BORDER = TRUE; + Pos = MAP_APPFONT( 65, 8 ); + Size = MAP_APPFONT( 110, 12 ); + TABSTOP = TRUE; + }; + Edit RID_REPLACE { + BORDER = TRUE; + Pos = MAP_APPFONT( 65, 28 ); + Size = MAP_APPFONT( 110, 12 ); + TABSTOP = TRUE; + }; + OKButton RID_OK { + Pos = MAP_APPFONT( 30, 50 ); + Size = MAP_APPFONT( 50, 14 ); + TEXT = "~Ersetzen"; + TEXT [ english_us ] = "~Replace"; + TABSTOP = TRUE; + DefButton = TRUE; + TEXT[ portuguese ] = "~Substituir"; + TEXT[ russian ] = "~Replace"; + TEXT[ greek ] = "~Replace"; + TEXT[ dutch ] = "~Vervangen"; + TEXT[ french ] = "~Remplacer"; + TEXT[ spanish ] = "~Sustituir"; + TEXT[ italian ] = "~Replace"; + TEXT[ danish ] = "~Replace"; + TEXT[ swedish ] = "~Replace"; + TEXT[ polish ] = "~Replace"; + TEXT[ portuguese_brazilian ] = "~Ersetzen"; + TEXT[ japanese ] = "u"; + TEXT[ korean ] = "ٲٱ(~R)"; + TEXT[ chinese_simplified ] = "~Ersetzen"; + TEXT[ chinese_traditional ] = "~Replace"; + TEXT[ arabic ] = "~Replace"; + TEXT[ turkish ] = "~Deitir"; + }; + CancelButton RID_CANCEL { + Pos = MAP_APPFONT( 105, 50 ); + Size = MAP_APPFONT( 50, 14 ); + TEXT = "~Abbruch"; + TEXT [ english_us ] = "~Cancel"; + TABSTOP = TRUE; + TEXT[ portuguese ] = "~Cancelar"; + TEXT[ russian ] = "~Cancel"; + TEXT[ greek ] = "~Cancel"; + TEXT[ dutch ] = "~Annuleren"; + TEXT[ french ] = "~Annuler"; + TEXT[ spanish ] = "~Cancelar"; + TEXT[ italian ] = "~Cancel"; + TEXT[ danish ] = "~Cancel"; + TEXT[ swedish ] = "~Cancel"; + TEXT[ polish ] = "~Cancel "; + TEXT[ portuguese_brazilian ] = "~Abbruch"; + TEXT[ japanese ] = "ݾ"; + TEXT[ korean ] = "(~C)"; + TEXT[ chinese_simplified ] = "~Abbruch"; + TEXT[ chinese_traditional ] = "~Cancel"; + TEXT[ arabic ] = "~Cancel"; + TEXT[ turkish ] = "ptal"; + }; + TEXT[ portuguese ] = "StarOffice Basic: Substituir texto"; + TEXT[ russian ] = "StarBasic: Replace Text"; + TEXT[ greek ] = "StarBasic: Replace Text"; + TEXT[ dutch ] = "StarOffice Basic: tekst vervangen"; + TEXT[ french ] = "StarBasic : Remplacement de texte"; + TEXT[ spanish ] = "StarBasic: Sustituir texto"; + TEXT[ italian ] = "StarOffice Basic: Replace Text"; + TEXT[ danish ] = "StarBasic: Replace Text"; + TEXT[ swedish ] = "StarOffice Basic: Replace Text"; + TEXT[ polish ] = "StarBasic: Replace Text "; + TEXT[ portuguese_brazilian ] = "StarBasic: Text ersetzen"; + TEXT[ japanese ] = "StarBasic: ̒u"; + TEXT[ korean ] = "StarBasic: ؽƮ ٲٱ"; + TEXT[ chinese_simplified ] = "StarBasic: Text ersetzen"; + TEXT[ chinese_traditional ] = "StarOffcie BasicGReplace Text"; + TEXT[ arabic ] = "StarBasic: Replace Text"; + TEXT[ turkish ] = "StarBasic: Metni deitir"; +}; + +InfoBox IDS_NOPRINTERERROR { + MESSAGE = "Drucken steht nicht zur Verfgung!"; + MESSAGE [ english_us ] = "The print function is not available!"; + MESSAGE[ portuguese ] = "A funo de impresso no est disponvel!"; + MESSAGE[ russian ] = "The print function is not available!"; + MESSAGE[ greek ] = "The print function is not available!"; + MESSAGE[ dutch ] = "De functie Afdrukken is niet beschikbaar!"; + MESSAGE[ french ] = "La fonction d'impresssion n'est pas disponible !"; + MESSAGE[ spanish ] = "No disponible la funcin para imprimir!"; + MESSAGE[ italian ] = "The print function is not available!"; + MESSAGE[ danish ] = "The print function is not available!"; + MESSAGE[ swedish ] = "The print function is not available!"; + MESSAGE[ polish ] = "The print function is not available! "; + MESSAGE[ portuguese_brazilian ] = "Drucken steht nicht zur Verfgung!"; + MESSAGE[ japanese ] = "܂!"; + MESSAGE[ korean ] = " ȵ!"; + MESSAGE[ chinese_simplified ] = "Drucken steht nicht zur Verfgung!"; + MESSAGE[ chinese_traditional ] = "The print function is not available!"; + MESSAGE[ arabic ] = "The print function is not available"; + MESSAGE[ turkish ] = "Yazdrma ilevi kullanlamaz!"; +}; +ErrorBox IDS_CANTLOAD { + TITLE = "StarBasic-Fehler"; + TITLE [ english_us ] = "StarBasic Error"; + MESSAGE = "Library kann nicht geladen werden!"; + MESSAGE [ english_us ] = "Library cannot be loaded!"; + MESSAGE[ portuguese ] = "Impossvel carregar a biblioteca!"; + MESSAGE[ russian ] = "Library cannot be loaded!"; + MESSAGE[ greek ] = "Library cannot be loaded!"; + MESSAGE[ dutch ] = "Library kan niet worden geladen!"; + MESSAGE[ french ] = "Impossible de charger la bibliothque !"; + MESSAGE[ spanish ] = "No se puede cargar la biblioteca!"; + MESSAGE[ italian ] = "Library cannot be loaded!"; + MESSAGE[ danish ] = "Library cannot be loaded!"; + MESSAGE[ swedish ] = "Library cannot be loaded!"; + MESSAGE[ polish ] = "Library cannot be loaded! "; + MESSAGE[ portuguese_brazilian ] = "Library kann nicht geladen werden!"; + MESSAGE[ japanese ] = "ײ͓ǂݍ݂ł܂!"; + MESSAGE[ korean ] = "̺귯 ε ϴ!"; + MESSAGE[ chinese_simplified ] = "Library kann nicht geladen werden!"; + MESSAGE[ chinese_traditional ] = "Library cannot be loaded!"; + MESSAGE[ arabic ] = "Library cannot be loaded!"; + Title[ portuguese ] = "StarBasic-Fehler"; + Title[ russian ] = "StarBasic-Fehler"; + Title[ greek ] = "StarBasic Error"; + Title[ dutch ] = "StarBasic-Fehler"; + Title[ french ] = "StarBasic-Fehler"; + Title[ spanish ] = "Error de StarBasic"; + Title[ italian ] = "StarBasic-Fehler"; + Title[ danish ] = "StarBasic Error"; + Title[ swedish ] = "StarBasic Error"; + Title[ polish ] = "Bd StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic-Fehler"; + Title[ japanese ] = "StarBasic-Fehler"; + Title[ korean ] = "StarBasic-Fehler"; + Title[ chinese_simplified ] = "StarBasic-Fehler"; + Title[ chinese_traditional ] = "StarBasic-Fehler"; + Title[ arabic ] = "StarBasic-Fehler"; + MESSAGE[ turkish ] = "Kitaplk yklenemiyor!"; +}; +ErrorBox IDS_CANTSAVE { + TITLE = "StarBasic-Fehler"; + TITLE [ english_us ] = "StarBasic Error"; + MESSAGE = "Library kann nicht gespeichert werden!"; + MESSAGE [ english_us ] = "Library cannot be saved!"; + MESSAGE[ portuguese ] = "Impossvel guardar a biblioteca!"; + MESSAGE[ russian ] = "Library cannot be saved!"; + MESSAGE[ greek ] = "Library cannot be saved!"; + MESSAGE[ dutch ] = "Library kan niet worden opgeslagen!"; + MESSAGE[ french ] = "Impossible d'enregistrer la bibliothque !"; + MESSAGE[ spanish ] = "No se puede guardar la biblioteca!"; + MESSAGE[ italian ] = "Library cannot be saved!"; + MESSAGE[ danish ] = "Library cannot be saved!"; + MESSAGE[ swedish ] = "Library cannot be saved!"; + MESSAGE[ polish ] = "Library cannot be saved! "; + MESSAGE[ portuguese_brazilian ] = "Library kann nicht gespeichert werden!"; + MESSAGE[ japanese ] = "ײ͕ۑł܂!"; + MESSAGE[ korean ] = "̺귯 ʾ!"; + MESSAGE[ chinese_simplified ] = "Library kann nicht gespeichert werden!"; + MESSAGE[ chinese_traditional ] = "Library cannot be saved!"; + MESSAGE[ arabic ] = "Library cannot be saved!"; + Title[ portuguese ] = "StarBasic-Fehler"; + Title[ russian ] = "StarBasic-Fehler"; + Title[ greek ] = "StarBasic Error"; + Title[ dutch ] = "StarBasic-Fehler"; + Title[ french ] = "StarBasic-Fehler"; + Title[ spanish ] = "Error de StarBasic"; + Title[ italian ] = "StarBasic-Fehler"; + Title[ danish ] = "StarBasic Error"; + Title[ swedish ] = "StarBasic Error"; + Title[ polish ] = "Bd StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic-Fehler"; + Title[ japanese ] = "StarBasic-Fehler"; + Title[ korean ] = "StarBasic-Fehler"; + Title[ chinese_simplified ] = "StarBasic-Fehler"; + Title[ chinese_traditional ] = "StarBasic-Fehler"; + Title[ arabic ] = "StarBasic-Fehler"; + MESSAGE[ turkish ] = "Kitaplk kaydedilemiyor!"; +}; +ErrorBox IDS_NOMAINPGM { + TITLE = "StarBasic-Fehler"; + TITLE [ english_us ] = "StarBasic Error"; + MESSAGE = "Dieses Fenster enthlt kein Hauptprogramm!"; + MESSAGE [ english_us ] = "This window does not contain a main program!"; + MESSAGE[ portuguese ] = "Esta janela no contm nenhum programa principal!"; + MESSAGE[ russian ] = "This window does not contain a main program!"; + MESSAGE[ greek ] = "This window does not contain a main program!"; + MESSAGE[ dutch ] = "Dit venster bevat geen hoofdprogramma!"; + MESSAGE[ french ] = "Cette fentre ne contient aucun programme principal !"; + MESSAGE[ spanish ] = "Esta ventana no contiene ningn programa principal!"; + MESSAGE[ italian ] = "The window does not contain a main program!"; + MESSAGE[ danish ] = "This window does not contain a main program!"; + MESSAGE[ swedish ] = "This window does not contain a main program!"; + MESSAGE[ polish ] = "This window does not contain a main program! "; + MESSAGE[ portuguese_brazilian ] = "Dieses Fenster enthlt kein Hauptprogramm!"; + MESSAGE[ japanese ] = "̳ɂҲ۸т͂܂!"; + MESSAGE[ korean ] = " α ϰ ʽϴ !"; + MESSAGE[ chinese_simplified ] = "Dieses Fenster enthlt kein Hauptprogramm!"; + MESSAGE[ chinese_traditional ] = "This window does not contain a main program!"; + MESSAGE[ arabic ] = "This window does not contain a main program!"; + Title[ portuguese ] = "StarBasic-Fehler"; + Title[ russian ] = "StarBasic-Fehler"; + Title[ greek ] = "StarBasic Error"; + Title[ dutch ] = "StarBasic-Fehler"; + Title[ french ] = "StarBasic-Fehler"; + Title[ spanish ] = "Error de StarBasic"; + Title[ italian ] = "StarBasic-Fehler"; + Title[ danish ] = "StarBasic Error"; + Title[ swedish ] = "StarBasic Error"; + Title[ polish ] = "Bd StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic-Fehler"; + Title[ japanese ] = "StarBasic-Fehler"; + Title[ korean ] = "StarBasic-Fehler"; + Title[ chinese_simplified ] = "StarBasic-Fehler"; + Title[ chinese_traditional ] = "StarBasic-Fehler"; + Title[ arabic ] = "StarBasic-Fehler"; + MESSAGE[ turkish ] = "Bu pencere ana program iermiyor!"; +}; +ErrorBox IDS_READERROR { + TITLE = "StarBasic-Fehler"; + TITLE [ english_us ] = "StarBasic Error"; + MESSAGE = "Datei kann nicht eingelesen werden!"; + MESSAGE [ english_us ] = "File cannot be read!"; + MESSAGE[ portuguese ] = "Impossvel ler ficheiro!"; + MESSAGE[ russian ] = "File cannot be read!"; + MESSAGE[ greek ] = "File cannot be read!"; + MESSAGE[ dutch ] = "Bestand kan niet worden gelezen!"; + MESSAGE[ french ] = "Impossible de lire le fichier !"; + MESSAGE[ spanish ] = "No se puede leer el archivo!"; + MESSAGE[ italian ] = "File cannot be read!"; + MESSAGE[ danish ] = "File cannot be read!"; + MESSAGE[ swedish ] = "File cannot be read!"; + MESSAGE[ polish ] = "File cannot be read! "; + MESSAGE[ portuguese_brazilian ] = "Datei kann nicht eingelesen werden!"; + MESSAGE[ japanese ] = "̧ق͓ǂݎ܂!"; + MESSAGE[ korean ] = " ϴ!"; + MESSAGE[ chinese_simplified ] = "Datei kann nicht eingelesen werden!"; + MESSAGE[ chinese_traditional ] = "File cannot be read!"; + MESSAGE[ arabic ] = "File cannot be read!"; + Title[ portuguese ] = "StarBasic-Fehler"; + Title[ russian ] = "StarBasic-Fehler"; + Title[ greek ] = "StarBasic Error"; + Title[ dutch ] = "StarBasic-Fehler"; + Title[ french ] = "StarBasic-Fehler"; + Title[ spanish ] = "Error de StarBasic"; + Title[ italian ] = "StarBasic-Fehler"; + Title[ danish ] = "StarBasic Error"; + Title[ swedish ] = "StarBasic Error"; + Title[ polish ] = "Bd StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic-Fehler"; + Title[ japanese ] = "StarBasic-Fehler"; + Title[ korean ] = "StarBasic-Fehler"; + Title[ chinese_simplified ] = "StarBasic-Fehler"; + Title[ chinese_traditional ] = "StarBasic-Fehler"; + Title[ arabic ] = "StarBasic-Fehler"; + MESSAGE[ turkish ] = "Dosya okunamyor!"; +}; +ErrorBox IDS_WRITEERROR { + TITLE = "StarBasic-Fehler"; + TITLE [ english_us ] = "StarBasic Error"; + MESSAGE = "Datei kann nicht abgespeichert werden!"; + MESSAGE [ english_us ] = "File cannot be saved!"; + MESSAGE[ portuguese ] = "Impossvel guardar ficheiro!"; + MESSAGE[ russian ] = "File cannot be saved!"; + MESSAGE[ greek ] = "File cannot be saved!"; + MESSAGE[ dutch ] = "Bestand kan niet worden opgeslagen!"; + MESSAGE[ french ] = "Impossible d'enregister le fichier !"; + MESSAGE[ spanish ] = "No se puede guardar el archivo!"; + MESSAGE[ italian ] = "File cannt be saved!"; + MESSAGE[ danish ] = "File cannot be saved!"; + MESSAGE[ swedish ] = "File cannot be saved!"; + MESSAGE[ polish ] = "File cannot be saved! "; + MESSAGE[ portuguese_brazilian ] = "Datei kann nicht abgespeichert werden!"; + MESSAGE[ japanese ] = "̧ق͕ۑł܂!"; + MESSAGE[ korean ] = " ʾҽϴ !"; + MESSAGE[ chinese_simplified ] = "Datei kann nicht abgespeichert werden!"; + MESSAGE[ chinese_traditional ] = "File cannot be saved!"; + MESSAGE[ arabic ] = "File cannot be saved!"; + Title[ portuguese ] = "StarBasic-Fehler"; + Title[ russian ] = "StarBasic-Fehler"; + Title[ greek ] = "StarBasic Error"; + Title[ dutch ] = "StarBasic-Fehler"; + Title[ french ] = "StarBasic-Fehler"; + Title[ spanish ] = "Error de StarBasic"; + Title[ italian ] = "StarBasic-Fehler"; + Title[ danish ] = "StarBasic Error"; + Title[ swedish ] = "StarBasic Error"; + Title[ polish ] = "Bd StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic-Fehler"; + Title[ japanese ] = "StarBasic-Fehler"; + Title[ korean ] = "StarBasic-Fehler"; + Title[ chinese_simplified ] = "StarBasic-Fehler"; + Title[ chinese_traditional ] = "StarBasic-Fehler"; + Title[ arabic ] = "StarBasic-Fehler"; + MESSAGE[ turkish ] = "Dosya kaydedilemiyor!"; +}; +ErrorBox IDS_PATTERNNOTFOUND { + TITLE = "StarBasic-Fehler"; + TITLE [ english_us ] = "StarBasic Error"; + MESSAGE = "Suchbegriff nicht gefunden!"; + MESSAGE [ english_us ] = "Search key not found!"; + MESSAGE[ portuguese ] = "Impossvel encontrar expresso procurada!"; + MESSAGE[ russian ] = "Search key not found!"; + MESSAGE[ greek ] = "Search key not found!"; + MESSAGE[ dutch ] = "Zoekbegrip niet gevonden!"; + MESSAGE[ french ] = "lment recherch introuvable !"; + MESSAGE[ spanish ] = "No se encontr el trmino buscado!"; + MESSAGE[ italian ] = "Search key not found!"; + MESSAGE[ danish ] = "Search key not found!"; + MESSAGE[ swedish ] = "Search term not found!"; + MESSAGE[ polish ] = "Search key not found!"; + MESSAGE[ portuguese_brazilian ] = "Suchbegriff nicht gefunden!"; + MESSAGE[ japanese ] = "͌܂!"; + MESSAGE[ korean ] = "˻ ã !"; + MESSAGE[ chinese_simplified ] = "Suchbegriff nicht gefunden!"; + MESSAGE[ chinese_traditional ] = "Search key not found!"; + MESSAGE[ arabic ] = "Search term not found!"; + Title[ portuguese ] = "StarBasic-Fehler"; + Title[ russian ] = "StarBasic-Fehler"; + Title[ greek ] = "StarBasic Error"; + Title[ dutch ] = "StarBasic-Fehler"; + Title[ french ] = "StarBasic-Fehler"; + Title[ spanish ] = "Error de StarBasic"; + Title[ italian ] = "StarBasic-Fehler"; + Title[ danish ] = "StarBasic Error"; + Title[ swedish ] = "StarBasic Error"; + Title[ polish ] = "Bd StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic-Fehler"; + Title[ japanese ] = "StarBasic-Fehler"; + Title[ korean ] = "StarBasic-Fehler"; + Title[ chinese_simplified ] = "StarBasic-Fehler"; + Title[ chinese_traditional ] = "StarBasic-Fehler"; + Title[ arabic ] = "StarBasic-Fehler"; + MESSAGE[ turkish ] = "Arama terimi bulunamad!"; +}; +ErrorBox IDS_INVALID_VALUE { + TITLE = "StarBasic-Fehler"; + TITLE [ english_us ] = "StarBasic Error"; + MESSAGE = "Der Wert ist ungltig und kann daher nicht gesetzt werden."; + MESSAGE [ english_us ] = "The value is invalid and cannot be set."; + MESSAGE[ portuguese ] = "O valor no vlido e no pode ser aplicado."; + MESSAGE[ russian ] = " ."; + MESSAGE[ greek ] = "The value is invalid and cannot be set."; + MESSAGE[ dutch ] = "De waarde is ongeldig en kan daarom niet worden gebruikt."; + MESSAGE[ french ] = "Valeur incorrecte, impossible de la placer."; + MESSAGE[ spanish ] = "Valor incorrecto; no se puede aplicar."; + MESSAGE[ italian ] = "The value is invalid and cannot be set."; + MESSAGE[ danish ] = "The value is invalid and cannot be set."; + MESSAGE[ swedish ] = "The value is invalid and cannot be set."; + MESSAGE[ polish ] = "Warto jest nieprawdiowa i nie mona jeje dlatego osadzi."; + MESSAGE[ portuguese_brazilian ] = "Der Wert ist ungltig und kann daher nicht gesetzt werden."; + MESSAGE[ japanese ] = "lȂ̂Őݒł܂B"; + MESSAGE[ korean ] = "ȿ ̹Ƿ ϴ ."; + MESSAGE[ chinese_simplified ] = "The value is invalid and cannot be set."; + MESSAGE[ chinese_traditional ] = "The value is invalid and cannot be set."; + MESSAGE[ arabic ] = "The value is invalid and cannot be set."; + Title[ portuguese ] = "StarBasic Error"; + Title[ russian ] = "StarBasic Error"; + Title[ greek ] = "StarBasic Error"; + Title[ dutch ] = "StarBasic Error"; + Title[ french ] = "StarBasic Error"; + Title[ spanish ] = "StarBasic Error"; + Title[ italian ] = "StarBasic Error"; + Title[ danish ] = "StarBasic Error"; + Title[ swedish ] = "StarBasic Error"; + Title[ polish ] = "Bd StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic Error"; + Title[ japanese ] = "StarBasic Error"; + Title[ korean ] = "StarBasic Error"; + Title[ chinese_simplified ] = "StarBasic Error"; + Title[ chinese_traditional ] = "StarBasic Error"; + Title[ arabic ] = "StarBasic Error"; + MESSAGE[ turkish ] = "Bu deer geersiz olduu iin belirlenemez."; +}; + +QueryBox IDS_ASKSAVEERROR { + TITLE = "StarBasic"; + TITLE [ english_us ] = "StarBasic"; + MESSAGE = "Fehler beim Speichern der Dateien! Trotzdem ausfhren?"; + MESSAGE [ english_us ] = "Error saving files! Run anyway?"; + BUTTONS = WB_YES_NO; + MESSAGE[ portuguese ] = "Ocorreu um erro ao guardar os ficheiros!Mesmo assim, executar?"; + MESSAGE[ russian ] = "Error saving files! Run anyway?"; + MESSAGE[ greek ] = "Error saving files! Run anyway?"; + MESSAGE[ dutch ] = "Fout bij opslaan van bestanden! Toch uitvoeren?"; + MESSAGE[ french ] = "Une erreur s'est produite lors de l'enregistrement des fichiers ! Souhaitez-vous quand mme poursuivre l'excution ?"; + MESSAGE[ spanish ] = "Error al guardar los archivos! Ejecutar de todas formas?"; + MESSAGE[ italian ] = "Error saving files! Run anyway?"; + MESSAGE[ danish ] = "Error saving files! Run anyway?"; + MESSAGE[ swedish ] = "Error saving files! Run anyway?"; + MESSAGE[ polish ] = "Error saving files! Run anyway? "; + MESSAGE[ portuguese_brazilian ] = "Fehler beim Speichern der Dateien! Trotzdem ausfhren?"; + MESSAGE[ japanese ] = "̧ق̕ۑ̍ۂ̴װ! łs܂?"; + MESSAGE[ korean ] = " ߽ϴ! Ͻðڽϱ?"; + MESSAGE[ chinese_simplified ] = "Fehler beim Speichern der Dateien! Trotzdem ausfhren?"; + MESSAGE[ chinese_traditional ] = "Error saving files! Run anyway?"; + MESSAGE[ arabic ] = "Error saving files! Run anyway?"; + Title[ portuguese ] = "StarBasic"; + Title[ russian ] = "StarBasic"; + Title[ greek ] = "StarBasic"; + Title[ dutch ] = "StarBasic"; + Title[ french ] = "StarBasic"; + Title[ spanish ] = "StarBasic"; + Title[ italian ] = "StarBasic"; + Title[ danish ] = "StarBasic"; + Title[ swedish ] = "StarBasic"; + Title[ polish ] = "StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic"; + Title[ japanese ] = "StarBasic"; + Title[ korean ] = "StarBasic"; + Title[ chinese_simplified ] = "StarBasic"; + Title[ chinese_traditional ] = "StarBasic"; + Title[ arabic ] = "StarBasic"; + MESSAGE[ turkish ] = "Dosya kayd srasnda bir hata ortaya kt! lem yine de yrtlsn m?"; +}; +QueryBox IDS_ASK_DIRTY_SAVE { + TITLE = "StarBasic"; + TITLE [ english_us ] = "StarBasic"; + MESSAGE = "Datei ist gendert worden. Abspeichern?"; + MESSAGE [ english_us ] = "File has been changed. Save?"; + BUTTONS = WB_YES_NO_CANCEL; + MESSAGE[ portuguese ] = "O ficheiro foi modificado. Guardar?"; + MESSAGE[ russian ] = "File has been changed. Save?"; + MESSAGE[ greek ] = "File has been changed. Save?"; + MESSAGE[ dutch ] = "Bestand is gewijzigd. Opslaan?"; + MESSAGE[ french ] = "Le fichier a t modifi. Souhaitez-vous l'enregistrer ?"; + MESSAGE[ spanish ] = "El archivo ha sido modificado. Guardar?"; + MESSAGE[ italian ] = "File has been changed. Save?"; + MESSAGE[ danish ] = "File has been changed. Save?"; + MESSAGE[ swedish ] = "File has been changed. Save?"; + MESSAGE[ polish ] = "File has been changed. Save? "; + MESSAGE[ portuguese_brazilian ] = "Datei ist gendert worden. Abspeichern?"; + MESSAGE[ japanese ] = "̧قύXĂ܂B㏑܂?"; + MESSAGE[ korean ] = " ٲϴ. Ͻðڽϱ?"; + MESSAGE[ chinese_simplified ] = "Datei ist gendert worden. Abspeichern?"; + MESSAGE[ chinese_traditional ] = "File has been changed. Save?"; + MESSAGE[ arabic ] = "File has been changed. Save?"; + Title[ portuguese ] = "StarBasic"; + Title[ russian ] = "StarBasic"; + Title[ greek ] = "StarBasic"; + Title[ dutch ] = "StarBasic"; + Title[ french ] = "StarBasic"; + Title[ spanish ] = "StarBasic"; + Title[ italian ] = "StarBasic"; + Title[ danish ] = "StarBasic"; + Title[ swedish ] = "StarBasic"; + Title[ polish ] = "StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic"; + Title[ japanese ] = "StarBasic"; + Title[ korean ] = "StarBasic"; + Title[ chinese_simplified ] = "StarBasic"; + Title[ chinese_traditional ] = "StarBasic"; + Title[ arabic ] = "StarBasic"; + MESSAGE[ turkish ] = "Dosya deitirildi. Deiiklikler kaydedilsin mi?"; +}; +QueryBox IDS_ASK_DIRTY_AND_DISKCHANGE_SAVE { + TITLE = "StarBasic"; + TITLE [ english_us ] = "StarBasic"; + MESSAGE = "Datei ist auf dem Datentrger und\nim Editor gendert worden. Abspeichern?"; + MESSAGE [ english_us ] = "File has been changed on data medium\nand in the Editor. Save?"; + BUTTONS = WB_YES_NO_CANCEL; + MESSAGE[ portuguese ] = "O ficheiro foi modificado no suporte\nde dados e no Editor. Guardar?"; + MESSAGE[ russian ] = "File has been changed on data medium\nand in the Editor. Save?"; + MESSAGE[ greek ] = "File has been changed on data medium\nand in the Editor. Save?"; + MESSAGE[ dutch ] = "Bestand op datamedium en \nin editor werd gewijzigd. Opslaan?"; + MESSAGE[ french ] = "Le fichier a t modifi sur le mdia\net dans l'diteur. Enregistrer ?"; + MESSAGE[ spanish ] = "El archivo se ha modificado en el disco\ny en el editor. Desea guardarlo?"; + MESSAGE[ italian ] = "File has been changed on data medium\nand in the Editor. Save?"; + MESSAGE[ danish ] = "File has been changed on data medium\nand in the Editor. Save?"; + MESSAGE[ swedish ] = "File has been changed on data medium\nand in the Editor. Save?"; + MESSAGE[ polish ] = "File has been changed on data medium\nand in the Editor. Save? "; + MESSAGE[ portuguese_brazilian ] = "Datei ist auf dem Datentrger und\nim Editor gendert worden. Abspeichern?"; + MESSAGE[ japanese ] = "̧قި\nҏWɕύXĂ܂B㏑܂?"; + MESSAGE[ korean ] = " ü ̺Ǿϴ. \nϽðڽϱ ?"; + MESSAGE[ chinese_simplified ] = "Datei ist auf dem Datentrger und\nim Editor gendert worden. Abspeichern?"; + MESSAGE[ chinese_traditional ] = "File has been changed on data medium\nand in the Editor. Save?"; + MESSAGE[ arabic ] = "File has been changed on data medium\nand in the Editor. Save?"; + Title[ portuguese ] = "StarBasic"; + Title[ russian ] = "StarBasic"; + Title[ greek ] = "StarBasic"; + Title[ dutch ] = "StarBasic"; + Title[ french ] = "StarBasic"; + Title[ spanish ] = "StarBasic"; + Title[ italian ] = "StarBasic"; + Title[ danish ] = "StarBasic"; + Title[ swedish ] = "StarBasic"; + Title[ polish ] = "StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic"; + Title[ japanese ] = "StarBasic"; + Title[ korean ] = "StarBasic"; + Title[ chinese_simplified ] = "StarBasic"; + Title[ chinese_traditional ] = "StarBasic"; + Title[ arabic ] = "StarBasic"; + MESSAGE[ turkish ] = "Dosya, veri kayt ortamnda\nve editrde deitirildi. Kaydedilsin mi?"; +}; +QueryBox IDS_ASK_DISKCHANGE_SAVE { + TITLE = "StarBasic"; + TITLE [ english_us ] = "StarBasic"; + MESSAGE = "Datei ist auf dem Datentrger gendert worden.\nberschreiben?"; + MESSAGE [ english_us ] = "File has been changed on data medium.\nOverwrite?"; + BUTTONS = WB_YES_NO_CANCEL; + MESSAGE[ portuguese ] = "O ficheiro foi modificado no suporte de dados.\nSobregravar?"; + MESSAGE[ russian ] = "File has been changed on data medium.\nOverwrite?"; + MESSAGE[ greek ] = "File has been changed on data medium.\nOverwrite?"; + MESSAGE[ dutch ] = "Bestand op het datamedium werd gewijzigd.\nOverschrijven?"; + MESSAGE[ french ] = "Le fichier a t modifi sur le mdia.\nRemplacer ?"; + MESSAGE[ spanish ] = "El archivo en el disco se ha modificado\nDesea sobrescribirlo?"; + MESSAGE[ italian ] = "File has been changed on data medium.\nOverwrite?"; + MESSAGE[ danish ] = "File has been changed on data medium.\nOverwrite?"; + MESSAGE[ swedish ] = "File has been changed on data medium.\nOverwrite?"; + MESSAGE[ polish ] = "File has been changed on data medium.\nOverwrite? "; + MESSAGE[ portuguese_brazilian ] = "Datei ist auf dem Datentrger gendert worden.\nberschreiben?"; + MESSAGE[ japanese ] = "̧قިŕύXĂ܂B\n㏑܂?"; + MESSAGE[ korean ] = " ü ̺Ǿϴ. \n ðڽϱ?"; + MESSAGE[ chinese_simplified ] = "Datei ist auf dem Datentrger gendert worden.\nberschreiben?"; + MESSAGE[ chinese_traditional ] = "File has been changed on data medium.\nOverwrite?"; + MESSAGE[ arabic ] = "File has been changed on data medium.\nOverwrite?"; + Title[ portuguese ] = "StarBasic"; + Title[ russian ] = "StarBasic"; + Title[ greek ] = "StarBasic"; + Title[ dutch ] = "StarBasic"; + Title[ french ] = "StarBasic"; + Title[ spanish ] = "StarBasic"; + Title[ italian ] = "StarBasic"; + Title[ danish ] = "StarBasic"; + Title[ swedish ] = "StarBasic"; + Title[ polish ] = "StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic"; + Title[ japanese ] = "StarBasic"; + Title[ korean ] = "StarBasic"; + Title[ chinese_simplified ] = "StarBasic"; + Title[ chinese_traditional ] = "StarBasic"; + Title[ arabic ] = "StarBasic"; + MESSAGE[ turkish ] = "Dosya, veri ortamnda deitirildi.\nKaydedilsin mi?"; +}; +QueryBox IDS_ASKRELOAD { + TITLE = "StarBasic"; + TITLE [ english_us ] = "StarBasic"; + MESSAGE = "Datei ist auf dem Datentrger gendert worden. Erneut Laden?"; + MESSAGE [ english_us ] = "File has been changed on data medium. Reload?"; + BUTTONS = WB_YES_NO; + MESSAGE[ portuguese ] = "O ficheiro foi modificado no suporte de dados. Recarregar?"; + MESSAGE[ russian ] = "File has been changed on data medium. Reload?"; + MESSAGE[ greek ] = "File has been changed on data medium. Reload?"; + MESSAGE[ dutch ] = "Bestand op het datamedium werd gewijzigd. Opnieuw laden?"; + MESSAGE[ french ] = "Le fichier a t modifi sur le mdia. Recharger ?"; + MESSAGE[ spanish ] = "Se ha modificado el archivo en el disco. Desea recargarlo?"; + MESSAGE[ italian ] = "File has been changed on data medium. Reload?"; + MESSAGE[ danish ] = "File has been changed on data medium. Reload?"; + MESSAGE[ swedish ] = "File has been changed on data medium. Reload?"; + MESSAGE[ polish ] = "File has been changed on data medium. Reload? "; + MESSAGE[ portuguese_brazilian ] = "Datei ist auf dem Datentrger gendert worden. Erneut Laden?"; + MESSAGE[ japanese ] = "̧قިŕύXĂ܂Bēǂݍ݂܂?"; + MESSAGE[ korean ] = " ü ̺Ǿϴ. ٽ εϰڽϱ?"; + MESSAGE[ chinese_simplified ] = "Datei ist auf dem Datentrger gendert worden. Erneut Laden?"; + MESSAGE[ chinese_traditional ] = "File has been changed on data medium. Reload?"; + MESSAGE[ arabic ] = "File has been changed on data medium. Reload?"; + Title[ portuguese ] = "StarBasic"; + Title[ russian ] = "StarBasic"; + Title[ greek ] = "StarBasic"; + Title[ dutch ] = "StarBasic"; + Title[ french ] = "StarBasic"; + Title[ spanish ] = "StarBasic"; + Title[ italian ] = "StarBasic"; + Title[ danish ] = "StarBasic"; + Title[ swedish ] = "StarBasic"; + Title[ polish ] = "StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic"; + Title[ japanese ] = "StarBasic"; + Title[ korean ] = "StarBasic"; + Title[ chinese_simplified ] = "StarBasic"; + Title[ chinese_traditional ] = "StarBasic"; + Title[ arabic ] = "StarBasic"; + MESSAGE[ turkish ] = "Dosya, veri ortamnda deitirildi. Yeniden yklensin mi?"; +}; +QueryBox IDS_ASKDIRTYRELOAD { + TITLE = "StarBasic"; + TITLE [ english_us ] = "StarBasic"; + MESSAGE = "Datei ist auf dem Datentrger und\nim Editor gendert worden. Erneut Laden?"; + MESSAGE [ english_us ] = "File has been changed on data medium\nand in the Editor. Reload?"; + BUTTONS = WB_YES_NO; + MESSAGE[ portuguese ] = "O ficheiro foi modificado no\\suporte de dados e no Editor. Recarregar?"; + MESSAGE[ russian ] = "File has been changed on data medium\nand in the Editor. Reload?"; + MESSAGE[ greek ] = "File has been changed on data medium\nand in the Editor. Reload?"; + MESSAGE[ dutch ] = "Bestand op het datamedium en\nin de editor werd gewijzigd. Opnieuw laden?"; + MESSAGE[ french ] = "Le fichier a t modifi sur le mdia\net dans l'diteur. Recharger ?"; + MESSAGE[ spanish ] = "Se ha modificado el archivo en el disco y\nen el editor. Desea recargarlo?"; + MESSAGE[ italian ] = "File has been changed on data medium\nand in the Editor. Reload?"; + MESSAGE[ danish ] = "File has been changed on data medium\nand in the Editor. Reload?"; + MESSAGE[ swedish ] = "File has been changed on data medium\nand in the Editor. Reload?"; + MESSAGE[ polish ] = "File has been changed on data medium\nand in the Editor. Reload? "; + MESSAGE[ portuguese_brazilian ] = "Datei ist auf dem Datentrger und\nim Editor gendert worden. Erneut Laden?"; + MESSAGE[ japanese ] = "̧قި\nҏWɕύXĂ܂Bēǂݍ݂܂?"; + MESSAGE[ korean ] = " ü ̺Ǿϴ. \n ٽ εϰڽϱ?"; + MESSAGE[ chinese_simplified ] = "Datei ist auf dem Datentrger und\nim Editor gendert worden. Erneut Laden?"; + MESSAGE[ chinese_traditional ] = "File has been changed on data medium\nand in the Editor. Reload?"; + MESSAGE[ arabic ] = "File has been changed on data medium\nand in the Editor. Reload?"; + Title[ portuguese ] = "StarBasic"; + Title[ russian ] = "StarBasic"; + Title[ greek ] = "StarBasic"; + Title[ dutch ] = "StarBasic"; + Title[ french ] = "StarBasic"; + Title[ spanish ] = "StarBasic"; + Title[ italian ] = "StarBasic"; + Title[ danish ] = "StarBasic"; + Title[ swedish ] = "StarBasic"; + Title[ polish ] = "StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic"; + Title[ japanese ] = "StarBasic"; + Title[ korean ] = "StarBasic"; + Title[ chinese_simplified ] = "StarBasic"; + Title[ chinese_traditional ] = "StarBasic"; + Title[ arabic ] = "StarBasic"; + MESSAGE[ turkish ] = "Dosya, veri ortamnda ve\neditrde deitirildi deitirildi. Yeniden yklensin mi?"; +}; +QueryBox IDS_RUNNING { + TITLE = "StarBasic"; + TITLE [ english_us ] = "StarBasic"; + MESSAGE = "BASIC-Programm ist noch aktiv! Dennoch beenden?"; + MESSAGE [ english_us ] = "BASIC is still running! Exit anyway?"; + BUTTONS = WB_YES_NO; + MESSAGE[ portuguese ] = "O programa BASIC ainda est activo! Mesmo assim, sair?"; + MESSAGE[ russian ] = "BASIC is still running! Exit anyway?"; + MESSAGE[ greek ] = "BASIC is still running! Exit anyway?"; + MESSAGE[ dutch ] = "BASIC-programma is nog actief! Toch beindigen?"; + MESSAGE[ french ] = "BASIC est encore actif ! tes-vous sr de vouloir quitter le programme ?"; + MESSAGE[ spanish ] = "El programa BASIC est an activo! Desea cerrar de todas formas?"; + MESSAGE[ italian ] = "BASIC is still running! Exit anyway?"; + MESSAGE[ danish ] = "BASIC is still running! Exit anyway?"; + MESSAGE[ swedish ] = "BASIC is still running! Exit anyway?"; + MESSAGE[ polish ] = "BASIC is still running! Exit anyway? "; + MESSAGE[ portuguese_brazilian ] = "BASIC-Programm ist noch aktiv! Dennoch beenden?"; + MESSAGE[ japanese ] = "BASIC۸т͂܂èނɂȂĂ܂! ̂܂I܂?"; + MESSAGE[ korean ] = "BASIC α ۵Դϴ. Ͻðڽϱ??"; + MESSAGE[ chinese_simplified ] = "BASIC-Programm ist noch aktiv! Dennoch beenden?"; + MESSAGE[ chinese_traditional ] = "BASIC is still running! Exit anyway?"; + MESSAGE[ arabic ] = "BASIC is still running! Exit anyway?"; + Title[ portuguese ] = "StarBasic"; + Title[ russian ] = "StarBasic"; + Title[ greek ] = "StarBasic"; + Title[ dutch ] = "StarBasic"; + Title[ french ] = "StarBasic"; + Title[ spanish ] = "StarBasic"; + Title[ italian ] = "StarBasic"; + Title[ danish ] = "StarBasic"; + Title[ swedish ] = "StarBasic"; + Title[ polish ] = "StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic"; + Title[ japanese ] = "StarBasic"; + Title[ korean ] = "StarBasic"; + Title[ chinese_simplified ] = "StarBasic"; + Title[ chinese_traditional ] = "StarBasic"; + Title[ arabic ] = "StarBasic"; + MESSAGE[ turkish ] = "BASIC program hl etkin. Yine de kmak istiyor musunuz?"; +}; +QueryBox IDS_LOSS_OF_INFORMATION { + TITLE = "StarBasic"; + TITLE [ english_us ] = "StarBasic"; + MESSAGE = "Speichern in Fremdformat verursacht Informationsverlust"; + MESSAGE [ english_us ] = "Saving in an external format causes information loss."; + BUTTONS = WB_OK_CANCEL; + MESSAGE[ portuguese ] = "Guardar em formatos externos causar perda de informao."; + MESSAGE[ russian ] = " "; + MESSAGE[ greek ] = "Saving in an external format causes information loss."; + MESSAGE[ dutch ] = "Door het opslaan in een extern formaat kan informatie verloren gaan."; + MESSAGE[ french ] = "L'enregistrement dans un format externe entrane une perte d'informations."; + MESSAGE[ spanish ] = "Al guardar en formato externo se perder informacin"; + MESSAGE[ italian ] = "Saving in an external format causes information loss."; + MESSAGE[ danish ] = "Saving in an external format causes information loss."; + MESSAGE[ swedish ] = "Saving in an external format causes information loss."; + MESSAGE[ polish ] = "Zapisanie w innym formacie spowoduje utrat informacji"; + MESSAGE[ portuguese_brazilian ] = "BASIC is still running! Exit anyway?"; + MESSAGE[ japanese ] = "ȌݒŕۑƏƂɂȂ܂"; + MESSAGE[ korean ] = "ܺ ս մϴ."; + MESSAGE[ chinese_simplified ] = "Saving in an external format causes information loss."; + MESSAGE[ chinese_traditional ] = "Saving in an external format causes information loss."; + MESSAGE[ arabic ] = "Saving in an external format causes information loss."; + Title[ portuguese ] = "StarBasic"; + Title[ russian ] = "StarBasic"; + Title[ greek ] = "StarBasic"; + Title[ dutch ] = "StarBasic"; + Title[ french ] = "StarBasic"; + Title[ spanish ] = "StarBasic"; + Title[ italian ] = "StarBasic"; + Title[ danish ] = "StarBasic"; + Title[ swedish ] = "StarBasic"; + Title[ polish ] = "StarBasic"; + Title[ portuguese_brazilian ] = "StarBasic"; + Title[ japanese ] = "StarBasic"; + Title[ korean ] = "StarBasic"; + Title[ chinese_simplified ] = "StarBasic"; + Title[ chinese_traditional ] = "StarBasic"; + Title[ arabic ] = "StarBasic"; + MESSAGE[ turkish ] = "Yabanc formatta kaydetmek bilgi kaybna yol aar"; +}; + +InfoBox IDS_NOT_YET_IMPLEMENTED +{ + MESSAGE = "Noch nicht implementiert"; + MESSAGE[ english_us ] = "Not yet implemented"; + MESSAGE[ portuguese ] = "Ainda no implementado"; + MESSAGE[ russian ] = " "; + MESSAGE[ greek ] = "Not yet implemented"; + MESSAGE[ dutch ] = "Nog niet gemplementeerd"; + MESSAGE[ french ] = "Pas encore implment"; + MESSAGE[ spanish ] = "Todava no implementado"; + MESSAGE[ italian ] = "Not yet implemented"; + MESSAGE[ danish ] = "Not yet implemented"; + MESSAGE[ swedish ] = "Not yet implemented"; + MESSAGE[ polish ] = "Na razie nie implementowane"; + MESSAGE[ portuguese_brazilian ] = "Noch nicht implementiert"; + MESSAGE[ japanese ] = "܂Ă܂"; + MESSAGE[ korean ] = " ʾҽϴ."; + MESSAGE[ chinese_simplified ] = "Not yet implemented"; + MESSAGE[ chinese_traditional ] = "Not yet implemented"; + MESSAGE[ arabic ] = "Not yet implemented"; + MESSAGE[ turkish ] = "Henz uygulanmad"; +}; + + +String IDS_WARNING1 { + TEXT = "Warnung "; + TEXT [ english_us ] = "Warning "; + TEXT[ portuguese ] = "Aviso "; + TEXT[ russian ] = "Warning "; + TEXT[ greek ] = "Warning "; + TEXT[ dutch ] = "Waarschuwing "; + TEXT[ french ] = "Attention !"; + TEXT[ spanish ] = "Advertencia "; + TEXT[ italian ] = "Warning "; + TEXT[ danish ] = "Warning "; + TEXT[ swedish ] = "Warning "; + TEXT[ polish ] = "Warning "; + TEXT[ portuguese_brazilian ] = "Warnung "; + TEXT[ japanese ] = "x "; + TEXT[ korean ] = " "; + TEXT[ chinese_simplified ] = "Warnung "; + TEXT[ chinese_traditional ] = "Warning "; + TEXT[ arabic ] = "Warning "; + TEXT[ turkish ] = "Uyar "; +}; +String IDS_ERROR1 { + TEXT = "Fehler "; + TEXT [ english_us ] = "Error "; + TEXT[ portuguese ] = "Erro "; + TEXT[ russian ] = "Error "; + TEXT[ greek ] = "Error "; + TEXT[ dutch ] = "Fout "; + TEXT[ french ] = "Erreur "; + TEXT[ spanish ] = "Error "; + TEXT[ italian ] = "Error "; + TEXT[ danish ] = "Error "; + TEXT[ swedish ] = "Error "; + TEXT[ polish ] = "Error "; + TEXT[ portuguese_brazilian ] = "Fehler "; + TEXT[ japanese ] = "װ "; + TEXT[ korean ] = " "; + TEXT[ chinese_simplified ] = "Fehler "; + TEXT[ chinese_traditional ] = "Error "; + TEXT[ arabic ] = "Error "; + TEXT[ turkish ] = "Hata "; +}; +String IDS_ERROR2 { + TEXT = " in Zeile "; + TEXT [ english_us ] = "in row "; + TEXT[ portuguese ] = "na linha "; + TEXT[ russian ] = "in row "; + TEXT[ greek ] = "in row "; + TEXT[ dutch ] = "in regel "; + TEXT[ french ] = " la ligne "; + TEXT[ spanish ] = "en fila "; + TEXT[ italian ] = "in row "; + TEXT[ danish ] = "in row "; + TEXT[ swedish ] = "in row "; + TEXT[ polish ] = "in row "; + TEXT[ portuguese_brazilian ] = "in Zeile "; + TEXT[ japanese ] = "s "; + TEXT[ korean ] = " "; + TEXT[ chinese_simplified ] = "in Zeile "; + TEXT[ chinese_traditional ] = "in row "; + TEXT[ arabic ] = "in row "; + TEXT[ turkish ] = "Satr: "; +}; +String IDS_NO_LONGNAME { + TEXT = "Kein Eintrag in Hid.Lst"; + TEXT[ english_us ] = "No entries in Hid.Lst"; + TEXT[ portuguese ] = "Nenhuma entrada em Hid.Lst"; + TEXT[ russian ] = " Hid.Lst "; + TEXT[ greek ] = "No entries in Hid.Lst"; + TEXT[ dutch ] = "Geen item in Hid.Lst"; + TEXT[ french ] = "Aucune entre dans Hid.Lst"; + TEXT[ spanish ] = "Ninguna entrada en Hid.Lst"; + TEXT[ italian ] = "No esntries in Hid.Lst"; + TEXT[ danish ] = "No entries in Hid.Lst"; + TEXT[ swedish ] = "No entries in Hid.Lst"; + TEXT[ polish ] = "Brak wpisu w Hid.Lst"; + TEXT[ portuguese_brazilian ] = "Kein Eintrag in Hid.Lst"; + TEXT[ japanese ] = "Hid.Lstɍڂ͂܂"; + TEXT[ korean ] = "Hid.Lst ϵ ʾҽϴ."; + TEXT[ chinese_simplified ] = "No entries in Hid.Lst"; + TEXT[ chinese_traditional ] = "No entries in Hid.Lst"; + TEXT[ arabic ] = "No entries in Hid.Lst"; + TEXT[ turkish ] = "Hid.Lst'te giri yok"; +}; +String IDS_WARNING_PREFIX +{ + Text = "Warnung: "; + Text[ english_us ] = "Warning: "; + Text[ portuguese ] = "Aviso: "; + Text[ russian ] = ": "; + Text[ greek ] = "Warning: "; + Text[ dutch ] = "Waarschuwing: "; + Text[ french ] = "Attention ! "; + Text[ spanish ] = "Advertencia: "; + Text[ italian ] = "Warning: "; + Text[ danish ] = "Warning: "; + Text[ swedish ] = "Warning: "; + Text[ polish ] = "Ostrzeenie: "; + Text[ portuguese_brazilian ] = "Warnung: "; + Text[ japanese ] = "x: "; + Text[ korean ] = " "; + Text[ chinese_simplified ] = "Warning: "; + Text[ chinese_traditional ] = "Warning: "; + Text[ arabic ] = "Warning: "; + Text[ turkish ] = "Uyar: "; +}; +String IDS_OBJECT +{ + Text = "Objekt"; + Text[ english_us ] = "Object"; + Text[ LANGUAGE_USER1 ] = "Gemeint sind Objekte aus der Objektorientierten Programmierung"; + Text[ portuguese ] = "Objecto"; + Text[ russian ] = ""; + Text[ greek ] = "Objekt"; + Text[ dutch ] = "Object"; + Text[ french ] = "Objet"; + Text[ spanish ] = "Objeto"; + Text[ italian ] = "Object"; + Text[ danish ] = "Object"; + Text[ swedish ] = "Object"; + Text[ polish ] = "Obiekt"; + Text[ portuguese_brazilian ] = "Object"; + Text[ japanese ] = "ު"; + Text[ korean ] = "ü"; + Text[ chinese_simplified ] = "Object"; + Text[ chinese_traditional ] = "Object"; + Text[ arabic ] = "Object"; + Text[ turkish ] = "Nesne"; +}; +String IDS_EDIT_VAR +{ + Text = "($Arg1) Editieren"; + Text[ english_us ] = "Edit ($Arg1)"; + Text[ LANGUAGE_USER1 ] = "Keine Dati, sondern eine Variable"; + Text[ portuguese ] = "Editar ($Arg1)"; + Text[ russian ] = " ($Arg1)"; + Text[ greek ] = "Edit ($Arg1)"; + Text[ dutch ] = "Editeren ($Arg1)"; + Text[ french ] = "diter ($Arg1)"; + Text[ spanish ] = "Editar ($Arg1)"; + Text[ italian ] = "Edit ($Arg1)"; + Text[ danish ] = "Edit ($Arg1)"; + Text[ swedish ] = "Edit ($Arg1)"; + Text[ polish ] = "Edytuj ($Arg1)"; + Text[ portuguese_brazilian ] = "Edit ($Arg1)"; + Text[ japanese ] = "($Arg1)ҏW"; + Text[ korean ] = " ($Arg1)"; + Text[ chinese_simplified ] = "Edit ($Arg1)"; + Text[ chinese_traditional ] = "Edit ($Arg1)"; + Text[ arabic ] = "Edit ($Arg1)"; + Text[ turkish ] = "($Arg1) Dzenle"; +}; + +String IDS_APPNAME { + TEXT = "StarBasic"; + TEXT [ english_us ] = "StarBasic"; + TEXT[ portuguese ] = "StarOffice Basic"; + TEXT[ russian ] = "StarBasic"; + TEXT[ greek ] = "StarBasic"; + TEXT[ dutch ] = "StarOffice Basic"; + TEXT[ french ] = "StarBasic"; + TEXT[ spanish ] = "StarBasic"; + TEXT[ italian ] = "StarOffice Basic"; + TEXT[ danish ] = "StarBasic"; + TEXT[ swedish ] = "StarOffice Basic"; + TEXT[ polish ] = "StarBasic"; + TEXT[ portuguese_brazilian ] = "StarBasic"; + TEXT[ japanese ] = "StarBasic"; + TEXT[ korean ] = "StarOffice Basic"; + TEXT[ chinese_simplified ] = "StarOffice Basic"; + TEXT[ chinese_traditional ] = "StarOffice Basic"; + TEXT[ arabic ] = "StarBasic"; + TEXT[ turkish ] = "StarOffice Basic"; +}; +String IDS_APPNAME2 { + TEXT = "StarTestTool"; + TEXT [ english_us ] = "StarTestTool"; + TEXT[ portuguese ] = "StarTestTool"; + TEXT[ russian ] = "StarTestTool"; + TEXT[ greek ] = "StarTestTool"; + TEXT[ dutch ] = "StarTestTool"; + TEXT[ french ] = "StarTestTool"; + TEXT[ spanish ] = "StarTestTool"; + TEXT[ italian ] = "StarTestTool"; + TEXT[ danish ] = "StarTestTool"; + TEXT[ swedish ] = "StarTestTool"; + TEXT[ polish ] = "StarTestTool"; + TEXT[ portuguese_brazilian ] = "StarTestTool"; + TEXT[ japanese ] = "StarTestTool"; + TEXT[ korean ] = "StarTestTool"; + TEXT[ chinese_simplified ] = "StarTestTool"; + TEXT[ chinese_traditional ] = "StarTestTool"; + TEXT[ arabic ] = "StarTestTool"; + TEXT[ turkish ] = "StarTestTool"; +}; +String IDS_APPMODE_BREAK { + text = "Break"; + text[ english_us ] = "Break"; + text[ portuguese ] = "Break"; + text[ russian ] = "Break"; + text[ greek ] = "Break"; + text[ dutch ] = "Break"; + text[ french ] = "Break"; + text[ spanish ] = "Break"; + text[ italian ] = "Break"; + text[ danish ] = "Break"; + text[ swedish ] = "Break"; + text[ polish ] = "Przerwa"; + text[ portuguese_brazilian ] = "Break"; + text[ japanese ] = "Break"; + text[ korean ] = "Break"; + text[ chinese_simplified ] = "Break"; + text[ chinese_traditional ] = "Break"; + text[ arabic ] = "Break"; + text[ turkish ] = "Break"; +}; +String IDS_APPMODE_RUN { + text = "Run"; + text[ english_us ] = "Run"; + text[ portuguese ] = "Run"; + text[ russian ] = "Run"; + text[ greek ] = "Run"; + text[ dutch ] = "Run"; + text[ french ] = "Run"; + text[ spanish ] = "Run"; + text[ italian ] = "Run"; + text[ danish ] = "Run"; + text[ swedish ] = "Run"; + text[ polish ] = "Run"; + text[ portuguese_brazilian ] = "Run"; + text[ japanese ] = "Run"; + text[ korean ] = ""; + text[ chinese_simplified ] = "Run"; + text[ chinese_traditional ] = "Run"; + text[ arabic ] = "Run"; + text[ turkish ] = "Run"; +}; +String IDS_NONAME { + TEXT = "Unbenannt"; + TEXT [ english_us ] = "Unnamed"; + TEXT[ portuguese ] = "Sem nome"; + TEXT[ russian ] = "Unnamed"; + TEXT[ greek ] = "Unnamed"; + TEXT[ dutch ] = "Naamloos"; + TEXT[ french ] = "Sans nom"; + TEXT[ spanish ] = "Desconocido"; + TEXT[ italian ] = "Unnamed"; + TEXT[ danish ] = "Unnamed"; + TEXT[ swedish ] = "Unnamed"; + TEXT[ polish ] = "Unnamed "; + TEXT[ portuguese_brazilian ] = "Unbenannt"; + TEXT[ japanese ] = "s"; + TEXT[ korean ] = "̸ "; + TEXT[ chinese_simplified ] = "Unbenannt"; + TEXT[ chinese_traditional ] = "Unnamed"; + TEXT[ arabic ] = "Unnamed"; + TEXT[ turkish ] = "Adsz"; +}; + +String IDS_NONAMEFILE { +#if defined ( UNX ) +TEXT = "*.bas"; +#else +TEXT = "*.BAS"; +#endif +}; +String IDS_INCFILE { +#if defined ( UNX ) +TEXT = "*.inc"; +#else +TEXT = "*.INC"; +#endif +}; +String IDS_LIBFILE { +#if defined ( UNX ) +TEXT = "*.sb"; +#else +TEXT = "*.SB"; +#endif +}; +String IDS_RESFILE { +#if defined ( UNX ) +TEXT = "*.res"; +#else +TEXT = "*.RES"; +#endif +}; +String IDS_TXTFILE { +#if defined ( UNX ) +TEXT = "*.txt"; +#else +TEXT = "*.TXT"; +#endif +}; + +String IDS_LOADDLG { + TEXT = "StarBasic: Datei einlesen"; + TEXT [ english_us ] = "StarBasic: Load File"; + TEXT[ portuguese ] = "StarOffice Basic: ler ficheiro"; + TEXT[ russian ] = "StarBasic: Load File"; + TEXT[ greek ] = "StarBasic: Load File"; + TEXT[ dutch ] = "StarOffice Basic: bestand lezen"; + TEXT[ french ] = "StarBasic : Lecture du fichier"; + TEXT[ spanish ] = "StarBasic: Leer archivo"; + TEXT[ italian ] = "StarBasic: Load File"; + TEXT[ danish ] = "StarBasic: Load File"; + TEXT[ swedish ] = "StarBasic: Load File"; + TEXT[ polish ] = "StarBasic: Load File "; + TEXT[ portuguese_brazilian ] = "StarBasic: Datei einlesen"; + TEXT[ japanese ] = "StarBasic: ̧ق̓ǂݍ"; + TEXT[ korean ] = "StarBasic: ε"; + TEXT[ chinese_simplified ] = "StarBasic: Datei einlesen"; + TEXT[ chinese_traditional ] = "StarOffice BasicGLoad File"; + TEXT[ arabic ] = "StarBasic: Load File"; + TEXT[ turkish ] = "StarBasic: Dosyay ykle"; +}; +String IDS_SAVEDLG { + TEXT = "StarBasic: Datei speichern"; + TEXT [ english_us ] = "StarBasic: Save File"; + TEXT[ portuguese ] = "StarOffice Basic: guardar ficheiro"; + TEXT[ russian ] = "StarBasic: Save File"; + TEXT[ greek ] = "StarBasic: Save File"; + TEXT[ dutch ] = "StarOffice Basic: bestand opslaan"; + TEXT[ french ] = "StarBasic: Enregistrement du fichier"; + TEXT[ spanish ] = "StarBasic: Guardar archivo"; + TEXT[ italian ] = "StarBasic: Save File"; + TEXT[ danish ] = "StarBasic: Save File"; + TEXT[ swedish ] = "StarBasic: Save File"; + TEXT[ polish ] = "StarBasic: Save File "; + TEXT[ portuguese_brazilian ] = "StarBasic: Datei speichern"; + TEXT[ japanese ] = "StarBasic: ̧ق̕ۑ"; + TEXT[ korean ] = "StarBasic: "; + TEXT[ chinese_simplified ] = "StarBasic: Datei speichern"; + TEXT[ chinese_traditional ] = "StarOffice Basic: Save File"; + TEXT[ arabic ] = "StarBasic: Save File"; + TEXT[ turkish ] = "StarBasic: Dosyay kaydet"; +}; +String IDS_BASFILTER { + TEXT = "Quelltexte (*.BAS)"; + TEXT [ english_us ] = "Source text (*.BAS)"; + TEXT[ portuguese ] = "Textos-fonte (*.BAS)"; + TEXT[ russian ] = "Source text (*.BAS)"; + TEXT[ greek ] = "Source text (*.BAS)"; + TEXT[ dutch ] = "Brontekst (*.BAS)"; + TEXT[ french ] = "Texte source (*.BAS)"; + TEXT[ spanish ] = "Textos fuente (*.BAS)"; + TEXT[ italian ] = "Source text (*.BAS)"; + TEXT[ danish ] = "Source text (*.BAS)"; + TEXT[ swedish ] = "Source text (*.BAS)"; + TEXT[ polish ] = "Source text (*.BAS) "; + TEXT[ portuguese_brazilian ] = "Quelltexte (*.BAS)"; + TEXT[ japanese ] = "(*.BAS)"; + TEXT[ korean ] = "ҽ ؽƮ (*.BAS)"; + TEXT[ chinese_simplified ] = "Quelltexte (*.BAS)"; + TEXT[ chinese_traditional ] = "Source text(*.BAS)"; + TEXT[ arabic ] = "Source text (*.BAS)"; + TEXT[ turkish ] = "Kaynak metinler (*.BAS)"; +}; +String IDS_INCFILTER { + TEXT = "Include-Dateien (*.INC)"; + TEXT [ english_us ] = "Include files (*.INC)"; + TEXT[ portuguese ] = "Ficheiros \"Include\" (*.INC)"; + TEXT[ russian ] = "Include files (*.INC)"; + TEXT[ greek ] = "Include files (*.INC)"; + TEXT[ dutch ] = "Include-bestanden (*.INC)"; + TEXT[ french ] = "Fichiers \"Include\" (*.INC)"; + TEXT[ spanish ] = "Archivos \"Include\" (*.INC)"; + TEXT[ italian ] = "Include files (*.INC)"; + TEXT[ danish ] = "Include files (*.INC)"; + TEXT[ swedish ] = "Include files (*.INC)"; + TEXT[ polish ] = "Include files (*.INC) "; + TEXT[ portuguese_brazilian ] = "Include-Dateien (*.INC)"; + TEXT[ japanese ] = "Include files (*.INC)"; + TEXT[ korean ] = " (*.INC)"; + TEXT[ chinese_simplified ] = "Include-Dateien (*.INC)"; + TEXT[ chinese_traditional ] = "Include files(*.INC)"; + TEXT[ arabic ] = "Include files (*.INC)"; + TEXT[ turkish ] = "Include dosyalar (*.INC)"; +}; +String IDS_LIBFILTER { + TEXT = "Libraries (*.SB)"; + TEXT [ english_us ] = "Libraries (*.SB)"; + TEXT[ portuguese ] = "Bibliotecas (*.SB)"; + TEXT[ russian ] = "Libraries (*.SB)"; + TEXT[ greek ] = "Libraries (*.SB)"; + TEXT[ dutch ] = "Libraries (*.SB)"; + TEXT[ french ] = "Bibliothques (*.SB)"; + TEXT[ spanish ] = "Bibliotecas (*.SB)"; + TEXT[ italian ] = "Libraries (*.SB)"; + TEXT[ danish ] = "Libraries (*.SB)"; + TEXT[ swedish ] = "Libraries (*.SB)"; + TEXT[ polish ] = "Libraries (*.SB) "; + TEXT[ portuguese_brazilian ] = "Libraries (*.SB)"; + TEXT[ japanese ] = "ײ(*.SB)"; + TEXT[ korean ] = "̺귯 (*.SB)"; + TEXT[ chinese_simplified ] = "Libraries (*.SB)"; + TEXT[ chinese_traditional ] = "Libraries(*.SB)"; + TEXT[ arabic ] = "Libraries (*.SB)"; + TEXT[ turkish ] = "Kitaplklar (*.SB)"; +}; +String IDS_RESFILTER { + TEXT = "Results (*.RES)"; + TEXT [ english_us ] = "Results (*.RES)"; + TEXT[ portuguese ] = "Resultados (*.RES)"; + TEXT[ russian ] = "Results (*.RES)"; + TEXT[ greek ] = "Results (*.RES)"; + TEXT[ dutch ] = "Results (*.RES)"; + TEXT[ french ] = "Rsultats (*.RES)"; + TEXT[ spanish ] = "Resultados (*.RES)"; + TEXT[ italian ] = "Results (*.RES)"; + TEXT[ danish ] = "Results (*.RES)"; + TEXT[ swedish ] = "Results (*.RES)"; + TEXT[ polish ] = "Results (*.RES) "; + TEXT[ portuguese_brazilian ] = "Results (*.RES)"; + TEXT[ japanese ] = "(*.RES)"; + TEXT[ korean ] = " (*.RES)"; + TEXT[ chinese_simplified ] = "Results (*.RES)"; + TEXT[ chinese_traditional ] = "Results(*.RES)"; + TEXT[ arabic ] = "Results (*.RES)"; + TEXT[ turkish ] = "Sonular (*.RES)"; +}; +String IDS_TXTFILTER { + TEXT = "Results als Textdatei (*.TXT)"; + TEXT [ english_us ] = "Results as text file (*.TXT)"; + TEXT[ portuguese ] = "Resultados como ficheiro de texto (*.TXT)"; + TEXT[ russian ] = "Results as text file (*.TXT)"; + TEXT[ greek ] = "Results as text file (*.TXT)"; + TEXT[ dutch ] = "Results als tekstbestand (*.TXT)"; + TEXT[ french ] = "Rsultats sous forme de fichier texte (*.TXT)"; + TEXT[ spanish ] = "Resultados como archivo de texto (*.TXT)"; + TEXT[ italian ] = "Results as text file (*.TXT)"; + TEXT[ danish ] = "Results as text file (*.TXT)"; + TEXT[ swedish ] = "Results as text file (*.TXT)"; + TEXT[ polish ] = "Results as text file (*.TXT) "; + TEXT[ portuguese_brazilian ] = "Results als Textdatei (*.TXT)"; + TEXT[ japanese ] = "̧قƂĂ̌(*.TXT)"; + TEXT[ korean ] = "ؽƮ (*.TXT)"; + TEXT[ chinese_simplified ] = "Results als Textdatei (*.TXT)"; + TEXT[ chinese_traditional ] = "Results as text file(*.TXT)"; + TEXT[ arabic ] = "Results as text file (*.TXT)"; + TEXT[ turkish ] = "Metin dosyas olarak sonular (*.TXT)"; +}; +String IDS_PAGE { + TEXT = "Seite "; + TEXT [ english_us ] = "Page "; + TEXT[ portuguese ] = "Pgina "; + TEXT[ russian ] = "Page "; + TEXT[ greek ] = "Page "; + TEXT[ dutch ] = "Pagina "; + TEXT[ french ] = "Page "; + TEXT[ spanish ] = "Pgina "; + TEXT[ italian ] = "Page "; + TEXT[ danish ] = "Page "; + TEXT[ swedish ] = "Page "; + TEXT[ polish ] = "Page "; + TEXT[ portuguese_brazilian ] = "Seite "; + TEXT[ japanese ] = "߰ "; + TEXT[ korean ] = " "; + TEXT[ chinese_simplified ] = "Seite "; + TEXT[ chinese_traditional ] = "Page "; + TEXT[ arabic ] = "Page "; + TEXT[ turkish ] = "Sayfa "; +}; +String IDS_PRINTMSG { + TEXT = "Ausdruck von "; + TEXT [ english_us ] = "Printout from "; + TEXT[ portuguese ] = "Impresso de "; + TEXT[ russian ] = "Printout from "; + TEXT[ greek ] = "Printout from "; + TEXT[ dutch ] = "Afdruk van "; + TEXT[ french ] = "Impression de "; + TEXT[ spanish ] = "Imprimir "; + TEXT[ italian ] = "Printout from "; + TEXT[ danish ] = "Printout from "; + TEXT[ swedish ] = "Printout from "; + TEXT[ polish ] = "Printout from "; + TEXT[ portuguese_brazilian ] = "Ausdruck von "; + TEXT[ japanese ] = "͈ "; + TEXT[ korean ] = " "; + TEXT[ chinese_simplified ] = "Ausdruck von "; + TEXT[ chinese_traditional ] = "Printout from "; + TEXT[ arabic ] = "Printout from "; + TEXT[ turkish ] = "kt kayna: "; +}; +String IDS_CONTINUE { + TEXT = "Weiter"; + TEXT [ english_us ] = "Continue"; + TEXT[ portuguese ] = "Continuar"; + TEXT[ russian ] = "Continue"; + TEXT[ greek ] = "Continue"; + TEXT[ dutch ] = "Volgende"; + TEXT[ french ] = "Poursuivre"; + TEXT[ spanish ] = "Avanzar"; + TEXT[ italian ] = "Continue"; + TEXT[ danish ] = "Continue"; + TEXT[ swedish ] = "Continue"; + TEXT[ polish ] = "Continue "; + TEXT[ portuguese_brazilian ] = "Weiter"; + TEXT[ japanese ] = "s"; + TEXT[ korean ] = ""; + TEXT[ chinese_simplified ] = "Weiter"; + TEXT[ chinese_traditional ] = "Contiune"; + TEXT[ arabic ] = "Continue"; + TEXT[ turkish ] = "leri"; +}; +String IDS_CANCEL { + TEXT = "Abbruch"; + TEXT [ english_us ] = "Cancel"; + TEXT[ portuguese ] = "Cancelar"; + TEXT[ russian ] = "Cancel"; + TEXT[ greek ] = "Cancel"; + TEXT[ dutch ] = "Annuleren"; + TEXT[ french ] = "Annuler"; + TEXT[ spanish ] = "Cancelar"; + TEXT[ italian ] = "Cancel"; + TEXT[ danish ] = "Cancel"; + TEXT[ swedish ] = "Cancel"; + TEXT[ polish ] = "Cancel "; + TEXT[ portuguese_brazilian ] = "Abbruch"; + TEXT[ japanese ] = "ݾ"; + TEXT[ korean ] = ""; + TEXT[ chinese_simplified ] = "Abbruch"; + TEXT[ chinese_traditional ] = "Cancel"; + TEXT[ arabic ] = "Cancel"; + TEXT[ turkish ] = "ptal"; +}; +String IDS_DISASWIN { + TEXT = "Disassembly"; + TEXT [ english_us ] = "Disassembly"; + TEXT[ portuguese ] = "Descodificar"; + TEXT[ russian ] = "Disassembly"; + TEXT[ greek ] = "Disassembly"; + TEXT[ dutch ] = "Disassembly"; + TEXT[ french ] = "Dsassembler"; + TEXT[ spanish ] = "Desensamblar"; + TEXT[ italian ] = "Disassembly"; + TEXT[ danish ] = "Disassembly"; + TEXT[ swedish ] = "Disassembly"; + TEXT[ polish ] = "Disassembly "; + TEXT[ portuguese_brazilian ] = "Disassembly"; + TEXT[ japanese ] = "Disassembly"; + TEXT[ korean ] = "Disassembly"; + TEXT[ chinese_simplified ] = "Disassembly"; + TEXT[ chinese_traditional ] = "Disassembly"; + TEXT[ arabic ] = "Disassembly"; + TEXT[ turkish ] = "Disassembly"; +}; +//Icon RID_APPICON { +// FILE = "basic.ico"; +//}; +//Icon RID_APPICON2 { +// FILE = "testtool.ico"; +//}; +//Icon RID_WORKICON { +// FILE = "work.ico"; +//}; + +Bitmap MBP_PLUS { + File = "plus.bmp"; +}; +Bitmap MBP_MINUS { + File = "minus.bmp"; +}; +Bitmap MBP_ASSERT { + File = "assert.bmp"; +}; + +Menu RID_APPMENUBAR { + ItemList = { + MenuItem { + Identifier = RID_APPFILE; + TEXT = "~Datei"; + TEXT [ english_us ] = "~File"; + HELPTEXT = "Dateien ffnen, schlieen und drucken"; + HELPTEXT [ english_us ] = "Dateien ffnen, schlieen und drucken"; + SUBMENU = Menu ,RID_FILE; + TEXT[ portuguese ] = "~Ficheiro"; + TEXT[ russian ] = "~"; + TEXT[ greek ] = "~File"; + TEXT[ dutch ] = "~Bestand"; + TEXT[ french ] = "~Fichier"; + TEXT[ spanish ] = "~Archivo"; + TEXT[ italian ] = "~File"; + TEXT[ danish ] = "~File"; + TEXT[ swedish ] = "~File"; + TEXT[ polish ] = "~File "; + TEXT[ portuguese_brazilian ] = "~Datei"; + TEXT[ japanese ] = "̧(~F)"; + TEXT[ korean ] = "(~F)"; + TEXT[ chinese_simplified ] = "~Datei"; + TEXT[ chinese_traditional ] = "~File"; + TEXT[ arabic ] = "~File"; + TEXT[ turkish ] = "~Dosya"; + }; + MenuItem { + Identifier = RID_APPEDIT; + TEXT = "~Bearbeiten"; + TEXT [ english_us ] = "~Edit"; + HELPTEXT = "Editier-Funktionen"; + HELPTEXT [ english_us ] = "Editier-Funktionen"; + SUBMENU = Menu ,RID_EDIT; + TEXT[ portuguese ] = "~Editar"; + TEXT[ russian ] = "~Edit"; + TEXT[ greek ] = "~Edit"; + TEXT[ dutch ] = "~Bewerken"; + TEXT[ french ] = "~diter"; + TEXT[ spanish ] = "~Editar"; + TEXT[ italian ] = "~Edit"; + TEXT[ danish ] = "~Edit"; + TEXT[ swedish ] = "~Edit"; + TEXT[ polish ] = "~Edit "; + TEXT[ portuguese_brazilian ] = "~Bearbeiten"; + TEXT[ japanese ] = "ҏW(~E)"; + TEXT[ korean ] = "(~E)"; + TEXT[ chinese_simplified ] = "~Bearbeiten"; + TEXT[ chinese_traditional ] = "~Edit"; + TEXT[ arabic ] = "~Edit"; + TEXT[ turkish ] = "D~zenle"; + }; + MenuItem { + Identifier = RID_APPRUN; + TEXT = "~Programm"; + TEXT [ english_us ] = "~Program"; + HELPTEXT = "Programme compilieren und ausfhren"; + HELPTEXT [ english_us ] = "Programme compilieren und ausfhren"; + SUBMENU = Menu ,RID_RUN; + TEXT[ portuguese ] = "~Programa"; + TEXT[ russian ] = "~Program"; + TEXT[ greek ] = "~Program"; + TEXT[ dutch ] = "~Programma"; + TEXT[ french ] = "~Programme"; + TEXT[ spanish ] = "~Programa"; + TEXT[ italian ] = "~Program"; + TEXT[ danish ] = "~Program"; + TEXT[ swedish ] = "~Program"; + TEXT[ polish ] = "~Program "; + TEXT[ portuguese_brazilian ] = "~Programm"; + TEXT[ japanese ] = "۸(~P)"; + TEXT[ korean ] = "α(~P)"; + TEXT[ chinese_simplified ] = "~Programm"; + TEXT[ chinese_traditional ] = "~Program"; + TEXT[ arabic ] = "~Program"; + TEXT[ turkish ] = "P~rogram"; + }; + MenuItem { + Identifier = RID_APPWINDOW; + TEXT = "~Fenster"; + TEXT [ english_us ] = "~Window"; + HELPTEXT = "Fenster anordnen"; + HELPTEXT [ english_us ] = "Fenster anordnen"; + SUBMENU = Menu ,RID_WINDOW; + TEXT[ portuguese ] = "~Janela"; + TEXT[ russian ] = "~Window"; + TEXT[ greek ] = "~Window"; + TEXT[ dutch ] = "~Venster"; + TEXT[ french ] = "~Fentre"; + TEXT[ spanish ] = "~Ventana"; + TEXT[ italian ] = "~Window"; + TEXT[ danish ] = "~Window"; + TEXT[ swedish ] = "~Window"; + TEXT[ polish ] = "~Window "; + TEXT[ portuguese_brazilian ] = "~Fenster"; + TEXT[ japanese ] = "(~W)"; + TEXT[ korean ] = "â(~W)"; + TEXT[ chinese_simplified ] = "~Fenster"; + TEXT[ chinese_traditional ] = "~Window"; + TEXT[ arabic ] = "~Window"; + TEXT[ turkish ] = "~Pencere"; + }; + MenuItem { + SEPARATOR = TRUE; + }; + MenuItem { + HELP = TRUE; + Identifier = RID_APPHELP; + TEXT = "~Hilfe"; + TEXT [ english_us ] = "~Help"; + HELPTEXT = "Hilfe-Funktionen"; + HELPTEXT [ english_us ] = "Hilfe-Funktionen"; + SUBMENU = Menu ,RID_HELP; + TEXT[ portuguese ] = "~Ajuda"; + TEXT[ russian ] = "~Help"; + TEXT[ greek ] = "~Help"; + TEXT[ dutch ] = "~Help"; + TEXT[ french ] = "~Aide"; + TEXT[ spanish ] = "~Ayuda"; + TEXT[ italian ] = "~Help"; + TEXT[ danish ] = "~Help"; + TEXT[ swedish ] = "~Help"; + TEXT[ polish ] = "~Help "; + TEXT[ portuguese_brazilian ] = "~Hilfe"; + TEXT[ japanese ] = "(~H)"; + TEXT[ korean ] = "(~H)"; + TEXT[ chinese_simplified ] = "~Hilfe"; + TEXT[ chinese_traditional ] = "~Help"; + TEXT[ arabic ] = "~Help"; + TEXT[ turkish ] = "~Yardm"; + }; + }; +}; +Menu RID_FILE { + ITEMLIST = { + MenuItem { + Identifier = RID_FILENEW; + TEXT = "~Neu"; + TEXT [ english_us ] = "~New"; + HELPTEXT = "Neues, leeres Fenster ffnen"; + HELPTEXT [ english_us ] = "Neues, leeres Fenster ffnen"; + AccelKey = KeyCode { Function = KEYFUNC_NEW; }; + TEXT[ portuguese ] = "~Novo"; + TEXT[ russian ] = "~New"; + TEXT[ greek ] = "~New"; + TEXT[ dutch ] = "~Nieuw"; + TEXT[ french ] = "~Nouveau"; + TEXT[ spanish ] = "~Nuevo"; + TEXT[ italian ] = "~New"; + TEXT[ danish ] = "~New"; + TEXT[ swedish ] = "~New"; + TEXT[ polish ] = "~New "; + TEXT[ portuguese_brazilian ] = "~Neu"; + TEXT[ japanese ] = "VK쐬(~N)"; + TEXT[ korean ] = "(~N)"; + TEXT[ chinese_simplified ] = "~Neu"; + TEXT[ chinese_traditional ] = "~New"; + TEXT[ arabic ] = "~New"; + TEXT[ turkish ] = "Y~eni"; + }; + MenuItem { + Identifier = RID_FILEOPEN; + TEXT = "~ffnen..."; + TEXT [ english_us ] = "~Open..."; + HELPTEXT = "Datei in Fenster einlesen"; + HELPTEXT [ english_us ] = "Datei in Fenster einlesen"; + AccelKey = KeyCode { Function = KEYFUNC_OPEN; }; + TEXT[ portuguese ] = "A~brir..."; + TEXT[ russian ] = "~Open..."; + TEXT[ greek ] = "~Open..."; + TEXT[ dutch ] = "O~penen..."; + TEXT[ french ] = "~Ouvrir..."; + TEXT[ spanish ] = "A~brir..."; + TEXT[ italian ] = "~Open..."; + TEXT[ danish ] = "~Open..."; + TEXT[ swedish ] = "~Open..."; + TEXT[ polish ] = "~Open... "; + TEXT[ portuguese_brazilian ] = "~ffnen..."; + TEXT[ japanese ] = "J(~O)..."; + TEXT[ korean ] = "(~O)..."; + TEXT[ chinese_simplified ] = "~ffnen..."; + TEXT[ chinese_traditional ] = "~Open..."; + TEXT[ arabic ] = "~Open..."; + TEXT[ turkish ] = "~A..."; + }; + MenuItem { + SEPARATOR = TRUE; + }; + MenuItem { + Identifier = RID_FILECLOSE; + TEXT = "S~chlieen"; + TEXT [ english_us ] = "~Close"; + HELPTEXT = "Fenster schlieen"; + HELPTEXT [ english_us ] = "Fenster schlieen"; + TEXT[ portuguese ] = "~Fechar"; + TEXT[ russian ] = "~Close"; + TEXT[ greek ] = "~Close"; + TEXT[ dutch ] = "S~luiten"; + TEXT[ french ] = "~Fermer"; + TEXT[ spanish ] = "~Cerrar"; + TEXT[ italian ] = "~Close"; + TEXT[ danish ] = "~Close"; + TEXT[ swedish ] = "~Close"; + TEXT[ polish ] = "~Close "; + TEXT[ portuguese_brazilian ] = "S~chlieen"; + TEXT[ japanese ] = "(~C)"; + TEXT[ korean ] = "ݱ(~C)"; + TEXT[ chinese_simplified ] = "S~chlieen"; + TEXT[ chinese_traditional ] = "~Close"; + TEXT[ arabic ] = "~Close"; + TEXT[ turkish ] = "Kapa~t"; + }; + MenuItem { + Identifier = RID_FILESAVE; + TEXT = "~Speichern"; + TEXT [ english_us ] = "~Save"; + HELPTEXT = "Datei unter dem aktuellen Namen speichern"; + HELPTEXT [ english_us ] = "Datei unter dem aktuellen Namen speichern"; + AccelKey = KeyCode { Function = KEYFUNC_SAVE; }; + TEXT[ portuguese ] = "~Guardar"; + TEXT[ russian ] = "~Save"; + TEXT[ greek ] = "~Save"; + TEXT[ dutch ] = "~Opslaan"; + TEXT[ french ] = "~Enregistrer"; + TEXT[ spanish ] = "~Guardar"; + TEXT[ italian ] = "~Save"; + TEXT[ danish ] = "~Save"; + TEXT[ swedish ] = "~Save"; + TEXT[ polish ] = "~Save "; + TEXT[ portuguese_brazilian ] = "~Speichern"; + TEXT[ japanese ] = "ۑ(~S)"; + TEXT[ korean ] = "(~S)"; + TEXT[ chinese_simplified ] = "~Speichern"; + TEXT[ chinese_traditional ] = "~Save"; + TEXT[ arabic ] = "~Save"; + TEXT[ turkish ] = "Kay~det"; + }; + MenuItem { + Identifier = RID_FILESAVEAS; + TEXT = "Speichern ~unter..."; + TEXT [ english_us ] = "Save~ As..."; + HELPTEXT = "Datei unter einem neuen Namen speichern"; + HELPTEXT [ english_us ] = "Datei unter einem neuen Namen speichern"; + AccelKey = KeyCode { Function = KEYFUNC_SAVEAS; }; + TEXT[ portuguese ] = "Guardar ~como..."; + TEXT[ russian ] = "Save~ As..."; + TEXT[ greek ] = "Save~ As..."; + TEXT[ dutch ] = "Opslaan ~als..."; + TEXT[ french ] = "Enregistrer ~sous..."; + TEXT[ spanish ] = "Guardar ~como..."; + TEXT[ italian ] = "Save ~As..."; + TEXT[ danish ] = "Save~ As..."; + TEXT[ swedish ] = "Save ~As..."; + TEXT[ polish ] = "Save~ As... "; + TEXT[ portuguese_brazilian ] = "Speichern ~unter..."; + TEXT[ japanese ] = "㏑ۑ(~U)..."; + TEXT[ korean ] = "ٸ ̸ (~ )..."; + TEXT[ chinese_simplified ] = "Speichern ~unter..."; + TEXT[ chinese_traditional ] = "Save ~as..."; + TEXT[ arabic ] = "Save~ As..."; + TEXT[ turkish ] = "~Farkl kaydet..."; + }; + MenuItem { + SEPARATOR = TRUE; + }; + MenuItem { + Identifier = RID_FILELOADLIB; + TEXT = "~Library laden..."; + TEXT [ english_us ] = "~Load Library..."; + HELPTEXT = "Modul-Library laden und aktivieren"; + HELPTEXT [ english_us ] = "Modul-Library laden und aktivieren"; + TEXT[ portuguese ] = "~Carregar biblioteca..."; + TEXT[ russian ] = "~Load Library..."; + TEXT[ greek ] = "~Load Library..."; + TEXT[ dutch ] = "~Library laden..."; + TEXT[ french ] = "Charger la ~bibliothque..."; + TEXT[ spanish ] = "Cargar ~Biblioteca..."; + TEXT[ italian ] = "~Load Library..."; + TEXT[ danish ] = "~Load Library..."; + TEXT[ swedish ] = "~Load Library..."; + TEXT[ polish ] = "~Load Library... "; + TEXT[ portuguese_brazilian ] = "~Library laden..."; + TEXT[ japanese ] = "ײ̓ǂݍ(~L)..."; + TEXT[ korean ] = "ε ̺귯(~L)..."; + TEXT[ chinese_simplified ] = "~Library laden..."; + TEXT[ chinese_traditional ] = "~Load Library..."; + TEXT[ arabic ] = "~Load Library..."; + TEXT[ turkish ] = "~Kitapl ykle"; + }; + MenuItem { + Identifier = RID_FILESAVELIB; + TEXT = "Li~brary speichern..."; + TEXT [ english_us ] = "Save Li~brary..."; + HELPTEXT = "Aktuelle Module als Library speichern"; + HELPTEXT [ english_us ] = "Aktuelle Module als Library speichern"; + TEXT[ portuguese ] = "~Guardar biblioteca..."; + TEXT[ russian ] = "Save Li~brary..."; + TEXT[ greek ] = "Save Li~brary..."; + TEXT[ dutch ] = "Li~brary opslaan..."; + TEXT[ french ] = "En~registrer la bibliothque..."; + TEXT[ spanish ] = "Guardar Bibli~oteca..."; + TEXT[ italian ] = "Save Li~brary..."; + TEXT[ danish ] = "Save Li~brary..."; + TEXT[ swedish ] = "Save Li~brary..."; + TEXT[ polish ] = "Save Li~brary... "; + TEXT[ portuguese_brazilian ] = "Li~brary speichern..."; + TEXT[ japanese ] = "ײ̕ۑ(~B)..."; + TEXT[ korean ] = "̺귯 (~B)..."; + TEXT[ chinese_simplified ] = "Li~brary speichern..."; + TEXT[ chinese_traditional ] = "Save L~ibrary..."; + TEXT[ arabic ] = "Save Li~brary..."; + TEXT[ turkish ] = "Kitapl kaydet..."; + }; + MenuItem { + SEPARATOR = TRUE; + }; + MenuItem { + Identifier = RID_FILEPRINT; + TEXT = "~Drucken"; + TEXT [ english_us ] = "~Print"; + HELPTEXT = "Datei ausdrucken"; + HELPTEXT [ english_us ] = "Datei ausdrucken"; + TEXT[ portuguese ] = "~Imprimir"; + TEXT[ russian ] = "~Print"; + TEXT[ greek ] = "~Print"; + TEXT[ dutch ] = "~Afdrukken"; + TEXT[ french ] = "~Imprimer"; + TEXT[ spanish ] = "~Imprimir"; + TEXT[ italian ] = "~Print"; + TEXT[ danish ] = "~Print"; + TEXT[ swedish ] = "~Print"; + TEXT[ polish ] = "~Print "; + TEXT[ portuguese_brazilian ] = "~Drucken"; + TEXT[ japanese ] = "(~P)"; + TEXT[ korean ] = "μ(~P)"; + TEXT[ chinese_simplified ] = "~Drucken"; + TEXT[ chinese_traditional ] = "~Print"; + TEXT[ arabic ] = "~Print"; + TEXT[ turkish ] = "~Yazdr"; + }; + MenuItem { + Identifier = RID_FILESETUP; + TEXT = "Druckereinstellun~g..."; + TEXT [ english_us ] = "P~rinter Setting..."; + HELPTEXT = "Drucker einrichten"; + HELPTEXT [ english_us ] = "Drucker einrichten"; + TEXT[ portuguese ] = "Configurar ~impressora..."; + TEXT[ russian ] = "P~rinter Setup..."; + TEXT[ greek ] = "P~rinter Setup..."; + TEXT[ dutch ] = "Printerinstellin~g..."; + TEXT[ french ] = "Para~mtrage de l'imprimante..."; + TEXT[ spanish ] = "~Configuracin de impresora..."; + TEXT[ italian ] = "P~rinter Setup..."; + TEXT[ danish ] = "P~rinter Setup..."; + TEXT[ swedish ] = "P~rinter Setup..."; + TEXT[ polish ] = "P~rinter Setup... "; + TEXT[ portuguese_brazilian ] = "Druckereinstellun~g..."; + TEXT[ japanese ] = "ݒ(~R)..."; + TEXT[ korean ] = " (~R)..."; + TEXT[ chinese_simplified ] = "Druckereinstellun~g..."; + TEXT[ chinese_traditional ] = "~Printer Setup..."; + TEXT[ arabic ] = "P~rinter Setup..."; + TEXT[ turkish ] = "Yazc ayarlar..."; + }; + MenuItem { + SEPARATOR = TRUE; + }; + MenuItem { + Identifier = RID_QUIT; + TEXT = "~Beenden"; + TEXT [ english_us ] = "~Exit"; + HELPTEXT = "Programm beenden"; + HELPTEXT [ english_us ] = "Programm beenden"; + AccelKey = KeyCode { Function = KEYFUNC_QUIT; }; + TEXT[ portuguese ] = "~Sair"; + TEXT[ russian ] = ""; + TEXT[ greek ] = "~Exit"; + TEXT[ dutch ] = "~Beindigen"; + TEXT[ french ] = "~Quitter"; + TEXT[ spanish ] = "~Terminar"; + TEXT[ italian ] = "~Exit"; + TEXT[ danish ] = "~Exit"; + TEXT[ swedish ] = "~Exit"; + TEXT[ polish ] = "~Exit "; + TEXT[ portuguese_brazilian ] = "~Beenden"; + TEXT[ japanese ] = "I(~X)"; + TEXT[ korean ] = "(~E)"; + TEXT[ chinese_simplified ] = "~Beenden"; + TEXT[ chinese_traditional ] = "~Exit"; + TEXT[ arabic ] = "~Exit"; + TEXT[ turkish ] = "~k"; + }; + }; +}; +Menu RID_EDIT { + ITEMLIST = { + MenuItem { + Identifier = RID_EDITUNDO; + TEXT = "~Rckgngig"; + TEXT [ english_us ] = "~Undo"; + HELPTEXT = "Die letzte nderung rckgngig machen"; + HELPTEXT [ english_us ] = "Die letzte nderung rckgngig machen"; +// AccelKey = KeyCode { Function = KEYFUNC_CUT; }; + TEXT[ portuguese ] = "~Desfazer"; + TEXT[ russian ] = "~Undo"; + TEXT[ greek ] = "~Undo"; + TEXT[ dutch ] = "~Ongedaan"; + TEXT[ french ] = "~Annuler"; + TEXT[ spanish ] = "~Deshacer"; + TEXT[ italian ] = "~Undo"; + TEXT[ danish ] = "~Undo"; + TEXT[ swedish ] = "~Undo"; + TEXT[ polish ] = "~Undo "; + TEXT[ portuguese_brazilian ] = "~Rckgngig"; + TEXT[ japanese ] = "ɖ߂(~U)"; + TEXT[ korean ] = "(~U)"; + TEXT[ chinese_simplified ] = "~Rckgngig"; + TEXT[ chinese_traditional ] = "~Undo"; + TEXT[ arabic ] = ""; + TEXT[ turkish ] = "Geri ~al"; + }; + MenuItem { + Identifier = RID_EDITREDO; + TEXT = "~Wiederholen"; + TEXT [ english_us ] = "~Repeat"; + HELPTEXT = "Die zuletzt rckgngig gemachte nderung wiederherstellen"; + HELPTEXT [ english_us ] = "Die zuletzt rckgngig gemachte nderung wiederherstellen"; +// AccelKey = KeyCode { Function = KEYFUNC_CUT; }; + TEXT[ portuguese ] = "~Repetir"; + TEXT[ russian ] = "~Repeat"; + TEXT[ greek ] = "~Repeat"; + TEXT[ dutch ] = "~Herhalen"; + TEXT[ french ] = "~Rpter"; + TEXT[ spanish ] = "~Repetir"; + TEXT[ italian ] = "~Repeat"; + TEXT[ danish ] = "~Repeat"; + TEXT[ swedish ] = "~Repeat"; + TEXT[ polish ] = "~Repeat "; + TEXT[ portuguese_brazilian ] = "~Wiederholen"; + TEXT[ japanese ] = "蒼(~R)"; + TEXT[ korean ] = "(~R)"; + TEXT[ chinese_simplified ] = "~Wiederholen"; + TEXT[ chinese_traditional ] = "~Repeat"; + TEXT[ arabic ] = "~Repeat"; + TEXT[ turkish ] = "~Yinele"; + }; + MenuItem { + SEPARATOR = TRUE; + }; + MenuItem { + Identifier = RID_EDITCUT; + TEXT = "~Ausschneiden"; + TEXT [ english_us ] = "~Cut"; + HELPTEXT = "Markierten Text in Zwischenablage ablegen"; + HELPTEXT [ english_us ] = "Markierten Text in Zwischenablage ablegen"; + AccelKey = KeyCode { Function = KEYFUNC_CUT; }; + TEXT[ portuguese ] = "Cor~tar"; + TEXT[ russian ] = "~Cut"; + TEXT[ greek ] = "~Cut"; + TEXT[ dutch ] = "~Knippen"; + TEXT[ french ] = "~Couper"; + TEXT[ spanish ] = "~Cortar"; + TEXT[ italian ] = "~Cut"; + TEXT[ danish ] = "~Cut"; + TEXT[ swedish ] = "~Cut"; + TEXT[ polish ] = "~Cut "; + TEXT[ portuguese_brazilian ] = "~Ausschneiden"; + TEXT[ japanese ] = "(~T)"; + TEXT[ korean ] = "߶(~C)"; + TEXT[ chinese_simplified ] = "~Ausschneiden"; + TEXT[ chinese_traditional ] = "~Cut"; + TEXT[ arabic ] = "~Cut"; + TEXT[ turkish ] = "Kes"; + }; + MenuItem { + Identifier = RID_EDITCOPY; + TEXT = "~Kopieren"; + TEXT [ english_us ] = "~Copy"; + HELPTEXT = "Markierten Text in Zwischenablage kopieren"; + HELPTEXT [ english_us ] = "Markierten Text in Zwischenablage kopieren"; + AccelKey = KeyCode { Function = KEYFUNC_COPY; }; + TEXT[ portuguese ] = "~Copiar"; + TEXT[ russian ] = "~Copy"; + TEXT[ greek ] = "~Copy"; + TEXT[ dutch ] = "~Kopiren"; + TEXT[ french ] = "Co~pier"; + TEXT[ spanish ] = "Copiar"; + TEXT[ italian ] = "~Copy"; + TEXT[ danish ] = "~Copy"; + TEXT[ swedish ] = "~Copy"; + TEXT[ polish ] = "~Copy "; + TEXT[ portuguese_brazilian ] = "~Kopieren"; + TEXT[ japanese ] = "߰(~C)"; + TEXT[ korean ] = "(~C)"; + TEXT[ chinese_simplified ] = "~Kopieren"; + TEXT[ chinese_traditional ] = "~Copy"; + TEXT[ arabic ] = "~Copy"; + TEXT[ turkish ] = "Kopyala"; + }; + MenuItem { + Identifier = RID_EDITPASTE; + TEXT = "E~infgen"; + TEXT [ english_us ] = "~Paste"; + HELPTEXT = "Inhalt der Zwischenablage einfgen"; + HELPTEXT [ english_us ] = "Inhalt der Zwischenablage einfgen"; + AccelKey = KeyCode { Function = KEYFUNC_PASTE; }; + TEXT[ portuguese ] = "In~serir"; + TEXT[ russian ] = "~Paste"; + TEXT[ greek ] = "~Paste"; + TEXT[ dutch ] = "I~nvoegen"; + TEXT[ french ] = "C~oller"; + TEXT[ spanish ] = "In~sertar"; + TEXT[ italian ] = "~Paste"; + TEXT[ danish ] = "~Paste"; + TEXT[ swedish ] = "~Paste"; + TEXT[ polish ] = "~Paste "; + TEXT[ portuguese_brazilian ] = "E~infgen"; + TEXT[ japanese ] = "\\t(~P)"; + TEXT[ korean ] = "ٿֱ(~P)"; + TEXT[ chinese_simplified ] = "E~infgen"; + TEXT[ chinese_traditional ] = "~Paste"; + TEXT[ arabic ] = "~Insert"; + TEXT[ turkish ] = "Ekle"; + }; + MenuItem { + Identifier = RID_EDITDEL; + TEXT = "~Lschen"; + TEXT [ english_us ] = "~Delete"; + HELPTEXT = "Markierten Text lschen"; + HELPTEXT [ english_us ] = "Markierten Text lschen"; + AccelKey = KeyCode { Function = KEYFUNC_DELETE; }; + TEXT[ portuguese ] = "E~liminar"; + TEXT[ russian ] = "~Delete"; + TEXT[ greek ] = "~Delete"; + TEXT[ dutch ] = "~Wissen"; + TEXT[ french ] = "~Supprimer"; + TEXT[ spanish ] = "~Eliminar"; + TEXT[ italian ] = "~Delete"; + TEXT[ danish ] = "~Delete"; + TEXT[ swedish ] = "~Delete"; + TEXT[ polish ] = "~Delete "; + TEXT[ portuguese_brazilian ] = "~Lschen"; + TEXT[ japanese ] = "폜(~D)"; + TEXT[ korean ] = "(~D)"; + TEXT[ chinese_simplified ] = "~Lschen"; + TEXT[ chinese_traditional ] = "~Delete"; + TEXT[ arabic ] = "~Delete"; + TEXT[ turkish ] = "Sil"; + }; + MenuItem { + SEPARATOR = TRUE; + }; + MenuItem { + Identifier = RID_EDITSEARCH; + TEXT = "~Suchen..."; + TEXT [ english_us ] = "~Find..."; + HELPTEXT = "Textstelle suchen"; + HELPTEXT [ english_us ] = "Textstelle suchen"; + AccelKey = KeyCode { Function = KEYFUNC_FIND; }; + TEXT[ portuguese ] = "~Localizar..."; + TEXT[ russian ] = "~Find..."; + TEXT[ greek ] = "~Find..."; + TEXT[ dutch ] = "~Zoeken..."; + TEXT[ french ] = "~Rechercher..."; + TEXT[ spanish ] = "~Buscar..."; + TEXT[ italian ] = "~Find..."; + TEXT[ danish ] = "~Find..."; + TEXT[ swedish ] = "~Find..."; + TEXT[ polish ] = "~Find... "; + TEXT[ portuguese_brazilian ] = "~Suchen..."; + TEXT[ japanese ] = "(~F)..."; + TEXT[ korean ] = "ã(~F)..."; + TEXT[ chinese_simplified ] = "~Suchen..."; + TEXT[ chinese_traditional ] = "~Find..."; + TEXT[ arabic ] = "~Find..."; + TEXT[ turkish ] = "Ara..."; + }; + MenuItem { + Identifier = RID_EDITREPLACE; + TEXT = "~Ersetzen..."; + TEXT [ english_us ] = "~Replace..."; + HELPTEXT = "Textstelle durch anderen Text ersetzen"; + HELPTEXT [ english_us ] = "Textstelle durch anderen Text ersetzen"; + TEXT[ portuguese ] = "~Substituir..."; + TEXT[ russian ] = "~Replace..."; + TEXT[ greek ] = "~Replace..."; + TEXT[ dutch ] = "~Vervangen..."; + TEXT[ french ] = "R~emplacer..."; + TEXT[ spanish ] = "~Sustituir..."; + TEXT[ italian ] = "~Replace..."; + TEXT[ danish ] = "~Replace..."; + TEXT[ swedish ] = "~Replace..."; + TEXT[ polish ] = "~Replace... "; + TEXT[ portuguese_brazilian ] = "~Ersetzen..."; + TEXT[ japanese ] = "u(~R)..."; + TEXT[ korean ] = "ٲٱ(~R)..."; + TEXT[ chinese_simplified ] = "~Ersetzen..."; + TEXT[ chinese_traditional ] = "~Replace..."; + TEXT[ arabic ] = "~Replace..."; + TEXT[ turkish ] = "Deitir..."; + }; + MenuItem { + Identifier = RID_EDITREPEAT; + TEXT = "S~uchen Wiederholen"; + TEXT [ english_us ] = "Repeat S~earch"; + HELPTEXT = "Suchen/ersetzen wiederholen"; + HELPTEXT [ english_us ] = "Suchen/ersetzen wiederholen"; + AccelKey = KeyCode { Code = KEY_F3; }; +// AccelKey = KeyCode { Function = KEYFUNC_REPEAT; }; + TEXT[ portuguese ] = "~Repetir Localizar"; + TEXT[ russian ] = "Repeat S~earch"; + TEXT[ greek ] = "Repeat S~earch"; + TEXT[ dutch ] = "Z~oeken herhalen"; + TEXT[ french ] = "R~pter la recherche"; + TEXT[ spanish ] = "~Repetir bsqueda"; + TEXT[ italian ] = "Repeat S~earch"; + TEXT[ danish ] = "Repeat S~earch"; + TEXT[ swedish ] = "Repeat S~earch"; + TEXT[ polish ] = "Repeat S~earch "; + TEXT[ portuguese_brazilian ] = "S~uchen Wiederholen"; + TEXT[ japanese ] = "̌JԂ(~U)"; + TEXT[ korean ] = "ٽ ã(~E)"; + TEXT[ chinese_simplified ] = "S~uchen Wiederholen"; + TEXT[ chinese_traditional ] = "Repeat S~earch"; + TEXT[ arabic ] = "Repeat S~earch"; + TEXT[ turkish ] = "Yeniden ara"; + }; + }; +}; +Menu RID_RUN { + ITEMLIST = { + MenuItem { + Identifier = RID_RUNCOMPILE; + TEXT = "~Compilieren"; + TEXT [ english_us ] = "~Compile"; + HELPTEXT = "Programm bersetzen"; + HELPTEXT [ english_us ] = "Programm bersetzen"; + AccelKey = KeyCode { Code = KEY_F5; Shift = TRUE; }; + TEXT[ portuguese ] = "~Compilar"; + TEXT[ russian ] = "~Compile"; + TEXT[ greek ] = "~Compile"; + TEXT[ dutch ] = "~Compileren"; + TEXT[ french ] = "~Compiler"; + TEXT[ spanish ] = "~Compilar"; + TEXT[ italian ] = "~Compile"; + TEXT[ danish ] = "~Compile"; + TEXT[ swedish ] = "~Compile"; + TEXT[ polish ] = "~Compile "; + TEXT[ portuguese_brazilian ] = "~Compilieren"; + TEXT[ japanese ] = "߲قs"; + TEXT[ korean ] = "(~C)"; + TEXT[ chinese_simplified ] = "~Compilieren"; + TEXT[ chinese_traditional ] = "~Compile"; + TEXT[ arabic ] = "~Compile"; + TEXT[ turkish ] = "~Derle"; + }; + MenuItem { + Identifier = RID_RUNDISAS; + TEXT = "~Disassemblieren"; + TEXT [ english_us ] = "~Disassemble"; + HELPTEXT = "Programm disassemblieren und Ergebnis ins Clipboard stellen"; + HELPTEXT [ english_us ] = "Programm disassemblieren und Ergebnis ins Clipboard stellen"; + TEXT[ portuguese ] = "~Descodificar"; + TEXT[ russian ] = "~Disassemble"; + TEXT[ greek ] = "~Disassemble"; + TEXT[ dutch ] = "~Disassembleren"; + TEXT[ french ] = "~Dsassembler"; + TEXT[ spanish ] = "~Desensamblar"; + TEXT[ italian ] = "~Disassemble"; + TEXT[ danish ] = "~Disassemble"; + TEXT[ swedish ] = "~Disassemble"; + TEXT[ polish ] = "~Disassemble "; + TEXT[ portuguese_brazilian ] = "~Disassemblieren"; + TEXT[ japanese ] = "~Disassemble"; + TEXT[ korean ] = "ü(~D)"; + TEXT[ chinese_simplified ] = "~Disassemblieren"; + TEXT[ chinese_traditional ] = "~Disassemble"; + TEXT[ arabic ] = "~Disassemble"; + TEXT[ turkish ] = "~Disassemble"; + }; + MenuItem { + Identifier = RID_RUNSTART; + TEXT = "~Start"; + TEXT [ english_us ] = "~Start"; + HELPTEXT = "Programm starten"; + HELPTEXT [ english_us ] = "Programm starten"; + AccelKey = KeyCode { Code = KEY_F5; }; + TEXT[ portuguese ] = "~Iniciar"; + TEXT[ russian ] = "~Start"; + TEXT[ greek ] = "~Start"; + TEXT[ dutch ] = "~Start"; + TEXT[ french ] = "~Dmarrer"; + TEXT[ spanish ] = "~Iniciar"; + TEXT[ italian ] = "~Start"; + TEXT[ danish ] = "~Start"; + TEXT[ swedish ] = "~Start"; + TEXT[ polish ] = "~Start"; + TEXT[ portuguese_brazilian ] = "~Start"; + TEXT[ japanese ] = ""; + TEXT[ korean ] = "(~S)"; + TEXT[ chinese_simplified ] = "~Start"; + TEXT[ chinese_traditional ] = "~Start"; + TEXT[ arabic ] = "~Start"; + TEXT[ turkish ] = "~Balat"; + }; + MenuItem { + Identifier = RID_RUNSTEPINTO; + TEXT = "~Einzelschritt"; + TEXT [ english_us ] = "~Single Stepping"; + HELPTEXT = "Ein Programmschritt"; + HELPTEXT [ english_us ] = "Ein Programmschritt"; + AccelKey = KeyCode { Code = KEY_F8; }; + TEXT[ portuguese ] = "Pa~sso a passo"; + TEXT[ russian ] = "~Single Stepping"; + TEXT[ greek ] = "~Single Stepping"; + TEXT[ dutch ] = "~Stap voor stap"; + TEXT[ french ] = "~tape par tape"; + TEXT[ spanish ] = "~Paso a paso"; + TEXT[ italian ] = "~Single Stepping"; + TEXT[ danish ] = "~Single Stepping"; + TEXT[ swedish ] = "~Single stepping"; + TEXT[ polish ] = "~Single Stepping "; + TEXT[ portuguese_brazilian ] = "~Einzelschritt"; + TEXT[ japanese ] = "~Single Stepping"; + TEXT[ korean ] = " ܰ(~S)"; + TEXT[ chinese_simplified ] = "~Einzelschritt"; + TEXT[ chinese_traditional ] = "~Single Stepping"; + TEXT[ arabic ] = "~Single Stepping"; + TEXT[ turkish ] = "~Tek adm"; + }; + MenuItem { + Identifier = RID_RUNSTEPOVER; + TEXT = "Einzelschritt ber ~Prozeduren"; + TEXT [ english_us ] = "Si~ngle Step over Procedure"; + HELPTEXT = "Ein Programmschritt, ohne Prozeduren"; + HELPTEXT [ english_us ] = "Ein Programmschritt, ohne Prozeduren"; + AccelKey = KeyCode { Code = KEY_F10; }; + TEXT[ portuguese ] = "~Procedimentos passo a passo"; + TEXT[ russian ] = "Si~ngle Step over Procedure"; + TEXT[ greek ] = "Si~ngle Step over Procedure"; + TEXT[ dutch ] = "Stap voor stap ~procedures"; + TEXT[ french ] = "~Procdures tape par tape"; + TEXT[ spanish ] = "Procesos ~paso a paso"; + TEXT[ italian ] = "Si~ngle Stepping (subroutines excluded)"; + TEXT[ danish ] = "Si~ngle Step over Procedure"; + TEXT[ swedish ] = "Si~ngle Step over Procedure"; + TEXT[ polish ] = "Si~ngle Step over Procedure"; + TEXT[ portuguese_brazilian ] = "Einzelschritt ber ~Prozeduren"; + TEXT[ japanese ] = "Si~ngle Stepping (subroutines excluded)"; + TEXT[ korean ] = "ν ܰ(~N)"; + TEXT[ chinese_simplified ] = "Einzelschritt ber ~Prozeduren"; + TEXT[ chinese_traditional ] = "Si~ngle Step over Procedure"; + TEXT[ arabic ] = "Si~ngle Step over Procedure"; + TEXT[ turkish ] = "Si~ngle Step over Procedure"; + }; +// MenuItem { +// Identifier = RID_RUNTOCURSOR; +// TEXT = "Ausfhren ~bis Cursor"; +// TEXT [ english_us ] = "Ausfhren ~bis Cursor"; +// HELPTEXT = "Ausfhren des Programmes bis zur aktuellen Cursorposition"; +// HELPTEXT [ english_us ] = "Ausfhren des Programmes bis zur aktuellen Cursorposition"; +// AccelKey = KeyCode { Code = KEY_F7; }; +// }; + MenuItem { + Identifier = RID_TOGLEBRKPNT; + TEXT = "Brechpunkt setzen/lschen"; + TEXT [ english_us ] = "Set / Delete Break Point"; + HELPTEXT = "Brechpunkt setzen/lschen an der aktuellen Cursorposition"; + HELPTEXT [ english_us ] = "Brechpunkt setzen/lschen an der aktuellen Cursorposition"; + AccelKey = KeyCode { Code = KEY_F9; }; + TEXT[ portuguese ] = "Colocar/Eliminar ponto de quebra "; + TEXT[ russian ] = "Set / Delete Break Point"; + TEXT[ greek ] = "Set / Delete Break Point"; + TEXT[ dutch ] = "Break point zetten/wissen"; + TEXT[ french ] = "Placer / supprimer un point d'arrt (breakpoint)"; + TEXT[ spanish ] = "Poner/eliminar punto de detencin"; + TEXT[ italian ] = "Set / Delete Break Point"; + TEXT[ danish ] = "Set / Delete Break Point"; + TEXT[ swedish ] = "Set / Delete Break Point"; + TEXT[ polish ] = "Set / Delete Break Point"; + TEXT[ portuguese_brazilian ] = "Brechpunkt setzen/lschen"; + TEXT[ japanese ] = "Set / Delete Break Point"; + TEXT[ korean ] = "Break Ʈ /"; + TEXT[ chinese_simplified ] = "Brechpunkt setzen/lschen"; + TEXT[ chinese_traditional ] = "Set / Delete Break Point"; + TEXT[ arabic ] = "Set / Delete Break Point"; + TEXT[ turkish ] = "Set / Delete Break Point"; + }; + MenuItem { + Identifier = RID_RUNBREAK; + TEXT = "~Unterbrechen"; + TEXT [ english_us ] = "~Interrupt"; + HELPTEXT = "Programmlauf unterbrechen"; + HELPTEXT [ english_us ] = "Programmlauf unterbrechen"; + AccelKey = KeyCode { Code = KEY_F5; Modifier1 = TRUE; }; + TEXT[ portuguese ] = "~Interromper"; + TEXT[ russian ] = "~Interrupt"; + TEXT[ greek ] = "~Interrupt"; + TEXT[ dutch ] = "~Onderbreken"; + TEXT[ french ] = "~Interrompre"; + TEXT[ spanish ] = "Interru~mpir"; + TEXT[ italian ] = "~Interrupt"; + TEXT[ danish ] = "~Interrupt"; + TEXT[ swedish ] = "~Interrupt"; + TEXT[ polish ] = "~Interrupt "; + TEXT[ portuguese_brazilian ] = "~Unterbrechen"; + TEXT[ japanese ] = "f"; + TEXT[ korean ] = "ͷƮ(~I)"; + TEXT[ chinese_simplified ] = "~Unterbrechen"; + TEXT[ chinese_traditional ] = "~Interrupt"; + TEXT[ arabic ] = "~Interrupt"; + TEXT[ turkish ] = "~Duraklat"; + }; + MenuItem { + Identifier = RID_RUNSTOP; + TEXT = "~Abbrechen"; + TEXT [ english_us ] = "~Cancel"; + HELPTEXT = "Programmlauf abbrechen"; + HELPTEXT [ english_us ] = "Programmlauf abbrechen"; + TEXT[ portuguese ] = "~Cancelar"; + TEXT[ russian ] = "~Cancel"; + TEXT[ greek ] = "~Cancel"; + TEXT[ dutch ] = "~Stoppen"; + TEXT[ french ] = "~Annuler"; + TEXT[ spanish ] = "~Cancelar"; + TEXT[ italian ] = "~Cancel"; + TEXT[ danish ] = "~Cancel"; + TEXT[ swedish ] = "~Cancel"; + TEXT[ polish ] = "~Cancel"; + TEXT[ portuguese_brazilian ] = "~Abbrechen"; + TEXT[ japanese ] = "ݾ"; + TEXT[ korean ] = "(~C)"; + TEXT[ chinese_simplified ] = "~Abbrechen"; + TEXT[ chinese_traditional ] = "~Cancel"; + TEXT[ arabic ] = "~Cancel"; + TEXT[ turkish ] = "~ptal"; + }; + MenuItem { + Identifier = RID_RUNNEXTERR; + TEXT = "~Nchster Fehler"; + TEXT [ english_us ] = "~Next Error"; + HELPTEXT = "Den nchsten Programmfehler anzeigen"; + HELPTEXT [ english_us ] = "Den nchsten Programmfehler anzeigen"; + AccelKey = KeyCode { Code = KEY_F8; Shift = TRUE; }; + TEXT[ portuguese ] = "Erro ~seguinte"; + TEXT[ russian ] = "~Next Error"; + TEXT[ greek ] = "~Next Error"; + TEXT[ dutch ] = "~Volgende fout"; + TEXT[ french ] = "~Erreur suivante"; + TEXT[ spanish ] = "~Error siguiente"; + TEXT[ italian ] = "Errore successivo"; + TEXT[ danish ] = "~Next Error"; + TEXT[ swedish ] = "~Next Error"; + TEXT[ polish ] = "~Next Error"; + TEXT[ portuguese_brazilian ] = "~Nchster Fehler"; + TEXT[ japanese ] = "̴װ"; + TEXT[ korean ] = " (~N)"; + TEXT[ chinese_simplified ] = "~Nchster Fehler"; + TEXT[ chinese_traditional ] = "~Next Error"; + TEXT[ arabic ] = "~Next Error"; + TEXT[ turkish ] = "~Sonraki hata"; + }; + MenuItem { + Identifier = RID_RUNPREVERR; + TEXT = "~Vorheriger Fehler"; + TEXT [ english_us ] = "~Previous Error"; + HELPTEXT = "Den vorherigen Programmfehler anzeigen"; + HELPTEXT [ english_us ] = "Den vorherigen Programmfehler anzeigen"; + AccelKey = KeyCode { Code = KEY_F7; Shift = TRUE; }; + TEXT[ portuguese ] = "Erro ~anterior"; + TEXT[ russian ] = "~Previous Error"; + TEXT[ greek ] = "~Previous Error"; + TEXT[ dutch ] = "~Vorige fout"; + TEXT[ french ] = "~Erreur prcdente"; + TEXT[ spanish ] = "Error ~anterior"; + TEXT[ italian ] = "~Previous error"; + TEXT[ danish ] = "~Previous Error"; + TEXT[ swedish ] = "~Previous Error"; + TEXT[ polish ] = "~Previous Error"; + TEXT[ portuguese_brazilian ] = "~Vorheriger Fehler"; + TEXT[ japanese ] = "O̴װ"; + TEXT[ korean ] = " (~P)"; + TEXT[ chinese_simplified ] = "~Vorheriger Fehler"; + TEXT[ chinese_traditional ] = "~Previous Error"; + TEXT[ arabic ] = "~Previous Error"; + TEXT[ turkish ] = "~nceki hata"; + }; + MenuItem { + SEPARATOR = TRUE; + }; + }; +}; +// Wird nur beim Test Tool eingefgt + +// unter Folgendem Name +String RID_TT_EXTRAS_NAME +{ + Text = "E~xtras"; + Text[ english_us ] = "E~xtras"; + Text[ portuguese ] = "~Ferramentas"; + Text[ russian ] = ""; + Text[ greek ] = "E~xtras"; + Text[ dutch ] = "E~xtra"; + Text[ french ] = "~Outils"; + Text[ spanish ] = "~Herramientas"; + Text[ italian ] = "E~xtras"; + Text[ danish ] = "E~xtras"; + Text[ swedish ] = "E~xtras"; + Text[ polish ] = "Narzdzia"; + Text[ portuguese_brazilian ] = "E~xtras"; + Text[ japanese ] = "E~xtras"; + Text[ korean ] = " ߰(~X)"; + Text[ chinese_simplified ] = "E~xtras"; + Text[ chinese_traditional ] = "E~xtras"; + Text[ arabic ] = "E~xtras"; + Text[ turkish ] = "Aralar"; +}; + +Menu RID_TT_EXTRAS { + ITEMLIST = { + MenuItem { + Identifier = RID_OPTIONS; + TEXT = "~Einstellungen"; + TEXT [ english_us ] = "~Settings"; + HELPTEXT = "Einstellungen fr das Test Tool"; + HELPTEXT [ english_us ] = "Einstellungen fr das Test Tool"; + TEXT[ portuguese ] = "~Definies"; + TEXT[ russian ] = "~Settings"; + TEXT[ greek ] = "~Settings"; + TEXT[ dutch ] = "~Instellingen"; + TEXT[ french ] = "~Paramtres"; + TEXT[ spanish ] = "~Configuracin"; + TEXT[ italian ] = "~Settings"; + TEXT[ danish ] = "~Settings"; + TEXT[ swedish ] = "~Settings"; + TEXT[ polish ] = "~Settings"; + TEXT[ portuguese_brazilian ] = "~Einstellungen"; + TEXT[ japanese ] = "ݒ"; + TEXT[ korean ] = "(~S)"; + TEXT[ chinese_simplified ] = "~Einstellungen"; + TEXT[ chinese_traditional ] = "~Settings"; + TEXT[ arabic ] = "~Settings"; + TEXT[ turkish ] = "~Ayarlar"; + }; + MenuItem { + Identifier = RID_DECLARE_HELPER; + TEXT = "~Dialoge aufnehmen"; + TEXT [ english_us ] = "~Include Dialogs"; + HELPTEXT = "Modus zum aufnehmen der Dialoge aktivieren"; + HELPTEXT [ english_us ] = "Modus zum aufnehmen der Dialoge aktivieren"; + TEXT[ portuguese ] = "~Incluir caixas de dilogo"; + TEXT[ russian ] = "~Include Dialogs"; + TEXT[ greek ] = "~Include Dialogs"; + TEXT[ dutch ] = "~Dialogen opnemen"; + TEXT[ french ] = "Ajouter une bote de ~dialogue"; + TEXT[ spanish ] = "In~cluir dilogos"; + TEXT[ italian ] = "~Include Dialogs"; + TEXT[ danish ] = "~Include Dialogs"; + TEXT[ swedish ] = "~Include Dialogs"; + TEXT[ polish ] = "~Include Dialogs"; + TEXT[ portuguese_brazilian ] = "~Dialoge aufnehmen"; + TEXT[ japanese ] = "۸ނn߂"; + TEXT[ korean ] = "̾α (~I)"; + TEXT[ chinese_simplified ] = "~Dialoge aufnehmen"; + TEXT[ chinese_traditional ] = "~Include Dialogs"; + TEXT[ arabic ] = "~Include Dialogs"; + TEXT[ turkish ] = "~Diyaloglar ekle"; + }; + }; +}; +Menu RID_WINDOW { + ITEMLIST = { + MenuItem { + Identifier = RID_WINCASCADE; + TEXT = "~berlappend"; + TEXT [ english_us ] = "~Overlapping"; + HELPTEXT = "Fenster berlappend anordnen"; + HELPTEXT [ english_us ] = "Fenster berlappend anordnen"; + TEXT[ portuguese ] = "Em ~cascata"; + TEXT[ russian ] = "~Overlapping"; + TEXT[ greek ] = "~Overlapping"; + TEXT[ dutch ] = "~Overlappend"; + TEXT[ french ] = "~Cascade"; + TEXT[ spanish ] = "~Cascada"; + TEXT[ italian ] = "~Overlapping"; + TEXT[ danish ] = "~Overlapping"; + TEXT[ swedish ] = "~Overlapping"; + TEXT[ polish ] = "~Overlapping"; + TEXT[ portuguese_brazilian ] = "~berlappend"; + TEXT[ japanese ] = "d˂ĕ\\"; + TEXT[ korean ] = "ġ(~O)"; + TEXT[ chinese_simplified ] = "~berlappend"; + TEXT[ chinese_traditional ] = "~Overlapping"; + TEXT[ arabic ] = "~Overlapping"; + TEXT[ turkish ] = "B~asamakla"; + }; + MenuItem { + Identifier = RID_WINTILE; + TEXT = "~Nebeneinander"; + TEXT [ english_us ] = "~Tile"; + HELPTEXT = "Fenster nebeneinander anordnen"; + HELPTEXT [ english_us ] = "Fenster nebeneinander anordnen"; + TEXT[ portuguese ] = "~Lado a lado"; + TEXT[ russian ] = "~Tile"; + TEXT[ greek ] = "~Tile"; + TEXT[ dutch ] = "~Naast elkaar"; + TEXT[ french ] = "Ca~rrelage"; + TEXT[ spanish ] = "~Mosaico"; + TEXT[ italian ] = "~Tile"; + TEXT[ danish ] = "~Tile"; + TEXT[ swedish ] = "~Tile"; + TEXT[ polish ] = "~Tile"; + TEXT[ portuguese_brazilian ] = "~Nebeneinander"; + TEXT[ japanese ] = "ׂĕ\\"; + TEXT[ korean ] = "â (~T)"; + TEXT[ chinese_simplified ] = "~Nebeneinander"; + TEXT[ chinese_traditional ] = "~Tiled"; + TEXT[ arabic ] = "~Tiled"; + TEXT[ turkish ] = "~Yan yana"; + }; + MenuItem { + Identifier = RID_WINTILEHORZ; + TEXT = "~Horizontal anordnen"; + TEXT [ english_us ] = "~Arrange Horizontally"; + HELPTEXT = "Fenster horizontal bereinander anordnen"; + HELPTEXT [ english_us ] = "Fenster horizontal bereinander anordnen"; + TEXT[ portuguese ] = "~Dispor na horizontal"; + TEXT[ russian ] = "~Arrange Horizontally"; + TEXT[ greek ] = "~Arrange Horizontally"; + TEXT[ dutch ] = "~Horizontaal schikken"; + TEXT[ french ] = "~Aligner horizontalement"; + TEXT[ spanish ] = "~Horizontal"; + TEXT[ italian ] = "~Arrange Horizontally"; + TEXT[ danish ] = "~Arrange Horizontally"; + TEXT[ swedish ] = "~Arrange Horizontally"; + TEXT[ polish ] = "~Arrange Horizontally"; + TEXT[ portuguese_brazilian ] = "~Horizontal anordnen"; + TEXT[ japanese ] = "Eɕׂĕ\\"; + TEXT[ korean ] = " (~A)"; + TEXT[ chinese_simplified ] = "~Horizontal anordnen"; + TEXT[ chinese_traditional ] = "~Arrange Horizontally"; + TEXT[ arabic ] = "~Arrange Horizontally"; + TEXT[ turkish ] = "~Yatay yerletir"; + }; + MenuItem { + Identifier = RID_WINTILEVERT; + TEXT = "~Vertikal anordnen"; + TEXT [ english_us ] = "~Arrange Vertically"; + HELPTEXT = "Fenster vertikal nebeneinander anordnen"; + HELPTEXT [ english_us ] = "Fenster vertikal nebeneinander anordnen"; + TEXT[ portuguese ] = "~Dispor na vertical"; + TEXT[ russian ] = "~Arrange Vertically"; + TEXT[ greek ] = "~Arrange Vertically"; + TEXT[ dutch ] = "~Verticaal schikken"; + TEXT[ french ] = "~Verticalement"; + TEXT[ spanish ] = "~Vertical"; + TEXT[ italian ] = "~Arrange Vertically"; + TEXT[ danish ] = "~Arrange Vertically"; + TEXT[ swedish ] = "~Arrange Vertically"; + TEXT[ polish ] = "~Arrange Vertically"; + TEXT[ portuguese_brazilian ] = "~Vertikal anordnen"; + TEXT[ japanese ] = "㉺ɕׂĕ\\"; + TEXT[ korean ] = " (~A)"; + TEXT[ chinese_simplified ] = "~Vertikal anordnen"; + TEXT[ chinese_traditional ] = "~Arrange Vertically"; + TEXT[ arabic ] = "~Arrange Vertically"; + TEXT[ turkish ] = "~Dikey yerletir"; + }; + }; +}; +Menu RID_HELP { + ITEMLIST = { +/* MenuItem { + Identifier = RID_HELPINDEX; + TEXT = "~Index"; + TEXT [ english_us ] = "~Index"; + HELPTEXT = "Inhaltsverzeichnis der Hilfe"; + HELPTEXT [ english_us ] = "Inhaltsverzeichnis der Hilfe"; + }; + MenuItem { + SEPARATOR = TRUE; + }; + MenuItem { + Identifier = RID_HELPKEYS; + TEXT = "~Tastaturbelegung"; + TEXT [ english_us ] = "~Tastaturbelegung"; + HELPTEXT = "Liste der definierten Sondertasten"; + HELPTEXT [ english_us ] = "Liste der definierten Sondertasten"; + }; + MenuItem { + Identifier = RID_HELPINTRO; + TEXT = "~Anleitung"; + TEXT [ english_us ] = "~Anleitung"; + HELPTEXT = "Einfhrung in die Programmierung"; + HELPTEXT [ english_us ] = "Einfhrung in die Programmierung"; + }; + MenuItem { + SEPARATOR = TRUE; + }; + MenuItem { + Identifier = RID_HELPTOPIC; + TEXT = "~Markierter Text"; + TEXT [ english_us ] = "~Markierter Text"; + HELPTEXT = "Aktuell markierten Text erlutern"; + HELPTEXT [ english_us ] = "Aktuell markierten Text erlutern"; + }; + MenuItem { + SEPARATOR = TRUE; + }; +*/ MenuItem { + ABOUT = TRUE; + Identifier = RID_HELPABOUT; + TEXT = "~Info..."; + TEXT [ english_us ] = "~About..."; + HELPTEXT = "Copyright-Informationen"; + HELPTEXT [ english_us ] = "Copyright-Informationen"; + TEXT[ portuguese ] = "~Informao..."; + TEXT[ russian ] = "~About..."; + TEXT[ greek ] = "~About..."; + TEXT[ dutch ] = "~Info..."; + TEXT[ french ] = "~Info..."; + TEXT[ spanish ] = "~Informacin..."; + TEXT[ italian ] = "~Info..."; + TEXT[ danish ] = "~About..."; + TEXT[ swedish ] = "~About..."; + TEXT[ polish ] = "~About..."; + TEXT[ portuguese_brazilian ] = "~Info..."; + TEXT[ japanese ] = "(~I)..."; + TEXT[ korean ] = "(~A)..."; + TEXT[ chinese_simplified ] = "~Info..."; + TEXT[ chinese_traditional ] = "~About..."; + TEXT[ arabic ] = "..."; + TEXT[ turkish ] = "~Bilgi..."; + }; + }; +}; +ModelessDialog IDD_PRINT_DIALOG { + Pos = MAP_APPFONT( 83, 42 ); + Size = MAP_APPFONT( 171, 94 ); + TEXT = "StarBasic: Datei drucken"; + TEXT [ english_us ] = "StarBasic: Print File"; + MOVEABLE = TRUE; + SVLook = TRUE; + FixedText RID_TEXT { + Pos = MAP_APPFONT( 11, 9 ); + Size = MAP_APPFONT( 146, 28 ); + TEXT = "Druck von "; + TEXT [ english_us ] = "Print from "; + CENTER = TRUE; + TEXT[ portuguese ] = "Impresso de "; + TEXT[ russian ] = "Print from "; + TEXT[ greek ] = "Print from "; + TEXT[ dutch ] = "Afdruk van "; + TEXT[ french ] = "Impression de "; + TEXT[ spanish ] = "Imprimir "; + TEXT[ italian ] = "Print from "; + TEXT[ danish ] = "Print from "; + TEXT[ swedish ] = "Print from "; + TEXT[ polish ] = "Print from "; + TEXT[ portuguese_brazilian ] = "Druck von "; + TEXT[ japanese ] = "͈ "; + TEXT[ korean ] = "κ μ "; + TEXT[ chinese_simplified ] = "Druck von "; + TEXT[ chinese_traditional ] = "Print from "; + TEXT[ arabic ] = "Print from "; + TEXT[ turkish ] = "kt kayna "; + }; + CancelButton RID_CANCEL { + Pos = MAP_APPFONT( 56, 46 ); + Size = MAP_APPFONT( 47, 19 ); + TEXT = "Abbruch"; + TEXT [ english_us ] = "Cancel"; + TEXT[ portuguese ] = "Cancelar"; + TEXT[ russian ] = "Cancel"; + TEXT[ greek ] = "Cancel"; + TEXT[ dutch ] = "Annuleren"; + TEXT[ french ] = "Annuler"; + TEXT[ spanish ] = "Cancelar"; + TEXT[ italian ] = "Cancel"; + TEXT[ danish ] = "Cancel"; + TEXT[ swedish ] = "Cancel"; + TEXT[ polish ] = "Cancel"; + TEXT[ portuguese_brazilian ] = "Abbruch"; + TEXT[ japanese ] = "ݾ"; + TEXT[ korean ] = ""; + TEXT[ chinese_simplified ] = "Abbruch"; + TEXT[ chinese_traditional ] = "Cancel"; + TEXT[ arabic ] = "Cancel"; + TEXT[ turkish ] = "ptal"; + }; + TEXT[ portuguese ] = "StarOffice Basic: imprimir ficheiro"; + TEXT[ russian ] = "StarBasic: Print File"; + TEXT[ greek ] = "StarBasic: Print File"; + TEXT[ dutch ] = "StarOffice Basic: bestand afdrukken"; + TEXT[ french ] = "StarBasic: Impression d'un fichier"; + TEXT[ spanish ] = "StarBasic: Imprimir archivo"; + TEXT[ italian ] = "StarBasic: Print file"; + TEXT[ danish ] = "StarBasic: Print File"; + TEXT[ swedish ] = "StarBasic: Print File"; + TEXT[ polish ] = "StarBasic: Print File"; + TEXT[ portuguese_brazilian ] = "StarBasic: Datei drucken"; + TEXT[ japanese ] = "StarBasic: ̧ق̈"; + TEXT[ korean ] = "StarBasic: Ʈ "; + TEXT[ chinese_simplified ] = "StarBasic: Datei drucken"; + TEXT[ chinese_traditional ] = "StarOffcie Basic: Print File"; + TEXT[ arabic ] = "StarBasic: Print File"; + TEXT[ turkish ] = "StarBasic: Dosyay yazdr"; +}; + + +ModelessDialog IDD_OPTIONS_DLG +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT( 248, 140 ); + Text = "Einstellungen" ; + Text [ english_us ] = "Settings" ; + Moveable = TRUE ; + Closeable = TRUE ; + TabControl RES_TC_OPTIONS + { + OutputSize = TRUE ; + Pos = MAP_APPFONT( 4, 4 ); + Size = MAP_APPFONT( 240, 116 ); + Hide = FALSE ; + PageList = + { + PageItem + { + Identifier = RID_TP_GEN ; + Text = "Generisch" ; + Text [ english_us ] = "Generic" ; + Text[ portuguese ] = "Genrico"; + Text[ russian ] = "Generic"; + Text[ greek ] = "Generic"; + Text[ dutch ] = "Generiek"; + Text[ french ] = "Gnrique"; + Text[ spanish ] = "Genrico"; + Text[ italian ] = "Generic"; + Text[ danish ] = "Generic"; + Text[ swedish ] = "Generic"; + Text[ polish ] = "Generic"; + Text[ portuguese_brazilian ] = "Generisch"; + Text[ japanese ] = "I"; + Text[ korean ] = "Ϲ"; + Text[ chinese_simplified ] = "Generisch"; + Text[ chinese_traditional ] = "Generic"; + Text[ arabic ] = "Generic"; + Text[ turkish ] = "Genel"; + }; + PageItem + { + Identifier = RID_TP_SPE ; + Text = "Spezial" ; + Text [ english_us ] = "Specialized" ; + Text[ portuguese ] = "Especial"; + Text[ russian ] = "Specialized"; + Text[ greek ] = "Specialized"; + Text[ dutch ] = "Speciaal"; + Text[ french ] = "Spcial"; + Text[ spanish ] = "Especial"; + Text[ italian ] = "Special"; + Text[ danish ] = "Specialized"; + Text[ swedish ] = "Specialized"; + Text[ polish ] = "Specialized"; + Text[ portuguese_brazilian ] = "Spezial"; + Text[ japanese ] = ""; + Text[ korean ] = "Ư"; + Text[ chinese_simplified ] = "Spezial"; + Text[ chinese_traditional ] = "Specialized"; + Text[ arabic ] = "Specialized"; + Text[ turkish ] = "zel"; + }; + }; + OKButton RID_OK { + Pos = MAP_APPFONT( 65, 124 ); + Size = MAP_APPFONT( 55, 12 ); + TabStop = TRUE; + DefButton = TRUE; + }; + CancelButton RID_CANCEL { + Pos = MAP_APPFONT( 135, 124 ); + Size = MAP_APPFONT( 55, 12 ); + TabStop = TRUE; + }; + }; + Text[ portuguese ] = "Definies"; + Text[ russian ] = "Settings"; + Text[ greek ] = "Settings"; + Text[ dutch ] = "Instellingen"; + Text[ french ] = "Paramtres"; + Text[ spanish ] = "Configuracin"; + Text[ italian ] = "Settings"; + Text[ danish ] = "Settings"; + Text[ swedish ] = "Settings"; + Text[ polish ] = "Settings"; + Text[ portuguese_brazilian ] = "Einstellungen"; + Text[ japanese ] = "ݒ"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Einstellungen"; + Text[ chinese_traditional ] = "Settings"; + Text[ arabic ] = "Settings"; + Text[ turkish ] = "Ayarlar"; +}; + + +TabPage RID_TP_GENERIC { + Hide = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT( 244, 100 ); + GroupBox RID_GB_AREA { + Pos = MAP_APPFONT( 4, 4 ); + Size = MAP_APPFONT( 228, 28 ); + Text = "Bereich"; + Text [ english_us ] = "Range"; + Text[ portuguese ] = "rea"; + Text[ russian ] = "Range"; + Text[ greek ] = "Range"; + Text[ dutch ] = "Bereik"; + Text[ french ] = "Zone"; + Text[ spanish ] = "rea"; + Text[ italian ] = "Range"; + Text[ danish ] = "Range"; + Text[ swedish ] = "Range"; + Text[ polish ] = "Range"; + Text[ portuguese_brazilian ] = "Bereich"; + Text[ japanese ] = "͈"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Bereich"; + Text[ chinese_traditional ] = "Range"; + Text[ arabic ] = "Range"; + Text[ turkish ] = "Aralk"; + }; + ComboBox RID_CB_AREA { + HScroll = TRUE; + VScroll = TRUE; + AutoHScroll = TRUE; + Border = TRUE; + Pos = MAP_APPFONT( 8, 16 ); + Size = MAP_APPFONT( 132, 88 ); + TabStop = TRUE; + DropDown = TRUE; + }; + PushButton RID_PB_NEW_AREA { + Pos = MAP_APPFONT( 144, 16 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "Neu"; + Text [ english_us ] = "New"; + TabStop = TRUE; + Text[ portuguese ] = "Novo"; + Text[ russian ] = "New"; + Text[ greek ] = "New"; + Text[ dutch ] = "Nieuw"; + Text[ french ] = "Nouveau"; + Text[ spanish ] = "Nuevo"; + Text[ italian ] = "New"; + Text[ danish ] = "New"; + Text[ swedish ] = "New"; + Text[ polish ] = "New "; + Text[ portuguese_brazilian ] = "Neu"; + Text[ japanese ] = "VK"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Neu"; + Text[ chinese_traditional ] = "New"; + Text[ arabic ] = "New"; + Text[ turkish ] = "Yeni"; + }; + PushButton RID_PD_DEL_AREA { + Pos = MAP_APPFONT( 188, 16 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "Lschen"; + Text [ english_us ] = "Delete"; + TabStop = TRUE; + Text[ portuguese ] = "Eliminar"; + Text[ russian ] = "Delete"; + Text[ greek ] = "Delete"; + Text[ dutch ] = "Wissen"; + Text[ french ] = "Supprimer"; + Text[ spanish ] = "Eliminar"; + Text[ italian ] = "Cancel"; + Text[ danish ] = "Delete"; + Text[ swedish ] = "Delete"; + Text[ polish ] = "Delete"; + Text[ portuguese_brazilian ] = "Lschen"; + Text[ japanese ] = "폜"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Lschen"; + Text[ chinese_traditional ] = "Delete"; + Text[ arabic ] = "Delete"; + Text[ turkish ] = "Sil"; + }; + GroupBox RID_GB_VALUE { + Pos = MAP_APPFONT( 4, 36 ); + Size = MAP_APPFONT( 228, 60 ); + Text = "Einstellung"; + Text [ english_us ] = "Setting"; + Text[ portuguese ] = "Configurao"; + Text[ russian ] = "Setting"; + Text[ greek ] = "Setting"; + Text[ dutch ] = "Instelling"; + Text[ french ] = "Paramtre"; + Text[ spanish ] = "Configuracin"; + Text[ italian ] = "Setting"; + Text[ danish ] = "Setting"; + Text[ swedish ] = "Setting"; + Text[ polish ] = "Setting"; + Text[ portuguese_brazilian ] = "Einstellung"; + Text[ japanese ] = "ݒ"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Einstellung"; + Text[ chinese_traditional ] = "Settings"; + Text[ arabic ] = "Setting"; + Text[ turkish ] = "Ayarlar"; + }; + ComboBox RID_CB_VALUE { + HScroll = TRUE; + VScroll = TRUE; + AutoHScroll = TRUE; + Border = TRUE; + Pos = MAP_APPFONT( 8, 48 ); + Size = MAP_APPFONT( 176, 44 ); + TabStop = TRUE; + }; + PushButton RID_PB_NEW_VALUE { + Pos = MAP_APPFONT( 188, 48 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "Neu"; + Text [ english_us ] = "New"; + TabStop = TRUE; + Text[ portuguese ] = "Novo"; + Text[ russian ] = "New"; + Text[ greek ] = "New"; + Text[ dutch ] = "Nieuw"; + Text[ french ] = "Nouveau"; + Text[ spanish ] = "Nuevo"; + Text[ italian ] = "New"; + Text[ danish ] = "New"; + Text[ swedish ] = "New"; + Text[ polish ] = "New"; + Text[ portuguese_brazilian ] = "Neu"; + Text[ japanese ] = "VK"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Neu"; + Text[ chinese_traditional ] = "New"; + Text[ arabic ] = "New"; + Text[ turkish ] = "Yeni"; + }; + PushButton RID_PB_DEL_VALUE { + Pos = MAP_APPFONT( 188, 64 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "Lschen"; + Text [ english_us ] = "Delete"; + TabStop = TRUE; + Text[ portuguese ] = "Eliminar"; + Text[ russian ] = "Delete"; + Text[ greek ] = "Delete"; + Text[ dutch ] = "Wissen"; + Text[ french ] = "Supprimer"; + Text[ spanish ] = "Eliminar"; + Text[ italian ] = "Cancel"; + Text[ danish ] = "Delete"; + Text[ swedish ] = "Delete"; + Text[ polish ] = "Delete"; + Text[ portuguese_brazilian ] = "Lschen"; + Text[ japanese ] = "폜"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Lschen"; + Text[ chinese_traditional ] = "Delete"; + Text[ arabic ] = "Delete"; + Text[ turkish ] = "Sil"; + }; +}; + + +TabPage RID_TP_SPECIAL { + Hide = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT( 244, 100 ); + GroupBox GB_DIRECTORIES { + Pos = MAP_APPFONT( 4, 4 ); + Size = MAP_APPFONT( 230, 56 ); + Text = "Verzeichnisse"; + Text [ english_us ] = "Directories"; + Text[ portuguese ] = "Directrios"; + Text[ russian ] = "Directories"; + Text[ greek ] = "Directories"; + Text[ dutch ] = "Directory's"; + Text[ french ] = "Rpertoires"; + Text[ spanish ] = "Directorios"; + Text[ italian ] = "Directories"; + Text[ danish ] = "Directories"; + Text[ swedish ] = "Directories"; + Text[ polish ] = "Directories"; + Text[ portuguese_brazilian ] = "Verzeichnisse"; + Text[ japanese ] = "ިڸ"; + Text[ korean ] = "丮"; + Text[ chinese_simplified ] = "Verzeichnisse"; + Text[ chinese_traditional ] = "Directories"; + Text[ arabic ] = "Directories"; + Text[ turkish ] = "Dizinler"; + }; + FixedText LOG_TEXT { + Pos = MAP_APPFONT( 7, 12 ); + Size = MAP_APPFONT( 76, 12 ); + Text = "Log Basisverzeichnis"; + Text [ english_us ] = "Log home directory"; + Text[ portuguese ] = "Directrio LOG de base"; + Text[ russian ] = "Log home directory"; + Text[ greek ] = "Log home directory"; + Text[ dutch ] = "Log home directory"; + Text[ french ] = "Rpertoire racine LOG"; + Text[ spanish ] = "Directorio base de Log"; + Text[ italian ] = "Cartella log home"; + Text[ danish ] = "Log home directory"; + Text[ swedish ] = "Log home directory"; + Text[ polish ] = "Log home directory"; + Text[ portuguese_brazilian ] = "Log Basisverzeichnis"; + Text[ japanese ] = "۸ ΰ ިڸ"; + Text[ korean ] = "α Ȩ 丮"; + Text[ chinese_simplified ] = "Log Basisverzeichnis"; + Text[ chinese_traditional ] = "Log home directory"; + Text[ arabic ] = "Log home directory"; + Text[ turkish ] = "Log ana dizin"; + }; + FixedText BASIS_TEXT { + Pos = MAP_APPFONT( 7, 28 ); + Size = MAP_APPFONT( 76, 12 ); + Text = "Basisverzeichnis"; + Text [ english_us ] = "Home directory"; + Text[ portuguese ] = "Directrio de base"; + Text[ russian ] = "Home directory"; + Text[ greek ] = "Home directory"; + Text[ dutch ] = "Home directory"; + Text[ french ] = "Rpertoire racine"; + Text[ spanish ] = "Directorio base"; + Text[ italian ] = "Cartella home"; + Text[ danish ] = "Home directory"; + Text[ swedish ] = "Home directory"; + Text[ polish ] = "Home directory"; + Text[ portuguese_brazilian ] = "Basisverzeichnis"; + Text[ japanese ] = "ΰ ިڸ"; + Text[ korean ] = "Ȩ 丮"; + Text[ chinese_simplified ] = "Basisverzeichnis"; + Text[ chinese_traditional ] = "Home directory"; + Text[ arabic ] = "Home directory"; + Text[ turkish ] = "Ana dizin"; + }; + FixedText HID_TEXT { + Pos = MAP_APPFONT( 7, 44 ); + Size = MAP_APPFONT( 76, 12 ); + Text = "HID Verzeichnis"; + Text [ english_us ] = "HID directory"; + Text[ portuguese ] = "Directrio HID"; + Text[ russian ] = "HID directory"; + Text[ greek ] = "HID directory"; + Text[ dutch ] = "HID directory"; + Text[ french ] = "Rpertoire HID"; + Text[ spanish ] = "Directorio HID"; + Text[ italian ] = "Cartella HID"; + Text[ danish ] = "HID directory"; + Text[ swedish ] = "HID directory"; + Text[ polish ] = "HID directory"; + Text[ portuguese_brazilian ] = "HID Verzeichnis"; + Text[ japanese ] = "HID ިڸ"; + Text[ korean ] = "HID 丮"; + Text[ chinese_simplified ] = "HID Verzeichnis"; + Text[ chinese_traditional ] = "HID directory"; + Text[ arabic ] = "HID directory"; + Text[ turkish ] = "HID diziniz"; + }; + Edit LOG_NAME { + Border = TRUE; + Pos = MAP_APPFONT( 87, 12 ); + Size = MAP_APPFONT( 126, 12 ); + TabStop = TRUE; + }; + Edit BASIS_NAME { + Border = TRUE; + Pos = MAP_APPFONT( 87, 28 ); + Size = MAP_APPFONT( 126, 12 ); + TabStop = TRUE; + }; + Edit HID_NAME { + Border = TRUE; + Pos = MAP_APPFONT( 87, 44 ); + Size = MAP_APPFONT( 126, 12 ); + TabStop = TRUE; + }; + PushButton LOG_SET { + Pos = MAP_APPFONT( 217, 12 ); + Size = MAP_APPFONT( 12, 12 ); + Text = "..."; + Text [ english_us ] = "..."; + TabStop = TRUE; + Text[ portuguese ] = "..."; + Text[ russian ] = "..."; + Text[ greek ] = "..."; + Text[ dutch ] = "..."; + Text[ french ] = "..."; + Text[ spanish ] = "..."; + Text[ italian ] = "..."; + Text[ danish ] = "..."; + Text[ swedish ] = "..."; + Text[ polish ] = "..."; + Text[ portuguese_brazilian ] = "..."; + Text[ japanese ] = "..."; + Text[ korean ] = "..."; + Text[ chinese_simplified ] = "..."; + Text[ chinese_traditional ] = "..."; + Text[ arabic ] = "..."; + Text[ turkish ] = "..."; + }; + PushButton BASIS_SET { + Pos = MAP_APPFONT( 217, 28 ); + Size = MAP_APPFONT( 12, 12 ); + Text = "..."; + Text [ english_us ] = "..."; + TabStop = TRUE; + Text[ portuguese ] = "..."; + Text[ russian ] = "..."; + Text[ greek ] = "..."; + Text[ dutch ] = "..."; + Text[ french ] = "..."; + Text[ spanish ] = "..."; + Text[ italian ] = "..."; + Text[ danish ] = "..."; + Text[ swedish ] = "..."; + Text[ polish ] = "..."; + Text[ portuguese_brazilian ] = "..."; + Text[ japanese ] = "..."; + Text[ korean ] = "..."; + Text[ chinese_simplified ] = "..."; + Text[ chinese_traditional ] = "..."; + Text[ arabic ] = "..."; + Text[ turkish ] = "..."; + }; + PushButton HID_SET { + Pos = MAP_APPFONT( 217, 44 ); + Size = MAP_APPFONT( 12, 12 ); + Text = "..."; + Text [ english_us ] = "..."; + TabStop = TRUE; + Text[ portuguese ] = "..."; + Text[ russian ] = "..."; + Text[ greek ] = "..."; + Text[ dutch ] = "..."; + Text[ french ] = "..."; + Text[ spanish ] = "..."; + Text[ italian ] = "..."; + Text[ danish ] = "..."; + Text[ swedish ] = "..."; + Text[ polish ] = "..."; + Text[ portuguese_brazilian ] = "..."; + Text[ japanese ] = "..."; + Text[ korean ] = "..."; + Text[ chinese_simplified ] = "..."; + Text[ chinese_traditional ] = "..."; + Text[ arabic ] = "..."; + Text[ turkish ] = "..."; + }; + GroupBox GB_OTHER { + Pos = MAP_APPFONT( 4, 62 ); + Size = MAP_APPFONT( 230, 34 ); + Text = "Andere Einstellungen"; + Text [ english_us ] = "Other settings"; + Text[ portuguese ] = "Outras definies"; + Text[ russian ] = "Other settings"; + Text[ greek ] = "Other settings"; + Text[ dutch ] = "Andere instellingen"; + Text[ french ] = "Autres paramtres"; + Text[ spanish ] = "Otra configuracin"; + Text[ italian ] = "Other settings"; + Text[ danish ] = "Other settings"; + Text[ swedish ] = "Other settings"; + Text[ polish ] = "Other settings"; + Text[ portuguese_brazilian ] = "Andere Einstellungen"; + Text[ japanese ] = "̑̐ݒ"; + Text[ korean ] = "ٸ "; + Text[ chinese_simplified ] = "Andere Einstellungen"; + Text[ chinese_traditional ] = "Ohter settings"; + Text[ arabic ] = "Other settings"; + Text[ turkish ] = "Dier ayarlar"; + }; + FixedText TIMEOUT_TEXT { + Pos = MAP_APPFONT( 8, 70 ); + Size = MAP_APPFONT( 70, 12 ); + Text = "Server Timeout"; + Text [ english_us ] = "Server Timeout"; + Text[ portuguese ] = "Timeout do servidor"; + Text[ russian ] = "Server Timeout"; + Text[ greek ] = "Server Timeout"; + Text[ dutch ] = "Server timeout"; + Text[ french ] = "Timeout du serveur (dpassement de dlai)"; + Text[ spanish ] = "Server Timeout"; + Text[ italian ] = "Server Timeout"; + Text[ danish ] = "Server Timeout"; + Text[ swedish ] = "Server Timeout"; + Text[ polish ] = "Server Timeout"; + Text[ portuguese_brazilian ] = "Server Timeout"; + Text[ japanese ] = "ް ѱ"; + Text[ korean ] = " ŸӾƿ"; + Text[ chinese_simplified ] = "Server Timeout"; + Text[ chinese_traditional ] = "Server Timeout"; + Text[ arabic ] = "Server Timeout"; + Text[ turkish ] = "Sunucu zaman am"; + }; + TimeField SERVER_TIMEOUT { + Border = TRUE; + Pos = MAP_APPFONT( 83, 70 ); + Size = MAP_APPFONT( 40, 12 ); + TabStop = TRUE; + Repeat = TRUE; + Spin = TRUE; + Format = TIMEF_SEC; + Duration = TRUE; + }; + CheckBox CB_AUTORELOAD { + Pos = MAP_APPFONT( 8, 83 ); + Size = MAP_APPFONT( 115, 12 ); + Text = "Automatischer Reload"; + Text [ english_us ] = "AutoReload"; + Text[ portuguese ] = "Recarga automtica"; + Text[ russian ] = "AutoReload"; + Text[ greek ] = "AutoReload"; + Text[ dutch ] = "Automatische reload"; + Text[ french ] = "Recharge automatique"; + Text[ spanish ] = "Recarga automtica"; + Text[ italian ] = "AutoReload"; + Text[ danish ] = "AutoReload"; + Text[ swedish ] = "AutoReload"; + Text[ polish ] = "AutoReload"; + Text[ portuguese_brazilian ] = "Automatischer Reload"; + Text[ japanese ] = "AutoReload"; + Text[ korean ] = "ڵε"; + Text[ chinese_simplified ] = "Automatischer Reload"; + Text[ chinese_traditional ] = "AutoReload"; + Text[ arabic ] = "AutoReload"; + Text[ turkish ] = "Otomatik yeniden ykleme"; + }; +// CheckBox 5555 { +// Pos = MAP_APPFONT( 127, 70 ); +// Size = MAP_APPFONT( 103, 12 ); +// Text = "Unbenutzt aber Positioniert"; +// Text [ english_us ] = "Unbenutzt aber Positioniert"; +// }; +}; + + + +FloatingWindow IDD_DISPLAY_HID { + OutputSize = TRUE; + SVLook = TRUE; + Size = MAP_APPFONT( 261, 160 ); + Text = "Display HId"; + Text [ english_us ] = "Display HId"; + Moveable = TRUE; + Closeable = TRUE; + Sizeable = TRUE; + Zoomable = TRUE; + Hide = TRUE; + ClipChildren = TRUE; + ToolBox RID_TB_CONF { + Border = TRUE; + Pos = MAP_APPFONT( 0, 0 ); + Size = MAP_APPFONT( 260, 14 ); +/* ItemList = { + ToolBoxItem { + Text = "erster der Toolbox"; + Text [ english_us ] = "erster der Toolbox"; + }; + };*/ +// Hide = TRUE; + }; + FixedText RID_FT_CONTROLS { + Pos = MAP_APPFONT( 4, 16 ); + Size = MAP_APPFONT( 128, 10 ); + Text = "Controls"; + Text [ english_us ] = "Controls"; + Text[ portuguese ] = "Controlos"; + Text[ russian ] = "Controls"; + Text[ greek ] = "Controls"; + Text[ dutch ] = "Controls"; + Text[ french ] = "Contrles"; + Text[ spanish ] = "Controles"; + Text[ italian ] = "Controls"; + Text[ danish ] = "Controls"; + Text[ swedish ] = "Controls"; + Text[ polish ] = "Controls"; + Text[ portuguese_brazilian ] = "Controls"; + Text[ japanese ] = "Controls"; + Text[ korean ] = "Ʈ"; + Text[ chinese_simplified ] = "Controls"; + Text[ chinese_traditional ] = "Controls"; + Text[ arabic ] = "Controls"; + Text[ turkish ] = "Denetimler"; + }; + MultiListBox RID_MLB_CONTROLS { + Border = TRUE; + AutoHScroll = TRUE; + Pos = MAP_APPFONT( 4, 28 ); + Size = MAP_APPFONT( 208, 88 ); + TabStop = TRUE; + }; + FixedText RID_FT_SLOTS { + Pos = MAP_APPFONT( 4, 120 ); + Size = MAP_APPFONT( 128, 10 ); + Text = "Slots"; + Text [ english_us ] = "Slots"; + Text[ portuguese ] = "Slots"; + Text[ russian ] = "Slots"; + Text[ greek ] = "Slots"; + Text[ dutch ] = "Slots"; + Text[ french ] = "Ports (slots)"; + Text[ spanish ] = "Puertos (slots)"; + Text[ italian ] = "Slots"; + Text[ danish ] = "Slots"; + Text[ swedish ] = "Slots"; + Text[ polish ] = "Slots"; + Text[ portuguese_brazilian ] = "Slots"; + Text[ japanese ] = "Slots"; + Text[ korean ] = "Slots"; + Text[ chinese_simplified ] = "Slots"; + Text[ chinese_traditional ] = "Slots"; + Text[ arabic ] = "Slots"; + Text[ turkish ] = "Yuvalar"; + }; + MultiListBox RID_MLB_SLOTS { + Border = TRUE; + AutoHScroll = TRUE; + Pos = MAP_APPFONT( 4, 132 ); + Size = MAP_APPFONT( 208, 24 ); + TabStop = TRUE; + }; + PushButton RID_PB_KOPIEREN { + Pos = MAP_APPFONT( 216, 28 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "Kopieren"; + Text [ english_us ] = "Copy"; + TabStop = TRUE; + Text[ portuguese ] = "Copiar"; + Text[ russian ] = "Copy"; + Text[ greek ] = "Copy"; + Text[ dutch ] = "Kopiren"; + Text[ french ] = "Copier"; + Text[ spanish ] = "Copiar"; + Text[ italian ] = "Copy"; + Text[ danish ] = "Copy"; + Text[ swedish ] = "Copy"; + Text[ polish ] = "Copy"; + Text[ portuguese_brazilian ] = "Kopieren"; + Text[ japanese ] = "Copy"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Kopieren"; + Text[ chinese_traditional ] = "Copy"; + Text[ arabic ] = "Copy"; + Text[ turkish ] = "Kopyala"; + }; + PushButton RID_PB_BENENNEN { + Pos = MAP_APPFONT( 216, 44 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "Benennen"; + Text [ english_us ] = "Name"; + TabStop = TRUE; + Hide = TRUE; + Text[ portuguese ] = "Atribuir nome"; + Text[ russian ] = "Name"; + Text[ greek ] = "Name"; + Text[ dutch ] = "Naam geven"; + Text[ french ] = "Nommer"; + Text[ spanish ] = "Nombrar"; + Text[ italian ] = "Name"; + Text[ danish ] = "Name"; + Text[ swedish ] = "Name"; + Text[ polish ] = "Name"; + Text[ portuguese_brazilian ] = "Benennen"; + Text[ japanese ] = "Name"; + Text[ korean ] = "̸"; + Text[ chinese_simplified ] = "Benennen"; + Text[ chinese_traditional ] = "Name"; + Text[ arabic ] = "Name"; + Text[ turkish ] = "Adlandr"; + }; + PushButton RID_PB_SELECTALL { + Pos = MAP_APPFONT( 216, 44 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "Alle Markieren"; + Text [ english_us ] = "Select all"; + TabStop = TRUE; + Text[ portuguese ] = "Seleccionar tudo"; + Text[ russian ] = "Select all"; + Text[ greek ] = "Select all"; + Text[ dutch ] = "Alle markeren"; + Text[ french ] = "Slectionner tout"; + Text[ spanish ] = "Seleccionar todos"; + Text[ italian ] = "Select all"; + Text[ danish ] = "Select all"; + Text[ swedish ] = "Select all"; + Text[ polish ] = "Select all"; + Text[ portuguese_brazilian ] = "Alle Markieren"; + Text[ japanese ] = "Select all"; + Text[ korean ] = "ü "; + Text[ chinese_simplified ] = "Alle Markieren"; + Text[ chinese_traditional ] = "Select all"; + Text[ arabic ] = "Select all"; + Text[ turkish ] = "Tmn se"; + }; + OKButton RID_OK_CLOSE { + Pos = MAP_APPFONT( 216, 144 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "Schlieen"; + Text [ english_us ] = "Close"; + TabStop = TRUE; + Text[ portuguese ] = "Fechar"; + Text[ russian ] = "Close"; + Text[ greek ] = "Close"; + Text[ dutch ] = "Sluiten"; + Text[ french ] = "Fermer"; + Text[ spanish ] = "Cerrar"; + Text[ italian ] = "Close"; + Text[ danish ] = "Close"; + Text[ swedish ] = "Close"; + Text[ polish ] = "Close"; + Text[ portuguese_brazilian ] = "Schlieen"; + Text[ japanese ] = "Close"; + Text[ korean ] = "ݱ"; + Text[ chinese_simplified ] = "Schlieen"; + Text[ chinese_traditional ] = "Close"; + Text[ arabic ] = "Close"; + Text[ turkish ] = "Kapat"; + }; + Text[ portuguese ] = "Mostrar HId"; + Text[ russian ] = "Display HId"; + Text[ greek ] = "Display HId"; + Text[ dutch ] = "Display HId"; + Text[ french ] = "Display HId"; + Text[ spanish ] = "Mostrar HId"; + Text[ italian ] = "Display HId"; + Text[ danish ] = "Display HId"; + Text[ swedish ] = "Display HId"; + Text[ polish ] = "Display HId"; + Text[ portuguese_brazilian ] = "Display HId"; + Text[ japanese ] = "Display HId"; + Text[ korean ] = "÷ HId"; + Text[ chinese_simplified ] = "Display HId"; + Text[ chinese_traditional ] = "Display HId"; + Text[ arabic ] = "Display HId"; + Text[ turkish ] = "Grntle: HId"; +}; + + + +Accelerator MAIN_ACCEL { + ItemList = { + AcceleratorItem { + Identifier = RID_FILENEW; + Key = KeyCode { Function = KEYFUNC_NEW; }; + }; + AcceleratorItem { + Identifier = RID_FILEOPEN; + Key = KeyCode { Function = KEYFUNC_OPEN; }; + }; + AcceleratorItem { + Identifier = RID_FILESAVE; + Key = KeyCode { Function = KEYFUNC_SAVE; }; + }; + AcceleratorItem { + Identifier = RID_FILESAVEAS; + Key = KeyCode { Function = KEYFUNC_SAVEAS; }; + }; + AcceleratorItem { + Identifier = RID_QUIT; + Key = KeyCode { Function = KEYFUNC_QUIT; }; + }; +// AcceleratorItem { +// Identifier = RID_EDITCUT; +// Key = KeyCode { Function = KEYFUNC_CUT; }; +// }; +// AcceleratorItem { +// Identifier = RID_EDITCOPY; +// Key = KeyCode { Function = KEYFUNC_COPY; }; +// }; +// AcceleratorItem { +// Identifier = RID_EDITPASTE; +// Key = KeyCode { Function = KEYFUNC_PASTE; }; +// }; +// AcceleratorItem { +// Identifier = RID_EDITDEL; +// Key = KeyCode { Function = KEYFUNC_DELETE; }; +// }; + AcceleratorItem { + Identifier = RID_EDITSEARCH; + Key = KeyCode { Function = KEYFUNC_FIND; }; + }; + AcceleratorItem { + Identifier = RID_EDITREPEAT; + Key = KeyCode { Code = KEY_F3; }; +// Key = KeyCode { Function = KEYFUNC_REPEAT; }; + }; + AcceleratorItem { + Identifier = RID_RUNCOMPILE; + Key = KeyCode { Code = KEY_F5; Shift = TRUE; }; + }; + AcceleratorItem { + Identifier = RID_RUNSTART; + Key = KeyCode { Code = KEY_F5; }; + }; + AcceleratorItem { + Identifier = RID_RUNSTEPINTO; + Key = KeyCode { Code = KEY_F8; }; + }; + AcceleratorItem { + Identifier = RID_TOGLEBRKPNT; + Key = KeyCode { Code = KEY_F9; }; + }; + AcceleratorItem { + Identifier = RID_RUNSTEPOVER; + Key = KeyCode { Code = KEY_F10; }; + }; + AcceleratorItem { + Identifier = RID_RUNTOCURSOR; + Key = KeyCode { Code = KEY_F7; }; + }; + AcceleratorItem { + Identifier = RID_RUNBREAK; + Key = KeyCode { Code = KEY_F5; Modifier1 = TRUE; }; + }; + AcceleratorItem { + Identifier = RID_RUNNEXTERR; + Key = KeyCode { Code = KEY_F8; Shift = TRUE; }; + }; + AcceleratorItem { + Identifier = RID_RUNPREVERR; + Key = KeyCode { Code = KEY_F7; Shift = TRUE; }; + }; + }; +}; + +ImageList RID_IMGLST_LAYOUT +{ + ImageBitmap = Bitmap { FILE = "images2.bmp" ; }; + MaskColor = Color { Red = 0xFFFF ; Green = 0xFFFF ; Blue = 0xFFFF ; }; + IdList = + { + IMGID_BRKENABLED ; + IMGID_BRKDISABLED ; + IMGID_STEPMARKER ; + IMGID_ERRORMARKER ; + }; +}; + + +ModelessDialog IDD_EDIT_VAR { + Pos = MAP_APPFONT( 0, 0 ); + Size = MAP_APPFONT( 171, 87 ); + Text = "Variable editieren"; + Text [ english_us ] = "Edit variable"; + Moveable = TRUE; + Closeable = TRUE; + FixedText RID_FT_NAME { + Pos = MAP_APPFONT( 8, 8 ); + Size = MAP_APPFONT( 40, 10 ); + Text = "Name"; + Text [ english_us ] = "Name"; + Text[ portuguese ] = "Nome"; + Text[ russian ] = "Name"; + Text[ greek ] = "Name"; + Text[ dutch ] = "Naam"; + Text[ french ] = "Nom"; + Text[ spanish ] = "Nombre"; + Text[ italian ] = "Name"; + Text[ danish ] = "Name"; + Text[ swedish ] = "Name"; + Text[ polish ] = "Name"; + Text[ portuguese_brazilian ] = "Name"; + Text[ japanese ] = "Name"; + Text[ korean ] = "̸"; + Text[ chinese_simplified ] = "Name"; + Text[ chinese_traditional ] = "Name"; + Text[ arabic ] = "Name"; + Text[ turkish ] = "Ad"; + }; + FixedText RID_FT_CONTENT { + Pos = MAP_APPFONT( 8, 21 ); + Size = MAP_APPFONT( 40, 10 ); + Text = "Inhalt"; + Text [ english_us ] = "Content"; + Text[ portuguese ] = "Contedo"; + Text[ russian ] = "Content"; + Text[ greek ] = "Content"; + Text[ dutch ] = "Inhoud"; + Text[ french ] = "Contenu"; + Text[ spanish ] = "Contenido"; + Text[ italian ] = "Content"; + Text[ danish ] = "Content"; + Text[ swedish ] = "Content"; + Text[ polish ] = "Content"; + Text[ portuguese_brazilian ] = "Inhalt"; + Text[ japanese ] = "Content"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Inhalt"; + Text[ chinese_traditional ] = "Content"; + Text[ arabic ] = "Content"; + Text[ turkish ] = "erik"; + }; + FixedText RID_FT_NEW_CONTENT { + Pos = MAP_APPFONT( 8, 38 ); + Size = MAP_APPFONT( 40, 10 ); + Text = "Neuer Inhalt"; + Text [ english_us ] = "New content"; + Text[ portuguese ] = "Novo contedo"; + Text[ russian ] = "New content"; + Text[ greek ] = "New content"; + Text[ dutch ] = "Nieuwe inhoud"; + Text[ french ] = "Nouveau contenu"; + Text[ spanish ] = "Nuevo contenido"; + Text[ italian ] = "New content"; + Text[ danish ] = "New content"; + Text[ swedish ] = "New content"; + Text[ polish ] = "New content"; + Text[ portuguese_brazilian ] = "Neuer Inhalt"; + Text[ japanese ] = "New content"; + Text[ korean ] = "ο "; + Text[ chinese_simplified ] = "Neuer Inhalt"; + Text[ chinese_traditional ] = "New content"; + Text[ arabic ] = "New content"; + Text[ turkish ] = "Yeni ierik"; + }; + FixedText RID_FT_NAME_VALUE { + Pos = MAP_APPFONT( 53, 8 ); + Size = MAP_APPFONT( 111, 10 ); + Text = "name der variablen"; + Text [ english_us ] = "Name of variable"; + Text[ portuguese ] = "nome das variveis"; + Text[ russian ] = "Name of variable"; + Text[ greek ] = "Name of variable"; + Text[ dutch ] = "Naam van de variabelen"; + Text[ french ] = "Noms des variables"; + Text[ spanish ] = "nombre de variables"; + Text[ italian ] = "Name of variables"; + Text[ danish ] = "Name of variable"; + Text[ swedish ] = "Name of variable"; + Text[ polish ] = "Name of variable"; + Text[ portuguese_brazilian ] = "name der variablen"; + Text[ japanese ] = "Name of variable"; + Text[ korean ] = " "; + Text[ chinese_simplified ] = "name der variablen"; + Text[ chinese_traditional ] = "name of variable"; + Text[ arabic ] = "Name of variable"; + Text[ turkish ] = "Deiken ad"; + }; + FixedText RID_FT_CONTENT_VALUE { + Pos = MAP_APPFONT( 53, 21 ); + Size = MAP_APPFONT( 111, 10 ); + Text = "Alter Inhalt"; + Text [ english_us ] = "Previous contents"; + Text[ portuguese ] = "Antigo contedo"; + Text[ russian ] = "Previous contents"; + Text[ greek ] = "Previous contents"; + Text[ dutch ] = "Oude inhoud"; + Text[ french ] = "Ancien contenu"; + Text[ spanish ] = "Contenido antiguo"; + Text[ italian ] = "Previous content"; + Text[ danish ] = "Previous contents"; + Text[ swedish ] = "Previous content"; + Text[ polish ] = "Previous contents"; + Text[ portuguese_brazilian ] = "Alter Inhalt"; + Text[ japanese ] = "Previous contents"; + Text[ korean ] = " "; + Text[ chinese_simplified ] = "Alter Inhalt"; + Text[ chinese_traditional ] = "Previous content"; + Text[ arabic ] = "Previous contents"; + Text[ turkish ] = "Eski ierik"; + }; + RadioButton RID_RB_NEW_BOOL_T { + Hide = TRUE; + Pos = MAP_APPFONT( 53, 37 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "True"; + Text [ english_us ] = "True"; + TabStop = TRUE; + Text[ portuguese ] = "Verdadeiro"; + Text[ russian ] = "True"; + Text[ greek ] = "True"; + Text[ dutch ] = "True"; + Text[ french ] = "Vrai"; + Text[ spanish ] = "Verdadero"; + Text[ italian ] = "True"; + Text[ danish ] = "True"; + Text[ swedish ] = "True"; + Text[ polish ] = "True"; + Text[ portuguese_brazilian ] = "True"; + Text[ japanese ] = "True"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "True"; + Text[ chinese_traditional ] = "True"; + Text[ arabic ] = "True"; + Text[ turkish ] = "Doru"; + }; + RadioButton RID_RB_NEW_BOOL_F { + Hide = TRUE; + Pos = MAP_APPFONT( 98, 37 ); + Size = MAP_APPFONT( 40, 12 ); + Text = "False"; + Text [ english_us ] = "False"; + TabStop = TRUE; + Text[ portuguese ] = "Falso"; + Text[ russian ] = "False"; + Text[ greek ] = "False"; + Text[ dutch ] = "False"; + Text[ french ] = "Faux"; + Text[ spanish ] = "Falso"; + Text[ italian ] = "False"; + Text[ danish ] = "False"; + Text[ swedish ] = "False"; + Text[ polish ] = "False"; + Text[ portuguese_brazilian ] = "False"; + Text[ japanese ] = "False"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "False"; + Text[ chinese_traditional ] = "False"; + Text[ arabic ] = "False"; + Text[ turkish ] = "Yanl"; + }; + NumericField RID_NF_NEW_INTEGER { + Border = TRUE; + Hide = TRUE; + Pos = MAP_APPFONT( 53, 37 ); + Size = MAP_APPFONT( 111, 12 ); + TabStop = TRUE; + Repeat = TRUE; + Spin = TRUE; + Minimum = -32768; + Maximum = 32767; + First = -32768; + Last = 32767; + SpinSize = 10; + }; + NumericField RID_NF_NEW_LONG { + Border = TRUE; + Hide = TRUE; + Pos = MAP_APPFONT( 53, 37 ); + Size = MAP_APPFONT( 111, 12 ); + TabStop = TRUE; + Repeat = TRUE; + Spin = TRUE; + Minimum = -2147483648; + Maximum = 2147483647; + First = -2147483648; + Last = 2147483647; + SpinSize = 10; + }; + Edit RID_ED_NEW_STRING { + Hide = TRUE; + Border = TRUE; + Pos = MAP_APPFONT( 53, 37 ); + Size = MAP_APPFONT( 111, 12 ); + Text = "Edit"; + Text [ english_us ] = "Edit"; + TabStop = TRUE; + Text[ portuguese ] = "Editar"; + Text[ russian ] = "Edit"; + Text[ greek ] = "Edit"; + Text[ dutch ] = "Edit"; + Text[ french ] = "diter"; + Text[ spanish ] = "Editar"; + Text[ italian ] = "Edit"; + Text[ danish ] = "Edit"; + Text[ swedish ] = "Edit"; + Text[ polish ] = "Edit"; + Text[ portuguese_brazilian ] = "Edit"; + Text[ japanese ] = "Edit"; + Text[ korean ] = ""; + Text[ chinese_simplified ] = "Edit"; + Text[ chinese_traditional ] = "Edit"; + Text[ arabic ] = "Edit"; + Text[ turkish ] = "Dzenle"; + }; + OKButton RID_OK { + Pos = MAP_APPFONT( 33, 58 ); + Size = MAP_APPFONT( 40, 12 ); + TabStop = TRUE; + }; + CancelButton RID_CANCEL { + Pos = MAP_APPFONT( 93, 58 ); + Size = MAP_APPFONT( 40, 12 ); + TabStop = TRUE; + }; + Text[ portuguese ] = "Editar variveis"; + Text[ russian ] = "Edit variable"; + Text[ greek ] = "Edit variable"; + Text[ dutch ] = "Variabele editeren"; + Text[ french ] = "dition de variable"; + Text[ spanish ] = "Editar variable"; + Text[ italian ] = "Edit variable"; + Text[ danish ] = "Edit variable"; + Text[ swedish ] = "Edit variable"; + Text[ polish ] = "Edit variable"; + Text[ portuguese_brazilian ] = "Variable editieren"; + Text[ japanese ] = "Edit variable"; + Text[ korean ] = " "; + Text[ chinese_simplified ] = "Variable editieren"; + Text[ chinese_traditional ] = "Edit variable"; + Text[ arabic ] = "Edit variable"; + Text[ turkish ] = "Deiken dzenle"; +}; + +FloatingWindow LOAD_CONF { + SVLook = TRUE; + Pos = MAP_APPFONT( 66, 23 ); + Size = MAP_APPFONT( 156, 51 ); + Text = "Lese Konfigurationsdateien"; + Text[ english_us ] = "Load configuration files"; + Moveable = TRUE; + FixedText WORK { + SVLook = TRUE; + Pos = MAP_APPFONT( 0, 8 ); + Size = MAP_APPFONT( 155, 10 ); + Text = "Slot IDs"; + Text[ english_us ] = "Slot IDs"; + Center = TRUE; + Text[ portuguese ] = "Slot IDs"; + Text[ russian ] = "Slot IDs"; + Text[ greek ] = "Slot IDs"; + Text[ dutch ] = "Slot IDs"; + Text[ french ] = "Slot IDs"; + Text[ spanish ] = "Slot IDs"; + Text[ italian ] = "Slot IDs"; + Text[ danish ] = "Slot IDs"; + Text[ swedish ] = "Slot IDs"; + Text[ polish ] = "Slot IDs"; + Text[ portuguese_brazilian ] = "Slot IDs"; + Text[ japanese ] = "Slot IDs"; + Text[ korean ] = "Slot IDs"; + Text[ chinese_simplified ] = "Slot IDs"; + Text[ chinese_traditional ] = "Slot IDs"; + Text[ arabic ] = "Slot IDs"; + Text[ turkish ] = "Slot IDs"; + }; + FixedText FILENAME { + SVLook = TRUE; + Pos = MAP_APPFONT( 0, 21 ); + Size = MAP_APPFONT( 155, 10 ); + Text = "Datei.win"; + Text[ english_us ] = "File.win"; + Center = TRUE; + Text[ portuguese ] = "File.win"; + Text[ russian ] = "File.win"; + Text[ greek ] = "File.win"; + Text[ dutch ] = "Bestand.win"; + Text[ french ] = "Fichier.win"; + Text[ spanish ] = "Archivo.win"; + Text[ italian ] = "File.win"; + Text[ danish ] = "File.win"; + Text[ swedish ] = "File.win"; + Text[ polish ] = "Plik.win"; + Text[ portuguese_brazilian ] = "Datei.win"; + Text[ japanese ] = "File.win"; + Text[ korean ] = "File.win"; + Text[ chinese_simplified ] = "File.win"; + Text[ chinese_traditional ] = "Datei.win"; + Text[ arabic ] = "File.win"; + Text[ turkish ] = "File.win"; + }; + Text[ portuguese ] = "A ler ficheiros de configurao"; + Text[ russian ] = "Load configuration files"; + Text[ greek ] = "Load configuration files"; + Text[ dutch ] = "Lees configuratiebestanden"; + Text[ french ] = "Lecture des fichiers de configuration"; + Text[ spanish ] = "Leyendo archivos de configuracin"; + Text[ italian ] = "Load configuration files"; + Text[ danish ] = "Load configuration files"; + Text[ swedish ] = "Load configuration files"; + Text[ polish ] = "Czytaj pliki konfiguracyjne"; + Text[ portuguese_brazilian ] = "Lese Konfigurationsdateien"; + Text[ japanese ] = "Load configuration files"; + Text[ korean ] = " ε"; + Text[ chinese_simplified ] = "Load configuration files"; + Text[ chinese_traditional ] = "Lese Konfigurationsdateien"; + Text[ arabic ] = "Load configuration files"; + Text[ turkish ] = "Konfigrasyon dosyalar okunuyor"; +}; diff --git a/basic/source/app/basicrt.cxx b/basic/source/app/basicrt.cxx new file mode 100644 index 000000000000..2ca8d5ee6edf --- /dev/null +++ b/basic/source/app/basicrt.cxx @@ -0,0 +1,163 @@ +/************************************************************************* + * + * $RCSfile: basicrt.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + + +#include "sbintern.hxx" +#include "runtime.hxx" +#include "basicrt.hxx" + + +const String BasicRuntime::GetModuleName( SbxNameType nType ) +{ + return pRun->GetModule()->GetName( nType ); +} + +const String BasicRuntime::GetMethodName( SbxNameType nType ) +{ + return pRun->GetMethod()->GetName( nType ); +} + +xub_StrLen BasicRuntime::GetLine() +{ + return pRun->nLine; +} + +xub_StrLen BasicRuntime::GetCol1() +{ + return pRun->nCol1; +} + +xub_StrLen BasicRuntime::GetCol2() +{ + return pRun->nCol2; +} + +BasicRuntime BasicRuntime::GetNextRuntime() +{ + return BasicRuntime ( pRun->pNext ); +} + + + + +const String BasicErrorStackEntry::GetModuleName( SbxNameType nType ) +{ + return pEntry->aMethod->GetModule()->GetName( nType ); +} + +const String BasicErrorStackEntry::GetMethodName( SbxNameType nType ) +{ + return pEntry->aMethod->GetName( nType ); +} + +xub_StrLen BasicErrorStackEntry::GetLine() +{ + return pEntry->nLine; +} + +xub_StrLen BasicErrorStackEntry::GetCol1() +{ + return pEntry->nCol1; +} + +xub_StrLen BasicErrorStackEntry::GetCol2() +{ + return pEntry->nCol2; +} + + + + +BasicRuntime BasicRuntimeAccess::GetRuntime() +{ + return BasicRuntime( pINST->pRun ); +} + +BOOL BasicRuntimeAccess::HasRuntime() +{ + return pINST ? ( pINST->pRun != NULL ) : FALSE; +} + +USHORT BasicRuntimeAccess::GetStackEntryCount() +{ + return GetSbData()->pErrStack->Count(); +} + +BasicErrorStackEntry BasicRuntimeAccess::GetStackEntry( USHORT nIndex ) +{ + return BasicErrorStackEntry( GetSbData()->pErrStack->GetObject( nIndex ) ); +} + +BOOL BasicRuntimeAccess::HasStack() +{ + return GetSbData()->pErrStack != NULL; +} + +void BasicRuntimeAccess::DeleteStack() +{ + delete GetSbData()->pErrStack; + GetSbData()->pErrStack = NULL; +} + +BOOL BasicRuntimeAccess::IsRunInit() +{ + return GetSbData()->bRunInit; +} diff --git a/basic/source/app/basmsg.hrc b/basic/source/app/basmsg.hrc new file mode 100644 index 000000000000..2e900e258209 --- /dev/null +++ b/basic/source/app/basmsg.hrc @@ -0,0 +1,79 @@ +/************************************************************************* + * + * $RCSfile: basmsg.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#include <svtools/ttglobal.hrc> + + +// Hier sind die Messages aus dem Verzeichnis /basic/source/app enhalten + + +/////////////////////////////// +// Fehlermeldungen, die in das Resultfile gelangen. +// ********************* +// *** !!ACHTUNG!! *** +// ********************* +// Die Nummern drfen sich NIE! ndern, +// da sie in den Resultfiles gespeichert sind, und bei erneutem Anzeigen +// statdessen die entsprechenden neuen oder garkeine Strings angzeigt werden. +/////////////////////////////// + +#define S_PROG_START ( BAS_START + 0 ) +#define S_ERROR_OUTSIDE_TESTCASE ( BAS_START + 1 ) +#define S_WARNING_PREFIX ( BAS_START + 2 ) diff --git a/basic/source/app/basmsg.src b/basic/source/app/basmsg.src new file mode 100644 index 000000000000..abaab9a6b21f --- /dev/null +++ b/basic/source/app/basmsg.src @@ -0,0 +1,142 @@ +/************************************************************************* + * + * $RCSfile: basmsg.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#include "basmsg.hrc" + + +// Hier sind die Messages aus dem Verzeichnis /basic/source/app enhalten + + +/////////////////////////////// +// Fehlermeldungen, die in das Resultfile gelangen. +// ********************* +// *** !!ACHTUNG!! *** +// ********************* +// Die Nummern drfen sich NIE! ndern, +// da sie in den Resultfiles gespeichert sind, und bei erneutem Anzeigen +// statdessen die entsprechenden neuen oder garkeine Strings angzeigt werden. +/////////////////////////////// +String S_PROG_START +{ + Text = "Programmstart: ($Arg1); ($Arg2)"; + Text[ english_us ] = "Program start: ($Arg1); ($Arg2)"; + Text[ LANGUAGE_USER1 ] = "Programmstart: <Datum>; <Uhrzeit>"; + Text[ portuguese ] = "Incio do programa: ($Arg1); ($Arg2)"; + Text[ russian ] = "Program start: ($Arg1); ($Arg2)"; + Text[ greek ] = "Program start: ($Arg1); ($Arg2)"; + Text[ dutch ] = "Programma start: ($Arg1); ($Arg2)"; + Text[ french ] = "Dmarrage du programme : ($Arg1); ($Arg2)"; + Text[ spanish ] = "Inicio de programa: ($Arg1); ($Arg2)"; + Text[ italian ] = "Program start: ($Arg1); ($Arg2)"; + Text[ danish ] = "Program start: ($Arg1); ($Arg2)"; + Text[ swedish ] = "Program start: ($Arg1); ($Arg2)"; + Text[ polish ] = "Uruchomienie programu: ($Arg1); ($Arg2)"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Program start: ($Arg1); ($Arg2)"; + Text[ korean ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ chinese_simplified ] = "Program start: ($Arg1); ($Arg2)"; + Text[ chinese_traditional ] = "Program start: ($Arg1); ($Arg2)"; + Text[ arabic ] = "Program start: ($Arg1); ($Arg2)"; + Text[ turkish ] = "Program balatma: ($Arg1); ($Arg2)"; +}; +String S_ERROR_OUTSIDE_TESTCASE +{ + Text = "Fehler auerhalb eines Testcase."; + Text[ english_us ] = "Error outside of test case"; + Text[ portuguese ] = "Erro fora de um test case."; + Text[ russian ] = "Error outside of test case."; + Text[ greek ] = "Error outside of test case."; + Text[ dutch ] = "Fout buiten testcase."; + Text[ french ] = "Erreur en dehors d'un scnario de test (test case)."; + Text[ spanish ] = "Error fuera de un Testcase."; + Text[ italian ] = "Error outside of test case"; + Text[ danish ] = "Error outside of test case."; + Text[ swedish ] = "Error outside of test case"; + Text[ polish ] = "Bd poza Testcase."; + Text[ portuguese_brazilian ] = "Fehler auerhalb eines Testcase."; + Text[ japanese ] = "Error outside of test case."; + Text[ korean ] = "Ʈ ̽ ܺ "; + Text[ chinese_simplified ] = "Error outside of test case"; + Text[ chinese_traditional ] = "Error outside of test case"; + Text[ arabic ] = "Error outside of test case"; + Text[ turkish ] = "Error outside of test case"; +}; +String S_WARNING_PREFIX +{ + Text = "Warnung: "; + Text[ english_us ] = "Warning: "; + Text[ portuguese ] = "Aviso: "; + Text[ russian ] = ": "; + Text[ greek ] = "Warning: "; + Text[ dutch ] = "Waarschuwing: "; + Text[ french ] = "Avertissement : "; + Text[ spanish ] = "Advertencia: "; + Text[ italian ] = "Warning: "; + Text[ danish ] = "Warning: "; + Text[ swedish ] = "Warning: "; + Text[ polish ] = "Ostrzeenie: "; + Text[ portuguese_brazilian ] = "Warning: "; + Text[ japanese ] = "x: "; + Text[ korean ] = ": "; + Text[ chinese_simplified ] = "Warning: "; + Text[ chinese_traditional ] = "Warning: "; + Text[ arabic ] = ": "; + Text[ turkish ] = "Uyar: "; +}; diff --git a/basic/source/app/brkpnts.cxx b/basic/source/app/brkpnts.cxx new file mode 100644 index 000000000000..29b7326c2ff7 --- /dev/null +++ b/basic/source/app/brkpnts.cxx @@ -0,0 +1,434 @@ +/************************************************************************* + * + * $RCSfile: brkpnts.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _LIST_HXX //autogen +#include <tools/list.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef _SB_SBMOD_HXX //autogen +#include <sbmod.hxx> +#endif +#ifndef _SB_SBSTAR_HXX //autogen +#include <sbstar.hxx> +#endif +#ifndef _SB_SBMETH_HXX //autogen +#include <sbmeth.hxx> +#endif +#ifndef _SV_IMAGE_HXX //autogen +#include <vcl/image.hxx> +#endif +#ifndef _TEXTDATA_HXX //autogen +#include <svtools/textdata.hxx> +#endif +#ifndef _SV_CONFIG_HXX //autogen +#include <vcl/config.hxx> +#endif +#ifndef _SV_GRADIENT_HXX +#include <vcl/gradient.hxx> +#endif + +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif + +#include <brkpnts.hxx> +#include "basic.hrc" +#include "resids.hrc" + +struct Breakpoint +{ + USHORT nLine; + + Breakpoint( USHORT nL ) { nLine = nL; } +}; + + +ImageList* BreakpointWindow::pImages = NULL; + + +BreakpointWindow::BreakpointWindow( Window *pParent ) +: Window( pParent ) +, nCurYOffset( 0 ) +, pModule( NULL ) +{ + if ( !pImages ) + pImages = new ImageList( ResId( RID_IMGLST_LAYOUT ) ); + + Gradient aGradient( GRADIENT_AXIAL, Color( 185, 182, 215 ), Color( 250, 245, 255 ) ); + aGradient.SetAngle(900); + SetBackground( aGradient ); + Show(); +} + + +void BreakpointWindow::Reset() +{ + Breakpoint* pBrk = First(); + while ( pBrk ) + { + delete pBrk; + pBrk = Next(); + } + Clear(); + + pModule->ClearAllBP(); +} + +void BreakpointWindow::SetModule( SbModule *pMod ) +{ + pModule = pMod; + USHORT i; + for ( i=0 ; i < pModule->GetBPCount() ; i++ ) + { + InsertBreakpoint( pModule->GetBP( i ) ); + } + SetBPsInModule(); +} + + +void BreakpointWindow::SetBPsInModule() +{ + pModule->ClearAllBP(); + + Breakpoint* pBrk = First(); + while ( pBrk ) + { + pModule->SetBP( (USHORT)pBrk->nLine ); +#ifdef DEBUG + DBG_ASSERT( pModule->IsBP( (USHORT)pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ) +#endif + pBrk = Next(); + } + for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + { + SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); + DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); + pMethod->SetDebugFlags( pMethod->GetDebugFlags() | SbDEBUG_BREAK ); + } +} + + +void BreakpointWindow::InsertBreakpoint( USHORT nLine ) +{ + Breakpoint* pNewBrk = new Breakpoint( nLine ); + Breakpoint* pBrk = First(); + while ( pBrk ) + { + if ( nLine <= pBrk->nLine ) + { + if ( pBrk->nLine != nLine ) + Insert( pNewBrk ); + else + delete pNewBrk; + pNewBrk = NULL; + pBrk = NULL; + } + else + pBrk = Next(); + } + // Keine Einfuegeposition gefunden => LIST_APPEND + if ( pNewBrk ) + Insert( pNewBrk, LIST_APPEND ); + + // vielleicht mal etwas genauer... + Invalidate(); + + if ( pModule->SetBP( nLine ) ) + { +#ifdef DEBUG + DBG_ASSERT( pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" ) +#endif + if ( StarBASIC::IsRunning() ) + { + for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + { + SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); + DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); + pMethod->SetDebugFlags( pMethod->GetDebugFlags() | SbDEBUG_BREAK ); + } + } + } +#ifdef DEBUG + DBG_ASSERT( pModule->IsBP( nLine ), "Brechpunkt wurde nicht gesetzt" ) +#endif +} + + +Breakpoint* BreakpointWindow::FindBreakpoint( ULONG nLine ) +{ + Breakpoint* pBrk = First(); + while ( pBrk ) + { + if ( pBrk->nLine == nLine ) + return pBrk; + + pBrk = Next(); + } + + return (Breakpoint*)0; +} + + +void BreakpointWindow::AdjustBreakpoints( ULONG nLine, BOOL bInserted ) +{ + if ( nLine == TEXT_PARA_ALL+1 ) + return; + Breakpoint* pBrk = First(); + while ( pBrk ) + { + BOOL bDelBrk = FALSE; + if ( pBrk->nLine == nLine ) + { + if ( bInserted ) + pBrk->nLine++; + else + bDelBrk = TRUE; + } + else if ( pBrk->nLine > nLine ) + { + if ( bInserted ) + pBrk->nLine++; + else + pBrk->nLine--; + } + + if ( bDelBrk ) + { + ULONG n = GetCurPos(); + delete Remove( pBrk ); + pBrk = Seek( n ); + } + else + { + pBrk = Next(); + } + } +} + + +void BreakpointWindow::LoadBreakpoints( String aFilename ) +{ + Config aConfig(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + + aConfig.SetGroup("Breakpoints"); + + ByteString aBreakpoints; + aBreakpoints = aConfig.ReadKey( ByteString( aFilename, RTL_TEXTENCODING_UTF8 ) ); + + xub_StrLen i; + + for ( i = 0 ; i < aBreakpoints.GetTokenCount( ';' ) ; i++ ) + { + InsertBreakpoint( aBreakpoints.GetToken( i, ';' ).ToInt32() ); + } +} + + +void BreakpointWindow::SaveBreakpoints( String aFilename ) +{ + ByteString aBreakpoints; + + Breakpoint* pBrk = First(); + while ( pBrk ) + { + if ( aBreakpoints.Len() ) + aBreakpoints += ';'; + + aBreakpoints += ByteString::CreateFromInt32( pBrk->nLine ); + pBrk = Next(); + } + + Config aConfig(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + + aConfig.SetGroup("Breakpoints"); + + if ( aBreakpoints.Len() ) + aConfig.WriteKey( ByteString( aFilename, RTL_TEXTENCODING_UTF8 ), aBreakpoints ); + else + aConfig.DeleteKey( ByteString( aFilename, RTL_TEXTENCODING_UTF8 ) ); +} + + +void BreakpointWindow::Paint( const Rectangle& ) +{ + Size aOutSz( GetOutputSize() ); + long nLineHeight = GetTextHeight(); + + Image aBrk( pImages->GetImage( IMGID_BRKENABLED ) ); + Size aBmpSz( aBrk.GetSizePixel() ); + aBmpSz = PixelToLogic( aBmpSz ); + Point aBmpOff( 0, 0 ); + aBmpOff.X() = ( aOutSz.Width() - aBmpSz.Width() ) / 2; + aBmpOff.Y() = ( nLineHeight - aBmpSz.Height() ) / 2; + + Breakpoint* pBrk = First(); + while ( pBrk ) + { +#ifdef DEBUG + DBG_ASSERT( pModule->IsBP( pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ) +#endif + ULONG nLine = pBrk->nLine-1; + ULONG nY = nLine*nLineHeight - nCurYOffset; + DrawImage( Point( 0, nY ) + aBmpOff, aBrk ); + pBrk = Next(); + } + ShowMarker( TRUE ); +} + + +Breakpoint* BreakpointWindow::FindBreakpoint( const Point& rMousePos ) +{ + long nLineHeight = GetTextHeight(); + long nYPos = rMousePos.Y() + nCurYOffset; + + Breakpoint* pBrk = First(); + while ( pBrk ) + { + ULONG nLine = pBrk->nLine-1; + long nY = nLine*nLineHeight; + if ( ( nYPos > nY ) && ( nYPos < ( nY + nLineHeight ) ) ) + return pBrk; + pBrk = Next(); + } + return 0; +} + + +void BreakpointWindow::ToggleBreakpoint( USHORT nLine ) +{ + BOOL bNewBreakPoint = FALSE; + Breakpoint* pBrk = FindBreakpoint( nLine ); + if ( pBrk ) // entfernen + { + pModule->ClearBP( nLine ); + delete Remove( pBrk ); + } + else // einen erzeugen + { + InsertBreakpoint( nLine ); + } + // vielleicht mal etwas genauer... + Invalidate(); +} + +void BreakpointWindow::ShowMarker( BOOL bShow ) +{ + if ( nMarkerPos == MARKER_NOMARKER ) + return; + + Size aOutSz( GetOutputSize() ); + long nLineHeight = GetTextHeight(); + + Image aMarker; + if ( bErrorMarker ) + aMarker = pImages->GetImage( IMGID_ERRORMARKER ); + else + aMarker = pImages->GetImage( IMGID_STEPMARKER ); + + Size aMarkerSz( aMarker.GetSizePixel() ); + aMarkerSz = PixelToLogic( aMarkerSz ); + Point aMarkerOff( 0, 0 ); + aMarkerOff.X() = ( aOutSz.Width() - aMarkerSz.Width() ) / 2; + aMarkerOff.Y() = ( nLineHeight - aMarkerSz.Height() ) / 2; + + ULONG nY = nMarkerPos*nLineHeight - nCurYOffset; + Point aPos( 0, nY ); + aPos += aMarkerOff; + if ( bShow ) + DrawImage( aPos, aMarker ); + else + Invalidate( Rectangle( aPos, aMarkerSz ) ); +} + + +void BreakpointWindow::MouseButtonDown( const MouseEvent& rMEvt ) +{ + if ( rMEvt.GetClicks() == 2 ) + { + Point aMousePos( PixelToLogic( rMEvt.GetPosPixel() ) ); + long nLineHeight = GetTextHeight(); + long nYPos = aMousePos.Y() + nCurYOffset; + long nLine = nYPos / nLineHeight + 1; + ToggleBreakpoint( nLine ); + // vielleicht mal etwas genauer... + Invalidate(); + } +} + + +void BreakpointWindow::SetMarkerPos( USHORT nLine, BOOL bError ) +{ + ShowMarker( FALSE ); // Alten wegzeichen... + nMarkerPos = nLine; + bErrorMarker = bError; + ShowMarker( TRUE ); // Neuen zeichnen... + Update(); +} + + +void BreakpointWindow::Scroll( long nHorzScroll, long nVertScroll ) +{ + nCurYOffset -= nVertScroll; + Window::Scroll( nHorzScroll, nVertScroll ); +} + diff --git a/basic/source/app/brkpnts.hxx b/basic/source/app/brkpnts.hxx new file mode 100644 index 000000000000..9150542a9304 --- /dev/null +++ b/basic/source/app/brkpnts.hxx @@ -0,0 +1,130 @@ +/************************************************************************* + * + * $RCSfile: brkpnts.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 _SV_WINDOW_HXX //autogen +#include <vcl/window.hxx> +#endif + +#define MARKER_NOMARKER 0xFFFF + + +class SbModule; +class BreakpointListe; +struct Breakpoint; +class ImageList; + +DECLARE_LIST( BreakpointList, Breakpoint* ); + +class BreakpointWindow : public Window, public BreakpointList +{ +public: + BreakpointWindow( Window *pParent ); +// ~BreakpointWindow(); + + void Reset(); + + void SetModule( SbModule *pMod ); + void SetBPsInModule(); + + void InsertBreakpoint( USHORT nLine ); + void ToggleBreakpoint( USHORT nLine ); + void AdjustBreakpoints( ULONG nLine, BOOL bInserted ); + + void LoadBreakpoints( String aFilename ); + void SaveBreakpoints( String aFilename ); + +protected: + Breakpoint* FindBreakpoint( ULONG nLine ); + +private: + BreakpointListe *pBreakpoints; + +private: + long nCurYOffset; + USHORT nMarkerPos; + SbModule* pModule; + BOOL bErrorMarker; + static ImageList *pImages; + +protected: + virtual void Paint( const Rectangle& ); + Breakpoint* FindBreakpoint( const Point& rMousePos ); + void ShowMarker( BOOL bShow ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + +public: + +// void SetModulWindow( ModulWindow* pWin ) +// { pModulWindow = pWin; } + + void SetMarkerPos( USHORT nLine, BOOL bErrorMarker = FALSE ); + + void Scroll( long nHorzScroll, long nVertScroll ); + long& GetCurYOffset() { return nCurYOffset; } +}; + + + + + + + + diff --git a/basic/source/app/dataedit.hxx b/basic/source/app/dataedit.hxx new file mode 100644 index 000000000000..5727f157bd37 --- /dev/null +++ b/basic/source/app/dataedit.hxx @@ -0,0 +1,155 @@ +/************************************************************************* + * + * $RCSfile: dataedit.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:08 $ + * + * 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 DATAEDIT_HXX +#define DATAEDIT_HXX + +#ifndef _SV_MENU_HXX +#include <vcl/menu.hxx> +#endif +#ifndef _LINK_HXX //autogen +#include <tools/link.hxx> +#endif +#ifndef _SV_GEN_HXX +#include <tools/gen.hxx> +#endif +#ifndef _TEXTDATA_HXX //autogen +#include <svtools/textdata.hxx> +#endif + +class String; +class Font; + +// Find, Load und Save mssen implementiert werden, +// die anderen mssen in MemberType existieren +#define DATA_FUNC_DEF( MemberName, MemberType ) \ +public: \ + MemberType MemberName; \ + BOOL Find( const String& rStr ); \ + BOOL Load( const String& rStr ); \ + BOOL Save( const String& rStr ); \ + \ + void GrabFocus(){ MemberName.GrabFocus(); } \ + void Show(){ MemberName.Show(); } \ + void SetPosPixel( const Point& rNewPos ){ MemberName.SetPosPixel(rNewPos); }\ + void SetSizePixel( const Size& rNewSize ){ MemberName.SetSizePixel(rNewSize); } \ + Size GetSizePixel(){ return MemberName.GetSizePixel(); } \ + Point GetPosPixel(){ return MemberName.GetPosPixel(); } \ + void Update(){ MemberName.Update(); } \ + void SetFont( const Font& rNewFont ){ MemberName.SetFont(rNewFont); } \ + \ + void Delete(); \ + void Cut(); \ + void Copy(); \ + void Paste(); \ + void Undo(); \ + void Redo(); \ + String GetText() const; \ + void SetText( const String& rStr ); \ + BOOL HasText() const; \ + String GetSelected(); \ + TextSelection GetSelection() const; \ + void SetSelection( const TextSelection& rSelection ); \ + USHORT GetLineNr() const; \ + void ReplaceSelected( const String& rStr ); \ + BOOL IsModified(); \ + void SetModifyHdl( Link l ); + + +class DataEdit +{ +public: + virtual ~DataEdit(){} + + virtual void Delete()=0; + virtual void Cut()=0; + virtual void Copy()=0; + virtual void Paste()=0; + + virtual void Undo()=0; + virtual void Redo()=0; + + virtual BOOL Find( const String& )=0; // Text suchen & markieren + virtual BOOL Load( const String& )=0; // Text aus Datei laden + virtual BOOL Save( const String& )=0; // Text in Datei speichern + virtual String GetSelected()=0; + virtual void GrabFocus()=0; + virtual TextSelection GetSelection() const=0; + virtual void SetSelection( const TextSelection& rSelection )=0; + virtual USHORT GetLineNr() const=0; + virtual String GetText() const=0; + virtual void SetText( const String& rStr )=0; + virtual BOOL HasText() const=0; // damit vermeiden wir GetText.Len() + virtual void ReplaceSelected( const String& rStr )=0; + virtual BOOL IsModified()=0; + virtual void SetModifyHdl( Link )=0; + virtual void Show()=0; + virtual void SetPosPixel( const Point& rNewPos )=0; + virtual void SetSizePixel( const Size& rNewSize )=0; + virtual Size GetSizePixel()=0; + virtual Point GetPosPixel()=0; + virtual void Update()=0; + virtual void SetFont( const Font& rNewFont )=0; + + virtual void BuildKontextMenu( PopupMenu *&pMenu ){;} // Wer will kann hier eigene Eintrge hinzufgen +}; + +#endif diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx new file mode 100644 index 000000000000..31865100b098 --- /dev/null +++ b/basic/source/app/dialogs.cxx @@ -0,0 +1,1064 @@ +/************************************************************************* + * + * $RCSfile: dialogs.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _SOLAR_H +#include <tools/solar.h> +#endif + +HACK( #define protected public ) +#define protected public // Kleine Schweinerei um an FreeResource ranzukommen +#ifndef _TOOLS_RC_HXX //autogen +#include <tools/rc.hxx> +#endif +#undef protected + +#ifndef _DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif +#ifndef _BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif +#ifndef _FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif +#ifndef _EDIT_HXX //autogen +#include <vcl/edit.hxx> +#endif +#ifndef _CONFIG_HXX //autogen +#include <vcl/config.hxx> +#endif +#ifndef _MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX //autogen +#include <tools/debug.hxx> +#endif +#ifndef _SV_FILEDLG_HXX //autogen +#include <svtools/filedlg.hxx> +#endif +#ifndef _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif +#ifndef _FSYS_HXX //autogen +#include <tools/fsys.hxx> +#endif +#ifndef _SV_CLIP_HXX //autogen +#include <vcl/clip.hxx> +#endif +#ifndef _SV_SPLITWIN_HXX //autogen +#include <vcl/splitwin.hxx> +#endif +#ifndef _ZFORLIST_HXX //autogen +#include <svtools/zformat.hxx> +#endif + +#include <svtools/pver.hxx> + +// Ohne Includeschutz +#include <svtools/svtdata.hxx> +#include <svtools/solar.hrc> + + +#ifndef _BASIC_DISPDEFS_HXX +#include "dispdefs.hxx" +#endif +#include "testtool.hxx" +#include "dialogs.hxx" +#include "resids.hrc" +#include "basic.hrc" + +#include "app.hxx" + +AboutDialog::AboutDialog( Window* pParent, const ResId& id ) +: ModalDialog( pParent, id ) +, a1( this, ResId( 1 ) ) +, a3( this, ResId( 3 ) ) +, a4( this, ResId( 4 ) ) +, aVersionString( this, ResId( RID_VERSIONSTRING ) ) +//, aIcon( this, ResId( RID_ICON ) ) +, aOk ( this, ResId( RID_OK ) ) +{ + aVersionString.SetText( ProductVersion::GetMajorVersion().Append( ProductVersion::GetMinorVersion() ) + .AppendAscii( " BUILD:" ).Append( ProductVersion::GetBuildNumber() ) ); + FreeResource(); +} + +//////////////////////////////////////////////////////////////////// + +FindDialog::FindDialog( Window* pParent, const ResId& id, String& Text ) +: ModalDialog( pParent, id ) +, aFT1( this, ResId( RID_FIXEDTEXT1 ) ) +, aFind( this, ResId( RID_FIND ) ) +, aOk( this, ResId( RID_OK ) ) +, aCancel( this, ResId( RID_CANCEL ) ) +{ + FreeResource(); + pFind = &Text; + // Button-Handler: + aOk.SetClickHdl( LINK( this, FindDialog, ButtonClick ) ); + aCancel.SetClickHdl( LINK( this, FindDialog, ButtonClick ) ); + aFind.SetText( Text ); +} + +IMPL_LINK_INLINE_START( FindDialog, ButtonClick, Button *, pB ) +{ + if( pB == &aOk ) { + *pFind = aFind.GetText(); + EndDialog( TRUE ); + } else EndDialog( FALSE ); + return TRUE; +} +IMPL_LINK_INLINE_END( FindDialog, ButtonClick, Button *, pB ) + +ReplaceDialog::ReplaceDialog(Window* pParent, const ResId& id, String& Old, String& New ) +: ModalDialog( pParent, id ) +, aFT1( this, ResId( RID_FIXEDTEXT1 ) ) +, aFT2( this, ResId( RID_FIXEDTEXT2 ) ) +, aFind( this, ResId( RID_FIND ) ) +, aReplace(this, ResId( RID_REPLACE ) ) +, aOk( this, ResId( RID_OK ) ) +, aCancel( this, ResId( RID_CANCEL ) ) +{ + FreeResource(); + pFind = &Old; + pReplace = &New; + // Button-Handler: + aOk.SetClickHdl( LINK( this, ReplaceDialog, ButtonClick ) ); + aCancel.SetClickHdl( LINK( this, ReplaceDialog, ButtonClick ) ); + aFind.SetText( Old ); + aReplace.SetText( New ); +} + +IMPL_LINK( ReplaceDialog, ButtonClick, Button *, pB ) +{ + if( pB == &aOk ) { + *pFind = aFind.GetText(); + *pReplace = aReplace.GetText(); + EndDialog( TRUE ); + } else EndDialog( FALSE ); + return TRUE; +} + +//////////////////////////////////////////////////////////////////// + +ConfEdit::ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nResButton, const ByteString& aKN ) +: PushButton( pParent, ResId(nResButton) ) +, aText( pParent, ResId(nResText) ) +, aEdit( pParent, ResId(nResEdit) ) +, aKeyName(aKN) +{ + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup("Path"); + + String aTemp = UniString( aConf.ReadKey( aKeyName ), RTL_TEXTENCODING_UTF8 ); + aEdit.SetText( aTemp ); +} + +void ConfEdit::Save() +{ + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup("Path"); + + aConf.WriteKey( aKeyName, ByteString( aEdit.GetText(), RTL_TEXTENCODING_UTF8 ) ); +} + +void ConfEdit::Click() +{ + PathDialog aPD( this ); + aPD.SetPath( aEdit.GetText() ); + aPD.Execute(); + aEdit.SetText( aPD.GetPath() ); +} + + +OptionsDialog::OptionsDialog( Window* pParent, const ResId& aResId ) +: ModelessDialog( pParent, aResId ) +, aTabCtrl( this, ResId( RES_TC_OPTIONS ) ) +, aOK( this, ResId( RID_OK ) ) +, aCancel( this, ResId( RID_CANCEL ) ) +{ + aTabCtrl.FreeResource(); + FreeResource(); + aTabCtrl.SetActivatePageHdl( LINK( this, OptionsDialog, ActivatePageHdl ) ); + aTabCtrl.SetCurPageId( RID_TP_GEN ); + ActivatePageHdl( &aTabCtrl ); + + aOK.SetClickHdl( LINK( this, OptionsDialog, OKClick ) ); +} + +OptionsDialog::~OptionsDialog() +{ + for ( USHORT i = 0; i < aTabCtrl.GetPageCount(); i++ ) + delete aTabCtrl.GetTabPage( aTabCtrl.GetPageId( i ) ); +}; + +BOOL OptionsDialog::Close() +{ + if ( ModelessDialog::Close() ) + { + delete this; + return TRUE; + } + else + return FALSE; +} + + +IMPL_LINK( OptionsDialog, ActivatePageHdl, TabControl *, pTabCtrl ) +{ + USHORT nId = pTabCtrl->GetCurPageId(); + // Wenn TabPage noch nicht erzeugt wurde, dann erzeugen + if ( !pTabCtrl->GetTabPage( nId ) ) + { + TabPage *pNewTabPage = NULL; + switch ( nId ) + { + case RID_TP_SPE: + pNewTabPage = new SpecialOptions( pTabCtrl ); + break; + case RID_TP_GEN: + pNewTabPage = new GenericOptions( pTabCtrl ); + break; + default: DBG_ERROR( "PageHdl: Unbekannte ID!" ); + } + DBG_ASSERT( pNewTabPage, "Keine Page!" ); + pTabCtrl->SetTabPage( nId, pNewTabPage ); + } + return 0; +} + + + + +IMPL_LINK( OptionsDialog, OKClick, Button *, pButton ) +{ + SpecialOptions *pSpecial; + pSpecial = (SpecialOptions*)aTabCtrl.GetTabPage( RID_TP_SPE ); + if ( pSpecial ) + pSpecial->Save(); + + GenericOptions *pGeneric; + pGeneric = (GenericOptions*)aTabCtrl.GetTabPage( RID_TP_GEN ); + if ( pGeneric ) + pGeneric->Save(); + + Close(); + return 0; +} + + +SpecialOptions::SpecialOptions( Window* pParent ) +: TabPage( pParent, ResId( RID_TP_SPECIAL ) ) +, aDirs( this, ResId(GB_DIRECTORIES) ) +, aLog( this, LOG_TEXT, LOG_NAME, LOG_SET ,"LogBasisverzeichnis" ) +, aBasis( this, BASIS_TEXT, BASIS_NAME, BASIS_SET ,"Basisverzeichnis" ) +, aHID( this, HID_TEXT, HID_NAME, HID_SET ,"HIDVerzeichnis" ) +, aOther( this, ResId(GB_OTHER) ) +, aTimeoutText( this, ResId(TIMEOUT_TEXT) ) +, aServerTimeout( this, ResId(SERVER_TIMEOUT) ) +, aAutoReload( this, ResId(CB_AUTORELOAD) ) +{ + FreeResource(); + + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup("Misc"); + ByteString aTemp = aConf.ReadKey( "ServerTimeout", "10000" ); // Vorgabe 1 Minute + aServerTimeout.SetTime( Time(aTemp.ToInt32()) ); + + aTemp = aConf.ReadKey( "AutoReload", "0" ); + aAutoReload.Check( aTemp.CompareTo("1") == COMPARE_EQUAL ); +} + + +void SpecialOptions::Save() +{ + aLog.Save(); + aBasis.Save(); + aHID.Save(); + + Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); + aConf.SetGroup("Misc"); + aConf.WriteKey( "ServerTimeout", ByteString::CreateFromInt32( aServerTimeout.GetTime().GetTime() ) ); + aConf.WriteKey( "AutoReload", aAutoReload.IsChecked()?"1":"0" ); + + ((BasicApp*)GetpApp())->LoadIniFile(); +} + + +GenericOptions::GenericOptions( Window* pParent ) +: TabPage( pParent, ResId( RID_TP_GENERIC ) ) +, aConf( Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ) ) + +, aGbArea( this, ResId( RID_GB_AREA ) ) +, aCbArea( this, ResId( RID_CB_AREA ) ) +, aPbNewArea( this, ResId( RID_PB_NEW_AREA ) ) +, aPbDelArea( this, ResId( RID_PD_DEL_AREA ) ) + +, aGbValue( this, ResId( RID_GB_VALUE ) ) +, aCbValue( this, ResId( RID_CB_VALUE ) ) +, aPbNewValue( this, ResId( RID_PB_NEW_VALUE ) ) +, aPbDelValue( this, ResId( RID_PB_DEL_VALUE ) ) +{ + FreeResource(); + DirEntry aDE; + aTempConfName = aDE.TempName().GetFull(); + pTempConf = new Config( aTempConfName ); + pTempConf->SetGroup("Main"); + + LoadData(); + + aCbArea.EnableAutocomplete( TRUE ); + aCbValue.EnableAutocomplete( TRUE ); + + aCbArea.SetSelectHdl( LINK( this, GenericOptions, LoadGroup ) ); + + aPbNewArea.SetClickHdl( LINK( this, GenericOptions, NewGroup ) ); + aPbDelArea.SetClickHdl( LINK( this, GenericOptions, DelGroup ) ); + + aPbNewValue.SetClickHdl( LINK( this, GenericOptions, NewValue ) ); + aPbDelValue.SetClickHdl( LINK( this, GenericOptions, DelValue ) ); + + + aCbArea.SetModifyHdl( LINK( this, GenericOptions, CheckButtonsHdl ) ); + aCbValue.SetModifyHdl( LINK( this, GenericOptions, CheckButtonsHdl ) ); + aCbValue.SetSelectHdl( LINK( this, GenericOptions, CheckButtonsHdl ) ); + +} + +GenericOptions::~GenericOptions() +{ + pTempConf->DeleteGroup("Main"); + delete pTempConf; +} + +StringList* GenericOptions::GetAllGroups() +{ + StringList* pGroups = new StringList(); + for ( USHORT i = 0 ; i < aConf.GetGroupCount() ; i++ ) + { + String *pGroup = new String( aConf.GetGroupName( i ), RTL_TEXTENCODING_UTF8 ); + pGroups->Insert( pGroup ); + } + return pGroups; +} + +void GenericOptions::LoadData() +{ + StringList* pGroups = GetAllGroups(); + String* pGroup; + while ( pGroup = pGroups->First() ) + { + pGroups->Remove( pGroup ); + aConf.SetGroup( ByteString( *pGroup, RTL_TEXTENCODING_UTF8 ) ); + if ( HasKey( aConf, C_KEY_AKTUELL ) ) + { + aCbArea.InsertEntry( *pGroup ); + } + delete pGroup; + } + aCbArea.SetText( aCbArea.GetEntry( 0 ) ); + CheckButtons( aCbArea, aPbNewArea, aPbDelArea ); + + // Und auch die Daten laden + LINK( this, GenericOptions, LoadGroup ).Call( NULL ); +} + + +String GenericOptions::ReadKey( const ByteString &aGroup, const ByteString &aKey ) +{ + ByteString aGroupKey( aGroup ); + aGroupKey.Append( aKey ); + if ( HasKey( *pTempConf, aGroupKey ) ) + return UniString( pTempConf->ReadKey( aGroupKey ), RTL_TEXTENCODING_UTF8 ); + else + { + aConf.SetGroup( aGroup ); + return UniString( aConf.ReadKey( aKey ), RTL_TEXTENCODING_UTF8 ); + } +} + +BOOL GenericOptions::HasKey( Config &aConfig, const ByteString &aKey ) +{ + return ! ( aConfig.ReadKey( aKey ).Len() == 0 && aConfig.ReadKey( aKey, "Default" ).Len() != 0 ); +} + +IMPL_LINK( GenericOptions, LoadGroup, ComboBox*, EMPTYARG ) +{ + String aCurrentValue; + String aAllValues; + + if ( aLastGroupName.Len() ) + { // Werte zwischenspeichern? + aCurrentValue = aCbValue.GetText(); + if ( aCbValue.GetEntryPos( aCurrentValue ) == COMBOBOX_ENTRY_NOTFOUND ) + { // Dann legen wir mal einen neuen Wert an + LINK( this, GenericOptions, NewValue ).Call( NULL ); + } + + pTempConf->WriteKey( ByteString( aLastGroupName ).Append( C_KEY_AKTUELL ), ByteString( aCurrentValue, RTL_TEXTENCODING_UTF8 ) ); + USHORT i; + for ( i=0 ; i < aCbValue.GetEntryCount() ; i++ ) + { + if ( i ) // ab Entry 1 + aAllValues += ';'; + aAllValues += aCbValue.GetEntry( i ); + } + pTempConf->WriteKey( ByteString( aLastGroupName ).Append( C_KEY_ALLE ), ByteString( aAllValues, RTL_TEXTENCODING_UTF8 ) ); + } + + aCbValue.Clear(); + + ByteString aGroupName = ByteString( aCbArea.GetText(), RTL_TEXTENCODING_UTF8 ); + aCurrentValue = ReadKey( aGroupName, C_KEY_AKTUELL ); + aAllValues = ReadKey( aGroupName, C_KEY_ALLE ); + + xub_StrLen i; + for ( i=0 ; i < aAllValues.GetTokenCount() ; i++ ) + { + aCbValue.InsertEntry( aAllValues.GetToken( i ) ); + } + aCbValue.SetText( aCurrentValue ); + + aLastGroupName = aGroupName; + CheckButtons( aCbArea, aPbNewArea, aPbDelArea ); + CheckButtons( aCbValue, aPbNewValue, aPbDelValue ); + return 0; +} + +IMPL_LINK( GenericOptions, DelGroup, Button*, EMPTYARG ) +{ + String aGroup = aCbArea.GetText(); + if ( aCbArea.GetEntryPos( aGroup ) != COMBOBOX_ENTRY_NOTFOUND ) + { + aCbArea.RemoveEntry( aGroup ); + ByteString aByteGroup( aGroup, RTL_TEXTENCODING_UTF8 ); + pTempConf->WriteKey( C_KEY_DELETE, pTempConf->ReadKey( C_KEY_DELETE ).Append( aByteGroup ) ); + pTempConf->DeleteKey( ByteString( aByteGroup ).Append( C_KEY_AKTUELL ) ); + pTempConf->DeleteKey( ByteString( aByteGroup ).Append( C_KEY_ALLE ) ); + } + + aCbArea.SetText( aCbArea.GetEntry( 0 ) ); + LINK( this, GenericOptions, LoadGroup ).Call( NULL ); + + return 0; +} + +IMPL_LINK( GenericOptions, NewGroup, Button*, EMPTYARG ) +{ + aCbArea.InsertEntry( aCbArea.GetText() ); + + LINK( this, GenericOptions, LoadGroup ).Call( NULL ); + + return 0; +} + +IMPL_LINK( GenericOptions, DelValue, Button*, EMPTYARG ) +{ + String aValue = aCbValue.GetText(); + if ( aCbValue.GetEntryPos( aValue ) != COMBOBOX_ENTRY_NOTFOUND ) + { + aCbValue.RemoveEntry( aValue ); + } + + aCbValue.SetText( aCbValue.GetEntry( 0 ) ); + CheckButtons( aCbValue, aPbNewValue, aPbDelValue ); + return 0; +} + +IMPL_LINK( GenericOptions, NewValue, Button*, EMPTYARG ) +{ + aCbValue.InsertEntry( aCbValue.GetText() ); + CheckButtons( aCbValue, aPbNewValue, aPbDelValue ); + return 0; +} + +IMPL_LINK( GenericOptions, CheckButtonsHdl, ComboBox*, pCB ) +{ + if ( pCB == &aCbArea ) + CheckButtons( aCbArea, aPbNewArea, aPbDelArea ); + if ( pCB == &aCbValue ) + CheckButtons( aCbValue, aPbNewValue, aPbDelValue ); + return 0; +} + +void GenericOptions::CheckButtons( ComboBox &aCB, Button &aNewB, Button &aDelB ) +{ + aNewB.Enable( aCB.GetEntryPos( aCB.GetText() ) == COMBOBOX_ENTRY_NOTFOUND && aCB.GetText().Len() ); +} + +void GenericOptions::Save() +{ + xub_StrLen i; + + // Erstmal eventuelle nderungen Speichern + LINK( this, GenericOptions, LoadGroup ).Call( NULL ); + + // Zuerst alles was wir Gelscht haben raushauen + ByteString aDelete = pTempConf->ReadKey( C_KEY_DELETE ); + for ( i=0 ; i < aDelete.GetTokenCount() ; i++ ) + { + aConf.DeleteGroup( aDelete.GetToken( i ) ); + } + + // Dann alles aus der Temporren in die Echte ini kopieren. + for ( i=0 ; i < aCbArea.GetEntryCount() ; i++ ) + { + ByteString aGroup = ByteString( aCbArea.GetEntry( i ), RTL_TEXTENCODING_UTF8 ); + ByteString aGroupKeyAktuell( aGroup ); + aGroupKeyAktuell.Append( C_KEY_AKTUELL ); + if ( HasKey( *pTempConf, aGroupKeyAktuell ) ) + { + ByteString aCurrentValue = pTempConf->ReadKey( aGroupKeyAktuell ); + aConf.SetGroup( ByteString( aCbArea.GetEntry( i ), RTL_TEXTENCODING_UTF8 ) ); + aConf.WriteKey( C_KEY_AKTUELL, aCurrentValue ); + aConf.WriteKey( C_KEY_ALLE, pTempConf->ReadKey( ByteString( aGroup ).Append( C_KEY_ALLE ) ) ); + } + } + aConf.Flush(); +} + + +class TextAndWin : public DockingWindow +{ + FixedText *pFt; + Window *pWin; + Window* pFtOriginalParent; + Window* pWinOriginalParent; + long nSpace; // Standardabstand + BOOL bAlignTop; + +public: + TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, BOOL bAlignTopP ); + ~TextAndWin(); + + virtual void Resize(); +}; + +TextAndWin::TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, BOOL bAlignTopP ) +: DockingWindow( pParent ) +, pFt( pFtP ) +, pWin( pWinP ) +, nSpace( nSpaceP ) +, bAlignTop( bAlignTopP ) +{ + pFtOriginalParent = pFt->GetParent(); + pWinOriginalParent = pWin->GetParent(); + pFt->SetParent( this ); + pWin->SetParent( this ); +} + +TextAndWin::~TextAndWin() +{ + pFt->SetParent( pFtOriginalParent ); + pWin->SetParent( pWinOriginalParent ); +} + +void TextAndWin::Resize() +{ + long nTopSpace = bAlignTop ? 0 : nSpace; + long nBottomSpace = bAlignTop ? nSpace : 0; + + long nFixedTextOffset; + if ( GetOutputSizePixel().Height() < 3 * pFt->GetSizePixel().Height() ) + { + pFt->Hide(); + nFixedTextOffset = 0; + } + else + { + pFt->Show(); + nFixedTextOffset = pFt->GetSizePixel().Height() + nSpace; + + // FixedText Positionieren + pFt->SetPosPixel( Point( 0, nTopSpace ) ); + } + + // Window Positionieren + long nWinPosY = nFixedTextOffset; + nWinPosY += nTopSpace; + pWin->SetPosPixel( Point( 0, nWinPosY ) ); + + // Gre des Window anpassen + long nWinHeight = GetOutputSizePixel().Height(); + nWinHeight -= nWinPosY; + nWinHeight -= nBottomSpace; + pWin->SetSizePixel( Size( GetOutputSizePixel().Width(), nWinHeight ) ); +} + +DisplayHidDlg::DisplayHidDlg( Window * pParent ) +: FloatingWindow( pParent, ResId( IDD_DISPLAY_HID ) ) +, aTbConf( this, ResId( RID_TB_CONF ) ) +, aFtControls( this, ResId( RID_FT_CONTROLS ) ) +, aMlbControls( this, ResId( RID_MLB_CONTROLS ) ) +, aFtSlots( this, ResId( RID_FT_SLOTS ) ) +, aMlbSlots( this, ResId( RID_MLB_SLOTS ) ) +, aPbKopieren( this, ResId( RID_PB_KOPIEREN ) ) +, aPbBenennen( this, ResId( RID_PB_BENENNEN ) ) +, aPbSelectAll( this, ResId( RID_PB_SELECTALL ) ) +, aOKClose( this, ResId( RID_OK_CLOSE ) ) +, nDisplayMode( DH_MODE_KURZNAME | DH_MODE_LANGNAME ) // Falls wir ein altes Office haben diesen Default verwenden +{ + FreeResource(); + + ResMgr* pRM = CREATERESMGR( svt ); + ToolBox aOrig( this, ResId( 12345, pRM ) ); + delete pRM; + + aTbConf.CopyItem( aOrig, 4 ); + aTbConf.InsertSeparator(); + aTbConf.CopyItem( aOrig, 5 ); + aTbConf.CopyItem( aOrig, 6 ); + aTbConf.CopyItem( aOrig, 7 ); + aTbConf.SetOutStyle( TOOLBOX_STYLE_FLAT ); + +#ifndef DEBUG + aTbConf.Hide(); +#endif + + pSplit = new SplitWindow( this ); + pControls = new TextAndWin( pSplit, &aFtControls, &aMlbControls, aMlbControls.GetPosPixel().X(), TRUE ); + pSlots = new TextAndWin( pSplit, &aFtSlots, &aMlbSlots, aMlbControls.GetPosPixel().X(), FALSE ); + + pSplit->SetPosPixel( aFtControls.GetPosPixel() ); + pSplit->InsertItem( 1, pControls, 70, SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE ); + pSplit->InsertItem( 2, pSlots, 30, SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE ); + pSplit->Show(); + + aTbConf.SetBorderStyle( WINDOW_BORDER_NORMAL ); + aPbKopieren.SetClickHdl( LINK( this, DisplayHidDlg, CopyToClipboard ) ); + aPbSelectAll.SetClickHdl( LINK( this, DisplayHidDlg, SelectAll ) ); + + aMlbControls.SetSelectHdl( LINK( this, DisplayHidDlg, Select ) ); + aMlbSlots.SetSelectHdl( LINK( this, DisplayHidDlg, Select ) ); + Select( NULL ); +} + +DisplayHidDlg::~DisplayHidDlg() +{ + delete pControls; + delete pSlots; + delete pSplit; +} + +IMPL_LINK( DisplayHidDlg, CopyToClipboard, void*, EMPTYARG ) +{ + String aSammel; + USHORT i; + + for ( i=0 ; i < aMlbControls.GetSelectEntryCount() ; i++ ) + { + if ( aSammel.Len() ) + aSammel += '\n'; + aSammel += aMlbControls.GetSelectEntry( i ); + } + for ( i=0 ; i < aMlbSlots.GetSelectEntryCount() ; i++ ) + { + if ( aSammel.Len() ) + aSammel += '\n'; + aSammel += aMlbSlots.GetSelectEntry( i ); + } + Clipboard::Clear(); + Clipboard::CopyString( aSammel ); + return 0; +} + +IMPL_LINK( DisplayHidDlg, SelectAll, PushButton*, pButton ) +{ + if ( pButton->GetState() != STATE_CHECK ) + { + USHORT i; + for ( i=0 ; i < aMlbControls.GetEntryCount() ; i++ ) + aMlbControls.SelectEntryPos( i ); + for ( i=0 ; i < aMlbSlots.GetEntryCount() ; i++ ) + aMlbSlots.SelectEntryPos( i ); + } + else + { + aMlbControls.SetNoSelection(); + aMlbControls.Invalidate(); + aMlbSlots.SetNoSelection(); + aMlbSlots.Invalidate(); + } + Select( NULL ); + return 0; +} + +IMPL_LINK( DisplayHidDlg, Select, void*, EMPTYARG ) +{ + if ( !aMlbControls.GetSelectEntryCount() && !aMlbSlots.GetSelectEntryCount() ) + aPbSelectAll.SetState( STATE_NOCHECK ); + else if ( aMlbControls.GetSelectEntryCount() == aMlbControls.GetEntryCount() + && aMlbSlots.GetSelectEntryCount() == aMlbSlots.GetEntryCount() ) + aPbSelectAll.SetState( STATE_CHECK ); + else + aPbSelectAll.SetState( STATE_DONTKNOW ); + return 0; +} + +void DisplayHidDlg::AddData( WinInfoRec* pWinInfo ) +{ + if ( pWinInfo->bIsReset ) + { + aMlbControls.Clear(); + aMlbSlots.Clear(); + + if ( pWinInfo->nUId & DH_MODE_DATA_VALID ) // kein altes Office + nDisplayMode = pWinInfo->nUId; // Wird im Reset zur bermittlung des Modus verwendet + + return; + } + + String aMsg; + if ( ( nDisplayMode & DH_MODE_KURZNAME ) ) + { + if ( pWinInfo->aKurzname.Len() > 0 ) + aMsg += pWinInfo->aKurzname; + else + { + aMsg.AppendAscii( "--" ); + aMsg += String::CreateFromInt64( pWinInfo->nUId ); + aMsg.AppendAscii( ": " ); + aMsg += pWinInfo->aRName; + } + aMsg.Expand(20); + } + else + { + aMsg += String::CreateFromInt64( pWinInfo->nUId ); + aMsg.Expand(13); + } + aMsg.AppendAscii( " " ); // Mindestens 3 Blanks sollten schon sein. + + if ( nDisplayMode & DH_MODE_LANGNAME ) + { + if ( pWinInfo->aLangname.Len() > 0 ) + aMsg += pWinInfo->aLangname; + else + aMsg += String( ResId( IDS_NO_LONGNAME ) ); + } + + aMlbControls.InsertEntry( aMsg ); + + + // Haben wir noch einen Slotname? + if ( ( nDisplayMode & DH_MODE_KURZNAME ) && pWinInfo->aSlotname.Len() > 0 ) + { + aMsg = pWinInfo->aSlotname; + aMsg.Expand(20); + aMsg.AppendAscii( " " ); // Mindestens 3 Blanks sollten schon sein. + + if ( nDisplayMode & DH_MODE_LANGNAME ) + { + if ( pWinInfo->aLangname.Len() > 0 ) + aMsg += pWinInfo->aLangname; + else + aMsg += String( ResId( IDS_NO_LONGNAME ) ); + } + + aMlbSlots.InsertEntry( aMsg ); + } +} + +void DisplayHidDlg::Resize() +{ + + if ( IsRollUp() ) + { + // Wir wollen nur die Toolbox sehen + SetOutputSizePixel( aTbConf.GetSizePixel() ); + } + else + { +// SetUpdateMode( FALSE ); + + // Minimalgre + Size aSize( GetOutputSizePixel() ); + aSize.Width() = max( aSize.Width(), aOKClose.GetSizePixel().Width() * 3 ); + aSize.Height() = max( aSize.Height(), aOKClose.GetSizePixel().Height() * 8 ); + SetOutputSizePixel( aSize ); + + // Standardabstand + long nSpace = pSplit->GetPosPixel().X(); + + // ToolBox Breite anpassen + aTbConf.SetSizePixel( Size ( GetSizePixel().Width(), aTbConf.CalcWindowSizePixel().Height() ) ); + aTbConf.SetSizePixel( Size() ); // Vorerst verstecken! + + // SplitWindow Positionieren + pSplit->SetPosPixel( Point( nSpace, nSpace + aTbConf.GetPosPixel().Y() + aTbConf.GetSizePixel().Height() ) ); + + // Breite des SplitWindows bestimmen + long nSplitWidth = GetSizePixel().Width(); + nSplitWidth -= aPbBenennen.GetSizePixel().Width(); + nSplitWidth -= 3 * nSpace; // Die Zwischenrume + nSplitWidth -= nSpace / 2; // Etwas mehr Platz am rechten Rand + + // Hhe des SplitWindows bestimmen + long nSplitHeight = GetOutputSizePixel().Height(); + nSplitHeight -= pSplit->GetPosPixel().Y(); + nSplitHeight -= nSpace; // der Abstand unten + + // Gre des SplitWindows setzen + pSplit->SetSizePixel( Size( nSplitWidth, nSplitHeight ) ); + + Point aPos; + + // Button "Kopieren" Positionieren + aPos = pSplit->GetPosPixel(); + aPos.Move( nSplitWidth, 0 ); + aPos.Move( nSpace, 0 ); + aPbKopieren.SetPosPixel( aPos ); + + // Button "Alles Whlen" gleich darunter positionieren + aPos.Move( 0, aPbKopieren.GetSizePixel().Height() ); + aPos.Move( 0, nSpace ); + aPbSelectAll.SetPosPixel( aPos ); + + // Button "Benennen" gleich darunter positionieren + aPos.Move( 0, aPbSelectAll.GetSizePixel().Height() ); + aPos.Move( 0, nSpace ); + aPbBenennen.SetPosPixel( aPos ); + + // Und zum Schlu noch den "Close" Button positionieren + aPos = pSplit->GetPosPixel(); + aPos.Move( nSpace, -aOKClose.GetSizePixel().Height() ); + aPos.Move( pSplit->GetSizePixel().Width(), pSplit->GetSizePixel().Height() ); + aOKClose.SetPosPixel( aPos ); + +// SetUpdateMode( TRUE ); +// Invalidate(); + } + FloatingWindow::Resize(); +} + + +VarEditDialog::VarEditDialog( Window * pParent, SbxVariable *pPVar ) +: ModelessDialog( pParent, ResId( IDD_EDIT_VAR ) ) +, aFixedTextRID_FT_NAME( this, ResId( RID_FT_NAME ) ) +, aFixedTextRID_FT_CONTENT( this, ResId( RID_FT_CONTENT ) ) +, aFixedTextRID_FT_NEW_CONTENT( this, ResId( RID_FT_NEW_CONTENT ) ) +, aFixedTextRID_FT_NAME_VALUE( this, ResId( RID_FT_NAME_VALUE ) ) +, aFixedTextRID_FT_CONTENT_VALUE( this, ResId( RID_FT_CONTENT_VALUE ) ) + +, aRadioButtonRID_RB_NEW_BOOL_T( this, ResId( RID_RB_NEW_BOOL_T ) ) +, aRadioButtonRID_RB_NEW_BOOL_F( this, ResId( RID_RB_NEW_BOOL_F ) ) +, aNumericFieldRID_NF_NEW_INTEGER( this, ResId( RID_NF_NEW_INTEGER ) ) +, aNumericFieldRID_NF_NEW_LONG( this, ResId( RID_NF_NEW_LONG ) ) +, aEditRID_ED_NEW_STRING( this, ResId( RID_ED_NEW_STRING ) ) + +, aOKButtonRID_OK( this, ResId( RID_OK ) ) +, aCancelButtonRID_CANCEL( this, ResId( RID_CANCEL ) ) +, pVar( pPVar ) +{ + aFixedTextRID_FT_NAME_VALUE.SetText( pVar->GetName() ); + aFixedTextRID_FT_CONTENT_VALUE.SetText( pVar->GetString() ); + + SbxDataType eType = pVar->GetType(); + if ( ( eType & ( SbxVECTOR | SbxARRAY | SbxBYREF )) == 0 ) + { + switch ( eType ) + { + case SbxBOOL: + aRadioButtonRID_RB_NEW_BOOL_T.Show(); + aRadioButtonRID_RB_NEW_BOOL_F.Show(); + if ( pVar->GetBool() ) + aRadioButtonRID_RB_NEW_BOOL_T.Check(); + else + aRadioButtonRID_RB_NEW_BOOL_F.Check(); + break; +// case SbxCURRENCY: +// case SbxDATE: + break; + case SbxINTEGER: + aNumericFieldRID_NF_NEW_INTEGER.Show(); + aNumericFieldRID_NF_NEW_INTEGER.SetText( pVar->GetString() ); + aNumericFieldRID_NF_NEW_INTEGER.Reformat(); + break; + case SbxLONG: + aNumericFieldRID_NF_NEW_LONG.Show(); + aNumericFieldRID_NF_NEW_LONG.SetText( pVar->GetString() ); + aNumericFieldRID_NF_NEW_LONG.Reformat(); + // Mssen hart gesetzt werden, da der Rsc Compiler damit nicht klar kommt. + aNumericFieldRID_NF_NEW_LONG.SetMin( -aNumericFieldRID_NF_NEW_LONG.GetMax()-1 ); + aNumericFieldRID_NF_NEW_LONG.SetFirst( -aNumericFieldRID_NF_NEW_LONG.GetLast()-1 ); + break; +// case SbxOBJECT: // kann nicht editiert werden + break; + case SbxSINGLE: + case SbxDOUBLE: + case SbxSTRING: + case SbxVARIANT: // Taucht wohl auch nicht auf. stattdessen SbxEMPTY + case SbxEMPTY: + aEditRID_ED_NEW_STRING.Show(); + aEditRID_ED_NEW_STRING.SetText( pVar->GetString() ); + break; + } + } + + + aOKButtonRID_OK.SetClickHdl( LINK( this, VarEditDialog, OKClick ) ); +} + + +IMPL_LINK( VarEditDialog, OKClick, Button *, pButton ) +{ + BOOL bWasError = SbxBase::IsError(); // Da eventuell ein Fehler geschmissen wird. + + + SbxDataType eType = pVar->GetType(); +/* +Boolean +Currency +Date +Double +Integer +Long +Object +Single +String +Variant + + +atof + + ecvt + f + gcvt + +SvNumberformat:: + static double StringToDouble( const xub_Unicode* pStr, + const International& rIntl, + int& nErrno, + const xub_Unicode** ppEnd = NULL ); + // Konvertiert analog strtod einen dezimalen String in einen double, + // Dezimalseparator und Tausenderseparator werden aus International + // genommen, fuehrende Leerzeichen werden weggeparst. + // Ist ppEnd!=NULL wird *ppEnd hinter das Weggeparste gesetzt. + // Enthaelt pStr nur den zu parsenden String, ist also bei Erfolg + // **ppEnd=='\0' und *ppEnd-pStr==strlen(pStr). + // Bei Ueberlauf wird fVal=+/-HUGE_VAL gesetzt, bei Unterlauf 0, + // nErrno wird in diesen Faellen auf ERANGE gesetzt, sonst 0. + // "+/-1.#INF" werden als +/-HUGE_VAL erkannt. + + */ + + + + String aContent( aEditRID_ED_NEW_STRING.GetText() ); + BOOL bError = FALSE; + switch ( eType ) + { + case SbxBOOL: + pVar->PutBool( aRadioButtonRID_RB_NEW_BOOL_T.IsChecked() ); + break; +// case SbxCURRENCY: +// pVar->PutCurrency( aContent ); + break; +// case SbxDATE: +// pVar->PutDate( aContent ); + break; + case SbxINTEGER: + pVar->PutInteger( aNumericFieldRID_NF_NEW_INTEGER.GetValue() ); + break; + case SbxLONG: + pVar->PutLong( aNumericFieldRID_NF_NEW_LONG.GetValue() ); + break; + case SbxDOUBLE: + case SbxSINGLE: + bError = !pVar->PutStringExt( aContent ); + break; + case SbxSTRING: + pVar->PutString( aContent ); + break; + case SbxVARIANT: + case SbxEMPTY: + bError = !pVar->PutStringExt( aContent ); + break; + } + + +// pVar->PutStringExt( aEditRID_ED_NEW_STRING.GetText() ); + if ( !bWasError && SbxBase::IsError() ) + { + bError = TRUE; + SbxBase::ResetError(); + } + + if ( bError ) + { +// ErrorBox( this, WB_OK | WB_DEF_OK, "Der Wert ist ungltig und kann daher nicht gesetzt werden" ).Execute(); + ErrorBox( this, ResId( IDS_INVALID_VALUE ) ).Execute(); + return 1; + } + +// if ( aEditRID_ED_NEW_STRING.GetText().Compare( pVar->GetString() ) != COMPARE_EQUAL ) +// { +// aFixedTextRID_FT_CONTENT_VALUE.SetText( pVar->GetString() ); +// aEditRID_ED_NEW_STRING.SetText( pVar->GetString() ); +// return 1; +// } + + Close(); + return 0; +} + + + diff --git a/basic/source/app/dialogs.hxx b/basic/source/app/dialogs.hxx new file mode 100644 index 000000000000..ab98752d2741 --- /dev/null +++ b/basic/source/app/dialogs.hxx @@ -0,0 +1,307 @@ +/************************************************************************* + * + * $RCSfile: dialogs.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _DIALOGS_HXX +#define _DIALOGS_HXX + +#ifndef _DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif +#ifndef _BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif +#ifndef _EDIT_HXX //autogen +#include <vcl/edit.hxx> +#endif +#ifndef _FIELD_HXX //autogen +#include <vcl/field.hxx> +#endif +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif +#ifndef _SV_TABDLG_HXX //autogen +#include <vcl/tabdlg.hxx> +#endif +#ifndef _SV_TABCTRL_HXX //autogen +#include <vcl/tabctrl.hxx> +#endif +#ifndef _SV_TABPAGE_HXX //autogen +#include <vcl/tabpage.hxx> +#endif +#ifndef _SV_GROUP_HXX //autogen +#include <vcl/group.hxx> +#endif +#ifndef _SV_CONFIG_HXX //autogen +#include <vcl/config.hxx> +#endif +#ifndef _TOOLS_LIST_HXX +#include <tools/list.hxx> +#endif +#ifndef _SV_LSTBOX_HXX //autogen +#include <vcl/lstbox.hxx> +#endif +#ifndef _SV_FLOATWIN_HXX //autogen +#include <vcl/floatwin.hxx> +#endif +#ifndef _SV_TOOLBOX_HXX //autogen +#include <vcl/toolbox.hxx> +#endif + +class SbxVariable; + +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif + +class AboutDialog : public ModalDialog { + FixedText a1,a3,a4,aVersionString; + OKButton aOk; +// FixedIcon aIcon; +public: + AboutDialog (Window*, const ResId&); +}; + +class FindDialog : public ModalDialog { + FixedText aFT1; + Edit aFind; + OKButton aOk; + CancelButton aCancel; + String* pFind; + DECL_LINK( ButtonClick, Button * ); +public: + FindDialog (Window*, const ResId&, String&); +}; + +class ReplaceDialog : public ModalDialog { + FixedText aFT1; + FixedText aFT2; + Edit aFind; + Edit aReplace; + OKButton aOk; + CancelButton aCancel; + String* pFind; + String* pReplace; + DECL_LINK( ButtonClick, Button * ); +public: + ReplaceDialog (Window*, const ResId&, String&, String&); +}; + +class ConfEdit : public PushButton +{ + FixedText aText; + ByteString aKeyName; + Edit aEdit; +public: + ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nResButton, const ByteString& aKN ); + void Save(); + void Click(); +}; + + +class OptionsDialog : public ModelessDialog +{ +private: + TabControl aTabCtrl; + + OKButton aOK; + CancelButton aCancel; + DECL_LINK( OKClick, Button * ); + +public: + OptionsDialog( Window* pParent, const ResId& ); + ~OptionsDialog(); + virtual BOOL Close(); + + + DECL_LINK( ActivatePageHdl, TabControl * ); +}; + +class SpecialOptions : public TabPage +{ + GroupBox aDirs; + ConfEdit aLog; + ConfEdit aBasis; + ConfEdit aHID; + GroupBox aOther; + FixedText aTimeoutText; + TimeField aServerTimeout; + CheckBox aAutoReload; + +public: + SpecialOptions( Window* ); + void Save(); +}; + + +DECLARE_LIST( StringList, String * ); +#define C_KEY_ALLE CByteString("Alle") +#define C_KEY_AKTUELL CByteString("Aktuell") +#define C_KEY_DELETE CByteString("Deleted Groups") + +class GenericOptions : public TabPage +{ + GroupBox aGbArea; + ComboBox aCbArea; + PushButton aPbNewArea; + PushButton aPbDelArea; + + GroupBox aGbValue; + ComboBox aCbValue; + PushButton aPbNewValue; + PushButton aPbDelValue; + + Config aConf; + String aTempConfName; + Config *pTempConf; + ByteString aLastGroupName; + + String ReadKey( const ByteString &aGroup, const ByteString &aKey ); + BOOL HasKey( Config &aConfig, const ByteString &aKey ); + + void LoadValues(); + + StringList* GetAllGroups(); + void LoadData(); + + DECL_LINK( LoadGroup, ComboBox* ); + DECL_LINK( DelGroup, Button* ); + DECL_LINK( NewGroup, Button* ); + DECL_LINK( DelValue, Button* ); + DECL_LINK( NewValue, Button* ); + DECL_LINK( CheckButtonsHdl, ComboBox* ); + + void CheckButtons( ComboBox &aCB, Button &aNewB, Button &aDelB ); + +public: + GenericOptions( Window* ); + ~GenericOptions(); + void Save(); +}; + + +struct WinInfoRec; +class SplitWindow; + +class DisplayHidDlg : public FloatingWindow +{ +protected: + ToolBox aTbConf; + FixedText aFtControls; + MultiListBox aMlbControls; + FixedText aFtSlots; + MultiListBox aMlbSlots; + PushButton aPbKopieren; + PushButton aPbBenennen; + PushButton aPbSelectAll; + OKButton aOKClose; + + DockingWindow* pControls; + DockingWindow* pSlots; + SplitWindow *pSplit; + + ULONG nDisplayMode; + + DECL_LINK( Select, void* ); + DECL_LINK( SelectAll, PushButton* ); + DECL_LINK( CopyToClipboard, void* ); + +public: + DisplayHidDlg( Window * pParent ); + virtual ~DisplayHidDlg(); + + virtual void Resize(); + + void AddData( WinInfoRec* pWinInfo ); + +}; + + +class VarEditDialog : public ModelessDialog +{ +protected: + FixedText aFixedTextRID_FT_NAME; + FixedText aFixedTextRID_FT_CONTENT; + FixedText aFixedTextRID_FT_NEW_CONTENT; + FixedText aFixedTextRID_FT_NAME_VALUE; + FixedText aFixedTextRID_FT_CONTENT_VALUE; + + RadioButton aRadioButtonRID_RB_NEW_BOOL_T; + RadioButton aRadioButtonRID_RB_NEW_BOOL_F; + NumericField aNumericFieldRID_NF_NEW_INTEGER; + NumericField aNumericFieldRID_NF_NEW_LONG; + Edit aEditRID_ED_NEW_STRING; + + OKButton aOKButtonRID_OK; + CancelButton aCancelButtonRID_CANCEL; + + SbxVariable *pVar; + + DECL_LINK( OKClick, Button * ); + +// BOOL bCompare = FALSE; +// String aCompareString; + +public: + VarEditDialog( Window * pParent, SbxVariable *pPVar ); +}; + + +#endif diff --git a/basic/source/app/makefile.mk b/basic/source/app/makefile.mk new file mode 100644 index 000000000000..8150a9e7cff8 --- /dev/null +++ b/basic/source/app/makefile.mk @@ -0,0 +1,164 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ +# +# 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): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=BASIC +TARGET=app + +# --- Settings ------------------------------------------------------------ + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + +# --- Allgemein ------------------------------------------------------------ + +.INCLUDE : $(UPD)minor.mk +RSCUPDVER=$(RSCREVISION)SV$(UPD)$(UPDMINOR) + + +CXXFILES = \ + ttstrhlp.cxx \ + ttbasic.cxx \ + basicrt.cxx \ + processw.cxx \ + process.cxx \ + brkpnts.cxx \ + app.cxx \ + mybasic.cxx \ + status.cxx \ + printer.cxx \ + appwin.cxx \ + appedit.cxx \ + appbased.cxx \ + apperror.cxx \ + textedit.cxx \ + msgedit.cxx \ + dialogs.cxx \ + comm_bas.cxx \ + testbasi.cxx + + +OBJFILES = \ + $(OBJ)$/ttstrhlp.obj \ + $(OBJ)$/ttbasic.obj \ + $(OBJ)$/basicrt.obj \ + $(OBJ)$/processw.obj \ + $(OBJ)$/process.obj \ + $(OBJ)$/brkpnts.obj \ + $(OBJ)$/app.obj \ + $(OBJ)$/mybasic.obj \ + $(OBJ)$/status.obj \ + $(OBJ)$/printer.obj \ + $(OBJ)$/appwin.obj \ + $(OBJ)$/appedit.obj \ + $(OBJ)$/appbased.obj \ + $(OBJ)$/apperror.obj \ + $(OBJ)$/textedit.obj \ + $(OBJ)$/msgedit.obj \ + $(OBJ)$/dialogs.obj \ + $(OBJ)$/comm_bas.obj \ + $(SLO)$/sbintern.obj + + +SRCFILES = \ + basic.src \ + ttmsg.src \ + basmsg.src \ + svtmsg.src \ + testtool.src + +LIBTARGET = NO + +LIB1TARGET=$(LB)$/app.lib +LIB1ARCHIV=$(LB)$/libapp.a +LIB1OBJFILES = \ + $(OBJ)$/ttstrhlp.obj \ + $(OBJ)$/basicrt.obj \ + $(OBJ)$/processw.obj \ + $(OBJ)$/process.obj \ + $(OBJ)$/brkpnts.obj \ + $(OBJ)$/app.obj \ + $(OBJ)$/mybasic.obj \ + $(OBJ)$/status.obj \ + $(OBJ)$/printer.obj \ + $(OBJ)$/appwin.obj \ + $(OBJ)$/appedit.obj \ + $(OBJ)$/appbased.obj \ + $(OBJ)$/apperror.obj \ + $(OBJ)$/textedit.obj \ + $(OBJ)$/msgedit.obj \ + $(OBJ)$/dialogs.obj \ + $(OBJ)$/comm_bas.obj \ + $(SLO)$/sbintern.obj + +.IF "$(depend)" == "" + +ALL: $(LB)$/app.lib \ + ALLTAR + +.ENDIF + +# --- Targets ------------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx new file mode 100644 index 000000000000..6de5e44a892c --- /dev/null +++ b/basic/source/app/msgedit.cxx @@ -0,0 +1,858 @@ +/************************************************************************* + * + * $RCSfile: msgedit.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +/************************************************************************* +File Versions so far: +No Version Initial Implementation without Version Information +Version 2 changed order of entries(New Entries at the end) +Version 3 Changed Charset from CHARSET_IBMPC to RTL_TEXTENCODING_UTF8 + +*************************************************************************/ +#ifndef _INTN_HXX //autogen +#include <tools/intn.hxx> +#endif +#ifndef _TIME_HXX //autogen +#include <tools/time.hxx> +#endif +#ifndef _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif +#ifndef _MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _SOUND_HXX //autogen +#include <vcl/sound.hxx> +#endif +#ifndef _FSYS_HXX //autogen +#include <tools/fsys.hxx> +#endif +#ifndef _CLIP_HXX //autogen +#include <vcl/clip.hxx> +#endif +#ifndef NOOLDSV //autogen +#include <vcl/system.hxx> +#endif +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif +#ifndef _SV_SYSTEM_HXX +#include <vcl/system.hxx> +#endif + +#include "basic.hrc" +#include "msgedit.hxx" +#include "app.hxx" +#include "appbased.hxx" +#include "basmsg.hrc" + +#define WARNING_PREFIX String( ResId( S_WARNING_PREFIX ) ) +#define VERSION_STRING CUniString("File Format Version: ") +#define THIS_VERSION 2 + +#define LOGTYPE( pEntry ) ((pEntry && pEntry->GetUserData())?((TTDebugData*)pEntry->GetUserData())->aLogType:LOG_ERROR) + +MsgEdit::MsgEdit( AppWin* pParent, BasicFrame *pBF, const WinBits& aBits ) +: aEditTree( pParent, pBF, aBits | WB_HASBUTTONS | WB_HASLINES | WB_HASBUTTONSATROOT ) +, pBasicFrame(pBF) +, pCurrentRun(NULL) +, pCurrentTestCase(NULL) +, pCurrentError(NULL) +, nVersion(0) +, bFileLoading(FALSE) +, bModified(FALSE) +, pAppWin( pParent ) +{ + SetFont( System::GetStandardFont(STDFONT_FIXED) ); + aEditTree.SetNodeBitmaps( Bitmap( ResId (MBP_PLUS) ), Bitmap( ResId (MBP_MINUS) ) ); + aEditTree.SetSelectionMode( MULTIPLE_SELECTION ); + if ( aEditTree.GetModel()->GetSortMode() != SortNone ) + aEditTree.GetModel()->SetSortMode( SortNone ); + + pParent->bHasFile = Load( pParent->GetText() ); +} + +MsgEdit::~MsgEdit() +{} + +#define ADD_TTDEBUGDATA( aLBoxEntry ) \ + { \ + TTDebugData *pData = new TTDebugData; \ + *pData = aDebugData; \ + aLBoxEntry->SetUserData( pData ); \ + } \ + + +void MsgEdit::AddAnyMsg( TTLogMsg *LogMsg ) +{ + if ( LogMsg->aDebugData.aFilename.Copy(0,2).CompareToAscii( "--" ) == COMPARE_EQUAL ) + LogMsg->aDebugData.aFilename.Erase(0,2); + xub_StrLen nPos; + LogMsg->aDebugData.aMsg.ConvertLineEnd(); + if ( (nPos = LogMsg->aDebugData.aMsg.Search( CUniString("\n").ConvertLineEnd() )) != STRING_NOTFOUND ) + { + xub_StrLen nSysLineEndLen = CUniString("\n").ConvertLineEnd().Len(); + String aLastPart = LogMsg->aDebugData.aMsg.Copy( nPos+nSysLineEndLen ); + LogMsg->aDebugData.aMsg.Erase( nPos ); + AddAnyMsg( LogMsg ); + LogMsg->aDebugData.aMsg = aLastPart; + AddAnyMsg( LogMsg ); + } + else + { + String aUILogMsg( pBasicFrame->GenRealString( LogMsg->aDebugData.aMsg ) ); + switch ( LogMsg->aDebugData.aLogType ) + { + case LOG_RUN: + { + if ( LogMsg->aDebugData.aMsg.Len() == 0 ) + { + LogMsg->aDebugData.aMsg = GEN_RES_STR2( S_PROG_START, + GetpApp()->GetAppInternational().GetDate(Date()), + GetpApp()->GetAppInternational().GetTime(Time(),FALSE) ); + aUILogMsg = pBasicFrame->GenRealString( LogMsg->aDebugData.aMsg ); + } + AddRun( aUILogMsg, LogMsg->aDebugData ); break; + } + case LOG_TEST_CASE: AddTestCase( aUILogMsg, LogMsg->aDebugData ); break; + case LOG_ERROR: AddError( aUILogMsg, LogMsg->aDebugData ); break; + case LOG_CALL_STACK:AddCallStack( aUILogMsg, LogMsg->aDebugData ); break; + case LOG_MESSAGE: AddMessage( aUILogMsg, LogMsg->aDebugData ); break; + case LOG_WARNING: AddWarning( aUILogMsg, LogMsg->aDebugData ); break; + case LOG_ASSERTION: AddAssertion( aUILogMsg, LogMsg->aDebugData ); break; + } + + if ( !bFileLoading ) + { // Kommt vom Testtool und mu gleich geschrieben werden. + BOOL bFileWasChanged = pAppWin->DiskFileChanged( SINCE_LAST_LOAD ); + + DBG_ASSERT( aLogFileName == LogMsg->aLogFileName, "Logging to different logfile as before" ); + SvFileStream aStrm( LogMsg->aLogFileName, STREAM_STD_WRITE ); + String aLogMsg = Impl_MakeSaveText( LogMsg->aDebugData ).AppendAscii("\n"); + if( aStrm.IsOpen() ) + { + aLogMsg.ConvertLineEnd(LINEEND_CRLF); + aStrm.Seek(STREAM_SEEK_TO_END); + aStrm << ByteString( aLogMsg, RTL_TEXTENCODING_UTF8 ).GetBuffer(); + aStrm.Close(); + } + if ( !bFileWasChanged ) + pAppWin->UpdateFileInfo( HAS_BEEN_LOADED ); + } + } +} + +void MsgEdit::AddRun( String aMsg, TTDebugData aDebugData ) +{ + if ( !bFileLoading || ( bFileLoading && nVersion >= 2 ) ) + pCurrentRun = aEditTree.InsertEntry( aMsg, NULL, FALSE, 0 ); + else // Erstes Dateiformat + pCurrentRun = aEditTree.InsertEntry( aMsg ); // und damit an Ende! + + aEditTree.ShowEntry( pCurrentRun ); + pCurrentTestCase = NULL; + pCurrentError = NULL; + aDebugData.aLogType = LOG_RUN; // Da auch von anderswo aufgerufen + ADD_TTDEBUGDATA( pCurrentRun ); +} + +void MsgEdit::AddTestCase( String aMsg, TTDebugData aDebugData ) +{ + if ( pCurrentRun ) + { + if ( aMsg.Len() == 0 ) // Am Ende des Testcase + { + pCurrentTestCase = NULL; + } + else + { + pCurrentTestCase = aEditTree.InsertEntry( aMsg, pCurrentRun ); + aEditTree.ShowEntry( pCurrentTestCase ); + aDebugData.aLogType = LOG_TEST_CASE; // Da auch von anderswo aufgerufen + ADD_TTDEBUGDATA( pCurrentTestCase ); + } + } + pCurrentError = NULL; +} + +void MsgEdit::AddError( String aMsg, TTDebugData aDebugData ) +{ + if ( !pCurrentTestCase ) + { + TTLogMsg aLogMsg; + aLogMsg.aDebugData = aDebugData; + aLogMsg.aDebugData.aMsg = GEN_RES_STR0( S_ERROR_OUTSIDE_TESTCASE ); + aLogMsg.aDebugData.aLogType = LOG_TEST_CASE; + aLogMsg.aLogFileName = aLogFileName; + AddAnyMsg( &aLogMsg ); + } + if ( pCurrentTestCase ) + { + pCurrentError = aEditTree.InsertEntry( aMsg, pCurrentTestCase ); + aEditTree.ShowEntry( pCurrentError ); + aDebugData.aLogType = LOG_ERROR; // Da auch von anderswo aufgerufen + ADD_TTDEBUGDATA( pCurrentError ); + } +} + +void MsgEdit::AddCallStack( String aMsg, TTDebugData aDebugData ) +{ + DBG_ASSERT( pCurrentError, "Callstack ohne CurrentError im Journal" ); + if ( pCurrentError ) + { + SvLBoxEntry *pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentError ,0 ); + aDebugData.aLogType = LOG_CALL_STACK; // Da auch von anderswo aufgerufen + ADD_TTDEBUGDATA( pThisEntry ); + } +} + +void MsgEdit::AddMessage( String aMsg, TTDebugData aDebugData ) +{ + SvLBoxEntry *pThisEntry = NULL; + if ( pCurrentTestCase ) + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase ); + else if ( pCurrentRun ) + { + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun ); + aEditTree.ShowEntry( pThisEntry ); + } + else + { + AddRun( aMsg, aDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun ); + aEditTree.ShowEntry( pThisEntry ); + } + aDebugData.aLogType = LOG_MESSAGE; // Da auch von anderswo aufgerufen + ADD_TTDEBUGDATA( pThisEntry ); +} + +void MsgEdit::AddWarning( String aMsg, TTDebugData aDebugData ) +{ + SvLBoxEntry *pThisEntry = NULL; + String aCompleteMsg; + aCompleteMsg = WARNING_PREFIX.Append( aMsg ); + + if ( pCurrentTestCase ) + pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentTestCase ); + else if ( pCurrentRun ) + { + pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun ); + aEditTree.ShowEntry( pThisEntry ); + } + else + { + AddRun( aMsg, aDebugData ); + pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun ); + aEditTree.ShowEntry( pThisEntry ); + } + aDebugData.aLogType = LOG_WARNING; // Da auch von anderswo aufgerufen + ADD_TTDEBUGDATA( pThisEntry ); + + while ( !aEditTree.IsEntryVisible( pThisEntry ) && ( pThisEntry = aEditTree.GetParent( pThisEntry ) ) ) + aEditTree.InvalidateEntry( pThisEntry ); +} + +void MsgEdit::AddAssertion( String aMsg, TTDebugData aDebugData ) +{ + SvLBoxEntry *pThisEntry = NULL; + if ( pCurrentTestCase ) + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase ); + else if ( pCurrentRun ) + { + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun ); + aEditTree.ShowEntry( pThisEntry ); + } + else + { + AddRun( aMsg, aDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun ); + aEditTree.ShowEntry( pThisEntry ); + } + aDebugData.aLogType = LOG_ASSERTION; // Da auch von anderswo aufgerufen + ADD_TTDEBUGDATA( pThisEntry ); + + while ( !aEditTree.IsEntryVisible( pThisEntry ) && ( pThisEntry = aEditTree.GetParent( pThisEntry ) ) ) + aEditTree.InvalidateEntry( pThisEntry ); +} + +/* + SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return SvLBox::GetEntry(pParent,nPos); } + SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return SvLBox::GetEntry(nRootPos);} + + + + SvLBoxEntry* FirstChild(SvLBoxEntry* pParent ) const { return (SvLBoxEntry*)(pModel->FirstChild(pParent)); } + SvLBoxEntry* NextSibling(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->NextSibling( pEntry )); } + SvLBoxEntry* PrevSibling(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->PrevSibling( pEntry )); } + + SvLBoxEntry* FirstSelected() const { return (SvLBoxEntry*)SvListView::FirstSelected(); } + SvLBoxEntry* NextSelected( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(SvListView::NextSelected(pEntry)); } + SvLBoxEntry* PrevSelected( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(SvListView::PrevSelected(pEntry)); } + SvLBoxEntry* LastSelected() const { return (SvLBoxEntry*)(SvListView::LastSelected()); } + + SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(pParent,nPos)); } + SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(nRootPos)); } + + SvLBoxEntry* GetParent( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetParent(pEntry)); } + SvLBoxEntry* GetRootLevelParent(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetRootLevelParent( pEntry ));} + + BOOL IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const; + SvListEntry* GetEntry( SvListEntry* pParent, ULONG nPos ) const; + SvListEntry* GetEntry( ULONG nRootPos ) const; + SvListEntry* GetEntryAtAbsPos( ULONG nAbsPos ) const; + SvListEntry* GetParent( SvListEntry* pEntry ) const; + SvListEntry* GetRootLevelParent( SvListEntry* pEntry ) const; +*/ + +//#define CHECK( pMemo ) if ( pMemo && !aEditTree.GetViewData( pMemo ) ) pMemo = NULL +#define CHECK( pMemo ) if ( pMemo && !aEditTree.GetModel()->IsInChildList( NULL, pMemo ) ) pMemo = NULL +void MsgEdit::Delete() +{ + aEditTree.RemoveSelection(); + CHECK( pCurrentRun ); + CHECK( pCurrentTestCase ); + CHECK( pCurrentError ); + bModified = TRUE; + lModify.Call( NULL ); +} + +void MsgEdit::Cut(){ Copy(); Delete(); bModified = TRUE; lModify.Call( NULL ); } +void MsgEdit::Copy(){ Clipboard::Clear();Clipboard::CopyString( GetSelected() ); } +/**/void MsgEdit::Paste(){ Sound::Beep(); } +void MsgEdit::Undo(){ Sound::Beep(); } +void MsgEdit::Redo(){ Sound::Beep(); } + + +String MsgEdit::Impl_MakeText( SvLBoxEntry *pEntry ) const +{ + String aRet; + TTDebugData *aData = (TTDebugData*)pEntry->GetUserData(); + switch ( aData->aLogType ) + { + case LOG_RUN: aRet.AppendAscii("\n"); break; + case LOG_TEST_CASE: break; + case LOG_ERROR: break; + case LOG_CALL_STACK:aRet.AppendAscii("--> "); break; + case LOG_MESSAGE: break; + case LOG_WARNING: break; + case LOG_ASSERTION: break; + default:DBG_ERROR("Unbekannter Typ im ResultFenster"); + } + aRet += aEditTree.GetEntryText( pEntry ); + return aRet; +} + +String MsgEdit::Impl_MakeSaveText( TTDebugData aData ) const +{ +// LogType;Filename;Line;Col1;Col2;Message + String aRet; + aRet += String::CreateFromInt32( (int)aData.aLogType ); + aRet += ';'; + aRet += aData.aFilename; + aRet += ';'; + aRet += String::CreateFromInt32( aData.nLine ); + aRet += ';'; + aRet += String::CreateFromInt32( aData.nCol1 ); + aRet += ';'; + aRet += String::CreateFromInt32( aData.nCol2 ); + aRet += ';'; + aRet += '"'; + aRet += aData.aMsg; + aRet += '"'; + return aRet; +} + +String MsgEdit::Impl_MakeSaveText( SvLBoxEntry *pEntry ) const +{ +// LogType;Filename;Line;Col1;Col2;Message + String aRet; + TTDebugData *aData = (TTDebugData*)pEntry->GetUserData(); + + if ( aEditTree.PrevSibling( pEntry ) && LOGTYPE( aEditTree.PrevSibling( pEntry ) ) == LOG_TEST_CASE ) + { // Um Cases richtig abzuschliessen, so da Warnings und Msgs in Hirarchie richtig. + aRet += String::CreateFromInt32( (int)LOG_TEST_CASE ); + aRet.AppendAscii(";;0;0;0;\"\"\n"); + } + aRet += Impl_MakeSaveText( *aData ); + return aRet; +} + +String MsgEdit::GetSelected() +{ + String aRet; + SvLBoxEntry *pEntry = aEditTree.FirstSelected(); + while ( pEntry ) + { + aRet += Impl_MakeText( pEntry ); + aRet += '\n'; + pEntry = aEditTree.NextSelected( pEntry ); + } + aRet.ConvertLineEnd(); + return aRet; +} + +TextSelection MsgEdit::GetSelection() const +{ + ULONG nStart=0,nEnd=0; + + if ( aEditTree.FirstSelected() ) + { + nStart = aEditTree.GetModel()->GetAbsPos(aEditTree.FirstSelected() ); + if ( aEditTree.LastSelected() ) + nEnd = aEditTree.GetModel()->GetAbsPos(aEditTree.LastSelected() ); + return TextSelection( TextPaM( nStart, 0 ), TextPaM( nEnd, STRING_MAXLEN ) ); + } + else + return TextSelection(); +} + +void MsgEdit::SetSelection( const TextSelection& rSelection ) +{ + USHORT nStart,nEnd; + + while ( aEditTree.GetSelectionCount() ) + aEditTree.Select( aEditTree.FirstSelected(), FALSE ); + + if ( rSelection.HasRange() ) + { + nStart = rSelection.GetStart().GetPara(); + nEnd = rSelection.GetEnd().GetPara(); + + for ( int i = nStart ; i <= nEnd ; i++ ) + aEditTree.Select( aEditTree.GetModel()->GetEntryAtAbsPos( i ), TRUE ); + } +} + +USHORT MsgEdit::GetLineNr() const +{ + if ( aEditTree.GetCurEntry() ) + return aEditTree.GetModel()->GetAbsPos(aEditTree.GetCurEntry() ) + 1; + else + return 0; +} + +void MsgEdit::ReplaceSelected( const String& rStr ){ Sound::Beep();DBG_ERROR("Not Implemented"); } +BOOL MsgEdit::IsModified(){ return bModified; } +void MsgEdit::SetModifyHdl( Link l ){ lModify = l; } + +String MsgEdit::GetText() const +{ + String aRet; + SvLBoxEntry *pEntry = aEditTree.First(); + while ( pEntry ) + { + aRet += Impl_MakeText( pEntry ); + aRet += '\n'; + pEntry = aEditTree.Next( pEntry ); + } + aRet.ConvertLineEnd(); + return aRet; +} + +/**/void MsgEdit::SetText( const String& rStr ){ DBG_ERROR("Not Implemented"); } + +BOOL MsgEdit::HasText() const { return aEditTree.First() != NULL; } + +// Es wird entweder ab Beginn oder ab Markierungsbegin + 1 gesucht. +BOOL MsgEdit::Find( const String& s ) +{ + TextSelection r = GetSelection(); + USHORT bgn = (USHORT) r.GetStart().GetPara() + 1; + if ( r.GetStart().GetPara() == 0 ) bgn = 0; // Suchen ganz von Anfang + + SvLBoxEntry *pEntry = aEditTree.GetModel()->GetEntryAtAbsPos( bgn ); + while ( pEntry ) + { + if( aEditTree.GetEntryText( pEntry ).Search( s, 0 ) != STRING_NOTFOUND ) + { + aEditTree.SetCurEntry( pEntry ); + return TRUE; + } + pEntry = aEditTree.Next( pEntry ); + } + return FALSE; +} +/****************************************************************** + +Zum Fileformat der *.res Dateien: +Die Informationenn werden als Semikolon getrennte Strings +zusammengebastelt. Reihenfolge: + + LogType;Filename;Line;Col1;Col2;Message + +******************************************************************/ + +BOOL MsgEdit::Load( const String& aName ) +{ + aLogFileName = aName; + BOOL bOk = TRUE, bFirstLine = TRUE; + BOOL bLoadError = FALSE; + SvFileStream aStrm( aName, STREAM_STD_READ ); + if( aStrm.IsOpen() ) + { + aEditTree.Clear(); + String aLine; + bFileLoading = TRUE; // So da nicht gleich wieder auf Platte mitgelogt wird. + TTLogMsg *pLogMsg = new TTLogMsg; + while( !aStrm.IsEof() && bOk ) + { + if ( nVersion >= 3 ) // Wir habe utf8 + aStrm.ReadByteStringLine( aLine, RTL_TEXTENCODING_UTF8 ); + else + aStrm.ReadByteStringLine( aLine, RTL_TEXTENCODING_IBM_850 ); + + if( aStrm.GetError() != SVSTREAM_OK ) + bOk = FALSE; + +#define TOKEN( n ) aLine.GetToken( n ) + + if ( aLine.GetTokenCount() >= 6 ) + { +// LogType;Filename;Line;Col1;Col2;Message + TTDebugData aDebugData; + aDebugData.aLogType = TTLogType( TOKEN(0).ToInt32() ); + aDebugData.aFilename = TOKEN(1); + aDebugData.nLine = TOKEN(2).ToInt32(); + aDebugData.nCol1 = TOKEN(3).ToInt32(); + aDebugData.nCol2 = TOKEN(4).ToInt32(); + aDebugData.aMsg = aLine.GetQuotedToken( 5, CUniString("\"\"") ); + aDebugData.aMsg.Erase(0,1); // Anfhrungszeichen entfernen + aDebugData.aMsg.Erase(aDebugData.aMsg.Len()-1,1); + + pLogMsg->aLogFileName.Erase(); + pLogMsg->aDebugData = aDebugData; + + AddAnyMsg( pLogMsg ); + } + else if ( bFirstLine && (aLine.Search( VERSION_STRING ) == 0) ) + nVersion = aLine.Copy( VERSION_STRING.Len() ).ToInt32(); + else bLoadError = TRUE; + + bFirstLine = FALSE; + } + bFileLoading = FALSE; + delete pLogMsg; + aStrm.Close(); + if ( nVersion < 2 && !bLoadError ) + Save( aName ); // Mu sein, sonst passiert beim mitloggen Bldsinn. + + } + else + bOk = FALSE; + return bOk; +} + +BOOL MsgEdit::Save( const String& aName ) +{ + BOOL bOk = TRUE; + BOOL bIsText = DirEntry( aName ).GetExtension().CompareIgnoreCaseToAscii("TXT") == COMPARE_EQUAL; + if ( bIsText && !QueryBox( NULL, ResId( IDS_LOSS_OF_INFORMATION ) ).Execute() ) + return FALSE; + SvFileStream aStrm( aName, STREAM_STD_WRITE | STREAM_TRUNC ); + if( aStrm.IsOpen() ) + { + if ( bIsText ) + { + String aSave = GetText(); + aSave.ConvertLineEnd(LINEEND_CRLF); + aStrm << ByteString( aSave, RTL_TEXTENCODING_UTF8 ).GetBuffer(); + } + else + { +// LogType;Filename;Line;Col1;Col2;Message + String aSave = VERSION_STRING.Append( UniString::CreateFromInt32( 3 ) ).AppendAscii("\n"); // Version 2 + SvLBoxEntry *pRun = aEditTree.First(); + while ( pRun && aEditTree.NextSibling( pRun ) ) + pRun = aEditTree.NextSibling( pRun ); + + aSave.ConvertLineEnd(LINEEND_CRLF); + aStrm << ByteString( aSave, RTL_TEXTENCODING_UTF8 ).GetBuffer(); + + SvLBoxEntry *pEntry; + while ( pRun ) + { + pEntry = pRun; + while ( pEntry && ( pEntry == pRun || LOGTYPE( pEntry ) != LOG_RUN ) ) + { + aSave = Impl_MakeSaveText( pEntry ); + aSave += '\n'; + aSave.ConvertLineEnd(LINEEND_CRLF); + aStrm << ByteString( aSave, RTL_TEXTENCODING_UTF8 ).GetBuffer(); + pEntry = aEditTree.Next( pEntry ); + } + pRun = aEditTree.PrevSibling( pRun ); + + } + } + if( aStrm.GetError() != SVSTREAM_OK ) + bOk = FALSE; + else + { + bModified = FALSE; + lModify.Call( NULL ); + } + + } + else + bOk = FALSE; + return bOk; +} + + +TTTreeListBox::TTTreeListBox( Window* pParent, BasicFrame* pBF, WinBits nWinStyle ) +: SvTreeListBox( pParent, nWinStyle ) +, pBasicFrame(pBF) +//, nDeselectParent(0) +{} + +BOOL TTTreeListBox::DoubleClickHdl() +{ + SvLBoxEntry *pThisEntry = GetHdlEntry(); + if ( pThisEntry && pThisEntry->GetUserData() && ((TTDebugData*)pThisEntry->GetUserData())->aFilename.Len() > 0 ) + { + TTDebugData *aData = (TTDebugData*)pThisEntry->GetUserData(); + if ( pBasicFrame->FindModuleWin( aData->aFilename ) ) + { + AppEdit *pWin = pBasicFrame->FindModuleWin( aData->aFilename ); + pWin->ToTop(); + } + else + pBasicFrame->LoadFile( aData->aFilename ); + + if ( pBasicFrame->pWork && pBasicFrame->pWork->ISA(AppEdit) ) + ((AppEdit*)pBasicFrame->pWork)->Highlight( aData->nLine, aData->nCol1, aData->nCol2 ); + return FALSE; + } + return TRUE; +} + +/*ULONG TTTreeListBox::SelectChildren( SvLBoxEntry* pParent, BOOL bSelect ) +{ + SvLBoxEntry *pEntry = FirstChild( pParent ); + ULONG nRet = 0; + while ( pEntry ) + { + nRet++; + Select( pEntry, bSelect ); + pEntry = NextSibling( pEntry ); + } + return nRet; +} + + +void TTTreeListBox::SelectHdl() +{ + SvLBoxEntry* pHdlEntry = GetHdlEntry(); + + SelectChildren( pHdlEntry, TRUE ); + Select( pHdlEntry, TRUE ); +// InitMenu(pApp->GetAppMenu()->GetPopupMenu( RID_APPEDIT )); // So da Delete richtig ist +} + +void TTTreeListBox::DeselectHdl() +{ + SvLBoxEntry* pHdlEntry = GetHdlEntry(); + if ( GetParent( pHdlEntry ) ) + { + nDeselectParent++; + Select( GetParent( pHdlEntry ), FALSE ); + nDeselectParent--; + } + if ( !nDeselectParent ) + { + SelectChildren( pHdlEntry, FALSE ); + Select( pHdlEntry, FALSE ); + } + Invalidate(); +} */ + + +void TTTreeListBox::KeyInput( const KeyEvent& rKEvt ) +{ + switch ( rKEvt.GetKeyCode().GetFunction() ) + { + case KEYFUNC_CUT: + Control::GetParent()->Command( CommandEvent( Point(), RID_EDITCUT ) ); + break; + case KEYFUNC_COPY: + Control::GetParent()->Command( CommandEvent( Point(), RID_EDITCOPY ) ); + break; + case KEYFUNC_PASTE: + Control::GetParent()->Command( CommandEvent( Point(), RID_EDITPASTE ) ); + break; + case KEYFUNC_DELETE: + Control::GetParent()->Command( CommandEvent( Point(), RID_EDITDEL ) ); + break; + default: + SvTreeListBox::KeyInput( rKEvt ); + } +} + + +TTFeatures TTTreeListBox::GetFeatures( SvLBoxEntry* pEntry ) +{ + switch ( LOGTYPE( pEntry ) ) + { + case LOG_MESSAGE: + return HasNothing; + case LOG_WARNING : + return HasWarning; + case LOG_ERROR: + case LOG_CALL_STACK: + return HasError; + case LOG_RUN: + case LOG_TEST_CASE: + { + SvLBoxEntry* pThisEntry = FirstChild( pEntry ); + TTFeatures aResult = HasNothing; + while ( pThisEntry && !( (aResult & HasError) == HasError ) ) + { + if ( !IsEntryVisible( pThisEntry ) ) + aResult |= GetFeatures( pThisEntry ); + pThisEntry = NextSibling( pThisEntry ); + } + return aResult; + } + case LOG_ASSERTION: + return HasAssertion; + default: + DBG_ERROR("Unbekannter Typ im ResultFenster"); + } + return HasNothing; // da der Comp nich sieht, da kein dafault ntig ist. +} + + +class TTLBoxString : public SvLBoxString +{ +public: + + TTLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, + const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr) {} + + virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, + SvLBoxEntry* pEntry); +}; + + +void TTLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, + SvLBoxEntry* pEntry ) +{ + TTFeatures aFeatures = ((TTTreeListBox*)&rDev)->GetFeatures( pEntry ); + + if ( aFeatures != HasNothing ) + { + Font aOldFont( rDev.GetFont()); + Font aFont( aOldFont ); + + if ( ( aFeatures & HasError ) != 0 || ( aFeatures & HasWarning ) != 0 ) + { + Color aCol; + if ( ( aFeatures & HasError ) == HasError ) + aCol = Color( 255, 120, 120 ); // Rot + else + aCol = Color( 255, 200, 120 ); // Ocker oder so + + if( rDev.IsSelected(pEntry) ) + aFont.SetColor( aCol ); + else + { + aFont.SetFillColor( aCol ); + aFont.SetTransparent( FALSE ); + } + } + else // also HasAssertion + { + if( rDev.IsSelected(pEntry) ) + { + Color aCol( 255, 255, 153 ); + aFont.SetColor( aCol ); + } + else + { + Size aSize( rDev.GetTextWidth( GetText() ), rDev.GetTextHeight() ); + Rectangle aRect( rPos, aSize ); + + static Bitmap aBmp( ResId( MBP_ASSERT ) ); + static BitmapEx aBmpEx( aBmp ); + static Wallpaper aWP( aBmpEx ); + + rDev.DrawWallpaper( aRect, aWP ); + } + +// virtual void NotifyScrolling( long nLines ); + } + rDev.SetFont( aFont ); + rDev.DrawText( rPos, GetText() ); + rDev.SetFont( aOldFont ); + } + else + SvLBoxString::Paint( rPos, rDev, nFlags, pEntry ); +} + + +void TTTreeListBox::InitEntry(SvLBoxEntry* pEntry, + const String& rStr ,const Image& rImg1, const Image& rImg2 ) +{ + USHORT nColToHilite = 1; //0==Bitmap;1=="Spalte1";2=="Spalte2" + SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2 ); + SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite ); + TTLBoxString* pStr = new TTLBoxString( pEntry, 0, pCol->GetText() ); + pEntry->ReplaceItem( pStr, nColToHilite ); +} + diff --git a/basic/source/app/msgedit.hxx b/basic/source/app/msgedit.hxx new file mode 100644 index 000000000000..ce26378694cb --- /dev/null +++ b/basic/source/app/msgedit.hxx @@ -0,0 +1,134 @@ +/************************************************************************* + * + * $RCSfile: msgedit.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _MSGEDIT_HXX +#define _MSGEDIT_HXX + +#ifndef _SVTREEBOX_HXX //autogen +#include <svtools/svtreebx.hxx> +#endif + +#include "dataedit.hxx" +#include "testtool.hxx" +class BasicFrame; +class AppWin; + +#define SelectChildren SelectChilds // Sonst wird mir schlecht + +typedef USHORT TTFeatures; // Bitfeld fr Features der Entrys +#define HasNothing TTFeatures(0x00) +#define HasError TTFeatures(0x01) +#define HasWarning TTFeatures(0x02) +#define HasAssertion TTFeatures(0x04) + + +class TTTreeListBox : public SvTreeListBox +{ +protected: +// virtual void Command( const CommandEvent& rCEvt ); +// USHORT nDeselectParent; + BasicFrame *pBasicFrame; + void InitEntry( SvLBoxEntry*, const String&, const Image&, const Image& ); +public: + TTTreeListBox( Window* pParent, BasicFrame* pBF, WinBits nWinStyle=0 ); + ~TTTreeListBox(){} + +// virtual void SelectHdl(); +// virtual void DeselectHdl(); + virtual BOOL DoubleClickHdl(); + + virtual void KeyInput( const KeyEvent& rKEvt ); + +// ULONG SelectChildren( SvLBoxEntry* pParent, BOOL bSelect ); + TTFeatures GetFeatures( SvLBoxEntry* ); +}; + +class MsgEdit : public DataEdit +{ + SvLBoxEntry *pCurrentRun; + SvLBoxEntry *pCurrentTestCase; + SvLBoxEntry *pCurrentError; +protected: + BOOL bModified; + Link lModify; + BasicFrame *pBasicFrame; + BOOL bFileLoading; // TRUE whrend eine Datei geladen wird. + String Impl_MakeText( SvLBoxEntry *pEntry ) const; + String Impl_MakeSaveText( SvLBoxEntry *pEntry ) const; + String Impl_MakeSaveText( TTDebugData aData ) const; + USHORT nVersion; // Speichert die Dateiversion + AppWin* pAppWin; + String aLogFileName; // Name der Logdatei +public: + MsgEdit( AppWin*, BasicFrame *pBF, const WinBits& ); + ~MsgEdit(); + void AddAnyMsg( TTLogMsg *LogMsg ); + void AddRun( String aMsg, TTDebugData aDebugData ); + void AddTestCase( String aMsg, TTDebugData aDebugData ); + void AddError( String aMsg, TTDebugData aDebugData ); + void AddCallStack( String aMsg, TTDebugData aDebugData ); + void AddMessage( String aMsg, TTDebugData aDebugData ); + void AddWarning( String aMsg, TTDebugData aDebugData ); + void AddAssertion( String aMsg, TTDebugData aDebugData ); +DATA_FUNC_DEF( aEditTree, TTTreeListBox ) +}; + +#endif diff --git a/basic/source/app/mybasic.cxx b/basic/source/app/mybasic.cxx new file mode 100644 index 000000000000..e9d823a6ff8f --- /dev/null +++ b/basic/source/app/mybasic.cxx @@ -0,0 +1,330 @@ +/************************************************************************* + * + * $RCSfile: mybasic.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif + +// AB-Uno-Test +//#define unotest +#ifdef unotest +#ifndef _USR_UNO_HXX +#include <usr/uno.hxx> +#endif +#include <sbuno.hxx> +#include <sbunoobj.hxx> +#endif + +#include "sbintern.hxx" + +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif +#include "mybasic.hxx" +#include "basic.hrc" +#include "appbased.hxx" + +#include "status.hxx" +#include "basic.hrc" + +#include "object.hxx" + +#include "comm_bas.hxx" +#include "processw.hxx" + +TYPEINIT1(MyBasic,StarBASIC) + +class MyFactory : public SbxFactory +{ +public: + virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); +}; + +static SampleObjectFac aFac1; +static MyFactory aFac2; +static CommunicationFactory aComManFac; +static ProcessFactory aProcessFac; +static short nInst = 0; + +SbxBase* MyFactory::Create( UINT16 nSbxId, UINT32 nCr ) +{ + if( nCr == SBXCR_TEST && nSbxId == SBXID_MYBASIC ) + return new MyBasic; + else + return NULL; +} + +MyBasic::MyBasic() : StarBASIC() +{ + nError = 0; + if( !nInst++ ) + { + AddFactory( &aFac1 ); + AddFactory( &aFac2 ); + AddFactory( &aComManFac ); + AddFactory( &aProcessFac ); + } + SbxVariable* p = new SbxCollection( CUniString("MyColl") ); + p->SetName( CUniString("Objects") ); + Insert( p ); + + // AB-Uno-Test +#ifdef unotest + // Uno-Service-Manager holenReflection Service bolen + createAndSetDefaultServiceManager(); // spaeter schon erledigt + + // Uno-Test-Objekt holen + UsrAny aObjAny = getIntrospectionTestObject(); + + // Objekt verpacken in ein SbUnoObject packen + String aName( "UnoObject" ); + SbxObjectRef xSbUnoObj = GetSbUnoObject( aName, aObjAny ); + //SbxObjectRef xSbUnoObj = new SbUnoObject( aName, aObjAny ); + Insert( (SbxObject*)xSbUnoObj ); +#endif + + pTestObject = NULL; +} + +Link MyBasic::GenLogHdl() +{ + return LINK( GetpApp()->GetAppWindow(), BasicFrame, Log ); +} + +Link MyBasic::GenWinInfoHdl() +{ + return LINK( GetpApp()->GetAppWindow(), BasicFrame, WinInfo ); +} + +Link MyBasic::GenModuleWinExistsHdl() +{ + return LINK( GetpApp()->GetAppWindow(), BasicFrame, ModuleWinExists ); +} + +void MyBasic::StartListening( SfxBroadcaster &rBroadcaster ) +{ + ((BasicFrame*)GetpApp()->GetAppWindow())->StartListening( rBroadcaster ); +} + +void MyBasic::SetCompileModule( SbModule *pMod ) +{ + GetSbData()->pCompMod = pMod; +} + +SbModule *MyBasic::GetCompileModule() +{ + return GetSbData()->pCompMod; +} + +String MyBasic::GenRealString( const String &aResString ) +{ + return ((BasicFrame*)GetpApp()->GetAppWindow())->GenRealString( aResString ); +} + +void MyBasic::LoadIniFile() +{ +} + +SbTextType MyBasic::GetSymbolType( const String &rSymbol, BOOL bWasTTControl ) +{ + return SB_SYMBOL; // Alles was hier landet ist vom Typ SB_SYMBOL und bleibt es auch +} + + +MyBasic::~MyBasic() +{ + aErrors.Clear(); + if( !--nInst ) + { + RemoveFactory( &aFac1 ); + RemoveFactory( &aFac2 ); + RemoveFactory( &aComManFac ); + RemoveFactory( &aProcessFac ); + } +} + +BOOL MyBasic::Compile( SbModule* p ) +{ + aErrors.Clear(); + nError = 0; + return StarBASIC::Compile( p ); +} + +BOOL MyBasic::ErrorHdl() +{ + AppEdit *CurrWin = aBasicApp.pFrame->FindModuleWin( GetActiveModule()->GetName() ); + if(CurrWin) + CurrWin->ToTop(); + else + { // erstmal Fenster aufmachen + String aModName = GetActiveModule()->GetName(); + if ( aModName.Copy(0,2).CompareToAscii("--") == COMPARE_EQUAL ) + aModName.Erase(0,2); + GetActiveModule()->SetName(aModName); + AppWin* p = new AppBasEd( aBasicApp.pFrame, GetActiveModule() ); + p->Show(); + p->GrabFocus(); + } + if( IsCompilerError() ) + { + aErrors.Insert( + new BasicError + ( aBasicApp.pFrame->pWork, + 0, StarBASIC::GetErrorText(), GetLine(), GetCol1(), GetCol2() ), + LIST_APPEND ); + nError++; + return BOOL( nError < 20 ); // Abbruch nach 20 Fehlern + } + else + { + ReportRuntimeError(); + return FALSE; + } +} + +void MyBasic::ReportRuntimeError() +{ + String nErrorText; + nErrorText = GetSpechialErrorText(); + + BasicError( aBasicApp.pFrame->pWork, + GetVBErrorCode( GetErrorCode() ), nErrorText, GetLine(), + GetCol1(), GetCol2() ).Show(); +} + +const String MyBasic::GetSpechialErrorText() +{ + return GetErrorText(); +} + +USHORT MyBasic::BreakHdl() +{ + SbModule* pMod = GetActiveModule(); + if( pMod ) + { + AppEdit* pWin = aBasicApp.pFrame->FindModuleWin( pMod->GetName() ); + if( !pWin ) + { // erstmal Fenster aufmachen + String aModName = GetActiveModule()->GetName(); + if ( aModName.Copy(0,2).CompareToAscii("--") == COMPARE_EQUAL ) + aModName.Erase(0,2); + GetActiveModule()->SetName(aModName); + AppWin* p = new AppBasEd( aBasicApp.pFrame, GetActiveModule() ); + p->Show(); + p->GrabFocus(); + p->ToTop(); + pWin = aBasicApp.pFrame->FindModuleWin( aModName ); + } + pWin->Highlight( GetLine(), GetCol1(), GetCol2() ); + } + + if( IsBreak() ) // Wenn Breakpoint (oder "Run to Cursor") + { +// if ( GetActiveModule()->IsBP(GetLine()) ) +// GetActiveModule()->ClearBP(GetLine()); + return aBasicApp.pFrame->BreakHandler(); + } + else + { + return aBasicApp.pFrame->BreakHandler(); + } +} + +/*************************************************************************** +|* +|* class BasicError +|* +***************************************************************************/ + +BasicError::BasicError + ( AppWin* w, USHORT nE, const String& r, USHORT nL, USHORT nC1, USHORT nC2 ) + : aText( ResId( IDS_ERROR1 ) ) +{ + pWin = w; + nLine = nL; + nCol1 = nC1; + nCol2 = nC2; + if( nE ) + { + aText += String::CreateFromInt32( nE ); + aText.AppendAscii(": "); + aText += r; + } + else + aText = r; +} + +// Dies ist ein Beispiel, wie die Fehler-Information geschickt +// aufgebaut werden kann, um ein Statement zu highlighten. + +void BasicError::Show() +{ + if( pWin && pWin->ISA(AppEdit) ) { + ((AppEdit*)pWin)->Highlight( nLine, nCol1, nCol2 ); + aBasicApp.pFrame->pStatus->Message( aText ); + } else MessBox( aBasicApp.pFrame, WB_OK, aBasicApp.pFrame->GetText(), + aText ).Execute(); +} + + diff --git a/basic/source/app/printer.cxx b/basic/source/app/printer.cxx new file mode 100644 index 000000000000..2de59e17bf9e --- /dev/null +++ b/basic/source/app/printer.cxx @@ -0,0 +1,216 @@ +/************************************************************************* + * + * $RCSfile: printer.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _PRINT_HXX //autogen +#include <vcl/print.hxx> +#endif +#ifndef _DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif +#ifndef _FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif +#ifndef _BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif + +#include "app.hxx" +#include "printer.hxx" +#include "basic.hrc" +#include "resids.hrc" + +class PrintingDialog : public ModelessDialog { + String aName; + FixedText aText; + CancelButton aCancel; +public: + PrintingDialog( Window*, BasicPrinter*, ResId&, String& ); + void ChangeMessage( short ); +}; + +BasicPrinter::BasicPrinter() : Printer() +{ + nPage = 0; nLine = 9999; + SetMapMode( MapMode( MAP_POINT ) ); + Size s( GetOutputSize() ); + // 10-Punkt-Schrift verwenden + Font aFont( FAMILY_MODERN, Size( 0, 10 ) ); + aFont.SetPitch( PITCH_FIXED ); + SetFont( aFont ); + // Ausgabe: 6 Zeilen/Zoll = 12 Punkt + nLines = (short) s.Height() / 12; + nYoff = 12; + SetStartPrintHdl( LINK( this, BasicPrinter, StartPrintHdl ) ); + SetEndPrintHdl( LINK( this, BasicPrinter, EndPrintHdl ) ); + SetPrintPageHdl( LINK( this, BasicPrinter, PrintPageHdl ) ); +} + +void BasicPrinter::Header() +{ + if( nPage ) EndPage(); + nPage++; + StartPage(); + String aHdr; + String aPage( ResId( IDS_PAGE ) ); + aPage.Append( String::CreateFromInt32(nPage) ); + aHdr = aFile.Copy( 0, 80 - aPage.Len() ); + aHdr.Expand( 80 - aPage.Len(), ' ' ); + aHdr += aPage; + DrawText( Point( 0, 0 ), aHdr ); + nLine = 2; +} + +void BasicPrinter::Print( const String& rFile, const String& rText, BasicFrame *pFrame ) +{ + nPage = 0; nLine = 9999; + aFile = rFile; + // Dialog einrichten + ResId aResId( IDD_PRINT_DIALOG ); + pDlg = new PrintingDialog + ( aBasicApp.pFrame, this, aResId, aFile ); + // Position des Dialogs setzen + Size s1 = aBasicApp.pFrame->GetSizePixel(); + Size s2 = pDlg->GetSizePixel(); + pDlg->SetPosPixel( Point( (s1.Width() - s2.Width() ) / 2, + (s1.Height()- s2.Height() ) / 2 ) ); + // PRINT-Menu disablen + MenuBar* pBar = pFrame->GetMenuBar(); + Menu* pFileMenu = pBar->GetPopupMenu( RID_APPFILE ); + pFileMenu->EnableItem( RID_FILEPRINT, FALSE ); + + pDlg->ChangeMessage( 1 ); + pDlg->Show(); + StartJob( rFile ); + StartPage(); + xub_StrLen nDone=0; + while( nDone < rText.Len() ) + { + if( nLine >= nLines ) Header(); + xub_StrLen nLineEnd = min( rText.Search( '\n', nDone ), rText.Search( '\r', nDone ) ); + DrawText( Point( 0, nLine * nYoff ), rText, nDone, nLineEnd-nDone-1 ); + nDone = nLineEnd; + if( nDone <= rText.Len() && rText.GetChar(nDone) == '\r' ) nDone++; + if( nDone <= rText.Len() && rText.GetChar(nDone) == '\n' ) nDone++; + nLine++; + Application::Reschedule(); + } + EndPage(); + EndJob(); + nPage = 1; + while( IsPrinting() ) Application::Reschedule(); + delete pDlg; pDlg = NULL; + pFileMenu->EnableItem( RID_FILEPRINT, TRUE ); +} + +IMPL_LINK_INLINE_START( BasicPrinter, StartPrintHdl, Printer *, pPrinter ) +{ + if( pDlg ) pDlg->Show(); + return 0; +} +IMPL_LINK_INLINE_END( BasicPrinter, StartPrintHdl, Printer *, pPrinter ) + +IMPL_LINK_INLINE_START( BasicPrinter, EndPrintHdl, Printer *, pPrinter ) +{ + if( pDlg ) pDlg->Hide(); + return 0; +} +IMPL_LINK_INLINE_END( BasicPrinter, EndPrintHdl, Printer *, pPrinter ) + +IMPL_LINK_INLINE_START( BasicPrinter, PrintPageHdl, Printer *, pPrinter ) +{ + if( pDlg ) pDlg->ChangeMessage( nPage ); + return 0; +} +IMPL_LINK_INLINE_END( BasicPrinter, PrintPageHdl, Printer *, pPrinter ) + +IMPL_LINK_INLINE( BasicPrinter, Abort , void *, EMPTYARG, +{ + AbortJob(); + return 0L; +} +) + +///////////////////////////////////////////////////////////////////////// + +PrintingDialog::PrintingDialog + ( Window* pParent, BasicPrinter* pPrn, ResId& rId, String& rName ) + : ModelessDialog( pParent, rId ), + aCancel( this, ResId( RID_CANCEL ) ), + aText ( this, ResId( RID_TEXT ) ), + aName ( rName ) +{ + FreeResource(); + aCancel.SetClickHdl( LINK( pPrn, BasicPrinter, Abort ) ); +} + +void PrintingDialog::ChangeMessage( short nPage ) +{ + String aMsg( ResId( IDS_PRINTMSG ) ); + aMsg += aName; + aMsg += CUniString("\n"); + aMsg += String( ResId( IDS_PAGE ) ); + aMsg += String::CreateFromInt32( nPage ); + aText.SetText( aMsg ); +} + diff --git a/basic/source/app/printer.hxx b/basic/source/app/printer.hxx new file mode 100644 index 000000000000..5478fed7efa3 --- /dev/null +++ b/basic/source/app/printer.hxx @@ -0,0 +1,92 @@ +/************************************************************************* + * + * $RCSfile: printer.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _BASICPRN_HXX +#define _BASICPRN_HXX + +#ifndef _PRINT_HXX //autogen +#include <vcl/print.hxx> +#endif + +class PrintingDialog; + +class BasicPrinter : public Printer { + short nLine; // aktuelle Zeile + short nPage; // aktuelle Seite + short nLines; // Zeilen pro Seite + short nYoff; // Zeilenabstand in Points + String aFile; // Dateiname + PrintingDialog* pDlg; // Druck-Dialog + void Header(); // Seitenkopf drucken +public: + BasicPrinter(); + void Print( const String& rFile, const String& rText, BasicFrame *pFrame ); + DECL_LINK( Abort, void * ); + DECL_LINK( StartPrintHdl, Printer * ); + DECL_LINK( EndPrintHdl, Printer * ); + DECL_LINK( PrintPageHdl, Printer * ); +#if defined( PM20 ) + // StarView-Bug, bald wieder zu entfernen: + virtual void SetPageQueueSize( USHORT ) {} +#endif +}; + +#endif diff --git a/basic/source/app/process.cxx b/basic/source/app/process.cxx new file mode 100644 index 000000000000..0a0a9beae762 --- /dev/null +++ b/basic/source/app/process.cxx @@ -0,0 +1,222 @@ +/************************************************************************* + * + * $RCSfile: process.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + + +#ifdef WNT +#include <tools/prewin.h> +#include "winbase.h" +#include <tools/postwin.h> +#endif + +#ifndef _ERRCODE_HXX //autogen +#include <tools/errcode.hxx> +#endif +#ifndef _VOS_PROCESS_HXX_ +#include <vos/process.hxx> +#endif +#ifndef _SBXCORE_HXX +#include <svtools/sbxcore.hxx> +#endif +#ifndef _STRING_HXX +#include <tools/string.hxx> +#endif +#ifndef _OSL_FILE_HXX_ +#include <osl/file.hxx> +#endif + +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif + +//#ifndef _BYTE_STRING_LIST +//DECLARE_LIST( ByteStringList, ByteString * ); +//#define _BYTE_STRING_LIST +//#endif + +#include "process.hxx" + +// Konstruktor fr den Process +Process::Process() +: bWasGPF( FALSE ) +, pArgumentList( NULL ) +, pProcess( NULL ) +, bHasBeenStarted( FALSE ) +{ +} + +// Destruktor +Process::~Process() +{ + delete pArgumentList; + delete pProcess; +} + + +BOOL Process::ImplIsRunning() +{ + if ( pProcess && bHasBeenStarted ) + { + NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo; + pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo ); + if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) ) + return TRUE; + else + return FALSE; + } + else + return FALSE; +} + +long Process::ImplGetExitCode() +{ + if ( pProcess ) + { + NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo; + pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo ); + if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) ) + SbxBase::SetError( SbxERR_NO_ACTIVE_OBJECT ); + return aProcessInfo.Code; + } + else + SbxBase::SetError( SbxERR_NO_ACTIVE_OBJECT ); + return 0; +} + + +//////////////////////////////////////////////////////////////////////////// + +// Die Methoden: +void Process::SetImage( const String &aAppPath, const String &aAppParams ) +{ // Imagedatei des Executables + if ( pProcess && ImplIsRunning() ) + SbxBase::SetError( SbxERR_NO_ACTIVE_OBJECT ); + else + { + delete pArgumentList; + delete pProcess; + + xub_StrLen i, nCount = aAppParams.GetQuotedTokenCount( CUniString("\"\"" ), ' ' ); + NAMESPACE_RTL(OUString) *pParamList = new NAMESPACE_RTL(OUString)[nCount]; + for ( i = 0 ; i < nCount ; i++ ) + { + NAMESPACE_RTL(OUString) aTemp = NAMESPACE_RTL(OUString)(aAppParams.GetQuotedToken( i, CUniString("\"\"" ), ' ' )); + if ( aTemp.getLength() ) + pParamList[i] = aTemp; + } + pArgumentList = new NAMESPACE_VOS(OArgumentList)( pParamList, nCount ); + NAMESPACE_RTL(OUString) aNormalizedAppPath; + osl::FileBase::normalizePath( NAMESPACE_RTL(OUString)(aAppPath), aNormalizedAppPath ); + pProcess = new NAMESPACE_VOS(OProcess)( aNormalizedAppPath ); + bHasBeenStarted = FALSE; + } +} + +BOOL Process::Start() +{ // Programm wird gestartet + BOOL bSuccess=FALSE; + if ( pProcess && !ImplIsRunning() ) + { + bWasGPF = FALSE; +#ifdef WNT +// sal_uInt32 nErrorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_NOALIGNMENTFAULTEXCEPT | SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); + sal_uInt32 nErrorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_NOALIGNMENTFAULTEXCEPT | SEM_NOGPFAULTERRORBOX); + try + { +#endif + bSuccess = pProcess->execute( (NAMESPACE_VOS(OProcess)::TProcessOption) + ( NAMESPACE_VOS(OProcess)::TOption_SearchPath + /*| NAMESPACE_VOS(OProcess)::TOption_Detached*/ + /*| NAMESPACE_VOS(OProcess)::TOption_Wait*/ ), + *pArgumentList ) == NAMESPACE_VOS(OProcess)::E_None; +#ifdef WNT + } + catch( ... ) + { + bWasGPF = TRUE; + } + nErrorMode = SetErrorMode(nErrorMode); +#endif + bHasBeenStarted = bSuccess; + } + else + SbxBase::SetError( SbxERR_NO_ACTIVE_OBJECT ); + return bSuccess; +} + +ULONG Process::GetExitCode() +{ // ExitCode des Programms(nachdem es beendet ist) + return ImplGetExitCode(); +} + +BOOL Process::IsRunning() +{ // Programm luft noch + return ImplIsRunning(); +} + +BOOL Process::WasGPF() +{ // Programm mit GPF o.. abgebrochen +#ifdef WNT + return ImplGetExitCode() == 3221225477; +#else + return bWasGPF; +#endif +} + diff --git a/basic/source/app/processw.cxx b/basic/source/app/processw.cxx new file mode 100644 index 000000000000..d33c9ddfa208 --- /dev/null +++ b/basic/source/app/processw.cxx @@ -0,0 +1,324 @@ +/************************************************************************* + * + * $RCSfile: processw.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _ERRCODE_HXX //autogen +#include <tools/errcode.hxx> +#endif +#ifndef _SBX_SBXOBJECT_HXX //autogen +#include <svtools/sbxobj.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef __SBX_SBXVARIABLE_HXX //autogen +#include <svtools/sbxvar.hxx> +#endif + +//#include <osl/thread.h> +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif + +#include "processw.hxx" + +//#include "collelem.hxx" +// Makro MEMBER() +#include "macfix.hxx" + +// Der Process hat folgende Elemente: +// 1) Properties: +// Keine +// 2) Methoden: +// SetImage( Filename ) +// BOOL Start +// USHORT GetExitCode +// BOOL IsRunning +// BOOL WasGPF + + +// Diese Implementation ist ein Beispiel fuer eine tabellengesteuerte +// Version, die sehr viele Elemente enthalten kann. Die Elemente werden +// je nach Bedarf aus der Tabelle in das Objekt uebernommen. + +// Das nArgs-Feld eines Tabelleneintrags ist wie folgt verschluesselt: + +#define _ARGSMASK 0x00FF // Bis zu 255 Argumente +#define _RWMASK 0x0F00 // Maske fuer R/W-Bits +#define _TYPEMASK 0xF000 // Maske fuer den Typ des Eintrags + +#define _READ 0x0100 // kann gelesen werden +#define _BWRITE 0x0200 // kann as Lvalue verwendet werden +#define _LVALUE _BWRITE // kann as Lvalue verwendet werden +#define _READWRITE 0x0300 // beides +#define _OPT 0x0400 // TRUE: optionaler Parameter +#define _METHOD 0x1000 // Masken-Bit fuer eine Methode +#define _PROPERTY 0x2000 // Masken-Bit fuer eine Property +#define _COLL 0x4000 // Masken-Bit fuer eine Collection + // Kombination von oberen Bits: +#define _FUNCTION 0x1100 // Maske fuer Function +#define _LFUNCTION 0x1300 // Maske fuer Function, die auch als Lvalue geht +#define _ROPROP 0x2100 // Maske Read Only-Property +#define _WOPROP 0x2200 // Maske Write Only-Property +#define _RWPROP 0x2300 // Maske Read/Write-Property +#define _COLLPROP 0x4100 // Maske Read-Collection-Element + +#define COLLNAME "Elements" // Name der Collection, hier mal hart verdrahtet + + + +ProcessWrapper::Methods ProcessWrapper::aProcessMethods[] = { +// Imagedatei des Executables +{ "SetImage", SbxEMPTY, 1 | _FUNCTION, MEMBER(ProcessWrapper::PSetImage) }, + // Zwei Named Parameter + { "Filename",SbxSTRING }, + { "Params",SbxSTRING, _OPT }, +// Programm wird gestartet +{ "Start", SbxBOOL, 0 | _FUNCTION, MEMBER(ProcessWrapper::PStart) }, +// ExitCode des Programms(nachdem es beendet ist) +{ "GetExitCode", SbxULONG, 0 | _FUNCTION, MEMBER(ProcessWrapper::PGetExitCode) }, +// Programm luft noch +{ "IsRunning", SbxBOOL, 0 | _FUNCTION, MEMBER(ProcessWrapper::PIsRunning) }, +// Programm mit GPF o.. abgebrochen +{ "WasGPF", SbxBOOL, 0 | _FUNCTION, MEMBER(ProcessWrapper::PWasGPF) }, + +{ NULL, SbxNULL, -1 }}; // Tabellenende + + + +// Konstruktor fr den Process +ProcessWrapper::ProcessWrapper() : SbxObject( CUniString("Process") ) +{ + pProcess = new Process(); + SetName( CUniString("Process") ); + pMethods = &aProcessMethods[0]; +} + +// Destruktor +ProcessWrapper::~ProcessWrapper() +{ + delete pProcess; +} + +// Suche nach einem Element: +// Hier wird linear durch die Methodentabelle gegangen, bis eine +// passende Methode gefunden wurde. +// Wenn die Methode/Property nicht gefunden wurde, nur NULL ohne +// Fehlercode zurueckliefern, da so auch eine ganze Chain von +// Objekten nach der Methode/Property befragt werden kann. + +SbxVariable* ProcessWrapper::Find( const String& rName, SbxClassType t ) +{ + // Ist das Element bereits vorhanden? + SbxVariable* pRes = SbxObject::Find( rName, t ); + if( !pRes && t != SbxCLASS_OBJECT ) + { + // sonst suchen + Methods* p = pMethods; + short nIndex = 0; + BOOL bFound = FALSE; + while( p->nArgs != -1 ) + { + if( rName.CompareIgnoreCaseToAscii( p->pName ) == COMPARE_EQUAL ) + { + bFound = TRUE; break; + } + nIndex += ( p->nArgs & _ARGSMASK ) + 1; + p = pMethods + nIndex; + } + if( bFound ) + { + // Args-Felder isolieren: + short nAccess = ( p->nArgs & _RWMASK ) >> 8; + short nType = ( p->nArgs & _TYPEMASK ); + String aName( p->pName, RTL_TEXTENCODING_ASCII_US ); + SbxClassType eCT = SbxCLASS_OBJECT; + if( nType & _PROPERTY ) + eCT = SbxCLASS_PROPERTY; + else if( nType & _METHOD ) + eCT = SbxCLASS_METHOD; + pRes = Make( aName, eCT, p->eType ); + // Wir setzen den Array-Index + 1, da ja noch andere + // Standard-Properties existieren, die auch aktiviert + // werden muessen. + pRes->SetUserData( nIndex + 1 ); + pRes->SetFlags( nAccess ); + } + } + return pRes; +} + +// Aktivierung eines Elements oder Anfordern eines Infoblocks + +void ProcessWrapper::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCT, + const SfxHint& rHint, const TypeId& rHT ) +{ + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbxArray* pPar = pVar->GetParameters(); + USHORT nIndex = (USHORT) pVar->GetUserData(); + // kein Index: weiterreichen! + if( nIndex ) + { + ULONG t = pHint->GetId(); + if( t == SBX_HINT_INFOWANTED ) + pVar->SetInfo( GetInfo( (short) pVar->GetUserData() ) ); + else + { + BOOL bWrite = FALSE; + if( t == SBX_HINT_DATACHANGED ) + bWrite = TRUE; + if( t == SBX_HINT_DATAWANTED || bWrite ) + { + // Parameter-Test fuer Methoden: + USHORT nPar = pMethods[ --nIndex ].nArgs & 0x00FF; + // Element 0 ist der Returnwert + if( ( !pPar && nPar ) + || ( pPar && pPar->Count() < nPar+1 ) ) + SetError( SbxERR_WRONG_ARGS ); + // Alles klar, man kann den Call ausfuehren + else + { + (this->*(pMethods[ nIndex ].pFunc))( pVar, pPar, bWrite ); + } + } + } + } + SbxObject::SFX_NOTIFY( rBC, rBCT, rHint, rHT ); + } +} + +// Zusammenbau der Infostruktur fuer einzelne Elemente + +SbxInfo* ProcessWrapper::GetInfo( short nIdx ) +{ + Methods* p = &pMethods[ nIdx ]; + // Wenn mal eine Hilfedatei zur Verfuegung steht: + // SbxInfo* pInfo = new SbxInfo( Hilfedateiname, p->nHelpId ); + SbxInfo* pInfo = new SbxInfo; + short nPar = p->nArgs & _ARGSMASK; + for( short i = 0; i < nPar; i++ ) + { + p++; + String aName( p->pName, RTL_TEXTENCODING_ASCII_US ); + USHORT nFlags = ( p->nArgs >> 8 ) & 0x03; + if( p->nArgs & _OPT ) + nFlags |= SBX_OPTIONAL; + pInfo->AddParam( aName, p->eType, nFlags ); + } + return pInfo; +} + + +//////////////////////////////////////////////////////////////////////////// + + +//////////////////////////////////////////////////////////////////////////// + +// Properties und Methoden legen beim Get (bPut = FALSE) den Returnwert +// im Element 0 des Argv ab; beim Put (bPut = TRUE) wird der Wert aus +// Element 0 gespeichert. + +// Die Methoden: +void ProcessWrapper::PSetImage( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ) +{ // Imagedatei des Executables + if ( pPar->Count() >= 2 ) + pProcess->SetImage(pPar->Get( 1 )->GetString(), pPar->Get( 2 )->GetString() ); + else + pProcess->SetImage(pPar->Get( 1 )->GetString(), String() ); +} + +void ProcessWrapper::PStart( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ) +{ // Programm wird gestartet + pVar->PutBool( pProcess->Start() ); +} + +void ProcessWrapper::PGetExitCode( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ) +{ // ExitCode des Programms(nachdem es beendet ist) + pVar->PutULong( pProcess->GetExitCode() ); +} + +void ProcessWrapper::PIsRunning( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ) +{ // Programm luft noch + pVar->PutBool( pProcess->IsRunning() ); +} + +void ProcessWrapper::PWasGPF( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ) +{ // Programm mit GPF o.. abgebrochen + pVar->PutBool( pProcess->WasGPF() ); +} + + + + + + +// Die Factory legt unser Objekte an. + +SbxObject* ProcessFactory::CreateObject( const String& rClass ) +{ + if( rClass.CompareIgnoreCaseToAscii( "Process" ) == COMPARE_EQUAL ) + return new ProcessWrapper(); + return NULL; +} + diff --git a/basic/source/app/processw.hxx b/basic/source/app/processw.hxx new file mode 100644 index 000000000000..ea1bff65605a --- /dev/null +++ b/basic/source/app/processw.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: processw.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _PROCESSW_HXX +#define _PROCESSW_HXX + +#ifndef __SBX_SBX_FACTORY_HXX //autogen +#include <svtools/sbxfac.hxx> +#endif +#ifndef __SBX_SBXVARIABLE_HXX //autogen +#include <svtools/sbxvar.hxx> +#endif +#ifndef _SBX_SBXOBJECT_HXX //autogen +#include <svtools/sbxobj.hxx> +#endif +#include "process.hxx" + +class ProcessWrapper : public SbxObject +{ + // Definition eines Tabelleneintrags. Dies wird hier gemacht, + // da dadurch die Methoden und Properties als private deklariert + // werden koennen. +#if defined ( ICC ) || defined ( HPUX ) || defined ( C50 ) +public: +#endif + typedef void( ProcessWrapper::*pMeth ) + ( SbxVariable* pThis, SbxArray* pArgs, BOOL bWrite ); +#if defined ( ICC ) || defined ( HPUX ) +private: +#endif + + struct Methods { + const char* pName; // Name des Eintrags + SbxDataType eType; // Datentyp + short nArgs; // Argumente und Flags + pMeth pFunc; // Function Pointer + }; + static Methods aProcessMethods[]; // Methodentabelle + Methods *pMethods; // Aktuelle Methodentabelle + + // Methoden + void PSetImage( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); + void PStart( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); + void PGetExitCode( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); + void PIsRunning( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); + void PWasGPF( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); + + // Interne Member und Methoden + Process *pProcess; + + // Infoblock auffuellen + SbxInfo* GetInfo( short nIdx ); + + // Broadcaster Notification + virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ); +public: + ProcessWrapper(); + ~ProcessWrapper(); + // Suchen eines Elements + virtual SbxVariable* Find( const String&, SbxClassType ); +}; + + +// Die dazugehoerige Factory: + +class ProcessFactory : public SbxFactory +{ +public: + virtual SbxObject* CreateObject( const String& ); +}; + +#endif diff --git a/basic/source/app/resids.hrc b/basic/source/app/resids.hrc new file mode 100644 index 000000000000..c2d775771892 --- /dev/null +++ b/basic/source/app/resids.hrc @@ -0,0 +1,148 @@ +/************************************************************************* + * + * $RCSfile: resids.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _RESIDS_HRC +#define _RESIDS_HRC + +#define RID_OK 1 +#define RID_CANCEL 2 +#define RID_FILENAME 3 +#define RID_PATHNAME 4 +#define RID_FILELIST 5 +#define RID_DIRSLIST 6 +#define RID_FIND 7 +#define RID_REPLACE 8 +//#define RID_ICON 9 +//#define RID_EDITFIELD 10 +#define RID_TEXT 11 +//#define RID_FRAME1 12 +//#define RID_FRAME2 13 +#define RID_VERSIONSTRING 14 +#define RID_FIXEDTEXT1 15 +#define RID_FIXEDTEXT2 16 + + +// OptionsDialog +#define RES_TC_OPTIONS 20 + +// SpecialOptions +#define RID_TP_SPE 30 +#define GB_DIRECTORIES 31 +#define LOG_TEXT 32 +#define BASIS_TEXT 33 +#define HID_TEXT 34 +#define GB_OTHER 35 +#define TIMEOUT_TEXT 36 +#define LOG_NAME 37 +#define BASIS_NAME 38 +#define HID_NAME 39 +#define LOG_SET 40 +#define BASIS_SET 41 +#define HID_SET 42 +#define SERVER_TIMEOUT 43 +#define CB_AUTORELOAD 44 + + +// GenericOptions +#define RID_TP_GEN 50 +#define RID_GB_AREA 51 +#define RID_CB_AREA 52 +#define RID_PB_NEW_AREA 53 +#define RID_PD_DEL_AREA 54 +#define RID_GB_VALUE 55 +#define RID_CB_VALUE 56 +#define RID_PB_NEW_VALUE 57 +#define RID_PB_DEL_VALUE 58 + +// DisplayHId +#define RID_TB_CONF 70 +#define RID_FT_CONTROLS 71 +#define RID_MLB_CONTROLS 72 +#define RID_FT_SLOTS 73 +#define RID_MLB_SLOTS 74 +#define RID_PB_KOPIEREN 75 +#define RID_PB_BENENNEN 76 +#define RID_PB_SELECTALL 77 +#define RID_OK_CLOSE 78 + + +// BreakpointWindow +#define IMGID_BRKENABLED 80 +#define IMGID_BRKDISABLED 81 +#define IMGID_STEPMARKER 82 +#define IMGID_ERRORMARKER 83 + + +// Edit Variables +#define RID_FT_NAME 90 +#define RID_FT_CONTENT 91 +#define RID_FT_NEW_CONTENT 92 +#define RID_FT_NAME_VALUE 93 +#define RID_FT_CONTENT_VALUE 94 + +#define RID_RB_NEW_BOOL_T 95 +#define RID_RB_NEW_BOOL_F 96 +#define RID_NF_NEW_INTEGER 97 +#define RID_NF_NEW_LONG 98 +#define RID_ED_NEW_STRING 99 + +#endif + diff --git a/basic/source/app/status.cxx b/basic/source/app/status.cxx new file mode 100644 index 000000000000..9e9cd80c47e7 --- /dev/null +++ b/basic/source/app/status.cxx @@ -0,0 +1,157 @@ +/************************************************************************* + * + * $RCSfile: status.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "app.hxx" +#include "basic.hrc" +#include "appwin.hxx" +#include "status.hxx" + +#include <vcl/system.hxx> + +#include <vcl/decoview.hxx> + +StatusLine::StatusLine( BasicFrame* p ) +: TaskBar( p ) +, pFrame( p ) +{ + Show(); +} + +TaskToolBox* StatusLine::CreateTaskToolBox() +{ + TaskToolBox *pTTB = new TaskToolBox( this ); + pTTB->SetActivateTaskHdl( LINK( this, StatusLine, ActivateTask ) ); +// pTTB->Show(); + return pTTB; +} + +TaskStatusBar* StatusLine::CreateTaskStatusBar() +{ + TaskStatusBar* pBar = new TaskStatusBar( this, WB_3DLOOK | WB_BORDER | WB_LEFT ); + USHORT nCharWidth = GetTextWidth( '0' ); // Angenommen, alle Zahlen sind gleich breit + + pBar->InsertItem( ST_MESSAGE, GetTextWidth( 'X' ) * 20, SIB_LEFT | SIB_IN | SIB_AUTOSIZE ); + pBar->InsertItem( ST_LINE, 5*nCharWidth ); + pBar->InsertStatusField(); + return pBar; +} + +void StatusLine::Message( String& s ) +{ + GetStatusBar()->SetItemText( ST_MESSAGE, s ); +} + +void StatusLine::Pos( String& s ) +{ + GetStatusBar()->SetItemText( ST_LINE, s ); +} + +IMPL_LINK( StatusLine, ActivateTask, TaskToolBox*, pTTB ) +{ + USHORT nFirstWinPos=0; + MenuBar* pMenu = pFrame->GetMenuBar(); + PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); + + while ( pWinMenu->GetItemId( nFirstWinPos ) < RID_WIN_FILE1 && nFirstWinPos < pWinMenu->GetItemCount() ) + nFirstWinPos++; + + nFirstWinPos += pTTB->GetItemPos( pTTB->GetCurItemId() ) / 2; + + USHORT x; + x = pTTB->GetItemPos( pTTB->GetCurItemId() ); + x = pWinMenu->GetItemId( nFirstWinPos ); + x = pWinMenu->GetItemCount(); + AppWin* pWin = pFrame->FindWin( pWinMenu->GetItemText( pWinMenu->GetItemId( nFirstWinPos ) ) ); + if ( pWin ) + { + pWin->Minimize( FALSE ); + pWin->ToTop(); + } + return 0; +} + +void StatusLine::LoadTaskToolBox() +{ + USHORT nFirstWinPos=0; + MenuBar* pMenu = pFrame->GetMenuBar(); + PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); + + while ( pWinMenu->GetItemId( nFirstWinPos ) < RID_WIN_FILE1 && nFirstWinPos < pWinMenu->GetItemCount() ) + nFirstWinPos++; + + TaskToolBox* pTaskToolBox = GetTaskToolBox(); + + pTaskToolBox->StartUpdateTask(); + + while ( nFirstWinPos < pWinMenu->GetItemCount() ) + { // Es gibt Fenster + Window* pWin = pFrame->FindWin( pWinMenu->GetItemId( nFirstWinPos ) ); + + if ( pWin ) + pTaskToolBox->UpdateTask( Image(), pWin->GetText(), pWin == pFrame->pList->Last() && !( pFrame->pList->Last()->GetWinState() & TT_WIN_STATE_HIDE ) ); + + nFirstWinPos++; + } + + pTaskToolBox->EndUpdateTask(); +} + + diff --git a/basic/source/app/status.hxx b/basic/source/app/status.hxx new file mode 100644 index 000000000000..d1bc2135c4fd --- /dev/null +++ b/basic/source/app/status.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * $RCSfile: status.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _BASICSTATUS_HXX +#define _BASICSTATUS_HXX + +#ifndef _TASKBAR_HXX +#include <svtools/taskbar.hxx> +#endif +#ifndef _SV_STATUS_HXX +#include <vcl/status.hxx> +#endif + +#define ST_MESSAGE 1 +#define ST_LINE 2 + +class BasicFrame; + +class StatusLine : public TaskBar +{ +protected: + BasicFrame* pFrame; +// virtual TaskButtonBar* CreateButtonBar(); + virtual TaskToolBox* CreateTaskToolBox(); + virtual TaskStatusBar* CreateTaskStatusBar(); + DECL_LINK( ActivateTask, TaskToolBox* ); + +public: + StatusLine( BasicFrame* ); + void Message( String& ); // Text anzeigen + void Pos( String& s ); // Textposition anzeigen + void LoadTaskToolBox(); +}; + +#endif diff --git a/basic/source/app/svtmsg.src b/basic/source/app/svtmsg.src new file mode 100644 index 000000000000..f6231aefe4c5 --- /dev/null +++ b/basic/source/app/svtmsg.src @@ -0,0 +1,1330 @@ +/************************************************************************* + * + * $RCSfile: svtmsg.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#include <svtools/svtmsg.hrc> + + +// Hier sind die Messages aus dem Verzeichnis /basic/source/app enhalten + + +/////////////////////////////// +// Fehlermeldungen, die in das Resultfile gelangen. +// ********************* +// *** !!ACHTUNG!! *** +// ********************* +// Die Nummern drfen sich NIE! ndern, +// da sie in den Resultfiles gespeichert sind, und bei erneutem Anzeigen +// statdessen die entsprechenden neuen oder garkeine Strings angzeigt werden. +/////////////////////////////// +String S_GPF_ABORT +{ + Text = "Programm abgebrochen mit GPF"; + Text[ english_us ] = "Program aborted with GPF"; + Text[ portuguese ] = "Programa abortado com GPF"; + Text[ russian ] = "Program aborted with GPF"; + Text[ greek ] = "Program aborted with GPF"; + Text[ dutch ] = "Programma gestopt met GPF"; + Text[ french ] = "Programme interrompu l'aide de GPF"; + Text[ spanish ] = "Programa interrumpido con GPF"; + Text[ italian ] = "Program aborted with GPF"; + Text[ danish ] = "Program aborted with GPF"; + Text[ swedish ] = "Program aborted with GPF"; + Text[ polish ] = "Przerwanie programu przez GPF"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Program aborted with GPF"; + Text[ korean ] = "α GPF Բ ҵǾϴ."; + Text[ chinese_simplified ] = "Program aborted with GPF"; + Text[ chinese_traditional ] = "Program aborted with GPF"; + Text[ arabic ] = "Program aborted with GPF"; + Text[ turkish ] = "Program aborted with GPF"; +}; +String S_APP_SHUTDOWN +{ + Text = "Applikation wurde Beendet"; + Text[ english_us ] = "Application has been shut down"; + Text[ portuguese ] = "A aplicao foi fechada."; + Text[ russian ] = "Application has been shut down"; + Text[ greek ] = "Application has been shut down"; + Text[ dutch ] = "Applicatie werd beindigd"; + Text[ french ] = "L'application a t arrte."; + Text[ spanish ] = "Se cerr la aplicacin"; + Text[ italian ] = "Application has been shut down"; + Text[ danish ] = "Application has been shut down"; + Text[ swedish ] = "Application has been shut down"; + Text[ polish ] = "Aplikacja zakoczona"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Application has been shut down"; + Text[ korean ] = "α Ǿϴ."; + Text[ chinese_simplified ] = "Application has been shut down"; + Text[ chinese_traditional ] = "Application has been shut down"; + Text[ arabic ] = "Application has been shut down"; + Text[ turkish ] = "Application has been shut down"; +}; +String S_SID_EXECUTE_FAILED_NO_DISPATCHER +{ + Text = "Konnte Slot ID nicht ausfhren: Kein ActiveDispatcher"; + Text[ english_us ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ portuguese ] = "Foi impossvel executar Slot ID: ActiveDispatcher inexistente"; + Text[ russian ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ greek ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ dutch ] = "Kon slot ID niet uitvoeren: geen ActiveDispatcher"; + Text[ french ] = "Impossible d'excuter Slot ID : aucun dispatcheur actif"; + Text[ spanish ] = "No se pudo ejecutar Slot ID. ActiveDispatcher inexistente"; + Text[ italian ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ danish ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ swedish ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ polish ] = "Nie mg wykona Slot ID: Brak ActiveDispatcher"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ korean ] = " ID ۵ ϴ. ActiveDispatcher ϴ."; + Text[ chinese_simplified ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ chinese_traditional ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ arabic ] = "Slot ID cannot be run. No ActiveDispatcher"; + Text[ turkish ] = "Slot ID cannot be run. No ActiveDispatcher"; +}; +String S_SID_EXECUTE_FAILED +{ + Text = "Konnte Slot ID nicht ausfhren"; + Text[ english_us ] = "Slot ID could not be run"; + Text[ portuguese ] = "Impossvel executar Slot ID."; + Text[ russian ] = "Slot ID could not be run"; + Text[ greek ] = "Slot ID could not be run"; + Text[ dutch ] = "Kon slot ID niet uitvoeren"; + Text[ french ] = "Impossible d'excuter Slot ID"; + Text[ spanish ] = "No se pudo ejecutar Slot ID"; + Text[ italian ] = "Slot ID could not be run"; + Text[ danish ] = "Slot ID could not be run"; + Text[ swedish ] = "Slot ID could not be run"; + Text[ polish ] = "Nie mg wykona Slot ID"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Slot ID could not be run"; + Text[ korean ] = " ID ۵ ϴ."; + Text[ chinese_simplified ] = "Slot ID could not be run"; + Text[ chinese_traditional ] = "Slot ID could not be run"; + Text[ arabic ] = "Slot ID could not be run"; + Text[ turkish ] = "Slot ID could not be run"; +}; +String S_UNO_PROPERTY_NITIALIZE_FAILED +{ + Text = "UnoSlot: Konnte Properties nicht initialisieren."; + Text[ english_us ] = "UnoSlot: Properties could not be initialized"; + Text[ portuguese ] = "UnoSlot: impossvel inicializar Properties."; + Text[ russian ] = "UnoSlot: Properties could not be initialized"; + Text[ greek ] = "UnoSlot: Properties could not be initialized"; + Text[ dutch ] = "UnoSlot: kon Properties niet initialiseren"; + Text[ french ] = "UnoSlot : Impossible d'initialiser les proprits."; + Text[ spanish ] = "UnoSlot: No se pudo instalar Properties"; + Text[ italian ] = "UnoSlot: Properties could not be initialized."; + Text[ danish ] = "UnoSlot: Properties could not be initialized"; + Text[ swedish ] = "UnoSlot: Properties could not be initialized"; + Text[ polish ] = "UnoSlot: Nie mg rozpocz Properties."; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "UnoSlot: Properties could not be initialized"; + Text[ korean ] = "UnoSlot: Ӽ ʱȭ ʽϴ."; + Text[ chinese_simplified ] = "UnoSlot: Properties could not be initialized"; + Text[ chinese_traditional ] = "UnoSlot: Properties could not be initialized"; + Text[ arabic ] = "UnoSlot: Properties could not be initialized"; + Text[ turkish ] = "UnoSlot: Properties could not be initialized"; +}; +String S_RESETAPPLICATION_FAILED_COMPLEX +{ + Text = "ResetApplication fehlgeschlagen: Zu komplex"; + Text[ english_us ] = "ResetApplication failed: too complex"; + Text[ portuguese ] = "ResetApplication falhou: demasiado complexa"; + Text[ russian ] = "ResetApplication failed: too complex"; + Text[ greek ] = "ResetApplication failed: too complex"; + Text[ dutch ] = "ResetApplication mislukt: te gecompliceerd"; + Text[ french ] = "chec de ResetApplication : trop complexe"; + Text[ spanish ] = "No se realiz ResetApplication: Demasiado compleja"; + Text[ italian ] = "ResetApplication failed: too complex"; + Text[ danish ] = "ResetApplication failed: too complex"; + Text[ swedish ] = "ResetApplication failed: too complex"; + Text[ polish ] = "ResetApplikation nie powido si: za bardzo zoone"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "ResetApplication failed: too complex"; + Text[ korean ] = "ResetApplication : ʹ մϴ."; + Text[ chinese_simplified ] = "ResetApplication failed: too complex"; + Text[ chinese_traditional ] = "ResetApplication failed: too complex"; + Text[ arabic ] = "ResetApplication failed: too complex"; + Text[ turkish ] = "ResetApplication failed: too complex"; +}; +String S_RESETAPPLICATION_FAILED_UNKNOWN +{ + Text = "ResetApplication fehlgeschlagen: Unbekannter Fenstertyp"; + Text[ english_us ] = "ResetApplication failed: unknown window type"; + Text[ portuguese ] = "ResetApplication falhou: tipo de janela desconhecido"; + Text[ russian ] = "ResetApplication failed: unknown window type"; + Text[ greek ] = "ResetApplication failed: unknown window type"; + Text[ dutch ] = "RestApplication mislukt: onbekend venstertype"; + Text[ french ] = "chec de ResetApplication : type de fentre inconnu"; + Text[ spanish ] = "No se realiz ResetApplication: Tipo desconocido de error"; + Text[ italian ] = "RestApplication failed: unknown window type."; + Text[ danish ] = "ResetApplication failed: unknown window type"; + Text[ swedish ] = "ResetApplication failed: unknown window type"; + Text[ polish ] = "ResetApplikation nie powiodo si: nieznany typ okna"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "ResetApplication failed: unknown window type"; + Text[ korean ] = "ResetApplication : ˼ â Ÿ"; + Text[ chinese_simplified ] = "ResetApplication failed: unknown window type"; + Text[ chinese_traditional ] = "ResetApplication failed: unknown window type"; + Text[ arabic ] = "ResetApplication failed: unknown window type"; + Text[ turkish ] = "ResetApplication failed: unknown window type"; +}; +String S_NO_ACTIVE_WINDOW +{ + Text = "Kein aktives Fenster gefunden (GetNextCloseWindow)"; + Text[ english_us ] = "Active window not found (GetNextCloseWindow)"; + Text[ portuguese ] = "Impossvel encontrar janela activa (GetNextCloseWindow)"; + Text[ russian ] = "Active window not found (GetNextCloseWindow)"; + Text[ greek ] = "Active window not found (GetNextCloseWindow)"; + Text[ dutch ] = "Geen actief venster gevonden (GetNextCloseWindows)"; + Text[ french ] = "Aucune fentre active dtecte (GetNextCloseWindow)"; + Text[ spanish ] = "No se encontr ninguna ventana activa (GetNextCloseWindow)"; + Text[ italian ] = "Active window not found (GetNextCloseWindow)"; + Text[ danish ] = "Active window not found (GetNextCloseWindow)"; + Text[ swedish ] = "Active window not found (GetNextCloseWindow)"; + Text[ polish ] = "Nie znaleziono aktywnego okna (GetNextCloseWindow) "; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Active window not found (GetNextCloseWindow)"; + Text[ korean ] = "Ȱ â ߰ߵ ʽϴ.(GetNextCloseWindow)"; + Text[ chinese_simplified ] = "Active window not found (GetNextCloseWindow)"; + Text[ chinese_traditional ] = "ResetApplication failed: unknown window type"; + Text[ arabic ] = "Active window not found (GetNextCloseWindow)"; + Text[ turkish ] = "Active window not found (GetNextCloseWindow)"; +}; +String S_NO_DIALOG_IN_GETACTIVE +{ + Text = "GetActive liefert keinen Dialog zurck! Bitte Entwicklung informieren"; + Text[ english_us ] = "GetActive does not show a dialog! Inform development."; + Text[ portuguese ] = "GetActive no devolve nenhuma caixa de dilogo! Informe o departamento de programao."; + Text[ russian ] = "GetActive does not deliver a dialog! Inform development."; + Text[ greek ] = "GetActive does not deliver a dialog! Inform development."; + Text[ dutch ] = "GetActive levert geen dialoog terug! Ontwikkeling informeren!"; + Text[ french ] = "GetActive ne fournit aucune bote de dialogue ! Veuillez informer le service de dveloppement."; + Text[ spanish ] = "GetActive no devuelve ningn dilogo! Informe por favor al servicio de programacin"; + Text[ italian ] = "GetActive does not deliver a dialog! Inform development."; + Text[ danish ] = "GetActive does not deliver a dialog! Inform development."; + Text[ swedish ] = "GetActive does not deliver a dialog! Inform development."; + Text[ polish ] = "GetActive nie wysya z powrotem adnego dialogu! Prosz powiadomi o tym oddzia programowania."; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "GetActive does not deliver a dialog! Inform development."; + Text[ korean ] = "GetActive does not deliver a dialog! Inform development."; + Text[ chinese_simplified ] = "GetActive does not deliver a dialog! Inform development."; + Text[ chinese_traditional ] = "GetActive does not deliver a dialog! Inform development."; + Text[ arabic ] = "GetActive does not deliver a dialog! Inform development."; + Text[ turkish ] = "GetActive does not deliver a dialog! Inform development."; +}; +String S_NO_POPUP +{ + Text = "Kein PopupMenu geffnet"; + Text[ english_us ] = "PopUp menu not open"; + Text[ portuguese ] = "PopupMenu no est aberto"; + Text[ russian ] = "PopUp menu not open"; + Text[ greek ] = "PopUp menu not open"; + Text[ dutch ] = "Geen PopUpMenu geopend"; + Text[ french ] = "Aucun menu Pop-Up ouvert"; + Text[ spanish ] = "No existe ningn PopupMenu abierto"; + Text[ italian ] = "PopUp menu not open"; + Text[ danish ] = "PopUp menu not open"; + Text[ swedish ] = "PopUp menu not open"; + Text[ polish ] = "Nie otworzono adnego menu Popup"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "PopUp menu not open"; + Text[ korean ] = "˾ ʽϴ."; + Text[ chinese_simplified ] = "PopUp menu not open"; + Text[ chinese_traditional ] = "PopUp menu not open"; + Text[ arabic ] = "PopUp menu not open"; + Text[ turkish ] = "PopUp menu not open"; +}; +String S_NO_SUBMENU +{ + Text = "Untermen nicht vorhanden"; + Text[ english_us ] = "Submenu does not exist"; + Text[ portuguese ] = "Submenu inexistente"; + Text[ russian ] = "Submenu does not exist"; + Text[ greek ] = "Submenu does not exist"; + Text[ dutch ] = "Submenu niet voorhanden"; + Text[ french ] = "Sous-menu inexistant"; + Text[ spanish ] = "Submen inexistente"; + Text[ italian ] = "Submenu does not exists"; + Text[ danish ] = "Submenu does not exist"; + Text[ swedish ] = "Submenu does not exist"; + Text[ polish ] = "Menu podrzdne nie istnieje"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Submenu does not exist"; + Text[ korean ] = " ϴ."; + Text[ chinese_simplified ] = "Submenu does not exist"; + Text[ chinese_traditional ] = "Submenu does not exist"; + Text[ arabic ] = "Submenu does not exist"; + Text[ turkish ] = "Submenu does not exist"; +}; +String S_CONTROLTYPE_NOT_SUPPORTED +{ + Text = "ControlType ($Arg1) wird nicht untersttzt"; + Text[ english_us ] = "ControlType ($Arg1) is not supported"; + Text[ portuguese ] = "ControlType ($Arg1) no tem suporte"; + Text[ russian ] = "ControlType ($Arg1) is not supported"; + Text[ greek ] = "ControlType ($Arg1) is not supported"; + Text[ dutch ] = "ControlType ($Arg1) wordt niet ondersteund"; + Text[ french ] = "ControlType ($Arg1) non support"; + Text[ spanish ] = "No se apoya ControlType ($Arg1)"; + Text[ italian ] = "ControlType ($Arg1) is not supported"; + Text[ danish ] = "ControlType ($Arg1) is not supported"; + Text[ swedish ] = "ControlType ($Arg1) is not supported"; + Text[ polish ] = "ControlType ($Arg1) nie jest obsugiwany"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "ControlType ($Arg1) is not supported"; + Text[ korean ] = "ControlType ($Arg1) ʽϴ."; + Text[ chinese_simplified ] = "ControlType ($Arg1) is not supported"; + Text[ chinese_traditional ] = "ControlType ($Arg1) is not supported"; + Text[ arabic ] = "ControlType ($Arg1) is not supported"; + Text[ turkish ] = "ControlType ($Arg1) is not supported"; +}; +String S_SELECTION_BY_ATTRIBUTE_ONLY_DIRECTORIES +{ + Text = "Selektion nach Attributen nur fr Directories mglich."; + Text[ english_us ] = "Selection by attributes only possible for directories"; + Text[ portuguese ] = "A seleco por atributos somente possvel para directrios."; + Text[ russian ] = "Selection by attributes only possible for directories"; + Text[ greek ] = "Selection by attributes only possible for directories"; + Text[ dutch ] = "Selectie naar attributen alleen voor directory's mogelijk."; + Text[ french ] = "La slection en fonction des attributs n'est possible que pour les rpertoires."; + Text[ spanish ] = "La seleccin por atributos es solo posible para directorios."; + Text[ italian ] = "Selection by attributes only possible for directories"; + Text[ danish ] = "Selection by attributes only possible for directories"; + Text[ swedish ] = "Selection by attributes only possible for directories"; + Text[ polish ] = "Selekcja wedug atrybutw moliwa jest tylko w wypadku katalogw."; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Selection by attributes only possible for directories"; + Text[ korean ] = "Ӽ 丮 մϴ."; + Text[ chinese_simplified ] = "Selection by attributes only possible for directories"; + Text[ chinese_traditional ] = "Selection by attributes only possible for directories"; + Text[ arabic ] = "Selection by attributes only possible for directories"; + Text[ turkish ] = "Selection by attributes only possible for directories"; +}; +String S_NO_MORE_FILES +{ + Text = "Keine weiteren Dateien"; + Text[ english_us ] = "No further files"; + Text[ portuguese ] = "No existem outros ficheiros"; + Text[ russian ] = "No further files"; + Text[ greek ] = "No further files"; + Text[ dutch ] = "Geen verdere bestanden"; + Text[ french ] = "Aucun autre fichier"; + Text[ spanish ] = "Ningn otro archivo"; + Text[ italian ] = "No further files"; + Text[ danish ] = "No further files"; + Text[ swedish ] = "No further files"; + Text[ polish ] = "Brak innych plikw"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "No further files"; + Text[ korean ] = " ̻ ϴ."; + Text[ chinese_simplified ] = "No further files"; + Text[ chinese_traditional ] = "No further files"; + Text[ arabic ] = "No further files"; + Text[ turkish ] = "No further files"; +}; +String S_UNKNOWN_METHOD +{ + Text = "Unbekannte Methode '($Arg1)' an ($Arg2)"; + Text[ english_us ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ portuguese ] = "Mtodo desconhecido ($Arg1) para ($Arg2)"; + Text[ russian ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ greek ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ dutch ] = "Onbekende methode '($Arg1)' aan ($Arg2)"; + Text[ french ] = "Mthode inconnue '($Arg1)' vers ($Arg2)"; + Text[ spanish ] = "Mtodo desconocido '($Arg1)' a ($Arg2)"; + Text[ italian ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ danish ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ swedish ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ polish ] = "Nieznana metoda '($Arg1)' do ($Arg2)"; + Text[ portuguese_brazilian ] = "Unbekannte Methode an Objekt : ($Arg1).($Arg2)"; + Text[ japanese ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ korean ] = "($Arg2) '($Arg1)'"; + Text[ chinese_simplified ] = "($Arg2)ϲķ'($Arg1)'"; + Text[ chinese_traditional ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ arabic ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ turkish ] = "Unknown method '($Arg1)' to ($Arg2)"; +}; +String S_INVALID_PARAMETERS +{ + Text = "Ungltige Parameter"; + Text[ english_us ] = "Invalid Parameters"; + Text[ portuguese ] = "Parmetros no vlidos"; + Text[ russian ] = "Invalid Parameters"; + Text[ greek ] = "Invalid Parameters"; + Text[ dutch ] = "Ongeldige parameters"; + Text[ french ] = "Paramtres incorrects"; + Text[ spanish ] = "Parmetros incorrectos"; + Text[ italian ] = "Invalid parameters"; + Text[ danish ] = "Invalid Parameters"; + Text[ swedish ] = "Invalid Parameters"; + Text[ polish ] = "Nieprawidowe parametry"; + Text[ portuguese_brazilian ] = "Invalid Parameters"; + Text[ japanese ] = "Invalid Parameters"; + Text[ korean ] = "ȿ Ķ"; + Text[ chinese_simplified ] = "Invalid Parameters"; + Text[ chinese_traditional ] = "Invalid Parameters"; + Text[ arabic ] = "Invalid Parameters"; + Text[ turkish ] = "Invalid Parameters"; +}; +String S_POINTER_OUTSIDE_APPWIN +{ + Text = "Pointer nicht innerhalb des Applikationsfensters bei '($Arg1)'"; + Text[ english_us ] = "Pointer not located in application window at '($Arg1)'"; + Text[ portuguese ] = "O ponteiro no est dentro da janela de aplicao em '($Arg1)'"; + Text[ russian ] = "Pointer not located in application window at '($Arg1)'"; + Text[ greek ] = "Pointer not located in application window at '($Arg1)'"; + Text[ dutch ] = "Pointer niet in applicatievenster bij '($Arg1)'"; + Text[ french ] = "Pointeur en dehors de la fentre de l'application pour '($Arg1)'"; + Text[ spanish ] = "Pointer fuera de la ventana de aplicacin en '($Arg1)'"; + Text[ italian ] = "Pointer not located in application window at '($Arg1)'"; + Text[ danish ] = "Pointer not located in application window at '($Arg1)'"; + Text[ swedish ] = "Pointer not located in application window at '($Arg1)'"; + Text[ polish ] = "Pointer poza obszarem okna aplikacji przy '($Arg1)' "; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Pointer not located in application window at '($Arg1)'"; + Text[ korean ] = " α â '($Arg1)' Ͱ ϴ."; + Text[ chinese_simplified ] = "Pointer not located in application window at '($Arg1)'"; + Text[ chinese_traditional ] = "Pointer not located in application window at '($Arg1)'"; + Text[ arabic ] = "Pointer not located in application window at '($Arg1)'"; + Text[ turkish ] = "Pointer not located in application window at '($Arg1)'"; +}; +String S_UNKNOWN_COMMAND +{ + Text = "Unbekannter Befehl '($Arg1)'"; + Text[ english_us ] = "Unknown command '($Arg1)'"; + Text[ portuguese ] = "Comando desconhecido '($Arg1)'"; + Text[ russian ] = "Unknown command '($Arg1)'"; + Text[ greek ] = "Unknown command '($Arg1)'"; + Text[ dutch ] = "Onbekende opdracht '($Arg1)'"; + Text[ french ] = "Commande inconnue '($Arg1)'"; + Text[ spanish ] = "Error desconocido '($Arg1)'"; + Text[ italian ] = "Unknown command '($Arg1)'"; + Text[ danish ] = "Unknown command '($Arg1)'"; + Text[ swedish ] = "Unknown command '($Arg1)'"; + Text[ polish ] = "Nieznane polecenie ($Arg1)"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Unknown command '($Arg1)'"; + Text[ korean ] = "˼ ɾ '($Arg1)'"; + Text[ chinese_simplified ] = "Unknown command '($Arg1)'"; + Text[ chinese_traditional ] = "Unknown command '($Arg1)'"; + Text[ arabic ] = "Unknown command '($Arg1)'"; + Text[ turkish ] = "Unknown command '($Arg1)'"; +}; +String S_WIN_NOT_FOUND +{ + Text = "Konnte ($Arg1) nicht finden."; + Text[ english_us ] = "($Arg1) could not be found"; + Text[ portuguese ] = "Foi impossvel encontrar ($Arg1)."; + Text[ russian ] = "($Arg1) could not be found"; + Text[ greek ] = "($Arg1) could not be found"; + Text[ dutch ] = "Kon ($Arg1) niet vinden"; + Text[ french ] = "($Arg1) introuvable"; + Text[ spanish ] = "No se pudo encontrar ($Arg1)"; + Text[ italian ] = "($Arg1) could not be found."; + Text[ danish ] = "($Arg1) could not be found"; + Text[ swedish ] = "($Arg1) could not be found"; + Text[ polish ] = "($Arg1) could not be found"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "($Arg1) could not be found"; + Text[ korean ] = "($Arg1) ߰ߵ ʽϴ."; + Text[ chinese_simplified ] = "($Arg1) could not be found."; + Text[ chinese_traditional ] = "($Arg1) could not be found"; + Text[ arabic ] = "($Arg1) could not be found"; + Text[ turkish ] = "($Arg1) could not be found"; +}; +String S_WIN_INVISIBLE +{ + Text = "($Arg1) ist unsichtbar."; + Text[ english_us ] = "($Arg1) is not visible"; + Text[ portuguese ] = "($Arg1) invisvel."; + Text[ russian ] = "($Arg1) is not visible"; + Text[ greek ] = "($Arg1) is not visible"; + Text[ dutch ] = "($Arg1) is onzichtbaar"; + Text[ french ] = "($Arg1) invisible"; + Text[ spanish ] = "No se puede ver ($Arg1)."; + Text[ italian ] = "$Arg1) is not visible"; + Text[ danish ] = "($Arg1) is not visible"; + Text[ swedish ] = "($Arg1) is not visible"; + Text[ polish ] = "($Arg1) is not visible "; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "($Arg1) is not visible"; + Text[ korean ] = "($Arg1) ʽϴ."; + Text[ chinese_simplified ] = "($Arg1) is not visible."; + Text[ chinese_traditional ] = "($Arg1) is not visible"; + Text[ arabic ] = "($Arg1) is not visible"; + Text[ turkish ] = "($Arg1) is not visible"; +}; +String S_WIN_DISABLED +{ + Text = "Konnte auf ($Arg1) nicht zugreifen."; + Text[ english_us ] = "(Arg1) could not be accessed"; + Text[ portuguese ] = "Impossvel o acesso a ($Arg1)."; + Text[ russian ] = "(Arg1) could not be accessed"; + Text[ greek ] = "(Arg1) could not be accessed"; + Text[ dutch ] = "Geen toegang tot ($Arg1)"; + Text[ french ] = "Accs ($Arg1) impossible"; + Text[ spanish ] = "No se pudo acceder a ($Arg1)"; + Text[ italian ] = "(Arg1) could not be accessed."; + Text[ danish ] = "(Arg1) could not be accessed"; + Text[ swedish ] = "(Arg1) could not be accessed"; + Text[ polish ] = "(Arg1) could not be accessed "; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "(Arg1) could not be accessed"; + Text[ korean ] = "(Arg1) Ҽ ϴ."; + Text[ chinese_simplified ] = "(Arg1) could not be accessed."; + Text[ chinese_traditional ] = "(Arg1) could not be accessed."; + Text[ arabic ] = "(Arg1) could not be accessed"; + Text[ turkish ] = "(Arg1) could not be accessed"; +}; +String S_NUMBER_TOO_BIG +{ + Text = "Eintragsnummer ($Arg2) zu gro in ($Arg1). Maximum ist ($Arg3)"; + Text[ english_us ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ portuguese ] = "O nmero da entrada ($Arg2) muito elevado em ($Arg1). O mximo ($Arg3)"; + Text[ russian ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ greek ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ dutch ] = "Nummer voor ($Arg2) te hoog in ($Arg1). Maximum is ($Arg3)"; + Text[ french ] = "Le numro d'entre ($Arg2) est trop lev pour ($Arg1). Le maximum possible est ($Arg3)"; + Text[ spanish ] = "Nm. de entradas ($Arg2) es demasiado grande en ($Arg1). El mximo es ($Arg3)"; + Text[ italian ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ danish ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ swedish ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ polish ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ korean ] = "($Arg1) ȣ($Arg2) ʹ Ůϴ. ִ밪 ($Arg3)Դϴ."; + Text[ chinese_simplified ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)."; + Text[ chinese_traditional ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ arabic ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; + Text[ turkish ] = "Entry number ($Arg2) is too large in ($Arg1). Max. allowed is ($Arg3)"; +}; +String S_NUMBER_TOO_SMALL +{ + Text = "Eintragsnummer ($Arg2) zu klein in ($Arg1). Minimum ist ($Arg3)"; + Text[ english_us ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ portuguese ] = "O nmero da entrada ($Arg2) muito baixo em ($Arg1). O mnimo ($Arg3)"; + Text[ russian ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ greek ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ dutch ] = "Nummer voor ($Arg2) te laag in ($Arg1). Minimum is ($Arg3)"; + Text[ french ] = "Le numro d'entre ($Arg2) est trop bas pour ($Arg1). Le minimum possible est ($Arg3)"; + Text[ spanish ] = "Nm. de entradas ($Arg2) es demasiado pequeo en ($Arg1). El mnimo es ($Arg3)"; + Text[ italian ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ danish ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ swedish ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ polish ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ korean ] = "($Arg1) ȣ($Arg2) ʹ ۽ϴ. ּҰ ($Arg3)Դϴ."; + Text[ chinese_simplified ] = "The entry number ($Arg2) is too small in ($Arg1). Min. allowed is ($Arg3)."; + Text[ chinese_traditional ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ arabic ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; + Text[ turkish ] = "The entry number ($Arg2) is too small in ($Arg1). Min allowed is ($Arg3)"; +}; +String S_WINDOW_DISAPPEARED +{ + Text = "Window zwischenzeitlich verschwunden bei ($Arg1)"; + Text[ english_us ] = "Window momentarily not visible at ($Arg1)"; + Text[ portuguese ] = "Desaparecimento momentneo da janela em ($Arg1)"; + Text[ russian ] = "Window momentarily not visible at ($Arg1)"; + Text[ greek ] = "Window momentarily not visible at ($Arg1)"; + Text[ dutch ] = "Windows momenteel niet zichtbaar bij ($Arg1)"; + Text[ french ] = "Disparition momentane de la fentre ($Arg1)"; + Text[ spanish ] = "Desaparacin momentnea de Windows en ($Arg1)"; + Text[ italian ] = "Window momentarily not visible at ($Arg1)"; + Text[ danish ] = "Window momentarily not visible at ($Arg1)"; + Text[ swedish ] = "Window momentarily not visible at ($Arg1)"; + Text[ polish ] = "Window momentarily not visible at ($Arg1)"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Window momentarily not visible at ($Arg1)"; + Text[ korean ] = "Window ($Arg1) "; + Text[ chinese_simplified ] = "Window momentarily not visible at ($Arg1)"; + Text[ chinese_traditional ] = "Window momentarily not visible at ($Arg1)"; + Text[ arabic ] = "Window momentarily not visible at ($Arg1)"; + Text[ turkish ] = "Window momentarily not visible at ($Arg1)"; +}; +String S_ERROR_SAVING_IMAGE +{ + Text = "Fehler #($Arg1) beim Speichern des Bildes"; + Text[ english_us ] = "Error #($Arg1) when saving the image"; + Text[ portuguese ] = "Erro #($Arg1) ao guardar a imagem"; + Text[ russian ] = "Error #($Arg1) when saving the image"; + Text[ greek ] = "Error #($Arg1) when saving the image"; + Text[ dutch ] = "Fout #($Arg1) bij opslaan van afbeelding"; + Text[ french ] = "Erreur #($Arg1) lors de l'enregistrement de l'image"; + Text[ spanish ] = "Error #($Arg1) al guardar la imagen"; + Text[ italian ] = "Error #($Arg1) when saving the image"; + Text[ danish ] = "Error #($Arg1) when saving the image"; + Text[ swedish ] = "Error #($Arg1) when saving the image"; + Text[ polish ] = "Error #($Arg1) when saving the image"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Error #($Arg1) when saving the image"; + Text[ korean ] = "̹ #($Arg1)"; + Text[ chinese_simplified ] = "Error #($Arg1) when saving the image"; + Text[ chinese_traditional ] = "Error #($Arg1) when saving the image"; + Text[ arabic ] = "Error #($Arg1) when saving the image"; + Text[ turkish ] = "Error #($Arg1) when saving the image"; +}; +String S_INVALID_POSITION +{ + Text = "Ungltige Positionsangabe bei ($Arg1)"; + Text[ english_us ] = "Invalid positon at ($Arg1)"; + Text[ portuguese ] = "Posio indicada incorrectamente em ($Arg1)"; + Text[ russian ] = "Invalid positon at ($Arg1)"; + Text[ greek ] = "Invalid positon at ($Arg1)"; + Text[ dutch ] = "Omgeldige positie aangegeven bij ($Arg1)"; + Text[ french ] = "Erreur d'indication de l'emplacement de ($Arg1)"; + Text[ spanish ] = "Posicin indicada incorrecta en ($Arg1)"; + Text[ italian ] = "Invalid positon at ($Arg1)"; + Text[ danish ] = "Invalid positon at ($Arg1)"; + Text[ swedish ] = "Invalid positon at ($Arg1)"; + Text[ polish ] = "Invalid positon at ($Arg1)"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Invalid positon at ($Arg1)"; + Text[ korean ] = "($Arg1) ȿ ġ"; + Text[ chinese_simplified ] = "Invalid positon at ($Arg1)"; + Text[ chinese_traditional ] = "Invalid positon at ($Arg1)"; + Text[ arabic ] = "Invalid positon at ($Arg1)"; + Text[ turkish ] = "Invalid positon at ($Arg1)"; +}; +String S_SPLITWIN_NOT_FOUND +{ + Text = "Konnte SplitWindow nicht finden bei ($Arg1)"; + Text[ english_us ] = "Split window not found at ($Arg1)"; + Text[ portuguese ] = "Foi impossvel encontrar SplitWindow em ($Arg1)"; + Text[ russian ] = "Split window not found at ($Arg1)"; + Text[ greek ] = "Split window not found at ($Arg1)"; + Text[ dutch ] = "Kon SplitWindow niet vinden bij ($Arg1)"; + Text[ french ] = "SplitWindow introuvable pour ($Arg1)"; + Text[ spanish ] = "No se pudo encontrar SplitWindow en ($Arg1)"; + Text[ italian ] = "Split window not found at ($Arg1)"; + Text[ danish ] = "Split window not found at ($Arg1)"; + Text[ swedish ] = "Split window not found at ($Arg1)"; + Text[ polish ] = "Split window not found at ($Arg1)"; + Text[ portuguese_brazilian ] = "Programmstart: ($Arg1); ($Arg2)"; + Text[ japanese ] = "Split window not found at ($Arg1)"; + Text[ korean ] = "SplitWindow ($Arg1) ã "; + Text[ chinese_simplified ] = "Split window not found at ($Arg1)"; + Text[ chinese_traditional ] = "Split window not found at ($Arg1)"; + Text[ arabic ] = "Split window not found at ($Arg1)"; + Text[ turkish ] = "Split window not found at ($Arg1)"; +}; +String S_INTERNAL_ERROR +{ + Text = "Interner Fehler bei ($Arg1)"; + Text[ english_us ] = "Internal error at ($Arg1)"; + Text[ portuguese ] = "Erro interno em ($Arg1)"; + Text[ russian ] = "Internal error at ($Arg1)"; + Text[ greek ] = "Internal error at ($Arg1)"; + Text[ dutch ] = "Interne fout bij ($Arg1)"; + Text[ french ] = "Erreur interne pour ($Arg1)"; + Text[ spanish ] = "Error interno en ($Arg1)"; + Text[ italian ] = "Internal error at ($Arg1)"; + Text[ danish ] = "Internal error at ($Arg1)"; + Text[ swedish ] = "Internal error at ($Arg1)"; + Text[ polish ] = "Internal error at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Internal error at ($Arg1)"; + Text[ korean ] = "($Arg1) "; + Text[ chinese_simplified ] = "Internal error at ($Arg1)"; + Text[ chinese_traditional ] = "Internal error at ($Arg1)"; + Text[ arabic ] = "Internal error at ($Arg1)"; + Text[ turkish ] = "Internal error at ($Arg1)"; +}; +String S_NO_STATUSBAR +{ + Text = "Keine StatusBar vorhanden bei ($Arg1)"; + Text[ english_us ] = "No status bar at ($Arg1)"; + Text[ portuguese ] = "Barra de estado em ($Arg1) inexistente"; + Text[ russian ] = "No status bar at ($Arg1)"; + Text[ greek ] = "No status bar at ($Arg1)"; + Text[ dutch ] = "Geen StatusBar voorhanden bij ($Arg1)"; + Text[ french ] = "Absence de barre d'tat pour ($Arg1) "; + Text[ spanish ] = "No existe StatusBar en ($Arg1)"; + Text[ italian ] = "No status bar at ($Arg1)"; + Text[ danish ] = "No status bar at ($Arg1)"; + Text[ swedish ] = "No status bar at ($Arg1)"; + Text[ polish ] = "No status bar at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "No status bar at ($Arg1)"; + Text[ korean ] = "($Arg1) ٰ ϴ."; + Text[ chinese_simplified ] = "No status bar at ($Arg1)"; + Text[ chinese_traditional ] = "No status bar at ($Arg1)"; + Text[ arabic ] = "No status bar at ($Arg1)"; + Text[ turkish ] = "No status bar at ($Arg1)"; +}; +String S_ITEMS_INVISIBLE +{ + Text = "Die Items sind ausgeblendet bei ($Arg1)"; + Text[ english_us ] = "The items are hidden at ($Arg1)"; + Text[ portuguese ] = "Os items em ($Arg1) esto ocultos"; + Text[ russian ] = "The items are hidden at ($Arg1)"; + Text[ greek ] = "The items are hidden at ($Arg1)"; + Text[ dutch ] = "De items zijn verborgen bij ($Arg1)"; + Text[ french ] = "Les Items sont masqus pour ($Arg1)"; + Text[ spanish ] = "Los tems en ($Arg1) estn ocultos"; + Text[ italian ] = "The items are hidden at ($Arg1)"; + Text[ danish ] = "The items are hidden at ($Arg1)"; + Text[ swedish ] = "The items are hidden at ($Arg1)"; + Text[ polish ] = "The items are hidden at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "The items are hidden at ($Arg1)"; + Text[ korean ] = "($Arg1) ֽϴ."; + Text[ chinese_simplified ] = "The items are hidden at ($Arg1)"; + Text[ chinese_traditional ] = "The items are hidden at ($Arg1)"; + Text[ arabic ] = "The items are hidden at ($Arg1)"; + Text[ turkish ] = "The items are hidden at ($Arg1)"; +}; +String S_TABPAGE_NOT_FOUND +{ + Text = "Tabpage nicht gefunden bei ($Arg1)"; + Text[ english_us ] = "Tab page not found at ($Arg1)"; + Text[ portuguese ] = "Foi impossvel encontrar o separador em ($Arg1)"; + Text[ russian ] = "Tab page not found at ($Arg1)"; + Text[ greek ] = "Tab page not found at ($Arg1)"; + Text[ dutch ] = "Tabpage niet gevonden bij ($Arg1"; + Text[ french ] = "Tabpage introuvable pour ($Arg1)"; + Text[ spanish ] = "No se encontr tabpage en ($Arg1)"; + Text[ italian ] = "Tab page not found at ($Arg1)"; + Text[ danish ] = "Tab page not found at ($Arg1)"; + Text[ swedish ] = "Tab page not found at ($Arg1)"; + Text[ polish ] = "Tab page not found at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Tab page not found at ($Arg1)"; + Text[ korean ] = "($Arg1) ߰ߵ ʽϴ."; + Text[ chinese_simplified ] = "Tab page not found at ($Arg1)"; + Text[ chinese_traditional ] = "Tab page not found at ($Arg1)"; + Text[ arabic ] = "Tab page not found at ($Arg1)"; + Text[ turkish ] = "Tab page not found at ($Arg1)"; +}; +String S_TRISTATE_NOT_ALLOWED +{ + Text = "Tristate darf nicht gesetzt werden bei ($Arg1)"; + Text[ english_us ] = "Three state cannot be set at ($Arg1)"; + Text[ portuguese ] = "Impossvel indicar um valor \"tristate\" em ($Arg1)"; + Text[ russian ] = "Three state cannot be set at ($Arg1)"; + Text[ greek ] = "Three state cannot be set at ($Arg1)"; + Text[ dutch ] = "Tristate mag niet worden gezet bij ($Arg1)"; + Text[ french ] = "Impossible de placer une valeur Tristate pour ($Arg1)"; + Text[ spanish ] = "No se pude aplicar tristate en ($Arg1)"; + Text[ italian ] = "Three state cannot be set at ($Arg1)"; + Text[ danish ] = "Three state cannot be set at ($Arg1)"; + Text[ swedish ] = "Three state cannot be set at ($Arg1)"; + Text[ polish ] = "Three state cannot be set at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Three state cannot be set at ($Arg1)"; + Text[ korean ] = " ° ($Arg1) ϴ."; + Text[ chinese_simplified ] = "Three state cannot be set at ($Arg1)"; + Text[ chinese_traditional ] = "Three state cannot be set at ($Arg1)"; + Text[ arabic ] = "Three state cannot be set at ($Arg1)"; + Text[ turkish ] = "Three state cannot be set at ($Arg1)"; + Text[ language_user1 ] = " "; +}; +String S_ERROR_IN_SET_TEXT +{ + Text = "SetText hat nicht funktioniert"; + Text[ english_us ] = "Set text did not function"; + Text[ portuguese ] = "SetText no funcionou"; + Text[ russian ] = "Set text did not function"; + Text[ greek ] = "Set text did not function"; + Text[ dutch ] = "SetText heeft niet gefunctioneerd"; + Text[ french ] = "SetText n'a pas fonctionn"; + Text[ spanish ] = "No ha funcionado SetText"; + Text[ italian ] = "Set text did not function"; + Text[ danish ] = "Set text did not function"; + Text[ swedish ] = "Set text did not function"; + Text[ polish ] = "Set text did not function"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Set text did not function"; + Text[ korean ] = "ؽƮ ۵ ʽϴ."; + Text[ chinese_simplified ] = "Set text did not function"; + Text[ chinese_traditional ] = "Set text did not function"; + Text[ arabic ] = "Set text did not function"; + Text[ turkish ] = "Set text did not function"; +}; +String S_ATTEMPT_TO_WRITE_READONLY +{ + Text = "Schreibversuch auf ReadOnly ($Arg1)"; + Text[ english_us ] = "Attempt to write on read-only ($Arg1)"; + Text[ portuguese ] = "Tentativa de escrita em ($Arg1) como s leitura"; + Text[ russian ] = "Attempt to write on read-only ($Arg1)"; + Text[ greek ] = "Attempt to write on read-only ($Arg1)"; + Text[ dutch ] = "Schrijfpoging op ReadOnly ($Arg1)"; + Text[ french ] = "Tentative d'citure sur ($Arg1) (en lecture seule)"; + Text[ spanish ] = "Intento de escritura en ReadOnly ($Arg1)"; + Text[ italian ] = "Attempt to write on read-only ($Arg1)"; + Text[ danish ] = "Attempt to write on read-only ($Arg1)"; + Text[ swedish ] = "Attempt to write on read-only ($Arg1)"; + Text[ polish ] = "Attempt to write on read-only ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Attempt to write on read-only ($Arg1)"; + Text[ korean ] = "б ($Arg1) ⸦ õ"; + Text[ chinese_simplified ] = "Attempt to write on read-only ($Arg1)"; + Text[ chinese_traditional ] = "Attempt to write on read-only ($Arg1)"; + Text[ arabic ] = "Attempt to write on read-only ($Arg1)"; + Text[ turkish ] = "Attempt to write on read-only ($Arg1)"; +}; +String S_NO_SELECT_FALSE +{ + Text = "Select FALSE nicht erlaubt. Bitte MultiSelect verwenden bei ($Arg1)"; + Text[ english_us ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ portuguese ] = "Interdito seleccionar FALSE. Utilizar MultiSelect em ($Arg1)"; + Text[ russian ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ greek ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ dutch ] = "Select FALSE niet toegestaan. Gebruik MultiSelect bij ($Arg1)"; + Text[ french ] = "Interdit de slectionner FALSE. Veuillez utiliser MultiSelect pour ($Arg1)"; + Text[ spanish ] = "No se permite Select FALSE. Use MultiSelect en ($Arg1)"; + Text[ italian ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ danish ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ swedish ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ polish ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ korean ] = "FALSE ʽϴ. ($Arg1) ."; + Text[ chinese_simplified ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ chinese_traditional ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ arabic ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; + Text[ turkish ] = "Select FALSE not allowed. Use MultiSelect at ($Arg1)"; +}; +String S_ENTRY_NOT_FOUND +{ + Text = "Eintrag \"($Arg2)\" bei ($Arg1) nicht gefunden"; + Text[ english_us ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ portuguese ] = "Foi impossvel encontrar a entrada \"($Arg2) em ($Arg1)"; + Text[ russian ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ greek ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ dutch ] = "Optie ($Arg2) niet gevonden bij ($Arg1)"; + Text[ french ] = "Entre \"($Arg2)\" introuvable pour ($Arg1)"; + Text[ spanish ] = "No se encontr entrada \"($Arg2)\" en ($Arg1)"; + Text[ italian ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ danish ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ swedish ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ polish ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ korean ] = "\"($Arg2)\" ($Arg1) ߰ߵ ʽϴ."; + Text[ chinese_simplified ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ chinese_traditional ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ arabic ] = "\"($Arg2)\" entry at ($Arg1) not found"; + Text[ turkish ] = "\"($Arg2)\" entry at ($Arg1) not found"; +}; +String S_METHOD_FAILED +{ + Text = "($Arg1) von Eintrag \"($Arg2)\" ist fehlgeschlagen"; + Text[ english_us ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ portuguese ] = "($Arg1) da entrada \"($Arg2)\" falhou"; + Text[ russian ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ greek ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ dutch ] = "($Arg1) van optie ($Arg2) mislukt"; + Text[ french ] = "($Arg1) a chou pour l'entre \"($Arg2)\" "; + Text[ spanish ] = "No result ($Arg1) de la entrada \"($Arg2)\""; + Text[ italian ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ danish ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ swedish ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ polish ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ korean ] = "\"($Arg2)\" ($Arg1) ߸ƽϴ."; + Text[ chinese_simplified ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ chinese_traditional ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ arabic ] = "($Arg1) of entry \"($Arg2)\" failed"; + Text[ turkish ] = "($Arg1) of entry \"($Arg2)\" failed"; +}; +String S_HELPID_ON_TOOLBOX_NOT_FOUND +{ + Text = "HelpID auf ToolBox nicht gefunden bei ($Arg1)"; + Text[ english_us ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ portuguese ] = "Impossvel encontrar o HelpID da ToolBox em ($Arg1)"; + Text[ russian ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ greek ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ dutch ] = "HelpID op ToolBox niet gevonden bij ($Arg1)"; + Text[ french ] = "HelpID de la ToolBox introuvable pour ($Arg1)"; + Text[ spanish ] = "No se encontr en ($Arg1) HelpID en ToolBox"; + Text[ italian ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ danish ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ swedish ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ polish ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ korean ] = " ID ($Arg1) ߰ߵ ʽϴ."; + Text[ chinese_simplified ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ chinese_traditional ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ arabic ] = "HelpID in ToolBox not found at ($Arg1)"; + Text[ turkish ] = "HelpID in ToolBox not found at ($Arg1)"; +}; +String S_BUTTON_DISABLED_ON_TOOLBOX +{ + Text = "Der Button ist disabled in ToolBox bei ($Arg1)"; + Text[ english_us ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ portuguese ] = "O boto da ToolBox em ($Arg1) est desactivado"; + Text[ russian ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ greek ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ dutch ] = "Button buiten werking in ToolBox bij ($Arg1)"; + Text[ french ] = "Le bouton est dsactiv dans la ToolBox pour ($Arg1)"; + Text[ spanish ] = "El botn est desactivado en ToolBox en ($Arg1)"; + Text[ italian ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ danish ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ swedish ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ polish ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ korean ] = "($Arg1) ư ȵ˴ϴ."; + Text[ chinese_simplified ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ chinese_traditional ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ arabic ] = "The button is disabled in ToolBox at ($Arg1)"; + Text[ turkish ] = "The button is disabled in ToolBox at ($Arg1)"; +}; +String S_BUTTON_HIDDEN_ON_TOOLBOX +{ + Text = "Der Button ist hidden in ToolBox bei ($Arg1)"; + Text[ english_us ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ portuguese ] = "O boto da ToolBox em ($Arg1) est oculto"; + Text[ russian ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ greek ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ dutch ] = "Button verborgen in Toolbox bij ($Arg1)"; + Text[ french ] = "Le bouton est cach dans la ToolBox pour ($Arg1)"; + Text[ spanish ] = "El botn es hidden en ToolBox en ($Arg1)"; + Text[ italian ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ danish ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ swedish ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ polish ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ korean ] = "($Arg1) ư ֽϴ."; + Text[ chinese_simplified ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ chinese_traditional ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ arabic ] = "The button is hidden in ToolBox at ($Arg1)"; + Text[ turkish ] = "The button is hidden in ToolBox at ($Arg1)"; +}; +String S_CANNOT_MAKE_BUTTON_VISIBLE_IN_TOOLBOX +{ + Text = "Button konnte nicht sichtbar gemacht werden in ToolBox bei ($Arg1)"; + Text[ english_us ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ portuguese ] = "Foi impossvel tornar o boto da ToolBox em ($Arg1) visvel"; + Text[ russian ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ greek ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ dutch ] = "Button kon niet zichtbaar worden gemaakt in Toolbox bij ($Arg1)"; + Text[ french ] = "mpossible d'afficher le bouton dans la ToolBox pour ($Arg1)"; + Text[ spanish ] = "No se pudo mostrar el boton en ToolBox para ($Arg1)"; + Text[ italian ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ danish ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ swedish ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ polish ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ korean ] = "($Arg1) ư ̰ Ҽ ϴ."; + Text[ chinese_simplified ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ chinese_traditional ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ arabic ] = "Button cannot be made visible in ToolBox at ($Arg1)"; + Text[ turkish ] = "Button cannot be made visible in ToolBox at ($Arg1)"; +}; +String S_TEAROFF_FAILED +{ + Text = "TearOff Fehlgeschlagen in ToolBox bei ($Arg1)"; + Text[ english_us ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ portuguese ] = "TearOff falhou na ToolBox em ($Arg1)"; + Text[ russian ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ greek ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ dutch ] = "TearOff mislukt in ToolBox bij ($Arg1)"; + Text[ french ] = "TearOff a chou dans la ToolBox pour ($Arg1)"; + Text[ spanish ] = "Ha fallado TearOff en ToolBox para ($Arg1)"; + Text[ italian ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ danish ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ swedish ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ polish ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ korean ] = "($Arg1) ڿ 밡 Ͽϴ."; + Text[ chinese_simplified ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ chinese_traditional ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ arabic ] = "TearOff failed in ToolBox at ($Arg1)"; + Text[ turkish ] = "TearOff failed in ToolBox at ($Arg1)"; +}; +String S_NO_SELECTED_ENTRY +{ + Text = "Es ist kein Eintrag Selektiert in TreeListBox bei ($Arg1)"; + Text[ english_us ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ portuguese ] = "Nenhuma entrada seleccionada na TreeListBox para ($Arg1)"; + Text[ russian ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ greek ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ dutch ] = "Geen item geselecteerd in TreeListBox bij ($Arg1)"; + Text[ french ] = "Aucune entre slectionne dans la TreeListBox pour ($Arg1)"; + Text[ spanish ] = "No hay ninguna entrada seleccionada en TreeListBox para ($Arg1)"; + Text[ italian ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ danish ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ swedish ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ polish ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ korean ] = "($Arg1) Ʈ Ʈ ڽ õ ϴ."; + Text[ chinese_simplified ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ chinese_traditional ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ arabic ] = "An entry has not been selected in TreeListBox at ($Arg1)"; + Text[ turkish ] = "An entry has not been selected in TreeListBox at ($Arg1)"; +}; +String S_SELECT_DESELECT_VIA_STRING_NOT_IMPLEMENTED +{ + Text = "Select/Deselect mit String nicht implementiert bei ($Arg1)"; + Text[ english_us ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ portuguese ] = "Seleccionar/Desseleccionar com String no implementado em ($Arg1)"; + Text[ russian ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ greek ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ dutch ] = "Select/Deselect met String niet gemplementeerd bij ($Arg1)"; + Text[ french ] = "Slection/dselection d'un string pas implmente pour ($Arg1)"; + Text[ spanish ] = "Seleccionar/Deshacer seleccin con String no implementado para ($Arg1)"; + Text[ italian ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ danish ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ swedish ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ polish ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ korean ] = "($Arg1) ڿ Բ / ʾҽϴ."; + Text[ chinese_simplified ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ chinese_traditional ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ arabic ] = "Select/Deselect with string not implemented at ($Arg1)"; + Text[ turkish ] = "Select/Deselect with string not implemented at ($Arg1)"; +}; +String S_ALLOWED_ONLY_IN_FLOATING_MODE +{ + Text = "Methode nur im Froating-Mode erlaubt bei ($Arg1)"; + Text[ english_us ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ portuguese ] = "Mtodo autorizado apenas em modo Froating em ($Arg1)"; + Text[ russian ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ greek ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ dutch ] = "Methode alleen toegestaan in Froating Mode bij ($Arg1)"; + Text[ french ] = "Mthode autorise uniquement en mode Froating pour ($Arg1)"; + Text[ spanish ] = "Mtodo permitido solo en modo Froating para ($Arg1)"; + Text[ italian ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ danish ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ swedish ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ polish ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ korean ] = "($Arg1) ̵ ҵ常 ˴ϴ."; + Text[ chinese_simplified ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ chinese_traditional ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ arabic ] = "Method only allowed in floating mode at ($Arg1)"; + Text[ turkish ] = "Method only allowed in floating mode at ($Arg1)"; +}; +String S_ALLOWED_ONLY_IN_DOCKING_MODE +{ + Text = "Methode nur im Docking-Mode erlaubt bei ($Arg1)"; + Text[ english_us ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ portuguese ] = "Mtodo somente autorizado em modo Docking em ($Arg1)"; + Text[ russian ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ greek ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ dutch ] = "Methode alleen toegestaan in Docking-Mode bij ($Arg1)"; + Text[ french ] = "Mthode autorise uniquement en mode Docking pour ($Arg1)"; + Text[ spanish ] = "Mtodo permitido solo en modo Docking para ($Arg1)"; + Text[ italian ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ danish ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ swedish ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ polish ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ korean ] = "($Arg1) ҵ常 ˴ϴ."; + Text[ chinese_simplified ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ chinese_traditional ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ arabic ] = "Method only allowed in docking mode at ($Arg1)"; + Text[ turkish ] = "Method only allowed in docking mode at ($Arg1)"; +}; +String S_SIZE_NOT_CHANGEABLE +{ + Text = "Gre ist nicht vernderbar bei ($Arg1)"; + Text[ english_us ] = "Size cannot be altered at ($Arg1)"; + Text[ portuguese ] = "Impossvel alterar o tamanho em ($Arg1)"; + Text[ russian ] = "Size cannot be altered at ($Arg1)"; + Text[ greek ] = "Size cannot be altered at ($Arg1)"; + Text[ dutch ] = "Grootte kan niet worden veranderd bij ($Arg1)"; + Text[ french ] = "Taille non modifiable pour ($Arg1)"; + Text[ spanish ] = "Tamao no modificable para ($Arg1)"; + Text[ italian ] = "Size cannot be altered at ($Arg1)"; + Text[ danish ] = "Size cannot be altered at ($Arg1)"; + Text[ swedish ] = "Size cannot be altered at ($Arg1)"; + Text[ polish ] = "Size cannot be altered at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Size cannot be altered at ($Arg1)"; + Text[ korean ] = "($Arg1) ũⰡ ٲ ʽϴ."; + Text[ chinese_simplified ] = "Size cannot be altered at ($Arg1)"; + Text[ chinese_traditional ] = "Size cannot be altered at ($Arg1)"; + Text[ arabic ] = "Size cannot be altered at ($Arg1)"; + Text[ turkish ] = "Size cannot be altered at ($Arg1)"; +}; +String S_NO_OK_BUTTON +{ + Text = "Kein OK Button Vorhanden bei ($Arg1)"; + Text[ english_us ] = "There is no OK button at ($Arg1)"; + Text[ portuguese ] = "Boto OK inexistente em ($Arg1)"; + Text[ russian ] = "There is no OK button at ($Arg1)"; + Text[ greek ] = "There is no OK button at ($Arg1)"; + Text[ dutch ] = "Geen OK-button voorhanden bij ($Arg1)"; + Text[ french ] = "Absence de bouton OK pour ($Arg1)"; + Text[ spanish ] = "No existe botn Aceptar para ($Arg1)"; + Text[ italian ] = "There is no OK button at ($Arg1)"; + Text[ danish ] = "There is no OK button at ($Arg1)"; + Text[ swedish ] = "There is no OK button at ($Arg1)"; + Text[ polish ] = "There is no OK button at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "There is no OK button at ($Arg1)"; + Text[ korean ] = "($Arg1) Ȯ ư ϴ."; + Text[ chinese_simplified ] = "There is no OK button at ($Arg1)"; + Text[ chinese_traditional ] = "There is no OK button at ($Arg1)"; + Text[ arabic ] = "There is no OK button at ($Arg1)"; + Text[ turkish ] = "There is no OK button at ($Arg1)"; +}; +String S_NO_CANCEL_BUTTON +{ + Text = "Kein Abbrechen Button Vorhanden bei ($Arg1)"; + Text[ english_us ] = "There is no Cancel button at ($Arg1)"; + Text[ portuguese ] = "Boto Cancelar inexistente em ($Arg1)"; + Text[ russian ] = "There is no Cancel button at ($Arg1)"; + Text[ greek ] = "There is no Cancel button at ($Arg1)"; + Text[ dutch ] = "Geen Annuleren-button beschikbaar bij ($Arg1)"; + Text[ french ] = "Absence de bouton Annuler pour ($Arg1)"; + Text[ spanish ] = "No existe botn Cancelar para ($Arg1)"; + Text[ italian ] = "There is no Cancel button at ($Arg1)"; + Text[ danish ] = "There is no Cancel button at ($Arg1)"; + Text[ swedish ] = "There is no Cancel button at ($Arg1)"; + Text[ polish ] = "There is no Cancel button at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "There is no Cancel button at ($Arg1)"; + Text[ korean ] = "($Arg1) ư ϴ."; + Text[ chinese_simplified ] = "There is no Cancel button at ($Arg1)"; + Text[ chinese_traditional ] = "There is no Cancel button at ($Arg1)"; + Text[ arabic ] = "There is no Cancel button at ($Arg1)"; + Text[ turkish ] = "There is no Cancel button at ($Arg1)"; +}; +String S_NO_YES_BUTTON +{ + Text = "Kein Ja Button Vorhanden bei ($Arg1)"; + Text[ english_us ] = "There is no Yes button at ($Arg1)"; + Text[ portuguese ] = "Boto Sim inexistente em ($Arg1)"; + Text[ russian ] = "There is no Yes button at ($Arg1)"; + Text[ greek ] = "There is no Yes button at ($Arg1)"; + Text[ dutch ] = "Geen Ja-button beschikbaar bij ($Arg1)"; + Text[ french ] = "Absence de bouton Oui pour ($Arg1)"; + Text[ spanish ] = "No existe botn S para ($Arg1)"; + Text[ italian ] = "There is no Yes button at ($Arg1)"; + Text[ danish ] = "There is no Yes button at ($Arg1)"; + Text[ swedish ] = "There is no Yes button at ($Arg1)"; + Text[ polish ] = "There is no Yes button at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "There is no Yes button at ($Arg1)"; + Text[ korean ] = "($Arg1) \"\" ư ϴ."; + Text[ chinese_simplified ] = "There is no Yes button at ($Arg1)"; + Text[ chinese_traditional ] = "There is no Yes button at ($Arg1)"; + Text[ arabic ] = "There is no Yes button at ($Arg1)"; + Text[ turkish ] = "There is no Yes button at ($Arg1)"; +}; +String S_NO_NO_BUTTON +{ + Text = "Kein Nein Button Vorhanden bei ($Arg1)"; + Text[ english_us ] = "There is no No button at ($Arg1)"; + Text[ portuguese ] = "Boto No inexistente em ($Arg1)"; + Text[ russian ] = "There is no No button at ($Arg1)"; + Text[ greek ] = "There is no No button at ($Arg1)"; + Text[ dutch ] = "Geen Nee-button beschikbaar bij ($Arg1)"; + Text[ french ] = "Absence de bouton Non pour ($Arg1)"; + Text[ spanish ] = "No existe boton No para ($Arg1)"; + Text[ italian ] = "There is no No button at ($Arg1)"; + Text[ danish ] = "There is no No button at ($Arg1)"; + Text[ swedish ] = "There is no No button at ($Arg1)"; + Text[ polish ] = "There is no No button at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "There is no No button at ($Arg1)"; + Text[ korean ] = "($Arg1) \"ƴϿ\" ư ϴ."; + Text[ chinese_simplified ] = "There is no No button at ($Arg1)"; + Text[ chinese_traditional ] = "There is no No button at ($Arg1)"; + Text[ arabic ] = "There is no No button at ($Arg1)"; + Text[ turkish ] = "There is no No button at ($Arg1)"; +}; +String S_NO_RETRY_BUTTON +{ + Text = "Kein Wiederholen Button Vorhanden bei ($Arg1)"; + Text[ english_us ] = "There is no Repeat button at ($Arg1)"; + Text[ portuguese ] = "Boto Repetir inexistente em ($Arg1)"; + Text[ russian ] = "There is no Repeat button at ($Arg1)"; + Text[ greek ] = "There is no Repeat button at ($Arg1)"; + Text[ dutch ] = "Geen Herhalen-button beschikbaar bij ($Arg1)"; + Text[ french ] = "Absence de bouton Ressayer pour ($Arg1)"; + Text[ spanish ] = "No existe botn Repetir para ($Arg1)"; + Text[ italian ] = "There is no Repeat button at ($Arg1)"; + Text[ danish ] = "There is no Repeat button at ($Arg1)"; + Text[ swedish ] = "There is no Repeat button at ($Arg1)"; + Text[ polish ] = "There is no Repeat button at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "There is no Repeat button at ($Arg1)"; + Text[ korean ] = "($Arg1) ݺ ư ϴ."; + Text[ chinese_simplified ] = "There is no Repeat button at ($Arg1)"; + Text[ chinese_traditional ] = "There is no Repeat button at ($Arg1)"; + Text[ arabic ] = "There is no Repeat button at ($Arg1)"; + Text[ turkish ] = "There is no Repeat button at ($Arg1)"; +}; +String S_NO_HELP_BUTTON +{ + Text = "Kein Hilfe Button Vorhanden bei ($Arg1)"; + Text[ english_us ] = "There is no Help button at ($Arg1)"; + Text[ portuguese ] = "Boto Ajuda inexistente em ($Arg1)"; + Text[ russian ] = "There is no Help button at ($Arg1)"; + Text[ greek ] = "There is no Help button at ($Arg1)"; + Text[ dutch ] = "Geen Help-button beschikbaar bij ($Arg1)"; + Text[ french ] = "Absence de bouton Aide pour ($Arg1)"; + Text[ spanish ] = "No existe botn Ayuda para ($Arg1)"; + Text[ italian ] = "There is no Help button at ($Arg1)"; + Text[ danish ] = "There is no Help button at ($Arg1)"; + Text[ swedish ] = "There is no Help button at ($Arg1)"; + Text[ polish ] = "There is no Help button at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "There is no Help button at ($Arg1)"; + Text[ korean ] = "($Arg1) ư ϴ."; + Text[ chinese_simplified ] = "There is no Help button at ($Arg1)"; + Text[ chinese_traditional ] = "There is no Help button at ($Arg1)"; + Text[ arabic ] = "There is no Help button at ($Arg1)"; + Text[ turkish ] = "There is no Help button at ($Arg1)"; +}; +String S_NO_DEFAULT_BUTTON +{ + Text = "Kein Default Button Definiert bei ($Arg1)"; + Text[ english_us ] = "There is no Default button defined at ($Arg1)"; + Text[ portuguese ] = "Boto Padro inexistente em ($Arg1)"; + Text[ russian ] = "There is no Default button defined at ($Arg1)"; + Text[ greek ] = "There is no Default button defined at ($Arg1)"; + Text[ dutch ] = "Geen Default-button beschikbaar bij ($Arg1)"; + Text[ french ] = "Absence de bouton Par dfaut pour ($Arg1)"; + Text[ spanish ] = "No hay definido un botn Default para ($Arg1)"; + Text[ italian ] = "There is no Default button defined at ($Arg1)"; + Text[ danish ] = "There is no Default button defined at ($Arg1)"; + Text[ swedish ] = "There is no Default button defined at ($Arg1)"; + Text[ polish ] = "There is no Default button defined at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "There is no Default button defined at ($Arg1)"; + Text[ korean ] = "($Arg1) ǵ ⺻ ư ϴ."; + Text[ chinese_simplified ] = "There is no Default button defined at ($Arg1)"; + Text[ chinese_traditional ] = "There is no Default button defined at ($Arg1)"; + Text[ arabic ] = "There is no Default button defined at ($Arg1)"; + Text[ turkish ] = "There is no Default button defined at ($Arg1)"; +}; +String S_BUTTON_ID_NOT_THERE +{ + Text = "Kein Button mit der ID ($Arg1) Vorhanden bei ($Arg2)"; + Text[ english_us ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ portuguese ] = "Boto com ID ($Arg1) inexistente em ($Arg2)"; + Text[ russian ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ greek ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ dutch ] = "Geen button met ID ($Arg1) beschikbaar bij ($Arg2)"; + Text[ french ] = "Absence bouton portant l'ID ($Arg1) pour ($Arg2) "; + Text[ spanish ] = "No existe un botn con la ID ($Arg1) para ($Arg2)"; + Text[ italian ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ danish ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ swedish ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ polish ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ korean ] = "($Arg2) ID ($Arg1) ư "; + Text[ chinese_simplified ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ chinese_traditional ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ arabic ] = "There is no button with a ($Arg1) ID at ($Arg2)"; + Text[ turkish ] = "There is no button with a ($Arg1) ID at ($Arg2)"; +}; +String S_BUTTONID_REQUIRED +{ + Text = "Es muss eine ButtonId angegeben werden bei ($Arg1)"; + Text[ english_us ] = "A button ID needs to be entered at ($Arg1)"; + Text[ portuguese ] = "Necessrio indicar ButtonId em ($Arg1)"; + Text[ russian ] = "A button ID needs to be entered at ($Arg1)"; + Text[ greek ] = "A button ID needs to be entered at ($Arg1)"; + Text[ dutch ] = "Er moet een buttonID worden vermeld bij ($Arg1)"; + Text[ french ] = "Il manque un ButtonID pour ($Arg1) "; + Text[ spanish ] = "Debe indicarse un ButtonId para ($Arg1)"; + Text[ italian ] = "A button ID needs to be specified at ($Arg1)"; + Text[ danish ] = "A button ID needs to be entered at ($Arg1)"; + Text[ swedish ] = "A button ID needs to be entered at ($Arg1)"; + Text[ polish ] = "A button ID needs to be entered at ($Arg1)"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "A button ID needs to be entered at ($Arg1)"; + Text[ korean ] = "($Arg1) Էµ ư ID"; + Text[ chinese_simplified ] = "A button ID needs to be entered at ($Arg1)"; + Text[ chinese_traditional ] = "A button ID needs to be entered at ($Arg1)"; + Text[ arabic ] = "A button ID needs to be entered at ($Arg1)"; + Text[ turkish ] = "A button ID needs to be entered at ($Arg1)"; +}; +String S_UNKNOWN_TYPE +{ + Text = "Unbekannter Objekttyp ($Arg1) aus UId"; + Text[ english_us ] = "Unknown object type ($Arg1) from UId"; + Text[ portuguese ] = "Tipo de objecto ($Arg1) desconhecido deste UId"; + Text[ russian ] = "Unknown object type ($Arg1) from UId"; + Text[ greek ] = "Unknown object type ($Arg1) from UId"; + Text[ dutch ] = "Onbekend objecttype ($Arg1) uit UId"; + Text[ french ] = "Type d'objet ($Arg1) inconnu pour cet UId"; + Text[ spanish ] = "Tipo de objeto ($Arg1) desconocido por su UId"; + Text[ italian ] = "Unknown object type ($Arg1) from UId"; + Text[ danish ] = "Unknown object type ($Arg1) from UId"; + Text[ swedish ] = "Unknown object type ($Arg1) from UId"; + Text[ polish ] = "Unknown object type ($Arg1) from UId"; + Text[ portuguese_brazilian ] = "dummytext"; + Text[ japanese ] = "Unknown object type ($Arg1) from UId"; + Text[ korean ] = "UIdκ ˼°ü Ÿ ($Arg1) "; + Text[ chinese_simplified ] = "Unknown object type ($Arg1) from UId"; + Text[ chinese_traditional ] = "Unknown object type ($Arg1) from UId"; + Text[ arabic ] = "Unknown object type ($Arg1) from UId"; + Text[ turkish ] = "Unknown object type ($Arg1) from UId"; +}; diff --git a/basic/source/app/testbasi.cxx b/basic/source/app/testbasi.cxx new file mode 100644 index 000000000000..e21c67587453 --- /dev/null +++ b/basic/source/app/testbasi.cxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * $RCSfile: testbasi.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#define testtool +#include "mybasic.cxx" diff --git a/basic/source/app/testtool.idl b/basic/source/app/testtool.idl new file mode 100644 index 000000000000..7666576c3e4e --- /dev/null +++ b/basic/source/app/testtool.idl @@ -0,0 +1,81 @@ +/************************************************************************* + * + * $RCSfile: testtool.idl,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +module +"484E40E0-1F23-101C-9961-04021C007002" +"5A30E000-1F23-101C-9961-04021C007002" +App +[ +HelpText( "Test" ), +TypeLibFile( "testtool.tlb" ) +] +{ + interface TestToolAutomation + [ + uuid( "6706E171-FB05-101B-804c-04021c007002" ) + ] + { + void Start( String aFilePath ); + BOOL Call( String aProcName, UINT32 nUId ); + void Close( ); + } +} + + diff --git a/basic/source/app/testtool.src b/basic/source/app/testtool.src new file mode 100644 index 000000000000..747d891ffc9c --- /dev/null +++ b/basic/source/app/testtool.src @@ -0,0 +1,221 @@ +/************************************************************************* + * + * $RCSfile: testtool.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#include "testtool.hrc" + + +/////////////////////////////// +// Strings +/////////////////////////////// +String S_INVALID_KEYCODE +{ + Text = "Ist kein gltiger KeyCode!"; + Text[ english_us ] = "Is an invalid KeyCode!"; + Text[ portuguese ] = "No um KeyCode vlido!"; + Text[ russian ] = "Is an invalid KeyCode!"; + Text[ greek ] = "Is an invalid KeyCode!"; + Text[ dutch ] = "Is geen geldige KeyCode!"; + Text[ french ] = "KeyCode incorrect !"; + Text[ spanish ] = "No es un KeyCode correcto!"; + Text[ italian ] = "Is an invalid KeyCode!"; + Text[ danish ] = "Is an invalid KeyCode!"; + Text[ swedish ] = "Is an invalid KeyCode!"; + Text[ polish ] = "Nieprawidowy KeyCode!"; + Text[ portuguese_brazilian ] = "Ist kein gltiger KeyCode!"; + Text[ japanese ] = "Is an invalid KeyCode!"; + Text[ korean ] = "Ű ڵ尡 ʽϴ!"; + Text[ chinese_simplified ] = "Is an invalid KeyCode!"; + Text[ chinese_traditional ] = "Ist kein gltiger KeyCode!"; + Text[ arabic ] = "Is an invalid KeyCode!"; + Text[ turkish ] = "Geerli bir KeyCode deil!"; +}; +String S_MANDATORY_FILE +{ + Text = "\nwurde nicht gefunden.\nDiese Datei ist unentbehrlich."; + Text[ english_us ] = "\ncould not be found.\nThis file is indispensable."; + Text[ portuguese ] = "\nno foi encontrado.\nEste ficheiro indispensvel."; + Text[ russian ] = "\ncould not be found.\nThis file is indispensable."; + Text[ greek ] = "\ncould not be found.\nThis file is indispensable."; + Text[ dutch ] = "\nniet gevonden.\nDit bestand is onontbeerlijk."; + Text[ french ] = "\nn'a pas pu tre dtect.\nCe fichier est indispensable."; + Text[ spanish ] = "\nno se encontr.\nEste archivo es imprescindible."; + Text[ italian ] = "\ncould not be found.\nThis file is indispensable."; + Text[ danish ] = "\ncould not be found.\nThis file is indispensable."; + Text[ swedish ] = "\ncould not be found.\nThis file is indispensable."; + Text[ polish ] = "\nnie znaleziono.\n.Plik ten jest niezbdny."; + Text[ portuguese_brazilian ] = "\nwurde nicht gefunden.\nDiese Datei ist unentbehrlich."; + Text[ japanese ] = "\ncould not be found.\nThis file is indispensable."; + Text[ korean ] = "\n߰ߵ ʽϴ.\n ݵ ־մϴ."; + Text[ chinese_simplified ] = "\ncould not be found.\nThis file is indispensable."; + Text[ chinese_traditional ] = "\nwurde nicht gefunden.\nDiese Datei ist unentbehrlich."; + Text[ arabic ] = "\ncould not be found.\nThis file is indispensable."; + Text[ turkish ] = "\nbulunamad.\nBu dosya mutlaka gerekli."; +}; +String S_READING_LONGNAMES +{ + Text = "Einlesen der Langnamen"; + Text[ english_us ] = "Reading long names"; + Text[ portuguese ] = "Leitura dos nomes extensos"; + Text[ russian ] = "Reading long names"; + Text[ greek ] = "Reading long names"; + Text[ dutch ] = "Lezen van volledige namen"; + Text[ french ] = "Lecture des noms de fichiers longs (long names)"; + Text[ spanish ] = "Leyendo nombres largos"; + Text[ italian ] = "Reading long names"; + Text[ danish ] = "Reading long names"; + Text[ swedish ] = "Reading long names"; + Text[ polish ] = "Czytanie penych nazw"; + Text[ portuguese_brazilian ] = "Einlesen der Langnamen"; + Text[ japanese ] = "Reading long names"; + Text[ korean ] = " ̸ б"; + Text[ chinese_simplified ] = "Reading long names"; + Text[ chinese_traditional ] = "Einlesen der Langnamen"; + Text[ arabic ] = "Reading long names"; + Text[ turkish ] = "Uzun adlar okunuyor"; +}; +String S_READING_SLOT_IDS +{ + Text = "Einlesen der Slot IDs"; + Text[ english_us ] = "Reading Slot IDs"; + Text[ portuguese ] = "Leitura dos Slot IDs"; + Text[ russian ] = "Reading Slot IDs"; + Text[ greek ] = "Reading Slot IDs"; + Text[ dutch ] = "Lezen van de Slot IDs"; + Text[ french ] = "Lecture des Slot IDs"; + Text[ spanish ] = "Leyendo Slot IDs"; + Text[ italian ] = "Reading Slot IDs"; + Text[ danish ] = "Reading Slot IDs"; + Text[ swedish ] = "Reading Slot IDs"; + Text[ polish ] = "Czytanie Slot ID"; + Text[ portuguese_brazilian ] = "Einlesen der Slot IDs"; + Text[ japanese ] = "Reading Slot IDs"; + Text[ korean ] = " ̵ б"; + Text[ chinese_simplified ] = "Reading Slot IDs"; + Text[ chinese_traditional ] = "Einlesen der Slot IDs"; + Text[ arabic ] = "Reading Slot IDs"; + Text[ turkish ] = "Slot ID'ler okunuyor"; +}; +String S_READING_CONTROLS +{ + Text = "Einlesen der Controls"; + Text[ english_us ] = "Reading Controls"; + Text[ portuguese ] = "Leitura dos Controls"; + Text[ russian ] = "Reading Controls"; + Text[ greek ] = "Reading Controls"; + Text[ dutch ] = "Leuen van de Controls"; + Text[ french ] = "Lecture des contrles"; + Text[ spanish ] = "Leyendo Controls"; + Text[ italian ] = "Reading Controls"; + Text[ danish ] = "Reading Controls"; + Text[ swedish ] = "Reading Controls"; + Text[ polish ] = "Odczyt pl kontrolnych"; + Text[ portuguese_brazilian ] = "Einlesen der Controls"; + Text[ japanese ] = "Reading Controls"; + Text[ korean ] = "Ʈ б"; + Text[ chinese_simplified ] = "Reading Controls"; + Text[ chinese_traditional ] = "Einlesen der Controls"; + Text[ arabic ] = "Reading Controls"; + Text[ turkish ] = "Control'ler okunuyor"; +}; +String S_READING_BASIC_MODULE +{ + Text = "Einlesen BASIC Modul"; + Text[ english_us ] = "Reading BASIC module"; + Text[ portuguese ] = "Leitura do mdulo BASIC"; + Text[ russian ] = "Reading BASIC module"; + Text[ greek ] = "Reading BASIC module"; + Text[ dutch ] = "Lezen van BASIC module"; + Text[ french ] = "Lecture du module BASIC"; + Text[ spanish ] = "Leyendo mdulo BASIC"; + Text[ italian ] = "Reading BASIC module"; + Text[ danish ] = "Reading BASIC module"; + Text[ swedish ] = "Reading BASIC module"; + Text[ polish ] = "Czytanie moduu BASIC"; + Text[ portuguese_brazilian ] = "Einlesen BASIC Modul"; + Text[ japanese ] = "Reading BASIC module"; + Text[ korean ] = "BASIC б"; + Text[ chinese_simplified ] = "Reading BASIC module"; + Text[ chinese_traditional ] = "Einlesen BASIC Modul"; + Text[ arabic ] = "Reading BASIC module"; + Text[ turkish ] = "BASIC modl okunuyor"; +}; +String S_STARTING_APPLICATION +{ + Text = "Starten der Applikation"; + Text[ english_us ] = "Starting application"; + Text[ portuguese ] = "A iniciar aplicao"; + Text[ russian ] = "Starting application"; + Text[ greek ] = "Starting application"; + Text[ dutch ] = "Starten van applicatie"; + Text[ french ] = "Dmarrage de l'application"; + Text[ spanish ] = "Iniciando la aplicacin"; + Text[ italian ] = "Starting application"; + Text[ danish ] = "Starting application"; + Text[ swedish ] = "Starting application"; + Text[ polish ] = "Uruchamianie aplikacji"; + Text[ portuguese_brazilian ] = "Starten der Applikation"; + Text[ japanese ] = "Starting application"; + Text[ korean ] = "α "; + Text[ chinese_simplified ] = "Starting application"; + Text[ chinese_traditional ] = "Starten der Applikation"; + Text[ arabic ] = "Starting application"; + Text[ turkish ] = "Uygulama balatlyor"; +}; + diff --git a/basic/source/app/textedit.cxx b/basic/source/app/textedit.cxx new file mode 100644 index 000000000000..cd0343ef63e2 --- /dev/null +++ b/basic/source/app/textedit.cxx @@ -0,0 +1,898 @@ +/************************************************************************* + * + * $RCSfile: textedit.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _SYSTEM_HXX //autogen +#include <vcl/system.hxx> +#endif +#ifndef _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif + +#ifndef _TEXTENG_HXX //autogen +#include <svtools/texteng.hxx> +#endif +#ifndef _TEXTVIEW_HXX //autogen +#include <svtools/textview.hxx> +#endif +#ifndef _TXTATTR_HXX //autogen +#include <svtools/txtattr.hxx> +#endif +#ifndef __SBX_SBXMETHOD_HXX //autogen +#include <svtools/sbxmeth.hxx> +#endif +#ifndef _BASIC_TTRESHLP_HXX +#include "ttstrhlp.hxx" +#endif + +#include "basic.hrc" +#include "textedit.hxx" +#include "appedit.hxx" +#include "brkpnts.hxx" +#include "testtool.hxx" // defines fr das Syntaxhighlighting + +TextEditImp::TextEditImp( AppEdit* pParent, const WinBits& aBits ) +: Window( pParent, aBits ) +, pAppEdit( pParent ) +, bHighlightning( FALSE ) +, bDoSyntaxHighlight( FALSE ) +, bDelayHighlight( TRUE ) +, nTipId( 0 ) +{ + pTextEngine = new TextEngine(); + pTextEngine->SetMaxTextLen( STRING_MAXLEN ); + pTextEngine->EnableUndo( TRUE ); + + pTextView = new TextView( pTextEngine, this ); + pTextEngine->InsertView( pTextView ); + pTextEngine->SetModified( FALSE ); + + aSyntaxIdleTimer.SetTimeout( 200 ); + aSyntaxIdleTimer.SetTimeoutHdl( LINK( this, TextEditImp, SyntaxTimerHdl ) ); + + aImplSyntaxIdleTimer.SetTimeout( 1 ); + aImplSyntaxIdleTimer.SetTimeoutHdl( LINK( this, TextEditImp, SyntaxTimerHdl ) ); + + StartListening( *pTextEngine ); + + HideTipTimer.SetTimeout( 5000 ); // 5 Sekunden + ShowTipTimer.SetTimeout( 500 ); // 1/2 Sekunde + HideTipTimer.SetTimeoutHdl( LINK( this, TextEditImp, HideVarContents ) ); + ShowTipTimer.SetTimeoutHdl( LINK( this, TextEditImp, ShowVarContents ) ); +} + +TextEditImp::~TextEditImp() +{ + pTextEngine->RemoveView( pTextView ); + delete pTextView; + delete pTextEngine; +} + +void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) +{ + if ( rHint.ISA( TextHint ) ) + { + const TextHint& rTextHint = (const TextHint&)rHint; + if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED ) + { + pAppEdit->pHScroll->SetThumbPos( pTextView->GetStartDocPos().X() ); + pAppEdit->pVScroll->SetThumbPos( pTextView->GetStartDocPos().Y() ); + if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() ) + ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->Scroll( 0, ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->GetCurYOffset() - pTextView->GetStartDocPos().Y() ); + } + else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED ) + { + if ( pTextView->GetStartDocPos().Y() ) + { + long nOutHeight = GetOutputSizePixel().Height(); + long nTextHeight = pTextEngine->GetTextHeight(); + if ( nTextHeight < nOutHeight ) + pTextView->Scroll( 0, pTextView->GetStartDocPos().Y() ); + } + + pAppEdit->SetScrollBarRanges(); + } + else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED ) + { + ULONG nWidth = pTextEngine->CalcTextWidth(); + if ( (ULONG)nWidth != pAppEdit->nCurTextWidth ) + { + pAppEdit->nCurTextWidth = nWidth; + if ( pAppEdit->pHScroll ) + { // Initialisierung abgeschlossen? + pAppEdit->pHScroll->SetRange( Range( 0, (long)nWidth) ); + pAppEdit->pHScroll->SetThumbPos( pTextView->GetStartDocPos().X() ); + } + } + } + else if( rTextHint.GetId() == TEXT_HINT_PARAINSERTED ) + { + if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() ) + ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, TRUE ); + + // Lstiges anpassen fr 2 Zeichen am Zeilenende statt einem(Hartverdrateter Default) + pTextEngine->SetMaxTextLen( STRING_MAXLEN - pTextEngine->GetParagraphCount() ); + } + else if( rTextHint.GetId() == TEXT_HINT_PARAREMOVED ) + { + if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() ) + ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, FALSE ); + + // Lstiges anpassen fr 2 Zeichen am Zeilenende statt einem(Hartverdrateter Default) + pTextEngine->SetMaxTextLen( STRING_MAXLEN - pTextEngine->GetParagraphCount() ); + } + else if( rTextHint.GetId() == TEXT_HINT_FORMATPARA ) + { + DoDelayedSyntaxHighlight( rTextHint.GetValue() ); + ModifyHdl.Call( NULL ); + } + } +} + +#define TEXTATTR_SPECHIAL 55 +class TextAttribSpechial : public TextAttrib +{ +private: + FontWeight maFontWeight; + +public: + TextAttribSpechial( const FontWeight& rFontWeight ); + TextAttribSpechial( const TextAttribSpechial& rAttr ); + ~TextAttribSpechial() {;} + + virtual void SetFont( Font& rFont ) const; + virtual TextAttrib* Clone() const; + virtual int operator==( const TextAttrib& rAttr ) const; +}; + +TextAttribSpechial::TextAttribSpechial( const FontWeight& rFontWeight ) + : TextAttrib( TEXTATTR_SPECHIAL ), maFontWeight( rFontWeight ) +{} + +TextAttribSpechial::TextAttribSpechial( const TextAttribSpechial& rAttr ) + : TextAttrib( rAttr ), maFontWeight( rAttr.maFontWeight ) +{} + +void TextAttribSpechial::SetFont( Font& rFont ) const +{ + rFont.SetWeight( maFontWeight ); +} + +TextAttrib* TextAttribSpechial::Clone() const +{ + return new TextAttribSpechial( *this ); +} + +int TextAttribSpechial::operator==( const TextAttrib& rAttr ) const +{ + return ( ( TextAttrib::operator==(rAttr ) ) && + ( maFontWeight == ((const TextAttribSpechial&)rAttr).maFontWeight ) ); +} + +void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) +{ + SbTextPortions aPortionList; + pAppEdit->GetBasicFrame()->Basic().Highlight( rSource, aPortionList ); + + USHORT nCount = aPortionList.Count(); + if ( !nCount ) + return; + + SbTextPortion& rLast = aPortionList[nCount-1]; + if ( rLast.nStart > rLast.nEnd ) // Nur bis Bug von MD behoben + { +#ifdef DEBUG + DBG_ERROR( "MD-Bug nicht beseitigt!" ); +#endif + nCount--; + aPortionList.Remove( nCount); + if ( !nCount ) + return; + } + + /// hier werden die Type fr das Testtool nachbearbeitet + USHORT i; + BOOL bWasTTControl = FALSE; + for ( i = 0; i < aPortionList.Count(); i++ ) + { + SbTextPortion& r = aPortionList[i]; +// DBG_ASSERT( r.nStart <= r.nEnd, "Highlight: Start > End?" ); + if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoben + continue; + + SbTextType eType = r.eType; + Color aColor; + switch ( eType ) + { + case SB_SYMBOL: + { + String aSymbol = rSource.Copy( r.nStart, r.nEnd - r.nStart +1 ); + r.eType = pAppEdit->GetBasicFrame()->Basic().GetSymbolType( aSymbol, bWasTTControl ); + + if ( r.eType == TT_CONTROL ) + bWasTTControl = TRUE; + else + bWasTTControl = FALSE; + } + break; + case SB_PUNCTUATION: + { + String aPunctuation = rSource.Copy( r.nStart, r.nEnd - r.nStart +1 ); + if ( aPunctuation.CompareToAscii( "." ) != COMPARE_EQUAL ) + bWasTTControl = FALSE; + } + break; + default: + bWasTTControl = FALSE; + } + } + + // Evtl. Optimieren: + // Wenn haufig gleiche Farbe, dazwischen Blank ohne Farbe, + // ggf. zusammenfassen, oder zumindest das Blank, + // damit weniger Attribute + if ( TRUE /*bOptimizeHighlight*/ ) + { + // Es muessen nur die Blanks und Tabs mit attributiert werden. + // Wenn zwei gleiche Attribute hintereinander eingestellt werden, + // optimiert das die EditEngine. + xub_StrLen nLastEnd = 0; + xub_StrLen nLine = aPortionList[0].nLine; + for ( USHORT i = 0; i < nCount; i++ ) + { + SbTextPortion& r = aPortionList[i]; + DBG_ASSERT( r.nLine == nLine, "doch mehrere Zeilen ?" ); + DBG_ASSERT( r.nStart <= r.nEnd, "Highlight: Start > End?" ); + if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoben + continue; + + if ( r.nStart > nLastEnd ) + { + // Kann ich mich drauf verlassen, dass alle ausser + // Blank und Tab gehighlightet wird ?! + r.nStart = nLastEnd; + } + nLastEnd = r.nEnd+1; + if ( ( i == (nCount-1) ) && ( r.nEnd < rSource.Len() ) ) + r.nEnd = rSource.Len()-1; + } + } + + BOOL bWasModified = pTextEngine->IsModified(); + for ( i = 0; i < aPortionList.Count(); i++ ) + { + SbTextPortion& r = aPortionList[i]; +// DBG_ASSERT( r.nStart <= r.nEnd, "Highlight: Start > End?" ); + if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoben + continue; + + SbTextType eCol = r.eType; + Color aColor; + xub_StrLen nLine = nLineOff+r.nLine-1; // -1, weil Basic bei 1 beginnt + switch ( eCol ) + { + case SB_KEYWORD: + aColor = Color( COL_BLUE ); + break; + case SB_SYMBOL: + aColor = Color( RGB_COLORDATA( 0x00, 0x60, 0x00 ) ); + break; + case SB_STRING: + aColor = Color( COL_RED ); + break; + case SB_NUMBER: + aColor = Color( COL_MAGENTA ); + break; + case SB_PUNCTUATION: + aColor = Color( COL_BLACK ); + break; + case SB_COMMENT: + aColor = Color( COL_GRAY ); + break; + case TT_KEYWORD: + case TT_LOCALCMD: + aColor = Color( COL_LIGHTBLUE ); + break; + case TT_REMOTECMD: + aColor = Color( RGB_COLORDATA( 0x00, 0xB0, 0xB0 ) ); + break; + case TT_CONTROL: + case TT_SLOT: + aColor = Color( RGB_COLORDATA( 0x00, 0xB0, 0x00 ) ); + break; + case TT_METHOD: + aColor = Color( RGB_COLORDATA( 0x00, 0xB0, 0x00 ) ); + break; + case TT_NOMETHOD: + { + aColor = Color( COL_RED ); + pTextEngine->SetAttrib( TextAttribSpechial( WEIGHT_BOLD ), nLine, r.nStart, r.nEnd+1 ); + } + break; + default: + { + aColor = Color( RGB_COLORDATA( 0xff, 0x80, 0x80 ) ); + DBG_ERROR( "Unbekannte Syntax-Farbe?" ); + } + } + pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLine, r.nStart, r.nEnd+1 ); + } + // Das Highlighten soll kein Modify setzen + pTextEngine->SetModified( bWasModified ); +} + +void TextEditImp::DoSyntaxHighlight( ULONG nPara ) +{ + // Durch das DelayedSyntaxHighlight kann es passieren, + // dass die Zeile nicht mehr existiert! + if ( nPara < pTextEngine->GetParagraphCount() ) + { + // leider weis ich nicht, ob genau diese Zeile Modified() ... +// if ( pProgress ) +// pProgress->StepProgress(); + pTextEngine->RemoveAttribs( nPara ); + String aSource( pTextEngine->GetText( nPara ) ); + ImpDoHighlight( aSource, nPara ); + } +} + +void TextEditImp::DoDelayedSyntaxHighlight( xub_StrLen nPara ) +{ + // Zeile wird nur in 'Liste' aufgenommen, im TimerHdl abgearbeitet. + // => Nicht Absaetze manipulieren, waehrend EditEngine formatiert. +// if ( pProgress ) +// pProgress->StepProgress(); + + if ( !bHighlightning && bDoSyntaxHighlight ) + { + if ( bDelayHighlight ) + { + aSyntaxLineTable.Insert( nPara, (void*)(ULONG)1 ); + aSyntaxIdleTimer.Start(); + } + else + DoSyntaxHighlight( nPara ); + } +} + +IMPL_LINK( TextEditImp, SyntaxTimerHdl, Timer *, EMPTYARG ) +{ + DBG_ASSERT( pTextView, "Noch keine View, aber Syntax-Highlight ?!" ); + pTextEngine->SetUpdateMode( FALSE ); + + bHighlightning = TRUE; + USHORT nLine; + while ( aSyntaxLineTable.First() && !Application::AnyInput( INPUT_MOUSEANDKEYBOARD ) ) + { + nLine = (USHORT)aSyntaxLineTable.GetCurKey(); + DoSyntaxHighlight( nLine ); + aSyntaxLineTable.Remove( nLine ); +/* if ( Application::AnyInput() ) + { + aSyntaxIdleTimer.Start(); // Starten, falls wir in einem Dialog landen + pTextView->ShowCursor( TRUE, TRUE ); + pTextEngine->SetUpdateMode( TRUE ); + bHighlightning = FALSE; + GetpApp()->Reschedule(); + bHighlightning = TRUE; + pTextEngine->SetUpdateMode( FALSE ); + }*/ + } + + BOOL bWasModified = pTextEngine->IsModified(); + if ( aSyntaxLineTable.Count() > 3 ) // Ohne VDev + { + pTextEngine->SetUpdateMode( TRUE ); + pTextView->ShowCursor( TRUE, TRUE ); + } + else + pTextEngine->SetUpdateMode( TRUE ); // ! Mit VDev +// pTextView->ForceUpdate(); + + // SetUpdateMode( TRUE ) soll kein Modify setzen + pTextEngine->SetModified( bWasModified ); + + // SyntaxTimerHdl wird gerufen, wenn Text-Aenderung + // => gute Gelegenheit, Textbreite zu ermitteln! +// long nPrevTextWidth = nCurTextWidth; +// nCurTextWidth = pTextEngine->CalcTextWidth(); +// if ( nCurTextWidth != nPrevTextWidth ) +// SetScrollBarRanges(); + bHighlightning = FALSE; + + if ( aSyntaxLineTable.First() ) + aImplSyntaxIdleTimer.Start(); + +// while ( Application::AnyInput() ) +// Application::Reschedule(); // Reschedule, da der UserEvent keine Paints etc. durchlsst + + return 0; +} + +void TextEditImp::InvalidateSyntaxHighlight() +{ + for ( ULONG i = 0; i < pTextEngine->GetParagraphCount(); i++ ) + DoDelayedSyntaxHighlight( i ); +} + +void TextEditImp::SyntaxHighlight( BOOL bNew ) +{ + if ( ( bNew && bDoSyntaxHighlight ) || ( !bNew && !bDoSyntaxHighlight ) ) + return; + + bDoSyntaxHighlight = bNew; + if ( !pTextEngine ) + return; + + + if ( bDoSyntaxHighlight ) + { + InvalidateSyntaxHighlight(); + } + else + { + aSyntaxIdleTimer.Stop(); + pTextEngine->SetUpdateMode( FALSE ); + for ( ULONG i = 0; i < pTextEngine->GetParagraphCount(); i++ ) + pTextEngine->RemoveAttribs( i ); + +// pTextEngine->QuickFormatDoc(); + pTextEngine->SetUpdateMode( TRUE ); + pTextView->ShowCursor(TRUE, TRUE ); + } +} + + +void TextEditImp::SetFont( const Font& rNewFont ) +{ + pTextEngine->SetFont(rNewFont); +} + +BOOL TextEditImp::IsModified() +{ + return pTextEngine->IsModified(); +} + +void TextEditImp::KeyInput( const KeyEvent& rKeyEvent ) +{ + BOOL bWasModified = pTextView->GetTextEngine()->IsModified(); + pTextView->GetTextEngine()->SetModified( FALSE ); + + if ( !pTextView->KeyInput( rKeyEvent ) ) + Window::KeyInput( rKeyEvent ); + + if ( pTextView->GetTextEngine()->IsModified() ) + ModifyHdl.Call( NULL ); + else + pTextView->GetTextEngine()->SetModified( bWasModified ); // Eventuell wieder setzen +} + +void TextEditImp::Paint( const Rectangle& rRect ){ pTextView->Paint( rRect );} +void TextEditImp::MouseButtonUp( const MouseEvent& rMouseEvent ){ pTextView->MouseButtonUp( rMouseEvent );} +//void TextEditImp::MouseButtonDown( const MouseEvent& rMouseEvent ){ pTextView->MouseButtonDown( rMouseEvent );} +//void TextEditImp::MouseMove( const MouseEvent& rMouseEvent ){ pTextView->MouseMove( rMouseEvent );} +//void TextEditImp::Command( const CommandEvent& rCEvt ){ pTextView->Command( rCEvt );} +BOOL TextEditImp::Drop( const DropEvent& rEvt ){ return pTextView->Drop( rEvt );} +BOOL TextEditImp::QueryDrop( DropEvent& rEvt ){ return pTextView->QueryDrop( rEvt );} + + +void TextEditImp::Command( const CommandEvent& rCEvt ) +{ + switch( rCEvt.GetCommand() ) { + case COMMAND_CONTEXTMENU: + GetParent()->Command( rCEvt ); + break; + default: + pTextView->Command( rCEvt ); + } +} + + +void TextEditImp::MouseButtonDown( const MouseEvent& rMouseEvent ) +{ + pTextView->MouseButtonDown( rMouseEvent ); + HideVarContents( NULL ); + ShowTipTimer.Stop(); +} + + +void TextEditImp::MouseMove( const MouseEvent& rMEvt ) +{ + pTextView->MouseMove( rMEvt ); + HideVarContents( NULL ); + if ( rMEvt.GetButtons() == 0 ) + ShowTipTimer.Start(); + if ( rMEvt.IsLeaveWindow() ) + ShowTipTimer.Stop(); +} + + +IMPL_LINK( TextEditImp, HideVarContents, void*, EMPTYARG ) +{ + if ( nTipId ) + { + Help::HideTip( nTipId ); + nTipId = 0; + aTipWord = String(); + } + return 0; +} + +static const char cSuffixes[] = "%&!#@$"; + + +SbxBase* TextEditImp::GetSbxAtMousePos( String &aWord ) +{ + Point aPos = GetPointerPosPixel(); + Point aDocPos = pTextView->GetDocPos( aPos ); + aWord = pTextEngine->GetWord( pTextEngine->GetPaM( aDocPos ) ); + + if ( aWord.Len() && !Application::GetAppInternational().IsNumeric( aWord ) ) + { + xub_StrLen nLastChar = aWord.Len()-1; + String aSuffixes = CUniString( cSuffixes ); + if ( aSuffixes.Search( aWord.GetChar(nLastChar) ) != STRING_NOTFOUND ) + aWord.Erase( nLastChar, 1 ); + + BOOL bWasError = SbxBase::IsError(); // Da eventuell im Testtool ein Fehler geschmissen wird. + SbxBase* pSBX = StarBASIC::FindSBXInCurrentScope( aWord ); + if ( !bWasError && SbxBase::IsError() ) + SbxBase::ResetError(); + + return pSBX; + } + return NULL; +} + + +IMPL_LINK( TextEditImp, ShowVarContents, void*, EMPTYARG ) +{ + String aWord; + SbxBase* pSBX = GetSbxAtMousePos( aWord ); + String aHelpText; + Point aPos = GetPointerPosPixel(); + + if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) ) + { + SbxVariable* pVar = (SbxVariable*)pSBX; + SbxDataType eType = pVar->GetType(); + if ( (BYTE)eType == (BYTE)SbxOBJECT ) + { + // Kann zu Absturz, z.B. bei Selections-Objekt fuehren + // Type == Object heisst nicht, dass pVar == Object! + if ( pVar->GetObject() && pVar->GetObject()->ISA( SbxObject ) ) + aHelpText = ((SbxObject*)(pVar->GetObject()))->GetClassName(); + else + aHelpText = CUniString("Object"); + } + else if ( eType & SbxARRAY ) + aHelpText = CUniString("{...}"); + else if ( (BYTE)eType != (BYTE)SbxEMPTY ) + { + aHelpText = pVar->GetName(); + if ( !aHelpText.Len() ) // Bei Uebergabeparametern wird der Name nicht kopiert + aHelpText = aWord; + aHelpText += '='; + aHelpText += pVar->GetString(); + } + } + + + if ( aHelpText.Len() && aTipPos != aPos && aTipWord != aWord ) + { + if ( nTipId ) + Help::HideTip( nTipId ); + nTipId = Help::ShowTip( this, Rectangle(), aHelpText ); + + HideTipTimer.Start(); + aTipWord = aWord; + aTipPos = aPos; + } + if ( nTipId && aTipPos != aPos ) + { + Help::HideTip( nTipId ); + nTipId = 0; + aTipWord = String(); + } + + return 0; +} + + +void TextEditImp::BuildKontextMenu( PopupMenu *&pMenu ) +{ + String aWord; + SbxBase* pSBX = GetSbxAtMousePos( aWord ); + if ( pSBX && pSBX->ISA( SbxVariable ) && !pSBX->ISA( SbxMethod ) ) + { + SbxVariable* pVar = (SbxVariable*)pSBX; + SbxDataType eType = pVar->GetType(); + + if ( ( eType & ( SbxVECTOR | SbxARRAY | SbxBYREF )) == 0 ) + { + +/* +Boolean +Currency +Date +Double +Integer +Long +Object +Single +String +Variant(Empty) +*/ + switch ( eType ) + { + case SbxBOOL: +// case SbxCURRENCY: +// case SbxDATE: + case SbxDOUBLE: + case SbxINTEGER: + case SbxLONG: +// case SbxOBJECT: // kann nicht editiert werden + case SbxSINGLE: + case SbxSTRING: + + case SbxVARIANT: // Taucht wohl auch nicht auf. stattdessen SbxEMPTY + case SbxEMPTY: + { + pAppEdit->GetBasicFrame()->SetEditVar( pVar ); + if ( !pMenu ) + pMenu = new PopupMenu(); + else + pMenu->InsertSeparator(); + + pMenu->InsertItem( RID_POPUPEDITVAR, ((BasicFrame*)GetpApp()->GetAppWindow())->GenRealString( GEN_RES_STR1( IDS_EDIT_VAR, aWord ) ) ); + } + break; + } + } + } +} + + + + +DBG_NAME(TextEdit) + +TextEdit::TextEdit( AppEdit* pParent, const WinBits& aBits ) +: aEdit( pParent, aBits | WB_NOHIDESELECTION ) +, pBreakpointWindow( NULL ) +, bFileWasUTF8( FALSE ) +, bSaveAsUTF8( FALSE ) +{ +DBG_CTOR(TextEdit,0); + Font aFont(System::GetStandardFont(STDFONT_FIXED)); + aFont.SetTransparent( FALSE ); + SetFont( aFont ); +} + +TextEdit::~TextEdit() +{DBG_DTOR(TextEdit,0);} + +void TextEdit::Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ) +{ + if ( nLine ) // Kann eigentlich nicht vorkommen, auer bei Fehler 'Sub erwartet' in erster Zeile + nLine--; + + String s = aEdit.pTextEngine->GetText( nLine ); + + if( nCol1 == STRING_NOTFOUND ) + // Keine Spalte angegeben + nCol1 = 0, nCol2 = STRING_NOTFOUND; + if( nCol2 == STRING_NOTFOUND ) + { + nCol2 = s.Len(); + } + // Anpassung an den Precompiler | EditText != Compilierter Text + if ( nCol2 > s.Len() ) + nCol2 = s.Len(); + if ( nCol1 >= nCol2 ) + nCol1 = 0; + + // Da nCol2 u.U. hinter das aktuelle Statement zeigt + // (weil dort schon das naechste beginnt), muessen + // wird am Ende evtl. Whitespace, einen Doppelpunkt + // und mehr Whitespace entfernen + BOOL bColon = FALSE; + + while ( s.GetChar( nCol2 ) == ' ' && nCol2 > nCol1 && !bColon ) + { + nCol2--; + if ( s.GetChar( nCol2 ) == ':' ) + { + nCol2--; + bColon = TRUE; + } + } + + aEdit.pTextView->SetSelection( TextSelection(TextPaM(nLine,nCol2+1)) ); + aEdit.pTextView->SetSelection( TextSelection(TextPaM(nLine,nCol2+1), TextPaM(nLine,nCol1)) ); +} + + +void TextEdit::Delete(){ aEdit.pTextView->KeyInput( KeyEvent( 0, KeyCode( KEYFUNC_DELETE ) )); } +void TextEdit::Cut(){ aEdit.pTextView->Cut(); } +void TextEdit::Copy(){ aEdit.pTextView->Copy(); } +void TextEdit::Paste(){ aEdit.pTextView->Paste(); } +void TextEdit::Undo(){ aEdit.pTextView->Undo(); } +void TextEdit::Redo(){ aEdit.pTextView->Redo(); } +String TextEdit::GetSelected(){ return aEdit.pTextView->GetSelected(); } +TextSelection TextEdit::GetSelection() const{ return aEdit.pTextView->GetSelection(); } +void TextEdit::SetSelection( const TextSelection& rSelection ){ aEdit.pTextView->SetSelection( rSelection ); } + +USHORT TextEdit::GetLineNr() const +{ + return aEdit.pTextView->GetSelection().GetEnd().GetPara()+1; +} + +void TextEdit::ReplaceSelected( const String& rStr ){ aEdit.pTextView->InsertText(rStr); } +BOOL TextEdit::IsModified(){ return aEdit.IsModified(); } + +String TextEdit::GetText() const +{ + return aEdit.pTextEngine->GetText( GetSystemLineEnd() ); +} + +void TextEdit::SetText( const String& rStr ){ aEdit.pTextEngine->SetText(rStr); aEdit.pTextEngine->SetModified( FALSE ); } +void TextEdit::SetModifyHdl( Link l ){ aEdit.SetModifyHdl(l); } +BOOL TextEdit::HasText() const { return aEdit.pTextEngine->GetTextLen() > 0; } + +// Es wird entweder ab Beginn oder ab Markierungsbegin + 1 gesucht. + +BOOL TextEdit::Find( const String& s ) +{ + DBG_CHKTHIS(TextEdit,0); + + TextSelection aSelection = aEdit.pTextView->GetSelection(); + USHORT nPara = aSelection.GetStart().GetPara(); + xub_StrLen nIndex = aSelection.GetStart().GetIndex(); + + if ( aSelection.HasRange() ) + nIndex ++; + + while ( nPara <= aEdit.pTextEngine->GetParagraphCount() ) + { + String aText = aEdit.pTextEngine->GetText( nPara ); + + nIndex = aText.Search( s, nIndex ); + if( nIndex != STRING_NOTFOUND ) + { + aEdit.pTextView->SetSelection( TextSelection( TextPaM( nPara, nIndex ), TextPaM( nPara, nIndex + s.Len() ) ) ); + return TRUE; + } + nIndex = 0; + nPara++; + } + return FALSE; +} + +BOOL TextEdit::Load( const String& aName ) +{ +DBG_CHKTHIS(TextEdit,0); + BOOL bOk = TRUE; + SvFileStream aStrm( aName, STREAM_STD_READ ); + if( aStrm.IsOpen() ) + { + String aText, aLine; + BOOL bIsFirstLine = TRUE; + rtl_TextEncoding aFileEncoding = RTL_TEXTENCODING_IBM_850; + while( !aStrm.IsEof() && bOk ) + { + aStrm.ReadByteStringLine( aLine, aFileEncoding ); + if ( bIsFirstLine && aLine.EqualsAscii( TT_SIGNATURE_FOR_UNICODE_TEXTFILES ) ) + { + aFileEncoding = RTL_TEXTENCODING_UTF8; + bFileWasUTF8 = TRUE; + } + else + { + if ( !bIsFirstLine ) + aText += '\n'; + aText += aLine; + bIsFirstLine = FALSE; + } + if( aStrm.GetError() != SVSTREAM_OK ) + bOk = FALSE; + } + aText.ConvertLineEnd(); + SetText( aText ); + } + else + bOk = FALSE; + return bOk; +} + +BOOL TextEdit::Save( const String& aName ) +{ +DBG_CHKTHIS(TextEdit,0); + BOOL bOk = TRUE; + SvFileStream aStrm( aName, STREAM_STD_WRITE | STREAM_TRUNC ); + rtl_TextEncoding aFileEncoding = RTL_TEXTENCODING_IBM_850; + if( aStrm.IsOpen() ) + { + if ( bFileWasUTF8 || bSaveAsUTF8 ) + { + aStrm << TT_SIGNATURE_FOR_UNICODE_TEXTFILES; + aStrm << sal_Char(_CR); + aStrm << sal_Char(_LF); + aFileEncoding = RTL_TEXTENCODING_UTF8; + } + String aSave = GetText(); + aSave.ConvertLineEnd(LINEEND_CRLF); + aStrm << ByteString( aSave, aFileEncoding ).GetBuffer(); + if( aStrm.GetError() != SVSTREAM_OK ) + bOk = FALSE; + else + aEdit.pTextEngine->SetModified(FALSE); + } else bOk = FALSE; + return bOk; +} + + +void TextEdit::BuildKontextMenu( PopupMenu *&pMenu ) +{ + DataEdit::BuildKontextMenu( pMenu ); + aEdit.BuildKontextMenu( pMenu ); +} + + diff --git a/basic/source/app/textedit.hxx b/basic/source/app/textedit.hxx new file mode 100644 index 000000000000..a96123b507c9 --- /dev/null +++ b/basic/source/app/textedit.hxx @@ -0,0 +1,178 @@ +/************************************************************************* + * + * $RCSfile: textedit.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _TEXTEDIT_HXX +#define _TEXTEDIT_HXX + +class AppEdit; +class TextEngine; +class TextView; +class TextEdit; +class BreakpointWindow; + +#ifndef _SV_TIMER_HXX //autogen +#include <vcl/timer.hxx> +#endif +#ifndef _TOOLS_TABLE_HXX //autogen +#include <tools/table.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX //autogen +#include <tools/debug.hxx> +#endif +#ifndef _SFXLSTNER_HXX //autogen +#include <svtools/lstner.hxx> +#endif +#ifdef VCL +#include <svtools/svmedit.hxx> +#endif + +#include "dataedit.hxx" + +//#include <xtextedt.hxx> + +class TextEditImp : public Window, public SfxListener +{ +protected: + void DoSyntaxHighlight( ULONG nPara ); + + +private: + AppEdit *pAppEdit; + Link ModifyHdl; + + Timer aSyntaxIdleTimer; + Timer aImplSyntaxIdleTimer; + DECL_LINK( SyntaxTimerHdl, Timer * ); + Table aSyntaxLineTable; + + void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + void ImpDoHighlight( const String& rSource, ULONG nLineOff ); + BOOL bHighlightning; + BOOL bDoSyntaxHighlight; + BOOL bDelayHighlight; + + + SbxBase* GetSbxAtMousePos( String &aWord ); + virtual void MouseMove( const MouseEvent& rMEvt ); + DECL_LINK( HideVarContents, void* ); + DECL_LINK( ShowVarContents, void* ); + Point aTipPos; + String aTipWord; + ULONG nTipId; + + Timer HideTipTimer; + Timer ShowTipTimer; + + +public: + TextEditImp( AppEdit *pParent, const WinBits& aBits ); + ~TextEditImp(); + + TextEngine *pTextEngine; + TextView *pTextView; + + void SetFont( const Font& rNewFont ); + BOOL IsModified(); + void SetModifyHdl( Link l ){ ModifyHdl = l; } + + void KeyInput( const KeyEvent& rKeyEvent ); + void Paint( const Rectangle& rRect ); + void MouseButtonUp( const MouseEvent& rMouseEvent ); + void MouseButtonDown( const MouseEvent& rMouseEvent ); +// void MouseMove( const MouseEvent& rMouseEvent ); + void Command( const CommandEvent& rCEvt ); + BOOL Drop( const DropEvent& rEvt ); + BOOL QueryDrop( DropEvent& rEvt ); + + + void DoDelayedSyntaxHighlight( xub_StrLen nPara ); + void InvalidateSyntaxHighlight(); + void SyntaxHighlight( BOOL bNew ); + void BuildKontextMenu( PopupMenu *&pMenu ); +}; + + + +DBG_NAMEEX(TextEdit) +class TextEdit : public DataEdit { + + BreakpointWindow *pBreakpointWindow; + BOOL bFileWasUTF8; + BOOL bSaveAsUTF8; + +public: + TextEdit( AppEdit*, const WinBits& ); + ~TextEdit(); + void Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); + TextEditImp& GetTextEditImp() { return aEdit; } + + void SetBreakpointWindow( BreakpointWindow *pBPWindow ){ pBreakpointWindow = pBPWindow; } + BreakpointWindow *GetBreakpointWindow(){ return pBreakpointWindow; } + + DATA_FUNC_DEF( aEdit, TextEditImp ) + + virtual void BuildKontextMenu( PopupMenu *&pMenu ); + + void SaveAsUTF8( BOOL bUTF8 ) { bSaveAsUTF8 = bUTF8; } +}; + +#endif diff --git a/basic/source/app/ttbasic.cxx b/basic/source/app/ttbasic.cxx new file mode 100644 index 000000000000..c80ecae055ca --- /dev/null +++ b/basic/source/app/ttbasic.cxx @@ -0,0 +1,66 @@ +/************************************************************************* + * + * $RCSfile: ttbasic.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#include "mybasic.hxx" +#include "ttbasic.hxx" + +MyBasic* TTBasic::CreateMyBasic() +{ + return new MyBasic; diff --git a/basic/source/app/ttbasic.hxx b/basic/source/app/ttbasic.hxx new file mode 100644 index 000000000000..1dc5fbeb7b09 --- /dev/null +++ b/basic/source/app/ttbasic.hxx @@ -0,0 +1,66 @@ +/************************************************************************* + * + * $RCSfile: ttbasic.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +class TTBasic +{ +public: + static MyBasic* CreateMyBasic(); +}; + diff --git a/basic/source/app/ttmsg.src b/basic/source/app/ttmsg.src new file mode 100644 index 000000000000..c19e892d5243 --- /dev/null +++ b/basic/source/app/ttmsg.src @@ -0,0 +1,659 @@ +/************************************************************************* + * + * $RCSfile: ttmsg.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#include "ttmsg.hrc" + + +// Hier sind die Messages aus dem Verzeichnis /basic/source/testtool enhalten + + +/////////////////////////////// +// Fehlermeldungen, die in das Resultfile gelangen. +// ********************* +// *** !!ACHTUNG!! *** +// ********************* +// Die Nummern drfen sich NIE! ndern, +// da sie in den Resultfiles gespeichert sind, und bei erneutem Anzeigen +// statdessen die entsprechenden neuen oder garkeine Strings angzeigt werden. +/////////////////////////////// +String S_NAME_NOT_THERE +{ + Text = "Name nicht vorhanden: #($Arg1)"; + Text[ english_us ] = "Name doesn't exist: #($Arg1)"; + Text[ portuguese ] = "Nome inexistente: #($Arg1)"; + Text[ russian ] = "Name doesn't exist: #($Arg1)"; + Text[ greek ] = "Name doesn't exist: #($Arg1)"; + Text[ dutch ] = "Naam bestaat niet: #($Arg1)"; + Text[ french ] = "Nom inexistant : #($Arg1)"; + Text[ spanish ] = "El nombre no existe: #($Arg1)"; + Text[ italian ] = "Name doesn't exist: #($Arg1)"; + Text[ danish ] = "Name doesn't exist: #($Arg1)"; + Text[ swedish ] = "Name doesn't exist: #($Arg1)"; + Text[ polish ] = "Nazwa nie istnieje: #($Arg1)"; + Text[ portuguese_brazilian ] = "Name nicht vorhanden: #($Arg1)"; + Text[ japanese ] = "̖O݂͑Ă܂: #($Arg1)"; + Text[ korean ] = "̸ ʽϴ: #($Arg1)"; + Text[ chinese_simplified ] = "Ʋڣ#($Arg1)"; + Text[ chinese_traditional ] = "W٤sbG #($Arg1)"; + Text[ arabic ] = "Name doesn't exist: #($Arg1)"; + Text[ turkish ] = "Name doesn't exist: #($Arg1)"; +}; +String S_DOUBLE_NAME +{ + Text = "Name Doppelt: ($Arg1)"; + Text[ english_us ] = "Name double: ($Arg1)"; + Text[ portuguese ] = "Nome duplo: ($Arg1)"; + Text[ russian ] = "Name double: ($Arg1)"; + Text[ greek ] = "Name double: ($Arg1)"; + Text[ dutch ] = "Dubbele naam: ($Arg1)"; + Text[ french ] = "Nome double : ($Arg1)"; + Text[ spanish ] = "Nombre doble: ($Arg1)"; + Text[ italian ] = "Name double: ($Arg1)"; + Text[ danish ] = "Name double: ($Arg1)"; + Text[ swedish ] = "Name double: ($Arg1)"; + Text[ polish ] = "Podwjna nazwa: ($Arg1)"; + Text[ portuguese_brazilian ] = "Name Doppelt: ($Arg1)"; + Text[ japanese ] = "OdĂ܂: ($Arg1)"; + Text[ korean ] = "̸ ߺǾϴ. : ($Arg1)"; + Text[ chinese_simplified ] = "˫ƣ($Arg1)"; + Text[ chinese_traditional ] = "WG($Arg1)"; + Text[ arabic ] = "Name double: ($Arg1)"; + Text[ turkish ] = "Name double: ($Arg1)"; +}; +String S_READING_FILE +{ + Text = "Einlesen der Dateien"; + Text[ english_us ] = "Reading the files"; + Text[ portuguese ] = "Leitura dos ficheiros"; + Text[ russian ] = "Reading the files"; + Text[ greek ] = "Reading the files"; + Text[ dutch ] = "Bestanden lezen"; + Text[ french ] = "Lecture des fichiers"; + Text[ spanish ] = "Leyendo los archivos"; + Text[ italian ] = "Reading the files"; + Text[ danish ] = "Reading the files"; + Text[ swedish ] = "Reading the files"; + Text[ polish ] = "Czytanie plikw"; + Text[ portuguese_brazilian ] = "Einlesen der Dateien"; + Text[ japanese ] = "̧ق̓ǂݍ"; + Text[ korean ] = " б"; + Text[ chinese_simplified ] = "ȡļ"; + Text[ chinese_traditional ] = "Ūɮ"; + Text[ arabic ] = "Reading the files"; + Text[ turkish ] = "Reading the files"; +}; +String S_CANNOT_OPEN_FILE +{ + Text = "Kann Datei nicht ffnen: ($Arg1)"; + Text[ english_us ] = "File cannot be opened: ($Arg1)"; + Text[ portuguese ] = "Impossvel abrir ficheiro: ($Arg1)"; + Text[ russian ] = "File cannot be opened: ($Arg1)"; + Text[ greek ] = "File cannot be opened: ($Arg1)"; + Text[ dutch ] = "Kan bestand niet openen: ($Arg1)"; + Text[ french ] = "Impossible d'ouvrir le fichier : ($Arg1)"; + Text[ spanish ] = "No se puede abrir el archivo: ($Arg1)"; + Text[ italian ] = "File cannot be opened: ($Arg1)"; + Text[ danish ] = "File cannot be opened: ($Arg1)"; + Text[ swedish ] = "File cannot be opened: ($Arg1)"; + Text[ polish ] = "Nie moe otworzy pliku: ($Arg1)"; + Text[ portuguese_brazilian ] = "Kann Datei nicht ffnen: ($Arg1)"; + Text[ japanese ] = "̧قJ܂: ($Arg1)"; + Text[ korean ] = " ʽϴ: ($Arg1)"; + Text[ chinese_simplified ] = "ļ($Arg1)"; + Text[ chinese_traditional ] = "Lk}ɮסG ($Arg1)"; + Text[ arabic ] = "File cannot be opened: ($Arg1)"; + Text[ turkish ] = "File cannot be opened: ($Arg1)"; +}; +String S_INVALID_LINE +{ + Text = "Zeile \"($Arg1)\" Ist ungltig."; + Text[ english_us ] = "Line \"($Arg1)\" is invalid."; + Text[ portuguese ] = "A linha \"($Arg1)\" no vlida."; + Text[ russian ] = "Line \"($Arg1)\" is invalid."; + Text[ greek ] = "Line \"($Arg1)\" is invalid."; + Text[ dutch ] = "Regel \"($Arg1)\" is ongeldig."; + Text[ french ] = "Ligne \"($Arg1)\" non valable."; + Text[ spanish ] = "La lnea \"($Arg1)\" no es vlida."; + Text[ italian ] = "Line \"($Arg1)\" is invalid."; + Text[ danish ] = "Line \"($Arg1)\" is invalid."; + Text[ swedish ] = "Line \"($Arg1)\" is invalid."; + Text[ polish ] = "Wiersz \"($Arg1)\" jest niewany."; + Text[ portuguese_brazilian ] = "Zeile \"($Arg1)\" Ist ungltig."; + Text[ japanese ] = "s \"($Arg1)\" ͖łB"; + Text[ korean ] = " \"($Arg1)\" ȿ ʽϴ."; + Text[ chinese_simplified ] = "ЧС($Arg1)"; + Text[ chinese_traditional ] = " \"($Arg1)\" LġC"; + Text[ arabic ] = "Line \"($Arg1)\" is invalid."; + Text[ turkish ] = "Line \"($Arg1)\" is invalid."; +}; +String S_SHORTNAME_UNKNOWN +{ + Text = "Kurzname Unbekannt beim Kopieren: ($Arg1)"; + Text[ english_us ] = "Short name unknown during copying: ($Arg1)"; + Text[ portuguese ] = "Abreviatura desconhecida ao copiar: ($Arg1)"; + Text[ russian ] = "Short name unknown during copying: ($Arg1)"; + Text[ greek ] = "Short name unknown during copying: ($Arg1)"; + Text[ dutch ] = "Afkorting onbekend bij kopiren: ($Arg1)"; + Text[ french ] = "Abrviation inconnue lors de la copie : ($Arg1)"; + Text[ spanish ] = "Abreviatura desconocida al copiar: ($Arg1)"; + Text[ italian ] = "Short name unknown during copying: ($Arg1)"; + Text[ danish ] = "Short name unknown during copying: ($Arg1)"; + Text[ swedish ] = "Short name unknown during copying: ($Arg1)"; + Text[ polish ] = "Skrt nazwy nieznany podczas kopiowania: ($Arg1)"; + Text[ portuguese_brazilian ] = "Kurzname Unbekannt beim Kopieren: ($Arg1)"; + Text[ japanese ] = "Short name unknown during copying: ($Arg1)"; + Text[ korean ] = "Ǵ ˼ ª ̸: ($Arg1)"; + Text[ chinese_simplified ] = "ʱļƣ($Arg1)"; + Text[ chinese_traditional ] = "`ɵuW٤G($Arg1)"; + Text[ arabic ] = "Short name unknown during copying: ($Arg1)"; + Text[ turkish ] = "Short name unknown during copying: ($Arg1)"; +}; +String S_LONGNAME_UNKNOWN +{ + Text = "Kurzname Unbekannt beim Kopieren: ($Arg1)"; + Text[ english_us ] = "Short name unknown during copying: ($Arg1)"; + Text[ portuguese ] = "Abreviatura desconhecida ao copiar: ($Arg1)"; + Text[ russian ] = "Short name unknown during copying: ($Arg1)"; + Text[ greek ] = "Short name unknown during copying: ($Arg1)"; + Text[ dutch ] = "Afkorting onbekend bij kopiren: ($Arg1)"; + Text[ french ] = "Abrviation inconnue lors de la copie : ($Arg1)"; + Text[ spanish ] = "Abreviatura desconocida al copiar: ($Arg1)"; + Text[ italian ] = "Short name unknown during copying: ($Arg1)"; + Text[ danish ] = "Short name unknown during copying: ($Arg1)"; + Text[ swedish ] = "Short name unknown during copying: ($Arg1)"; + Text[ polish ] = "Skrt nazwy nieznany podczas kopiowania: ($Arg1)"; + Text[ portuguese_brazilian ] = "Kurzname Unbekannt beim Kopieren: ($Arg1)"; + Text[ japanese ] = "Short name unknown during copying: ($Arg1)"; + Text[ korean ] = "Ǵ ˼ ª ̸: ($Arg1)"; + Text[ chinese_simplified ] = "ʱļƣ($Arg1)"; + Text[ chinese_traditional ] = "`ɵuW٤G($Arg1)"; + Text[ arabic ] = "Short name unknown during copying: ($Arg1)"; + Text[ turkish ] = "Short name unknown during copying: ($Arg1)"; +}; +String S_FIRST_SHORTNAME_REQ_ASTRX +{ + Text = "Erster Kurzname muss mit * beginnen. berspringe."; + Text[ english_us ] = "First short name must start with * . Ignore."; + Text[ portuguese ] = "A primeira abreviatura dever comear com *. Ignorar."; + Text[ russian ] = "First short name must start with * . Leave out."; + Text[ greek ] = "First short name must start with * . Ignore."; + Text[ dutch ] = "Eerste afkorting moet beginnen met *. Overslaan."; + Text[ french ] = "La premire abrviation doit commencer par *. Ignorer."; + Text[ spanish ] = "La primera abreviatura debe comenzar con *. Ignorar."; + Text[ italian ] = "First short name must start with * . Ignore."; + Text[ danish ] = "First short name must start with *. Ignore. "; + Text[ swedish ] = "First short name must start with * . Ignore."; + Text[ polish ] = "Pierwszy skrt nazwy musi si zaczyna na * . Omi."; + Text[ portuguese_brazilian ] = "Erster Kurzname mu mit * beginnen. berspringe."; + Text[ japanese ] = "First short name must start with * . Ignore."; + Text[ korean ] = "ù° ª ̸ ݵ * . Ignore Բ Ǿ մϴ."; + Text[ chinese_simplified ] = "һƱ * ͷʡԡ"; + Text[ chinese_traditional ] = "Ĥ@ӵuW٥H * }lCC"; + Text[ arabic ] = "First short name must start with * . Leave out."; + Text[ turkish ] = "First short name must start with * . Ignore."; +}; +String S_TIMOUT_WAITING +{ + Text = "Server Timeout beim Warten auf Antwort. Sequenz Nr: ($Arg1)"; + Text[ english_us ] = "Server Timeout while waiting for answer. Sequence No: ($Arg1)"; + Text[ portuguese ] = "Server Timeout ao esperar pela resposta. Sequncia n: ($Arg1)"; + Text[ russian ] = "Server Timeout while waiting for answer. Sequence No: ($Arg1)"; + Text[ greek ] = "Server Timeout while waiting for answer. Sequence No: ($Arg1)"; + Text[ dutch ] = "Server timeout bij het wachten op antwoord. Sequentie nr: ($Arg1)"; + Text[ french ] = "Timeout du serveur lors de l'attente de la rponse. N de squence : ($Arg1)"; + Text[ spanish ] = "Server Timeout al esperar por respuesta. Secuencia nm.: ($Arg1)"; + Text[ italian ] = "Server Timeout while waiting for answer. Sequence No: ($Arg1)"; + Text[ danish ] = "Server Timeout while waiting for answer. Sequence No: ($Arg1)"; + Text[ swedish ] = "Server Timeout while waiting for answer. Sequence No: ($Arg1)"; + Text[ polish ] = "Server Timeout podczas czekania na odpowied. Numer sekwencji: ($Arg1)"; + Text[ portuguese_brazilian ] = "Server Timeout beim Warten auf Antwort. Sequenz Nr: ($Arg1)"; + Text[ japanese ] = "҂̍ۂ̻ްѱāBݽNo.: ($Arg1)"; + Text[ korean ] = " ٸ Ÿ ƿ. Ϸ ȣ: ($Arg1)"; + Text[ chinese_simplified ] = "ڵȺʱʱкţ($Arg1)"; + Text[ chinese_traditional ] = "AԵ`WɡCǦCXG ($Arg1)"; + Text[ arabic ] = "Server Timeout while waiting for answer. Sequence No: ($Arg1)"; + Text[ turkish ] = "Server Timeout while waiting for answer. Sequence No: ($Arg1)"; +}; +String S_APPLICATION_RESTARTED +{ + Text = "Applikation wurde neu gestartet."; + Text[ english_us ] = "Application has been restarted."; + Text[ portuguese ] = "A aplicao foi reiniciada."; + Text[ russian ] = "Application has been restarted."; + Text[ greek ] = "Application has been restarted."; + Text[ dutch ] = "Applicatie werd opnieuw gestart"; + Text[ french ] = "L'application a t redmarre."; + Text[ spanish ] = "Se reinici la aplicacin."; + Text[ italian ] = "Application has been restarted."; + Text[ danish ] = "Application has been restarted."; + Text[ swedish ] = "Application has been restarted."; + Text[ polish ] = "Aplikacja zostaa ponownie uruchomiona."; + Text[ portuguese_brazilian ] = "Applikation wurde neu gestartet."; + Text[ japanese ] = "ع݂͍ĽĂ܂B"; + Text[ korean ] = "α ٽ Ǿϴ."; + Text[ chinese_simplified ] = "ӦóѾ"; + Text[ chinese_traditional ] = "sҰʤFε{C"; + Text[ arabic ] = "Application has been restarted."; + Text[ turkish ] = "Application has been restarted."; +}; +String S_APPLICATION_START_FAILED +{ + Text = "Applikation \"($Arg1)\" kann nicht gestartet werden. "; + Text[ english_us ] = "Application \"($Arg1)\" cannot be started. "; + Text[ portuguese ] = "Impossvel iniciar a aplicao \"($Arg1)\". "; + Text[ russian ] = "Application \"($Arg1)\" cannot be started. "; + Text[ greek ] = "Application \"($Arg1)\" cannot be started. "; + Text[ dutch ] = "Applicatie \"($Arg1)\" kan niet worden gestart. "; + Text[ french ] = "Impossible de lancer l'application \"($Arg1)\". "; + Text[ spanish ] = "No se puede iniciar la aplicacin \"($Arg1)\". "; + Text[ italian ] = "Application \"($Arg1)\" cannot be started. "; + Text[ danish ] = "Application \"($Arg1)\" cannot be started. "; + Text[ swedish ] = "Application \"($Arg1)\" cannot be started. "; + Text[ polish ] = "Nie mona uruchomi aplikacji \"($Arg1)\". "; + Text[ portuguese_brazilian ] = "Applikation \"($Arg1)\" kann nicht gestartet werden. "; + Text[ japanese ] = "ع \"($Arg1)\" ͽĂł܂B "; + Text[ korean ] = "α \"($Arg1)\" ۵ɼ ϴ. "; + Text[ chinese_simplified ] = "Ӧó($Arg1) "; + Text[ chinese_traditional ] = "LkҰε{ \"($Arg1)\" C "; + Text[ arabic ] = "Application \"($Arg1)\" cannot be started. "; + Text[ turkish ] = "Application \"($Arg1)\" cannot be started. "; +}; +String S_TIMOUT_SENDING +{ + Text = "Server Timeout beim Senden. Sequenz Nr: ($Arg1)"; + Text[ english_us ] = "Server Timeout while sending. Sequence No: ($Arg1)"; + Text[ portuguese ] = "Server Timeout ao enviar. Sequncia n: ($Arg1)"; + Text[ russian ] = "Server Timeout while sending. Sequence No: ($Arg1)"; + Text[ greek ] = "Server Timeout while sending. Sequence No: ($Arg1)"; + Text[ dutch ] = "Server timeout bij het zenden. Sequentie nr: ($Arg1)"; + Text[ french ] = "Timeout du serveur lors de l'envoi. N de squence : ($Arg1)"; + Text[ spanish ] = "Server Timeout al enviar. Secuencia nm.: ($Arg1)"; + Text[ italian ] = "Server Timeout while sending. Sequence No: ($Arg1)"; + Text[ danish ] = "Server Timeout while sending. Sequence No: ($Arg1)"; + Text[ swedish ] = "Server Timeout while sending. Sequence No: ($Arg1)"; + Text[ polish ] = "Server Timeout podczas wysyania. Numer sekwencji: ($Arg1)"; + Text[ portuguese_brazilian ] = "Server Timeout beim Senden. Sequenz Nr: ($Arg1)"; + Text[ japanese ] = "M̍ۂ̻ްѱāBݽNo.: ($Arg1)"; + Text[ korean ] = " Ÿ ƿ. Ϸ ȣ: ($Arg1)"; + Text[ chinese_simplified ] = "ڼķʱʱкţ($Arg1)"; + Text[ chinese_traditional ] = "AoeɶWɡCǦCXG ($Arg1)"; + Text[ arabic ] = "Server Timeout while sending. Sequence No: ($Arg1)"; + Text[ turkish ] = "Server Timeout while sending. Sequence No: ($Arg1)"; +}; +String S_NO_CONNECTION +{ + Text = "Keine Verbindung. Sequenz Nr: ($Arg1)"; + Text[ english_us ] = "No connection. Sequence No: ($Arg1)"; + Text[ portuguese ] = "Sem ligao. Sequncia n: ($Arg1)"; + Text[ russian ] = "No connection. Sequence No: ($Arg1)"; + Text[ greek ] = "No connection. Sequence No: ($Arg1)"; + Text[ dutch ] = "Geen verbinding. Sequentie nr: ($Arg1)"; + Text[ french ] = "Aucune connexion. N de squence : ($Arg1)"; + Text[ spanish ] = "Sin conexin. Secuencia nm.: ($Arg1)"; + Text[ italian ] = "No connection. Sequence No: ($Arg1)"; + Text[ danish ] = "No connection. Sequence No: ($Arg1)"; + Text[ swedish ] = "No connection. Sequence No: ($Arg1)"; + Text[ polish ] = "Brak poczenia. Numer sekwencji: ($Arg1)"; + Text[ portuguese_brazilian ] = "Keine Verbindung. Sequenz Nr: ($Arg1)"; + Text[ japanese ] = "ڑȂBݽNo.: ($Arg1)"; + Text[ korean ] = " ȵǾϴ. Ϸùȣ: ($Arg1)"; + Text[ chinese_simplified ] = "ûӡкţ($Arg1)"; + Text[ chinese_traditional ] = "LksuCǦCXG($Arg1)"; + Text[ arabic ] = "No connection. Sequence No: ($Arg1)"; + Text[ turkish ] = "No connection. Sequence No: ($Arg1)"; +}; +String S_NO_FILES_FOUND +{ + Text = "Keine ($Arg1) Dateien gefunden"; + Text[ english_us ] = "No ($Arg1) files found"; + Text[ portuguese ] = "No foram encontrados quaisquer ficheiros ($Arg1)"; + Text[ russian ] = "No ($Arg1) files found"; + Text[ greek ] = "No ($Arg1) files found"; + Text[ dutch ] = "Geen ($Arg1) bestanden gevonden"; + Text[ french ] = "Aucun fichier ($Arg1) dtect"; + Text[ spanish ] = "No se encontr ningn archivo ($Arg1)"; + Text[ italian ] = "No ($Arg1) files found"; + Text[ danish ] = "No ($Arg1) files found"; + Text[ swedish ] = "No ($Arg1) files found"; + Text[ polish ] = "Nie znaleziono plikw ($Arg1)"; + Text[ portuguese_brazilian ] = "Keine ($Arg1) Dateien gefunden"; + Text[ japanese ] = "($Arg1)̧ق͌܂B"; + Text[ korean ] = "($Arg1) ߰ߵ ʽϴ."; + Text[ chinese_simplified ] = "ûҵ ($Arg1) ļ"; + Text[ chinese_traditional ] = "S ($Arg1) ɮ"; + Text[ arabic ] = "No ($Arg1) files found"; + Text[ turkish ] = "No ($Arg1) files found"; +}; +String S_ERRORS_DETECTED +{ + Text = "** ($Arg1) Fehler aufgetreten"; + Text[ english_us ] = "** ($Arg1) errors occurred"; + Text[ portuguese ] = "** ($Arg1): erros ocorridos"; + Text[ russian ] = "** ($Arg1) errors occurred"; + Text[ greek ] = "** ($Arg1) errors occurred"; + Text[ dutch ] = "** ($Arg1) fout opgetreden"; + Text[ french ] = "** ($Arg1) : Erreurs survenues"; + Text[ spanish ] = "** Ha ocurrido el error ($Arg1)"; + Text[ italian ] = "** ($Arg1) errors occurred"; + Text[ danish ] = "** ($Arg1) errors occurred"; + Text[ swedish ] = "** ($Arg1) errors occurred"; + Text[ polish ] = "** Wystpio ($Arg1) bdw"; + Text[ portuguese_brazilian ] = "** ($Arg1) Fehler aufgetreten"; + Text[ japanese ] = "** ($Arg1) ̴װ"; + Text[ korean ] = "** ($Arg1) "; + Text[ chinese_simplified ] = "** ($Arg1) "; + Text[ chinese_traditional ] = "** ($Arg1) ~"; + Text[ arabic ] = "** ($Arg1) errors occurred"; + Text[ turkish ] = "** ($Arg1) errors occurred"; +}; +String S_NO_ERRORS_DETECTED +{ + Text = "** Keine Fehler aufgetreten"; + Text[ english_us ] = "** No errors have occurred"; + Text[ portuguese ] = "**No ocorreram erros"; + Text[ russian ] = "** No errors have occurred"; + Text[ greek ] = "** No errors have occurred"; + Text[ dutch ] = "** Geen fouten opgetreden"; + Text[ french ] = "** Aucune erreur n'est survenue"; + Text[ spanish ] = "** No ha ocurrido ningn error"; + Text[ italian ] = "** No errors have occurred"; + Text[ danish ] = "** No errors have occurred"; + Text[ swedish ] = "** No errors have occurred"; + Text[ polish ] = "** Nie wystpiy adne bdy"; + Text[ portuguese_brazilian ] = "** Keine Fehler aufgetreten"; + Text[ japanese ] = "** װȂ"; + Text[ korean ] = "** ϴ."; + Text[ chinese_simplified ] = "** ûгִ"; + Text[ chinese_traditional ] = "** SX{~"; + Text[ arabic ] = "** No errors have occurred"; + Text[ turkish ] = "** No errors have occurred"; +}; +String S_WARNINGS_DETECTED +{ + Text = "** ($Arg1) Warnungen aufgetreten"; + Text[ english_us ] = "** ($Arg1) warnings occurred"; + Text[ portuguese ] = "** ($Arg1): erros ocorridos"; + Text[ russian ] = "** ($Arg1) warnings occurred"; + Text[ greek ] = "** ($Arg1) warnings occurred"; + Text[ dutch ] = "** ($Arg1) waarschuwingen weergegeven"; + Text[ french ] = "** ($Arg1) : Avertissements survenus"; + Text[ spanish ] = "** Han aparecido las advertencias ($Arg1)"; + Text[ italian ] = "** ($Arg1) warnings occurred"; + Text[ danish ] = "** ($Arg1) warnings occurred"; + Text[ swedish ] = "** ($Arg1) warnings occurred"; + Text[ polish ] = "** Wystpio ($Arg1) ostrzee"; + Text[ portuguese_brazilian ] = "** ($Arg1) Warnungen aufgetreten"; + Text[ japanese ] = "** ($Arg1) ̌x"; + Text[ korean ] = "** ($Arg1) "; + Text[ chinese_simplified ] = "** ($Arg1) "; + Text[ chinese_traditional ] = "** ($Arg1) ĵi"; + Text[ arabic ] = "** ($Arg1) warnings occurred"; + Text[ turkish ] = "** ($Arg1) warnings occurred"; +}; +String S_NO_WARNINGS_DETECTED +{ + Text = "** Keine Warnungen aufgetreten"; + Text[ english_us ] = "** No warnings have occurred"; + Text[ portuguese ] = "**No ocorreram quaisquer erros"; + Text[ russian ] = "** No warnings have occurred"; + Text[ greek ] = "** No warnings have occurred"; + Text[ dutch ] = "** Geen waarschuwingen weergegeven"; + Text[ french ] = "** Aucun avertissement n'est survenu"; + Text[ spanish ] = "** No han aparecido advertencias"; + Text[ italian ] = "** No warnings have occurred"; + Text[ danish ] = "** No warnings have occurred"; + Text[ swedish ] = "** No warnings have occurred"; + Text[ polish ] = "** Nie wystpiy adne ostrzeenia"; + Text[ portuguese_brazilian ] = "** Keine Warnungen aufgetreten"; + Text[ japanese ] = "** xȂ"; + Text[ korean ] = "** ϴ."; + Text[ chinese_simplified ] = "** ûг־"; + Text[ chinese_traditional ] = "** Sĵi"; + Text[ arabic ] = "** No warnings have occurred"; + Text[ turkish ] = "** No warnings have occurred"; +}; +String S_INCLUDE_FILE_WARNINGS_DETECTED +{ + Text = "** ($Arg1) Warnungen bei der Initialisierung aufgetreten"; + Text[ english_us ] = "** ($Arg1) warnings occurred"; + Text[ portuguese ] = "** ($Arg1): erros ocorridos"; + Text[ russian ] = "** ($Arg1) warnings occurred"; + Text[ greek ] = "** ($Arg1) warnings occurred"; + Text[ dutch ] = "** ($Arg1) waarschuwingen weergegeven"; + Text[ french ] = "** ($Arg1) : Avertissements survenus"; + Text[ spanish ] = "** Han aparecido las advertencias ($Arg1)"; + Text[ italian ] = "** ($Arg1) warnings occurred"; + Text[ danish ] = "** ($Arg1) warnings occurred"; + Text[ swedish ] = "** ($Arg1) warnings occurred"; + Text[ polish ] = "** Wystpio ($Arg1) ostrzee"; + Text[ portuguese_brazilian ] = "** ($Arg1) Warnungen aufgetreten"; + Text[ japanese ] = "** ($Arg1) ̌x"; + Text[ korean ] = "** ($Arg1) "; + Text[ chinese_simplified ] = "** ($Arg1) "; + Text[ chinese_traditional ] = "** ($Arg1) ĵi"; + Text[ arabic ] = "** ($Arg1) warnings occurred"; + Text[ turkish ] = "** ($Arg1) warnings occurred"; +}; +String S_NO_INCLUDE_FILE_WARNINGS_DETECTED +{ + Text = "** Keine Warnungen bei der Initialisierung aufgetreten"; + Text[ english_us ] = "** No warnings have occurred"; + Text[ portuguese ] = "**No ocorreram quaisquer erros"; + Text[ russian ] = "** No warnings have occurred"; + Text[ greek ] = "** No warnings have occurred"; + Text[ dutch ] = "** Geen waarschuwingen weergegeven"; + Text[ french ] = "** Aucun avertissement n'est survenu"; + Text[ spanish ] = "** No han aparecido advertencias"; + Text[ italian ] = "** No warnings have occurred"; + Text[ danish ] = "** No warnings have occurred"; + Text[ swedish ] = "** No warnings have occurred"; + Text[ polish ] = "** Nie wystpiy adne ostrzeenia"; + Text[ portuguese_brazilian ] = "** Keine Warnungen aufgetreten"; + Text[ japanese ] = "** xȂ"; + Text[ korean ] = "** ϴ."; + Text[ chinese_simplified ] = "** ûг־"; + Text[ chinese_traditional ] = "** Sĵi"; + Text[ arabic ] = "** No warnings have occurred"; + Text[ turkish ] = "** No warnings have occurred"; +}; +String S_UNKNOWN_SLOT_CONTROL +{ + Text = "Slot/Control unbekannt :\"($Arg1)\""; + Text[ english_us ] = "Slot/Control unknown :\"($Arg1)\""; + Text[ portuguese ] = "Slot/Control desconhecido :\"($Arg1)\""; + Text[ russian ] = "Slot/Control unknown :\"($Arg1)\""; + Text[ greek ] = "Slot/Control unknown :\"($Arg1)\""; + Text[ dutch ] = "Slot/Control onbekend :\"($Arg1)\""; + Text[ french ] = "Slot/Control inconnu : \"($Arg1)\""; + Text[ spanish ] = "Slot/Control desconocido :\"($Arg1)\""; + Text[ italian ] = "Slot/Control unknown :\"($Arg1)\""; + Text[ danish ] = "Slot/Control unknown :\"($Arg1)\""; + Text[ swedish ] = "Slot/Control unknown :\"($Arg1)\""; + Text[ polish ] = "Nieznany Slot/Control :\"($Arg1)\""; + Text[ portuguese_brazilian ] = "Slot/Control unbekannt :\"($Arg1)\""; + Text[ japanese ] = "ۯ/۰ق킩܂:\"($Arg1)\""; + Text[ korean ] = "˼ /Ʈ :\"($Arg1)\""; + Text[ chinese_simplified ] = " Slot/Control\"($Arg1)\""; + Text[ chinese_traditional ] = "Slot/Control G\"($Arg1)\""; + Text[ arabic ] = "Slot/Control unknown :\"($Arg1)\""; + Text[ turkish ] = "Slot/Control unknown :\"($Arg1)\""; +}; +String S_RETURN_SEQUENCE_MISSMATCH +{ + Text = "Return Stream mit falscher Sequenz: ($Arg1) statt ($Arg2)"; + Text[ english_us ] = "Return Stream has wrong sequence: ($Arg1) instead of ($Arg2)"; + Text[ portuguese ] = "Return Stream com sequncia incorrecta: ($Arg1) em lugar de ($Arg2)"; + Text[ russian ] = "Return Stream has wrong sequence: ($Arg1) instead of ($Arg2)"; + Text[ greek ] = "Return Stream has wrong sequence: ($Arg1) instead of ($Arg2)"; + Text[ dutch ] = "Return Stream met verkeerde sequentie: ($Arg1) in plaats van ($Arg2)"; + Text[ french ] = "Return Stream avec une squence errone : ($Arg1) au lieu de ($Arg2)"; + Text[ spanish ] = "Return Stream con secuencia falsa: ($Arg1) en vez de ($Arg2)"; + Text[ italian ] = "Return Stream has wrong sequence: ($Arg1) instead of ($Arg2)"; + Text[ danish ] = "Return Stream has wrong sequence: ($Arg1) instead of ($Arg2)"; + Text[ swedish ] = "Return Stream has wrong sequence: ($Arg1) instead of ($Arg2)"; + Text[ polish ] = "Return Stream o nieprawidowej sekwencji: ($Arg1) zamiast ($Arg2)"; + Text[ portuguese_brazilian ] = "Return Stream mit falscher Sequenz: ($Arg1) statt ($Arg2)"; + Text[ japanese ] = "ݽذт̼ݽԈĂ܂: ($Arg2) łȂ ($Arg1)"; + Text[ korean ] = "Ʋ Ϸ ȣ Ʈ: ($Arg2) ($Arg1)"; + Text[ chinese_simplified ] = "деķϢ($Arg1) ($Arg2)"; + Text[ chinese_traditional ] = "^uyǦC~G($Arg1)A ӬO ($Arg2)"; + Text[ arabic ] = "Return Stream has wrong sequence: ($Arg1) instead of ($Arg2)"; + Text[ turkish ] = "Return Stream has wrong sequence: ($Arg1) instead of ($Arg2)"; +}; +String S_RETURNED_VALUE_ID_MISSMATCH +{ + Text = "Returnwert Empfangen aber andere Id erwartet"; + Text[ english_us ] = "Return value received but different Id expected"; + Text[ portuguese ] = "Recebido o valor Return, mas espera-se outro ID"; + Text[ russian ] = "Return value received but different Id expected"; + Text[ greek ] = "Return value received but different Id expected"; + Text[ dutch ] = "Retourwaarde ontvangen echter andere Id verwacht"; + Text[ french ] = "Valeur de renvoi reue mais attente d'un autre ID"; + Text[ spanish ] = "Recibido Valor Return, pero se esperaba otro Id"; + Text[ italian ] = "Return value received but different Id expected"; + Text[ danish ] = "Return value received but different Id expected"; + Text[ swedish ] = "Return value received but different Id expected"; + Text[ polish ] = "Odebrano warto return, ale oczekiwane jest inne ID"; + Text[ portuguese_brazilian ] = "Returnwert Empfangen aber andere Id erwartet"; + Text[ japanese ] = "ݒl܂AʂIdKvłB"; + Text[ korean ] = " ϰ ٸ Id "; + Text[ chinese_simplified ] = "ֵڴ Id(ʶ)"; + Text[ chinese_traditional ] = "^ȡAOݬO䥦 Id"; + Text[ arabic ] = "Return value received but different Id expected"; + Text[ turkish ] = "Return value received but different Id expected"; +}; +String S_RETURNED_VALUE_NO_RECEIVER +{ + Text = "Returnwert Empfangen aber kein Empfnger definiert"; + Text[ english_us ] = "Return value received but receiver not defined"; + Text[ portuguese ] = "Recebido o valor Return, mas o destinatrio no foi definido"; + Text[ russian ] = "Return value received but receiver not defined"; + Text[ greek ] = "Return value received but receiver not defined"; + Text[ dutch ] = "Retourwaarde ontvangen echter geen ontvanger gedefinieerd"; + Text[ french ] = "Valeur de renvoi reue mais aucun destinataire dfini"; + Text[ spanish ] = "Recibido valor Return sin definicin de destinatario"; + Text[ italian ] = "Return value received but receiver not defined"; + Text[ danish ] = "Return value received but receiver not defined"; + Text[ swedish ] = "Return value received but receiver not defined"; + Text[ polish ] = "Odebrano warto return, ale brak zdefiniowanego odbiorcy"; + Text[ portuguese_brazilian ] = "Returnwert Empfangen aber kein Empfnger definiert"; + Text[ japanese ] = "ݒl܂AM҂ł܂B"; + Text[ korean ] = " ϰ ǵ "; + Text[ chinese_simplified ] = "ֵûָ"; + Text[ chinese_traditional ] = "^ȡAOSwؼСC"; + Text[ arabic ] = "Return value received but receiver not defined"; + Text[ turkish ] = "Return value received but receiver not defined"; +}; +String S_UNKNOWN_METHOD +{ + Text = "Unbekannte Methode an Objekt : ($Arg1).($Arg2)"; + Text[ english_us ] = "Unknown method on object :($Arg1).($Arg2)"; + Text[ portuguese ] = "Mtodo desconhecido ($Arg1) para ($Arg2)"; + Text[ russian ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ greek ] = "Unknown method on object :($Arg1).($Arg2)"; + Text[ dutch ] = "Onbekende methode aan object: ($Arg1).($Arg2)"; + Text[ french ] = "Mthode inconnue vers l'objet : ($Arg1).($Arg2)"; + Text[ spanish ] = "Mtodo desconocido ($Arg1) a ($Arg2)"; + Text[ italian ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ danish ] = "Unknown method on object: ($Arg1).($Arg2)"; + Text[ swedish ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ polish ] = "Nieznana metoda do obiektu: ($Arg1).($Arg2)"; + Text[ portuguese_brazilian ] = "Unbekannte Methode an Objekt : ($Arg1).($Arg2)"; + Text[ japanese ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ korean ] = "ü ˼ ҵ : ($Arg1).($Arg2)"; + Text[ chinese_simplified ] = "Unknown method on object:($Arg1).($Arg2)"; + Text[ chinese_traditional ] = "覡G ($Arg1).($Arg2)"; + Text[ arabic ] = "Unknown method '($Arg1)' to ($Arg2)"; + Text[ turkish ] = "Unknown method on object :($Arg1).($Arg2)"; +}; +/* +String +{ + Text = ; +}; +String +{ + Text = ; +}; +String +{ + Text = ; +}; +String +{ + Text = ; +}; +String +{ + Text = ; +}; +String +{ + Text = ; +}; +String +{ + Text = ; +}; +String +{ + Text = ; +}; +*/ diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx new file mode 100644 index 000000000000..94a26ef87600 --- /dev/null +++ b/basic/source/basmgr/basmgr.cxx @@ -0,0 +1,71 @@ +/************************************************************************* + * + * $RCSfile: basmgr.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <basmgr.hxx> + + +TYPEINIT1( BasicManager, SfxBroadcaster ); +DBG_NAME( BasicManager ); + +BasicManager::~BasicManager() +{ +} + diff --git a/basic/source/basmgr/makefile.mk b/basic/source/basmgr/makefile.mk new file mode 100644 index 000000000000..a2279673782f --- /dev/null +++ b/basic/source/basmgr/makefile.mk @@ -0,0 +1,82 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ +# +# 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): _______________________________________ +# +# +# +#************************************************************************* +PRJ=..$/.. + +PRJNAME=BASIC +TARGET=basicmgr + +# --- Settings ----------------------------------------------------------- + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + + +# --- Allgemein ----------------------------------------------------------- + +CXXFILES = basmgr.cxx + +SLOFILES= $(SLO)$/basmgr.obj + +# --- Targets ------------------------------------------------------------- + +.INCLUDE : target.mk diff --git a/basic/source/classes/disas.cxx b/basic/source/classes/disas.cxx new file mode 100644 index 000000000000..74c3922f0ab0 --- /dev/null +++ b/basic/source/classes/disas.cxx @@ -0,0 +1,701 @@ +/************************************************************************* + * + * $RCSfile: disas.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <stdio.h> +#include <string.h> + +#ifndef _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif +#pragma hdrstop +#include <svtools/sbx.hxx> +#include "sb.hxx" +#include "iosys.hxx" +#include "disas.hxx" +// Makro MEMBER() +#include "macfix.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBDISAS, SBDISAS_CODE ) + +static const char* pOp1[] = { + "NOP", + + // Operatoren + // die folgenden Operatoren sind genauso angeordnet + // wie der enum SbxVarOp + "EXP", "MUL", "DIV", "MOD", "PLUS", "MINUS", "NEG", + "EQ", "NE", "LT", "GT", "LE", "GE", + "IDIV", "AND", "OR", "XOR", "EQV", "IMP", "NOT", + "CAT", + // Ende enum SbxVarOp + "LIKE", "IS", + // Laden/speichern + "ARGC", // neuen Argv einrichten + "ARGV", // TOS ==> aktueller Argv + "INPUT", // Input ==> TOS + "LINPUT", // Line Input ==> TOS + "GET", // TOS anfassen + "SET", // Speichern Objekt TOS ==> TOS-1 + "PUT", // TOS ==> TOS-1 + "CONST", // TOS ==> TOS-1, dann ReadOnly + "DIM", // DIM + "REDIM", // REDIM + "REDIMP", // REDIM PRESERVE + "ERASE", // TOS loeschen + // Verzweigen + "STOP", // Programmende + "INITFOR", // FOR-Variable initialisieren + "NEXT", // FOR-Variable inkrementieren + "CASE", // Anfang CASE + "ENDCASE", // Ende CASE + "STDERR", // Standard-Fehlerbehandlung + "NOERROR", // keine Fehlerbehandlung + "LEAVE", // UP verlassen + // E/A + "CHANNEL", // TOS = Kanalnummer + "PRINT", // print TOS + "PRINTF", // print TOS in field + "WRITE", // write TOS + "RENAME", // Rename Tos+1 to Tos + "PROMPT", // TOS = Prompt for Input + "RESTART", // Restartpunkt definieren + "STDIO", // E/A-Kanal 0 einstellen + // Sonstiges + "EMPTY", // Leeren Ausdruck auf Stack + "ERROR", // TOS = Fehlercode + "LSET", // Speichern Objekt TOS ==> TOS-1 + "RSET" // Speichern Objekt TOS ==> TOS-1 +}; + +static const char* pOp2[] = { + "NUMBER", // Laden einer numerischen Konstanten (+ID) + "STRING", // Laden einer Stringkonstanten (+ID) + "CONST", // Immediate Load (+Wert) + "ARGN", // Speichern eines named Args in Argv (+StringID) + "PAD", // String auf feste Laenge bringen (+Laenge) + // Verzweigungen + "JUMP", // Sprung (+Target) + "JUMP.T", // TOS auswerten, bedingter Sprung (+Target) + "JUMP.F", // TOS auswerten, bedingter Sprung (+Target) + "ONJUMP", // TOS auswerten, Sprung in JUMP-Tabelle (+MaxVal) + "GOSUB", // UP-Aufruf (+Target) + "RETURN", // UP-Return (+0 oder Target) + "TESTFOR", // FOR-Variable testen, inkrementieren (+Endlabel) + "CASETO", // Tos+1 <= Case <= Tos, 2xremove (+Target) + "ERRHDL", // Fehler-Handler (+Offset) + "RESUME", // Resume nach Fehlern (+0 or 1 or Label) + // E/A + "CLOSE", // (+Kanal/0) + "PRCHAR", // (+char) + // Objekte + "CLASS", // Klassennamen testen (+StringId) + "LIB", // Libnamen fuer Declare-Procs setzen (+StringId) + // Neues ab Beta 3 + "BASED", // TOS wird um BASE erhoeht, BASE davor gepusht + "ARGTYP", // Letzten Parameter in Argv konvertieren (+Typ) +}; + +static const char* pOp3[] = { + // Alle Opcodes mit zwei Operanden + "RTL", // Laden aus RTL (+StringID+Typ) + "FIND", // Laden (+StringID+Typ) + "ELEM", // Laden Element (+StringID+Typ) + "PARAM", // Parameter (+Offset+Typ) + // Verzweigen + "CALL", // DECLARE-Methode rufen (+StringID+Typ) + "CALL.C", // Cdecl-DECLARE-Methode rufen (+StringID+Typ) + "CASEIS", // Case-Test (+Test-Opcode+False-Target) + "STMNT", // Beginn eines Statements (+Line+Col) + // E/A + "OPEN", // (+SvStreamFlags+Flags) + // Objekte und Variable + "LOCAL", // Lokale Variable (+StringID+Typ) + "PUBLIC", // Modulglobale Variable (+StringID+Typ) + "GLOBAL", // Globale Variable (+StringID+Typ) + "CREATE", // Objekt kreieren (+StringId+StringId) + "STATIC", // Objekt kreieren (+StringId+StringId) + "TCREATE", // User defined Objekt kreieren (+StringId+StringId) + "DCREATE", // User defined Objekt-Array kreieren (+StringId+StringId) +}; + +static const char** pOps[3] = { pOp1, pOp2, pOp3 }; + +typedef void( SbiDisas::*Func )( String& ); // Verarbeitungsroutine + +static const Func pOperand2[] = { + MEMBER(SbiDisas::StrOp), // Laden einer numerischen Konstanten (+ID) + MEMBER(SbiDisas::StrOp), // Laden einer Stringkonstanten (+ID) + MEMBER(SbiDisas::ImmOp), // Immediate Load (+Wert) + MEMBER(SbiDisas::StrOp), // Speichern eines benannten Arguments(+ID) + MEMBER(SbiDisas::ImmOp), // String auf feste Laenge bringen (+Laenge) + // Verzweigungen + MEMBER(SbiDisas::LblOp), // Sprung (+Target) + MEMBER(SbiDisas::LblOp), // TOS auswerten), bedingter Sprung (+Target) + MEMBER(SbiDisas::LblOp), // TOS auswerten), bedingter Sprung (+Target) + MEMBER(SbiDisas::OnOp), // TOS auswerten), Sprung in JUMP-Tabelle (+MaxVal) + MEMBER(SbiDisas::LblOp), // UP-Aufruf (+Target) + MEMBER(SbiDisas::ReturnOp), // UP-Return (+0 oder Target) + MEMBER(SbiDisas::LblOp), // FOR-Variable testen), inkrementieren (+Endlabel) + MEMBER(SbiDisas::LblOp), // Tos+1 <= Case <= Tos), 2xremove (+Target) + MEMBER(SbiDisas::LblOp), // Fehler-Handler (+Offset) + MEMBER(SbiDisas::ResumeOp), // Resume nach Fehlern (+0 or 1 or Label) + // E/A + MEMBER(SbiDisas::CloseOp), // (+Kanal/0) + MEMBER(SbiDisas::CharOp), // (+char) + // Objekte + MEMBER(SbiDisas::StrOp), // Klassennamen testen (+StringId) + MEMBER(SbiDisas::StrOp), // Libnamen fuer Declare-Procs setzen (+StringId) + MEMBER(SbiDisas::ImmOp), // TOS wird um BASE erhoeht, BASE davor gepusht + MEMBER(SbiDisas::TypeOp), // Letzten Parameter in Argv konvertieren (+Typ) +}; + +static const Func pOperand3[] = { + // Alle Opcodes mit zwei Operanden + MEMBER(SbiDisas::VarOp), // Laden aus RTL (+StringID+Typ) + MEMBER(SbiDisas::VarOp), // Laden (+StringID+Typ) + MEMBER(SbiDisas::VarOp), // Laden Element (+StringID+Typ) + MEMBER(SbiDisas::OffOp), // Parameter (+Offset+Typ) + // Verzweigen + MEMBER(SbiDisas::VarOp), // DECLARE-Methode rufen (+StringID+Typ) + MEMBER(SbiDisas::VarOp), // CDecl-DECLARE-Methode rufen (+StringID+Typ) + MEMBER(SbiDisas::CaseOp), // Case-Test (+Test-Opcode+False-Target) + MEMBER(SbiDisas::StmntOp), // Statement (+Zeilen+Spalte) + // E/A + MEMBER(SbiDisas::StrmOp), // (+SvStreamFlags+Flags) + // Objekte + MEMBER(SbiDisas::VarDefOp), // Lokale Variable definieren (+StringID+Typ) + MEMBER(SbiDisas::VarDefOp), // Modulglobale Variable definieren (+StringID+Typ) + MEMBER(SbiDisas::VarDefOp), // Globale Variable definieren (+StringID+Typ) + MEMBER(SbiDisas::Str2Op), // Objekt kreieren (+StringId+StringId) + MEMBER(SbiDisas::VarDefOp), // Statische Variable definieren (+StringID+Typ) + MEMBER(SbiDisas::Str2Op), // User defined Objekt kreieren (+StringId+StringId) + MEMBER(SbiDisas::Str2Op), // User defined Objekt-Array kreieren (+StringId+StringId) +}; + +static const char* _crlf() +{ +#if defined (MAC) + return "\n"; +#elif defined (UNX) || defined( PM2 ) + return "\n"; +#else + return "\r\n"; +#endif +} + +// Diese Methode ist hier, damit die Datei als eigenes Segment geladen werden +// kann. + +BOOL SbModule::Disassemble( String& rText ) +{ + rText.Erase(); + if( pImage ) + { + SbiDisas aDisas( this, pImage ); + aDisas.Disas( rText ); + } + return BOOL( rText.Len() != 0 ); +} + +SbiDisas::SbiDisas( SbModule* p, const SbiImage* q ) : rImg( *q ), pMod( p ) +{ + memset( cLabels, 0, 8192 ); + nLine = nOff = nPC = nOp1 = nOp2 = nParts = 0; + eOp = _NOP; + // Label-Bits setzen + USHORT nPos; + nOff = 0; + while( Fetch() ) + { + BOOL bLbl = FALSE; + switch( eOp ) + { + case _RESUME: if( nOp1 <= 1 ) break; + case _RETURN: if( !nOp1 ) break; + case _JUMP: + case _JUMPT: + case _JUMPF: + case _GOSUB: + case _TESTFOR: + case _CASEIS: + case _CASETO: + case _ERRHDL: nPos = nOp1; bLbl = TRUE; break; + } + if( bLbl ) + cLabels[ nPos >> 3 ] |= ( 1 << ( nPos & 7 ) ); + } + nOff = 0; + // Die Publics noch dazu + for( USHORT i = 0; i < pMod->GetMethods()->Count(); i++ ) + { + SbMethod* pMeth = PTR_CAST(SbMethod,pMod->GetMethods()->Get( i )); + if( pMeth ) + { + nPos = pMeth->GetId(); + cLabels[ nPos >> 3 ] |= ( 1 << ( nPos & 7 ) ); + } + } +} + +// Aktuellen Opcode auslesen + +BOOL SbiDisas::Fetch() +{ + nPC = nOff; + if( nOff >= rImg.GetCodeSize() ) + return FALSE; + const char* p = rImg.GetCode() + nOff; + eOp = (SbiOpcode) ( *p++ & 0xFF ); + if( eOp <= SbOP0_END ) + { + nOp1 = nOp2 = 0; + nParts = 1; + nOff++; + return TRUE; + } + else if( eOp <= SbOP1_END ) + { + nOff += 3; + if( nOff > rImg.GetCodeSize() ) + return FALSE; + nOp1 = *p++ & 0xFF; nOp1 |= *p << 8; + nParts = 2; + return TRUE; + } + else if( eOp <= SbOP2_END ) + { + nOff += 5; + if( nOff > rImg.GetCodeSize() ) + return FALSE; + nOp1 = *p++ & 0xFF; nOp1 |= *p++ << 8; + nOp2 = *p++ & 0xFF; nOp2 |= *p << 8; + nParts = 3; + return TRUE; + } + else + return FALSE; +} + +void SbiDisas::Disas( SvStream& r ) +{ + String aText; + nOff = 0; + while( DisasLine( aText ) ) + { + ByteString aByteText( aText, gsl_getSystemTextEncoding() ); + r.WriteLine( aByteText ); + } +} + +void SbiDisas::Disas( String& r ) +{ + r.Erase(); + String aText; + nOff = 0; + while( DisasLine( aText ) ) + { + r += aText; + r.AppendAscii( _crlf() ); + } + aText.ConvertLineEnd(); +} + +#ifdef HP9000 +const char* SbiDisas_DisasLine_pMask[] = { + "%04X ", + "%04X %02X ", + "%04X %02X %04X ", + "%04X %02X %04X %04X " }; +#define pMask SbiDisas_DisasLine_pMask +#endif +BOOL SbiDisas::DisasLine( String& rText ) +{ + char cBuf[ 30 ]; +#ifndef HP9000 + const char* pMask[] = { + "%04X ", + "%04X %02X ", + "%04X %02X %04X ", + "%04X %02X %04X %04X " }; +#endif + rText.Erase(); + if( !Fetch() ) + return FALSE; + // Neue Zeile? + if( eOp == _STMNT && (short) nOp1 != nLine ) + { + // Zeile raussuchen + USHORT n = 0, l = nLine = nOp1; + while( --l ) { + n = rImg.aSource.SearchAscii( "\n", n ); + if( n == STRING_NOTFOUND ) break; + else n++; + } + // Stelle anzeigen + if( n != STRING_NOTFOUND ) + { + USHORT n2 = rImg.aSource.SearchAscii( "\n", n ); + if( n2 == STRING_NOTFOUND ) n2 = rImg.aSource.Len() - n; + String s( rImg.aSource.Copy( n, n2 - n + 1 ) ); + BOOL bDone; + do { + bDone = TRUE; + n = s.Search( '\r' ); + if( n != STRING_NOTFOUND ) bDone = FALSE, s.Erase( n, 1 ); + n = s.Search( '\n' ); + if( n != STRING_NOTFOUND ) bDone = FALSE, s.Erase( n, 1 ); + } while( !bDone ); +// sprintf( cBuf, pMask[ 0 ], nPC ); +// rText += cBuf; + rText.AppendAscii( "; " ); + rText += s; + rText.AppendAscii( _crlf() ); + } + } + // Label? + const char* p = ""; + if( cLabels[ nPC >> 3 ] & ( 1 << ( nPC & 7 ) ) ) + { + // Public? + ByteString aByteMethName; + for( USHORT i = 0; i < pMod->GetMethods()->Count(); i++ ) + { + SbMethod* pMeth = PTR_CAST(SbMethod,pMod->GetMethods()->Get( i )); + if( pMeth ) + { + aByteMethName = ByteString( pMeth->GetName(), gsl_getSystemTextEncoding() ); + if( pMeth->GetId() == nPC ) + { + p = aByteMethName.GetBuffer(); + break; + } + if( pMeth->GetId() >= nPC ) + break; + } + } + sprintf( cBuf, pMask[ 0 ], nPC ); + rText.AppendAscii( cBuf ); + if( p && *p ) + { + rText.AppendAscii( p ); + } + else + { + sprintf( cBuf, "Lbl%04X", nPC ); + rText.AppendAscii( cBuf ); + } + rText += ':'; + rText.AppendAscii( _crlf() ); + } + sprintf( cBuf, pMask[ nParts ], nPC, (USHORT) eOp, nOp1, nOp2 ); + rText.AppendAscii( cBuf ); + short n = eOp; + if( eOp >= SbOP2_START ) + n -= SbOP2_START; + else if( eOp >= SbOP1_START ) + n -= SbOP1_START; + rText += '\t'; + rText.AppendAscii( pOps[ nParts-1 ][ n ] ); + rText += '\t'; + switch( nParts ) + { + case 2: (this->*( pOperand2[ n ] ) )( rText ); break; + case 3: (this->*( pOperand3[ n ] ) )( rText ); break; + } + return TRUE; +} +#ifdef HP9000 +#undef pMask +#endif + + +// Auslesen aus StringPool + +void SbiDisas::StrOp( String& rText ) +{ + String aStr = rImg.GetString( nOp1 ); + const char* p = ByteString( aStr, gsl_getSystemTextEncoding() ).GetBuffer(); + if( p ) + { + rText += '"'; + rText.AppendAscii( p ); + rText += '"'; + } + else + { + rText.AppendAscii( "?String? " ); + rText += nOp1; + } +} + +void SbiDisas::Str2Op( String& rText ) +{ + StrOp( rText ); + rText += ','; + String s; + nOp1 = nOp2; + StrOp( s ); + rText += s; +} + +// Immediate Operand + +void SbiDisas::ImmOp( String& rText ) +{ + rText += nOp1; +} + +// OnGoto Operand + +void SbiDisas::OnOp( String& rText ) +{ + rText += nOp1 & 0x7FFF; + if( nOp1 & 0x800 ) + rText.AppendAscii( "\t; Gosub" ); +} + +// Label + +void SbiDisas::LblOp( String& rText ) +{ + char cBuf[ 10 ]; + sprintf( cBuf, "Lbl%04X", nOp1 ); + rText.AppendAscii( cBuf ); +} + +// 0 oder Label + +void SbiDisas::ReturnOp( String& rText ) +{ + if( nOp1 ) + LblOp( rText ); +} + +// 0, 1 oder Label + +void SbiDisas::ResumeOp( String& rText ) +{ + switch( nOp1 ) + { + case 1: rText.AppendAscii( "NEXT" ); break; + case 2: LblOp( rText ); + } +} + +// Prompt ausgeben +// FALSE/TRUE + +void SbiDisas::PromptOp( String& rText ) +{ + if( nOp1 ) + rText.AppendAscii( "\"? \"" ); +} + +// 0 oder 1 + +void SbiDisas::CloseOp( String& rText ) +{ + rText.AppendAscii( nOp1 ? "Channel" : "All" ); +} + +// Zeichen ausgeben + +void SbiDisas::CharOp( String& rText ) +{ + const char* p = NULL; + switch( nOp1 ) + { + case 7: p = "'\\a'"; break; + case 9: p = "'\\t'"; break; + case 10: p = "'\\n'"; break; + case 12: p = "'\\f'"; break; + case 13: p = "'\\r'"; break; + } + if( p ) rText.AppendAscii( p ); + else if( nOp1 >= ' ' ) + rText += '\'', + rText += (char) nOp1, + rText += '\''; + else + rText.AppendAscii( "char " ), + rText += nOp1; +} + +// Variable ausgeben: String-ID und Typ + +void SbiDisas::VarOp( String& rText ) +{ + rText += rImg.GetString( nOp1 & 0x7FFF ); + rText.AppendAscii( "\t; " ); + // Der Typ + USHORT n = nOp1; + nOp1 = nOp2; + TypeOp( rText ); + if( n & 0x8000 ) + rText.AppendAscii( ", Args" ); +} + +// Variable definieren: String-ID und Typ + +void SbiDisas::VarDefOp( String& rText ) +{ + rText += rImg.GetString( nOp1 ); + rText.AppendAscii( "\t; " ); + // Der Typ + USHORT n = nOp1; + nOp1 = nOp2; + TypeOp( rText ); +} + +// Variable ausgeben: Offset und Typ + +void SbiDisas::OffOp( String& rText ) +{ + rText += ( nOp1 & 0x7FFF ); + rText.AppendAscii( "\t; " ); + // Der Typ + USHORT n = nOp1; + nOp1 = nOp2; + TypeOp( rText ); + if( n & 0x8000 ) + rText.AppendAscii( ", Args" ); +} + +// Datentyp +#ifdef HP9000 +static char* SbiDisas_TypeOp_pTypes[13] = { + "Empty","Null","Integer","Long","Single","Double", + "Currency","Date","String","Object","Error","Boolean", + "Variant" }; +#define pTypes SbiDisas_TypeOp_pTypes +#endif +void SbiDisas::TypeOp( String& rText ) +{ + // AB 19.1.96: Typ kann Flag fr BYVAL enthalten (StepARGTYP) + if( nOp1 & 0x8000 ) + { + nOp1 &= 0x7FFF; // Flag wegfiltern + rText.AppendAscii( "BYVAL " ); + } + if( nOp1 < 13 ) + { +#ifndef HP9000 + static char* pTypes[13] = { + "Empty","Null","Integer","Long","Single","Double", + "Currency","Date","String","Object","Error","Boolean", + "Variant" }; +#endif + rText.AppendAscii( pTypes[ nOp1 ] ); + } + else + { + rText.AppendAscii( "type " ); + rText += nOp1; + } +} +#ifdef HP9000 +#undef pTypes +#endif + +// TRUE-Label, Bedingungs-Opcode + +void SbiDisas::CaseOp( String& rText ) +{ + LblOp( rText ); + rText += ','; + rText.AppendAscii( pOp1[ nOp2 - SbxEQ + _EQ ] ); +} + +// Zeile, Spalte + +void SbiDisas::StmntOp( String& rText ) +{ + rText += nOp1; + rText += ','; + USHORT nCol = nOp2 & 0xFF; + USHORT nFor = nOp2 / 0x100; + rText += nCol; + rText.AppendAscii( " (For-Level: " ); + rText += nFor; + rText += ')'; +} + +// open mode, flags + +void SbiDisas::StrmOp( String& rText ) +{ + char cBuf[ 10 ]; + sprintf( cBuf, "%04X", nOp1 ); + rText.AppendAscii( cBuf ); + if( nOp2 & SBSTRM_INPUT ) + rText.AppendAscii( ", Input" ); + if( nOp2 & SBSTRM_OUTPUT ) + rText.AppendAscii( ", Output" ); + if( nOp2 & SBSTRM_APPEND ) + rText.AppendAscii( ", Append" ); + if( nOp2 & SBSTRM_RANDOM ) + rText.AppendAscii( ", Random" ); + if( nOp2 & SBSTRM_BINARY ) + rText.AppendAscii( ", Binary" ); +} + + diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx new file mode 100644 index 000000000000..b857afd4fe09 --- /dev/null +++ b/basic/source/classes/image.cxx @@ -0,0 +1,431 @@ +/************************************************************************* + * + * $RCSfile: image.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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 _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif +#pragma hdrstop +#include <svtools/sbx.hxx> +#include "sb.hxx" +#include <string.h> // memset() etc +#include "image.hxx" +#include "filefmt.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBASIC, SBASIC_CODE ) + +SbiImage::SbiImage() +{ + rTypes = new SbxArray; + pStringOff = NULL; + pStrings = NULL; + pCode = NULL; + nFlags = + nStrings = + nStringSize= + nCodeSize = + nDimBase = 0; + bInit = + bError = FALSE; + eCharSet = gsl_getSystemTextEncoding(); +} + +SbiImage::~SbiImage() +{ + Clear(); +} + +void SbiImage::Clear() +{ + delete pStringOff; + delete pStrings; + delete pCode; + pStringOff = NULL; + pStrings = NULL; + pCode = NULL; + nFlags = + nStrings = + nStringSize= + nCodeSize = 0; + eCharSet = gsl_getSystemTextEncoding(); + nDimBase = 0; + bError = FALSE; +} + +/************************************************************************** +* +* Service-Routinen fuer das Laden und Speichern +* +**************************************************************************/ + +BOOL SbiGood( SvStream& r ) +{ + return BOOL( !r.IsEof() && r.GetError() == SVSTREAM_OK ); +} + +// Oeffnen eines Records + +ULONG SbiOpenRecord( SvStream& r, UINT16 nSignature, UINT16 nElem ) +{ + ULONG nPos = r.Tell(); + r << nSignature << (INT32) 0 << nElem; + return nPos; +} + +// Schliessen eines Records + +void SbiCloseRecord( SvStream& r, ULONG nOff ) +{ + ULONG nPos = r.Tell(); + r.Seek( nOff + 2 ); + r << (INT32) ( nPos - nOff - 8 ); + r.Seek( nPos ); +} + +/************************************************************************** +* +* Laden und Speichern +* +**************************************************************************/ + +// Falls die Versionsnummer nicht passt, werden die binaeren Teile +// nicht geladen, wohl aber Source, Kommentar und Name. + +BOOL SbiImage::Load( SvStream& r ) +{ + UINT16 nSign, nCount; + UINT32 nLen, nOff; + + Clear(); + ULONG nStart = r.Tell(); + // Master-Record einlesen + r >> nSign >> nLen >> nCount; + ULONG nLast = r.Tell() + nLen; + UINT32 nVersion = 0; // Versionsnummer + UINT32 nCharSet; // System-Zeichensatz + UINT32 lDimBase; + UINT16 nReserved1; + UINT32 nReserved2; + UINT32 nReserved3; + BOOL bBadVer = FALSE; + if( nSign == B_MODULE ) + { + r >> nVersion >> nCharSet >> lDimBase + >> nFlags >> nReserved1 >> nReserved2 >> nReserved3; + eCharSet = (CharSet) nCharSet; + bBadVer = BOOL( nVersion != B_CURVERSION ); + nDimBase = (USHORT) lDimBase; + } + + ULONG nNext; + while( ( nNext = r.Tell() ) < nLast ) + { + short i; + + r >> nSign >> nLen >> nCount; + nNext += nLen + 8; + if( r.GetError() == SVSTREAM_OK ) + switch( nSign ) + { + case B_NAME: + r.ReadByteString( aName, eCharSet ); + //r >> aName; + break; + case B_COMMENT: + r.ReadByteString( aComment, eCharSet ); + //r >> aComment; + break; + case B_SOURCE: + r.ReadByteString( aSource, eCharSet ); + //r >> aSource; + break; + case B_PCODE: + if( bBadVer ) break; + pCode = new char[ nLen ]; + nCodeSize = (USHORT) nLen; + r.Read( pCode, nCodeSize ); + break; + case B_PUBLICS: + case B_POOLDIR: + case B_SYMPOOL: + case B_LINERANGES: + break; + case B_STRINGPOOL: + if( bBadVer ) break; + MakeStrings( nCount ); + for( i = 0; i < nStrings && SbiGood( r ); i++ ) + { + r >> nOff; + pStringOff[ i ] = (USHORT) nOff; + } + r >> nLen; + if( SbiGood( r ) ) + { + delete pStrings; + pStrings = new sal_Unicode[ nLen ]; + nStringSize = (USHORT) nLen; + + char* pByteStrings = new char[ nLen ]; + r.Read( pByteStrings, nStringSize ); + for( short i = 0; i < nStrings; i++ ) + { + USHORT nOff = pStringOff[ i ]; + String aStr( pByteStrings + nOff, eCharSet ); + memcpy( pStrings + nOff, aStr.GetBuffer(), (aStr.Len() + 1) * sizeof( sal_Unicode ) ); + } + delete pByteStrings; + } break; + case B_MODEND: + goto done; + default: + break; + } + else + break; + r.Seek( nNext ); + } +done: + r.Seek( nLast ); + //if( eCharSet != ::GetSystemCharSet() ) + //ConvertStrings(); + if( !SbiGood( r ) ) + bError = TRUE; + return BOOL( !bError ); +} + +BOOL SbiImage::Save( SvStream& r ) +{ + // Erst mal der Header: + ULONG nStart = SbiOpenRecord( r, B_MODULE, 1 ); + ULONG nPos; + r << (INT32) B_CURVERSION + << (INT32) eCharSet + << (INT32) nDimBase + << (INT16) nFlags + << (INT16) 0 + << (INT32) 0 + << (INT32) 0; + + // Name? + if( aName.Len() && SbiGood( r ) ) + { + nPos = SbiOpenRecord( r, B_NAME, 1 ); + r.WriteByteString( aName, eCharSet ); + //r << aName; + SbiCloseRecord( r, nPos ); + } + // Kommentar? + if( aComment.Len() && SbiGood( r ) ) + { + nPos = SbiOpenRecord( r, B_COMMENT, 1 ); + r.WriteByteString( aComment, eCharSet ); + //r << aComment; + SbiCloseRecord( r, nPos ); + } + // Source? + if( aSource.Len() && SbiGood( r ) ) + { + nPos = SbiOpenRecord( r, B_SOURCE, 1 ); + r.WriteByteString( aSource, eCharSet ); + //r << aSource; + SbiCloseRecord( r, nPos ); + } + // Binaere Daten? + if( pCode && SbiGood( r ) ) + { + nPos = SbiOpenRecord( r, B_PCODE, 1 ); + r.Write( pCode, nCodeSize ); + SbiCloseRecord( r, nPos ); + } + // String-Pool? + if( nStrings ) + { + nPos = SbiOpenRecord( r, B_STRINGPOOL, nStrings ); + // Fuer jeden String: + // UINT32 Offset des Strings im Stringblock + for( short i = 0; i < nStrings && SbiGood( r ); i++ ) + r << (UINT32) pStringOff[ i ]; + + // Danach der String-Block + char* pByteStrings = new char[ nStringSize ]; + for( i = 0; i < nStrings; i++ ) + { + USHORT nOff = pStringOff[ i ]; + ByteString aStr( pStrings + nOff, eCharSet ); + memcpy( pByteStrings + nOff, aStr.GetBuffer(), (aStr.Len() + 1) * sizeof( char ) ); + } + r << (UINT32) nStringSize; + r.Write( pByteStrings, nStringSize ); + delete pByteStrings; + SbiCloseRecord( r, nPos ); + } + // Und die Gesamtlaenge setzen + SbiCloseRecord( r, nStart ); + if( !SbiGood( r ) ) + bError = TRUE; + return BOOL( !bError ); +} + +/************************************************************************** +* +* Routinen, die auch vom Compiler gerufen werden +* +**************************************************************************/ + +void SbiImage::MakeStrings( short nSize ) +{ + nStrings = nStringIdx = nStringOff = 0; + nStringSize = 1024; + pStrings = new sal_Unicode[ nStringSize ]; + pStringOff = new UINT16[ nSize ]; + if( pStrings && pStringOff ) + { + nStrings = nSize; + memset( pStringOff, 0, nSize * sizeof( UINT16 ) ); + memset( pStrings, 0, nStringSize * sizeof( sal_Unicode ) ); + } + else + bError = TRUE; +} + +// Hinzufuegen eines Strings an den StringPool. Der String-Puffer +// waechst dynamisch in 1K-Schritten + +// AB 12.5.2000 Aus Zeitgruenden vorerst weiter auf char-Basis +// TODO: Auch hier auf Unicode umstellen, d.h. sal_Unicode-Array +void SbiImage::AddString( const String& r ) +{ + if( nStringIdx >= nStrings ) + bError = TRUE; + if( !bError ) + { + UINT16 len = r.Len() + 1; + long needed = (long) nStringOff + len; + if( needed > 0xFF00L ) + bError = TRUE; // out of mem! + else if( (USHORT) needed > nStringSize ) + { + sal_Unicode* p = new sal_Unicode[ nStringSize + 1024 ]; + if( p ) + { + memcpy( p, pStrings, nStringSize * sizeof( sal_Unicode ) ); + delete pStrings; + pStrings = p; + nStringSize += 1024; + } + else + bError = TRUE; + } + if( !bError ) + { + pStringOff[ nStringIdx++ ] = nStringOff; + //ByteString aByteStr( r, eCharSet ); + memcpy( pStrings + nStringOff, r.GetBuffer(), len * sizeof( sal_Unicode ) ); + nStringOff += len; + // war das der letzte String? Dann die Groesse + // des Puffers aktualisieren + if( nStringIdx >= nStrings ) + nStringSize = nStringOff; + } + } +} + +// Codeblock hinzufuegen +// Der Block wurde vom Compiler aus der Klasse SbBuffer herausgeholt +// und ist bereits per new angelegt. Ausserdem enthaelt er alle Integers +// im Big Endian-Format, kann also direkt gelesen/geschrieben werden. + +void SbiImage::AddCode( char* p, USHORT s ) +{ + pCode = p; + nCodeSize = s; +} + +void SbiImage::AddType(SbxObject* pObject) // User-Type mit aufnehmen +{ + SbxObject *pCopyObject = new SbxObject(*pObject); + rTypes->Insert (pCopyObject,rTypes->Count()); +} + +/************************************************************************** +* +* Zugriffe auf das Image +* +**************************************************************************/ + +// IDs zaehlen ab 1!! + +String SbiImage::GetString( short nId ) const +{ + if( nId && nId <= nStrings ) + { + USHORT nOff = pStringOff[ --nId ]; + String aStr( pStrings + nOff ); + return aStr; + } + return String(); +} + +const SbxObject* SbiImage::FindType (String aTypeName) const +{ + return (SbxObject *)rTypes->Find(aTypeName,SbxCLASS_OBJECT); +} + diff --git a/basic/source/classes/makefile.mk b/basic/source/classes/makefile.mk new file mode 100644 index 000000000000..da2218d70b77 --- /dev/null +++ b/basic/source/classes/makefile.mk @@ -0,0 +1,93 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ +# +# 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): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=BASIC +TARGET=classes + +# --- Settings ----------------------------------------------------------- + +ENABLE_EXCEPTIONS=TRUE + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + + + +# --- Allgemein ----------------------------------------------------------- + +SLOFILES= \ + $(SLO)$/sb.obj \ + $(SLO)$/sbxmod.obj \ + $(SLO)$/image.obj \ + $(SLO)$/sbintern.obj \ + $(SLO)$/sbunoobj.obj \ + $(SLO)$/propacc.obj \ + $(SLO)$/disas.obj + +SRCFILES= sb.src + +# --- Targets ------------------------------------------------------------- + +.INCLUDE : target.mk diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx new file mode 100644 index 000000000000..d28282379bd6 --- /dev/null +++ b/basic/source/classes/propacc.cxx @@ -0,0 +1,435 @@ +/************************************************************************* + * + * $RCSfile: propacc.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:09 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "propacc.hxx" + +#include <tools/urlobj.hxx> +#include <tools/errcode.hxx> +#include <svtools/svarray.hxx> +#include <svtools/sbx.hxx> +#include <sbstar.hxx> +#include <sbunoobj.hxx> + +using namespace com::sun::star::uno; +using namespace com::sun::star::lang; +using namespace com::sun::star::beans; +using namespace cppu; +using namespace rtl; + + +//======================================================================== + +// Deklaration Konvertierung von Sbx nach Uno mit bekannter Zielklasse +Any sbxToUnoValue( SbxVariable* pVar, const Reference< XIdlClass >& xIdlTargetClass ); +Reference<XIdlClass> TypeToIdlClass( const Type& rType ); + +//======================================================================== + +#ifdef WNT +#define CDECL _cdecl +#endif +#ifdef OS2 +#define CDECL _Optlink +#endif +#if defined(UNX) || defined(MAC) +#define CDECL +#endif + +int CDECL SbCompare_PropertyValues_Impl( const void *arg1, const void *arg2 ) +{ + return ((PropertyValue*)arg1)->Name.compareTo( ((PropertyValue*)arg2)->Name ); +} + +int CDECL SbCompare_UString_PropertyValue_Impl( const void *arg1, const void *arg2 ) +{ + const OUString *pArg1 = (OUString*) arg1; + const PropertyValue **pArg2 = (const PropertyValue**) arg2; + return pArg1->compareTo( (*pArg2)->Name ); +} + +int CDECL SbCompare_Properties_Impl( const void *arg1, const void *arg2 ) +{ + return ((Property*)arg1)->Name.compareTo( ((Property*)arg2)->Name ); +} + +int CDECL SbCompare_UString_Property_Impl( const void *arg1, const void *arg2 ) +{ + const OUString *pArg1 = (OUString*) arg1; + const Property *pArg2 = (Property*) arg2; + return pArg1->compareTo( pArg2->Name ); +} + +//---------------------------------------------------------------------------- + +SbPropertyValues::SbPropertyValues() +{ +} + +//---------------------------------------------------------------------------- + +SbPropertyValues::~SbPropertyValues() +{ + _xInfo = Reference< XPropertySetInfo >(); + + for ( USHORT n = 0; n < _aPropVals.Count(); ++n ) + delete _aPropVals.GetObject( n ); +} + +//---------------------------------------------------------------------------- + +Reference< XPropertySetInfo > SbPropertyValues::getPropertySetInfo(void) throw( RuntimeException ) +{ + // create on demand? + if ( !_xInfo.is() ) + { + SbPropertySetInfo *pInfo = new SbPropertySetInfo( _aPropVals ); + ((SbPropertyValues*)this)->_xInfo = (XPropertySetInfo*)pInfo; + } + return _xInfo; +} + +//------------------------------------------------------------------------- + +INT32 SbPropertyValues::GetIndex_Impl( const OUString &rPropName ) const +{ + PropertyValue **ppPV; + ppPV = (PropertyValue **) + bsearch( &rPropName, _aPropVals.GetData(), _aPropVals.Count(), + sizeof( PropertyValue* ), + SbCompare_UString_PropertyValue_Impl ); + return ppPV ? ( (ppPV-_aPropVals.GetData()) / sizeof(ppPV) ) : USHRT_MAX; +} + +//---------------------------------------------------------------------------- + +void SbPropertyValues::setPropertyValue( + const OUString& aPropertyName, + const Any& aValue) +{ + USHORT nIndex = GetIndex_Impl( aPropertyName ); + PropertyValue *pPropVal = _aPropVals.GetObject(nIndex); + pPropVal->Value = aValue; +} + +//---------------------------------------------------------------------------- + +Any SbPropertyValues::getPropertyValue( + const OUString& aPropertyName) throw( UnknownPropertyException, WrappedTargetException, RuntimeException ) +{ + USHORT nIndex = GetIndex_Impl( aPropertyName ); + if ( nIndex != USHRT_MAX ) + return _aPropVals.GetObject(nIndex)->Value; + return Any(); +} + +//---------------------------------------------------------------------------- + +void SbPropertyValues::addPropertyChangeListener( + const OUString& aPropertyName, + const Reference< XPropertyChangeListener >& ) +{ +} + +//---------------------------------------------------------------------------- + +void SbPropertyValues::removePropertyChangeListener( + const OUString& aPropertyName, + const Reference< XPropertyChangeListener >& ) +{ +} + +//---------------------------------------------------------------------------- + +void SbPropertyValues::addVetoableChangeListener( + const OUString& aPropertyName, + const Reference< XVetoableChangeListener >& ) +{ +} + +//---------------------------------------------------------------------------- + +void SbPropertyValues::removeVetoableChangeListener( + const OUString& aPropertyName, + const Reference< XVetoableChangeListener >& ) +{ +} + +//---------------------------------------------------------------------------- + +Sequence< PropertyValue > SbPropertyValues::getPropertyValues(void) +{ + Sequence<PropertyValue> aRet( _aPropVals.Count()); + for ( USHORT n = 0; n < _aPropVals.Count(); ++n ) + aRet.getArray()[n] = *_aPropVals.GetObject(n); + return aRet; +} + +//---------------------------------------------------------------------------- + +void SbPropertyValues::setPropertyValues(const Sequence< PropertyValue >& rPropertyValues ) +{ + if ( _aPropVals.Count() ) + throw PropertyExistException(); + + const PropertyValue *pPropVals = rPropertyValues.getConstArray(); + for ( sal_Int16 n = 0; n < rPropertyValues.getLength(); ++n ) + { + PropertyValue *pPropVal = new PropertyValue(pPropVals[n]); + _aPropVals.Insert( pPropVal, n ); + } +} + +//============================================================================ +//PropertySetInfoImpl + +PropertySetInfoImpl::PropertySetInfoImpl() +{ +} + +INT32 PropertySetInfoImpl::GetIndex_Impl( const OUString &rPropName ) const +{ + Property *pP; + pP = (Property*) + bsearch( &rPropName, _aProps.getConstArray(), _aProps.getLength(), + sizeof( Property ), + SbCompare_UString_Property_Impl ); + return pP ? ( (pP-_aProps.getConstArray()) / sizeof(pP) ) : -1; +} + +Sequence< Property > PropertySetInfoImpl::getProperties(void) +{ + return _aProps; +} + +Property PropertySetInfoImpl::getPropertyByName(const OUString& Name) throw( RuntimeException ) +{ + USHORT nIndex = GetIndex_Impl( Name ); + if( USHRT_MAX != nIndex ) + return _aProps.getConstArray()[ nIndex ]; + return Property(); +} + +sal_Bool PropertySetInfoImpl::hasPropertyByName(const OUString& Name) throw( RuntimeException ) +{ + USHORT nIndex = GetIndex_Impl( Name ); + return USHRT_MAX != nIndex; +} + + +//============================================================================ + +SbPropertySetInfo::SbPropertySetInfo() +{ +} + +//---------------------------------------------------------------------------- + +SbPropertySetInfo::SbPropertySetInfo( const SbPropertyValueArr_Impl &rPropVals ) +{ + aImpl._aProps.realloc( rPropVals.Count() ); + for ( USHORT n = 0; n < rPropVals.Count(); ++n ) + { + Property &rProp = aImpl._aProps.getArray()[n]; + const PropertyValue &rPropVal = *rPropVals.GetObject(n); + rProp.Name = rPropVal.Name; + rProp.Handle = rPropVal.Handle; + rProp.Type = getCppuVoidType(); + rProp.Attributes = 0; + } +} + +//---------------------------------------------------------------------------- + +SbPropertySetInfo::~SbPropertySetInfo() +{ +} + +//------------------------------------------------------------------------- + +Sequence< Property > SbPropertySetInfo::getProperties(void) throw( RuntimeException ) +{ + return aImpl.getProperties(); +} + +Property SbPropertySetInfo::getPropertyByName(const OUString& Name) + throw( RuntimeException ) +{ + return aImpl.getPropertyByName( Name ); +} + +BOOL SbPropertySetInfo::hasPropertyByName(const OUString& Name) + throw( RuntimeException ) +{ + return aImpl.hasPropertyByName( Name ); +} + + +//---------------------------------------------------------------------------- + +SbPropertyContainer::SbPropertyContainer() +{ +} + +//---------------------------------------------------------------------------- + +SbPropertyContainer::~SbPropertyContainer() +{ +} + +//---------------------------------------------------------------------------- +void SbPropertyContainer::addProperty(const OUString& Name, + INT16 Attributes, + const Any& DefaultValue) + throw( PropertyExistException, IllegalTypeException, + IllegalArgumentException, RuntimeException ) +{ +} + +//---------------------------------------------------------------------------- +void SbPropertyContainer::removeProperty(const OUString& Name) + throw( UnknownPropertyException, RuntimeException ) +{ +} + +//---------------------------------------------------------------------------- +// XPropertySetInfo +Sequence< Property > SbPropertyContainer::getProperties(void) +{ + return aImpl.getProperties(); +} + +Property SbPropertyContainer::getPropertyByName(const OUString& Name) + throw( RuntimeException ) +{ + return aImpl.getPropertyByName( Name ); +} + +BOOL SbPropertyContainer::hasPropertyByName(const OUString& Name) + throw( RuntimeException ) +{ + return aImpl.hasPropertyByName( Name ); +} + +//---------------------------------------------------------------------------- + +Sequence< PropertyValue > SbPropertyContainer::getPropertyValues(void) +{ + return Sequence<PropertyValue>(); +} + +//---------------------------------------------------------------------------- + +void SbPropertyContainer::setPropertyValues(const Sequence< PropertyValue >& PropertyValues_) +{ +} + +//---------------------------------------------------------------------------- + +void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +{ + // Wir brauchen mindestens 1 Parameter + if ( rPar.Count() < 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // Klassen-Name der struct holen + String aServiceName( RTL_CONSTASCII_USTRINGPARAM("stardiv.uno.beans.PropertySet") ); + +#if 0 + // Service suchen und instanzieren + Reference< XMultiServiceFactory > xServiceManager = getProcessServiceFactory(); + Reference< XInterface > xInterface; + if( xProv.is() ) + xInterface = xProv->newInstance(); +#else + Reference< XInterface > xInterface = (OWeakObject*) new SbPropertyValues(); +#endif + + SbxVariableRef refVar = rPar.Get(0); + if( xInterface.is() ) + { + // PropertyValues setzen + Any aArgAsAny = sbxToUnoValue( rPar.Get(1), + TypeToIdlClass( getCppuType( (Sequence<PropertyValue>*)0 ) ) ); + Sequence<PropertyValue> *pArg = + (Sequence<PropertyValue>*) aArgAsAny.getValue(); + Reference< XPropertyAccess > xPropAcc = Reference< XPropertyAccess >::query( xInterface ); + xPropAcc->setPropertyValues( *pArg ); + + // SbUnoObject daraus basteln und zurueckliefern + Any aAny; + aAny <<= xInterface; + SbUnoObjectRef xUnoObj = new SbUnoObject( aServiceName, aAny ); + if( xUnoObj->getUnoAny().getValueType().getTypeClass() != TypeClass_VOID ) + { + // Objekt zurueckliefern + refVar->PutObject( (SbUnoObject*)xUnoObj ); + return; + } + } + + // Objekt konnte nicht erzeugt werden + refVar->PutObject( NULL ); +} + + diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx new file mode 100644 index 000000000000..6b3cd5c011ba --- /dev/null +++ b/basic/source/classes/sb.cxx @@ -0,0 +1,1028 @@ +/************************************************************************* + * + * $RCSfile: sb.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <stdio.h> // sprintf() + +#pragma hdrstop +#include "sb.hxx" +#ifdef VCL +#include <vcl/rcid.h> +#include <vcl/config.hxx> +#endif + +#ifndef _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif +#ifndef __RSC //autogen +#include <tools/errinf.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef _LIST_HXX //autogen +#include <tools/list.hxx> +#endif +#ifndef _SHL_HXX //autogen +#include <tools/shl.hxx> +#endif +#ifndef _TOOLS_RC_HXX //autogen +#include <tools/rc.hxx> +#endif +#ifndef _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#include "sbunoobj.hxx" +#include "sbjsmeth.hxx" +#include "sbjsmod.hxx" +#include "sbintern.hxx" +#include "disas.hxx" +#include "runtime.hxx" +#include "sbuno.hxx" +#include "stdobj.hxx" +#include "filefmt.hxx" +#include "sb.hrc" +#include <basrid.hxx> + +#pragma SW_SEGMENT_CLASS( SBASIC, SBASIC_CODE ) + +SV_IMPL_VARARR(SbTextPortions,SbTextPortion) + +TYPEINIT1(StarBASIC,SbxObject) + +#define RTLNAME "@SBRTL" + + +//======================================================================== +// Array zur Umrechnung SFX <-> VB-Fehlercodes anlegen + +struct SFX_VB_ErrorItem +{ + USHORT nErrorVB; + SbError nErrorSFX; +}; + +const SFX_VB_ErrorItem __FAR_DATA SFX_VB_ErrorTab[] = +{ + { 2, SbERR_SYNTAX }, + { 3, SbERR_NO_GOSUB }, + { 4, SbERR_REDO_FROM_START }, + { 5, SbERR_BAD_ARGUMENT }, + { 6, SbERR_MATH_OVERFLOW }, + { 7, SbERR_NO_MEMORY }, + { 8, SbERR_ALREADY_DIM }, + { 9, SbERR_OUT_OF_RANGE }, + { 10, SbERR_DUPLICATE_DEF }, + { 11, SbERR_ZERODIV }, + { 12, SbERR_VAR_UNDEFINED }, + { 13, SbERR_CONVERSION }, + { 14, SbERR_BAD_PARAMETER }, + { 18, SbERR_USER_ABORT }, + { 20, SbERR_BAD_RESUME }, + { 28, SbERR_STACK_OVERFLOW }, + { 35, SbERR_PROC_UNDEFINED }, + { 48, SbERR_BAD_DLL_LOAD }, + { 49, SbERR_BAD_DLL_CALL }, + { 51, SbERR_INTERNAL_ERROR }, + { 52, SbERR_BAD_CHANNEL }, + { 53, SbERR_FILE_NOT_FOUND }, + { 54, SbERR_BAD_FILE_MODE }, + { 55, SbERR_FILE_ALREADY_OPEN }, + { 57, SbERR_IO_ERROR }, + { 58, SbERR_FILE_EXISTS }, + { 59, SbERR_BAD_RECORD_LENGTH }, + { 61, SbERR_DISK_FULL }, + { 62, SbERR_READ_PAST_EOF }, + { 63, SbERR_BAD_RECORD_NUMBER }, + { 67, SbERR_TOO_MANY_FILES }, + { 68, SbERR_NO_DEVICE }, + { 70, SbERR_ACCESS_DENIED }, + { 71, SbERR_NOT_READY }, + { 73, SbERR_NOT_IMPLEMENTED }, + { 74, SbERR_DIFFERENT_DRIVE }, + { 75, SbERR_ACCESS_ERROR }, + { 76, SbERR_PATH_NOT_FOUND }, + { 91, SbERR_NO_OBJECT }, + { 93, SbERR_BAD_PATTERN }, + { 94, SBERR_IS_NULL }, + { 250, SbERR_DDE_ERROR }, + { 280, SbERR_DDE_WAITINGACK }, + { 281, SbERR_DDE_OUTOFCHANNELS }, + { 282, SbERR_DDE_NO_RESPONSE }, + { 283, SbERR_DDE_MULT_RESPONSES }, + { 284, SbERR_DDE_CHANNEL_LOCKED }, + { 285, SbERR_DDE_NOTPROCESSED }, + { 286, SbERR_DDE_TIMEOUT }, + { 287, SbERR_DDE_USER_INTERRUPT }, + { 288, SbERR_DDE_BUSY }, + { 289, SbERR_DDE_NO_DATA }, + { 290, SbERR_DDE_WRONG_DATA_FORMAT }, + { 291, SbERR_DDE_PARTNER_QUIT }, + { 292, SbERR_DDE_CONV_CLOSED }, + { 293, SbERR_DDE_NO_CHANNEL }, + { 294, SbERR_DDE_INVALID_LINK }, + { 295, SbERR_DDE_QUEUE_OVERFLOW }, + { 296, SbERR_DDE_LINK_ALREADY_EST }, + { 297, SbERR_DDE_LINK_INV_TOPIC }, + { 298, SbERR_DDE_DLL_NOT_FOUND }, + { 323, SbERR_CANNOT_LOAD }, + { 341, SbERR_BAD_INDEX }, + { 366, SbERR_NO_ACTIVE_OBJECT }, + { 380, SbERR_BAD_PROP_VALUE }, + { 382, SbERR_PROP_READONLY }, + { 394, SbERR_PROP_WRITEONLY }, + { 420, SbERR_INVALID_OBJECT }, + { 423, SbERR_NO_METHOD }, + { 424, SbERR_NEEDS_OBJECT }, + { 425, SbERR_INVALID_USAGE_OBJECT }, + { 430, SbERR_NO_OLE }, + { 438, SbERR_BAD_METHOD }, + { 440, SbERR_OLE_ERROR }, + { 445, SbERR_BAD_ACTION }, + { 446, SbERR_NO_NAMED_ARGS }, + { 447, SbERR_BAD_LOCALE }, + { 448, SbERR_NAMED_NOT_FOUND }, + { 449, SbERR_NOT_OPTIONAL }, + { 450, SbERR_WRONG_ARGS }, + { 451, SbERR_NOT_A_COLL }, + { 452, SbERR_BAD_ORDINAL }, + { 453, SbERR_DLLPROC_NOT_FOUND }, + { 460, SbERR_BAD_CLIPBD_FORMAT }, + { 951, SbERR_UNEXPECTED }, + { 952, SbERR_EXPECTED }, + { 953, SbERR_SYMBOL_EXPECTED }, + { 954, SbERR_VAR_EXPECTED }, + { 955, SbERR_LABEL_EXPECTED }, + { 956, SbERR_LVALUE_EXPECTED }, + { 957, SbERR_VAR_DEFINED }, + { 958, SbERR_PROC_DEFINED }, + { 959, SbERR_LABEL_DEFINED }, + { 960, SbERR_UNDEF_VAR }, + { 961, SbERR_UNDEF_ARRAY }, + { 962, SbERR_UNDEF_PROC }, + { 963, SbERR_UNDEF_LABEL }, + { 964, SbERR_UNDEF_TYPE }, + { 965, SbERR_BAD_EXIT }, + { 966, SbERR_BAD_BLOCK }, + { 967, SbERR_BAD_BRACKETS }, + { 968, SbERR_BAD_DECLARATION }, + { 969, SbERR_BAD_PARAMETERS }, + { 970, SbERR_BAD_CHAR_IN_NUMBER }, + { 971, SbERR_MUST_HAVE_DIMS }, + { 972, SbERR_NO_IF }, + { 973, SbERR_NOT_IN_SUBR }, + { 974, SbERR_NOT_IN_MAIN }, + { 975, SbERR_WRONG_DIMS }, + { 976, SbERR_BAD_OPTION }, + { 977, SbERR_CONSTANT_REDECLARED }, + { 978, SbERR_PROG_TOO_LARGE }, + { 979, SbERR_NO_STRINGS_ARRAYS }, + { 1000, SbERR_PROPERTY_NOT_FOUND }, + { 1001, SbERR_METHOD_NOT_FOUND }, + { 1002, SbERR_ARG_MISSING }, + { 1003, SbERR_BAD_NUMBER_OF_ARGS }, + { 1004, SbERR_METHOD_FAILED }, + { 1005, SbERR_SETPROP_FAILED }, + { 1006, SbERR_GETPROP_FAILED }, + { 0xFFFF, 0xFFFFFFFFL } // End-Marke +}; + +//////////////////////////////////////////////////////////////////////////// + +// Die StarBASIC-Factory hat einen Hack. Wenn ein SbModule eingerichtet wird, +// wird der Pointer gespeichert und an nachfolgende SbProperties/SbMethods +// uebergeben. Dadurch wird die Modul-Relationship wiederhergestellt. Das +// klappt aber nur, wenn ein Modul geladen wird. Fuer getrennt geladene +// Properties kann es Probleme geben! + +SbxBase* SbiFactory::Create( UINT16 nSbxId, UINT32 nCreator ) +{ + if( nCreator == SBXCR_SBX ) + { + String aEmpty; + switch( nSbxId ) + { + case SBXID_BASIC: + return new StarBASIC( NULL ); + case SBXID_BASICMOD: + return new SbModule( aEmpty ); + case SBXID_BASICPROP: + return new SbProperty( aEmpty, SbxVARIANT, NULL ); + case SBXID_BASICMETHOD: + return new SbMethod( aEmpty, SbxVARIANT, NULL ); + case SBXID_JSCRIPTMOD: + return new SbJScriptModule( aEmpty ); + case SBXID_JSCRIPTMETH: + return new SbJScriptMethod( aEmpty, SbxVARIANT, NULL ); + } + } + return NULL; +} + +SbxObject* SbiFactory::CreateObject( const String& rClass ) +{ + if( rClass.EqualsIgnoreCaseAscii( "StarBASIC" ) ) + return new StarBASIC( NULL ); + else + if( rClass.EqualsIgnoreCaseAscii( "StarBASICModule" ) ) + { + String aEmpty; + return new SbModule( aEmpty ); + } + else + return NULL; +} + +//////////////////////////////////////////////////////////////////////////// + +StarBASIC::StarBASIC( StarBASIC* p ) + : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) ) +{ + SetParent( p ); + pLibInfo = NULL; + bNoRtl = bBreak = FALSE; + pModules = new SbxArray; + +#ifdef DBG_UTIL + Config LangConfig( String( RTL_CONSTASCII_USTRINGPARAM("d:\\LANGUAGE.INI") ) ); + LangConfig.SetGroup( "main" ); + ByteString aStr = LangConfig.ReadKey( "language","basic" ); + if( aStr == "vbscript" ) + SetGlobalLanguageMode( SB_LANG_VBSCRIPT ); + else + if( aStr == "javascript" ) + SetGlobalLanguageMode( SB_LANG_JAVASCRIPT ); +#endif + + if( !GetSbData()->nInst++ ) + { + pSBFAC = new SbiFactory; + AddFactory( pSBFAC ); + pUNOFAC = new SbUnoFactory; + AddFactory( pUNOFAC ); + } + pRtl = new SbiStdObject( String( RTL_CONSTASCII_USTRINGPARAM(RTLNAME) ), this ); + // Suche ueber StarBASIC ist immer global + SetFlag( SBX_GBLSEARCH ); +} + +// #51727 SetModified ueberladen, damit der Modified- +// Zustand nicht an den Parent weitergegeben wird. +void StarBASIC::SetModified( BOOL b ) +{ + SbxBase::SetModified( b ); +} + +//*** + +StarBASIC::~StarBASIC() +{ + if( !--GetSbData()->nInst ) + { + RemoveFactory( pSBFAC ); + pSBFAC = NULL; + RemoveFactory( pUNOFAC ); + pUNOFAC = NULL; + +#ifdef DBG_UTIL + // SbiData braucht am Programm-Ende nicht abgeraeumt werden, + // aber wir wollen keine MLK's beim Purify + // Wo sollte es sonst geschehen??? + SbiGlobals** pp = (SbiGlobals**) ::GetAppData( SHL_SBC ); + SbiGlobals* p = *pp; + if( p ) + { + delete p; + *pp = 0; + } +#endif + } +} + +// operator new() wird hier versenkt, damit jeder eine Instanz +// anlegen kann, ohne neu zu bilden. + +void* StarBASIC::operator new( size_t n ) +{ + if( n < sizeof( StarBASIC ) ) + { +// DBG_ASSERT( FALSE, "Warnung: inkompatibler BASIC-Stand!" ); + n = sizeof( StarBASIC ); + } + return ::operator new( n ); +} + +void StarBASIC::operator delete( void* p ) +{ + ::operator delete( p ); +} + +/************************************************************************** +* +* Erzeugen/Verwalten von Modulen +* +**************************************************************************/ + +SbModule* StarBASIC::MakeModule( const String& rName, const String& rSrc ) +{ + SbModule* p = new SbModule( rName ); + p->SetSource( rSrc ); + p->SetParent( this ); + pModules->Insert( p, pModules->Count() ); + SetModified( TRUE ); + return p; +} + +void StarBASIC::Insert( SbxVariable* pVar ) +{ + if( pVar->IsA( TYPE(SbModule) ) ) + { + pModules->Insert( pVar, pModules->Count() ); + pVar->SetParent( this ); + StartListening( pVar->GetBroadcaster(), TRUE ); + } + else + { + BOOL bWasModified = IsModified(); + SbxObject::Insert( pVar ); + if( !bWasModified && pVar->IsSet( SBX_DONTSTORE ) ) + SetModified( FALSE ); + } +} + +void StarBASIC::Remove( SbxVariable* pVar ) +{ + if( pVar->IsA( TYPE(SbModule) ) ) + { + pModules->Remove( pVar ); + pVar->SetParent( 0 ); + EndListening( pVar->GetBroadcaster() ); + } + else + SbxObject::Remove( pVar ); +} + +BOOL StarBASIC::Compile( SbModule* pMod ) +{ + return pMod ? pMod->Compile() : FALSE; +} + +BOOL StarBASIC::Disassemble( SbModule* pMod, String& rText ) +{ + rText.Erase(); + if( pMod ) + pMod->Disassemble( rText ); + return BOOL( rText.Len() != 0 ); +} + +void StarBASIC::Clear() +{ + while( pModules->Count() ) + pModules->Remove( pModules->Count() - 1 ); +} + +SbModule* StarBASIC::FindModule( const String& rName ) +{ + for( USHORT i = 0; i < pModules->Count(); i++ ) + { + SbModule* p = (SbModule*) pModules->Get( i ); + if( p->GetName().EqualsIgnoreCaseAscii( rName ) ) + return p; + } + return NULL; +} + +// Init-Code aller Module ausfuehren (auch in inserteten Bibliotheken) +void StarBASIC::InitAllModules( void ) +{ + // Eigene Module initialisieren + for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + { + SbModule* pModule = (SbModule*)pModules->Get( nMod ); + if( !pModule->IsCompiled() ) + pModule->Compile(); + pModule->RunInit(); + } + // Alle Objekte ueberpruefen, ob es sich um ein Basic handelt + // Wenn ja, auch dort initialisieren + for ( USHORT nObj = 0; nObj < pObjs->Count(); nObj++ ) + { + SbxVariable* pVar = pObjs->Get( nObj ); + StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar); + if( pBasic ) + pBasic->InitAllModules(); + } +} + +// #43011 Fuer das TestTool, um globale Variablen loeschen zu koennen +void StarBASIC::ClearGlobalVars( void ) +{ + SbxArrayRef xProps( GetProperties() ); + USHORT nPropCount = xProps->Count(); + for ( USHORT nProp = 0 ; nProp < nPropCount ; ++nProp ) + { + SbxBase* pVar = xProps->Get( nProp ); + pVar->Clear(); + } + SetModified( TRUE ); +} + + +// Diese Implementation sucht erst innerhalb der Runtime-Library, dann +// nach einem Element innerhalb eines Moduls. Dieses Element kann eine +// Public-Variable oder ein Entrypoint sein. Wenn nicht gefunden, wird, +// falls nach einer Methode gesucht wird und ein Modul mit dem angege- +// benen Namen gefunden wurde, der Entrypoint "Main" gesucht. Wenn das +// auch nicht klappt, laeuft die traditionelle Suche ueber Objekte an. + +SbxVariable* StarBASIC::Find( const String& rName, SbxClassType t ) +{ + SbxVariable* pRes = NULL; + SbModule* pNamed = NULL; + // "Extended" search in Runtime Lib + // aber nur, wenn SbiRuntime nicht das Flag gesetzt hat + if( !bNoRtl ) + { + if( t == SbxCLASS_DONTCARE || t == SbxCLASS_OBJECT ) + { + if( rName.EqualsIgnoreCaseAscii( RTLNAME ) ) + pRes = pRtl; + } + if( !pRes ) + pRes = ((SbiStdObject*) (SbxObject*) pRtl)->Find( rName, t ); + if( pRes ) + pRes->SetFlag( SBX_EXTFOUND ); + } + // Module durchsuchen + if( !pRes ) + for( USHORT i = 0; i < pModules->Count(); i++ ) + { + SbModule* p = (SbModule*) pModules->Get( i ); + if( p->IsVisible() ) + { + // Modul merken fuer Main()-Aufruf + // oder stimmt etwa der Name ueberein?!? + if( p->GetName().EqualsIgnoreCaseAscii( rName ) ) + { + if( t == SbxCLASS_OBJECT || t == SbxCLASS_DONTCARE ) + { + pRes = p; break; + } + pNamed = p; + } + // Sonst testen, ob das Element vorhanden ist + // GBLSEARCH-Flag rausnehmen (wg. Rekursion) + USHORT nGblFlag = p->GetFlags() & SBX_GBLSEARCH; + p->ResetFlag( SBX_GBLSEARCH ); + pRes = p->Find( rName, t ); + p->SetFlag( nGblFlag ); + if( pRes ) + break; + } + } + if( !pRes && pNamed && ( t == SbxCLASS_METHOD || t == SbxCLASS_DONTCARE ) ) + pRes = pNamed->Find( String( RTL_CONSTASCII_USTRINGPARAM("Main") ), SbxCLASS_METHOD ); + if( !pRes ) + pRes = SbxObject::Find( rName, t ); + return pRes; +} + +BOOL StarBASIC::Call( const String& rName, SbxArray* pParam ) +{ + BOOL bRes = SbxObject::Call( rName, pParam ); + if( !bRes ) + { + SbxError eErr = SbxBase::GetError(); + SbxBase::ResetError(); + if( eErr != SbxERR_OK ) + RTError( (SbError)eErr, 0, 0, 0 ); + } + return bRes; +} + +// Find-Funktion ueber Name (z.B. Abfrage aus BASIC-IDE) +SbxBase* StarBASIC::FindSBXInCurrentScope( const String& rName ) +{ + if( !pINST ) + return NULL; + if( !pINST->pRun ) + return NULL; + return pINST->pRun->FindElementExtern( rName ); +} + +// Alte Schnittstelle vorerst erhalten +SbxVariable* StarBASIC::FindVarInCurrentScopy +( const String& rName, USHORT& rStatus ) +{ + rStatus = 1; // Annahme: Nichts gefunden + SbxVariable* pVar = NULL; + SbxBase* pSbx = FindSBXInCurrentScope( rName ); + if( pSbx ) + { + if( !pSbx->ISA(SbxMethod) && !pSbx->ISA(SbxObject) ) + pVar = PTR_CAST(SbxVariable,pSbx); + } + if( pVar ) + rStatus = 0; // doch gefunden + return pVar; +} + +void StarBASIC::Stop() +{ + SbiInstance* p = pINST; + while( p ) + { + p->Stop(); + p = p->pNext; + } +} + +BOOL StarBASIC::IsRunning() +{ + return BOOL( pINST != NULL ); +} + +/************************************************************************** +* +* Objekt-Factories etc. +* +**************************************************************************/ + +// Aktivierung eines Objekts. Aktive Objekte muessen nicht mehr +// von BASIC aus ueber den Namen angesprochen werden. Ist +// NULL angegeben, wird alles aktiviert. + +void StarBASIC::ActivateObject( const String* pName, BOOL bActivate ) +{ + if( pName ) + { + SbxObject* p = (SbxObject*) SbxObject::Find( *pName, SbxCLASS_OBJECT ); + if( p ) + if( bActivate ) + p->SetFlag( SBX_EXTSEARCH ); + else + p->ResetFlag( SBX_EXTSEARCH ); + } + else + { + for( USHORT i = 0; i < GetObjects()->Count(); i++ ) + { + SbxObject* p = (SbxObject*) GetObjects()->Get( i ); + if( bActivate ) + p->SetFlag( SBX_EXTSEARCH ); + else + p->ResetFlag( SBX_EXTSEARCH ); + } + } +} + +/************************************************************************** +* +* Debugging und Fehlerbehandlung +* +**************************************************************************/ + +SbMethod* StarBASIC::GetActiveMethod( USHORT nLevel ) +{ + if( pINST ) + return pINST->GetCaller( nLevel ); + else + return NULL; +} + +SbModule* StarBASIC::GetActiveModule() +{ + if( pINST && !IsCompilerError() ) + return pINST->GetActiveModule(); + else + return pCMOD; +} + +USHORT StarBASIC::BreakPoint( USHORT l, USHORT c1, USHORT c2 ) +{ + SetErrorData( 0, l, c1, c2 ); + bBreak = TRUE; + if( GetSbData()->aBreakHdl.IsSet() ) + return (USHORT) GetSbData()->aBreakHdl.Call( this ); + else + return BreakHdl(); +} + +USHORT StarBASIC::StepPoint( USHORT l, USHORT c1, USHORT c2 ) +{ + SetErrorData( 0, l, c1, c2 ); + bBreak = FALSE; + if( GetSbData()->aBreakHdl.IsSet() ) + return (USHORT) GetSbData()->aBreakHdl.Call( this ); + else + return BreakHdl(); +} + +USHORT __EXPORT StarBASIC::BreakHdl() +{ + return (USHORT) ( aBreakHdl.IsSet() + ? aBreakHdl.Call( this ) : SbDEBUG_CONTINUE ); +} + +// Abfragen fuer den Error-Handler und den Break-Handler: +USHORT StarBASIC::GetLine() { return GetSbData()->nLine; } +USHORT StarBASIC::GetCol1() { return GetSbData()->nCol1; } +USHORT StarBASIC::GetCol2() { return GetSbData()->nCol2; } + +// Spezifisch fuer den Error-Handler: +SbError StarBASIC::GetErrorCode() { return GetSbData()->nCode; } +const String& StarBASIC::GetErrorText() { return GetSbData()->aErrMsg; } +BOOL StarBASIC::IsCompilerError() { return GetSbData()->bCompiler; } +void StarBASIC::SetGlobalLanguageMode( SbLanguageMode eLanguageMode ) +{ + GetSbData()->eLanguageMode = eLanguageMode; +} +SbLanguageMode StarBASIC::GetGlobalLanguageMode() +{ + return GetSbData()->eLanguageMode; +} +// Lokale Einstellung +SbLanguageMode StarBASIC::GetLanguageMode() +{ + // Globale Einstellung nehmen? + if( eLanguageMode == SB_LANG_GLOBAL ) + return GetSbData()->eLanguageMode; + else + return eLanguageMode; +} + +// AB: 29.3.96 +// Das Mapping zwischen alten und neuen Fehlercodes erfolgt, indem die Tabelle +// SFX_VB_ErrorTab[] durchsucht wird. Dies ist zwar nicht besonders performant, +// verbraucht aber viel weniger Speicher als entsprechende switch-Bloecke. +// Die Umrechnung von Fehlercodes muss nicht schnell sein, daher auch keine +// binaere Suche bei VB-Error -> SFX-Error. + +// Neue Fehler-Codes auf alte, Sbx-Kompatible zurueckmappen +USHORT StarBASIC::GetVBErrorCode( SbError nError ) +{ + USHORT nRet = 0; + + // Suchschleife + const SFX_VB_ErrorItem* pErrItem; + USHORT nIndex = 0; + do + { + pErrItem = SFX_VB_ErrorTab + nIndex; + if( pErrItem->nErrorSFX == nError ) + { + nRet = pErrItem->nErrorVB; + break; + } + nIndex++; + } + while( pErrItem->nErrorVB != 0xFFFF ); // bis End-Marke + return nRet; +} + +SbError StarBASIC::GetSfxFromVBError( USHORT nError ) +{ + SbError nRet = 0L; + + // Suchschleife + const SFX_VB_ErrorItem* pErrItem; + USHORT nIndex = 0; + do + { + pErrItem = SFX_VB_ErrorTab + nIndex; + if( pErrItem->nErrorVB == nError ) + { + nRet = pErrItem->nErrorSFX; + break; + } + else if( pErrItem->nErrorVB > nError ) + break; // kann nicht mehr gefunden werden + + nIndex++; + } + while( pErrItem->nErrorVB != 0xFFFF ); // bis End-Marke + return nRet; +} + +// Error- / Break-Daten setzen +void StarBASIC::SetErrorData +( SbError nCode, USHORT nLine, USHORT nCol1, USHORT nCol2 ) +{ + SbiGlobals& aGlobals = *GetSbData(); + aGlobals.nCode = nCode; + aGlobals.nLine = nLine; + aGlobals.nCol1 = nCol1; + aGlobals.nCol2 = nCol2; +} + +//---------------------------------------------------------------- +// Hilfsklasse zum Zugriff auf String SubResourcen einer Resource. +// Quelle: sfx2\source\doc\docfile.cxx (TLX) +struct BasicStringList_Impl : private Resource +{ + ResId aResId; + + BasicStringList_Impl( ResId& rErrIdP, USHORT nId) + : Resource( rErrIdP ),aResId(nId){} + ~BasicStringList_Impl() { FreeResource(); } + + String GetString(){ return String( aResId ); } + BOOL IsErrorTextAvailable( void ) + { return IsAvailableRes(aResId.SetRT(RSC_STRING)); } +}; +//---------------------------------------------------------------- + +// #60175 Flag, das bei Basic-Fehlern das Anziehen der SFX-Resourcen verhindert +static BOOL bStaticSuppressSfxResource = FALSE; + +void StarBASIC::StaticSuppressSfxResource( BOOL bSuppress ) +{ + bStaticSuppressSfxResource = bSuppress; +} + +void StarBASIC::MakeErrorText( SbError nId, const String& aMsg ) +{ + if( bStaticSuppressSfxResource ) + { + GetSbData()->aErrMsg = String( RTL_CONSTASCII_USTRINGPARAM("No resource: Error message not available") ); + return; + } + + USHORT nOldID = GetVBErrorCode( nId ); + + // Hilfsklasse instanzieren + BasicResId aId( RID_BASIC_START ); + BasicStringList_Impl aMyStringList( aId, USHORT(nId & ERRCODE_RES_MASK) ); + + if( aMyStringList.IsErrorTextAvailable() ) + { + // Merge Message mit Zusatztext + String aMsg1 = aMyStringList.GetString(); + // Argument-Platzhalter durch %s ersetzen + String aSrgStr( RTL_CONSTASCII_USTRINGPARAM("$(ARG1)") ); + USHORT nResult = aMsg1.Search( aSrgStr ); + + if( nResult != STRING_NOTFOUND ) + { + aMsg1.Erase( nResult, aSrgStr.Len() ); + aMsg1.Insert( aMsg, nResult ); + } + GetSbData()->aErrMsg = aMsg1; + } + else + { + String aStdMsg( RTL_CONSTASCII_USTRINGPARAM("Fehler ") ); + aStdMsg += String::CreateFromInt32( nOldID); + aStdMsg += String( RTL_CONSTASCII_USTRINGPARAM(": Kein Fehlertext verfuegbar!") ); + GetSbData()->aErrMsg = aStdMsg; + } +} + +BOOL StarBASIC::CError + ( SbError code, const String& rMsg, USHORT l, USHORT c1, USHORT c2 ) +{ + // Compiler-Fehler waehrend der Laufzeit -> Programm anhalten + if( IsRunning() ) + Stop(); + + // #45741# Falls der Wait-Cursor gesetzt ist, jetzt zuruecksetzen + if( GetSbData()->bCompWait ) + { + Application::LeaveWait(); + GetSbData()->bCompWait = FALSE; + } + + // Flag setzen, damit GlobalRunInit den Fehler mitbekommt + GetSbData()->bGlobalInitErr = TRUE; + + // Fehlertext basteln + MakeErrorText( code, rMsg ); + + // Umsetzung des Codes fuer String-Transport in SFX-Error + if( rMsg.Len() ) + code = (ULONG)*new StringErrorInfo( code, String(rMsg) ); + + SetErrorData( code, l, c1, c2 ); + GetSbData()->bCompiler = TRUE; + BOOL bRet; + if( GetSbData()->aErrHdl.IsSet() ) + bRet = (BOOL) GetSbData()->aErrHdl.Call( this ); + else + bRet = ErrorHdl(); + GetSbData()->bCompiler = FALSE; // nur TRUE fuer Error-Handler + return bRet; +} + +BOOL StarBASIC::RTError + ( SbError code, USHORT l, USHORT c1, USHORT c2 ) +{ + return RTError( code, String(), l, c1, c2 ); +} + +BOOL StarBASIC::RTError( SbError code, const String& rMsg, USHORT l, USHORT c1, USHORT c2 ) +{ + SbError c = code; + if( (c & ERRCODE_CLASS_MASK) == ERRCODE_CLASS_COMPILER ) + c = 0; + MakeErrorText( c, rMsg ); + + // Umsetzung des Codes fuer String-Transport in SFX-Error + if( rMsg.Len() ) + code = (ULONG)*new StringErrorInfo( code, String(rMsg) ); + + SetErrorData( code, l, c1, c2 ); + if( GetSbData()->aErrHdl.IsSet() ) + return (BOOL) GetSbData()->aErrHdl.Call( this ); + else + return ErrorHdl(); +} + +void StarBASIC::Error( SbError n ) +{ + Error( n, String() ); +} + +void StarBASIC::Error( SbError n, const String& rMsg ) +{ + if( pINST ) + pINST->Error( n, rMsg ); +} + +void StarBASIC::FatalError( SbError n ) +{ + if( pINST ) + pINST->FatalError( n ); +} + +SbError StarBASIC::GetErr() +{ + if( pINST ) + return pINST->GetErr(); + else + return 0; +} + +// #66536 Zusatz-Message fuer RTL-Funktion Error zugreifbar machen +String StarBASIC::GetErrorMsg() +{ + if( pINST ) + return pINST->GetErrorMsg(); + else + return String(); +} + +USHORT StarBASIC::GetErl() +{ + if( pINST ) + return pINST->GetErl(); + else + return 0; +} + +BOOL __EXPORT StarBASIC::ErrorHdl() +{ + return (BOOL) ( aErrorHdl.IsSet() + ? aErrorHdl.Call( this ) : FALSE ); +} + +Link StarBASIC::GetGlobalErrorHdl() +{ + return GetSbData()->aErrHdl; +} + +void StarBASIC::SetGlobalErrorHdl( const Link& rLink ) +{ + GetSbData()->aErrHdl = rLink; +} + + +Link StarBASIC::GetGlobalBreakHdl() +{ + return GetSbData()->aBreakHdl; +} + +void StarBASIC::SetGlobalBreakHdl( const Link& rLink ) +{ + GetSbData()->aBreakHdl = rLink; +} + +/************************************************************************** +* +* Laden und Speichern +* +**************************************************************************/ + +BOOL StarBASIC::LoadData( SvStream& r, USHORT nVer ) +{ + if( !SbxObject::LoadData( r, nVer ) ) + return FALSE; + UINT16 nMod; + pModules->Clear(); + r >> nMod; + for( USHORT i = 0; i < nMod; i++ ) + { + SbModule* pMod = (SbModule*) SbxBase::Load( r ); + if( !pMod ) + return FALSE; + else if( pMod->ISA(SbJScriptModule) ) + { + // Ref zuweisen, damit pMod deleted wird + SbModuleRef xRef = pMod; + } + else + { + pMod->SetParent( this ); + pModules->Put( pMod, i ); + } + } + // HACK fuer SFX-Mist! + SbxVariable* p = Find( String( RTL_CONSTASCII_USTRINGPARAM("FALSE") ), SbxCLASS_PROPERTY ); + if( p ) + Remove( p ); + p = Find( String( RTL_CONSTASCII_USTRINGPARAM("TRUE") ), SbxCLASS_PROPERTY ); + if( p ) + Remove( p ); + // Ende des Hacks! + // Suche ueber StarBASIC ist immer global + DBG_ASSERT( IsSet( SBX_GBLSEARCH ), "Basic ohne GBLSEARCH geladen" ); + SetFlag( SBX_GBLSEARCH ); + return TRUE; +} + +BOOL StarBASIC::StoreData( SvStream& r ) const +{ + if( !SbxObject::StoreData( r ) ) + return FALSE; + r << (UINT16) pModules->Count(); + for( USHORT i = 0; i < pModules->Count(); i++ ) + { + SbModule* p = (SbModule*) pModules->Get( i ); + if( !p->Store( r ) ) + return FALSE; + } + return TRUE; +} + +BOOL StarBASIC::LoadOldModules( SvStream& r ) +{ + return FALSE; +} + + diff --git a/basic/source/classes/sb.src b/basic/source/classes/sb.src new file mode 100644 index 000000000000..ba78c4a83d89 --- /dev/null +++ b/basic/source/classes/sb.src @@ -0,0 +1,3747 @@ +/************************************************************************* + * + * $RCSfile: sb.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#define __RSC +#ifndef _ERRCODE_HXX //autogen +#include <tools/errcode.hxx> +#endif +#include "sb.hrc" +#include "sberrors.hxx" + +Resource RID_BASIC_START +{ + String SbERR_SYNTAX & ERRCODE_RES_MASK + { + Text = "Syntaxfehler" ; + Text [ ENGLISH ] = "Syntax error" ; + Text [ norwegian ] = "Syntax error" ; + Text [ italian ] = "Errore di sintassi" ; + Text [ portuguese_brazilian ] = "Syntax error" ; + Text [ portuguese ] = "Erro de sintaxe" ; + Text [ french ] = "Erreur de syntaxe" ; + Text [ dutch ] = "Fout in syntaxis" ; + Text [ spanish ] = "Error de sintaxis" ; + Text [ danish ] = "Syntaksfejl" ; + Text [ swedish ] = "Syntaxfel" ; + Text [ finnish ] = "Syntax error" ; + Text [ english_us ] = "Syntax error" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Bd skadni"; + Text[ japanese ] = " װ"; + Text[ chinese_traditional ] = "yk~"; + Text[ arabic ] = " "; + Text[ dutch ] = "Fout in syntaxis"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "ؽ "; + Text[ turkish ] = "Szdizim hatas"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_GOSUB & ERRCODE_RES_MASK + { + Text = "Return ohne Gosub" ; + Text [ ENGLISH ] = "Return without Gosub" ; + Text [ norwegian ] = "Return without Gosub" ; + Text [ italian ] = "Return senza Gosub" ; + Text [ portuguese_brazilian ] = "Return without Gosub" ; + Text [ portuguese ] = "Retorno sem Gosub" ; + Text [ french ] = "Return sans Gosub" ; + Text [ dutch ] = "Return zonder Gosub" ; + Text [ spanish ] = "Retorno sin Gosub" ; + Text [ danish ] = "Return uden Gosub" ; + Text [ swedish ] = "Return utan Gosub" ; + Text [ finnish ] = "Return without Gosub" ; + Text [ english_us ] = "Return without Gosub" ; + Text[ chinese_simplified ] = "Return Gosub"; + Text[ russian ] = " Gosub"; + Text[ polish ] = "Powrt bez Gosub"; + Text[ japanese ] = "Return without Gosub"; + Text[ chinese_traditional ] = "Return a Gosub"; + Text[ arabic ] = "Gosub Return"; + Text[ dutch ] = "Return zonder Gosub"; + Text[ chinese_simplified ] = "Return Gosub"; + Text[ greek ] = "Return Gosub"; + Text[ korean ] = "Gosub "; + Text[ turkish ] = "Gosub olmadan return"; + Text[ language_user1 ] = " "; + }; + String SbERR_REDO_FROM_START & ERRCODE_RES_MASK + { + Text = "Inkorrekte Eingabe, bitte wiederholen" ; + Text [ ENGLISH ] = "Incorrect data, please retry" ; + Text [ norwegian ] = "Incorrect data, please retry" ; + Text [ italian ] = "Digitazione errata, riprovare" ; + Text [ portuguese_brazilian ] = "Incorrect data, please retry" ; + Text [ portuguese ] = "Entrada incorrecta, tente novamente" ; + Text [ french ] = "Saisie incorrecte, veuillez recommencer" ; + Text [ dutch ] = "Incorrecte gegevens, herhalen a.u.b." ; + Text [ spanish ] = "Entrada incorrecta. Intntelo otra vez" ; + Text [ danish ] = "Forkert input, gentag venligst" ; + Text [ swedish ] = "Felaktig inmatning, var vnlig upprepa" ; + Text [ finnish ] = "Incorrect data, please retry" ; + Text [ english_us ] = "Incorrect entry; please retry" ; + Text[ chinese_simplified ] = "Чظ"; + Text[ russian ] = " , , "; + Text[ polish ] = "Niepoprawny wpis, prosz ponowi"; + Text[ japanese ] = "Ȃ͂łA蒼ĉ"; + Text[ chinese_traditional ] = "JLġMЭơC"; + Text[ arabic ] = " "; + Text[ dutch ] = "Incorrecte gegevens, herhalen a.u.b."; + Text[ chinese_simplified ] = "Чظ"; + Text[ greek ] = " , "; + Text[ korean ] = " ߸Ǿϴ. ٽ ֽʽÿ."; + Text[ turkish ] = "Giri yanl, ltfen yeniden girin"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_ARGUMENT & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Ungltiger Prozeduraufruf : Ungltiger Prozeduraufruf */ + Text = "Ungltiger Prozeduraufruf" ; + Text [ ENGLISH ] = "Invalid procedure call" ; + Text [ norwegian ] = "Invalid procedure call" ; + Text [ italian ] = "Richiamo di procedura non valido" ; + Text [ portuguese_brazilian ] = "Invalid procedure call" ; + Text [ portuguese ] = "Chamada de procedimento no vlida" ; + Text [ french ] = "Appel de procdure incorrect" ; + Text [ dutch ] = "Ongeldige oproep van procedure" ; + Text [ spanish ] = "Inicio del proceso no vlido" ; + Text [ danish ] = "Ugyldigt procedurekald" ; + Text [ swedish ] = "Ogiltigt proceduranrop" ; + Text [ finnish ] = "Invalid procedure call" ; + Text [ english_us ] = "Invalid procedure call" ; + Text[ chinese_simplified ] = "Чĵù"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowa procedura wywoania"; + Text[ japanese ] = "ۼެ̌Ăяo"; + Text[ chinese_traditional ] = "եιL{L"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldige oproep van procedure"; + Text[ chinese_simplified ] = "Чĵù"; + Text[ greek ] = " "; + Text[ korean ] = "߸ ν ȣ"; + Text[ turkish ] = "Geersiz yordam ars"; + Text[ language_user1 ] = " "; + }; + String SbERR_MATH_OVERFLOW & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? berlauf : berlauf */ + Text = "berlauf" ; + Text [ ENGLISH ] = "Overflow" ; + Text [ norwegian ] = "Overflow" ; + Text [ italian ] = "Overflow" ; + Text [ portuguese_brazilian ] = "Overflow" ; + Text [ portuguese ] = "Transbordo" ; + Text [ french ] = "Dbordement" ; + Text [ dutch ] = "Overflow" ; + Text [ spanish ] = "Desbordamiento" ; + Text [ danish ] = "Overlb" ; + Text [ swedish ] = "Spill" ; + Text [ finnish ] = "Overflow" ; + Text [ english_us ] = "Overflow" ; + Text[ chinese_simplified ] = "ֵ"; + Text[ russian ] = ""; + Text[ polish ] = "Przepenienie"; + Text[ japanese ] = "ް۰"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ dutch ] = "Overflow"; + Text[ chinese_simplified ] = "ֵ"; + Text[ greek ] = ""; + Text[ korean ] = "ħ"; + Text[ turkish ] = "Tama"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_MEMORY & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Nicht gengend Speicher : Nicht gengend Speicher */ + Text = "Nicht gengend Speicher" ; + Text [ ENGLISH ] = "Out of memory" ; + Text [ norwegian ] = "Out of memory" ; + Text [ italian ] = "Memoria insufficiente" ; + Text [ portuguese_brazilian ] = "Out of memory" ; + Text [ portuguese ] = "Memria insuficiente" ; + Text [ french ] = "Mmoire insuffisante" ; + Text [ dutch ] = "Niet voldoende geheugen" ; + Text [ spanish ] = "No hay memoria suficiente" ; + Text [ danish ] = "Ikke tilstrkkelig hukommelse" ; + Text [ swedish ] = "Inte tillrckligt med minne" ; + Text [ finnish ] = "Out of memory" ; + Text [ english_us ] = "Not enough memory" ; + Text[ chinese_simplified ] = "ڴ治"; + Text[ russian ] = " "; + Text[ polish ] = "Za mao pamici"; + Text[ japanese ] = "\\ȋeʂ܂"; + Text[ chinese_traditional ] = "O餣"; + Text[ arabic ] = " "; + Text[ dutch ] = "Niet voldoende geheugen"; + Text[ chinese_simplified ] = "ڴ治"; + Text[ greek ] = " "; + Text[ korean ] = " "; + Text[ turkish ] = "Bellek yeterli deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_ALREADY_DIM & ERRCODE_RES_MASK + { + Text = "Array bereits dimensioniert" ; + Text [ ENGLISH ] = "Array already dimensioned" ; + Text [ norwegian ] = "Array already dimensioned" ; + Text [ italian ] = "Array gi dimensionato" ; + Text [ portuguese_brazilian ] = "Array already dimensioned" ; + Text [ portuguese ] = "A matriz j foi dimensionada" ; + Text [ french ] = "Array dj dimensionn" ; + Text [ dutch ] = "Array reeds gedimensioneerd" ; + Text [ spanish ] = "Array ya dimensionado" ; + Text [ danish ] = "Array er allerede dimensioneret" ; + Text [ swedish ] = "Array redan dimensionerad" ; + Text [ finnish ] = "Array already dimensioned" ; + Text [ english_us ] = "Array already dimensioned" ; + Text[ chinese_simplified ] = "Ѿ߶"; + Text[ russian ] = " "; + Text[ polish ] = "Macierz ju zostaa zwymiarowana"; + Text[ japanese ] = "z͂łɎĂ܂"; + Text[ chinese_traditional ] = "CwgQwث"; + Text[ arabic ] = " "; + Text[ dutch ] = "Array reeds gedimensioneerd"; + Text[ chinese_simplified ] = "Ѿ߶"; + Text[ greek ] = " "; + Text[ korean ] = "迭 ũⰡ ̹ "; + Text[ turkish ] = "Dizi boyutlandrlm durumda"; + Text[ language_user1 ] = " "; + }; + String SbERR_OUT_OF_RANGE & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Index auerhalb des definierten Bereichs : Index auerhalb des definierten Bereichs */ + Text = "Index auerhalb des definierten Bereichs" ; + Text [ ENGLISH ] = "Subscript out of range" ; + Text [ norwegian ] = "Subscript out of range" ; + Text [ italian ] = "Indice al di fuori dell'area definita" ; + Text [ portuguese_brazilian ] = "Subscript out of range" ; + Text [ portuguese ] = "ndice fora da rea definida" ; + Text [ french ] = "Index en dehors de la plage dfinie" ; + Text [ dutch ] = "Index buiten gedefinieerd bereik" ; + Text [ spanish ] = "El ndice se encuentra fuera del rea definida" ; + Text [ danish ] = "Indeks udenfor det definerede omrde" ; + Text [ swedish ] = "Index utanfr definierat omrde" ; + Text [ finnish ] = "Subscript out of range" ; + Text [ english_us ] = "Index out of defined range" ; + Text[ chinese_simplified ] = "巶Χ֮"; + Text[ russian ] = " "; + Text[ polish ] = "Indeks poza zdefiniowanym obszarem"; + Text[ japanese ] = "`ꂽ͈͊O̲ޯ"; + Text[ chinese_traditional ] = "wqd~"; + Text[ arabic ] = " "; + Text[ dutch ] = "Index buiten gedefinieerd bereik"; + Text[ chinese_simplified ] = "巶Χ֮"; + Text[ greek ] = " ."; + Text[ korean ] = "ǵ ε"; + Text[ turkish ] = "Dizin tanmlanan araln dnda"; + Text[ language_user1 ] = " "; + }; + String SbERR_DUPLICATE_DEF & ERRCODE_RES_MASK + { + Text = "Doppelt vorhandene Definition" ; + Text [ ENGLISH ] = "Duplicate definition" ; + Text [ norwegian ] = "Duplicate definition" ; + Text [ italian ] = "Definizione doppia" ; + Text [ portuguese_brazilian ] = "Duplicate definition" ; + Text [ portuguese ] = "Definio dupla" ; + Text [ french ] = "Dfinition faisant double emploi" ; + Text [ dutch ] = "Definitie dubbel voorhanden" ; + Text [ spanish ] = "La definicin existe dos veces" ; + Text [ danish ] = "Dobbelt foreliggende definition" ; + Text [ swedish ] = "Dubbelt frekommande definition" ; + Text [ finnish ] = "Duplicate definition" ; + Text [ english_us ] = "Duplicate definition" ; + Text[ chinese_simplified ] = "˫ض"; + Text[ russian ] = " "; + Text[ polish ] = "Zduplikowana definicja"; + Text[ japanese ] = "d`"; + Text[ chinese_traditional ] = "sbwq"; + Text[ arabic ] = " "; + Text[ dutch ] = "Definitie dubbel voorhanden"; + Text[ chinese_simplified ] = "˫ض"; + Text[ greek ] = " "; + Text[ korean ] = "ߺ "; + Text[ turkish ] = "ift tanmlama"; + Text[ language_user1 ] = " "; + }; + String SbERR_ZERODIV & ERRCODE_RES_MASK + { + Text = "Division durch Null" ; + Text [ ENGLISH ] = "Division by zero" ; + Text [ norwegian ] = "Division by zero" ; + Text [ italian ] = "Diviso zero" ; + Text [ portuguese_brazilian ] = "Division by zero" ; + Text [ portuguese ] = "Dividir por zero" ; + Text [ french ] = "Division par zro" ; + Text [ dutch ] = "Deling door nul" ; + Text [ spanish ] = "Divisin por cero" ; + Text [ danish ] = "Divider med nul" ; + Text [ swedish ] = "Division med noll" ; + Text [ finnish ] = "Division by zero" ; + Text [ english_us ] = "Division by zero" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Dzielenie przez zero"; + Text[ japanese ] = "ۂɂ鏜Z"; + Text[ chinese_traditional ] = "_s"; + Text[ arabic ] = " "; + Text[ dutch ] = "Deling door nul"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "0 "; + Text[ turkish ] = "Sfra blme"; + Text[ language_user1 ] = " "; + }; + String SbERR_VAR_UNDEFINED & ERRCODE_RES_MASK + { + Text = "Variable nicht definiert" ; + Text [ ENGLISH ] = "Variable not defined" ; + Text [ norwegian ] = "Variable not defined" ; + Text [ italian ] = "Variabile non definita" ; + Text [ portuguese_brazilian ] = "Variable not defined" ; + Text [ portuguese ] = "Varivel no definida" ; + Text [ french ] = "Variable indfinie" ; + Text [ dutch ] = "Variabele niet gedefinieerd" ; + Text [ spanish ] = "Variable no definida" ; + Text [ danish ] = "Variablen er ikke defineret" ; + Text [ swedish ] = "Variabel inte definierad" ; + Text [ finnish ] = "Variable not defined" ; + Text [ english_us ] = "Variable not defined" ; + Text[ chinese_simplified ] = "ûж"; + Text[ russian ] = " "; + Text[ polish ] = "Zmienna nie zdefiniowana"; + Text[ japanese ] = "ϐ͒`Ă܂"; + Text[ chinese_traditional ] = "Swqܼ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Variabele niet gedefinieerd"; + Text[ chinese_simplified ] = "ûж"; + Text[ greek ] = " "; + Text[ korean ] = " "; + Text[ turkish ] = "Deiken tanmlanmad"; + Text[ language_user1 ] = " "; + }; + String SbERR_CONVERSION & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Datentypen unvertrglich : Datentypen unvertrglich */ + Text = "Datentypen unvertrglich" ; + Text [ ENGLISH ] = "Data type mismatch" ; + Text [ norwegian ] = "Data type mismatch" ; + Text [ italian ] = "Tipi di dati non compatibili" ; + Text [ portuguese_brazilian ] = "Data type mismatch" ; + Text [ portuguese ] = "Tipos de dados incompatveis" ; + Text [ french ] = "Types de donnes incompatibles" ; + Text [ dutch ] = "Gegevenstypen passen niet bij elkaar" ; + Text [ spanish ] = "Los tipos de datos no coinciden" ; + Text [ danish ] = "Datatyper er uforenelige" ; + Text [ swedish ] = "Datatyper passar inte ihop" ; + Text [ finnish ] = "Data type mismatch" ; + Text [ english_us ] = "Data type mismatch" ; + Text[ chinese_simplified ] = "Ͳƥ"; + Text[ russian ] = " "; + Text[ polish ] = "Niezgodne typy danych"; + Text[ japanese ] = "ް̎ނ͋܂"; + Text[ chinese_traditional ] = "ǰt"; + Text[ arabic ] = " "; + Text[ dutch ] = "Gegevenstypen passen niet bij elkaar"; + Text[ chinese_simplified ] = "Ͳƥ"; + Text[ greek ] = " "; + Text[ korean ] = " Ÿ ʽϴ."; + Text[ turkish ] = "Veri tipleri arasnda uyumazlk"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_PARAMETER & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Ungltiger Parameter : Ungltiger Parameter */ + Text = "Ungltiger Parameter" ; + Text [ ENGLISH ] = "Bad parameter" ; + Text [ norwegian ] = "Bad parameter" ; + Text [ italian ] = "Parametro non valido" ; + Text [ portuguese_brazilian ] = "Bad parameter" ; + Text [ portuguese ] = "Parmetro no vlido" ; + Text [ french ] = "Paramtre incorrect" ; + Text [ dutch ] = "Ongeldige parameter" ; + Text [ spanish ] = "Parmetro no vlido" ; + Text [ danish ] = "Ugyldig parameter" ; + Text [ swedish ] = "Ogiltig parameter" ; + Text [ finnish ] = "Bad parameter" ; + Text [ english_us ] = "Invalid parameter" ; + Text[ chinese_simplified ] = "Ч"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowy parametr"; + Text[ japanese ] = "Ұ"; + Text[ chinese_traditional ] = "UܼƵL"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldige parameter"; + Text[ chinese_simplified ] = "Ч"; + Text[ greek ] = " "; + Text[ korean ] = "߸ ۶"; + Text[ turkish ] = "Geersiz parametre"; + Text[ language_user1 ] = " "; + }; + String SbERR_USER_ABORT & ERRCODE_RES_MASK + { + Text = "Der Ablauf wurde durch den Benutzer unterbrochen" ; + Text [ ENGLISH ] = "User interrupt occurred" ; + Text [ norwegian ] = "User interrupt occurred" ; + Text [ italian ] = "Processo interrotto dall'utente" ; + Text [ portuguese_brazilian ] = "User interrupt occurred" ; + Text [ portuguese ] = "O processo foi interrompido pelo utilizador" ; + Text [ french ] = "Processus interrompu par l'utilisateur" ; + Text [ dutch ] = "Onderbreking door gebruiker" ; + Text [ spanish ] = "El proceso ha sido interrumpido por el usuario" ; + Text [ danish ] = "Processen blev afbrudt af brugeren" ; + Text [ swedish ] = "Anvndaren avslutade frloppet" ; + Text [ finnish ] = "User interrupt occurred" ; + Text [ english_us ] = "Process interrupted by user" ; + Text[ chinese_simplified ] = "ʹж̡"; + Text[ russian ] = " "; + Text[ polish ] = "Proces zosta przerwany przez uytkownika"; + Text[ japanese ] = "հްɂĒf܂"; + Text[ chinese_traditional ] = "ϥΪ̤_BL{C"; + Text[ arabic ] = " "; + Text[ dutch ] = "Onderbreking door gebruiker"; + Text[ chinese_simplified ] = "ʹж̡"; + Text[ greek ] = " "; + Text[ korean ] = "ڿ μ ͷƮ"; + Text[ turkish ] = "Sre kullanc tarafndan kesildi"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_RESUME & ERRCODE_RES_MASK + { + Text = "Resume ohne Fehler" ; + Text [ ENGLISH ] = "Resume without error" ; + Text [ norwegian ] = "Resume without error" ; + Text [ italian ] = "Resume senza errori" ; + Text [ portuguese_brazilian ] = "Resume without error" ; + Text [ portuguese ] = "Resumo sem erros" ; + Text [ french ] = "Rsum sans erreur" ; + Text [ dutch ] = "Resume zonder fouten" ; + Text [ spanish ] = "Resumen sin error" ; + Text [ danish ] = "Resume uden fejl" ; + Text [ swedish ] = "Resume utan fel" ; + Text [ finnish ] = "Resume without error" ; + Text [ english_us ] = "Resume without error" ; + Text[ chinese_simplified ] = "Resume error"; + Text[ russian ] = " "; + Text[ polish ] = "Resume bez bdu"; + Text[ japanese ] = "Resume without error"; + Text[ chinese_traditional ] = "Resume a error"; + Text[ arabic ] = " "; + Text[ dutch ] = "Resume zonder fouten"; + Text[ chinese_simplified ] = "Resume error"; + Text[ greek ] = " "; + Text[ korean ] = " ٽ "; + Text[ turkish ] = "Resume ohne Fehler"; + Text[ language_user1 ] = " "; + }; + String SbERR_STACK_OVERFLOW & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Nicht gengend Stapelspeicher : Nicht gengend Stapelspeicher */ + Text = "Nicht gengend Stapelspeicher" ; + Text [ ENGLISH ] = "Out of stack space" ; + Text [ norwegian ] = "Out of stack space" ; + Text [ italian ] = "Memoria stack non sufficiente" ; + Text [ portuguese_brazilian ] = "Out of stack space" ; + Text [ portuguese ] = "Memria tampo insuficiente" ; + Text [ french ] = "Mmoire tampon insuffisante" ; + Text [ dutch ] = "Niet genoeg stack" ; + Text [ spanish ] = "Desbordamiento de pila" ; + Text [ danish ] = "Ikke nok stakhukommelse" ; + Text [ swedish ] = "Inte tillrckligt med stapelminne" ; + Text [ finnish ] = "Out of stack space" ; + Text [ english_us ] = "Not enough stack memory" ; + Text[ chinese_simplified ] = "ջʽڴ治"; + Text[ russian ] = " "; + Text[ polish ] = "Za mao pamici stosowej"; + Text[ japanese ] = "s\\Ƚ"; + Text[ chinese_traditional ] = "|O餣"; + Text[ arabic ] = " "; + Text[ dutch ] = "Niet genoeg stack"; + Text[ chinese_simplified ] = "ջʽڴ治"; + Text[ greek ] = " "; + Text[ korean ] = "stack "; + Text[ turkish ] = "Yn bellek yeterli deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_PROC_UNDEFINED & ERRCODE_RES_MASK + { + Text = "Sub- oder Function-Prozedur nicht definiert" ; + Text [ ENGLISH ] = "Sub or Function not defined" ; + Text [ norwegian ] = "Sub or Function not defined" ; + Text [ italian ] = "Procedura sub o di funzione non definita" ; + Text [ portuguese_brazilian ] = "Sub or Function not defined" ; + Text [ portuguese ] = "Procedimento de funo ou subordinado no definidos" ; + Text [ french ] = "La sous-procdure ou procdure fonctionnelle n'est pas dfinie" ; + Text [ dutch ] = "Sub- of functieprocedure niet gedefinieerd" ; + Text [ spanish ] = "Procedimiento de funcin o subordinado no definido" ; + Text [ danish ] = "Under- eller funktionsproceduren er ikke defineret" ; + Text [ swedish ] = "Sub- eller funktionsproceduren inte definierad" ; + Text [ finnish ] = "Sub or Function not defined" ; + Text [ english_us ] = "Sub-procedure or function procedure not defined" ; + Text[ chinese_simplified ] = "ûжֹ̻"; + Text[ russian ] = " "; + Text[ polish ] = "Nie zdefiniowano procedury podrzdnej lub funkcyjnej"; + Text[ japanese ] = "Sub܂Functionۼެ͒`Ă܂"; + Text[ chinese_traditional ] = "SwqL{ΨƹL{"; + Text[ arabic ] = " "; + Text[ dutch ] = "Sub- of functieprocedure niet gedefinieerd"; + Text[ chinese_simplified ] = "ûжֹ̻"; + Text[ greek ] = " (Sub) (Function)"; + Text[ korean ] = " ν Ǵ ν"; + Text[ turkish ] = "Alt yordam ya da ilev yordam tanmlanmad"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_DLL_LOAD & ERRCODE_RES_MASK + { + Text = "Fehler beim Laden einer DLL-Datei" ; + Text [ ENGLISH ] = "Error in loading DLL" ; + Text [ norwegian ] = "Error in loading DLL" ; + Text [ italian ] = "Errore nel caricamento del file DLL" ; + Text [ portuguese_brazilian ] = "Error in loading DLL" ; + Text [ portuguese ] = "Erro ao carregar um ficheiro DLL" ; + Text [ french ] = "Erreur lors du chargement d'un fichier DLL" ; + Text [ dutch ] = "Fout bei laden van DLL-bestand" ; + Text [ spanish ] = "Error al cargar un archivo DDL" ; + Text [ danish ] = "Fejl ved indlsning af DLL-fil" ; + Text [ swedish ] = "Fel vid laddning av DLL-fil" ; + Text [ finnish ] = "Error in loading DLL" ; + Text [ english_us ] = "Error loading DLL file" ; + Text[ chinese_simplified ] = "װ DLL ļʱ"; + Text[ russian ] = " DLL"; + Text[ polish ] = "Bd przy adowaniu pliku DLL"; + Text[ japanese ] = "DLĻق̓ǂݍ݂̍ۂ̴װ"; + Text[ chinese_traditional ] = "˸DLLɮɵoͿ~"; + Text[ arabic ] = "DLL "; + Text[ dutch ] = "Fout bei laden van DLL-bestand"; + Text[ chinese_simplified ] = "װ DLL ļʱ"; + Text[ greek ] = " DLL"; + Text[ korean ] = "DLL ε "; + Text[ turkish ] = "DLL dosyasn ykleme srasnda hata"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_DLL_CALL & ERRCODE_RES_MASK + { + Text = "Falsche DLL-Aufrufkonvention" ; + Text [ ENGLISH ] = "Bad DLL calling convention" ; + Text [ norwegian ] = "Bad DLL calling convention" ; + Text [ italian ] = "Convenzione di richiamo DLL errata" ; + Text [ portuguese_brazilian ] = "Bad DLL calling convention" ; + Text [ portuguese ] = "Conveno da chamada DLL incorrecta" ; + Text [ french ] = "Convention d'appel DLL incorrecte" ; + Text [ dutch ] = "Foutieve DLL-oproepconventie" ; + Text [ spanish ] = "Convencin de la llamada DLL incorrecta" ; + Text [ danish ] = "Forkert DLL-kaldkonvention" ; + Text [ swedish ] = "Fel DLL-anropningskonvention" ; + Text [ finnish ] = "Bad DLL calling convention" ; + Text [ english_us ] = "Wrong DLL call convention" ; + Text[ chinese_simplified ] = " DLLԼ"; + Text[ russian ] = " DLL"; + Text[ polish ] = "Nieprawidowa konwencja wywoania DLL"; + Text[ japanese ] = "ȂDLLĂяo"; + Text[ chinese_traditional ] = "~DLLեάw"; + Text[ arabic ] = " DLL "; + Text[ dutch ] = "Foutieve DLL-oproepconventie"; + Text[ chinese_simplified ] = " DLLԼ"; + Text[ greek ] = " DLL"; + Text[ korean ] = "Ʋ DLL ȣ "; + Text[ turkish ] = "Yanl DLL ar kural"; + Text[ language_user1 ] = " "; + }; + String SbERR_INTERNAL_ERROR & ERRCODE_RES_MASK + { + Text = "Interner Fehler $(ARG1)" ; + Text [ ENGLISH ] = "Internal error $(ARG1)" ; + Text [ norwegian ] = "Internal error $(ARG1)" ; + Text [ italian ] = "Errore interno $(ARG1)" ; + Text [ portuguese_brazilian ] = "Internal error $(ARG1)" ; + Text [ portuguese ] = "Erro interno $(ARG1)" ; + Text [ french ] = "Erreur interne $(ARG1)" ; + Text [ dutch ] = "Interne fout $(ARG1)" ; + Text [ spanish ] = "Error interno $(ARG1)" ; + Text [ danish ] = "Intern fejl $(ARG1)" ; + Text [ swedish ] = "Internt fel $(ARG1)" ; + Text [ finnish ] = "Internal error $(ARG1)" ; + Text [ english_us ] = "Internal error $(ARG1)" ; + Text[ chinese_simplified ] = "ڲ $(ARG1)"; + Text[ russian ] = " $(ARG1)"; + Text[ polish ] = "Bd wewntrzny $(ARG1)"; + Text[ japanese ] = "װ$(ARG1)"; + Text[ chinese_traditional ] = "~$(ARG1)"; + Text[ arabic ] = "$(ARG1) "; + Text[ dutch ] = "Interne fout $(ARG1)"; + Text[ chinese_simplified ] = "ڲ $(ARG1)"; + Text[ greek ] = " $(ARG1)"; + Text[ korean ] = " $(ARG1)"; + Text[ turkish ] = "Dahili hata $(ARG1)"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_CHANNEL & ERRCODE_RES_MASK + { + Text = "Dateiname oder -nummer falsch" ; + Text [ ENGLISH ] = "Bad file name or number" ; + Text [ norwegian ] = "Bad file name or number" ; + Text [ italian ] = "Nome file o numero file errato" ; + Text [ portuguese_brazilian ] = "Bad file name or number" ; + Text [ portuguese ] = "Nome ou nmero do ficheiro incorrecto" ; + Text [ french ] = "Nom ou numro de fichier incorrect" ; + Text [ dutch ] = "Foutieve bestandsnaam of -nummer" ; + Text [ spanish ] = "Nombre o nmero incorrecto de archivo" ; + Text [ danish ] = "Forkert filnavn eller -nummer" ; + Text [ swedish ] = "Ogiltigt filnamn eller filnummer" ; + Text [ finnish ] = "Bad file name or number" ; + Text [ english_us ] = "Invalid file name or file number" ; + Text[ chinese_simplified ] = "Чļ"; + Text[ russian ] = " "; + Text[ polish ] = "Nazwa pliku lub numer nieprawidowe"; + Text[ japanese ] = "̧ٖ܂̧ٔԍ܂"; + Text[ chinese_traditional ] = "LĪɮשθX"; + Text[ arabic ] = " "; + Text[ dutch ] = "Foutieve bestandsnaam of -nummer"; + Text[ chinese_simplified ] = "Чļ"; + Text[ greek ] = " "; + Text[ korean ] = "߸ ̸ Ǵ ȣ"; + Text[ turkish ] = "Dosya ad ya da numaras yanl"; + Text[ language_user1 ] = " "; + }; + String SbERR_FILE_NOT_FOUND & ERRCODE_RES_MASK + { + Text = "Datei nicht gefunden" ; + Text [ ENGLISH ] = "File not found" ; + Text [ norwegian ] = "File not found" ; + Text [ italian ] = "File non trovato" ; + Text [ portuguese_brazilian ] = "File not found" ; + Text [ portuguese ] = "O ficheiro no foi encontrado" ; + Text [ french ] = "Fichier introuvable" ; + Text [ dutch ] = "Bestand niet gevonden" ; + Text [ spanish ] = "No se encuentra el archivo" ; + Text [ danish ] = "Filen blev ikke fundet" ; + Text [ swedish ] = "Filen hittades inte" ; + Text [ finnish ] = "File not found" ; + Text [ english_us ] = "File not found" ; + Text[ chinese_simplified ] = "ûҵļ"; + Text[ russian ] = " "; + Text[ polish ] = "pliku nie znaleziono"; + Text[ japanese ] = "̧ق͌܂"; + Text[ chinese_traditional ] = "Sɮ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Bestand niet gevonden"; + Text[ chinese_simplified ] = "ûҵļ"; + Text[ greek ] = " "; + Text[ korean ] = " ϴ."; + Text[ turkish ] = "Dosya bulunamad"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_FILE_MODE & ERRCODE_RES_MASK + { + Text = "Dateimodus falsch" ; + Text [ ENGLISH ] = "Bad file mode" ; + Text [ norwegian ] = "Bad file mode" ; + Text [ italian ] = "Modo file errato" ; + Text [ portuguese_brazilian ] = "Bad file mode" ; + Text [ portuguese ] = "Modo do ficheiro incorrecto" ; + Text [ french ] = "Mode de fichier incorrect" ; + Text [ dutch ] = "Foutieve bestandsmodus" ; + Text [ spanish ] = "Modo de archivo incorrecto" ; + Text [ danish ] = "Forkert filtilstand" ; + Text [ swedish ] = "Fel fillge" ; + Text [ finnish ] = "Bad file mode" ; + Text [ english_us ] = "Incorrect file mode" ; + Text[ chinese_simplified ] = "ļģʽ"; + Text[ russian ] = " "; + Text[ polish ] = "Niepoprawny tryb pliku"; + Text[ japanese ] = "̧ Ӱނ܂@@@@@@@@@@@@@"; + Text[ chinese_traditional ] = "~ɮҦ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Foutieve bestandsmodus"; + Text[ chinese_simplified ] = "ļģʽ"; + Text[ greek ] = " "; + Text[ korean ] = "߸ "; + Text[ turkish ] = "Dosya kipi yanl"; + Text[ language_user1 ] = " "; + }; + String SbERR_FILE_ALREADY_OPEN & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Datei bereits geffnet : Datei bereits geffnet */ + Text = "Datei bereits geffnet" ; + Text [ ENGLISH ] = "File already open" ; + Text [ norwegian ] = "File already open" ; + Text [ italian ] = "File gi aperto" ; + Text [ portuguese_brazilian ] = "File already open" ; + Text [ portuguese ] = "O ficheiro j est aberto" ; + Text [ french ] = "Fichier dj ouvert" ; + Text [ dutch ] = "Bestand reeds geopend" ; + Text [ spanish ] = "El archivo ya est abierto" ; + Text [ danish ] = "Filen er allerede ben" ; + Text [ swedish ] = "Filen r redan ppen" ; + Text [ finnish ] = "File already open" ; + Text [ english_us ] = "File already open" ; + Text[ chinese_simplified ] = "Ѿļ"; + Text[ russian ] = " "; + Text[ polish ] = "Plik ju otworzony"; + Text[ japanese ] = "̧ق͂łɊJĂ܂"; + Text[ chinese_traditional ] = "wg}ɮ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Bestand reeds geopend"; + Text[ chinese_simplified ] = "Ѿļ"; + Text[ greek ] = " "; + Text[ korean ] = " ̹ ֽϴ."; + Text[ turkish ] = "Dosya ak durumda"; + Text[ language_user1 ] = " "; + }; + String SbERR_IO_ERROR & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Gerte-E/A-Fehler : Gerte-E/A-Fehler */ + Text = "Gerte-E/A-Fehler" ; + Text [ ENGLISH ] = "Device I/O error" ; + Text [ norwegian ] = "Device I/O error" ; + Text [ italian ] = "Errore di I/O" ; + Text [ portuguese_brazilian ] = "Device I/O error" ; + Text [ portuguese ] = "Erro perifrico I/O" ; + Text [ french ] = "Erreur de priphrique E/S" ; + Text [ dutch ] = "Fout in-/uitvoerapparatuur" ; + Text [ spanish ] = "Error de dispositivo E/S" ; + Text [ danish ] = "I/O-fejl i enhed" ; + Text [ swedish ] = "Apparat I/O-fel" ; + Text [ finnish ] = "Device I/O error" ; + Text [ english_us ] = "Device I/O error" ; + Text[ chinese_simplified ] = "豸I/O"; + Text[ russian ] = " /"; + Text[ polish ] = "Bd We/Wy urzdzenia"; + Text[ japanese ] = "ި I/O װ"; + Text[ chinese_traditional ] = "]ƵoI/O~"; + Text[ arabic ] = " "; + Text[ dutch ] = "Fout in-/uitvoerapparatuur"; + Text[ chinese_simplified ] = "豸I/O"; + Text[ greek ] = " /"; + Text[ korean ] = "̽ I/O "; + Text[ turkish ] = "Cihaz I/O hatas"; + Text[ language_user1 ] = " "; + }; + String SbERR_FILE_EXISTS & ERRCODE_RES_MASK + { + Text = "Datei bereits vorhanden" ; + Text [ ENGLISH ] = "File already exists" ; + Text [ norwegian ] = "File already exists" ; + Text [ italian ] = "File gi esistente" ; + Text [ portuguese_brazilian ] = "File already exists" ; + Text [ portuguese ] = "O ficheiro j existe" ; + Text [ french ] = "Fichier existant dj" ; + Text [ dutch ] = "Bestand bestaat reeds" ; + Text [ spanish ] = "El archivo ya existe" ; + Text [ danish ] = "Filen eksisterer allerede" ; + Text [ swedish ] = "Filen existerar redan" ; + Text [ finnish ] = "File already exists" ; + Text [ english_us ] = "File already exists" ; + Text[ chinese_simplified ] = "ļѾ"; + Text[ russian ] = " "; + Text[ polish ] = "Plik ju istnieje"; + Text[ japanese ] = "̧ق͂łɂ܂"; + Text[ chinese_traditional ] = "ɮפwgsb"; + Text[ arabic ] = " "; + Text[ dutch ] = "Bestand bestaat reeds"; + Text[ chinese_simplified ] = "ļѾ"; + Text[ greek ] = " "; + Text[ korean ] = " ̹ մϴ."; + Text[ turkish ] = "Dosya mevcut durumda"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_RECORD_LENGTH & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Falsche Datensatzlnge : Falsche Datensatzlnge */ + Text = "Falsche Datensatzlnge" ; + Text [ ENGLISH ] = "Bad record length" ; + Text [ norwegian ] = "Bad record length" ; + Text [ italian ] = "Lunghezza record di dati errata" ; + Text [ portuguese_brazilian ] = "Bad record length" ; + Text [ portuguese ] = "Comprimento do registo de dados incorrecto" ; + Text [ french ] = "Longueur d'enregistrement incorrecte" ; + Text [ dutch ] = "Foutieve record-lengte" ; + Text [ spanish ] = "Longitud errnea del registro de datos" ; + Text [ danish ] = "Forkert datapostlngde" ; + Text [ swedish ] = "Felaktig datapostlngd" ; + Text [ finnish ] = "Bad record length" ; + Text [ english_us ] = "Incorrect record length" ; + Text[ chinese_simplified ] = "Ŀȴ"; + Text[ russian ] = " "; + Text[ polish ] = "Niepoprawna dugo rekordw"; + Text[ japanese ] = "Ȃںނ̒"; + Text[ chinese_traditional ] = "~ƶت"; + Text[ arabic ] = " "; + Text[ dutch ] = "Foutieve record-lengte"; + Text[ chinese_simplified ] = "Ŀȴ"; + Text[ greek ] = " "; + Text[ korean ] = "߸ ڵ "; + Text[ turkish ] = "Yanl veri kmesi uzunluu"; + Text[ language_user1 ] = " "; + }; + String SbERR_DISK_FULL & ERRCODE_RES_MASK + { + Text = "Diskette/Festplatte voll" ; + Text [ ENGLISH ] = "Disk full" ; + Text [ norwegian ] = "Disk full" ; + Text [ italian ] = "Dischetto o disco rigido pieno" ; + Text [ portuguese_brazilian ] = "Disk full" ; + Text [ portuguese ] = "Disquete ou disco rgido cheios" ; + Text [ french ] = "Disquette/disque dur plein(e)" ; + Text [ dutch ] = "Diskette/harde schijf vol" ; + Text [ spanish ] = "Disquete o disco duro lleno" ; + Text [ danish ] = "Disketten/harddisken er fuld" ; + Text [ swedish ] = "Diskett eller hrddisk full" ; + Text [ finnish ] = "Disk full" ; + Text [ english_us ] = "Disk or hard drive full" ; + Text[ chinese_simplified ] = "̻Ӳ"; + Text[ russian ] = " "; + Text[ polish ] = "Dyskietka/Dysk twardy s pene"; + Text[ japanese ] = "ۯ߰ި܂ʰިς"; + Text[ chinese_traditional ] = "nϽLκϽLw"; + Text[ arabic ] = " / "; + Text[ dutch ] = "Diskette/harde schijf vol"; + Text[ chinese_simplified ] = "̻Ӳ"; + Text[ greek ] = "/ "; + Text[ korean ] = "/ ϵ ũ á"; + Text[ turkish ] = "Disket/disk dolu"; + Text[ language_user1 ] = " "; + }; + String SbERR_READ_PAST_EOF & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Lesen ber das Ende der Datei hinaus : Lesen ber das Ende der Datei hinaus */ + Text = "Lesen ber das Ende der Datei hinaus" ; + Text [ ENGLISH ] = "Input past end of file" ; + Text [ norwegian ] = "Input past end of file" ; + Text [ italian ] = "Lettura oltre la fine del file" ; + Text [ portuguese_brazilian ] = "Input past end of file" ; + Text [ portuguese ] = "Ler para alm do fim de ficheiro" ; + Text [ french ] = "Lecture au-del de la fin du fichier" ; + Text [ dutch ] = "Lezen overschrijdt bestandseinde" ; + Text [ spanish ] = "Seguir leyendo tras el final del archivo" ; + Text [ danish ] = "Ls ud over filens slutning" ; + Text [ swedish ] = "Lsning utver filens slut" ; + Text [ finnish ] = "Input past end of file" ; + Text [ english_us ] = "Reading exceeds EOF" ; + Text[ chinese_simplified ] = "ȡļΧ"; + Text[ russian ] = " "; + Text[ polish ] = "Odczyt przekracza koniec pliku"; + Text[ japanese ] = "EOF ނzǂݎ"; + Text[ chinese_traditional ] = "ŪWXɮd"; + Text[ arabic ] = " "; + Text[ dutch ] = "Lezen overschrijdt bestandseinde"; + Text[ chinese_simplified ] = "ȡļΧ"; + Text[ greek ] = " "; + Text[ korean ] = " ʰϿ "; + Text[ turkish ] = "Okuma dosya sonunu ayor"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_RECORD_NUMBER & ERRCODE_RES_MASK + { + Text = "Datensatznummer falsch" ; + Text [ ENGLISH ] = "Bad record number" ; + Text [ norwegian ] = "Bad record number" ; + Text [ italian ] = "Numero record errato" ; + Text [ portuguese_brazilian ] = "Bad record number" ; + Text [ portuguese ] = "Nmero do registo de dados incorrecto" ; + Text [ french ] = "Numro d'enregistrement incorrect" ; + Text [ dutch ] = "Foutief record-nummer" ; + Text [ spanish ] = "Nmero errneo de registro de datos" ; + Text [ danish ] = "Forkert datapostnummer" ; + Text [ swedish ] = "Felaktigt datapostnummer" ; + Text [ finnish ] = "Bad record number" ; + Text [ english_us ] = "Incorrect record number" ; + Text[ chinese_simplified ] = "Ŀ"; + Text[ russian ] = " "; + Text[ polish ] = "Niepoprawna dugo rekordw"; + Text[ japanese ] = "ںނ̔ԍ܂"; + Text[ chinese_traditional ] = "ƶظX~"; + Text[ arabic ] = " "; + Text[ dutch ] = "Foutief record-nummer"; + Text[ chinese_simplified ] = "Ŀ"; + Text[ greek ] = " "; + Text[ korean ] = "߸ ڵ ȣ"; + Text[ turkish ] = "Veri kmesi numaras yanl"; + Text[ language_user1 ] = " "; + }; + String SbERR_TOO_MANY_FILES & ERRCODE_RES_MASK + { + Text = "Zu viele Dateien" ; + Text [ ENGLISH ] = "Too many files" ; + Text [ norwegian ] = "Too many files" ; + Text [ italian ] = "Troppi file" ; + Text [ portuguese_brazilian ] = "Too many files" ; + Text [ portuguese ] = "Demasiados ficheiros" ; + Text [ french ] = "Trop de fichiers" ; + Text [ dutch ] = "Teveel bestanden" ; + Text [ spanish ] = "Demasiados archivos" ; + Text [ danish ] = "Der er for mange filer" ; + Text [ swedish ] = "Fr mnga filer" ; + Text [ finnish ] = "Too many files" ; + Text [ english_us ] = "Too many files" ; + Text[ chinese_simplified ] = "̫ļ"; + Text[ russian ] = " "; + Text[ polish ] = "Za duo plikw"; + Text[ japanese ] = "̧ق܂"; + Text[ chinese_traditional ] = "Ӧhɮ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Teveel bestanden"; + Text[ chinese_simplified ] = "̫ļ"; + Text[ greek ] = " "; + Text[ korean ] = "ϵ ʹ "; + Text[ turkish ] = "Dosya says fazla"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_DEVICE & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Gert nicht verfgbar : Gert nicht verfgbar */ + Text = "Gert nicht verfgbar" ; + Text [ ENGLISH ] = "Device not available" ; + Text [ norwegian ] = "Device not available" ; + Text [ italian ] = "Apparecchio non disponibile" ; + Text [ portuguese_brazilian ] = "Device not available" ; + Text [ portuguese ] = "Aparelho no disponvel" ; + Text [ french ] = "Priphrique indisponible" ; + Text [ dutch ] = "Apparatuur niet beschikbaar" ; + Text [ spanish ] = "El dispositivo no est disponible" ; + Text [ danish ] = "Enheden er ikke tilgngelig" ; + Text [ swedish ] = "Enhet ej tillgnglig" ; + Text [ finnish ] = "Device not available" ; + Text [ english_us ] = "Device not available" ; + Text[ chinese_simplified ] = "豸"; + Text[ russian ] = " "; + Text[ polish ] = "Urzdzenie niedostpne"; + Text[ japanese ] = "ި͂܂"; + Text[ chinese_traditional ] = "]Ƥsb"; + Text[ arabic ] = " "; + Text[ dutch ] = "Apparatuur niet beschikbaar"; + Text[ chinese_simplified ] = "豸"; + Text[ greek ] = " "; + Text[ korean ] = "̽ Ұ"; + Text[ turkish ] = "Cihaz kullanlabilir durumda deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_ACCESS_DENIED & ERRCODE_RES_MASK + { + Text = "Zugriff verweigert" ; + Text [ ENGLISH ] = "Permission denied" ; + Text [ norwegian ] = "Permission denied" ; + Text [ italian ] = "Accesso negato" ; + Text [ portuguese_brazilian ] = "Permission denied" ; + Text [ portuguese ] = "Acesso recusado" ; + Text [ french ] = "Accs refus" ; + Text [ dutch ] = "Toegang geweigerd" ; + Text [ spanish ] = "Acceso denegado" ; + Text [ danish ] = "Adgang ngtet" ; + Text [ swedish ] = "tkomst nekad" ; + Text [ finnish ] = "Permission denied" ; + Text [ english_us ] = "Access denied" ; + Text[ chinese_simplified ] = "ܾȡ"; + Text[ russian ] = " "; + Text[ polish ] = "Dostp zabroniony"; + Text[ japanese ] = "ł܂"; + Text[ chinese_traditional ] = "ڵŪ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Toegang geweigerd"; + Text[ chinese_simplified ] = "ܾȡ"; + Text[ greek ] = " "; + Text[ korean ] = " ź"; + Text[ turkish ] = "Eriim engellendi"; + Text[ language_user1 ] = " "; + }; + String SbERR_NOT_READY & ERRCODE_RES_MASK + { + Text = "Diskette nicht bereit" ; + Text [ ENGLISH ] = "Disk not ready" ; + Text [ norwegian ] = "Disk not ready" ; + Text [ italian ] = "Dischetto non pronto" ; + Text [ portuguese_brazilian ] = "Disk not ready" ; + Text [ portuguese ] = "A disquete no est pronta" ; + Text [ french ] = "La disquette n'est pas prte" ; + Text [ dutch ] = "Diskette niet bereid" ; + Text [ spanish ] = "El disquete no est preparado" ; + Text [ danish ] = "Disketten er ikke klar" ; + Text [ swedish ] = "Disketten r inte beredd" ; + Text [ finnish ] = "Disk not ready" ; + Text [ english_us ] = "Disk not ready" ; + Text[ chinese_simplified ] = "̻û"; + Text[ russian ] = " "; + Text[ polish ] = "Dyskietka nie gotowa"; + Text[ japanese ] = "ި͗pӂłĂ܂"; + Text[ chinese_traditional ] = "nϽL٨SdzƦn"; + Text[ arabic ] = " "; + Text[ dutch ] = "Diskette niet bereid"; + Text[ chinese_simplified ] = "̻û"; + Text[ greek ] = " "; + Text[ korean ] = "ũ غ ʾҽϴ."; + Text[ turkish ] = "Disket hazr deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_NOT_IMPLEMENTED & ERRCODE_RES_MASK + { + Text = "Nicht implementiert" ; + Text [ ENGLISH ] = "Feature not implemented" ; + Text [ norwegian ] = "Feature not implemented" ; + Text [ italian ] = "Non implementato" ; + Text [ portuguese_brazilian ] = "Feature not implemented" ; + Text [ portuguese ] = "No implementado" ; + Text [ french ] = "Non implant" ; + Text [ dutch ] = "Niet gemplementeerd" ; + Text [ spanish ] = "No implementado" ; + Text [ danish ] = "Ikke implementeret" ; + Text [ swedish ] = "Ej implementerad" ; + Text [ finnish ] = "Feature not implemented" ; + Text [ english_us ] = "Not implemented" ; + Text[ chinese_simplified ] = "δʵʩ"; + Text[ russian ] = " "; + Text[ polish ] = "Nie zaimplementowane"; + Text[ japanese ] = "Ă܂"; + Text[ chinese_traditional ] = "|I"; + Text[ arabic ] = " "; + Text[ dutch ] = "Niet gemplementeerd"; + Text[ chinese_simplified ] = "δʵʩ"; + Text[ greek ] = " "; + Text[ korean ] = " ʾ"; + Text[ turkish ] = "Uygulanmad"; + Text[ language_user1 ] = " "; + }; + String SbERR_DIFFERENT_DRIVE & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Umbenennen auf verschiedenen Laufwerken nicht mglich : Umbenennen auf verschiedenen Laufwerken nicht mglich */ + Text = "Umbenennen auf verschiedenen Laufwerken nicht mglich" ; + Text [ ENGLISH ] = "No rename with different drive" ; + Text [ norwegian ] = "No rename with different drive" ; + Text [ italian ] = "Impossibile rinominare su drive diversi" ; + Text [ portuguese_brazilian ] = "No rename with different drive" ; + Text [ portuguese ] = "Impossvel mudar nome em vrias unidades" ; + Text [ french ] = "Impossible de renommer sur des lecteurs diffrents" ; + Text [ dutch ] = "Namen wijzigen op verschillende stations niet mogelijk" ; + Text [ spanish ] = "No se puede cambiar nombre en distintas unidades" ; + Text [ danish ] = "Omdbning p forskellige drev er ikke mulig" ; + Text [ swedish ] = "Omjligt att byta namn p olika enheter" ; + Text [ finnish ] = "No rename with different drive" ; + Text [ english_us ] = "Renaming on different drives impossible" ; + Text[ chinese_simplified ] = "ɲͬ"; + Text[ russian ] = " "; + Text[ polish ] = "Zmiana nazwy na rnych dyskach jest niemoliwa"; + Text[ japanese ] = "ײނ̖O̕ύX͂ł܂"; + Text[ chinese_traditional ] = "LksRWPϽL"; + Text[ arabic ] = " "; + Text[ dutch ] = "Namen wijzigen op verschillende stations niet mogelijk"; + Text[ chinese_simplified ] = "ɲͬ"; + Text[ greek ] = " "; + Text[ korean ] = "ٸ ̹ ο ̸ Ұմϴ."; + Text[ turkish ] = "Farkl srclerde yeniden adlandrma yaplamaz"; + Text[ language_user1 ] = " "; + }; + String SbERR_ACCESS_ERROR & ERRCODE_RES_MASK + { + Text = "Pfad/Datei-Zugriffsfehler" ; + Text [ ENGLISH ] = "Path/File access error" ; + Text [ norwegian ] = "Path/File access error" ; + Text [ italian ] = "Errore di accesso al percorso/file" ; + Text [ portuguese_brazilian ] = "Path/File access error" ; + Text [ portuguese ] = "Atalho/Erro de acesso ao ficheiro" ; + Text [ french ] = "Erreur d'accs au chemin/fichier" ; + Text [ dutch ] = "Fout bij toegang op pad/bestand" ; + Text [ spanish ] = "Error de acceso a la ruta o al archivo" ; + Text [ danish ] = "Sti/fil adgangsfejl" ; + Text [ swedish ] = "Skvg/fil tkomstfel" ; + Text [ finnish ] = "Path/File access error" ; + Text [ english_us ] = "Path/File access error" ; + Text[ chinese_simplified ] = "ȡ·/ļʱ"; + Text[ russian ] = " "; + Text[ polish ] = "Bd dostpu do cieki/pliku"; + Text[ japanese ] = "߽܂̧قւ̱װ"; + Text[ chinese_traditional ] = "Ū|/ɮɵoͿ~"; + Text[ arabic ] = " /"; + Text[ dutch ] = "Fout bij toegang op pad/bestand"; + Text[ chinese_simplified ] = "ȡ·/ļʱ"; + Text[ greek ] = " /"; + Text[ korean ] = "н/ "; + Text[ turkish ] = "Veri yolu/eriim hatas"; + Text[ language_user1 ] = " "; + }; + String SbERR_PATH_NOT_FOUND & ERRCODE_RES_MASK + { + Text = "Pfad nicht gefunden" ; + Text [ ENGLISH ] = "Path not found" ; + Text [ norwegian ] = "Path not found" ; + Text [ italian ] = "Percorso non trovato" ; + Text [ portuguese_brazilian ] = "Path not found" ; + Text [ portuguese ] = "Atalho no encontrado" ; + Text [ french ] = "Chemin introuvable" ; + Text [ dutch ] = "Pad niet gevonden" ; + Text [ spanish ] = "No se encontr la ruta" ; + Text [ danish ] = "Stien blev ikke fundet" ; + Text [ swedish ] = "Skvgen hittades inte" ; + Text [ finnish ] = "Path not found" ; + Text [ english_us ] = "Path not found" ; + Text[ chinese_simplified ] = "ûҵ·"; + Text[ russian ] = " "; + Text[ polish ] = "cieka nie zostaa znaleziona"; + Text[ japanese ] = "߽܂"; + Text[ chinese_traditional ] = "S|"; + Text[ arabic ] = " "; + Text[ dutch ] = "Pad niet gevonden"; + Text[ chinese_simplified ] = "ûҵ·"; + Text[ greek ] = " "; + Text[ korean ] = "н ߰ߵ ʾҽϴ."; + Text[ turkish ] = "Veri yolu bulunamad"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_OBJECT & ERRCODE_RES_MASK + { + Text = "Objektvariable nicht belegt" ; + Text [ ENGLISH ] = "Object variable not set" ; + Text [ norwegian ] = "Object variable not set" ; + Text [ italian ] = "Variabile dell'oggetto non impostata" ; + Text [ portuguese_brazilian ] = "Object variable not set" ; + Text [ portuguese ] = "Varivel do objecto no configurada" ; + Text [ french ] = "Variable d'objet non configure" ; + Text [ dutch ] = "Objectvariabele niet gereserveerd" ; + Text [ spanish ] = "La variable del objeto no se ha establecido" ; + Text [ danish ] = "Objektvariablen er ikke optaget" ; + Text [ swedish ] = "Objektvariablerna inte bestmda" ; + Text [ finnish ] = "Object variable not set" ; + Text [ english_us ] = "Object variable not set" ; + Text[ chinese_simplified ] = "û趨"; + Text[ russian ] = " "; + Text[ polish ] = "Nie osadzono zmiennej obiektu"; + Text[ japanese ] = "ުĕϐ͐ݒłĂ܂"; + Text[ chinese_traditional ] = "٨S]wܶq"; + Text[ arabic ] = " "; + Text[ dutch ] = "Objectvariabele niet gereserveerd"; + Text[ chinese_simplified ] = "û趨"; + Text[ greek ] = " "; + Text[ korean ] = "ü ʾҽϴ."; + Text[ turkish ] = "Nesne deikeni belirlenmedi"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_PATTERN & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Zeichenfolgenmuster unzulssig : Zeichenfolgenmuster unzulssig */ + Text = "Zeichenfolgenmuster unzulssig" ; + Text [ ENGLISH ] = "Invalid pattern string" ; + Text [ norwegian ] = "Invalid pattern string" ; + Text [ italian ] = "Sequenza di caratteri non valida" ; + Text [ portuguese_brazilian ] = "Invalid pattern string" ; + Text [ portuguese ] = "Sequncia de caracteres no vlida" ; + Text [ french ] = "chantillon de chane de caractres incorrect" ; + Text [ dutch ] = "Ontoelaatbare tekenreeks" ; + Text [ spanish ] = "Secuencia de caracteres no vlida" ; + Text [ danish ] = "Ugyldigt strengmnster" ; + Text [ swedish ] = "Ogiltig mnsterstring" ; + Text [ finnish ] = "Invalid pattern string" ; + Text [ english_us ] = "Invalid string pattern" ; + Text[ chinese_simplified ] = "Чִģʽ"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowy cig wzoru"; + Text[ japanese ] = "݂͋܂"; + Text[ chinese_traditional ] = "LĪrҦ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ontoelaatbare tekenreeks"; + Text[ chinese_simplified ] = "Чִģʽ"; + Text[ greek ] = " "; + Text[ korean ] = "ȿ ڿ "; + Text[ turkish ] = "Dizilim rnei geerli deil"; + Text[ language_user1 ] = " "; + }; + String SBERR_IS_NULL & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Verwendung von Null unzulssig : Verwendung von Null unzulssig */ + Text = "Verwendung von Null unzulssig" ; + Text [ ENGLISH ] = "Invalid use of Null" ; + Text [ norwegian ] = "Invalid use of Null" ; + Text [ italian ] = "Uso dello zero non ammesso" ; + Text [ portuguese_brazilian ] = "Invalid use of Null" ; + Text [ portuguese ] = "Interdito o uso do zero" ; + Text [ french ] = "Utilisation du zro interdite" ; + Text [ dutch ] = "Ongeldig gebruik van nul" ; + Text [ spanish ] = "No se admite el uso del cero" ; + Text [ danish ] = "Brug af nul er ikke tilladt" ; + Text [ swedish ] = "Anvndning av noll r ej tilltet" ; + Text [ finnish ] = "Invalid use of Null" ; + Text [ english_us ] = "Use of zero not permitted" ; + Text[ chinese_simplified ] = "ʹֵ"; + Text[ russian ] = " "; + Text[ polish ] = "Uywanie zera niedopuszczalne"; + Text[ japanese ] = "ۂ̎gp͋܂"; + Text[ chinese_traditional ] = "\\եιs"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldig gebruik van nul"; + Text[ chinese_simplified ] = "ʹֵ"; + Text[ greek ] = " "; + Text[ korean ] = "0 ʾҽϴ."; + Text[ turkish ] = "Sfr kullanm geerli deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_ERROR & ERRCODE_RES_MASK + { + Text = "DDE-Fehler" ; + Text [ ENGLISH ] = "DDE Error" ; + Text [ norwegian ] = "DDE Error" ; + Text [ italian ] = "Errore DDE" ; + Text [ portuguese_brazilian ] = "DDE Error" ; + Text [ portuguese ] = "Erro DDE" ; + Text [ french ] = "Erreur DDE" ; + Text [ dutch ] = "DDE-fout" ; + Text [ spanish ] = "Error de DDE" ; + Text [ danish ] = "DDE-fejl" ; + Text [ swedish ] = "DDE-fel" ; + Text [ finnish ] = "DDE Error" ; + Text [ english_us ] = "DDE Error" ; + Text[ chinese_simplified ] = "DDE "; + Text[ russian ] = " DDE"; + Text[ polish ] = "Bd DDE"; + Text[ japanese ] = "DDE̴װ"; + Text[ chinese_traditional ] = "DDE ~"; + Text[ arabic ] = "DDE "; + Text[ dutch ] = "DDE-fout"; + Text[ chinese_simplified ] = "DDE "; + Text[ greek ] = " DDE"; + Text[ korean ] = "DDE "; + Text[ turkish ] = "DDE hatas"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_WAITINGACK & ERRCODE_RES_MASK + { + Text = "Warten auf Antwort in DDE-Verbindung" ; + Text [ ENGLISH ] = "Awaiting response in DDE-Conversation" ; + Text [ norwegian ] = "Awaiting response in DDE-Conversation" ; + Text [ italian ] = "In attesa di risposta nel collegamento DDE" ; + Text [ portuguese_brazilian ] = "Awaiting response in DDE-Conversation" ; + Text [ portuguese ] = "Esperando resposta ligao DDE" ; + Text [ french ] = "Attente de rponse dans une connexion DDE" ; + Text [ dutch ] = "Wachten op antwoord in DDE-verbinding" ; + Text [ spanish ] = "Esperando respuesta en la conexin DDE" ; + Text [ danish ] = "Venter p svar til DDE-forbindelsen" ; + Text [ swedish ] = "Vntar p svar till DDE-frbindelsen" ; + Text [ finnish ] = "Awaiting response in DDE-Conversation" ; + Text [ english_us ] = "Awaiting response to DDE connection" ; + Text[ chinese_simplified ] = " DDE ʱȺ"; + Text[ russian ] = " DDE"; + Text[ polish ] = "Czekanie na odpowied w poczeniu DDE"; + Text[ japanese ] = "DDEڑɂ鉞҂"; + Text[ chinese_traditional ] = "b DDE sɵԵ_"; + Text[ arabic ] = "DDE "; + Text[ dutch ] = "Wachten op antwoord in DDE-verbinding"; + Text[ chinese_simplified ] = " DDE ʱȺ"; + Text[ greek ] = " DDE"; + Text[ korean ] = "DDE "; + Text[ turkish ] = "DDE balantsnda yant bekleniyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_OUTOFCHANNELS & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Keine freien DDE-Kanle : Keine freien DDE-Kanle */ + Text = "Keine freien DDE-Kanle" ; + Text [ ENGLISH ] = "No more DDE channels" ; + Text [ norwegian ] = "No more DDE channels" ; + Text [ italian ] = "Nessun canale DDE libero" ; + Text [ portuguese_brazilian ] = "No more DDE channels" ; + Text [ portuguese ] = "Nenhum canal DDE livre" ; + Text [ french ] = "Aucun canal DDE libre" ; + Text [ dutch ] = "Geen vrije DDE-kanalen" ; + Text [ spanish ] = "No hay canales DDE libres" ; + Text [ danish ] = "Ingen bne DDE-kanaler" ; + Text [ swedish ] = "Inga fria DDE-kanaler" ; + Text [ finnish ] = "No more DDE channels" ; + Text [ english_us ] = "No DDE channels available" ; + Text[ chinese_simplified ] = "ûпõ DDE-ŵ"; + Text[ russian ] = " DDE "; + Text[ polish ] = "Nie ma wolnych kanaw DDE"; + Text[ japanese ] = "gDDEق܂"; + Text[ chinese_traditional ] = "S} DDE-HD"; + Text[ arabic ] = "DDE "; + Text[ dutch ] = "Geen vrije DDE-kanalen"; + Text[ chinese_simplified ] = "ûпõ DDE-ŵ"; + Text[ greek ] = " DDE"; + Text[ korean ] = "DDE ä Ұ"; + Text[ turkish ] = "Bo DDE kanallar yok"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_NO_RESPONSE & ERRCODE_RES_MASK + { + Text = "Keine Applikation anwortet auf DDE-Verbindungswunsch" ; + Text [ ENGLISH ] = "No application responded to DDE initiate" ; + Text [ norwegian ] = "No application responded to DDE initiate" ; + Text [ italian ] = "Nessuna applicazione risponde al tentativo di collegamento DDE" ; + Text [ portuguese_brazilian ] = "No application responded to DDE initiate" ; + Text [ portuguese ] = "O estabelecimento da ligao DDE no obteve resposta de nenhuma aplicao" ; + Text [ french ] = "Aucune application ne ragit la tentative de connexion DDE" ; + Text [ dutch ] = "Geen enkele applicatie antwoordt op DDE-verbindingsoproep" ; + Text [ spanish ] = "No responde ninguna aplicacin a la conexin DDE deseada" ; + Text [ danish ] = "Ingen applikation svarer p DDE-forbindelsesinitialiseringen" ; + Text [ swedish ] = "Ingen applikation svarar p DDE-frbindelsinitieringen" ; + Text [ finnish ] = "No application responded to DDE initiate" ; + Text [ english_us ] = "No application responded to DDE connect initiation" ; + Text[ chinese_simplified ] = "ûκӦóӦ DDE "; + Text[ russian ] = " DDE"; + Text[ polish ] = "Za duo aplikacji odpowiada na inicjacj poczenia DDE"; + Text[ japanese ] = "DDEڑ]ɉع݂܂"; + Text[ chinese_traditional ] = "Sε{^ DDE sШD"; + Text[ arabic ] = " DDE"; + Text[ dutch ] = "Geen enkele applicatie antwoordt op DDE-verbindingsoproep"; + Text[ chinese_simplified ] = "ûκӦóӦ DDE "; + Text[ greek ] = " DDE"; + Text[ korean ] = "DDE ʱȭ ϴ α "; + Text[ turkish ] = "Hibir uygulama DDE balant talebine yant vermiyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_MULT_RESPONSES & ERRCODE_RES_MASK + { + Text = "Zu viele Applikationen antworten auf DDE-Verbindungswunsch" ; + Text [ ENGLISH ] = "Multiple applications responded to DDE initiate" ; + Text [ norwegian ] = "Multiple applications responded to DDE initiate" ; + Text [ italian ] = "Troppe applicazioni rispondono al collegamento DDE desiderato" ; + Text [ portuguese_brazilian ] = "Multiple applications responded to DDE initiate" ; + Text [ portuguese ] = "Demasiadas aplicaes respondem tentativa de ligao DDE" ; + Text [ french ] = "Trop d'applications rpondent la tentative de connexion DDE" ; + Text [ dutch ] = "Teveel applicatiex antwoorden op de DDE-verbindingsoproep" ; + Text [ spanish ] = "Demasiadas aplicaciones responden a la conexin deseada DDE" ; + Text [ danish ] = "For mange applikationer svarer p DDE-forbindelsesinitialiseringen" ; + Text [ swedish ] = "Alltfr mnga applikationer svarar p DDE-frbindelseinitieringen" ; + Text [ finnish ] = "Multiple applications responded to DDE initiate" ; + Text [ english_us ] = "Too many applications responded to DDE connect initiation" ; + Text[ chinese_simplified ] = "̫ӦóӦ DDE "; + Text[ russian ] = " DDE"; + Text[ polish ] = "Za duo aplikacji odpowiada na inicjacj poczenia DDE"; + Text[ japanese ] = "DDEڑ]ɉع݂܂"; + Text[ chinese_traditional ] = "Ӧhε{^ DDE sШD"; + Text[ arabic ] = " DDE"; + Text[ dutch ] = "Teveel applicatiex antwoorden op de DDE-verbindingsoproep"; + Text[ chinese_simplified ] = "̫ӦóӦ DDE "; + Text[ greek ] = " DDE"; + Text[ korean ] = "DDE ʱȭ ϴ α ʹ "; + Text[ turkish ] = "DDE balant talebine ok fazla uygulama yant veriyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_CHANNEL_LOCKED & ERRCODE_RES_MASK + { + Text = "DDE-Kanal gesperrt" ; + Text [ ENGLISH ] = "DDE channel locked" ; + Text [ norwegian ] = "DDE channel locked" ; + Text [ italian ] = "Canale DDE bloccato" ; + Text [ portuguese_brazilian ] = "DDE channel locked" ; + Text [ portuguese ] = "Canal DDE bloqueado" ; + Text [ french ] = "Canal DDE verrouill" ; + Text [ dutch ] = "DDE-kanaal geblokkeerd" ; + Text [ spanish ] = "Canal DDE bloqueado" ; + Text [ danish ] = "DDE-kanalen er lst" ; + Text [ swedish ] = "DDE-kanalen r sprrad" ; + Text [ finnish ] = "DDE channel locked" ; + Text [ english_us ] = "DDE channel locked" ; + Text[ chinese_simplified ] = "DDE ŵѾ"; + Text[ russian ] = " DDE "; + Text[ polish ] = "Kana DDE jest zablokowany"; + Text[ japanese ] = "DDEقۯĂ܂"; + Text[ chinese_traditional ] = "DDE HDwgQw"; + Text[ arabic ] = ".DDE "; + Text[ dutch ] = "DDE-kanaal geblokkeerd"; + Text[ chinese_simplified ] = "DDE ŵѾ"; + Text[ greek ] = " DDE "; + Text[ korean ] = "DDE ä "; + Text[ turkish ] = "DDE kanal kilitli"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_NOTPROCESSED & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Fremdapplikation kann DDE-Operation nicht ausfhren : Fremdapplikation kann DDE-Operation nicht ausfhren */ + Text = "Fremdapplikation kann DDE-Operation nicht ausfhren" ; + Text [ ENGLISH ] = "Foreign application won't perform DDE operation" ; + Text [ norwegian ] = "Foreign application won't perform DDE operation" ; + Text [ italian ] = "L'applicazione esterna non pu eseguire l'operazione DDE" ; + Text [ portuguese_brazilian ] = "Foreign application won't perform DDE operation" ; + Text [ portuguese ] = "A aplicao externa no pode executar a operao DDE" ; + Text [ french ] = "L'application externe ne peut pas excuter l'opration DDE" ; + Text [ dutch ] = "Externe applicatie kan DDE niet uitvoeren" ; + Text [ spanish ] = "Una aplicacin externa no puede realizar la operacin DDE" ; + Text [ danish ] = "Den eksterne applikation kan ikke udfre DDE-operationen" ; + Text [ swedish ] = "Den externa applikationen kan inte utfra DDE-operationen" ; + Text [ finnish ] = "Foreign application won't perform DDE operation" ; + Text [ english_us ] = "External application cannot execute DDE operation" ; + Text[ chinese_simplified ] = "ⲿӦóִ DDE "; + Text[ russian ] = " DDE"; + Text[ polish ] = "Obca aplikacja nie moe wykona operacjiDDE"; + Text[ japanese ] = "Oع݂DDE̵ڰ݂sł܂"; + Text[ chinese_traditional ] = "~ε{ǵLk DDE B"; + Text[ arabic ] = "DDE "; + Text[ dutch ] = "Externe applicatie kan DDE niet uitvoeren"; + Text[ chinese_simplified ] = "ⲿӦóִ DDE "; + Text[ greek ] = " DDE"; + Text[ korean ] = "ܺ α DDE ۵ ų ϴ."; + Text[ turkish ] = "Harici uygulama DDE ilemini yrtemiyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_TIMEOUT & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Zeitberschreitung whrend des Wartens auf DDE-Antwort : Zeitberschreitung whrend des Wartens auf DDE-Antwort */ + Text = "Zeitberschreitung whrend des Wartens auf DDE-Antwort" ; + Text [ ENGLISH ] = "Timeout while waiting for DDE response" ; + Text [ norwegian ] = "Timeout while waiting for DDE response" ; + Text [ italian ] = "Tempo d'attesa per la rispota DDE oltrepassato" ; + Text [ portuguese_brazilian ] = "Timeout while waiting for DDE response" ; + Text [ portuguese ] = "Ultrapassado tempo de espera pela resposta DDE" ; + Text [ french ] = "Timeout pendant l'attente de la rponse DDE" ; + Text [ dutch ] = "Tijdoverschrijding tijdens wachten op DDE-antwoord" ; + Text [ spanish ] = "Se ha excedido el tiempo de espera por una respuesta DDE" ; + Text [ danish ] = "Timeout mens der blev ventet p DDE-svar" ; + Text [ swedish ] = "Tiden har gtt ut vid vntandet p DDE-svar" ; + Text [ finnish ] = "Timeout while waiting for DDE response" ; + Text [ english_us ] = "Timeout while waiting for DDE response" ; + Text[ chinese_simplified ] = "Ⱥ DDE Ӧʱ"; + Text[ russian ] = " DDE"; + Text[ polish ] = "Przekroczenie limitu czasu podczas czekania na odpowied DDE"; + Text[ japanese ] = "DDẺ҂̊ԂɎԒ"; + Text[ chinese_traditional ] = " DDE ^WLɭ"; + Text[ arabic ] = "DDE "; + Text[ dutch ] = "Tijdoverschrijding tijdens wachten op DDE-antwoord"; + Text[ chinese_simplified ] = "Ⱥ DDE Ӧʱ"; + Text[ greek ] = " DDE"; + Text[ korean ] = "DDE ٸ ŸӾƿ"; + Text[ turkish ] = "DDE yantn beklemede zaman am"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_USER_INTERRUPT & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Benutzer drckte ESCAPE whrend der DDE-Operation : Benutzer drckte ESCAPE whrend der DDE-Operation */ + Text = "Benutzer drckte ESCAPE whrend der DDE-Operation" ; + Text [ ENGLISH ] = "User pressed Escape during DDE operation" ; + Text [ norwegian ] = "User pressed Escape during DDE operation" ; + Text [ italian ] = "L'utente ha premuto ESC durante l'operazione DDE" ; + Text [ portuguese_brazilian ] = "User pressed Escape during DDE operation" ; + Text [ portuguese ] = "O utilizador premiu ESCAPE durante a operao DDE" ; + Text [ french ] = "L'utilisateur a appuy sur CHAP pendant l'opration DDE" ; + Text [ dutch ] = "Gebruiker drukte Escape tijdens uitvoering DDE" ; + Text [ spanish ] = "El usuario presion la tecla ESC durante la operacin DDE" ; + Text [ danish ] = "Brugeren trykkede p ESCAPE under DDE-operationen" ; + Text [ swedish ] = "Anvndaren tryckte p ESCAPE under DDE-operationen" ; + Text [ finnish ] = "User pressed Escape during DDE operation" ; + Text [ english_us ] = "User pressed ESCAPE during DDE operation." ; + Text[ chinese_simplified ] = "ִ DDE ʹ߰ ESCAPE "; + Text[ russian ] = " ESCAPE DDE"; + Text[ polish ] = "Uytkownik uy przycisku ESCAPE podczas operacji DDE"; + Text[ japanese ] = "DDE̵ڰ݂̍Œ հްESCAPE݂܂"; + Text[ language_user1 ] = " "; + Text[ chinese_traditional ] = "b DDE BL{ϥΪ̫F ESCAPE "; + Text[ arabic ] = " DDE"; + Text[ dutch ] = "Gebruiker drukte Escape tijdens uitvoering DDE"; + Text[ chinese_simplified ] = "ִ DDE ʹ߰ ESCAPE "; + Text[ greek ] = " ESCAPE DDE."; + Text[ korean ] = "DDE ۵̿ Escape ."; + Text[ turkish ] = "DDE ilemi srasnda ESCAPE tuuna basld"; + }; + String SbERR_DDE_BUSY & ERRCODE_RES_MASK + { + Text = "Fremdapplikation ist nicht bereit" ; + Text [ ENGLISH ] = "Destination application is busy" ; + Text [ norwegian ] = "Destination application is busy" ; + Text [ italian ] = "L'applicazione esterna non pronta" ; + Text [ portuguese_brazilian ] = "Destination application is busy" ; + Text [ portuguese ] = "A aplicao externa est ocupada" ; + Text [ french ] = "L'application externe est occupe" ; + Text [ dutch ] = "Doelapplicatie is niet bereid" ; + Text [ spanish ] = "La aplicacin externa no est lista" ; + Text [ danish ] = "Den eksterne applikation er ikke klar" ; + Text [ swedish ] = "Extern applikation upptagen" ; + Text [ finnish ] = "Destination application is busy" ; + Text [ english_us ] = "External application busy" ; + Text[ chinese_simplified ] = "ⲿӦóæµ"; + Text[ russian ] = " "; + Text[ polish ] = "Obca aplikacja nie jest gotowa"; + Text[ japanese ] = "Oع݂ިԂł"; + Text[ chinese_traditional ] = "~ε{L"; + Text[ arabic ] = " "; + Text[ dutch ] = "Doelapplicatie is niet bereid"; + Text[ chinese_simplified ] = "ⲿӦóæµ"; + Text[ greek ] = " ."; + Text[ korean ] = " α غ ȵǾϴ."; + Text[ turkish ] = "Harici uygulama hazr deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_NO_DATA & ERRCODE_RES_MASK + { + Text = "DDE-Operation ohne Daten" ; + Text [ ENGLISH ] = "Data not provided in DDE operation" ; + Text [ norwegian ] = "Data not provided in DDE operation" ; + Text [ italian ] = "Operazione DDE senza dati" ; + Text [ portuguese_brazilian ] = "Data not provided in DDE operation" ; + Text [ portuguese ] = "A operao DDE no tem dados" ; + Text [ french ] = "Donnes non fournies dans l'opration DDE" ; + Text [ dutch ] = "DDE-operatie zonder gegevens" ; + Text [ spanish ] = "Operacin DDE sin datos" ; + Text [ danish ] = "DDE-operation uden data" ; + Text [ swedish ] = "DDE-operation utan data" ; + Text [ finnish ] = "Data not provided in DDE operation" ; + Text [ english_us ] = "DDE operation without data" ; + Text[ chinese_simplified ] = "ûݵ DDE "; + Text[ russian ] = " DDE "; + Text[ polish ] = "Operacja DDE bez danych"; + Text[ japanese ] = "ްȂDDEڰ"; + Text[ chinese_traditional ] = "Sƪ DDE B"; + Text[ arabic ] = " DDE "; + Text[ dutch ] = "DDE-operatie zonder gegevens"; + Text[ chinese_simplified ] = "ûݵ DDE "; + Text[ greek ] = " DDE "; + Text[ korean ] = " DDE ۵"; + Text[ turkish ] = "Verisiz DDE ilemi"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_WRONG_DATA_FORMAT & ERRCODE_RES_MASK + { + Text = "Daten sind im falschen Format" ; + Text [ ENGLISH ] = "Data in wrong format" ; + Text [ norwegian ] = "Data in wrong format" ; + Text [ italian ] = "I dati hanno un formato errato" ; + Text [ portuguese_brazilian ] = "Data in wrong format" ; + Text [ portuguese ] = "Formato dos dados incorrecto" ; + Text [ french ] = "Le format des donnes est incorrect" ; + Text [ dutch ] = "Gegevens hebben foutief formaat" ; + Text [ spanish ] = "Los datos estn en un formato falso" ; + Text [ danish ] = "Data er i forkert format" ; + Text [ swedish ] = "Data har fel format" ; + Text [ finnish ] = "Data in wrong format" ; + Text [ english_us ] = "Data are in wrong format" ; + Text[ chinese_simplified ] = "ݸʽ"; + Text[ russian ] = " "; + Text[ polish ] = "Pliki s le sformatowane"; + Text[ japanese ] = "ް͏܂"; + Text[ chinese_traditional ] = "Ʈ榡~"; + Text[ arabic ] = " "; + Text[ dutch ] = "Gegevens hebben foutief formaat"; + Text[ chinese_simplified ] = "ݸʽ"; + Text[ greek ] = " "; + Text[ korean ] = "߸ "; + Text[ turkish ] = "Verilerin format yanl"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_PARTNER_QUIT & ERRCODE_RES_MASK + { + Text = "Fremdapplikation ist beendet worden" ; + Text [ ENGLISH ] = "Foreign application quit" ; + Text [ norwegian ] = "Foreign application quit" ; + Text [ italian ] = "L'applicazione esterna terminata" ; + Text [ portuguese_brazilian ] = "Foreign application quit" ; + Text [ portuguese ] = "Cancelada a aplicao externa" ; + Text [ french ] = "L'application externe a t quitte" ; + Text [ dutch ] = "Externe applicatie werd beindigd" ; + Text [ spanish ] = "La aplicacin externa se ha cancelado" ; + Text [ danish ] = "Den eksterne applikation er blevet afsluttet" ; + Text [ swedish ] = "Den externa applikationen r avslutad" ; + Text [ finnish ] = "Foreign application quit" ; + Text [ english_us ] = "External application has been terminated" ; + Text[ chinese_simplified ] = "ⲿӦóѾ"; + Text[ russian ] = " "; + Text[ polish ] = "Obca aplikacja zostaa zakoczona"; + Text[ japanese ] = "Oع݂͏IĂ܂"; + Text[ chinese_traditional ] = "~ε{wg"; + Text[ arabic ] = " "; + Text[ dutch ] = "Externe applicatie werd beindigd"; + Text[ chinese_simplified ] = "ⲿӦóѾ"; + Text[ greek ] = " ."; + Text[ korean ] = "ܺ α ŵǾϴ."; + Text[ turkish ] = "Harici uygulamadan kld"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_CONV_CLOSED & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? DDE-Verbindung ist unterbrochen oder gendert worden : DDE-Verbindung ist unterbrochen oder gendert worden */ + Text = "DDE-Verbindung ist unterbrochen oder gendert worden" ; + Text [ ENGLISH ] = "DDE conversation closed or changed" ; + Text [ norwegian ] = "DDE conversation closed or changed" ; + Text [ italian ] = "Collegamento DEE interrotto o modificato" ; + Text [ portuguese_brazilian ] = "DDE conversation closed or changed" ; + Text [ portuguese ] = "A ligao DDE foi interrompida ou modificada" ; + Text [ french ] = "La connexion DDE a t interrompue ou modifie" ; + Text [ dutch ] = "DDE-verbinding verbroken of veranderd" ; + Text [ spanish ] = "La conexin DDE se ha interrumpido o modificado" ; + Text [ danish ] = "DDE-forbindelsen er blevet afbrudt eller modificeret" ; + Text [ swedish ] = "DDE-frbindelsen r avbruten eller frndrad" ; + Text [ finnish ] = "DDE conversation closed or changed" ; + Text [ english_us ] = "DDE connection interrupted or modified" ; + Text[ chinese_simplified ] = "DDEѾжϻѾ"; + Text[ russian ] = " DDE "; + Text[ polish ] = "Poczenie DDE zostao przerwane lub zmodyfikowane."; + Text[ japanese ] = "DDEڑf܂͕ύXĂ܂"; + Text[ chinese_traditional ] = "DDEswg_Ϊ̤wgܧ"; + Text[ arabic ] = "DDE "; + Text[ dutch ] = "DDE-verbinding verbroken of veranderd"; + Text[ chinese_simplified ] = "DDEѾжϻѾ"; + Text[ greek ] = " DDE "; + Text[ korean ] = "DDE ͷƮǰų Ǿϴ."; + Text[ turkish ] = "DDE balants kesildi ya da deitirildi"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_NO_CHANNEL & ERRCODE_RES_MASK + { + Text = "DDE-Methode ohne offenen DDE-Kanal gerufen" ; + Text [ ENGLISH ] = "DDE method invoked with no channel open" ; + Text [ norwegian ] = "DDE method invoked with no channel open" ; + Text [ italian ] = "Metodo DDE richiamato senza canale DDE aperto" ; + Text [ portuguese_brazilian ] = "DDE method invoked with no channel open" ; + Text [ portuguese ] = "Mtodo DDE foi chamado sem canal aberto" ; + Text [ french ] = "Mthode DDE appele sans avoir ouvert un canal DDE" ; + Text [ dutch ] = "DDE-methode zonder open kanaal opgeroepen" ; + Text [ spanish ] = "Se llam al mtodo DDE sin un canal DDE abierto" ; + Text [ danish ] = "DDE-metode blev kaldt uden ben DDE-kanal" ; + Text [ swedish ] = "DDE-metod anropad utan ppen DDE-kanal" ; + Text [ finnish ] = "DDE method invoked with no channel open" ; + Text [ english_us ] = "DDE method invoked with no channel open" ; + Text[ chinese_simplified ] = "ûдDDEŵʱDDE"; + Text[ russian ] = " DDE DDE"; + Text[ polish ] = "Metoda DDE wywoana bez otwartego kanau DDE"; + Text[ japanese ] = "DDEقJĂȂԂDDEҿނĂяoĂ܂"; + Text[ chinese_traditional ] = "bS}DDEHDɽեDDE k"; + Text[ arabic ] = "DDE DDE "; + Text[ dutch ] = "DDE-methode zonder open kanaal opgeroepen"; + Text[ chinese_simplified ] = "ûдDDEŵʱDDE"; + Text[ greek ] = " DDE DDE"; + Text[ korean ] = "DDE ä ʰ DDE ҵ带 ȣ"; + Text[ turkish ] = "Ak DDE kanal olmadan DDE yntemi ars"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_INVALID_LINK & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Ungltiges DDE-Linkformat : Ungltiges DDE-Linkformat */ + Text = "Ungltiges DDE-Linkformat" ; + Text [ ENGLISH ] = "Invalid DDE Link format" ; + Text [ norwegian ] = "Invalid DDE Link format" ; + Text [ italian ] = "Formato link DDE non valido" ; + Text [ portuguese_brazilian ] = "Invalid DDE Link format" ; + Text [ portuguese ] = "Formato de ligao DDE no vlido" ; + Text [ french ] = "Format de lien DDE incorrect" ; + Text [ dutch ] = "Foutief DDE-link-formaat" ; + Text [ spanish ] = "Formato del vnculo DDE incorrecto" ; + Text [ danish ] = "Ugyldigt DDE-linkformat" ; + Text [ swedish ] = "Ogiltigt DDE- linkformat" ; + Text [ finnish ] = "Invalid DDE Link format" ; + Text [ english_us ] = "Invalid DDE link format" ; + Text[ chinese_simplified ] = "Ч DDE Ӹʽ"; + Text[ russian ] = " DDE"; + Text[ polish ] = "Nieprawidowy format cza DDE"; + Text[ japanese ] = " DDE ݸ"; + Text[ chinese_traditional ] = "LĪDDEs榡"; + Text[ arabic ] = " DDE "; + Text[ dutch ] = "Foutief DDE-link-formaat"; + Text[ chinese_simplified ] = "Ч DDE Ӹʽ"; + Text[ greek ] = " DDE"; + Text[ korean ] = "ȿ DDE "; + Text[ turkish ] = "Geersiz DDE balant format"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_QUEUE_OVERFLOW & ERRCODE_RES_MASK + { + Text = "DDE-Message ist verlorengegangen" ; + Text [ ENGLISH ] = "Message queue filled; DDE Message lost" ; + Text [ norwegian ] = "Message queue filled; DDE Message lost" ; + Text [ italian ] = "Il messaggio DDE andato perduto" ; + Text [ portuguese_brazilian ] = "Message queue filled; DDE Message lost" ; + Text [ portuguese ] = "A mensagem DDE perdeu-se" ; + Text [ french ] = "Le message DDE a t perdu" ; + Text [ dutch ] = "DDE-message verloren gegaan" ; + Text [ spanish ] = "El mensaje DDE se ha perdido" ; + Text [ danish ] = "DDE-meddelelse er get tabt" ; + Text [ swedish ] = "DDE-meddelandet r borttappat" ; + Text [ finnish ] = "Message queue filled; DDE Message lost" ; + Text [ english_us ] = "DDE message has been lost" ; + Text[ chinese_simplified ] = "DDE Ϣʧ"; + Text[ russian ] = " DDE "; + Text[ polish ] = "Wiadomo DDE zagina"; + Text[ japanese ] = "DDEүނ͎܂"; + Text[ chinese_traditional ] = "DDET"; + Text[ arabic ] = "DDE "; + Text[ dutch ] = "DDE-message verloren gegaan"; + Text[ chinese_simplified ] = "DDE Ϣʧ"; + Text[ greek ] = " DDE "; + Text[ korean ] = "DDE "; + Text[ turkish ] = "DDE iletisi kayboldu"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_LINK_ALREADY_EST & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Paste Link bereits durchgefhrt : Paste Link bereits durchgefhrt */ + Text = "Paste Link bereits durchgefhrt" ; + Text [ ENGLISH ] = "Paste link already performed" ; + Text [ norwegian ] = "Paste link already performed" ; + Text [ italian ] = "Paste link gi eseguito" ; + Text [ portuguese_brazilian ] = "Paste link already performed" ; + Text [ portuguese ] = "\"Paste link\" j executado" ; + Text [ french ] = "Le paste link a dj t excut" ; + Text [ dutch ] = "Paste link reeds uitgevoerd" ; + Text [ spanish ] = "Pegar vnculo ya ejecutado" ; + Text [ danish ] = "Paste link er allerede udfrt" ; + Text [ swedish ] = "Paste link r redan genomfrt" ; + Text [ finnish ] = "Paste link already performed" ; + Text [ english_us ] = "Paste link already performed" ; + Text[ chinese_simplified ] = "ճѾ"; + Text[ russian ] = " "; + Text[ polish ] = "Polecenie Wklej cze zostao ju wykonane"; + Text[ japanese ] = "ݸ̓\\t͂łɎsĂ܂"; + Text[ language_user1 ] = " "; + Text[ chinese_traditional ] = "߶Kswg"; + Text[ arabic ] = " Paste link "; + Text[ dutch ] = "Paste link reeds uitgevoerd"; + Text[ chinese_simplified ] = "ճѾ"; + Text[ greek ] = " 'Paste link' "; + Text[ korean ] = " ٿֱ ̹ Ǿϴ."; + Text[ turkish ] = "Paste Link ilemi yrtld"; + }; + String SbERR_DDE_LINK_INV_TOPIC & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? LinkMode kann wegen ungltigen Link-Topics nicht gesetzt werden : LinkMode kann wegen ungltigen Link-Topics nicht gesetzt werden */ + Text = "LinkMode kann wegen ungltigen Link-Topics nicht gesetzt werden" ; + Text [ ENGLISH ] = "Cant set LinkMode; invalid Link Topic" ; + Text [ norwegian ] = "Cant set LinkMode; invalid Link Topic" ; + Text [ italian ] = "Link topic non valido; impossibile impostare il modo link" ; + Text [ portuguese_brazilian ] = "Cant set LinkMode; invalid Link Topic" ; + Text [ portuguese ] = "Impossvel configurar o LinkMode devido a LinkTopic no vlido" ; + Text [ french ] = "Impossible de dfinir le LinkMode cause d'un Link-Topic incorrect" ; + Text [ dutch ] = "Ongeldig Link Topic; LinkMode kan niet worden gezet" ; + Text [ spanish ] = "No se puede establecer el LinkMode debido a un Link Topic incorrecto" ; + Text [ danish ] = "Linktilstand kan ikke indstilles p grund af ugyldige linktopics." ; + Text [ swedish ] = "LinkMode kan inte stllas in p grund av ogiltiga Link-Topics" ; + Text [ finnish ] = "Cant set LinkMode; invalid Link Topic" ; + Text [ english_us ] = "Link mode cannot be set due to invalid link topic" ; + Text[ chinese_simplified ] = "Чӱ趨ӱ"; + Text[ russian ] = "- Link-Topic LinkMode "; + Text[ polish ] = "Nie mona skonfigurowa LinkMode z powodu niewanych Link-Topics"; + Text[ japanese ] = "ݸ Ӱނݸ ߯ł邽߁Aݒł܂"; + Text[ chinese_traditional ] = "]LĪ|DӵLk]w|D"; + Text[ arabic ] = " Link-Topics LinkMode "; + Text[ dutch ] = "Ongeldig Link Topic; LinkMode kan niet worden gezet"; + Text[ chinese_simplified ] = "Чӱ趨ӱ"; + Text[ greek ] = " LinkMode Link-Topics."; + Text[ korean ] = "ȿ Ͽ ɼ ϴ."; + Text[ turkish ] = "LinkMode, geersiz Link-Topics nedeniyle belirlenemez"; + Text[ language_user1 ] = " "; + }; + String SbERR_DDE_DLL_NOT_FOUND & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Fr DDE wird DDEML.DLL bentigt : Fr DDE wird DDEML.DLL bentigt */ + Text = "Fr DDE wird DDEML.DLL bentigt" ; + Text [ ENGLISH ] = "DDE requires DDEML.DLL" ; + Text [ norwegian ] = "DDE requires DDEML.DLL" ; + Text [ italian ] = "DDE necessita del DDEML.DLL" ; + Text [ portuguese_brazilian ] = "DDE requires DDEML.DLL" ; + Text [ portuguese ] = "DDE requere DDEML.DLL" ; + Text [ french ] = "Le DDE requiert DDEML.DLL" ; + Text [ dutch ] = "DDE benodigt DDEML.DLL" ; + Text [ spanish ] = "Para el DDE se requiere DDEML.DLL" ; + Text [ danish ] = "DDE krver DDEML.DLL" ; + Text [ swedish ] = "DDE krver DDEML.DLL" ; + Text [ finnish ] = "DDE requires DDEML.DLL" ; + Text [ english_us ] = "DDE requires the DDEML.DLL file" ; + Text[ chinese_simplified ] = "DDE Ҫ DDEML.DLL"; + Text[ russian ] = " DDE DDEML.DLL"; + Text[ polish ] = "Dla DDE jest wymagane DDEML.DLL"; + Text[ japanese ] = "DDÊ߂DDEML.DLLKvł"; + Text[ chinese_traditional ] = "DDEnDDDEML.DLL"; + Text[ arabic ] = "DDEML.DLL DDE"; + Text[ dutch ] = "DDE benodigt DDEML.DLL"; + Text[ chinese_simplified ] = "DDE Ҫ DDEML.DLL"; + Text[ greek ] = " DDE DDEML.DLL"; + Text[ korean ] = "DDE DDEML.DLL ʿմϴ."; + Text[ turkish ] = "DDE iin DDEML.DLL gerekli"; + Text[ language_user1 ] = " "; + }; + String SbERR_CANNOT_LOAD & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Das Modul kann nicht geladen werden, ungltiges Format : Das Modul kann nicht geladen werden, ungltiges Format */ + Text = "Das Modul kann nicht geladen werden, ungltiges Format" ; + Text [ ENGLISH ] = "Can't load module, invalid format" ; + Text [ norwegian ] = "Can't load module, invalid format" ; + Text [ italian ] = "Formato non valido; impossibile caricare il modulo" ; + Text [ portuguese_brazilian ] = "Can't load module, invalid format" ; + Text [ portuguese ] = "Impossvel carregar mdulo; formato no vlido" ; + Text [ french ] = "Impossible de charger le module cause d'une erreur de format" ; + Text [ dutch ] = "De module kan niet worden geladen, ongeldig formaat" ; + Text [ spanish ] = "No se puede cargar el mdulo ya que el formato es incorrecto" ; + Text [ danish ] = "Det er ikke muligt at indlse modulet; ugyldigt format" ; + Text [ swedish ] = "Modulen kan inte laddas, ogiltigt format" ; + Text [ finnish ] = "Can't load module, invalid format" ; + Text [ english_us ] = "Module cannot be loaded; invalid format" ; + Text[ chinese_simplified ] = "ʽЧװģ"; + Text[ russian ] = " , "; + Text[ polish ] = "Moduu nie mona zaadowa, nieprawidowy format"; + Text[ japanese ] = "Ӽޭقǂݍ߂܂BȏłB"; + Text[ chinese_traditional ] = "榡LġM]ӵLk˸Ҷ"; + Text[ arabic ] = " "; + Text[ dutch ] = "De module kan niet worden geladen, ongeldig formaat"; + Text[ chinese_simplified ] = "ʽЧװģ"; + Text[ greek ] = " , "; + Text[ korean ] = " ε ʾҽϴ. ; ߸ "; + Text[ turkish ] = "Modl yklenemiyor; geersiz format"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_INDEX & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Ungltiger Objektindex : Ungltiger Objektindex */ + Text = "Ungltiger Objektindex" ; + Text [ ENGLISH ] = "Invalid object index" ; + Text [ norwegian ] = "Invalid object index" ; + Text [ italian ] = "Indice di oggetto non valido" ; + Text [ portuguese_brazilian ] = "Invalid object index" ; + Text [ portuguese ] = "ndice de objectos no vlido" ; + Text [ french ] = "Index d'objets incorrect" ; + Text [ dutch ] = "Ongeldige objectindex" ; + Text [ spanish ] = "ndice incorrecto del objeto" ; + Text [ danish ] = "Ugyldigt objektindeks" ; + Text [ swedish ] = "Ogiltigt objektindex" ; + Text [ finnish ] = "Invalid object index" ; + Text [ english_us ] = "Invalid object index" ; + Text[ chinese_simplified ] = "ЧĶ"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowy indeks obiektw"; + Text[ japanese ] = "ȵު ޯ"; + Text[ chinese_traditional ] = "LĪ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldige objectindex"; + Text[ chinese_simplified ] = "ЧĶ"; + Text[ greek ] = " "; + Text[ korean ] = "ȿ ü ε"; + Text[ turkish ] = "Geersiz nesne dizini"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_ACTIVE_OBJECT & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Objekt ist nicht verfgbar : Objekt ist nicht verfgbar */ + Text = "Objekt ist nicht verfgbar" ; + Text [ ENGLISH ] = "Object is not available" ; + Text [ norwegian ] = "Object is not available" ; + Text [ italian ] = "Oggetto non disponibile" ; + Text [ portuguese_brazilian ] = "Object is not available" ; + Text [ portuguese ] = "Objecto no disponvel" ; + Text [ french ] = "L'objet n'est pas disponible" ; + Text [ dutch ] = "Object niet beschikbaar" ; + Text [ spanish ] = "El objeto no est disponible" ; + Text [ danish ] = "Objektet er ikke tilgngeligt" ; + Text [ swedish ] = "Objektet r inte tillgngligt" ; + Text [ finnish ] = "Object is not available" ; + Text [ english_us ] = "Object is not available" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Obiekt jest niedostpny"; + Text[ japanese ] = "ުĂ܂"; + Text[ chinese_traditional ] = "sb"; + Text[ arabic ] = " "; + Text[ dutch ] = "Object niet beschikbaar"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "ü ȿ Ƚϴ."; + Text[ turkish ] = "Nesne mevcut deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_PROP_VALUE & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Falscher Wert fr Eigenschaft : Falscher Wert fr Eigenschaft */ + Text = "Falscher Wert fr Eigenschaft" ; + Text [ ENGLISH ] = "Bad property value" ; + Text [ norwegian ] = "Bad property value" ; + Text [ italian ] = "Valore per la propriet errato" ; + Text [ portuguese_brazilian ] = "Bad property value" ; + Text [ portuguese ] = "Valor de propriedade incorrecto" ; + Text [ french ] = "Valeur de proprit incorrecte" ; + Text [ dutch ] = "Foutieve waarde voor eigenschap" ; + Text [ spanish ] = "Valor no vlido para la propiedad" ; + Text [ danish ] = "Forkert egenskabsvrdi" ; + Text [ swedish ] = "Felaktigt vrde fr egenskap" ; + Text [ finnish ] = "Bad property value" ; + Text [ english_us ] = "Incorrect property value" ; + Text[ chinese_simplified ] = "ֵ"; + Text[ russian ] = " "; + Text[ polish ] = "Niepoprawna warto waciwoci"; + Text[ japanese ] = "èl܂"; + Text[ chinese_traditional ] = "~ݩʼƭ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Foutieve waarde voor eigenschap"; + Text[ chinese_simplified ] = "ֵ"; + Text[ greek ] = " "; + Text[ korean ] = "߸ Ƽ "; + Text[ turkish ] = "Yanl zellik deeri"; + Text[ language_user1 ] = " "; + }; + String SbERR_PROP_READONLY & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Eigenschaft ist schreibgeschtzt : Eigenschaft ist schreibgeschtzt */ + Text = "Eigenschaft ist schreibgeschtzt" ; + Text [ ENGLISH ] = "Property is read only" ; + Text [ norwegian ] = "Property is read only" ; + Text [ italian ] = "La propriet a sola lettura" ; + Text [ portuguese_brazilian ] = "Property is read only" ; + Text [ portuguese ] = "A propriedade s leitura" ; + Text [ french ] = "La proprit est en lecture seule" ; + Text [ dutch ] = "Eigenschap is schrijfbeveiligd" ; + Text [ spanish ] = "Propiedad es solo lectura" ; + Text [ danish ] = "Egenskaben er skrivebeskyttet" ; + Text [ swedish ] = "Egenskapen r skrivskyddad" ; + Text [ finnish ] = "Property is read only" ; + Text [ english_us ] = "This property is read only" ; + Text[ chinese_simplified ] = "д"; + Text[ russian ] = " "; + Text[ polish ] = "Waciwo tylko do odczytu"; + Text[ japanese ] = "è͏ݕی삳Ă܂"; + Text[ chinese_traditional ] = "Ūݩ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Eigenschap is schrijfbeveiligd"; + Text[ chinese_simplified ] = "д"; + Text[ greek ] = " "; + Text[ korean ] = " Ƽ б Դϴ."; + Text[ turkish ] = "zellik yazma korumal"; + Text[ language_user1 ] = " "; + }; + String SbERR_PROP_WRITEONLY & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Eigenschaft ist lesegeschtzt : Eigenschaft ist lesegeschtzt */ + Text = "Eigenschaft ist lesegeschtzt" ; + Text [ ENGLISH ] = "Property is write only" ; + Text [ norwegian ] = "Property is write only" ; + Text [ italian ] = "La propriet a sola scrittura" ; + Text [ portuguese_brazilian ] = "Property is write only" ; + Text [ portuguese ] = "A propriedade s escrita" ; + Text [ french ] = "La proprit est en criture seule" ; + Text [ dutch ] = "Eigenschap is leesbeveiligd" ; + Text [ spanish ] = "Propiedad es solo escritura" ; + Text [ danish ] = "Egenskaben er lsebeskyttet" ; + Text [ swedish ] = "Egenskapen r lsskyddad" ; + Text [ finnish ] = "Property is write only" ; + Text [ english_us ] = "This property is write only" ; + Text[ chinese_simplified ] = "ȡ"; + Text[ russian ] = " "; + Text[ polish ] = "Waciwo tylko do zapisu"; + Text[ japanese ] = "è͓ǂݎی삳Ă܂"; + Text[ chinese_traditional ] = "Ūݩ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Eigenschap is leesbeveiligd"; + Text[ chinese_simplified ] = "ȡ"; + Text[ greek ] = " "; + Text[ korean ] = " Ƽ Դϴ."; + Text[ turkish ] = "zellik okuma korumal"; + Text[ language_user1 ] = " "; + }; + String SbERR_INVALID_OBJECT & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Ungltige Objektreferenz : Ungltige Objektreferenz */ + Text = "Ungltige Objektreferenz" ; + Text [ ENGLISH ] = "Invalid object reference" ; + Text [ norwegian ] = "Invalid object reference" ; + Text [ italian ] = "Riferimento ad oggetto non valido" ; + Text [ portuguese_brazilian ] = "Invalid object reference" ; + Text [ portuguese ] = "Referncia do objecto no-vlida" ; + Text [ french ] = "Rfrence d'objet incorrecte" ; + Text [ dutch ] = "Ongeldige objectverwijzing" ; + Text [ spanish ] = "Referencia al objeto no vlida" ; + Text [ danish ] = "Ugyldig objektreference" ; + Text [ swedish ] = "Ogiltig objektreferens" ; + Text [ finnish ] = "Invalid object reference" ; + Text [ english_us ] = "Invalid object reference" ; + Text[ chinese_simplified ] = "ЧĶ"; + Text[ russian ] = " "; + Text[ polish ] = "Niewane odwoanie obiektu"; + Text[ japanese ] = "ȵުĎQ"; + Text[ chinese_traditional ] = "LĪѷ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldige objectverwijzing"; + Text[ chinese_simplified ] = "ЧĶ"; + Text[ greek ] = " "; + Text[ korean ] = "߸ ü "; + Text[ turkish ] = "Geersiz nesne referans"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_METHOD & ERRCODE_RES_MASK + { + Text = "Eigenschaft oder Methode nicht gefunden" ; + Text [ ENGLISH ] = "Property or method not found" ; + Text [ norwegian ] = "Property or method not found" ; + Text [ italian ] = "Propriet o metodo non trovati" ; + Text [ portuguese_brazilian ] = "Property or method not found" ; + Text [ portuguese ] = "Propriedade ou mtodo no encontrados" ; + Text [ french ] = "Proprit ou mthode introuvable" ; + Text [ dutch ] = "Eigenschap of methode niet gevonden" ; + Text [ spanish ] = "No se encontr la propiedad o el mtodo" ; + Text [ danish ] = "Egenskab eller metode blev ikke fundet" ; + Text [ swedish ] = "Egenskap eller metod hittades inte" ; + Text [ finnish ] = "Property or method not found" ; + Text [ english_us ] = "Property or method not found" ; + Text[ chinese_simplified ] = "ûҵԻ"; + Text[ russian ] = " "; + Text[ polish ] = "Nie znaleziono waciwoci lub metody"; + Text[ japanese ] = "è܂ҿނ܂"; + Text[ chinese_traditional ] = "SݩʩΤk"; + Text[ arabic ] = " "; + Text[ dutch ] = "Eigenschap of methode niet gevonden"; + Text[ chinese_simplified ] = "ûҵԻ"; + Text[ greek ] = " "; + Text[ korean ] = "Ƽ Ǵ ҵ尡 ߰ߵ ʽϴ."; + Text[ turkish ] = "zellik ya da yntem bulunamad"; + Text[ language_user1 ] = " "; + }; + String SbERR_NEEDS_OBJECT & ERRCODE_RES_MASK + { + Text = "Objekt erforderlich" ; + Text [ ENGLISH ] = "Object required" ; + Text [ norwegian ] = "Object required" ; + Text [ italian ] = " necessario un oggetto" ; + Text [ portuguese_brazilian ] = "Object required" ; + Text [ portuguese ] = "Necessrio objecto" ; + Text [ french ] = "Objet requis" ; + Text [ dutch ] = "Object vereist" ; + Text [ spanish ] = "Se requiere un objeto" ; + Text [ danish ] = "Objekt krves" ; + Text [ swedish ] = "Objekt krvs" ; + Text [ finnish ] = "Object required" ; + Text [ english_us ] = "Object required" ; + Text[ chinese_simplified ] = "Ҫ"; + Text[ russian ] = " "; + Text[ polish ] = "Wymagany obiekt"; + Text[ japanese ] = "ުĂKvł"; + Text[ chinese_traditional ] = "nD"; + Text[ arabic ] = " "; + Text[ dutch ] = "Object vereist"; + Text[ chinese_simplified ] = "Ҫ"; + Text[ greek ] = " "; + Text[ korean ] = "ü ʿմϴ."; + Text[ turkish ] = "Nesne gerekli"; + Text[ language_user1 ] = " "; + }; + String SbERR_INVALID_USAGE_OBJECT & ERRCODE_RES_MASK + { + Text = "Falsche Verwendung eines Objekts" ; + Text [ ENGLISH ] = "Invalid use of object" ; + Text [ norwegian ] = "Invalid use of object" ; + Text [ italian ] = "Utilizzo non valido di un oggetto" ; + Text [ portuguese_brazilian ] = "Invalid use of object" ; + Text [ portuguese ] = "Uso incorrecto de um objecto" ; + Text [ french ] = "Utilisation incorrecte d'un objet" ; + Text [ dutch ] = "Ongeldig gebruik van object" ; + Text [ spanish ] = "Uso errneo de un objeto" ; + Text [ danish ] = "Ugyldig brug af et objekt" ; + Text [ swedish ] = "Felaktig anvndning av ett objekt" ; + Text [ finnish ] = "Invalid use of object" ; + Text [ english_us ] = "Invalid use of an object" ; + Text[ chinese_simplified ] = "ʹö"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowe uycie obiektu"; + Text[ japanese ] = "ުĂ̌gp"; + Text[ chinese_traditional ] = "~ϥΪ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldig gebruik van object"; + Text[ chinese_simplified ] = "ʹö"; + Text[ greek ] = " "; + Text[ korean ] = "ü ߸ "; + Text[ turkish ] = "Nesne kullanm yanl"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_OLE & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? OLE-Automatisierung wird von diesem Objekt nicht untersttzt : OLE-Automatisierung wird von diesem Objekt nicht untersttzt */ + Text = "OLE-Automatisierung wird von diesem Objekt nicht untersttzt" ; + Text [ ENGLISH ] = "Object does not support OLE Automation" ; + Text [ norwegian ] = "Object does not support OLE Automation" ; + Text [ italian ] = "L'automatizzazione OLE non supportata dall'oggetto" ; + Text [ portuguese_brazilian ] = "Object does not support OLE Automation" ; + Text [ portuguese ] = "Este objecto no suporta a automatao OLE" ; + Text [ french ] = "Cet objet ne supporte pas l'automatisation OLE" ; + Text [ dutch ] = "OLE-automatisering wordt niet ondersteund door het aangegeven object" ; + Text [ spanish ] = "Este objeto no apoya la automatizacin OLE" ; + Text [ danish ] = "OLE-automatiseringen understttes ikke af dette objekt" ; + Text [ swedish ] = "OLE-automatiseringen stds ej av detta objekt" ; + Text [ finnish ] = "Object does not support OLE Automation" ; + Text [ english_us ] = "OLE Automation is not supported by this object" ; + Text[ chinese_simplified ] = "֧OLEԶ"; + Text[ russian ] = " OLE "; + Text[ polish ] = "Automatyzacja OLE nie jest obsugiwana przez ten obiekt"; + Text[ japanese ] = "OLE̵̎͂ުĂx܂"; + Text[ chinese_traditional ] = "oӪ䴩OLE۰ʤ"; + Text[ arabic ] = " OLE "; + Text[ dutch ] = "OLE-automatisering wordt niet ondersteund door het aangegeven object"; + Text[ chinese_simplified ] = "֧OLEԶ"; + Text[ greek ] = " OLE "; + Text[ korean ] = "OLE ڵȭ ü ʽϴ."; + Text[ turkish ] = "OLE otomasyonu bu nesne tarafndan desteklenmiyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_METHOD & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Objekt untersttzt diese Eigenschaft oder Methode nicht : Objekt untersttzt diese Eigenschaft oder Methode nicht */ + Text = "Objekt untersttzt diese Eigenschaft oder Methode nicht" ; + Text [ ENGLISH ] = "Object doesn't support property or method" ; + Text [ norwegian ] = "Object doesn't support property or method" ; + Text [ italian ] = "L'oggetto non supporta la propriet o il metodo" ; + Text [ portuguese_brazilian ] = "Object doesn't support property or method" ; + Text [ portuguese ] = "Objecto no suporta nem a caracterstica nem o mtodo" ; + Text [ french ] = "L'objet ne supporte pas cette proprit ou mthode" ; + Text [ dutch ] = "Deze eigenschap of methode wordt niet ondersteund door het aangegeven object" ; + Text [ spanish ] = "El objeto no apoya esta propiedad o mtodo" ; + Text [ danish ] = "Objektet understtter ikke denne egenskab eller metode" ; + Text [ swedish ] = "Objektet understdjer inte denna egenskap eller metod" ; + Text [ finnish ] = "Object doesn't support property or method" ; + Text [ english_us ] = "This property or method is not supported by the object" ; + Text[ chinese_simplified ] = "֧Ի"; + Text[ russian ] = " "; + Text[ polish ] = "Obiekt nie obsuguje tej waciwoci lub metody"; + Text[ japanese ] = "ުĂ͂è܂͕@xł܂"; + Text[ chinese_traditional ] = "oݩʩΤk"; + Text[ arabic ] = " "; + Text[ dutch ] = "Deze eigenschap of methode wordt niet ondersteund door het aangegeven object"; + Text[ chinese_simplified ] = "֧Ի"; + Text[ greek ] = " "; + Text[ korean ] = " Ƽ Ǵ ҵ ü ʽϴ."; + Text[ turkish ] = "Nesne bu zellii ya da yntemi desteklemiyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_OLE_ERROR & ERRCODE_RES_MASK + { + Text = "Fehler bei OLE-Automatisierung" ; + Text [ ENGLISH ] = "OLE Automation error" ; + Text [ norwegian ] = "OLE Automation error" ; + Text [ italian ] = "Errore nell'automatizzazione OLE" ; + Text [ portuguese_brazilian ] = "OLE Automation error" ; + Text [ portuguese ] = "Erro na automatao OLE" ; + Text [ french ] = "Erreur lors de l'automatisation OLE" ; + Text [ dutch ] = "Fout bij OLE-automatisering" ; + Text [ spanish ] = "Error en la automatizacin OLE" ; + Text [ danish ] = "Fejl ved OLE-automatisering" ; + Text [ swedish ] = "Fel vid OLE-automatisering" ; + Text [ finnish ] = "OLE Automation error" ; + Text [ english_us ] = "OLE Automation Error" ; + Text[ chinese_simplified ] = "OLE Զ"; + Text[ russian ] = " OLE"; + Text[ polish ] = "Bd przy automatyzacji OLE"; + Text[ japanese ] = "OLE̍ۂ̴װ"; + Text[ chinese_traditional ] = "OLE۰ʤƿ~"; + Text[ arabic ] = " OLE "; + Text[ dutch ] = "Fout bij OLE-automatisering"; + Text[ chinese_simplified ] = "OLE Զ"; + Text[ greek ] = " OLE"; + Text[ korean ] = "OLE ڵȭ "; + Text[ turkish ] = "OLE otomasyonunda hata"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_ACTION & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Diese Aktion wird vom angegebenen Objekt nicht untersttzt : Diese Aktion wird vom angegebenen Objekt nicht untersttzt */ + Text = "Diese Aktion wird vom angegebenen Objekt nicht untersttzt" ; + Text [ ENGLISH ] = "Object doesn't support this action" ; + Text [ norwegian ] = "Object doesn't support this action" ; + Text [ italian ] = "Azione non supportata dall'oggetto specificato" ; + Text [ portuguese_brazilian ] = "Object doesn't support this action" ; + Text [ portuguese ] = "O objecto indicado no suporta esta aco" ; + Text [ french ] = "L'objet indiqu ne supporte pas cette action" ; + Text [ dutch ] = "Deze activiteit wordt niet ondersteund door het aangegeven object" ; + Text [ spanish ] = "Esta accin no es apoyada por el objeto dado" ; + Text [ danish ] = "Denne handling understttes ikke at det angivne objekt." ; + Text [ swedish ] = "Denna tgrd understds inte av angivet objekt" ; + Text [ finnish ] = "Object doesn't support this action" ; + Text [ english_us ] = "This action is not supported by given object" ; + Text[ chinese_simplified ] = "Ķ֧"; + Text[ russian ] = " "; + Text[ polish ] = "Ta akcja nie jest obsugiwana przez podany obiekt"; + Text[ japanese ] = "̱݂͎w肳ꂽުĂx܂"; + Text[ chinese_traditional ] = "w䴩oӾާ@"; + Text[ arabic ] = " "; + Text[ dutch ] = "Deze activiteit wordt niet ondersteund door het aangegeven object"; + Text[ chinese_simplified ] = "Ķ֧"; + Text[ greek ] = " "; + Text[ korean ] = " ־ üؼ ʽϴ."; + Text[ turkish ] = "Bu ilem belirtilen nesne tarafndan desteklenmiyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_NAMED_ARGS & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Benannte Argumente werden vom angegebenen Objekt nicht untersttzt : Benannte Argumente werden vom angegebenen Objekt nicht untersttzt */ + Text = "Benannte Argumente werden vom angegebenen Objekt nicht untersttzt" ; + Text [ ENGLISH ] = "Object doesn't support named args" ; + Text [ norwegian ] = "Object doesn't support named args" ; + Text [ italian ] = "Gli argomenti indicati non vengono supportati dall'oggetto specificato" ; + Text [ portuguese_brazilian ] = "Object doesn't support named args" ; + Text [ portuguese ] = "O objecto indicado no suporta os argumentos mencionados" ; + Text [ french ] = "L'objet indiqu ne supporte pas les arguments cits" ; + Text [ dutch ] = "Genoemde argumenten wordt niet ondersteund door het aangegeven object" ; + Text [ spanish ] = "El objeto indicado no apoya los argumentos nombrados" ; + Text [ danish ] = "Nvnte argumenter understttes ikke af det angivne objekt" ; + Text [ swedish ] = "Angivna argument understds ej av angivet objekt" ; + Text [ finnish ] = "Object doesn't support named args" ; + Text [ english_us ] = "Named arguments are not supported by given object" ; + Text[ chinese_simplified ] = "ָ֧Ա"; + Text[ russian ] = " "; + Text[ polish ] = "Nazwane argumenty nie s obsugiwane przez podany obiekt"; + Text[ japanese ] = "wꂽ͎w肳ꂽުĂx܂"; + Text[ chinese_traditional ] = "wܶqw䴩"; + Text[ arabic ] = " "; + Text[ dutch ] = "Genoemde argumenten wordt niet ondersteund door het aangegeven object"; + Text[ chinese_simplified ] = "ָ֧Ա"; + Text[ greek ] = " "; + Text[ korean ] = " ־ ü ʽϴ."; + Text[ turkish ] = "Adlandrlm argmanlar, belirtilen nesne tarafndan desteklenmiyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_LOCALE & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Das aktuelle Gebietsschema wird vom angegebenen Objekt nicht untersttzt : Das aktuelle Gebietsschema wird vom angegebenen Objekt nicht untersttzt */ + Text = "Das aktuelle Gebietsschema wird vom angegebenen Objekt nicht untersttzt" ; + Text [ ENGLISH ] = "Object doesn't support current locale setting" ; + Text [ norwegian ] = "Object doesn't support current locale setting" ; + Text [ italian ] = "L'oggetto indicato non supporta l'attuale schema regionale" ; + Text [ portuguese_brazilian ] = "Object doesn't support current locale setting" ; + Text [ portuguese ] = "O objecto indicado no suporta a configurao local actual" ; + Text [ french ] = "L'objet indiqu ne supporte pas les paramtres rgionaux slectionns" ; + Text [ dutch ] = "Dit actuele gebiedschema wordt niet ondersteund door het aangegeven object" ; + Text [ spanish ] = "La configuracin local actual no es apoyada por el objeto dado" ; + Text [ danish ] = "Det aktuelle omrdeskema understttes ikke af det angivne objekt" ; + Text [ swedish ] = "De aktuella lokala instllningarna understds inte av angivet objekt" ; + Text [ finnish ] = "Object doesn't support current locale setting" ; + Text [ english_us ] = "The current locale setting is not supported by the given object" ; + Text[ chinese_simplified ] = "ǰľֲ趨ܸ֧"; + Text[ russian ] = " "; + Text[ polish ] = "Biece ustawienie lokalne nie jest obsugiwane przez podany obiekt"; + Text[ japanese ] = "݂۰ِݒ͎w肵ުĂx܂"; + Text[ chinese_traditional ] = "e]ww䴩"; + Text[ arabic ] = " "; + Text[ dutch ] = "Dit actuele gebiedschema wordt niet ondersteund door het aangegeven object"; + Text[ chinese_simplified ] = "ǰľֲ趨ܸ֧"; + Text[ greek ] = " "; + Text[ korean ] = " ־ üؼ ʽϴ."; + Text[ turkish ] = "Yrlkteki yerel ayarlar, belirtilen nesne tarafndan desteklenmiyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_NAMED_NOT_FOUND & ERRCODE_RES_MASK + { + Text = "Benanntes Argument nicht gefunden" ; + Text [ ENGLISH ] = "Named argument not found" ; + Text [ norwegian ] = "Named argument not found" ; + Text [ italian ] = "L'argomento indicato non stato trovato" ; + Text [ portuguese_brazilian ] = "Named argument not found" ; + Text [ portuguese ] = "Impossvel encontrar o argumento mencionado" ; + Text [ french ] = "L'argument cit est introuvable" ; + Text [ dutch ] = "Genoemd argument niet gevonden" ; + Text [ spanish ] = "No se encontr el argumento nombrado" ; + Text [ danish ] = "Det nvnte argument blev ikke fundet" ; + Text [ swedish ] = "Angivet argument hittades inte" ; + Text [ finnish ] = "Named argument not found" ; + Text [ english_us ] = "Named argument not found" ; + Text[ chinese_simplified ] = "ûҵָԱ"; + Text[ russian ] = " "; + Text[ polish ] = "Nazwanego argumentu nie znaleziono"; + Text[ japanese ] = "w͌܂"; + Text[ chinese_traditional ] = "Swܶq"; + Text[ arabic ] = " "; + Text[ dutch ] = "Genoemd argument niet gevonden"; + Text[ chinese_simplified ] = "ûҵָԱ"; + Text[ greek ] = " "; + Text[ korean ] = " ߰ߵ ʽϴ."; + Text[ turkish ] = "Adlandrlan argman bulunamad"; + Text[ language_user1 ] = " "; + }; + String SbERR_NOT_OPTIONAL & ERRCODE_RES_MASK + { + Text = "Argument ist nicht optional" ; + Text [ ENGLISH ] = "Argument not optional" ; + Text [ norwegian ] = "Argument not optional" ; + Text [ italian ] = "L'argomento non opzionale" ; + Text [ portuguese_brazilian ] = "Argument not optional" ; + Text [ portuguese ] = "Argumento no opcional" ; + Text [ french ] = "L'argument n'est pas facultatif" ; + Text [ dutch ] = "Argument niet optioneel" ; + Text [ spanish ] = "El argumento no es opcional" ; + Text [ danish ] = "Argumentet er ikke valgfrit" ; + Text [ swedish ] = "Argumentet r inte valfritt" ; + Text [ finnish ] = "Argument not optional" ; + Text [ english_us ] = "Argument is not optional" ; + Text[ chinese_simplified ] = "ǿѡԱ"; + Text[ russian ] = " "; + Text[ polish ] = "Argument nie jest opcjonalny"; + Text[ japanese ] = "͵݂ł͂܂"; + Text[ chinese_traditional ] = "Di諸ܶq"; + Text[ arabic ] = " "; + Text[ dutch ] = "Argument niet optioneel"; + Text[ chinese_simplified ] = "ǿѡԱ"; + Text[ greek ] = " "; + Text[ korean ] = " ɼ ƴմϴ."; + Text[ turkish ] = "Argman istee bal deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_WRONG_ARGS & ERRCODE_RES_MASK + { + Text = "Falsche Anzahl an Argumenten" ; + Text [ ENGLISH ] = "Wrong number of arguments" ; + Text [ norwegian ] = "Wrong number of arguments" ; + Text [ italian ] = "Numero di argomenti errato" ; + Text [ portuguese_brazilian ] = "Wrong number of arguments" ; + Text [ portuguese ] = "Nmero de argumentos incorrecto" ; + Text [ french ] = "Nombre d'arguments incorrect" ; + Text [ dutch ] = "Foutief aantal argumenten" ; + Text [ spanish ] = "Nmero errneo de argumentos" ; + Text [ danish ] = "Forkert antal argumenter" ; + Text [ swedish ] = "Felaktigt antal argument" ; + Text [ finnish ] = "Wrong number of arguments" ; + Text [ english_us ] = "Invalid number of arguments" ; + Text[ chinese_simplified ] = "ЧԱĿ"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowa ilo argumentw"; + Text[ japanese ] = "̐܂"; + Text[ chinese_traditional ] = "LĪܶqƥ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Foutief aantal argumenten"; + Text[ chinese_simplified ] = "ЧԱĿ"; + Text[ greek ] = " "; + Text[ korean ] = " Ʋ"; + Text[ turkish ] = "Argman says yanl"; + Text[ language_user1 ] = " "; + }; + String SbERR_NOT_A_COLL & ERRCODE_RES_MASK + { + Text = "Objekt ist keine Auflistung" ; + Text [ ENGLISH ] = "Object not a collection" ; + Text [ norwegian ] = "Object not a collection" ; + Text [ italian ] = "L'oggetto non un elenco" ; + Text [ portuguese_brazilian ] = "Object not a collection" ; + Text [ portuguese ] = "O objecto no uma lista" ; + Text [ french ] = "L'objet n'est pas une liste" ; + Text [ dutch ] = "Object is geen lijst" ; + Text [ spanish ] = "El objeto no es una lista" ; + Text [ danish ] = "Objektet er ingen liste" ; + Text [ swedish ] = "Objektet r ingen lista" ; + Text [ finnish ] = "Object not a collection" ; + Text [ english_us ] = "Object is not a list" ; + Text[ chinese_simplified ] = "һе"; + Text[ russian ] = " "; + Text[ polish ] = "Obiekt nie jest list"; + Text[ japanese ] = "ުĂؽĂł͂܂"; + Text[ chinese_traditional ] = "O@ӲM"; + Text[ arabic ] = " "; + Text[ dutch ] = "Object is geen lijst"; + Text[ chinese_simplified ] = "һе"; + Text[ greek ] = " "; + Text[ korean ] = "ü ϵ ʾҽϴ."; + Text[ turkish ] = "Nesne bir liste deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_ORDINAL & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Ordnungszahl ungltig : Ordnungszahl ungltig */ + Text = "Ordnungszahl ungltig" ; + Text [ ENGLISH ] = "Invalid ordinal" ; + Text [ norwegian ] = "Invalid ordinal" ; + Text [ italian ] = "Numero ordinale non valido" ; + Text [ portuguese_brazilian ] = "Invalid ordinal" ; + Text [ portuguese ] = "Ordinal incorrecto" ; + Text [ french ] = "Nombre ordinal non valable" ; + Text [ dutch ] = "Ongeldig ranggetal" ; + Text [ spanish ] = "Nmero ordinal no vlido" ; + Text [ danish ] = "Ugyldigt ordenstal" ; + Text [ swedish ] = "Ogiltigt ordningstal" ; + Text [ finnish ] = "Invalid ordinal" ; + Text [ english_us ] = "Invalid ordinal number" ; + Text[ chinese_simplified ] = "Ч"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowa liczba porzdkowa"; + Text[ japanese ] = "͖ł"; + Text[ chinese_traditional ] = "ǸL"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldig ranggetal"; + Text[ chinese_simplified ] = "Ч"; + Text[ greek ] = " "; + Text[ korean ] = "߸ "; + Text[ turkish ] = "Sra says geersiz"; + Text[ language_user1 ] = " "; + }; + String SbERR_DLLPROC_NOT_FOUND & ERRCODE_RES_MASK + { + Text = "Angegebene DLL-Funktion nicht gefunden" ; + Text [ ENGLISH ] = "Specified DLL function not found" ; + Text [ norwegian ] = "Specified DLL function not found" ; + Text [ italian ] = "Impossibile trovare la funzione DLL specificata" ; + Text [ portuguese_brazilian ] = "Specified DLL function not found" ; + Text [ portuguese ] = "Funo DLL especificada no foi encontrada" ; + Text [ french ] = "La fonction DLL indique est introuvable" ; + Text [ dutch ] = "Aangegeven DLL- functie niet gevonden" ; + Text [ spanish ] = "No se encontr la funcin DLL especificada" ; + Text [ danish ] = "Den angivne DDL-funktion blev ikke fundet" ; + Text [ swedish ] = "Angiven DLL-funktion hittades inte" ; + Text [ finnish ] = "Specified DLL function not found" ; + Text [ english_us ] = "Specified DLL function not found" ; + Text[ chinese_simplified ] = "ûҵָ DLL "; + Text[ russian ] = " DLL "; + Text[ polish ] = "Podanej funkcji DLL nie znaleziono"; + Text[ japanese ] = "w肳ꂽDLL@\\͌܂"; + Text[ chinese_traditional ] = "SwDLL\\"; + Text[ arabic ] = " DLL "; + Text[ dutch ] = "Aangegeven DLL- functie niet gevonden"; + Text[ chinese_simplified ] = "ûҵָ DLL "; + Text[ greek ] = " DLL"; + Text[ korean ] = " DLL Լ ߰ߵ ʾҽϴ."; + Text[ turkish ] = "Belirtilen DLL ilevi bulunamad"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_CLIPBD_FORMAT & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Ungltiges Clipboard-Format : Ungltiges Clipboard-Format */ + Text = "Ungltiges Clipboard-Format" ; + Text [ ENGLISH ] = "Invalid clipboard format" ; + Text [ norwegian ] = "Invalid clipboard format" ; + Text [ italian ] = "Formato clipboard non valido" ; + Text [ portuguese_brazilian ] = "Invalid clipboard format" ; + Text [ portuguese ] = "Formato da rea de transferncia no vlido" ; + Text [ french ] = "Le format de presse-papiers souhait est incorrect." ; + Text [ dutch ] = "Ongeldig Clipboard- formaat" ; + Text [ spanish ] = "Formato de portapapeles no vlido" ; + Text [ danish ] = "Ugyldigt udklipsholderformat" ; + Text [ swedish ] = "Ogiltigt urklippsformat" ; + Text [ finnish ] = "Invalid clipboard format" ; + Text [ english_us ] = "Invalid clipboard format" ; + Text[ chinese_simplified ] = "Чļʽ"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowy format schowka"; + Text[ japanese ] = "دްޏł"; + Text[ chinese_traditional ] = "LĪŶKï榡"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldig Clipboard- formaat"; + Text[ chinese_simplified ] = "Чļʽ"; + Text[ greek ] = " "; + Text[ korean ] = "ȿ Ŭ "; + Text[ turkish ] = "Geersiz pano format"; + Text[ language_user1 ] = " "; + }; + String SbERR_PROPERTY_NOT_FOUND & ERRCODE_RES_MASK + { + Text = "Objekt hat diese Eigenschaft nicht" ; + Text [ ENGLISH ] = "Object does not have property" ; + Text [ norwegian ] = "Object does not have property" ; + Text [ italian ] = "L'oggetto non dispone di questa propriet" ; + Text [ portuguese_brazilian ] = "Object does not have property" ; + Text [ portuguese ] = "O objecto no tem esta propriedade" ; + Text [ french ] = "L'objet ne possde pas cette proprit" ; + Text [ dutch ] = "Object heeft deze eigenschap niet" ; + Text [ spanish ] = "El objeto no tiene esta propiedad" ; + Text [ danish ] = "Objektet har ikke denne egenskab" ; + Text [ swedish ] = "Objektet har inte denna egenskap" ; + Text [ finnish ] = "Object does not have property" ; + Text [ english_us ] = "Object does not have this property" ; + Text[ chinese_simplified ] = "߱"; + Text[ russian ] = " "; + Text[ polish ] = "Obiekt nie ma tej waciwoci"; + Text[ japanese ] = "ުĂɂ̑͂܂"; + Text[ chinese_traditional ] = "Ƴoݩ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Object heeft deze eigenschap niet"; + Text[ chinese_simplified ] = "߱"; + Text[ greek ] = " "; + Text[ korean ] = "ü Ƽ ʽϴ."; + Text[ turkish ] = "Nesne bu zellie sahip deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_METHOD_NOT_FOUND & ERRCODE_RES_MASK + { + Text = "Objekt hat diese Methode nicht" ; + Text [ ENGLISH ] = "Object does not have method" ; + Text [ norwegian ] = "Object does not have method" ; + Text [ italian ] = "L'oggetto non dispone di questo metodo" ; + Text [ portuguese_brazilian ] = "Object does not have method" ; + Text [ portuguese ] = "O objecto no dispe deste mtodo" ; + Text [ french ] = "L'objet ne possde pas cette mthode" ; + Text [ dutch ] = "Object kent deze methode niet" ; + Text [ spanish ] = "El objeto no tiene este mtodo" ; + Text [ danish ] = "Objekt har ikke denne metode" ; + Text [ swedish ] = "Objektet har inte denna metod" ; + Text [ finnish ] = "Object does not have method" ; + Text [ english_us ] = "Object does not have this method" ; + Text[ chinese_simplified ] = "߱"; + Text[ russian ] = " "; + Text[ polish ] = "Obiekt nie ma tej metody"; + Text[ japanese ] = "ުĂɂҿނ͂܂"; + Text[ chinese_traditional ] = "ƳoӤk"; + Text[ arabic ] = " "; + Text[ dutch ] = "Object kent deze methode niet"; + Text[ chinese_simplified ] = "߱"; + Text[ greek ] = " "; + Text[ korean ] = "ü ҵ带 ʽϴ."; + Text[ turkish ] = "Nesne bu ynteme sahip deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_ARG_MISSING & ERRCODE_RES_MASK + { + Text = "Erforderliches Argument fehlt" ; + Text [ ENGLISH ] = "Missing required argument" ; + Text [ norwegian ] = "Missing required argument" ; + Text [ italian ] = "L'argomento richiesto manca" ; + Text [ portuguese_brazilian ] = "Missing required argument" ; + Text [ portuguese ] = "Falta o argumento necessrio" ; + Text [ french ] = "L'argument requis fait dfaut" ; + Text [ dutch ] = "Noordzakelijk argument ontbreekt" ; + Text [ spanish ] = "Falta el argumento requerido" ; + Text [ danish ] = "Pkrvet argument mangler" ; + Text [ swedish ] = "Ndvndigt argument saknas" ; + Text [ finnish ] = "Missing required argument" ; + Text [ english_us ] = "Required argument lacking" ; + Text[ chinese_simplified ] = "ȱٱҪԱ"; + Text[ russian ] = " "; + Text[ polish ] = "Brakuje wymaganego argumentu"; + Text[ japanese ] = "KvȈ܂"; + Text[ chinese_traditional ] = "ʤ֥nܶq"; + Text[ arabic ] = " "; + Text[ dutch ] = "Noordzakelijk argument ontbreekt"; + Text[ chinese_simplified ] = "ȱٱҪԱ"; + Text[ greek ] = " "; + Text[ korean ] = "û ϴ"; + Text[ turkish ] = "Gerekli argman eksik"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_NUMBER_OF_ARGS & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Ungltige Anzahl von Argumenten : Ungltige Anzahl von Argumenten */ + Text = "Ungltige Anzahl von Argumenten" ; + Text [ ENGLISH ] = "Invalid number of arguments" ; + Text [ norwegian ] = "Invalid number of arguments" ; + Text [ italian ] = "Numero di argomenti non valido" ; + Text [ portuguese_brazilian ] = "Invalid number of arguments" ; + Text [ portuguese ] = "Nmero de argumentos incorrecto" ; + Text [ french ] = "Nombre d'arguments incorrect" ; + Text [ dutch ] = "Ongeldig aantal argumenten" ; + Text [ spanish ] = "Nmero de argumentos no vlido" ; + Text [ danish ] = "Ugyldigt antal argumenter" ; + Text [ swedish ] = "Ogiltigt antal argument" ; + Text [ finnish ] = "Invalid number of arguments" ; + Text [ english_us ] = "Invalid number of arguments" ; + Text[ chinese_simplified ] = "ЧԱĿ"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowa ilo argumentw"; + Text[ japanese ] = "̐ɖ肪܂"; + Text[ chinese_traditional ] = "ܶqƥصL"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldig aantal argumenten"; + Text[ chinese_simplified ] = "ЧԱĿ"; + Text[ greek ] = " "; + Text[ korean ] = " ȿ "; + Text[ turkish ] = "Argman says geersiz"; + Text[ language_user1 ] = " "; + }; + String SbERR_METHOD_FAILED & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Fehler in Ausfhrung einer Methode : Fehler in Ausfhrung einer Methode */ + Text = "Fehler in Ausfhrung einer Methode" ; + Text [ ENGLISH ] = "Method failed" ; + Text [ norwegian ] = "Method failed" ; + Text [ italian ] = "Errore nell'esecuzione di un metodo" ; + Text [ portuguese_brazilian ] = "Method failed" ; + Text [ portuguese ] = "Erro ao executar mtodo" ; + Text [ french ] = "Erreur dans l'excution d'une mthode" ; + Text [ dutch ] = "Fout in uitvoering van een methode" ; + Text [ spanish ] = "Error al ejecutar un mtodo" ; + Text [ danish ] = "Fejl ved udfrelsen af en metode" ; + Text [ swedish ] = "Fel vid utfrandet av en metod" ; + Text [ finnish ] = "Method failed" ; + Text [ english_us ] = "Error executing a method" ; + Text[ chinese_simplified ] = "зʱ"; + Text[ russian ] = " "; + Text[ polish ] = "Bd w wykonywaniu metody"; + Text[ japanese ] = "ҿގs̴װ"; + Text[ chinese_traditional ] = "BkɵoͿ~"; + Text[ arabic ] = " "; + Text[ dutch ] = "Fout in uitvoering van een methode"; + Text[ chinese_simplified ] = "зʱ"; + Text[ greek ] = " "; + Text[ korean ] = "ҵ "; + Text[ turkish ] = "Yntemin yrtlmesinde hata"; + Text[ language_user1 ] = " "; + }; + String SbERR_SETPROP_FAILED & ERRCODE_RES_MASK + { + Text = "Eigenschaft konnte nicht festgelegt werden" ; + Text [ ENGLISH ] = "Unable to set property" ; + Text [ norwegian ] = "Unable to set property" ; + Text [ italian ] = "Impossibile impostare la propriet" ; + Text [ portuguese_brazilian ] = "Unable to set property" ; + Text [ portuguese ] = "Foi impossvel definir propriedade" ; + Text [ french ] = "Impossible de dfinir la proprit" ; + Text [ dutch ] = "Eigenschap kon niet worden gedefinieerd" ; + Text [ spanish ] = "No se pudo determinar la propiedad" ; + Text [ danish ] = "Det var ikke muligt at definere egenskaben" ; + Text [ swedish ] = "Egenskap kunde inte definieras" ; + Text [ finnish ] = "Unable to set property" ; + Text [ english_us ] = "Unable to set property" ; + Text[ chinese_simplified ] = "ȷ"; + Text[ russian ] = " "; + Text[ polish ] = "Waciwo nie moga zosta zdefiniowana"; + Text[ japanese ] = "͎wł܂ł"; + Text[ chinese_traditional ] = "LkTwݩ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Eigenschap kon niet worden gedefinieerd"; + Text[ chinese_simplified ] = "ȷ"; + Text[ greek ] = " "; + Text[ korean ] = "Ƽ Ҽ ϴ."; + Text[ turkish ] = "zellik tanmlanamad"; + Text[ language_user1 ] = " "; + }; + String SbERR_GETPROP_FAILED & ERRCODE_RES_MASK + { + Text = "Eigenschaft konnte nicht ermittelt werden" ; + Text [ ENGLISH ] = "Unable to get property" ; + Text [ norwegian ] = "Unable to get property" ; + Text [ italian ] = "Impossibile individuare la propriet" ; + Text [ portuguese_brazilian ] = "Unable to get property" ; + Text [ portuguese ] = "Foi impossvel determinar a propriedade" ; + Text [ french ] = "Impossible de dterminer la proprit" ; + Text [ dutch ] = "Eigenschap kon niet worden vastgesteld" ; + Text [ spanish ] = "No se pudo determinar la propiedad" ; + Text [ danish ] = "Det var ikke muligt at bestemme egenskaben" ; + Text [ swedish ] = "Egenskaperna kunde inte bestmmas" ; + Text [ finnish ] = "Unable to get property" ; + Text [ english_us ] = "Unable to determine property" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Waciwo nie moga zosta zdefiniowana"; + Text[ japanese ] = "͊m߂邱Ƃł܂ł"; + Text[ chinese_traditional ] = "LkŪXݩ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Eigenschap kon niet worden vastgesteld"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "Ƽ Ҽ ϴ."; + Text[ turkish ] = "zellik belirlenemedi"; + Text[ language_user1 ] = " "; + }; + // Compiler errors. These are not runtime errors. + String SbERR_UNEXPECTED & ERRCODE_RES_MASK + { + Text = "Unerwartetes Symbol: $(ARG1)" ; + Text [ ENGLISH ] = "Unexpected symbol: $(ARG1)" ; + Text [ norwegian ] = "Unexpected symbol: $(ARG1)" ; + Text [ italian ] = "Simbolo inatteso: $(ARG1)" ; + Text [ portuguese_brazilian ] = "Unexpected symbol: $(ARG1)" ; + Text [ portuguese ] = "Smbolo inesperado: $(ARG1)" ; + Text [ french ] = "Symbole imprvu : $(ARG1)" ; + Text [ dutch ] = "Onverwacht symbool: $(ARG1)" ; + Text [ spanish ] = "Smbolo inesperado: $(ARG1)" ; + Text [ danish ] = "Uventet symbol: $(ARG1)" ; + Text [ swedish ] = "Ovntad symbol: $(ARG1)" ; + Text [ finnish ] = "Unexpected symbol: $(ARG1)" ; + Text [ english_us ] = "Unexpected symbol: $(ARG1)" ; + Text[ chinese_simplified ] = "ͼ꣺$(ARG1)"; + Text[ russian ] = " : $(ARG1)"; + Text[ polish ] = "Nieoczekiwany symbol: $(ARG1)"; + Text[ japanese ] = "sKȼ: $(ARG1)"; + Text[ chinese_traditional ] = "N~ϥܡG$(ARG1)"; + Text[ arabic ] = "$(ARG1) : "; + Text[ dutch ] = "Onverwacht symbool: $(ARG1)"; + Text[ chinese_simplified ] = "ͼ꣺$(ARG1)"; + Text[ greek ] = " : $(ARG1)"; + Text[ korean ] = " ȣ : $(ARG1)"; + Text[ turkish ] = "Beklenmeyen simge: $(ARG1)"; + Text[ language_user1 ] = " "; + }; + String SbERR_EXPECTED & ERRCODE_RES_MASK + { + Text = "Erwartet: $(ARG1)" ; + Text [ ENGLISH ] = "Expected: $(ARG1)" ; + Text [ norwegian ] = "Expected: $(ARG1)" ; + Text [ italian ] = "Atteso: $(ARG1)" ; + Text [ portuguese_brazilian ] = "Expected: $(ARG1)" ; + Text [ portuguese ] = "Esperado: $(ARG1)" ; + Text [ french ] = "Requis : $(ARG1)" ; + Text [ dutch ] = "Verwacht: $(ARG1)" ; + Text [ spanish ] = "Se espera: $(ARG1)" ; + Text [ danish ] = "Forventet: $(ARG1)" ; + Text [ swedish ] = "Frvntad: $(ARG1)" ; + Text [ finnish ] = "Expected: $(ARG1)" ; + Text [ english_us ] = "Expected: $(ARG1)" ; + Text[ chinese_simplified ] = "ȴ$(ARG1)"; + Text[ russian ] = ": $(ARG1)"; + Text[ polish ] = "Oczekiwany: $(ARG1)"; + Text[ japanese ] = "Kv: $(ARG1)"; + Text[ chinese_traditional ] = "ݡG$(ARG1)"; + Text[ arabic ] = "$(ARG1) :"; + Text[ dutch ] = "Verwacht: $(ARG1)"; + Text[ chinese_simplified ] = "ȴ$(ARG1)"; + Text[ greek ] = ": $(ARG1)"; + Text[ korean ] = ": $(ARG1)"; + Text[ turkish ] = "Beklenen: $(ARG1)"; + Text[ language_user1 ] = " "; + }; + String SbERR_SYMBOL_EXPECTED & ERRCODE_RES_MASK + { + Text = "Symbol erwartet" ; + Text [ ENGLISH ] = "Symbol expected" ; + Text [ norwegian ] = "Symbol expected" ; + Text [ italian ] = "Simbolo atteso" ; + Text [ portuguese_brazilian ] = "Symbol expected" ; + Text [ portuguese ] = "Smbolo esperado" ; + Text [ french ] = "Symbole requis" ; + Text [ dutch ] = "Symbool verwacht" ; + Text [ spanish ] = "Smbolo esperado" ; + Text [ danish ] = "Symbol forventes" ; + Text [ swedish ] = "Symbol frvntad" ; + Text [ finnish ] = "Symbol expected" ; + Text [ english_us ] = "Symbol expected" ; + Text[ chinese_simplified ] = "ȴͼ"; + Text[ russian ] = " "; + Text[ polish ] = "Oczekiwany symbol"; + Text[ japanese ] = "قKvł"; + Text[ chinese_traditional ] = "ݹϥ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Symbool verwacht"; + Text[ chinese_simplified ] = "ȴͼ"; + Text[ greek ] = " "; + Text[ korean ] = " ȣ"; + Text[ turkish ] = "Simge bekleniyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_VAR_EXPECTED & ERRCODE_RES_MASK + { + Text = "Variable erwartet" ; + Text [ ENGLISH ] = "Variable expected" ; + Text [ norwegian ] = "Variable expected" ; + Text [ italian ] = "Variabile attesa" ; + Text [ portuguese_brazilian ] = "Variable expected" ; + Text [ portuguese ] = "Varivel esperada" ; + Text [ french ] = "Variable requise" ; + Text [ dutch ] = "Variabele verwacht" ; + Text [ spanish ] = "Se requiere una variable" ; + Text [ danish ] = "Variabel forventes" ; + Text [ swedish ] = "Variabel frvntad" ; + Text [ finnish ] = "Variable expected" ; + Text [ english_us ] = "Variable expected" ; + Text[ chinese_simplified ] = "ȴ"; + Text[ russian ] = " "; + Text[ polish ] = "Zmienna oczekiwana"; + Text[ japanese ] = "ϐKvł"; + Text[ chinese_traditional ] = "ܶq"; + Text[ arabic ] = " "; + Text[ dutch ] = "Variabele verwacht"; + Text[ chinese_simplified ] = "ȴ"; + Text[ greek ] = " "; + Text[ korean ] = " "; + Text[ turkish ] = "Deiken bekleniyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_LABEL_EXPECTED & ERRCODE_RES_MASK + { + Text = "Label erwartet" ; + Text [ ENGLISH ] = "Label expected" ; + Text [ norwegian ] = "Label expected" ; + Text [ italian ] = "Label attesa" ; + Text [ portuguese_brazilian ] = "Label expected" ; + Text [ portuguese ] = "Etiqueta esperada" ; + Text [ french ] = "tiquette requise" ; + Text [ dutch ] = "Label verwacht" ; + Text [ spanish ] = "Se requiere una etiqueta" ; + Text [ danish ] = "Etiket forventes" ; + Text [ swedish ] = "Etikett frvntad" ; + Text [ finnish ] = "Label expected" ; + Text [ english_us ] = "Label expected" ; + Text[ chinese_simplified ] = "ȴ"; + Text[ russian ] = " "; + Text[ polish ] = "Oczekiwana etykieta"; + Text[ japanese ] = "قKvł"; + Text[ chinese_traditional ] = "ݼи"; + Text[ arabic ] = " "; + Text[ dutch ] = "Label verwacht"; + Text[ chinese_simplified ] = "ȴ"; + Text[ greek ] = " "; + Text[ korean ] = " "; + Text[ turkish ] = "Etiket bekleniyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_LVALUE_EXPECTED & ERRCODE_RES_MASK + { + Text = "Wert kann nicht zugewiesen werden" ; + Text [ ENGLISH ] = "Cannot set value" ; + Text [ norwegian ] = "Cannot set value" ; + Text [ italian ] = "Impossibile attribuitre il valore" ; + Text [ portuguese_brazilian ] = "Cannot set value" ; + Text [ portuguese ] = "Impossvel atribuir o valor" ; + Text [ french ] = "Impossible d'attribuer la valeur" ; + Text [ dutch ] = "Waarde kan niet worden toegewezen" ; + Text [ spanish ] = "No se puede asignar el valor" ; + Text [ danish ] = "Vrdien kan ikke tildeles" ; + Text [ swedish ] = "Vrdet kan inte tilldelas" ; + Text [ finnish ] = "Cannot set value" ; + Text [ english_us ] = "Value cannot be applied" ; + Text[ chinese_simplified ] = "ֵָ"; + Text[ russian ] = " "; + Text[ polish ] = "Nie mona zastosowa wartoci"; + Text[ japanese ] = "l͊蓖Ă܂"; + Text[ chinese_traditional ] = "Lkwƭ"; + Text[ arabic ] = " "; + Text[ dutch ] = "Waarde kan niet worden toegewezen"; + Text[ chinese_simplified ] = "ֵָ"; + Text[ greek ] = " "; + Text[ korean ] = " ϴ."; + Text[ turkish ] = "Deer atanamyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_VAR_DEFINED & ERRCODE_RES_MASK + { + Text = "Variable $(ARG1) bereits definiert" ; + Text [ ENGLISH ] = "Variable $(ARG1) already defined" ; + Text [ norwegian ] = "Variable $(ARG1) already defined" ; + Text [ italian ] = "Variabile $(ARG1) gi definita" ; + Text [ portuguese_brazilian ] = "Variable $(ARG1) already defined" ; + Text [ portuguese ] = "Varivel $(ARG1) j definida" ; + Text [ french ] = "La variable $(ARG1) est dj dfinie" ; + Text [ dutch ] = "Variabele $(ARG1) reeds gedefinieerd" ; + Text [ spanish ] = "La variable $(ARG1) ya se ha definido" ; + Text [ danish ] = "Variabel $(ARG1) er allerede defineret" ; + Text [ swedish ] = "Variabeln $(ARG1) r redan definierad" ; + Text [ finnish ] = "Variable $(ARG1) already defined" ; + Text [ english_us ] = "Variable $(ARG1) already defined" ; + Text[ chinese_simplified ] = "Ѿ˱ $(ARG1)"; + Text[ russian ] = " $(ARG1) "; + Text[ polish ] = "Zmienna $(ARG1) ju zdefiniowana"; + Text[ japanese ] = "ϐ$(ARG1)͂łɒ`Ă܂"; + Text[ chinese_traditional ] = "wgwqFܶq $(ARG1)"; + Text[ arabic ] = " $(ARG1) "; + Text[ dutch ] = "Variabele $(ARG1) reeds gedefinieerd"; + Text[ chinese_simplified ] = "Ѿ˱ $(ARG1)"; + Text[ greek ] = " $(ARG1) "; + Text[ korean ] = "$(ARG1) ̹ ǵǾֽϴ."; + Text[ turkish ] = "Deiken $(ARG1) tanmlanm durumda"; + Text[ language_user1 ] = " "; + }; + String SbERR_PROC_DEFINED & ERRCODE_RES_MASK + { + Text = "Sub- oder Function-Prozedur $(ARG1) bereits definiert" ; + Text [ ENGLISH ] = "Procedure $(ARG1) already defined" ; + Text [ norwegian ] = "Procedure $(ARG1) already defined" ; + Text [ italian ] = "Procedura subordinata o di funzione $(ARG1) gi definita" ; + Text [ portuguese_brazilian ] = "Procedure $(ARG1) already defined" ; + Text [ portuguese ] = "Procedimento subordinado ou de funo $(ARG1) j definidos" ; + Text [ french ] = "La sous-procdure ou procdure fonctionnelle $(ARG1) est dj dfinie" ; + Text [ dutch ] = "Sub- of functieprocedure $(ARG1) reeds gedefinieerd" ; + Text [ spanish ] = "El procedimiento de funcin o subordinado $(ARG1) ya est definido" ; + Text [ danish ] = "Under- eller funktionsprocedure $(ARG1) er allerede defineret" ; + Text [ swedish ] = "Sub- eller funktionsproceduren $(ARG1) r redan definierad" ; + Text [ finnish ] = "Procedure $(ARG1) already defined" ; + Text [ english_us ] = "Sub procedure or function procedure $(ARG1) already defined" ; + Text[ chinese_simplified ] = "Ѿ˷ֹ̻ $(ARG1)"; + Text[ russian ] = " $(ARG1) "; + Text[ polish ] = "Procedura podrzdna lub funkcyjna ju zostaa zdefiniowana $(ARG1)"; + Text[ japanese ] = "Sub܂Functionۼެ$(ARG1)͂łɒ`Ă܂"; + Text[ chinese_traditional ] = "wgwqFL{ΨƹL{$(ARG1)"; + Text[ arabic ] = " $(ARG1) "; + Text[ dutch ] = "Sub- of functieprocedure $(ARG1) reeds gedefinieerd"; + Text[ chinese_simplified ] = "Ѿ˷ֹ̻ $(ARG1)"; + Text[ greek ] = " (Sub) (Function) $(ARG1) "; + Text[ korean ] = " Ǵ Լ ν $(ARG1) ̹ Ǿֽϴ"; + Text[ turkish ] = "Alt yordam ya da ilev yordam $(ARG1) tanmlanm durumda"; + Text[ language_user1 ] = " "; + }; + String SbERR_LABEL_DEFINED & ERRCODE_RES_MASK + { + Text = "Label $(ARG1) bereits definiert" ; + Text [ ENGLISH ] = "Label $(ARG1) already defined" ; + Text [ norwegian ] = "Label $(ARG1) already defined" ; + Text [ italian ] = "Label $(ARG1) gi definita" ; + Text [ portuguese_brazilian ] = "Label $(ARG1) already defined" ; + Text [ portuguese ] = "Etiqueta $(ARG1) j foi definida" ; + Text [ french ] = "L'tiquette $(ARG1) est dj dfinie" ; + Text [ dutch ] = "Label $(ARG1) reeds gedefinieerd" ; + Text [ spanish ] = "La etiqueta $(ARG1) ya est definida" ; + Text [ danish ] = "Etiket $(ARG1) er allerede defineret" ; + Text [ swedish ] = "Etiketten $(ARG1) r redan definierad" ; + Text [ finnish ] = "Label $(ARG1) already defined" ; + Text [ english_us ] = "Label $(ARG1) already defined" ; + Text[ chinese_simplified ] = "Ѿ˱ $(ARG1)"; + Text[ russian ] = " $(ARG1) "; + Text[ polish ] = "Etykieta $(ARG1) zostaa ju zdefiniowana"; + Text[ japanese ] = "$(ARG1)͂łɒ`Ă܂"; + Text[ chinese_traditional ] = "wgwqFаO$(ARG1)"; + Text[ arabic ] = " $(ARG1) "; + Text[ dutch ] = "Label $(ARG1) reeds gedefinieerd"; + Text[ chinese_simplified ] = "Ѿ˱ $(ARG1)"; + Text[ greek ] = " $(ARG1) "; + Text[ korean ] = " $(ARG1) ̹ Ǿֽϴ."; + Text[ turkish ] = "Etiket $(ARG1) tanmlanm durumda"; + Text[ language_user1 ] = " "; + }; + String SbERR_UNDEF_VAR & ERRCODE_RES_MASK + { + Text = "Variable $(ARG1) nicht gefunden" ; + Text [ ENGLISH ] = "Variable $(ARG1) not found" ; + Text [ norwegian ] = "Variable $(ARG1) not found" ; + Text [ italian ] = "Variabile $(ARG1) non trovata" ; + Text [ portuguese_brazilian ] = "Variable $(ARG1) not found" ; + Text [ portuguese ] = "Varivel $(ARG1) no encontrada" ; + Text [ french ] = "Variable $(ARG1) introuvable" ; + Text [ dutch ] = "Variabele $(ARG1) niet gevonden" ; + Text [ spanish ] = "No se encontr la variable $(ARG1)" ; + Text [ danish ] = "Variabel $(ARG1) blev ikke fundet" ; + Text [ swedish ] = "Variabeln $(ARG1) hittades inte" ; + Text [ finnish ] = "Variable $(ARG1) not found" ; + Text [ english_us ] = "Variable $(ARG1) not found" ; + Text[ chinese_simplified ] = "ûҵ $(ARG1)"; + Text[ russian ] = " $(ARG1) "; + Text[ polish ] = "Zmiennej $(ARG1) nie znaleziono"; + Text[ japanese ] = "ϐ$(ARG1)͌܂"; + Text[ chinese_traditional ] = "Sܶq$(ARG1)"; + Text[ arabic ] = " $(ARG1) "; + Text[ dutch ] = "Variabele $(ARG1) niet gevonden"; + Text[ chinese_simplified ] = "ûҵ $(ARG1)"; + Text[ greek ] = " $(ARG1) "; + Text[ korean ] = " $(ARG1) ߰ߵ ʾҽϴ."; + Text[ turkish ] = "Deiken $(ARG1) bulunamad"; + Text[ language_user1 ] = " "; + }; + String SbERR_UNDEF_ARRAY & ERRCODE_RES_MASK + { + Text = "Array oder Prozedur $(ARG1) nicht gefunden" ; + Text [ ENGLISH ] = "Array or function $(ARG1) not found" ; + Text [ norwegian ] = "Array or function $(ARG1) not found" ; + Text [ italian ] = "Array o procedura $(ARG1) non trovata" ; + Text [ portuguese_brazilian ] = "Array or function $(ARG1) not found" ; + Text [ portuguese ] = "Matriz ou funo $(ARG1) no encontrados" ; + Text [ french ] = "Array ou procdure $(ARG1) introuvable" ; + Text [ dutch ] = "Array of procedure $(ARG1) niet gevonden" ; + Text [ spanish ] = "No se encontr la matriz o procedimiento $(ARG1)" ; + Text [ danish ] = "Array eller procedure $(ARG1) blev ikke fundet" ; + Text [ swedish ] = "Array eller procedur $(ARG1) hittades inte" ; + Text [ finnish ] = "Array or function $(ARG1) not found" ; + Text [ english_us ] = "Array or procedure $(ARG1) not found" ; + Text[ chinese_simplified ] = "ûҵ $(ARG1)"; + Text[ russian ] = " $(ARG1) "; + Text[ polish ] = "Tablicy lub procedury $(ARG1) nie znaleziono"; + Text[ japanese ] = "z܂ۼެ$(ARG1)͌܂"; + Text[ chinese_traditional ] = "SCιL{$(ARG1)"; + Text[ arabic ] = "$(ARG1) "; + Text[ dutch ] = "Array of procedure $(ARG1) niet gevonden"; + Text[ chinese_simplified ] = "ûҵ $(ARG1)"; + Text[ greek ] = " $(ARG1)"; + Text[ korean ] = "迭 Ǵ Լ $(ARG1) ߰ߵ ʾҽϴ. "; + Text[ turkish ] = "Dizi ya da yordam $(ARG1) bulunamad"; + Text[ language_user1 ] = " "; + }; + String SbERR_UNDEF_PROC & ERRCODE_RES_MASK + { + Text = "Procedure $(ARG1) nicht gefunden" ; + Text [ ENGLISH ] = "Procedure $(ARG1) not found" ; + Text [ norwegian ] = "Procedure $(ARG1) not found" ; + Text [ italian ] = "Procedura $(ARG1) non trovata" ; + Text [ portuguese_brazilian ] = "Procedure $(ARG1) not found" ; + Text [ portuguese ] = "Procedimento $(ARG1) no encontrado" ; + Text [ french ] = "Procdure $(ARG1) introuvable" ; + Text [ dutch ] = "Procedure $(ARG1) niet gevonden" ; + Text [ spanish ] = "No se encontr el procedimiento $(ARG1)" ; + Text [ danish ] = "Procedure $(ARG1) blev ikke fundet" ; + Text [ swedish ] = "Proceduren $(ARG1) hittades inte" ; + Text [ finnish ] = "Procedure $(ARG1) not found" ; + Text [ english_us ] = "Procedure $(ARG1) not found" ; + Text[ chinese_simplified ] = "ûҵ $(ARG1)"; + Text[ russian ] = " $(ARG1) "; + Text[ polish ] = "Procedury $(ARG1) nie znaleziono"; + Text[ japanese ] = "ۼެ$(ARG1)͌܂"; + Text[ chinese_traditional ] = "SL{$(ARG1)"; + Text[ arabic ] = "$(ARG1) "; + Text[ dutch ] = "Procedure $(ARG1) niet gevonden"; + Text[ chinese_simplified ] = "ûҵ $(ARG1)"; + Text[ greek ] = " $(ARG1) "; + Text[ korean ] = "ν $(ARG1) ߰ߵ ʾҽϴ."; + Text[ turkish ] = "Yordam $(ARG1) bulunamad"; + Text[ language_user1 ] = " "; + }; + String SbERR_UNDEF_LABEL & ERRCODE_RES_MASK + { + Text = "Label $(ARG1) undefiniert" ; + Text [ ENGLISH ] = "Label $(ARG1) undefined" ; + Text [ norwegian ] = "Label $(ARG1) undefined" ; + Text [ italian ] = "Label $(ARG1) non definita" ; + Text [ portuguese_brazilian ] = "Label $(ARG1) undefined" ; + Text [ portuguese ] = "Rtulo $(ARG1) indefinido" ; + Text [ french ] = "L'tiquette $(ARG1) n'est pas dfinie" ; + Text [ dutch ] = "Label $(ARG1) ongedefinieerd" ; + Text [ spanish ] = "La etiqueta $(ARG1) no est definida" ; + Text [ danish ] = "Etket $(ARG1) er udefineret" ; + Text [ swedish ] = "Etiketten $(ARG1) r odefinierad" ; + Text [ finnish ] = "Label $(ARG1) undefined" ; + Text [ english_us ] = "Label $(ARG1) undefined" ; + Text[ chinese_simplified ] = "δ $(ARG1)"; + Text[ russian ] = " $(ARG1) "; + Text[ polish ] = "Etykieta $(ARG1) nie jest zdefionowana"; + Text[ japanese ] = "$(ARG1)͒`Ă܂"; + Text[ chinese_traditional ] = "|wqаO$(ARG1)"; + Text[ arabic ] = " $(ARG1) "; + Text[ dutch ] = "Label $(ARG1) ongedefinieerd"; + Text[ chinese_simplified ] = "δ $(ARG1)"; + Text[ greek ] = " $(ARG1)"; + Text[ korean ] = " $(ARG1) ǵ ʾҽϴ."; + Text[ turkish ] = "Etiket $(ARG1) tanmlanmad"; + Text[ language_user1 ] = " "; + }; + String SbERR_UNDEF_TYPE & ERRCODE_RES_MASK + { + Text = "Unbekannter Datentyp $(ARG1)" ; + Text [ ENGLISH ] = "Unknown data type $(ARG1)" ; + Text [ norwegian ] = "Unknown data type $(ARG1)" ; + Text [ italian ] = "Tipo di dati $(ARG1) sconosciuto" ; + Text [ portuguese_brazilian ] = "Unknown data type $(ARG1)" ; + Text [ portuguese ] = "Tipo de dados $(ARG1) desconhecido" ; + Text [ french ] = "Type de donnes $(ARG1) inconnu" ; + Text [ dutch ] = "Onbekend gegevenstype $(ARG1)" ; + Text [ spanish ] = "Tipo de datos $(ARG1) desconocido" ; + Text [ danish ] = "Ukendt datatype $(ARG1)" ; + Text [ swedish ] = "Oknd datatyp $(ARG1)" ; + Text [ finnish ] = "Unknown data type $(ARG1)" ; + Text [ english_us ] = "Unknown data type $(ARG1)" ; + Text[ chinese_simplified ] = " $(ARG1)"; + Text[ russian ] = " $(ARG1)"; + Text[ polish ] = "Nieznany typ danych $(ARG1)"; + Text[ japanese ] = "sް̎$(ARG1)"; + Text[ chinese_traditional ] = " $(ARG1)"; + Text[ arabic ] = "$(ARG1) "; + Text[ dutch ] = "Onbekend gegevenstype $(ARG1)"; + Text[ chinese_simplified ] = " $(ARG1)"; + Text[ greek ] = " $(ARG1)"; + Text[ korean ] = "˷ Ÿ $(ARG1)"; + Text[ turkish ] = "Bilinmeyen veri tipi $(ARG1)"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_EXIT & ERRCODE_RES_MASK + { + Text = "Exit $(ARG1) erwartet" ; + Text [ ENGLISH ] = "Exit $(ARG1) erwartet" ; + Text [ norwegian ] = "Exit $(ARG1) erwartet" ; + Text [ italian ] = "Exit $(ARG1) atteso" ; + Text [ portuguese_brazilian ] = "Exit $(ARG1) erwartet" ; + Text [ portuguese ] = "Sada de $(ARG1) esperada" ; + Text [ french ] = "Exit $(ARG1) requis" ; + Text [ dutch ] = "Exit $(ARG1) verwacht" ; + Text [ spanish ] = "Se requiere salida $(ARG1)" ; + Text [ danish ] = "Exit $(ARG1) forventes" ; + Text [ swedish ] = "Exit $(ARG1) frvntat" ; + Text [ finnish ] = "Exit $(ARG1) erwartet" ; + Text [ english_us ] = "Exit $(ARG1) expected" ; + Text[ chinese_simplified ] = "Ⱥ˳ $(ARG1)"; + Text[ russian ] = " $(ARG1)"; + Text[ polish ] = "Oczekiwany koniec $(ARG1)"; + Text[ japanese ] = "$(ARG1)̏IKvł"; + Text[ chinese_traditional ] = "hX$(ARG1)"; + Text[ arabic ] = " $(ARG1)"; + Text[ dutch ] = "Exit $(ARG1) verwacht"; + Text[ chinese_simplified ] = "Ⱥ˳ $(ARG1)"; + Text[ greek ] = " Exit $(ARG1)"; + Text[ korean ] = " $(ARG1)"; + Text[ turkish ] = "k $(ARG1) bekleniyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_BLOCK & ERRCODE_RES_MASK + { + Text = "Noch offener Anweisungsblock: $(ARG1) fehlt" ; + Text [ ENGLISH ] = "Unterminated statement block: missing $(ARG1)" ; + Text [ norwegian ] = "Unterminated statement block: missing $(ARG1)" ; + Text [ italian ] = "Blocco di comandi ancora aperto: manca $(ARG1)" ; + Text [ portuguese_brazilian ] = "Unterminated statement block: missing $(ARG1)" ; + Text [ portuguese ] = "Bloco de instrues ainda incompleto: falta $(ARG1)" ; + Text [ french ] = "Bloc d'instructions encore ouvert : $(ARG1) fait dfaut" ; + Text [ dutch ] = "Nog open aanwijzingenblok $(ARG1) ontbreekt" ; + Text [ spanish ] = "Bloque de instrucciones incompleto: falta $(ARG1) " ; + Text [ danish ] = "Endnu ben instruktionsblok: $(ARG1) mangler" ; + Text [ swedish ] = "Icke avslutat statementblock: $(ARG1) saknas" ; + Text [ finnish ] = "Unterminated statement block: missing $(ARG1)" ; + Text [ english_us ] = "Statement block still open: $(ARG1) missing" ; + Text[ chinese_simplified ] = "ȱδķֳ飺$(ARG1)"; + Text[ russian ] = " : $(ARG1)"; + Text[ polish ] = "Jeszcze otwarty blok instrukcji: brak $(ARG1)"; + Text[ japanese ] = "܂J܂܂̎wۯ: $(ARG1)܂"; + Text[ chinese_traditional ] = "ٯʤ֥{ǶG$(ARG1)"; + Text[ arabic ] = " : $(ARG1) "; + Text[ dutch ] = "Nog open aanwijzingenblok $(ARG1) ontbreekt"; + Text[ chinese_simplified ] = "ȱδķֳ飺$(ARG1)"; + Text[ greek ] = " : $(ARG1) ."; + Text[ korean ] = " ֽϴ. :$(ARG1) ϴ."; + Text[ turkish ] = "Ak deyim bloku: $(ARG1) eksik"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_BRACKETS & ERRCODE_RES_MASK + { + Text = "Fehler in Klammerschachtelung" ; + Text [ ENGLISH ] = "Parentheses do not match" ; + Text [ norwegian ] = "Parentheses do not match" ; + Text [ italian ] = "Errore nelle parentesi impostate" ; + Text [ portuguese_brazilian ] = "Parentheses do not match" ; + Text [ portuguese ] = "Erro nos parnteses" ; + Text [ french ] = "Erreur de parenthses" ; + Text [ dutch ] = "Fout in het plaatsen van haakjes" ; + Text [ spanish ] = "Los parntesis no coinciden" ; + Text [ danish ] = "Fejl i parentesstrukturen" ; + Text [ swedish ] = "Parentesfel" ; + Text [ finnish ] = "Parentheses do not match" ; + Text [ english_us ] = "Parentheses do not match" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = " "; + Text[ polish ] = "Bd w ustawianiu nawiasw"; + Text[ japanese ] = "ʕt̴װ"; + Text[ chinese_traditional ] = "Aտ~"; + Text[ arabic ] = " "; + Text[ dutch ] = "Fout in het plaatsen van haakjes"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = " "; + Text[ korean ] = "ȣ ʽϴ."; + Text[ turkish ] = "Ayralar uyumsuz"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_DECLARATION & ERRCODE_RES_MASK + { + Text = "Symbol $(ARG1) bereits anders definiert" ; + Text [ ENGLISH ] = "Symbol $(ARG1) defined differently" ; + Text [ norwegian ] = "Symbol $(ARG1) defined differently" ; + Text [ italian ] = "Simbolo $(ARG1) gi definito diversamente" ; + Text [ portuguese_brazilian ] = "Symbol $(ARG1) defined differently" ; + Text [ portuguese ] = "O smbolo $(ARG1) j tem outra definio" ; + Text [ french ] = "Le symbole $(ARG1) a dj reu une autre dfinition" ; + Text [ dutch ] = "Symbool $(ARG1) reeds anders gedefinieerd" ; + Text [ spanish ] = "El smbolo $(ARG1) ya se defini de otra manera" ; + Text [ danish ] = "Symbolet $(ARG1) er allerede defineret anderledes" ; + Text [ swedish ] = "Symbolen $(ARG1) r redan annorlunda definierad" ; + Text [ finnish ] = "Symbol $(ARG1) defined differently" ; + Text [ english_us ] = "Symbol $(ARG1) already defined differently" ; + Text[ chinese_simplified ] = "Ѿжͼ $(ARG1)"; + Text[ russian ] = " $(ARG1) -"; + Text[ polish ] = "Symbol $(ARG1) zosta ju inaczej zdefiniowany"; + Text[ japanese ] = "$(ARG1)͂łɕʂɒ`Ă܂"; + Text[ chinese_traditional ] = "wgtwqFϥ$(ARG1)"; + Text[ arabic ] = " $(ARG1) "; + Text[ dutch ] = "Symbool $(ARG1) reeds anders gedefinieerd"; + Text[ chinese_simplified ] = "Ѿжͼ $(ARG1)"; + Text[ greek ] = " $(ARG1) "; + Text[ korean ] = "ȣ$(ARG1) ̹ ٸ ǵǾ ֽϴ."; + Text[ turkish ] = "Simge $(ARG1) farkl bir biimde tanmlanm durumda"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_PARAMETERS & ERRCODE_RES_MASK + { + Text = "Parameter passen nicht zu Prozedur" ; + Text [ ENGLISH ] = "Parameters do not match" ; + Text [ norwegian ] = "Parameters do not match" ; + Text [ italian ] = "Le parentesi non corrispondono alla procedura" ; + Text [ portuguese_brazilian ] = "Parameters do not match" ; + Text [ portuguese ] = "Os parmetros no correspondem ao procedimento" ; + Text [ french ] = "Les paramtres ne correspondent pas la procdure" ; + Text [ dutch ] = "Parameters passen niet bij procedure" ; + Text [ spanish ] = "Los parmetros no coinciden con el procedimiento" ; + Text [ danish ] = "Parametrene svarer ikke til proceduren" ; + Text [ swedish ] = "Parametern passar inte till proceduren" ; + Text [ finnish ] = "Parameters do not match" ; + Text [ english_us ] = "Parameters do not correspond to procedure" ; + Text[ chinese_simplified ] = "̲ƥ"; + Text[ russian ] = " "; + Text[ polish ] = "Parametry nie odpowiadaj procedurze"; + Text[ japanese ] = "Ұۼެɍ܂"; + Text[ chinese_traditional ] = "UܶqML{ǰt"; + Text[ arabic ] = " "; + Text[ dutch ] = "Parameters passen niet bij procedure"; + Text[ chinese_simplified ] = "̲ƥ"; + Text[ greek ] = " "; + Text[ korean ] = "ĶͰ ν ʽϴ."; + Text[ turkish ] = "Parametreler yordama uymuyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_CHAR_IN_NUMBER & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Ungltiges Zeichen in Zahl : Ungltiges Zeichen in Zahl */ + Text = "Ungltiges Zeichen in Zahl" ; + Text [ ENGLISH ] = "Bad character in number" ; + Text [ norwegian ] = "Bad character in number" ; + Text [ italian ] = "Carattere non valido nel numero" ; + Text [ portuguese_brazilian ] = "Bad character in number" ; + Text [ portuguese ] = "Caracter incorrecto no nmero" ; + Text [ french ] = "Le nombre contient un caractre incorrect" ; + Text [ dutch ] = "Ongeldig teken in getal" ; + Text [ spanish ] = "Carcter incorrecto en el nmero" ; + Text [ danish ] = "Ugyldigt tegn i tallet" ; + Text [ swedish ] = "Ogiltigt tecken i talet" ; + Text [ finnish ] = "Bad character in number" ; + Text [ english_us ] = "Invalid character in number" ; + Text[ chinese_simplified ] = "ںЧַ"; + Text[ russian ] = " "; + Text[ polish ] = "Nieprawidowy znak w liczbie"; + Text[ japanese ] = "ɖȕ"; + Text[ chinese_traditional ] = "bƦrtLĪr"; + Text[ arabic ] = " "; + Text[ dutch ] = "Ongeldig teken in getal"; + Text[ chinese_simplified ] = "ںЧַ"; + Text[ greek ] = " "; + Text[ korean ] = "ڿ ȿ "; + Text[ turkish ] = "Numara geersiz bir karakter ieriyor"; + Text[ language_user1 ] = " "; + }; + String SbERR_MUST_HAVE_DIMS & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Array mu dimensioniert werden : Array mu dimensioniert werden */ + Text = "Array muss dimensioniert werden" ; + Text [ ENGLISH ] = "Array needs dimensioning" ; + Text [ norwegian ] = "Array needs dimensioning" ; + Text [ italian ] = "L'array deve essere dimensionato" ; + Text [ portuguese_brazilian ] = "Array needs dimensioning" ; + Text [ portuguese ] = "Necessrio dimensionar matriz" ; + Text [ french ] = "Vous devez dimensionner l'Array" ; + Text [ dutch ] = "Array moet worden gedimensioneerd" ; + Text [ spanish ] = "Hay que dimensionar el array" ; + Text [ danish ] = "Array skal dimensioneres" ; + Text [ swedish ] = "Array mste dimensioneras" ; + Text [ finnish ] = "Array needs dimensioning" ; + Text [ english_us ] = "Array must be dimensioned" ; + Text[ chinese_simplified ] = "Ϊ鶨߶"; + Text[ russian ] = " "; + Text[ polish ] = "Macierz naley zwymiarowa"; + Text[ japanese ] = "z͎ȂȂ܂"; + Text[ chinese_traditional ] = "Cwث"; + Text[ arabic ] = " "; + Text[ dutch ] = "Array moet worden gedimensioneerd"; + Text[ chinese_simplified ] = "Ϊ鶨߶"; + Text[ greek ] = " "; + Text[ korean ] = "迭 ݵ ġ ־Ѵ."; + Text[ turkish ] = "Dizinin boyutlandrlmas gerekir"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_IF & ERRCODE_RES_MASK + { + Text = "Else/Endif ohne If" ; + Text [ ENGLISH ] = "Else/Endif without If" ; + Text [ norwegian ] = "Else/Endif without If" ; + Text [ italian ] = "Else/Endif senza If" ; + Text [ portuguese_brazilian ] = "Else/Endif without If" ; + Text [ portuguese ] = "Else/Endif sem If" ; + Text [ french ] = "Else/Endif sans If" ; + Text [ dutch ] = "Else/Endif zonder If" ; + Text [ spanish ] = "Else/Endif sin If" ; + Text [ danish ] = "Else/Endif uden If" ; + Text [ swedish ] = "Else/Endif utan If" ; + Text [ finnish ] = "Else/Endif without If" ; + Text [ english_us ] = "Else/Endif without If" ; + Text[ chinese_simplified ] = "Else/Endif If"; + Text[ russian ] = "Else/Endif If"; + Text[ polish ] = "Else/Endif bez If"; + Text[ japanese ] = "Else/Endif without If"; + Text[ chinese_traditional ] = "Else/Endif a If"; + Text[ arabic ] = "If Else/Endif"; + Text[ dutch ] = "Else/Endif zonder If"; + Text[ chinese_simplified ] = "Else/Endif If"; + Text[ greek ] = "Else/Endif If"; + Text[ korean ] = "IF ELSE/ELSEIF"; + Text[ turkish ] = "If olmadan Else/Endif"; + Text[ language_user1 ] = " "; + }; + String SbERR_NOT_IN_SUBR & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? $(ARG1) innerhalb einer Prozedur unzulssig : $(ARG1) innerhalb einer Prozedur unzulssig */ + Text = "$(ARG1) innerhalb einer Prozedur unzulssig" ; + Text [ ENGLISH ] = "$(ARG1) not allowed within a procedure" ; + Text [ norwegian ] = "$(ARG1) not allowed within a procedure" ; + Text [ italian ] = "$(ARG1) non ammesso all'interno di una procedura" ; + Text [ portuguese_brazilian ] = "$(ARG1) not allowed within a procedure" ; + Text [ portuguese ] = "$(ARG1) no permitido dentro de um procedimento" ; + Text [ french ] = "$(ARG1) interdit dans une procdure" ; + Text [ dutch ] = "$(ARG1) binnen een procedure niet toegestaan" ; + Text [ spanish ] = "$(ARG1) no est permitido dentro de un proceso" ; + Text [ danish ] = "$(ARG1) er ikke tilladt indenfor en procedure" ; + Text [ swedish ] = "$(ARG1) inte tilltet inuti en procedur" ; + Text [ finnish ] = "$(ARG1) not allowed within a procedure" ; + Text [ english_us ] = "$(ARG1) not allowed within a procedure" ; + Text[ chinese_simplified ] = "һڲ $(ARG1)"; + Text[ russian ] = "$(ARG1) "; + Text[ polish ] = "$(ARG1) niedopuszczalny w procedurze"; + Text[ japanese ] = "$(ARG1)ۼެł͋܂"; + Text[ chinese_traditional ] = "b@ӹL{\\$(ARG1)"; + Text[ arabic ] = " $(ARG1)"; + Text[ dutch ] = "$(ARG1) binnen een procedure niet toegestaan"; + Text[ chinese_simplified ] = "һڲ $(ARG1)"; + Text[ greek ] = "$(ARG1) "; + Text[ korean ] = "$(ARG1) ν ̿ ʽϴ."; + Text[ turkish ] = "Yordamda $(ARG1) geerli deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_NOT_IN_MAIN & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? $(ARG1) auerhalb einer Prozedur unzulssig : $(ARG1) auerhalb einer Prozedur unzulssig */ + Text = "$(ARG1) auerhalb einer Prozedur unzulssig" ; + Text [ ENGLISH ] = "$(ARG1) not allowed outside a procedure" ; + Text [ norwegian ] = "$(ARG1) not allowed outside a procedure" ; + Text [ italian ] = "$(ARG1) non permesso al di fuori di una procedura" ; + Text [ portuguese_brazilian ] = "$(ARG1) not allowed outside a procedure" ; + Text [ portuguese ] = "$(ARG1) no permitido fora de um procedimento" ; + Text [ french ] = "$(ARG1) interdit en dehors d'une procdure" ; + Text [ dutch ] = "$(ARG1) buiten een procedure niet toegestaan" ; + Text [ spanish ] = "$(ARG1) no est permitido fuera de un proceso" ; + Text [ danish ] = "$(ARG1) er ikke tilladt udenfor en procedure" ; + Text [ swedish ] = "$(ARG1) inte tilltet utanfr en procedur" ; + Text [ finnish ] = "$(ARG1) not allowed outside a procedure" ; + Text [ english_us ] = "$(ARG1) not allowed outside a procedure" ; + Text[ chinese_simplified ] = "һⲻ $(ARG1)"; + Text[ russian ] = "$(ARG1) "; + Text[ polish ] = "$(ARG1) niedopuszczalny poza procedur"; + Text[ japanese ] = "$(ARG1)ۼެOł͋܂"; + Text[ chinese_traditional ] = "b@ӹL{~\\$(ARG1)"; + Text[ arabic ] = " $(ARG1)"; + Text[ dutch ] = "$(ARG1) buiten een procedure niet toegestaan"; + Text[ chinese_simplified ] = "һⲻ $(ARG1)"; + Text[ greek ] = "$(ARG1) "; + Text[ korean ] = "$(ARG1) νۿ ʽϴ."; + Text[ turkish ] = "Yordam dnda $(ARG1) geerli deil"; + Text[ language_user1 ] = " "; + }; + String SbERR_WRONG_DIMS & ERRCODE_RES_MASK + { + Text = "Dimensionsangaben passen nicht zueinander" ; + Text [ ENGLISH ] = "Dimensions do not match" ; + Text [ norwegian ] = "Dimensions do not match" ; + Text [ italian ] = "I dati sulle dimensioni non sono compatibili tra loro" ; + Text [ portuguese_brazilian ] = "Dimensions do not match" ; + Text [ portuguese ] = "As dimenses indicadas no combinam" ; + Text [ french ] = "Les dimensions indiques ne concordent pas" ; + Text [ dutch ] = "Aangegeven afmetingen passen niet bij elkaar" ; + Text [ spanish ] = "Las dimensiones no coinciden" ; + Text [ danish ] = "Dimensionsangivelserne svarer ikke til hinanden" ; + Text [ swedish ] = "Dimensionsspecificeringarna stmmer inte verens" ; + Text [ finnish ] = "Dimensions do not match" ; + Text [ english_us ] = "Dimension specifications do not match" ; + Text[ chinese_simplified ] = "߶ȵ趨ƥ"; + Text[ russian ] = " "; + Text[ polish ] = "Dane wymiarowe nie s zgodne"; + Text[ japanese ] = "̎w͍Ă܂"; + Text[ chinese_traditional ] = "wثת]wǰt"; + Text[ arabic ] = " "; + Text[ dutch ] = "Aangegeven afmetingen passen niet bij elkaar"; + Text[ chinese_simplified ] = "߶ȵ趨ƥ"; + Text[ greek ] = " ."; + Text[ korean ] = " ǰ ʽϴ."; + Text[ turkish ] = "Boyut verileri arasnda uyumazlk"; + Text[ language_user1 ] = " "; + }; + String SbERR_BAD_OPTION & ERRCODE_RES_MASK + { + Text = "Unbekannte Option: $(ARG1)" ; + Text [ ENGLISH ] = "Unknown option: $(ARG1)" ; + Text [ norwegian ] = "Unknown option: $(ARG1)" ; + Text [ italian ] = "Opzione sconosciuta: $(ARG1)" ; + Text [ portuguese_brazilian ] = "Unknown option: $(ARG1)" ; + Text [ portuguese ] = "Opo desconhecida: $(ARG1)" ; + Text [ french ] = "Option inconnue : $(ARG1)" ; + Text [ dutch ] = "Onbekende optie: $(ARG1)" ; + Text [ spanish ] = "Opcin desconocida: $(ARG1)" ; + Text [ danish ] = "Ukendt alternativ: $(ARG1)" ; + Text [ swedish ] = "Obekant alternativ: $(ARG1)" ; + Text [ finnish ] = "Unknown option: $(ARG1)" ; + Text [ english_us ] = "Unknown option: $(ARG1)" ; + Text[ chinese_simplified ] = "ѡ$(ARG1)"; + Text[ russian ] = " : $(ARG1)"; + Text[ polish ] = "Nieznana opcja: $(ARG1)"; + Text[ japanese ] = "sȵ: $(ARG1)"; + Text[ chinese_traditional ] = "ﶵG$(ARG1)"; + Text[ arabic ] = "$(ARG1) : "; + Text[ dutch ] = "Onbekende optie: $(ARG1)"; + Text[ chinese_simplified ] = "ѡ$(ARG1)"; + Text[ greek ] = " : $(ARG1)"; + Text[ korean ] = "˷ ɼ:$(ARG1)"; + Text[ turkish ] = "Bilinmeyen seenek: $(ARG1)"; + Text[ language_user1 ] = " "; + }; + String SbERR_CONSTANT_REDECLARED & ERRCODE_RES_MASK + { + Text = "Konstante $(ARG1) neu definiert" ; + Text [ ENGLISH ] = "Constant $(ARG1) redeclared" ; + Text [ norwegian ] = "Constant $(ARG1) redeclared" ; + Text [ italian ] = "Costante $(ARG1) ridefinita" ; + Text [ portuguese_brazilian ] = "Constant $(ARG1) redeclared" ; + Text [ portuguese ] = "Constante $(ARG1) redefinida" ; + Text [ french ] = "La constante $(ARG1) a t redfinie" ; + Text [ dutch ] = "Constante $(ARG1) opnieuw gedefinieerd" ; + Text [ spanish ] = "Constante $(ARG1) redefinida" ; + Text [ danish ] = "Konstanten $(ARG1) er nydefineret" ; + Text [ swedish ] = "Konstanten $(ARG1) r nydefinierad" ; + Text [ finnish ] = "Constant $(ARG1) redeclared" ; + Text [ english_us ] = "Constant $(ARG1) redefined" ; + Text[ chinese_simplified ] = "¶峣 $(ARG1)"; + Text[ russian ] = " $(ARG1) "; + Text[ polish ] = "Staa $(ARG1) ponownie zdefiniowana"; + Text[ japanese ] = "萔$(ARG1)͍Ē`܂"; + Text[ chinese_traditional ] = "swq`$(ARG1)"; + Text[ arabic ] = "$(ARG1) "; + Text[ dutch ] = "Constante $(ARG1) opnieuw gedefinieerd"; + Text[ chinese_simplified ] = "¶峣 $(ARG1)"; + Text[ greek ] = " $(ARG1)"; + Text[ korean ] = " ǵ $(ARG1)"; + Text[ turkish ] = "Sabit $(ARG1) yeniden tanmland"; + Text[ language_user1 ] = " "; + }; + String SbERR_PROG_TOO_LARGE & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Programm ist zu gro : Programm ist zu gro */ + Text = "Programm ist zu gro" ; + Text [ ENGLISH ] = "Program is too large" ; + Text [ norwegian ] = "Program is too large" ; + Text [ italian ] = "Il programma troppo esteso" ; + Text [ portuguese_brazilian ] = "Program is too large" ; + Text [ portuguese ] = "O programa demasiado extenso" ; + Text [ french ] = "Le programme est trop volumineux" ; + Text [ dutch ] = "Programma is te groot" ; + Text [ spanish ] = "El programa es demasiado grande" ; + Text [ danish ] = "Programmet er for stort" ; + Text [ swedish ] = "Programmet r fr stort" ; + Text [ finnish ] = "Program is too large" ; + Text [ english_us ] = "Program too large" ; + Text[ chinese_simplified ] = "̫"; + Text[ russian ] = " "; + Text[ polish ] = "Program jest za duy"; + Text[ japanese ] = "۸т͑傫܂"; + Text[ chinese_traditional ] = "{Ӥj"; + Text[ arabic ] = " "; + Text[ dutch ] = "Programma is te groot"; + Text[ chinese_simplified ] = "̫"; + Text[ greek ] = " "; + Text[ korean ] = "α̳ʹ Ůϴ."; + Text[ turkish ] = "Program ok byk"; + Text[ language_user1 ] = " "; + }; + String SbERR_NO_STRINGS_ARRAYS & ERRCODE_RES_MASK + { + /* ### ACHTUNG: Neuer Text in Resource? Strings oder Arrays unzulssig : Strings oder Arrays unzulssig */ + Text = "Strings oder Arrays unzulssig" ; + Text [ ENGLISH ] = "Sorry, no strings or arrays allowed" ; + Text [ norwegian ] = "Sorry, no strings or arrays allowed" ; + Text [ italian ] = "String o array non validi" ; + Text [ portuguese_brazilian ] = "Sorry, no strings or arrays allowed" ; + Text [ portuguese ] = "Sries de caracteres ou matrizes no permitidas" ; + Text [ french ] = "Strings ou Arrays inadmissibles" ; + Text [ dutch ] = "Strings of arrays niet toegestaan" ; + Text [ spanish ] = "No estn permitidos strings o arrays" ; + Text [ danish ] = "Strenge eller arrays er ikke tilladte" ; + Text [ swedish ] = "Strings eller arrays ej tilltna" ; + Text [ finnish ] = "Sorry, no strings or arrays allowed" ; + Text [ english_us ] = "Strings or arrays not permitted" ; + Text[ chinese_simplified ] = "ִ"; + Text[ russian ] = " "; + Text[ polish ] = "Ciagi znakw lub macierze niedopuszczalne"; + Text[ japanese ] = "܂͔z͋܂"; + Text[ chinese_traditional ] = "\\rΦC"; + Text[ arabic ] = " "; + Text[ dutch ] = "Strings of arrays niet toegestaan"; + Text[ chinese_simplified ] = "ִ"; + Text[ greek ] = " "; + Text[ korean ] = " Ǵ 迭 ʾҽϴ."; + Text[ turkish ] = "Dizilimler ya da diziler geerli deil"; + Text[ language_user1 ] = " "; + }; +#ifdef VBSCRIPT_TEST + String ERRCODE_BASIC_NOT_IN_VBSCRIPT & ERRCODE_RES_MASK + { + Text = "In VBScript nicht enthalten" ; + Text [ ENGLISH ] = "Not implemented in VBScript" ; + Text [ norwegian ] = "Not implemented in VBScript" ; + Text [ italian ] = "Non contenuto nello script VB" ; + Text [ portuguese_brazilian ] = "Not implemented in VBScript" ; + Text [ portuguese ] = "No contido no Script VB" ; + Text [ french ] = "Pas contenu dans le VBScript" ; + Text [ dutch ] = "Bevindt zich niet in VBScript" ; + Text [ spanish ] = "No est contenido en el script VB" ; + Text [ danish ] = "Ikke indeholdt i VB-script" ; + Text [ swedish ] = "Innefattas inte i VBScript" ; + Text [ finnish ] = "Not implemented in VBScript" ; + Text [ english_us ] = "Not contained in VB script" ; + Text[ chinese_simplified ] = "ûа VB script "; + Text[ russian ] = " VBScript "; + Text[ polish ] = "Nie zawarte w VBScript"; + Text[ japanese ] = "VBScriptɊ܂܂Ă܂"; + Text[ chinese_traditional ] = "S]tbVB script"; + Text[ arabic ] = "VB script "; + Text[ dutch ] = "Bevindt zich niet in VBScript"; + Text[ chinese_simplified ] = "ûа VB script "; + Text[ greek ] = " VB script"; + Text[ korean ] = "VB ũƮ ʽϴ."; + Text[ turkish ] = "VBScript'te mevcut deil"; + Text[ language_user1 ] = " "; + }; +#endif +}; + // Hinweis: IDS_SBERR_TERMINATED = IDS_SBERR_START+2000. +String IDS_SBERR_TERMINATED +{ + Text = "Das laufende Makro wurde unterbrochen" ; + Text [ ENGLISH ] = "Stopped currently running macro" ; + Text [ norwegian ] = "Stopped currently running macro" ; + Text [ italian ] = "La macro in corso stata interrotta" ; + Text [ portuguese_brazilian ] = "Stopped currently running macro" ; + Text [ portuguese ] = "A macro em execuo foi cancelada" ; + Text [ french ] = "La macro en cours a t interrompue" ; + Text [ dutch ] = "Actuele macro werd onderbroken" ; + Text [ spanish ] = "Se ha interrumpido la macro activa" ; + Text [ danish ] = "Den aktuelle makro blev afbrudt" ; + Text [ swedish ] = "Det aktuella makrot avbrts" ; + Text [ finnish ] = "Stopped currently running macro" ; + Text [ english_us ] = "The macro running has been interrupted" ; + Text[ chinese_simplified ] = "жкꡣ"; + Text[ russian ] = " "; + Text[ polish ] = "Wykonywane makro zostao przerwane"; + Text[ japanese ] = "ϸۍƂf܂"; + Text[ chinese_traditional ] = "_B楨C"; + Text[ arabic ] = " "; + Text[ dutch ] = "Actuele macro werd onderbroken"; + Text[ chinese_simplified ] = "жкꡣ"; + Text[ greek ] = " "; + Text[ korean ] = "ũ ߴܵǾϴ."; + Text[ turkish ] = "Yrtlen makro kesildi"; + Text[ language_user1 ] = " "; +}; +String IDS_SBERR_STOREREF +{ + Text = "Referenz wird nicht gespeichert: "; + Text [ italian ] = "Il riferimento non viene salvato: "; + Text [ portuguese_brazilian ] = "reference will not be saved: "; + Text [ portuguese ] = "A referncia no ser guardada: "; + Text [ danish ] = "Referencen bliver ikke gemt: "; + Text [ french ] = "Impossible d'enregistrer la rfrence : "; + Text [ swedish ] = "Referens sparas inte: "; + Text [ dutch ] = "Verwijzing wordt niet opgeslagen: "; + Text [ spanish ] = "No se guardar la referencia: "; + Text [ english_us ] = "Reference will not be saved: "; + Text[ chinese_simplified ] = ": "; + Text[ language_user1 ] = " "; + Text[ russian ] = " : "; + Text[ polish ] = "Odwoanie nie zostao zapisane: "; + Text[ japanese ] = "QƂ͕ۑ܂: "; + Text[ chinese_traditional ] = "xsѷӡG "; + Text[ arabic ] = ": "; + Text[ dutch ] = "Verwijzing wordt niet opgeslagen: "; + Text[ chinese_simplified ] = ": "; + Text[ greek ] = " : "; + Text[ korean ] = " ʾҽϴ. "; + Text[ turkish ] = "Referans kaydedilmeyecek: "; +#if defined( MAC ) || defined( OS2 ) + Text = "Referenz wird nicht gesichert: " ; +#else + Text = "Referenz wird nicht gespeichert: " ; +#endif + Text [ ENGLISH ] = "reference will not be saved: " ; + Text [ norwegian ] = "reference will not be saved: " ; + Text [ italian ] = "Il riferimento non viene salvato: " ; + Text [ portuguese_brazilian ] = "reference will not be saved: " ; + Text [ portuguese ] = "A referncia no ser guardada: " ; + Text [ french ] = "Rfrence non enregistre : " ; + Text [ dutch ] = "Verwijzing wordt niet opgeslagen: " ; + Text [ spanish ] = "No se guardar la referencia: " ; + Text [ danish ] = "Referencen bliver ikke gemt: " ; + Text [ swedish ] = "Referens sparas inte: " ; + Text [ finnish ] = "reference will not be saved: " ; + Text [ english_us ] = "Reference will not be saved: " ; + Text = "Referenz wird nicht gespeichert: " ; +}; +String ERRCODE_BASMGR_LIBLOAD & ERRCODE_RES_MASK +{ + /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Laden der Bibliothek '$(ARG1)' : Fehler beim Laden der Bibliothek ''$(ARG1)'' */ + /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Laden der Bibliothek '$(ARG1)' : Fehler beim Laden der Bibliothek ''$(ARG1) */ + /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Laden der Bibliothek '$(ARG1)' : Fehler beim Laden der Bibliothek ''$(ARG1) */ + /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Laden der Bibliothek '$(ARG1)' : Fehler beim Laden der Bibliothek ''$(ARG1)'' */ + Text = "Fehler beim Laden der Bibliothek '$(ARG1)'" ; + Text [ ENGLISH ] = "Fehler beim Laden der Bibliothek '$(ARG1)'" ; + Text [ english_us ] = "Error loading library '$(ARG1)'" ; + Text [ italian ] = "Errore nel caricare la library '$(ARG1)'" ; + Text [ spanish ] = "Error al cargar la biblioteca '$(ARG1)'" ; + Text [ french ] = "Erreur lors du chargement de la bibliothque '$(ARG1)'" ; + Text [ dutch ] = "Fout bij laden van bibliotheek '$(ARG1)'" ; + Text [ swedish ] = "Fel vid laddning av bibliotek '$(ARG1)'" ; + Text [ danish ] = "Fejl ved indlsning af biblioteket '$(ARG1)'" ; + Text [ portuguese_brazilian ] = "Fehler beim Laden der Bibliothek '$(ARG1)" ; + Text [ portuguese ] = "Erro ao carregar a biblioteca '$(ARG1)" ; + Text[ chinese_simplified ] = "װؿʱ'$(ARG1)'"; + Text[ russian ] = " '$(ARG1)'"; + Text[ polish ] = "Bd przy adowaniu biblioteki '$(ARG1)'"; + Text[ japanese ] = "ײ'$(ARG1)'̓ǂݍ݂̍ۂ̴װ"; + Text[ chinese_traditional ] = "˸{wɵoͿ~'$(ARG1)'"; + Text[ arabic ] = "'$(ARG1)' "; + Text[ dutch ] = "Fout bij laden van bibliotheek '$(ARG1)'"; + Text[ chinese_simplified ] = "װؿʱ'$(ARG1)'"; + Text[ greek ] = " '$(ARG1)'"; + Text[ korean ] = "̺귯 $(ARG1) ε "; + Text[ turkish ] = "Kitapl ykleme srasnda hata '$(ARG1)'"; + Text[ language_user1 ] = " "; +}; +String ERRCODE_BASMGR_LIBSAVE & ERRCODE_RES_MASK +{ + /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Speichern der Bibliothek: '$(ARG1)' : Fehler beim Speichern der Bibliothek: ''$(ARG1)'' */ + /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Speichern der Bibliothek: '$(ARG1)' : Fehler beim Speichern der Bibliothek: ''$(ARG1) */ + /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Speichern der Bibliothek: '$(ARG1)' : Fehler beim Speichern der Bibliothek: ''$(ARG1) */ + /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Speichern der Bibliothek: '$(ARG1)' : Fehler beim Speichern der Bibliothek: ''$(ARG1)'' */ + Text = "Fehler beim Speichern der Bibliothek: '$(ARG1)'" ; + Text [ ENGLISH ] = "Fehler beim Speichern der Bibliothek: '$(ARG1)'" ; + Text [ dutch ] = "Fout bij het opslaan van bibliotheek: '$(ARG1)'" ; + Text [ english_us ] = "Error saving library: '$(ARG1)'" ; + Text [ italian ] = "Errore nel salvare la library: '$(ARG1)'" ; + Text [ spanish ] = "Error al guardar la biblioteca: '$(ARG1)'" ; + Text [ french ] = "Erreur lors de l'enregistrement de la bibliothque : '$(ARG1)'" ; + Text [ swedish ] = "Fel vid sparandet av bibliotek: '$(ARG1)'" ; + Text [ danish ] = "Fejl under forsg p at gemme biblioteket: '$(ARG1)'" ; + Text [ portuguese ] = "Erro ao guardar a biblioteca: '$(ARG1)" ; + Text [ portuguese_brazilian ] = "Fehler beim Speichern der Bibliothek: '$(ARG1)" ; + Text[ chinese_simplified ] = "̿ʱ '$(ARG1)'"; + Text[ russian ] = " : '$(ARG1)'"; + Text[ polish ] = "Bd przy zapisie biblioteki '$(ARG1)'"; + Text[ japanese ] = "ײ̕ۑ̍ۂ̴װ: '$(ARG1)'"; + Text[ chinese_traditional ] = "xs{wɵoͿ~'$(ARG1)'"; + Text[ arabic ] = "'$(ARG1)' : "; + Text[ dutch ] = "Fout bij het opslaan van bibliotheek: '$(ARG1)'"; + Text[ chinese_simplified ] = "̿ʱ '$(ARG1)'"; + Text[ greek ] = " : '$(ARG1)'"; + Text[ korean ] = "̺귯 $(ARG1) "; + Text[ turkish ] = "Kitapl kaydetme srasnda hata: '$(ARG1)'"; + Text[ language_user1 ] = " "; +}; +String ERRCODE_BASMGR_MGROPEN & ERRCODE_RES_MASK +{ + /* ### ACHTUNG: Neuer Text in Resource? Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden : Das BASIC aus der Datei ''$(ARG1)'' konnte nicht initialisiert werden */ + /* ### ACHTUNG: Neuer Text in Resource? Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden : Das BASIC aus der Datei ''$(ARG1)'' konnte nicht initialisiert werden */ + /* ### ACHTUNG: Neuer Text in Resource? Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden : Das BASIC aus der Datei ''$(ARG1)'' konnte nicht initialisiert werden */ + /* ### ACHTUNG: Neuer Text in Resource? Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden : Das BASIC aus der Datei ''$(ARG1)'' konnte nicht initialisiert werden */ + Text = "Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden" ; + Text [ english ] = "The BASIC from the file '$(ARG1)' could not be initialized" ; + Text [ dutch ] = "BASIC in bestand '$(ARG1)' kon niet worden genitialiseerd" ; + Text [ english_us ] = "The BASIC from the file '$(ARG1)' could not be initialized" ; + Text [ italian ] = "Impossibile inizializzare il BASIC dal file '$(ARG1)'" ; + Text [ spanish ] = "No se pudo inicializar el Basic del archivo '$(ARG1)'" ; + Text [ french ] = "Impossible d'initialiser BASIC partir du fichier '$(ARG1)'" ; + Text [ swedish ] = "BASIC frn filen '$(ARG1)' kunde inte initialiseras" ; + Text [ danish ] = "Det var ikke muligt at initialisere BASIC fra filen '$(ARG1)'" ; + Text [ portuguese ] = "Impossvel inicializar BASIC do ficheiro '$(ARG1)'" ; + Text [ portuguese_brazilian ] = "Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden" ; + Text[ chinese_simplified ] = "ļ'$(ARG1)' ʼ BASIC"; + Text[ russian ] = " BASIC '$(ARG1)' "; + Text[ polish ] = "BASIC z pliku '$(ARG1)' nie mg zosta zainicjowany"; + Text[ japanese ] = "̧ '$(ARG1)'BASIC͏ł܂ł"; + Text[ chinese_traditional ] = "Lkqɮ'$(ARG1)'lBASIC"; + Text[ arabic ] = "'$(ARG1)' BASIC "; + Text[ dutch ] = "BASIC in bestand '$(ARG1)' kon niet worden genitialiseerd"; + Text[ chinese_simplified ] = "ļ'$(ARG1)' ʼ BASIC"; + Text[ greek ] = " BASIC '$(ARG1)'."; + Text[ korean ] = " $(ARG1) BASIC ʱȭ ʾҽϴ."; + Text[ turkish ] = "'$(ARG1)' dosyasndan BASIC kurulamad"; + Text[ language_user1 ] = " "; +}; +String ERRCODE_BASMGR_MGRSAVE & ERRCODE_RES_MASK +{ + Text = "Fehler beim Speichern des BASIC's: '$(ARG1)'" ; + Text [ english ] = "Error saving BASIC: '$(ARG1)'" ; + Text [ dutch ] = "Fout bij het opslaan van BASIC: '$(ARG1)'" ; + Text [ english_us ] = "Error saving BASIC: '$(ARG1)'" ; + Text [ italian ] = "Errore nel salvare il BASIC: '$(ARG1)'" ; + Text [ spanish ] = "Error al guardar BASIC: '$(ARG1)'" ; + Text [ french ] = "Erreur lors de l'enregistrement de la macro BASIC : '$(ARG1)'" ; + Text [ swedish ] = "Fel vid sparandet av BASIC: '$(ARG1)'" ; + Text [ danish ] = "Fejl under forsg p at gemme BASIC: '$(ARG1)'" ; + Text [ portuguese ] = "Erro ao guardar BASIC: '$(ARG1)'" ; + Text [ portuguese_brazilian ] = "Fehler beim Speichern des Basics: '$(ARG1)" ; + Text[ chinese_simplified ] = "BASICʱ'$(ARG1)'"; + Text[ russian ] = " BASIC: '$(ARG1)'"; + Text[ polish ] = "Bd przy zapisie biblioteki BASIC: '$(ARG1)'"; + Text[ japanese ] = "BASIC̕ۑ̍ۂ̴װ: '$(ARG1)'"; + Text[ chinese_traditional ] = "xsBASICɵoͿ~G'$(ARG1)'"; + Text[ arabic ] = "'$(ARG1)' :BASIC "; + Text[ dutch ] = "Fout bij het opslaan van BASIC: '$(ARG1)'"; + Text[ chinese_simplified ] = "BASICʱ'$(ARG1)'"; + Text[ greek ] = " BASIC: '$(ARG1)'"; + Text[ korean ] = "BASIC :$(ARG1)"; + Text[ turkish ] = "BASIC'i kaydetme srasnda hata: '$(ARG1)'"; + Text[ language_user1 ] = " "; +}; +String ERRCODE_BASMGR_REMOVELIB & ERRCODE_RES_MASK +{ + Text = "Fehler beim entfernen der Bibliothek" ; + Text [ ENGLISH ] = "Fehler beim entfernen der Bibliothek" ; + Text [ dutch ] = "Fout bij verwijderen van bibliotheek" ; + Text [ english_us ] = "Error removing library" ; + Text [ italian ] = "Errore nell'eliminare la library" ; + Text [ spanish ] = "Error al eliminar la biblioteca" ; + Text [ french ] = "Erreur lors de la suppression de la bibliothque" ; + Text [ swedish ] = "Fel vid borttagande av bibliotek" ; + Text [ danish ] = "Fejl under sletning af biblioteket" ; + Text [ portuguese ] = "Erro ao eliminar a biblioteca" ; + Text [ portuguese_brazilian ] = "Fehler beim entfernen der Bibliothek" ; + Text[ chinese_simplified ] = "ɾʱ"; + Text[ russian ] = " "; + Text[ polish ] = "Bd przy usuwaniu biblioteki"; + Text[ japanese ] = "ײ̍폜̍ۂ̴װ"; + Text[ chinese_traditional ] = "R{wɵoͿ~"; + Text[ arabic ] = " "; + Text[ dutch ] = "Fout bij verwijderen van bibliotheek"; + Text[ chinese_simplified ] = "ɾʱ"; + Text[ greek ] = " "; + Text[ korean ] = "̺귯 "; + Text[ turkish ] = "Kitapl kaldrma srasnda hata"; + Text[ language_user1 ] = " "; +}; +String ERRCODE_BASMGR_UNLOADLIB & ERRCODE_RES_MASK +{ + Text = "Die Bibliothek konnte nicht aus dem Speicher entfernt werden." ; + Text [ ENGLISH ] = "Die Bibliothek konnte nicht aus dem Speicher entfernt werden." ; + Text [ dutch ] = "De bibliotheek kon niet uit het geheugen worden verwijderd." ; + Text [ english_us ] = "The library could not be removed from memory." ; + Text [ italian ] = "Impossibile eliminare la library dalla memoria." ; + Text [ spanish ] = "No se pudo eliminar la biblioteca de la memoria." ; + Text [ french ] = "Impossible de supprimer la bibliothque de la mmoire." ; + Text [ swedish ] = "Biblioteket kunde inte tas bort frn minnet." ; + Text [ danish ] = "Det var ikke muligt at slette biblioteket fra hukommelsen." ; + Text [ portuguese ] = "Foi impossvel remover a biblioteca da memria." ; + Text [ portuguese_brazilian ] = "Die Bibliothek konnte nicht aus dem Speicher entfernt werden." ; + Text[ chinese_simplified ] = "ڴ"; + Text[ russian ] = " ."; + Text[ polish ] = "Biblioteki nie mona byo usun z pamici."; + Text[ japanese ] = "ײ폜ł܂łB"; + Text[ chinese_traditional ] = "{wLkqO餺MC"; + Text[ arabic ] = ". "; + Text[ dutch ] = "De bibliotheek kon niet uit het geheugen worden verwijderd."; + Text[ chinese_simplified ] = "ڴ"; + Text[ greek ] = " "; + Text[ korean ] = "̺귯 ϴ."; + Text[ turkish ] = "Kitaplk bellekten silinemedi."; + Text[ language_user1 ] = " "; +}; diff --git a/basic/source/classes/sbintern.cxx b/basic/source/classes/sbintern.cxx new file mode 100644 index 000000000000..2a94af758ece --- /dev/null +++ b/basic/source/classes/sbintern.cxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * $RCSfile: sbintern.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _SHL_HXX //autogen +#include <tools/shl.hxx> +#endif +#include "sbintern.hxx" +#include "sbunoobj.hxx" +#include "token.hxx" // Tokenizer +#include "symtbl.hxx" // Symbolverwaltung +#include "parser.hxx" // Parser +#include "codegen.hxx" // Code-Generator +#pragma hdrstop + +SV_IMPL_PTRARR(SbErrorStack, SbErrorStackEntry*) + +SbiGlobals* GetSbData() +{ + SbiGlobals** pp = (SbiGlobals**) ::GetAppData( SHL_SBC ); + SbiGlobals* p = *pp; + if( !p ) + p = *pp = new SbiGlobals; + return p; +} + +SbiGlobals::SbiGlobals() +{ + pInst = NULL; + pMod = NULL; + pSbFac= NULL; + pUnoFac = NULL; + pCompMod = NULL; // JSM + nInst = 0; + nCode = 0; + nLine = 0; + nCol1 = nCol2 = 0; + bCompiler = FALSE; + bCompWait = FALSE; + bGlobalInitErr = FALSE; + bRunInit = FALSE; + eLanguageMode = SB_LANG_BASIC; + pErrStack = NULL; +} + +SbiGlobals::~SbiGlobals() +{ + delete pErrStack; + delete pSbFac; + delete pUnoFac; +} + diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx new file mode 100644 index 000000000000..799ffc0054a5 --- /dev/null +++ b/basic/source/classes/sbunoobj.cxx @@ -0,0 +1,2500 @@ +/************************************************************************* + * + * $RCSfile: sbunoobj.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +//#include <stl_queue.h> + +#ifndef _VOS_MUTEX_HXX_ //autogen +#include <vos/mutex.hxx> +#endif +#ifndef _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#ifndef _TOOLERR_HXX //autogen +#include <tools/errcode.hxx> +#endif +#ifndef _SFXHINT_HXX //autogen +#include <svtools/hint.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif + +#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/typeprovider.hxx> +#include <cppuhelper/extract.hxx> + +#ifndef _UNOTOOLS_PROCESSFACTORY_HXX_ +#include <unotools/processfactory.hxx> +#endif + +#include <rtl/ustrbuf.hxx> +#include <rtl/strbuf.hxx> + + +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/beans/PropertyConcept.hpp> +#include <com/sun/star/beans/MethodConcept.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/script/XAllListener.hpp> +#include <com/sun/star/script/XInvocationAdapterFactory.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/container/XHierarchicalNameAccess.hpp> +#include <com/sun/star/reflection/XIdlArray.hpp> +#include <com/sun/star/reflection/XIdlReflection.hpp> +#include <com/sun/star/reflection/XIdlClassProvider.hpp> + +using namespace com::sun::star::uno; +using namespace com::sun::star::lang; +using namespace com::sun::star::reflection; +using namespace com::sun::star::beans; +using namespace com::sun::star::script; +using namespace com::sun::star::container; +using namespace cppu; +using namespace rtl; + + +#include<sbstar.hxx> +#include<sbuno.hxx> +#include<sberrors.hxx> +#include<sbunoobj.hxx> +#include"sbjsmod.hxx" +#include<basmgr.hxx> +#include<sbintern.hxx> +#include<runtime.hxx> + +TYPEINIT1(SbUnoMethod,SbxMethod) +TYPEINIT1(SbUnoProperty,SbxProperty) +TYPEINIT1(SbUnoObject,SbxObject) +TYPEINIT1(SbUnoClass,SbxObject) + +//#define U2S(Str) String( OUStringToOString( Str, RTL_TEXTENCODING_ASCII_US ) ) +//#define S2U(Str) OStringToOUString( OString( (Str).GetStr() ), RTL_TEXTENCODING_ASCII_US ) + +typedef WeakImplHelper1< XAllListener > BasicAllListenerHelper; + +// Flag, um immer ueber Invocation zu gehen +//#define INVOCATION_ONLY + + +// Identifier fuer die dbg_-Properies als Strings anlegen +static String ID_DBG_SUPPORTEDINTERFACES( RTL_CONSTASCII_USTRINGPARAM("Dbg_SupportedInterfaces") ); +static String ID_DBG_PROPERTIES( RTL_CONSTASCII_USTRINGPARAM("Dbg_Properties") ); +static String ID_DBG_METHODS( RTL_CONSTASCII_USTRINGPARAM("Dbg_Methods") ); + + +// CoreReflection statisch speichern +Reference< XIdlReflection > getCoreReflection_Impl( void ) +{ + static Reference< XIdlReflection > xCoreReflection; + + // Haben wir schon CoreReflection, sonst besorgen + if( !xCoreReflection.is() ) + { + Reference< XMultiServiceFactory > xFactory = utl::getProcessServiceFactory(); + if ( xFactory.is() ) + { + Reference< XInterface > xI = xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.reflection.CoreReflection") ); + //if (xI.is()) + //{ + xCoreReflection = Reference<XIdlReflection>::query( xI ); + //xI->queryInterface( XIdlReflection::getSmartUik(), xCoreReflection ); + //} + } + } + return xCoreReflection; +} + +// TODO: Spaeter auslagern +Reference<XIdlClass> TypeToIdlClass( const Type& rType ) +{ + // void als Default-Klasse eintragen + Reference<XIdlClass> xRetClass; + typelib_TypeDescription * pTD = 0; + rType.getDescription( &pTD ); + if( pTD ) + { + OUString sOWName( pTD->pTypeName ); + Reference< XIdlReflection > xRefl = getCoreReflection_Impl(); + xRetClass = xRefl->forName( sOWName ); + } + return xRetClass; +} + +// Fehlermeldungs-Message bei Exception zusammenbauen +String implGetExceptionMsg( Exception& e1 ) +{ + // TODO: NAME??? + static String aBaseMsg( RTL_CONSTASCII_USTRINGPARAM("\nException " ) ); + String aMsg = aBaseMsg; + aMsg.AppendAscii( ": " ); + aMsg += String( e1.Message ); + //aMsg += ": " + U2S( ((Exception&)e1).Message ); + return aMsg; +} + +// Error-Message fuer WrappedTargetExceptions +String implGetWrappedMsg( WrappedTargetException& e1 ) +{ + Any aWrappedAny = e1.TargetException; + + // Haben wir wirklich eine gewrappte Exception? + if( aWrappedAny.getValueType().getTypeClass() == TypeClass_EXCEPTION ) + { + RuntimeException& e = *( (RuntimeException*)aWrappedAny.getValue() ); + return implGetExceptionMsg( e ); + } + // Sonst WrappedTargetException selbst liefern + else + { + return implGetExceptionMsg( e1 ); + } +} + +// Von Uno nach Sbx wandeln +SbxDataType unoToSbxType( const Reference< XIdlClass >& xIdlClass ) +{ + SbxDataType eRetType = SbxVOID; + + if( xIdlClass.is() ) + { + TypeClass eType = xIdlClass->getTypeClass(); + switch( eType ) + { + case TypeClass_INTERFACE: + case TypeClass_TYPE: + case TypeClass_STRUCT: eRetType = SbxOBJECT; break; + + /* folgende Typen lassen wir erstmal weg + case TypeClass_SERVICE: break; + case TypeClass_CLASS: break; + case TypeClass_TYPEDEF: break; + case TypeClass_UNION: break; + case TypeClass_EXCEPTION: break; + case TypeClass_ARRAY: break; + */ + case TypeClass_ENUM: eRetType = SbxLONG; break; + case TypeClass_SEQUENCE: + eRetType = (SbxDataType) ( SbxOBJECT | SbxARRAY ); + break; + + /* + case TypeClass_VOID: break; + case TypeClass_UNKNOWN: break; + */ + + case TypeClass_ANY: eRetType = SbxVARIANT; break; + case TypeClass_BOOLEAN: eRetType = SbxBOOL; break; + case TypeClass_CHAR: eRetType = SbxCHAR; break; + case TypeClass_STRING: eRetType = SbxSTRING; break; + case TypeClass_FLOAT: eRetType = SbxSINGLE; break; + case TypeClass_DOUBLE: eRetType = SbxDOUBLE; break; + //case TypeClass_OCTET: break; + case TypeClass_BYTE: eRetType = SbxBYTE; break; + //case TypeClass_INT: eRetType = SbxINT; break; + case TypeClass_SHORT: eRetType = SbxINTEGER; break; + case TypeClass_LONG: eRetType = SbxLONG; break; + //case TypeClass_HYPER: break; + //case TypeClass_UNSIGNED_OCTET: break; + case TypeClass_UNSIGNED_SHORT: eRetType = SbxUSHORT; break; + case TypeClass_UNSIGNED_LONG: eRetType = SbxULONG; break; + //case TypeClass_UNSIGNED_HYPER: break; + //case TypeClass_UNSIGNED_INT: eRetType = SbxUINT; break; + //case TypeClass_UNSIGNED_BYTE: eRetType = SbxUSHORT; break; + } + } + return eRetType; +} + +void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) +{ + Type aType = aValue.getValueType(); + TypeClass eTypeClass = aType.getTypeClass(); + switch( eTypeClass ) + { + case TypeClass_TYPE: + { + // Map Type to IdlClass + Type aType; + aValue >>= aType; + Reference<XIdlClass> xClass = TypeToIdlClass( aType ); + Any aClassAny; + aClassAny <<= xClass; + + // SbUnoObject instanzieren + String aName; + SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aClassAny ); + SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject; + + // #51475 Wenn das Objekt ungueltig ist null liefern + if( pSbUnoObject->getUnoAny().getValueType().getTypeClass() == TypeClass_VOID ) + { + pVar->PutObject( NULL ); + } + else + { + pVar->PutObject( xWrapper ); + } + } + break; + + // Interfaces und Structs muessen in ein SbUnoObject gewrappt werden + case TypeClass_INTERFACE: + case TypeClass_STRUCT: + { + // SbUnoObject instanzieren + String aName; + SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aValue ); + SbxObjectRef xWrapper = (SbxObject*)pSbUnoObject; + + // #51475 Wenn das Objekt ungueltig ist null liefern + if( pSbUnoObject->getUnoAny().getValueType().getTypeClass() == TypeClass_VOID ) + { + pVar->PutObject( NULL ); + } + else + { + pVar->PutObject( xWrapper ); + } + } + break; + + /* folgende Typen lassen wir erstmal weg + case TypeClass_SERVICE: break; + case TypeClass_CLASS: break; + case TypeClass_TYPEDEF: break; + case TypeClass_UNION: break; + case TypeClass_ENUM: break; + case TypeClass_EXCEPTION: break; + case TypeClass_ARRAY: break; + */ + + case TypeClass_ENUM: + { + sal_Int32 nEnum = 0; + enum2int( nEnum, aValue ); + pVar->PutLong( nEnum ); + } + break; + + case TypeClass_SEQUENCE: + { + Reference< XIdlClass > xIdlTargetClass = TypeToIdlClass( aType ); + Reference< XIdlArray > xIdlArray = xIdlTargetClass->getArray(); + sal_Int32 i, nLen = xIdlArray->getLen( aValue ); + // In Basic Array anlegen + SbxDimArrayRef xArray = new SbxDimArray( SbxVARIANT ); + if( nLen >= 0 ) + xArray->unoAddDim( 0, nLen - 1 ); + + // Elemente als Variablen eintragen + for( i = 0 ; i < nLen ; i++ ) + { + // Elemente wandeln + Any aElementAny = xIdlArray->get( aValue, (UINT32)i ); + //Any aElementAny = pSeqReflection->get( aValue, (UINT32)i ); + SbxVariableRef xVar = new SbxVariable( SbxVARIANT ); + unoToSbxValue( (SbxVariable*)xVar, aElementAny ); + + // Ins Array braten + short nIndex = (short)i; + xArray->Put( (SbxVariable*)xVar, &nIndex ); + } + + // Array zurueckliefern + USHORT nFlags = pVar->GetFlags(); + pVar->ResetFlag( SBX_FIXED ); + pVar->PutObject( (SbxDimArray*)xArray ); + pVar->SetFlags( nFlags ); + + // #54548, Die Parameter duerfen hier nicht weggehauen werden + //pVar->SetParameters( NULL ); + } + break; + + /* + case TypeClass_SEQUENCE: break; + case TypeClass_VOID: break; + case TypeClass_UNKNOWN: break; + + case TypeClass_ANY: + { + // Any rausholen und konvertieren + //Any* pAny = (Any*)aValue.get(); + //if( pAny ) + //unoToSbxValue( pVar, *pAny ); + } + break; + */ + + case TypeClass_BOOLEAN: pVar->PutBool( *(sal_Bool*)aValue.getValue() ); break; + case TypeClass_CHAR: { sal_Unicode val; aValue >>= val; pVar->PutChar( val ); } break; + case TypeClass_STRING: { OUString val; aValue >>= val; pVar->PutString( String( val ) ); } break; + case TypeClass_FLOAT: { float val; aValue >>= val; pVar->PutSingle( val ); } break; + case TypeClass_DOUBLE: { double val; aValue >>= val; pVar->PutDouble( val ); } break; + //case TypeClass_OCTET: break; + case TypeClass_BYTE: { sal_Int8 val; aValue >>= val; pVar->PutByte( val ); } break; + //case TypeClass_INT: break; + case TypeClass_SHORT: { sal_Int16 val; aValue >>= val; pVar->PutInteger( val ); } break; + case TypeClass_LONG: { sal_Int32 val; aValue >>= val; pVar->PutLong( val ); } break; + //case TypeClass_HYPER: break; + //case TypeClass_UNSIGNED_OCTET:break; + case TypeClass_UNSIGNED_SHORT: { sal_uInt16 val; aValue >>= val; pVar->PutUShort( val ); } break; + case TypeClass_UNSIGNED_LONG: { sal_uInt32 val; aValue >>= val; pVar->PutULong( val ); } break; + //case TypeClass_UNSIGNED_HYPER:break; + //case TypeClass_UNSIGNED_INT: break; + //case TypeClass_UNSIGNED_BYTE: break; + default: pVar->PutEmpty(); break; + } +} + +// Reflection fuer Sbx-Typen liefern +Type getUnoTypeForSbxBaseType( SbxDataType eType ) +{ + Type aRetType = getCppuVoidType(); + switch( eType ) + { + //case SbxEMPTY: eRet = TypeClass_VOID; break; + case SbxNULL: aRetType = ::getCppuType( (const Reference< XInterface > *)0 ); break; + case SbxINTEGER: aRetType = ::getCppuType( (sal_Int16*)0 ); break; + case SbxLONG: aRetType = ::getCppuType( (sal_Int32*)0 ); break; + case SbxSINGLE: aRetType = ::getCppuType( (float*)0 ); break; + case SbxDOUBLE: aRetType = ::getCppuType( (double*)0 ); break; + //case SbxCURRENCY: break; + case SbxDATE: aRetType = ::getCppuType( (double*)0 ); break; + case SbxSTRING: aRetType = ::getCppuType( (OUString*)0 ); break; + //case SbxOBJECT: break; + //case SbxERROR: break; + case SbxBOOL: aRetType = ::getCppuType( (sal_Bool*)0 ); break; + case SbxVARIANT: aRetType = ::getCppuType( (Any*)0 ); break; + //case SbxDATAOBJECT: break; + case SbxCHAR: aRetType = ::getCppuType( (sal_Unicode*)0 ); break; + case SbxBYTE: aRetType = ::getCppuType( (sal_Int8*)0 ); break; + case SbxUSHORT: aRetType = ::getCppuType( (sal_uInt16*)0 ); break; + case SbxULONG: aRetType = ::getCppuType( (sal_uInt32*)0 ); break; + //case SbxLONG64: break; + //case SbxULONG64: break; + // Maschinenabhaengige zur Sicherheit auf Hyper abbilden + case SbxINT: aRetType = ::getCppuType( (sal_Int32*)0 ); break; + case SbxUINT: aRetType = ::getCppuType( (sal_uInt32*)0 ); break; + //case SbxVOID: break; + //case SbxHRESULT: break; + //case SbxPOINTER: break; + //case SbxDIMARRAY: break; + //case SbxCARRAY: break; + //case SbxUSERDEF: break; + //case SbxLPSTR: break; + //case SbxLPWSTR: break; + //case SbxCoreSTRING: break; + } + return aRetType; +} + +// Konvertierung von Sbx nach Uno ohne bekannte Zielklasse fuer TypeClass_ANY +Type getUnoTypeForSbxValue( SbxValue* pVal ) +{ + Type aRetType = getCppuVoidType(); + if( !pVal ) + return aRetType; + + // SbxType nach Uno wandeln + SbxDataType eBaseType = pVal->SbxValue::GetType(); + if( eBaseType == SbxOBJECT ) + { + SbxBaseRef xObj = (SbxBase*)pVal->GetObject(); + if( !xObj ) + { + StarBASIC::Error( SbERR_INVALID_OBJECT ); + return aRetType; + } + + if( xObj->ISA(SbxDimArray) ) + { + SbxBase* pObj = (SbxBase*)xObj; + SbxDimArray* pArray = (SbxDimArray*)pObj; + + // es muss ein eindimensionales Array sein + short nLower, nUpper; + if( pArray->GetDims() == 1 && pArray->GetDim( 1, nLower, nUpper ) ) + { + INT32 nSize = nUpper - nLower + 1; + Type aElementType; + if( nSize == 0 ) + { + aElementType = getUnoTypeForSbxBaseType( (SbxDataType)(pArray->GetType() & 0xfff) ); + } + else + { + // Wenn alle Elemente des Arrays vom gleichen Typ sind, wird + // der genommen, sonst wird das ganze als Any-Sequence betrachtet + sal_Bool bInit = sal_False; + + short nIdx = nLower; + for( UINT32 i = 0 ; i < nSize ; i++,nIdx++ ) + { + SbxVariableRef xVar = pArray->Get( &nIdx ); + Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar ); + if( !bInit ) + { + aElementType = aType; + bInit = sal_True; + } + else if( aElementType != aType ) + { + // Verschiedene Typen -> AnySequence + aElementType = getCppuType( (Any*)0 ); + break; + } + } + } + + OUString aSeqTypeName( RTL_CONSTASCII_USTRINGPARAM("[]") ); + aSeqTypeName += aElementType.getTypeName(); + aRetType = Type( TypeClass_SEQUENCE, aSeqTypeName ); + } + // Ein Array mit Dim > 1 wird nicht konvertiert -> default==void liefern + } + // Kein Array, sondern... + else if( xObj->ISA(SbUnoObject) ) + { + aRetType = ((SbUnoObject*)(SbxBase*)xObj)->getUnoAny().getValueType(); + } + // Sonst ist es ein Nicht-Uno-Basic-Objekt -> default==void liefern + } + // Kein Objekt, Basistyp konvertieren + else + { + aRetType = getUnoTypeForSbxBaseType( eBaseType ); + } + return aRetType; +} + +// Deklaration Konvertierung von Sbx nach Uno mit bekannter Zielklasse +Any sbxToUnoValue( SbxVariable* pVar, const Reference< XIdlClass >& xIdlTargetClass ); + +// Konvertierung von Sbx nach Uno ohne bekannte Zielklasse fuer TypeClass_ANY +Any sbxToUnoValue( SbxVariable* pVar ) +{ + Type aType = getUnoTypeForSbxValue( pVar ); + return sbxToUnoValue( pVar, TypeToIdlClass( aType ) ); +} + +// Konvertierung von Sbx nach Uno mit bekannter Zielklasse +Any sbxToUnoValue( SbxVariable* pVar, const Reference< XIdlClass >& xIdlTargetClass ) +{ + Any aRetVal; + //aRetVal.setVoid(); + + TypeClass eType = xIdlTargetClass->getTypeClass(); + switch( eType ) + { + case TypeClass_INTERFACE: + case TypeClass_STRUCT: + { + // Null-Referenz? + if( pVar->IsNull() && eType == TypeClass_INTERFACE ) + { + Reference< XInterface > xRef; + OUString aClassName = xIdlTargetClass->getName(); + Type aClassType( xIdlTargetClass->getTypeClass(), aClassName.getStr() ); + aRetVal <<= aClassType; + } + else + { + SbxBaseRef pObj = (SbxBase*)pVar->GetObject(); + if( pObj && pObj->ISA(SbUnoObject) ) + aRetVal = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); + } + } + break; + + /* folgende Typen lassen wir erstmal weg + case TypeClass_SERVICE: break; + case TypeClass_CLASS: break; + case TypeClass_TYPEDEF: break; + case TypeClass_UNION: break; + case TypeClass_ENUM: break; + case TypeClass_EXCEPTION: break; + case TypeClass_ARRAY: break; + */ + + // Array -> Sequence + case TypeClass_ENUM: + { + OUString aClassName = xIdlTargetClass->getName(); + Type aEnumType( xIdlTargetClass->getTypeClass(), aClassName.getStr() ); + aRetVal = int2enum( pVar->GetLong(), aEnumType ); + } + break; + + case TypeClass_SEQUENCE: + { + SbxBaseRef xObj = (SbxBase*)pVar->GetObject(); + if( xObj && xObj->ISA(SbxDimArray) ) + { + SbxBase* pObj = (SbxBase*)xObj; + SbxDimArray* pArray = (SbxDimArray*)pObj; + + // Instanz der geforderten Sequence erzeugen + xIdlTargetClass->createObject( aRetVal ); + + // es muss ein eindimensionales Array sein + short nLower, nUpper; + if( pArray->GetDims() == 1 && pArray->GetDim( 1, nLower, nUpper ) ) + { + INT32 nSeqSize = nUpper - nLower + 1; + + Reference< XIdlArray > xArray = xIdlTargetClass->getArray(); + xArray->realloc( aRetVal, nSeqSize ); + + // Element-Type + OUString aClassName = xIdlTargetClass->getName(); + typelib_TypeDescription * pSeqTD = 0; + typelib_typedescription_getByName( &pSeqTD, aClassName.pData ); + OSL_ASSERT( pSeqTD ); +#if SUPD > 600 + Type aElemType( ((typelib_IndirectTypeDescription *)pSeqTD)->pType ); +#else + typelib_TypeDescription * pElementTD = + ((typelib_IndirectTypeDescription *)pSeqTD)->pType; + Type aElemType( pElementTD->pWeakRef ); +#endif + Reference< XIdlClass > xElementClass = TypeToIdlClass( aElemType ); + + // Alle Array-Member umwandeln und eintragen + short nIdx = nLower; + for( sal_Int32 i = 0 ; i < nSeqSize ; i++,nIdx++ ) + { + SbxVariableRef xVar = pArray->Get( &nIdx ); + + // Wert von Sbx nach Uno wandeln + Any aAnyValue = sbxToUnoValue( (SbxVariable*)xVar, xElementClass ); + + try + { + // In die Sequence uebernehmen + xArray->set( aRetVal, i, aAnyValue ); + } + catch( IllegalArgumentException& e1 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e1 ) ); + } + catch (IndexOutOfBoundsException& e2) + { + StarBASIC::Error( SbERR_OUT_OF_RANGE ); + } + } + } + } + } + break; + + /* + case TypeClass_VOID: break; + case TypeClass_UNKNOWN: break; + */ + + // Bei Any die Klassen-unabhaengige Konvertierungs-Routine nutzen + case TypeClass_ANY: + { + aRetVal = sbxToUnoValue( pVar ); + } + break; + + case TypeClass_BOOLEAN: aRetVal <<= (sal_Bool)( pVar->GetBool() ); break; + case TypeClass_CHAR: aRetVal <<= (sal_Unicode)( pVar->GetChar() ); break; + case TypeClass_STRING: aRetVal <<= OUString( pVar->GetString() ); break; + case TypeClass_FLOAT: aRetVal <<= pVar->GetSingle(); break; + case TypeClass_DOUBLE: aRetVal <<= pVar->GetDouble(); break; + //case TypeClass_OCTET: break; + case TypeClass_BYTE: aRetVal <<= (sal_Int8)( pVar->GetByte() ); break; + //case TypeClass_INT: break; + case TypeClass_SHORT: aRetVal <<= (sal_Int16)( pVar->GetInteger() ); break; + case TypeClass_LONG: aRetVal <<= (sal_Int32)( pVar->GetLong() ); break; + //case TypeClass_HYPER: break; + //case TypeClass_UNSIGNED_OCTET:break; + case TypeClass_UNSIGNED_SHORT: aRetVal <<= (sal_uInt16)( pVar->GetUShort() ); break; + case TypeClass_UNSIGNED_LONG: aRetVal <<= (sal_uInt32)( pVar->GetULong() ); break; + //case TypeClass_UNSIGNED_HYPER:break; + //case TypeClass_UNSIGNED_INT: break; + //case TypeClass_UNSIGNED_BYTE: break; + } + + return aRetVal; +} + +// Dbg-Hilfsmethode zum Auslesen der in einem Object implementierten Interfaces +String Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, USHORT nRekLevel ) +{ + Type aIfaceType = ::getCppuType( (const Reference< XInterface > *)0 ); + static Reference< XIdlClass > xIfaceClass = TypeToIdlClass( aIfaceType ); + + String aRetStr; + for( USHORT i = 0 ; i < nRekLevel ; i++ ) + aRetStr.AppendAscii( " " ); + aRetStr += String( xClass->getName() ); + OUString aClassName = xClass->getName(); + Type aClassType( xClass->getTypeClass(), aClassName.getStr() ); + + // Pruefen, ob das Interface wirklich unterstuetzt wird + if( !x->queryInterface( aClassType ).hasValue() ) + { + aRetStr.AppendAscii( " (ERROR: Not really supported!)\n" ); + } + // Gibt es Super-Interfaces + else + { + aRetStr.AppendAscii( "\n" ); + + // Super-Interfaces holen + Sequence< Reference< XIdlClass > > aSuperClassSeq = xClass->getSuperclasses(); + const Reference< XIdlClass >* pClasses = aSuperClassSeq.getConstArray(); + UINT32 nSuperIfaceCount = aSuperClassSeq.getLength(); + for( UINT32 j = 0 ; j < nSuperIfaceCount ; j++ ) + { + const Reference< XIdlClass >& rxIfaceClass = pClasses[j]; + if( !rxIfaceClass->equals( xIfaceClass ) ) + aRetStr += Impl_GetInterfaceInfo( x, rxIfaceClass, nRekLevel + 1 ); + } + } + return aRetStr; +} + +// Dbg-Hilfsmethode zum Auslesen der in einem Object implementierten Interfaces +String Impl_GetSupportedInterfaces( const String& rName, const Any& aToInspectObj ) +{ + //static Reference< XIdlClass > xUsrObjectClass = UsrObject::getUsrObjectIdlClass(); + + // #54898: Nur TypeClass Interface zulasssen + TypeClass eType = aToInspectObj.getValueType().getTypeClass(); + String aRet; + if( eType != TypeClass_INTERFACE ) + { + aRet += ID_DBG_SUPPORTEDINTERFACES; + aRet.AppendAscii( " not available for \"" ); + aRet += rName; + aRet.AppendAscii( "\"\n(TypeClass is not TypeClass_INTERFACE)" ); + } + else + { + // Interface aus dem Any besorgen + const Reference< XInterface > x = *(Reference< XInterface >*)aToInspectObj.getValue(); + + // XIdlClassProvider-Interface ansprechen + Reference< XIdlClassProvider > xClassProvider( x, UNO_QUERY ); + Reference< XTypeProvider > xTypeProvider( x, UNO_QUERY ); + + aRet.AssignAscii( "Supported interfaces by object " ); + if( xTypeProvider.is() ) + aRet.AppendAscii( "(using XTypeProvider) " ); + if( rName.Len() > 20 ) + aRet.AppendAscii( "\n" ); + aRet.AppendAscii( "(Type \"" ); + aRet += rName; + aRet.AppendAscii( "\"):\n" ); + if( xTypeProvider.is() ) + { + // Interfaces der Implementation holen + Sequence< Type > aTypeSeq = xTypeProvider->getTypes(); + //Sequence< Reference< XIdlClass > > aClassSeq = xTypeProvider->getTypes(); + const Type* pTypeArray = aTypeSeq.getConstArray(); + UINT32 nIfaceCount = aTypeSeq.getLength(); + for( UINT32 j = 0 ; j < nIfaceCount ; j++ ) + { + const Type& rType = pTypeArray[j]; + aRet += Impl_GetInterfaceInfo( x, TypeToIdlClass( rType ), 1 ); + } + } + else if( xClassProvider.is() ) + { + + DBG_ERROR( "XClassProvider not supported in UNO3" ); + } + } + return aRet; +} + + + +// Dbg-Hilfsmethode SbxDataType -> String +String Dbg_SbxDataType2String( SbxDataType eType ) +{ + String aRet( RTL_CONSTASCII_USTRINGPARAM("Unknown Sbx-Type!") ); + switch( eType ) + { + case SbxEMPTY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxEMPTY") ); break; + case SbxNULL: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxNULL") ); break; + case SbxINTEGER: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxINTEGER") ); break; + case SbxLONG: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLONG") ); break; + case SbxSINGLE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxSINGLE") ); break; + case SbxDOUBLE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDOUBLE") ); break; + case SbxCURRENCY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCURRENCY") ); break; + case SbxDATE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDATE") ); break; + case SbxSTRING: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxSTRING") ); break; + case SbxOBJECT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxOBJECT") ); break; + case SbxERROR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxERROR") ); break; + case SbxBOOL: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxBOOL") ); break; + case SbxVARIANT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxVARIANT") ); break; + case SbxDATAOBJECT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDATAOBJECT") ); break; + case SbxCHAR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCHAR") ); break; + case SbxBYTE: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxBYTE") ); break; + case SbxUSHORT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUSHORT") ); break; + case SbxULONG: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxULONG") ); break; + case SbxLONG64: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLONG64") ); break; + case SbxULONG64: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxULONG64") ); break; + case SbxINT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxINT") ); break; + case SbxUINT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUINT") ); break; + case SbxVOID: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxVOID") ); break; + case SbxHRESULT: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxHRESULT") ); break; + case SbxPOINTER: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxPOINTER") ); break; + case SbxDIMARRAY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxDIMARRAY") ); break; + case SbxCARRAY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCARRAY") ); break; + case SbxUSERDEF: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxUSERDEF") ); break; + case SbxLPSTR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLPSTR") ); break; + case SbxLPWSTR: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxLPWSTR") ); break; + case SbxCoreSTRING: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxCoreSTRING" ) ); break; + case SbxOBJECT | SbxARRAY: aRet = String( RTL_CONSTASCII_USTRINGPARAM("SbxARRAY") ); break; + } + return aRet; +} + +// Dbg-Hilfsmethode zum Anzeigen der Properties eines SbUnoObjects +String Impl_DumpProperties( const String& rName, SbUnoObject* pUnoObj ) +{ + String aRet( RTL_CONSTASCII_USTRINGPARAM("Properties of object ") ); + if( rName.Len() > 20 ) + aRet.AppendAscii( "\n" ); + aRet.AppendAscii( "(Type \"" ); + aRet += rName; + aRet.AppendAscii( "\"):" ); + + // Uno-Infos auswerten, um Arrays zu erkennen + Reference< XIntrospectionAccess > xAccess = pUnoObj->getIntrospectionAccess(); + if( !xAccess.is() ) + { + Reference< XInvocation > xInvok = pUnoObj->getInvocation(); + if( xInvok.is() ) + xAccess = xInvok->getIntrospection(); + } + if( !xAccess.is() ) + { + aRet.AppendAscii( "\nUnknown, no introspection available" ); + return aRet; + } + + Sequence<Property> props = xAccess->getProperties( PropertyConcept::ALL - PropertyConcept::DANGEROUS ); + UINT32 nUnoPropCount = props.getLength(); + const Property* pUnoProps = props.getConstArray(); + + SbxArray* pProps = pUnoObj->GetProperties(); + USHORT nPropCount = pProps->Count(); + USHORT nPropsPerLine = 1 + nPropCount / 30; + for( USHORT i = 0; i < nPropCount; i++ ) + { + SbxVariable* pVar = pProps->Get( i ); + if( pVar ) + { + String aPropStr; + if( (i % nPropsPerLine) == 0 ) + aPropStr.AppendAscii( "\n" ); + + // Typ und Namen ausgeben + // Ist es in Uno eine Sequence? + SbxDataType eType = pVar->GetFullType(); + + BOOL bMaybeVoid = FALSE; + if( i < nUnoPropCount ) + { + const Property& rProp = pUnoProps[ i ]; + + // #63133: Bei MAYBEVOID Typ aus Uno neu konvertieren, + // damit nicht immer nur SbxEMPTY ausgegben wird. + if( rProp.Attributes & PropertyAttribute::MAYBEVOID ) + { + eType = unoToSbxType( TypeToIdlClass( rProp.Type ) ); + bMaybeVoid = TRUE; + } + if( eType == SbxOBJECT ) + { + Type aType = rProp.Type; + if( aType.getTypeClass() == TypeClass_SEQUENCE ) + eType = (SbxDataType) ( SbxOBJECT | SbxARRAY ); + } + } + aPropStr += Dbg_SbxDataType2String( eType ); + if( bMaybeVoid ) + aPropStr.AppendAscii( "/void" ); + aPropStr.AppendAscii( " " ); + aPropStr += pVar->GetName(); + + if( i == nPropCount - 1 ) + aPropStr.AppendAscii( "\n" ); + else + aPropStr.AppendAscii( "; " ); + + aRet += aPropStr; + } + } + return aRet; +} + +// Dbg-Hilfsmethode zum Anzeigen der Methoden eines SbUnoObjects +String Impl_DumpMethods( const String& rName, SbUnoObject* pUnoObj ) +{ + String aRet( RTL_CONSTASCII_USTRINGPARAM("Methods of object ") ); + if( rName.Len() > 20 ) + aRet.AppendAscii( "\n" ); + aRet.AppendAscii( "(Type \"" ); + aRet += rName; + aRet.AppendAscii( "\"):" ); + + // XIntrospectionAccess, um die Typen der Parameter auch ausgeben zu koennen + Reference< XIntrospectionAccess > xAccess = pUnoObj->getIntrospectionAccess(); + if( !xAccess.is() ) + { + Reference< XInvocation > xInvok = pUnoObj->getInvocation(); + if( xInvok.is() ) + xAccess = xInvok->getIntrospection(); + } + if( !xAccess.is() ) + { + aRet.AppendAscii( "\nUnknown, no introspection available" ); + return aRet; + } + Sequence< Reference< XIdlMethod > > methods = xAccess->getMethods + ( MethodConcept::ALL - MethodConcept::DANGEROUS ); + const Reference< XIdlMethod >* pUnoMethods = methods.getConstArray(); + + SbxArray* pMethods = pUnoObj->GetMethods(); + USHORT nMethodCount = pMethods->Count(); + USHORT nPropsPerLine = 1 + nMethodCount / 30; + for( USHORT i = 0; i < nMethodCount; i++ ) + { + SbxVariable* pVar = pMethods->Get( i ); + if( pVar ) + { + String aPropStr; + if( (i % nPropsPerLine) == 0 ) + aPropStr.AppendAscii( "\n" ); + + // Methode ansprechen + const Reference< XIdlMethod >& rxMethod = pUnoMethods[i]; + + // Ist es in Uno eine Sequence? + SbxDataType eType = pVar->GetFullType(); + if( eType == SbxOBJECT ) + { + Reference< XIdlClass > xClass = rxMethod->getReturnType(); + if( xClass.is() && xClass->getTypeClass() == TypeClass_SEQUENCE ) + eType = (SbxDataType) ( SbxOBJECT | SbxARRAY ); + } + // Name und Typ ausgeben + aPropStr += Dbg_SbxDataType2String( eType ); + aPropStr.AppendAscii( " " ); + aPropStr += pVar->GetName(); + aPropStr.AppendAscii( " ( " ); + + // get-Methode darf keinen Parameter haben + Sequence< Reference< XIdlClass > > aParamsSeq = rxMethod->getParameterTypes(); + UINT32 nParamCount = aParamsSeq.getLength(); + const Reference< XIdlClass >* pParams = aParamsSeq.getConstArray(); + + if( nParamCount > 0 ) + { + for( USHORT j = 0; j < nParamCount; j++ ) + { + String aTypeStr = Dbg_SbxDataType2String( unoToSbxType( pParams[ j ] ) ); + aPropStr += aTypeStr; + + if( j < nParamCount - 1 ) + aPropStr.AppendAscii( ", " ); + } + } + else + aPropStr.AppendAscii( "void" ); + + aPropStr.AppendAscii( " ) " ); + + if( i == nMethodCount - 1 ) + aPropStr.AppendAscii( "\n" ); + else + aPropStr.AppendAscii( "; " ); + + aRet += aPropStr; + } + } + return aRet; +} + +// Implementation SbUnoObject +void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) +{ + if( bNeedIntrospection ) doIntrospection(); + + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbxArray* pParams = pVar->GetParameters(); + SbUnoProperty* pProp = PTR_CAST(SbUnoProperty,pVar); + SbUnoMethod* pMeth = PTR_CAST(SbUnoMethod,pVar); + if( pProp ) + { + if( pHint->GetId() == SBX_HINT_DATAWANTED ) + { + // Test-Properties + INT32 nId = (INT32)pProp->nId; + if( nId < 0 ) + { + // Id == -1: Implementierte Interfaces gemaess ClassProvider anzeigen + if( nId == -1 ) // Property ID_DBG_SUPPORTEDINTERFACES" + { + String aRetStr = Impl_GetSupportedInterfaces( GetClassName(), getUnoAny() ); + pVar->PutString( aRetStr ); + } + // Id == -2: Properties ausgeben + else if( nId == -2 ) // Property ID_DBG_PROPERTIES + { + // Jetzt muessen alle Properties angelegt werden + implCreateAll(); + String aRetStr = Impl_DumpProperties( GetClassName(), this ); + pVar->PutString( aRetStr ); + } + // Id == -3: Methoden ausgeben + else if( nId == -3 ) // Property ID_DBG_METHODS + { + // Jetzt muessen alle Properties angelegt werden + implCreateAll(); + String aRetStr = Impl_DumpMethods( GetClassName(), this ); + pVar->PutString( aRetStr ); + } + return; + } + + if( mxUnoAccess.is() ) + { + try + { + // Wert holen + Reference< XPropertySet > xPropSet( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY ); + Any aRetAny = xPropSet->getPropertyValue( pProp->GetName() ); + // Die Nutzung von getPropertyValue (statt ueber den Index zu gehen) ist + // nicht optimal, aber die Umstellung auf XInvocation steht ja ohnehin an + // Ansonsten kann auch FastPropertySet genutzt werden + + // Wert von Uno nach Sbx uebernehmen + unoToSbxValue( pVar, aRetAny ); + } + catch( WrappedTargetException& e1 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetWrappedMsg( e1 ) ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e2 ) ); + } + catch( Exception& e3 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e3 ) ); + } + } + else if( mxInvocation.is() ) + { + try + { + // Wert holen + Any aRetAny = mxInvocation->getValue( pProp->GetName() ); + + // Wert von Uno nach Sbx uebernehmen + unoToSbxValue( pVar, aRetAny ); + } + catch( WrappedTargetException& e1 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetWrappedMsg( e1 ) ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e2 ) ); + } + catch( Exception& e3 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e3 ) ); + } + } + } + else if( pHint->GetId() == SBX_HINT_DATACHANGED ) + { + if( mxUnoAccess.is() ) + { + if( pProp->aUnoProp.Attributes & PropertyAttribute::READONLY ) + { + StarBASIC::Error( SbERR_PROP_READONLY ); + return; + } + + // Wert von Uno nach Sbx uebernehmen + Any aAnyValue = sbxToUnoValue( pVar, TypeToIdlClass( pProp->aUnoProp.Type ) ); + try + { + // Wert setzen + Reference< XPropertySet > xPropSet( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY ); + xPropSet->setPropertyValue( pProp->GetName(), aAnyValue ); + // Die Nutzung von getPropertyValue (statt ueber den Index zu gehen) ist + // nicht optimal, aber die Umstellung auf XInvocation steht ja ohnehin an + // Ansonsten kann auch FastPropertySet genutzt werden + } + catch( WrappedTargetException& e1 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetWrappedMsg( e1 ) ); + } + catch( IllegalArgumentException& e2 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e2 ) ); + } + catch( RuntimeException& e3 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e3 ) ); + } + catch( Exception& e4 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e4 ) ); + } + } + else if( mxInvocation.is() ) + { + // Wert von Uno nach Sbx uebernehmen + Any aAnyValue = sbxToUnoValue( pVar ); + try + { + // Wert setzen + mxInvocation->setValue( pProp->GetName(), aAnyValue ); + } + catch( WrappedTargetException& e1 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetWrappedMsg( e1 ) ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e2 ) ); + } + catch( Exception& e3 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e3 ) ); + } + } + } + } + else if( pMeth ) + { + if( pHint->GetId() == SBX_HINT_DATAWANTED ) + { + UINT32 nParamCount = 0; + Sequence<Any> args; + BOOL bOutParams = FALSE; + UINT32 i; + if( pParams ) + { + // Anzahl Parameter -1 wegen Param0 == this + nParamCount = (UINT32)pParams->Count() - 1; + args.realloc( nParamCount ); + Any* pAnyArgs = args.getArray(); + + if( mxUnoAccess.is() ) + { + // Infos holen + const Sequence<ParamInfo>& rInfoSeq = pMeth->getParamInfos(); + const ParamInfo* pParamInfos = rInfoSeq.getConstArray(); + UINT32 nUnoParamCount = rInfoSeq.getLength(); + + // Ueberschuessige Parameter ignorieren, Alternative: Error schmeissen + if( nParamCount > nUnoParamCount ) + nParamCount = nUnoParamCount; + + for( i = 0 ; i < nParamCount ; i++ ) + { + const ParamInfo& rInfo = pParamInfos[i]; + const Reference< XIdlClass >& rxClass = rInfo.aType; + //const XIdlClassRef& rxClass = pUnoParams[i]; + + // ACHTUNG: Bei den Sbx-Parametern den Offset nicht vergessen! + pAnyArgs[i] = sbxToUnoValue( pParams->Get( (USHORT)(i+1) ), rxClass ); + + // Wenn es nicht schon feststeht pruefen, ob Out-Parameter vorliegen + if( !bOutParams ) + { + ParamMode aParamMode = rInfo.aMode; + if( aParamMode != ParamMode_IN ) + bOutParams = TRUE; + } + } + } + else if( mxInvocation.is() ) + { + for( i = 0 ; i < nParamCount ; i++ ) + { + // ACHTUNG: Bei den Sbx-Parametern den Offset nicht vergessen! + pAnyArgs[i] = sbxToUnoValue( pParams->Get( (USHORT)(i+1) ) ); + } + } + } + + // Methode callen + try + { + if( mxUnoAccess.is() ) + { + Any aRetAny = pMeth->m_xUnoMethod->invoke( getUnoAny(), args ); + + // Wert von Uno nach Sbx uebernehmen + unoToSbxValue( pVar, aRetAny ); + + // Muessen wir Out-Parameter zurueckkopieren? + if( bOutParams ) + { + const Any* pAnyArgs = args.getConstArray(); + + // Infos holen + const Sequence<ParamInfo>& rInfoSeq = pMeth->getParamInfos(); + const ParamInfo* pParamInfos = rInfoSeq.getConstArray(); + + UINT32 i; + for( i = 0 ; i < nParamCount ; i++ ) + { + const ParamInfo& rInfo = pParamInfos[i]; + ParamMode aParamMode = rInfo.aMode; + if( aParamMode != ParamMode_IN ) + unoToSbxValue( (SbxVariable*)pParams->Get( (USHORT)(i+1) ), pAnyArgs[ i ] ); + } + } + } + else if( mxInvocation.is() ) + { + Sequence< INT16 > OutParamIndex; + Sequence< Any > OutParam; + Any aRetAny = mxInvocation->invoke( pMeth->GetName(), args, OutParamIndex, OutParam ); + + // Wert von Uno nach Sbx uebernehmen + unoToSbxValue( pVar, aRetAny ); + + const INT16* pIndices = OutParamIndex.getConstArray(); + UINT32 nLen = OutParamIndex.getLength(); + if( nLen ) + { + const Any* pNewValues = OutParam.getConstArray(); + for( UINT32 i = 0 ; i < nLen ; i++ ) + { + INT16 iTarget = pIndices[ i ]; + if( iTarget >= nParamCount ) + break; + unoToSbxValue( (SbxVariable*)pParams->Get( (USHORT)(i+1) ), pNewValues[ i ] ); + } + } + } + + // #55460, Parameter hier weghauen, da das in unoToSbxValue() + // bei Arrays wegen #54548 nicht mehr gemacht wird + if( pParams ) + pVar->SetParameters( NULL ); + } + catch( WrappedTargetException& e1 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetWrappedMsg( e1 ) ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e2 ) ); + } + catch( Exception& e3 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e3 ) ); + } + /* + catch( NullPointerException& e1 ) + { + } + catch( InvocationTargetException& e2 ) + { + } + catch( IllegalArgumentException& e3) + { + } + */ + } + } + else + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + } +} + + +#ifdef INVOCATION_ONLY +// Aus USR +Reference< XInvocation > createDynamicInvocationFor( const Any& aAny ); +#endif + +SbUnoObject::SbUnoObject( const String& aName, const Any& aUnoObj_ ) + : SbxObject( aName ) +{ + static Reference< XIntrospection > xIntrospection; + + // Default-Properties von Sbx wieder rauspruegeln + Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_DONTCARE ); + Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Parent") ), SbxCLASS_DONTCARE ); + + // Typ des Objekts pruefen + TypeClass eType = aUnoObj_.getValueType().getTypeClass(); + Reference< XInterface > x; + if( eType == TypeClass_INTERFACE ) + { + // Interface aus dem Any besorgen + x = *(Reference< XInterface >*)aUnoObj_.getValue(); + if( !x.is() ) + return; + } + +#ifdef INVOCATION_ONLY + // Invocation besorgen + mxInvocation = createDynamicInvocationFor( aUnoObj_ ); +#else + // Hat das Object selbst eine Invocation? + mxInvocation = Reference< XInvocation >( x, UNO_QUERY ); +#endif + + if( mxInvocation.is() ) + { + // MaterialHolder holen + mxMaterialHolder = Reference< XMaterialHolder >::query( mxInvocation ); + + // ExactName holen + mxExactName = Reference< XExactName >::query( mxInvocation ); + + // Rest bezieht sich nur auf Introspection + bNeedIntrospection = FALSE; + return; + } + + // Introspection-Flag + bNeedIntrospection = TRUE; + maTmpUnoObj = aUnoObj_; + + + //*** Namen bestimmen *** + BOOL bFatalError = TRUE; + + // Ist es ein Interface oder eine struct? + BOOL bSetClassName = FALSE; + String aClassName; + if( eType == TypeClass_STRUCT ) + { + // Struct ist Ok + bFatalError = FALSE; + + // #67173 Echten Klassen-Namen eintragen + if( aName.Len() == 0 ) + { + aClassName = String( aUnoObj_.getValueType().getTypeName() ); + bSetClassName = TRUE; + } + } + else if( eType == TypeClass_INTERFACE ) + { + // #70197 Interface geht immer durch Typ im Any + bFatalError = FALSE; + + // Nach XIdlClassProvider-Interface fragen + Reference< XIdlClassProvider > xClassProvider( x, UNO_QUERY ); + if( xClassProvider.is() ) + { + // #67173 Echten Klassen-Namen eintragen + if( aName.Len() == 0 ) + { + Sequence< Reference< XIdlClass > > szClasses = xClassProvider->getIdlClasses(); + UINT32 nLen = szClasses.getLength(); + if( nLen ) + { + const Reference< XIdlClass > xImplClass = szClasses.getConstArray()[ 0 ]; + if( xImplClass.is() ) + { + aClassName = String( xImplClass->getName() ); + bSetClassName = TRUE; + } + } + } + } + } + if( bSetClassName ) + SetClassName( aClassName ); + + // Weder Interface noch Struct -> FatalError + if( bFatalError ) + { + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + return; + } + + // #67781 Introspection erst on demand durchfuehren +} + +SbUnoObject::~SbUnoObject() +{} + + +// #76470 Introspection on Demand durchfuehren +void SbUnoObject::doIntrospection( void ) +{ + static Reference< XIntrospection > xIntrospection; + + if( !bNeedIntrospection ) + return; + bNeedIntrospection = FALSE; + + if( !xIntrospection.is() ) + { + // Introspection-Service holen + Reference< XMultiServiceFactory > xFactory( utl::getProcessServiceFactory() ); + if ( xFactory.is() ) + { + Reference< XInterface > xI = xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.beans.Introspection") ); + if (xI.is()) + xIntrospection = Reference< XIntrospection >::query( xI ); + //xI->queryInterface( ::getCppuType( (const Reference< XIntrospection > *)0 ), xIntrospection ); + } + } + if( !xIntrospection.is() ) + { + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + return; + } + + // Introspection durchfuehren + try + { + mxUnoAccess = xIntrospection->inspect( maTmpUnoObj ); + } + catch( RuntimeException& e ) + { + String aMsg = implGetExceptionMsg( e ); + } + + if( !mxUnoAccess.is() ) + { + // #51475 Ungueltiges Objekt kennzeichnen (kein mxMaterialHolder) + return; + } + + // MaterialHolder vom Access holen + mxMaterialHolder = Reference< XMaterialHolder >::query( mxUnoAccess ); + + // ExactName vom Access holen + mxExactName = Reference< XExactName >::query( mxUnoAccess ); +} + + + + +// #67781 Start einer Liste aller SbUnoMethod-Instanzen +static SbUnoMethod* pFirst = NULL; + +void clearUnoMethods( void ) +{ + SbUnoMethod* pMeth = pFirst; + while( pMeth ) + { + pMeth->SbxValue::Clear(); + pMeth = pMeth->pNext; + } +} + + +SbUnoMethod::SbUnoMethod +( + const String& aName, + SbxDataType eSbxType, + Reference< XIdlMethod > xUnoMethod_ +) + : SbxMethod( aName, eSbxType ) +{ + m_xUnoMethod = xUnoMethod_; + pParamInfoSeq = NULL; + + // #67781 Methode in Liste eintragen + pNext = pFirst; + pPrev = NULL; + pFirst = this; + if( pNext ) + pNext->pPrev = this; +} + +SbUnoMethod::~SbUnoMethod() +{ + delete pParamInfoSeq; + + if( this == pFirst ) + pFirst = pNext; + else if( pPrev ) + pPrev->pNext = pNext; + if( pNext ) + pNext->pPrev = pPrev; +} + +const Sequence<ParamInfo>& SbUnoMethod::getParamInfos( void ) +{ + if( !pParamInfoSeq ) + { + Sequence<ParamInfo> aTmp = m_xUnoMethod->getParameterInfos() ; + pParamInfoSeq = new Sequence<ParamInfo>( aTmp ); + //pParamInfoSeq = new Sequence<ParamInfo>( m_xUnoMethod->getParameterInfos() ); + } + return *pParamInfoSeq; +} + +SbUnoProperty::SbUnoProperty +( + const String& aName, + SbxDataType eSbxType, + const Property& aUnoProp_, + UINT32 nId_ +) + : SbxProperty( aName, eSbxType ) +{ + aUnoProp = aUnoProp_; + nId = nId_; + + // #54548, bei bedarf Dummy-Array einsetzen, damit SbiRuntime::CheckArray() geht + static SbxArrayRef xDummyArray = new SbxArray( SbxVARIANT ); + if( eSbxType & SbxARRAY ) + PutObject( xDummyArray ); +} + +SbUnoProperty::~SbUnoProperty() +{} + + +// #72732 Spezielle SbxVariable, die beim put/get prueft, +// ob der Kontext fuer eine UnoClass sinnvoll ist. Sonst +// liegt eventuell ein Schreibfehler im Basic-Source vor. +BOOL UnoClassMemberVariable::Get( SbxValues& rRes ) const +{ + // Zugriff auf den Member einer UnoClass mit Parametern ist unsinnig + if( GetParameters() ) + { + if( mpRuntime ) + mpRuntime->Error( SbERR_NO_METHOD ); + } + return SbxVariable::Get( rRes ); +} + +BOOL UnoClassMemberVariable::Put( const SbxValues& rRes ) +{ + if( bInternalUse ) + { + return SbxVariable::Put( rRes ); + } + // Schreibzugriff auf den Member einer UnoClass ist immer falsch + mpRuntime->Error( SbERR_NO_METHOD ); + return FALSE; +} + +TYPEINIT1(UnoClassMemberVariable,SbxVariable) + + +SbxVariable* SbUnoObject::Find( const XubString& rName, SbxClassType t ) +{ + static Reference< XIdlMethod > xDummyMethod; + static Property aDummyProp; + + SbxVariable* pRes = SbxObject::Find( rName, t ); + + if( bNeedIntrospection ) doIntrospection(); + + // Neu 4.3.1999: Properties on Demand anlegen, daher jetzt perIntrospectionAccess + // suchen, ob doch eine Property oder Methode des geforderten Namens existiert + if( !pRes && mxExactName.is() ) + { + OUString aUNonCaseName( rName ); + OUString aUName = mxExactName->getExactName( aUNonCaseName ); + if( mxUnoAccess.is() ) + { + if( aUName.len() ) + { + if( mxUnoAccess->hasProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS ) ) + { + const Property& rProp = mxUnoAccess-> + getProperty( aUName, PropertyConcept::ALL - PropertyConcept::DANGEROUS ); + + // #58455 Wenn die Property void sein kann, muss als Typ Variant gesetzt werden + SbxDataType eSbxType; + if( rProp.Attributes & PropertyAttribute::MAYBEVOID ) + eSbxType = SbxVARIANT; + else + eSbxType = unoToSbxType( TypeToIdlClass( rProp.Type ) ); + + // Property anlegen und reinbraten + SbxVariableRef xVarRef = new SbUnoProperty( rProp.Name, eSbxType, rProp, 0 ); + QuickInsert( (SbxVariable*)xVarRef ); + pRes = xVarRef; + } + else if( mxUnoAccess->hasMethod( aUName, + MethodConcept::ALL - MethodConcept::DANGEROUS ) ) + { + // Methode ansprechen + const Reference< XIdlMethod >& rxMethod = mxUnoAccess-> + getMethod( aUName, MethodConcept::ALL - MethodConcept::DANGEROUS ); + + // SbUnoMethode anlegen und reinbraten + SbxVariableRef xMethRef = new SbUnoMethod + ( rxMethod->getName(), unoToSbxType( rxMethod->getReturnType() ), rxMethod ); + QuickInsert( (SbxVariable*)xMethRef ); + pRes = xMethRef; + } + } + + // Wenn immer noch nichts gefunden wurde, muss geprueft werden, ob NameAccess vorliegt + if( !pRes ) + { + try + { + Reference< XNameAccess > xNameAccess( mxUnoAccess->queryAdapter( ::getCppuType( (const Reference< XPropertySet > *)0 ) ), UNO_QUERY ); + OUString aUName( rName ); + + if( xNameAccess.is() && xNameAccess->hasByName( aUName ) ) + { + Any aAny = xNameAccess->getByName( aUName ); + + // ACHTUNG: Die hier erzeugte Variable darf wegen bei XNameAccess + // nicht als feste Property in das Object aufgenommen werden und + // wird daher nirgendwo gehalten. + // Wenn das Probleme gibt, muss das kuenstlich gemacht werden oder + // es muss eine Klasse SbUnoNameAccessProperty geschaffen werden, + // bei der die Existenz staendig neu ueberprueft und die ggf. weg- + // geworfen wird, wenn der Name nicht mehr gefunden wird. + pRes = new SbxVariable( SbxVARIANT ); + unoToSbxValue( pRes, aAny ); + } + } + catch( WrappedTargetException& e1 ) + { + // Anlegen, damit der Exception-Fehler nicht ueberschrieben wird + if( !pRes ) + pRes = new SbxVariable( SbxVARIANT ); + + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetWrappedMsg( e1 ) ); + } + catch( RuntimeException& e2 ) + { + // Anlegen, damit der Exception-Fehler nicht ueberschrieben wird + if( !pRes ) + pRes = new SbxVariable( SbxVARIANT ); + + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e2 ) ); + } + } + } + else if( mxInvocation.is() ) + { + if( aUName.len() ) + { + if( mxInvocation->hasProperty( aUName ) ) + { + // Property anlegen und reinbraten + SbxVariableRef xVarRef = new SbUnoProperty( aUName, SbxVARIANT, aDummyProp, 0 ); + QuickInsert( (SbxVariable*)xVarRef ); + pRes = xVarRef; + } + else if( mxInvocation->hasMethod( aUName ) ) + { + // SbUnoMethode anlegen und reinbraten + SbxVariableRef xMethRef = new SbUnoMethod( aUName, SbxVARIANT, xDummyMethod ); + QuickInsert( (SbxVariable*)xMethRef ); + pRes = xMethRef; + } + } + } + } + + // Ganz am Schluss noch pruefen, ob die Dbg_-Properties gemeint sind + + if( !pRes ) + { + if( rName.EqualsIgnoreCaseAscii( ID_DBG_SUPPORTEDINTERFACES ) || + rName.EqualsIgnoreCaseAscii( ID_DBG_PROPERTIES ) || + rName.EqualsIgnoreCaseAscii( ID_DBG_METHODS ) ) + { + // Anlegen + implCreateDbgProperties(); + + // Jetzt muessen sie regulaer gefunden werden + pRes = SbxObject::Find( rName, SbxCLASS_DONTCARE ); + } + } + return pRes; +} + +// Hilfs-Methode zum Anlegen der dbg_-Properties +void SbUnoObject::implCreateDbgProperties( void ) +{ + Property aProp; + + // Id == -1: Implementierte Interfaces gemaess ClassProvider anzeigen + SbxVariableRef xVarRef = new SbUnoProperty( ID_DBG_SUPPORTEDINTERFACES, SbxSTRING, aProp, -1 ); + QuickInsert( (SbxVariable*)xVarRef ); + + // Id == -2: Properties ausgeben + xVarRef = new SbUnoProperty( ID_DBG_PROPERTIES, SbxSTRING, aProp, -2 ); + QuickInsert( (SbxVariable*)xVarRef ); + + // Id == -3: Methoden ausgeben + xVarRef = new SbUnoProperty( ID_DBG_METHODS, SbxSTRING, aProp, -3 ); + QuickInsert( (SbxVariable*)xVarRef ); +} + +void SbUnoObject::implCreateAll( void ) +{ + // Bestehende Methoden und Properties alle wieder wegwerfen + pMethods = new SbxArray; + pProps = new SbxArray; + + if( bNeedIntrospection ) doIntrospection(); + + // Instrospection besorgen + Reference< XIntrospectionAccess > xAccess = mxUnoAccess; + if( !xAccess.is() ) + { + if( mxInvocation.is() ) + xAccess = mxInvocation->getIntrospection(); + } + if( !xAccess.is() ) + return; + + // Properties anlegen + Sequence<Property> props = xAccess->getProperties( PropertyConcept::ALL - PropertyConcept::DANGEROUS ); + UINT32 nPropCount = props.getLength(); + const Property* pProps = props.getConstArray(); + + UINT32 i; + for( i = 0 ; i < nPropCount ; i++ ) + { + const Property& rProp = pProps[ i ]; + + // #58455 Wenn die Property void sein kann, muss als Typ Variant gesetzt werden + SbxDataType eSbxType; + if( rProp.Attributes & PropertyAttribute::MAYBEVOID ) + eSbxType = SbxVARIANT; + else + eSbxType = unoToSbxType( TypeToIdlClass( rProp.Type ) ); + + // Property anlegen und reinbraten + SbxVariableRef xVarRef = new SbUnoProperty( rProp.Name, eSbxType, rProp, i ); + QuickInsert( (SbxVariable*)xVarRef ); + } + + // Dbg_-Properties anlegen + implCreateDbgProperties(); + + // Methoden anlegen + Sequence< Reference< XIdlMethod > > aMethodSeq = xAccess->getMethods + ( MethodConcept::ALL - MethodConcept::DANGEROUS ); + UINT32 nMethCount = aMethodSeq.getLength(); + const Reference< XIdlMethod >* pMethods = aMethodSeq.getConstArray(); + for( i = 0 ; i < nMethCount ; i++ ) + { + // Methode ansprechen + const Reference< XIdlMethod >& rxMethod = pMethods[i]; + + // SbUnoMethode anlegen und reinbraten + SbxVariableRef xMethRef = new SbUnoMethod + ( rxMethod->getName(), unoToSbxType( rxMethod->getReturnType() ), rxMethod ); + QuickInsert( (SbxVariable*)xMethRef ); + } +} + + +// Wert rausgeben +Any SbUnoObject::getUnoAny( void ) +{ + Any aRetAny; + if( bNeedIntrospection ) doIntrospection(); + if( mxMaterialHolder.is() ) + aRetAny = mxMaterialHolder->getMaterial(); + else if( mxInvocation.is() ) + aRetAny <<= mxInvocation; + return aRetAny; +} + +// Hilfsmethode zum Anlegen einer Uno-Struct per CoreReflection +SbUnoObject* Impl_CreateUnoStruct( const String& aClassName ) +{ + // CoreReflection holen + Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); + if( !xCoreReflection.is() ) + return NULL; + + // Klasse suchen + Reference< XIdlClass > xClass = xCoreReflection->forName( aClassName ); + if( !xClass.is() ) + return NULL; + + // Ist es ueberhaupt ein struct? + TypeClass eType = xClass->getTypeClass(); + if( eType != TypeClass_STRUCT ) + return NULL; + + // Instanz erzeugen + Any aNewAny; + xClass->createObject( aNewAny ); + + // SbUnoObject daraus basteln + SbUnoObject* pUnoObj = new SbUnoObject( aClassName, aNewAny ); + return pUnoObj; +} + + +// Factory-Klasse fuer das Anlegen von Uno-Structs per DIM AS NEW +SbxBase* SbUnoFactory::Create( UINT16 nSbxId, UINT32 ) +{ + // Ueber SbxId laeuft in Uno nix + return NULL; +} + +SbxObject* SbUnoFactory::CreateObject( const String& rClassName ) +{ + return Impl_CreateUnoStruct( rClassName ); +} + + +// Provisorische Schnittstelle fuer UNO-Anbindung +// Liefert ein SbxObject, das ein Uno-Interface wrappt +SbxObjectRef GetSbUnoObject( const String& aName, const Any& aUnoObj_ ) +{ + return new SbUnoObject( aName, aUnoObj_ ); +} + +void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +{ + // Wir brauchen mindestens 1 Parameter + if ( rPar.Count() < 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // Klassen-Name der struct holen + String aClassName = rPar.Get(1)->GetString(); + + // Versuchen, gleichnamige Struct zu erzeugen + SbUnoObjectRef xUnoObj = Impl_CreateUnoStruct( aClassName ); + if( !xUnoObj ) + return; + + // Objekt zurueckliefern + SbxVariableRef refVar = rPar.Get(0); + refVar->PutObject( (SbUnoObject*)xUnoObj ); +} + +void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +{ + // Wir brauchen mindestens 1 Parameter + if ( rPar.Count() < 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // Klassen-Name der struct holen + String aServiceName = rPar.Get(1)->GetString(); + + // Service suchen und instanzieren + Reference< XMultiServiceFactory > xFactory( utl::getProcessServiceFactory() ); + Reference< XInterface > xInterface; + if ( xFactory.is() ) + { + try + { + xInterface = xFactory->createInstance( aServiceName ); + } + catch( WrappedTargetException& e1 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetWrappedMsg( e1 ) ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e2 ) ); + } + } + + SbxVariableRef refVar = rPar.Get(0); + if( xInterface.is() ) + { + Any aAny; + aAny <<= xInterface; + + // SbUnoObject daraus basteln und zurueckliefern + SbUnoObjectRef xUnoObj = new SbUnoObject( aServiceName, aAny ); + if( xUnoObj->getUnoAny().getValueType().getTypeClass() != TypeClass_VOID ) + { + // Objekt zurueckliefern + refVar->PutObject( (SbUnoObject*)xUnoObj ); + } + else + { + refVar->PutObject( NULL ); + } + } + else + { + refVar->PutObject( NULL ); + } +} + +void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +{ + SbxVariableRef refVar = rPar.Get(0); + + // Globalen Service-Manager holen + Reference< XMultiServiceFactory > xFactory( utl::getProcessServiceFactory() ); + if( xFactory.is() ) + { + Any aAny; + aAny <<= xFactory; + + // SbUnoObject daraus basteln und zurueckliefern + SbUnoObjectRef xUnoObj = new SbUnoObject( String( RTL_CONSTASCII_USTRINGPARAM("ProcessServiceManager") ), aAny ); + refVar->PutObject( (SbUnoObject*)xUnoObj ); + } + else + { + refVar->PutObject( NULL ); + } +} + +void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +{ + // Wir brauchen mindestens 2 Parameter + USHORT nParCount = rPar.Count(); + if( nParCount < 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // Variable fuer Rueckgabewert + SbxVariableRef refVar = rPar.Get(0); + refVar->PutBool( FALSE ); + + // Uno-Objekt holen + SbxBaseRef pObj = (SbxBase*)rPar.Get( 1 )->GetObject(); + if( !(pObj && pObj->ISA(SbUnoObject)) ) + return; + Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); + TypeClass eType = aAny.getValueType().getTypeClass(); + if( eType != TypeClass_INTERFACE ) + return; + + // Interface aus dem Any besorgen + Reference< XInterface > x = *(Reference< XInterface >*)aAny.getValue(); + + // CoreReflection holen + Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); + if( !xCoreReflection.is() ) + return; + + for( USHORT i = 2 ; i < nParCount ; i++ ) + { + // Interface-Name der struct holen + String aIfaceName = rPar.Get( i )->GetString(); + + // Klasse suchen + Reference< XIdlClass > xClass = xCoreReflection->forName( aIfaceName ); + if( !xClass.is() ) + return; + + // Pruefen, ob das Interface unterstuetzt wird + OUString aClassName = xClass->getName(); + Type aClassType( xClass->getTypeClass(), aClassName.getStr() ); + if( !x->queryInterface( aClassType ).hasValue() ) + return; + } + + // Alles hat geklappt, dann TRUE liefern + refVar->PutBool( TRUE ); +} + +void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +{ + // Wir brauchen mindestens 1 Parameter + if ( rPar.Count() < 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // Variable fuer Rueckgabewert + SbxVariableRef refVar = rPar.Get(0); + refVar->PutBool( FALSE ); + + // Uno-Objekt holen + SbxVariableRef xParam = rPar.Get( 1 ); + if( !xParam->IsObject() ) + return; + SbxBaseRef pObj = (SbxBase*)rPar.Get( 1 )->GetObject(); + if( !(pObj && pObj->ISA(SbUnoObject)) ) + return; + Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); + TypeClass eType = aAny.getValueType().getTypeClass(); + if( eType == TypeClass_STRUCT ) + refVar->PutBool( TRUE ); +} + + +void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +{ + if ( rPar.Count() < 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // Variable fuer Rueckgabewert + SbxVariableRef refVar = rPar.Get(0); + refVar->PutBool( FALSE ); + + // Uno-Objekte holen + SbxVariableRef xParam1 = rPar.Get( 1 ); + if( !xParam1->IsObject() ) + return; + SbxBaseRef pObj1 = (SbxBase*)xParam1->GetObject(); + if( !(pObj1 && pObj1->ISA(SbUnoObject)) ) + return; + Any aAny1 = ((SbUnoObject*)(SbxBase*)pObj1)->getUnoAny(); + TypeClass eType1 = aAny1.getValueType().getTypeClass(); + if( eType1 != TypeClass_INTERFACE ) + return; + Reference< XInterface > x1; + aAny1 >>= x1; + //XInterfaceRef x1 = *(XInterfaceRef*)aAny1.get(); + + SbxVariableRef xParam2 = rPar.Get( 2 ); + if( !xParam2->IsObject() ) + return; + SbxBaseRef pObj2 = (SbxBase*)xParam2->GetObject(); + if( !(pObj2 && pObj2->ISA(SbUnoObject)) ) + return; + Any aAny2 = ((SbUnoObject*)(SbxBase*)pObj2)->getUnoAny(); + TypeClass eType2 = aAny2.getValueType().getTypeClass(); + if( eType2 != TypeClass_INTERFACE ) + return; + Reference< XInterface > x2; + aAny2 >>= x2; + //XInterfaceRef x2 = *(XInterfaceRef*)aAny2.get(); + + if( x1 == x2 ) + refVar->PutBool( TRUE ); +} + +// Funktion, um einen globalen Bezeichner im +// UnoScope zu suchen und fuer Sbx zu wrappen +SbxVariable* findUnoClass( const String& rName ) +{ + // CoreReflection holen + Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); + if( !xCoreReflection.is() ) + return NULL; + + // Klasse suchen + Reference< XIdlClass > xClass = xCoreReflection->forName( rName ); + + // #72382 Klasse wird jetzt immer angelegt, da Module unbekannt sind + SbUnoClass* pUnoClass = new SbUnoClass( rName, xClass ); + return pUnoClass; +} + +SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t ) +{ + SbxVariable* pRes = SbxObject::Find( rName, t ); + + // Wenn nichts gefunden wird, ist das Sub-Modul noch nicht bekannt + if( !pRes ) + { + // Wenn es schon eine Klasse ist, nach einen Feld fragen + if( m_xClass.is() ) + { + // Ist es ein Field + OUString aUStr( rName ); + Reference< XIdlField > xField = m_xClass->getField( aUStr ); + Reference< XIdlClass > xClass; + if( xField.is() ) + { + try + { + Any aAny; + aAny = xField->get( aAny ); + + // Nach Sbx wandeln + pRes = new SbxVariable( SbxVARIANT ); + pRes->SetName( rName ); + unoToSbxValue( pRes, aAny ); + } + catch( WrappedTargetException& e1 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetWrappedMsg( e1 ) ); + } + catch( RuntimeException& e2 ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR, implGetExceptionMsg( e2 ) ); + } + } + } + else + { + // Vollqualifizierten Namen erweitern + String aNewName = GetName(); + aNewName.AppendAscii( "." ); + aNewName += rName; + + // CoreReflection holen + Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); + if( xCoreReflection.is() ) + { + // Ist es eine Konstante? + Reference< XHierarchicalNameAccess > xHarryName( xCoreReflection, UNO_QUERY ); + if( xHarryName.is() ) + { + try + { + Any aValue = xHarryName->getByHierarchicalName( aNewName ); + TypeClass eType = aValue.getValueType().getTypeClass(); + + // Interface gefunden? Dann ist es eine Klasse + if( eType == TypeClass_INTERFACE ) + { + Reference< XInterface > xIface = *(Reference< XInterface >*)aValue.getValue(); + Reference< XIdlClass > xClass( xIface, UNO_QUERY ); + if( xClass.is() ) + { + pRes = new SbxVariable( SbxVARIANT ); + SbxObjectRef xWrapper = (SbxObject*)new SbUnoClass( aNewName, xClass ); + pRes->PutObject( xWrapper ); + + } + } + else + { + pRes = new SbxVariable( SbxVARIANT ); + unoToSbxValue( pRes, aValue ); + } + } + catch( NoSuchElementException& e1 ) + { + String aMsg = implGetExceptionMsg( e1 ); + } + } + + // Sonst wieder als Klasse annehmen + if( !pRes ) + { + // neue Klasse erzeugen + Reference< XIdlClass > xClass; + pRes = new SbxVariable( SbxVARIANT ); + SbxObjectRef xWrapper = (SbxObject*)new SbUnoClass( aNewName, xClass ); + pRes->PutObject( xWrapper ); + } + } + } + + if( pRes ) + { + pRes->SetName( rName ); + + // Variable einfuegen, damit sie spaeter im Find gefunden wird + QuickInsert( pRes ); + + // Uns selbst gleich wieder als Listener rausnehmen, + // die Werte sind alle konstant + if( pRes->IsBroadcaster() ) + EndListening( pRes->GetBroadcaster(), TRUE ); + } + } + return pRes; +} + + +//======================================================================== +//======================================================================== +//======================================================================== + +// Implementation eines EventAttacher-bezogenen AllListeners, der +// nur einzelne Events an einen allgemeinen AllListener weiterleitet +class BasicAllListener_Impl : public BasicAllListenerHelper +{ + virtual void firing_impl(const AllEventObject& Event, Any* pRet); + +public: + SbxObjectRef xSbxObj; + OUString aPrefixName; + + BasicAllListener_Impl( const OUString& aPrefixName ); + ~BasicAllListener_Impl(); + + // Methoden von XInterface + //virtual BOOL queryInterface( Uik aUik, Reference< XInterface > & rOut ); + + // Methoden von XAllListener + virtual void SAL_CALL firing(const AllEventObject& Event) throw ( RuntimeException ); + virtual Any SAL_CALL approveFiring(const AllEventObject& Event) throw ( RuntimeException ); + + // Methoden von XEventListener + virtual void SAL_CALL disposing(const EventObject& Source) throw ( RuntimeException ); +}; + + +//======================================================================== +BasicAllListener_Impl::BasicAllListener_Impl +( + const OUString & aPrefixName_ +) + : aPrefixName( aPrefixName_ ) +{ +} + +//======================================================================== +BasicAllListener_Impl::~BasicAllListener_Impl() +{ +} + +//======================================================================== + +void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet ) +{ + NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + + if( xSbxObj.Is() ) + { + OUString aMethodName = aPrefixName; + aMethodName = aMethodName + Event.MethodName; + + SbxVariable * pP = xSbxObj; + while( pP->GetParent() ) + { + pP = pP->GetParent(); + StarBASIC * pLib = PTR_CAST(StarBASIC,pP); + if( pLib ) + { + // In Basic Array anlegen + SbxArrayRef xSbxArray = new SbxArray( SbxVARIANT ); + const Any * pArgs = Event.Arguments.getConstArray(); + INT32 nCount = Event.Arguments.getLength(); + for( INT32 i = 0; i < nCount; i++ ) + { + // Elemente wandeln + SbxVariableRef xVar = new SbxVariable( SbxVARIANT ); + unoToSbxValue( (SbxVariable*)xVar, pArgs[i] ); + xSbxArray->Put( xVar, i +1 ); + } + + pLib->Call( aMethodName, xSbxArray ); + + // Return-Wert aus dem Param-Array holen, wenn verlangt + if( pRet ) + { + SbxVariable* pVar = xSbxArray->Get( 0 ); + if( pVar ) + *pRet = sbxToUnoValue( pVar ); + } + break; + } + } + } +} + + +// Methoden von XAllListener +void BasicAllListener_Impl::firing( const AllEventObject& Event ) throw ( RuntimeException ) +{ + firing_impl( Event, NULL ); +} + +Any BasicAllListener_Impl::approveFiring( const AllEventObject& Event ) throw ( RuntimeException ) +{ + Any aRetAny; + firing_impl( Event, &aRetAny ); + return aRetAny; +} + +//======================================================================== +// Methoden von XEventListener +void BasicAllListener_Impl ::disposing(const EventObject& ) throw ( RuntimeException ) +{ + NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + + xSbxObj.Clear(); +} + + + +//************************************************************************* +// class InvocationToAllListenerMapper +// helper class to map XInvocation to XAllListener (also in project eventattacher!) +//************************************************************************* +class InvocationToAllListenerMapper : public WeakImplHelper1< XInvocation > +{ +public: + InvocationToAllListenerMapper( const Reference< XIdlClass >& ListenerType, + const Reference< XAllListener >& AllListener, const Any& Helper ); + + // XInvocation + virtual Reference< XIntrospectionAccess > SAL_CALL getIntrospection(void) throw( RuntimeException ); + virtual Any SAL_CALL invoke(const OUString& FunctionName, const Sequence< Any >& Params, Sequence< sal_Int16 >& OutParamIndex, Sequence< Any >& OutParam) + throw( IllegalArgumentException, CannotConvertException, InvocationTargetException, RuntimeException ); + virtual void SAL_CALL setValue(const OUString& PropertyName, const Any& Value) + throw( UnknownPropertyException, CannotConvertException, InvocationTargetException, RuntimeException ); + virtual Any SAL_CALL getValue(const OUString& PropertyName) throw( UnknownPropertyException, RuntimeException ); + virtual sal_Bool SAL_CALL hasMethod(const OUString& Name) throw( RuntimeException ); + virtual sal_Bool SAL_CALL hasProperty(const OUString& Name) throw( RuntimeException ); + +private: + Reference< XIdlReflection > m_xCoreReflection; + Reference< XAllListener > m_xAllListener; + Reference< XIdlClass > m_xListenerType; + Any m_Helper; +}; + + +// Function to replace AllListenerAdapterService::createAllListerAdapter +Reference< XInterface > createAllListenerAdapter +( + const Reference< XInvocationAdapterFactory >& xInvocationAdapterFactory, + const Reference< XIdlClass >& xListenerType, + const Reference< XAllListener >& xListener, + const Any& Helper +) +{ + Reference< XInterface > xAdapter; + if( xInvocationAdapterFactory.is() && xListenerType.is() && xListener.is() ) + { + Reference< XInvocation > xInvocationToAllListenerMapper = + (XInvocation*)new InvocationToAllListenerMapper( xListenerType, xListener, Helper ); + Type aListenerType( xListenerType->getTypeClass(), xListenerType->getName() ); + xAdapter = xInvocationAdapterFactory->createAdapter( xInvocationToAllListenerMapper, aListenerType ); + } + return xAdapter; +} + + +//-------------------------------------------------------------------------------------------------- +// InvocationToAllListenerMapper +InvocationToAllListenerMapper::InvocationToAllListenerMapper + ( const Reference< XIdlClass >& ListenerType, const Reference< XAllListener >& AllListener, const Any& Helper ) + : m_xAllListener( AllListener ) + , m_Helper( Helper ) + , m_xListenerType( ListenerType ) +{ +} + +//************************************************************************* +Reference< XIntrospectionAccess > SAL_CALL InvocationToAllListenerMapper::getIntrospection(void) + throw( RuntimeException ) +{ + return Reference< XIntrospectionAccess >(); +} + +//************************************************************************* +Any SAL_CALL InvocationToAllListenerMapper::invoke(const OUString& FunctionName, const Sequence< Any >& Params, + Sequence< sal_Int16 >& OutParamIndex, Sequence< Any >& OutParam) + throw( IllegalArgumentException, CannotConvertException, + InvocationTargetException, RuntimeException ) +{ + Any aRet; + + // Check if to firing or approveFiring has to be called + Reference< XIdlMethod > xMethod = m_xListenerType->getMethod( FunctionName ); + sal_Bool bApproveFiring = sal_False; + if( !xMethod.is() ) + return aRet; + Reference< XIdlClass > xReturnType = xMethod->getReturnType(); + Sequence< Reference< XIdlClass > > aExceptionSeq = xMethod->getExceptionTypes(); + if( ( xReturnType.is() && xReturnType->getTypeClass() != TypeClass_VOID ) || + aExceptionSeq.getLength() > 0 ) + { + bApproveFiring = sal_True; + } + else + { + Sequence< ParamInfo > aParamSeq = xMethod->getParameterInfos(); + sal_uInt32 nParamCount = aParamSeq.getLength(); + if( nParamCount > 1 ) + { + const ParamInfo* pInfos = aParamSeq.getConstArray(); + for( sal_uInt32 i = 0 ; i < nParamCount ; i++ ) + { + if( pInfos[ i ].aMode != ParamMode_IN ) + { + bApproveFiring = sal_True; + break; + } + } + } + } + + AllEventObject aAllEvent; + aAllEvent.Source = (OWeakObject*) this; + aAllEvent.Helper = m_Helper; + aAllEvent.ListenerType = Type(m_xListenerType->getTypeClass(), m_xListenerType->getName() ); + aAllEvent.MethodName = FunctionName; + aAllEvent.Arguments = Params; + if( bApproveFiring ) + aRet = m_xAllListener->approveFiring( aAllEvent ); + else + m_xAllListener->firing( aAllEvent ); + return aRet; +} + +//************************************************************************* +void SAL_CALL InvocationToAllListenerMapper::setValue(const OUString& PropertyName, const Any& Value) + throw( UnknownPropertyException, CannotConvertException, + InvocationTargetException, RuntimeException ) +{ +} + +//************************************************************************* +Any SAL_CALL InvocationToAllListenerMapper::getValue(const OUString& PropertyName) + throw( UnknownPropertyException, RuntimeException ) +{ + return Any(); +} + +//************************************************************************* +sal_Bool SAL_CALL InvocationToAllListenerMapper::hasMethod(const OUString& Name) + throw( RuntimeException ) +{ + Reference< XIdlMethod > xMethod = m_xListenerType->getMethod( Name ); + return xMethod.is(); +} + +//************************************************************************* +sal_Bool SAL_CALL InvocationToAllListenerMapper::hasProperty(const OUString& Name) + throw( RuntimeException ) +{ + Reference< XIdlField > xField = m_xListenerType->getField( Name ); + return xField.is(); +} + +//======================================================================== +// Uno-Service erzeugen +// 1. Parameter == Prefix-Name der Makros +// 2. Parameter == voll qualifizierter Name des Listeners +void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +//RTLFUNC(CreateUnoListener) +{ + // Wir brauchen mindestens 1 Parameter + if ( rPar.Count() != 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // Klassen-Name der struct holen + String aPrefixName = rPar.Get(1)->GetString(); + String aListenerClassName = rPar.Get(2)->GetString(); + + // CoreReflection holen + Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl(); + if( !xCoreReflection.is() ) + return; + + // AllListenerAdapterService holen + Reference< XMultiServiceFactory > xFactory( utl::getProcessServiceFactory() ); + if( !xFactory.is() ) + return; + + // Klasse suchen + Reference< XIdlClass > xClass = xCoreReflection->forName( aListenerClassName ); + if( !xClass.is() ) + return; + + // AB, 30.11.1999 InvocationAdapterFactory holen + Reference< XInvocationAdapterFactory > xInvocationAdapterFactory = Reference< XInvocationAdapterFactory >( + xFactory->createInstance( rtl::OUString::createFromAscii("com.sun.star.script.InvocationAdapterFactory") ), UNO_QUERY ); + + BasicAllListener_Impl * p; + Reference< XAllListener > xAllLst = p = new BasicAllListener_Impl( aPrefixName ); + Any aTmp; + Reference< XInterface > xLst = createAllListenerAdapter( xInvocationAdapterFactory, xClass, xAllLst, aTmp ); + if( !xLst.is() ) + return; + + OUString aClassName = xClass->getName(); + Type aClassType( xClass->getTypeClass(), aClassName.getStr() ); + aTmp = xLst->queryInterface( aClassType ); + if( !aTmp.hasValue() ) + return; + + p->xSbxObj = new SbUnoObject( aListenerClassName, aTmp ); + p->xSbxObj->SetParent( pBasic ); + + // Objekt zurueckliefern + SbxVariableRef refVar = rPar.Get(0); + refVar->PutObject( p->xSbxObj ); +} + + + diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx new file mode 100644 index 000000000000..187a5b45280c --- /dev/null +++ b/basic/source/classes/sbxmod.cxx @@ -0,0 +1,1984 @@ +/************************************************************************* + * + * $RCSfile: sbxmod.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#if STLPORT_VERSION < 321 +#include <tools/presys.h> +#include <list> +#include <tools/postsys.h> +#else +#include <list> +#endif + +#include <vos/macros.hxx> +#include <vcl/svapp.hxx> + +#ifndef _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif +#ifndef _SFXBRDCST_HXX //autogen +#include <svtools/brdcst.hxx> +#endif +#ifndef _SHL_HXX //autogen +#include <tools/shl.hxx> +#endif +#pragma hdrstop +#include <svtools/sbx.hxx> +#include "sb.hxx" +#include <sbjsmeth.hxx> +#include "sbjsmod.hxx" +#include "sbintern.hxx" +#include "image.hxx" +#include "opcodes.hxx" +#include "runtime.hxx" +#include "token.hxx" +#include "sbunoobj.hxx" +#include <hilight.hxx> +#include <basrdll.hxx> + + +// for the bsearch +#ifdef WNT +#define CDECL _cdecl +#endif +#ifdef OS2 +#define CDECL _Optlink +#endif +#if defined(UNX) || defined(MAC) +#define CDECL +#endif + + +// TEST +#include <stdio.h> + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBASIC, SBASIC_CODE ) + +TYPEINIT1(SbModule,SbxObject) +TYPEINIT1(SbMethod,SbxMethod) +TYPEINIT1(SbProperty,SbxProperty) +TYPEINIT1(SbJScriptModule,SbModule) +TYPEINIT1(SbJScriptMethod,SbMethod) + +SV_DECL_VARARR(SbiBreakpoints,USHORT,4,4) +SV_IMPL_VARARR(SbiBreakpoints,USHORT) + + +SV_IMPL_VARARR(HighlightPortions, HighlightPortion) + +// ########################################################################## +// ACHTUNG!!! Alle Woerter dieser Tabelle mssen KLEIN geschrieben werden!!! +// ########################################################################## +static char* strListBasicKeyWords[] = { + "access", + "alias", + "and", + "any", + "append", + "as", + "base", + "binary", + "boolean", + "byval", + "call", + "case", + "cdecl", + "close", + "compare", + "const", + "currency", + "date", + "declare", + "defbool", + "defcur", + "defdate", + "defdbl", + "deferr", + "defint", + "deflng", + "defobj", + "defsng", + "defstr", + "defvar", + "dim", + "do", + "double", + "each", + "else", + "elseif", + "end", + "end function", + "end if", + "end select", + "end sub", + "end type", + "endif", + "eqv", + "erase", + "error", + "exit", + "explicit", + "for", + "function", + "global", + "gosub", + "goto", + "if", + "imp", + "in", + "input", + "integer", + "is", + "let", + "lib" + "line", + "line input", + "local", + "lock", + "long", + "loop", + "lprint", + "lset", + "mod", + "name", + "new", + "next", + "not", + "object", + "on", + "open", + "option", + "optional", + "or", + "output", + "preserve", + "print", + "private", + "public", + "random", + "read", + "redim", + "rem", + "resume", + "return", + "rset", + "select", + "set", + "shared", + "single", + "static", + "step", + "stop", + "string", + "sub", + "system", + "text", + "then", + "to", + "type", + "until", + "variant", + "wend", + "while", + "with", + "write", + "xor" +}; + +int CDECL compare_strings( const void *arg1, const void *arg2 ) +{ + char* pCh = *(char**)arg2; + return strcmp( (char *)arg1, *(char **)arg2 ); +} + + + +///////////////////////////////////////////////////////////////////////////// + +// Ein BASIC-Modul hat EXTSEARCH gesetzt, damit die im Modul enthaltenen +// Elemente von anderen Modulen aus gefunden werden koennen. + +SbModule::SbModule( const String& rName ) + : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASICModule") ) ), + pImage( NULL ), pBreaks( NULL ) +{ + SetName( rName ); + SetFlag( SBX_EXTSEARCH | SBX_GBLSEARCH ); +} + +SbModule::~SbModule() +{ + if( pImage ) + delete pImage; + if( pBreaks ) + delete pBreaks; +} + +BOOL SbModule::IsCompiled() const +{ + return BOOL( pImage != 0 ); +} + +// Aus dem Codegenerator: Loeschen des Images und Invalidieren der Entries + +void SbModule::StartDefinitions() +{ + delete pImage; pImage = NULL; + // Methoden und Properties bleiben erhalten, sind jedoch ungueltig + // schliesslich sind ja u.U. die Infos belegt + USHORT i; + for( i = 0; i < pMethods->Count(); i++ ) + { + SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) ); + if( p ) + p->bInvalid = TRUE; + } + for( i = 0; i < pProps->Count(); ) + { + SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) ); + if( p ) + pProps->Remove( i ); + else + i++; + } +} + +// Methode anfordern/anlegen + +SbMethod* SbModule::GetMethod( const String& rName, SbxDataType t ) +{ + SbxVariable* p = pMethods->Find( rName, SbxCLASS_METHOD ); + SbMethod* pMeth = p ? PTR_CAST(SbMethod,p) : NULL; + if( p && !pMeth ) + pMethods->Remove( p ); + if( !pMeth ) + { + pMeth = new SbMethod( rName, t, this ); + pMeth->SetParent( this ); + pMeth->SetFlags( SBX_READ ); + pMethods->Put( pMeth, pMethods->Count() ); + StartListening( pMeth->GetBroadcaster(), TRUE ); + } + // Per Default ist die Methode GUELTIG, da sie auch vom Compiler + // (Codegenerator) erzeugt werden kann + pMeth->bInvalid = FALSE; + pMeth->ResetFlag( SBX_FIXED ); + pMeth->SetFlag( SBX_WRITE ); + pMeth->SetType( t ); + pMeth->ResetFlag( SBX_WRITE ); + if( t != SbxVARIANT ) + pMeth->SetFlag( SBX_FIXED ); + return pMeth; +} + +// Property anfordern/anlegen + +SbProperty* SbModule::GetProperty( const String& rName, SbxDataType t ) +{ + SbxVariable* p = pProps->Find( rName, SbxCLASS_PROPERTY ); + SbProperty* pProp = p ? PTR_CAST(SbProperty,p) : NULL; + if( p && !pProp ) + pProps->Remove( p ); + if( !pProp ) + { + pProp = new SbProperty( rName, t, this ); + pProp->SetFlag( SBX_READWRITE ); + pProp->SetParent( this ); + pProps->Put( pProp, pProps->Count() ); + StartListening( pProp->GetBroadcaster(), TRUE ); + } + return pProp; +} + +// Aus dem Codegenerator: Ungueltige Eintraege entfernen + +void SbModule::EndDefinitions( BOOL bNewState ) +{ + for( USHORT i = 0; i < pMethods->Count(); ) + { + SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) ); + if( p ) + { + if( p->bInvalid ) + pMethods->Remove( p ); + else + { + p->bInvalid = bNewState; + i++; + } + } + } + SetModified( TRUE ); +} + +void SbModule::Clear() +{ + delete pImage; pImage = NULL; + SbxObject::Clear(); +} + +const String& SbModule::GetSource() const +{ + return aSource; +} + +// Parent und BASIC sind eins! + +void SbModule::SetParent( SbxObject* p ) +{ + DBG_ASSERT( !p || p->IsA( TYPE(StarBASIC) ), "SbModules nur in BASIC eintragen" ); + pParent = p; +} + +void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) +{ + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbProperty* pProp = PTR_CAST(SbProperty,pVar); + SbMethod* pMeth = PTR_CAST(SbMethod,pVar); + if( pProp ) + { + if( pProp->GetModule() != this ) + SetError( SbxERR_BAD_ACTION ); + } + else if( pMeth ) + { + if( pHint->GetId() == SBX_HINT_DATAWANTED ) + { + if( pMeth->bInvalid && !Compile() ) + // Auto-Compile hat nicht geklappt! + StarBASIC::Error( SbERR_BAD_PROP_VALUE ); + else + { + // Aufruf eines Unterprogramms + SbModule* pOld = pMOD; + pMOD = this; + Run( (SbMethod*) pVar ); + pMOD = pOld; + } + } + } + else + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + } +} + +// Das Setzen der Source macht das Image ungueltig +// und scant die Methoden-Definitionen neu ein + +void SbModule::SetSource( const String& r ) +{ + aSource = r; + StartDefinitions(); + SbiTokenizer aTok( r ); + while( !aTok.IsEof() ) + { + SbiToken eEndTok = NIL; + + // Suchen nach SUB oder FUNCTION + SbiToken eLastTok = NIL; + while( !aTok.IsEof() ) + { + // #32385: Nicht bei declare + SbiToken eCurTok = aTok.Next(); + if( eLastTok != DECLARE ) + { + if( eCurTok == SUB ) + { + eEndTok = ENDSUB; break; + } + if( eCurTok == FUNCTION ) + { + eEndTok = ENDFUNC; break; + } + } + eLastTok = eCurTok; + } + // Definition der Methode + SbMethod* pMeth; + if( eEndTok != NIL ) + { + USHORT nLine1 = aTok.GetLine(); + if( aTok.Next() == SYMBOL ) + { + String aName( aTok.GetSym() ); + SbxDataType t = aTok.GetType(); + if( t == SbxVARIANT && eEndTok == ENDSUB ) + t = SbxVOID; + pMeth = GetMethod( aName, t ); + pMeth->nLine1 = pMeth->nLine2 = nLine1; + // Die Methode ist erst mal GUELTIG + pMeth->bInvalid = FALSE; + } + else + eEndTok = NIL; + } + // Skip bis END SUB/END FUNCTION + if( eEndTok != NIL ) + { + while( !aTok.IsEof() ) + { + if( aTok.Next() == eEndTok ) + { + pMeth->nLine2 = aTok.GetLine(); + break; + } + } + if( aTok.IsEof() ) + pMeth->nLine2 = aTok.GetLine(); + } + } + EndDefinitions( TRUE ); +} + +void SbModule::SetComment( const String& r ) +{ + aComment = r; + SetModified( TRUE ); +} + +SbMethod* SbModule::GetFunctionForLine( USHORT nLine ) +{ + for( USHORT i = 0; i < pMethods->Count(); i++ ) + { + SbMethod* p = (SbMethod*) pMethods->Get( i ); + if( p->GetSbxId() == SBXID_BASICMETHOD ) + { + if( nLine >= p->nLine1 && nLine <= p->nLine2 ) + return p; + } + } + return NULL; +} + +// Ausstrahlen eines Hints an alle Basics + +static void _SendHint( SbxObject* pObj, ULONG nId, SbMethod* p ) +{ + // Selbst ein BASIC? + if( pObj->IsA( TYPE(StarBASIC) ) && pObj->IsBroadcaster() ) + pObj->GetBroadcaster().Broadcast( SbxHint( nId, p ) ); + // Dann die Unterobjekte fragen + SbxArray* pObjs = pObj->GetObjects(); + for( USHORT i = 0; i < pObjs->Count(); i++ ) + { + SbxVariable* pVar = pObjs->Get( i ); + if( pVar->IsA( TYPE(SbxObject) ) ) + _SendHint( PTR_CAST(SbxObject,pVar), nId, p ); + } +} + +static void SendHint( SbxObject* pObj, ULONG nId, SbMethod* p ) +{ + while( pObj->GetParent() ) + pObj = pObj->GetParent(); + _SendHint( pObj, nId, p ); +} + +// #57841 Uno-Objekte, die in RTL-Funktionen gehalten werden, +// beim Programm-Ende freigeben, damit nichts gehalten wird. +void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic ) +{ + // return-Wert von CreateUnoService loeschen + static String aName( RTL_CONSTASCII_USTRINGPARAM("CreateUnoService") ); + SbxVariable* pVar = pBasic->GetRtl()->Find( aName, SbxCLASS_METHOD ); + if( pVar ) + pVar->SbxValue::Clear(); + + // Ueber alle Sub-Basics gehen + SbxArray* pObjs = pBasic->GetObjects(); + USHORT nCount = pObjs->Count(); + for( USHORT i = 0 ; i < nCount ; i++ ) + { + SbxVariable* pObjVar = pObjs->Get( i ); + StarBASIC* pSubBasic = PTR_CAST( StarBASIC, pObjVar ); + if( pSubBasic ) + ClearUnoObjectsInRTL_Impl_Rek( pSubBasic ); + } +} + +void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic ) +{ + // #67781 Rueckgabewerte der Uno-Methoden loeschen + clearUnoMethods(); + + // Oberstes Basic suchen + SbxObject* p = pBasic; + while( p->GetParent() ) + p = p->GetParent(); + + // Rekursiven Loeschvorgang ausloesen + ClearUnoObjectsInRTL_Impl_Rek( (StarBASIC*)p ); +} + +// Ausfuehren eines BASIC-Unterprogramms +USHORT SbModule::Run( SbMethod* pMeth ) +{ + USHORT nRes = 0; + BOOL bDelInst = BOOL( pINST == NULL ); + StarBASICRef xBasic; + if( bDelInst ) + { + // #32779: Basic waehrend der Ausfuehrung festhalten + xBasic = (StarBASIC*) GetParent(); + + pINST = new SbiInstance( (StarBASIC*) GetParent() ); + + // Error-Stack loeschen + SbErrorStack*& rErrStack = GetSbData()->pErrStack; + delete rErrStack; + rErrStack = NULL; + } + // Rekursion zu tief? + if( ++pINST->nCallLvl <= MAXRECURSION ) + { + // Globale Variable in allen Mods definieren + GlobalRunInit( /* bBasicStart = */ bDelInst ); + + // Trat ein Compiler-Fehler auf? Dann starten wir nicht + if( GetSbData()->bGlobalInitErr == FALSE ) + { + if( bDelInst ) + { + SendHint( GetParent(), SBX_HINT_BASICSTART, pMeth ); + + // 16.10.96: #31460 Neues Konzept fuer StepInto/Over/Out + // Erklaerung siehe runtime.cxx bei SbiInstance::CalcBreakCallLevel() + // BreakCallLevel ermitteln + pINST->CalcBreakCallLevel( pMeth->GetDebugFlags() ); + } + + SbModule* pOldMod = pMOD; + pMOD = this; + SbiRuntime* pRt = new SbiRuntime( this, pMeth, pMeth->nStart ); + pRt->pNext = pINST->pRun; + pINST->pRun = pRt; + while( pRt->Step() ) {} + + // #63710 Durch ein anderes Thread-Handling bei Events kann es passieren, + // dass show-Aufruf an einem Dialog zurueckkehrt (durch schliessen des + // Dialogs per UI), BEVOR ein per Event ausgeloester weitergehender Call, + // der in Basic weiter oben im Stack steht und auf einen Basic-Breakpoint + // gelaufen ist, zurueckkehrt. Dann wird unten die Instanz zerstoert und + // wenn das noch im Call stehende Basic weiterlaeuft, gibt es einen GPF. + // Daher muss hier gewartet werden, bis andere Call zurueckkehrt. + if( bDelInst ) + { + // Hier mit 1 statt 0 vergleichen, da vor nCallLvl-- + while( pINST->nCallLvl != 1 ) + GetpApp()->Yield(); + } + + nRes = TRUE; + pINST->pRun = pRt->pNext; + pINST->nCallLvl--; // Call-Level wieder runter + + // Gibt es eine uebergeordnete Runtime-Instanz? + // Dann SbDEBUG_BREAK uebernehmen, wenn gesetzt + SbiRuntime* pRtNext = pRt->pNext; + if( pRtNext && (pRt->GetDebugFlags() & SbDEBUG_BREAK) ) + pRtNext->SetDebugFlags( SbDEBUG_BREAK ); + + delete pRt; + pMOD = pOldMod; + if( bDelInst ) + { + // #57841 Uno-Objekte, die in RTL-Funktionen gehalten werden, + // beim Programm-Ende freigeben, damit nichts gehalten wird. + ClearUnoObjectsInRTL_Impl( xBasic ); + + DBG_ASSERT(pINST->nCallLvl==0,"BASIC-Call-Level > 0") + delete pINST, pINST = NULL, bDelInst = FALSE; + SendHint( GetParent(), SBX_HINT_BASICSTOP, pMeth ); + } + } + } + else + StarBASIC::FatalError( SbERR_STACK_OVERFLOW ); + if( bDelInst ) + { + // #57841 Uno-Objekte, die in RTL-Funktionen gehalten werden, + // beim Programm-Ende freigeben, damit nichts gehalten wird. + ClearUnoObjectsInRTL_Impl( xBasic ); + + delete pINST; + pINST = NULL; + } + return nRes; +} + +// Ausfuehren der Init-Methode eines Moduls nach dem Laden +// oder der Compilation + +void SbModule::RunInit() +{ + if( pImage + && !pImage->bInit + && pImage->GetFlag( SBIMG_INITCODE ) ) + { + // Flag setzen, dass RunInit aktiv ist (Testtool) + GetSbData()->bRunInit = TRUE; + + // BOOL bDelInst = BOOL( pINST == NULL ); + // if( bDelInst ) + // pINST = new SbiInstance( (StarBASIC*) GetParent() ); + SbModule* pOldMod = pMOD; + pMOD = this; + // Der Init-Code beginnt immer hier + SbiRuntime* pRt = new SbiRuntime( this, NULL, 0 ); + pRt->pNext = pINST->pRun; + pINST->pRun = pRt; + while( pRt->Step() ) {} + pINST->pRun = pRt->pNext; + delete pRt; + pMOD = pOldMod; + // if( bDelInst ) + // delete pINST, pINST = NULL; + pImage->bInit = TRUE; + + // RunInit ist nicht mehr aktiv + GetSbData()->bRunInit = FALSE; + } +} + +// Mit private/dim deklarierte Variablen loeschen +void SbModule::ClearPrivateVars() +{ + for( int i = 0 ; i < pProps->Count() ; i++ ) + { + SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) ); + if( p ) + { + // Arrays nicht loeschen, sondern nur deren Inhalt + if( p->GetType() & SbxARRAY ) + { + SbxArray* pArray = PTR_CAST(SbxArray,p->GetObject()); + if( pArray ) + { + for( int j = 0 ; j < pArray->Count() ; j++ ) + { + SbxVariable* pj = PTR_CAST(SbxVariable,pArray->Get( j )); + pj->SbxValue::Clear(); + /* + USHORT nFlags = pj->GetFlags(); + pj->SetFlags( (nFlags | SBX_WRITE) & (~SBX_FIXED) ); + pj->PutEmpty(); + pj->SetFlags( nFlags ); + */ + } + } + } + else + { + p->SbxValue::Clear(); + /* + USHORT nFlags = p->GetFlags(); + p->SetFlags( (nFlags | SBX_WRITE) & (~SBX_FIXED) ); + p->PutEmpty(); + p->SetFlags( nFlags ); + */ + } + } + } +} + +// Zunaechst in dieses Modul, um 358-faehig zu bleiben +// (Branch in sb.cxx vermeiden) +void StarBASIC::ClearAllModuleVars( void ) +{ + // Eigene Module initialisieren + for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + { + SbModule* pModule = (SbModule*)pModules->Get( nMod ); + // Nur initialisieren, wenn der Startcode schon ausgefuehrt wurde + if( pModule->pImage && pModule->pImage->bInit ) + pModule->ClearPrivateVars(); + } + // Alle Objekte ueberpruefen, ob es sich um ein Basic handelt + // Wenn ja, auch dort initialisieren + for ( USHORT nObj = 0; nObj < pObjs->Count(); nObj++ ) + { + SbxVariable* pVar = pObjs->Get( nObj ); + StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar); + if( pBasic ) + pBasic->ClearAllModuleVars(); + } + +} + +// Ausfuehren des Init-Codes aller Module +void SbModule::GlobalRunInit( BOOL bBasicStart ) +{ + // Wenn kein Basic-Start, nur initialisieren, wenn Modul uninitialisiert + if( !bBasicStart ) + if( !(pImage && !pImage->bInit) ) + return; + + // GlobalInitErr-Flag fuer Compiler-Error initialisieren + // Anhand dieses Flags kann in SbModule::Run() nach dem Aufruf + // von GlobalRunInit festgestellt werden, ob beim initialisieren + // der Module ein Fehler auftrat. Dann wird nicht gestartet. + GetSbData()->bGlobalInitErr = FALSE; + + // Parent vom Modul ist ein Basic + StarBASIC *pBasic = PTR_CAST(StarBASIC,GetParent()); + if( pBasic ) + { + pBasic->InitAllModules(); + + SbxObject* pParent = pBasic->GetParent(); + if( pParent ) + pBasic = PTR_CAST(StarBASIC,pParent); + if( pBasic ) + pBasic->InitAllModules(); + } +} + +// Suche nach dem naechsten STMNT-Befehl im Code. Wird vom STMNT- +// Opcode verwendet, um die Endspalte zu setzen. + +const BYTE* SbModule::FindNextStmnt( const BYTE* p, USHORT& nLine, USHORT& nCol ) const +{ + USHORT nPC = (USHORT) ( p - (const BYTE*) pImage->GetCode() ); + while( nPC < pImage->GetCodeSize() ) + { + SbiOpcode eOp = (SbiOpcode ) ( *p++ ); + nPC++; + if( eOp >= SbOP1_START && eOp <= SbOP1_END ) + p += 2, nPC += 2; + else if( eOp == _STMNT ) + { + USHORT nl, nc; + nl = *p++; nl |= *p++ << 8; + nc = *p++; nc |= *p++ << 8; + nLine = nl; nCol = nc; + return p; + } + else if( eOp >= SbOP2_START && eOp <= SbOP2_END ) + p += 4, nPC += 4; + else if( !( eOp >= SbOP0_START && eOp <= SbOP0_END ) ) + { + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + break; + } + } + return NULL; +} + +// Testen, ob eine Zeile STMNT-Opcodes enthaelt + +BOOL SbModule::IsBreakable( USHORT nLine ) const +{ + if( !pImage ) + return FALSE; + const BYTE* p = (const BYTE* ) pImage->GetCode(); + USHORT nl, nc; + while( ( p = FindNextStmnt( p, nl, nc ) ) != NULL ) + if( nl == nLine ) + return TRUE; + return FALSE; +} + +USHORT SbModule::GetBPCount() const +{ + return pBreaks ? pBreaks->Count() : 0; +} + +USHORT SbModule::GetBP( USHORT n ) const +{ + if( pBreaks && n < pBreaks->Count() ) + return pBreaks->GetObject( n ); + else + return 0; +} + +BOOL SbModule::IsBP( USHORT nLine ) const +{ + if( pBreaks ) + { + const USHORT* p = pBreaks->GetData(); + USHORT n = pBreaks->Count(); + for( USHORT i = 0; i < n; i++, p++ ) + { + USHORT b = *p; + if( b == nLine ) + return TRUE; + if( b < nLine ) + break; + } + } + return FALSE; +} + +BOOL SbModule::SetBP( USHORT nLine ) +{ + if( !IsBreakable( nLine ) ) + return FALSE; + if( !pBreaks ) + pBreaks = new SbiBreakpoints; + const USHORT* p = pBreaks->GetData(); + USHORT n = pBreaks->Count(); + USHORT i; + for( i = 0; i < n; i++, p++ ) + { + USHORT b = *p; + if( b == nLine ) + return TRUE; + if( b < nLine ) + break; + } + pBreaks->Insert( &nLine, 1, i ); + + // #38568: Zur Laufzeit auch hier SbDEBUG_BREAK setzen + if( pINST && pINST->pRun ) + pINST->pRun->SetDebugFlags( SbDEBUG_BREAK ); + + return IsBreakable( nLine ); +} + +BOOL SbModule::ClearBP( USHORT nLine ) +{ + BOOL bRes = FALSE; + if( pBreaks ) + { + const USHORT* p = pBreaks->GetData(); + USHORT n = pBreaks->Count(); + for( USHORT i = 0; i < n; i++, p++ ) + { + USHORT b = *p; + if( b == nLine ) + { + pBreaks->Remove( i, 1 ); bRes = TRUE; break; + } + if( b < nLine ) + break; + } + if( !pBreaks->Count() ) + delete pBreaks, pBreaks = NULL; + } + return bRes; +} + +void SbModule::ClearAllBP() +{ + delete pBreaks; pBreaks = NULL; +} + +BOOL SbModule::LoadData( SvStream& rStrm, USHORT nVer ) +{ + Clear(); + if( !SbxObject::LoadData( rStrm, 1 ) ) + return FALSE; + // Sicherheitshalber... + SetFlag( SBX_EXTSEARCH | SBX_GBLSEARCH ); + BYTE bImage; + rStrm >> bImage; + if( bImage ) + { + SbiImage* p = new SbiImage; + if( !p->Load( rStrm ) ) + { + delete p; + return FALSE; + } + aComment = p->aComment; + SetName( p->aName ); + // Ist Code vorhanden? + if( p->GetCodeSize() ) + { + aSource = p->aSource; + // Alte Version: Image weg + if( nVer == 1 ) + { + SetSource( p->aSource ); + delete p; + } + else + pImage = p; + } + else + { + SetSource( p->aSource ); + delete p; + } + } + return TRUE; +} + +BOOL SbModule::StoreData( SvStream& rStrm ) const +{ + if( !SbxObject::StoreData( rStrm ) ) + return FALSE; + if( pImage ) + { + pImage->aSource = aSource; + pImage->aComment = aComment; + pImage->aName = GetName(); + rStrm << (BYTE) 1; + return pImage->Save( rStrm ); + } + else + { + SbiImage aImg; + aImg.aSource = aSource; + aImg.aComment = aComment; + aImg.aName = GetName(); + rStrm << (BYTE) 1; + return aImg.Save( rStrm ); + } +} + +BOOL SbModule::LoadCompleted() +{ + SbxArray* p = GetMethods(); + USHORT i; + for( i = 0; i < p->Count(); i++ ) + { + SbMethod* q = PTR_CAST(SbMethod,p->Get( i ) ); + if( q ) + q->pMod = this; + } + p = GetProperties(); + for( i = 0; i < p->Count(); i++ ) + { + SbProperty* q = PTR_CAST(SbProperty,p->Get( i ) ); + if( q ) + q->pMod = this; + } + return TRUE; +} + + +///////////////////////////////////////////////////////////////////////// +// Hilfsklasse zur Untersuchung von JavaScript-Modulen, zunaechst zum +// Heraussuchen der Funktionen, spaeter auch zum Syntax-Highlighting verwenden + +// Flags fuer Zeichen-Eigenschaften +#define CHAR_START_IDENTIFIER 0x0001 +#define CHAR_IN_IDENTIFIER 0x0002 +#define CHAR_START_NUMBER 0x0004 +#define CHAR_IN_NUMBER 0x0008 +#define CHAR_IN_HEX_NUMBER 0x0010 +#define CHAR_IN_OCT_NUMBER 0x0020 +#define CHAR_START_STRING 0x0040 +#define CHAR_OPERATOR 0x0080 +#define CHAR_SPACE 0x0100 +#define CHAR_EOL 0x0200 + +#define CHAR_EOF 0x00 + + +// Token-Typen TT_... + +//enum TokenType +//{ +// TT_UNKNOWN, +// TT_IDENTIFIER, +// TT_WHITESPACE, +// TT_NUMBER, +// TT_STRING, +//// TT_HTMLSTRING, +//// TT_LONG, +//// TT_DOUBLE, +//// TT_BOOLEAN, +//// TT_NULLOBJECT, +//// TT_CHAR, +// TT_EOL, +//// TT_LONG2DOUBLE, +// TT_COMMENT, +//// TT_SKIP, +// TT_ERROR, +// TT_OPERATOR, +// TT_KEYWORD +//}; + + +class SimpleTokenizer_Impl +{ + // Zeichen-Info-Tabelle + USHORT aCharTypeTab[256]; + + const char* mpStringBegin; + const char* mpActualPos; + + // Zeile und Spalte + UINT32 nLine; + UINT32 nCol; + + char peekChar( void ) { return *mpActualPos; } + char getChar( void ) { nCol++; return *mpActualPos++; } + + // Hilfsfunktion: Zeichen-Flag Testen + BOOL testCharFlags( unsigned char c, USHORT nTestFlags ); + + // Neues Token holen, Leerstring == nix mehr da + BOOL getNextToken( /*out*/TokenTypes& reType, + /*out*/const char*& rpStartPos, /*out*/const char*& rpEndPos ); + + String getTokStr( /*out*/const char* pStartPos, /*out*/const char* pEndPos ); + + // TEST: Token ausgeben + String getFullTokenStr( /*out*/TokenTypes eType, + /*out*/const char* pStartPos, /*out*/const char* pEndPos ); + + BOOL isBeginComment( UINT32 nLine ); + void setCommentState(UINT32 nLine, BOOL bCommentBegin, BOOL bCommentEnd); + + NAMESPACE_STD(list)<BOOL>* pCommentsBegin; + NAMESPACE_STD(list)<BOOL>* pCommentsEnd; + + char** ppListKeyWords; + UINT16 nKeyWordCount; + BOOL bStarScriptMode; + + BOOL bLineHasCommentBegin; + BOOL bLineHasCommentEnd; + +public: + SimpleTokenizer_Impl( void ); + ~SimpleTokenizer_Impl( void ); + + UINT16 parseLine( UINT32 nLine, const String* aSource ); + void getHighlightPortions( UINT32 nParseLine, const String& rLine, + /*out*/HighlightPortions& portions ); + void addLines(UINT32 nLine, INT32 nCount); + void outCommentList(); + void setKeyWords( char** ppKeyWords, UINT16 nCount ); +}; + +// Hilfsfunktion: Zeichen-Flag Testen +BOOL SimpleTokenizer_Impl::testCharFlags( unsigned char c, USHORT nTestFlags ) +{ + if( c != 0 ) + return ( (aCharTypeTab[c] & nTestFlags) != 0 ); + return FALSE; +} + +void SimpleTokenizer_Impl::setKeyWords( char** ppKeyWords, UINT16 nCount ) +{ + ppListKeyWords = ppKeyWords; + nKeyWordCount = nCount; +} + +// Neues Token holen +BOOL SimpleTokenizer_Impl::getNextToken( /*out*/TokenTypes& reType, + /*out*/const char*& rpStartPos, /*out*/const char*& rpEndPos ) +{ + reType = TT_UNKNOWN; + + // Position merken + rpStartPos = mpActualPos; + + // Zeichen untersuchen + char c = peekChar(); + if( c == CHAR_EOF ) + return FALSE; + + // Zeichen lesen + getChar(); + + //*** Alle Moeglichkeiten durchgehen *** + // Spce? + if ( (testCharFlags( c, CHAR_SPACE ) == TRUE) && (!bLineHasCommentBegin) ) + { + while( testCharFlags( peekChar(), CHAR_SPACE ) == TRUE ) + getChar(); + + reType = TT_WHITESPACE; + } + + // Identifier? + else if ( (testCharFlags( c, CHAR_START_IDENTIFIER ) == TRUE) && (!bLineHasCommentBegin) ) + { + BOOL bIdentifierChar; + int nPos = 0; + do + { + // Naechstes Zeichen holen + c = peekChar(); + bIdentifierChar = testCharFlags( c, CHAR_IN_IDENTIFIER ); + if( bIdentifierChar ) + getChar(); + } + while( bIdentifierChar ); + + reType = TT_IDENTIFIER; + + // Schluesselwort-Tabelle + if (ppListKeyWords != NULL) + { + ByteString aByteStr(rpStartPos, mpActualPos-rpStartPos); + if ( !bStarScriptMode ) + aByteStr.ToLowerAscii(); + + if ( bsearch( aByteStr.GetBuffer(), ppListKeyWords, nKeyWordCount, sizeof( char* ), + compare_strings ) ) + { + reType = TT_KEYWORD; + + if ( (!bStarScriptMode) && (aByteStr.Equals( "rem" )) ) + { + // Alle Zeichen bis Zeilen-Ende oder EOF entfernen + char cPeek = peekChar(); + while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE ) + { + c = getChar(); + cPeek = peekChar(); + } + + reType = TT_COMMENT; + } + } + } + } + + // Operator? + else if ( (testCharFlags( c, CHAR_OPERATOR ) == TRUE) || bLineHasCommentBegin + || ((!bStarScriptMode) && (c == '\'')) ) + { + // Kommentar ? + if ( (( c == '/' ) || bLineHasCommentBegin) || ((!bStarScriptMode) && (c == '\'')) ) + { + char cNext = peekChar(); + if ( cNext == '/' || ( bStarScriptMode && (cNext == '*' || bLineHasCommentBegin)) + || ((!bStarScriptMode) && (c == '\'')) ) // Kommentar + { + if ((c == '*') && (cNext == '/')) // Kommentarende am Zeilenanfang + { + getChar(); // Zeichen entfernen + + bLineHasCommentEnd = TRUE; + bLineHasCommentBegin = FALSE; + + reType = TT_COMMENT; + } + else if ( (cNext == '/' && (!bStarScriptMode || !bLineHasCommentBegin)) + || ((!bStarScriptMode) && (c == '\'')) )// C++ - Kommentar + { + c = getChar(); // '/' entfernen + + // Alle Zeichen bis Zeilen-Ende oder EOF entfernen + char cPeek = peekChar(); + while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE ) + { + c = getChar(); + cPeek = peekChar(); + + if (c == '*' && cPeek == '/') + { + bLineHasCommentEnd = TRUE; + } + } + + reType = TT_COMMENT; + } + else if (( cNext == '*' ) || bLineHasCommentBegin) // C -Kommentar + { + bLineHasCommentBegin = !bLineHasCommentBegin; + + // Alle Zeichen bis */ entfernen + do + { + c = getChar(); + cNext = peekChar(); + + // Zeilennummer auch im Kommentar pflegen + if( testCharFlags( c, CHAR_EOL ) == TRUE ) + { + // Doppelt-EOL rausschmeissen (CR/LF) + if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == TRUE ) + { + c = getChar(); + cNext = peekChar(); + } + + setCommentState(nLine, bLineHasCommentBegin, bLineHasCommentEnd); + bLineHasCommentBegin = FALSE; + bLineHasCommentEnd = FALSE; + + // Positions-Daten auf Zeilen-Beginn setzen + nCol = 0; + nLine++; + } + else if (c == '*' && cNext == '/') // am Kommentarende + { + if (bLineHasCommentBegin) // das Ende ist in der gleichen Zeile + { // wie der Anfang des Kommentars + bLineHasCommentBegin = FALSE; // also zurcksetzen + } + else + { + bLineHasCommentEnd = TRUE; + } + } + } + while( cNext != CHAR_EOF && ( c != '*' || cNext != '/' ) ); + + // Alles ausser EOF lesen + if( cNext != CHAR_EOF ) + getChar(); + + reType = TT_COMMENT; + } + } + } + // HTML-Kommentar + else if( c == '<' ) + { + char cNext = peekChar(); + if( cNext == '!' ) + { + getChar(); // '!' ist verloren, wenn nicht wirklich Tag + + cNext = peekChar(); + if( cNext == '-' ) + { + getChar(); // '-' ist verloren, wenn nicht wirklich Tag + + cNext = peekChar(); + if( cNext == '-' ) + { + getChar(); + + // HTML-Kommentar: Alle Zeichen bis Zeilen-Ende oder EOF entfernen + char cPeek = peekChar(); + while( cPeek != CHAR_EOF && testCharFlags( cPeek, CHAR_EOL ) == FALSE ) + { + c = getChar(); + cPeek = peekChar(); + } + + reType = TT_COMMENT; + } + else + { + // Verlorene Zeichen nachliefern + mpActualPos -= 2; + } + } + else + { + // Verlorenes Zeichen nachliefern + mpActualPos--; + } + } + } + + // Echter Operator, kann hier einfach behandelt werden, + // da nicht der wirkliche Operator, wie z.B. += interessiert, + // sondern nur die Tatsache, dass es sich um einen handelt. + if( reType != TT_COMMENT ) + { + reType = TT_OPERATOR; + } + } + + // Objekt-Trenner? Muss vor Number abgehandelt werden + else if( c == '.' && ( peekChar() < '0' || peekChar() > '9' ) ) + { + reType = TT_OPERATOR; + } + + // Zahl? + else if( testCharFlags( c, CHAR_START_NUMBER ) == TRUE ) + { + // Buffer-Position initialisieren + int nPos = 0; + + // Zahlensystem, 10 = normal, wird bei Oct/Hex geaendert + int nRadix = 10; + + // Ist es eine Hex- oder Oct-Zahl? + if( c == '0' ) + { + // Octal? + // Java-Script geht von einem Octal-Wert aus, wenn nach 0 eine + // Ziffer im oktalen Ziffernbereich folgt + if( testCharFlags( peekChar(), CHAR_IN_OCT_NUMBER ) ) + { + nRadix = 8; // Octal-Basis + + // Alle Ziffern einlesen + while( testCharFlags( peekChar(), CHAR_IN_OCT_NUMBER ) ) + c = getChar(); + } + + // Dementsprechend wird bei 0x Hex geparsed + else if( peekChar() == 'x' || peekChar() == 'X' ) + { + // x entfernen + getChar(); + nRadix = 16; // Hex-Basis + + // Alle Ziffern einlesen und puffern + while( testCharFlags( peekChar(), CHAR_IN_HEX_NUMBER ) ) + c = getChar(); + } + } + + // Wenn nicht Oct oder Hex als double ansehen + if( nRadix == 10 ) + { + // Flag, ob das letzte Zeichen ein Exponent war + BOOL bAfterExpChar = FALSE; + + // Alle Ziffern einlesen + while( testCharFlags( peekChar(), CHAR_IN_NUMBER ) || + (bAfterExpChar && peekChar() == '+' ) || + (bAfterExpChar && peekChar() == '-' ) ) + // Nach Exponent auch +/- OK + { + c = getChar(); // Zeichen lesen + bAfterExpChar = ( c == 'e' || c == 'E' ); + } + } + + reType = TT_NUMBER; + } + + // String? + else if( testCharFlags( c, CHAR_START_STRING ) == TRUE ) + { + // Merken, welches Zeichen den String eroeffnet hat + char cEndString = c; + + // Alle Ziffern einlesen und puffern + while( peekChar() != cEndString ) + { + // #58846 EOF vor getChar() abfangen, damit EOF micht verloren geht + if( peekChar() == CHAR_EOF ) + { + // ERROR: unterminated string literal + reType = TT_ERROR; + break; + } + c = getChar(); + if( testCharFlags( c, CHAR_EOL ) == TRUE ) + { + // ERROR: unterminated string literal + reType = TT_ERROR; + break; + } + // Escape-Character untersuchen + else if ( (c == '\\') && (bStarScriptMode) ) + { + // Kann hier ganz einfach gehandelt werden: + // Einfach ein weiteres Zeichen lesen + char cNext = getChar(); + } + } + + // Zeichen lesen + if( reType != TT_ERROR ) + { + getChar(); + reType = TT_STRING; + } + } + + // Zeilenende? + else if( testCharFlags( c, CHAR_EOL ) == TRUE ) + { + // Falls ein weiteres anderes EOL-Char folgt, weg damit + char cNext = peekChar(); + if( cNext != c && testCharFlags( cNext, CHAR_EOL ) == TRUE ) + getChar(); + + setCommentState(nLine, bLineHasCommentBegin, bLineHasCommentEnd); + bLineHasCommentBegin = FALSE; + bLineHasCommentEnd = FALSE; + + // Positions-Daten auf Zeilen-Beginn setzen + nCol = 0; + nLine++; + + reType = TT_EOL; + } + + // Alles andere bleibt TT_UNKNOWN + + + // End-Position eintragen + rpEndPos = mpActualPos; + return TRUE; +} + +void SimpleTokenizer_Impl::setCommentState(UINT32 nLine, BOOL bCommentBegin, BOOL bCommentEnd) +{ + while (pCommentsBegin->size() <= nLine) + pCommentsBegin->push_back(FALSE); + + while (pCommentsEnd->size() <= nLine) + pCommentsEnd->push_back(FALSE); + + NAMESPACE_STD(list)<BOOL>::iterator posBegins, posEnds; + UINT32 nCounter = 0; + + posBegins = pCommentsBegin->begin(); + posEnds = pCommentsEnd->begin(); + + while (nCounter < nLine) + { + posBegins++; + posEnds++; + nCounter++; + } + + *posBegins = bCommentBegin; + *posEnds = bCommentEnd; +} + +void SimpleTokenizer_Impl::addLines(UINT32 nLine, INT32 nCount) +{ + NAMESPACE_STD(list)<BOOL>::iterator posBegins, posEnds; + UINT32 nCounter = 0; + + if (!pCommentsBegin->empty()) + { + posBegins = pCommentsBegin->begin(); + posEnds = pCommentsEnd->begin(); + + while (nCounter < nLine) + { + posBegins++; + posEnds++; + nCounter++; + } + + INT32 nDiff = nCount; + while (nDiff != 0) + { + if (nDiff > 0) + { + pCommentsBegin->insert(posBegins, FALSE); + pCommentsEnd->insert(posEnds, FALSE); + nDiff--; + } + else + { + pCommentsBegin->erase(posBegins++); + pCommentsEnd->erase(posEnds++); + UINT16 dummy = pCommentsBegin->size(); + + nDiff++; + } + } + } + else if (nCount > 0) + { + INT32 nDiff = nCount; + while (nDiff != 0) + { + pCommentsBegin->push_back(FALSE); + pCommentsEnd->push_back(FALSE); + nDiff--; + } + } +} + +String SimpleTokenizer_Impl::getTokStr + ( /*out*/const char* pStartPos, /*out*/const char* pEndPos ) +{ + return String( pStartPos, (USHORT)( pEndPos - pStartPos ) ); +} + +// TEST: Token ausgeben +String SimpleTokenizer_Impl::getFullTokenStr( /*out*/TokenTypes eType, + /*out*/const char* pStartPos, /*out*/const char* pEndPos ) +{ + String aOut; + switch( eType ) + { + case TT_UNKNOWN: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_UNKNOWN:") ); break; + case TT_IDENTIFIER: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_IDENTIFIER:") ); break; + case TT_WHITESPACE: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_WHITESPACE:") ); break; + case TT_NUMBER: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_NUMBER:") ); break; + case TT_STRING: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_STRING:") ); break; + case TT_EOL: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_EOL:") ); break; + case TT_COMMENT: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_COMMENT:") ); break; + case TT_ERROR: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_ERROR:") ); break; + case TT_OPERATOR: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_OPERATOR:") ); break; + case TT_KEYWORD: aOut = String( RTL_CONSTASCII_USTRINGPARAM("TT_KEYWORD:") ); break; + } + if( eType != TT_EOL ) + { + aOut += String( pStartPos, (USHORT)( pEndPos - pStartPos ) ); + } + aOut += String( RTL_CONSTASCII_USTRINGPARAM("\n") ); + return aOut; +} + +SimpleTokenizer_Impl::SimpleTokenizer_Impl( void ) +{ + memset( aCharTypeTab, 0, sizeof( aCharTypeTab ) ); + + // Zeichen-Tabelle fuellen + USHORT i; + + // Zulaessige Zeichen fuer Identifier + USHORT nHelpMask = (USHORT)( CHAR_START_IDENTIFIER | CHAR_IN_IDENTIFIER ); + for( i = 'a' ; i <= 'z' ; i++ ) + aCharTypeTab[i] |= nHelpMask; + for( i = 'A' ; i <= 'Z' ; i++ ) + aCharTypeTab[i] |= nHelpMask; + // '_' extra eintragen + aCharTypeTab['_'] |= nHelpMask; + // AB 23.6.97: '$' ist auch erlaubt + aCharTypeTab['$'] |= nHelpMask; + + // Ziffern (Identifier und Number ist moeglich) + nHelpMask = (USHORT)( CHAR_IN_IDENTIFIER | CHAR_START_NUMBER | + CHAR_IN_NUMBER | CHAR_IN_HEX_NUMBER ); + for( i = '0' ; i <= '9' ; i++ ) + aCharTypeTab[i] |= nHelpMask; + + // e und E sowie . von Hand ergaenzen + aCharTypeTab['e'] |= CHAR_IN_NUMBER; + aCharTypeTab['E'] |= CHAR_IN_NUMBER; + aCharTypeTab['.'] |= (USHORT)( CHAR_IN_NUMBER | CHAR_START_NUMBER ); + + // Hex-Ziffern + for( i = 'a' ; i <= 'f' ; i++ ) + aCharTypeTab[i] |= CHAR_IN_HEX_NUMBER; + for( i = 'A' ; i <= 'F' ; i++ ) + aCharTypeTab[i] |= CHAR_IN_HEX_NUMBER; + + // Oct-Ziffern + for( i = '0' ; i <= '7' ; i++ ) + aCharTypeTab[i] |= CHAR_IN_OCT_NUMBER; + + // String-Beginn/End-Zeichen + aCharTypeTab['\''] |= CHAR_START_STRING; + aCharTypeTab['\"'] |= CHAR_START_STRING; + + // Operator-Zeichen + aCharTypeTab['!'] |= CHAR_OPERATOR; + aCharTypeTab['%'] |= CHAR_OPERATOR; + aCharTypeTab['&'] |= CHAR_OPERATOR; + aCharTypeTab['('] |= CHAR_OPERATOR; + aCharTypeTab[')'] |= CHAR_OPERATOR; + aCharTypeTab['*'] |= CHAR_OPERATOR; + aCharTypeTab['+'] |= CHAR_OPERATOR; + aCharTypeTab[','] |= CHAR_OPERATOR; + aCharTypeTab['-'] |= CHAR_OPERATOR; + aCharTypeTab['/'] |= CHAR_OPERATOR; + aCharTypeTab[':'] |= CHAR_OPERATOR; + aCharTypeTab['<'] |= CHAR_OPERATOR; + aCharTypeTab['='] |= CHAR_OPERATOR; + aCharTypeTab['>'] |= CHAR_OPERATOR; + aCharTypeTab['?'] |= CHAR_OPERATOR; + aCharTypeTab['^'] |= CHAR_OPERATOR; + aCharTypeTab['|'] |= CHAR_OPERATOR; + aCharTypeTab['~'] |= CHAR_OPERATOR; + aCharTypeTab['{'] |= CHAR_OPERATOR; + aCharTypeTab['}'] |= CHAR_OPERATOR; + aCharTypeTab['['] |= CHAR_OPERATOR; + aCharTypeTab[']'] |= CHAR_OPERATOR; + aCharTypeTab[';'] |= CHAR_OPERATOR; + + // Space + aCharTypeTab[' ' ] |= CHAR_SPACE; + aCharTypeTab['\t'] |= CHAR_SPACE; + + // Zeilen-Ende-Zeichen + aCharTypeTab['\r'] |= CHAR_EOL; + aCharTypeTab['\n'] |= CHAR_EOL; + + // fuer Syntax Highlighting + pCommentsBegin = new NAMESPACE_STD(list)<BOOL>(); + pCommentsEnd = new NAMESPACE_STD(list)<BOOL>(); + + bStarScriptMode = FALSE; + ppListKeyWords = NULL; +} + +SimpleTokenizer_Impl::~SimpleTokenizer_Impl( void ) +{ + delete(pCommentsBegin); + delete(pCommentsEnd); +} + +SimpleTokenizer_Impl* getSimpleTokenizer( void ) +{ + static SimpleTokenizer_Impl* pSimpleTokenizer = NULL; + if( !pSimpleTokenizer ) + pSimpleTokenizer = new SimpleTokenizer_Impl(); + return pSimpleTokenizer; +} + +// Heraussuchen der jeweils naechsten Funktion aus einem JavaScript-Modul +UINT16 SimpleTokenizer_Impl::parseLine( UINT32 nParseLine, const String* aSource ) +{ + ByteString aByteSource( *aSource, gsl_getSystemTextEncoding() ); + + // Position auf den Anfang des Source-Strings setzen + mpStringBegin = mpActualPos = aByteSource.GetBuffer(); + bLineHasCommentBegin = isBeginComment( nParseLine ); + bLineHasCommentEnd = FALSE; + + // Zeile und Spalte initialisieren + nLine = nParseLine; + nCol = 0L; + + // Variablen fuer die Out-Parameter + TokenTypes eType; + const char* pStartPos; + const char* pEndPos; + + // Schleife ueber alle Tokens + UINT16 nTokenCount = 0; + while( getNextToken( eType, pStartPos, pEndPos ) ) + nTokenCount++; + + // die Endzustaende der Zeilen in die Listen eintragen + setCommentState(nParseLine, bLineHasCommentBegin, bLineHasCommentEnd); + + return nTokenCount; +} + +void SimpleTokenizer_Impl::getHighlightPortions( UINT32 nParseLine, const String& rLine, + /*out*/HighlightPortions& portions ) +{ + ByteString aByteLine( rLine, gsl_getSystemTextEncoding() ); + + // Position auf den Anfang des Source-Strings setzen + mpStringBegin = mpActualPos = aByteLine.GetBuffer(); + bLineHasCommentBegin = isBeginComment( nParseLine ); + bLineHasCommentEnd = FALSE; + + // Zeile und Spalte initialisieren + nLine = nParseLine; + nCol = 0L; + + // Variablen fuer die Out-Parameter + TokenTypes eType; + const char* pStartPos; + const char* pEndPos; + + // Schleife ueber alle Tokens + while( getNextToken( eType, pStartPos, pEndPos ) ) + { + HighlightPortion portion; + + portion.nBegin = (UINT16)(pStartPos - mpStringBegin); + portion.nEnd = (UINT16)(pEndPos - mpStringBegin); + portion.tokenType = eType; + + portions.Insert(portion, portions.Count()); + } +} + +BOOL SimpleTokenizer_Impl::isBeginComment( UINT32 nLine ) +{ + NAMESPACE_STD(list)<BOOL>::const_iterator posBegin, posEnd; + BOOL bCommentStart = FALSE; + + UINT32 i = 0; + posBegin=pCommentsBegin->begin(); + posEnd=pCommentsEnd->begin(); + + while ((i < nLine) && (posBegin != pCommentsBegin->end()) && (posEnd != pCommentsEnd->end())) + { + if (bCommentStart && *posEnd) + bCommentStart = FALSE; + if ((!bCommentStart) && *posBegin) + bCommentStart = TRUE; + + posBegin++; + posEnd++; + i++; + } + + return bCommentStart; +} + +void SimpleTokenizer_Impl::outCommentList() +{ + NAMESPACE_STD(list)<BOOL>::const_iterator posBegin, posEnd; + BOOL bCommentStart = FALSE; + + UINT32 i = 0; + posBegin=pCommentsBegin->begin(); + posEnd=pCommentsEnd->begin(); + + printf("\nComments:\n"); + while (posBegin != pCommentsBegin->end()) + { + printf("line: %2d beginComment: %d endComment: %d\n", i, *posBegin, *posEnd); + + posBegin++; + posEnd++; + i++; + } + +} + +////////////////////////////////////////////////////////////////////////// +// Implementierung des SyntaxHighlighter + +SyntaxHighlighter::SyntaxHighlighter() +{ + m_pSimpleTokenizer = new SimpleTokenizer_Impl(); + m_pKeyWords = NULL; + m_nKeyWordCount = 0; +} + +SyntaxHighlighter::~SyntaxHighlighter() +{ + delete(m_pSimpleTokenizer); + delete(m_pKeyWords); +} + +void SyntaxHighlighter::initialize( HighlighterLanguage eLanguage_ ) +{ + eLanguage = eLanguage_; + delete(m_pSimpleTokenizer); + m_pSimpleTokenizer = new SimpleTokenizer_Impl(); + + if (eLanguage == HIGHLIGHT_BASIC) + { + m_pSimpleTokenizer->setKeyWords( strListBasicKeyWords, + sizeof( strListBasicKeyWords ) / sizeof( char* )); + } + else + { + m_pSimpleTokenizer->setKeyWords( NULL, 0 ); + } +} + +const Range SyntaxHighlighter::notifyChange( UINT32 nLine, INT32 nLineCountDifference, + const String* pChangedLines, UINT32 nArrayLength) +{ + if (nLineCountDifference != 0) + m_pSimpleTokenizer->addLines(nLine, nLineCountDifference); + + for (INT32 i=0; i<nArrayLength; i++) + m_pSimpleTokenizer->parseLine(nLine+i, &pChangedLines[i]); + + return Range(nLine, nLine+nArrayLength-1); +} + +void SyntaxHighlighter::getHighlightPortions( UINT32 nLine, const String& rLine, + /*out*/HighlightPortions& portions ) +{ + m_pSimpleTokenizer->getHighlightPortions( nLine, rLine, portions ); +} + + +///////////////////////////////////////////////////////////////////////// +// Implementation SbJScriptModule (Basic-Modul fuer JavaScript-Sourcen) +SbJScriptModule::SbJScriptModule( const String& rName ) + :SbModule( rName ) +{ +} + +BOOL SbJScriptModule::LoadData( SvStream& rStrm, USHORT nVer ) +{ + Clear(); + if( !SbxObject::LoadData( rStrm, 1 ) ) + return FALSE; + + // Source-String holen + rStrm.ReadByteString( aSource, gsl_getSystemTextEncoding() ); + //rStrm >> aSource; + return TRUE; +} + +BOOL SbJScriptModule::StoreData( SvStream& rStrm ) const +{ + if( !SbxObject::StoreData( rStrm ) ) + return FALSE; + + // Source-String schreiben + rStrm.WriteByteString( aSource, gsl_getSystemTextEncoding() ); + //rStrm << aSource; + return TRUE; +} + + +///////////////////////////////////////////////////////////////////////// + +SbMethod::SbMethod( const String& r, SbxDataType t, SbModule* p ) + : SbxMethod( r, t ), pMod( p ) +{ + bInvalid = TRUE; + nStart = + nDebugFlags = + nLine1 = + nLine2 = 0; + // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden' + SetFlag( SBX_NO_MODIFY ); +} + +SbMethod::~SbMethod() +{} + +SbxArray* SbMethod::GetLocals() +{ + if( pINST ) + return pINST->GetLocals( this ); + else + return NULL; +} + +SbxArray* SbMethod::GetStatics() +{ + DBG_ERROR( "SbMethod::GetStatics() invalid, AB fragen" ) + return NULL; +} + +BOOL SbMethod::LoadData( SvStream& rStrm, USHORT nVer ) +{ + if( !SbxMethod::LoadData( rStrm, 1 ) ) + return FALSE; + INT16 n; + rStrm >> n; + // nDebugFlags = n; // AB 16.1.96: Nicht mehr uebernehmen + if( nVer == 2 ) + rStrm >> nLine1 >> nLine2 >> nStart >> bInvalid; + // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden' + SetFlag( SBX_NO_MODIFY ); + return TRUE; +} + +BOOL SbMethod::StoreData( SvStream& rStrm ) const +{ + if( !SbxMethod::StoreData( rStrm ) ) + return FALSE; + rStrm << (INT16) nDebugFlags + << (INT16) nLine1 + << (INT16) nLine2 + << (INT16) nStart + << (BYTE) bInvalid; + return TRUE; +} + +void SbMethod::GetLineRange( USHORT& l1, USHORT& l2 ) +{ + l1 = nLine1; l2 = nLine2; +} + +// Kann spaeter mal weg + +SbxInfo* SbMethod::GetInfo() +{ + return pInfo; +} + +// Schnittstelle zum Ausfuehren einer Methode aus den Applikationen +// #34191# Mit speziellem RefCounting, damit das Basic nicht durch CloseDocument() +// abgeschossen werden kann. Rueckgabewert wird als String geliefert. +ErrCode SbMethod::Call( SbxValue* pRet ) +{ + // RefCount vom Modul hochzaehlen + SbModule* pMod = (SbModule*)GetParent(); + pMod->AddRef(); + + // RefCount vom Basic hochzaehlen + StarBASIC* pBasic = (StarBASIC*)pMod->GetParent(); + pBasic->AddRef(); + + // Values anlegen, um Return-Wert zu erhalten + SbxValues aVals; + aVals.eType = SbxVARIANT; + Get( aVals ); + if ( pRet ) + pRet->Put( aVals ); + + // Gab es einen Error + ErrCode nErr = SbxBase::GetError(); + SbxBase::ResetError(); + + // Objekte freigeben + pMod->ReleaseRef(); + pBasic->ReleaseRef(); + + return nErr; +} + +///////////////////////////////////////////////////////////////////////// + +// Implementation SbJScriptMethod (Method-Klasse als Wrapper fuer JavaScript-Funktionen) + +SbJScriptMethod::SbJScriptMethod( const String& r, SbxDataType t, SbModule* p ) + : SbMethod( r, t, p ) +{ +} + +SbJScriptMethod::~SbJScriptMethod() +{} + + +///////////////////////////////////////////////////////////////////////// + +SbProperty::SbProperty( const String& r, SbxDataType t, SbModule* p ) + : SbxProperty( r, t ), pMod( p ) +{ + bInvalid = FALSE; +} + +SbProperty::~SbProperty() +{} + + diff --git a/basic/source/comp/buffer.cxx b/basic/source/comp/buffer.cxx new file mode 100644 index 000000000000..7fc27bb233cc --- /dev/null +++ b/basic/source/comp/buffer.cxx @@ -0,0 +1,253 @@ +/************************************************************************* + * + * $RCSfile: buffer.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "sbcomp.hxx" +#pragma hdrstop +#include "buffer.hxx" +#include <string.h> + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +// Der SbiBuffer wird in Inkrements von mindestens 16 Bytes erweitert. +// Dies ist notwendig, da viele Klassen von einer Pufferlaenge +// von x*16 Bytes ausgehen. + +SbiBuffer::SbiBuffer( SbiParser* p, short n ) +{ + pParser = p; + n = ( (n + 15 ) / 16 ) * 16; + if( !n ) n = 16; + pBuf = NULL; + pCur = NULL; + nInc = n; + nSize = + nOff = 0; +} + +SbiBuffer::~SbiBuffer() +{ + delete pBuf; +} + +// Rausreichen des Puffers +// Dies fuehrt zur Loeschung des Puffers! + +char* SbiBuffer::GetBuffer() +{ + char* p = pBuf; + pBuf = NULL; + pCur = NULL; + return p; +} + +// Test, ob der Puffer n Bytes aufnehmen kann. +// Im Zweifelsfall wird er vergroessert + +BOOL SbiBuffer::Check( USHORT n ) +{ + if( !n ) return TRUE; + if( ((long) nOff + n ) > (long) nSize ) + { + USHORT nn = 0; + while( nn < n ) nn += nInc; + char* p; + if( ((long) nSize + nn ) > 0xFF00L ) p = NULL; + else p = new char [nSize + nn]; + if( !p ) + { + pParser->Error( SbERR_PROG_TOO_LARGE ); + nInc = 0; + delete pBuf; pBuf = NULL; + return FALSE; + } + else + { + if( nSize ) memcpy( p, pBuf, nSize ); + delete pBuf; + pBuf = p; + pCur = pBuf + nOff; + nSize += nn; + } + } + return TRUE; +} + +// Angleich des Puffers auf die uebergebene Byte-Grenze + +void SbiBuffer::Align( short n ) +{ + if( nOff % n ) { + USHORT nn =( ( nOff + n ) / n ) * n; + if( nn <= 0xFF00 ) + { + nn -= nOff; + if( Check( nn ) ) + { + memset( pCur, 0, nn ); + pCur += nn; + nOff += nn; + } + } + } +} + +// Patch einer Location + +void SbiBuffer::Patch( USHORT off, UINT16 val ) +{ + if( ( off + sizeof( UINT16 ) ) < nOff ) + { + BYTE* p = (BYTE*) pBuf + off; + *p++ = (char) ( val & 0xFF ); + *p = (char) ( val >> 8 ); + } +} + +// Forward References auf Labels und Prozeduren +// bauen eine Kette auf. Der Anfang der Kette ist beim uebergebenen +// Parameter, das Ende der Kette ist 0. + +void SbiBuffer::Chain( USHORT off ) +{ + if( off && pBuf ) + { + BYTE *ip; + USHORT i = off; + USHORT val = nOff; + do + { + ip = (BYTE*) pBuf + i; + i = ( *ip ) | ( *(ip+1) << 8 ); + if( i >= nOff ) + { + pParser->Error( SbERR_INTERNAL_ERROR, "BACKCHAIN" ); + break; + } + *ip++ = (char) ( val & 0xFF ); + *ip = (char) ( val >> 8 ); + } while( i ); + } +} + +BOOL SbiBuffer::operator +=( INT8 n ) +{ + if( Check( 1 ) ) + { + *pCur++ = (char) n; nOff++; return TRUE; + } else return FALSE; +} + +BOOL SbiBuffer::operator +=( UINT8 n ) +{ + if( Check( 1 ) ) + { + *pCur++ = (char) n; nOff++; return TRUE; + } else return FALSE; +} + +BOOL SbiBuffer::operator +=( INT16 n ) +{ + if( Check( 2 ) ) + { + *pCur++ = (char) ( n & 0xFF ); + *pCur++ = (char) ( n >> 8 ); + nOff += 2; return TRUE; + } else return FALSE; +} + +BOOL SbiBuffer::operator +=( UINT16 n ) +{ + if( Check( 2 ) ) + { + *pCur++ = (char) ( n & 0xFF ); + *pCur++ = (char) ( n >> 8 ); + nOff += 2; return TRUE; + } else return FALSE; +} + +BOOL SbiBuffer::operator +=( const String& n ) +{ + USHORT l = n.Len() + 1; + if( Check( l ) ) + { + ByteString aByteStr( n, gsl_getSystemTextEncoding() ); + memcpy( pCur, aByteStr.GetBuffer(), l ); + pCur += l; + nOff += l; + return TRUE; + } + else return FALSE; +} + +BOOL SbiBuffer::Add( const void* p, USHORT len ) +{ + if( Check( len ) ) + { + memcpy( pCur, p, len ); + pCur += len; + nOff += len; + return TRUE; + } else return FALSE; +} + + + diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx new file mode 100644 index 000000000000..a81b0c02422d --- /dev/null +++ b/basic/source/comp/codegen.cxx @@ -0,0 +1,241 @@ +/************************************************************************* + * + * $RCSfile: codegen.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <svtools/sbx.hxx> +#include "sbcomp.hxx" +#pragma hdrstop +#include "image.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +// nInc ist die Inkrementgroesse der Puffer + +SbiCodeGen::SbiCodeGen( SbModule& r, SbiParser* p, short nInc ) + : rMod( r ), aCode( p, nInc ) +{ + pParser = p; + bStmnt = FALSE; + nLine = 0; + nCol = 0; + nForLevel = 0; +} + +USHORT SbiCodeGen::GetPC() +{ + return aCode.GetSize(); +} + +// Statement merken + +void SbiCodeGen::Statement() +{ + bStmnt = TRUE; + + nLine = pParser->GetLine(); + nCol = pParser->GetCol1(); + + // #29955 Information der for-Schleifen-Ebene + // in oberen Byte der Spalte speichern + nCol = (nCol & 0xff) + 0x100 * nForLevel; +} + +// Anfang eines Statements markieren + +void SbiCodeGen::GenStmnt() +{ + if( bStmnt ) + { + bStmnt = FALSE; + Gen( _STMNT, nLine, nCol ); + } +} + +// Die Gen-Routinen returnen den Offset des 1. Operanden, +// damit Jumps dort ihr Backchain versenken koennen + +USHORT SbiCodeGen::Gen( SbiOpcode eOpcode ) +{ +#ifndef PRODUCT + if( eOpcode < SbOP0_START || eOpcode > SbOP0_END ) + pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE1" ); +#endif + GenStmnt(); + aCode += (UINT8) eOpcode; + return GetPC(); +} + +USHORT SbiCodeGen::Gen( SbiOpcode eOpcode, UINT16 nOpnd ) +{ +#ifndef PRODUCT + if( eOpcode < SbOP1_START || eOpcode > SbOP1_END ) + pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE2" ); +#endif + GenStmnt(); + aCode += (UINT8) eOpcode; + USHORT n = GetPC(); + aCode += nOpnd; + return n; +} + +USHORT SbiCodeGen::Gen( SbiOpcode eOpcode, UINT16 nOpnd1, UINT16 nOpnd2 ) +{ +#ifndef PRODUCT + if( eOpcode < SbOP2_START || eOpcode > SbOP2_END ) + pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE3" ); +#endif + GenStmnt(); + aCode += (UINT8) eOpcode; + USHORT n = GetPC(); + aCode += nOpnd1; + aCode += nOpnd2; + return n; +} + +// Abspeichern des erzeugten Images im Modul + +void SbiCodeGen::Save() +{ + SbiImage* p = new SbiImage; + if( !p ) + { + SbERR_NO_MEMORY; return; + } + rMod.StartDefinitions(); + // OPTION BASE-Wert: + p->nDimBase = pParser->nBase; + // OPTION EXPLICIT-Flag uebernehmen + if( pParser->bExplicit ) + p->SetFlag( SBIMG_EXPLICIT ); + if( pParser->bText ) + p->SetFlag( SBIMG_COMPARETEXT ); + // GlobalCode-Flag + if( pParser->HasGlobalCode() ) + p->SetFlag( SBIMG_INITCODE ); + // Die Entrypoints: + for( SbiSymDef* pDef = pParser->aPublics.First(); pDef; + pDef = pParser->aPublics.Next() ) + { + SbiProcDef* pProc = pDef->GetProcDef(); + if( pProc && pProc->IsPublic() && pProc->IsDefined() ) + { + SbMethod* pMeth = rMod.GetMethod( pProc->GetName(), pProc->GetType() ); + pMeth->nStart = pProc->GetAddr(); + pMeth->nLine1 = pProc->GetLine1(); + pMeth->nLine2 = pProc->GetLine2(); + // Die Parameter: + SbxInfo* pInfo = pMeth->GetInfo(); + String aHelpFile, aComment; + ULONG nHelpId = 0; + if( pInfo ) + { + // Die Zusatzdaten retten + aHelpFile = pInfo->GetHelpFile(); + aComment = pInfo->GetComment(); + nHelpId = pInfo->GetHelpId(); + } + // Und die Parameterliste neu aufbauen + pInfo = new SbxInfo( aHelpFile, nHelpId ); + pInfo->SetComment( aComment ); + SbiSymPool* pPool = &pProc->GetParams(); + // Das erste Element ist immer der Funktionswert! + for( USHORT i = 1; i < pPool->GetSize(); i++ ) + { + SbiSymDef* pPar = pPool->Get( i ); + SbxDataType t = pPar->GetType(); + if( !pPar->IsByVal() ) + t = (SbxDataType) ( t | SbxBYREF ); + if( pPar->GetDims() ) + t = (SbxDataType) ( t | SbxARRAY ); + // #33677 Optional-Info durchreichen + USHORT nFlags = SBX_READ; + if( pPar->IsOptional() ) + nFlags |= SBX_OPTIONAL; + pInfo->AddParam( pPar->GetName(), t, nFlags ); + } + pMeth->SetInfo( pInfo ); + } + } + // Der Code + p->AddCode( aCode.GetBuffer(), aCode.GetSize() ); + + // Der globale StringPool. 0 ist nicht belegt. + SbiStringPool* pPool = &pParser->aGblStrings; + USHORT nSize = pPool->GetSize(); + p->MakeStrings( nSize ); + USHORT i; + for( i = 1; i <= nSize; i++ ) + p->AddString( pPool->Find( i ) ); + + // Typen einfuegen + + USHORT nCount = pParser->rTypeArray->Count(); + for (i = 0; i < nCount; i++) + p->AddType((SbxObject *)pParser->rTypeArray->Get(i)); + + if( !p->IsError() ) + rMod.pImage = p; + else + delete p; + + rMod.EndDefinitions(); +} + diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx new file mode 100644 index 000000000000..233342c0499c --- /dev/null +++ b/basic/source/comp/dim.cxx @@ -0,0 +1,792 @@ +/************************************************************************* + * + * $RCSfile: dim.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <svtools/sbx.hxx> +#include "sbcomp.hxx" +#pragma hdrstop + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +// Deklaration einer Variablen +// Bei Fehlern wird bis zum Komma oder Newline geparst. +// Returnwert: eine neue Instanz, die eingefuegt und dann geloescht wird. +// Array-Indexe werden als SbiDimList zurueckgegeben + +SbiSymDef* SbiParser::VarDecl( SbiDimList** ppDim, BOOL bStatic, BOOL bConst ) +{ + if( !TestSymbol() ) return NULL; + SbxDataType t = eScanType; + SbiSymDef* pDef = bConst ? new SbiConstDef( aSym ) : new SbiSymDef( aSym ); + SbiDimList* pDim = NULL; + // Klammern? + if( Peek() == LPAREN ) + pDim = new SbiDimList( this ); + pDef->SetType( t ); + if( bStatic ) + pDef->SetStatic(); + TypeDecl( *pDef ); + if( !ppDim && pDim ) + { + if(pDim->GetDims() ) + Error( SbERR_EXPECTED, "()" ); + delete pDim; + } + else if( ppDim ) + *ppDim = pDim; + return pDef; +} + +// Aufloesen einer AS-Typdeklaration +// Der Datentyp wird in die uebergebene Variable eingetragen + +void SbiParser::TypeDecl( SbiSymDef& rDef ) +{ + SbxDataType eType = rDef.GetType(); + short nSize = 0; + if( Peek() == AS ) + { +#ifdef VBSCRIPT_TEST + Error( ERRCODE_BASIC_NOT_IN_VBSCRIPT ); +#endif + Next(); + rDef.SetDefinedAs(); + String aType; + SbiToken eTok = Next(); + if( eTok == NEW ) + { + rDef.SetNew(); + eTok = Next(); + } + switch( eTok ) + { + case ANY: + if( rDef.IsNew() ) + Error( SbERR_SYNTAX ); + eType = SbxVARIANT; break; + case TINTEGER: + case TLONG: + case TSINGLE: + case TDOUBLE: + case TCURRENCY: + case TDATE: + case TSTRING: + case TOBJECT: + case _ERROR_: + case TBOOLEAN: + case TVARIANT: + if( rDef.IsNew() ) + Error( SbERR_SYNTAX ); + eType = SbxDataType( eTok - TINTEGER + SbxINTEGER ); + if( eType == SbxSTRING ) + { + // STRING*n ? + if( Peek() == MUL ) + { // fixed size! + Next(); + SbiConstExpression aSize( this ); + nSize = aSize.GetShortValue(); + if( nSize < 0 ) + Error( SbERR_OUT_OF_RANGE ); + } + } + break; + case SYMBOL: // kann nur ein TYPE oder eine Objektklasse sein! + if( eScanType != SbxVARIANT ) + Error( SbERR_SYNTAX ); + else + { + String aCompleteName = aSym; + + // #52709 DIM AS NEW fuer Uno mit voll-qualifizierten Namen + if( Peek() == DOT ) + { + String aDotStr( '.' ); + while( Peek() == DOT ) + { + aCompleteName += aDotStr; + Next(); + if( Peek() == SYMBOL ) + { + Next(); + aCompleteName += aSym; + } + else + { + Next(); + Error( SbERR_UNEXPECTED, SYMBOL ); + break; + } + } + } + + // In den String-Pool uebernehmen + rDef.SetTypeId( aGblStrings.Add( aCompleteName ) ); + } + eType = SbxOBJECT; + break; + default: + Error( SbERR_UNEXPECTED, eTok ); + Next(); + } + // Die Variable koennte mit Suffix deklariert sein + if( rDef.GetType() != SbxVARIANT ) + { + if( rDef.GetType() != eType ) + Error( SbERR_VAR_DEFINED, rDef.GetName() ); + else if( eType == SbxSTRING && rDef.GetLen() != nSize ) + Error( SbERR_VAR_DEFINED, rDef.GetName() ); + } + rDef.SetType( eType ); + rDef.SetLen( nSize ); + } +} + +// Hier werden Variable, Arrays und Strukturen definiert. +// DIM/PRIVATE/PUBLIC/GLOBAL + +void SbiParser::Dim() +{ + DefVar( _DIM, FALSE ); +} + +void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) +{ + SbiSymPool* pOldPool = pPool; + BOOL bSwitchPool = FALSE; + if( pProc && ( eCurTok == GLOBAL || eCurTok == PUBLIC || eCurTok == PRIVATE ) ) + Error( SbERR_NOT_IN_SUBR, eCurTok ); + if( eCurTok == PUBLIC || eCurTok == GLOBAL ) + bSwitchPool = TRUE; // im richtigen Moment auf globalen Pool schalten + //pPool = &aGlobals; + // PRIVATE ist Synonym fuer DIM + // _CONST_? + BOOL bConst = FALSE; + if( eCurTok == _CONST_ ) + bConst = TRUE; + else if( Peek() == _CONST_ ) + Next(), bConst = TRUE; +#ifdef SHARED +#define tmpSHARED +#undef SHARED +#endif + // SHARED wird ignoriert + if( Peek() == SHARED ) Next(); +#ifdef tmpSHARED +#define SHARED +#undef tmpSHARED +#endif + // PRESERVE nur bei REDIM + if( Peek() == PRESERVE ) + { + Next(); + if( eOp == _REDIM ) + eOp = _REDIMP; + else + Error( SbERR_UNEXPECTED, eCurTok ); + } + SbiSymDef* pDef; + SbiDimList* pDim; + + // AB 9.7.97, #40689, Statics -> Modul-Initialisierung, in Sub ueberspringen + USHORT nEndOfStaticLbl; + if( bStatic ) + { + nEndOfStaticLbl = aGen.Gen( _JUMP, 0 ); + aGen.Statement(); // bei static hier nachholen + } + + BOOL bDefined = FALSE; + while( ( pDef = VarDecl( &pDim, bStatic, bConst ) ) != NULL ) + { + EnableErrors(); + // Variable suchen: + if( bSwitchPool ) + pPool = &aGlobals; + SbiSymDef* pOld = pPool->Find( pDef->GetName() ); + // AB 31.3.1996, #25651#, auch in Runtime-Library suchen + BOOL bRtlSym = FALSE; + if( !pOld ) + { + pOld = CheckRTLForSym( pDef->GetName(), SbxVARIANT ); + if( pOld ) + bRtlSym = TRUE; + } + if( pOld ) + { + bDefined = TRUE; + // Bei RTL-Symbol immer Fehler + if( !bRtlSym && (eOp == _REDIM || eOp == _REDIMP) ) + { + // Bei REDIM die Attribute vergleichen + if( pOld->IsStatic() || pOld->GetType() != pDef->GetType() ) + Error( SbERR_VAR_DEFINED, pDef->GetName() ); + } + else + Error( SbERR_VAR_DEFINED, pDef->GetName() ); + delete pDef; pDef = pOld; + } + else + pPool->Add( pDef ); + + // #36374: Variable vor Unterscheidung IsNew() anlegen + // Sonst Error bei Dim Identifier As New Type und option explicit + if( !bDefined && ( !bConst || pDef->GetScope() == SbGLOBAL ) ) + { + // Variable oder globale Konstante deklarieren + SbiOpcode eOp; + switch ( pDef->GetScope() ) + { + case SbGLOBAL: eOp = _GLOBAL; goto global; + case SbPUBLIC: eOp = _PUBLIC; + // AB 9.7.97, #40689, kein eigener Opcode mehr + /* + if( bStatic ) + { + eOp = _STATIC; + break; + } + */ + global: aGen.BackChain( nGblChain ); + nGblChain = 0; + bGblDefs = bNewGblDefs = TRUE; + break; + default: eOp = _LOCAL; + } + aGen.Gen( eOp, pDef->GetId(), pDef->GetType() ); + } + + // Initialisierung fuer selbstdefinierte Datentypen + // und per NEW angelegte Variable + if( pDef->GetType() == SbxOBJECT + && pDef->GetTypeId() + && pDef->IsNew() ) +// && ( pDef->IsNew() || pDef->HabIchAlsTypeDefiniert() ) ) + { + if( bConst ) + { + Error( SbERR_SYNTAX ); + } + + if( pDim ) + { + pDef->SetDims( pDim->GetDims() ); + SbiExpression aExpr( this, *pDef, pDim ); + aExpr.Gen(); + aGen.Gen( _DCREATE, pDef->GetId(), pDef->GetTypeId() ); + } + else + { + SbiExpression aExpr( this, *pDef ); + aExpr.Gen(); + SbiOpcode eOp = pDef->IsNew() ? _CREATE : _TCREATE; + aGen.Gen( eOp, pDef->GetId(), pDef->GetTypeId() ); + aGen.Gen( _SET ); + } + } + else + { + if( bConst ) + { + // Konstanten-Definition + if( pDim ) + { + Error( SbERR_SYNTAX ); + delete pDim; + } + SbiExpression aVar( this, *pDef ); + if( !TestToken( EQ ) ) + goto MyBreak; // AB 24.6.1996 (s.u.) + SbiConstExpression aExpr( this ); + if( !bDefined && aExpr.IsValid() ) + { + if( pDef->GetScope() == SbGLOBAL ) + { + // Nur Code fuer globale Konstante erzeugen! + aVar.Gen(); + aExpr.Gen(); + aGen.Gen( _PUTC ); + } + SbiConstDef* pConst = pDef->GetConstDef(); + if( aExpr.GetType() == SbxSTRING ) + pConst->Set( aExpr.GetString() ); + else + pConst->Set( aExpr.GetValue(), aExpr.GetType() ); + } + } + else if( pDim ) + { + // Die Variable dimensionieren + // Bei REDIM die Var vorher loeschen + if( eOp == _REDIM ) + { + SbiExpression aExpr( this, *pDef, NULL ); + aExpr.Gen(); + aGen.Gen( _ERASE ); + } + pDef->SetDims( pDim->GetDims() ); + SbiExpression aExpr( this, *pDef, pDim ); + aExpr.Gen(); + aGen.Gen( (eOp == _STATIC) ? _DIM : eOp ); + } + } + if( !TestComma() ) + goto MyBreak; // AB 24.6.1996 (s.u.) + + // #27963# AB, 24.6.1996 + // Einfuehrung bSwitchPool (s.o.): pPool darf beim VarDecl-Aufruf + // noch nicht auf &aGlobals gesetzt sein. + // Ansonsten soll das Verhalten aber absolut identisch bleiben, + // d.h. pPool muss immer am Schleifen-Ende zurueckgesetzt werden. + // auch bei break + pPool = pOldPool; + continue; // MyBreak berspingen + MyBreak: + pPool = pOldPool; + break; + } + + // AB 9.7.97, #40689, Sprung ueber Statics-Deklaration abschliessen + if( bStatic ) + { + // globalen Chain pflegen + nGblChain = aGen.Gen( _JUMP, 0 ); + bGblDefs = bNewGblDefs = TRUE; + + // fuer Sub Sprung auf Ende der statics eintragen + aGen.BackChain( nEndOfStaticLbl ); + } + + //pPool = pOldPool; +} + +// Hier werden Arrays redimensioniert. + +void SbiParser::ReDim() +{ + DefVar( _REDIM, FALSE ); +} + +// ERASE array, ... + +void SbiParser::Erase() +{ + while( !bAbort ) + { + if( !TestSymbol() ) return; + String aName( aSym ); + SbxDataType eType = eScanType; + SbiSymDef* pDef = pPool->Find( aName ); + if( !pDef ) + { + if( bExplicit ) + Error( SbERR_UNDEF_VAR, aName ); + pDef = pPool->AddSym( aName ); + pDef->SetType( eType ); + } + SbiExpression aExpr( this, *pDef ); + aExpr.Gen(); + aGen.Gen( _ERASE ); + if( !TestComma() ) break; + } +} + +// Deklaration eines Datentyps + +void SbiParser::Type() +{ + // Neues Token lesen, es muss ein Symbol sein + if (!TestSymbol()) + return; + + if (rTypeArray->Find(aSym,SbxCLASS_OBJECT)) + { + Error( SbERR_VAR_DEFINED, aSym ); + return; + } + + SbxObject *pType = new SbxObject(aSym); + + SbiSymDef* pElem; + SbiDimList* pDim; + BOOL bDone = FALSE; + + while( !bDone && !IsEof() ) + { + switch (Next()) + { + case ENDTYPE : + pElem = NULL; + bDone = TRUE; + break; + + case EOLN : + pElem = NULL; + break; + + default: + pDim = NULL; + pElem = VarDecl(&pDim,FALSE,FALSE); + if( pDim ) + { + // HOT FIX, to be updated + delete pDim; + Error( SbERR_NO_STRINGS_ARRAYS ); + } + + } + if( pElem ) + { + SbxArray *pTypeMembers = pType -> GetProperties(); + if (pTypeMembers -> Find (pElem->GetName(),SbxCLASS_DONTCARE)) + Error (SbERR_VAR_DEFINED); + else + { + SbxProperty *pTypeElem = new SbxProperty (pElem->GetName(),pElem->GetType()); + pTypeMembers -> Insert (pTypeElem,pTypeMembers->Count()); + } + delete pElem; + } + } + rTypeArray->Insert (pType,rTypeArray->Count()); +} +/********************************************************** + // Variablennamen einlesen: + if( !TestSymbol() ) return; + String aName( aSym ); + if( pDEFS->Find( aName ) ) + { + Error( SbERR_VAR_DEFINED, aName ); return; + } + SbTypeDef* pDef = pDEFS->AddTypeDef( aName ); + TestEoln(); + + // Deklarationen parsen: + SbiSymDef* pElem; + SbiDimList* pDim; + BOOL bDone = FALSE; + while( !IsEof() && !bDone ) + { + switch( Next() ) + { + case SUB: + case FUNCTION: + pElem = ProcDecl( TRUE ); break; + case END: + pElem = NULL; + bDone = TRUE; + if( Next() != TYPE ) + Error( SbERR_EXPECTED, TYPE ); + break; + default: + pElem = VarDecl( &pDim ); + if( pDim ) + { + // HOT FIX, to be updated + delete pDim; + Error( SbERR_NO_STRINGS_ARRAYS ); + } + } + if( pElem ) + pDef->GetPool().Add( *pElem ); + delete pElem; + } +} +************************************************/ + +// Prozedur-Deklaration +// das erste Token ist bereits eingelesen (SUB/FUNCTION) +// xxx Name [LIB "name"[ALIAS "name"]][(Parameter)][AS TYPE] + +SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) +{ + BOOL bFunc = BOOL( eCurTok == FUNCTION ); + if( !TestSymbol() ) return NULL; + String aName( aSym ); + SbxDataType eType = eScanType; + SbiProcDef* pDef = new SbiProcDef( this, aName ); + pDef->SetType( eType ); + if( Peek() == _CDECL_ ) + { + Next(); pDef->SetCdecl(); + } + if( Peek() == LIB ) + { + Next(); + if( Next() == FIXSTRING ) + pDef->GetLib() = aSym; + else + Error( SbERR_SYNTAX ); + } + if( Peek() == ALIAS ) + { + Next(); + if( Next() == FIXSTRING ) + pDef->GetAlias() = aSym; + else + Error( SbERR_SYNTAX ); + } + if( !bDecl ) + { + // CDECL, LIB und ALIAS sind unzulaessig + if( pDef->GetLib().Len() ) + Error( SbERR_UNEXPECTED, LIB ); + if( pDef->GetAlias().Len() ) + Error( SbERR_UNEXPECTED, ALIAS ); + if( pDef->IsCdecl() ) + Error( SbERR_UNEXPECTED, _CDECL_ ); + pDef->SetCdecl( FALSE ); + pDef->GetLib().Erase(); + pDef->GetAlias().Erase(); + } + else if( !pDef->GetLib().Len() ) + { + // ALIAS und CDECL nur zusammen mit LIB + if( pDef->GetAlias().Len() ) + Error( SbERR_UNEXPECTED, ALIAS ); + if( pDef->IsCdecl() ) + Error( SbERR_UNEXPECTED, _CDECL_ ); + pDef->SetCdecl( FALSE ); + pDef->GetAlias().Erase(); + } + // Klammern? + if( Peek() == LPAREN ) + { + Next(); + if( Peek() == RPAREN ) + Next(); + else + for(;;) { + BOOL bByVal = FALSE; + BOOL bOptional = FALSE; + while( Peek() == BYVAL || Peek() == _OPTIONAL_ ) + { + if ( Peek() == BYVAL ) Next(), bByVal = TRUE; + else if ( Peek() == _OPTIONAL_ ) Next(), bOptional = TRUE; + } + SbiSymDef* pPar = VarDecl( NULL, FALSE, FALSE ); + if( !pPar ) + break; + if( bByVal ) + pPar->SetByVal(); + if( bOptional ) + pPar->SetOptional(); + pDef->GetParams().Add( pPar ); + SbiToken eTok = Next(); + if( eTok != COMMA && eTok != RPAREN ) + { + Error( SbERR_EXPECTED, RPAREN ); + break; + } + if( eTok == RPAREN ) + break; + } + } + TypeDecl( *pDef ); + if( eType != SbxVARIANT && pDef->GetType() != eType ) + Error( SbERR_BAD_DECLARATION, aName ); +// if( pDef->GetType() == SbxOBJECT ) +// pDef->SetType( SbxVARIANT ), +// Error( SbERR_SYNTAX ); + if( pDef->GetType() == SbxVARIANT && !bFunc ) + pDef->SetType( SbxEMPTY ); + return pDef; +} + +// DECLARE + +void SbiParser::Declare() +{ + Next(); + if( eCurTok != SUB && eCurTok != FUNCTION ) + Error( SbERR_UNEXPECTED, eCurTok ); + else + { + SbiProcDef* pDef = ProcDecl( TRUE ); + if( pDef ) + { + if( !pDef->GetLib().Len() ) + Error( SbERR_EXPECTED, LIB ); + // gibts den schon? + SbiSymDef* pOld = aPublics.Find( pDef->GetName() ); + if( pOld ) + { + SbiProcDef* p = pOld->GetProcDef(); + if( !p ) + { + // Als Variable deklariert + Error( SbERR_BAD_DECLARATION, pDef->GetName() ); + delete pDef; + } + else + pDef->Match( p ); + } + else + aPublics.Add( pDef ); + } + } +} + +// Aufruf einer SUB oder FUNCTION + +void SbiParser::Call() +{ + String aName( aSym ); + SbiExpression aVar( this, SbSYMBOL ); + aVar.Gen(); + aGen.Gen( _GET ); +} + +// SUB/FUNCTION + +void SbiParser::SubFunc() +{ + DefProc( FALSE ); +} + +// Einlesen einer Prozedur + +void SbiParser::DefProc( BOOL bStatic ) +{ + USHORT l1 = nLine, l2 = nLine; + BOOL bSub = BOOL( eCurTok == SUB ); + SbiToken eExit = eCurTok; + SbiProcDef* pDef = ProcDecl( FALSE ); + if( !pDef ) + return; + + // Ist die Proc bereits deklariert? + SbiSymDef* pOld = aPublics.Find( pDef->GetName() ); + if( pOld ) + { + pProc = pOld->GetProcDef(); + if( !pProc ) + { + // Als Variable deklariert + Error( SbERR_BAD_DECLARATION, pDef->GetName() ); + delete pDef; + pProc = NULL; + } + else + { + pDef->Match( pProc ); + pProc = pDef; + } + } + else + aPublics.Add( pDef ), pProc = pDef; + + if( !pProc ) + return; + + // Nun setzen wir die Suchhierarchie fuer Symbole sowie die aktuelle + // Prozedur. + aPublics.SetProcId( pProc->GetId() ); + pProc->GetParams().SetParent( &aPublics ); + if( !bStatic ) + { + // Normalfall: Lokale Variable->Parameter->Globale Variable + pProc->GetLocals().SetParent( &pProc->GetParams() ); + pPool = &pProc->GetLocals(); + } + else + { + Error( SbERR_NOT_IMPLEMENTED ); // STATIC SUB ... + } + + pProc->Define(); + OpenBlock( eExit ); + StmntBlock( bSub ? ENDSUB : ENDFUNC ); + l2 = nLine; + pProc->SetLine1( l1 ); + pProc->SetLine2( l2 ); + pPool = &aPublics; + aPublics.SetProcId( 0 ); + // Offene Labels? + pProc->GetLabels().CheckRefs(); + CloseBlock(); + aGen.Gen( _LEAVE ); + pProc = NULL; +} + +// STATIC variable|procedure + +void SbiParser::Static() +{ + switch( Peek() ) + { + case SUB: + case FUNCTION: + Next(); + DefProc( TRUE ); + break; + default: { + if( !pProc ) + Error( SbERR_NOT_IN_SUBR ); + // Pool umsetzen, damit STATIC-Deklarationen im globalen + // Pool landen + SbiSymPool* p = pPool; pPool = &aPublics; + DefVar( _STATIC, TRUE ); + pPool = p; + } break; + } +} + diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx new file mode 100644 index 000000000000..0d1783a1c155 --- /dev/null +++ b/basic/source/comp/exprgen.cxx @@ -0,0 +1,273 @@ +/************************************************************************* + * + * $RCSfile: exprgen.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "sbcomp.hxx" +#pragma hdrstop +#include "expr.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCEXPR, SBCOMP_CODE ) + +// Umsetztabelle fuer Token-Operatoren und Opcodes + +typedef struct { + SbiToken eTok; // Token + SbiOpcode eOp; // Opcode +} OpTable; + +static OpTable aOpTable [] = { + { EXPON,_EXP }, + { MUL, _MUL }, + { DIV, _DIV }, + { IDIV, _IDIV }, + { MOD, _MOD }, + { PLUS, _PLUS }, + { MINUS,_MINUS }, + { EQ, _EQ }, + { NE, _NE }, + { LE, _LE }, + { GE, _GE }, + { LT, _LT }, + { GT, _GT }, + { AND, _AND }, + { OR, _OR }, + { XOR, _XOR }, + { EQV, _EQV }, + { IMP, _IMP }, + { NOT, _NOT }, + { NEG, _NEG }, + { CAT, _CAT }, + { LIKE, _LIKE }, + { IS, _IS }, + { NIL, _NOP }}; + +// Ausgabe eines Elements + +void SbiExprNode::Gen() +{ + if( IsConstant() ) + { + switch( GetType() ) + { + case SbxEMPTY: pGen->Gen( _EMPTY ); break; + case SbxINTEGER: pGen->Gen( _CONST, (short) nVal ); break; + case SbxSTRING: pGen->Gen( _SCONST, nStringId ); break; + default: + nStringId = pGen->GetParser()->aGblStrings.Add( nVal, eType ); + pGen->Gen( _NUMBER, nStringId ); + } + } + else if( IsOperand() ) + { + SbiOpcode eOp; + if( aVar.pDef->GetScope() == SbPARAM ) + eOp = _PARAM; + // AB: 17.12.1995, Spezialbehandlung fuer WITH + else if( IsPartOfWith() ) + { + eOp = _ELEM; // .-Ausdruck in WITH + } + else + { + SbiProcDef* pProc = aVar.pDef->GetProcDef(); + // per DECLARE definiert? + if( pProc && pProc->GetLib().Len() ) + eOp = pProc->IsCdecl() ? _CALLC : _CALL; + else + eOp = ( aVar.pDef->GetScope() == SbRTL ) ? _RTL : _FIND; + } + + for( SbiExprNode* p = this; p; p = p->aVar.pNext ) + { + if( p->IsPartOfWith() ) + pGen->GetParser()->GetWithVar()->Gen(); + p->GenElement( eOp ); + eOp = _ELEM; + } + } + else + { + pLeft->Gen(); + if( pRight ) + pRight->Gen(); + for( OpTable* p = aOpTable; p->eTok != NIL; p++ ) + { + if( p->eTok == eTok ) + { + pGen->Gen( p->eOp ); break; + } + } + } +} + +// Ausgabe eines Operanden-Elements + +void SbiExprNode::GenElement( SbiOpcode eOp ) +{ +#ifndef PRODUCT + if( eOp < _RTL || eOp > _CALLC ) + pGen->GetParser()->Error( SbERR_INTERNAL_ERROR, "Opcode" ); +#endif + SbiSymDef* pDef = aVar.pDef; + // Das ID ist entweder die Position oder das String-ID + // Falls das Bit 0x8000 gesetzt ist, hat die Variable + // eine Parameterliste. + USHORT nId = ( eOp == _PARAM ) ? pDef->GetPos() : pDef->GetId(); + // Parameterliste aufbauen + if( aVar.pPar && aVar.pPar->GetSize() ) + { + nId |= 0x8000; + aVar.pPar->Gen(); + } + SbiProcDef* pProc = aVar.pDef->GetProcDef(); + // per DECLARE definiert? + if( pProc ) + { + // Dann evtl. einen LIB-Befehl erzeugen + if( pProc->GetLib().Len() ) + pGen->Gen( _LIB, pGen->GetParser()->aGblStrings.Add( pProc->GetLib() ) ); + // und den Aliasnamen nehmen + if( pProc->GetAlias().Len() ) + nId = ( nId & 0x8000 ) | pGen->GetParser()->aGblStrings.Add( pProc->GetAlias() ); + } + pGen->Gen( eOp, nId, GetType() ); +} + +// Erzeugen einer Argv-Tabelle +// Das erste Element bleibt immer frei fuer Returnwerte etc. +// Siehe auch SbiProcDef::SbiProcDef() in symtbl.cxx + +void SbiExprList::Gen() +{ + if( pFirst ) + { + pParser->aGen.Gen( _ARGC ); + // AB 10.1.96: Typ-Anpassung bei DECLARE + USHORT nCount = 1, nParAnz = 0; + SbiSymPool* pPool; + if( pProc ) + { + pPool = &pProc->GetParams(); + nParAnz = pPool->GetSize(); + } + for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ ) + { + pExpr->Gen(); + if( pExpr->GetName().Len() ) + { + // named arg + USHORT nSid = pParser->aGblStrings.Add( pExpr->GetName() ); + pParser->aGen.Gen( _ARGN, nSid ); + + // AB 10.1.96: Typanpassung bei named -> passenden Parameter suchen + if( pProc ) + { + // Vorerst: Error ausloesen + pParser->Error( SbERR_NO_NAMED_ARGS ); + + // Spaeter, wenn Named Args bei DECLARE moeglich + /* + for( USHORT i = 1 ; i < nParAnz ; i++ ) + { + SbiSymDef* pDef = pPool->Get( i ); + const String& rName = pDef->GetName(); + if( rName.Len() ) + { + if( pExpr->GetName().ICompare( rName ) + == COMPARE_EQUAL ) + { + pParser->aGen.Gen( _ARGTYP, pDef->GetType() ); + break; + } + } + } + */ + } + } + else + { + pParser->aGen.Gen( _ARGV ); + + // Funktion mit DECLARE -> Typ-Anpassung + if( pProc && nCount < nParAnz ) + { + SbiSymDef* pDef = pPool->Get( nCount ); + USHORT nTyp = pDef->GetType(); + // Zustzliches Flag fr BYVAL einbauen + if( pDef->IsByVal() ) + nTyp |= 0x8000; + pParser->aGen.Gen( _ARGTYP, nTyp ); + } + } + } + } +} + +void SbiExpression::Gen() +{ + // AB: 17.12.1995, Spezialbehandlung fuer WITH + // Wenn pExpr == .-Ausdruck in With, zunaechst Gen fuer Basis-Objekt + pExpr->Gen(); + if( bBased ) + pParser->aGen.Gen( _BASED, pParser->nBase ), + pParser->aGen.Gen( _ARGV ); +} + diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx new file mode 100644 index 000000000000..818bfb5aa10b --- /dev/null +++ b/basic/source/comp/exprnode.cxx @@ -0,0 +1,497 @@ +/************************************************************************* + * + * $RCSfile: exprnode.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#define _NTSDK // wg. HUGE_VAL MH +#define HUGE_VAL HUGE +#include <math.h> + +#include "sbcomp.hxx" +#pragma hdrstop +#include "expr.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCEXPR, SBCOMP_CODE ) + +////////////////////////////////////////////////////////////////////////// + +SbiExprNode::SbiExprNode( SbiParser* p, SbiExprNode* l, SbiToken t, SbiExprNode* r ) +{ + BaseInit( p ); + + pLeft = l; + pRight = r; + eTok = t; + nVal = 0; + eType = SbxVARIANT; // Nodes sind immer Variant + eNodeType = SbxNODE; + bComposite= TRUE; +} + +SbiExprNode::SbiExprNode( SbiParser* p, double n, SbxDataType t ) +{ + BaseInit( p ); + + eType = t; + eNodeType = SbxNUMVAL; + nVal = n; +} + +SbiExprNode::SbiExprNode( SbiParser* p, const String& rVal ) +{ + BaseInit( p ); + + eType = SbxSTRING; + eNodeType = SbxSTRVAL; + nStringId = p->aGblStrings.Add( rVal, TRUE ); +} + +SbiExprNode::SbiExprNode( SbiParser* p, const SbiSymDef& r, SbxDataType t, SbiExprList* l ) +{ + BaseInit( p ); + + eType = ( t == SbxVARIANT ) ? r.GetType() : t; + eNodeType = SbxVARVAL; + aVar.pDef = (SbiSymDef*) &r; + aVar.pPar = l; + aVar.pNext= NULL; + + // Funktionsergebnisse sind nie starr + bComposite= BOOL( aVar.pDef->GetProcDef() != NULL ); +} + +// AB: 17.12.95, Hilfsfunktion fuer Ctor fuer einheitliche Initialisierung +void SbiExprNode::BaseInit( SbiParser* p ) +{ + pGen = &p->aGen; + eTok = NIL; + pLeft = NULL; + pRight = NULL; + bComposite = FALSE; + bPartOfWith = FALSE; + bError = FALSE; +} + +SbiExprNode::~SbiExprNode() +{ + delete pLeft; + delete pRight; + if( IsVariable() ) + { + delete aVar.pPar; + delete aVar.pNext; + } +} + +SbiSymDef* SbiExprNode::GetVar() +{ + if( eNodeType == SbxVARVAL ) + return aVar.pDef; + else + return NULL; +} + +SbiSymDef* SbiExprNode::GetRealVar() +{ + SbiExprNode* p = GetRealNode(); + if( p ) + return p->GetVar(); + else + return NULL; +} + +// AB: 18.12.95 +SbiExprNode* SbiExprNode::GetRealNode() +{ + if( eNodeType == SbxVARVAL ) + { + SbiExprNode* p = this; + while( p->aVar.pNext ) + p = p->aVar.pNext; + return p; + } + else + return NULL; +} + +BOOL SbiExprNode::IsOperand() +{ + return BOOL( eNodeType != SbxNODE ); +} + +BOOL SbiExprNode::IsConstant() +{ + return BOOL( eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL ); +} + +// Diese Methode setzt den Typ um, falls er in den Integer-Bereich hineinpasst + +BOOL SbiExprNode::IsIntConst() +{ + if( eNodeType == SbxNUMVAL ) + { + if( eType >= SbxINTEGER && eType <= SbxDOUBLE ) + { +#if defined(MAC) && !defined(__powerc) + long double n; +#else + double n; +#endif + if( nVal >= SbxMININT && nVal <= SbxMAXINT && modf( nVal, &n ) == 0 ) + { + nVal = (double) (short) nVal; + eType = SbxINTEGER; + return TRUE; + } + } + } + return FALSE; +} + +BOOL SbiExprNode::IsNumber() +{ + return BOOL( eNodeType == SbxNUMVAL ); +} + +BOOL SbiExprNode::IsString() +{ + return BOOL( eNodeType == SbxSTRVAL ); +} + +BOOL SbiExprNode::IsVariable() +{ + return BOOL( eNodeType == SbxVARVAL ); +} + +BOOL SbiExprNode::IsLvalue() +{ + return IsVariable(); +} + +// Ermitteln der Tiefe eines Baumes + +short SbiExprNode::GetDepth() +{ + if( IsOperand() ) return 0; + else + { + SbiExprNode* p = (SbiExprNode*) this; + short d1 = pLeft->GetDepth(); + short d2 = pRight->GetDepth(); + return( (d1 < d2 ) ? d2 : d1 ) + 1; + } +} + +const String& SbiExprNode::GetString() +{ + USHORT n = ( eType == SbxSTRING ) ? nStringId : 0; + return pGen->GetParser()->aGblStrings.Find( n ); +} + +// Abgleich eines Baumes: +// 1. Constant Folding +// 2. Typabgleich +// 3. Umwandlung der Operanden in Strings +// 4. Hochziehen der Composite- und Error-Bits + +void SbiExprNode::Optimize() +{ + FoldConstants(); + CollectBits(); +} + +// Hochziehen der Composite- und Fehlerbits + +void SbiExprNode::CollectBits() +{ + if( pLeft ) + { + pLeft->CollectBits(); + bError |= pLeft->bError; + bComposite |= pLeft->bComposite; + } + if( pRight ) + { + pRight->CollectBits(); + bError |= pRight->bError; + bComposite |= pRight->bComposite; + } +} + +// Kann ein Zweig umgeformt werden, wird TRUE zurueckgeliefert. In diesem +// Fall ist das Ergebnis im linken Zweig. + +void SbiExprNode::FoldConstants() +{ + if( IsOperand() ) return; + pLeft->FoldConstants(); + if( pRight ) + { + pRight->FoldConstants(); + if( pLeft->IsConstant() && pRight->IsConstant() + && pLeft->eNodeType == pRight->eNodeType ) + { + CollectBits(); + if( eTok == CAT ) + // CAT verbindet auch zwei Zahlen miteinander! + eType = SbxSTRING; + if( pLeft->eType == SbxSTRING ) + // Kein Type Mismatch! + eType = SbxSTRING; + if( eType == SbxSTRING ) + { + String rl( pLeft->GetString() ); + String rr( pRight->GetString() ); + delete pLeft; pLeft = NULL; + delete pRight; pRight = NULL; + eType = SbxDOUBLE; + eNodeType = SbxNUMVAL; + bComposite = FALSE; + StringCompare eRes = rr.CompareTo( rl ); + //StringCompare eRes = rl.Compare( rr ); + String s; + switch( eTok ) + { + case PLUS: + case CAT: + eTok = CAT; + // Verkettung: + s = rl; + s += rr; + nStringId = pGen->GetParser()->aGblStrings.Add( s, TRUE ); + eType = SbxSTRING; + eNodeType = SbxSTRVAL; + break; + case EQ: + nVal = ( eRes == COMPARE_EQUAL ) ? SbxTRUE : SbxFALSE; + break; + case NE: + nVal = ( eRes != COMPARE_EQUAL ) ? SbxTRUE : SbxFALSE; + break; + case LT: + nVal = ( eRes == COMPARE_LESS ) ? SbxTRUE : SbxFALSE; + break; + case GT: + nVal = ( eRes == COMPARE_GREATER ) ? SbxTRUE : SbxFALSE; + break; + case LE: + nVal = ( eRes != COMPARE_GREATER ) ? SbxTRUE : SbxFALSE; + break; + case GE: + nVal = ( eRes != COMPARE_LESS ) ? SbxTRUE : SbxFALSE; + break; + default: + pGen->GetParser()->Error( SbERR_CONVERSION ); + bError = TRUE; + } + } + else + { + double nl = pLeft->nVal; + double nr = pRight->nVal; + long ll, lr; + if( ( eTok >= AND && eTok <= EQV ) + || eTok == IDIV || eTok == MOD ) + { + // Integer-Operationen + BOOL err = FALSE; + if( nl > SbxMAXLNG ) err = TRUE, nl = SbxMAXLNG; + else + if( nl < SbxMINLNG ) err = TRUE, nl = SbxMINLNG; + if( nr > SbxMAXLNG ) err = TRUE, nr = SbxMAXLNG; + else + if( nr < SbxMINLNG ) err = TRUE, nr = SbxMINLNG; + ll = (long) nl; lr = (long) nr; + if( err ) + { + pGen->GetParser()->Error( SbERR_MATH_OVERFLOW ); + bError = TRUE; + } + } + BOOL bBothInt = BOOL( pLeft->eType < SbxSINGLE + && pRight->eType < SbxSINGLE ); + delete pLeft; pLeft = NULL; + delete pRight; pRight = NULL; + nVal = 0; + eType = SbxDOUBLE; + eNodeType = SbxNUMVAL; + bComposite = FALSE; + BOOL bCheckType = FALSE; + switch( eTok ) + { + case EXPON: + nVal = pow( nl, nr ); break; + case MUL: + bCheckType = TRUE; + nVal = nl * nr; break; + case DIV: + if( !nr ) + { + pGen->GetParser()->Error( SbERR_ZERODIV ); nVal = HUGE_VAL; + bError = TRUE; + } else nVal = nl / nr; + break; + case PLUS: + bCheckType = TRUE; + nVal = nl + nr; break; + case MINUS: + bCheckType = TRUE; + nVal = nl - nr; break; + case EQ: + nVal = ( nl == nr ) ? SbxTRUE : SbxFALSE; + eType = SbxINTEGER; break; + case NE: + nVal = ( nl != nr ) ? SbxTRUE : SbxFALSE; + eType = SbxINTEGER; break; + case LT: + nVal = ( nl < nr ) ? SbxTRUE : SbxFALSE; + eType = SbxINTEGER; break; + case GT: + nVal = ( nl > nr ) ? SbxTRUE : SbxFALSE; + eType = SbxINTEGER; break; + case LE: + nVal = ( nl <= nr ) ? SbxTRUE : SbxFALSE; + eType = SbxINTEGER; break; + case GE: + nVal = ( nl >= nr ) ? SbxTRUE : SbxFALSE; + eType = SbxINTEGER; break; + case IDIV: + if( !lr ) + { + pGen->GetParser()->Error( SbERR_ZERODIV ); nVal = HUGE_VAL; + bError = TRUE; + } else nVal = ll / lr; + eType = SbxLONG; break; + case MOD: + if( !lr ) + { + pGen->GetParser()->Error( SbERR_ZERODIV ); nVal = HUGE_VAL; + bError = TRUE; + } else nVal = ll % lr; + eType = SbxLONG; break; + case AND: + nVal = (double) ( ll & lr ); eType = SbxLONG; break; + case OR: + nVal = (double) ( ll | lr ); eType = SbxLONG; break; + case XOR: + nVal = (double) ( ll ^ lr ); eType = SbxLONG; break; + case EQV: + nVal = (double) ( ~ll ^ lr ); eType = SbxLONG; break; + case IMP: + nVal = (double) ( ~ll | lr ); eType = SbxLONG; break; + } + // Den Datentyp wiederherstellen, um Rundungsfehler + // zu killen + if( bCheckType && bBothInt + && nVal >= SbxMINLNG && nVal <= SbxMAXLNG ) + { + // NK-Stellen weg + long n = (long) nVal; + nVal = n; + eType = ( n >= SbxMININT && n <= SbxMAXINT ) + ? SbxINTEGER : SbxLONG; + } + } + } + } + else if( pLeft->IsNumber() ) + { + nVal = pLeft->nVal; + delete pLeft; + pLeft = NULL; + eType = SbxDOUBLE; + eNodeType = SbxNUMVAL; + bComposite = FALSE; + switch( eTok ) + { + case NEG: + nVal = -nVal; break; + case NOT: { + // Integer-Operation! + BOOL err = FALSE; + if( nVal > SbxMAXLNG ) err = TRUE, nVal = SbxMAXLNG; + else + if( nVal < SbxMINLNG ) err = TRUE, nVal = SbxMINLNG; + if( err ) + { + pGen->GetParser()->Error( SbERR_MATH_OVERFLOW ); + bError = TRUE; + } + nVal = (double) ~((long) nVal); + eType = SbxLONG; + } break; + } + } + if( eNodeType == SbxNUMVAL ) + { + // Evtl auf INTEGER falten (wg. besserem Opcode)? + if( eType == SbxSINGLE || eType == SbxDOUBLE ) + { + double x; + if( nVal >= SbxMINLNG && nVal <= SbxMAXLNG + && !modf( nVal, &x ) ) + eType = SbxLONG; + } + if( eType == SbxLONG && nVal >= SbxMININT && nVal <= SbxMAXINT ) + eType = SbxINTEGER; + } +} + + diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx new file mode 100644 index 000000000000..1ed4e54a2db8 --- /dev/null +++ b/basic/source/comp/exprtree.cxx @@ -0,0 +1,971 @@ +/************************************************************************* + * + * $RCSfile: exprtree.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "sbcomp.hxx" +#pragma hdrstop +#include <svtools/sbx.hxx> // w.g. ...IMPL_REF(...sbxvariable) +#include "expr.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCEXPR, SBCOMP_CODE ) + +/*************************************************************************** +|* +|* SbiExpression +|* +***************************************************************************/ + +SbiExpression::SbiExpression( SbiParser* p, SbiExprType t ) +{ + pParser = p; + bError = bByVal = bBased = FALSE; + eCurExpr = t; + pNext = NULL; + pExpr = (t != SbSTDEXPR ) ? Term() : Boolean(); + if( t != SbSYMBOL ) + pExpr->Optimize(); + if( t == SbLVALUE && !pExpr->IsLvalue() ) + p->Error( SbERR_LVALUE_EXPECTED ); + if( t == SbOPERAND && !IsVariable() ) + p->Error( SbERR_VAR_EXPECTED ); +} + +SbiExpression::SbiExpression( SbiParser* p, double n, SbxDataType t ) +{ + pParser = p; + eCurExpr = SbOPERAND; + pNext = NULL; + bError = bByVal = bBased = FALSE; + pExpr = new SbiExprNode( pParser, n, t ); + pExpr->Optimize(); +} + +SbiExpression::SbiExpression( SbiParser* p, const String& r ) +{ + pParser = p; + pNext = NULL; + bError = bByVal = bBased = FALSE; + eCurExpr = SbOPERAND; + pExpr = new SbiExprNode( pParser, r ); +} + +SbiExpression::SbiExpression( SbiParser* p, const SbiSymDef& r, SbiExprList* pPar ) +{ + pParser = p; + pNext = NULL; + bError = bByVal = bBased = FALSE; + eCurExpr = SbOPERAND; + pExpr = new SbiExprNode( pParser, r, SbxVARIANT, pPar ); +} + +SbiExpression::SbiExpression( SbiParser* p, SbiToken t ) +{ + pParser = p; + pNext = NULL; + bError = bByVal = bBased = FALSE; + eCurExpr = SbOPERAND; + pExpr = new SbiExprNode( pParser, NULL, t, NULL ); +} + +SbiExpression::~SbiExpression() +{ + delete pExpr; +} + +// Einlesen eines kompletten Bezeichners +// Ein Bezeichner hat folgende Form: +// name[(Parameter)][.Name[(parameter)]]... +// Strukturelemente werden ueber das Element pNext verkoppelt, +// damit sie nicht im Baum stehen. + +// Folgen Parameter ohne Klammer? Dies kann eine Zahl, ein String, +// ein Symbol oder auch ein Komma sein (wenn der 1. Parameter fehlt) + +static BOOL DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTok ) +{ + if( eTok == LPAREN ) + return TRUE; + // Aber nur, wenn CALL-aehnlich! + if( !p->WhiteSpace() || eCurExpr != SbSYMBOL ) + return FALSE; + return BOOL( + eTok == NUMBER || eTok == FIXSTRING + || eTok == SYMBOL || eTok == COMMA || eTok == DOT ); +} + +// Definition eines neuen Symbols + +static SbiSymDef* AddSym + ( SbiToken eTok, SbiSymPool& rPool, SbiExprType eCurExpr, + const String& rName, SbxDataType eType, SbiParameters* pPar ) +{ + SbiSymDef* pDef; + // A= ist keine Prozedur + BOOL bHasType = BOOL( eTok == EQ || eTok == DOT ); + if( ( !bHasType && eCurExpr == SbSYMBOL ) || pPar ) + { + // Dies ist also eine Prozedur + // da suche man doch den richtigen Pool raus, da Procs + // immer in einem Public-Pool landen muessen + SbiSymPool* pPool = &rPool; + if( pPool->GetScope() != SbPUBLIC ) + pPool = &rPool.GetParser()->aPublics; + SbiProcDef* pProc = pPool->AddProc( rName ); + + // Sonderbehandlung fuer Colls wie Documents(1) + if( eCurExpr == SbSTDEXPR ) + bHasType = TRUE; + + pDef = pProc; + pDef->SetType( bHasType ? eType : SbxEMPTY ); + if( pPar ) + { + // Dummy-Parameter generieren + USHORT n = 1; + for( short i = 0; i < pPar->GetSize(); i++ ) + { + String aPar = String::CreateFromAscii( "PAR" ); + aPar += ++n; + pProc->GetParams().AddSym( aPar ); + } + } + } + else + { + // oder ein normales Symbol + pDef = rPool.AddSym( rName ); + pDef->SetType( eType ); + } + return pDef; +} + +// Zur Zeit sind sogar Keywords zugelassen (wg. gleichnamiger Dflt-Properties) + +SbiExprNode* SbiExpression::Term() +{ + if( pParser->Peek() == DOT ) + { + // eine WITH-Variable + SbiExprNode* pWithVar = pParser->GetWithVar(); + // #26608: Ans Ende der Node-Kette gehen, um richtiges Objekt zu uebergeben + SbiSymDef* pDef = pWithVar ? pWithVar->GetRealVar() : NULL; + SbiExprNode* pNd = NULL; + if( !pDef ) + { + pParser->Next(); + } + else + { + pNd = ObjTerm( *pDef ); + if( pNd ) + pNd->SetPartOfWith( TRUE ); + } + if( !pNd ) + { + pParser->Error( SbERR_UNEXPECTED, DOT ); + pNd = new SbiExprNode( pParser, 1.0, SbxDOUBLE ); + } + return pNd; + } + + SbiToken eTok = pParser->Next(); + // Anfang des Parsings merken + pParser->LockColumn(); + String aSym( pParser->GetSym() ); + SbxDataType eType = pParser->GetType(); + SbiParameters* pPar = NULL; + // Folgen Parameter? + SbiToken eNextTok = pParser->Peek(); + // Ist es ein benannter Parameter? + // Dann einfach eine Stringkonstante erzeugen. Diese wird + // im SbiParameters-ctor erkannt und weiterverarbeitet + if( eNextTok == ASSIGN ) + { + pParser->UnlockColumn(); + return new SbiExprNode( pParser, aSym ); + } + // ab hier sind keine Keywords zugelassen! + if( pParser->IsKwd( eTok ) ) + { + pParser->Error( SbERR_SYNTAX ); + bError = TRUE; + } + + if( DoParametersFollow( pParser, eCurExpr, eTok = eNextTok ) ) + { + pPar = new SbiParameters( pParser ); + bError |= !pPar->IsValid(); + eTok = pParser->Peek(); + } + // Es koennte ein Objektteil sein, wenn . oder ! folgt + // Bei . muss aber die Variable bereits definiert sein; wenn pDef + // nach der Suche NULL ist, isses ein Objekt! + BOOL bObj = BOOL( ( eTok == DOT || eTok == EXCLAM ) + && !pParser->WhiteSpace() ); + if( bObj ) + { + if( eType == SbxVARIANT ) + eType = SbxOBJECT; + else + { + // Name%. geht wirklich nicht! + pParser->Error( SbERR_BAD_DECLARATION, aSym ); + bError = TRUE; + } + } + // Suche: + SbiSymDef* pDef = pParser->pPool->Find( aSym ); + if( !pDef ) + { + // Teil der Runtime-Library? + // AB 31.3.1996: In Parser-Methode ausgelagert + // (wird auch in SbiParser::DefVar() in DIM.CXX benoetigt) + pDef = pParser->CheckRTLForSym( aSym, eType ); + } + if( !pDef ) + { + // Falls ein Punkt angegeben war, isses Teil eines Objekts, + // also muss der Returnwert ein Objekt sein + if( bObj ) + eType = SbxOBJECT; + pDef = AddSym( eTok, *pParser->pPool, eCurExpr, aSym, eType, pPar ); + } + else + { + + // Symbol ist bereits definiert. + // Ist es eine Konstante? + SbiConstDef* pConst = pDef->GetConstDef(); + if( pConst ) + { + if( pConst->GetType() == SbxSTRING ) + return new SbiExprNode( pParser, pConst->GetString() ); + else + return new SbiExprNode( pParser, pConst->GetValue(), pConst->GetType() ); + } + // Hat es Dimensionen, + // und sind auch Parameter angegeben? + // (Wobei 0 Parameter () entsprechen) + if( pDef->GetDims() ) + { + if( !pPar + || ( pPar->GetSize() && pPar->GetSize() != pDef->GetDims() ) ) + pParser->Error( SbERR_WRONG_DIMS ); + } + if( pDef->IsDefinedAs() ) + { + if( eType >= SbxINTEGER && eType <= SbxSTRING ) + { + // Wie? Erst mit AS definieren und dann einen Suffix nehmen? + pParser->Error( SbERR_BAD_DECLARATION, aSym ); + bError = TRUE; + } + else if ( eType == SbxVARIANT ) + // Falls nix angegeben, den Typ des Eintrags nehmen + // aber nur, wenn die Var nicht mit AS XXX definiert ist + // damit erwischen wir n% = 5 : print n + eType = pDef->GetType(); + } + // Funktion? + if( pDef->GetProcDef() ) + { + SbiProcDef* pProc = pDef->GetProcDef(); + if( pPar && pProc->GetLib().Len() ) // DECLARE benutzt? + pPar->SetProc( pProc ); + // Wenn keine Pars, vorerst nichts machen + // Pruefung auf Typ-Anzahl waere denkbar + } + // Typcheck bei Variablen: + // ist explizit im Scanner etwas anderes angegeben? + // Bei Methoden ist dies OK! + if( eType != SbxVARIANT && // Variant nimmt alles + eType != pDef->GetType() && + !pDef->GetProcDef() ) + { + // Es kann sein, dass pDef ein Objekt beschreibt, das bisher + // nur als SbxVARIANT erkannt wurde, dann Typ von pDef aendern + // AB, 16.12.95 (Vielleicht noch aehnliche Faelle moeglich ?!?) + if( eType == SbxOBJECT && pDef->GetType() == SbxVARIANT ) + { + pDef->SetType( SbxOBJECT ); + } + else + { + pParser->Error( SbERR_BAD_DECLARATION, aSym ); + bError = TRUE; + } + } + } + SbiExprNode* pNd = new SbiExprNode( pParser, *pDef, eType ); + if( !pPar ) + pPar = new SbiParameters( pParser,FALSE,FALSE ); + pNd->aVar.pPar = pPar; + if( bObj ) + { + // AB, 8.1.95: Objekt kann auch vom Typ SbxVARIANT sein + if( pDef->GetType() == SbxVARIANT ) + pDef->SetType( SbxOBJECT ); + // Falls wir etwas mit Punkt einscannen, muss der + // Typ SbxOBJECT sein + if( pDef->GetType() != SbxOBJECT && pDef->GetType() != SbxVARIANT ) + { + pParser->Error( SbERR_BAD_DECLARATION, aSym ); + bError = TRUE; + } + if( !bError ) + pNd->aVar.pNext = ObjTerm( *pDef ); + } + // Merken der Spalte 1 wieder freigeben + pParser->UnlockColumn(); + return pNd; +} + +// Aufbau eines Objekt-Terms. Ein derartiger Term ist Teil +// eines Ausdrucks, der mit einer Objektvariablen beginnt. + +SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) +{ + pParser->Next(); + SbiToken eTok = pParser->Next(); + if( eTok != SYMBOL && !pParser->IsKwd( eTok ) && !pParser->IsExtra( eTok ) ) + { + // #66745 Einige Operatoren koennen in diesem Kontext auch + // als Identifier zugelassen werden, wichtig fuer StarOne + if( eTok != MOD && eTok != NOT && eTok != AND && eTok != OR && + eTok != XOR && eTok != EQV && eTok != IMP && eTok != IS ) + { + pParser->Error( SbERR_VAR_EXPECTED ); + bError = TRUE; + } + } + else + { + if( pParser->GetType() != SbxVARIANT ) + pParser->Error( SbERR_SYNTAX ), bError = TRUE; + } + if( bError ) + return NULL; + + String aSym( pParser->GetSym() ); + SbxDataType eType = pParser->GetType(); + SbiParameters* pPar = NULL; + eTok = pParser->Peek(); + // Parameter? + if( DoParametersFollow( pParser, eCurExpr, eTok ) ) + { + pPar = new SbiParameters( pParser ); + bError |= !pPar->IsValid(); + eTok = pParser->Peek(); + } + BOOL bObj = BOOL( ( eTok == DOT || eTok == EXCLAM ) && !pParser->WhiteSpace() ); + if( bObj ) + { + if( eType == SbxVARIANT ) + eType = SbxOBJECT; + else + { + // Name%. geht wirklich nicht! + pParser->Error( SbERR_BAD_DECLARATION, aSym ); + bError = TRUE; + } + } + + // Der Symbol-Pool eines Objekts ist immer PUBLIC + SbiSymPool& rPool = rObj.GetPool(); + rPool.SetScope( SbPUBLIC ); + SbiSymDef* pDef = rPool.Find( aSym ); + if( !pDef ) + { + pDef = AddSym( eTok, rPool, eCurExpr, aSym, eType, pPar ); + pDef->SetType( eType ); + } + + SbiExprNode* pNd = new SbiExprNode( pParser, *pDef, eType ); + pNd->aVar.pPar = pPar; + if( bObj ) + { + // Falls wir etwas mit Punkt einscannen, muss der + // Typ SbxOBJECT sein + + // AB, 3.1.96 + // Es kann sein, dass pDef ein Objekt beschreibt, das bisher + // nur als SbxVARIANT erkannt wurde, dann Typ von pDef aendern + if( pDef->GetType() == SbxVARIANT ) + pDef->SetType( SbxOBJECT ); + + if( pDef->GetType() != SbxOBJECT ) + { + pParser->Error( SbERR_BAD_DECLARATION, aSym ); + bError = TRUE; + } + if( !bError ) + { + pNd->aVar.pNext = ObjTerm( *pDef ); + pNd->eType = eType; + } + } + return pNd; +} + +// Als Operanden kommen in Betracht: +// Konstante +// skalare Variable +// Strukturelemente +// Array-Elemente +// Funktionen +// geklammerte Ausdruecke + +SbiExprNode* SbiExpression::Operand() +{ + SbiExprNode *pRes; + SbiToken eTok; + + // Operand testen: + switch( eTok = pParser->Peek() ) + { + case SYMBOL: + case DOT: // .with + pRes = Term(); break; + case NUMBER: + pParser->Next(); + pRes = new SbiExprNode( pParser, pParser->GetDbl(), pParser->GetType() ); + break; + case FIXSTRING: + pParser->Next(); + pRes = new SbiExprNode( pParser, pParser->GetSym() ); break; + case LPAREN: + pParser->Next(); + pRes = Boolean(); + if( pParser->Peek() != RPAREN ) + pParser->Error( SbERR_BAD_BRACKETS ); + else pParser->Next(); + pRes->bComposite = TRUE; + break; + default: + // Zur Zeit sind Keywords hier OK! + if( pParser->IsKwd( eTok ) ) + pRes = Term(); + else + { + pParser->Next(); + pRes = new SbiExprNode( pParser, 1.0, SbxDOUBLE ); // bei Fehlern + pParser->Error( SbERR_UNEXPECTED, eTok ); + } + } + return pRes; +} + +SbiExprNode* SbiExpression::Unary() +{ + SbiExprNode* pNd; + SbiToken eTok = pParser->Peek(); + switch( eTok ) + { + case MINUS: + eTok = NEG; + case NOT: + pParser->Next(); + pNd = new SbiExprNode( pParser, Unary(), eTok, NULL ); + break; + case PLUS: + pParser->Next(); + pNd = Unary(); + break; + default: + pNd = Operand(); + } + return pNd; +} + +SbiExprNode* SbiExpression::Exp() +{ + SbiExprNode* pNd = Unary(); + while( pParser->Peek() == EXPON ) { + SbiToken eTok = pParser->Next(); + pNd = new SbiExprNode( pParser, pNd, eTok, Unary() ); + } + return pNd; +} + +SbiExprNode* SbiExpression::MulDiv() +{ + SbiExprNode* pNd = Exp(); + for( ;; ) + { + SbiToken eTok = pParser->Peek(); + if( eTok != MUL && eTok != DIV ) + break; + eTok = pParser->Next(); + pNd = new SbiExprNode( pParser, pNd, eTok, Exp() ); + } + return pNd; +} + +SbiExprNode* SbiExpression::IntDiv() +{ + SbiExprNode* pNd = MulDiv(); + while( pParser->Peek() == IDIV ) { + SbiToken eTok = pParser->Next(); + pNd = new SbiExprNode( pParser, pNd, eTok, MulDiv() ); + } + return pNd; +} + +SbiExprNode* SbiExpression::Mod() +{ + SbiExprNode* pNd = IntDiv(); + while( pParser->Peek() == MOD ) { + SbiToken eTok = pParser->Next(); + pNd = new SbiExprNode( pParser, pNd, eTok, IntDiv() ); + } + return pNd; +} + +SbiExprNode* SbiExpression::AddSub() +{ + SbiExprNode* pNd = Mod(); + for( ;; ) + { + SbiToken eTok = pParser->Peek(); + if( eTok != PLUS && eTok != MINUS ) + break; + eTok = pParser->Next(); + pNd = new SbiExprNode( pParser, pNd, eTok, Mod() ); + } + return pNd; +} + +SbiExprNode* SbiExpression::Cat() +{ + SbiExprNode* pNd = AddSub(); + for( ;; ) + { + SbiToken eTok = pParser->Peek(); + if( eTok != CAT ) + break; + eTok = pParser->Next(); + pNd = new SbiExprNode( pParser, pNd, eTok, AddSub() ); + } + return pNd; +} + +SbiExprNode* SbiExpression::Comp() +{ + SbiExprNode* pNd = Cat(); + short nCount = 0; + for( ;; ) + { + SbiToken eTok = pParser->Peek(); + if( eTok != EQ && eTok != NE && eTok != LT + && eTok != GT && eTok != LE && eTok != GE ) + break; + eTok = pParser->Next(); + pNd = new SbiExprNode( pParser, pNd, eTok, Cat() ); + nCount++; + } + // Mehrere Operatoren hintereinander gehen nicht + if( nCount > 1 ) + { + pParser->Error( SbERR_SYNTAX ); + bError = TRUE; + } + return pNd; +} + +SbiExprNode* SbiExpression::Like() +{ + SbiExprNode* pNd = Comp(); + short nCount = 0; + while( pParser->Peek() == LIKE ) { + SbiToken eTok = pParser->Next(); + pNd = new SbiExprNode( pParser, pNd, eTok, Comp() ), nCount++; + } + // Mehrere Operatoren hintereinander gehen nicht + if( nCount > 1 ) + { + pParser->Error( SbERR_SYNTAX ); + bError = TRUE; + } + return pNd; +} + +SbiExprNode* SbiExpression::Boolean() +{ + SbiExprNode* pNd = Like(); + for( ;; ) + { + SbiToken eTok = pParser->Peek(); + if( eTok != AND && eTok != OR && eTok != XOR + && eTok != EQV && eTok != IMP && eTok != IS ) + break; + eTok = pParser->Next(); + pNd = new SbiExprNode( pParser, pNd, eTok, Like() ); + } + return pNd; +} + +/*************************************************************************** +|* +|* SbiConstExpression +|* +***************************************************************************/ + +// Parsing einer Expression, die sich zu einer numerischen +// Konstanten verarbeiten laesst. + +SbiConstExpression::SbiConstExpression( SbiParser* p ) : SbiExpression( p ) +{ + if( pExpr->IsConstant() ) + { + eType = pExpr->GetType(); + if( pExpr->IsNumber() ) + nVal = pExpr->nVal; + else + nVal = 0, aVal = pParser->aGblStrings.Find( pExpr->nStringId ); + } + else + { + // #40204 Spezialbehandlung fuer BOOL-Konstanten + BOOL bIsBool = FALSE; + if( pExpr->eNodeType == SbxVARVAL ) + { + SbiSymDef* pVarDef = pExpr->GetVar(); + + // Ist es eine BOOL-Konstante? + BOOL bBoolVal; + if( pVarDef->GetName().EqualsIgnoreCaseAscii( "true" ) ) + //if( pVarDef->GetName().ICompare( "true" ) == COMPARE_EQUAL ) + { + bIsBool = TRUE; + bBoolVal = TRUE; + } + else if( pVarDef->GetName().EqualsIgnoreCaseAscii( "false" ) ) + //else if( pVarDef->GetName().ICompare( "false" ) == COMPARE_EQUAL ) + { + bIsBool = TRUE; + bBoolVal = FALSE; + } + + // Wenn es ein BOOL ist, Node austauschen + if( bIsBool ) + { + delete pExpr; + pExpr = new SbiExprNode( pParser, (bBoolVal ? SbxTRUE : SbxFALSE), SbxINTEGER ); + eType = pExpr->GetType(); + nVal = pExpr->nVal; + } + } + + if( !bIsBool ) + { + pParser->Error( SbERR_SYNTAX ); + eType = SbxDOUBLE; + nVal = 0; + } + } +} + +short SbiConstExpression::GetShortValue() +{ + if( eType == SbxSTRING ) + { + SbxVariableRef refConv = new SbxVariable; + refConv->PutString( aVal ); + return refConv->GetInteger(); + } + else + { + double n = nVal; + if( n > 0 ) n += .5; else n -= .5; + if( n > SbxMAXINT ) n = SbxMAXINT, pParser->Error( SbERR_OUT_OF_RANGE ); + else + if( n < SbxMININT ) n = SbxMININT, pParser->Error( SbERR_OUT_OF_RANGE ); + return (short) n; + } +} + + +/*************************************************************************** +|* +|* SbiExprList +|* +***************************************************************************/ + +SbiExprList::SbiExprList( SbiParser* p ) +{ + pParser = p; + pFirst = NULL; + pProc = NULL; + nExpr = + nDim = 0; + bError = + bBracket = FALSE; +} + +SbiExprList::~SbiExprList() +{ + SbiExpression* p = pFirst; + while( p ) + { + SbiExpression* q = p->pNext; + delete p; + p = q; + } +} + +// Parameter anfordern (ab 0) + +SbiExpression* SbiExprList::Get( short n ) +{ + SbiExpression* p = pFirst; + while( n-- && p ) + p = p->pNext; + return p; +} + +/*************************************************************************** +|* +|* SbiParameters +|* +***************************************************************************/ + +// Parsender Konstruktor: +// Die Parameterliste wird komplett geparst. +// "Prozedurname()" ist OK. +// Dann handelt es sich um eine Funktion ohne Parameter +// respektive um die Angabe eines Arrays als Prozedurparameter. + +SbiParameters::SbiParameters( SbiParser* p, BOOL bConst, BOOL bPar) : + SbiExprList( p ) +{ + if (bPar) + { + SbiExpression *pExpr; + SbiToken eTok = pParser->Peek(); + + // evtl. Klammer auf weg: + if( eTok == LPAREN ) + { + bBracket = TRUE; pParser->Next(); eTok = pParser->Peek(); + } + + // Ende-Test + if( ( bBracket && eTok == RPAREN ) || pParser->IsEoln( eTok ) ) + { + if( eTok == RPAREN ) + pParser->Next(); + return; + } + // Parametertabelle einlesen und in richtiger Folge ablegen! + SbiExpression* pLast = NULL; + String aName; + while( !bError ) + { + aName.Erase(); + // Fehlendes Argument + if( eTok == COMMA ) + { + pExpr = new SbiExpression( pParser, 0, SbxEMPTY ); + if( bConst ) + pParser->Error( SbERR_SYNTAX ), bError = TRUE; + } + // Benannte Argumente: entweder .name= oder name:= + else + { + if( eTok == DOT ) + { + // VB mode: .name= + pParser->Next(); + pParser->TestSymbol( TRUE ); // Keywords sind OK + aName = pParser->GetSym(); + pParser->TestToken( EQ ); + pExpr = bConst ? new SbiConstExpression( pParser ) + : new SbiExpression( pParser ); + } + else + { + pExpr = bConst ? new SbiConstExpression( pParser ) + : new SbiExpression( pParser ); + if( pParser->Peek() == ASSIGN ) + { + // VBA mode: name:= + // SbiExpression::Term() hat einen String daraus gemacht + aName = pExpr->GetString(); + delete pExpr; + pParser->Next(); + pExpr = new SbiExpression( pParser ); + if( bConst ) + pParser->Error( SbERR_SYNTAX ), bError = TRUE; + } + } + pExpr->GetName() = aName; + } + pExpr->pNext = NULL; + if( !pLast ) + pFirst = pLast = pExpr; + else + pLast->pNext = pExpr, pLast = pExpr; + nExpr++; + bError |= !pExpr->IsValid(); + // Naechstes Element? + eTok = pParser->Peek(); + if( eTok != COMMA ) + { + if( ( bBracket && eTok == RPAREN ) || pParser->IsEoln( eTok ) ) + break; + pParser->Error( bBracket + ? SbERR_BAD_BRACKETS + : SbERR_EXPECTED, COMMA ); + bError = TRUE; + } + else + { + pParser->Next(); + eTok = pParser->Peek(); + if( ( bBracket && eTok == RPAREN ) || pParser->IsEoln( eTok ) ) + break; + } + } + // Schliessende Klammer + if( eTok == RPAREN ) + { + pParser->Next(); + pParser->Peek(); + if( !bBracket ) + { + pParser->Error( SbERR_BAD_BRACKETS ); + bError = TRUE; + } + } + nDim = nExpr; + } +} + +/*************************************************************************** +|* +|* SbiDimList +|* +***************************************************************************/ + +// Parsender Konstruktor: +// Eine Liste von Array-Dimensionen wird geparst. Die Ausdruecke werden +// auf numerisch getestet. Das bCONST-Bit wird gesetzt, wenn alle Ausdruecke +// Integer-Konstanten sind. + +SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) +{ + bConst = TRUE; + + if( pParser->Next() != LPAREN ) + { + pParser->Error( SbERR_EXPECTED, LPAREN ); + bError = TRUE; return; + } + + if( pParser->Peek() != RPAREN ) + { + SbiExpression *pExpr1, *pExpr2, *pLast = NULL; + SbiToken eTok; + for( ;; ) + { + pExpr1 = new SbiExpression( pParser ); + eTok = pParser->Next(); + if( eTok == TO ) + { + pExpr2 = new SbiExpression( pParser ); + eTok = pParser->Next(); + bConst &= pExpr1->IsIntConstant() & pExpr2->IsIntConstant(); + bError |= !pExpr1->IsValid(); + bError |= !pExpr2->IsValid(); + pExpr1->pNext = pExpr2; + if( !pLast ) + pFirst = pExpr1; + else + pLast->pNext = pExpr1; + pLast = pExpr2; + nExpr += 2; + } + else + { + // Nur eine Dim-Angabe + pExpr1->SetBased(); + pExpr1->pNext = NULL; + bConst &= pExpr1->IsIntConstant(); + bError |= !pExpr1->IsValid(); + if( !pLast ) + pFirst = pLast = pExpr1; + else + pLast->pNext = pExpr1, pLast = pExpr1; + nExpr++; + } + nDim++; + if( eTok == RPAREN ) break; + if( eTok != COMMA ) + { + pParser->Error( SbERR_BAD_BRACKETS ); + pParser->Next(); + break; + } + } + } + else pParser->Next(); +} + diff --git a/basic/source/comp/io.cxx b/basic/source/comp/io.cxx new file mode 100644 index 000000000000..de71e2474463 --- /dev/null +++ b/basic/source/comp/io.cxx @@ -0,0 +1,353 @@ +/************************************************************************* + * + * $RCSfile: io.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif +#include "sbcomp.hxx" +#pragma hdrstop +#include "iosys.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +// Test, ob ein I/O-Channel angegeben wurde + +BOOL SbiParser::Channel( BOOL bAlways ) +{ + BOOL bRes = FALSE; + Peek(); + if( IsHash() ) + { + SbiExpression aExpr( this ); + if( Peek() == COMMA ) Next(); + aExpr.Gen(); + aGen.Gen( _CHANNEL ); + bRes = TRUE; + } + else if( bAlways ) + Error( SbERR_EXPECTED, "#" ); + return bRes; +} + +// Fuer PRINT und WRITE wird bei Objektvariablen versucht, +// die Default-Property anzusprechen. + +// PRINT + +void SbiParser::Print() +{ + BOOL bChan = Channel(); + // Die Ausdruecke zum Drucken: + while( !bAbort ) + { + if( !IsEoln( Peek() ) ) + { + SbiExpression* pExpr = new SbiExpression( this ); + pExpr->Gen(); + delete pExpr; + Peek(); + aGen.Gen( eCurTok == COMMA ? _PRINTF : _BPRINT ); + } + if( eCurTok == COMMA || eCurTok == SEMICOLON ) + { + Next(); + if( IsEoln( Peek() ) ) break; + } + else + { + aGen.Gen( _PRCHAR, '\n' ); + break; + } + } + if( bChan ) + aGen.Gen( _CHAN0 ); +} + +// WRITE #chan, expr, ... + +void SbiParser::Write() +{ + BOOL bChan = Channel(); + // Die Ausdruecke zum Drucken: + while( !bAbort ) + { + SbiExpression* pExpr = new SbiExpression( this ); + pExpr->Gen(); + delete pExpr; + aGen.Gen( _BWRITE ); + if( Peek() == COMMA ) + { + aGen.Gen( _PRCHAR, ',' ); + Next(); + if( IsEoln( Peek() ) ) break; + } + else + { + aGen.Gen( _PRCHAR, '\n' ); + break; + } + } + if( bChan ) + aGen.Gen( _CHAN0 ); +} + +// LINE INPUT [prompt], var$ + +void SbiParser::LineInput() +{ + Channel( TRUE ); + // BOOL bChan = Channel( TRUE ); + SbiExpression* pExpr = new SbiExpression( this, SbOPERAND ); + /* AB 15.1.96: Keinen allgemeinen Ausdruck mehr zulassen + SbiExpression* pExpr = new SbiExpression( this ); + if( !pExpr->IsVariable() ) + { + SbiToken eTok = Peek(); + if( eTok == COMMA || eTok == SEMICOLON ) Next(); + else Error( SbERR_EXPECTED, COMMA ); + // mit Prompt + if( !bChan ) + { + pExpr->Gen(); + aGen.Gen( _PROMPT ); + } + else + Error( SbERR_VAR_EXPECTED ); + delete pExpr; + pExpr = new SbiExpression( this, SbOPERAND ); + } + */ + if( !pExpr->IsVariable() ) + Error( SbERR_VAR_EXPECTED ); + if( pExpr->GetType() != SbxVARIANT && pExpr->GetType() != SbxSTRING ) + Error( SbERR_CONVERSION ); + pExpr->Gen(); + aGen.Gen( _LINPUT ); + delete pExpr; + aGen.Gen( _CHAN0 ); // ResetChannel() nicht mehr in StepLINPUT() +} + +// INPUT + +void SbiParser::Input() +{ + aGen.Gen( _RESTART ); + Channel( TRUE ); + // BOOL bChan = Channel( TRUE ); + SbiExpression* pExpr = new SbiExpression( this, SbOPERAND ); + /* ALT: Jetzt keinen allgemeinen Ausdruck mehr zulassen + SbiExpression* pExpr = new SbiExpression( this ); + ... + siehe LineInput + */ + while( !bAbort ) + { + if( !pExpr->IsVariable() ) + Error( SbERR_VAR_EXPECTED ); + pExpr->Gen(); + aGen.Gen( _INPUT ); + if( Peek() == COMMA ) + { + Next(); + delete pExpr; + pExpr = new SbiExpression( this, SbOPERAND ); + } + else break; + } + delete pExpr; + aGen.Gen( _CHAN0 ); // ResetChannel() nicht mehr in StepINPUT() +} + +// OPEN stringexpr FOR mode ACCCESS access mode AS Channel [Len=n] + +void SbiParser::Open() +{ + SbiExpression aFileName( this ); + SbiToken eTok; + TestToken( FOR ); + short nMode = 0; + short nFlags = 0; + switch( Next() ) + { + case INPUT: + nMode = STREAM_READ; nFlags |= SBSTRM_INPUT; break; + case OUTPUT: + nMode = STREAM_WRITE | STREAM_TRUNC; nFlags |= SBSTRM_OUTPUT; break; + case APPEND: + nMode = STREAM_WRITE; nFlags |= SBSTRM_APPEND; break; + case RANDOM: + nMode = STREAM_READ | STREAM_WRITE; nFlags |= SBSTRM_RANDOM; break; + case BINARY: + nMode = STREAM_READ | STREAM_WRITE; nFlags |= SBSTRM_BINARY; break; + default: + Error( SbERR_SYNTAX ); + } + if( Peek() == ACCESS ) + { + Next(); + eTok = Next(); + // #27964# Nur STREAM_READ,STREAM_WRITE-Flags in nMode beeinflussen + nMode &= ~(STREAM_READ | STREAM_WRITE); // loeschen + if( eTok == READ ) + { + if( Peek() == WRITE ) + { + Next(); + nMode |= (STREAM_READ | STREAM_WRITE); + } + else + nMode |= STREAM_READ; + } + else if( eTok == WRITE ) + nMode |= STREAM_WRITE; + else + Error( SbERR_SYNTAX ); + } + switch( Peek() ) + { +#ifdef SHARED +#undef SHARED +#define tmpSHARED +#endif + case SHARED: + Next(); nMode |= STREAM_SHARE_DENYNONE; break; +#ifdef tmpSHARED +#define SHARED +#undef tmpSHARED +#endif + case LOCK: + Next(); + eTok = Next(); + if( eTok == READ ) + { + if( Peek() == WRITE ) Next(), nMode |= STREAM_SHARE_DENYALL; + else nMode |= STREAM_SHARE_DENYREAD; + } + else if( eTok == WRITE ) + nMode |= STREAM_SHARE_DENYWRITE; + else + Error( SbERR_SYNTAX ); + break; + } + TestToken( AS ); + // Die Kanalnummer + SbiExpression* pChan = new SbiExpression( this ); + if( !pChan ) + Error( SbERR_SYNTAX ); + SbiExpression* pLen = NULL; + if( Peek() == SYMBOL ) + { + Next(); + String aLen( aSym ); + if( aLen.EqualsIgnoreCaseAscii( "LEN" ) ) + { + TestToken( EQ ); + pLen = new SbiExpression( this ); + } + } + if( !pLen ) pLen = new SbiExpression( this, 128, SbxINTEGER ); + // Der Stack fuer den OPEN-Befehl sieht wie folgt aus: + // Blocklaenge + // Kanalnummer + // Dateiname + pLen->Gen(); + if( pChan ) + pChan->Gen(); + aFileName.Gen(); + aGen.Gen( _OPEN, nMode, nFlags ); + delete pLen; + delete pChan; +} + +// NAME file AS file + +void SbiParser::Name() +{ + SbiExpression aExpr1( this ); + TestToken( AS ); + SbiExpression aExpr2( this ); + aExpr1.Gen(); + aExpr2.Gen(); + aGen.Gen( _RENAME ); +} + +// CLOSE [n,...] + +void SbiParser::Close() +{ + Peek(); + if( IsEoln( eCurTok ) ) + aGen.Gen( _CLOSE, 0 ); + else + for( ;; ) + { + if( Channel( TRUE ) ) + aGen.Gen( _CLOSE, 1 ); + else + break; + if( IsEoln( Peek() ) ) + break; + } +} + + diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx new file mode 100644 index 000000000000..64c4001ee14a --- /dev/null +++ b/basic/source/comp/loops.cxx @@ -0,0 +1,561 @@ +/************************************************************************* + * + * $RCSfile: loops.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "sbcomp.hxx" +#pragma hdrstop + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +// Single-line IF und Multiline IF + +void SbiParser::If() +{ + USHORT nEndLbl; + SbiToken eTok; + // Ende-Tokens ignorieren: + SbiExpression aCond( this ); + aCond.Gen(); + TestToken( THEN ); + if( IsEoln( Next() ) ) + { + // AB 13.5.1996: #27720# Am Ende jeden Blocks muss ein Jump zu ENDIF + // eingefuegt werden, damit bei ELSEIF nicht erneut die Bedingung + // ausgewertet wird. Die Tabelle nimmt alle Absprungstellen auf. +#define JMP_TABLE_SIZE 100 + USHORT pnJmpToEndLbl[JMP_TABLE_SIZE]; // 100 ELSEIFs zulaessig + USHORT iJmp = 0; // aktueller Tabellen-Index + + // multiline IF + nEndLbl = aGen.Gen( _JUMPF, 0 ); + while( !bAbort && Parse() ) + { + eTok = Peek(); + if( eTok == ELSEIF || eTok == ELSE || eTok == ENDIF ) + break; + if( IsEof() ) + { + Error( SbERR_BAD_BLOCK, IF ); bAbort = TRUE; return; + } + } + // ELSEIF? + while( eTok == ELSEIF ) + { + // #27720# Bei erfolgreichem IF/ELSEIF auf ENDIF springen + if( iJmp >= JMP_TABLE_SIZE ) + { + Error( SbERR_PROG_TOO_LARGE ); bAbort = TRUE; return; + } + pnJmpToEndLbl[iJmp++] = aGen.Gen( _JUMP, 0 ); + + Next(); + aGen.BackChain( nEndLbl ); + SbiExpression* pCond = new SbiExpression( this ); + pCond->Gen(); + nEndLbl = aGen.Gen( _JUMPF, 0 ); + delete pCond; + TestToken( THEN ); + while( !bAbort && Parse() ) + { + eTok = Peek(); + if( eTok == ELSEIF || eTok == ELSE || eTok == ENDIF ) + break; + if( IsEof() ) + { + Error( SbERR_BAD_BLOCK, ELSEIF ); bAbort = TRUE; return; + } + } + } + if( eTok == ELSE ) + { + Next(); + USHORT nElseLbl = nEndLbl; + nEndLbl = aGen.Gen( _JUMP, 0 ); + aGen.BackChain( nElseLbl ); + StmntBlock( ENDIF ); + } + else if( eTok == ENDIF ) + Next(); + + // #27720# Jmp-Tabelle abarbeiten + while( iJmp > 0 ) + { + iJmp--; + aGen.BackChain( pnJmpToEndLbl[iJmp] ); + } + } + else + { + // single line IF + bSingleLineIf = TRUE; + nEndLbl = aGen.Gen( _JUMPF, 0 ); + Push( eCurTok ); + while( !bAbort ) + { + if( !Parse() ) break; + eTok = Peek(); + if( eTok == ELSE || eTok == EOLN || eTok == REM ) + break; + } + if( eTok == ELSE ) + { + Next(); + USHORT nElseLbl = nEndLbl; + nEndLbl = aGen.Gen( _JUMP, 0 ); + aGen.BackChain( nElseLbl ); + while( !bAbort ) + { + if( !Parse() ) break; + eTok = Peek(); + if( eTok == EOLN ) + break; + } + } + bSingleLineIf = FALSE; + } + aGen.BackChain( nEndLbl ); +} + +// ELSE/ELSEIF/ENDIF ohne IF + +void SbiParser::NoIf() +{ + Error( SbERR_NO_IF ); + StmntBlock( ENDIF ); +} + +// DO WHILE...LOOP +// DO ... LOOP WHILE + +void SbiParser::DoLoop() +{ + USHORT nStartLbl = aGen.GetPC(); + USHORT nEndChain = 0; + OpenBlock( DO ); + SbiToken eTok = Next(); + if( IsEoln( eTok ) ) + { + // DO ... LOOP [WHILE|UNTIL expr] + StmntBlock( LOOP ); + eTok = Next(); + if( eTok == UNTIL || eTok == WHILE ) + { + SbiExpression aExpr( this ); + aExpr.Gen(); + aGen.Gen( eTok == UNTIL ? _JUMPF : _JUMPT, nStartLbl ); + } else + if (eTok == EOLN || eTok == REM) + aGen.Gen (_JUMP, nStartLbl); + else + Error( SbERR_EXPECTED, WHILE ); + } + else + { + // DO [WHILE|UNTIL expr] ... LOOP + if( eTok == UNTIL || eTok == WHILE ) + { + SbiExpression aCond( this ); + aCond.Gen(); + } + USHORT nEndLbl = aGen.Gen( eTok == UNTIL ? _JUMPT : _JUMPF, 0 ); + StmntBlock( LOOP ); + TestEoln(); + aGen.Gen( _JUMP, nStartLbl ); + aGen.BackChain( nEndLbl ); + } + CloseBlock(); +} + +// WHILE ... WEND + +void SbiParser::While() +{ + SbiExpression aCond( this ); + USHORT nStartLbl = aGen.GetPC(); + aCond.Gen(); + USHORT nEndLbl = aGen.Gen( _JUMPF, 0 ); + StmntBlock( WEND ); + aGen.Gen( _JUMP, nStartLbl ); + aGen.BackChain( nEndLbl ); +} + +// FOR var = expr TO expr STEP + +void SbiParser::For() +{ + SbiExpression aLvalue( this, SbOPERAND ); + aLvalue.Gen(); // Variable auf dem Stack + TestToken( EQ ); + SbiExpression aStartExpr( this ); + aStartExpr.Gen(); // Startausdruck auf dem Stack + TestToken( TO ); + SbiExpression aStopExpr( this ); + aStopExpr.Gen(); // Endausdruck auf dem Stack + if( Peek() == STEP ) + { + Next(); + SbiExpression aStepExpr( this ); + aStepExpr.Gen(); + } + else + { + SbiExpression aOne( this, 1, SbxINTEGER ); + aOne.Gen(); + } + TestEoln(); + // Der Stack hat jetzt 4 Elemente: Variable, Start, Ende, Inkrement + // Startwert binden + aGen.Gen( _INITFOR ); + USHORT nLoop = aGen.GetPC(); + // Test durchfuehren, evtl. Stack freigeben + USHORT nEndTarget = aGen.Gen( _TESTFOR, 0 ); + OpenBlock( FOR ); + StmntBlock( NEXT ); + aGen.Gen( _NEXT ); + aGen.Gen( _JUMP, nLoop ); + // Kommen Variable nach NEXT? + if( Peek() == SYMBOL ) + { + SbiExpression aVar( this, SbOPERAND ); + if( aVar.GetRealVar() != aLvalue.GetRealVar() ) + Error( SbERR_EXPECTED, aVar.GetRealVar()->GetName() ); + } + aGen.BackChain( nEndTarget ); + CloseBlock(); +} + +// WITH .. END WITH + +void SbiParser::With() +{ + SbiExpression aVar( this, SbOPERAND ); + + // Letzten Knoten in der Objekt-Kette ueberpruefen + SbiExprNode *pNode = aVar.GetExprNode()->GetRealNode(); + SbiSymDef* pDef = pNode->GetVar(); + // Variant, AB 27.6.1997, #41090: bzw. empty -> mu Object sein + if( pDef->GetType() == SbxVARIANT || pDef->GetType() == SbxEMPTY ) + pDef->SetType( SbxOBJECT ); + else if( pDef->GetType() != SbxOBJECT ) + Error( SbERR_NEEDS_OBJECT ); + + // Knoten auch auf SbxOBJECT setzen, damit spaeter Gen() klappt + pNode->SetType( SbxOBJECT ); + + OpenBlock( NIL, aVar.GetExprNode() ); + StmntBlock( ENDWITH ); + CloseBlock(); +} + +// LOOP/NEXT/WEND ohne Konstrukt + +void SbiParser::BadBlock() +{ + if( eEndTok ) + Error( SbERR_BAD_BLOCK, eEndTok ); + else + Error( SbERR_BAD_BLOCK, "Loop/Next/Wend" ); +} + +// On expr Goto/Gosub n,n,n... + +void SbiParser::OnGoto() +{ + SbiExpression aCond( this ); + aCond.Gen(); + USHORT nLabelsTarget = aGen.Gen( _ONJUMP, 0 ); + SbiToken eTok = Next(); + if( eTok != GOTO && eTok != GOSUB ) + { + Error( SbERR_EXPECTED, "GoTo/GoSub" ); + eTok = GOTO; + } + // Label-Tabelle einlesen: + short nLbl = 0; + do + { + SbiToken eTok2 = Next(); // Label holen + if( MayBeLabel() ) + { + USHORT nOff = pProc->GetLabels().Reference( aSym ); + aGen.Gen( _JUMP, nOff ); + nLbl++; + } + else Error( SbERR_LABEL_EXPECTED ); + } + while( !bAbort && TestComma() ); + if( eTok == GOSUB ) + nLbl |= 0x8000; + aGen.Patch( nLabelsTarget, nLbl ); +} + +// GOTO/GOSUB + +void SbiParser::Goto() +{ + SbiOpcode eOp = eCurTok == GOTO ? _JUMP : _GOSUB; + Next(); + if( MayBeLabel() ) + { + USHORT nOff = pProc->GetLabels().Reference( aSym ); + aGen.Gen( eOp, nOff ); + } + else Error( SbERR_LABEL_EXPECTED ); +} + +// RETURN [label] + +void SbiParser::Return() +{ + Next(); + if( MayBeLabel() ) + { + USHORT nOff = pProc->GetLabels().Reference( aSym ); + aGen.Gen( _RETURN, nOff ); + } + else aGen.Gen( _RETURN, 0 ); +} + +// SELECT CASE + +void SbiParser::Select() +{ + TestToken( CASE ); + SbiExpression aCase( this ); + SbiToken eTok; + aCase.Gen(); + aGen.Gen( _CASE ); + TestEoln(); + USHORT nNextTarget = 0; + USHORT nDoneTarget = 0; + BOOL bElse = FALSE; + // Die Cases einlesen: + while( !bAbort ) + { + eTok = Next(); + if( eTok == CASE ) + { + if( nNextTarget ) + aGen.BackChain( nNextTarget ), nNextTarget = 0; + aGen.Statement(); + // Jeden Case einlesen + BOOL bDone = FALSE; + USHORT nTrueTarget = 0; + if( Peek() == ELSE ) + { + // CASE ELSE + Next(); + bElse = TRUE; + } + else while( !bDone ) + { + if( bElse ) + Error( SbERR_SYNTAX ); + SbiToken eTok = Peek(); + if( eTok == IS || ( eTok >= EQ && eTok <= GE ) ) + { // CASE [IS] operator expr + if( eTok == IS ) + Next(); + eTok = Peek(); + if( eTok < EQ || eTok > GE ) + Error( SbERR_SYNTAX ); + else Next(); + SbiExpression aCompare( this ); + aCompare.Gen(); + nTrueTarget = aGen.Gen( _CASEIS, nTrueTarget, + SbxEQ + ( eTok - EQ ) ); + } + else + { // CASE expr | expr TO expr + SbiExpression aCase1( this ); + aCase1.Gen(); + if( Peek() == TO ) + { + // CASE a TO b + Next(); + SbiExpression aCase2( this ); + aCase2.Gen(); + nTrueTarget = aGen.Gen( _CASETO, nTrueTarget ); + } + else + // CASE a + nTrueTarget = aGen.Gen( _CASEIS, nTrueTarget, SbxEQ ); + + } + if( Peek() == COMMA ) Next(); + else TestEoln(), bDone = TRUE; + } + // Alle Cases abgearbeitet + if( !bElse ) + { + nNextTarget = aGen.Gen( _JUMP, nNextTarget ); + aGen.BackChain( nTrueTarget ); + } + // den Statement-Rumpf bauen + while( !bAbort ) + { + eTok = Peek(); + if( eTok == CASE || eTok == ENDSELECT ) + break; + if( !Parse() ) goto done; + eTok = Peek(); + if( eTok == CASE || eTok == ENDSELECT ) + break; + } + if( !bElse ) + nDoneTarget = aGen.Gen( _JUMP, nDoneTarget ); + } + else if( !IsEoln( eTok ) ) + break; + } +done: + if( eTok != ENDSELECT ) + Error( SbERR_EXPECTED, ENDSELECT ); + if( nNextTarget ) + aGen.BackChain( nNextTarget ); + aGen.BackChain( nDoneTarget ); + aGen.Gen( _ENDCASE ); +} + +// ON Error/Variable + +#ifdef _MSC_VER +#pragma optimize("",off) +#endif + +void SbiParser::On() +{ + SbiToken eTok = Peek(); + String aString = SbiTokenizer::Symbol(eTok); + if (aString.EqualsIgnoreCaseAscii("ERROR")) + //if (!aString.ICompare("ERROR")) + eTok = _ERROR_; // Error kommt als SYMBOL + if( eTok != _ERROR_ && eTok != LOCAL ) OnGoto(); + else + { + if( eTok == LOCAL ) Next(); + Next (); // Kein TestToken mehr, da es sonst einen Fehler gibt + + Next(); // Token nach Error holen + if( eCurTok == GOTO ) + { + // ON ERROR GOTO label|0 + Next(); + if( MayBeLabel() ) + { + if( eCurTok == NUMBER && !nVal ) + aGen.Gen( _STDERROR ); + else + { + USHORT nOff = pProc->GetLabels().Reference( aSym ); + aGen.Gen( _ERRHDL, nOff ); + } + } + else Error( SbERR_LABEL_EXPECTED ); + } + else if( eCurTok == RESUME ) + { + TestToken( NEXT ); + aGen.Gen( _NOERROR ); + } + else Error( SbERR_EXPECTED, "GoTo/Resume" ); + } +} + +#ifdef _MSC_VER +#pragma optimize("",off) +#endif + +// RESUME [0]|NEXT|label + +void SbiParser::Resume() +{ + USHORT nLbl; + + switch( Next() ) + { + case EOS: + case EOLN: + aGen.Gen( _RESUME, 0 ); + break; + case NEXT: + aGen.Gen( _RESUME, 1 ); + Next(); + break; + case NUMBER: + if( !nVal ) + { + aGen.Gen( _RESUME, 0 ); + break; + } // fall thru + case SYMBOL: + if( MayBeLabel() ) + { + nLbl = pProc->GetLabels().Reference( aSym ); + aGen.Gen( _RESUME, nLbl ); + Next(); + break; + } // fall thru + default: + Error( SbERR_LABEL_EXPECTED ); + } +} + diff --git a/basic/source/comp/makefile.mk b/basic/source/comp/makefile.mk new file mode 100644 index 000000000000..c34e9b947d84 --- /dev/null +++ b/basic/source/comp/makefile.mk @@ -0,0 +1,106 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ +# +# 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): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=BASIC +TARGET=comp + +# --- Settings ------------------------------------------------------------ + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + +CXXFILES= \ + sbcomp.cxx \ + dim.cxx \ + exprtree.cxx \ + exprnode.cxx \ + exprgen.cxx \ + codegen.cxx \ + io.cxx \ + loops.cxx \ + parser.cxx \ + scanner.cxx \ + token.cxx \ + symtbl.cxx \ + buffer.cxx + +SLOFILES= \ + $(SLO)$/sbcomp.obj \ + $(SLO)$/dim.obj \ + $(SLO)$/exprtree.obj \ + $(SLO)$/exprnode.obj \ + $(SLO)$/exprgen.obj \ + $(SLO)$/codegen.obj \ + $(SLO)$/io.obj \ + $(SLO)$/loops.obj \ + $(SLO)$/parser.obj \ + $(SLO)$/scanner.obj \ + $(SLO)$/token.obj \ + $(SLO)$/symtbl.obj \ + $(SLO)$/buffer.obj + +# --- Targets -------------------------------------------------------------- + +.INCLUDE : target.mk diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx new file mode 100644 index 000000000000..0c3d82ce3f20 --- /dev/null +++ b/basic/source/comp/parser.cxx @@ -0,0 +1,774 @@ +/************************************************************************* + * + * $RCSfile: parser.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#if SUPD >= 375 +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#else +#include <svmem.hxx> +#include <sbx.hxx> +#endif +#include "sbcomp.hxx" +#pragma hdrstop + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +struct SbiParseStack { // "Stack" fuer Statement-Blocks + SbiParseStack* pNext; // Chain + SbiExprNode* pWithVar; // Variable fuer WITH + SbiToken eExitTok; // Exit-Token + USHORT nChain; // JUMP-Chain +}; + +struct SbiStatement { + SbiToken eTok; + void( SbiParser::*Func )(); // Verarbeitungsroutine + BOOL bMain; // TRUE: ausserhalb SUBs OK + BOOL bSubr; // TRUE: in SUBs OK + BOOL bVBScript; // TRUE: in OK +}; + +#define Y TRUE +#define N FALSE + +static SbiStatement StmntTable [] = { +{ CALL, &SbiParser::Call, N, Y, Y, }, // CALL +{ CLOSE, &SbiParser::Close, N, Y, Y, }, // CLOSE +{ _CONST_, &SbiParser::Dim, Y, Y, Y, }, // CONST +{ DECLARE, &SbiParser::Declare, Y, N, N, }, // DECLARE +{ DEFBOOL, &SbiParser::DefXXX, Y, N, N, }, // DEFBOOL +{ DEFCUR, &SbiParser::DefXXX, Y, N, N, }, // DEFCUR +{ DEFDATE, &SbiParser::DefXXX, Y, N, N, }, // DEFDATE +{ DEFDBL, &SbiParser::DefXXX, Y, N, N, }, // DEFDBL +{ DEFERR, &SbiParser::DefXXX, Y, N, N, }, // DEFERR +{ DEFINT, &SbiParser::DefXXX, Y, N, N, }, // DEFINT +{ DEFLNG, &SbiParser::DefXXX, Y, N, N, }, // DEFLNG +{ DEFOBJ, &SbiParser::DefXXX, Y, N, N, }, // DEFOBJ +{ DEFSNG, &SbiParser::DefXXX, Y, N, N, }, // DEFSNG +{ DEFSTR, &SbiParser::DefXXX, Y, N, N, }, // DEFSTR +{ DEFVAR, &SbiParser::DefXXX, Y, N, N, }, // DEFVAR +{ DIM, &SbiParser::Dim, Y, Y, Y, }, // DIM +{ DO, &SbiParser::DoLoop, N, Y, Y, }, // DO +{ ELSE, &SbiParser::NoIf, N, Y, Y, }, // ELSE +{ ELSEIF, &SbiParser::NoIf, N, Y, Y, }, // ELSEIF +{ ENDIF, &SbiParser::NoIf, N, Y, Y, }, // ENDIF +{ END, &SbiParser::Stop, N, Y, N, }, // END +{ ERASE, &SbiParser::Erase, N, Y, Y, }, // ERASE +{ _ERROR_, &SbiParser::ErrorStmnt, N, Y, Y, }, // ERROR +{ EXIT, &SbiParser::Exit, N, Y, N, }, // EXIT +{ FOR, &SbiParser::For, N, Y, Y, }, // FOR +{ FUNCTION, &SbiParser::SubFunc, Y, N, Y, }, // FUNCTION +{ GOSUB, &SbiParser::Goto, N, Y, N, }, // GOSUB +{ GLOBAL, &SbiParser::Dim, Y, N, Y, }, // GLOBAL +{ GOTO, &SbiParser::Goto, N, Y, N, }, // GOTO +{ IF, &SbiParser::If, N, Y, Y, }, // IF +{ INPUT, &SbiParser::Input, N, Y, Y, }, // INPUT +{ LET, &SbiParser::Assign, N, Y, Y, }, // LET +{ LINEINPUT,&SbiParser::LineInput, N, Y, Y, }, // LINE INPUT +{ LOOP, &SbiParser::BadBlock, N, Y, Y, }, // LOOP +{ LSET, &SbiParser::LSet, N, Y, N, }, // LSET +{ NAME, &SbiParser::Name, N, Y, Y, }, // NAME +{ NEXT, &SbiParser::BadBlock, N, Y, Y, }, // NEXT +{ ON, &SbiParser::On, N, Y, N, }, // ON +{ OPEN, &SbiParser::Open, N, Y, Y, }, // OPEN +{ OPTION, &SbiParser::Option, Y, N, N, }, // OPTION +{ PRINT, &SbiParser::Print, N, Y, Y, }, // PRINT +{ PRIVATE, &SbiParser::Dim, Y, N, Y, }, // PRIVATE +{ PUBLIC, &SbiParser::Dim, Y, N, Y, }, // PUBLIC +{ REDIM, &SbiParser::ReDim, N, Y, Y, }, // DIM +{ RESUME, &SbiParser::Resume, N, Y, N, }, // RESUME +{ RETURN, &SbiParser::Return, N, Y, N, }, // RETURN +{ RSET, &SbiParser::RSet, N, Y, N, }, // RSET +{ SELECT, &SbiParser::Select, N, Y, N, }, // SELECT +{ SET, &SbiParser::Set, N, Y, Y, }, // SET +{ STATIC, &SbiParser::Static, Y, Y, Y, }, // STATIC +{ STOP, &SbiParser::Stop, N, Y, N, }, // STOP +{ SUB, &SbiParser::SubFunc, Y, N, Y, }, // SUB +{ TYPE, &SbiParser::Type, Y, N, Y, }, // TYPE +{ UNTIL, &SbiParser::BadBlock, N, Y, Y, }, // UNTIL +{ WHILE, &SbiParser::While, N, Y, Y, }, // WHILE +{ WEND, &SbiParser::BadBlock, N, Y, Y, }, // WEND +{ WITH, &SbiParser::With, N, Y, N, }, // WITH +{ WRITE, &SbiParser::Write, N, Y, Y, }, // WRITE + +{ NIL } +}; + + +#ifdef MSC +// 'this' : used in base member initializer list +#pragma warning( disable: 4355 ) +#endif + +SbiParser::SbiParser( StarBASIC* pb, SbModule* pm ) + : SbiTokenizer( pm->GetSource(), pb ), + aGblStrings( this ), + aLclStrings( this ), + aPublics( aGblStrings, SbPUBLIC ), + aGlobals( aGblStrings, SbGLOBAL ), + aRtlSyms( aGblStrings, SbRTL ), + aGen( *pm, this, 1024 ) +{ + pBasic = pb; + eCurExpr = SbSYMBOL; + eEndTok = NIL; + pProc = NULL; + pStack = NULL; + pWithVar = NULL; + nBase = 0; + bText = + bGblDefs = + bNewGblDefs = + bSingleLineIf = + bExplicit = FALSE; + pPool = &aPublics; + for( short i = 0; i < 26; i++ ) + eDefTypes[ i ] = SbxVARIANT; // Kein expliziter Defaulttyp + + aPublics.SetParent( &aGlobals ); + aGlobals.SetParent( &aRtlSyms ); + + // Die globale Chainkette faengt bei Adresse 0 an: + nGblChain = aGen.Gen( _JUMP, 0 ); + + rTypeArray = new SbxArray; // Array fuer Benutzerdefinierte Typen +} + + +// Ist Teil der Runtime-Library? +SbiSymDef* SbiParser::CheckRTLForSym( const String& rSym, SbxDataType eType ) +{ + SbxVariable* pVar = GetBasic()->GetRtl()->Find( rSym, SbxCLASS_DONTCARE ); + SbiSymDef* pDef = NULL; + if( pVar ) + { + if( pVar->IsA( TYPE(SbxMethod) ) ) + { + SbiProcDef* pProc = aRtlSyms.AddProc( rSym ); + pProc->SetType( pVar->GetType() ); + pDef = pProc; + } + else + { + pDef = aRtlSyms.AddSym( rSym ); + pDef->SetType( eType ); + } + } + return pDef; +} + +// Globale Chainkette schliessen + +BOOL SbiParser::HasGlobalCode() +{ + if( bGblDefs && nGblChain ) + { + aGen.BackChain( nGblChain ); + aGen.Gen( _LEAVE ); + // aGen.Gen( _STOP ); + nGblChain = 0; + } + return bGblDefs; +} + +void SbiParser::OpenBlock( SbiToken eTok, SbiExprNode* pVar ) +{ + SbiParseStack* p = new SbiParseStack; + p->eExitTok = eTok; + p->nChain = 0; + p->pWithVar = pWithVar; + p->pNext = pStack; + pStack = p; + pWithVar = pVar; + + // #29955 for-Schleifen-Ebene pflegen + if( eTok == FOR ) + aGen.IncForLevel(); +} + +void SbiParser::CloseBlock() +{ + if( pStack ) + { + SbiParseStack* p = pStack; + + // #29955 for-Schleifen-Ebene pflegen + if( p->eExitTok == FOR ) + aGen.DecForLevel(); + + aGen.BackChain( p->nChain ); + pStack = p->pNext; + pWithVar = p->pWithVar; + delete p; + } +} + +// EXIT ... + +void SbiParser::Exit() +{ + SbiToken eTok = Next(); + for( SbiParseStack* p = pStack; p; p = p->pNext ) + { + if( eTok == p->eExitTok ) + { + p->nChain = aGen.Gen( _JUMP, p->nChain ); + return; + } + } + if( pStack ) + Error( SbERR_EXPECTED, pStack->eExitTok ); + else + Error( SbERR_BAD_EXIT ); +} + +BOOL SbiParser::TestSymbol( BOOL bKwdOk ) +{ + Peek(); + if( eCurTok == SYMBOL || ( bKwdOk && IsKwd( eCurTok ) ) ) + { + Next(); return TRUE; + } + Error( SbERR_SYMBOL_EXPECTED ); + return FALSE; +} + +// Testen auf ein bestimmtes Token + +BOOL SbiParser::TestToken( SbiToken t ) +{ + if( Peek() == t ) + { + Next(); return TRUE; + } + else + { + Error( SbERR_EXPECTED, t ); + return FALSE; + } +} + +// Testen auf Komma oder EOLN + +BOOL SbiParser::TestComma() +{ + SbiToken eTok = Peek(); + if( IsEoln( eTok ) ) + { + Next(); + return FALSE; + } + else if( eTok != COMMA ) + { + Error( SbERR_EXPECTED, COMMA ); + return FALSE; + } + Next(); + return TRUE; +} + +// Testen, ob EOLN vorliegt + +void SbiParser::TestEoln() +{ + if( !IsEoln( Next() ) ) + { + Error( SbERR_EXPECTED, EOLN ); + while( !IsEoln( Next() ) ) {} + } +} + +// Parsing eines Statement-Blocks +// Das Parsing laeuft bis zum Ende-Token. + +void SbiParser::StmntBlock( SbiToken eEnd ) +{ + SbiToken xe = eEndTok; + eEndTok = eEnd; + while( !bAbort && Parse() ) {} + eEndTok = xe; + if( IsEof() ) + { + Error( SbERR_BAD_BLOCK, eEnd ); + bAbort = TRUE; + } +} + +// Die Hauptroutine. Durch wiederholten Aufrufs dieser Routine wird +// die Quelle geparst. Returnwert FALSE bei Ende/Fehlern. + +BOOL SbiParser::Parse() +{ + if( bAbort ) return FALSE; + + EnableErrors(); + + Peek(); + // Dateiende? + if( IsEof() ) + { + // AB #33133: Falls keine Sub angelegt wurde, muss hier + // der globale Chain abgeschlossen werden! + // AB #40689: Durch die neue static-Behandlung kann noch + // ein nGblChain vorhanden sein, daher vorher abfragen + if( bNewGblDefs && nGblChain == 0 ) + nGblChain = aGen.Gen( _JUMP, 0 ); + return FALSE; + } + + // Leerstatement? + if( IsEoln( eCurTok ) ) + { + Next(); return TRUE; + } + + if( !bSingleLineIf && MayBeLabel( TRUE ) ) + { + // Ist ein Label + if( !pProc ) + Error( SbERR_NOT_IN_MAIN, aSym ); + else + pProc->GetLabels().Define( aSym ); + Next(); Peek(); + // Leerstatement? + if( IsEoln( eCurTok ) ) + { + Next(); return TRUE; + } + } + + // Ende des Parsings? + if( eCurTok == eEndTok ) + { + Next(); + if( eCurTok != NIL ) + aGen.Statement(); + return FALSE; + } + + // Kommentar? + if( eCurTok == REM ) + { + Next(); return TRUE; + } + + // Kommt ein Symbol, ist es entweder eine Variable( LET ) + // oder eine SUB-Prozedur( CALL ohne Klammern ) + // DOT fuer Zuweisungen im WITH-Block: .A=5 + if( eCurTok == SYMBOL || eCurTok == DOT ) + { +#ifndef VBSCRIPT_TEST + if( !pProc ) + Error( SbERR_EXPECTED, SUB ); + else +#endif + { + // Damit Zeile & Spalte stimmen... + Next(); + Push( eCurTok ); + aGen.Statement(); + Symbol(); + } + } + else + { + Next(); + + // Hier folgen nun die Statement-Parser. + + SbiStatement* p; + for( p = StmntTable; p->eTok != NIL; p++ ) + if( p->eTok == eCurTok ) + break; + if( p->eTok != NIL ) + { +#ifdef VBSCRIPT_TEST + if( !p->bVBScript ) + Error( ERRCODE_BASIC_NOT_IN_VBSCRIPT ); + else +#endif +#ifndef VBSCRIPT_TEST + if( !pProc && !p->bMain ) + Error( SbERR_NOT_IN_MAIN, eCurTok ); + else +#endif + if( pProc && !p->bSubr ) + Error( SbERR_NOT_IN_SUBR, eCurTok ); + else + { + // globalen Chain pflegen + // AB #41606/#40689: Durch die neue static-Behandlung kann noch + // ein nGblChain vorhanden sein, daher vorher abfragen + if( bNewGblDefs && ( eCurTok == SUB || eCurTok == FUNCTION ) && nGblChain == 0 ) + { + nGblChain = aGen.Gen( _JUMP, 0 ); + bNewGblDefs = FALSE; + } + // Statement-Opcode bitte auch am Anfang einer Sub + if( ( p->bSubr && (eCurTok != STATIC || Peek() == SUB || Peek() == FUNCTION ) ) || + eCurTok == SUB || eCurTok == FUNCTION ) + aGen.Statement(); + (this->*( p->Func ) )(); + SbxError nSbxErr = SbxBase::GetError(); + if( nSbxErr ) + SbxBase::ResetError(), Error( (SbError)nSbxErr ); + } + } + else + Error( SbERR_UNEXPECTED, eCurTok ); + } + + // Test auf Ende des Statements: + // Kann auch ein ELSE sein, da vor dem ELSE kein : stehen muss! + + if( !IsEos() ) + { + Peek(); + if( !IsEos() && eCurTok != ELSE ) + { + // falls das Parsing abgebrochen wurde, bis zum ":" vorgehen: + Error( SbERR_UNEXPECTED, eCurTok ); + while( !IsEos() ) Next(); + } + } + // Der Parser bricht am Ende ab, das naechste Token ist noch nicht + // geholt! + return TRUE; +} + +// Innerste With-Variable liefern +SbiExprNode* SbiParser::GetWithVar() +{ + if( pWithVar ) + return pWithVar; + + // Sonst im Stack suchen + SbiParseStack* p = pStack; + while( p ) + { + // LoopVar kann zur Zeit nur fuer with sein + if( p->pWithVar ) + return p->pWithVar; + p = p->pNext; + } + return NULL; +} + + +// Zuweisung oder Subroutine Call + +void SbiParser::Symbol() +{ + SbiExpression aVar( this, SbSYMBOL ); + aVar.Gen(); + if( Peek() != EQ ) + { + aGen.Gen( _GET ); + } + else + { + // Dann muss es eine Zuweisung sein. Was anderes gibts nicht! + if( !aVar.IsLvalue() ) + Error( SbERR_LVALUE_EXPECTED ); + TestToken( EQ ); + SbiExpression aExpr( this ); + aExpr.Gen(); + SbiOpcode eOp = _PUT; + SbiSymDef* pDef = aVar.GetRealVar(); + if( pDef ) + { + if( pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + if( pDef->GetType() == SbxOBJECT ) + { + eOp = _SET; + if( pDef->GetTypeId() ) +// if( pDef->GetTypeId() && !pDef->HabIchAlsTypeDefiniert() ) + aGen.Gen( _CLASS, pDef->GetTypeId() ); + // x = Objektfunktion (ohne Set) is nich drin +// Error( SbERR_SYNTAX ); + } + } + aGen.Gen( eOp ); + } +} + +// Zuweisungen + +void SbiParser::Assign() +{ + SbiExpression aLvalue( this, SbLVALUE ); + TestToken( EQ ); + SbiExpression aExpr( this ); + aLvalue.Gen(); + aExpr.Gen(); + USHORT nLen = 0; + SbiSymDef* pDef = aLvalue.GetRealVar(); + { + if( pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + nLen = aLvalue.GetRealVar()->GetLen(); + } + if( nLen ) + aGen.Gen( _PAD, nLen ); + aGen.Gen( _PUT ); +} + +// Zuweisungen einer Objektvariablen + +void SbiParser::Set() +{ + SbiExpression aLvalue( this, SbLVALUE ); + if( aLvalue.GetType() != SbxOBJECT ) + Error( SbERR_INVALID_OBJECT ); + TestToken( EQ ); + SbiSymDef* pDef = aLvalue.GetRealVar(); + if( pDef && pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + SbiExpression aExpr( this ); + aLvalue.Gen(); + aExpr.Gen(); + if( pDef->GetTypeId() ) +// if( pDef->GetTypeId() && !pDef->HabIchAlsTypeDefiniert() ) + aGen.Gen( _CLASS, pDef->GetTypeId() ); + aGen.Gen( _SET ); +} + +// JSM 07.10.95 +void SbiParser::LSet() +{ + SbiExpression aLvalue( this, SbLVALUE ); + if( aLvalue.GetType() != SbxSTRING ) + Error( SbERR_INVALID_OBJECT ); + TestToken( EQ ); + SbiSymDef* pDef = aLvalue.GetRealVar(); + if( pDef && pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + SbiExpression aExpr( this ); + aLvalue.Gen(); + aExpr.Gen(); + aGen.Gen( _LSET ); +} + +// JSM 07.10.95 +void SbiParser::RSet() +{ + SbiExpression aLvalue( this, SbLVALUE ); + if( aLvalue.GetType() != SbxSTRING ) + Error( SbERR_INVALID_OBJECT ); + TestToken( EQ ); + SbiSymDef* pDef = aLvalue.GetRealVar(); + if( pDef && pDef->GetConstDef() ) + Error( SbERR_DUPLICATE_DEF, pDef->GetName() ); + SbiExpression aExpr( this ); + aLvalue.Gen(); + aExpr.Gen(); + aGen.Gen( _RSET ); +} + +// DEFINT, DEFLNG, DEFSNG, DEFDBL, DEFSTR und so weiter + +void SbiParser::DefXXX() +{ + sal_Unicode ch1, ch2; + SbxDataType t = SbxDataType( eCurTok - DEFINT + SbxINTEGER ); + + while( !bAbort ) + { + if( Next() != SYMBOL ) break; + ch1 = aSym.ToUpperAscii().GetBuffer()[0]; + ch2 = 0; + if( Peek() == MINUS ) + { + Next(); + if( Next() != SYMBOL ) Error( SbERR_SYMBOL_EXPECTED ); + else + { + ch2 = aSym.ToUpperAscii().GetBuffer()[0]; + //ch2 = aSym.Upper(); + if( ch2 < ch1 ) Error( SbERR_SYNTAX ), ch2 = 0; + } + } + if (!ch2) ch2 = ch1; + ch1 -= 'A'; ch2 -= 'A'; + for (; ch1 <= ch2; ch1++) eDefTypes[ ch1 ] = t; + if( !TestComma() ) break; + } +} + +// STOP/SYSTEM + +void SbiParser::Stop() +{ + aGen.Gen( _STOP ); + Peek(); // #35694: Nur Peek(), damit EOL in Single-Line-If erkannt wird +} + +// OPTION + +void SbiParser::Option() +{ + switch( Next() ) + { + case EXPLICIT: + bExplicit = TRUE; break; + case BASE: + if( Next() == NUMBER ) + { + if( nVal == 0 || nVal == 1 ) + { + nBase = (short) nVal; + break; + } + } + Error( SbERR_EXPECTED, "0/1" ); + break; + case PRIVATE: + { + String aString = SbiTokenizer::Symbol(Next()); + if( !aString.EqualsIgnoreCaseAscii("Module") ) + Error( SbERR_EXPECTED, "Module" ); + break; + } + case COMPARE: + switch( Next() ) + { + case TEXT: bText = TRUE; return; + case BINARY: bText = FALSE; return; + default:; + } // Fall thru! + default: + Error( SbERR_BAD_OPTION, eCurTok ); + } +} + +// ERROR n + +void SbiParser::ErrorStmnt() +{ + SbiExpression aPar( this ); + aPar.Gen(); + aGen.Gen( _ERROR ); +} + + +// AB 22.5.1996 +// JavaScript-Parsing zunaechst provisorisch hier implementiert +void SbiParser::OpenJavaBlock( SbiToken, SbiExprNode* ) +{ +} + +void SbiParser::CloseJavaBlock() +{ +} + +void SbiParser::JavaStmntBlock( SbiToken ) +{ +} + +void SbiParser::JavaBreak() +{ +} + +void SbiParser::JavaContinue() +{ +} + +void SbiParser::JavaFor() +{ +} + +void SbiParser::JavaFunction() +{ +} + +void SbiParser::JavaIf() +{ +} + +void SbiParser::JavaNew() +{ +} + +void SbiParser::JavaReturn() +{ +} + +void SbiParser::JavaThis() +{ +} + +void SbiParser::JavaVar() +{ +} + +void SbiParser::JavaWhile() +{ +} + +void SbiParser::JavaWith() +{ +} + + + diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx new file mode 100644 index 000000000000..b83f3c60b58d --- /dev/null +++ b/basic/source/comp/sbcomp.cxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * $RCSfile: sbcomp.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#pragma hdrstop +#include <svtools/sbx.hxx> +#include "sbcomp.hxx" +#include "image.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +// Diese Routine ist hier definiert, damit der Compiler als eigenes Segment +// geladen werden kann. + +BOOL SbModule::Compile() +{ + if( pImage ) + return TRUE; + StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent()); + if( !pBasic ) + return FALSE; + SbxBase::ResetError(); + // Aktuelles Modul! + SbModule* pOld = pCMOD; + pCMOD = this; + + // #45741# Anderes Wait-Cursor-Handling + GetSbData()->bCompWait = BOOL( aSource.Len() > 2048 ); + if( GetSbData()->bCompWait ) + Application::EnterWait(); + + SbiParser* pParser = new SbiParser( (StarBASIC*) GetParent(), this ); + while( pParser->Parse() ) {} + if( !pParser->GetErrors() ) + pParser->aGen.Save(); + delete pParser; + // fuer den Disassembler + if( pImage ) + pImage->aSource = aSource; + + // #45741# Falls der Wait-Cursor gesetzt ist, jetzt zuruecksetzen + if( GetSbData()->bCompWait ) + { + Application::LeaveWait(); + GetSbData()->bCompWait = FALSE; + } + + pCMOD = pOld; + + // Beim Compilieren eines Moduls werden die Modul-globalen + // Variablen aller Module ungueltig + BOOL bRet = IsCompiled(); + if( bRet ) + { + pBasic->ClearAllModuleVars(); + + SbxObject* pParent = pBasic->GetParent(); + if( pParent ) + pBasic = PTR_CAST(StarBASIC,pParent); + if( pBasic ) + pBasic->ClearAllModuleVars(); + } + return bRet; +} + +/************************************************************************** +* +* Syntax-Highlighting +* +**************************************************************************/ + +void StarBASIC::Highlight( const String& rSrc, SbTextPortions& rList ) +{ + SbiTokenizer aTok( rSrc ); + aTok.Hilite( rList ); +} + diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx new file mode 100644 index 000000000000..68b6a7028f76 --- /dev/null +++ b/basic/source/comp/scanner.cxx @@ -0,0 +1,501 @@ +/************************************************************************* + * + * $RCSfile: scanner.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "sbcomp.hxx" +#pragma hdrstop +#include <ctype.h> +#include <stdio.h> // sprintf() +#include <string.h> +#if defined (ICC) || defined (WTC) || defined(__powerc) || defined ( MAC ) || defined UNX +#include <stdlib.h> +#else +#include <math.h> // atof() +#endif +#ifndef _SOLMATH_HXX //autogen wg. SolarMath +#include <tools/solmath.hxx> +#endif +#ifndef _TOOLS_INTN_HXX +#include <tools/intn.hxx> +#endif + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +SbiScanner::SbiScanner( const String& rBuf, StarBASIC* p ) : aBuf( rBuf ) +{ + pBasic = p; + pLine = NULL; + nVal = 0; + eScanType = SbxVARIANT; + nErrors = + nBufPos = + nCurCol1 = + nSavedCol1 = + nColLock = + nLine = + nCol1 = + nCol2 = + nCol = 0; + bError = + bAbort = + bSpaces = + bNumber = + bSymbol = + bUsedForHilite = FALSE; + bHash = + bErrors = TRUE; +} + +SbiScanner::~SbiScanner() +{} + +void SbiScanner::LockColumn() +{ + if( !nColLock++ ) + nSavedCol1 = nCol1; +} + +void SbiScanner::UnlockColumn() +{ + if( nColLock ) + nColLock--; +} + +void SbiScanner::GenError( SbError code ) +{ + if( !bError && bErrors ) + { + BOOL bRes = TRUE; + // Nur einen Fehler pro Statement reporten + bError = TRUE; + if( pBasic ) + { + // Falls EXPECTED oder UNEXPECTED kommen sollte, bezieht es sich + // immer auf das letzte Token, also die Col1 uebernehmen + USHORT nc = nColLock ? nSavedCol1 : nCol1; + switch( code ) + { + case SbERR_EXPECTED: + case SbERR_UNEXPECTED: + case SbERR_SYMBOL_EXPECTED: + case SbERR_LABEL_EXPECTED: + nc = nCol1; + if( nc > nCol2 ) nCol2 = nc; + break; + } + bRes = pBasic->CError( code, aError, nLine, nc, nCol2 ); + } + bAbort |= !bRes | + ( code == SbERR_NO_MEMORY || code == SbERR_PROG_TOO_LARGE ); + } + if( bErrors ) + nErrors++; +} + +// Falls sofort ein Doppelpunkt folgt, wird TRUE zurueckgeliefert. +// Wird von SbiTokenizer::MayBeLabel() verwendet, um einen Label zu erkennen + +BOOL SbiScanner::DoesColonFollow() +{ + if( pLine && *pLine == ':' ) + { + pLine++; nCol++; return TRUE; + } + else return FALSE; +} + +// Testen auf ein legales Suffix + +static SbxDataType GetSuffixType( sal_Unicode c ) +{ + static String aSuffixesStr = String::CreateFromAscii( "%&!#@ $" ); + if( c ) + { + sal_uInt32 n = aSuffixesStr.Search( c ); + if( STRING_NOTFOUND != n && c != ' ' ) + return SbxDataType( (USHORT) n + SbxINTEGER ); + } + return SbxVARIANT; +} + +// Einlesen des naechsten Symbols in die Variablen aSym, nVal und eType +// Returnwert ist FALSE bei EOF oder Fehlern +#define BUF_SIZE 80 + +BOOL SbiScanner::NextSym() +{ + static International aEnglischIntn( LANGUAGE_ENGLISH_US, LANGUAGE_ENGLISH_US ); + + // Fuer den EOLN-Fall merken + USHORT nOldLine = nLine; + USHORT nOldCol1 = nCol1; + USHORT nOldCol2 = nCol2; + sal_Unicode buf[ BUF_SIZE ], *p = buf; + bHash = FALSE; + + eScanType = SbxVARIANT; + aSym.Erase(); + bSymbol = + bNumber = bSpaces = FALSE; + + // Zeile einlesen? + if( !pLine ) + { + USHORT n = nBufPos; + USHORT nLen = aBuf.Len(); + if( nBufPos >= nLen ) + return FALSE; + const sal_Unicode* p = aBuf.GetBuffer(); + p += n; + while( ( n < nLen ) && ( *p != '\n' ) && ( *p != '\r' ) ) + p++, n++; + aLine = aBuf.Copy( nBufPos, n - nBufPos ); + if( ( n < nLen ) && *p == '\r' && *( p+1 ) == '\n' ) + n += 2; + else + n++; + nBufPos = n; + pLine = aLine.GetBuffer(); + nOldLine = ++nLine; + nCol = nCol1 = nCol2 = nOldCol1 = nOldCol2 = 0; + nColLock = 0; + } + + // Leerstellen weg: + while( *pLine && ( *pLine == ' ' ) || ( *pLine == '\t' ) || ( *pLine == '\f' ) ) + pLine++, nCol++, bSpaces = TRUE; + + nCol1 = nCol; + + // nur Leerzeile? + if( !*pLine ) goto eoln; + + if( *pLine == '#' ) pLine++, nCol++, bHash = TRUE; + + // Symbol? Dann Zeichen kopieren. + if( isalpha( *pLine & 0xFF ) || *pLine == '_' ) + { + // Wenn nach '_' nichts kommt, ist es ein Zeilenabschluss! + if( *pLine == '_' && !*(pLine+1) ) + { pLine++; + goto eoln; } + bSymbol = TRUE; + short n = nCol; + for ( ; (isalnum( *pLine & 0xFF ) || ( *pLine == '_' ) ); pLine++ ) + nCol++; + aSym = aLine.Copy( n, nCol - n ); + // Abschliessendes '_' durch Space ersetzen, wenn Zeilenende folgt + // (sonst falsche Zeilenfortsetzung) + if( !bUsedForHilite && !*pLine && *(pLine-1) == '_' ) + *((sal_Unicode*)(pLine-1)) = ' '; // cast wegen const + // Typkennung? + // Das Ausrufezeichen bitte nicht testen, wenn + // danach noch ein Symbol anschliesst + else if( *pLine != '!' || !isalpha( pLine[ 1 ] & 0xFF ) ) + { + SbxDataType t = GetSuffixType( *pLine ); + if( t != SbxVARIANT ) + { + eScanType = t; + pLine++; + nCol++; +#ifdef VBSCRIPT_TEST + nCol2 = nCol; + GenError( ERRCODE_BASIC_NOT_IN_VBSCRIPT ); +#endif + } + } + } + + // Zahl? Dann einlesen und konvertieren. + else if( isdigit( *pLine & 0xFF ) + || ( *pLine == '.' && isdigit( *(pLine+1) & 0xFF ) ) ) + { + short exp = 0; + short comma = 0; + short ndig = 0; + short ncdig = 0; + eScanType = SbxDOUBLE; + BOOL bBufOverflow = FALSE; + while( strchr( "0123456789.DEde", *pLine ) && *pLine ) + { + // AB 4.1.1996: Buffer voll? -> leer weiter scannen + if( (p-buf) == (BUF_SIZE-1) ) + { + bBufOverflow = TRUE; + pLine++, nCol++; + continue; + } + // Komma oder Exponent? + if( *pLine == '.' ) + { + if( ++comma > 1 ) + { + pLine++; nCol++; continue; + } + else *p++ = *pLine++, nCol++; + } + else if( strchr( "DdEe", *pLine ) ) + { + if (++exp > 1) + { + pLine++; nCol++; continue; + } +// if( toupper( *pLine ) == 'D' ) +// eScanType = SbxDOUBLE; + *p++ = 'E'; pLine++; nCol++; + // Vorzeichen hinter Exponent? + if( *pLine == '+' ) + pLine++, nCol++; + else + if( *pLine == '-' ) + *p++ = *pLine++, nCol++; + } + else + { + *p++ = *pLine++, nCol++; + if( comma && !exp ) ncdig++; + } + if (!exp) ndig++; + } + *p = 0; + aSym = p; bNumber = TRUE; + // Komma, Exponent mehrfach vorhanden? + if( comma > 1 || exp > 1 ) + { aError = '.'; + GenError( SbERR_BAD_CHAR_IN_NUMBER ); } + + // #57844 Lokalisierte Funktion benutzen + int nErrno; + nVal = SolarMath::StringToDouble( buf, aEnglischIntn, nErrno ); + // ATL: nVal = atof( buf ); + + ndig -= comma; + if( !comma && !exp ) + { + if( nVal >= SbxMININT && nVal <= SbxMAXINT ) + eScanType = SbxINTEGER; + else + if( nVal >= SbxMINLNG && nVal <= SbxMAXLNG ) + eScanType = SbxLONG; + } + if( bBufOverflow ) + GenError( SbERR_MATH_OVERFLOW ); + // zu viele Zahlen fuer SINGLE? +// if (ndig > 15 || ncdig > 6) +// eScanType = SbxDOUBLE; +// else +// if( nVal > SbxMAXSNG || nVal < SbxMINSNG ) +// eScanType = SbxDOUBLE; + + // Typkennung? + SbxDataType t = GetSuffixType( *pLine ); + if( t != SbxVARIANT ) + { + eScanType = t; + pLine++; + nCol++; +#ifdef VBSCRIPT_TEST + nCol2 = nCol; + GenError( ERRCODE_BASIC_NOT_IN_VBSCRIPT ); +#endif + } + } + + // Hex/Oktalzahl? Einlesen und konvertieren: + else if( *pLine == '&' ) + { + pLine++; nCol++; + sal_Unicode cmp1[] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; + sal_Unicode cmp2[] = { '0', '1', '2', '3', '4', '5', '6', '7' }; + sal_Unicode *cmp = cmp1; + //char *cmp = "0123456789ABCDEF"; + sal_Unicode base = 16; + sal_Unicode ndig = 8; + sal_Unicode xch = *pLine++ & 0xFF; nCol++; + switch( toupper( xch ) ) + { + case 'O': + cmp = cmp2; base = 8; ndig = 11; break; + //cmp = "01234567"; base = 8; ndig = 11; break; + case 'H': + break; + default : + // Wird als Operator angesehen + pLine--; nCol--; nCol1 = nCol-1; aSym = '&'; return SYMBOL; + } + bNumber = TRUE; + long l = 0; + int i; + BOOL bBufOverflow = FALSE; + while( isalnum( *pLine & 0xFF ) ) + { + sal_Unicode ch = toupper( *pLine & 0xFF ); + pLine++; nCol++; + // AB 4.1.1996: Buffer voll, leer weiter scannen + if( (p-buf) == (BUF_SIZE-1) ) + bBufOverflow = TRUE; + else if( String( cmp ).Search( ch ) != STRING_NOTFOUND ) + //else if( strchr( cmp, ch ) ) + *p++ = ch; + else + { + aError = ch; + GenError( SbERR_BAD_CHAR_IN_NUMBER ); + } + } + *p = 0; + for( p = buf; *p; p++ ) + { + i = (*p & 0xFF) - '0'; + if( i > 9 ) i -= 7; + l = ( l * base ) + i; + if( !ndig-- ) + { + GenError( SbERR_MATH_OVERFLOW ); break; + } + } + if( *pLine == '&' ) pLine++, nCol++; + nVal = (double) l; + eScanType = ( l >= SbxMININT && l <= SbxMAXINT ) ? SbxINTEGER : SbxLONG; + if( bBufOverflow ) + GenError( SbERR_MATH_OVERFLOW ); + } + + // Strings: + else if( *pLine == '"' || *pLine == '[' ) + { + sal_Unicode cSep = *pLine; + if( cSep == '[' ) + bSymbol = TRUE, cSep = ']'; + short n = nCol+1; + while( *pLine ) + { + do pLine++, nCol++; + while( *pLine && ( *pLine != cSep ) ); + if( *pLine == cSep ) + { + pLine++; nCol++; + if( *pLine != cSep || cSep == ']' ) break; + } else aError = cSep, GenError( SbERR_EXPECTED ); + } + aSym = aLine.Copy( n, nCol - n - 1 ); + // Doppelte Stringbegrenzer raus + String s( cSep ); + s += cSep; + USHORT nIdx; + do { + nIdx = aSym.Search( s ); + aSym.Erase( nIdx, 1 ); + } while( nIdx != STRING_NOTFOUND ); + if( cSep != ']' ) + eScanType = ( cSep == '#' ) ? SbxDATE : SbxSTRING; + } + // ungueltige Zeichen: + else if( ( *pLine & 0xFF ) >= 0x7F ) + { + GenError( SbERR_SYNTAX ); pLine++; nCol++; + } + // andere Gruppen: + else + { + short n = 1; + switch( *pLine++ ) + { + case '<': if( *pLine == '>' || *pLine == '=' ) n = 2; break; + case '>': if( *pLine == '=' ) n = 2; break; + case ':': if( *pLine == '=' ) n = 2; break; + } + aSym = aLine.Copy( nCol, n ); + pLine += n-1; nCol += n; + } + + nCol2 = nCol-1; + + // Kommentar? + if( eScanType != SbxSTRING && + ( aSym.GetBuffer()[0] == '\'' || aSym.EqualsIgnoreCaseAscii( "REM" ) ) ) + { + aSym = String::CreateFromAscii( "REM" ); + nCol2 += String( pLine ).Len(); + pLine = NULL; + } + return TRUE; + + // Sonst Zeilen-Ende: aber bitte auf '_' testen, ob die + // Zeile nicht weitergeht! +eoln: + if( nCol && *--pLine == '_' ) + { + pLine = NULL; return NextSym(); + } + else + { + pLine = NULL; + nLine = nOldLine; + nCol1 = nOldCol1; + nCol2 = nOldCol2; + aSym = '\n'; + nColLock = 0; + return TRUE; + } +} + diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx new file mode 100644 index 000000000000..1e5f7d714f9e --- /dev/null +++ b/basic/source/comp/symtbl.cxx @@ -0,0 +1,528 @@ +/************************************************************************* + * + * $RCSfile: symtbl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "sbcomp.hxx" +#pragma hdrstop +#include <stdio.h> +#include <string.h> +#include <ctype.h> + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +SV_IMPL_PTRARR(SbiStrings,String*) +SV_IMPL_PTRARR(SbiSymbols,SbiSymDef*) + +// Alle Symbolnamen werden im Stringpool des Symbol-Pools abgelegt, damit +// alle Symbole im gleichen Case verarbeitet werden. Beim Speichern des +// Code-Images wird der globale Stringpool mit den entsprechenden Sympools +// gespeichert. Der lokale Stringpool nimmt alle Symbole auf, die nicht +// ins Image wandern (Labels, Konstantennamen etc). + +/*************************************************************************** +|* +|* SbiStringPool +|* +***************************************************************************/ + +SbiStringPool::SbiStringPool( SbiParser* p ) +{ + pParser = p; +} + +SbiStringPool::~SbiStringPool() +{} + +// Suchen + +const String& SbiStringPool::Find( USHORT n ) const +{ + if( !n || n > aData.Count() ) + return aEmpty; + else + return *aData.GetObject( n-1 ); +} + +// Hinzufuegen eines Strings. Der String wird Case-Insensitiv +// verglichen. + +short SbiStringPool::Add( const String& rVal, BOOL bNoCase ) +{ + USHORT n = aData.Count(); + for( USHORT i = 0; i < n; i++ ) + { + String* p = aData.GetObject( i ); + if( ( bNoCase && p->Equals( rVal ) ) + || ( !bNoCase && p->EqualsIgnoreCaseAscii( rVal ) ) ) + return i+1; + } + const String* pNew = new String( rVal ); + aData.Insert( pNew, n++ ); + return (short) n; +} + +short SbiStringPool::Add( double n, SbxDataType t ) +{ + char buf[ 40 ]; + switch( t ) + { + case SbxINTEGER: sprintf( buf, "%d", (short) n ); break; + case SbxLONG: sprintf( buf, "%ld", (long) n ); break; + case SbxSINGLE: sprintf( buf, "%.6g", (float) n ); break; + case SbxDOUBLE: sprintf( buf, "%.16g", n ); break; + } + return Add( String::CreateFromAscii( buf ) ); +} + +/*************************************************************************** +|* +|* SbiSymPool +|* +***************************************************************************/ + +SbiSymPool::SbiSymPool( SbiStringPool& r, SbiSymScope s ) : rStrings( r ) +{ + pParser = r.GetParser(); + eScope = s; + pParent = NULL; + nCur = + nProcId = 0; +} + +SbiSymPool::~SbiSymPool() +{} + +// Inhalt loeschen + +void SbiSymPool::Clear() +{ + aData.DeleteAndDestroy( 0, aData.Count() ); +} + +SbiSymDef* SbiSymPool::First() +{ + nCur = (USHORT) -1; + return Next(); +} + +SbiSymDef* SbiSymPool::Next() +{ + if( ++nCur >= aData.Count() ) + return NULL; + else + return aData.GetObject( nCur ); +} + +// Hinzufuegen eines Symbols + +SbiSymDef* SbiSymPool::AddSym( const String& rName ) +{ + SbiSymDef* p = new SbiSymDef( rName ); + p->nPos = aData.Count(); + p->nId = rStrings.Add( rName ); + p->nProcId = nProcId; + p->pIn = this; + const SbiSymDef* q = p; + aData.Insert( q, q->nPos ); + return p; +} + +SbiProcDef* SbiSymPool::AddProc( const String& rName ) +{ + SbiProcDef* p = new SbiProcDef( pParser, rName ); + p->nPos = aData.Count(); + p->nId = rStrings.Add( rName ); + // Procs sind immer global + p->nProcId = 0; + p->pIn = this; + const SbiSymDef* q = p; + aData.Insert( q, q->nPos ); + return p; +} + +// Hinzufuegen einer extern aufgebauten Symboldefinition + +void SbiSymPool::Add( SbiSymDef* pDef ) +{ + if( pDef && pDef->pIn != this ) + { + if( pDef->pIn ) + { +#ifndef PRODUCT + // schon in einem anderen Pool drin! + pParser->Error( SbERR_INTERNAL_ERROR, "Dbl Pool" ); +#endif + return; + } + + pDef->nPos = aData.Count(); + if( !pDef->nId ) + { + // Bei statischen Variablen muss ein eindeutiger Name + // im Stringpool erzeugt werden (Form ProcName:VarName) + String aName( pDef->aName ); + if( pDef->IsStatic() ) + { + aName = pParser->aGblStrings.Find( nProcId ); + aName += ':'; + aName += pDef->aName; + } + pDef->nId = rStrings.Add( aName ); + } + // Procs sind immer global + if( !pDef->GetProcDef() ) + pDef->nProcId = nProcId; + pDef->pIn = this; + const SbiSymDef* q = pDef; + aData.Insert( q, q->nPos ); + } +} + +// Suchen eines Eintrags ueber den Namen. Es wird auch im Parent gesucht. + +SbiSymDef* SbiSymPool::Find( const String& rName ) const +{ + for( USHORT i = 0; i < aData.Count(); i++ ) + { + SbiSymDef* p = aData.GetObject( i ); + if( ( !p->nProcId || ( p->nProcId == nProcId ) ) + && ( p->aName.EqualsIgnoreCaseAscii( rName ) ) ) + return p; + } + if( pParent ) + return pParent->Find( rName ); + else + return NULL; +} + +// Suchen ueber ID-Nummer + +SbiSymDef* SbiSymPool::FindId( USHORT n ) const +{ + for( USHORT i = 0; i < aData.Count(); i++ ) + { + SbiSymDef* p = aData.GetObject( i ); + if( p->nId == n && ( !p->nProcId || ( p->nProcId == nProcId ) ) ) + return p; + } + if( pParent ) + return pParent->FindId( n ); + else + return NULL; +} + +// Suchen ueber Position (ab 0) + +SbiSymDef* SbiSymPool::Get( USHORT n ) const +{ + if( n >= aData.Count() ) + return NULL; + else + return aData.GetObject( n ); +} + +USHORT SbiSymPool::Define( const String& rName ) +{ + SbiSymDef* p = Find( rName ); + if( p ) + { if( p->IsDefined() ) + pParser->Error( SbERR_LABEL_DEFINED, rName ); + } + else + p = AddSym( rName ); + return p->Define(); +} + +USHORT SbiSymPool::Reference( const String& rName ) +{ + SbiSymDef* p = Find( rName ); + if( !p ) + p = AddSym( rName ); + //Sicherheitshalber + pParser->aGen.GenStmnt(); + return p->Reference(); +} + +// Alle offenen Referenzen anmaulen + +void SbiSymPool::CheckRefs() +{ + for( USHORT i = 0; i < aData.Count(); i++ ) + { + SbiSymDef* p = aData.GetObject( i ); + if( !p->IsDefined() ) + pParser->Error( SbERR_UNDEF_LABEL, p->GetName() ); + } +} + +/*************************************************************************** +|* +|* Symbol-Definitionen +|* +***************************************************************************/ + +SbiSymDef::SbiSymDef( const String& rName ) : aName( rName ) +{ + eType = SbxEMPTY; + nDims = + nTypeId = + nProcId = + nId = + nPos = + nLen = + nChain = 0; + bAs = + bNew = + bStatic = + bOpt = + bByVal = + bChained = FALSE; + pIn = + pPool = NULL; +} + +SbiSymDef::~SbiSymDef() +{ + delete pPool; +} + +SbiProcDef* SbiSymDef::GetProcDef() +{ + return NULL; +} + +SbiConstDef* SbiSymDef::GetConstDef() +{ + return NULL; +} + +// Wenn der Name benoetigt wird, den aktuellen Namen +// aus dem Stringpool nehmen + +const String& SbiSymDef::GetName() +{ + if( pIn ) + aName = pIn->rStrings.Find( nId ); + return aName; +} + +// Eintragen eines Datentyps + +void SbiSymDef::SetType( SbxDataType t ) +{ + if( t == SbxVARIANT && pIn ) + { + char ch = (char)aName.GetBuffer()[0]; + if( ch == '_' ) ch = 'Z'; + ch = toupper( ch ); + t = pIn->pParser->eDefTypes[ ch - 'A' ]; + } + eType = t; +} + +// Aufbau einer Backchain, falls noch nicht definiert +// Es wird der Wert zurueckgeliefert, der als Operand gespeichert +// werden soll. + +USHORT SbiSymDef::Reference() +{ + if( !bChained ) + { + USHORT n = nChain; + nChain = pIn->pParser->aGen.GetOffset(); + return n; + } + else return nChain; +} + +// Definition eines Symbols. +// Hier wird der Backchain aufgeloest, falls vorhanden + +USHORT SbiSymDef::Define() +{ + USHORT n = pIn->pParser->aGen.GetPC(); + pIn->pParser->aGen.GenStmnt(); + if( nChain ) pIn->pParser->aGen.BackChain( nChain ); + nChain = n; + bChained = TRUE; + return nChain; +} + +// Eine Symboldefinition kann einen eigenen Pool haben. Dies ist +// der Fall bei Objekten und Prozeduren (lokale Variable) + +SbiSymPool& SbiSymDef::GetPool() +{ + if( !pPool ) + pPool = new SbiSymPool( pIn->pParser->aGblStrings, SbLOCAL ); // wird gedumpt + return *pPool; +} + +SbiSymScope SbiSymDef::GetScope() const +{ + return pIn ? pIn->GetScope() : SbLOCAL; +} + +//////////////////////////////////////////////////////////////////////////// + +// Die Prozedur-Definition hat drei Pools: +// 1) aParams: wird durch die Definition gefuellt. Enthaelt die Namen +// der Parameter, wie sie innerhalb des Rumpfes verwendet werden. +// Das erste Element ist der Returnwert. +// 2) pPool: saemtliche lokale Variable +// 3) aLabels: Labels + +SbiProcDef::SbiProcDef( SbiParser* pParser, const String& rName ) + : SbiSymDef( rName ), + aParams( pParser->aGblStrings, SbPARAM ), // wird gedumpt + aLabels( pParser->aLclStrings, SbLOCAL ) // wird nicht gedumpt +{ + aParams.SetParent( &pParser->aPublics ); + pPool = new SbiSymPool( pParser->aGblStrings, SbLOCAL ); // Locals + pPool->SetParent( &aParams ); + nLine1 = + nLine2 = 0; + bPublic = TRUE; + bCdecl = FALSE; + // Fuer Returnwerte ist das erste Element der Parameterliste + // immer mit dem Namen und dem Typ der Proc definiert + aParams.AddSym( aName ); +} + +SbiProcDef::~SbiProcDef() +{} + +SbiProcDef* SbiProcDef::GetProcDef() +{ + return this; +} + +void SbiProcDef::SetType( SbxDataType t ) +{ + SbiSymDef::SetType( t ); + aParams.Get( 0 )->SetType( eType ); +} + +// Match mit einer Forward-Deklaration +// Falls der Match OK ist, wird pOld durch this im Pool ersetzt +// pOld wird immer geloescht! + +void SbiProcDef::Match( SbiProcDef* pOld ) +{ + SbiSymDef* po, *pn; + // Parameter 0 ist der Funktionsname + USHORT i; + for( i = 1; i < aParams.GetSize(); i++ ) + { + po = pOld->aParams.Get( i ); + pn = aParams.Get( i ); + // Kein Typabgleich; das wird beim Laufen erledigt + // aber ist sie evtl. mit zu wenigen Parametern aufgerufen + // worden? + if( !po && !pn->IsOptional() ) + break; + po = pOld->aParams.Next(); + } + // Wurden zu viele Parameter angegeben? + if( pn && i < aParams.GetSize() && pOld->pIn ) + { + // Die ganze Zeile markieren + pOld->pIn->GetParser()->SetCol1( 0 ); + pOld->pIn->GetParser()->Error( SbERR_BAD_DECLARATION, aName ); + } + if( !pIn && pOld->pIn ) + { + // Alten Eintrag durch neuen ersetzen + SbiSymDef** pData = (SbiSymDef**) pOld->pIn->aData.GetData(); + pData[ pOld->nPos ] = this; + nPos = pOld->nPos; + nId = pOld->nId; + pIn = pOld->pIn; + } + delete pOld; +} + +////////////////////////////////////////////////////////////////////////// + +SbiConstDef::SbiConstDef( const String& rName ) + : SbiSymDef( rName ) +{ + nVal = 0; eType = SbxINTEGER; +} + +void SbiConstDef::Set( double n, SbxDataType t ) +{ + aVal.Erase(); nVal = n; eType = t; +} + +void SbiConstDef::Set( const String& n ) +{ + aVal = n; nVal = 0; eType = SbxSTRING; +} + +SbiConstDef::~SbiConstDef() +{} + +SbiConstDef* SbiConstDef::GetConstDef() +{ + return this; +} + diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx new file mode 100644 index 000000000000..38a2fc9f9986 --- /dev/null +++ b/basic/source/comp/token.cxx @@ -0,0 +1,689 @@ +/************************************************************************* + * + * $RCSfile: token.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <ctype.h> +#include "sbcomp.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBCOMP, SBCOMP_CODE ) + +struct TokenTable { SbiToken t; const char *s; }; + +static short nToken; // Anzahl der Tokens + +static TokenTable* pTokTable; + +static TokenTable aTokTable_Basic [] = { // Token-Tabelle: + + { CAT, "&" }, + { MUL, "*" }, + { PLUS, "+" }, + { MINUS, "-" }, + { DIV, "/" }, + { EOS, ":" }, + { ASSIGN, ":=" }, + { LT, "<" }, + { LE, "<=" }, + { NE, "<>" }, + { EQ, "=" }, + { GT, ">" }, + { GE, ">=" }, + { ACCESS, "Access" }, + { ALIAS, "Alias" }, + { AND, "And" }, + { ANY, "Any" }, + { APPEND, "Append" }, + { AS, "As" }, + { BASE, "Base" }, + { BINARY, "Binary" }, + { TBOOLEAN, "Boolean" }, + { BYVAL, "ByVal", }, + { CALL, "Call" }, + { CASE, "Case" }, + { _CDECL_, "Cdecl" }, + { CLOSE, "Close" }, + { COMPARE, "Compare" }, + { _CONST_, "Const" }, + { TCURRENCY,"Currency" }, + { TDATE, "Date" }, + { DECLARE, "Declare" }, + { DEFBOOL, "DefBool" }, + { DEFCUR, "DefCur" }, + { DEFDATE, "DefDate" }, + { DEFDBL, "DefDbl" }, + { DEFERR, "DefErr" }, + { DEFINT, "DefInt" }, + { DEFLNG, "DefLng" }, + { DEFOBJ, "DefObj" }, + { DEFSNG, "DefSng" }, + { DEFSTR, "DefStr" }, + { DEFVAR, "DefVar" }, + { DIM, "Dim" }, + { DO, "Do" }, + { TDOUBLE, "Double" }, + { EACH, "Each" }, + { ELSE, "Else" }, + { ELSEIF, "ElseIf" }, + { END, "End" }, + { ENDFUNC, "End Function" }, + { ENDIF, "End If" }, + { ENDSELECT,"End Select" }, + { ENDSUB, "End Sub" }, + { ENDTYPE, "End Type" }, + { ENDIF, "EndIf" }, + { EQV, "Eqv" }, + { ERASE, "Erase" }, + { _ERROR_, "Error" }, + { EXIT, "Exit" }, + { EXPLICIT, "Explicit" }, + { FOR, "For" }, + { FUNCTION, "Function" }, + { GLOBAL, "Global" }, + { GOSUB, "GoSub" }, + { GOTO, "GoTo" }, + { IF, "If" }, + { IMP, "Imp" }, + { _IN_, "In" }, + { INPUT, "Input" }, // auch INPUT # + { TINTEGER, "Integer" }, + { IS, "Is" }, + { LET, "Let" }, + { LIB, "Lib" }, + { LINE, "Line" }, + { LINEINPUT,"Line Input" }, + { LOCAL, "Local" }, + { LOCK, "Lock" }, + { TLONG, "Long" }, + { LOOP, "Loop" }, + { LPRINT, "LPrint" }, + { LSET, "LSet" }, // JSM + { MOD, "Mod" }, + { NAME, "Name" }, + { NEW, "New" }, + { NEXT, "Next" }, + { NOT, "Not" }, + { TOBJECT, "Object" }, + { ON, "On" }, + { OPEN, "Open" }, + { OPTION, "Option" }, + { _OPTIONAL_, "Optional" }, + { OR, "Or" }, + { OUTPUT, "Output" }, + { PRESERVE, "Preserve" }, + { PRINT, "Print" }, + { PRIVATE, "Private" }, + { PUBLIC, "Public" }, + { RANDOM, "Random" }, + { READ, "Read" }, + { REDIM, "ReDim" }, + { REM, "Rem" }, + { RESUME, "Resume" }, + { RETURN, "Return" }, + { RSET, "RSet" }, // JSM + { SELECT, "Select" }, + { SET, "Set" }, +#ifdef SHARED +#undef SHARED +#define tmpSHARED +#endif + { SHARED, "Shared" }, +#ifdef tmpSHARED +#define SHARED +#undef tmpSHARED +#endif + { TSINGLE, "Single" }, + { STATIC, "Static" }, + { STEP, "Step" }, + { STOP, "Stop" }, + { TSTRING, "String" }, + { SUB, "Sub" }, + { STOP, "System" }, + { TEXT, "Text" }, + { THEN, "Then" }, + { TO, "To", }, + { TYPE, "Type" }, + { UNTIL, "Until" }, + { TVARIANT, "Variant" }, + { WEND, "Wend" }, + { WHILE, "While" }, + { WITH, "With" }, + { WRITE, "Write" }, // auch WRITE # + { XOR, "Xor" }, + { NIL } +}; + +/* +TokenTable aTokTable_Java [] = { // Token-Tabelle: + + { JS_LOG_NOT, "!" }, + { JS_NE, "!=" }, + { JS_MOD, "%" }, + { JS_ASS_MOD, "%=" }, + { JS_BIT_AND, "&" }, + { JS_LOG_AND, "&&" }, + { JS_ASS_AND, "&=" }, + { JS_LPAREN, "(" }, + { JS_RPAREN, ")" }, + { JS_MUL, "*" }, + { JS_ASS_MUL, "*=" }, + { JS_PLUS, "+" }, + { JS_INC, "++" }, + { JS_ASS_PLUS, "+=" }, + { JS_COMMA, "," }, + { JS_MINUS, "-" }, + { JS_DEC, "--" }, + { JS_ASS_MINUS, "-=" }, + { JS_DIV, "/" }, + { JS_ASS_DIV, "/=" }, + { JS_COND_SEL, ":" }, + { JS_LT, "<" }, + { JS_LSHIFT, "<<" }, + { JS_ASS_LSHIFT,"<<=" }, + { JS_LE, "<=" }, + { JS_NE, "<>" }, + { JS_ASSIGNMENT,"=" }, + { JS_EQ, "==" }, + { JS_GT, ">" }, + { JS_RSHIFT, ">>" }, + { JS_ASS_RSHIFT,">>=" }, + { JS_RSHIFT_Z, ">>>" }, + { JS_ASS_RSHIFT_Z,">>>=" }, + { JS_GE, ">=" }, + { JS_COND_QUEST,"?" }, + { ACCESS, "Access" }, + { ALIAS, "Alias" }, + { AND, "And" }, + { ANY, "Any" }, + { APPEND, "Append" }, + { AS, "As" }, + { BASE, "Base" }, + { BINARY, "Binary" }, + { TBOOLEAN, "Boolean" }, + { BYVAL, "ByVal", }, + { CALL, "Call" }, + { CASE, "Case" }, + { _CDECL_, "Cdecl" }, + { CLOSE, "Close" }, + { COMPARE, "Compare" }, + { _CONST_, "Const" }, + { TCURRENCY,"Currency" }, + { TDATE, "Date" }, + { DECLARE, "Declare" }, + { DEFBOOL, "DefBool" }, + { DEFCUR, "DefCur" }, + { DEFDATE, "DefDate" }, + { DEFDBL, "DefDbl" }, + { DEFERR, "DefErr" }, + { DEFINT, "DefInt" }, + { DEFLNG, "DefLng" }, + { DEFOBJ, "DefObj" }, + { DEFSNG, "DefSng" }, + { DEFSTR, "DefStr" }, + { DEFVAR, "DefVar" }, + { DIM, "Dim" }, + { DO, "Do" }, + { TDOUBLE, "Double" }, + { EACH, "Each" }, + { ELSE, "Else" }, + { ELSEIF, "ElseIf" }, + { END, "End" }, + { ENDFUNC, "End Function" }, + { ENDIF, "End If" }, + { ENDSELECT,"End Select" }, + { ENDSUB, "End Sub" }, + { ENDTYPE, "End Type" }, + { ENDIF, "EndIf" }, + { EQV, "Eqv" }, + { ERASE, "Erase" }, + { _ERROR_, "Error" }, + { EXIT, "Exit" }, + { EXPLICIT, "Explicit" }, + { FOR, "For" }, + { FUNCTION, "Function" }, + { GLOBAL, "Global" }, + { GOSUB, "GoSub" }, + { GOTO, "GoTo" }, + { IF, "If" }, + { IMP, "Imp" }, + { _IN_, "In" }, + { INPUT, "Input" }, // auch INPUT # + { TINTEGER, "Integer" }, + { IS, "Is" }, + { LET, "Let" }, + { LIB, "Lib" }, + { LINE, "Line" }, + { LINEINPUT,"Line Input" }, + { LOCAL, "Local" }, + { LOCK, "Lock" }, + { TLONG, "Long" }, + { LOOP, "Loop" }, + { LPRINT, "LPrint" }, + { LSET, "LSet" }, // JSM + { MOD, "Mod" }, + { NAME, "Name" }, + { NEW, "New" }, + { NEXT, "Next" }, + { NOT, "Not" }, + { TOBJECT, "Object" }, + { ON, "On" }, + { OPEN, "Open" }, + { OPTION, "Option" }, + { _OPTIONAL_, "Optional" }, + { OR, "Or" }, + { OUTPUT, "Output" }, + { PRESERVE, "Preserve" }, + { PRINT, "Print" }, + { PRIVATE, "Private" }, + { PUBLIC, "Public" }, + { RANDOM, "Random" }, + { READ, "Read" }, + { REDIM, "ReDim" }, + { REM, "Rem" }, + { RESUME, "Resume" }, + { RETURN, "Return" }, + { RSET, "RSet" }, // JSM + { SELECT, "Select" }, + { SET, "Set" }, + { SHARED, "Shared" }, + { TSINGLE, "Single" }, + { STATIC, "Static" }, + { STEP, "Step" }, + { STOP, "Stop" }, + { TSTRING, "String" }, + { SUB, "Sub" }, + { STOP, "System" }, + { TEXT, "Text" }, + { THEN, "Then" }, + { TO, "To", }, + { TYPE, "Type" }, + { UNTIL, "Until" }, + { TVARIANT, "Variant" }, + { WEND, "Wend" }, + { WHILE, "While" }, + { WITH, "With" }, + { WRITE, "Write" }, // auch WRITE # + { XOR, "Xor" }, + { JS_LINDEX, "[" }, + { JS_RINDEX, "]" }, + { JS_BIT_XOR, "^" }, + { JS_ASS_XOR, "^=" }, + { JS_BIT_OR, "|" }, + { JS_ASS_OR, "|=" }, + { JS_LOG_OR, "||" }, + { JS_BIT_NOT, "~" }, + { NIL } +}; +*/ + +// Der Konstruktor ermittelt die Laenge der Token-Tabelle. + +SbiTokenizer::SbiTokenizer( const String& rSrc, StarBASIC* pb ) + : SbiScanner( rSrc, pb ) +{ + pTokTable = aTokTable_Basic; + //if( StarBASIC::GetGlobalLanguageMode() == SB_LANG_JAVASCRIPT ) + // pTokTable = aTokTable_Java; + TokenTable *tp; + bEof = bAs = FALSE; + eCurTok = NIL; + ePush = NIL; + bEos = bKeywords = TRUE; + if( !nToken ) + for( nToken = 0, tp = pTokTable; tp->t; nToken++, tp++ ) {} +} + +SbiTokenizer::~SbiTokenizer() +{} + +// Wiederablage (Pushback) eines Tokens. (Bis zu 2 Tokens) + +void SbiTokenizer::Push( SbiToken t ) +{ + if( ePush != NIL ) + Error( SbERR_INTERNAL_ERROR, "PUSH" ); + else ePush = t; +} + +void SbiTokenizer::Error( SbError code, const char* pMsg ) +{ + aError = String::CreateFromAscii( pMsg ); + Error( code ); +} + +void SbiTokenizer::Error( SbError code, String aMsg ) +{ + aError = aMsg; + Error( code ); +} + +void SbiTokenizer::Error( SbError code, SbiToken tok ) +{ + aError = Symbol( tok ); + Error( code ); +} + +// Einlesen des naechsten Tokens, ohne dass das Token geschluckt wird + +SbiToken SbiTokenizer::Peek() +{ + if( ePush == NIL ) + { + USHORT nOldLine = nLine; + USHORT nOldCol1 = nCol1; + USHORT nOldCol2 = nCol2; + ePush = Next(); + nPLine = nLine; nLine = nOldLine; + nPCol1 = nCol1; nCol1 = nOldCol1; + nPCol2 = nCol2; nCol2 = nOldCol2; + } + return eCurTok = ePush; +} + +// Dies ist fuer die Decompilation. +// Zahlen und Symbole liefern einen Leerstring zurueck. + +const String& SbiTokenizer::Symbol( SbiToken t ) +{ + // Zeichen-Token? + if( t < FIRSTKWD ) + { + aSym = (char) t; + return aSym; + } + switch( t ) + { + case NEG : aSym = '-'; return aSym; + case EOS : aSym = String::CreateFromAscii( ":/CRLF" ); return aSym; + case EOLN : aSym = String::CreateFromAscii( "CRLF" ); return aSym; + } + TokenTable* tp = pTokTable; + for( short i = 0; i < nToken; i++, tp++ ) + { + if( tp->t == t ) + { + aSym = String::CreateFromAscii( tp->s ); + return aSym; + } + } + const sal_Unicode *p = aSym.GetBuffer(); + if (*p <= ' ') aSym = String::CreateFromAscii( "???" ); + return aSym; +} + +// Einlesen des naechsten Tokens und Ablage desselben +// Tokens, die nicht in der Token-Tabelle vorkommen, werden +// direkt als Zeichen zurueckgeliefert. +// Einige Worte werden gesondert behandelt. + +SbiToken SbiTokenizer::Next() +{ + if (bEof) return EOLN; + // Schon eines eingelesen? + if( ePush != NIL ) + { + eCurTok = ePush; + ePush = NIL; + nLine = nPLine; + nCol1 = nPCol1; + nCol2 = nPCol2; + bEos = IsEoln( eCurTok ); + return eCurTok; + } + TokenTable *tp; + + // Sonst einlesen: + if( !NextSym() ) + { + bEof = bEos = TRUE; + return eCurTok = EOLN; + } + // Zeilenende? + if( aSym.GetBuffer()[0] == '\n' ) + { + bEos = TRUE; return eCurTok = EOLN; + } + bEos = FALSE; + + // Zahl? + if( bNumber ) + return eCurTok = NUMBER; + + // String? + else if( ( eScanType == SbxDATE || eScanType == SbxSTRING ) && !bSymbol ) + return eCurTok = FIXSTRING; + // Sonderfaelle von Zeichen, die zwischen "Z" und "a" liegen. ICompare() + // wertet die Position dieser Zeichen unterschiedlich aus. + else if( aSym.GetBuffer()[0] == '^' ) + return eCurTok = EXPON; + else if( aSym.GetBuffer()[0] == '\\' ) + return eCurTok = IDIV; + else + { + // Mit Typkennung oder ein Symbol und keine Keyword-Erkennung? + // Dann kein Token-Test + if( eScanType != SbxVARIANT + || ( !bKeywords && bSymbol ) ) + return eCurTok = SYMBOL; + // Gueltiges Token? + short lb = 0; + short ub = nToken-1; + short delta; + do + { + delta = (ub - lb) >> 1; + tp = &pTokTable[ lb + delta ]; + StringCompare res = aSym.CompareIgnoreCaseToAscii( tp->s ); + // Gefunden? + if( res == COMPARE_EQUAL ) goto special; + // Groesser? Dann untere Haelfte + if( res == COMPARE_LESS ) + { + if ((ub - lb) == 2) ub = lb; + else ub -= delta; + } + // Kleiner? Dann obere Haelfte + else + { + if ((ub -lb) == 2) lb = ub; + else lb += delta; + } + } while( delta ); + // Symbol? Wenn nicht >= Token + sal_Unicode ch = aSym.GetBuffer()[0]; + if( !isalpha( ch ) && !bSymbol ) + return eCurTok = (SbiToken) (ch & 0x00FF); + return eCurTok = SYMBOL; + } +special: + // LINE INPUT + if( tp->t == LINE ) + { + short nC1 = nCol1; + eCurTok = Peek(); + if( eCurTok == INPUT ) + { + Next(); + nCol1 = nC1; + return eCurTok = LINEINPUT; + } + else + return eCurTok = LINE; + } + // END IF, CASE, SUB, DEF, FUNCTION, TYPE, CLASS, WITH + if( tp->t == END ) + { + // AB, 15.3.96, Spezialbehandlung fuer END, beim Peek() geht die + // aktuelle Zeile verloren, daher alles merken und danach restaurieren + USHORT nOldLine = nLine; + USHORT nOldCol = nCol; + USHORT nOldCol1 = nCol1; + USHORT nOldCol2 = nCol2; + String aOldSym = aSym; + SaveLine(); // pLine im Scanner sichern + + eCurTok = Peek(); + switch( eCurTok ) + { + case IF: Next(); eCurTok = ENDIF; break; + case SELECT: Next(); eCurTok = ENDSELECT; break; + case SUB: Next(); eCurTok = ENDSUB; break; + case FUNCTION: Next(); eCurTok = ENDFUNC; break; + case TYPE: Next(); eCurTok = ENDTYPE; break; + case WITH: Next(); eCurTok = ENDWITH; break; + default : eCurTok = END; + } + nCol1 = nOldCol1; + if( eCurTok == END ) + { + // Alles zuruecksetzen, damit Token nach END ganz neu gelesen wird + ePush = NIL; + nLine = nOldLine; + nCol = nOldCol; + nCol2 = nOldCol2; + aSym = aOldSym; + RestoreLine(); // pLine im Scanner restaurieren + } + return eCurTok; + } + // Sind Datentypen Keywords? + // Nur nach AS, sonst sind es Symbole! + // Es gibt ja ERROR(), DATA(), STRING() etc. + eCurTok = tp->t; + // AS: Datentypen sind Keywords + if( tp->t == AS ) + bAs = TRUE; + else + { + if( bAs ) + bAs = FALSE; + else if( eCurTok >= DATATYPE1 && eCurTok <= DATATYPE2 ) + eCurTok = SYMBOL; + } + bEos = IsEoln( eCurTok ); + return eCurTok; +} + +#ifdef _MSC_VER +#pragma optimize("",off) +#endif + +// Kann das aktuell eingelesene Token ein Label sein? + +BOOL SbiTokenizer::MayBeLabel( BOOL bNeedsColon ) +{ + if( eCurTok == SYMBOL ) + return bNeedsColon ? DoesColonFollow() : TRUE; + else + return BOOL( eCurTok == NUMBER + && eScanType == SbxINTEGER + && nVal >= 0 ); +} + +#ifdef _MSC_VER +#pragma optimize("",off) +#endif + + +void SbiTokenizer::Hilite( SbTextPortions& rList ) +{ + bErrors = FALSE; + bUsedForHilite = TRUE; + SbiToken eLastTok = NIL; + for( ;; ) + { + Next(); + if( IsEof() ) + break; + SbTextPortion aRes; + aRes.nLine = nLine; + aRes.nStart = nCol1; + aRes.nEnd = nCol2; + sal_Unicode ch = aSym.GetBuffer()[0]; + switch( eCurTok ) + { + case REM: + aRes.eType = SB_COMMENT; break; + case SYMBOL: + aRes.eType = SB_SYMBOL; break; + case FIXSTRING: + aRes.eType = SB_STRING; break; + case NUMBER: + aRes.eType = SB_NUMBER; break; + default: + if( ( eCurTok >= FIRSTKWD && eCurTok <= LASTKWD ) + || (eCurTok >= _CDECL_ ) ) + aRes.eType = SB_KEYWORD; + else + aRes.eType = SB_PUNCTUATION; + } + // Die Folge xxx.Keyword sollte nicht als Kwd geflagt werden + if( aRes.eType == SB_KEYWORD + && ( eLastTok == DOT|| eLastTok == EXCLAM ) ) + aRes.eType = SB_SYMBOL; + if( eCurTok != EOLN && aRes.nStart <= aRes.nEnd ) + rList.Insert( aRes, rList.Count() ); + if( aRes.eType == SB_COMMENT ) + break; + eLastTok = eCurTok; + } + bUsedForHilite = FALSE; +} + diff --git a/basic/source/inc/buffer.hxx b/basic/source/inc/buffer.hxx new file mode 100644 index 000000000000..4f806f218496 --- /dev/null +++ b/basic/source/inc/buffer.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * $RCSfile: buffer.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _BUFFER_HXX +#define _BUFFER_HXX + +#ifndef _SOLAR_H +#include <tools/solar.h> +#endif +#ifndef _STRING_HXX //autogen +#include <tools/string.hxx> +#endif + +class SbiParser; + +class SbiBuffer { // Code/Konstanten-Puffer: + SbiParser* pParser; // fuer Fehlermeldungen + char* pBuf; // Puffer-Pointer + char* pCur; // aktueller Puffer-Pointer + USHORT nOff; // aktuelles Offset + USHORT nSize; // aktuelle Groesse + short nInc; // Inkrement + BOOL Check( USHORT ); // Buffergroesse testen +public: + SbiBuffer( SbiParser*, short ); // Inkrement + ~SbiBuffer(); + void Patch( USHORT, USHORT ); // Patchen + void Chain( USHORT ); // Back-Chain + void Align( short ); // Alignment + BOOL Add( const void*, USHORT );// Element anfuegen + BOOL operator += (const String&);// Basic-String speichern + BOOL operator += (INT8); // Zeichen speichern + BOOL operator += (INT16); // Integer speichern + BOOL operator += (UINT8); // Zeichen speichern + BOOL operator += (UINT16); // Integer speichern + char* GetBuffer(); // Puffer rausgeben (selbst loeschen!) + USHORT GetSize() { return nOff; } +}; + +#endif diff --git a/basic/source/inc/codegen.hxx b/basic/source/inc/codegen.hxx new file mode 100644 index 000000000000..c748399b7b93 --- /dev/null +++ b/basic/source/inc/codegen.hxx @@ -0,0 +1,101 @@ +/************************************************************************* + * + * $RCSfile: codegen.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _CODEGEN_HXX +#define _CODEGEN_HXX + +class SbiImage; +class SbiParser; +class SbModule; +#ifndef _OPCODES_HXX +#include "opcodes.hxx" +#endif +#ifndef _BUFFER_HXX +#include "buffer.hxx" +#endif + +class SbiCodeGen { // Code-Erzeugung: + SbiParser* pParser; // fuer Fehlermeldungen, Line, Column etc. + SbModule& rMod; // aktuelles Modul + SbiBuffer aCode; // Code-Puffer + short nLine, nCol; // Zeile, Spalte fuer Stmnt-Befehl + short nForLevel; // #29955 for-Schleifen-Ebene + BOOL bStmnt; // TRUE: Statement-Opcode liegt an +public: + SbiCodeGen( SbModule&, SbiParser*, short ); + SbiParser* GetParser() { return pParser; } + USHORT Gen( SbiOpcode ); + USHORT Gen( SbiOpcode, UINT16 ); + USHORT Gen( SbiOpcode, UINT16, UINT16 ); + void Patch( USHORT o, USHORT v ){ aCode.Patch( o, v ); } + void BackChain( USHORT off ) { aCode.Chain( off ); } + void Statement(); + void GenStmnt(); // evtl. Statement-Opcode erzeugen + USHORT GetPC(); + USHORT GetOffset() { return GetPC() + 1; } + void Save(); + + // #29955 for-Schleifen-Ebene pflegen + void IncForLevel( void ) { nForLevel++; } + void DecForLevel( void ) { nForLevel--; } +}; + +#endif diff --git a/basic/source/inc/collelem.hxx b/basic/source/inc/collelem.hxx new file mode 100644 index 000000000000..389b690479d4 --- /dev/null +++ b/basic/source/inc/collelem.hxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * $RCSfile: collelem.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _SAMPLE_COLLELEM_HXX +#define _SAMPLE_COLLELEM_HXX + +#ifndef _SBX_SBXOBJECT_HXX //autogen +#include <svtools/sbxobj.hxx> +#endif + +// Das Sample-Element ist ein kleines Objekt, das die Properties +// Name und Value enthlt sowie die Methode Say, die den bergebenen +// Text mit dem eigenen Namen verkoppelt. Der Name ist von aussen setzbar. +// Die Implementation arbeitet ausschliesslich mit dynamischen Elementen. + +class SampleElement : public SbxObject +{ + // Broadcaster Notification + virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ); +public: + SampleElement( const String& ); +}; + +#endif diff --git a/basic/source/inc/disas.hxx b/basic/source/inc/disas.hxx new file mode 100644 index 000000000000..dda0ee20f1a7 --- /dev/null +++ b/basic/source/inc/disas.hxx @@ -0,0 +1,106 @@ +/************************************************************************* + * + * $RCSfile: disas.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _DISAS_HXX +#define _DISAS_HXX + +#include "image.hxx" +#include "opcodes.hxx" + +class SvStream; + +class SbiDisas { + const SbiImage& rImg; + SbModule* pMod; + char cLabels[ 8192 ]; // Bitvektor fuer Labels + USHORT nOff; // aktuelle Position + USHORT nPC; // Position des Opcodes + SbiOpcode eOp; // Opcode + USHORT nOp1, nOp2; // Operanden + short nParts; // 1, 2 oder 3 + short nLine; // aktuelle Zeile + BOOL DisasLine( String& ); + BOOL Fetch(); // naechster Opcode +public: + SbiDisas( SbModule*, const SbiImage* ); + void Disas( SvStream& ); + void Disas( String& ); + // NICHT AUFRUFEN + void StrOp( String& ); + void Str2Op( String& ); + void ImmOp( String& ); + void OnOp( String& ); + void LblOp( String& ); + void ReturnOp( String& ); + void ResumeOp( String& ); + void PromptOp( String& ); + void CloseOp( String& ); + void CharOp( String& ); + void VarOp( String& ); + void VarDefOp( String& ); + void OffOp( String& ); + void TypeOp( String& ); + void CaseOp( String& ); + void StmntOp( String& ); + void StrmOp( String& ); +}; + +#endif diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx new file mode 100644 index 000000000000..0b41dbeb3b3e --- /dev/null +++ b/basic/source/inc/expr.hxx @@ -0,0 +1,255 @@ +/************************************************************************* + * + * $RCSfile: expr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _EXPR_HXX +#define _EXPR_HXX + +#ifndef _OPCODES_HXX +#include "opcodes.hxx" +#endif +#ifndef _TOKEN_HXX +#include "token.hxx" +#endif + +class SbiExprNode; +class SbiExpression; +class SbiExprList; +class SbiDimList; +class SbiParameters; +class SbiParser; +class SbiCodeGen; +class SbiSymDef; +class SbiProcDef; + +struct SbVar { // Variablen-Element: + SbiExprNode* pNext; // Weiteres Element (bei Strukturen) + SbiSymDef* pDef; // Symboldefinition + SbiExprList* pPar; // optionale Parameter (wird geloescht) +}; + +enum SbiExprType { // Expression-Typen: + SbSTDEXPR, // normaler Ausdruck + SbLVALUE, // beliebiger lValue + SbSYMBOL, // beliebiges zusammengesetztes Symbol + SbOPERAND // Variable/Funktion +}; + +enum SbiNodeType { + SbxNUMVAL, // nVal = Wert + SbxSTRVAL, // nStringId = Wert + SbxVARVAL, // aVar = Wert + SbxNODE // Node +}; + +class SbiExprNode { // Operatoren (und Operanden) + friend class SbiExpression; + friend class SbiConstExpression; + union { + USHORT nStringId; // gepoolter String-ID + double nVal; // numerischer Wert + SbVar aVar; // oder Variable + }; + SbiExprNode* pLeft; // linker Zweig + SbiExprNode* pRight; // rechter Zweig (NULL bei unaeren Ops) + SbiCodeGen* pGen; // Code-Generator + SbiNodeType eNodeType; // Art des Nodes + SbxDataType eType; // aktueller Datentyp + SbiToken eTok; // Token des Operators + BOOL bComposite; // TRUE: Zusammengesetzter Ausdruck + BOOL bError; // TRUE: Fehlerhaft + BOOL bPartOfWith; // TRUE: .-Anweisung in with-Block + void FoldConstants(); // Constant Folding durchfuehren + void CollectBits(); // Umwandeln von Zahlen in Strings + BOOL IsOperand(); // TRUE, wenn Operand + BOOL IsNumber(); // TRUE bei Zahlen + BOOL IsString(); // TRUE bei Strings + BOOL IsLvalue(); // TRUE, falls als Lvalue verwendbar + void GenElement( SbiOpcode ); // Element + void BaseInit( SbiParser* p ); // Hilfsfunktion fuer Ctor, AB 17.12.95 +public: + SbiExprNode( SbiParser*, double, SbxDataType ); + SbiExprNode( SbiParser*, const String& ); + SbiExprNode( SbiParser*, const SbiSymDef&, SbxDataType, SbiExprList* = NULL ); + SbiExprNode( SbiParser*, SbiExprNode*, SbiToken, SbiExprNode* ); + virtual ~SbiExprNode(); + + BOOL IsValid() { return BOOL( !bError ); } + BOOL IsConstant(); // TRUE bei konstantem Operanden + BOOL IsIntConst(); // TRUE bei Integer-Konstanten + BOOL IsVariable(); // TRUE, wenn Variable + + BOOL IsPartOfWith() { return bPartOfWith; } + void SetPartOfWith( BOOL b ) { bPartOfWith = b; } + + SbxDataType GetType() { return eType; } + void SetType( SbxDataType eTp ) { eType = eTp; } + SbiNodeType GetNodeType() { return eNodeType; } + SbiSymDef* GetVar(); // Variable (falls vorhanden) + SbiSymDef* GetRealVar(); // letzte Variable in x.y.z + SbiExprNode* GetRealNode(); // letzter Knoten in x.y.z + short GetDepth(); // Tiefe eines Baumes berechnen + const String& GetString(); // String liefern + + void Optimize(); // Baumabgleich + + void Gen(); // Ausgabe eines Nodes +}; + +class SbiExpression { // der Ausdruck: + friend class SbiExprList; + friend class SbiParameters; + friend class SbiDimList; +protected: + String aArgName; // Name fuer bananntes Argument + SbiParser* pParser; // fuer Fehlermeldungen, Parsing + SbiExpression* pNext; // Link bei Parameterlisten + SbiExprNode* pExpr; // Der Expression-Baum + SbiExprType eCurExpr; // Art des Ausdrucks + BOOL bBased; // TRUE: einfacher DIM-Teil (+BASE) + BOOL bError; // TRUE: Fehler + BOOL bByVal; // TRUE: ByVal-Parameter + SbiExprNode* Term(); + SbiExprNode* ObjTerm( SbiSymDef& ); + SbiExprNode* Operand(); + SbiExprNode* Unary(); + SbiExprNode* Exp(); + SbiExprNode* MulDiv(); + SbiExprNode* IntDiv(); + SbiExprNode* Mod(); + SbiExprNode* AddSub(); + SbiExprNode* Cat(); + SbiExprNode* Like(); + SbiExprNode* Comp(); + SbiExprNode* Boolean(); +public: + SbiExpression( SbiParser*, SbiExprType = SbSTDEXPR ); // Parsender Ctor + SbiExpression( SbiParser*, const String& ); + SbiExpression( SbiParser*, double, SbxDataType = SbxDOUBLE ); + SbiExpression( SbiParser*, const SbiSymDef&, SbiExprList* = NULL ); + SbiExpression( SbiParser*, SbiToken ); // Spezial-Expr mit Spezial-Tokens + ~SbiExpression(); + String& GetName() { return aArgName; } + void SetBased() { bBased = TRUE; } + BOOL IsBased() { return bBased; } + void SetByVal() { bByVal = TRUE; } + BOOL IsByVal() { return bByVal; } + BOOL IsValid() { return pExpr->IsValid(); } + BOOL IsConstant() { return pExpr->IsConstant(); } + BOOL IsVariable() { return pExpr->IsVariable(); } + BOOL IsLvalue() { return pExpr->IsLvalue(); } + BOOL IsIntConstant() { return pExpr->IsIntConst(); } + const String& GetString() { return pExpr->GetString(); } + SbiSymDef* GetVar() { return pExpr->GetVar(); } + SbiSymDef* GetRealVar() { return pExpr->GetRealVar(); } + SbiExprNode* GetExprNode() { return pExpr; } + SbxDataType GetType() { return pExpr->GetType(); } + void SetType( SbxDataType eType){ pExpr->eType = eType; } + void Gen(); +}; + +class SbiConstExpression : public SbiExpression { + double nVal; + String aVal; + SbxDataType eType; +public: // numerische Konstante + SbiConstExpression( SbiParser* ); + SbxDataType GetType() { return eType; } + const String& GetString() { return aVal; } + double GetValue() { return nVal; } + short GetShortValue(); +}; + +class SbiExprList { // Basisklasse fuer Parameter und Dims +protected: + SbiParser* pParser; // Parser + SbiExpression* pFirst; // Expressions + SbiProcDef* pProc; // DECLARE-Funktion (Parameter-Anpassung) + short nExpr; // Anzahl Expressions + short nDim; // Anzahl Dimensionen + BOOL bError; // TRUE: Fehler + BOOL bBracket; // TRUE: Klammern +public: + SbiExprList( SbiParser* ); + virtual ~SbiExprList(); + BOOL IsBracket() { return bBracket; } + BOOL IsValid() { return BOOL( !bError ); } + short GetSize() { return nExpr; } + short GetDims() { return nDim; } + SbiExpression* Get( short ); + BOOL Test( const SbiProcDef& ); // Parameter-Checks + void Gen(); // Code-Erzeugung + // Setzen einer Funktionsdefinition zum Abgleich der Parameter + void SetProc( SbiProcDef* p ) { pProc = p; } +}; + +class SbiParameters : public SbiExprList { +public: + SbiParameters( SbiParser*, BOOL bConst = FALSE, BOOL bPar = TRUE);// parsender Ctor +}; + +class SbiDimList : public SbiExprList { + BOOL bConst; // TRUE: Alles sind Integer-Konstanten +public: + SbiDimList( SbiParser* ); // Parsender Ctor + BOOL IsConstant() { return bConst; } +}; + +#endif diff --git a/basic/source/inc/filefmt.hxx b/basic/source/inc/filefmt.hxx new file mode 100644 index 000000000000..777688a1935e --- /dev/null +++ b/basic/source/inc/filefmt.hxx @@ -0,0 +1,207 @@ +/************************************************************************* + * + * $RCSfile: filefmt.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _SB_FILEFMT_HXX +#define _SB_FILEFMT_HXX + +#ifndef _SOLAR_H +#include <tools/solar.h> +#endif + +class SvStream; + +// Version 2: Datentyp des Returnwerts fuer Publics +// Version 3: neue Opcodes +// Version 4: neue Opcodes +// Version 5: Bug (Ansprung von STATIC-Variablen im Init-Code) +// Version 6: Neue Opcodes und Bug (Globals anlegen, ohne BASIC zu beenden) +// Version 7: Korrektur im WITH-Parsing +// Version 8: Korrektur im IF-Parsing +// Version 9: Init-Code auch mit LEAVE beenden, wenn keine SUB/FUNCTION folgt +// Version A: #36374 Bei DIM AS NEW... auch Variablen anlegen +// Version B: #40689 Static umgestellt +// Version C: #41606 Bug bei Static +// Version D: #42678 Bug bei RTL-Function spc +// Version E: #56204 DCREATE, um auch bei DIM AS NEW Arrays anzulegen +// Version F: #57844 Einfuehrung von SvNumberformat::StringToDouble +// Version 10: #29955 For-Schleifen-Level in Statement-PCodes generieren +// Version 11: #29955 Wegen Build-Inkonsistenzen Neu-Compilieren erzwingen + +#define B_CURVERSION 0x00000011L + +// Eine Datei enthaelt entweder einen Modul- oder einen Library-Record. +// Diese Records enthalten wiederum weitere Records. Jeder Record hat +// den folgenden Header: + +// UINT16 Kennung +// UINT32 Laenge des Records ohne Header +// UINT16 Anzahl Unterelemente + +// Alle Datei-Offsets in Records sind relativ zum Start des Moduls! + +#define B_LIBRARY 0x4C42 // BL Library Record +#define B_MODULE 0x4D42 // BM Module Record +#define B_NAME 0x4E4D // MN module name +#define B_COMMENT 0x434D // MC comment +#define B_SOURCE 0x4353 // SC source code +#define B_PCODE 0x4350 // PC p-code +#define B_OLDPUBLICS 0x7550 // Pu publics +#define B_PUBLICS 0x5550 // PU publics +#define B_POOLDIR 0x4450 // PD symbol pool directory +#define B_SYMPOOL 0x5953 // SY symbol pool +#define B_STRINGPOOL 0x5453 // ST symbol pool +#define B_LINERANGES 0x524C // LR line ranges for publics +#define B_MODEND 0x454D // ME module end +#define B_SBXOBJECTS 0x5853 // SX SBX objects + +// Ein Library Record enthaelt nur Module Records +// UINT16 Kennung BL +// UINT32 Laenge des Records +// UINT16 Anzahl Module + +// Ein Modul-Record enthaelt alle anderen Recordtypen +// UINT16 Kennung BM +// UINT32 Laenge des Records +// UINT16 1 +// Daten: +// UINT32 Versionsnummer +// UINT32 Zeichensatz +// UINT32 Startadresse Initialisierungscode +// UINT32 Startadresse Sub Main +// UINT32 Reserviert +// UINT32 Reserviert + +// Modulname, Kommentar und Quellcode: +// UINT16 Kennung MN, MC oder SC +// UINT32 Laenge des Records +// UINT16 1 +// Daten: +// String-Instanz + +// P-Code: +// UINT16 Kennung PC +// UINT32 Laenge des Records +// UINT16 1 +// Daten: +// Der P-Code als Bytesack + +// Alle Symbole und Strings werden in einem String-Pool gehalten. +// Verweise auf diese Strings sind in Form eines Indexes in diesen Pool. + +// Liste aller Publics: +// UINT16 Kennung PU oder Pu +// UINT32 Laenge des Records +// UINT16 Anzahl der Publics +// Daten fuer jeden Public-Eintrag: +// UINT16 String-Index +// UINT32 Startadresse im P-Code-Image (UINT16 fuer alte Publics) +// UINT16 Datentyp des Returnwertes (ab Version 2) + +// Verzeichnis der Symbol-Tabellen: +// UINT16 Kennung SP +// UINT32 Laenge des Records +// UINT16 Anzahl der Symboltabellen +// Daten fuer jede Symboltabelle: +// UINT16 Stringindex des Namens +// UINT16 Anzahl Symbole +// UINT16 Scope-Kennung + +// Symboltabelle: +// UINT16 Kennung SY +// UINT32 Laenge des Records +// UINT16 Anzahl der Symbole +// Daten: +// UINT16 Stringindex des Namens +// UINT16 Anzahl Symbole +// Daten fuer jedes Symbol: +// UINT16 Stringindex des Namens +// UINT16 Datentyp +// UINT16 Laenge bei STRING*n-Symbolen (0x8000: STATIC-Variable) + +// Stringpool: +// UINT16 Kennung ST +// UINT32 Laenge des Records +// UINT16 Anzahl der Strings +// Daten fuer jeden String: +// UINT32 Offset in den Block aller Strings +// Danach folgt der Block aller Strings, die dort als ASCIIZ-Strings liegen. + +// Line Ranges: +// UINT16 Kennung LR +// UINT32 Laenge des Records +// UINT16 Anzahl der Strings +// Daten fuer jedes Public: +// UINT16 1. Zeile (Sub XXX) +// UINT16 2. Zeile (End Sub) + +// SBX-Objekte: +// UINT16 Anzahl Objekte +// .... Objektdaten + +//////////////////////////////////////////////////////////////////////////// + +// Service-Routinen (in IMAGE.CXX) + +BOOL SbGood( SvStream& r ); +ULONG SbOpenRecord( SvStream&, UINT16 nSignature, UINT16 nElem ); +void SbCloseRecord( SvStream&, ULONG ); + +#endif diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx new file mode 100644 index 000000000000..5573d97213c3 --- /dev/null +++ b/basic/source/inc/image.hxx @@ -0,0 +1,123 @@ +/************************************************************************* + * + * $RCSfile: image.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _SBIMAGE_HXX +#define _SBIMAGE_HXX + +#include "sbintern.hxx" + +// Diese Klasse liest das vom Compiler erzeugte Image ein und verwaltet +// den Zugriff auf die einzelnen Elemente. + +struct SbPublicEntry; + +class SbiImage { + friend class SbiCodeGen; // Compiler-Klassen, die die private- + + SbxArrayRef rTypes; // + UINT16* pStringOff; // StringId-Offsets + sal_Unicode* pStrings; // StringPool + char* pCode; // Code-Image + BOOL bError; // TRUE: Fehler + USHORT nFlags; // Flags (s.u.) + short nStrings; // Anzahl Strings + UINT16 nStringSize; // Groesse des String-Puffers + UINT16 nCodeSize; // Groesse des Code-Blocks + UINT16 nDimBase; // OPTION BASE-Wert + rtl_TextEncoding eCharSet; // Zeichensatz fuer Strings + // temporaere Verwaltungs-Variable: + short nStringIdx; // aktueller String-Index + UINT16 nStringOff; // aktuelle Pos im Stringpuffer + // Routinen fuer Compiler: + void MakeStrings( short ); // StringPool einrichten + void AddString( const String& );// String zufuegen + void AddCode( char*, USHORT ); // Codeblock dazu + void AddType(SbxObject *); // User-Type mit aufnehmen + +public: + String aName; // Makroname + String aSource; // Quellcode + String aComment; // Kommentar + BOOL bInit; // TRUE: Init-Code ist gelaufen + SbiImage(); + ~SbiImage(); + void Clear(); // Inhalt loeschen + BOOL Load( SvStream& ); + BOOL Save( SvStream& ); + BOOL IsError() { return bError; } + + const char* GetCode() const { return pCode; } + USHORT GetCodeSize() const { return nCodeSize; } + String& GetSource() { return aSource; } + USHORT GetBase() const { return nDimBase; } + String GetString( short nId ) const; + //const char* GetString( short nId ) const; + const SbxObject* FindType (String aTypeName) const; + + void SetFlag( USHORT n ) { nFlags |= n; } + USHORT GetFlag( USHORT n ) const { return nFlags & n; } +}; + +#define SBIMG_EXPLICIT 0x0001 // OPTION EXPLICIT ist aktiv +#define SBIMG_COMPARETEXT 0x0002 // OPTION COMPARE TEXT ist aktiv +#define SBIMG_INITCODE 0x0004 // Init-Code vorhanden + +#endif diff --git a/basic/source/inc/iosys.hxx b/basic/source/inc/iosys.hxx new file mode 100644 index 000000000000..ff0a41e3ace5 --- /dev/null +++ b/basic/source/inc/iosys.hxx @@ -0,0 +1,149 @@ +/************************************************************************* + * + * $RCSfile: iosys.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _SBIOSYS_HXX +#define _SBIOSYS_HXX + +#ifndef _STREAM_HXX //autogen +#include <tools/stream.hxx> +#endif +#ifndef _SBERRORS_HXX +#include "sberrors.hxx" +#endif + +class SvStream; + +// Zur Zeit sind globale Dateien (Kanalnummern 256 bis 511) +// nicht implementiert. + +#define CHANNELS 256 +#define CONSOLE 0 + +#define SBSTRM_INPUT 0x0001 // Input +#define SBSTRM_OUTPUT 0x0002 // Output +#define SBSTRM_RANDOM 0x0004 // Random +#define SBSTRM_APPEND 0x0008 // Append +#define SBSTRM_BINARY 0x0010 // Binary + +class SbiStream { + SvStream* pStrm; // der Stream + ULONG nExpandOnWriteTo; // bei Schreibzugriff, den Stream + // bis zu dieser Groesse aufblasen + ByteString aLine; // aktuelle Zeile + ULONG nLine; // aktuelle Zeilennummer + short nLen; // Pufferlaenge + short nMode; // Bits: + short nChan; // aktueller Kanal + SbError nError; // letzter Fehlercode + void MapError(); // Fehlercode mappen + +public: + SbiStream(); + ~SbiStream(); + SbError Open( short, const ByteString&, short, short, short ); + SbError Close(); + SbError Read( ByteString&, USHORT = 0 ); + SbError Read( char& ); + SbError Write( const ByteString&, USHORT = 0 ); + + BOOL IsText() const { return !(nMode & SBSTRM_BINARY); } + BOOL IsRandom() const { return (nMode & SBSTRM_RANDOM); } + BOOL IsBinary() const { return (nMode & SBSTRM_BINARY); } + BOOL IsSeq() const { return !(nMode & SBSTRM_RANDOM); } + BOOL IsAppend() const { return (nMode & SBSTRM_APPEND); } + short GetBlockLen() const { return nLen; } + short GetMode() const { return nMode; } + ULONG GetLine() const { return nLine; } + void SetExpandOnWriteTo( ULONG n ) { nExpandOnWriteTo = n; } + void ExpandFile(); + SvStream* GetStrm() { return pStrm; } +}; + +class SbiIoSystem { + SbiStream* pChan[ CHANNELS ]; + ByteString aPrompt; // Input-Prompt + ByteString aIn, aOut; // Console-Buffer + short nChan; // aktueller Kanal + SbError nError; // letzter Fehlercode + void ReadCon( ByteString& ); + void WriteCon( const ByteString& ); +public: + SbiIoSystem(); + ~SbiIoSystem(); + SbError GetError(); + void Shutdown(); + void SetPrompt( const ByteString& r ) { aPrompt = r; } + void SetChannel( short n ) { nChan = n; } + short GetChannel() const { return nChan;} + void ResetChannel() { nChan = 0; } + void Open( short, const ByteString&, short, short, short ); + void Close(); + void Read( ByteString&, short = 0 ); + char Read(); + void Write( const ByteString&, short = 0 ); + short NextChannel(); + // 0 == bad channel or no SvStream (nChannel=0..CHANNELS-1) + SbiStream* GetStream( short nChannel ) const; + void CloseAll(); // JSM +}; + +#endif + diff --git a/basic/source/inc/object.hxx b/basic/source/inc/object.hxx new file mode 100644 index 000000000000..e96d51dbe56f --- /dev/null +++ b/basic/source/inc/object.hxx @@ -0,0 +1,137 @@ +/************************************************************************* + * + * $RCSfile: object.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _SAMPLE_OBJECT_HXX +#define _SAMPLE_OBJECT_HXX + +#ifndef __SBX_SBX_FACTORY_HXX //autogen +#include <svtools/sbxfac.hxx> +#endif +#ifndef __SBX_SBXVARIABLE_HXX //autogen +#include <svtools/sbxvar.hxx> +#endif +#ifndef _SBX_SBXOBJECT_HXX //autogen +#include <svtools/sbxobj.hxx> +#endif + +// 1) Properties: +// Name der Name, R/O +// Value ein double-Wert, R/W +// 2) Methoden: +// Display Ausgabe eines Textes +// Square Argument * Argument +// Event Aufruf eines Basic-Programms +// 3) Unterobjekte: +// eine Collection names "Elements". Der Zugriff ist sowohl als +// Property (fuer das gesamte Objekt) als auch als Methode (fuer +// einzelne Elemente, wird durchgereicht) implementiert. +// Diese Implementation ist ein Beispiel fuer eine tabellengesteuerte +// Version, die sehr viele Elemente enthalten kann. +// Die Collection findet sich in COLLECTN.*, die in der Collection +// enthaltenen Objekte in COLLELEM.* + +class SampleObject : public SbxObject +{ + // Definition eines Tabelleneintrags. Dies wird hier gemacht, + // da dadurch die Methoden und Properties als private deklariert + // werden koennen. +#if defined ( ICC ) || defined ( HPUX ) || defined ( C50 ) +public: +#endif + typedef void( SampleObject::*pMeth ) + ( SbxVariable* pThis, SbxArray* pArgs, BOOL bWrite ); +#if defined ( ICC ) || defined ( HPUX ) +private: +#endif + + struct Methods { + const char* pName; // Name des Eintrags + SbxDataType eType; // Datentyp + short nArgs; // Argumente und Flags + pMeth pFunc; // Function Pointer + }; + static Methods aMethods[]; // Methodentabelle + + // Methoden + void Display( SbxVariable*, SbxArray*, BOOL ); + void Event( SbxVariable*, SbxArray*, BOOL ); + void Square( SbxVariable*, SbxArray*, BOOL ); + void Create( SbxVariable*, SbxArray*, BOOL ); + // Infoblock auffuellen + SbxInfo* GetInfo( short nIdx ); + // Broadcaster Notification + virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ); +public: + SampleObject( const String& ); + // Suchen eines Elements + virtual SbxVariable* Find( const String&, SbxClassType ); +}; + +// Die dazugehoerige Factory: + +class SampleObjectFac : public SbxFactory +{ +public: + virtual SbxObject* CreateObject( const String& ); +}; + +#endif diff --git a/basic/source/inc/opcodes.hxx b/basic/source/inc/opcodes.hxx new file mode 100644 index 000000000000..21f3fa6caeb3 --- /dev/null +++ b/basic/source/inc/opcodes.hxx @@ -0,0 +1,191 @@ +/************************************************************************* + * + * $RCSfile: opcodes.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _OPCODES_HXX +#define _OPCODES_HXX + +#include "sbintern.hxx" + +#ifdef MTW +#undef _NUMBER +#endif + +// Ein Opcode ist entweder 1, 3 oder 5 Bytes lang, je nach numerischen +// Wert des Opcodes (s.u.). + +enum SbiOpcode { + // Alle Opcodes ohne Operanden + _NOP = 0, + + SbOP0_START = _NOP, + + // Operatoren + // die folgenden Operatoren sind genauso angeordnet + // wie der enum SbxVarOp + _EXP, _MUL, _DIV, _MOD, _PLUS, _MINUS, _NEG, + _EQ, _NE, _LT, _GT, _LE, _GE, + _IDIV, _AND, _OR, _XOR, _EQV, _IMP, _NOT, + _CAT, + // Ende enum SbxVarOp + _LIKE, _IS, + // Laden/speichern + _ARGC, // neuen Argv einrichten + _ARGV, // TOS ==> aktueller Argv + _INPUT, // Input ==> TOS + _LINPUT, // Line Input ==> TOS + _GET, // TOS anfassen + _SET, // Speichern Objekt TOS ==> TOS-1 + _PUT, // TOS ==> TOS-1 + _PUTC, // TOS ==> TOS-1, dann ReadOnly + _DIM, // DIM + _REDIM, // REDIM + _REDIMP, // REDIM PRESERVE + _ERASE, // TOS loeschen + // Verzweigen + _STOP, // Programmende + _INITFOR, // FOR-Variable initialisieren + _NEXT, // FOR-Variable inkrementieren + _CASE, // Anfang CASE + _ENDCASE, // Ende CASE + _STDERROR, // Standard-Fehlerbehandlung + _NOERROR, // keine Fehlerbehandlung + _LEAVE, // UP verlassen + // E/A + _CHANNEL, // TOS = Kanalnummer + _BPRINT, // print TOS + _PRINTF, // print TOS in field + _BWRITE, // write TOS + _RENAME, // Rename Tos+1 to Tos + _PROMPT, // TOS = Prompt for Input + _RESTART, // Restartpunkt definieren + _CHAN0, // I/O-Kanal 0 + // Sonstiges + _EMPTY, // Leeren Ausdruck auf Stack + _ERROR, // TOS = Fehlercode + _LSET, // Speichern Objekt TOS ==> TOS-1 + _RSET, // Speichern Objekt TOS ==> TOS-1 + SbOP0_END, + + // Alle Opcodes mit einem Operanden + + _NUMBER = 0x40, // Laden einer numerischen Konstanten (+ID) + + SbOP1_START = _NUMBER, + + _SCONST, // Laden einer Stringkonstanten (+ID) + _CONST, // Immediate Load (+Wert) + _ARGN, // Speichern eines named Args in Argv (+StringID) + _PAD, // String auf feste Laenge bringen (+Laenge) + // Verzweigungen + _JUMP, // Sprung (+Target) + _JUMPT, // TOS auswerten, bedingter Sprung (+Target) + _JUMPF, // TOS auswerten, bedingter Sprung (+Target) + _ONJUMP, // TOS auswerten, Sprung in JUMP-Tabelle (+MaxVal) + _GOSUB, // UP-Aufruf (+Target) + _RETURN, // UP-Return (+0 oder Target) + _TESTFOR, // FOR-Variable testen, inkrementieren (+Endlabel) + _CASETO, // Tos+1 <= Case <= Tos, 2xremove (+Target) + _ERRHDL, // Fehler-Handler (+Offset) + _RESUME, // Resume nach Fehlern (+0 or 1 or Label) + // E/A + _CLOSE, // (+Kanal/0) + _PRCHAR, // (+char) + // Verwaltung + _CLASS, // Klassennamen testen (+StringId) + _LIB, // Libnamen fuer Declare-Procs setzen (+StringId) + _BASED, // TOS wird um BASE erhoeht, BASE davor gepusht (+base) + // Typanpassung im Argv + _ARGTYP, // Letzten Parameter in Argv konvertieren (+Typ) + + SbOP1_END, + + // Alle Opcodes mit zwei Operanden + + _RTL = 0x80, // Laden aus RTL (+StringID+Typ) + + SbOP2_START = _RTL, + + _FIND, // Laden (+StringID+Typ) + _ELEM, // Laden Element (+StringID+Typ) + _PARAM, // Parameter (+Offset+Typ) + // Verzweigen + _CALL, // DECLARE-Methode rufen (+StringID+Typ) + _CALLC, // Cdecl-DECLARE-Methode rufen (+StringID+Typ) + _CASEIS, // Case-Test (+Test-Opcode+True-Target) + // Verwaltung + _STMNT, // Beginn eines Statements (+Line+Col) + // E/A + _OPEN, // (+SvStreamFlags+Flags) + // Objekte + _LOCAL, // Lokale Variable definieren (+StringID+Typ) + _PUBLIC, // Modulglobale Variable (+StringID+Typ) + _GLOBAL, // Globale Variable definieren (+StringID+Typ) + _CREATE, // Objekt kreieren (+StringId+StringID) + _STATIC, // Statische Variabl (+StringID+Typ) JSM + _TCREATE, // User Defined Objekt kreieren + _DCREATE, // Objekt-Array kreieren (+StringId+StringID) + SbOP2_END + +}; + + + +#endif diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx new file mode 100644 index 000000000000..c99c587e55b7 --- /dev/null +++ b/basic/source/inc/parser.hxx @@ -0,0 +1,192 @@ +/************************************************************************* + * + * $RCSfile: parser.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _PARSER_HXX +#define _PARSER_HXX + +#ifndef _EXPR_HXX +#include "expr.hxx" +#endif +#ifndef _CODEGEN_HXX +#include "codegen.hxx" +#endif +#ifndef _SYMTBL_HXX +#include "symtbl.hxx" +#endif + + +struct SbiParseStack; + +class SbiParser : public SbiTokenizer +{ + SbiParseStack* pStack; // Block-Stack + SbiProcDef* pProc; // aktuelle Prozedur + SbiExprNode* pWithVar; // aktuelle With-Variable + SbiToken eEndTok; // das Ende-Token + USHORT nGblChain; // Chainkette fuer globale DIMs + BOOL bGblDefs; // TRUE globale Definitionen allgemein + BOOL bNewGblDefs; // TRUE globale Definitionen vor Sub + BOOL bSingleLineIf; // TRUE einzeiliges if-Statement + + SbiSymDef* VarDecl( SbiDimList**,BOOL,BOOL );// Variablen-Deklaration + SbiProcDef* ProcDecl(BOOL bDecl);// Prozedur-Deklaration + void DefProc( BOOL bStatic ); // Prozedur einlesen + void DefVar( SbiOpcode eOp, BOOL bStatic ); // DIM/REDIM einlesen + void TypeDecl( SbiSymDef& ); // AS-Deklaration + void OpenBlock( SbiToken, SbiExprNode* = NULL ); // Block oeffnen + void CloseBlock(); // Block aufloesen + BOOL Channel( BOOL=FALSE ); // Kanalnummer parsen + void StmntBlock( SbiToken ); // Statement-Block abarbeiten + +public: + SbxArrayRef rTypeArray; // das Type-Array + SbiStringPool aGblStrings; // der String-Pool + SbiStringPool aLclStrings; // der String-Pool + SbiSymPool aGlobals; // globale Variable + SbiSymPool aPublics; // modulglobale Variable + SbiSymPool aRtlSyms; // Runtime-Library + SbiCodeGen aGen; // Code-Generator + StarBASIC* pBasic; // StarBASIC-Instanz + SbiSymPool* pPool; // aktueller Pool + SbiExprType eCurExpr; // aktueller Expr-Typ + short nBase; // OPTION BASE-Wert + BOOL bText; // OPTION COMPARE TEXT + BOOL bExplicit; // TRUE: OPTION EXPLICIT + SbxDataType eDefTypes[26]; // DEFxxx-Datentypen + + SbiParser( StarBASIC*, SbModule* ); + BOOL Parse(); // die Aktion + SbiExprNode* GetWithVar(); // Innerste With-Variable liefern + + // AB 31.3.1996, Symbol in Runtime-Library suchen + SbiSymDef* CheckRTLForSym( const String& rSym, SbxDataType eType ); + + BOOL HasGlobalCode(); // Globaler Code definiert? + + BOOL TestToken( SbiToken ); // bestimmtes TOken? + BOOL TestSymbol( BOOL=FALSE ); // Symbol? + BOOL TestComma(); // Komma oder EOLN? + void TestEoln(); // EOLN? + + void Symbol(); // Let oder Call + void ErrorStmnt(); // ERROR n + void NotImp(); // nicht implementiert + void BadBlock(); // LOOP/WEND/NEXT + void BadSyntax(); // Falsches SbiToken + void NoIf(); // ELSE/ELSE IF ohne IF + void Assign(); // LET + void Call(); // CALL + void Close(); // CLOSE + void Declare(); // DECLARE + void DefXXX(); // DEFxxx + void Dim(); // DIM + void ReDim(); // ReDim(); + void Erase(); // ERASE + void Exit(); // EXIT + void For(); // FOR...NEXT + void Goto(); // GOTO / GOSUB + void If(); // IF + void Input(); // INPUT, INPUT # + void LineInput(); // LINE INPUT, LINE INPUT # + void LSet(); // LSET + void Name(); // NAME .. AS .. + void On(); // ON ERROR/variable + void OnGoto(); // ON...GOTO / GOSUB + void Open(); // OPEN + void Option(); // OPTION + void Print(); // PRINT, PRINT # + void SubFunc(); // SUB / FUNCTION + void Resume(); // RESUME + void Return(); // RETURN + void RSet(); // RSET + void DoLoop(); // DO...LOOP + void Select(); // SELECT ... CASE + void Set(); // SET + void Static(); // STATIC + void Stop(); // STOP/SYSTEM + void Type(); // TYPE...AS...END TYPE + void While(); // WHILE/WEND + void With(); // WITH + void Write(); // WRITE + + // JavaScript-Parsing + void OpenJavaBlock( SbiToken, SbiExprNode* = NULL ); // Block oeffnen + void CloseJavaBlock(); // Block aufloesen + void JavaStmntBlock( SbiToken ); // Statement-Block abarbeiten + void JavaBreak(); + void JavaContinue(); + void JavaFor(); + void JavaFunction(); + void JavaIf(); + void JavaNew(); + void JavaReturn(); + void JavaThis(); + void JavaVar(); + void JavaWhile(); + void JavaWith(); +}; + + + + + + +#endif diff --git a/basic/source/inc/propacc.hxx b/basic/source/inc/propacc.hxx new file mode 100644 index 000000000000..9833747cde30 --- /dev/null +++ b/basic/source/inc/propacc.hxx @@ -0,0 +1,235 @@ +/************************************************************************* + * + * $RCSfile: propacc.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:10 $ + * + * 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 _SFX_PROPBAG_HXX +#define _SFX_PROPBAG_HXX + +#ifndef _SVARRAY_HXX +#include <svtools/svarray.hxx> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HXX_ +#include <com/sun/star/beans/PropertyValue.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HXX_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HXX_ +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HXX_ +#include <com/sun/star/beans/XPropertyAccess.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HXX_ +#include <com/sun/star/beans/XPropertyContainer.hpp> +#endif + +#ifndef _CPPUHELPER_IMPLBASE1_HXX_ +#include <cppuhelper/implbase1.hxx> +#endif +#ifndef _CPPUHELPER_IMPLBASE2_HXX_ +#include <cppuhelper/implbase2.hxx> +#endif + +#define NS_BEANS ::com::sun::star::beans +#define NS_LANG ::com::sun::star::lang +#define NS_UNO ::com::sun::star::uno + +typedef NS_BEANS::PropertyValue* SbPropertyValuePtr; +SV_DECL_PTRARR( SbPropertyValueArr_Impl, SbPropertyValuePtr, 4, 4 ); + +typedef ::cppu::WeakImplHelper2< NS_BEANS::XPropertySet, + NS_BEANS::XPropertyAccess > SbPropertyValuesHelper; + + +//========================================================================== + +class SbPropertyValues: public SbPropertyValuesHelper +{ + SbPropertyValueArr_Impl _aPropVals; + NS_UNO::Reference< ::com::sun::star::beans::XPropertySetInfo > _xInfo; + +private: + INT32 GetIndex_Impl( const ::rtl::OUString &rPropName ) const; + +public: + SbPropertyValues(); + virtual ~SbPropertyValues(); + + // XPropertySet + virtual NS_UNO::Reference< NS_BEANS::XPropertySetInfo > SAL_CALL + getPropertySetInfo(void) throw( NS_UNO::RuntimeException ); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& aPropertyName, + const NS_UNO::Any& aValue); + virtual NS_UNO::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( NS_BEANS::UnknownPropertyException, + NS_LANG::WrappedTargetException, + NS_UNO::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& aPropertyName, + const NS_UNO::Reference< NS_BEANS::XPropertyChangeListener >& ); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& aPropertyName, + const NS_UNO::Reference< NS_BEANS::XPropertyChangeListener >& ); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& aPropertyName, + const NS_UNO::Reference< NS_BEANS::XVetoableChangeListener >& ); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& aPropertyName, + const NS_UNO::Reference< NS_BEANS::XVetoableChangeListener >& ); + + // XPropertyAccess + virtual NS_UNO::Sequence< NS_BEANS::PropertyValue > SAL_CALL getPropertyValues(void); + virtual void SAL_CALL setPropertyValues(const NS_UNO::Sequence< NS_BEANS::PropertyValue >& PropertyValues_); +}; + +//========================================================================== + +typedef ::cppu::WeakImplHelper1< NS_BEANS::XPropertySetInfo > SbPropertySetInfoHelper; + +// AB 20.3.2000 Help Class for XPropertySetInfo implementation +class PropertySetInfoImpl +{ + friend class SbPropertySetInfo; + friend class SbPropertyContainer; + + NS_UNO::Sequence< NS_BEANS::Property > _aProps; + + sal_Int32 GetIndex_Impl( const ::rtl::OUString &rPropName ) const; + +public: + PropertySetInfoImpl(); + PropertySetInfoImpl( NS_UNO::Sequence< NS_BEANS::Property >& rProps ); + + // XPropertySetInfo + NS_UNO::Sequence< NS_BEANS::Property > SAL_CALL getProperties(void); + NS_BEANS::Property SAL_CALL getPropertyByName(const ::rtl::OUString& Name) + throw( NS_UNO::RuntimeException ); + sal_Bool SAL_CALL hasPropertyByName(const ::rtl::OUString& Name) + throw ( NS_UNO::RuntimeException ); +}; + +class SbPropertySetInfo: public SbPropertySetInfoHelper +{ + PropertySetInfoImpl aImpl; + +public: + SbPropertySetInfo(); + SbPropertySetInfo( const SbPropertyValueArr_Impl &rPropVals ); + virtual ~SbPropertySetInfo(); + + // XPropertySetInfo + virtual NS_UNO::Sequence< NS_BEANS::Property > SAL_CALL getProperties(void) + throw( NS_UNO::RuntimeException ); + virtual NS_BEANS::Property SAL_CALL getPropertyByName(const ::rtl::OUString& Name) + throw( NS_UNO::RuntimeException ); + virtual sal_Bool SAL_CALL hasPropertyByName(const ::rtl::OUString& Name) + throw( NS_UNO::RuntimeException ); +}; + +//========================================================================== + +typedef ::cppu::WeakImplHelper2< NS_BEANS::XPropertySetInfo, NS_BEANS::XPropertyContainer > SbPropertyContainerHelper; + +class SbPropertyContainer: public SbPropertyContainerHelper +{ + PropertySetInfoImpl aImpl; + +public: + SbPropertyContainer(); + virtual ~SbPropertyContainer(); + + // XPropertyContainer + virtual void SAL_CALL addProperty( const ::rtl::OUString& Name, + INT16 Attributes, + const NS_UNO::Any& DefaultValue) + throw( NS_BEANS::PropertyExistException, NS_BEANS::IllegalTypeException, + NS_LANG::IllegalArgumentException, NS_UNO::RuntimeException ); + virtual void SAL_CALL removeProperty(const ::rtl::OUString& Name) + throw( NS_BEANS::UnknownPropertyException, NS_UNO::RuntimeException ); + + // XPropertySetInfo + virtual NS_UNO::Sequence< NS_BEANS::Property > SAL_CALL getProperties(void); + virtual NS_BEANS::Property SAL_CALL getPropertyByName(const ::rtl::OUString& Name) + throw( NS_UNO::RuntimeException ); + virtual sal_Bool SAL_CALL hasPropertyByName(const ::rtl::OUString& Name) + throw( NS_UNO::RuntimeException ); + + // XPropertyAccess + virtual NS_UNO::Sequence< NS_BEANS::PropertyValue > SAL_CALL getPropertyValues(void); + virtual void SAL_CALL setPropertyValues(const NS_UNO::Sequence< NS_BEANS::PropertyValue >& PropertyValues_); +}; + +//========================================================================= + +class StarBASIC; +class SbxArray; + +void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); + + +#undef NS_BEANS +#undef NS_LANG +#undef NS_UNO + + + +#endif + diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx new file mode 100644 index 000000000000..904224620b83 --- /dev/null +++ b/basic/source/inc/runtime.hxx @@ -0,0 +1,473 @@ +/************************************************************************* + * + * $RCSfile: runtime.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SBRUNTIME_HXX +#define _SBRUNTIME_HXX + +#include "sb.hxx" + +// Define activates class UCBStream in iosys.cxx +#define _USE_UNO + +#ifdef _USE_UNO +#include <rtl/ustring> +#include <com/sun/star/uno/Sequence.hxx> + +using namespace rtl; +using namespace com::sun::star::uno; + + +//#include <sal/types.h> +//#include <rtl/byteseq.hxx> +//#include <rtl/ustring> + + +namespace basicEncoder +{ + +// TODO: Use exported functionality (code is copied from deamons2/ucb) +class AsciiEncoder +{ +public: + static ::rtl::OUString decodeUnoUrlParamValue(const rtl::OUString & rSource); + //static ::rtl::OUString encodeUnoUrlParamValue(const rtl::OUString & rSource); + //static ::rtl::ByteSequence decode(const ::rtl::OUString & string); + //static ::rtl::OUString encode(const ::rtl::ByteSequence & bytes); + //static void test(); +}; + +} + +#endif /* _USE_UNO */ + +class SbiInstance; // aktiver StarBASIC-Prozess +class SbiRuntime; // aktive StarBASIC-Prozedur-Instanz + +struct SbiArgvStack; // Argv stack element +struct SbiGosubStack; // GOSUB stack element +class SbiImage; // Code-Image +class SbiIoSystem; // Dateisystem +class SbiDdeControl; // DDE-Steuerung +class SbiDllMgr; // Aufrufe in DLLs +class SvNumberFormatter; // Zeit/Datumsfunktionen + +struct SbiForStack { // for/next stack: + SbiForStack* pNext; // Chain + SbxVariableRef refVar; // loop variable + SbxVariableRef refEnd; // end expression + SbxVariableRef refInc; // increment expression +}; + +#define MAXRECURSION 500 // max. 500 Rekursionen + +#define Sb_ATTR_NORMAL 0x0000 +#define Sb_ATTR_HIDDEN 0x0002 +#define Sb_ATTR_SYSTEM 0x0004 +#define Sb_ATTR_VOLUME 0x0008 +#define Sb_ATTR_DIRECTORY 0x0010 +#define Sb_ATTR_ARCHIVE 0x0020 + + +class Dir; + +class SbiRTLData +{ +public: + Dir* pDir; + INT16 nDirFlags; + USHORT nCurDirPos; +#ifdef _USE_UNO + Sequence< OUString > aDirSeq; +#endif /* _USE_UNO */ + + SbiRTLData(); + ~SbiRTLData(); +}; + +// Die Instanz entspricht einem laufenden StarBASIC. Mehrere gleichzeitig +// laufende BASICs werden ueber verkettete Instanzen verwaltet. Hier liegen +// alle Daten, die nur leben, wenn BASIC auch lebt, wie z.B. das I/O-System. + +class SbiInstance +{ + friend class SbiRuntime; + + SbiRTLData aRTLData; + + SbiIoSystem* pIosys; // Dateisystem + SbiDdeControl* pDdeCtrl; // DDE + SbiDllMgr* pDllMgr; // DLL-Calls (DECLARE) + StarBASIC* pBasic; + SvNumberFormatter* pNumberFormatter; + ULONG nStdDateIdx, nStdTimeIdx, nStdDateTimeIdx; + + SbError nErr; // aktueller Fehlercode + String aErrorMsg; // letzte Error-Message fuer $ARG + USHORT nErl; // aktuelle Fehlerzeile + BOOL bReschedule; // Flag: TRUE = Reschedule in Hauptschleife + +public: + SbiRuntime* pRun; // Call-Stack + SbiInstance* pNext; // Instanzen-Chain + + // #31460 Neues Konzept fuer StepInto/Over/Out, + // Erklaerung siehe runtime.cxx bei SbiInstance::CalcBreakCallLevel() + USHORT nCallLvl; // Call-Level (wg. Rekursion) + USHORT nBreakCallLvl; // Call-Level zum Anhalten + void CalcBreakCallLevel( USHORT nFlags ); // Gemaess Flags setzen + + SbiInstance( StarBASIC* ); + ~SbiInstance(); + + void Error( SbError ); // trappable Error + void Error( SbError, const String& rMsg ); // trappable Error mit Message + void FatalError( SbError ); // non-trappable Error + void Abort(); // Abbruch mit aktuellem Fehlercode + + void Stop(); + SbError GetErr() { return nErr; } + String GetErrorMsg() { return aErrorMsg; } + xub_StrLen GetErl() { return nErl; } + void EnableReschedule( BOOL bEnable ) { bReschedule = bEnable; } + BOOL IsReschedule( void ) { return bReschedule; } + + SbMethod* GetCaller( USHORT ); + SbModule* GetActiveModule(); + SbxArray* GetLocals( SbMethod* ); + + SbiIoSystem* GetIoSystem() { return pIosys; } + SbiDdeControl* GetDdeControl() { return pDdeCtrl; } + SbiDllMgr* GetDllMgr(); + SbiRTLData* GetRTLData() const { return (SbiRTLData*)&aRTLData; } + + SvNumberFormatter* GetNumberFormatter(); + ULONG GetStdDateIdx() const { return nStdDateIdx; } + ULONG GetStdTimeIdx() const { return nStdTimeIdx; } + ULONG GetStdDateTimeIdx() const { return nStdDateTimeIdx; } + + // #39629# NumberFormatter auch statisch anbieten + static void PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter, + ULONG &rnStdDateIdx, ULONG &rnStdTimeIdx, ULONG &rnStdDateTimeIdx ); +}; + +SbiIoSystem* SbGetIoSystem(); // das aktuelle I/O-System + + +// Verkettbare Items, um Referenzen temporaer zu halten +struct RefSaveItem +{ + SbxVariableRef xRef; + RefSaveItem* pNext; + + RefSaveItem() { pNext = NULL; } +}; + +// #72488 Spezielle SbxVariable, die beim get das Verhalten +// einer nicht initialisierten Variable simuliert. Wenn als +// Typ SbxOBJECT verlangt wird, geht das jedoch nicht. +class UnoClassSbxVariable : public SbxVariable +{ + SbxDataType meOrgType; + BOOL mbOverWritten; + const SbiImage* mpImg; + SbiRuntime* mpRuntime; + +public: + UnoClassSbxVariable( SbxDataType eType, const SbiImage* pImg_, SbiRuntime* pRuntime_ ) + : SbxVariable( SbxVARIANT ), mpImg( pImg_ ), mpRuntime( pRuntime_ ) + { + meOrgType = eType; + mbOverWritten = FALSE; + } + UnoClassSbxVariable( const UnoClassSbxVariable& r ) + : SbxVariable( r ), meOrgType( r.meOrgType), mbOverWritten( r.mbOverWritten), + mpImg( r.mpImg ), mpRuntime( r.mpRuntime ) + {} + + virtual BOOL Get( SbxValues& ) const; + virtual BOOL Put( const SbxValues& ); + + TYPEINFO(); +}; + +// #72732 Spezielle SbxVariable, die beim put/get prueft, +// ob der Kontext fuer eine UnoClass sinnvoll ist. Sonst +// liegt eventuell ein Schreibfehler im Basic-Source vor. +class UnoClassMemberVariable : public SbxVariable +{ + SbiRuntime* mpRuntime; + BOOL bInternalUse; + +public: + UnoClassMemberVariable( SbiRuntime* pRuntime_, const SbxObjectRef& xWrapper ) + : SbxVariable( SbxVARIANT ), mpRuntime( pRuntime_ ) + { + bInternalUse = TRUE; + PutObject( xWrapper ); + bInternalUse = FALSE; + } + + virtual BOOL Get( SbxValues& ) const; + virtual BOOL Put( const SbxValues& ); + + TYPEINFO(); +}; + + +// Eine Instanz dieser Klasse wird fuer jedes ausgefuehrte Unterprogramm +// aufgesetzt. Diese Instanz ist das Herz der BASIC-Maschine und enthaelt +// nur lokale Daten. + +class SbiRuntime +{ + typedef void( SbiRuntime::*pStep0 )(); + typedef void( SbiRuntime::*pStep1 )( USHORT nOp1 ); + typedef void( SbiRuntime::*pStep2 )( USHORT nOp1, USHORT nOp2 ); + static pStep0 aStep0[]; // Opcode-Tabelle Gruppe 0 + static pStep1 aStep1[]; // Opcode-Tabelle Gruppe 1 + static pStep2 aStep2[]; // Opcode-Tabelle Gruppe 2 + + StarBASIC& rBasic; // StarBASIC-Instanz + SbiInstance* pInst; // aktiver Thread + SbModule* pMod; // aktuelles Modul + SbMethod* pMeth; // Methoden-Instanz + SbiIoSystem* pIosys; // I/O-System + const SbiImage* pImg; // Code-Image + SbxArrayRef refExprStk; // expression stack + SbxArrayRef refCaseStk; // CASE expression stack + SbxVariableRef xDummyVar; // Ersatz fuer nicht gefundene Variablen + SbiArgvStack* pArgvStk; // ARGV-Stack + SbiGosubStack* pGosubStk; // GOSUB stack + SbiForStack* pForStk; // FOR/NEXT-Stack + USHORT nExprLvl; // Tiefe des Expr-Stacks + USHORT nGosubLvl; // Zum Vermeiden von Tot-Rekursionen + const BYTE* pCode; // aktueller Code-Pointer + const BYTE* pStmnt; // Beginn des lezten Statements + const BYTE* pError; // Adresse des aktuellen Error-Handlers + const BYTE* pRestart; // Restart-Adresse + const BYTE* pErrCode; // Restart-Adresse RESUME NEXT + const BYTE* pErrStmnt; // Restart-Adresse RESUMT 0 + String aLibName; // Lib-Name fuer Declare-Call + SbxArrayRef refParams; // aktuelle Prozedur-Parameter + SbxArrayRef refLocals; // lokale Variable + SbxArrayRef refArgv; // aktueller Argv + // AB, 28.3.2000 #74254, Ein refSaveObj reicht nicht! Neu: pRefSaveList (s.u.) + //SbxVariableRef refSaveObj; // #56368 Bei StepElem Referenz sichern + short nArgc; // aktueller Argc + BOOL bRun; // TRUE: Programm ist aktiv + BOOL bError; // TRUE: Fehler behandeln + BOOL bInError; // TRUE: in einem Fehler-Handler + USHORT nFlags; // Debugging-Flags + SbError nError; // letzter Fehler + USHORT nOps; // Opcode-Zaehler + + RefSaveItem* pRefSaveList; // #74254 Temporaere Referenzen sichern + RefSaveItem* pItemStoreList; // Unbenutzte Items aufbewahren + void SaveRef( SbxVariable* pVar ) + { + RefSaveItem* pItem = pItemStoreList; + if( pItem ) + pItemStoreList = pItem->pNext; + else + pItem = new RefSaveItem(); + pItem->pNext = pRefSaveList; + pItem->xRef = pVar; + pRefSaveList = pItem; + } + void ClearRefs( void ) + { + while( pRefSaveList ) + { + RefSaveItem* pToClearItem = pRefSaveList; + pRefSaveList = pToClearItem->pNext; + pToClearItem->xRef = NULL; + pToClearItem->pNext = pItemStoreList; + pItemStoreList = pToClearItem; + } + } + + SbxVariable* FindElement + ( SbxObject* pObj, USHORT nOp1, USHORT nOp2, SbError, BOOL ); + void SetupArgs( SbxVariable*, USHORT ); + SbxVariable* CheckArray( SbxVariable* ); + + void PushVar( SbxVariable* ); // Variable push + SbxVariableRef PopVar(); // Variable pop + SbxVariable* GetTOS( short=0 ); // Variable vom TOS holen + void TOSMakeTemp(); // TOS in temp. Variable wandeln + BOOL ClearExprStack(); // Expr-Stack freigeben + + void PushGosub( const BYTE* ); // GOSUB-Element push + void PopGosub(); // GOSUB-Element pop + void ClearGosubStack(); // GOSUB-Stack freigeben + + void PushArgv(); // Argv-Element push + void PopArgv(); // Argv-Element pop + void ClearArgvStack(); // Argv-Stack freigeben + + void PushFor(); // For-Element push + void PopFor(); // For-Element pop + void ClearForStack(); // For-Stack freigeben + + void StepArith( SbxOperator ); // arithmetische Verknuepfungen + void StepUnary( SbxOperator ); // unaere Verknuepfungen + void StepCompare( SbxOperator );// Vergleiche + + void SetParameters( SbxArray* );// Parameter uebernehmen + + // MUSS NOCH IMPLEMENTIERT WERDEN + void DllCall( const String&, const String&, SbxArray*, SbxDataType, BOOL ); + + // #56204 DIM-Funktionalitaet in Hilfsmethode auslagern (step0.cxx) + void DimImpl( SbxVariableRef refVar ); + + // Die nachfolgenden Routinen werden vom Single Stepper + // gerufen und implementieren die einzelnen Opcodes + void StepNOP(), StepEXP(), StepMUL(), StepDIV(); + void StepMOD(), StepPLUS(), StepMINUS(), StepNEG(); + void StepEQ(), StepNE(), StepLT(), StepGT(); + void StepLE(), StepGE(), StepIDIV(), StepAND(); + void StepOR(), StepXOR(), StepEQV(), StepIMP(); + void StepNOT(), StepCAT(), StepLIKE(), StepIS(); + void StepCLONE(), StepOLDBASED(), StepARGC(); + void StepARGV(), StepINPUT(), StepLINPUT(), StepSTOP(); + void StepGET(), StepSET(), StepPUT(), StepPUTC(); + void StepDIM(), StepREDIM(), StepREDIMP(), StepERASE(); + void StepINITFOR(), StepNEXT(), StepERROR(); + void StepCASE(), StepENDCASE(), StepSTDERROR(); + void StepNOERROR(), StepCHANNEL(), StepCHANNEL0(), StepPRINT(); + void StepPRINTF(), StepWRITE(), StepRENAME(), StepPROMPT(); + void StepRESTART(), StepEMPTY(), StepLEAVE(); + void StepLSET(), StepRSET(); + // Alle Opcodes mit einem Operanden + void StepLOADNC( USHORT ), StepLOADSC( USHORT ), StepLOADI( USHORT ); + void StepARGN( USHORT ), StepBASED( USHORT ), StepPAD( USHORT ); + void StepJUMP( USHORT ), StepJUMPT( USHORT ); + void StepJUMPF( USHORT ), StepONJUMP( USHORT ); + void StepGOSUB( USHORT ), StepRETURN( USHORT ); + void StepTESTFOR( USHORT ), StepCASETO( USHORT ), StepERRHDL( USHORT ); + void StepRESUME( USHORT ), StepCLASS( USHORT ), StepLIB( USHORT ); + void StepCLOSE( USHORT ), StepPRCHAR( USHORT ), StepARGTYP( USHORT ); + // Alle Opcodes mit zwei Operanden + void StepRTL( USHORT, USHORT ), StepPUBLIC( USHORT, USHORT ); + void StepFIND( USHORT, USHORT ), StepELEM( USHORT, USHORT ); + void StepGLOBAL( USHORT, USHORT ), StepLOCAL( USHORT, USHORT ); + void StepPARAM( USHORT, USHORT), StepCREATE( USHORT, USHORT ); + void StepCALL( USHORT, USHORT ), StepCALLC( USHORT, USHORT ); + void StepCASEIS( USHORT, USHORT ), StepSTMNT( USHORT, USHORT ); + void StepOPEN( USHORT, USHORT ), StepSTATIC( USHORT, USHORT ); + void StepTCREATE(USHORT,USHORT), StepDCREATE(USHORT,USHORT); +public: + xub_StrLen nLine,nCol1,nCol2; // aktuelle Zeile, Spaltenbereich + SbiRuntime* pNext; // Stack-Chain + + SbiRuntime( SbModule*, SbMethod*, USHORT ); + ~SbiRuntime(); + void Error( SbError ); // Fehler setzen, falls != 0 + void FatalError( SbError ); // Fehlerbehandlung=Standard, Fehler setzen + BOOL Step(); // Einzelschritt (ein Opcode) + void Stop() { bRun = FALSE; } + SbMethod* GetMethod() { return pMeth; } + SbModule* GetModule() { return pMod; } + USHORT GetDebugFlags() { return nFlags; } + void SetDebugFlags( USHORT nFl ) { nFlags = nFl; } + SbMethod* GetCaller(); + SbxArray* GetLocals(); + SbxArray* GetParams(); + + SbxBase* FindElementExtern( const String& rName ); +}; + +// Hilfsfunktion, um aktives Basic zu finden +StarBASIC* GetCurrentBasic( StarBASIC* pRTBasic ); + +// Get information if security restrictions should be +// used (File IO based on UCB, no RTL function SHELL +// no DDE functionality, no DLLCALL) in basic because +// of portal "virtual" users (portal user != UNIX user) +// (Implemented in iosys.cxx) +BOOL needSecurityRestrictions( void ); + +// Returns TRUE if UNO is available, otherwise the old +// file system implementation has to be used +// (Implemented in iosys.cxx) +BOOL hasUno( void ); + +// Converts possibly relative paths to absolute paths +// according to the setting done by ChDir/ChDrive +// (Implemented in methods.cxx) +String getFullPath( const String& aRelPath ); + +// Sets (virtual) current path for UCB file access +void implChDir( const String& aDir ); + +// Sets (virtual) current drive for UCB file access +void implChDrive( const String& aDrive ); + +// Returns (virtual) current path for UCB file access +String implGetCurDir( void ); + +// Implementation of StepRENAME with UCB +// (Implemented in methods.cxx, so step0.cxx +// has not to be infected with UNO) +void implStepRenameUCB( const String& aSource, const String& aDest ); + +#endif diff --git a/basic/source/inc/sbcomp.hxx b/basic/source/inc/sbcomp.hxx new file mode 100644 index 000000000000..ede7182de510 --- /dev/null +++ b/basic/source/inc/sbcomp.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * $RCSfile: sbcomp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SBCOMP_HXX +#define _SBCOMP_HXX + +// das folgende habe ich der neuen Datei von MD entnommen! (MT) +#include "sbintern.hxx" +#include "token.hxx" // Tokenizer +#include "symtbl.hxx" // Symbolverwaltung +#include "parser.hxx" // Parser +#include "codegen.hxx" // Code-Generator + +#endif diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx new file mode 100644 index 000000000000..19ca73c6833c --- /dev/null +++ b/basic/source/inc/sbintern.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: sbintern.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SB_INTERN_HXX +#define _SB_INTERN_HXX + +#include <svtools/sbxfac.hxx> +#include "sb.hxx" + +class SbUnoFactory; +class SbiInstance; +class SbModule; + + +class SbiFactory : public SbxFactory +{ +public: + virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxObject* CreateObject( const String& ); +}; + +// Stack fuer die im Fehlerfall abgebaute SbiRuntime Kette +class SbErrorStackEntry +{ +public: + SbErrorStackEntry(SbMethodRef aM, xub_StrLen nL, xub_StrLen nC1, xub_StrLen nC2) + : aMethod(aM), nLine(nL), nCol1(nC1), nCol2(nC2) {} + SbMethodRef aMethod; + xub_StrLen nLine; + xub_StrLen nCol1, nCol2; +}; + +SV_DECL_PTRARR_DEL(SbErrorStack, SbErrorStackEntry*, 1, 1) + + + +struct SbiGlobals +{ + SbiInstance* pInst; // alle aktiven Runtime-Instanzen + SbiFactory* pSbFac; // StarBASIC-Factory + SbUnoFactory* pUnoFac; // Factory fuer Uno-Structs bei DIM AS NEW + SbModule* pMod; // aktuell aktives Modul + SbModule* pCompMod; // aktuell compiliertes Modul + short nInst; // Anzahl BASICs + Link aErrHdl; // globaler Error-Handler + Link aBreakHdl; // globaler Break-Handler + SbError nCode; // aktueller Fehlercode + xub_StrLen nLine; // aktuelle Zeile + xub_StrLen nCol1,nCol2; // aktuelle Spalten (von,bis) + BOOL bCompiler; // Flag fuer Compiler-Error + BOOL bCompWait; // Flag, beim Compilieren WaitCursor eingeschaltet ist + BOOL bGlobalInitErr; // Beim GlobalInit trat ein Compiler-Fehler auf + BOOL bRunInit; // TRUE, wenn RunInit vom Basic aktiv ist + String aErrMsg; // Puffer fuer GetErrorText() + SbLanguageMode eLanguageMode; // Flag fuer Visual-Basic-Script-Modus + SbErrorStack* pErrStack; // Stack fuer die im Fehlerfall abgebaute SbiRuntime Kette + + SbiGlobals(); + ~SbiGlobals(); +}; + +// Utility-Makros und -Routinen + +SbiGlobals* GetSbData(); + +#define pINST GetSbData()->pInst +#define pMOD GetSbData()->pMod +#define pCMOD GetSbData()->pCompMod +#define pSBFAC GetSbData()->pSbFac +#define pUNOFAC GetSbData()->pUnoFac + +#endif + diff --git a/basic/source/inc/sbjsmeth.hxx b/basic/source/inc/sbjsmeth.hxx new file mode 100644 index 000000000000..1239aafd3fc5 --- /dev/null +++ b/basic/source/inc/sbjsmeth.hxx @@ -0,0 +1,89 @@ +/************************************************************************* + * + * $RCSfile: sbjsmeth.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SB_SBJSMETH_HXX +#define _SB_SBJSMETH_HXX + +#ifndef _SB_SBMETH_HXX +#include <sbmeth.hxx> +#endif + +// Basic-Modul fuer JavaScript-Sourcen. +// Alle Basic-spezifischen Methoden muessen virtuell ueberladen und deaktiviert +// werden. Die Unterscheidung von normalen Modulen erfolgt uebr RTTI. + +class SbJScriptMethod : public SbMethod +{ +public: + SbJScriptMethod( const String&, SbxDataType, SbModule* ); + virtual ~SbJScriptMethod(); + + SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMETH,2); + TYPEINFO(); +}; + +#ifndef __SB_SBJSCRIPTMETHODREF_HXX +#define __SB_SBJSCRIPTMETHODREF_HXX +SV_DECL_IMPL_REF(SbJScriptMethod) +#endif + +#endif diff --git a/basic/source/inc/sbjsmod.hxx b/basic/source/inc/sbjsmod.hxx new file mode 100644 index 000000000000..265f21e7bd96 --- /dev/null +++ b/basic/source/inc/sbjsmod.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * $RCSfile: sbjsmod.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SB_SBJSMOD_HXX +#define _SB_SBJSMOD_HXX + +#include <sbmod.hxx> + +// Basic-Modul fuer JavaScript-Sourcen. +// Alle Basic-spezifischen Methoden muessen virtuell ueberladen und deaktiviert +// werden. Die Unterscheidung von normalen Modulen erfolgt uebr RTTI. + +class SbJScriptModule : public SbModule +{ + virtual BOOL LoadData( SvStream&, USHORT ); + virtual BOOL StoreData( SvStream& ) const; +public: + SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMOD,1); + TYPEINFO(); + SbJScriptModule( const String& ); // DURCHREICHEN +}; + +#endif + + + diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx new file mode 100644 index 000000000000..1ec293c47448 --- /dev/null +++ b/basic/source/inc/sbunoobj.hxx @@ -0,0 +1,226 @@ +/************************************************************************* + * + * $RCSfile: sbunoobj.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 SB_UNO_OBJ +#define SB_UNO_OBJ + +#ifndef _SBX_SBXOBJECT_HXX //autogen +#include <svtools/sbxobj.hxx> +#endif +#ifndef __SBX_SBXMETHOD_HXX //autogen +#include <svtools/sbxmeth.hxx> +#endif +#ifndef __SBX_SBXPROPERTY_HXX //autogen +#include <svtools/sbxprop.hxx> +#endif +#ifndef __SBX_SBX_FACTORY_HXX //autogen +#include <svtools/sbxfac.hxx> +#endif + +#ifndef _COM_SUN_STAR_BEANS_XMATERIALHOLDER_HPP_ +#include <com/sun/star/beans/XMaterialHolder.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XEXACTNAME_HPP_ +#include <com/sun/star/beans/XExactName.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XINTROSPECTIONACCESS_HPP_ +#include <com/sun/star/beans/XIntrospectionAccess.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_XINTROSPECTION_HPP_ +#include <com/sun/star/beans/XIntrospection.hpp> +#endif +#ifndef _COM_SUN_STAR_SCRIPT_XINVOCATION_HPP_ +#include <com/sun/star/script/XInvocation.hpp> +#endif +#ifndef _COM_SUN_STAR_REFLECTION_XIDLCLASS_HPP_ +#include <com/sun/star/reflection/XIdlClass.hpp> +#endif + +using namespace com::sun::star::uno; +using namespace com::sun::star::beans; +using namespace com::sun::star::script; +using namespace com::sun::star::reflection; + +class SbUnoObject: public SbxObject +{ + Reference< XIntrospectionAccess > mxUnoAccess; + Reference< XMaterialHolder > mxMaterialHolder; + Reference< XInvocation > mxInvocation; + Reference< XExactName > mxExactName; + BOOL bNeedIntrospection; + Any maTmpUnoObj; // Only to save obj for doIntrospection! + + // Hilfs-Methode zum Anlegen der dbg_-Properties + void implCreateDbgProperties( void ); + + // Hilfs-Methode zum Anlegen aller Properties und Methoden + // (Beim on-demand-Mechanismus erforderlich fuer die dbg_-Properties) + void implCreateAll( void ); + +public: + TYPEINFO(); + SbUnoObject( const String& aName, const Any& aUnoObj_ ); + ~SbUnoObject(); + + // #76470 Introspection on Demand durchfuehren + void doIntrospection( void ); + + // Find ueberladen, um z.B. NameAccess zu unterstuetzen + virtual SbxVariable* Find( const String&, SbxClassType ); + + // Wert rausgeben + Any getUnoAny( void ); + Reference< XIntrospectionAccess > getIntrospectionAccess( void ) { return mxUnoAccess; } + Reference< XInvocation > getInvocation( void ) { return mxInvocation; } + + void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ); +}; +SV_DECL_IMPL_REF(SbUnoObject); + + +// #67781 Rueckgabewerte der Uno-Methoden loeschen +void clearUnoMethods( void ); + +class SbUnoMethod : public SbxMethod +{ + friend class SbUnoObject; + friend void clearUnoMethods( void ); + + Reference< XIdlMethod > m_xUnoMethod; + Sequence<ParamInfo>* pParamInfoSeq; + + // #67781 Verweis auf vorige und naechste Methode in der Methoden-Liste + SbUnoMethod* pPrev; + SbUnoMethod* pNext; + +public: + TYPEINFO(); + + SbUnoMethod( const String& aName, SbxDataType eSbxType, Reference< XIdlMethod > xUnoMethod_ ); + virtual ~SbUnoMethod(); + //virtual SbxInfo* GetInfo() { return NULL; } + + const Sequence<ParamInfo>& getParamInfos( void ); +}; + + +class SbUnoProperty : public SbxProperty +{ + friend class SbUnoObject; + + // Daten der Uno-Property + Property aUnoProp; + UINT32 nId; + + virtual ~SbUnoProperty(); +public: + TYPEINFO(); + SbUnoProperty( const String& aName, SbxDataType eSbxType, + const Property& aUnoProp_, UINT32 nId_ ); +}; + +// Factory-Klasse fuer das Anlegen von Uno-Structs per DIM AS NEW +class SbUnoFactory : public SbxFactory +{ +public: + virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxObject* CreateObject( const String& ); +}; + +// Wrapper fuer eine Uno-Klasse +class SbUnoClass: public SbxObject +{ + const Reference< XIdlClass > m_xClass; +public: + TYPEINFO(); + SbUnoClass( const String& aName, const Reference< XIdlClass >& xClass_ ) + : SbxObject( aName ), m_xClass( xClass_ ) {} + //~SbUnoClass(); + + // Find ueberladen, um Elemente on Demand anzulegen + virtual SbxVariable* Find( const String&, SbxClassType ); + + // Wert rausgeben + const Reference< XIdlClass >& getUnoClass( void ) { return m_xClass; } + + //void SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SfxHint& rHint, const TypeId& ); +}; +SV_DECL_IMPL_REF(SbUnoClass); + + +// Funktion, um einen globalen Bezeichner im +// UnoScope zu suchen und fuer Sbx zu wrappen +SbxVariable* findUnoClass( const String& rName ); + + +class StarBASIC; + +// Impl-Methoden fuer RTL +void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); +void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); +void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); +void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); +void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); +void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); + +#endif + + diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx new file mode 100644 index 000000000000..760f3f2ba238 --- /dev/null +++ b/basic/source/inc/scanner.hxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * $RCSfile: scanner.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SCANNER_HXX +#define _SCANNER_HXX + +#ifndef _STRING_HXX //autogen +#include <tools/string.hxx> +#endif +#ifndef _SBERRORS_HXX +#include "sberrors.hxx" +#endif + +// Der Scanner ist stand-alone, d.h. er kann von ueberallher verwendet +// werden. Eine BASIC-Instanz ist fuer Fehlermeldungen notwendig. Ohne +// BASIC werden die Fehler nur gezaehlt. Auch ist Basic notwendig, wenn +// eine erweiterte SBX-Variable zur Erkennung von Datentypen etc. verwendet +// werden soll. + +class StarBASIC; + +class SbiScanner +{ + String aBuf; // Input-Puffer + String aLine; // aktuelle Zeile + const sal_Unicode* pLine; // Pointer + const sal_Unicode* pSaveLine; // Merker fuer Line +protected: + String aSym; // Symbolpuffer + String aError; // Fehler-String + SbxDataType eScanType; // evtl. Datentyp + StarBASIC* pBasic; // Instanz fuer Fehler-Callbacks + double nVal; // numerischer Wert + short nCurCol1; // aktuelle Spalte 1 + short nSavedCol1; // gerettete Spalte 1 + short nCol; // aktuelle Spaltennummer + short nErrors; // Anzahl Fehler + short nColLock; // Lock-Zaehler fuer Col1 + USHORT nBufPos; // aktuelle Buffer-Pos + USHORT nLine; // aktuelle Zeile + USHORT nCol1, nCol2; // aktuelle 1. und 2. Spalte + BOOL bSymbol; // TRUE: Symbol gescannt + BOOL bNumber; // TRUE: Zahl gescannt + BOOL bSpaces; // TRUE: Whitespace vor Token + BOOL bErrors; // TRUE: Fehler generieren + BOOL bAbort; // TRUE: abbrechen + BOOL bHash; // TRUE: # eingelesen + BOOL bError; // TRUE: Fehler generieren + BOOL bUsedForHilite; // TRUE: Nutzung fuer Highlighting + + void GenError( SbError ); +public: + SbiScanner( const String&, StarBASIC* = NULL ); + ~SbiScanner(); + + void EnableErrors() { bError = FALSE; } + BOOL IsHash() { return bHash; } + BOOL WhiteSpace() { return bSpaces; } + short GetErrors() { return nErrors; } + short GetLine() { return nLine; } + short GetCol1() { return nCol1; } + short GetCol2() { return nCol2; } + void SetCol1( short n ) { nCol1 = n; } + StarBASIC* GetBasic() { return pBasic; } + void SaveLine(void) { pSaveLine = pLine; } + void RestoreLine(void) { pLine = pSaveLine; } + void LockColumn(); + void UnlockColumn(); + BOOL DoesColonFollow(); + + BOOL NextSym(); // naechstes Symbol lesen + const String& GetSym() { return aSym; } + SbxDataType GetType() { return eScanType; } + double GetDbl() { return nVal; } +}; + + +#endif diff --git a/basic/source/inc/stdobj.hxx b/basic/source/inc/stdobj.hxx new file mode 100644 index 000000000000..5313f108ef3f --- /dev/null +++ b/basic/source/inc/stdobj.hxx @@ -0,0 +1,86 @@ +/************************************************************************* + * + * $RCSfile: stdobj.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SBSTDOBJ_HXX +#define _SBSTDOBJ_HXX + +#ifndef _SBX_SBXOBJECT_HXX //autogen +#include <svtools/sbxobj.hxx> +#endif + +class StarBASIC; +class SbStdFactory; + +class SbiStdObject : public SbxObject +{ + SbStdFactory* pStdFactory; + + ~SbiStdObject(); + SbxInfo* GetInfo( short ); + virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ); +public: + SbiStdObject( const String&, StarBASIC* ); + virtual SbxVariable* Find( const String&, SbxClassType ); + virtual void SetModified( BOOL ); +}; + +#endif diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx new file mode 100644 index 000000000000..76d0a9433708 --- /dev/null +++ b/basic/source/inc/symtbl.hxx @@ -0,0 +1,266 @@ +/************************************************************************* + * + * $RCSfile: symtbl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SYMTBL_HXX +#define _SYMTBL_HXX + +#ifndef _SVARRAY_HXX //autogen +#include <svtools/svarray.hxx> +#endif +#ifndef _STRING_HXX //autogen +#include <tools/string.hxx> +#endif +#ifndef _SBXDEF_HXX //autogen +#include <svtools/sbxdef.hxx> +#endif + +class SbiSymDef; // Basisklasse +class SbiProcDef; // Prozedur +class SbiConstDef; // Konstante +class SbiSymPool; // Symbol-Pool +class SbiStringPool; // gepoolte Strings + +class SvStream; +class SbiParser; + +enum SbiSymScope { SbLOCAL, SbPARAM, SbPUBLIC, SbGLOBAL, SbRTL }; + +/////////////////////////////////////////////////////////////////////////// + +// Der String-Pool nimmt String-Eintraege auf und sorgt dafuer, +// dass sie nicht doppelt vorkommen. + +SV_DECL_PTRARR_DEL(SbiStrings,String*,5,5) + +class SbiStringPool { // String-Pool + SbiStrings aData; // Daten + String aEmpty; // for convenience + SbiParser* pParser; // der Parser +public: + SbiStringPool( SbiParser* ); + ~SbiStringPool(); + USHORT GetSize() const { return aData.Count(); } + // AB 8.4.1999, Default wegen #64236 auf TRUE geaendert + // Wenn der Bug sauber behoben ist, wieder auf FALSE aendern. + short Add( const String&, BOOL=TRUE ); + short Add( double, SbxDataType ); + const String& Find( USHORT ) const; + SbiParser* GetParser() { return pParser; } +}; + +/////////////////////////////////////////////////////////////////////////// + +SV_DECL_PTRARR_DEL(SbiSymbols,SbiSymDef*,5,5) + +class SbiSymPool { // Symbol-Pool + friend class SbiSymDef; + friend class SbiProcDef; +protected: + SbiStringPool& rStrings; // verwendeter Stringpool + SbiSymbols aData; // Daten + SbiSymPool* pParent; // uebergeordneter Symbol-Pool + SbiParser* pParser; // der Parser + SbiSymScope eScope; // Scope des Pools + USHORT nProcId; // aktuelles ProcId fuer STATIC-Variable + USHORT nCur; // Iterator +public: + SbiSymPool( SbiStringPool&, SbiSymScope ); + ~SbiSymPool(); + + void Clear(); + + void SetParent( SbiSymPool* p ) { pParent = p; } + void SetProcId( short n ) { nProcId = n; } + USHORT GetSize() const { return aData.Count(); } + SbiSymScope GetScope() const { return eScope; } + void SetScope( SbiSymScope s ) { eScope = s; } + SbiParser* GetParser() { return pParser; } + + SbiSymDef* AddSym( const String& ); // Symbol hinzufuegen + SbiProcDef* AddProc( const String& );// Prozedur hinzufuegen + void Add( SbiSymDef* ); // Symbol uebernehmen + SbiSymDef* Find( const String& ) const;// Variablenname + SbiSymDef* FindId( USHORT ) const; // Variable per ID suchen + SbiSymDef* Get( USHORT ) const; // Variable per Position suchen + SbiSymDef* First(), *Next(); // Iteratoren + + USHORT Define( const String& ); // Label definieren + USHORT Reference( const String& ); // Label referenzieren + void CheckRefs(); // offene Referenzen suchen +}; + +/////////////////////////////////////////////////////////////////////////// + +class SbiSymDef { // Allgemeiner Symboleintrag + friend class SbiSymPool; +protected: + String aName; // Name des Eintrags + SbxDataType eType; // Typ des Eintrags + SbiSymPool* pIn; // Parent-Pool + SbiSymPool* pPool; // Pool fuer Unterelemente + short nLen; // Stringlaenge bei STRING*n + short nDims; // Array-Dimensionen + USHORT nId; // Symbol-Nummer + USHORT nTypeId; // String-ID des Datentyps (Dim X AS Dytentyp) + USHORT nProcId; // aktuelles ProcId fuer STATIC-Variable + USHORT nPos; // Positions-Nummer + USHORT nChain; // Backchain-Kette + BOOL bNew : 1; // TRUE: Dim As New... + BOOL bChained : 1; // TRUE: Symbol ist in Code definiert + BOOL bByVal : 1; // TRUE: ByVal-Parameter + BOOL bOpt : 1; // TRUE: optionaler Parameter + BOOL bStatic : 1; // TRUE: STATIC-Variable + BOOL bAs : 1; // TRUE: Datentyp per AS XXX definiert +public: + SbiSymDef( const String& ); + virtual ~SbiSymDef(); + virtual SbiProcDef* GetProcDef(); + virtual SbiConstDef* GetConstDef(); + + SbxDataType GetType() const { return eType; } + virtual void SetType( SbxDataType ); + const String& GetName(); + SbiSymScope GetScope() const; + USHORT GetProcId() const{ return nProcId; } + USHORT GetAddr() const { return nChain; } + USHORT GetId() const { return nId; } + USHORT GetTypeId() const{ return nTypeId; } + void SetTypeId( USHORT n ) { nTypeId = n; eType = SbxOBJECT; } + USHORT GetPos() const { return nPos; } + void SetLen( short n ){ nLen = n; } + short GetLen() const { return nLen; } + void SetDims( short n ) { nDims = n; } + short GetDims() const { return nDims; } + BOOL IsDefined() const{ return bChained; } + void SetOptional() { bOpt = TRUE; } + void SetByVal() { bByVal = TRUE; } + void SetStatic() { bStatic = TRUE; } + void SetNew() { bNew = TRUE; } + void SetDefinedAs() { bAs = TRUE; } + BOOL IsOptional() const{ return bOpt; } + BOOL IsByVal() const { return bByVal; } + BOOL IsStatic() const { return bStatic; } + BOOL IsNew() const { return bNew; } + BOOL IsDefinedAs() const { return bAs; } + + SbiSymPool& GetPool(); + USHORT Define(); // Symbol in Code definieren + USHORT Reference(); // Symbol in Code referenzieren + +private: + SbiSymDef( const SbiSymDef& ); + +}; + +class SbiProcDef : public SbiSymDef { // Prozedur-Definition (aus Basic): + SbiSymPool aParams; // Parameter + SbiSymPool aLabels; // lokale Sprungziele + String aLibName; // LIB "name" + String aAlias; // ALIAS "name" + USHORT nLine1, nLine2; // Zeilenbereich + BOOL bCdecl : 1; // TRUE: CDECL angegeben + BOOL bPublic : 1; // TRUE: proc ist PUBLIC +public: + SbiProcDef( SbiParser*, const String& ); // Name + virtual ~SbiProcDef(); + virtual SbiProcDef* GetProcDef(); + virtual void SetType( SbxDataType ); + SbiSymPool& GetParams() { return aParams; } + SbiSymPool& GetLabels() { return aLabels; } + SbiSymPool& GetLocals() { return GetPool();} + String& GetLib() { return aLibName; } + String& GetAlias() { return aAlias; } + void SetPublic( BOOL b ) { bPublic = b; } + BOOL IsPublic() const { return bPublic; } + void SetCdecl( BOOL b = TRUE) { bCdecl = b; } + BOOL IsCdecl() const { return bCdecl; } + void SetLine1( USHORT n ) { nLine1 = n; } + USHORT GetLine1() const { return nLine1; } + void SetLine2( USHORT n ) { nLine2 = n; } + USHORT GetLine2() const { return nLine2; } + + // Match mit einer Forward-Deklaration. Die Parameternamen + // werden abgeglichen und die Forward-Deklaration wird + // durch this ersetzt + void Match( SbiProcDef* pForward ); + +private: + SbiProcDef( const SbiProcDef& ); + +}; + +class SbiConstDef : public SbiSymDef +{ + double nVal; + String aVal; +public: + SbiConstDef( const String& ); + virtual ~SbiConstDef(); + virtual SbiConstDef* GetConstDef(); + void Set( double, SbxDataType ); + void Set( const String& ); + double GetValue() { return nVal; } + const String& GetString() { return aVal; } +}; + + +#endif + diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx new file mode 100644 index 000000000000..022f490895e1 --- /dev/null +++ b/basic/source/inc/token.hxx @@ -0,0 +1,199 @@ +/************************************************************************* + * + * $RCSfile: token.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _TOKEN_HXX +#define _TOKEN_HXX + +#ifndef _SCANNER_HXX +#include "scanner.hxx" +#endif +#ifndef _SBDEF_HXX +#include "sbdef.hxx" +#endif + +#if defined( SHARED ) +#define SbiTokenSHAREDTMPUNDEF +#undef SHARED +#endif + +// Der Tokenizer ist stand-alone, d.h. er kann von ueberallher verwendet +// werden. Eine BASIC-Instanz ist fuer Fehlermeldungen notwendig. Ohne +// BASIC werden die Fehler nur gezaehlt. Auch ist Basic notwendig, wenn +// eine erweiterte SBX-Variable zur Erkennung von Datentypen etc. verwendet +// werden soll. + +enum SbiToken { + NIL = 0, + // Token zwischen 0x20 und 0x3F sind Literale: + LPAREN = '(', RPAREN = ')', COMMA = ',', DOT = '.', EXCLAM = '!', + HASH = '#', SEMICOLON = ';', + + // Anweisungen: + FIRSTKWD = 0x40, + AS = FIRSTKWD, ALIAS, ASSIGN, + CALL, CASE, CLOSE, COMPARE, _CONST_, + DECLARE, DIM, DO, + + // in der Reihenfolge der Datentyp-Enums! + DEFINT, DEFLNG, DEFSNG, DEFDBL, DEFCUR, DEFDATE, DEFSTR, DEFOBJ, + DEFERR, DEFBOOL, DEFVAR, + // in der Reihenfolge der Datentyp-Enums! + DATATYPE1, + TINTEGER = DATATYPE1, + TLONG, TSINGLE, TDOUBLE, TCURRENCY, TDATE, TSTRING, TOBJECT, + _ERROR_, TBOOLEAN, TVARIANT, + DATATYPE2 = TVARIANT, + + EACH, ELSE, ELSEIF, END, ERASE, EXIT, + FOR, FUNCTION, + GLOBAL, GOSUB, GOTO, + IF, _IN_, INPUT, + LET, LINE, LINEINPUT, LOCAL, LOOP, LPRINT, LSET, + NAME, NEW, NEXT, + ON, OPEN, OPTION, + PRINT, PRIVATE, PUBLIC, + REDIM, REM, RESUME, RETURN, RSET, + SELECT, SET, SHARED, STATIC, STEP, STOP, SUB, + TEXT, THEN, TO, TYPE, + UNTIL, + WEND, WHILE, WITH, WRITE, + ENDIF, ENDFUNC, ENDSUB, ENDTYPE, ENDSELECT, ENDWITH, + // Ende aller Keywords + LASTKWD = ENDWITH, + // Statement-Ende + EOS, EOLN, + // Operatoren: + EXPON, NEG, MUL, + DIV, IDIV, MOD, PLUS, MINUS, + EQ, NE, LT, GT, LE, GE, + NOT, AND, OR, XOR, EQV, + IMP, CAT, LIKE, IS, + // Sonstiges: + FIRSTEXTRA, + NUMBER=FIRSTEXTRA, FIXSTRING, SYMBOL, _CDECL_, BYVAL, + OUTPUT, RANDOM, APPEND, BINARY, ACCESS, + LOCK, READ, PRESERVE, BASE, ANY, LIB, _OPTIONAL_, + EXPLICIT, + + // Ab hier kommen JavaScript-Tokens (gleiches enum, damit gleicher Typ) + FIRSTJAVA, + JS_BREAK=FIRSTJAVA, JS_CONTINUE, JS_FOR, JS_FUNCTION, JS_IF, JS_NEW, + JS_RETURN, JS_THIS, JS_VAR, JS_WHILE, JS_WITH, + + // JavaScript-Operatoren + // _ASS_ = Assignment + JS_COMMA, JS_ASSIGNMENT, JS_ASS_PLUS, JS_ASS_MINUS, JS_ASS_MUL, + JS_ASS_DIV, JS_ASS_MOD, JS_ASS_LSHIFT, JS_ASS_RSHIFT, JS_ASS_RSHIFT_Z, + JS_ASS_AND, JS_ASS_XOR, JS_ASS_OR, + JS_COND_QUEST, JS_COND_SEL, JS_LOG_OR, JS_LOG_AND, JS_BIT_OR, + JS_BIT_XOR, JS_BIT_AND, JS_EQ, JS_NE, JS_LT, JS_LE, + JS_GT, JS_GE, JS_LSHIFT, JS_RSHIFT, JS_RSHIFT_Z, + JS_PLUS, JS_MINUS, JS_MUL, JS_DIV, JS_MOD, JS_LOG_NOT, JS_BIT_NOT, + JS_INC, JS_DEC, JS_LPAREN, JS_RPAREN, JS_LINDEX, JS_RINDEX +}; + +#ifdef SbiTokenSHAREDTMPUNDEF +#define SHARED +#undef SbiTokenSHAREDTMPUNDEF +#endif + +class SbiTokenizer : public SbiScanner { +protected: + SbiToken eCurTok; // aktuelles Token + SbiToken ePush; // Pushback-Token + USHORT nPLine, nPCol1, nPCol2; // Pushback-Location + BOOL bEof; // TRUE bei Dateiende + BOOL bEos; // TRUE bei Statement-Ende + BOOL bKeywords; // TRUE, falls Keywords geparst werden + BOOL bAs; // letztes Keyword war AS +public: + SbiTokenizer( const String&, StarBASIC* = NULL ); + ~SbiTokenizer(); + + inline BOOL IsEof() { return bEof; } + inline BOOL IsEos() { return bEos; } + + void Push( SbiToken ); // Pushback eines Tokens + const String& Symbol( SbiToken );// Rueckumwandlung + + SbiToken Peek(); // das naechste Token lesen + SbiToken Next(); // Ein Token lesen + BOOL MayBeLabel( BOOL= FALSE ); // Kann es ein Label sein? + + void Hilite( SbTextPortions& ); // Syntax-Highlighting + + void Error( SbError c ) { GenError( c ); } + void Error( SbError, SbiToken ); + void Error( SbError, const char* ); + void Error( SbError, String ); + + void Keywords( BOOL b ) { bKeywords = b; } + + static BOOL IsEoln( SbiToken t ) + { return BOOL( t == EOS || t == EOLN || t == REM ); } + static BOOL IsKwd( SbiToken t ) + { return BOOL( t >= FIRSTKWD && t <= LASTKWD ); } + static BOOL IsExtra( SbiToken t ) + { return BOOL( t >= FIRSTEXTRA ); } +}; + + +#endif diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx new file mode 100644 index 000000000000..01c7ed0922c4 --- /dev/null +++ b/basic/source/runtime/basrdll.cxx @@ -0,0 +1,141 @@ +/************************************************************************* + * + * $RCSfile: basrdll.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SHL_HXX //autogen +#include <tools/shl.hxx> +#endif +#ifndef _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#ifndef _SOLAR_HRC +#include <svtools/solar.hrc> +#endif +#ifndef _INTN_HXX //autogen +#include <tools/intn.hxx> +#endif +#ifndef _TOOLS_DEBUG_HXX //autogen +#include <tools/debug.hxx> +#endif +#ifndef _SV_MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif + +#include <sbstar.hxx> +#include <basrdll.hxx> +#include <basrid.hxx> +#include <sb.hrc> + +BasicResId::BasicResId( USHORT nId ): + ResId( nId, (*(BasicDLL**)GetAppData(SHL_BASIC))->GetResMgr() ) +{ +} + +BasicDLL::BasicDLL() +{ + *(BasicDLL**)GetAppData(SHL_BASIC) = this; + pResMgr = NULL; + bDebugMode = FALSE; + bBreakEnabled = TRUE; +} + +BasicDLL::~BasicDLL() +{ + delete pResMgr; +} + +void BasicDLL::EnableBreak( BOOL bEnable ) +{ + BasicDLL* pThis = *(BasicDLL**)GetAppData(SHL_BASIC); + DBG_ASSERT( pThis, "BasicDLL::EnableBreak: Noch keine Instanz!" ); + if ( pThis ) + pThis->bBreakEnabled = bEnable; +} + +void BasicDLL::SetDebugMode( BOOL bDebugMode ) +{ + BasicDLL* pThis = *(BasicDLL**)GetAppData(SHL_BASIC); + DBG_ASSERT( pThis, "BasicDLL::EnableBreak: Noch keine Instanz!" ); + if ( pThis ) + pThis->bDebugMode = bDebugMode; +} + + +void BasicDLL::BasicBreak() +{ + //bJustStopping: Wenn jemand wie wild x-mal STOP drueckt, aber das Basic + // nicht schnell genug anhaelt, kommt die Box ggf. oefters... + static BOOL bJustStopping = FALSE; + + BasicDLL* pThis = *(BasicDLL**)GetAppData(SHL_BASIC); + DBG_ASSERT( pThis, "BasicDLL::EnableBreak: Noch keine Instanz!" ); + if ( pThis ) + { + if ( StarBASIC::IsRunning() && !bJustStopping && ( pThis->bBreakEnabled || pThis->bDebugMode ) ) + { + bJustStopping = TRUE; + StarBASIC::Stop(); + String aMessageStr( BasicResId( IDS_SBERR_TERMINATED ) ); + InfoBox( 0, aMessageStr ).Execute(); + bJustStopping = FALSE; + } + } +} + diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx new file mode 100644 index 000000000000..90dc5a53a00b --- /dev/null +++ b/basic/source/runtime/ddectrl.cxx @@ -0,0 +1,232 @@ +/************************************************************************* + * + * $RCSfile: ddectrl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _ERRCODE_HXX //autogen +#include <tools/errcode.hxx> +#endif +#ifndef _SVDDE_HXX //autogen +#include <svtools/svdde.hxx> +#endif +#pragma hdrstop +#include "ddectrl.hxx" +#ifndef _SBERRORS_HXX +#include <sberrors.hxx> +#endif + +//#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + +#define DDE_FREECHANNEL ((DdeConnection*)0xffffffff) + +#define DDE_FIRSTERR 0x4000 +#define DDE_LASTERR 0x4011 + +static const SbError nDdeErrMap[] = +{ + /* DMLERR_ADVACKTIMEOUT */ 0x4000, SbERR_DDE_TIMEOUT, + /* DMLERR_BUSY */ 0x4001, SbERR_DDE_BUSY, + /* DMLERR_DATAACKTIMEOUT */ 0x4002, SbERR_DDE_TIMEOUT, + /* DMLERR_DLL_NOT_INITIALIZED */ 0x4003, SbERR_DDE_ERROR, + /* DMLERR_DLL_USAGE */ 0x4004, SbERR_DDE_ERROR, + /* DMLERR_EXECACKTIMEOUT */ 0x4005, SbERR_DDE_TIMEOUT, + /* DMLERR_INVALIDPARAMETER */ 0x4006, SbERR_DDE_ERROR, + /* DMLERR_LOW_MEMORY */ 0x4007, SbERR_DDE_ERROR, + /* DMLERR_MEMORY_ERROR */ 0x4008, SbERR_DDE_ERROR, + /* DMLERR_NOTPROCESSED */ 0x4009, SbERR_DDE_NOTPROCESSED, + /* DMLERR_NO_CONV_ESTABLISHED */ 0x400a, SbERR_DDE_NO_CHANNEL, + /* DMLERR_POKEACKTIMEOUT */ 0x400b, SbERR_DDE_TIMEOUT, + /* DMLERR_POSTMSG_FAILED */ 0x400c, SbERR_DDE_QUEUE_OVERFLOW, + /* DMLERR_REENTRANCY */ 0x400d, SbERR_DDE_ERROR, + /* DMLERR_SERVER_DIED */ 0x400e, SbERR_DDE_PARTNER_QUIT, + /* DMLERR_SYS_ERROR */ 0x400f, SbERR_DDE_ERROR, + /* DMLERR_UNADVACKTIMEOUT */ 0x4010, SbERR_DDE_TIMEOUT, + /* DMLERR_UNFOUND_QUEUE_ID */ 0x4011, SbERR_DDE_NO_CHANNEL +}; + +SbError SbiDdeControl::GetLastErr( DdeConnection* pConv ) +{ + if( !pConv ) + return 0; + long nErr = pConv->GetError(); + if( !nErr ) + return 0; + if( nErr < DDE_FIRSTERR || nErr > DDE_LASTERR ) + return SbERR_DDE_ERROR; + return nDdeErrMap[ 2*(nErr - DDE_FIRSTERR) + 1 ]; +} + +IMPL_LINK_INLINE( SbiDdeControl,Data , DdeData*, pData, +{ + aData = String::CreateFromAscii( (char*)(const void*)*pData ); + return 1; +} +) + +SbiDdeControl::SbiDdeControl() +{ + pConvList = new DdeConnections; + DdeConnection* pPtr = DDE_FREECHANNEL; + pConvList->Insert( pPtr ); +} + +SbiDdeControl::~SbiDdeControl() +{ + TerminateAll(); + delete pConvList; +} + +INT16 SbiDdeControl::GetFreeChannel() +{ + INT16 nListSize = (INT16)pConvList->Count(); + DdeConnection* pPtr = pConvList->First(); + pPtr = pConvList->Next(); // nullten eintrag ueberspringen + INT16 nChannel; + for( nChannel = 1; nChannel < nListSize; nChannel++ ) + { + if( pPtr == DDE_FREECHANNEL ) + return nChannel; + pPtr = pConvList->Next(); + } + pPtr = DDE_FREECHANNEL; + pConvList->Insert( pPtr, LIST_APPEND ); + return nChannel; +} + +SbError SbiDdeControl::Initiate( const String& rService, const String& rTopic, + INT16& rnHandle ) +{ + SbError nErr; + DdeConnection* pConv = new DdeConnection( rService, rTopic ); + nErr = GetLastErr( pConv ); + if( nErr ) + { + delete pConv; + rnHandle = 0; + } + else + { + INT16 nChannel = GetFreeChannel(); + pConvList->Replace( pConv, (ULONG)nChannel ); + rnHandle = nChannel; + } + return 0; +} + +SbError SbiDdeControl::Terminate( INT16 nChannel ) +{ + DdeConnection* pConv = pConvList->GetObject( (ULONG)nChannel ); + if( !nChannel || !pConv || pConv == DDE_FREECHANNEL ) + return SbERR_DDE_NO_CHANNEL; + pConvList->Replace( DDE_FREECHANNEL, (ULONG)nChannel ); + delete pConv; + return 0L; +} + +SbError SbiDdeControl::TerminateAll() +{ + INT16 nChannel = (INT16)pConvList->Count(); + while( nChannel ) + { + nChannel--; + Terminate( nChannel ); + } + + pConvList->Clear(); + DdeConnection* pPtr = DDE_FREECHANNEL; + pConvList->Insert( pPtr ); + + return 0; +} + +SbError SbiDdeControl::Request( INT16 nChannel, const String& rItem, String& rResult ) +{ + DdeConnection* pConv = pConvList->GetObject( (ULONG)nChannel ); + if( !nChannel || !pConv || pConv == DDE_FREECHANNEL ) + return SbERR_DDE_NO_CHANNEL; + + DdeRequest aRequest( *pConv, rItem, 30000 ); + aRequest.SetDataHdl( LINK( this, SbiDdeControl, Data ) ); + aRequest.Execute(); + rResult = aData; + return GetLastErr( pConv ); +} + +SbError SbiDdeControl::Execute( INT16 nChannel, const String& rCommand ) +{ + DdeConnection* pConv = pConvList->GetObject( (ULONG)nChannel ); + if( !nChannel || !pConv || pConv == DDE_FREECHANNEL ) + return SbERR_DDE_NO_CHANNEL; + DdeExecute aRequest( *pConv, rCommand, 30000 ); + aRequest.Execute(); + return GetLastErr( pConv ); +} + +SbError SbiDdeControl::Poke( INT16 nChannel, const String& rItem, const String& rData ) +{ + DdeConnection* pConv = pConvList->GetObject( (ULONG)nChannel ); + if( !nChannel || !pConv || pConv == DDE_FREECHANNEL ) + return SbERR_DDE_NO_CHANNEL; + DdePoke aRequest( *pConv, rItem, DdeData(rData), 30000 ); + aRequest.Execute(); + return GetLastErr( pConv ); +} + + diff --git a/basic/source/runtime/ddectrl.hxx b/basic/source/runtime/ddectrl.hxx new file mode 100644 index 000000000000..a69faeeeb4e8 --- /dev/null +++ b/basic/source/runtime/ddectrl.hxx @@ -0,0 +1,102 @@ +/************************************************************************* + * + * $RCSfile: ddectrl.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _DDECTRL_HXX +#define _DDECTRL_HXX + +#ifndef _LINK_HXX //autogen +#include <tools/link.hxx> +#endif +#ifndef _SBERRORS_HXX +#include "sberrors.hxx" +#endif +#ifndef _STRING_HXX //autogen +#include <tools/string.hxx> +#endif + +class DdeConnection; +class DdeConnections; +class DdeData; + +class SbiDdeControl +{ +private: + DECL_LINK( Data, DdeData* ); + SbError GetLastErr( DdeConnection* ); + INT16 GetFreeChannel(); + DdeConnections* pConvList; + String aData; + +public: + + SbiDdeControl(); + ~SbiDdeControl(); + + SbError Initiate( const String& rService, const String& rTopic, + INT16& rnHandle ); + SbError Terminate( INT16 nChannel ); + SbError TerminateAll(); + SbError Request( INT16 nChannel, const String& rItem, String& rResult ); + SbError Execute( INT16 nChannel, const String& rCommand ); + SbError Poke( INT16 nChannel, const String& rItem, const String& rData ); +}; + +#endif diff --git a/basic/source/runtime/dllmgr.cxx b/basic/source/runtime/dllmgr.cxx new file mode 100644 index 000000000000..76a608674351 --- /dev/null +++ b/basic/source/runtime/dllmgr.cxx @@ -0,0 +1,702 @@ +/************************************************************************* + * + * $RCSfile: dllmgr.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <stdlib.h> +#ifdef OS2 +#define INCL_DOSMODULEMGR +#include <tools/svpm.h> +#endif + +#if defined( WIN ) || defined( WNT ) +#ifndef _SVWIN_H +#include <tools/svwin.h> +#endif +#endif +#ifndef _TOOLS_DEBUG_HXX //autogen +#include <tools/debug.hxx> +#endif +#ifndef _STRING_HXX //autogen +#include <tools/string.hxx> +#endif +#ifndef _ERRCODE_HXX //autogen +#include <tools/errcode.hxx> +#endif +#ifndef _SBXVAR_HXX //autogen +#include <svtools/sbxvar.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif + +#if defined(WIN) +typedef HINSTANCE SbiDllHandle; +typedef FARPROC SbiDllProc; +#elif defined(WNT) +typedef HMODULE SbiDllHandle; +typedef int(*SbiDllProc)(); +#elif defined(OS2) +typedef HMODULE SbiDllHandle; +typedef PFN SbiDllProc; + +#else +typedef void* SbiDllHandle; +typedef void* SbiDllProc; +#endif + +#define _DLLMGR_CXX +#include "dllmgr.hxx" +#include <sberrors.hxx> + +#ifndef CDECL +#ifdef WNT +//#define CDECL __cdecl +#define CDECL +#else +#ifdef WTC +#define CDECL cdecl +#else +#if defined(ICC) && defined(OS2) +#define CDECL _System +#else +#define CDECL +#endif +#endif +#endif +#endif + +extern "C" { +#if defined(INTEL) && (defined(WIN) || defined(WNT) || defined(OS2)) + +extern INT16 CDECL CallINT( SbiDllProc, char *stack, short nstack); +extern INT32 CDECL CallLNG( SbiDllProc, char *stack, short nstack); +#ifndef WNT +extern float CDECL CallSNG( SbiDllProc, char *stack, short nstack); +#endif +extern double CDECL CallDBL( SbiDllProc, char *stack, short nstack); +extern char* CDECL CallSTR( SbiDllProc, char *stack, short nstack); +// extern CallFIX( SbiDllProc, char *stack, short nstack); + +#else + +INT16 CallINT( SbiDllProc, char *, short ) { return 0; } +INT32 CallLNG( SbiDllProc, char *, short ) { return 0; } +float CallSNG( SbiDllProc, char *, short ) { return 0; } +double CallDBL( SbiDllProc, char *, short) { return 0; } +char* CallSTR( SbiDllProc, char *, short ) { return 0; } +#endif +} + +SV_IMPL_OP_PTRARR_SORT(ImplDllArr,ByteStringPtr) + +/* mit Optimierung An stuerzt unter Win95 folgendes Makro ab: +declare Sub MessageBeep Lib "user32" (ByVal long) +sub main + MessageBeep( 1 ) +end sub +*/ +#if defined (WNT) && defined (MSC) +//#pragma optimize ("", off) +#endif + +// +// *********************************************************************** +// + +class ImplSbiProc : public ByteString +{ + SbiDllProc pProc; + ImplSbiProc(); + ImplSbiProc( const ImplSbiProc& ); + +public: + ImplSbiProc( const ByteString& rName, SbiDllProc pFunc ) + : ByteString( rName ) { pProc = pFunc; } + SbiDllProc GetProc() const { return pProc; } +}; + +// +// *********************************************************************** +// + +class ImplSbiDll : public ByteString +{ + ImplDllArr aProcArr; + SbiDllHandle hDLL; + + ImplSbiDll( const ImplSbiDll& ); +public: + ImplSbiDll( const ByteString& rName, SbiDllHandle hHandle ) + : ByteString( rName ) { hDLL = hHandle; } + ~ImplSbiDll(); + SbiDllHandle GetHandle() const { return hDLL; } + SbiDllProc GetProc( const ByteString& rName ) const; + void InsertProc( const ByteString& rName, SbiDllProc pProc ); +}; + +ImplSbiDll::~ImplSbiDll() +{ + USHORT nCount = aProcArr.Count(); + for( USHORT nCur = 0; nCur < nCount; nCur++ ) + { + ImplSbiProc* pProc = (ImplSbiProc*)aProcArr.GetObject( nCur ); + delete pProc; + } +} + +SbiDllProc ImplSbiDll::GetProc( const ByteString& rName ) const +{ + USHORT nPos; + BOOL bRet = aProcArr.Seek_Entry( (ByteStringPtr)&rName, &nPos ); + if( bRet ) + { + ImplSbiProc* pImplProc = (ImplSbiProc*)aProcArr.GetObject(nPos); + return pImplProc->GetProc(); + } + return (SbiDllProc)0; +} + +void ImplSbiDll::InsertProc( const ByteString& rName, SbiDllProc pProc ) +{ + DBG_ASSERT(aProcArr.Seek_Entry((ByteStringPtr)&rName,0)==0,"InsertProc: Already in table"); + ImplSbiProc* pImplProc = new ImplSbiProc( rName, pProc ); + aProcArr.Insert( (ByteStringPtr)pImplProc ); +} + + +// +// *********************************************************************** +// + +SbiDllMgr::SbiDllMgr( const SbiDllMgr& ) +{ +} + +SbiDllMgr::SbiDllMgr() +{ +} + +SbiDllMgr::~SbiDllMgr() +{ + USHORT nCount = aDllArr.Count(); + for( USHORT nCur = 0; nCur < nCount; nCur++ ) + { + ImplSbiDll* pDll = (ImplSbiDll*)aDllArr.GetObject( nCur ); + FreeDllHandle( pDll->GetHandle() ); + delete pDll; + } +} + +void SbiDllMgr::FreeDll( const ByteString& rDllName ) +{ + USHORT nPos; + BOOL bRet = aDllArr.Seek_Entry( (ByteStringPtr)&rDllName, &nPos ); + if( bRet ) + { + ImplSbiDll* pDll = (ImplSbiDll*)aDllArr.GetObject(nPos); + FreeDllHandle( pDll->GetHandle() ); + delete pDll; + aDllArr.Remove( nPos, 1 ); + } +} + + +ImplSbiDll* SbiDllMgr::GetDll( const ByteString& rDllName ) +{ + USHORT nPos; + ImplSbiDll* pDll = 0; + BOOL bRet = aDllArr.Seek_Entry( (ByteStringPtr)&rDllName, &nPos ); + if( bRet ) + pDll = (ImplSbiDll*)aDllArr.GetObject(nPos); + else + { + SbiDllHandle hDll = CreateDllHandle( rDllName ); + if( hDll ) + { + pDll = new ImplSbiDll( rDllName, hDll ); + aDllArr.Insert( (ByteStringPtr)pDll ); + } + } + return pDll; +} + +SbiDllProc SbiDllMgr::GetProc( ImplSbiDll* pDll, const ByteString& rProcName ) +{ + DBG_ASSERT(pDll,"GetProc: No dll-ptr"); + SbiDllProc pProc; + pProc = pDll->GetProc( rProcName ); + if( !pProc ) + { + pProc = GetProcAddr( pDll->GetHandle(), rProcName ); + if( pProc ) + pDll->InsertProc( rProcName, pProc ); + } + return pProc; +} + + +SbError SbiDllMgr::Call( const char* pProcName, const char* pDllName, + SbxArray* pArgs, SbxVariable& rResult, BOOL bCDecl ) +{ + DBG_ASSERT(pProcName&&pDllName,"Call: Bad parms"); + SbError nSbErr = 0; + ByteString aDllName( pDllName ); + CheckDllName( aDllName ); + ImplSbiDll* pDll = GetDll( aDllName ); + if( pDll ) + { + SbiDllProc pProc = GetProc( pDll, pProcName ); + if( pProc ) + { + if( bCDecl ) + nSbErr = CallProcC( pProc, pArgs, rResult ); + else + nSbErr = CallProc( pProc, pArgs, rResult ); + } + else + nSbErr = SbERR_PROC_UNDEFINED; + } + else + nSbErr = SbERR_BAD_DLL_LOAD; + return nSbErr; +} + +// *********************************************************************** +// ******************* abhaengige Implementationen *********************** +// *********************************************************************** + +void SbiDllMgr::CheckDllName( ByteString& rDllName ) +{ +#if defined(WIN) || defined(WNT) // || defined(OS2) + if( rDllName.Search('.') == STRING_NOTFOUND ) + rDllName += ".DLL"; +#endif +} + + +SbiDllHandle SbiDllMgr::CreateDllHandle( const ByteString& rDllName ) +{ +#if defined(MAC) || defined(UNX) + SbiDllHandle hLib=0; +#else + SbiDllHandle hLib; +#endif + +#if defined(WIN) + hLib = LoadLibrary( (const char*)rDllName ); + if( (ULONG)hLib < 32 ) + hLib = 0; + +#elif defined(WNT) + hLib = LoadLibrary( rDllName.GetBuffer() ); + if( !(ULONG)hLib ) + { +#ifdef DBG_UTIL + ULONG nLastErr = GetLastError(); +#endif + hLib = 0; + } + +#elif defined(OS2) + char cErr[ 100 ]; + if( DosLoadModule( (PSZ) cErr, 100, (const char*)rDllName, &hLib ) ) + hLib = 0; +#endif + return hLib; +} + +void SbiDllMgr::FreeDllHandle( SbiDllHandle hLib ) +{ +#if defined(WIN) || defined(WNT) + if( hLib ) + FreeLibrary ((HINSTANCE) hLib); +#elif defined(OS2) + if( hLib ) + DosFreeModule( (HMODULE) hLib ); +#endif +} + +SbiDllProc SbiDllMgr::GetProcAddr(SbiDllHandle hLib, const ByteString& rProcName) +{ + char buf1 [128]; + char buf2 [128]; + + SbiDllProc pProc = 0; + short nOrd = 0; + + // Ordinal? + if( rProcName.GetBuffer()[0] == '@' ) + nOrd = atoi( rProcName.GetBuffer()+1 ); + + // Moegliche Parameter weg: + strcpy( buf1, rProcName.GetBuffer() ); + char *p = strchr( buf1, '#' ); + if( p ) + *p = 0; + strcpy( buf2, "_" ); + strcat( buf2, buf1 ); + +#if defined(WIN) || defined(WNT) + if( nOrd > 0 ) + pProc = (SbiDllProc)GetProcAddress( hLib, (char*)(long) nOrd ); + else + { + // 2. mit Parametern: + pProc = (SbiDllProc)GetProcAddress ( hLib, rProcName.GetBuffer() ); + // 3. nur der Name: + if (!pProc) + pProc = (SbiDllProc)GetProcAddress( hLib, buf1 ); + // 4. der Name mit Underline vorweg: + if( !pProc ) + pProc = (SbiDllProc)GetProcAddress( hLib, buf2 ); + } + +#elif defined(OS2) + PSZ pp; + APIRET rc; + // 1. Ordinal oder mit Parametern: + rc = DosQueryProcAddr( hLib, nOrd, pp = (char*)rProcName.GetStr(), &pProc ); + // 2. nur der Name: + if( rc ) + rc = DosQueryProcAddr( hLib, 0, pp = (PSZ)buf1, &pProc ); + // 3. der Name mit Underline vorweg: + if( rc ) + rc = DosQueryProcAddr( hLib, 0, pp = (PSZ)buf2, &pProc ); + if( rc ) + pProc = NULL; + else + { + // 16-bit oder 32-bit? + ULONG nInfo = 0; + if( DosQueryProcType( hLib, nOrd, pp, &nInfo ) ) + nInfo = 0;; + } +#endif + return pProc; +} + +SbError SbiDllMgr::CallProc( SbiDllProc pProc, SbxArray* pArgs, + SbxVariable& rResult ) +{ +// ByteString aStr("Calling DLL at "); +// aStr += (ULONG)pProc; +// InfoBox( 0, aStr ).Execute(); + INT16 nInt16; int nInt; INT32 nInt32; float nSingle; double nDouble; + char* pStr; + + USHORT nSize; + char* pStack = (char*)CreateStack( pArgs, nSize ); + switch( rResult.GetType() ) + { + case SbxINTEGER: + nInt16 = CallINT(pProc, pStack, (short)nSize ); + rResult.PutInteger( nInt16 ); + break; + + case SbxUINT: + case SbxUSHORT: + nInt16 = (INT16)CallINT(pProc, pStack, (short)nSize ); + rResult.PutUShort( (USHORT)nInt16 ); + break; + + case SbxERROR: + nInt16 = (INT16)CallINT(pProc, pStack, (short)nSize ); + rResult.PutErr( (USHORT)nInt16 ); + break; + + case SbxINT: + nInt = CallINT(pProc, pStack, (short)nSize ); + rResult.PutInt( nInt ); + break; + + case SbxLONG: + nInt32 = CallLNG(pProc, pStack, (short)nSize ); + rResult.PutLong( nInt32 ); + break; + + case SbxULONG: + nInt32 = CallINT(pProc, pStack, (short)nSize ); + rResult.PutULong( (ULONG)nInt32 ); + break; + +#ifndef WNT + case SbxSINGLE: + nSingle = CallSNG(pProc, pStack, (short)nSize ); + rResult.PutSingle( nSingle ); + break; +#endif + + case SbxDOUBLE: +#ifdef WNT + case SbxSINGLE: +#endif + nDouble = CallDBL(pProc, pStack, (short)nSize ); + rResult.PutDouble( nDouble ); + break; + + case SbxDATE: + nDouble = CallDBL(pProc, pStack, (short)nSize ); + rResult.PutDate( nDouble ); + break; + + case SbxCHAR: + case SbxBYTE: + case SbxBOOL: + nInt16 = CallINT(pProc, pStack, (short)nSize ); + rResult.PutByte( (BYTE)nInt16 ); + break; + + case SbxSTRING: + case SbxLPSTR: + pStr = CallSTR(pProc, pStack, (short)nSize ); + rResult.PutString( String::CreateFromAscii( pStr ) ); + break; + + case SbxNULL: + case SbxEMPTY: + nInt16 = CallINT(pProc, pStack, (short)nSize ); + // Rueckgabe nur zulaessig, wenn variant! + if( !rResult.IsFixed() ) + rResult.PutInteger( nInt16 ); + break; + + case SbxCURRENCY: + case SbxOBJECT: + case SbxDATAOBJECT: + default: + CallINT(pProc, pStack, (short)nSize ); + break; + } + delete pStack; + + if( pArgs ) + { + // die Laengen aller uebergebenen Strings anpassen + USHORT nCount = pArgs->Count(); + for( USHORT nCur = 1; nCur < nCount; nCur++ ) + { + SbxVariable* pVar = pArgs->Get( nCur ); + BOOL bIsString = ( pVar->GetType() == SbxSTRING ) || + ( pVar->GetType() == SbxLPSTR ); + + if( pVar->GetFlags() & SBX_REFERENCE ) + { + pVar->ResetFlag( SBX_REFERENCE ); // Sbx moechte es so + if( bIsString ) + { + ByteString aByteStr( (char*)pVar->GetUserData() ); + String aStr( aByteStr, gsl_getSystemTextEncoding() ); + pVar->PutString( aStr ); + } + } + if( bIsString ) + { + delete (char*)(pVar->GetUserData()); + pVar->SetUserData( 0 ); + } + } + } + return 0; +} + +SbError SbiDllMgr::CallProcC( SbiDllProc pProc, SbxArray* pArgs, + SbxVariable& rResult ) +{ + DBG_ERROR("C calling convention not supported"); + return (USHORT)SbERR_BAD_ARGUMENT; +} + +void* SbiDllMgr::CreateStack( SbxArray* pArgs, USHORT& rSize ) +{ + if( !pArgs ) + { + rSize = 0; + return 0; + } + char* pStack = new char[ 2048 ]; + char* pTop = pStack; + USHORT nCount = pArgs->Count(); + // erstes Element ueberspringen +#ifndef WIN + for( USHORT nCur = 1; nCur < nCount; nCur++ ) +#else + // unter 16-Bit Windows anders rum (OS/2 ?????) + for( USHORT nCur = nCount-1; nCur >= 1; nCur-- ) +#endif + { + SbxVariable* pVar = pArgs->Get( nCur ); + // AB 22.1.1996, Referenz + if( pVar->GetFlags() & SBX_REFERENCE ) // Es ist eine Referenz + { + switch( pVar->GetType() ) + { + case SbxINTEGER: + case SbxUINT: + case SbxINT: + case SbxUSHORT: + case SbxLONG: + case SbxULONG: + case SbxSINGLE: + case SbxDOUBLE: + case SbxCHAR: + case SbxBYTE: + case SbxBOOL: + *((void**)pTop) = (void*)&(pVar->aData); + pTop += sizeof( void* ); + break; + + case SbxSTRING: + case SbxLPSTR: + { + USHORT nLen = 256; + ByteString rStr( pVar->GetString(), gsl_getSystemTextEncoding() ); + if( rStr.Len() > 255 ) + nLen = rStr.Len() + 1; + + char* pStr = new char[ nLen ]; + strcpy( pStr, rStr.GetBuffer() ); + // ist nicht so sauber, aber wir sparen ein Pointerarray + DBG_ASSERT(sizeof(UINT32)>=sizeof(char*),"Gleich krachts im Basic"); + pVar->SetUserData( (UINT32)pStr ); + *((const char**)pTop) = pStr; + pTop += sizeof( char* ); + } + break; + + case SbxNULL: + case SbxEMPTY: + case SbxERROR: + case SbxDATE: + case SbxCURRENCY: + case SbxOBJECT: + case SbxDATAOBJECT: + default: + break; + } + } + else + { + // ByVal + switch( pVar->GetType() ) + { + case SbxINTEGER: + case SbxUINT: + case SbxINT: + case SbxUSHORT: + *((INT16*)pTop) = pVar->GetInteger(); + pTop += sizeof( INT16 ); + break; + + case SbxLONG: + case SbxULONG: + *((INT32*)pTop) = pVar->GetLong(); + pTop += sizeof( INT32 ); + break; + + case SbxSINGLE: + *((float*)pTop) = pVar->GetSingle(); + pTop += sizeof( float ); + break; + + case SbxDOUBLE: + *((double*)pTop) = pVar->GetDouble(); + pTop += sizeof( double ); + break; + + case SbxSTRING: + case SbxLPSTR: + { + char* pStr = new char[ pVar->GetString().Len() + 1 ]; + ByteString aByteStr( pVar->GetString(), gsl_getSystemTextEncoding() ); + strcpy( pStr, aByteStr.GetBuffer() ); + // ist nicht so sauber, aber wir sparen ein Pointerarray + DBG_ASSERT(sizeof(UINT32)>=sizeof(char*),"Gleich krachts im Basic"); + pVar->SetUserData( (UINT32)pStr ); + *((const char**)pTop) = pStr; + pTop += sizeof( char* ); + } + break; + + case SbxCHAR: + case SbxBYTE: + case SbxBOOL: + *((BYTE*)pTop) = pVar->GetByte(); + pTop += sizeof( BYTE ); + break; + + case SbxNULL: + case SbxEMPTY: + case SbxERROR: + case SbxDATE: + case SbxCURRENCY: + case SbxOBJECT: + case SbxDATAOBJECT: + default: + break; + } + } + } + rSize = (USHORT)((ULONG)pTop - (ULONG)pStack); + return pStack; +} + + + + diff --git a/basic/source/runtime/dllmgr.hxx b/basic/source/runtime/dllmgr.hxx new file mode 100644 index 000000000000..dafe6942c518 --- /dev/null +++ b/basic/source/runtime/dllmgr.hxx @@ -0,0 +1,135 @@ +/************************************************************************* + * + * $RCSfile: dllmgr.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _DLLMGR_HXX +#define _DLLMGR_HXX + +#define _SVSTDARR_BYTESTRINGSSORT +#ifndef _SVARRAY_HXX //autogen +#include <svtools/svarray.hxx> +#endif +#ifndef _SVSTDARR_HXX //autogen +#include <svtools/svstdarr.hxx> +#endif + +// !!! nur zum debuggen fuer infoboxes !!! +//#ifndef _SV_HXX +//#include <sv.hxx> +//#endif + +//#ifndef _TOOLS_HXX +//#include <tools.hxx> +//#endif +#if SUPD > 340 +#define _SVSTDARR_STRINGS +//#ifndef _SVSTDARR_HXX +//#include <svstdarr.hxx> +//#endif +#else +//#include <svmem.hxx> +#endif +#ifndef _SBERRORS_HXX +#include <sberrors.hxx> +#endif + +class SbxArray; +class SbxVariable; + +class ImplSbiDll; +class ImplSbiProc; + +SV_DECL_PTRARR_SORT(ImplDllArr,ByteStringPtr,5,5) + +class SbiDllMgr +{ + ImplDllArr aDllArr; + + SbiDllMgr( const SbiDllMgr& ); + +#ifdef _DLLMGR_CXX + ImplSbiDll* GetDll( const ByteString& rDllName ); + SbiDllProc GetProc( ImplSbiDll*, const ByteString& rProcName ); + + SbiDllHandle CreateDllHandle( const ByteString& rDllName ); + void FreeDllHandle( SbiDllHandle ); + SbiDllProc GetProcAddr( SbiDllHandle, const ByteString& pProcName ); + SbError CallProc( SbiDllProc pProc, SbxArray* pArgs, + SbxVariable& rResult ); + SbError CallProcC( SbiDllProc pProc, SbxArray* pArgs, + SbxVariable& rResult ); + void* CreateStack( SbxArray* pArgs, USHORT& rSize ); + void CheckDllName( ByteString& rName ); +#endif + +public: + SbiDllMgr(); + ~SbiDllMgr(); + + SbError Call( const char* pFunc, const char* pDll, + SbxArray* pArgs, SbxVariable& rResult, + BOOL bCDecl ); + + void FreeDll( const ByteString& rDllName ); +}; + + + +#endif diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx new file mode 100644 index 000000000000..236bf9e1e8a7 --- /dev/null +++ b/basic/source/runtime/inputbox.cxx @@ -0,0 +1,247 @@ +/************************************************************************* + * + * $RCSfile: inputbox.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 NOOLDSV //autogen +#include <vcl/system.hxx> +#endif +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif +#ifndef _SV_EDIT_HXX //autogen +#include <vcl/edit.hxx> +#endif +#ifndef _SV_DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif +#ifndef _SV_SVAPP_HXX +#include <vcl/svapp.hxx> +#endif +#include <svtools/sbx.hxx> +#include "runtime.hxx" +#pragma hdrstop +#include "stdobj.hxx" +#include "rtlproto.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + + +class SvRTLInputBox : public ModalDialog +{ + Edit aEdit; + OKButton aOk; + CancelButton aCancel; + FixedText aPromptText; + String aText; + + void PositionDialog( long nXTwips, long nYTwips, const Size& rDlgSize ); + void InitButtons( const Size& rDlgSize ); + void PositionEdit( const Size& rDlgSize ); + void PositionPrompt( const String& rPrompt, const Size& rDlgSize ); + DECL_LINK( OkHdl, Button * ); + DECL_LINK( CancelHdl, Button * ); + +public: + SvRTLInputBox( Window* pParent, const String& rPrompt, const String& rTitle, + const String& rDefault, long nXTwips = -1, long nYTwips = -1 ); + String GetText() const { return aText; } +}; + +SvRTLInputBox::SvRTLInputBox( Window* pParent, const String& rPrompt, + const String& rTitle, const String& rDefault, + long nXTwips, long nYTwips ) : + ModalDialog( pParent,WB_SVLOOK | WB_MOVEABLE | WB_CLOSEABLE ), + aEdit( this, WB_LEFT | WB_BORDER ), + aOk( this ), aCancel( this ), aPromptText( this, WB_WORDBREAK ) +{ + SetMapMode( MapMode( MAP_APPFONT ) ); + Size aDlgSizeApp( 280, 80 ); + PositionDialog( nXTwips, nYTwips, aDlgSizeApp ); + InitButtons( aDlgSizeApp ); + PositionEdit( aDlgSizeApp ); + PositionPrompt( rPrompt, aDlgSizeApp ); + aOk.Show(); + aCancel.Show(); + aEdit.Show(); + aPromptText.Show(); + SetText( rTitle ); + Font aFont( GetFont()); + Color aColor( GetBackgroundBrush().GetFillColor()); + aFont.SetFillColor( aColor ); + aEdit.SetFont( aFont ); + aEdit.SetText( rDefault ); + aEdit.SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) ); +} + +void SvRTLInputBox::InitButtons( const Size& rDlgSize ) +{ + aOk.SetSizePixel( LogicToPixel( Size( 45, 15) )); + aCancel.SetSizePixel( LogicToPixel( Size( 45, 15) )); + Point aPos( rDlgSize.Width()-45-10, 5 ); + aOk.SetPosPixel( LogicToPixel( Point(aPos) )); + aPos.Y() += 16; + aCancel.SetPosPixel( LogicToPixel( Point(aPos) )); + aOk.SetClickHdl(LINK(this,SvRTLInputBox, OkHdl)); + aCancel.SetClickHdl(LINK(this,SvRTLInputBox,CancelHdl)); +} + +void SvRTLInputBox::PositionDialog(long nXTwips, long nYTwips, const Size& rDlgSize) +{ + Size aScreenSzApp(Window::GetOutputSizePixel()); + aScreenSzApp = PixelToLogic( aScreenSzApp ); + + Point aDlgPosApp( nXTwips, nYTwips ); + aDlgPosApp = LogicToPixel( aDlgPosApp, MAP_TWIP ); + aDlgPosApp = PixelToLogic( aDlgPosApp ); + if ( nXTwips == -1 || nYTwips == -1 || + aDlgPosApp.X() >= aScreenSzApp.Width() || + aDlgPosApp.Y() >= aScreenSzApp.Height() ) + { + aDlgPosApp.X() = ( aScreenSzApp.Width() - rDlgSize.Width() ) / 2; + aDlgPosApp.Y() = ( aScreenSzApp.Height() - rDlgSize.Height() ) / 2; + } + SetSizePixel( LogicToPixel(rDlgSize) ); + SetPosPixel( LogicToPixel(aDlgPosApp) ); +} + +void SvRTLInputBox::PositionEdit( const Size& rDlgSize ) +{ + aEdit.SetPosPixel( LogicToPixel( Point( 5,rDlgSize.Height()-35))); + aEdit.SetSizePixel( LogicToPixel( Size(rDlgSize.Width()-15,12))); +} + + +void SvRTLInputBox::PositionPrompt(const String& rPrompt,const Size& rDlgSize) +{ + if ( rPrompt.Len() == 0 ) + return; + String aText( rPrompt ); + aText.ConvertLineEnd( LINEEND_CR ); + aPromptText.SetPosPixel( LogicToPixel(Point(5,5))); + aPromptText.SetText( aText ); + Size aSize( rDlgSize ); + aSize.Width() -= 70; + aSize.Height() -= 50; + aPromptText.SetSizePixel( LogicToPixel(aSize)); +} + + +IMPL_LINK_INLINE_START( SvRTLInputBox, OkHdl, Button *, pButton ) +{ + aText = aEdit.GetText(); + EndDialog( 1 ); + return 0; +} +IMPL_LINK_INLINE_END( SvRTLInputBox, OkHdl, Button *, pButton ) + +IMPL_LINK_INLINE_START( SvRTLInputBox, CancelHdl, Button *, pButton ) +{ + aText.Erase(); + EndDialog( 0 ); + return 0; +} +IMPL_LINK_INLINE_END( SvRTLInputBox, CancelHdl, Button *, pButton ) + + +// ********************************************************************* +// ********************************************************************* +// ********************************************************************* + +// Syntax: String InputBox( Prompt, [Title], [Default] [, nXpos, nYpos ] ) + +RTLFUNC(InputBox) +{ + ULONG nArgCount = rPar.Count(); + if ( nArgCount < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aTitle; + String aDefault; + INT32 nX = -1, nY = -1; // zentrieren + const String& rPrompt = rPar.Get(1)->GetString(); + if ( nArgCount > 2 ) + aTitle = rPar.Get(2)->GetString(); + if ( nArgCount > 3 ) + aDefault = rPar.Get(3)->GetString(); + if ( nArgCount > 4 ) + { + if ( nArgCount != 6 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + nX = rPar.Get(4)->GetLong(); + nY = rPar.Get(5)->GetLong(); + } + SvRTLInputBox *pDlg=new SvRTLInputBox(GetpApp()->GetDefModalDialogParent(), + rPrompt,aTitle,aDefault,nX,nY); + pDlg->Execute(); + rPar.Get(0)->PutString( pDlg->GetText() ); + delete pDlg; + } +} + + + diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx new file mode 100644 index 000000000000..d2861c32ba13 --- /dev/null +++ b/basic/source/runtime/iosys.cxx @@ -0,0 +1,1257 @@ +/************************************************************************* + * + * $RCSfile: iosys.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SV_DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif +#ifndef _SV_EDIT_HXX //autogen +#include <vcl/edit.hxx> +#endif +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/button.hxx> +#endif +#ifndef _SV_MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#include <osl/security.h> + +#include "runtime.hxx" + +#ifdef _USE_UNO + +// <-- encoding +#ifdef UNX +#include <alloca.h> +#endif +#ifdef WNT +#include <malloc.h> +#define alloca _alloca +#endif +#include <ctype.h> +#include <rtl/byteseq.hxx> +#ifndef _RTL_TEXTENC_H +#include <rtl/textenc.h> +#endif +#ifndef _RTL_USTRBUF_HXX_ +#include <rtl/ustrbuf.hxx> +#endif +#ifndef _RTL_TEXTENC_H +#include <rtl/textenc.h> +#endif +#ifndef _RTL_USTRBUF_HXX_ +#include <rtl/ustrbuf.hxx> +#endif +// encoding --> + +#include <unotools/processfactory.hxx> + +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/io/XSeekable.hpp> +#include <com/sun/star/bridge/XBridge.hpp> +#include <com/sun/star/bridge/XBridgeFactory.hpp> + +using namespace utl; +using namespace rtl; +using namespace com::sun::star::uno; +using namespace com::sun::star::lang; +using namespace com::sun::star::ucb; +using namespace com::sun::star::io; +using namespace com::sun::star::bridge; + +#endif /* _USE_UNO */ + +#pragma hdrstop +#include "iosys.hxx" +#include "sbintern.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + +// Der Input-Dialog: + +class SbiInputDialog : public ModalDialog { + Edit aInput; + OKButton aOk; + CancelButton aCancel; + String aText; + DECL_LINK( Ok, Window * ); + DECL_LINK( Cancel, Window * ); +public: + SbiInputDialog( Window*, const String& ); + const String& GetInput() { return aText; } +}; + +SbiInputDialog::SbiInputDialog( Window* pParent, const String& rPrompt ) + :ModalDialog( pParent, WB_SVLOOK | WB_MOVEABLE | WB_CLOSEABLE ), + aInput( this, WB_SVLOOK | WB_LEFT | WB_BORDER ), + aOk( this ), aCancel( this ) +{ + SetText( rPrompt ); + aOk.SetClickHdl( LINK( this, SbiInputDialog, Ok ) ); + aCancel.SetClickHdl( LINK( this, SbiInputDialog, Cancel ) ); + SetMapMode( MapMode( MAP_APPFONT ) ); + + Point aPt = LogicToPixel( Point( 50, 50 ) ); + Size aSz = LogicToPixel( Size( 145, 65 ) ); + SetPosSizePixel( aPt, aSz ); + aPt = LogicToPixel( Point( 10, 10 ) ); + aSz = LogicToPixel( Size( 120, 12 ) ); + aInput.SetPosSizePixel( aPt, aSz ); + aPt = LogicToPixel( Point( 15, 30 ) ); + aSz = LogicToPixel( Size( 45, 15) ); + aOk.SetPosSizePixel( aPt, aSz ); + aPt = LogicToPixel( Point( 80, 30 ) ); + aSz = LogicToPixel( Size( 45, 15) ); + aCancel.SetPosSizePixel( aPt, aSz ); + + aInput.Show(); + aOk.Show(); + aCancel.Show(); +} + +IMPL_LINK_INLINE_START( SbiInputDialog, Ok, Window *, pWindow ) +{ + aText = aInput.GetText(); + EndDialog( 1 ); + return 0; +} +IMPL_LINK_INLINE_END( SbiInputDialog, Ok, Window *, pWindow ) + +IMPL_LINK_INLINE_START( SbiInputDialog, Cancel, Window *, pWindow ) +{ + EndDialog( 0 ); + return 0; +} +IMPL_LINK_INLINE_END( SbiInputDialog, Cancel, Window *, pWindow ) + +////////////////////////////////////////////////////////////////////////// + +SbiStream::SbiStream() + : pStrm( 0 ) +{ +} + +SbiStream::~SbiStream() +{ + delete pStrm; +} + +// Ummappen eines SvStream-Fehlers auf einen StarBASIC-Code + +void SbiStream::MapError() +{ + if( pStrm ) + switch( pStrm->GetError() ) + { + case SVSTREAM_OK: + nError = 0; break; + case SVSTREAM_FILE_NOT_FOUND: + nError = SbERR_FILE_NOT_FOUND; break; + case SVSTREAM_PATH_NOT_FOUND: + nError = SbERR_PATH_NOT_FOUND; break; + case SVSTREAM_TOO_MANY_OPEN_FILES: + nError = SbERR_TOO_MANY_FILES; break; + case SVSTREAM_ACCESS_DENIED: + nError = SbERR_ACCESS_DENIED; break; + case SVSTREAM_INVALID_PARAMETER: + nError = SbERR_BAD_ARGUMENT; break; + case SVSTREAM_OUTOFMEMORY: + nError = SbERR_NO_MEMORY; break; + default: + nError = SbERR_IO_ERROR; break; + } +} + +#ifdef _USE_UNO + +// TODO: Code is copied from daemons2/source/uno/asciiEncoder.cxx + +namespace basicEncoder +{ + enum EncodeMechanism + { + ENCODE_ALL, + WAS_ENCODED, + NOT_CANONIC + }; + + enum DecodeMechanism + { + NO_DECODE, + DECODE_TO_IURI, + DECODE_WITH_CHARSET + }; + + enum EscapeType + { + ESCAPE_NO, + ESCAPE_OCTET, + ESCAPE_UTF32 + }; + + inline bool isUSASCII(sal_uInt32 nChar) + { + return nChar <= 0x7F; + } + + inline bool isDigit(sal_uInt32 nChar) + { + return nChar >= '0' && nChar <= '9'; + } + + inline int getHexWeight(sal_uInt32 nChar) + { + return isDigit(nChar) ? int(nChar - '0') : + nChar >= 'A' && nChar <= 'F' ? int(nChar - 'A' + 10) : + nChar >= 'a' && nChar <= 'f' ? int(nChar - 'a' + 10) : -1; + } + + inline bool isHighSurrogate(sal_uInt32 nUTF16) + { + return nUTF16 >= 0xD800 && nUTF16 <= 0xDBFF; + } + + inline bool isLowSurrogate(sal_uInt32 nUTF16) + { + return nUTF16 >= 0xDC00 && nUTF16 <= 0xDFFF; + } + + sal_uInt32 getHexDigit(int nWeight) + { + OSL_ASSERT(nWeight >= 0 && nWeight < 16); + static sal_Char const aDigits[16] + = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', + 'D', 'E', 'F' }; + return aDigits[nWeight]; + } + + inline void appendEscape(rtl::OUStringBuffer & rTheText, + sal_Char cEscapePrefix, sal_uInt32 nOctet) + { + rTheText.append(sal_Unicode(cEscapePrefix)); + rTheText.append(sal_Unicode(getHexDigit(int(nOctet >> 4)))); + rTheText.append(sal_Unicode(getHexDigit(int(nOctet & 15)))); + } + + inline sal_uInt32 getUTF32Character(sal_Unicode const *& rBegin, + sal_Unicode const * pEnd) + { + OSL_ASSERT(rBegin && rBegin < pEnd); + if (rBegin + 1 < pEnd && rBegin[0] >= 0xD800 && rBegin[0] <= 0xDBFF + && rBegin[1] >= 0xDC00 && rBegin[1] <= 0xDFFF) + { + sal_uInt32 nUTF32 = sal_uInt32(*rBegin++ & 0x3FF) << 10; + return (nUTF32 | (*rBegin++ & 0x3FF)) + 0x10000; + } + else + return *rBegin++; + } + + sal_uInt32 getUTF32(sal_Unicode const *& rBegin, sal_Unicode const * pEnd, + bool bOctets, sal_Char cEscapePrefix, + EncodeMechanism eMechanism, rtl_TextEncoding eCharset, + EscapeType & rEscapeType) + { + OSL_ASSERT(rBegin < pEnd); + sal_uInt32 nUTF32 = bOctets ? *rBegin++ : getUTF32Character(rBegin, pEnd); + switch (eMechanism) + { + case ENCODE_ALL: + rEscapeType = ESCAPE_NO; + break; + + case WAS_ENCODED: + { + int nWeight1; + int nWeight2; + if (nUTF32 == cEscapePrefix && rBegin + 1 < pEnd + && (nWeight1 = getHexWeight(rBegin[0])) >= 0 + && (nWeight2 = getHexWeight(rBegin[1])) >= 0) + { + rBegin += 2; + nUTF32 = nWeight1 << 4 | nWeight2; + switch (eCharset) + { + default: + OSL_ASSERT(false); + case RTL_TEXTENCODING_ASCII_US: + rEscapeType + = isUSASCII(nUTF32) ? ESCAPE_UTF32 : ESCAPE_OCTET; + break; + + case RTL_TEXTENCODING_ISO_8859_1: + rEscapeType = ESCAPE_UTF32; + break; + + case RTL_TEXTENCODING_UTF8: + if (isUSASCII(nUTF32)) + rEscapeType = ESCAPE_UTF32; + else + { + if (nUTF32 >= 0xC0 && nUTF32 <= 0xF4) + { + sal_uInt32 nEncoded; + int nShift; + sal_uInt32 nMin; + if (nUTF32 <= 0xDF) + { + nEncoded = (nUTF32 & 0x1F) << 6; + nShift = 0; + nMin = 0x80; + } + else if (nUTF32 <= 0xEF) + { + nEncoded = (nUTF32 & 0x0F) << 12; + nShift = 6; + nMin = 0x800; + } + else + { + nEncoded = (nUTF32 & 0x07) << 18; + nShift = 12; + nMin = 0x10000; + } + sal_Unicode const * p = rBegin; + bool bUTF8 = true; + for (;;) + { + if (p + 2 >= pEnd || p[0] != cEscapePrefix + || (nWeight1 = getHexWeight(p[1])) < 0 + || (nWeight2 = getHexWeight(p[2])) < 0 + || nWeight1 < 8) + { + bUTF8 = false; + break; + } + p += 3; + nEncoded + |= ((nWeight1 & 3) << 4 | nWeight2) + << nShift; + if (nShift == 0) + break; + nShift -= 6; + } + if (bUTF8 && nEncoded >= nMin + && !isHighSurrogate(nEncoded) + && !isLowSurrogate(nEncoded) + && nEncoded <= 0x10FFFF) + { + rBegin = p; + nUTF32 = nEncoded; + rEscapeType = ESCAPE_UTF32; + break; + } + } + rEscapeType = ESCAPE_OCTET; + } + break; + } + } + else + rEscapeType = ESCAPE_NO; + break; + } + + case NOT_CANONIC: + { + int nWeight1; + int nWeight2; + if (nUTF32 == cEscapePrefix && rBegin + 1 < pEnd + && ((nWeight1 = getHexWeight(rBegin[0])) >= 0) + && ((nWeight2 = getHexWeight(rBegin[1])) >= 0)) + { + rBegin += 2; + nUTF32 = nWeight1 << 4 | nWeight2; + rEscapeType = ESCAPE_OCTET; + } + else + rEscapeType = ESCAPE_NO; + break; + } + } + return nUTF32; + } + + static rtl::OUString decodeImpl(sal_Unicode const * pBegin, + sal_Unicode const * pEnd, sal_Char cEscapePrefix, + DecodeMechanism eMechanism, + rtl_TextEncoding eCharset) + { + switch (eMechanism) + { + case NO_DECODE: + return rtl::OUString(pBegin, pEnd - pBegin); + + case DECODE_TO_IURI: + eCharset = RTL_TEXTENCODING_UTF8; + break; + } + rtl::OUStringBuffer aResult; + while (pBegin < pEnd) + { + EscapeType eEscapeType; + sal_uInt32 nUTF32 = getUTF32(pBegin, pEnd, false, cEscapePrefix, + WAS_ENCODED, eCharset, eEscapeType); + switch (eEscapeType) + { + case ESCAPE_NO: + aResult.append(sal_Unicode(nUTF32)); + break; + + case ESCAPE_OCTET: + appendEscape(aResult, cEscapePrefix, nUTF32); + break; + + case ESCAPE_UTF32: + if (eMechanism == DECODE_TO_IURI && isUSASCII(nUTF32)) + appendEscape(aResult, cEscapePrefix, nUTF32); + else + aResult.append(sal_Unicode(nUTF32)); + break; + } + } + return aResult.makeStringAndClear(); + } + + + OUString AsciiEncoder::decodeUnoUrlParamValue(rtl::OUString const & rSource) + { + return decodeImpl(rSource.getStr(), rSource.getStr() + rSource.getLength(), + '%', DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8); + } + +} + + +OUString findUserInDescription( const OUString& aDescription ) +{ + OUString user; + + sal_Int32 index; + sal_Int32 lastIndex = 0; + +//#ifdef DEBUG + //OString tmp = OUStringToOString(aDescription, RTL_TEXTENCODING_ASCII_US); + //OSL_TRACE("Portal_XConnector %s\n", tmp.getStr()); +//#endif + + do + { + index = aDescription.indexOf((sal_Unicode) ',', lastIndex); + //OSL_TRACE("Portal_XConnector %d last_index %d\n", index, lastIndex); + OUString token = (index == -1) ? aDescription.copy(lastIndex) : aDescription.copy(lastIndex, index - lastIndex); + +//#ifdef DEBUG + //OString token_tmp = OUStringToOString(token, RTL_TEXTENCODING_ASCII_US); + //OSL_TRACE("Portal_XConnector - token %s\n", token_tmp.getStr()); +//#endif + + lastIndex = index + 1; + + sal_Int32 eindex = token.indexOf((sal_Unicode)'='); + OUString left = token.copy(0, eindex).toLowerCase().trim(); + OUString right = basicEncoder::AsciiEncoder::decodeUnoUrlParamValue(token.copy(eindex + 1).trim()); + +//#ifdef DEBUG + //OString left_tmp = OUStringToOString(left, RTL_TEXTENCODING_ASCII_US); + //OSL_TRACE("Portal_XConnector - left %s\n", left_tmp.getStr()); + //OString right_tmp = OUStringToOString(right, RTL_TEXTENCODING_ASCII_US); + //OSL_TRACE("Portal_XConnector - right %s\n", right_tmp.getStr()); +//#endif + + if(left.equals(OUString(RTL_CONSTASCII_USTRINGPARAM("user")))) + { + user = right; + break; + } + } + while(index != -1); + + return user; + + /* + ORef<IPortalConnector> connector; + + Reference<XConnection> xConnection; + + OUString protocol; + connector = getPortalConnector(protocol); + if(connector.isValid()) + { + ORef<IConnection> connection; + + OUString server; + if(host.getLength()) // let the server empty when there is no host + { + server += host; + server += OUString(RTL_CONSTASCII_USTRINGPARAM(":")); + server += port; + } + + RC state; + + if(user.getLength() && !ticket.getLength()) // if there is a user and no ticket + { + state = connector->connectToService(user, password, server, service, connection); + } + else + { + ByteSequence byteSequence_ticket = AsciiEncoder::decode(ticket); + + state = connector->connectToService(user, byteSequence_ticket, server, service, connection); + } + + if(state == E_None) + xConnection = new Portal_XConnection(connection); + else + throw ConnectionSetupException(OUString(RTL_CONSTASCII_USTRINGPARAM("Portal_XConnector::connect: could not connect")), Reference<XInterface>()); + } + else + throw ConnectionSetupException(OUString(RTL_CONSTASCII_USTRINGPARAM("Portal_XConnector::connect: couldn't get connector")), Reference<XInterface>()); + + return xConnection; + */ +} + +#endif + + + +BOOL needSecurityRestrictions( void ) +{ +#ifdef _USE_UNO + static BOOL bNeedInit = TRUE; + static BOOL bRetVal = TRUE; + + if( bNeedInit ) + { + bNeedInit = FALSE; + + // Get system user to compare to portal user + oslSecurity aSecurity = osl_getCurrentSecurity(); + OUString aSystemUser; + sal_Bool bRet = osl_getUserName( aSecurity, &aSystemUser.pData ); + if( !bRet ) + { + // No valid security! -> Secure mode! + return TRUE; + } + + Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); + if( !xSMgr.is() ) + return TRUE; + Reference< XBridgeFactory > xBridgeFac( xSMgr->createInstance + ( OUString::createFromAscii( "com.sun.star.bridge.BridgeFactory" ) ), UNO_QUERY ); + + Sequence< Reference< XBridge > > aBridgeSeq; + sal_Int32 nBridgeCount = 0; + if( xBridgeFac.is() ) + { + aBridgeSeq = xBridgeFac->getExistingBridges(); + nBridgeCount = aBridgeSeq.getLength(); + } + + if( nBridgeCount == 0 ) + { + // No bridges -> local + bRetVal = FALSE; + return bRetVal; + } + + // Iterate through all bridges to find (portal) user property + const Reference< XBridge >* pBridges = aBridgeSeq.getConstArray(); + bRetVal = FALSE; // Now only TRUE if user different from portal user is found + sal_Int32 i; + for( i = 0 ; i < nBridgeCount ; i++ ) + { + const Reference< XBridge >& rxBridge = pBridges[ i ]; + OUString aDescription = rxBridge->getDescription(); + OUString aPortalUser = findUserInDescription( aDescription ); + if( aPortalUser.getLength() > 0 ) + { + // User Found, compare to system user + if( aPortalUser == aSystemUser ) + { + // Same user -> system security is ok, bRetVal stays FALSE + break; + } + else + { + // Different user -> Secure mode! + bRetVal = TRUE; + break; + } + } + } + // No user found or PortalUser != SystemUser -> Secure mode! (Keep default value) + } + + return bRetVal; +#else + return FALSE; +#endif +} + +// Returns TRUE if UNO is available, otherwise the old +// file system implementation has to be used +// (Implemented in iosys.cxx) +BOOL hasUno( void ) +{ +#ifdef _USE_UNO + static BOOL bNeedInit = TRUE; + static BOOL bRetVal = TRUE; + + if( bNeedInit ) + { + bNeedInit = FALSE; + Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); + if( !xSMgr.is() ) + bRetVal = FALSE; + } + return bRetVal; +#else + return FALSE; +#endif +} + + +#ifdef _USE_UNO + +class UCBStream : public SvStream +{ + Reference< XInputStream > xIS; + Reference< XOutputStream > xOS; + Reference< XStream > xS; + Reference< XSeekable > xSeek; +public: + UCBStream( Reference< XInputStream > & xIS ); + UCBStream( Reference< XOutputStream > & xOS ); + UCBStream( Reference< XStream > & xS ); + ~UCBStream(); + virtual ULONG GetData( void* pData, ULONG nSize ); + virtual ULONG PutData( const void* pData, ULONG nSize ); + virtual ULONG SeekPos( ULONG nPos ); + virtual void FlushData(); + virtual void SetSize( ULONG nSize ); +}; + +/* +ULONG UCBErrorToSvStramError( ucb::IOErrorCode nError ) +{ + ULONG eReturn = ERRCODE_IO_GENERAL; + switch( nError ) + { + case ucb::IOErrorCode_ABORT: eReturn = SVSTREAM_GENERALERROR; break; + case ucb::IOErrorCode_NOT_EXISTING: eReturn = SVSTREAM_FILE_NOT_FOUND; break; + case ucb::IOErrorCode_NOT_EXISTING_PATH: eReturn = SVSTREAM_PATH_NOT_FOUND; break; + case ucb::IOErrorCode_OUT_OF_FILE_HANDLES: eReturn = SVSTREAM_TOO_MANY_OPEN_FILES; break; + case ucb::IOErrorCode_ACCESS_DENIED: eReturn = SVSTREAM_ACCESS_DENIED; break; + case ucb::IOErrorCode_LOCKING_VIOLATION: eReturn = SVSTREAM_SHARING_VIOLATION; break; + + case ucb::IOErrorCode_INVALID_ACCESS: eReturn = SVSTREAM_INVALID_ACCESS; break; + case ucb::IOErrorCode_CANT_CREATE: eReturn = SVSTREAM_CANNOT_MAKE; break; + case ucb::IOErrorCode_INVALID_PARAMETER: eReturn = SVSTREAM_INVALID_PARAMETER; break; + + case ucb::IOErrorCode_CANT_READ: eReturn = SVSTREAM_READ_ERROR; break; + case ucb::IOErrorCode_CANT_WRITE: eReturn = SVSTREAM_WRITE_ERROR; break; + case ucb::IOErrorCode_CANT_SEEK: eReturn = SVSTREAM_SEEK_ERROR; break; + case ucb::IOErrorCode_CANT_TELL: eReturn = SVSTREAM_TELL_ERROR; break; + + case ucb::IOErrorCode_OUT_OF_MEMORY: eReturn = SVSTREAM_OUTOFMEMORY; break; + + case SVSTREAM_FILEFORMAT_ERROR: eReturn = SVSTREAM_FILEFORMAT_ERROR; break; + case ucb::IOErrorCode_WRONG_VERSION: eReturn = SVSTREAM_WRONGVERSION; + case ucb::IOErrorCode_OUT_OF_DISK_SPACE: eReturn = SVSTREAM_DISK_FULL; break; + + case ucb::IOErrorCode_BAD_CRC: eReturn = ERRCODE_IO_BADCRC; break; + } + return eReturn; +} +*/ + +UCBStream::UCBStream( Reference< XInputStream > & rStm ) + : xIS( rStm ) + , xSeek( rStm, UNO_QUERY ) +{ +} + +UCBStream::UCBStream( Reference< XOutputStream > & rStm ) + : xOS( rStm ) + , xSeek( rStm, UNO_QUERY ) +{ +} + +UCBStream::UCBStream( Reference< XStream > & rStm ) + : xS( rStm ) + , xSeek( rStm, UNO_QUERY ) +{ +} + + +UCBStream::~UCBStream() +{ + try + { + if( xIS.is() ) + xIS->closeInput(); + else if( xOS.is() ) + xOS->closeOutput(); + else if( xS.is() ) + xS->closeStream(); + } + catch( Exception & ) + { + SetError( ERRCODE_IO_GENERAL ); + } +} + +ULONG UCBStream::GetData( void* pData, ULONG nSize ) +{ + try + { + if( xIS.is() ) + { + Sequence<sal_Int8> aData; + nSize = xIS->readBytes( aData, nSize ); + rtl_copyMemory( pData, aData.getConstArray(), nSize ); + return nSize; + } + else if( xS.is() ) + { + Sequence<sal_Int8> aData; + nSize = xS->readBytes( aData, nSize ); + rtl_copyMemory( pData, aData.getConstArray(), nSize ); + return nSize; + } + else + SetError( ERRCODE_IO_GENERAL ); + } + catch( Exception & ) + { + SetError( ERRCODE_IO_GENERAL ); + } + return 0; +} + +ULONG UCBStream::PutData( const void* pData, ULONG nSize ) +{ + try + { + if( xOS.is() ) + { + Sequence<sal_Int8> aData( (const sal_Int8 *)pData, nSize ); + xOS->writeBytes( aData ); + return nSize; + } + else if( xS.is() ) + { + Sequence<sal_Int8> aData( (const sal_Int8 *)pData, nSize ); + xS->writeBytes( aData ); + return nSize; + } + else + SetError( ERRCODE_IO_GENERAL ); + } + catch( Exception & ) + { + SetError( ERRCODE_IO_GENERAL ); + } + return 0; +} + +ULONG UCBStream::SeekPos( ULONG nPos ) +{ + if( !nPos ) + return 0; + try + { + if( xSeek.is() ) + { + sal_Int32 nLen = xSeek->getLength(); + if( nPos > nLen ) + nPos = nLen; + xSeek->seek( nPos ); + return nPos; + } + else + SetError( ERRCODE_IO_GENERAL ); + } + catch( Exception & ) + { + SetError( ERRCODE_IO_GENERAL ); + } + return 0; +} + +void UCBStream::FlushData() +{ + try + { + if( xOS.is() ) + xOS->flush(); + else if( xS.is() ) + xS->flush(); + else + SetError( ERRCODE_IO_GENERAL ); + } + catch( Exception & ) + { + SetError( ERRCODE_IO_GENERAL ); + } +} + +void UCBStream::SetSize( ULONG nSize ) +{ + DBG_ERROR( "not allowed to call from basic" ) + SetError( ERRCODE_IO_GENERAL ); +} + +#endif + +// Oeffnen eines Streams +SbError SbiStream::Open +( short nCh, const ByteString& rName, short nStrmMode, short nFlags, short nL ) +{ + nMode = nFlags; + nLen = nL; + nChan = nCh; + nLine = 0; + nExpandOnWriteTo = 0; + if( ( nStrmMode & ( STREAM_READ|STREAM_WRITE ) ) == STREAM_READ ) + nStrmMode |= STREAM_NOCREATE; + String aNameStr( rName, gsl_getSystemTextEncoding() ); +#ifdef _USE_UNO + if( hasUno() ) + { + Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); + if( xSMgr.is() ) + { + Reference< XSimpleFileAccess > + xSFI( xSMgr->createInstance( OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY ); + if( xSFI.is() ) + { + try + { + + if( (nStrmMode & (STREAM_READ | STREAM_WRITE)) == (STREAM_READ | STREAM_WRITE) ) + { + Reference< XStream > xIS = xSFI->openFileReadWrite( aNameStr ); + pStrm = new UCBStream( xIS ); + } + else if( nStrmMode & STREAM_WRITE ) + { + Reference< XStream > xIS = xSFI->openFileReadWrite( aNameStr ); + pStrm = new UCBStream( xIS ); + // Open for writing is not implemented in ucb yet!!! + //Reference< XOutputStream > xIS = xSFI->openFileWrite( aNameStr ); + //pStrm = new UCBStream( xIS ); + } + else //if( nStrmMode & STREAM_READ ) + { + Reference< XInputStream > xIS = xSFI->openFileRead( aNameStr ); + pStrm = new UCBStream( xIS ); + } + } + catch( Exception & ) + { + } + } + } + } + +#endif + if( !pStrm ) + pStrm = new SvFileStream( aNameStr, nStrmMode ); + if( IsAppend() ) + pStrm->Seek( STREAM_SEEK_TO_END ); + MapError(); + if( nError ) + delete pStrm, pStrm = NULL; + return nError; +} + +SbError SbiStream::Close() +{ + if( pStrm ) + { + if( !hasUno() ) + ((SvFileStream *)pStrm)->Close(); + MapError(); + delete pStrm; + pStrm = NULL; + } + nChan = 0; + return nError; +} + +SbError SbiStream::Read( ByteString& rBuf, USHORT n ) +{ + nExpandOnWriteTo = 0; + if( IsText() ) + { + pStrm->ReadLine( rBuf ); + nLine++; + } + else + { + if( !n ) n = nLen; + if( !n ) + return nError = SbERR_BAD_RECORD_LENGTH; + rBuf.Fill( n, ' ' ); + pStrm->Read( (void*)rBuf.GetBuffer(), n ); + } + MapError(); + if( !nError && pStrm->IsEof() ) + nError = SbERR_READ_PAST_EOF; + return nError; +} + +SbError SbiStream::Read( char& ch ) +{ + nExpandOnWriteTo = 0; + if( !aLine.Len() ) + { + Read( aLine, 0 ); + aLine += '\n'; + } + ch = aLine.GetBuffer()[0]; + aLine.Erase( 0, 1 ); + return nError; +} + +void SbiStream::ExpandFile() +{ + if ( nExpandOnWriteTo ) + { + ULONG nCur = pStrm->Seek(STREAM_SEEK_TO_END); + if( nCur < nExpandOnWriteTo ) + { + ULONG nDiff = nExpandOnWriteTo - nCur; + char c = 0; + while( nDiff-- ) + *pStrm << c; + } + else + { + pStrm->Seek( nExpandOnWriteTo ); + } + nExpandOnWriteTo = 0; + } +} + +SbError SbiStream::Write( const ByteString& rBuf, USHORT n ) +{ + ExpandFile(); + if( IsAppend() ) + pStrm->Seek( STREAM_SEEK_TO_END ); + + if( IsText() ) + { + aLine += rBuf; + // Raus damit, wenn das Ende ein LF ist, aber CRLF vorher + // strippen, da der SvStrm ein CRLF anfuegt! + USHORT n = aLine.Len(); + if( n && aLine.GetBuffer()[ --n ] == 0x0A ) + { + aLine.Erase( n ); + if( n && aLine.GetBuffer()[ --n ] == 0x0D ) + aLine.Erase( n ); + pStrm->WriteLines( aLine ); + aLine.Erase(); + } + } + else + { + if( !n ) n = nLen; + if( !n ) + return nError = SbERR_BAD_RECORD_LENGTH; + pStrm->Write( rBuf.GetBuffer(), n ); + MapError(); + } + return nError; +} + +////////////////////////////////////////////////////////////////////////// + +// Zugriff auf das aktuelle I/O-System: + +SbiIoSystem* SbGetIoSystem() +{ + SbiInstance* pInst = pINST; + return pInst ? pInst->GetIoSystem() : NULL; +} + +////////////////////////////////////////////////////////////////////////// + +SbiIoSystem::SbiIoSystem() +{ + for( short i = 0; i < CHANNELS; i++ ) + pChan[ i ] = NULL; + nChan = 0; + nError = 0; +} + +SbiIoSystem::~SbiIoSystem() +{ + Shutdown(); +} + +SbError SbiIoSystem::GetError() +{ + SbError n = nError; nError = 0; + return n; +} + +void SbiIoSystem::Open + ( short nCh, const ByteString& rName, short nMode, short nFlags, short nLen ) +{ + nError = 0; + if( nCh >= CHANNELS || !nCh ) + nError = SbERR_BAD_CHANNEL; + else if( pChan[ nCh ] ) + nError = SbERR_FILE_ALREADY_OPEN; + else + { + pChan[ nCh ] = new SbiStream; + nError = pChan[ nCh ]->Open( nCh, rName, nMode, nFlags, nLen ); + if( nError ) + delete pChan[ nCh ], pChan[ nCh ] = NULL; + } + nChan = 0; +} + +// Aktuellen Kanal schliessen + +void SbiIoSystem::Close() +{ + if( !nChan ) + nError = SbERR_BAD_CHANNEL; + else if( !pChan[ nChan ] ) + nError = SbERR_BAD_CHANNEL; + else + { + nError = pChan[ nChan ]->Close(); + delete pChan[ nChan ]; + pChan[ nChan ] = NULL; + } + nChan = 0; +} + +// Shutdown nach Programmlauf + +void SbiIoSystem::Shutdown() +{ + for( short i = 1; i < CHANNELS; i++ ) + { + if( pChan[ i ] ) + { + USHORT n = pChan[ i ]->Close(); + delete pChan[ i ]; + pChan[ i ] = NULL; + if( n && !nError ) + nError = n; + } + } + nChan = 0; + // Noch was zu PRINTen? + if( aOut.Len() ) + { + String aOutStr( aOut, gsl_getSystemTextEncoding() ); +#if defined GCC + Window* pParent = Application::GetDefModalDialogParent(); + MessBox( pParent, WinBits( WB_OK ), String(), aOutStr ).Execute(); +#else + MessBox( GetpApp()->GetDefModalDialogParent(), WinBits( WB_OK ), String(), aOutStr ).Execute(); +#endif + } + aOut.Erase(); +} + +// Aus aktuellem Kanal lesen + +void SbiIoSystem::Read( ByteString& rBuf, short n ) +{ + if( !nChan ) + ReadCon( rBuf ); + else if( !pChan[ nChan ] ) + nError = SbERR_BAD_CHANNEL; + else + nError = pChan[ nChan ]->Read( rBuf, n ); +} + +char SbiIoSystem::Read() +{ + char ch = ' '; + if( !nChan ) + { + if( !aIn.Len() ) + { + ReadCon( aIn ); + aIn += '\n'; + } + ch = aIn.GetBuffer()[0]; + aIn.Erase( 0, 1 ); + } + else if( !pChan[ nChan ] ) + nError = SbERR_BAD_CHANNEL; + else + nError = pChan[ nChan ]->Read( ch ); + return ch; +} + +void SbiIoSystem::Write( const ByteString& rBuf, short n ) +{ + if( !nChan ) + WriteCon( rBuf ); + else if( !pChan[ nChan ] ) + nError = SbERR_BAD_CHANNEL; + else + nError = pChan[ nChan ]->Write( rBuf, n ); +} + +short SbiIoSystem::NextChannel() +{ + for( short i = 1; i < CHANNELS; i++ ) + { + if( !pChan[ i ] ) + return i; + } + nError = SbERR_TOO_MANY_FILES; + return CHANNELS; +} + +// nChannel == 0..CHANNELS-1 + +SbiStream* SbiIoSystem::GetStream( short nChannel ) const +{ + SbiStream* pRet = 0; + if( nChannel >= 0 && nChannel < CHANNELS ) + pRet = pChan[ nChannel ]; + return pRet; +} + +void SbiIoSystem::CloseAll(void) +{ + for( short i = 1; i < CHANNELS; i++ ) + { + if( pChan[ i ] ) + { + USHORT n = pChan[ i ]->Close(); + delete pChan[ i ]; + pChan[ i ] = NULL; + if( n && !nError ) + nError = n; + } + } +} + +/*************************************************************************** +* +* Console Support +* +***************************************************************************/ + +// Einlesen einer Zeile von der Console + +void SbiIoSystem::ReadCon( ByteString& rIn ) +{ + String aPromptStr( aPrompt, gsl_getSystemTextEncoding() ); + SbiInputDialog aDlg( NULL, aPromptStr ); + if( aDlg.Execute() ) + rIn = ByteString( aDlg.GetInput(), gsl_getSystemTextEncoding() ); + else + nError = SbERR_USER_ABORT; + aPrompt.Erase(); +} + +// Ausgabe einer MessageBox, wenn im Console-Puffer ein CR ist + +void SbiIoSystem::WriteCon( const ByteString& rText ) +{ + aOut += rText; + USHORT n1 = aOut.Search( '\n' ); + USHORT n2 = aOut.Search( '\r' ); + if( n1 != STRING_NOTFOUND || n2 != STRING_NOTFOUND ) + { + if( n1 == STRING_NOTFOUND ) n1 = n2; + else + if( n2 == STRING_NOTFOUND ) n2 = n1; + if( n1 > n2 ) n1 = n2; + ByteString s( aOut.Copy( 0, n1 ) ); + aOut.Erase( 0, n1 ); + while( aOut.GetBuffer()[0] == '\n' || aOut.GetBuffer()[0] == '\r' ) + aOut.Erase( 0, 1 ); + String aStr( s, RTL_TEXTENCODING_ASCII_US ); + if( !MessBox( GetpApp()->GetDefModalDialogParent(), + WinBits( WB_OK_CANCEL | WB_DEF_OK ), + String(), aStr ).Execute() ) + nError = SbERR_USER_ABORT; + } +} + diff --git a/basic/source/runtime/makefile.mk b/basic/source/runtime/makefile.mk new file mode 100644 index 000000000000..24e9e1016f6d --- /dev/null +++ b/basic/source/runtime/makefile.mk @@ -0,0 +1,116 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ +# +# 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): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=BASIC +TARGET=runtime + +# --- Settings ----------------------------------------------------------- + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + +.IF "$(GUI)" == "WNT" +ASM=masm386 +.ENDIF + + +# --- Allgemein ----------------------------------------------------------- + +SLOFILES= \ + $(SLO)$/basrdll.obj \ + $(SLO)$/inputbox.obj \ + $(SLO)$/runtime.obj \ + $(SLO)$/step0.obj \ + $(SLO)$/step1.obj \ + $(SLO)$/step2.obj \ + $(SLO)$/iosys.obj \ + $(SLO)$/stdobj.obj \ + $(SLO)$/stdobj1.obj \ + $(SLO)$/methods.obj \ + $(SLO)$/methods1.obj \ + $(SLO)$/props.obj \ + $(SLO)$/ddectrl.obj \ + $(SLO)$/dllmgr.obj + +.IF "$(GUI)$(CPU)" == "WINI" +SLOFILES+= $(SLO)$/win.obj +.ENDIF + +.IF "$(GUI)$(CPU)" == "WNTI" +SLOFILES+= $(SLO)$/wnt.obj +.ENDIF + +.IF "$(GUI)$(CPU)" == "OS2I" +SLOFILES+= $(SLO)$/os2.obj +.ENDIF + +EXCEPTIONSFILES=$(SLO)$/step0.obj \ + $(SLO)$/step2.obj \ + $(SLO)$/methods.obj \ + $(SLO)$/iosys.obj + +# --- Targets ------------------------------------------------------------- + +.INCLUDE : target.mk diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx new file mode 100644 index 000000000000..e3a47cba275c --- /dev/null +++ b/basic/source/runtime/methods.cxx @@ -0,0 +1,3228 @@ +/************************************************************************* + * + * $RCSfile: methods.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _DATE_HXX //autogen +#include <tools/date.hxx> +#endif +#ifndef _SBXVAR_HXX +#include <svtools/sbxvar.hxx> +#endif +#ifndef _FSYS_HXX //autogen +#include <tools/fsys.hxx> +#endif +#ifndef _INTN_HXX //autogen +#include <tools/intn.hxx> +#endif +#ifndef _VOS_PROCESS_HXX +#include <vos/process.hxx> +#endif +#ifndef _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#ifndef _SV_SOUND_HXX //autogen +#include <vcl/sound.hxx> +#endif +#ifndef _SV_WINTYPES_HXX //autogen +#include <vcl/wintypes.hxx> +#endif +#ifndef _SV_MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef _ZFORLIST_HXX //autogen +#include <svtools/zforlist.hxx> +#endif +#ifndef _TOOLS_SOLMATH_HXX //autogen wg. SolarMath +#include <tools/solmath.hxx> +#endif +#include <tools/urlobj.hxx> +#include <osl/file.hxx> + +#ifdef OS2 +#define INCL_WINWINDOWMGR +#define INCL_DOS +#endif + +#if defined (WNT) +#ifndef _SVWIN_H +#include <tools/svwin.h> +#endif +#endif +#if defined (OS2) +#ifndef _SVPM_H +#include <tools/svpm.h> +#endif +#endif + +#pragma hdrstop +#include "runtime.hxx" + +#ifdef _USE_UNO +#include <unotools/processfactory.hxx> + +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/util/DateTime.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/io/XSeekable.hpp> + +using namespace utl; +using namespace rtl; +using namespace osl; +using namespace com::sun::star::uno; +using namespace com::sun::star::lang; +using namespace com::sun::star::ucb; +using namespace com::sun::star::io; + +#endif /* _USE_UNO */ + +#include "stdobj.hxx" +#include "stdobj1.hxx" +#include "rtlproto.hxx" +#include "basrid.hxx" +#include "sb.hrc" +#ifndef _SBIOSYS_HXX +#include "iosys.hxx" +#endif +#ifndef _DDECTRL_HXX +#include "ddectrl.hxx" +#endif +#include <sbintern.hxx> + +#include <stl/list> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> + +#if defined (WIN) || defined (WNT) || defined (OS2) +#include <direct.h> // _getdcwd get current work directory, _chdrive +#endif + +#ifdef WIN +#include <dos.h> // _dos_getfileattr +#include <errno.h> +#endif + +#ifdef UNX +#include <errno.h> +#include <unistd.h> +#endif + +#ifdef WNT +#include <io.h> +#endif + +#ifdef MAC +#include <mac_start.h> + +#ifndef __FILES__ + #include <Files.h> +#endif + +#ifndef __ERRORS__ + #include <Errors.h> +#endif + +#include <MAC_TOOLS.hxx> +#include <mac_end.h> +#endif + +//#include <numbers.hxx> + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + + +#if defined (OS2) && defined (__BORLANDC__) +#pragma option -w-par +#endif + +static void FilterWhiteSpace( String& rStr ) +{ + rStr.EraseAllChars( ' ' ); + rStr.EraseAllChars( '\t' ); + rStr.EraseAllChars( '\n' ); + rStr.EraseAllChars( '\r' ); +} + +static long GetDayDiff( const Date& rDate ) +{ + Date aRefDate( 1,1,1900 ); + long nDiffDays; + if ( aRefDate > rDate ) + { + nDiffDays = (long)(aRefDate - rDate); + nDiffDays *= -1; + } + else + nDiffDays = (long)(rDate - aRefDate); + nDiffDays += 2; // Anpassung VisualBasic: 1.Jan.1900 == 2 + return nDiffDays; +} + + +//*** UCB file access *** +// Converts possibly relative paths to absolute paths +// according to the setting done by ChDir/ChDrive +// (Implemented in methods.cxx) +String getFullPath( const String& aRelPath ) +{ + // TODO: Use CurDir to build full path + // First step: Return given path unchanged + return aRelPath; +} + +// Sets (virtual) current path for UCB file access +void implChDir( const String& aDir ) +{ + // TODO +} + +// Sets (virtual) current drive for UCB file access +void implChDrive( const String& aDrive ) +{ + // TODO +} + +// Returns (virtual) current path for UCB file access +String implGetCurDir( void ) +{ + String aRetStr; + + return aRetStr; +} + +// TODO: -> SbiGlobals +static Reference< XSimpleFileAccess > getFileAccess( void ) +{ + static Reference< XSimpleFileAccess > xSFI; + if( !xSFI.is() ) + { + Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); + if( xSMgr.is() ) + { + xSFI = Reference< XSimpleFileAccess >( xSMgr->createInstance + ( OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY ); + } + } + return xSFI; +} + + + + +// Properties und Methoden legen beim Get (bPut = FALSE) den Returnwert +// im Element 0 des Argv ab; beim Put (bPut = TRUE) wird der Wert aus +// Element 0 gespeichert. + +// CreateObject( class ) + +RTLFUNC(CreateObject) +{ + String aClass( rPar.Get( 1 )->GetString() ); + SbxObjectRef p = SbxBase::CreateObject( aClass ); + if( !p ) + StarBASIC::Error( SbERR_CANNOT_LOAD ); + else + { + // Convenience: BASIC als Parent eintragen + p->SetParent( pBasic ); + rPar.Get( 0 )->PutObject( p ); + } +} + +// Error( n ) + +RTLFUNC(Error) +{ + if( !pBasic ) + StarBASIC::Error( SbERR_INTERNAL_ERROR ); + else + { + String aErrorMsg; + SbError nErr = 0L; + if( rPar.Count() == 1 ) + { + nErr = StarBASIC::GetErr(); + aErrorMsg = StarBASIC::GetErrorMsg(); + } + else + { + INT32 nCode = rPar.Get( 1 )->GetLong(); + if( nCode > 65535L ) + StarBASIC::Error( SbERR_CONVERSION ); + else + nErr = StarBASIC::GetSfxFromVBError( (USHORT)nCode ); + } + pBasic->MakeErrorText( nErr, aErrorMsg ); + rPar.Get( 0 )->PutString( pBasic->GetErrorText() ); + } +} + +// Sinus + +RTLFUNC(Sin) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + rPar.Get( 0 )->PutDouble( sin( pArg->GetDouble() ) ); + } +} + +// Cosinus + +RTLFUNC(Cos) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + rPar.Get( 0 )->PutDouble( cos( pArg->GetDouble() ) ); + } +} + +// Atn + +RTLFUNC(Atn) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + rPar.Get( 0 )->PutDouble( atan( pArg->GetDouble() ) ); + } +} + + + +RTLFUNC(Abs) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + rPar.Get( 0 )->PutDouble( fabs( pArg->GetDouble() ) ); + } +} + + +RTLFUNC(Asc) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + String aStr( pArg->GetString() ); + if ( aStr.Len() == 0 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + rPar.Get(0)->PutEmpty(); + } + else + { + sal_Unicode aCh = aStr.GetBuffer()[0]; + rPar.Get(0)->PutInteger( (INT16)aCh ); + } + } +} + +RTLFUNC(Chr) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + char aCh = (char) pArg->GetInteger(); + String aStr; + aStr = aCh; + rPar.Get(0)->PutString( aStr ); + } +} + + +#ifdef UNX +#define _MAX_PATH 260 +#define _PATH_INCR 250 +#endif + +RTLFUNC(CurDir) +{ + // #57064 Obwohl diese Funktion nicht mit DirEntry arbeitet, ist sie von + // der Anpassung an virtuelle URLs nich betroffen, da bei Nutzung der + // DirEntry-Funktionalitaet keine Moeglichkeit besteht, das aktuelle so + // zu ermitteln, dass eine virtuelle URL geliefert werden koennte. + +// rPar.Get(0)->PutEmpty(); +#if defined (WIN) || defined (WNT) || (defined (OS2) && !defined( WTC )) + int nCurDir = 0; // Current dir // JSM + if ( rPar.Count() == 2 ) + { + String aDrive = rPar.Get(1)->GetString(); + if ( aDrive.Len() != 1 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + else + { + nCurDir = (int)aDrive.GetBuffer()[0]; + if ( !isalpha( nCurDir ) ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + else + nCurDir -= ( 'A' - 1 ); + } + } + char* pBuffer = new char[ _MAX_PATH ]; +#ifdef MTW + int old = _getdrive(); + _chdrive(nCurDir); + + if ( getcwd( pBuffer, _MAX_PATH ) != 0 ) + rPar.Get(0)->PutString( String::CreateFromAscii( pBuffer ) ); + else + StarBASIC::Error( SbERR_NO_DEVICE ); + delete pBuffer; + _chdrive(old); +#else +#ifdef OS2 + if( !nCurDir ) + nCurDir = _getdrive(); +#endif + if ( _getdcwd( nCurDir, pBuffer, _MAX_PATH ) != 0 ) + rPar.Get(0)->PutString( String::CreateFromAscii( pBuffer ) ); + else + StarBASIC::Error( SbERR_NO_DEVICE ); + delete pBuffer; +#endif + +#elif defined MAC + + Str255 aBuffer; + FSSpec aFileSpec; // Pseudofile + String aPar1; + OSErr nErr; + + // Erstmal aktuelle Pfad bestimmen + nErr = FSMakeFSSpec(0,0,"\p:X",&aFileSpec); + + PathNameFromDirID( aFileSpec.parID,aFileSpec.vRefNum, (char*) aBuffer); + String aPath((char*) &aBuffer[1],aBuffer[0]); + + if ( rPar.Count() == 2 ) + { + aPar1 = rPar.Get(1)->GetString(); + + // Wen kein ':' drin ist dann haengen wir (netterweise) einen an + if (aPar1.Search(':') == STRING_NOTFOUND) + aPar1 += ':'; + USHORT nFirstColon = aPar1.Search(':'); + if (!aPar1.Len() || + nFirstColon != (aPar1.Len() - 1)) + // Kein ':' am Ende oder mehr als ein ':' oder leerer String + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + // Is Param1 eventuelle das Volume des aktuellen Pfades ? + USHORT nMatchPoint = aPath.Match(aPar1); + if (nMatchPoint != (nFirstColon + 1)) + { + String aPseudoFile(aPar1); + aPseudoFile += 'X'; // Pseudodatei + + nErr = FSMakeFSSpec(0,0,aPseudoFile.GetPascalStr(),&aFileSpec); + + if(nErr == nsvErr) + { + StarBASIC::Error( SbERR_NO_DEVICE ); + return; + } + aPath = aPar1; + } + } + + rPar.Get(0)->PutString(aPath); + +#elif defined( UNX ) + + int nSize = _PATH_INCR; + char* pMem; + while( TRUE ) + { + pMem = new char[nSize]; + if( !pMem ) + { + StarBASIC::Error( SbERR_NO_MEMORY ); + return; + } + if( getcwd( pMem, nSize-1 ) != NULL ) + { + rPar.Get(0)->PutString( String::CreateFromAscii(pMem) ); + delete pMem; + return; + } + if( errno != ERANGE ) + { + StarBASIC::Error( SbERR_INTERNAL_ERROR ); + delete pMem; + return; + } + delete pMem; + nSize += _PATH_INCR; + }; + +#endif +} + +RTLFUNC(ChDir) // JSM +{ + rPar.Get(0)->PutEmpty(); + if (rPar.Count() == 2) + { + String aPath = rPar.Get(1)->GetString(); + BOOL bError = FALSE; +#ifdef WNT + // #55997 Laut MI hilft es bei File-URLs einen DirEntry zwischenzuschalten + // #40996 Harmoniert bei Verwendung der WIN32-Funktion nicht mit getdir + DirEntry aEntry( aPath ); + ByteString aFullPath( aEntry.GetFull(), gsl_getSystemTextEncoding() ); + if( chdir( aFullPath.GetBuffer()) ) + bError = TRUE; +#else + if (!DirEntry(aPath).SetCWD()) + bError = TRUE; +#endif + if( bError ) + StarBASIC::Error( SbERR_PATH_NOT_FOUND ); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + +RTLFUNC(ChDrive) // JSM +{ + rPar.Get(0)->PutEmpty(); + if (rPar.Count() == 2) + { + // Keine Laufwerke in Unix +#ifndef UNX + String aPar1 = rPar.Get(1)->GetString(); + +#if defined (WIN) || defined (WNT) || (defined (OS2) && !defined (WTC)) + if (aPar1.Len() > 0) + { + int nCurDrive = (int)aPar1.GetBuffer()[0]; ; + if ( !isalpha( nCurDrive ) ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + else + nCurDrive -= ( 'A' - 1 ); + if (_chdrive(nCurDrive)) + StarBASIC::Error( SbERR_NO_DEVICE ); + } +#elif defined MAC + // Wen kein ':' drin ist dann haengen wir (netterweise) einen an + if (aPar1.Search(':') == STRING_NOTFOUND) + aPar1 += ':'; + if (!aPar1.Len() || + aPar1.Search(':') != (aPar1.Len() - 1)) + // Kein ':' am Ende oder mehr als ein ':' oder leerer String + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + DirEntry aDrive(aPar1); + if (aDrive.SetCWD()) + return; + else + StarBASIC::Error( SbERR_NO_DEVICE ); +#endif + +#endif + // #ifndef UNX + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + + +// Implementation of StepRENAME with UCB +void implStepRenameUCB( const String& aSource, const String& aDest ) +{ + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + xSFI->move( getFullPath( aSource ), getFullPath( aDest ) ); + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } +} + +RTLFUNC(FileCopy) // JSM +{ + rPar.Get(0)->PutEmpty(); + if (rPar.Count() == 3) + { + String aSource = rPar.Get(1)->GetString(); + String aDest = rPar.Get(2)->GetString(); + // <-- UCB + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + xSFI->copy( getFullPath( aSource ), getFullPath( aDest ) ); + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + } + else + // --> UCB + { + DirEntry aSourceDirEntry(aSource); + if (aSourceDirEntry.Exists()) + { + if (aSourceDirEntry.CopyTo(DirEntry(aDest),FSYS_ACTION_COPYFILE) != FSYS_ERR_OK) + StarBASIC::Error( SbERR_PATH_NOT_FOUND ); + } + else + StarBASIC::Error( SbERR_PATH_NOT_FOUND ); + } + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + +RTLFUNC(Kill) // JSM +{ + rPar.Get(0)->PutEmpty(); + if (rPar.Count() == 2) + { + String aFileSpec = rPar.Get(1)->GetString(); + + // <-- UCB + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + xSFI->kill( getFullPath( aFileSpec ) ); + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + } + else + // --> UCB + { + if(DirEntry(aFileSpec).Kill() != FSYS_ERR_OK) + StarBASIC::Error( SbERR_PATH_NOT_FOUND ); + } + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + +RTLFUNC(MkDir) // JSM +{ + rPar.Get(0)->PutEmpty(); + if (rPar.Count() == 2) + { + String aPath = rPar.Get(1)->GetString(); + + // <-- UCB + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + xSFI->createFolder( getFullPath( aPath ) ); + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + } + else + // --> UCB + { + if (!DirEntry(aPath).MakeDir()) + StarBASIC::Error( SbERR_PATH_NOT_FOUND ); + } + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + +RTLFUNC(RmDir) // JSM +{ + rPar.Get(0)->PutEmpty(); + if (rPar.Count() == 2) + { + String aPath = rPar.Get(1)->GetString(); + // <-- UCB + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + xSFI->kill( getFullPath( aPath ) ); + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + } + else + // --> UCB + { + DirEntry aDirEntry(aPath); + if (aDirEntry.Kill() != FSYS_ERR_OK) + StarBASIC::Error( SbERR_PATH_NOT_FOUND ); + } + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + +RTLFUNC(SendKeys) // JSM +{ + rPar.Get(0)->PutEmpty(); + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); +} + +RTLFUNC(Exp) +{ + ULONG nArgCount = rPar.Count(); + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + double aDouble = rPar.Get( 1 )->GetDouble(); + aDouble = exp( aDouble ); + rPar.Get( 0 )->PutDouble( aDouble ); + } +} + +RTLFUNC(FileLen) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + String aStr( pArg->GetString() ); + INT32 nLen = 0; + // <-- UCB + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + nLen = xSFI->getSize( getFullPath( aStr ) ); + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + } + else + // --> UCB + { + FileStat aStat = DirEntry( aStr ); + nLen = aStat.GetSize(); + } + rPar.Get(0)->PutLong( (long)nLen ); + } +} + + +RTLFUNC(Hex) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + char aBuffer[16]; + SbxVariableRef pArg = rPar.Get( 1 ); + if ( pArg->IsInteger() ) + sprintf( aBuffer,"%X", pArg->GetInteger() ); + else + sprintf( aBuffer,"%lX", pArg->GetLong() ); + rPar.Get(0)->PutString( String::CreateFromAscii( aBuffer ) ); + } +} + +// InStr( [start],string,string,[compare] ) + +RTLFUNC(InStr) +{ + ULONG nArgCount = rPar.Count()-1; + if ( nArgCount < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + USHORT nStartPos = 1; + + USHORT nFirstStringPos = 1; + if ( nArgCount >= 3 ) + { + nStartPos = (USHORT)(rPar.Get(1)->GetInteger()); + if ( nStartPos == 0 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + nStartPos = 1; + } + nFirstStringPos++; + } + int bNotCaseSensitive = 1; // wird noch nicht ausgewertet + if ( nArgCount == 4 ) + bNotCaseSensitive = rPar.Get(4)->GetInteger(); + + USHORT nPos; + + if( !bNotCaseSensitive ) + { + const String& rStr1 = rPar.Get(nFirstStringPos)->GetString(); + const String& rToken = rPar.Get(nFirstStringPos+1)->GetString(); + + nPos = rStr1.Search( rToken, nStartPos-1 ); + if ( nPos == STRING_NOTFOUND ) + nPos = 0; + else + nPos++; + } + else + { + String aStr1 = rPar.Get(nFirstStringPos)->GetString(); + String aToken = rPar.Get(nFirstStringPos+1)->GetString(); + + aStr1.ToUpperAscii(); + aToken.ToUpperAscii(); + + nPos = aStr1.Search( aToken, nStartPos-1 ); + if ( nPos == STRING_NOTFOUND ) + nPos = 0; + else + nPos++; + } + rPar.Get(0)->PutInteger( (int)nPos ); + } +} + + +/* + Int( 2.8 ) = 2.0 + Int( -2.8 ) = -3.0 + Fix( 2.8 ) = 2.0 + Fix( -2.8 ) = -2.0 <- !! +*/ + +RTLFUNC(Int) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + double aDouble= pArg->GetDouble(); + /* + floor( 2.8 ) = 2.0 + floor( -2.8 ) = -3.0 + */ + aDouble = floor( aDouble ); + rPar.Get(0)->PutDouble( aDouble ); + } +} + + + +RTLFUNC(Fix) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + double aDouble = pArg->GetDouble(); + if ( aDouble >= 0.0 ) + aDouble = floor( aDouble ); + else + aDouble = ceil( aDouble ); + rPar.Get(0)->PutDouble( aDouble ); + } +} + + +RTLFUNC(LCase) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + const International& rInt = GetpApp()->GetAppInternational(); + String aStr( rPar.Get(1)->GetString() ); + rInt.ToLower( aStr ); + rPar.Get(0)->PutString( aStr ); + } +} + +RTLFUNC(Left) +{ + ULONG nArgCount = rPar.Count(); + if ( rPar.Count() < 3 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aStr( rPar.Get(1)->GetString() ); + short nCount = (USHORT)( rPar.Get(2)->GetLong() ); + if ( nCount < 0 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + aStr.Erase( (USHORT)nCount ); + rPar.Get(0)->PutString( aStr ); + } + } +} + +RTLFUNC(Log) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + double aArg = rPar.Get(1)->GetDouble(); + if ( aArg > 0 ) + rPar.Get( 0 )->PutDouble( log( aArg )); + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + } +} + +RTLFUNC(LTrim) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aStr( rPar.Get(1)->GetString() ); + aStr.EraseLeadingChars(); + rPar.Get(0)->PutString( aStr ); + } +} + + +// Mid( String, nStart, nLength ) + +RTLFUNC(Mid) +{ + ULONG nArgCount = rPar.Count()-1; + if ( nArgCount < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + // #23178: Funktionalitaet von Mid$ als Anweisung nachbilden, indem + // als weiterer (4.) Parameter ein Ersetzungsstring aufgenommen wird. + // Anders als im Original kann in dieser Variante der 3. Parameter + // nLength nicht weggelassen werden. Ist ueber bWrite schon vorgesehen. + if( nArgCount == 4 ) + bWrite = TRUE; + + String aArgStr = rPar.Get(1)->GetString(); + USHORT nStartPos = (USHORT)(rPar.Get(2)->GetLong() ); + if ( nStartPos == 0 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + nStartPos--; + USHORT nLen = 0xffff; + if ( nArgCount == 3 || bWrite ) + nLen = (USHORT)(rPar.Get(3)->GetLong() ); + String aResultStr; + if ( bWrite ) + { + aResultStr = aArgStr; + aResultStr.Erase( nStartPos, nLen ); + aResultStr.Insert(rPar.Get(4)->GetString(),0,nLen,nStartPos); + rPar.Get(1)->PutString( aResultStr ); + } + else + { + aResultStr = aArgStr.Copy( nStartPos, nLen ); + rPar.Get(0)->PutString( aResultStr ); + } + } + } +} + +RTLFUNC(Oct) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + char aBuffer[16]; + SbxVariableRef pArg = rPar.Get( 1 ); + if ( pArg->IsInteger() ) + sprintf( aBuffer,"%o", pArg->GetInteger() ); + else + sprintf( aBuffer,"%lo", pArg->GetLong() ); + rPar.Get(0)->PutString( String::CreateFromAscii( aBuffer ) ); + } +} + +RTLFUNC(Right) +{ + ULONG nArgCount = rPar.Count(); + if ( rPar.Count() < 3 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + const String& rStr = rPar.Get(1)->GetString(); + USHORT nResultLen = (USHORT)(rPar.Get(2)->GetLong() ); + USHORT nStrLen = rStr.Len(); + if ( nResultLen > nStrLen ) + nResultLen = nStrLen; + String aResultStr = rStr.Copy( nStrLen-nResultLen ); + rPar.Get(0)->PutString( aResultStr ); + } +} + +RTLFUNC(RTrim) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aStr( rPar.Get(1)->GetString() ); + aStr.EraseTrailingChars(); + rPar.Get(0)->PutString( aStr ); + } +} + +RTLFUNC(Sgn) +{ + ULONG nArgCount = rPar.Count(); + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + double aDouble = rPar.Get(1)->GetDouble(); + INT16 nResult = 0; + if ( aDouble > 0 ) + nResult = 1; + else if ( aDouble < 0 ) + nResult = -1; + rPar.Get(0)->PutInteger( nResult ); + } +} + +RTLFUNC(Space) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aStr; + aStr.Fill( (USHORT)(rPar.Get(1)->GetLong() )); + rPar.Get(0)->PutString( aStr ); + } +} + +RTLFUNC(Spc) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aStr; + aStr.Fill( (USHORT)(rPar.Get(1)->GetLong() )); + rPar.Get(0)->PutString( aStr ); + } +} + +RTLFUNC(Sqr) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + double aDouble = rPar.Get(1)->GetDouble(); + if ( aDouble >= 0 ) + rPar.Get(0)->PutDouble( sqrt( aDouble )); + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + } +} + +RTLFUNC(Str) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aStr; + rPar.Get( 1 )->Format( aStr ); + // Numbers start with a space + if( rPar.Get( 1 )->IsNumericRTL() ) + aStr.Insert( ' ', 0 ); + // Kommas durch Punkte ersetzen, damits symmetrisch zu Val ist! + aStr.SearchAndReplace( ',', '.' ); + rPar.Get(0)->PutString( aStr ); + } +} + +RTLFUNC(StrComp) +{ + + if ( rPar.Count() < 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + rPar.Get(0)->PutEmpty(); + return; + } + const String& rStr1 = rPar.Get(1)->GetString(); + const String& rStr2 = rPar.Get(2)->GetString(); + INT16 nNotCaseSensitive = TRUE; + if ( rPar.Count() == 4 ) + nNotCaseSensitive = rPar.Get(3)->GetInteger(); + + const International& aInternational = GetpApp()->GetAppInternational(); + StringCompare aResult; + if ( !nNotCaseSensitive ) + aResult = aInternational.Compare( rStr1, rStr2 ); + else + aResult = rStr1.CompareTo( rStr2 ); + int nRetValue = 0; + if ( aResult == COMPARE_LESS ) + nRetValue = -1; + else if ( aResult == COMPARE_GREATER ) + nRetValue = 1; + rPar.Get(0)->PutInteger( nRetValue ); +} + +RTLFUNC(String) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aStr; + sal_Unicode aFiller; + USHORT nCount = (USHORT)(rPar.Get(1)->GetLong()); + if( rPar.Get(2)->GetType() == SbxINTEGER ) + aFiller = (char)rPar.Get(2)->GetInteger(); + else + { + const String& rStr = rPar.Get(2)->GetString(); + aFiller = rStr.GetBuffer()[0]; + } + aStr.Fill( nCount, aFiller ); + rPar.Get(0)->PutString( aStr ); + } +} + +RTLFUNC(Tan) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + rPar.Get( 0 )->PutDouble( tan( pArg->GetDouble() ) ); + } +} + +RTLFUNC(UCase) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + const International& rInt = GetpApp()->GetAppInternational(); + String aStr( rPar.Get(1)->GetString() ); + rInt.ToUpper( aStr ); + rPar.Get(0)->PutString( aStr ); + } +} + + +RTLFUNC(Val) +{ + static International aEnglischIntn( LANGUAGE_ENGLISH_US, LANGUAGE_ENGLISH_US ); + + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + double nResult; + char* pEndPtr; + + String aStr( rPar.Get(1)->GetString() ); +// lt. Mikkysoft bei Kommas abbrechen! +// for( USHORT n=0; n < aStr.Len(); n++ ) +// if( aStr[n] == ',' ) aStr[n] = '.'; + + FilterWhiteSpace( aStr ); + if ( aStr.GetBuffer()[0] == '&' && aStr.Len() > 1 ) + { + int nRadix = 10; + char aChar = aStr.GetBuffer()[1]; + if ( aChar == 'h' || aChar == 'H' ) + nRadix = 16; + else if ( aChar == 'o' || aChar == 'O' ) + nRadix = 8; + if ( nRadix != 10 ) + { + ByteString aByteStr( aStr, gsl_getSystemTextEncoding() ); + INT16 nlResult = (INT16)strtol( aByteStr.GetBuffer()+2, &pEndPtr, nRadix); + nResult = (double)nlResult; + } + } + else + { + // #57844 Lokalisierte Funktion benutzen + int nErrno; + nResult = SolarMath::StringToDouble( aStr.GetBuffer(), aEnglischIntn, nErrno ); + // ATL: nResult = strtod( aStr.GetStr(), &pEndPtr ); + } + + rPar.Get(0)->PutDouble( nResult ); + } +} + +RTLFUNC(DateSerial) +{ + if ( rPar.Count() < 4 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + INT16 nYear = rPar.Get(1)->GetInteger(); + INT16 nMonth = rPar.Get(2)->GetInteger(); + INT16 nDay = rPar.Get(3)->GetInteger(); + if ( nYear < 100 ) + nYear += 1900; + if ((nYear < 100 || nYear > 9999) || + (nMonth < 1 || nMonth > 12 ) || + (nDay < 1 || nDay > 31 )) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + Date aCurDate( nDay, nMonth, nYear ); + long nDiffDays = GetDayDiff( aCurDate ); + rPar.Get(0)->PutDate( (double)nDiffDays ); // JSM +} + +RTLFUNC(TimeSerial) +{ + if ( rPar.Count() < 4 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + INT16 nHour = rPar.Get(1)->GetInteger(); + if ( nHour == 24 ) + nHour = 0; // Wegen UNO DateTimes, die bis 24 Uhr gehen + INT16 nMinute = rPar.Get(2)->GetInteger(); + INT16 nSecond = rPar.Get(3)->GetInteger(); + if ((nHour < 0 || nHour > 23) || + (nMinute < 0 || nMinute > 59 ) || + (nSecond < 0 || nSecond > 59 )) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + INT32 nSeconds = nHour; + nSeconds *= 3600; + nSeconds += nMinute * 60; + nSeconds += nSecond; + double nDays = ((double)nSeconds) / (double)(86400.0); + rPar.Get(0)->PutDate( nDays ); // JSM +} + +RTLFUNC(DateValue) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden + SvNumberFormatter* pFormatter = NULL; + if( pINST ) + pFormatter = pINST->GetNumberFormatter(); + else + { + ULONG n; // Dummy + SbiInstance::PrepareNumberFormatter( pFormatter, n, n, n ); + } + + ULONG nIndex; + double fResult; + String aStr( rPar.Get(1)->GetString() ); + BOOL bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult ); + short nType = pFormatter->GetType( nIndex ); + if(bSuccess && (nType==NUMBERFORMAT_DATE || nType==NUMBERFORMAT_DATETIME)) + { + if ( nType == NUMBERFORMAT_DATETIME ) + { + // Zeit abschneiden + if ( fResult > 0.0 ) + fResult = floor( fResult ); + else + fResult = ceil( fResult ); + } + // fResult += 2.0; // Anpassung StarCalcFormatter + rPar.Get(0)->PutDate( fResult ); // JSM + } + else + StarBASIC::Error( SbERR_CONVERSION ); + + // #39629 pFormatter kann selbst angefordert sein + if( !pINST ) + delete pFormatter; + } +} + +RTLFUNC(TimeValue) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden + SvNumberFormatter* pFormatter = NULL; + if( pINST ) + pFormatter = pINST->GetNumberFormatter(); + else + { + ULONG n; // Dummy + SbiInstance::PrepareNumberFormatter( pFormatter, n, n, n ); + } + + ULONG nIndex; + double fResult; + BOOL bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetString(), + nIndex, fResult ); + short nType = pFormatter->GetType(nIndex); + if(bSuccess && (nType==NUMBERFORMAT_TIME||nType==NUMBERFORMAT_DATETIME)) + { + if ( nType == NUMBERFORMAT_DATETIME ) + // Tage abschneiden + fResult = fmod( fResult, 1 ); + rPar.Get(0)->PutDate( fResult ); // JSM + } + else + StarBASIC::Error( SbERR_CONVERSION ); + + // #39629 pFormatter kann selbst angefordert sein + if( !pINST ) + delete pFormatter; + } +} + +RTLFUNC(Day) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxVariableRef pArg = rPar.Get( 1 ); + double aDouble = pArg->GetDate(); + aDouble -= 2.0; // normieren: 1.1.1900 => 0.0 + Date aRefDate( 1, 1, 1900 ); + // aDouble = Fix( aDouble ); + if ( aDouble >= 0.0 ) + { + aDouble = floor( aDouble ); + aRefDate += (ULONG)aDouble; + } + else + { + aDouble = ceil( aDouble ); + aRefDate -= (ULONG)(-1.0 * aDouble); + } + rPar.Get(0)->PutInteger( (INT16)(aRefDate.GetDay())); + } +} + +RTLFUNC(Weekday) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + Date aRefDate( 1,1,1900 ); + long nDays = (long) rPar.Get(1)->GetDate(); + nDays -= 2; // normieren: 1.1.1900 => 0 + aRefDate += nDays; + DayOfWeek aDay = aRefDate.GetDayOfWeek(); + INT16 nDay; + if ( aDay != SUNDAY ) + nDay = (INT16)aDay + 2; + else + nDay = 1; // 1==Sonntag + rPar.Get(0)->PutInteger( nDay ); + } +} + +RTLFUNC(Year) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + Date aRefDate( 1,1,1900 ); + long nDays = (long) rPar.Get(1)->GetDate(); + nDays -= 2; // normieren: 1.1.1900 => 0.0 + aRefDate += nDays; + rPar.Get(0)->PutInteger( (INT16)(aRefDate.GetYear()) ); + } +} + +RTLFUNC(Hour) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + double nArg = rPar.Get(1)->GetDate(); + if ( nArg < 0.0 ) + nArg *= -1.0; + double nFrac = nArg - floor( nArg ); + nFrac *= 86400.0; + INT32 nSeconds = (INT32)nFrac; + INT16 nHour = (INT16)(nSeconds / 3600); + rPar.Get(0)->PutInteger( nHour ); + } +} + + +RTLFUNC(Minute) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + double nArg = rPar.Get(1)->GetDate(); + if ( nArg < 0.0 ) + nArg *= -1.0; + double nFrac = nArg - floor( nArg ); + nFrac *= 86400.0; + INT32 nSeconds = (INT32)nFrac; + INT16 nTemp = (INT16)(nSeconds % 3600); + INT16 nMin = nTemp / 60; + rPar.Get(0)->PutInteger( nMin ); + } +} + +RTLFUNC(Month) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + Date aRefDate( 1,1,1900 ); + long nDays = (long) rPar.Get(1)->GetDate(); + nDays -= 2; // normieren: 1.1.1900 => 0.0 + aRefDate += nDays; + rPar.Get(0)->PutInteger( (INT16)(aRefDate.GetMonth()) ); + } +} + +RTLFUNC(Second) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + double nArg = rPar.Get(1)->GetDate(); + if ( nArg < 0.0 ) + nArg *= -1.0; + double nFrac = nArg - floor( nArg ); + nFrac *= 86400.0; + INT32 nSeconds = (INT32)nFrac; + INT16 nTemp = (INT16)(nSeconds / 3600); + nSeconds -= nTemp * 3600; + nTemp = (INT16)(nSeconds / 60); + nSeconds -= nTemp * 60; + rPar.Get(0)->PutInteger( (INT16)nSeconds ); + } +} + +// Date Now(void) + +RTLFUNC(Now) +{ + Date aDate; + Time aTime; + double aSerial = (double)GetDayDiff( aDate ); + long nSeconds = aTime.GetHour(); + nSeconds *= 3600; + nSeconds += aTime.GetMin() * 60; + nSeconds += aTime.GetSec(); + double nDays = ((double)nSeconds) / (double)(24.0*3600.0); + aSerial += nDays; + rPar.Get(0)->PutDate( aSerial ); +} + +// Date Time(void) + +RTLFUNC(Time) +{ + if ( !bWrite ) + { + Time aTime; + SbxVariable* pMeth = rPar.Get( 0 ); + String aRes; + if( pMeth->IsFixed() ) + { + // Time$: hh:mm:ss + char buf[ 20 ]; + sprintf( buf, "%02d:%02d:%02d", + aTime.GetHour(), aTime.GetMin(), aTime.GetSec() ); + aRes = String::CreateFromAscii( buf ); + } + else + { + // Time: system dependent + long nSeconds=aTime.GetHour(); + nSeconds *= 3600; + nSeconds += aTime.GetMin() * 60; + nSeconds += aTime.GetSec(); + double nDays = (double)nSeconds * ( 1.0 / (24.0*3600.0) ); + Color* pCol; + + // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden + SvNumberFormatter* pFormatter = NULL; + ULONG nIndex; + if( pINST ) + { + pFormatter = pINST->GetNumberFormatter(); + nIndex = pINST->GetStdTimeIdx(); + } + else + { + ULONG n; // Dummy + SbiInstance::PrepareNumberFormatter( pFormatter, n, nIndex, n ); + } + + pFormatter->GetOutputString( nDays, nIndex, aRes, &pCol ); + + // #39629 pFormatter kann selbst angefordert sein + if( !pINST ) + delete pFormatter; + } + pMeth->PutString( aRes ); + } + else + { + StarBASIC::Error( SbERR_NOT_IMPLEMENTED ); + } +} + +RTLFUNC(Timer) +{ + Time aTime; + long nSeconds = aTime.GetHour(); + nSeconds *= 3600; + nSeconds += aTime.GetMin() * 60; + nSeconds += aTime.GetSec(); + rPar.Get(0)->PutDate( (double)nSeconds ); +} + + +RTLFUNC(Date) +{ + if ( !bWrite ) + { + Date aToday; + double nDays = (double)GetDayDiff( aToday ); + SbxVariable* pMeth = rPar.Get( 0 ); + if( pMeth->IsString() ) + { + String aRes; + Color* pCol; + + // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden + SvNumberFormatter* pFormatter = NULL; + ULONG nIndex; + if( pINST ) + { + pFormatter = pINST->GetNumberFormatter(); + nIndex = pINST->GetStdDateIdx(); + } + else + { + ULONG n; // Dummy + SbiInstance::PrepareNumberFormatter( pFormatter, nIndex, n, n ); + } + + pFormatter->GetOutputString( nDays, nIndex, aRes, &pCol ); + pMeth->PutString( aRes ); + + // #39629 pFormatter kann selbst angefordert sein + if( !pINST ) + delete pFormatter; + } + else + pMeth->PutDate( nDays ); + } + else + { + StarBASIC::Error( SbERR_NOT_IMPLEMENTED ); + } +} + +RTLFUNC(IsArray) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + rPar.Get(0)->PutBool((rPar.Get(1)->GetType() & SbxARRAY) ? TRUE : FALSE ); +} + +RTLFUNC(IsObject) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + rPar.Get( 0 )->PutBool( rPar.Get(1)->IsObject() ); +} + +RTLFUNC(IsDate) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + // #46134 Nur String wird konvertiert, andere Typen ergeben FALSE + SbxVariableRef xArg = rPar.Get( 1 ); + SbxDataType eType = xArg->GetType(); + BOOL bDate = FALSE; + + if( eType == SbxDATE ) + { + bDate = TRUE; + } + else if( eType == SbxSTRING ) + { + // Error loeschen + SbxError nPrevError = SbxBase::GetError(); + SbxBase::ResetError(); + + // Konvertierung des Parameters nach SbxDATE erzwingen + xArg->SbxValue::GetDate(); + + // Bei Fehler ist es kein Date + bDate = !SbxBase::IsError(); + + // Error-Situation wiederherstellen + SbxBase::ResetError(); + SbxBase::SetError( nPrevError ); + } + rPar.Get( 0 )->PutBool( bDate ); + } +} + +RTLFUNC(IsEmpty) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + rPar.Get( 0 )->PutBool( rPar.Get(1)->IsEmpty() ); +} + +RTLFUNC(IsError) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + rPar.Get( 0 )->PutBool( rPar.Get(1)->IsErr() ); +} + +RTLFUNC(IsNull) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + // #51475 Wegen Uno-Objekten auch true liefern, + // wenn der pObj-Wert NULL ist + SbxVariableRef pArg = rPar.Get( 1 ); + BOOL bNull = rPar.Get(1)->IsNull(); + if( !bNull && pArg->GetType() == SbxOBJECT ) + { + SbxBase* pObj = pArg->GetObject(); + if( !pObj ) + bNull = TRUE; + } + rPar.Get( 0 )->PutBool( bNull ); + } +} + +RTLFUNC(IsNumeric) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + rPar.Get( 0 )->PutBool( rPar.Get( 1 )->IsNumericRTL() ); +} + +// Das machen wir auf die billige Tour + +RTLFUNC(IsMissing) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + // #57915 Missing wird durch Error angezeigt + rPar.Get( 0 )->PutBool( rPar.Get(1)->IsErr() ); +} + +// Dir( [Maske] [,Attrs] ) +// ToDo: Library-globaler Datenbereich fuer Dir-Objekt und Flags + +static String getFileNameFromURL( const String& aURL ); + +RTLFUNC(Dir) +{ + String aPath; + + USHORT nParCount = rPar.Count(); + if( nParCount > 3 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbiRTLData* pRTLData = pINST->GetRTLData(); + + // #34645: Kann auch von der URL-Zeile ueber 'macro: Dir' aufgerufen werden + // dann existiert kein pRTLData und die Methode muss verlassen werden + if( !pRTLData ) + return; + + // <-- UCB + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + if ( nParCount >= 2 ) + { + String aStr = getFullPath( rPar.Get(1)->GetString() ); + OUString aUNCPath; + FileBase::normalizePath( aStr, aUNCPath ); + OUString aFileURLStr; + FileBase::getFileURLFromNormalizedPath( aUNCPath, aFileURLStr ); + + try + { + String aDirURLStr; + sal_Bool bFolder = sal_False; + try { bFolder = xSFI->isFolder( aFileURLStr ); } + catch( Exception & ) {} + //catch( ::ucb::ContentCreationException & e ) + //{ + //::ucb::ContentCreationException::Reason aReason = e.getReason(); + //} + + if( bFolder ) + { + aDirURLStr = aFileURLStr; + } + else + { + INetURLObject aFileURL( aFileURLStr ); + + // Not folder but exists? Return file! + sal_Bool bExists = sal_False; + try { bExists = xSFI->exists( aFileURLStr ); } + //catch( ::ucb::ContentCreationException & e ) + //{ + //::ucb::ContentCreationException::Reason aReason = e.getReason(); + //} + catch( Exception & ) {} + if( bExists ) + { + String aNameOnlyStr = aFileURL.getName( INetURLObject::LAST_SEGMENT, + true, INetURLObject::DECODE_WITH_CHARSET ); + rPar.Get(0)->PutString( aNameOnlyStr ); + return; + } + aDirURLStr = aFileURL.GetPath(); + } + + USHORT nFlags = 0; + if ( nParCount > 2 ) + pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger(); + else + pRTLData->nDirFlags = 0; + + // Read directory + sal_Bool bIncludeFolders = ((nFlags & Sb_ATTR_DIRECTORY) != 0); + pRTLData->aDirSeq = xSFI->getFolderContents( aDirURLStr, bIncludeFolders ); + pRTLData->nCurDirPos = 0; + } + catch( Exception & ) + { + //StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + + + if( pRTLData->aDirSeq.getLength() > 0 ) + { + sal_Bool bOnlyFolders = ((pRTLData->nDirFlags & Sb_ATTR_DIRECTORY) != 0); + for( ;; ) + { + if( pRTLData->nCurDirPos >= pRTLData->aDirSeq.getLength() ) + { + pRTLData->aDirSeq.realloc( 0 ); + aPath.Erase(); + break; + } + else + { + OUString aFile = pRTLData->aDirSeq.getConstArray()[pRTLData->nCurDirPos++]; + + // Only directories? + if( bOnlyFolders ) + { + sal_Bool bFolder = sal_False; + try { bFolder = xSFI->isFolder( aFile ); } + catch( Exception & ) {} + if( !bFolder ) + continue; + } + + INetURLObject aURL( aFile ); + aPath = aURL.getName( INetURLObject::LAST_SEGMENT, true, + INetURLObject::DECODE_WITH_CHARSET ); + break; + } + } + } + rPar.Get(0)->PutString( aPath ); + } + } + else + // --> UCB + { + if ( nParCount >= 2 ) + { + delete pRTLData->pDir; + pRTLData->pDir = 0; // wg. Sonderbehandlung Sb_ATTR_VOLUME + DirEntry aEntry( rPar.Get(1)->GetString() ); + FileStat aStat( aEntry ); + if(!aStat.GetError() && (aStat.GetKind() & FSYS_KIND_FILE)) + { + // ah ja, ist nur ein dateiname + // Pfad abschneiden (wg. VB4) + rPar.Get(0)->PutString( aEntry.GetName() ); + return; + } + USHORT nFlags = 0; + if ( nParCount > 2 ) + pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger(); + else + pRTLData->nDirFlags = 0; + // Nur diese Bitmaske ist unter Windows erlaubt + #ifdef WIN + if( nFlags & ~0x1E ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ), pRTLData->nDirFlags = 0; + #endif + // Sb_ATTR_VOLUME wird getrennt gehandelt + if( pRTLData->nDirFlags & Sb_ATTR_VOLUME ) + aPath = aEntry.GetVolume(); + else + { + // Die richtige Auswahl treffen + USHORT nMode = FSYS_KIND_FILE; + if( nFlags & Sb_ATTR_DIRECTORY ) + nMode |= FSYS_KIND_DIR; + if( nFlags == Sb_ATTR_DIRECTORY ) + nMode = FSYS_KIND_DIR; + pRTLData->pDir = new Dir( aEntry, (DirEntryKind) nMode ); + pRTLData->nCurDirPos = 0; + } + } + + if( pRTLData->pDir ) + { + for( ;; ) + { + if( pRTLData->nCurDirPos >= pRTLData->pDir->Count() ) + { + delete pRTLData->pDir; + pRTLData->pDir = 0; + aPath.Erase(); + break; + } + DirEntry aNextEntry=(*(pRTLData->pDir))[pRTLData->nCurDirPos++]; + aPath = aNextEntry.GetName(); //Full(); + #ifdef WIN + aNextEntry.ToAbs(); + String sFull(aNextEntry.GetFull()); + unsigned nFlags; + + if (_dos_getfileattr( sFull.GetStr(), &nFlags )) + StarBASIC::Error( SbERR_FILE_NOT_FOUND ); + else + { + INT16 nCurFlags = pRTLData->nDirFlags; + if( (nCurFlags == Sb_ATTR_NORMAL) + && !(nFlags & ( _A_HIDDEN | _A_SYSTEM | _A_VOLID | _A_SUBDIR ) ) ) + break; + else if( (nCurFlags & Sb_ATTR_HIDDEN) && (nFlags & _A_HIDDEN) ) + break; + else if( (nCurFlags & Sb_ATTR_SYSTEM) && (nFlags & _A_SYSTEM) ) + break; + else if( (nCurFlags & Sb_ATTR_VOLUME) && (nFlags & _A_VOLID) ) + break; + else if( (nCurFlags & Sb_ATTR_DIRECTORY) && (nFlags & _A_SUBDIR) ) + break; + } + #else + break; + #endif + } + } + rPar.Get(0)->PutString( aPath ); + } + } +} + + +RTLFUNC(GetAttr) +{ + if ( rPar.Count() == 2 ) + { + INT16 nFlags = 0; + + // <-- UCB + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + String aPath = getFullPath( rPar.Get(1)->GetString() ); + sal_Bool bExists = sal_False; + try { bExists = xSFI->exists( aPath ); } + catch( Exception & ) {} + if( !bExists ) + { + StarBASIC::Error( SbERR_FILE_NOT_FOUND ); + return; + } + + sal_Bool bReadOnly = xSFI->isReadOnly( aPath ); + sal_Bool bDirectory = xSFI->isFolder( aPath ); + if( bReadOnly ) + nFlags |= 0x0001; // ATTR_READONLY + if( bDirectory ) + nFlags |= 0x0010; // ATTR_DIRECTORY + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + } + else + // --> UCB + { + DirEntry aEntry( rPar.Get(1)->GetString() ); + aEntry.ToAbs(); + BOOL bUseFileStat = FALSE; + + // #57064 Bei virtuellen URLs den Real-Path extrahieren + String aFile = aEntry.GetFull(); + ByteString aByteStrFullPath( aEntry.GetFull(), gsl_getSystemTextEncoding() ); + #if defined( WIN ) + int nErr = _dos_getfileattr( aByteStrFullPath.GetBuffer(),(unsigned *) &nFlags ); + if ( nErr ) + StarBASIC::Error( SbERR_FILE_NOT_FOUND ); + #elif defined( WNT ) + DWORD nRealFlags = GetFileAttributes (aByteStrFullPath.GetBuffer()); + if (nRealFlags != 0xffffffff) + { + if (nRealFlags == FILE_ATTRIBUTE_NORMAL) + nRealFlags = 0; + nFlags = (INT16) (nRealFlags); + } + else + StarBASIC::Error( SbERR_FILE_NOT_FOUND ); + #elif defined( OS2 ) + FILESTATUS3 aFileStatus; + APIRET rc = DosQueryPathInfo(aByteStrFullPath.GetBuffer(),1, + &aFileStatus,sizeof(FILESTATUS3)); + if (!rc) + nFlags = (INT16) aFileStatus.attrFile; + else + StarBASIC::Error( SbERR_FILE_NOT_FOUND ); + #else + bUseFileStat = TRUE; + #endif + if( bUseFileStat ) + { + if( FileStat::GetReadOnlyFlag( aEntry ) ) + nFlags |= 0x0001; // ATTR_READONLY + FileStat aStat( aEntry ); + DirEntryKind eKind = aStat.GetKind(); + if( eKind & FSYS_KIND_DIR ) + nFlags |= 0x0010; // ATTR_DIRECTORY + if( aEntry.GetFlag() & FSYS_FLAG_VOLUME ) + nFlags |= 0x0008; // ATTR_VOLUME + } + } + rPar.Get(0)->PutInteger( nFlags ); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + + +RTLFUNC(FileDateTime) +{ + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + + // <-- UCB + String aPath = rPar.Get(1)->GetString(); + Time aTime; + Date aDate; + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + com::sun::star::util::DateTime aUnoDT = xSFI->getDateTimeModified( aPath ); + aTime = Time( aUnoDT.Hours, aUnoDT.Minutes, aUnoDT.Seconds, aUnoDT.HundredthSeconds ); + aDate = Date( aUnoDT.Day, aUnoDT.Month, aUnoDT.Year ); + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + } + else + // --> UCB + { + DirEntry aEntry( aPath ); + FileStat aStat( aEntry ); + aTime = Time( aStat.TimeModified() ); + aDate = Date( aStat.DateModified() ); + } + + double fSerial = (double)GetDayDiff( aDate ); + long nSeconds = aTime.GetHour(); + nSeconds *= 3600; + nSeconds += aTime.GetMin() * 60; + nSeconds += aTime.GetSec(); + double nDays = ((double)nSeconds) / (double)(24.0*3600.0); + fSerial += nDays; + + Color* pCol; + + // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden + SvNumberFormatter* pFormatter = NULL; + ULONG nIndex; + if( pINST ) + { + pFormatter = pINST->GetNumberFormatter(); + nIndex = pINST->GetStdDateTimeIdx(); + } + else + { + ULONG n; // Dummy + SbiInstance::PrepareNumberFormatter( pFormatter, n, n, nIndex ); + } + + String aRes; + pFormatter->GetOutputString( fSerial, nIndex, aRes, &pCol ); + rPar.Get(0)->PutString( aRes ); + + // #39629 pFormatter kann selbst angefordert sein + if( !pINST ) + delete pFormatter; + } +} + + +RTLFUNC(EOF) +{ + // AB 08/16/2000: No changes for UCB + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + INT16 nChannel = rPar.Get(1)->GetInteger(); + // nChannel--; // macht MD beim Oeffnen auch nicht + SbiIoSystem* pIO = pINST->GetIoSystem(); + SbiStream* pSbStrm = pIO->GetStream( nChannel ); + if ( !pSbStrm ) + { + StarBASIC::Error( SbERR_BAD_CHANNEL ); + return; + } + BOOL bIsEof; + SvStream* pSvStrm = pSbStrm->GetStrm(); + if ( pSbStrm->IsText() ) + { + char cBla; + (*pSvStrm) >> cBla; // koennen wir noch ein Zeichen lesen + bIsEof = pSvStrm->IsEof(); + if ( !bIsEof ) + pSvStrm->SeekRel( -1 ); + } + else + bIsEof = pSvStrm->IsEof(); // fuer binaerdateien! + rPar.Get(0)->PutBool( bIsEof ); + } +} + +RTLFUNC(FileAttr) +{ + // AB 08/16/2000: No changes for UCB + + // #57064 Obwohl diese Funktion nicht mit DirEntry arbeitet, ist sie von + // der Anpassung an virtuelle URLs nich betroffen, da sie nur auf bereits + // geoeffneten Dateien arbeitet und der Name hier keine Rolle spielt. + + if ( rPar.Count() != 3 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + INT16 nChannel = rPar.Get(1)->GetInteger(); +// nChannel--; + SbiIoSystem* pIO = pINST->GetIoSystem(); + SbiStream* pSbStrm = pIO->GetStream( nChannel ); + if ( !pSbStrm ) + { + StarBASIC::Error( SbERR_BAD_CHANNEL ); + return; + } + INT16 nRet; + if ( rPar.Get(2)->GetInteger() == 1 ) + nRet = (INT16)(pSbStrm->GetMode()); + else + nRet = 0; // System file handle not supported + + rPar.Get(0)->PutInteger( nRet ); + } +} +RTLFUNC(Loc) +{ + // AB 08/16/2000: No changes for UCB + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + INT16 nChannel = rPar.Get(1)->GetInteger(); + SbiIoSystem* pIO = pINST->GetIoSystem(); + SbiStream* pSbStrm = pIO->GetStream( nChannel ); + if ( !pSbStrm ) + { + StarBASIC::Error( SbERR_BAD_CHANNEL ); + return; + } + SvStream* pSvStrm = pSbStrm->GetStrm(); + ULONG nPos; + if( pSbStrm->IsRandom()) + { + short nBlockLen = pSbStrm->GetBlockLen(); + nPos = nBlockLen ? (pSvStrm->Tell() / nBlockLen) : 0; + nPos++; // Blockpositionen beginnen bei 1 + } + else if ( pSbStrm->IsText() ) + nPos = pSbStrm->GetLine(); + else if( pSbStrm->IsBinary() ) + nPos = pSvStrm->Tell(); + else if ( pSbStrm->IsSeq() ) + nPos = ( pSvStrm->Tell()+1 ) / 128; + else + nPos = pSvStrm->Tell(); + rPar.Get(0)->PutLong( (INT32)nPos ); + } +} + +RTLFUNC(Lof) +{ + // AB 08/16/2000: No changes for UCB + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + INT16 nChannel = rPar.Get(1)->GetInteger(); + SbiIoSystem* pIO = pINST->GetIoSystem(); + SbiStream* pSbStrm = pIO->GetStream( nChannel ); + if ( !pSbStrm ) + { + StarBASIC::Error( SbERR_BAD_CHANNEL ); + return; + } + SvStream* pSvStrm = pSbStrm->GetStrm(); + ULONG nOldPos = pSvStrm->Tell(); + ULONG nLen = pSvStrm->Seek( STREAM_SEEK_TO_END ); + pSvStrm->Seek( nOldPos ); + rPar.Get(0)->PutLong( (INT32)nLen ); + } +} + + +RTLFUNC(Seek) +{ + // AB 08/16/2000: No changes for UCB + int nArgs = (int)rPar.Count(); + if ( nArgs < 2 || nArgs > 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + INT16 nChannel = rPar.Get(1)->GetInteger(); +// nChannel--; + SbiIoSystem* pIO = pINST->GetIoSystem(); + SbiStream* pSbStrm = pIO->GetStream( nChannel ); + if ( !pSbStrm ) + { + StarBASIC::Error( SbERR_BAD_CHANNEL ); + return; + } + SvStream* pStrm = pSbStrm->GetStrm(); + + if ( nArgs == 2 ) // Seek-Function + { + ULONG nPos = pStrm->Tell(); + if( pSbStrm->IsRandom() ) + nPos = nPos / pSbStrm->GetBlockLen(); + nPos++; // Basic zaehlt ab 1 + rPar.Get(0)->PutLong( (INT32)nPos ); + } + else // Seek-Statement + { + INT32 nPos = rPar.Get(2)->GetLong(); + if ( nPos < 1 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + nPos--; // Basic zaehlt ab 1, SvStreams zaehlen ab 0 + pSbStrm->SetExpandOnWriteTo( 0 ); + if ( pSbStrm->IsRandom() ) + nPos *= pSbStrm->GetBlockLen(); + pStrm->Seek( (ULONG)nPos ); + pSbStrm->SetExpandOnWriteTo( nPos ); + } +} + +RTLFUNC(Format) +{ + USHORT nArgCount = (USHORT)rPar.Count(); + if ( nArgCount < 2 || nArgCount > 3 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aResult; + if( nArgCount == 2 ) + rPar.Get(1)->Format( aResult ); + else + { + String aFmt( rPar.Get(2)->GetString() ); + rPar.Get(1)->Format( aResult, &aFmt ); + } + rPar.Get(0)->PutString( aResult ); + } +} + +RTLFUNC(Randomize) +{ + if ( rPar.Count() > 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + INT16 nSeed; + if( rPar.Count() == 2 ) + nSeed = (INT16)rPar.Get(1)->GetInteger(); + else + nSeed = (INT16)rand(); + srand( nSeed ); +} + +RTLFUNC(Rnd) +{ + if ( rPar.Count() > 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + double nRand = (double)rand(); + nRand = ( nRand / (double)RAND_MAX ); + rPar.Get(0)->PutDouble( nRand ); + } +} + + +// +// Syntax: Shell("Path",[ Window-Style,[ "Params", [ bSync = FALSE ]]]) +// +// WindowStyles (VBA-kompatibel): +// 2 == Minimized +// 3 == Maximized +// 10 == Full-Screen (Textmodus-Anwendungen OS/2, WIN95, WNT) +// +// !!!HACK der WindowStyle wird im Creator an Application::StartApp +// uebergeben. Format: "xxxx2" +// + + +RTLFUNC(Shell) +{ + // No shell command for "virtual" portal users + if( needSecurityRestrictions() ) + { + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); + return; + } + + if ( rPar.Count() < 2 || rPar.Count() > 5 ) + { + rPar.Get(0)->PutLong(0); + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + } + else + { + USHORT nOptions = NAMESPACE_VOS(OProcess)::TOption_SearchPath| + NAMESPACE_VOS(OProcess)::TOption_Detached; + String aCmdLine = rPar.Get(1)->GetString(); + // Zusaetzliche Parameter anhaengen, es muss eh alles geparsed werden + if( rPar.Count() >= 4 ) + { + aCmdLine.AppendAscii( " " ); + aCmdLine += rPar.Get(3)->GetString(); + } + else if( !aCmdLine.Len() ) + { + // Spezial-Behandlung (leere Liste) vermeiden + aCmdLine.AppendAscii( " " ); + } + USHORT nLen = aCmdLine.Len(); + + // #55735 Wenn Parameter dabei sind, muessen die abgetrennt werden + // #72471 Auch die einzelnen Parameter trennen + std::list<String> aTokenList; + String aToken; + USHORT i = 0; + char c; + while( i < nLen ) + { + // Spaces weg + while( ( c = aCmdLine.GetBuffer()[ i ] ) == ' ' || c == '\t' ) + i++; + + if( c == '\"' || c == '\'' ) + { + USHORT iFoundPos = aCmdLine.Search( c, i + 1 ); + + // Wenn nichts gefunden wurde, Rest kopieren + if( iFoundPos == STRING_NOTFOUND ) + { + aToken = aCmdLine.Copy( i, STRING_LEN ); + i = nLen; + } + else + { + aToken = aCmdLine.Copy( i + 1, (iFoundPos - i - 1) ); + i = iFoundPos + 1; + } + } + else + { + USHORT iFoundSpacePos = aCmdLine.Search( ' ', i ); + USHORT iFoundTabPos = aCmdLine.Search( '\t', i ); + USHORT iFoundPos = Min( iFoundSpacePos, iFoundTabPos ); + + // Wenn nichts gefunden wurde, Rest kopieren + if( iFoundPos == STRING_NOTFOUND ) + { + aToken = aCmdLine.Copy( i, STRING_LEN ); + i = nLen; + } + else + { + aToken = aCmdLine.Copy( i, (iFoundPos - i) ); + i = iFoundPos; + } + } + + // In die Liste uebernehmen + aTokenList.push_back( aToken ); + } + // #55735 / #72471 Ende + + INT16 nWinStyle = 0; + if( rPar.Count() >= 3 ) + { + nWinStyle = rPar.Get(2)->GetInteger(); + switch( nWinStyle ) + { + case 2: + nOptions |= NAMESPACE_VOS(OProcess)::TOption_Minimized; + break; + case 3: + nOptions |= NAMESPACE_VOS(OProcess)::TOption_Maximized; + break; + case 10: + nOptions |= NAMESPACE_VOS(OProcess)::TOption_FullScreen; + break; + } + } + NAMESPACE_VOS(OProcess)::TProcessOption eOptions = + (NAMESPACE_VOS(OProcess)::TProcessOption)nOptions; + + + // #72471 Parameter aufbereiten + std::list<String>::const_iterator iter = aTokenList.begin(); + const String& rStr = *iter; + NAMESPACE_RTL(OUString) aOUStrProg( rStr.GetBuffer(), rStr.Len() ); + iter++; + + USHORT nParamCount = aTokenList.size() - 1; + NAMESPACE_RTL(OUString)* pArgumentList = NULL; + //const char** pParamList = NULL; + if( nParamCount ) + { + pArgumentList = new NAMESPACE_RTL(OUString)[ nParamCount ]; + //pParamList = new const char*[ nParamCount ]; + USHORT iList = 0; + while( iter != aTokenList.end() ) + { + const String& rParamStr = (*iter); + pArgumentList[iList++] = NAMESPACE_RTL(OUString)( rParamStr.GetBuffer(), rParamStr.Len() ); + //pParamList[iList++] = (*iter).GetStr(); + iter++; + } + } + + //const char* pParams = aParams.Len() ? aParams.GetStr() : 0; + NAMESPACE_VOS(OProcess)* pApp; + pApp = new NAMESPACE_VOS(OProcess)( aOUStrProg ); + BOOL bSucc; + if( nParamCount == 0 ) + { + bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None; + } + else + { + NAMESPACE_VOS(OArgumentList) aArgList( pArgumentList, nParamCount ); + bSucc = pApp->execute( eOptions, aArgList ) == NAMESPACE_VOS(OProcess)::E_None; + } + + /* + if( nParamCount == 0 ) + pApp = new NAMESPACE_VOS(OProcess)( pProg ); + else + pApp = new NAMESPACE_VOS(OProcess)( pProg, pParamList, nParamCount ); + BOOL bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None; + */ + + delete pApp; + delete[] pArgumentList; + if( !bSucc ) + StarBASIC::Error( SbERR_FILE_NOT_FOUND ); + else + rPar.Get(0)->PutLong( 0 ); + } +} + +RTLFUNC(VarType) +{ + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxDataType eType = rPar.Get(1)->GetType(); + rPar.Get(0)->PutInteger( (INT16)eType ); + } +} + +RTLFUNC(TypeName) +{ + static const char* pTypeNames[] = + { + "Empty", + "Null", + "Integer", + "Long", + "Single", + "Double", + "Currency", + "Date", + "String", + "Object", + "Error", + "Boolean", + "Variant", + "DataObject", + "Unknown Type", + "Unknown Type", + "Char", + "Byte", + "UShort", + "ULong", + "Long64", + "ULong64", + "Int", + "UInt", + "Void", + "HResult", + "Pointer", + "DimArray", + "CArray", + "Userdef", + "Lpstr", + "Lpwstr", + "Unknown Type", + }; + + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxDataType eType = rPar.Get(1)->GetType(); + BOOL bIsArray = ( ( eType & SbxARRAY ) != 0 ); + int nPos = ((int)eType) & 0x0FFF; + USHORT nTypeNameCount = sizeof( pTypeNames ) / sizeof( char* ); + if ( nPos < 0 || nPos >= nTypeNameCount ) + nPos = nTypeNameCount - 1; + String aRetStr = String::CreateFromAscii( pTypeNames[nPos] ); + if( bIsArray ) + aRetStr.AppendAscii( "()" ); + rPar.Get(0)->PutString( aRetStr ); + } +} + +RTLFUNC(Len) +{ + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + const String& rStr = rPar.Get(1)->GetString(); + rPar.Get(0)->PutLong( (INT32)rStr.Len() ); + } +} + +RTLFUNC(DDEInitiate) +{ + // No DDE for "virtual" portal users + if( needSecurityRestrictions() ) + { + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); + return; + } + + int nArgs = (int)rPar.Count(); + if ( nArgs != 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + const String& rApp = rPar.Get(1)->GetString(); + const String& rTopic = rPar.Get(2)->GetString(); + + SbiDdeControl* pDDE = pINST->GetDdeControl(); + INT16 nChannel; + SbError nDdeErr = pDDE->Initiate( rApp, rTopic, nChannel ); + if( nDdeErr ) + StarBASIC::Error( nDdeErr ); + else + rPar.Get(0)->PutInteger( nChannel ); +} + +RTLFUNC(DDETerminate) +{ + // No DDE for "virtual" portal users + if( needSecurityRestrictions() ) + { + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); + return; + } + + rPar.Get(0)->PutEmpty(); + int nArgs = (int)rPar.Count(); + if ( nArgs != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + INT16 nChannel = rPar.Get(1)->GetInteger(); + SbiDdeControl* pDDE = pINST->GetDdeControl(); + SbError nDdeErr = pDDE->Terminate( nChannel ); + if( nDdeErr ) + StarBASIC::Error( nDdeErr ); +} + +RTLFUNC(DDETerminateAll) +{ + // No DDE for "virtual" portal users + if( needSecurityRestrictions() ) + { + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); + return; + } + + rPar.Get(0)->PutEmpty(); + int nArgs = (int)rPar.Count(); + if ( nArgs != 1 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + SbiDdeControl* pDDE = pINST->GetDdeControl(); + SbError nDdeErr = pDDE->TerminateAll(); + if( nDdeErr ) + StarBASIC::Error( nDdeErr ); + +} + +RTLFUNC(DDERequest) +{ + // No DDE for "virtual" portal users + if( needSecurityRestrictions() ) + { + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); + return; + } + + int nArgs = (int)rPar.Count(); + if ( nArgs != 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + INT16 nChannel = rPar.Get(1)->GetInteger(); + const String& rItem = rPar.Get(2)->GetString(); + SbiDdeControl* pDDE = pINST->GetDdeControl(); + String aResult; + SbError nDdeErr = pDDE->Request( nChannel, rItem, aResult ); + if( nDdeErr ) + StarBASIC::Error( nDdeErr ); + else + rPar.Get(0)->PutString( aResult ); +} + +RTLFUNC(DDEExecute) +{ + // No DDE for "virtual" portal users + if( needSecurityRestrictions() ) + { + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); + return; + } + + rPar.Get(0)->PutEmpty(); + int nArgs = (int)rPar.Count(); + if ( nArgs != 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + INT16 nChannel = rPar.Get(1)->GetInteger(); + const String& rCommand = rPar.Get(2)->GetString(); + SbiDdeControl* pDDE = pINST->GetDdeControl(); + SbError nDdeErr = pDDE->Execute( nChannel, rCommand ); + if( nDdeErr ) + StarBASIC::Error( nDdeErr ); +} + +RTLFUNC(DDEPoke) +{ + // No DDE for "virtual" portal users + if( needSecurityRestrictions() ) + { + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); + return; + } + + rPar.Get(0)->PutEmpty(); + int nArgs = (int)rPar.Count(); + if ( nArgs != 4 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + INT16 nChannel = rPar.Get(1)->GetInteger(); + const String& rItem = rPar.Get(2)->GetString(); + const String& rData = rPar.Get(3)->GetString(); + SbiDdeControl* pDDE = pINST->GetDdeControl(); + SbError nDdeErr = pDDE->Poke( nChannel, rItem, rData ); + if( nDdeErr ) + StarBASIC::Error( nDdeErr ); +} + + +RTLFUNC(FreeFile) +{ + if ( rPar.Count() != 1 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + SbiIoSystem* pIO = pINST->GetIoSystem(); + short nChannel = 1; + while( nChannel < CHANNELS ) + { + SbiStream* pStrm = pIO->GetStream( nChannel ); + if( !pStrm ) + { + rPar.Get(0)->PutInteger( nChannel ); + return; + } + nChannel++; + } + StarBASIC::Error( SbERR_TOO_MANY_FILES ); +} + +RTLFUNC(LBound) +{ + USHORT nParCount = rPar.Count(); + if ( nParCount != 3 && nParCount != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + SbxBase* pParObj = rPar.Get(1)->GetObject(); + SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj); + if( pArr ) + { + short nLower, nUpper; + short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1; + if( !pArr->GetDim( nDim, nLower, nUpper ) ) + StarBASIC::Error( SbERR_OUT_OF_RANGE ); + else + rPar.Get(0)->PutInteger( (INT16)nLower ); + } + else + StarBASIC::Error( SbERR_MUST_HAVE_DIMS ); +} + +RTLFUNC(UBound) +{ + USHORT nParCount = rPar.Count(); + if ( nParCount != 3 && nParCount != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + SbxBase* pParObj = rPar.Get(1)->GetObject(); + SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj); + if( pArr ) + { + short nLower, nUpper; + short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1; + if( !pArr->GetDim( nDim, nLower, nUpper ) ) + StarBASIC::Error( SbERR_OUT_OF_RANGE ); + else + rPar.Get(0)->PutInteger( (INT16)nUpper ); + } + else + StarBASIC::Error( SbERR_MUST_HAVE_DIMS ); +} + +RTLFUNC(RGB) +{ + if ( rPar.Count() != 4 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + ULONG nRed = rPar.Get(1)->GetInteger() & 0xFF; + ULONG nGreen = rPar.Get(2)->GetInteger() & 0xFF; + ULONG nBlue = rPar.Get(3)->GetInteger() & 0xFF; + ULONG nRGB = (nRed << 16) | (nGreen << 8) | nBlue; + rPar.Get(0)->PutLong( nRGB ); +} + +RTLFUNC(QBColor) +{ + if ( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + Color aCol( (ColorName)rPar.Get(1)->GetInteger() ); + + ULONG nRed = aCol.GetRed() >> 8; + ULONG nGreen = aCol.GetGreen() >> 8; + ULONG nBlue = aCol.GetBlue() >> 8; + ULONG nRGB = (nRed << 16) | (nGreen << 8) | nBlue; + rPar.Get(0)->PutLong( nRGB ); +} + + +RTLFUNC(StrConv) +{ + DBG_ASSERT(0,"StrConv:Not implemented"); +// if ( rPar.Count() != 3 ) +// { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +// return; +// } +} + +RTLFUNC(Beep) +{ + if ( rPar.Count() != 1 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + Sound::Beep(); +} + +RTLFUNC(Load) +{ + if( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // Diesen Call einfach an das Object weiterreichen + SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject(); + if( pObj && pObj->IsA( TYPE( SbxObject ) ) ) + { + SbxVariable* pVar = ((SbxObject*)pObj)-> + Find( String( RTL_CONSTASCII_USTRINGPARAM("Load") ), SbxCLASS_METHOD ); + if( pVar ) + pVar->GetInteger(); + } +} + +RTLFUNC(Unload) +{ + rPar.Get(0)->PutEmpty(); + if( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // Diesen Call einfach an das Object weitereichen + SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject(); + if( pObj && pObj->IsA( TYPE( SbxObject ) ) ) + { + SbxVariable* pVar = ((SbxObject*)pObj)-> + Find( String( RTL_CONSTASCII_USTRINGPARAM("Unload") ), SbxCLASS_METHOD ); + if( pVar ) + pVar->GetInteger(); + } +} + +RTLFUNC(LoadPicture) +{ + if( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + SbxObjectRef xRef = new SbStdPicture; + + SvFileStream aIStream( rPar.Get(1)->GetString(), STREAM_READ ); + Bitmap aBmp; + aIStream >> aBmp; + Graphic aGraphic( aBmp ); + ((SbStdPicture*)(SbxObject*)xRef)->SetGraphic( aGraphic ); + rPar.Get(0)->PutObject( xRef ); +} + +RTLFUNC(SavePicture) +{ + rPar.Get(0)->PutEmpty(); + if( rPar.Count() != 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject(); + if( pObj->IsA( TYPE( SbStdPicture ) ) ) + { + SvFileStream aOStream( rPar.Get(2)->GetString(), STREAM_WRITE | STREAM_TRUNC ); + Graphic aGraphic = ((SbStdPicture*)pObj)->GetGraphic(); + aOStream << aGraphic; + } +} + + +//----------------------------------------------------------------------------------------- +/* +class SbiAboutStarBasicDlg : public ModalDialog +{ + OKButton aOkButton; + Control aCtrl; + +public: + SbiAboutStarBasicDlg(); +}; + +SbiAboutStarBasicDlg::SbiAboutStarBasicDlg() : + ModalDialog( GetpApp()->GetAppWindow(), BasicResId( RID_BASIC_START ) ), + aOkButton( this, BasicResId( 1 ) ), + aCtrl( this, BasicResId( 1 ) ) +{ + FreeResource(); +} +*/ +//----------------------------------------------------------------------------------------- + +RTLFUNC(AboutStarBasic) +{ + /* + String aName; + if( rPar.Count() >= 2 ) + { + aName = rPar.Get(1)->GetString(); + } + + SbiAboutStarBasicDlg* pDlg = new SbiAboutStarBasicDlg; + pDlg->Execute(); + delete pDlg; + */ +} + +// MsgBox( msg [,type[,title]] ) + +RTLFUNC(MsgBox) +{ + static const WinBits nStyleMap[] = + { + WB_OK, // MB_OK + WB_OK_CANCEL, // MB_OKCANCEL + WB_RETRY_CANCEL, // MB_ABORTRETRYIGNORE + WB_YES_NO_CANCEL, // MB_YESNOCANCEL + WB_YES_NO, // MB_YESNO + WB_RETRY_CANCEL // MB_RETRYCANCEL + }; + static const INT16 nButtonMap[] = + { + 2, // #define RET_CANCEL FALSE + 1, // #define RET_OK TRUE + 6, // #define RET_YES 2 + 7, // #define RET_NO 3 + 4 // #define RET_RETRY 4 + }; + + + USHORT nArgCount = (USHORT)rPar.Count(); + if( nArgCount < 2 || nArgCount > 4 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + WinBits nWinBits; + WinBits nType = 0; // MB_OK + if( nArgCount >= 3 ) + nType = (WinBits)rPar.Get(2)->GetInteger(); + WinBits nStyle = nType; + nStyle &= 15; // Bits 4-16 loeschen + if( nStyle > 5 ) + nStyle = 0; + + nWinBits = nStyleMap[ nStyle ]; + if( nType & 4096 ) + nWinBits |= WB_SYSMODAL; + if( nType & 256 ) + { + if( nStyle == 5 || nStyle == 2) + nWinBits |= WB_DEF_CANCEL; + else + nWinBits |= (WB_DEF_CANCEL | WB_DEF_RETRY | WB_DEF_NO); + } + if( nType & 512 ) + nWinBits |= WB_DEF_CANCEL; + + String aMsg = rPar.Get(1)->GetString(); + String aTitle; + if( nArgCount == 4 ) + aTitle = rPar.Get(3)->GetString(); + else + aTitle = GetpApp()->GetAppName(); + + nType &= (16+32+64); + MessBox* pBox = 0; + Window* pParent = GetpApp()->GetDefModalDialogParent(); + switch( nType ) + { + case 16: + pBox = new ErrorBox( pParent, nWinBits, aMsg ); + break; + case 32: + pBox = new QueryBox( pParent, nWinBits, aMsg ); + break; + case 48: + pBox = new WarningBox( pParent, nWinBits, aMsg ); + break; + case 64: + pBox = new InfoBox( pParent, aMsg ); + break; + default: + pBox = new MessBox( pParent, nWinBits, aTitle, aMsg ); + } + pBox->SetText( aTitle ); + USHORT nRet = (USHORT)pBox->Execute(); + if( nRet == TRUE ) + nRet = 1; + rPar.Get(0)->PutInteger( nButtonMap[ nRet ] ); + delete pBox; +} + +RTLFUNC(SetAttr) // JSM +{ + rPar.Get(0)->PutEmpty(); + if ( rPar.Count() == 3 ) + { + String aStr = rPar.Get(1)->GetString(); + INT16 nFlags = rPar.Get(2)->GetInteger(); + + // <-- UCB + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + sal_Bool bReadOnly = (nFlags & 0x0001) != 0; // ATTR_READONLY + xSFI->setReadOnly( aStr, bReadOnly ); + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + } + else + // --> UCB + { + // #57064 Bei virtuellen URLs den Real-Path extrahieren + DirEntry aEntry( aStr ); + String aFile = aEntry.GetFull(); + #ifdef WIN + int nErr = _dos_setfileattr( aFile.GetStr(),(unsigned ) nFlags ); + if ( nErr ) + { + if (errno == EACCES) + StarBASIC::Error( SbERR_ACCESS_DENIED ); + else + StarBASIC::Error( SbERR_FILE_NOT_FOUND ); + } + #endif + ByteString aByteFile( aFile, gsl_getSystemTextEncoding() ); + #ifdef WNT + if (!SetFileAttributes (aByteFile.GetBuffer(),(DWORD)nFlags)) + StarBASIC::Error(SbERR_FILE_NOT_FOUND); + #endif + #ifdef OS2 + FILESTATUS3 aFileStatus; + APIRET rc = DosQueryPathInfo(aByteFile.GetBuffer(),1, + &aFileStatus,sizeof(FILESTATUS3)); + if (!rc) + { + if (aFileStatus.attrFile != nFlags) + { + aFileStatus.attrFile = nFlags; + rc = DosSetPathInfo(aFile.GetStr(),1, + &aFileStatus,sizeof(FILESTATUS3),0); + if (rc) + StarBASIC::Error( SbERR_FILE_NOT_FOUND ); + } + } + else + StarBASIC::Error( SbERR_FILE_NOT_FOUND ); + #endif + } + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + +RTLFUNC(Reset) // JSM +{ + SbiIoSystem* pIO = pINST->GetIoSystem(); + if (pIO) + pIO->CloseAll(); +} + +RTLFUNC(DumpAllObjects) +{ + USHORT nArgCount = (USHORT)rPar.Count(); + if( nArgCount < 2 || nArgCount > 3 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else if( !pBasic ) + StarBASIC::Error( SbERR_INTERNAL_ERROR ); + else + { + SbxObject* p = pBasic; + while( p->GetParent() ) + p = p->GetParent(); + SvFileStream aStrm( rPar.Get( 1 )->GetString(), + STREAM_WRITE | STREAM_TRUNC ); + p->Dump( aStrm, rPar.Get( 2 )->GetBool() ); + aStrm.Close(); + if( aStrm.GetError() != SVSTREAM_OK ) + StarBASIC::Error( SbERR_IO_ERROR ); + } +} + + +RTLFUNC(FileExists) +{ + if ( rPar.Count() == 2 ) + { + String aStr = rPar.Get(1)->GetString(); + BOOL bExists = FALSE; + + // <-- UCB + if( hasUno() ) + { + Reference< XSimpleFileAccess > xSFI = getFileAccess(); + if( xSFI.is() ) + { + try + { + bExists = xSFI->exists( aStr ); + } + catch( Exception & ) + { + StarBASIC::Error( ERRCODE_IO_GENERAL ); + } + } + } + else + // --> UCB + { + DirEntry aEntry( aStr ); + bExists = aEntry.Exists(); + } + rPar.Get(0)->PutBool( bExists ); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx new file mode 100644 index 000000000000..5265ec824324 --- /dev/null +++ b/basic/source/runtime/methods1.cxx @@ -0,0 +1,1266 @@ +/************************************************************************* + * + * $RCSfile: methods1.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#if defined(WIN) +#include <string.h> +#else +#include <stdlib.h> // getenv +#endif + +#ifndef NOOLDSV //autogen +#include <vcl/system.hxx> +#endif +#ifndef _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#ifndef _SV_MAPMOD_HXX +#include <vcl/mapmod.hxx> +#endif +#ifndef _SV_WRKWIN_HXX +#include <vcl/wrkwin.hxx> +#endif +#ifndef _SBXVAR_HXX +#include <svtools/sbxvar.hxx> +#endif +#ifndef _SBX_HXX +#include <svtools/sbx.hxx> +#endif +#ifndef _FSYS_HXX +#include <tools/fsys.hxx> +#endif + +#ifdef OS2 +#define INCL_DOS +#define INCL_DOSPROCESS +#include <tools/svpm.h> +#include <vcl/sysdep.hxx> +#endif + +#if defined(WIN) +#ifndef _SVWIN_H +#include <tools/svwin.h> +#endif +#endif + +#ifndef OS2 +#include <time.h> +#endif + +#ifndef CLK_TCK +#define CLK_TCK CLOCKS_PER_SEC +#endif + +#ifdef VCL +#include <vcl/jobset.hxx> +#else +#include <vcl/jobset.hxx> +#endif + +#pragma hdrstop +#include "sbintern.hxx" +#include "runtime.hxx" +#include "stdobj.hxx" +#include "rtlproto.hxx" +#include "dllmgr.hxx" +#include <iosys.hxx> +#ifndef SB_UNO_OBJ +#include "sbunoobj.hxx" +#endif +#include "propacc.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + + +#if defined (OS2) && defined (__BORLANDC__) +#pragma option -w-par +#endif + +static BOOL Convert (SbxDataType eType, + SbxValue &rSbxValue, + SbxVariable *pSbxVariable) +{ + return TRUE; +} + +RTLFUNC(CBool) // JSM +{ + BOOL bVal = FALSE; + if ( rPar.Count() == 2 ) + { + SbxVariable *pSbxVariable = rPar.Get(1); + bVal = pSbxVariable->GetBool(); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + + rPar.Get(0)->PutBool(bVal); +} + +RTLFUNC(CByte) // JSM +{ + BYTE nByte = 0; + if ( rPar.Count() == 2 ) + { + SbxVariable *pSbxVariable = rPar.Get(1); + nByte = pSbxVariable->GetByte(); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + + rPar.Get(0)->PutByte(nByte); +} + +RTLFUNC(CCur) // JSM +{ + rPar.Get(0)->PutEmpty(); + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); +} + +RTLFUNC(CDate) // JSM +{ + double nVal = 0.0; + if ( rPar.Count() == 2 ) + { + SbxVariable *pSbxVariable = rPar.Get(1); + nVal = pSbxVariable->GetDate(); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + + rPar.Get(0)->PutDate(nVal); +} + +RTLFUNC(CDbl) // JSM +{ + double nVal = 0.0; + if ( rPar.Count() == 2 ) + { + SbxVariable *pSbxVariable = rPar.Get(1); + if( pSbxVariable->GetType() == SbxSTRING ) + { + SbxError eOld = SbxBase::GetError(); + if( eOld != SbxERR_OK ) + SbxBase::ResetError(); + + // AB #42529 , zunaechst Wandlung in Date versuchen + // Wenn erfolgreich, ist das das Ergebnis + nVal = pSbxVariable->GetDate(); + if( SbxBase::GetError() != SbxERR_OK ) + { + SbxBase::ResetError(); + if( eOld != SbxERR_OK ) + SbxBase::SetError( eOld ); + + // AB #41690 , String holen + String aScanStr = pSbxVariable->GetString(); + SbError Error = SbxValue::ScanNumIntnl( aScanStr, nVal ); + if( Error != SbxERR_OK ) + StarBASIC::Error( Error ); + } + } + else + { + nVal = pSbxVariable->GetDouble(); + } + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + + rPar.Get(0)->PutDouble(nVal); +} + +RTLFUNC(CInt) // JSM +{ + INT16 nVal = 0; + if ( rPar.Count() == 2 ) + { + SbxVariable *pSbxVariable = rPar.Get(1); + nVal = pSbxVariable->GetInteger(); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + + rPar.Get(0)->PutInteger(nVal); +} + +RTLFUNC(CLng) // JSM +{ + INT32 nVal = 0; + if ( rPar.Count() == 2 ) + { + SbxVariable *pSbxVariable = rPar.Get(1); + nVal = pSbxVariable->GetLong(); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + + rPar.Get(0)->PutLong(nVal); +} + +RTLFUNC(CSng) // JSM +{ + float nVal = (float)0.0; + if ( rPar.Count() == 2 ) + { + SbxVariable *pSbxVariable = rPar.Get(1); + if( pSbxVariable->GetType() == SbxSTRING ) + { + SbxError eOld = SbxBase::GetError(); + if( eOld != SbxERR_OK ) + SbxBase::ResetError(); + + // AB #42529 , zunaechst Wandlung in Date versuchen + // Wenn erfolgreich, ist das das Ergebnis + double dVal = pSbxVariable->GetDate(); + if( SbxBase::GetError() != SbxERR_OK ) + { + SbxBase::ResetError(); + if( eOld != SbxERR_OK ) + SbxBase::SetError( eOld ); + + // AB #41690 , String holen + String aScanStr = pSbxVariable->GetString(); + SbError Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/TRUE ); + if( SbxBase::GetError() == SbxERR_OK && Error != SbxERR_OK ) + StarBASIC::Error( Error ); + } + nVal = (float)dVal; + } + else + { + nVal = pSbxVariable->GetSingle(); + } + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + + rPar.Get(0)->PutSingle(nVal); +} + +RTLFUNC(CStr) // JSM +{ + String aString; + if ( rPar.Count() == 2 ) + { + SbxVariable *pSbxVariable = rPar.Get(1); + aString = pSbxVariable->GetString(); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + + rPar.Get(0)->PutString(aString); +} + +RTLFUNC(CVar) // JSM +{ + rPar.Get(0)->PutEmpty(); + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); +} + +RTLFUNC(CVErr) // JSM +{ + rPar.Get(0)->PutEmpty(); + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); +} + +RTLFUNC(Iif) // JSM +{ + if ( rPar.Count() == 4 ) + { + if (rPar.Get(1)->GetBool()) + *rPar.Get(0) = *rPar.Get(2); + else + *rPar.Get(0) = *rPar.Get(3); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + +RTLFUNC(GetSystemType) +{ + if ( rPar.Count() != 1 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + // Removed for SRC595 + rPar.Get(0)->PutInteger( -1 ); +} + +RTLFUNC(GetGUIType) +{ + if ( rPar.Count() != 1 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + // 17.7.2000 Make simple solution for testtool / fat office +#if defined (WNT) || (defined (OS2) && !defined (WTC)) + rPar.Get(0)->PutInteger( 1 ); +#elif defined OS2 + rPar.Get(0)->PutInteger( 2 ); +#elif defined UNX + rPar.Get(0)->PutInteger( 4 ); +#elif + rPar.Get(0)->PutInteger( -1 ); +#endif + } +} + +RTLFUNC(Red) +{ + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + ULONG nRGB = (ULONG)rPar.Get(1)->GetLong(); + nRGB &= 0x00FF0000; + nRGB >>= 16; + rPar.Get(0)->PutInteger( (INT16)nRGB ); + } +} + +RTLFUNC(Green) +{ + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + ULONG nRGB = (ULONG)rPar.Get(1)->GetLong(); + nRGB &= 0x0000FF00; + nRGB >>= 8; + rPar.Get(0)->PutInteger( (INT16)nRGB ); + } +} + +RTLFUNC(Blue) +{ + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + ULONG nRGB = (ULONG)rPar.Get(1)->GetLong(); + nRGB &= 0x000000FF; + rPar.Get(0)->PutInteger( (INT16)nRGB ); + } +} + + +RTLFUNC(Switch) +{ + USHORT nCount = rPar.Count(); + if( !(nCount & 0x0001 )) + // Anzahl der Argumente muss ungerade sein + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + USHORT nCurExpr = 1; + while( nCurExpr < (nCount-1) ) + { + if( rPar.Get( nCurExpr )->GetBool()) + { + (*rPar.Get(0)) = *(rPar.Get(nCurExpr+1)); + return; + } + nCurExpr += 2; + } + rPar.Get(0)->PutNull(); +} + + +RTLFUNC(Wait) +{ + if( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + long nWait = rPar.Get(1)->GetLong(); + if( nWait < 0 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } +#if defined(OS2) + ULONG nStart, nCur; + DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT,&nStart,sizeof(ULONG) ); + // drucken wir gerade? + int bPrinting = Sysdepen::IsMultiThread() ? TRUE : FALSE; + do + { + Application::Reschedule(); + if( bPrinting ) + DosSleep( 50 ); // damit der Druck-Thread mehr CPU-Zeit bekommt + DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT,&nCur,sizeof(ULONG) ); + } while( (nCur-nStart) < (ULONG)nWait ); +#else + long nSeconds = nWait / 1000; + if( !nSeconds ) nSeconds = 1; +#if defined(UNX) || defined(WIN) + // Unix hat kein clock() + time_t nStart = time( 0 ); + time_t nEnd; + do + { + Application::Reschedule(); + nEnd = time( 0 ); + } while( (nEnd-nStart) < nSeconds ); +#else + clock_t nStart = clock() / CLK_TCK; + clock_t nEnd; + do + { + Application::Reschedule(); + nEnd = clock() / CLK_TCK; + } while( (nEnd-nStart) < nSeconds ); +#endif + +#endif +} + +RTLFUNC(GetGUIVersion) +{ + if ( rPar.Count() != 1 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + // Removed for SRC595 + rPar.Get(0)->PutLong( -1 ); + } +} + +RTLFUNC(Choose) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + INT16 nIndex = rPar.Get(1)->GetInteger(); + USHORT nCount = rPar.Count(); + nCount--; + if( nCount == 1 || nIndex > (nCount-1) || nIndex < 1 ) + { + rPar.Get(0)->PutNull(); + return; + } + (*rPar.Get(0)) = *(rPar.Get(nIndex+1)); +} + + +RTLFUNC(Trim) +{ + if ( rPar.Count() < 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + String aStr( rPar.Get(1)->GetString() ); + aStr.EraseLeadingChars(); + aStr.EraseTrailingChars(); + rPar.Get(0)->PutString( aStr ); + } +} + +RTLFUNC(DateAdd) +{ +} + +RTLFUNC(DateDiff) +{ +} + +RTLFUNC(DatePart) +{ +} + + +RTLFUNC(GetSolarVersion) +{ + rPar.Get(0)->PutLong( (INT32)SUPD ); +} + +RTLFUNC(TwipsPerPixelX) +{ + Size aSize( 100,0 ); + MapMode aMap( MAP_TWIP ); + aSize = GetpApp()->GetAppWindow()->PixelToLogic( aSize, aMap ); + aSize.Width() /= 100; + rPar.Get(0)->PutLong( aSize.Width() ); +} + +RTLFUNC(TwipsPerPixelY) +{ + Size aSize( 0,100 ); + MapMode aMap( MAP_TWIP ); + aSize = GetpApp()->GetAppWindow()->PixelToLogic( aSize, aMap ); + aSize.Height() /= 100; + rPar.Get(0)->PutLong( aSize.Height() ); +} + + +RTLFUNC(FreeLibrary) +{ + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + ByteString aByteDLLName( rPar.Get(1)->GetString(), gsl_getSystemTextEncoding() ); + pINST->GetDllMgr()->FreeDll( aByteDLLName ); +} + +RTLFUNC(Array) +{ + SbxDimArray* pArray = new SbxDimArray( SbxVARIANT ); + USHORT nArraySize = rPar.Count() - 1; + + // Option Base zunaechst ignorieren (kennt leider nur der Compiler) + if( nArraySize ) + pArray->AddDim( 0, nArraySize-1 ); + + // Parameter ins Array uebernehmen + for( short i = 0 ; i < nArraySize ; i++ ) + pArray->Put( rPar.Get(i+1), &i ); + + // Array zurueckliefern + SbxVariableRef refVar = rPar.Get(0); + USHORT nFlags = refVar->GetFlags(); + refVar->ResetFlag( SBX_FIXED ); + refVar->PutObject( pArray ); + refVar->SetFlags( nFlags ); + refVar->SetParameters( NULL ); +} + + +// Featurewunsch #57868 +// Die Funktion liefert ein Variant-Array, wenn keine Parameter angegeben +// werden, wird ein leeres Array erzeugt (entsprechend dim a(), entspricht +// einer Sequence der Laenge 0 in Uno). +// Wenn Parameter angegeben sind, wird fuer jeden eine Dimension erzeugt +// DimArray( 2, 2, 4 ) entspricht DIM a( 2, 2, 4 ) +// Das Array ist immer vom Typ Variant +RTLFUNC(DimArray) +{ + SbxDimArray* pArray = new SbxDimArray( SbxVARIANT ); + USHORT nArrayDims = rPar.Count() - 1; + if( nArrayDims > 0 ) + { + for( USHORT i = 0; i < nArrayDims ; i++ ) + { + INT16 ub = rPar.Get(i+1)->GetInteger(); + if( ub < 0 ) + { + StarBASIC::Error( SbERR_OUT_OF_RANGE ); + ub = 0; + } + pArray->AddDim( 0, ub ); + } + } + // Array zurueckliefern + SbxVariableRef refVar = rPar.Get(0); + USHORT nFlags = refVar->GetFlags(); + refVar->ResetFlag( SBX_FIXED ); + refVar->PutObject( pArray ); + refVar->SetFlags( nFlags ); + refVar->SetParameters( NULL ); +} + +/* + * FindObject und FindPropertyObject ermoeglichen es, + * Objekte und Properties vom Typ Objekt zur Laufzeit + * ueber ihren Namen als String-Parameter anzusprechen. + * + * Bsp.: + * MyObj.Prop1.Bla = 5 + * + * entspricht: + * dim ObjVar as Object + * dim ObjProp as Object + * ObjName$ = "MyObj" + * ObjVar = FindObject( ObjName$ ) + * PropName$ = "Prop1" + * ObjProp = FindPropertyObject( ObjVar, PropName$ ) + * ObjProp.Bla = 5 + * + * Dabei koennen die Namen zur Laufzeit dynamisch + * erzeugt werden und, so dass z.B. ueber Controls + * "TextEdit1" bis "TextEdit5" in einem Dialog in + * einer Schleife iteriert werden kann. + */ + +// Objekt ueber den Namen ansprechen +// 1. Parameter = Name des Objekts als String +RTLFUNC(FindObject) +{ + // Wir brauchen einen Parameter + if ( rPar.Count() < 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // 1. Parameter ist der Name + String aNameStr = rPar.Get(1)->GetString(); + + // Basic-Suchfunktion benutzen + SbxBase* pFind = StarBASIC::FindSBXInCurrentScope( aNameStr ); + SbxObject* pFindObj = NULL; + if( pFind ) + pFindObj = PTR_CAST(SbxObject,pFind); + /* + if( !pFindObj ) + { + StarBASIC::Error( SbERR_VAR_UNDEFINED ); + return; + } + */ + + // Objekt zurueckliefern + SbxVariableRef refVar = rPar.Get(0); + refVar->PutObject( pFindObj ); +} + +// Objekt-Property in einem Objekt ansprechen +// 1. Parameter = Objekt +// 2. Parameter = Name der Property als String +RTLFUNC(FindPropertyObject) +{ + // Wir brauchen 2 Parameter + if ( rPar.Count() < 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + // 1. Parameter holen, muss Objekt sein + SbxBase* pObjVar = (SbxObject*)rPar.Get(1)->GetObject(); + SbxObject* pObj = NULL; + if( pObjVar ) + pObj = PTR_CAST(SbxObject,pObjVar); + if( !pObj && pObjVar && pObjVar->ISA(SbxVariable) ) + { + SbxBase* pObjVarObj = ((SbxVariable*)pObjVar)->GetObject(); + pObj = PTR_CAST(SbxObject,pObjVarObj); + } + /* + if( !pObj ) + { + StarBASIC::Error( SbERR_VAR_UNDEFINED ); + return; + } + */ + + // 2. Parameter ist der Name + String aNameStr = rPar.Get(2)->GetString(); + + // Jetzt muss ein Objekt da sein, sonst Error + SbxObject* pFindObj = NULL; + if( pObj ) + { + // Im Objekt nach Objekt suchen + SbxVariable* pFindVar = pObj->Find( aNameStr, SbxCLASS_OBJECT ); + pFindObj = PTR_CAST(SbxObject,pFindVar); + } + else + StarBASIC::Error( SbERR_BAD_PARAMETER ); + + // Objekt zurueckliefern + SbxVariableRef refVar = rPar.Get(0); + refVar->PutObject( pFindObj ); +} + + + +BOOL lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, + BOOL bBinary, short nBlockLen, BOOL bIsArray ) +{ + ULONG nFPos = pStrm->Tell(); + + BOOL bIsVariant = !rVar.IsFixed(); + SbxDataType eType = rVar.GetType(); + + switch( eType ) + { + case SbxBOOL: + case SbxCHAR: + case SbxBYTE: + if( bIsVariant ) + *pStrm << (USHORT)SbxBYTE; // VarType Id + *pStrm << rVar.GetByte(); + break; + + case SbxEMPTY: + case SbxNULL: + case SbxVOID: + case SbxINTEGER: + case SbxUSHORT: + case SbxINT: + case SbxUINT: + if( bIsVariant ) + *pStrm << (USHORT)SbxINTEGER; // VarType Id + *pStrm << rVar.GetInteger(); + break; + + case SbxLONG: + case SbxULONG: + case SbxLONG64: + case SbxULONG64: + if( bIsVariant ) + *pStrm << (USHORT)SbxLONG; // VarType Id + *pStrm << rVar.GetLong(); + break; + + case SbxSINGLE: + if( bIsVariant ) + *pStrm << (USHORT)eType; // VarType Id + *pStrm << rVar.GetSingle(); + break; + + case SbxDOUBLE: + case SbxCURRENCY: + case SbxDATE: + if( bIsVariant ) + *pStrm << (USHORT)eType; // VarType Id + *pStrm << rVar.GetDouble(); + break; + + case SbxSTRING: + case SbxLPSTR: + { + const String& rStr = rVar.GetString(); + if( !bBinary || bIsArray ) + { + if( bIsVariant ) + *pStrm << (USHORT)SbxSTRING; + pStrm->WriteByteString( rStr, gsl_getSystemTextEncoding() ); + //*pStrm << rStr; + } + else + { + // ohne Laengenangabe! ohne Endekennung! + // What does that mean for Unicode?! Choosing conversion to ByteString... + ByteString aByteStr( rStr, gsl_getSystemTextEncoding() ); + *pStrm << (const char*)aByteStr.GetBuffer(); + //*pStrm << (const char*)rStr.GetStr(); + } + } + break; + + default: + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return FALSE; + } + + if( nBlockLen ) + pStrm->Seek( nFPos + nBlockLen ); + return pStrm->GetErrorCode() ? FALSE : TRUE; +} + +BOOL lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, + BOOL bBinary, short nBlockLen, BOOL bIsArray ) +{ + double aDouble; + + ULONG nFPos = pStrm->Tell(); + + BOOL bIsVariant = !rVar.IsFixed(); + SbxDataType eVarType = rVar.GetType(); + + SbxDataType eSrcType = eVarType; + if( bIsVariant ) + { + USHORT nTemp; + *pStrm >> nTemp; + eSrcType = (SbxDataType)nTemp; + } + + switch( eSrcType ) + { + case SbxBOOL: + case SbxCHAR: + case SbxBYTE: + { + BYTE aByte; + *pStrm >> aByte; + rVar.PutByte( aByte ); + } + break; + + case SbxEMPTY: + case SbxNULL: + case SbxVOID: + case SbxINTEGER: + case SbxUSHORT: + case SbxINT: + case SbxUINT: + { + INT16 aInt; + *pStrm >> aInt; + rVar.PutInteger( aInt ); + } + break; + + case SbxLONG: + case SbxULONG: + case SbxLONG64: + case SbxULONG64: + { + INT32 aInt; + *pStrm >> aInt; + rVar.PutLong( aInt ); + } + break; + + case SbxSINGLE: + { + float nS; + *pStrm >> nS; + rVar.PutSingle( nS ); + } + break; + + case SbxDOUBLE: + case SbxCURRENCY: + { + *pStrm >> aDouble; + rVar.PutDouble( aDouble ); + } + break; + + case SbxDATE: + { + *pStrm >> aDouble; + rVar.PutDate( aDouble ); + } + break; + + case SbxSTRING: + case SbxLPSTR: + { + String aStr; + pStrm->ReadByteString( aStr, gsl_getSystemTextEncoding() ); + rVar.PutString( aStr ); + } + break; + + default: + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return FALSE; + } + + if( nBlockLen ) + pStrm->Seek( nFPos + nBlockLen ); + return pStrm->GetErrorCode() ? FALSE : TRUE; +} + + +// nCurDim = 1...n +BOOL lcl_WriteReadSbxArray( SbxDimArray& rArr, SvStream* pStrm, + BOOL bBinary, short nCurDim, short* pOtherDims, BOOL bWrite ) +{ + DBG_ASSERT( nCurDim > 0,"Bad Dim"); + short nLower, nUpper; + if( !rArr.GetDim( nCurDim, nLower, nUpper ) ) + return FALSE; + for( short nCur = nLower; nCur <= nUpper; nCur++ ) + { + pOtherDims[ nCurDim-1 ] = nCur; + if( nCurDim != 1 ) + lcl_WriteReadSbxArray(rArr, pStrm, bBinary, nCurDim-1, pOtherDims, bWrite); + else + { + SbxVariable* pVar = rArr.Get( (const short*)pOtherDims ); + BOOL bRet; + if( bWrite ) + bRet = lcl_WriteSbxVariable(*pVar, pStrm, bBinary, 0, TRUE ); + else + bRet = lcl_ReadSbxVariable(*pVar, pStrm, bBinary, 0, TRUE ); + if( !bRet ) + return FALSE; + } + } + return TRUE; +} + +void PutGet( SbxArray& rPar, BOOL bPut ) +{ + // Wir brauchen 3 Parameter + if ( rPar.Count() != 4 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + INT16 nFileNo = rPar.Get(1)->GetInteger(); + SbxVariable* pVar2 = rPar.Get(2); + BOOL bHasRecordNo = (BOOL)(pVar2->GetType() != SbxEMPTY); + long nRecordNo = pVar2->GetLong(); + if ( nFileNo < 1 || ( bHasRecordNo && nRecordNo < 1 ) ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + nRecordNo--; // wir moegen's ab 0! + SbiIoSystem* pIO = pINST->GetIoSystem(); + SbiStream* pSbStrm = pIO->GetStream( nFileNo ); + // das File muss Random (feste Record-Laenge) oder Binary sein + if ( !pSbStrm || !(pSbStrm->GetMode() & (SBSTRM_BINARY | SBSTRM_RANDOM)) ) + { + StarBASIC::Error( SbERR_BAD_CHANNEL ); + return; + } + + SvStream* pStrm = pSbStrm->GetStrm(); + BOOL bRandom = pSbStrm->IsRandom(); + short nBlockLen = bRandom ? pSbStrm->GetBlockLen() : 0; + + if( bPut ) + { + // Datei aufplustern, falls jemand uebers Dateiende hinaus geseekt hat + pSbStrm->ExpandFile(); + } + + // auf die Startposition seeken + if( bHasRecordNo ) + { + ULONG nFilePos = bRandom ? (ULONG)(nBlockLen*nRecordNo) : (ULONG)nRecordNo; + pStrm->Seek( nFilePos ); + } + + SbxDimArray* pArr = 0; + SbxVariable* pVar = rPar.Get(3); + if( pVar->GetType() & SbxARRAY ) + { + SbxBase* pParObj = pVar->GetObject(); + pArr = PTR_CAST(SbxDimArray,pParObj); + } + + BOOL bRet; + + if( pArr ) + { + ULONG nFPos = pStrm->Tell(); + short nDims = pArr->GetDims(); + short* pDims = new short[ nDims ]; + bRet = lcl_WriteReadSbxArray(*pArr,pStrm,!bRandom,nDims,pDims,bPut); + delete pDims; + if( nBlockLen ) + pStrm->Seek( nFPos + nBlockLen ); + } + else + { + if( bPut ) + bRet = lcl_WriteSbxVariable(*pVar, pStrm, !bRandom, nBlockLen, FALSE); + else + bRet = lcl_ReadSbxVariable(*pVar, pStrm, !bRandom, nBlockLen, FALSE); + } + if( !bRet || pStrm->GetErrorCode() ) + StarBASIC::Error( SbERR_IO_ERROR ); +} + +RTLFUNC(Put) +{ + PutGet( rPar, TRUE ); +} + +RTLFUNC(Get) +{ + PutGet( rPar, FALSE ); +} + +RTLFUNC(Environ) +{ + if ( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + String aResult; + // sollte ANSI sein, aber unter Win16 in DLL nicht moeglich +#if defined(WIN) + LPSTR lpszEnv = GetDOSEnvironment(); + String aCompareStr( rPar.Get(1)->GetString() ); + aCompareStr += '='; + const char* pCompare = aCompareStr.GetStr(); + int nCompareLen = aCompareStr.Len(); + while ( *lpszEnv ) + { + // Es werden alle EnvString in der Form ENV=VAL 0-terminiert + // aneinander gehaengt. + + if ( strnicmp( pCompare, lpszEnv, nCompareLen ) == 0 ) + { + aResult = (const char*)(lpszEnv+nCompareLen); + rPar.Get(0)->PutString( aResult ); + return; + } + lpszEnv += lstrlen( lpszEnv ) + 1; // Next Enviroment-String + } +#else + ByteString aByteStr( rPar.Get(1)->GetString(), gsl_getSystemTextEncoding() ); + const char* pEnvStr = getenv( aByteStr.GetBuffer() ); + if ( pEnvStr ) + aResult = String::CreateFromAscii( pEnvStr ); +#endif + rPar.Get(0)->PutString( aResult ); +} + +static double GetDialogZoomFactor( BOOL bX, long nValue ) +{ + Size aRefSize( nValue, nValue ); +#ifndef WIN + Fraction aFracX( 1, 26 ); +#else + Fraction aFracX( 1, 23 ); +#endif + Fraction aFracY( 1, 24 ); + MapMode aMap( MAP_APPFONT, Point(), aFracX, aFracY ); + Window* pWin = GetpApp()->GetAppWindow(); + Size aScaledSize = pWin->LogicToPixel( aRefSize, aMap ); + aRefSize = pWin->LogicToPixel( aRefSize, MapMode(MAP_TWIP) ); + double nRef, nScaled, nResult; + if( bX ) + { + nRef = aRefSize.Width(); + nScaled = aScaledSize.Width(); + } + else + { + nRef = aRefSize.Height(); + nScaled = aScaledSize.Height(); + } + nResult = nScaled / nRef; + return nResult; +} + + +RTLFUNC(GetDialogZoomFactorX) +{ + if ( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + rPar.Get(0)->PutDouble( GetDialogZoomFactor( TRUE, rPar.Get(1)->GetLong() )); +} + +RTLFUNC(GetDialogZoomFactorY) +{ + if ( rPar.Count() != 2 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + rPar.Get(0)->PutDouble( GetDialogZoomFactor( FALSE, rPar.Get(1)->GetLong())); +} + + +RTLFUNC(EnableReschedule) +{ + rPar.Get(0)->PutEmpty(); + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + if( pINST ) + pINST->EnableReschedule( rPar.Get(1)->GetBool() ); +} + +RTLFUNC(GetSystemTicks) +{ + if ( rPar.Count() != 1 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + rPar.Get(0)->PutLong( Time::GetSystemTicks() ); +} + +RTLFUNC(GetPathSeparator) +{ + if ( rPar.Count() != 1 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + rPar.Get(0)->PutString( DirEntry::GetAccessDelimiter() ); +} + +RTLFUNC(ResolvePath) +{ + if ( rPar.Count() == 2 ) + { + String aStr = rPar.Get(1)->GetString(); + DirEntry aEntry( aStr ); + //if( aEntry.IsVirtual() ) + //aStr = aEntry.GetRealPathFromVirtualURL(); + rPar.Get(0)->PutString( aStr ); + } + else + StarBASIC::Error( SbERR_BAD_ARGUMENT ); +} + +RTLFUNC(TypeLen) +{ + if ( rPar.Count() != 2 ) + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + else + { + SbxDataType eType = rPar.Get(1)->GetType(); + INT16 nLen = 0; + switch( eType ) + { + case SbxEMPTY: + case SbxNULL: + case SbxVECTOR: + case SbxARRAY: + case SbxBYREF: + case SbxVOID: + case SbxHRESULT: + case SbxPOINTER: + case SbxDIMARRAY: + case SbxCARRAY: + case SbxUSERDEF: + nLen = 0; + break; + + case SbxINTEGER: + case SbxERROR: + case SbxUSHORT: + case SbxINT: + case SbxUINT: + nLen = 2; + break; + + case SbxLONG: + case SbxSINGLE: + case SbxULONG: + nLen = 4; + break; + + case SbxDOUBLE: + case SbxCURRENCY: + case SbxDATE: + case SbxLONG64: + case SbxULONG64: + nLen = 8; + break; + + case SbxOBJECT: + case SbxVARIANT: + case SbxDATAOBJECT: + nLen = 0; + break; + + case SbxCHAR: + case SbxBYTE: + case SbxBOOL: + nLen = 1; + break; + + case SbxLPSTR: + case SbxLPWSTR: + case SbxCoreSTRING: + case SbxSTRING: + nLen = (INT16)rPar.Get(1)->GetString().Len(); + break; + + default: + nLen = 0; + } + rPar.Get(0)->PutInteger( nLen ); + } +} + + +// Uno-Struct eines beliebigen Typs erzeugen +// 1. Parameter == Klassename, weitere Parameter zur Initialisierung +RTLFUNC(CreateUnoStruct) +{ + RTL_Impl_CreateUnoStruct( pBasic, rPar, bWrite ); +} + +// Uno-Service erzeugen +// 1. Parameter == Service-Name +RTLFUNC(CreateUnoService) +{ + RTL_Impl_CreateUnoService( pBasic, rPar, bWrite ); +} + +// ServiceManager liefern (keine Parameter) +RTLFUNC(GetProcessServiceManager) +{ + RTL_Impl_GetProcessServiceManager( pBasic, rPar, bWrite ); +} + +// PropertySet erzeugen +// 1. Parameter == Sequence<PropertyValue> +RTLFUNC(CreatePropertySet) +{ + RTL_Impl_CreatePropertySet( pBasic, rPar, bWrite ); +} + +// Abfragen, ob ein Interface unterstuetzt wird +// Mehrere Interface-Namen als Parameter +RTLFUNC(HasUnoInterfaces) +{ + RTL_Impl_HasInterfaces( pBasic, rPar, bWrite ); +} + +// Abfragen, ob ein Basic-Objekt ein Uno-Struct repraesentiert +RTLFUNC(IsUnoStruct) +{ + RTL_Impl_IsUnoStruct( pBasic, rPar, bWrite ); +} + +// Abfragen, ob zwei Uno-Objekte identisch sind +RTLFUNC(EqualUnoObjects) +{ + RTL_Impl_EqualUnoObjects( pBasic, rPar, bWrite ); +} + diff --git a/basic/source/runtime/os2.asm b/basic/source/runtime/os2.asm new file mode 100644 index 000000000000..c50f2233ec87 --- /dev/null +++ b/basic/source/runtime/os2.asm @@ -0,0 +1,89 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; OS2.ASM +;; +;; Ersterstellung MD 30.05.94 +;; +;; Anmerkungen +;; Direktaufruf von C- und PASCAL-Routinen, OS/2 +;; +;; Source Code Control System - Header +;; $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/basic/source/runtime/os2.asm,v 1.1.1.1 2000-09-18 16:12:11 hr Exp $ +;; +;; Copyright (c) 1990,95 by STAR DIVISION GmbH +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Inhalt: +; type = CallXXX (far *proc, char *stack, short nstack) +; +; Kopie des Basic-Stacks (nstack Bytes) auf den C-Stack +; und Aufruf der Prozedur. + + .386 + .MODEL FLAT + + .CODE + + PUBLIC CallINT + PUBLIC CallLNG + PUBLIC CallSNG + PUBLIC CallDBL + PUBLIC CallSTR + PUBLIC CallFIX + + PUBLIC _CallINT + PUBLIC _CallLNG + PUBLIC _CallSNG + PUBLIC _CallDBL + PUBLIC _CallSTR + PUBLIC _CallFIX + +_CallINT LABEL byte +_CallLNG LABEL byte +_CallSNG LABEL byte +_CallDBL LABEL byte +_CallSTR LABEL byte +_CallFIX LABEL byte + +CallINT LABEL byte +CallLNG LABEL byte +CallSNG LABEL byte +CallDBL LABEL byte +CallSTR LABEL byte +CallFIX PROC + +p EQU [EBP+8] +stk EQU [EBP+12] +n EQU [EBP+16] + + PUSH EBP + MOV EBP,ESP + PUSH ESI + PUSH EDI + MOV DX,DS + MOVZX ECX,word ptr [n] + SUB ESP,ECX + MOV EDI,ESP + MOV AX,SS + MOV ES,AX + MOV ESI,[stk] + SHR ECX,1 + CLD + JCXZ $1 + REP MOVSW ; Stack uebernehmen +$1: MOV DS,DX + CALL LARGE [p] ; 32-bit + MOV ECX,EBP + SUB ECX,8 ; wegen gepushter Register + MOV ESP,ECX + POP EDI + POP ESI + POP EBP +; Bei Borland C++ Calling Convention: +; RET 12 +; CSet System-Calling Convention + RET +CallFIX ENDP + + END diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx new file mode 100644 index 000000000000..7c43f22b5dc5 --- /dev/null +++ b/basic/source/runtime/props.cxx @@ -0,0 +1,504 @@ +/************************************************************************* + * + * $RCSfile: props.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <svtools/sbx.hxx> +#include "runtime.hxx" +#pragma hdrstop +#include "stdobj.hxx" +#include "rtlproto.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + +#if defined (OS2) && defined (__BORLANDC__) +#pragma option -w-par +#endif + + +// Properties und Methoden legen beim Get (bWrite = FALSE) den Returnwert +// im Element 0 des Argv ab; beim Put (bWrite = TRUE) wird der Wert aus +// Element 0 gespeichert. + +RTLFUNC(Erl) +{ + rPar.Get( 0 )->PutLong( StarBASIC::GetErl() ); +} + +RTLFUNC(Err) +{ + if( bWrite ) + { + INT32 nVal = rPar.Get( 0 )->GetLong(); + if( nVal <= 65535L ) + StarBASIC::Error( StarBASIC::GetSfxFromVBError( (USHORT) nVal ) ); + } + else + rPar.Get( 0 )->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErr() ) ); +} + +RTLFUNC(False) +{ + rPar.Get(0)->PutBool( FALSE ); +} + +RTLFUNC(Nothing) +{ + // liefert eine leere Objekt-Variable. + rPar.Get( 0 )->PutObject( NULL ); +} + +RTLFUNC(Null) +{ + // liefert eine leere Objekt-Variable. + rPar.Get( 0 )->PutNull(); +} + +RTLFUNC(PI) +{ + rPar.Get( 0 )->PutDouble( F_PI ); +} + +RTLFUNC(True) +{ + rPar.Get( 0 )->PutBool( TRUE ); +} + +RTLFUNC(ATTR_NORMAL) +{ + rPar.Get(0)->PutInteger(0); +} +RTLFUNC(ATTR_READONLY) +{ + rPar.Get(0)->PutInteger(1); +} +RTLFUNC(ATTR_HIDDEN) +{ + rPar.Get(0)->PutInteger(2); +} +RTLFUNC(ATTR_SYSTEM) +{ + rPar.Get(0)->PutInteger(4); +} +RTLFUNC(ATTR_VOLUME) +{ + rPar.Get(0)->PutInteger(8); +} +RTLFUNC(ATTR_DIRECTORY) +{ + rPar.Get(0)->PutInteger(16); +} +RTLFUNC(ATTR_ARCHIVE) +{ + rPar.Get(0)->PutInteger(32); +} + +RTLFUNC(V_EMPTY) +{ + rPar.Get(0)->PutInteger(0); +} +RTLFUNC(V_NULL) +{ + rPar.Get(0)->PutInteger(1); +} +RTLFUNC(V_INTEGER) +{ + rPar.Get(0)->PutInteger(2); +} +RTLFUNC(V_LONG) +{ + rPar.Get(0)->PutInteger(3); +} +RTLFUNC(V_SINGLE) +{ + rPar.Get(0)->PutInteger(4); +} +RTLFUNC(V_DOUBLE) +{ + rPar.Get(0)->PutInteger(5); +} +RTLFUNC(V_CURRENCY) +{ + rPar.Get(0)->PutInteger(6); +} +RTLFUNC(V_DATE) +{ + rPar.Get(0)->PutInteger(7); +} +RTLFUNC(V_STRING) +{ + rPar.Get(0)->PutInteger(8); +} + +RTLFUNC(MB_OK) +{ + rPar.Get(0)->PutInteger(0); +} +RTLFUNC(MB_OKCANCEL) +{ + rPar.Get(0)->PutInteger(1); +} +RTLFUNC(MB_ABORTRETRYIGNORE) +{ + rPar.Get(0)->PutInteger(2); +} +RTLFUNC(MB_YESNOCANCEL) +{ + rPar.Get(0)->PutInteger(3); +} +RTLFUNC(MB_YESNO) +{ + rPar.Get(0)->PutInteger(4); +} +RTLFUNC(MB_RETRYCANCEL) +{ + rPar.Get(0)->PutInteger(5); +} +RTLFUNC(MB_ICONSTOP) +{ + rPar.Get(0)->PutInteger(16); +} +RTLFUNC(MB_ICONQUESTION) +{ + rPar.Get(0)->PutInteger(32); +} +RTLFUNC(MB_ICONEXCLAMATION) +{ + rPar.Get(0)->PutInteger(48); +} +RTLFUNC(MB_ICONINFORMATION) +{ + rPar.Get(0)->PutInteger(64); +} +RTLFUNC(MB_DEFBUTTON1) +{ + rPar.Get(0)->PutInteger(0); +} +RTLFUNC(MB_DEFBUTTON2) +{ + rPar.Get(0)->PutInteger(256); +} +RTLFUNC(MB_DEFBUTTON3) +{ + rPar.Get(0)->PutInteger(512); +} +RTLFUNC(MB_APPLMODAL) +{ + rPar.Get(0)->PutInteger(0); +} +RTLFUNC(MB_SYSTEMMODAL) +{ + rPar.Get(0)->PutInteger(4096); +} + +RTLFUNC(IDOK) +{ + rPar.Get(0)->PutInteger(1); +} + +RTLFUNC(IDCANCEL) +{ + rPar.Get(0)->PutInteger(2); +} +RTLFUNC(IDABORT) +{ + rPar.Get(0)->PutInteger(3); +} +RTLFUNC(IDRETRY) +{ + rPar.Get(0)->PutInteger(4); +} +RTLFUNC(IDYES) +{ + rPar.Get(0)->PutInteger(6); +} +RTLFUNC(IDNO) +{ + rPar.Get(0)->PutInteger(7); +} + +RTLFUNC(CF_TEXT) +{ + rPar.Get(0)->PutInteger(1); +} +RTLFUNC(CF_BITMAP) +{ + rPar.Get(0)->PutInteger(2); +} +RTLFUNC(CF_METAFILEPICT) +{ + rPar.Get(0)->PutInteger(3); +} + +RTLFUNC(TYP_AUTHORFLD) +{ + rPar.Get(0)->PutInteger(7); +} +RTLFUNC(TYP_CHAPTERFLD) +{ + rPar.Get(0)->PutInteger(4); +} +RTLFUNC(TYP_CONDTXTFLD) +{ + rPar.Get(0)->PutInteger(27); +} +RTLFUNC(TYP_DATEFLD) +{ + rPar.Get(0)->PutInteger(0); +} +RTLFUNC(TYP_DBFLD) +{ + rPar.Get(0)->PutInteger(19); +} +RTLFUNC(TYP_DBNAMEFLD) +{ + rPar.Get(0)->PutInteger(3); +} +RTLFUNC(TYP_DBNEXTSETFLD) +{ + rPar.Get(0)->PutInteger(24); +} +RTLFUNC(TYP_DBNUMSETFLD) +{ + rPar.Get(0)->PutInteger(25); +} +RTLFUNC(TYP_DBSETNUMBERFLD) +{ + rPar.Get(0)->PutInteger(26); +} +RTLFUNC(TYP_DDEFLD) +{ + rPar.Get(0)->PutInteger(14); +} +RTLFUNC(TYP_DOCINFOFLD) +{ + rPar.Get(0)->PutInteger(18); +} +RTLFUNC(TYP_DOCSTATFLD) +{ + rPar.Get(0)->PutInteger(6); +} +RTLFUNC(TYP_EXTUSERFLD) +{ + rPar.Get(0)->PutInteger(30); +} +RTLFUNC(TYP_FILENAMEFLD) +{ + rPar.Get(0)->PutInteger(2); +} +RTLFUNC(TYP_FIXDATEFLD) +{ + rPar.Get(0)->PutInteger(31); +} +RTLFUNC(TYP_FIXTIMEFLD) +{ + rPar.Get(0)->PutInteger(32); +} +RTLFUNC(TYP_FORMELFLD) +{ + rPar.Get(0)->PutInteger(10); +} +RTLFUNC(TYP_GETFLD) +{ + rPar.Get(0)->PutInteger(9); +} +RTLFUNC(TYP_GETREFFLD) +{ + rPar.Get(0)->PutInteger(13); +} +RTLFUNC(TYP_HIDDENPARAFLD) +{ + rPar.Get(0)->PutInteger(17); +} +RTLFUNC(TYP_HIDDENTXTFLD) +{ + rPar.Get(0)->PutInteger(11); +} +RTLFUNC(TYP_INPUTFLD) +{ + rPar.Get(0)->PutInteger(16); +} +RTLFUNC(TYP_MACROFLD) +{ + rPar.Get(0)->PutInteger(15); +} +RTLFUNC(TYP_NEXTPAGEFLD) +{ + rPar.Get(0)->PutInteger(28); +} +RTLFUNC(TYP_PAGENUMBERFLD) +{ + rPar.Get(0)->PutInteger(5); +} +RTLFUNC(TYP_POSTITFLD) +{ + rPar.Get(0)->PutInteger(21); +} +RTLFUNC(TYP_PREVPAGEFLD) +{ + rPar.Get(0)->PutInteger(29); +} +RTLFUNC(TYP_SEQFLD) +{ + rPar.Get(0)->PutInteger(23); +} +RTLFUNC(TYP_SETFLD) +{ + rPar.Get(0)->PutInteger(8); +} +RTLFUNC(TYP_SETINPFLD) +{ + rPar.Get(0)->PutInteger(33); +} +RTLFUNC(TYP_SETREFFLD) +{ + rPar.Get(0)->PutInteger(12); +} +RTLFUNC(TYP_TEMPLNAMEFLD) +{ + rPar.Get(0)->PutInteger(22); +} +RTLFUNC(TYP_TIMEFLD) +{ + rPar.Get(0)->PutInteger(1); +} +RTLFUNC(TYP_USERFLD) +{ + rPar.Get(0)->PutInteger(20); +} +RTLFUNC(TYP_USRINPFLD) +{ + rPar.Get(0)->PutInteger(34); +} +RTLFUNC(TYP_SETREFPAGEFLD) +{ + rPar.Get(0)->PutInteger(35); +} +RTLFUNC(TYP_GETREFPAGEFLD) +{ + rPar.Get(0)->PutInteger(36); +} +RTLFUNC(TYP_INTERNETFLD) +{ + rPar.Get(0)->PutInteger(37); +} + +RTLFUNC(SET_ON) +{ + rPar.Get(0)->PutInteger(1); +} +RTLFUNC(SET_OFF) +{ + rPar.Get(0)->PutInteger(0); +} +RTLFUNC(TOGGLE) +{ + rPar.Get(0)->PutInteger(2); +} + +RTLFUNC(FRAMEANCHORPAGE) +{ + rPar.Get(0)->PutInteger(1); +} +RTLFUNC(FRAMEANCHORPARA) +{ + rPar.Get(0)->PutInteger(14); +} +RTLFUNC(FRAMEANCHORCHAR) +{ + rPar.Get(0)->PutInteger(15); +} + +RTLFUNC(CLEAR_ALLTABS) +{ + rPar.Get(0)->PutInteger(2); +} +RTLFUNC(CLEAR_TAB) +{ + rPar.Get(0)->PutInteger(1); +} +RTLFUNC(SET_TAB) +{ + rPar.Get(0)->PutInteger(0); +} + +RTLFUNC(LINEPROP) +{ + rPar.Get(0)->PutInteger(0); +} +RTLFUNC(LINE_1) +{ + rPar.Get(0)->PutInteger(1); +} +RTLFUNC(LINE_15) +{ + rPar.Get(0)->PutInteger(2); +} +RTLFUNC(LINE_2) +{ + rPar.Get(0)->PutInteger(3); +} + +RTLFUNC(TYP_JUMPEDITFLD) +{ + rPar.Get(0)->PutInteger(38); +} + + diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx new file mode 100644 index 000000000000..18902eafae0e --- /dev/null +++ b/basic/source/runtime/rtlproto.hxx @@ -0,0 +1,354 @@ +/************************************************************************* + * + * $RCSfile: rtlproto.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include "sbstar.hxx" +#include "macfix.hxx" + +#define RTLFUNC( name ) void SbRtl_##name( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +#define RTLNAME( name ) MEMBER(SbRtl_##name) + +typedef void( *RtlCall ) ( StarBASIC* p, SbxArray& rArgs, BOOL bWrite ); + +// Properties + +extern RTLFUNC(Date); +extern RTLFUNC(Err); +extern RTLFUNC(Erl); +extern RTLFUNC(False); +extern RTLFUNC(Nothing); +extern RTLFUNC(Null); +extern RTLFUNC(True); + +extern RTLFUNC(ATTR_NORMAL); +extern RTLFUNC(ATTR_READONLY); +extern RTLFUNC(ATTR_HIDDEN); +extern RTLFUNC(ATTR_SYSTEM); +extern RTLFUNC(ATTR_VOLUME); +extern RTLFUNC(ATTR_DIRECTORY); +extern RTLFUNC(ATTR_ARCHIVE); + +extern RTLFUNC(V_EMPTY); +extern RTLFUNC(V_NULL); +extern RTLFUNC(V_INTEGER); +extern RTLFUNC(V_LONG); +extern RTLFUNC(V_SINGLE); +extern RTLFUNC(V_DOUBLE); +extern RTLFUNC(V_CURRENCY); +extern RTLFUNC(V_DATE); +extern RTLFUNC(V_STRING); + +extern RTLFUNC(MB_OK); +extern RTLFUNC(MB_OKCANCEL); +extern RTLFUNC(MB_ABORTRETRYIGNORE); +extern RTLFUNC(MB_YESNOCANCEL); +extern RTLFUNC(MB_YESNO); +extern RTLFUNC(MB_RETRYCANCEL); +extern RTLFUNC(MB_ICONSTOP); +extern RTLFUNC(MB_ICONQUESTION); +extern RTLFUNC(MB_ICONEXCLAMATION); +extern RTLFUNC(MB_ICONINFORMATION); +extern RTLFUNC(MB_DEFBUTTON1); +extern RTLFUNC(MB_DEFBUTTON2); +extern RTLFUNC(MB_DEFBUTTON3); +extern RTLFUNC(MB_APPLMODAL); +extern RTLFUNC(MB_SYSTEMMODAL); + +extern RTLFUNC(IDOK); +extern RTLFUNC(IDCANCEL); +extern RTLFUNC(IDABORT); +extern RTLFUNC(IDRETRY); +extern RTLFUNC(IDYES); +extern RTLFUNC(IDNO); + +extern RTLFUNC(CF_TEXT); +extern RTLFUNC(CF_BITMAP); +extern RTLFUNC(CF_METAFILEPICT); + +extern RTLFUNC(PI); + +extern RTLFUNC(SET_OFF); +extern RTLFUNC(SET_ON); +extern RTLFUNC(TOGGLE); + +extern RTLFUNC(TYP_AUTHORFLD); +extern RTLFUNC(TYP_CHAPTERFLD); +extern RTLFUNC(TYP_CONDTXTFLD); +extern RTLFUNC(TYP_DATEFLD); +extern RTLFUNC(TYP_DBFLD); +extern RTLFUNC(TYP_DBNAMEFLD); +extern RTLFUNC(TYP_DBNEXTSETFLD); +extern RTLFUNC(TYP_DBNUMSETFLD); +extern RTLFUNC(TYP_DBSETNUMBERFLD); +extern RTLFUNC(TYP_DDEFLD); +extern RTLFUNC(TYP_DOCINFOFLD); +extern RTLFUNC(TYP_DOCSTATFLD); +extern RTLFUNC(TYP_EXTUSERFLD); +extern RTLFUNC(TYP_FILENAMEFLD); +extern RTLFUNC(TYP_FIXDATEFLD); +extern RTLFUNC(TYP_FIXTIMEFLD); +extern RTLFUNC(TYP_FORMELFLD); +extern RTLFUNC(TYP_GETFLD); +extern RTLFUNC(TYP_GETREFFLD); +extern RTLFUNC(TYP_HIDDENPARAFLD); +extern RTLFUNC(TYP_HIDDENTXTFLD); +extern RTLFUNC(TYP_INPUTFLD); +extern RTLFUNC(TYP_MACROFLD); +extern RTLFUNC(TYP_NEXTPAGEFLD); +extern RTLFUNC(TYP_PAGENUMBERFLD); +extern RTLFUNC(TYP_POSTITFLD); +extern RTLFUNC(TYP_PREVPAGEFLD); +extern RTLFUNC(TYP_SEQFLD); +extern RTLFUNC(TYP_SETFLD); +extern RTLFUNC(TYP_SETINPFLD); +extern RTLFUNC(TYP_SETREFFLD); +extern RTLFUNC(TYP_TEMPLNAMEFLD); +extern RTLFUNC(TYP_TIMEFLD); +extern RTLFUNC(TYP_USERFLD); +extern RTLFUNC(TYP_USRINPFLD); +extern RTLFUNC(TYP_SETREFPAGEFLD); +extern RTLFUNC(TYP_GETREFPAGEFLD); +extern RTLFUNC(TYP_INTERNETFLD); +extern RTLFUNC(TYP_JUMPEDITFLD); + +extern RTLFUNC(FRAMEANCHORPAGE); +extern RTLFUNC(FRAMEANCHORPARA); +extern RTLFUNC(FRAMEANCHORCHAR); + +extern RTLFUNC(CLEAR_ALLTABS); +extern RTLFUNC(CLEAR_TAB); +extern RTLFUNC(SET_TAB); + +extern RTLFUNC(LINEPROP); +extern RTLFUNC(LINE_1); +extern RTLFUNC(LINE_15); +extern RTLFUNC(LINE_2); + +// Methoden + +extern RTLFUNC(CreateObject); +extern RTLFUNC(Error); +extern RTLFUNC(Sin); +extern RTLFUNC(Abs); +extern RTLFUNC(Asc); +extern RTLFUNC(Atn); +extern RTLFUNC(Chr); +extern RTLFUNC(Cos); +extern RTLFUNC(CurDir); +extern RTLFUNC(ChDir); // JSM +extern RTLFUNC(ChDrive); // JSM +extern RTLFUNC(FileCopy); // JSM +extern RTLFUNC(Kill); // JSM +extern RTLFUNC(MkDir); // JSM +extern RTLFUNC(RmDir); // JSM +extern RTLFUNC(SendKeys); // JSM +extern RTLFUNC(DimArray); +extern RTLFUNC(Dir); +extern RTLFUNC(Exp); +extern RTLFUNC(FileLen); +extern RTLFUNC(Fix); +extern RTLFUNC(Hex); +extern RTLFUNC(InStr); +extern RTLFUNC(Int); +extern RTLFUNC(LCase); +extern RTLFUNC(Left); +extern RTLFUNC(Log); +extern RTLFUNC(LTrim); +extern RTLFUNC(Mid); +extern RTLFUNC(Oct); +extern RTLFUNC(Right); +extern RTLFUNC(RTrim); +extern RTLFUNC(Sgn); +extern RTLFUNC(Space); +extern RTLFUNC(Sqr); +extern RTLFUNC(Str); +extern RTLFUNC(StrComp); +extern RTLFUNC(String); +extern RTLFUNC(Tan); +extern RTLFUNC(UCase); +extern RTLFUNC(Val); +extern RTLFUNC(Len); +extern RTLFUNC(Spc); +extern RTLFUNC(DateSerial); +extern RTLFUNC(TimeSerial); +extern RTLFUNC(DateValue); +extern RTLFUNC(TimeValue); +extern RTLFUNC(Day); +extern RTLFUNC(Hour); +extern RTLFUNC(Minute); +extern RTLFUNC(Month); +extern RTLFUNC(Now); +extern RTLFUNC(Second); +extern RTLFUNC(Time); +extern RTLFUNC(Timer); +extern RTLFUNC(Weekday); +extern RTLFUNC(Year); +extern RTLFUNC(Date); +extern RTLFUNC(InputBox); +extern RTLFUNC(MsgBox); +extern RTLFUNC(IsArray); +extern RTLFUNC(IsDate); +extern RTLFUNC(IsEmpty); +extern RTLFUNC(IsError); +extern RTLFUNC(IsNull); +extern RTLFUNC(IsNumeric); +extern RTLFUNC(IsObject); +extern RTLFUNC(IsUnoStruct); + +extern RTLFUNC(FileDateTime); +extern RTLFUNC(Format); +extern RTLFUNC(GetAttr); +extern RTLFUNC(Randomize); // JSM +extern RTLFUNC(Rnd); +extern RTLFUNC(Shell); +extern RTLFUNC(VarType); +extern RTLFUNC(TypeName); +extern RTLFUNC(TypeLen); + +extern RTLFUNC(EOF); +extern RTLFUNC(FileAttr); +extern RTLFUNC(Loc); +extern RTLFUNC(Lof); +extern RTLFUNC(Seek); +extern RTLFUNC(SetAttr); // JSM +extern RTLFUNC(Reset); // JSM + +extern RTLFUNC(DDEInitiate); +extern RTLFUNC(DDETerminate); +extern RTLFUNC(DDETerminateAll); +extern RTLFUNC(DDERequest); +extern RTLFUNC(DDEExecute); +extern RTLFUNC(DDEPoke); + +extern RTLFUNC(FreeFile); +extern RTLFUNC(IsMissing); +extern RTLFUNC(LBound); +extern RTLFUNC(UBound); +extern RTLFUNC(RGB); +extern RTLFUNC(QBColor); +extern RTLFUNC(StrConv); + +extern RTLFUNC(Beep); + +extern RTLFUNC(Load); +extern RTLFUNC(Unload); +extern RTLFUNC(AboutStarBasic); +extern RTLFUNC(LoadPicture); +extern RTLFUNC(SavePicture); + +extern RTLFUNC(CBool); // JSM +extern RTLFUNC(CByte); // JSM +extern RTLFUNC(CCur); // JSM +extern RTLFUNC(CDate); // JSM +extern RTLFUNC(CDbl); // JSM +extern RTLFUNC(CInt); // JSM +extern RTLFUNC(CLng); // JSM +extern RTLFUNC(CSng); // JSM +extern RTLFUNC(CStr); // JSM +extern RTLFUNC(CVar); // JSM +extern RTLFUNC(CVErr); // JSM + +extern RTLFUNC(Iif); // JSM + +extern RTLFUNC(DumpAllObjects); + +extern RTLFUNC(GetSystemType); +extern RTLFUNC(GetGUIType); +extern RTLFUNC(Red); +extern RTLFUNC(Green); +extern RTLFUNC(Blue); + +extern RTLFUNC(Switch); +extern RTLFUNC(Wait); +extern RTLFUNC(GetGUIVersion); +extern RTLFUNC(Choose); +extern RTLFUNC(Trim); + +extern RTLFUNC(DateAdd); +extern RTLFUNC(DateDiff); +extern RTLFUNC(DatePart); +extern RTLFUNC(GetSolarVersion); +extern RTLFUNC(TwipsPerPixelX); +extern RTLFUNC(TwipsPerPixelY); +extern RTLFUNC(FreeLibrary); +extern RTLFUNC(Array); +extern RTLFUNC(FindObject); +extern RTLFUNC(FindPropertyObject); +extern RTLFUNC(EnableReschedule); + +extern RTLFUNC(Put); +extern RTLFUNC(Get); +extern RTLFUNC(Environ); +extern RTLFUNC(GetDialogZoomFactorX); +extern RTLFUNC(GetDialogZoomFactorY); +extern RTLFUNC(GetSystemTicks); +extern RTLFUNC(GetPathSeparator); +extern RTLFUNC(ResolvePath); +extern RTLFUNC(CreateUnoStruct); +extern RTLFUNC(CreateUnoService); +extern RTLFUNC(GetProcessServiceManager); +extern RTLFUNC(CreatePropertySet); +extern RTLFUNC(CreateUnoListener); +extern RTLFUNC(HasUnoInterfaces); +extern RTLFUNC(EqualUnoObjects); + +extern RTLFUNC(FileExists); + + diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx new file mode 100644 index 000000000000..587c59ffeb9e --- /dev/null +++ b/basic/source/runtime/runtime.cxx @@ -0,0 +1,934 @@ +/************************************************************************* + * + * $RCSfile: runtime.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _FSYS_HXX //autogen +#include <tools/fsys.hxx> +#endif +#ifndef _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#ifndef _INTN_HXX //autogen +#include <tools/intn.hxx> +#endif + +#ifndef _ZFORLIST_HXX //autogen +#include <svtools/zforlist.hxx> +#endif +#include <svtools/sbx.hxx> +#include "runtime.hxx" +#pragma hdrstop +#include "sbintern.hxx" +#include "opcodes.hxx" +#include "iosys.hxx" +#include "image.hxx" +#include "ddectrl.hxx" +#include "dllmgr.hxx" + +// Makro MEMBER() +#include <macfix.hxx> + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + +struct SbiGosubStack { // GOSUB-Stack: + SbiGosubStack* pNext; // Chain + const BYTE* pCode; // Return-Pointer +}; + +struct SbiArgvStack { // Argv stack: + SbiArgvStack* pNext; // Stack Chain + SbxArrayRef refArgv; // Argv + short nArgc; // Argc +}; + +SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // Alle Opcodes ohne Operanden + MEMBER(SbiRuntime::StepNOP), + MEMBER(SbiRuntime::StepEXP), + MEMBER(SbiRuntime::StepMUL), + MEMBER(SbiRuntime::StepDIV), + MEMBER(SbiRuntime::StepMOD), + MEMBER(SbiRuntime::StepPLUS), + MEMBER(SbiRuntime::StepMINUS), + MEMBER(SbiRuntime::StepNEG), + MEMBER(SbiRuntime::StepEQ), + MEMBER(SbiRuntime::StepNE), + MEMBER(SbiRuntime::StepLT), + MEMBER(SbiRuntime::StepGT), + MEMBER(SbiRuntime::StepLE), + MEMBER(SbiRuntime::StepGE), + MEMBER(SbiRuntime::StepIDIV), + MEMBER(SbiRuntime::StepAND), + MEMBER(SbiRuntime::StepOR), + MEMBER(SbiRuntime::StepXOR), + MEMBER(SbiRuntime::StepEQV), + MEMBER(SbiRuntime::StepIMP), + MEMBER(SbiRuntime::StepNOT), + MEMBER(SbiRuntime::StepCAT), + + MEMBER(SbiRuntime::StepLIKE), + MEMBER(SbiRuntime::StepIS), + // Laden/speichern + MEMBER(SbiRuntime::StepARGC), // neuen Argv einrichten + MEMBER(SbiRuntime::StepARGV), // TOS ==> aktueller Argv + MEMBER(SbiRuntime::StepINPUT), // Input ==> TOS + MEMBER(SbiRuntime::StepLINPUT), // Line Input ==> TOS + MEMBER(SbiRuntime::StepGET), // TOS anfassen + MEMBER(SbiRuntime::StepSET), // Speichern Objekt TOS ==> TOS-1 + MEMBER(SbiRuntime::StepPUT), // TOS ==> TOS-1 + MEMBER(SbiRuntime::StepPUTC), // TOS ==> TOS-1, dann ReadOnly + MEMBER(SbiRuntime::StepDIM), // DIM + MEMBER(SbiRuntime::StepREDIM), // REDIM + MEMBER(SbiRuntime::StepREDIMP), // REDIM PRESERVE + MEMBER(SbiRuntime::StepERASE), // TOS loeschen + // Verzweigen + MEMBER(SbiRuntime::StepSTOP), // Programmende + MEMBER(SbiRuntime::StepINITFOR), // FOR-Variable initialisieren + MEMBER(SbiRuntime::StepNEXT), // FOR-Variable inkrementieren + MEMBER(SbiRuntime::StepCASE), // Anfang CASE + MEMBER(SbiRuntime::StepENDCASE), // Ende CASE + MEMBER(SbiRuntime::StepSTDERROR), // Standard-Fehlerbehandlung + MEMBER(SbiRuntime::StepNOERROR), // keine Fehlerbehandlung + MEMBER(SbiRuntime::StepLEAVE), // UP verlassen + // E/A + MEMBER(SbiRuntime::StepCHANNEL), // TOS = Kanalnummer + MEMBER(SbiRuntime::StepPRINT), // print TOS + MEMBER(SbiRuntime::StepPRINTF), // print TOS in field + MEMBER(SbiRuntime::StepWRITE), // write TOS + MEMBER(SbiRuntime::StepRENAME), // Rename Tos+1 to Tos + MEMBER(SbiRuntime::StepPROMPT), // Input Prompt aus TOS definieren + MEMBER(SbiRuntime::StepRESTART), // Set restart point + MEMBER(SbiRuntime::StepCHANNEL0), // E/A-Kanal 0 einstellen + MEMBER(SbiRuntime::StepEMPTY), // Leeren Ausdruck auf Stack + MEMBER(SbiRuntime::StepERROR), // TOS = Fehlercode + MEMBER(SbiRuntime::StepLSET), // Speichern Objekt TOS ==> TOS-1 + MEMBER(SbiRuntime::StepRSET) // Speichern Objekt TOS ==> TOS-1 +}; + +SbiRuntime::pStep1 SbiRuntime::aStep1[] = { // Alle Opcodes mit einem Operanden + MEMBER(SbiRuntime::StepLOADNC), // Laden einer numerischen Konstanten (+ID) + MEMBER(SbiRuntime::StepLOADSC), // Laden einer Stringkonstanten (+ID) + MEMBER(SbiRuntime::StepLOADI), // Immediate Load (+Wert) + MEMBER(SbiRuntime::StepARGN), // Speichern eines named Args in Argv (+StringID) + MEMBER(SbiRuntime::StepPAD), // String auf feste Laenge bringen (+Laenge) + // Verzweigungen + MEMBER(SbiRuntime::StepJUMP), // Sprung (+Target) + MEMBER(SbiRuntime::StepJUMPT), // TOS auswerten), bedingter Sprung (+Target) + MEMBER(SbiRuntime::StepJUMPF), // TOS auswerten), bedingter Sprung (+Target) + MEMBER(SbiRuntime::StepONJUMP), // TOS auswerten), Sprung in JUMP-Tabelle (+MaxVal) + MEMBER(SbiRuntime::StepGOSUB), // UP-Aufruf (+Target) + MEMBER(SbiRuntime::StepRETURN), // UP-Return (+0 oder Target) + MEMBER(SbiRuntime::StepTESTFOR), // FOR-Variable testen), inkrementieren (+Endlabel) + MEMBER(SbiRuntime::StepCASETO), // Tos+1 <= Case <= Tos), 2xremove (+Target) + MEMBER(SbiRuntime::StepERRHDL), // Fehler-Handler (+Offset) + MEMBER(SbiRuntime::StepRESUME), // Resume nach Fehlern (+0 or 1 or Label) + // E/A + MEMBER(SbiRuntime::StepCLOSE), // (+Kanal/0) + MEMBER(SbiRuntime::StepPRCHAR), // (+char) + // Verwaltung + MEMBER(SbiRuntime::StepCLASS), // Klassennamen testen (+StringId) + MEMBER(SbiRuntime::StepLIB), // Lib fuer Declare-Call (+StringId) + MEMBER(SbiRuntime::StepBASED), // TOS wird um BASE erhoeht, BASE davor gepusht + MEMBER(SbiRuntime::StepARGTYP), // Letzten Parameter in Argv konvertieren (+Typ) +}; + +SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// Alle Opcodes mit zwei Operanden + MEMBER(SbiRuntime::StepRTL), // Laden aus RTL (+StringID+Typ) + MEMBER(SbiRuntime::StepFIND), // Laden (+StringID+Typ) + MEMBER(SbiRuntime::StepELEM), // Laden Element (+StringID+Typ) + MEMBER(SbiRuntime::StepPARAM), // Parameter (+Offset+Typ) + // Verzweigen + MEMBER(SbiRuntime::StepCALL), // Declare-Call (+StringID+Typ) + MEMBER(SbiRuntime::StepCALLC), // CDecl-Declare-Call (+StringID+Typ) + MEMBER(SbiRuntime::StepCASEIS), // Case-Test (+Test-Opcode+False-Target) + // Verwaltung + MEMBER(SbiRuntime::StepSTMNT), // Beginn eines Statements (+Line+Col) + // E/A + MEMBER(SbiRuntime::StepOPEN), // (+SvStreamFlags+Flags) + // Objekte + MEMBER(SbiRuntime::StepLOCAL), // Lokale Variable definieren (+StringId+Typ) + MEMBER(SbiRuntime::StepPUBLIC), // Modulglobale Variable (+StringID+Typ) + MEMBER(SbiRuntime::StepGLOBAL), // Globale Variable definieren (+StringID+Typ) + MEMBER(SbiRuntime::StepCREATE), // Objekt kreieren (+StringId+StringId) + MEMBER(SbiRuntime::StepSTATIC), // Statische Variable (+StringId+StringId) + MEMBER(SbiRuntime::StepTCREATE), // User Defined Objekte (+StringId+StringId) + MEMBER(SbiRuntime::StepDCREATE), // Objekt-Array kreieren (+StringID+StringID) +}; + +////////////////////////////////////////////////////////////////////////// +// SbiRTLData // +////////////////////////////////////////////////////////////////////////// + +SbiRTLData::SbiRTLData() +{ + pDir = 0; + nDirFlags = 0; + nCurDirPos = 0; +} + +SbiRTLData::~SbiRTLData() +{ + delete pDir; + pDir = 0; +} + +////////////////////////////////////////////////////////////////////////// +// SbiInstance // +////////////////////////////////////////////////////////////////////////// + +// 16.10.96: #31460 Neues Konzept fuer StepInto/Over/Out +// Die Entscheidung, ob StepPoint aufgerufen werden soll, wird anhand des +// CallLevels getroffen. Angehalten wird, wenn der aktuelle CallLevel <= +// nBreakCallLvl ist. Der aktuelle CallLevel kann niemals kleiner als 1 +// sein, da er beim Aufruf einer Methode (auch main) inkrementiert wird. +// Daher bedeutet ein BreakCallLvl von 0, dass das Programm gar nicht +// angehalten wird. +// (siehe auch step2.cxx, SbiRuntime::StepSTMNT() ) + +// Hilfsfunktion, um den BreakCallLevel gemaess der der Debug-Flags zu ermitteln +void SbiInstance::CalcBreakCallLevel( USHORT nFlags ) +{ + // Break-Flag wegfiltern + nFlags &= ~((USHORT)SbDEBUG_BREAK); + + USHORT nRet; + switch( nFlags ) + { + case SbDEBUG_STEPINTO: + nRet = nCallLvl + 1; // CallLevel+1 wird auch angehalten + break; + case SbDEBUG_STEPOVER | SbDEBUG_STEPINTO: + nRet = nCallLvl; // Aktueller CallLevel wird angehalten + break; + case SbDEBUG_STEPOUT: + nRet = nCallLvl - 1; // Kleinerer CallLevel wird angehalten + break; + case SbDEBUG_CONTINUE: + // Basic-IDE liefert 0 statt SbDEBUG_CONTINUE, also auch default=continue + default: + nRet = 0; // CallLevel ist immer >0 -> kein StepPoint + } + nBreakCallLvl = nRet; // Ergebnis uebernehmen +} + +SbiInstance::SbiInstance( StarBASIC* p ) +{ + pBasic = p; + pNext = NULL; + pRun = NULL; + pIosys = new SbiIoSystem; + pDdeCtrl = new SbiDdeControl; + pDllMgr = 0; // on demand + pNumberFormatter = 0; // on demand + nCallLvl = 0; + nBreakCallLvl = 0; + nErr = + nErl = 0; + bReschedule = TRUE; +} + +SbiInstance::~SbiInstance() +{ + while( pRun ) + { + SbiRuntime* p = pRun->pNext; + delete pRun; + pRun = p; + } + delete pIosys; + delete pDdeCtrl; + delete pDllMgr; + delete pNumberFormatter; +} + +SbiDllMgr* SbiInstance::GetDllMgr() +{ + if( !pDllMgr ) + pDllMgr = new SbiDllMgr; + return pDllMgr; +} + +// #39629 NumberFormatter jetzt ueber statische Methode anlegen +SvNumberFormatter* SbiInstance::GetNumberFormatter() +{ + if( !pNumberFormatter ) + PrepareNumberFormatter( pNumberFormatter, nStdDateIdx, nStdTimeIdx, nStdDateTimeIdx ); + return pNumberFormatter; +} + +// #39629 NumberFormatter auch statisch anbieten +void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter, + ULONG &rnStdDateIdx, ULONG &rnStdTimeIdx, ULONG &rnStdDateTimeIdx ) +{ + const International& rInter = GetpApp()->GetAppInternational(); + LanguageType eLangType = rInter.GetLanguage(); + rpNumberFormatter = new SvNumberFormatter( eLangType ); + xub_StrLen nCheckPos = 0; short nType; + rnStdTimeIdx = rpNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eLangType ); + + // Standard-Vorlagen des Formatters haben nur zweistellige + // Jahreszahl. Deshalb eigenes Format registrieren + + // HACK, da der Numberformatter in PutandConvertEntry die Platzhalter + // fuer Monat, Tag, Jahr nicht entsprechend der Systemeinstellung + // austauscht. Problem: Print Year(Date) unter engl. BS + // siehe auch svtools\source\sbx\sbxdate.cxx + + DateFormat eDate = rInter.GetDateFormat(); + String aDateStr; + switch( eDate ) + { + case MDY: aDateStr = String( RTL_CONSTASCII_USTRINGPARAM("MM.TT.JJJJ") ); break; + case DMY: aDateStr = String( RTL_CONSTASCII_USTRINGPARAM("TT.MM.JJJJ") ); break; + case YMD: aDateStr = String( RTL_CONSTASCII_USTRINGPARAM("JJJJ.MM.TT") ); break; + default: aDateStr = String( RTL_CONSTASCII_USTRINGPARAM("MM.TT.JJJJ") ); + } + String aStr( aDateStr ); + rpNumberFormatter->PutandConvertEntry( aStr, nCheckPos, nType, + rnStdDateIdx, LANGUAGE_GERMAN, eLangType ); + nCheckPos = 0; + String aStrHHMMSS( RTL_CONSTASCII_USTRINGPARAM(" HH:MM:SS") ); + aStr = aDateStr; + aStr += aStrHHMMSS; + rpNumberFormatter->PutandConvertEntry( aStr, nCheckPos, nType, + rnStdDateTimeIdx, LANGUAGE_GERMAN, eLangType ); +} + + + +// Engine laufenlassen. Falls Flags == SbDEBUG_CONTINUE, Flags uebernehmen + +void SbiInstance::Stop() +{ + for( SbiRuntime* p = pRun; p; p = p->pNext ) + p->Stop(); +} + +void SbiInstance::Error( SbError n ) +{ + Error( n, String() ); +} + +void SbiInstance::Error( SbError n, const String& rMsg ) +{ + aErrorMsg = rMsg; + pRun->Error( n ); +} + +void SbiInstance::FatalError( SbError n ) +{ + pRun->FatalError( n ); +} + +void SbiInstance::Abort() +{ + // Basic suchen, in dem der Fehler auftrat + StarBASIC* pErrBasic = GetCurrentBasic( pBasic ); + pErrBasic->RTError( nErr, aErrorMsg, pRun->nLine, pRun->nCol1, pRun->nCol2 ); + pBasic->Stop(); +} + +// Hilfsfunktion, um aktives Basic zu finden, kann ungleich pRTBasic sein +StarBASIC* GetCurrentBasic( StarBASIC* pRTBasic ) +{ + StarBASIC* pCurBasic = pRTBasic; + SbModule* pActiveModule = pRTBasic->GetActiveModule(); + if( pActiveModule ) + { + SbxObject* pParent = pActiveModule->GetParent(); + if( pParent && pParent->ISA(StarBASIC) ) + pCurBasic = (StarBASIC*)pParent; + } + return pCurBasic; +} + +SbModule* SbiInstance::GetActiveModule() +{ + if( pRun ) + return pRun->GetModule(); + else + return NULL; +} + +SbMethod* SbiInstance::GetCaller( USHORT nLevel ) +{ + SbiRuntime* p = pRun; + while( nLevel-- && p ) + p = p->pNext; + if( p ) + return p->GetCaller(); + else + return NULL; +} + +SbxArray* SbiInstance::GetLocals( SbMethod* pMeth ) +{ + SbiRuntime* p = pRun; + while( p && p->GetMethod() != pMeth ) + p = p->pNext; + if( p ) + return p->GetLocals(); + else + return NULL; +} + +////////////////////////////////////////////////////////////////////////// +// SbiInstance // +////////////////////////////////////////////////////////////////////////// + +// Achtung: pMeth kann auch NULL sein (beim Aufruf des Init-Codes) + +SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, USHORT nStart ) + : pMeth( pe ), pMod( pm ), pImg( pMod->pImage ), + rBasic( *(StarBASIC*)pm->pParent ), pInst( pINST ) +{ + nFlags = pe ? pe->GetDebugFlags() : 0; + pIosys = pInst->pIosys; + pArgvStk = NULL; + pGosubStk = NULL; + pForStk = NULL; + pError = NULL; + pErrCode = + pErrStmnt = + pRestart = NULL; + pNext = NULL; + pCode = + pStmnt = (const BYTE* ) pImg->GetCode() + nStart; + bRun = + bError = TRUE; + bInError = FALSE; + nLine = + nCol1 = + nCol2 = + nExprLvl = + nArgc = + nError = + nGosubLvl = + nOps = 0; + refExprStk = new SbxArray; +#if defined GCC + SetParameters( pe ? pe->GetParameters() : (class SbxArray *)NULL ); +#else + SetParameters( pe ? pe->GetParameters() : NULL ); +#endif + pRefSaveList = NULL; + pItemStoreList = NULL; +} + +SbiRuntime::~SbiRuntime() +{ + ClearGosubStack(); + ClearArgvStack(); + ClearForStack(); + + // #74254 Items zum Sichern temporaere Referenzen freigeben + ClearRefs(); + while( pItemStoreList ) + { + RefSaveItem* pToDeleteItem = pItemStoreList; + pItemStoreList = pToDeleteItem->pNext; + delete pToDeleteItem; + } +} + +// Aufbau der Parameterliste. Alle ByRef-Parameter werden direkt +// uebernommen; von ByVal-Parametern werden Kopien angelegt. Falls +// ein bestimmter Datentyp verlangt wird, wird konvertiert. + +void SbiRuntime::SetParameters( SbxArray* pParams ) +{ + refParams = new SbxArray; + // fuer den Returnwert + refParams->Put( pMeth, 0 ); + if( pParams ) + { + SbxInfo* pInfo = pMeth->GetInfo(); + for( USHORT i = 1; i < pParams->Count(); i++ ) + { + const SbxParamInfo* p = pInfo ? pInfo->GetParam( i ) : NULL; + SbxVariable* v = pParams->Get( i ); + // Methoden sind immer byval! + BOOL bByVal = v->IsA( TYPE(SbxMethod) ); + SbxDataType t = v->GetType(); + if( p ) + { + bByVal |= BOOL( ( p->eType & SbxBYREF ) == 0 ); + t = (SbxDataType) ( p->eType & 0x0FFF ); + } + if( bByVal ) + { + SbxVariable* v2 = new SbxVariable( t ); + v2->SetFlag( SBX_READWRITE ); + *v2 = *v; + refParams->Put( v2, i ); + } + else + { + if( t != SbxVARIANT && t != ( v->GetType() & 0x0FFF ) ) + { + // Array konvertieren?? + if( p && (p->eType & SbxARRAY) ) + Error( SbERR_CONVERSION ); + else + v->Convert( t ); + } + refParams->Put( v, i ); + } + if( p ) + refParams->PutAlias( p->aName, i ); + } + } +} + +// Einen P-Code ausfuehren + +BOOL SbiRuntime::Step() +{ + if( bRun ) + { + // Unbedingt gelegentlich die Kontrolle abgeben! + if( pInst->IsReschedule() && !( ++nOps & 0x1F ) ) + Application::Reschedule(); + + SbiOpcode eOp = (SbiOpcode ) ( *pCode++ ); + USHORT nOp1, nOp2; + if( eOp <= SbOP0_END ) + { + (this->*( aStep0[ eOp ] ) )(); + } + else if( eOp >= SbOP1_START && eOp <= SbOP1_END ) + { + nOp1 = *pCode++; nOp1 |= *pCode++ << 8; + (this->*( aStep1[ eOp - SbOP1_START ] ) )( nOp1 ); + } + else if( eOp >= SbOP2_START && eOp <= SbOP2_END ) + { + nOp1 = *pCode++; nOp1 |= *pCode++ << 8; + nOp2 = *pCode++; nOp2 |= *pCode++ << 8; + (this->*( aStep2[ eOp - SbOP2_START ] ) )( nOp1, nOp2 ); + } + else + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + + // SBX-Fehler aufgetreten? + SbError nSbError = SbxBase::GetError(); + Error( ERRCODE_TOERROR(nSbError) ); // Warnings rausfiltern + + // AB 13.2.1997, neues Error-Handling: + // ACHTUNG: Hier kann nError auch dann gesetzt sein, wenn !nSbError, + // da nError jetzt auch von anderen RT-Instanzen gesetzt werden kann + + if( nError ) + SbxBase::ResetError(); + + // AB,15.3.96: Fehler nur anzeigen, wenn BASIC noch aktiv + // (insbesondere nicht nach Compiler-Fehlern zur Laufzeit) + if( nError && bRun ) + { + SbError err = nError; + ClearExprStack(); + nError = 0; + // Im Error Handler? Dann Std-Error + if( bInError ) + { + StepSTDERROR(); + pInst->Abort(); + } + else + { + bInError = TRUE; + + pInst->nErr = err; + pInst->nErl = nLine; + pErrCode = pCode; + pErrStmnt = pStmnt; + if( !bError ) // On Error Resume Next + StepRESUME( 1 ); + else if( pError ) // On Error Goto ... + pCode = pError; + else // Standard-Fehlerbehandlung + { + // AB 13.2.1997, neues Error-Handling: + // Uebergeordnete Error-Handler beruecksichtigen + + // Wir haben keinen Error-Handler -> weiter oben suchen + SbiRuntime* pRtErrHdl = NULL; + SbiRuntime* pRt = this; + while( NULL != (pRt = pRt->pNext) ) + { + // Gibt es einen Error-Handler? + if( pRt->bError == FALSE || pRt->pError != NULL ) + { + pRtErrHdl = pRt; + break; + } + } + + // Error-Hdl gefunden? + if( pRtErrHdl ) + { + // (Neuen) Error-Stack anlegen + SbErrorStack*& rErrStack = GetSbData()->pErrStack; + if( rErrStack ) + delete rErrStack; + rErrStack = new SbErrorStack(); + + // Alle im Call-Stack darunter stehenden RTs manipulieren + pRt = this; + do + { + // Fehler setzen + pRt->nError = err; + if( pRt != pRtErrHdl ) + pRt->bRun = FALSE; + + // In Error-Stack eintragen + SbErrorStackEntry *pEntry = new SbErrorStackEntry + ( pRt->pMeth, pRt->nLine, pRt->nCol1, pRt->nCol2 ); + rErrStack->C40_INSERT(SbErrorStackEntry, pEntry, rErrStack->Count() ); + + // Nach RT mit Error-Handler aufhoeren + if( pRt == pRtErrHdl ) + break; + } + while( pRt = pRt->pNext ); + } + // Kein Error-Hdl gefunden -> altes Vorgehen + else + { + pInst->Abort(); + } + + // ALT: Nur + // pInst->Abort(); + } + } + } + } + return bRun; +} + +void SbiRuntime::Error( SbError n ) +{ + if( n ) + nError = n; +} + +void SbiRuntime::FatalError( SbError n ) +{ + StepSTDERROR(); + Error( n ); +} + +////////////////////////////////////////////////////////////////////////// +// +// Parameter, Locals, Caller +// +////////////////////////////////////////////////////////////////////////// + +SbMethod* SbiRuntime::GetCaller() +{ + return pMeth; +} + +SbxArray* SbiRuntime::GetLocals() +{ + return refLocals; +} + +SbxArray* SbiRuntime::GetParams() +{ + return refParams; +} + +////////////////////////////////////////////////////////////////////////// +// +// Stacks +// +////////////////////////////////////////////////////////////////////////// + +// Der Expression-Stack steht fuer die laufende Auswertung von Expressions +// zur Verfuegung. + +void SbiRuntime::PushVar( SbxVariable* pVar ) +{ + if( pVar ) + refExprStk->Put( pVar, nExprLvl++ ); +} + +SbxVariableRef SbiRuntime::PopVar() +{ +#ifndef PRODUCT + if( !nExprLvl ) + { + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + return new SbxVariable; + } +#endif + SbxVariableRef xVar = refExprStk->Get( --nExprLvl ); +#ifdef DBG_UTIL + if ( xVar->GetName().EqualsAscii( "Cells" ) ) + DBG_TRACE( "" ); +#endif + // Methods halten im 0.Parameter sich selbst, also weghauen + if( xVar->IsA( TYPE(SbxMethod) ) ) + xVar->SetParameters(0); + return xVar; +} + +BOOL SbiRuntime::ClearExprStack() +{ + // #74732 Hier kann ein Fehler gesetzt werden + BOOL bErrorSet = FALSE; + + // Achtung: Clear() reicht nicht, da Methods geloescht werden muessen + while ( nExprLvl ) + { + SbxVariableRef xVar = PopVar(); + if( !nError && xVar->ISA( UnoClassMemberVariable ) ) + { + Error( SbERR_NO_METHOD ); + bErrorSet = TRUE; + } + } + refExprStk->Clear(); + return bErrorSet; +} + +// Variable auf dem Expression-Stack holen, ohne sie zu entfernen +// n zaehlt ab 0. + +SbxVariable* SbiRuntime::GetTOS( short n ) +{ + n = nExprLvl - n - 1; +#ifndef PRODUCT + if( n < 0 ) + { + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + return new SbxVariable; + } +#endif + return refExprStk->Get( (USHORT) n ); +} + +// Sicherstellen, dass TOS eine temporaere Variable ist + +void SbiRuntime::TOSMakeTemp() +{ + SbxVariable* p = refExprStk->Get( nExprLvl - 1 ); + if( p->GetRefCount() != 1 ) + { + // #74573 UnoClassSbxVariable spezialbehandeln + SbxVariable* pNew; + if( p->ISA( UnoClassSbxVariable ) ) + pNew = new UnoClassSbxVariable( *(UnoClassSbxVariable*)p ); + else + pNew = new SbxVariable( *p ); + pNew->SetFlag( SBX_READWRITE ); + refExprStk->Put( pNew, nExprLvl - 1 ); + } +} + +// Der GOSUB-Stack nimmt Returnadressen fuer GOSUBs auf + +void SbiRuntime::PushGosub( const BYTE* pc ) +{ + if( ++nGosubLvl > MAXRECURSION ) + StarBASIC::FatalError( SbERR_STACK_OVERFLOW ); + SbiGosubStack* p = new SbiGosubStack; + p->pCode = pc; + p->pNext = pGosubStk; + pGosubStk = p; +} + +void SbiRuntime::PopGosub() +{ + if( !pGosubStk ) + Error( SbERR_NO_GOSUB ); + else + { + SbiGosubStack* p = pGosubStk; + pCode = p->pCode; + pGosubStk = p->pNext; + delete p; + nGosubLvl--; + } +} + +// Entleeren des GOSUB-Stacks + +void SbiRuntime::ClearGosubStack() +{ + SbiGosubStack* p; + while(( p = pGosubStk ) != NULL ) + pGosubStk = p->pNext, delete p; + nGosubLvl = 0; +} + +// Der Argv-Stack nimmt aktuelle Argument-Vektoren auf + +void SbiRuntime::PushArgv() +{ + SbiArgvStack* p = new SbiArgvStack; + p->refArgv = refArgv; + p->nArgc = nArgc; + nArgc = 1; + refArgv.Clear(); + p->pNext = pArgvStk; + pArgvStk = p; +} + +void SbiRuntime::PopArgv() +{ + if( pArgvStk ) + { + SbiArgvStack* p = pArgvStk; + pArgvStk = p->pNext; + refArgv = p->refArgv; + nArgc = p->nArgc; + delete p; + } +} + +// Entleeren des Argv-Stacks + +void SbiRuntime::ClearArgvStack() +{ + while( pArgvStk ) + PopArgv(); +} + +// Push des For-Stacks. Der Stack hat Inkrement, Ende, Beginn und Variable. +// Nach Aufbau des Stack-Elements ist der Stack leer. + +void SbiRuntime::PushFor() +{ + SbiForStack* p = new SbiForStack; + p->pNext = pForStk; + pForStk = p; + // Der Stack ist wie folgt aufgebaut: + p->refInc = PopVar(); + p->refEnd = PopVar(); + SbxVariableRef xBgn = PopVar(); + p->refVar = PopVar(); + *(p->refVar) = *xBgn; +} + +// Poppen des FOR-Stacks + +void SbiRuntime::PopFor() +{ + if( pForStk ) + { + SbiForStack* p = pForStk; + pForStk = p->pNext; + delete p; + } +} + +// Entleeren des FOR-Stacks + +void SbiRuntime::ClearForStack() +{ + while( pForStk ) + PopFor(); +} + +////////////////////////////////////////////////////////////////////////// +// +// DLL-Aufrufe +// +////////////////////////////////////////////////////////////////////////// + +void SbiRuntime::DllCall + ( const String& aFuncName, // Funktionsname + const String& aDLLName, // Name der DLL + SbxArray* pArgs, // Parameter (ab Index 1, kann NULL sein) + SbxDataType eResType, // Returnwert + BOOL bCDecl ) // TRUE: nach C-Konventionen +{ + // No DllCall for "virtual" portal users + if( needSecurityRestrictions() ) + { + StarBASIC::Error(SbERR_NOT_IMPLEMENTED); + return; + } + + // MUSS NOCH IMPLEMENTIERT WERDEN + /* + String aMsg; + aMsg = "FUNC="; + aMsg += pFunc; + aMsg += " DLL="; + aMsg += pDLL; + MessBox( NULL, WB_OK, String( "DLL-CALL" ), aMsg ).Execute(); + Error( SbERR_NOT_IMPLEMENTED ); + */ + + SbxVariable* pRes = new SbxVariable( eResType ); + SbiDllMgr* pDllMgr = pInst->GetDllMgr(); + ByteString aByteFuncName( aFuncName, gsl_getSystemTextEncoding() ); + ByteString aByteDLLName( aDLLName, gsl_getSystemTextEncoding() ); + SbError nErr = pDllMgr->Call( aByteFuncName.GetBuffer(), aByteDLLName.GetBuffer(), pArgs, *pRes, bCDecl ); + if( nErr ) + Error( nErr ); + PushVar( pRes ); +} + diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx new file mode 100644 index 000000000000..778d5d727440 --- /dev/null +++ b/basic/source/runtime/stdobj.cxx @@ -0,0 +1,729 @@ +/************************************************************************* + * + * $RCSfile: stdobj.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#include "runtime.hxx" +#pragma hdrstop +#include "stdobj.hxx" +#include "stdobj1.hxx" +#include "rtlproto.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + +// Das nArgs-Feld eines Tabelleneintrags ist wie folgt verschluesselt: +// Zur Zeit wird davon ausgegangen, dass Properties keine Parameter +// benoetigen! + +#define _ARGSMASK 0x00FF // Bis zu 255 Argumente +#define _RWMASK 0x0F00 // Maske fuer R/W-Bits +#define _TYPEMASK 0xF000 // Maske fuer den Typ des Eintrags + +#define _READ 0x0100 // kann gelesen werden +#define _BWRITE 0x0200 // kann as Lvalue verwendet werden +#define _LVALUE _BWRITE // kann as Lvalue verwendet werden +#define _READWRITE 0x0300 // beides +#define _OPT 0x0400 // Parameter ist optional +#define _CONST 0x0800 // Property ist const +#define _METHOD 0x3000 // Masken-Bits fuer eine Methode +#define _PROPERTY 0x4000 // Masken-Bit fuer eine Property +#define _OBJECT 0x8000 // Masken-Bit fuer ein Objekt + // Kombination von oberen Bits: +#define _FUNCTION 0x1100 // Maske fuer Function +#define _LFUNCTION 0x1300 // Maske fuer Function, die auch als Lvalue geht +#define _SUB 0x2100 // Maske fuer Sub +#define _ROPROP 0x4100 // Maske Read Only-Property +#define _WOPROP 0x4200 // Maske Write Only-Property +#define _RWPROP 0x4300 // Maske Read/Write-Property +#define _CPROP 0x4900 // Maske fuer Konstante + +struct Methods { + const char* pName; // Name des Eintrags + SbxDataType eType; // Datentyp + short nArgs; // Argumente und Flags + RtlCall pFunc; // Function Pointer + USHORT nHash; // Hashcode +}; + +static Methods aMethods[] = { + +{ "AboutStarBasic", SbxNULL, 1 | _FUNCTION, RTLNAME(AboutStarBasic) }, + { "Name", SbxSTRING }, +{ "Abs", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Abs) }, + { "number", SbxDOUBLE }, +{ "Array", SbxOBJECT, _FUNCTION, RTLNAME(Array) }, +{ "Asc", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Asc) }, + { "string", SbxSTRING }, +{ "Atn", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Atn) }, + { "number", SbxDOUBLE }, +{ "ATTR_ARCHIVE", SbxINTEGER, _CPROP, RTLNAME(ATTR_ARCHIVE) }, +{ "ATTR_DIRECTORY", SbxINTEGER, _CPROP, RTLNAME(ATTR_DIRECTORY) }, +{ "ATTR_HIDDEN", SbxINTEGER, _CPROP, RTLNAME(ATTR_HIDDEN) }, +{ "ATTR_NORMAL", SbxINTEGER, _CPROP, RTLNAME(ATTR_NORMAL) }, +{ "ATTR_READONLY", SbxINTEGER, _CPROP, RTLNAME(ATTR_READONLY) }, +{ "ATTR_SYSTEM", SbxINTEGER, _CPROP, RTLNAME(ATTR_SYSTEM) }, +{ "ATTR_VOLUME", SbxINTEGER, _CPROP, RTLNAME(ATTR_VOLUME) }, +{ "Beep", SbxNULL, _FUNCTION, RTLNAME(Beep) }, +{ "Blue", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Blue) }, + { "RGB-Value", SbxLONG }, + +{ "CBool", SbxBOOL, 1 | _FUNCTION, RTLNAME(CBool) }, + { "expression", SbxVARIANT }, +{ "CByte", SbxBYTE, 1 | _FUNCTION, RTLNAME(CByte) }, + { "expression", SbxVARIANT }, +{ "CCur", SbxCURRENCY, 1 | _FUNCTION, RTLNAME(CCur) }, + { "expression", SbxVARIANT }, +{ "CDate", SbxDATE, 1 | _FUNCTION, RTLNAME(CDate) }, + { "expression", SbxVARIANT }, +{ "CDbl", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(CDbl) }, + { "expression", SbxVARIANT }, +{ "CF_BITMAP", SbxINTEGER, _CPROP, RTLNAME(CF_BITMAP) }, +{ "CF_METAFILEPICT",SbxINTEGER, _CPROP, RTLNAME(CF_METAFILEPICT) }, +{ "CF_TEXT", SbxINTEGER, _CPROP, RTLNAME(CF_TEXT) }, +{ "ChDir", SbxNULL, 1 | _FUNCTION, RTLNAME(ChDir) }, + { "string", SbxSTRING }, +{ "ChDrive", SbxNULL, 1 | _FUNCTION, RTLNAME(ChDrive) }, + { "string", SbxSTRING }, + +{ "Choose", SbxVARIANT, 2 | _FUNCTION, RTLNAME(Choose) }, + { "Index", SbxINTEGER }, + { "Expression", SbxVARIANT }, + +{ "Chr", SbxSTRING, 1 | _FUNCTION, RTLNAME(Chr) }, + { "string", SbxINTEGER }, + +{ "CInt", SbxINTEGER, 1 | _FUNCTION, RTLNAME(CInt) }, + { "expression", SbxVARIANT }, +{ "CLEAR_ALLTABS", SbxINTEGER, _CPROP, RTLNAME(CLEAR_ALLTABS) }, +{ "CLEAR_TAB", SbxINTEGER, _CPROP, RTLNAME(CLEAR_TAB) }, + +{ "CLng", SbxLONG, 1 | _FUNCTION, RTLNAME(CLng) }, + { "expression", SbxVARIANT }, +{ "Cos", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Cos) }, + { "number", SbxDOUBLE }, +{ "CreateObject", SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateObject ) }, + { "class", SbxSTRING }, +{ "CreateUnoListener",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateUnoListener ) }, + { "prefix", SbxSTRING }, + { "typename", SbxSTRING }, +{ "CreateUnoService",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateUnoService ) }, + { "servicename", SbxSTRING }, +{ "CreateUnoStruct",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreateUnoStruct ) }, + { "classname", SbxSTRING }, +{ "CreatePropertySet",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreatePropertySet ) }, + { "values", SbxARRAY }, +{ "CSng", SbxSINGLE, 1 | _FUNCTION, RTLNAME(CSng) }, + { "expression", SbxVARIANT }, +{ "CStr", SbxSTRING, 1 | _FUNCTION, RTLNAME(CStr) }, + { "expression", SbxVARIANT }, +{ "CurDir", SbxSTRING, 1 | _FUNCTION, RTLNAME(CurDir) }, + { "string", SbxSTRING }, +{ "CVar", SbxVARIANT, 1 | _FUNCTION, RTLNAME(CVar) }, + { "expression", SbxVARIANT }, +{ "CVErr", SbxVARIANT, 1 | _FUNCTION, RTLNAME(CVErr) }, + { "expression", SbxVARIANT }, +{ "Date", SbxSTRING, _LFUNCTION,RTLNAME(Date) }, +{ "DateAdd", SbxDATE, 1 | _FUNCTION, RTLNAME(DateAdd) }, + { "Interval", SbxSTRING }, + { "Number", SbxLONG }, + { "Date", SbxDATE }, +{ "DateDiff", SbxLONG, 1 | _FUNCTION, RTLNAME(DateDiff) }, + { "Interval", SbxSTRING }, + { "Date1", SbxDATE }, + { "Date2", SbxDATE }, +{ "DatePart", SbxLONG, 1 | _FUNCTION, RTLNAME(DatePart) }, + { "Interval", SbxSTRING }, + { "Date", SbxDATE }, +{ "DateSerial", SbxDATE, 3 | _FUNCTION, RTLNAME(DateSerial) }, + { "Year", SbxINTEGER }, + { "Month", SbxINTEGER }, + { "Day", SbxINTEGER }, +{ "DateValue", SbxDATE, 1 | _FUNCTION, RTLNAME(DateValue) }, + { "String", SbxSTRING }, +{ "Day", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Day) }, + { "Date", SbxDATE }, + +{ "Ddeexecute", SbxNULL, 2 | _FUNCTION, RTLNAME(DDEExecute) }, + { "Channel", SbxLONG }, + { "Command", SbxSTRING }, +{ "Ddeinitiate", SbxINTEGER, 2 | _FUNCTION, RTLNAME(DDEInitiate) }, + { "Application", SbxSTRING }, + { "Topic", SbxSTRING }, +{ "Ddepoke", SbxNULL, 3 | _FUNCTION, RTLNAME(DDEPoke) }, + { "Channel", SbxLONG }, + { "Item", SbxSTRING }, + { "Data", SbxSTRING }, +{ "Dderequest", SbxSTRING, 2 | _FUNCTION, RTLNAME(DDERequest) }, + { "Channel", SbxLONG }, + { "Item", SbxSTRING }, +{ "Ddeterminate", SbxNULL, 1 | _FUNCTION, RTLNAME(DDETerminate) }, + { "Channel", SbxLONG }, +{ "Ddeterminateall", SbxNULL, _FUNCTION, RTLNAME(DDETerminateAll) }, +{ "DimArray", SbxOBJECT, _FUNCTION, RTLNAME(DimArray) }, +{ "Dir", SbxSTRING, 2 | _FUNCTION, RTLNAME(Dir) }, + { "FileSpec", SbxSTRING, _OPT }, + { "attrmask", SbxINTEGER, _OPT }, +{ "DumpAllObjects", SbxEMPTY, 2 | _SUB, RTLNAME(DumpAllObjects) }, + { "FileSpec", SbxSTRING }, + { "DumpAll", SbxINTEGER, _OPT }, + +{ "EqualUnoObjects",SbxBOOL, 2 | _FUNCTION, RTLNAME(EqualUnoObjects) }, + { "Variant", SbxVARIANT }, + { "Variant", SbxVARIANT }, +{ "EnableReschedule", SbxNULL, 1 | _FUNCTION, RTLNAME(EnableReschedule) }, + { "bEnable", SbxBOOL }, +{ "Environ", SbxSTRING, 1 | _FUNCTION, RTLNAME(Environ) }, + { "Environmentstring",SbxSTRING }, +{ "EOF", SbxBOOL, 1 | _FUNCTION, RTLNAME(EOF) }, + { "Channel", SbxINTEGER }, +{ "Erl", SbxLONG, _ROPROP, RTLNAME( Erl ) }, +{ "Err", SbxLONG, _RWPROP, RTLNAME( Err ) }, +{ "Error", SbxSTRING, 1 | _FUNCTION, RTLNAME( Error ) }, + { "code", SbxLONG }, +{ "Exp", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Exp) }, + { "number", SbxDOUBLE }, +{ "False", SbxBOOL, _CPROP, RTLNAME(False) }, +{ "FileAttr", SbxINTEGER, 2 | _FUNCTION, RTLNAME(FileAttr) }, + { "Channel", SbxINTEGER }, + { "Attributes", SbxINTEGER }, +{ "FileCopy", SbxNULL, 2 | _FUNCTION, RTLNAME(FileCopy) }, + { "Source", SbxSTRING }, + { "Destination", SbxSTRING }, +{ "FileDateTime", SbxSTRING, 1 | _FUNCTION, RTLNAME(FileDateTime) }, + { "filename", SbxSTRING }, +{ "FileExists", SbxBOOL, 1 | _FUNCTION, RTLNAME(FileExists) }, + { "filename", SbxSTRING }, +{ "FileLen", SbxLONG, 1 | _FUNCTION, RTLNAME(FileLen) }, + { "filename", SbxSTRING }, +{ "FindObject", SbxOBJECT, 1 | _FUNCTION, RTLNAME(FindObject) }, + { "Name", SbxSTRING }, +{ "FindPropertyObject", SbxOBJECT, 2 | _FUNCTION, RTLNAME(FindPropertyObject) }, + { "Object", SbxOBJECT }, + { "Name", SbxSTRING }, +{ "Fix", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Fix) }, + { "number", SbxDOUBLE }, +{ "Format", SbxSTRING, 2 | _FUNCTION, RTLNAME(Format) }, + { "expression", SbxVARIANT }, + { "format", SbxSTRING, _OPT }, + +{ "FRAMEANCHORCHAR", SbxINTEGER, _CPROP, RTLNAME(FRAMEANCHORCHAR) }, +{ "FRAMEANCHORPAGE", SbxINTEGER, _CPROP, RTLNAME(FRAMEANCHORPAGE) }, +{ "FRAMEANCHORPARA", SbxINTEGER, _CPROP, RTLNAME(FRAMEANCHORPARA) }, + +{ "FreeFile", SbxINTEGER, _FUNCTION, RTLNAME(FreeFile) }, +{ "FreeLibrary", SbxNULL, 1 | _FUNCTION, RTLNAME(FreeLibrary) }, + { "Modulename", SbxSTRING }, + +{ "Get", SbxNULL, 3 | _FUNCTION, RTLNAME(Get) }, + { "filenumber", SbxINTEGER }, + { "recordnumber", SbxLONG }, + { "variablename", SbxVARIANT }, + +{ "GetAttr", SbxINTEGER, 1 | _FUNCTION, RTLNAME(GetAttr) }, + { "filename", SbxSTRING }, +{ "GetDialogZoomFactorX", SbxDOUBLE, _FUNCTION,RTLNAME(GetDialogZoomFactorX) }, +{ "GetDialogZoomFactorY", SbxDOUBLE, _FUNCTION,RTLNAME(GetDialogZoomFactorY) }, +{ "GetGUIType", SbxINTEGER, _FUNCTION,RTLNAME(GetGUIType) }, +{ "GetGUIVersion", SbxLONG, _FUNCTION,RTLNAME(GetGUIVersion) }, +{ "GetPathSeparator", SbxSTRING, _FUNCTION,RTLNAME(GetPathSeparator) }, +{ "GetProcessServiceManager", SbxOBJECT, 0 | _FUNCTION, RTLNAME(GetProcessServiceManager) }, +{ "GetSolarVersion", SbxLONG, _FUNCTION,RTLNAME(GetSolarVersion) }, +{ "GetSystemTicks", SbxLONG, _FUNCTION,RTLNAME(GetSystemTicks) }, +{ "GetSystemType", SbxINTEGER, _FUNCTION,RTLNAME(GetSystemType) }, +{ "Green", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Green) }, + { "RGB-Value", SbxLONG }, + +{ "HasUnoInterfaces", SbxBOOL, 1 | _FUNCTION, RTLNAME(HasUnoInterfaces) }, + { "InterfaceName",SbxSTRING }, +{ "Hex", SbxSTRING, 1 | _FUNCTION, RTLNAME(Hex) }, + { "number", SbxLONG }, +{ "Hour", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Hour) }, + { "Date", SbxDATE }, + +{ "IDABORT", SbxINTEGER, _CPROP, RTLNAME(IDABORT) }, +{ "IDCANCEL", SbxINTEGER, _CPROP, RTLNAME(IDCANCEL) }, +{ "IDNO", SbxINTEGER, _CPROP, RTLNAME(IDNO) }, +{ "IDOK", SbxINTEGER, _CPROP, RTLNAME(IDOK) }, +{ "IDRETRY", SbxINTEGER, _CPROP, RTLNAME(IDRETRY) }, +{ "IDYES", SbxINTEGER, _CPROP, RTLNAME(IDYES) }, + +{ "Iif", SbxVARIANT, 3 | _FUNCTION, RTLNAME(Iif) }, + { "Bool", SbxBOOL }, + { "Variant1", SbxVARIANT }, + { "Variant2", SbxVARIANT }, + +{ "InputBox", SbxSTRING, 5 | _FUNCTION, RTLNAME(InputBox) }, + { "Prompt", SbxSTRING }, + { "Title", SbxSTRING, _OPT }, + { "Default", SbxSTRING, _OPT }, + { "XPosTwips", SbxLONG, _OPT }, + { "YPosTwips", SbxLONG, _OPT }, +{ "InStr", SbxINTEGER, 4 | _FUNCTION, RTLNAME(InStr) }, + { "StartPos", SbxSTRING, _OPT }, + { "String1", SbxSTRING }, + { "String2", SbxSTRING }, + { "Compare", SbxINTEGER, _OPT }, +{ "Int", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Int) }, + { "number", SbxDOUBLE }, +{ "IsArray", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsArray) }, + { "Variant", SbxVARIANT }, +{ "IsDate", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsDate) }, + { "Variant", SbxVARIANT }, +{ "IsEmpty", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsEmpty) }, + { "Variant", SbxVARIANT }, +{ "IsError", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsError) }, + { "Variant", SbxVARIANT }, +{ "IsMissing", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsMissing) }, + { "Variant", SbxVARIANT }, +{ "IsNull", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsNull) }, + { "Variant", SbxVARIANT }, +{ "IsNumeric", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsNumeric) }, + { "Variant", SbxVARIANT }, +{ "IsObject", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsObject) }, + { "Variant", SbxVARIANT }, +{ "IsUnoStruct", SbxBOOL, 1 | _FUNCTION, RTLNAME(IsUnoStruct) }, + { "Variant", SbxVARIANT }, +{ "Kill", SbxNULL, 1 | _FUNCTION, RTLNAME(Kill) }, + { "filespec", SbxSTRING }, +{ "LBound", SbxINTEGER, 1 | _FUNCTION, RTLNAME(LBound) }, + { "Variant", SbxVARIANT }, +{ "LCase", SbxSTRING, 1 | _FUNCTION, RTLNAME(LCase) }, + { "string", SbxSTRING }, +{ "Left", SbxSTRING, 2 | _FUNCTION, RTLNAME(Left) }, + { "String", SbxSTRING }, + { "Count", SbxLONG }, +{ "Len", SbxLONG, 1 | _FUNCTION, RTLNAME(Len) }, + { "StringOrVariant", SbxVARIANT }, +{ "Load", SbxNULL, 1 | _FUNCTION, RTLNAME(Load) }, + { "object", SbxOBJECT }, +{ "LoadPicture", SbxOBJECT, 1 | _FUNCTION, RTLNAME(LoadPicture) }, + { "string", SbxSTRING }, +{ "Loc", SbxLONG, 1 | _FUNCTION, RTLNAME(Loc) }, + { "Channel", SbxINTEGER }, +{ "Lof", SbxLONG, 1 | _FUNCTION, RTLNAME(Lof) }, + { "Channel", SbxINTEGER }, +{ "Log", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Log) }, + { "number", SbxDOUBLE }, +{ "LTrim", SbxSTRING, 1 | _FUNCTION, RTLNAME(LTrim) }, + { "string", SbxSTRING }, + +{ "MB_ABORTRETRYIGNORE", SbxINTEGER, _CPROP, RTLNAME(MB_ABORTRETRYIGNORE)}, +{ "MB_APPLMODAL", SbxINTEGER, _CPROP, RTLNAME(MB_APPLMODAL) }, +{ "MB_DEFBUTTON1", SbxINTEGER, _CPROP, RTLNAME(MB_DEFBUTTON1) }, +{ "MB_DEFBUTTON2", SbxINTEGER, _CPROP, RTLNAME(MB_DEFBUTTON2) }, +{ "MB_DEFBUTTON3", SbxINTEGER, _CPROP, RTLNAME(MB_DEFBUTTON3) }, +{ "MB_ICONEXCLAMATION", SbxINTEGER, _CPROP, RTLNAME(MB_ICONEXCLAMATION)}, +{ "MB_ICONINFORMATION", SbxINTEGER, _CPROP, RTLNAME(MB_ICONINFORMATION)}, +{ "MB_ICONQUESTION",SbxINTEGER, _CPROP, RTLNAME(MB_ICONQUESTION) }, +{ "MB_ICONSTOP", SbxINTEGER, _CPROP, RTLNAME(MB_ICONSTOP) }, +{ "MB_OK", SbxINTEGER, _CPROP, RTLNAME(MB_OK) }, +{ "MB_OKCANCEL", SbxINTEGER, _CPROP, RTLNAME(MB_OKCANCEL) }, +{ "MB_RETRYCANCEL", SbxINTEGER, _CPROP, RTLNAME(MB_RETRYCANCEL) }, +{ "MB_SYSTEMMODAL", SbxINTEGER, _CPROP, RTLNAME(MB_SYSTEMMODAL) }, +{ "MB_YESNO", SbxINTEGER, _CPROP, RTLNAME(MB_YESNO) }, +{ "MB_YESNOCANCEL", SbxINTEGER, _CPROP, RTLNAME(MB_YESNOCANCEL) }, + + +{ "Mid", SbxSTRING, 3 | _LFUNCTION,RTLNAME(Mid) }, + { "String", SbxSTRING }, + { "StartPos", SbxLONG } , + { "Length", SbxLONG, _OPT } , +{ "Minute", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Minute) }, + { "Date", SbxDATE }, +{ "MkDir", SbxNULL, 1 | _FUNCTION, RTLNAME(MkDir) }, + { "pathname", SbxSTRING }, +{ "Month", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Month) }, + { "Date", SbxDATE }, +{ "MsgBox", SbxINTEGER, 3 | _FUNCTION, RTLNAME(MsgBox) }, + { "Message", SbxSTRING }, + { "Type", SbxINTEGER, _OPT }, + { "Title", SbxSTRING, _OPT }, + +{ "Nothing", SbxOBJECT, _CPROP, RTLNAME(Nothing) }, +{ "Now", SbxDATE, _FUNCTION, RTLNAME(Now) }, +{ "Null", SbxOBJECT, _CPROP, RTLNAME(Null) }, +{ "Oct", SbxSTRING, 1 | _FUNCTION, RTLNAME(Oct) }, + { "number", SbxLONG }, +{ "Pi", SbxDOUBLE, _CPROP, RTLNAME(PI) }, + +{ "Put", SbxNULL, 3 | _FUNCTION, RTLNAME(Put) }, + { "filenumber", SbxINTEGER }, + { "recordnumber", SbxLONG }, + { "variablename", SbxVARIANT }, + +{ "QBColor", SbxLONG, 1 | _FUNCTION, RTLNAME(QBColor) }, + { "number", SbxINTEGER }, +{ "Randomize", SbxNULL, 1 | _FUNCTION, RTLNAME(Randomize) }, + { "Number", SbxDOUBLE, _OPT }, +{ "Red", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Red) }, + { "RGB-Value", SbxLONG }, +{ "Reset", SbxNULL, 0 | _FUNCTION, RTLNAME(Reset) }, +{ "ResolvePath", SbxSTRING, 1 | _FUNCTION, RTLNAME(ResolvePath) }, + { "Path", SbxSTRING }, +{ "RGB", SbxLONG, 3 | _FUNCTION, RTLNAME(RGB) }, + { "Red", SbxINTEGER }, + { "Green", SbxINTEGER }, + { "Blue", SbxINTEGER }, + +{ "Right", SbxSTRING, 2 | _FUNCTION, RTLNAME(Right) }, + { "String", SbxSTRING }, + { "Count", SbxLONG } , +{ "RmDir", SbxNULL, 1 | _FUNCTION, RTLNAME(RmDir) }, + { "pathname", SbxSTRING }, +{ "Rnd", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Rnd) }, + { "Number", SbxDOUBLE, _OPT }, +{ "RTrim", SbxSTRING, 1 | _FUNCTION, RTLNAME(RTrim) }, + { "string", SbxSTRING }, +{ "SavePicture", SbxNULL, 2 | _FUNCTION, RTLNAME(SavePicture) }, + { "object", SbxOBJECT }, + { "string", SbxSTRING }, +{ "Second", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Second) }, + { "Date", SbxDATE }, +{ "Seek", SbxLONG, 1 | _FUNCTION, RTLNAME(Seek) }, + { "Channel", SbxINTEGER }, + +{ "SendKeys", SbxNULL, 2 | _FUNCTION, RTLNAME(SendKeys) }, + { "String", SbxSTRING }, + { "Wait", SbxBOOL, _OPT } , +{ "SetAttr", SbxNULL, 2 | _FUNCTION, RTLNAME(SetAttr) }, + { "File" , SbxSTRING }, + { "Attributes", SbxINTEGER } , +{ "SET_OFF", SbxINTEGER, _CPROP, RTLNAME(SET_OFF) }, +{ "SET_ON", SbxINTEGER, _CPROP, RTLNAME(SET_ON) }, +{ "SET_TAB", SbxINTEGER, _CPROP, RTLNAME(SET_TAB) }, + +{ "Sgn", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Sgn) }, + { "number", SbxDOUBLE }, +{ "Shell", SbxLONG, 2 | _FUNCTION, RTLNAME(Shell) }, + { "Commandstring",SbxSTRING }, + { "WindowStyle", SbxINTEGER, _OPT }, +{ "Sin", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Sin) }, + { "number", SbxDOUBLE }, +{ "Space", SbxSTRING, 1 | _FUNCTION, RTLNAME(Space) }, + { "string", SbxLONG }, +{ "Spc", SbxSTRING, 1 | _FUNCTION, RTLNAME(Spc) }, + { "Count", SbxLONG }, +{ "Sqr", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Sqr) }, + { "number", SbxDOUBLE }, +{ "Str", SbxSTRING, 1 | _FUNCTION, RTLNAME(Str) }, + { "number", SbxDOUBLE }, +{ "StrComp", SbxINTEGER, 3 | _FUNCTION, RTLNAME(StrComp) }, + { "String1", SbxSTRING }, + { "String2", SbxSTRING }, + { "Compare", SbxINTEGER, _OPT }, +{ "StrConv", SbxSTRING, 2 | _FUNCTION, RTLNAME(StrConv) }, + { "String", SbxSTRING }, + { "Conversion", SbxSTRING }, +{ "String", SbxSTRING, 2 | _FUNCTION, RTLNAME(String) }, + { "Count", SbxLONG }, + { "Filler", SbxVARIANT }, + +{ "Switch", SbxVARIANT, 2 | _FUNCTION, RTLNAME(Switch) }, + { "Expression", SbxVARIANT }, + { "Value", SbxVARIANT }, + +{ "Tan", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Tan) }, + { "number", SbxDOUBLE }, +{ "Time", SbxVARIANT, _LFUNCTION,RTLNAME(Time) }, +{ "Timer", SbxDATE, _FUNCTION, RTLNAME(Timer) }, +{ "TimeSerial", SbxDATE, 3 | _FUNCTION, RTLNAME(TimeSerial) }, + { "Hour", SbxLONG }, + { "Minute", SbxLONG }, + { "Second", SbxLONG }, +{ "TimeValue", SbxDATE, 1 | _FUNCTION, RTLNAME(TimeValue) }, + { "String", SbxSTRING }, + +{ "TOGGLE", SbxINTEGER, _CPROP, RTLNAME(TOGGLE) }, + +{ "Trim", SbxSTRING, 1 | _FUNCTION, RTLNAME(Trim) }, + { "String", SbxSTRING }, +{ "True", SbxBOOL, _CPROP, RTLNAME(True) }, +{ "TwipsPerPixelX", SbxLONG, _FUNCTION, RTLNAME(TwipsPerPixelX) }, +{ "TwipsPerPixelY", SbxLONG, _FUNCTION, RTLNAME(TwipsPerPixelY) }, + +{ "TYP_AUTHORFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_AUTHORFLD) }, +{ "TYP_CHAPTERFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_CHAPTERFLD) }, +{ "TYP_CONDTXTFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_CONDTXTFLD) }, +{ "TYP_DATEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_DATEFLD) }, +{ "TYP_DBFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_DBFLD) }, +{ "TYP_DBNAMEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_DBNAMEFLD) }, +{ "TYP_DBNEXTSETFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_DBNEXTSETFLD) }, +{ "TYP_DBNUMSETFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_DBNUMSETFLD) }, +{ "TYP_DBSETNUMBERFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_DBSETNUMBERFLD) }, +{ "TYP_DDEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_DDEFLD) }, +{ "TYP_DOCINFOFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_DOCINFOFLD) }, +{ "TYP_DOCSTATFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_DOCSTATFLD) }, +{ "TYP_EXTUSERFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_EXTUSERFLD) }, +{ "TYP_FILENAMEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_FILENAMEFLD) }, +{ "TYP_FIXDATEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_FIXDATEFLD) }, +{ "TYP_FIXTIMEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_FIXTIMEFLD) }, +{ "TYP_FORMELFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_FORMELFLD) }, +{ "TYP_GETFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_GETFLD) }, +{ "TYP_GETREFFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_GETREFFLD) }, +{ "TYP_GETREFPAGEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_GETREFPAGEFLD) }, +{ "TYP_HIDDENPARAFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_HIDDENPARAFLD) }, +{ "TYP_HIDDENTXTFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_HIDDENTXTFLD) }, +{ "TYP_INPUTFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_INPUTFLD) }, +{ "TYP_INTERNETFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_INTERNETFLD) }, +{ "TYP_JUMPEDITFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_JUMPEDITFLD) }, +{ "TYP_MACROFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_MACROFLD) }, +{ "TYP_NEXTPAGEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_NEXTPAGEFLD) }, +{ "TYP_PAGENUMBERFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_PAGENUMBERFLD) }, +{ "TYP_POSTITFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_POSTITFLD) }, +{ "TYP_PREVPAGEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_PREVPAGEFLD) }, +{ "TYP_SEQFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_SEQFLD) }, +{ "TYP_SETFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_SETFLD) }, +{ "TYP_SETINPFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_SETINPFLD) }, +{ "TYP_SETREFFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_SETREFFLD) }, +{ "TYP_SETREFPAGEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_SETREFPAGEFLD) }, +{ "TYP_TEMPLNAMEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_TEMPLNAMEFLD) }, +{ "TYP_TIMEFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_TIMEFLD) }, +{ "TYP_USERFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_USERFLD) }, +{ "TYP_USRINPFLD", SbxINTEGER, _CPROP, RTLNAME(TYP_USRINPFLD) }, + +{ "TypeLen", SbxINTEGER, 1 | _FUNCTION, RTLNAME(TypeLen) }, + { "Var", SbxVARIANT }, +{ "TypeName", SbxSTRING, 1 | _FUNCTION, RTLNAME(TypeName) }, + { "Var", SbxVARIANT }, +{ "UBound", SbxINTEGER, 1 | _FUNCTION, RTLNAME(UBound) }, + { "Var", SbxVARIANT }, +{ "UCase", SbxSTRING, 1 | _FUNCTION, RTLNAME(UCase) }, + { "String", SbxSTRING }, +{ "Unload", SbxNULL, 1 | _FUNCTION, RTLNAME(Unload) }, + { "Dialog", SbxOBJECT }, +{ "Val", SbxDOUBLE, 1 | _FUNCTION, RTLNAME(Val) }, + { "String", SbxSTRING }, +{ "VarType", SbxINTEGER, 1 | _FUNCTION, RTLNAME(VarType) }, + { "Var", SbxVARIANT }, +{ "V_EMPTY", SbxINTEGER, _CPROP, RTLNAME(V_EMPTY) }, +{ "V_NULL", SbxINTEGER, _CPROP, RTLNAME(V_NULL) }, +{ "V_INTEGER", SbxINTEGER, _CPROP, RTLNAME(V_INTEGER) }, +{ "V_LONG", SbxINTEGER, _CPROP, RTLNAME(V_LONG) }, +{ "V_SINGLE", SbxINTEGER, _CPROP, RTLNAME(V_SINGLE) }, +{ "V_DOUBLE", SbxINTEGER, _CPROP, RTLNAME(V_DOUBLE) }, +{ "V_CURRENCY", SbxINTEGER, _CPROP, RTLNAME(V_CURRENCY) }, +{ "V_DATE", SbxINTEGER, _CPROP, RTLNAME(V_DATE) }, +{ "V_STRING", SbxINTEGER, _CPROP, RTLNAME(V_STRING) }, + +{ "Wait", SbxNULL, 1 | _FUNCTION, RTLNAME(Wait) }, + { "Milliseconds", SbxLONG }, +{ "Weekday", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Weekday) }, + { "Date", SbxDATE }, +{ "Year", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Year) }, + { "Date", SbxDATE }, + +{ NULL, SbxNULL, -1 }}; // Tabellenende + +SbiStdObject::SbiStdObject( const String& r, StarBASIC* pb ) : SbxObject( r ) +{ + // Muessen wir die Hashcodes initialisieren? + Methods* p = aMethods; + if( !p->nHash ) + while( p->nArgs != -1 ) + { + String aName = String::CreateFromAscii( p->pName ); + p->nHash = SbxVariable::MakeHashCode( aName ); + p += ( p->nArgs & _ARGSMASK ) + 1; + } + + SetParent( pb ); + + pStdFactory = new SbStdFactory; + SbxBase::AddFactory( pStdFactory ); + + Insert( new SbStdClipboard ); +} + +SbiStdObject::~SbiStdObject() +{ + SbxBase::RemoveFactory( pStdFactory ); + delete pStdFactory; +} + +// Suche nach einem Element: +// Hier wird linear durch die Methodentabelle gegangen, bis eine +// passende Methode gefunden wurde. Auf Grund der Bits im nArgs-Feld +// wird dann die passende Instanz eines SbxObjElement generiert. +// Wenn die Methode/Property nicht gefunden wurde, nur NULL ohne +// Fehlercode zurueckliefern, da so auch eine ganze Chain von +// Objekten nach der Methode/Property befragt werden kann. + +SbxVariable* SbiStdObject::Find( const String& rName, SbxClassType t ) +{ + // Bereits eingetragen? + SbxVariable* pVar = SbxObject::Find( rName, t ); + if( !pVar ) + { + // sonst suchen + USHORT nHash = SbxVariable::MakeHashCode( rName ); + Methods* p = aMethods; + BOOL bFound = FALSE; + short nIndex = 0; + USHORT nSrchMask = _TYPEMASK; + switch( t ) + { + case SbxCLASS_METHOD: nSrchMask = _METHOD; break; + case SbxCLASS_PROPERTY: nSrchMask = _PROPERTY; break; + case SbxCLASS_OBJECT: nSrchMask = _OBJECT; break; + } + while( p->nArgs != -1 ) + { + if( ( p->nArgs & nSrchMask ) + && ( p->nHash == nHash ) + && ( rName.EqualsIgnoreCaseAscii( p->pName ) ) ) + { + bFound = TRUE; break; + } + nIndex += ( p->nArgs & _ARGSMASK ) + 1; + p = aMethods + nIndex; + } + if( bFound ) + { + // Args-Felder isolieren: + short nAccess = ( p->nArgs & _RWMASK ) >> 8; + short nType = ( p->nArgs & _TYPEMASK ); + if( p->nArgs & _CONST ) + nAccess |= SBX_CONST; + String aName = String::CreateFromAscii( p->pName ); + SbxClassType eCT = SbxCLASS_OBJECT; + if( nType & _PROPERTY ) + eCT = SbxCLASS_PROPERTY; + else if( nType & _METHOD ) + eCT = SbxCLASS_METHOD; + pVar = Make( aName, eCT, p->eType ); + pVar->SetUserData( nIndex + 1 ); + pVar->SetFlags( nAccess ); + } + } + return pVar; +} + +// SetModified mu bei der RTL abgklemmt werden +void SbiStdObject::SetModified( BOOL ) +{ +} + +// Aufruf einer Property oder Methode. + +void SbiStdObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) + +{ + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbxArray* pPar = pVar->GetParameters(); + ULONG t = pHint->GetId(); + USHORT nCallId = (USHORT) pVar->GetUserData(); + if( nCallId ) + { + if( t == SBX_HINT_INFOWANTED ) + pVar->SetInfo( GetInfo( (short) pVar->GetUserData() ) ); + else + { + BOOL bWrite = FALSE; + if( t == SBX_HINT_DATACHANGED ) + bWrite = TRUE; + if( t == SBX_HINT_DATAWANTED || bWrite ) + { + RtlCall p = (RtlCall) aMethods[ nCallId-1 ].pFunc; + SbxArrayRef rPar( pPar ); + if( !pPar ) + { + rPar = pPar = new SbxArray; + pPar->Put( pVar, 0 ); + } + p( (StarBASIC*) GetParent(), *pPar, bWrite ); + return; + } + } + } + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + } +} + +// Zusammenbau der Infostruktur fuer einzelne Elemente +// Falls nIdx = 0, nix erzeugen (sind Std-Props!) + +SbxInfo* SbiStdObject::GetInfo( short nIdx ) +{ + if( !nIdx ) + return NULL; + Methods* p = &aMethods[ --nIdx ]; + // Wenn mal eine Hilfedatei zur Verfuegung steht: + // SbxInfo* pInfo = new SbxInfo( Hilfedateiname, p->nHelpId ); + SbxInfo* pInfo = new SbxInfo; + short nPar = p->nArgs & _ARGSMASK; + for( short i = 0; i < nPar; i++ ) + { + p++; + String aName = String::CreateFromAscii( p->pName ); + USHORT nFlags = ( p->nArgs >> 8 ) & 0x03; + if( p->nArgs & _OPT ) + nFlags |= SBX_OPTIONAL; + pInfo->AddParam( aName, p->eType, nFlags ); + } + return pInfo; +} + diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx new file mode 100644 index 000000000000..e72786422d9b --- /dev/null +++ b/basic/source/runtime/stdobj1.cxx @@ -0,0 +1,547 @@ +/************************************************************************* + * + * $RCSfile: stdobj1.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SV_WRKWIN_HXX //autogen +#include <vcl/wrkwin.hxx> +#endif +#ifndef _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#ifndef _SV_CLIP_HXX //autogen +#include <vcl/clip.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#include "runtime.hxx" +#pragma hdrstop +#include "stdobj1.hxx" + +#include "segmentc.hxx" +//#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + +#define ATTR_IMP_TYPE 1 +#define ATTR_IMP_WIDTH 2 +#define ATTR_IMP_HEIGHT 3 +#define ATTR_IMP_BOLD 4 +#define ATTR_IMP_ITALIC 5 +#define ATTR_IMP_STRIKETHROUGH 6 +#define ATTR_IMP_UNDERLINE 7 +#define ATTR_IMP_WEIGHT 8 +#define ATTR_IMP_SIZE 9 +#define ATTR_IMP_NAME 10 + +#define METH_CLEAR 20 +#define METH_GETDATA 21 +#define METH_GETFORMAT 22 +#define METH_GETTEXT 23 +#define METH_SETDATA 24 +#define METH_SETTEXT 25 + +//------------------------------------------------------------------------------ +SbStdFactory::SbStdFactory() +{ +} + +SbxObject* SbStdFactory::CreateObject( const String& rClassName ) +{ + if( rClassName.EqualsIgnoreCaseAscii( String( RTL_CONSTASCII_USTRINGPARAM("Picture") ) ) ) + return new SbStdPicture; + else + if( rClassName.EqualsIgnoreCaseAscii( String( RTL_CONSTASCII_USTRINGPARAM("Font") ) ) ) + return new SbStdFont; + else + return NULL; +} + +//------------------------------------------------------------------------------ + + + +void SbStdPicture::PropType( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +{ + if( bWrite ) + { + StarBASIC::Error( SbERR_PROP_READONLY ); + return; + } + + GraphicType eType = aGraphic.GetType(); + INT16 nType = 0; + + if( eType == GRAPHIC_BITMAP ) + nType = 1; + else + if( eType != GRAPHIC_NONE ) + nType = 2; + + pVar->PutInteger( nType ); +} + + +void SbStdPicture::PropWidth( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +{ + if( bWrite ) + { + StarBASIC::Error( SbERR_PROP_READONLY ); + return; + } + + Size aSize = aGraphic.GetPrefSize(); + aSize = GetpApp()->GetAppWindow()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() ); + aSize = GetpApp()->GetAppWindow()->PixelToLogic( aSize, MapMode( MAP_TWIP ) ); + + pVar->PutInteger( (INT16)aSize.Width() ); +} + +void SbStdPicture::PropHeight( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +{ + if( bWrite ) + { + StarBASIC::Error( SbERR_PROP_READONLY ); + return; + } + + Size aSize = aGraphic.GetPrefSize(); + aSize = GetpApp()->GetAppWindow()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() ); + aSize = GetpApp()->GetAppWindow()->PixelToLogic( aSize, MapMode( MAP_TWIP ) ); + + pVar->PutInteger( (INT16)aSize.Height() ); +} + + +TYPEINIT1( SbStdPicture, SbxObject ); + +SbStdPicture::SbStdPicture() : + SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Picture") ) ) +{ + // Properties + SbxVariable* p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Type") ), SbxCLASS_PROPERTY, SbxVARIANT ); + p->SetFlags( SBX_READ | SBX_DONTSTORE ); + p->SetUserData( ATTR_IMP_TYPE ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Width") ), SbxCLASS_PROPERTY, SbxVARIANT ); + p->SetFlags( SBX_READ | SBX_DONTSTORE ); + p->SetUserData( ATTR_IMP_WIDTH ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Height") ), SbxCLASS_PROPERTY, SbxVARIANT ); + p->SetFlags( SBX_READ | SBX_DONTSTORE ); + p->SetUserData( ATTR_IMP_HEIGHT ); +} + +SbStdPicture::~SbStdPicture() +{ +} + + +SbxVariable* SbStdPicture::Find( const String& rName, SbxClassType t ) +{ + // Bereits eingetragen? + return SbxObject::Find( rName, t ); +} + + + +void SbStdPicture::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) + +{ + const SbxHint* pHint = PTR_CAST( SbxHint, &rHint ); + + if( pHint ) + { + if( pHint->GetId() == SBX_HINT_INFOWANTED ) + { + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + return; + } + + SbxVariable* pVar = pHint->GetVar(); + SbxArray* pPar = pVar->GetParameters(); + USHORT nWhich = (USHORT)pVar->GetUserData(); + BOOL bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; + + // Propteries + switch( nWhich ) + { + case ATTR_IMP_TYPE: PropType( pVar, pPar, bWrite ); return; + case ATTR_IMP_WIDTH: PropWidth( pVar, pPar, bWrite ); return; + case ATTR_IMP_HEIGHT: PropHeight( pVar, pPar, bWrite ); return; + } + + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + } +} + +//----------------------------------------------------------------------------- + +void SbStdFont::PropBold( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +{ + if( bWrite ) + SetBold( pVar->GetBool() ); + else + pVar->PutBool( IsBold() ); +} + +void SbStdFont::PropItalic( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +{ + if( bWrite ) + SetItalic( pVar->GetBool() ); + else + pVar->PutBool( IsItalic() ); +} + +void SbStdFont::PropStrikeThrough( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +{ + if( bWrite ) + SetStrikeThrough( pVar->GetBool() ); + else + pVar->PutBool( IsStrikeThrough() ); +} + +void SbStdFont::PropUnderline( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +{ + if( bWrite ) + SetUnderline( pVar->GetBool() ); + else + pVar->PutBool( IsUnderline() ); +} + +void SbStdFont::PropSize( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +{ + if( bWrite ) + SetSize( (USHORT)pVar->GetInteger() ); + else + pVar->PutInteger( (INT16)GetSize() ); +} + +void SbStdFont::PropName( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +{ + if( bWrite ) + SetFontName( pVar->GetString() ); + else + pVar->PutString( GetFontName() ); +} + + +TYPEINIT1( SbStdFont, SbxObject ); + +SbStdFont::SbStdFont() : + SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Font") ) ) +{ + // Properties + SbxVariable* p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Bold") ), SbxCLASS_PROPERTY, SbxVARIANT ); + p->SetFlags( SBX_READWRITE | SBX_DONTSTORE ); + p->SetUserData( ATTR_IMP_BOLD ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Italic") ), SbxCLASS_PROPERTY, SbxVARIANT ); + p->SetFlags( SBX_READWRITE | SBX_DONTSTORE ); + p->SetUserData( ATTR_IMP_ITALIC ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("StrikeThrough") ), SbxCLASS_PROPERTY, SbxVARIANT ); + p->SetFlags( SBX_READWRITE | SBX_DONTSTORE ); + p->SetUserData( ATTR_IMP_STRIKETHROUGH ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Underline") ), SbxCLASS_PROPERTY, SbxVARIANT ); + p->SetFlags( SBX_READWRITE | SBX_DONTSTORE ); + p->SetUserData( ATTR_IMP_UNDERLINE ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Size") ), SbxCLASS_PROPERTY, SbxVARIANT ); + p->SetFlags( SBX_READWRITE | SBX_DONTSTORE ); + p->SetUserData( ATTR_IMP_SIZE ); + + // Name Property selbst verarbeiten + p = Find( String( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_PROPERTY ); + DBG_ASSERT( p, "Keine Name Property" ); + p->SetUserData( ATTR_IMP_NAME ); +} + +SbStdFont::~SbStdFont() +{ +} + + +SbxVariable* SbStdFont::Find( const String& rName, SbxClassType t ) +{ + // Bereits eingetragen? + return SbxObject::Find( rName, t ); +} + + + +void SbStdFont::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) +{ + const SbxHint* pHint = PTR_CAST( SbxHint, &rHint ); + + if( pHint ) + { + if( pHint->GetId() == SBX_HINT_INFOWANTED ) + { + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + return; + } + + SbxVariable* pVar = pHint->GetVar(); + SbxArray* pPar = pVar->GetParameters(); + USHORT nWhich = (USHORT)pVar->GetUserData(); + BOOL bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; + + // Propteries + switch( nWhich ) + { + case ATTR_IMP_BOLD: PropBold( pVar, pPar, bWrite ); return; + case ATTR_IMP_ITALIC: PropItalic( pVar, pPar, bWrite ); return; + case ATTR_IMP_STRIKETHROUGH:PropStrikeThrough( pVar, pPar, bWrite ); return; + case ATTR_IMP_UNDERLINE: PropUnderline( pVar, pPar, bWrite ); return; + case ATTR_IMP_SIZE: PropSize( pVar, pPar, bWrite ); return; + case ATTR_IMP_NAME: PropName( pVar, pPar, bWrite ); return; + } + + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + } +} + + +//----------------------------------------------------------------------------- +void SbStdClipboard::MethClear( SbxVariable*, SbxArray* pPar, BOOL ) +{ + if( pPar && (pPar->Count() > 1) ) + { + StarBASIC::Error( SbERR_BAD_NUMBER_OF_ARGS ); + return; + } + + Clipboard::Clear(); +} + +void SbStdClipboard::MethGetData( SbxVariable* pVar, SbxArray* pPar, BOOL ) +{ + if( !pPar || (pPar->Count() != 2) ) + { + StarBASIC::Error( SbERR_BAD_NUMBER_OF_ARGS ); + return; + } + + USHORT nFormat = pPar->Get(1)->GetInteger(); + if( !nFormat || nFormat > 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + if( nFormat == FORMAT_STRING ) + pVar->PutString( Clipboard::PasteString() ); + else + if( (nFormat == FORMAT_BITMAP) || + (nFormat == FORMAT_GDIMETAFILE ) ) + { + SbxObjectRef xPic = new SbStdPicture; + Graphic aGraph; + aGraph.Paste(); + ((SbStdPicture*)(SbxObject*)xPic)->SetGraphic( aGraph ); + pVar->PutObject( xPic ); + } +} + +void SbStdClipboard::MethGetFormat( SbxVariable* pVar, SbxArray* pPar, BOOL ) +{ + if( !pPar || (pPar->Count() != 2) ) + { + StarBASIC::Error( SbERR_BAD_NUMBER_OF_ARGS ); + return; + } + + USHORT nFormat = pPar->Get(1)->GetInteger(); + if( !nFormat || nFormat > 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + pVar->PutBool( Clipboard::HasFormat( nFormat ) ); +} + +void SbStdClipboard::MethGetText( SbxVariable* pVar, SbxArray* pPar, BOOL ) +{ + if( pPar && (pPar->Count() > 1) ) + { + StarBASIC::Error( SbERR_BAD_NUMBER_OF_ARGS ); + return; + } + + pVar->PutString( Clipboard::PasteString() ); +} + +void SbStdClipboard::MethSetData( SbxVariable* pVar, SbxArray* pPar, BOOL ) +{ + if( !pPar || (pPar->Count() != 3) ) + { + StarBASIC::Error( SbERR_BAD_NUMBER_OF_ARGS ); + return; + } + + USHORT nFormat = pPar->Get(2)->GetInteger(); + if( !nFormat || nFormat > 3 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return; + } + + if( nFormat == FORMAT_STRING ) + { + Clipboard::CopyString( pPar->Get(1)->GetString() ); + } + else + if( (nFormat == FORMAT_BITMAP) || + (nFormat == FORMAT_GDIMETAFILE) ) + { + SbxObject* pObj = (SbxObject*)pPar->Get(1)->GetObject(); + + if( pObj && pObj->IsA( TYPE( SbStdPicture ) ) ) + ((SbStdPicture*)(SbxObject*)pObj)->GetGraphic().Copy(); + } +} + +void SbStdClipboard::MethSetText( SbxVariable* pVar, SbxArray* pPar, BOOL ) +{ + if( !pPar || (pPar->Count() != 2) ) + { + StarBASIC::Error( SbERR_BAD_NUMBER_OF_ARGS ); + return; + } + + Clipboard::CopyString( pPar->Get(1)->GetString() ); +} + + +TYPEINIT1( SbStdClipboard, SbxObject ); + +SbStdClipboard::SbStdClipboard() : + SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Clipboard") ) ) +{ + // Name Property selbst verarbeiten + SbxVariable* p = Find( String( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_PROPERTY ); + DBG_ASSERT( p, "Keine Name Property" ); + p->SetUserData( ATTR_IMP_NAME ); + + //Methoden registrieren + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Clear") ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); + p->SetUserData( METH_CLEAR ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("GetData") ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); + p->SetUserData( METH_GETDATA ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("GetFormat") ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); + p->SetUserData( METH_GETFORMAT ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("GetText") ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); + p->SetUserData( METH_GETTEXT ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("SetData") ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); + p->SetUserData( METH_SETDATA ); + p = Make( String( RTL_CONSTASCII_USTRINGPARAM("SetText") ), SbxCLASS_METHOD, SbxEMPTY ); + p->SetFlag( SBX_DONTSTORE ); + p->SetUserData( METH_SETTEXT ); +} + +SbStdClipboard::~SbStdClipboard() +{ +} + + +SbxVariable* SbStdClipboard::Find( const String& rName, SbxClassType t ) +{ + // Bereits eingetragen? + return SbxObject::Find( rName, t ); +} + + + +void SbStdClipboard::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) +{ + const SbxHint* pHint = PTR_CAST( SbxHint, &rHint ); + + if( pHint ) + { + if( pHint->GetId() == SBX_HINT_INFOWANTED ) + { + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + return; + } + + SbxVariable* pVar = pHint->GetVar(); + SbxArray* pPar = pVar->GetParameters(); + USHORT nWhich = (USHORT)pVar->GetUserData(); + BOOL bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; + + // Methods + switch( nWhich ) + { + case METH_CLEAR: MethClear( pVar, pPar, bWrite ); return; + case METH_GETDATA: MethGetData( pVar, pPar, bWrite ); return; + case METH_GETFORMAT: MethGetFormat( pVar, pPar, bWrite ); return; + case METH_GETTEXT: MethGetText( pVar, pPar, bWrite ); return; + case METH_SETDATA: MethSetData( pVar, pPar, bWrite ); return; + case METH_SETTEXT: MethSetText( pVar, pPar, bWrite ); return; + } + + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + } +} + + diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx new file mode 100644 index 000000000000..2b848e97a2d4 --- /dev/null +++ b/basic/source/runtime/step0.cxx @@ -0,0 +1,799 @@ +/************************************************************************* + * + * $RCSfile: step0.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _SV_MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _FSYS_HXX //autogen +#include <tools/fsys.hxx> +#endif + +#include <svtools/sbx.hxx> +#include "runtime.hxx" +#pragma hdrstop +#include "sbintern.hxx" +#include "iosys.hxx" +#include <sb.hrc> +#include <basrid.hxx> +#include "sbunoobj.hxx" +#include <com/sun/star/uno/Any.hxx> + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + +void SbiRuntime::StepNOP() +{} + +void SbiRuntime::StepArith( SbxOperator eOp ) +{ + SbxVariableRef p1 = PopVar(); + TOSMakeTemp(); + SbxVariable* p2 = GetTOS(); + p2->ResetFlag( SBX_FIXED ); + p2->Compute( eOp, *p1 ); +} + +void SbiRuntime::StepUnary( SbxOperator eOp ) +{ + TOSMakeTemp(); + SbxVariable* p = GetTOS(); + p->Compute( eOp, *p ); +} + +void SbiRuntime::StepCompare( SbxOperator eOp ) +{ + SbxVariableRef p1 = PopVar(); + SbxVariableRef p2 = PopVar(); +#ifndef WIN + static SbxVariable* pTRUE = NULL; + static SbxVariable* pFALSE = NULL; + + if( p2->Compare( eOp, *p1 ) ) + { + if( !pTRUE ) + { + pTRUE = new SbxVariable; + pTRUE->PutBool( TRUE ); + pTRUE->AddRef(); + } + PushVar( pTRUE ); + } + else + { + if( !pFALSE ) + { + pFALSE = new SbxVariable; + pFALSE->PutBool( FALSE ); + pFALSE->AddRef(); + } + PushVar( pFALSE ); + } +#else + BOOL bRes = p2->Compare( eOp, *p1 ); + SbxVariable* pRes = new SbxVariable; + pRes->PutBool( bRes ); + PushVar( pRes ); +#endif +} + +void SbiRuntime::StepEXP() { StepArith( SbxEXP ); } +void SbiRuntime::StepMUL() { StepArith( SbxMUL ); } +void SbiRuntime::StepDIV() { StepArith( SbxDIV ); } +void SbiRuntime::StepIDIV() { StepArith( SbxIDIV ); } +void SbiRuntime::StepMOD() { StepArith( SbxMOD ); } +void SbiRuntime::StepPLUS() { StepArith( SbxPLUS ); } +void SbiRuntime::StepMINUS() { StepArith( SbxMINUS ); } +void SbiRuntime::StepCAT() { StepArith( SbxCAT ); } +void SbiRuntime::StepAND() { StepArith( SbxAND ); } +void SbiRuntime::StepOR() { StepArith( SbxOR ); } +void SbiRuntime::StepXOR() { StepArith( SbxXOR ); } +void SbiRuntime::StepEQV() { StepArith( SbxEQV ); } +void SbiRuntime::StepIMP() { StepArith( SbxIMP ); } + +void SbiRuntime::StepNEG() { StepUnary( SbxNEG ); } +void SbiRuntime::StepNOT() { StepUnary( SbxNOT ); } + +void SbiRuntime::StepEQ() { StepCompare( SbxEQ ); } +void SbiRuntime::StepNE() { StepCompare( SbxNE ); } +void SbiRuntime::StepLT() { StepCompare( SbxLT ); } +void SbiRuntime::StepGT() { StepCompare( SbxGT ); } +void SbiRuntime::StepLE() { StepCompare( SbxLE ); } +void SbiRuntime::StepGE() { StepCompare( SbxGE ); } + +void SbiRuntime::StepLIKE() +{ + StarBASIC::FatalError( SbERR_NOT_IMPLEMENTED ); +} + +// TOS und TOS-1 sind beides Objektvariable und enthalten den selben Pointer + +void SbiRuntime::StepIS() +{ + SbxVariableRef refVar1 = PopVar(); + SbxVariableRef refVar2 = PopVar(); + BOOL bRes = BOOL( + refVar1->GetType() == SbxOBJECT + && refVar2->GetType() == SbxOBJECT + && refVar1->GetObject() == refVar2->GetObject() ); + SbxVariable* pRes = new SbxVariable; + pRes->PutBool( bRes ); + PushVar( pRes ); +} + +// Aktualisieren des Wertes von TOS + +void SbiRuntime::StepGET() +{ + SbxVariable* p = GetTOS(); + p->Broadcast( SBX_HINT_DATAWANTED ); +} + +// #67607 Uno-Structs kopieren +inline void checkUnoStructCopy( SbxVariableRef& refVal, SbxVariableRef& refVar ) +{ + SbxDataType eVarType = refVar->GetType(); + if( eVarType == SbxOBJECT ) + { + SbxObjectRef xVarObj = (SbxObject*)refVar->GetObject(); + SbxDataType eValType = refVal->GetType(); + if( eValType == SbxOBJECT && xVarObj == refVal->GetObject() ) + { + SbUnoObject* pUnoObj = PTR_CAST(SbUnoObject,(SbxObject*)xVarObj); + if( pUnoObj ) + { + Any aAny = pUnoObj->getUnoAny(); + if( aAny.getValueType().getTypeClass() == TypeClass_STRUCT ) + { + SbUnoObject* pNewUnoObj = new SbUnoObject( pUnoObj->GetName(), aAny ); + // #70324: ClassName uebernehmen + pNewUnoObj->SetClassName( pUnoObj->GetClassName() ); + refVar->PutObject( pNewUnoObj ); + } + } + } + } +} + +// Ablage von TOS in TOS-1 + +void SbiRuntime::StepPUT() +{ + SbxVariableRef refVal = PopVar(); + SbxVariableRef refVar = PopVar(); + // Store auf die eigene Methode (innerhalb einer Function)? + BOOL bFlagsChanged = FALSE; + USHORT n; + if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) + { + bFlagsChanged = TRUE; + n = refVar->GetFlags(); + refVar->SetFlag( SBX_WRITE ); + } + *refVar = *refVal; + // #67607 Uno-Structs kopieren + checkUnoStructCopy( refVal, refVar ); + if( bFlagsChanged ) + refVar->SetFlags( n ); +} + + +// Speichern Objektvariable +// Nicht-Objekt-Variable fuehren zu Fehlern + +void SbiRuntime::StepSET() +{ + SbxVariableRef refVal = PopVar(); + SbxVariableRef refVar = PopVar(); + // #67733 Typen mit Array-Flag sind auch ok + SbxDataType eValType = refVal->GetType(); + SbxDataType eVarType = refVar->GetType(); + if( (eValType != SbxOBJECT && eValType != SbxEMPTY && !(eValType & SbxARRAY)) || + (eVarType != SbxOBJECT && !(eVarType & SbxARRAY) ) ) + { + Error( SbERR_INVALID_USAGE_OBJECT ); + } + else + { + // Auf refVal GetObject fuer Collections ausloesen + SbxBase* pObjVarObj = refVal->GetObject(); + if( pObjVarObj ) + { + SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj); + + // #67733 Typen mit Array-Flag sind auch ok + if( refObjVal ) + refVal = refObjVal; + else if( !(eValType & SbxARRAY) ) + refVal = NULL; + } + + // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als + // Object deklarierten Variable zugewiesen werden, kann hier + // refVal ungueltig sein! + if( !refVal ) + { + Error( SbERR_INVALID_USAGE_OBJECT ); + } + else + { + // Store auf die eigene Methode (innerhalb einer Function)? + BOOL bFlagsChanged = FALSE; + USHORT n; + if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) + { + bFlagsChanged = TRUE; + n = refVar->GetFlags(); + refVar->SetFlag( SBX_WRITE ); + } + *refVar = *refVal; + // #67607 Uno-Structs kopieren + checkUnoStructCopy( refVal, refVar ); + if( bFlagsChanged ) + refVar->SetFlags( n ); + } + } +} + +// JSM 07.10.95 +void SbiRuntime::StepLSET() +{ + SbxVariableRef refVal = PopVar(); + SbxVariableRef refVar = PopVar(); + if( refVar->GetType() != SbxSTRING + || refVal->GetType() != SbxSTRING ) + Error( SbERR_INVALID_USAGE_OBJECT ); + else + { + // Store auf die eigene Methode (innerhalb einer Function)? + USHORT n = refVar->GetFlags(); + if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) + refVar->SetFlag( SBX_WRITE ); + String aRefVarString = refVar->GetString(); + String aRefValString = refVal->GetString(); + + if (aRefVarString.Len() > aRefValString.Len()) + aRefVarString.Fill(aRefVarString.Len(),' '); + aRefVarString = aRefValString.Copy( 0, aRefVarString.Len() ); + aRefVarString += aRefVarString.Copy( aRefValString.Len() ); + refVar->PutString(aRefVarString); + + refVar->SetFlags( n ); + } +} + +// JSM 07.10.95 +void SbiRuntime::StepRSET() +{ + SbxVariableRef refVal = PopVar(); + SbxVariableRef refVar = PopVar(); + if( refVar->GetType() != SbxSTRING + || refVal->GetType() != SbxSTRING ) + Error( SbERR_INVALID_USAGE_OBJECT ); + else + { + // Store auf die eigene Methode (innerhalb einer Function)? + USHORT n = refVar->GetFlags(); + if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) + refVar->SetFlag( SBX_WRITE ); + String aRefVarString = refVar->GetString(); + String aRefValString = refVal->GetString(); + + USHORT nPos = 0; + if (aRefVarString.Len() > aRefValString.Len()) + { + aRefVarString.Fill(aRefVarString.Len(),' '); + nPos = aRefVarString.Len() - aRefValString.Len(); + } + aRefVarString = aRefVarString.Copy( 0, nPos ); + aRefVarString += aRefValString.Copy( 0, aRefVarString.Len() - nPos ); + refVar->PutString(aRefVarString); + + refVar->SetFlags( n ); + } +} + +// Ablage von TOS in TOS-1, dann ReadOnly-Bit setzen + +void SbiRuntime::StepPUTC() +{ + SbxVariableRef refVal = PopVar(); + SbxVariableRef refVar = PopVar(); + refVar->SetFlag( SBX_WRITE ); + *refVar = *refVal; + refVar->ResetFlag( SBX_WRITE ); + refVar->SetFlag( SBX_CONST ); +} + +// DIM +// TOS = Variable fuer das Array mit Dimensionsangaben als Parameter + +void SbiRuntime::StepDIM() +{ + SbxVariableRef refVar = PopVar(); + DimImpl( refVar ); +} + +// #56204 DIM-Funktionalitaet in Hilfsmethode auslagern (step0.cxx) +void SbiRuntime::DimImpl( SbxVariableRef refVar ) +{ + SbxArray* pDims = refVar->GetParameters(); + // Muss eine gerade Anzahl Argumente haben + // Man denke daran, dass Arg[0] nicht zaehlt! + if( pDims && !( pDims->Count() & 1 ) ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + else + { + SbxDataType eType = refVar->IsFixed() ? refVar->GetType() : SbxVARIANT; + SbxDimArray* pArray = new SbxDimArray( eType ); + // AB 2.4.1996, auch Arrays ohne Dimensionsangaben zulassen (VB-komp.) + if( pDims ) + { + for( USHORT i = 1; i < pDims->Count(); ) + { + INT16 lb = pDims->Get( i++ )->GetInteger(); + INT16 ub = pDims->Get( i++ )->GetInteger(); + if( ub < lb ) + Error( SbERR_OUT_OF_RANGE ), ub = lb; + pArray->AddDim( lb, ub ); + } + } + else + { + // #62867 Beim Anlegen eines Arrays der Laenge 0 wie bei + // Uno-Sequences der Laenge 0 eine Dimension anlegen + pArray->unoAddDim( 0, -1 ); + } + USHORT nFlags = refVar->GetFlags(); + refVar->ResetFlag( SBX_FIXED ); + refVar->PutObject( pArray ); + refVar->SetFlags( nFlags ); + refVar->SetParameters( NULL ); + } +} + + +// REDIM +// TOS = Variable fuer das Array +// argv = Dimensionsangaben + +void SbiRuntime::StepREDIM() +{ + // Im Moment ist es nichts anderes als Dim, da doppeltes Dim + // bereits vom Compiler erkannt wird. + StepDIM(); +} + +// REDIM PRESERVE +// TOS = Variable fuer das Array +// argv = Dimensionsangaben + +void SbiRuntime::StepREDIMP() +{ + StarBASIC::FatalError( SbERR_NOT_IMPLEMENTED ); +} + +// Variable loeschen +// TOS = Variable + +void SbiRuntime::StepERASE() +{ + SbxVariableRef refVar = PopVar(); + SbxDataType eType = refVar->GetType(); + if( eType & SbxARRAY ) + { + // AB 2.4.1996 + // Arrays haben bei Erase nach VB ein recht komplexes Verhalten. Hier + // werden zunaechst nur die Typ-Probleme bei REDIM (#26295) beseitigt: + // Typ hart auf den Array-Typ setzen, da eine Variable mit Array + // SbxOBJECT ist. Bei REDIM entsteht dann ein SbxOBJECT-Array und + // der ursruengliche Typ geht verloren -> Laufzeitfehler + USHORT nFlags = refVar->GetFlags(); + refVar->ResetFlag( SBX_FIXED ); + refVar->SetType( SbxDataType(eType & 0x0FFF) ); + refVar->SetFlags( nFlags ); + refVar->Clear(); + } + else + if( refVar->IsFixed() ) + refVar->Clear(); + else + refVar->SetType( SbxEMPTY ); +} + +// Einrichten eines Argvs +// nOp1 bleibt so -> 1. Element ist Returnwert + +void SbiRuntime::StepARGC() +{ + PushArgv(); + refArgv = new SbxArray; + nArgc = 1; +} + +// Speichern eines Arguments in Argv + +void SbiRuntime::StepARGV() +{ + if( !refArgv ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + else + { + SbxVariableRef pVal = PopVar(); + if( pVal->ISA(SbxMethod) || pVal->ISA(SbxProperty) ) + { + // Methoden und Properties evaluieren! + SbxVariable* pRes = new SbxVariable( *pVal ); + pVal = pRes; + } + refArgv->Put( pVal, nArgc++ ); + } +} + +// Input to Variable. Die Variable ist auf TOS und wird +// anschliessend entfernt. + +void SbiRuntime::StepINPUT() +{ + String s; + char ch; + SbError err; + // Skip whitespace + while( ( err = pIosys->GetError() ) == 0 ) + { + ch = pIosys->Read(); + if( ch != ' ' && ch != '\t' && ch != '\n' ) + break; + } + if( !err ) + { + // Scan until comma or whitespace + char sep = ( ch == '"' ) ? ch : 0; + if( sep ) ch = pIosys->Read(); + while( ( err = pIosys->GetError() ) == 0 ) + { + if( ch == sep ) + { + ch = pIosys->Read(); + if( ch != sep ) + break; + } + else if( !sep && (ch == ',' || ch == '\n') ) + break; + s += ch; + ch = pIosys->Read(); + } + // skip whitespace + if( ch == ' ' || ch == '\t' ) + while( ( err = pIosys->GetError() ) == 0 ) + { + if( ch != ' ' && ch != '\t' && ch != '\n' ) + break; + ch = pIosys->Read(); + } + } + if( !err ) + { + SbxVariableRef pVar = GetTOS(); + // Zuerst versuchen, die Variable mit einem numerischen Wert + // zu fuellen, dann mit einem Stringwert + BOOL bSet = FALSE; + if( !pVar->IsFixed() || pVar->IsNumeric() ) + { + USHORT nLen = 0; + if( !pVar->Scan( s, &nLen ) ) + { + err = SbxBase::GetError(); + SbxBase::ResetError(); + } + // Der Wert muss komplett eingescant werden + else if( nLen != s.Len() && !pVar->PutString( s ) ) + { + err = SbxBase::GetError(); + SbxBase::ResetError(); + } + else if( nLen != s.Len() && pVar->IsNumeric() ) + { + err = SbxBase::GetError(); + SbxBase::ResetError(); + if( !err ) + err = SbERR_CONVERSION; + } + } + else + { + pVar->PutString( s ); + err = SbxBase::GetError(); + SbxBase::ResetError(); + } + } + if( err == SbERR_USER_ABORT ) + Error( err ); + else if( err ) + { + if( pRestart && !pIosys->GetChannel() ) + { + BasicResId aId( IDS_SBERR_START + 4 ); + String aMsg( aId ); + ErrorBox( NULL, WB_OK, aMsg ).Execute(); + pCode = pRestart; + } + else + Error( err ); + } + else + { + // pIosys->ResetChannel(); + PopVar(); + } +} + +// Line Input to Variable. Die Variable ist auf TOS und wird +// anschliessend entfernt. + +void SbiRuntime::StepLINPUT() +{ + ByteString aInput; + pIosys->Read( aInput ); + Error( pIosys->GetError() ); + SbxVariableRef p = PopVar(); + p->PutString( String( aInput, gsl_getSystemTextEncoding() ) ); + // pIosys->ResetChannel(); +} + +// Programmende + +void SbiRuntime::StepSTOP() +{ + pInst->Stop(); +} + +// FOR-Variable initialisieren + +void SbiRuntime::StepINITFOR() +{ + PushFor(); +} + +// FOR-Variable inkrementieren + +void SbiRuntime::StepNEXT() +{ + if( !pForStk ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + else + pForStk->refVar->Compute( SbxPLUS, *pForStk->refInc ); +} + +// Anfang CASE: TOS in CASE-Stack + +void SbiRuntime::StepCASE() +{ + if( !refCaseStk.Is() ) + refCaseStk = new SbxArray; + SbxVariableRef xVar = PopVar(); + refCaseStk->Put( xVar, refCaseStk->Count() ); +} + +// Ende CASE: Variable freigeben + +void SbiRuntime::StepENDCASE() +{ + if( !refCaseStk || !refCaseStk->Count() ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + else + refCaseStk->Remove( refCaseStk->Count() - 1 ); +} + +// Standard-Fehlerbehandlung + +void SbiRuntime::StepSTDERROR() +{ + pError = NULL; bError = TRUE; + pInst->aErrorMsg = String(); + pInst->nErr = 0L; + pInst->nErl = 0; + nError = 0L; +} + +void SbiRuntime::StepNOERROR() +{ + pInst->aErrorMsg = String(); + pInst->nErr = 0L; + pInst->nErl = 0; + nError = 0L; + bError = FALSE; +} + +// UP verlassen + +void SbiRuntime::StepLEAVE() +{ + bRun = FALSE; +} + +void SbiRuntime::StepCHANNEL() // TOS = Kanalnummer +{ + SbxVariableRef pChan = PopVar(); + short nChan = pChan->GetInteger(); + pIosys->SetChannel( nChan ); + Error( pIosys->GetError() ); +} + +void SbiRuntime::StepCHANNEL0() +{ + pIosys->ResetChannel(); +} + +void SbiRuntime::StepPRINT() // print TOS +{ + SbxVariableRef p = PopVar(); + String s1 = p->GetString(); + String s; + if( p->GetType() >= SbxINTEGER && p->GetType() <= SbxDOUBLE ) + s = ' '; // ein Blank davor + s += s1; + ByteString aByteStr( s, gsl_getSystemTextEncoding() ); + pIosys->Write( aByteStr ); + Error( pIosys->GetError() ); +} + +void SbiRuntime::StepPRINTF() // print TOS in field +{ + SbxVariableRef p = PopVar(); + String s1 = p->GetString(); + String s; + if( p->GetType() >= SbxINTEGER && p->GetType() <= SbxDOUBLE ) + s = ' '; // ein Blank davor + s += s1; + s.Expand( 14, ' ' ); + ByteString aByteStr( s, gsl_getSystemTextEncoding() ); + pIosys->Write( aByteStr ); + Error( pIosys->GetError() ); +} + +void SbiRuntime::StepWRITE() // write TOS +{ + SbxVariableRef p = PopVar(); + // Muss der String gekapselt werden? + char ch = 0; + switch (p->GetType() ) + { + case SbxSTRING: ch = '"'; break; + case SbxCURRENCY: + case SbxBOOL: + case SbxDATE: ch = '#'; break; + } + String s; + if( ch ) + s += ch; + s += p->GetString(); + if( ch ) + s += ch; + ByteString aByteStr( s, gsl_getSystemTextEncoding() ); + pIosys->Write( aByteStr ); + Error( pIosys->GetError() ); +} + +void SbiRuntime::StepRENAME() // Rename Tos+1 to Tos +{ + SbxVariableRef pTos1 = PopVar(); + SbxVariableRef pTos = PopVar(); + String aDest = pTos1->GetString(); + String aSource = pTos->GetString(); + + // <-- UCB + if( hasUno() ) + { + implStepRenameUCB( aSource, aDest ); + } + else + // --> UCB + { + DirEntry aSourceDirEntry( aSource ); + if( aSourceDirEntry.Exists() ) + { + if( aSourceDirEntry.MoveTo( DirEntry(aDest) ) != FSYS_ERR_OK ) + StarBASIC::Error( SbERR_PATH_NOT_FOUND ); + } + else + StarBASIC::Error( SbERR_PATH_NOT_FOUND ); + } +} + +// TOS = Prompt + +void SbiRuntime::StepPROMPT() +{ + SbxVariableRef p = PopVar(); + ByteString aStr( p->GetString(), gsl_getSystemTextEncoding() ); + pIosys->SetPrompt( aStr ); +} + +// Set Restart point + +void SbiRuntime::StepRESTART() +{ + pRestart = pCode; +} + +// Leerer Ausdruck auf Stack fuer fehlenden Parameter + +void SbiRuntime::StepEMPTY() +{ + // #57915 Die Semantik von StepEMPTY() ist die Repraesentation eines fehlenden + // Arguments. Dies wird in VB durch ein durch den Wert 448 (SbERR_NAMED_NOT_FOUND) + // vom Typ Error repraesentiert. StepEmpty jetzt muesste besser StepMISSING() + // heissen, aber der Name wird der Einfachkeit halber beibehalten. + SbxVariableRef xVar = new SbxVariable( SbxVARIANT ); + xVar->PutErr( 448 ); + PushVar( xVar ); + // ALT: PushVar( new SbxVariable( SbxEMPTY ) ); +} + +// TOS = Fehlercode + +void SbiRuntime::StepERROR() +{ + SbxVariableRef refCode = PopVar(); + ULONG n = refCode->GetLong(); + Error( n ); +} + diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx new file mode 100644 index 000000000000..9196e5df0fa0 --- /dev/null +++ b/basic/source/runtime/step1.cxx @@ -0,0 +1,423 @@ +/************************************************************************* + * + * $RCSfile: step1.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <stdlib.h> +#include <svtools/sbx.hxx> +#ifndef _TOOLS_SOLMATH_HXX //autogen wg. SolarMath +#include <tools/solmath.hxx> +#endif +#ifndef _TOOLS_INTN_HXX //autogen wg. International +#include <tools/intn.hxx> +#endif +#include "runtime.hxx" +#pragma hdrstop +#include "sbintern.hxx" +#include "iosys.hxx" +#include "image.hxx" + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + +// Laden einer numerischen Konstanten (+ID) + +void SbiRuntime::StepLOADNC( USHORT nOp1 ) +{ + static International aEnglischIntn( LANGUAGE_ENGLISH_US, LANGUAGE_ENGLISH_US ); + + SbxVariable* p = new SbxVariable( SbxDOUBLE ); + + // #57844 Lokalisierte Funktion benutzen + int nErrno; + String aStr = pImg->GetString( nOp1 ); + // Auch , zulassen !!! + USHORT iComma = aStr.Search( ',' ); + if( iComma != STRING_NOTFOUND ) + { + String aStr1 = aStr.Copy( 0, iComma ); + String aStr2 = aStr.Copy( iComma + 1 ); + aStr = aStr1; + aStr += '.'; + aStr += aStr2; + } + double n = SolarMath::StringToDouble( aStr.GetBuffer(), aEnglischIntn, nErrno ); + //ALT: double n = atof( pImg->GetString( nOp1 ) ); + + p->PutDouble( n ); + PushVar( p ); +} + +// Laden einer Stringkonstanten (+ID) + +void SbiRuntime::StepLOADSC( USHORT nOp1 ) +{ + SbxVariable* p = new SbxVariable; + p->PutString( pImg->GetString( nOp1 ) ); + PushVar( p ); +} + +// Immediate Load (+Wert) + +void SbiRuntime::StepLOADI( USHORT nOp1 ) +{ + SbxVariable* p = new SbxVariable; + p->PutInteger( nOp1 ); + PushVar( p ); +} + +// Speichern eines named Arguments in Argv (+Arg-Nr ab 1!) + +void SbiRuntime::StepARGN( USHORT nOp1 ) +{ + if( !refArgv ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + else + { + String aAlias( pImg->GetString( nOp1 ) ); + SbxVariableRef pVal = PopVar(); + refArgv->Put( pVal, nArgc ); + refArgv->PutAlias( aAlias, nArgc++ ); + } +} + +// Konvertierung des Typs eines Arguments in Argv fuer DECLARE-Fkt. (+Typ) + +void SbiRuntime::StepARGTYP( USHORT nOp1 ) +{ + if( !refArgv ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + else + { + BOOL bByVal = (nOp1 & 0x8000) != 0; // Ist BYVAL verlangt? + SbxDataType t = (SbxDataType) (nOp1 & 0x7FFF); + SbxVariable* pVar = refArgv->Get( refArgv->Count() - 1 ); // letztes Arg + + // BYVAL prfen + if( pVar->GetRefCount() > 2 ) // 2 ist normal fr BYVAL + { + // Parameter ist eine Referenz + if( bByVal ) + { + // Call by Value ist verlangt -> Kopie anlegen + pVar = new SbxVariable( *pVar ); + pVar->SetFlag( SBX_READWRITE ); + refExprStk->Put( pVar, refArgv->Count() - 1 ); + } + else + pVar->SetFlag( SBX_REFERENCE ); // Ref-Flag fr DllMgr + } + else + { + // Parameter ist KEINE Referenz + if( bByVal ) + pVar->ResetFlag( SBX_REFERENCE ); // Keine Referenz -> OK + else + Error( SbERR_BAD_PARAMETERS ); // Referenz verlangt + } + + if( pVar->GetType() != t ) + { + // Variant, damit richtige Konvertierung + // Ausserdem Fehler, wenn SbxBYREF + pVar->Convert( SbxVARIANT ); + pVar->Convert( t ); + } + } +} + +// String auf feste Laenge bringen (+Laenge) + +void SbiRuntime::StepPAD( USHORT nOp1 ) +{ + SbxVariable* p = GetTOS(); + String& s = (String&)(const String&) *p; + if( s.Len() > nOp1 ) + s.Erase( nOp1 ); + else + s.Expand( nOp1, ' ' ); +} + +// Sprung (+Target) + +void SbiRuntime::StepJUMP( USHORT nOp1 ) +{ +#ifndef PRODUCT + if( nOp1 >= pImg->GetCodeSize() ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); +#endif + pCode = (const BYTE*) pImg->GetCode() + nOp1; +} + +// TOS auswerten, bedingter Sprung (+Target) + +void SbiRuntime::StepJUMPT( USHORT nOp1 ) +{ + SbxVariableRef p = PopVar(); + if( p->GetBool() ) + StepJUMP( nOp1 ); +} + +// TOS auswerten, bedingter Sprung (+Target) + +void SbiRuntime::StepJUMPF( USHORT nOp1 ) +{ + SbxVariableRef p = PopVar(); + if( !p->GetBool() ) + StepJUMP( nOp1 ); +} + +// TOS auswerten, Sprung in JUMP-Tabelle (+MaxVal) +// Sieht so aus: +// ONJUMP 2 +// JUMP target1 +// JUMP target2 +// ... +//Falls im Operanden 0x8000 gesetzt ist, Returnadresse pushen (ON..GOSUB) + +void SbiRuntime::StepONJUMP( USHORT nOp1 ) +{ + SbxVariableRef p = PopVar(); + INT16 n = p->GetInteger(); + if( nOp1 & 0x8000 ) + { + nOp1 &= 0x7FFF; + PushGosub( pCode + 3 * nOp1 ); + } + if( n < 1 || n > (short) nOp1 ) + n = nOp1 + 1; + nOp1 = (USHORT) ( (const char*) pCode - pImg->GetCode() ) + 3 * --n; + StepJUMP( nOp1 ); +} + +// UP-Aufruf (+Target) + +void SbiRuntime::StepGOSUB( USHORT nOp1 ) +{ + PushGosub( pCode ); + if( nOp1 >= pImg->GetCodeSize() ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + pCode = (const BYTE*) pImg->GetCode() + nOp1; +} + +// UP-Return (+0 oder Target) + +void SbiRuntime::StepRETURN( USHORT nOp1 ) +{ + PopGosub(); + if( nOp1 ) + StepJUMP( nOp1 ); +} + +// FOR-Variable testen (+Endlabel) + +void SbiRuntime::StepTESTFOR( USHORT nOp1 ) +{ + if( !pForStk ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + else + { + SbxOperator eOp = ( pForStk->refInc->GetDouble() < 0 ) ? SbxLT : SbxGT; + if( pForStk->refVar->Compare( eOp, *pForStk->refEnd ) ) + { + PopFor(); + StepJUMP( nOp1 ); + } + } +} + +// Tos+1 <= Tos+2 <= Tos, 2xremove (+Target) + +void SbiRuntime::StepCASETO( USHORT nOp1 ) +{ + if( !refCaseStk || !refCaseStk->Count() ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + else + { + SbxVariableRef xTo = PopVar(); + SbxVariableRef xFrom = PopVar(); + SbxVariableRef xCase = refCaseStk->Get( refCaseStk->Count() - 1 ); + if( *xCase >= *xFrom && *xCase <= *xTo ) + StepJUMP( nOp1 ); + } +} + +// Fehler-Handler + +void SbiRuntime::StepERRHDL( USHORT nOp1 ) +{ + const BYTE* p = pCode; + StepJUMP( nOp1 ); + pError = pCode; + pCode = p; + pInst->aErrorMsg = String(); + pInst->nErr = + pInst->nErl = + nError = 0; +} + +// Resume nach Fehlern (+0=statement, 1=next or Label) + +void SbiRuntime::StepRESUME( USHORT nOp1 ) +{ + // AB #32714 Resume ohne Error? -> Fehler + if( !bInError ) + { + Error( SbERR_BAD_RESUME ); + return; + } + if( nOp1 ) + { + // Code-Zeiger auf naechstes Statement setzen + USHORT n1, n2; + pCode = pMod->FindNextStmnt( pErrCode, n1, n2 ); + } + else + pCode = pErrStmnt; + + if( nOp1 > 1 ) + StepJUMP( nOp1 ); + pInst->aErrorMsg = String(); + pInst->nErr = + pInst->nErl = + nError = 0; + bInError = FALSE; + + // Error-Stack loeschen + SbErrorStack*& rErrStack = GetSbData()->pErrStack; + delete rErrStack; + rErrStack = NULL; +} + +// Kanal schliessen (+Kanal, 0=Alle) +void SbiRuntime::StepCLOSE( USHORT nOp1 ) +{ + short err; + if( !nOp1 ) + pIosys->Shutdown(); + else + { + err = pIosys->GetError(); + if( !err ) + { + pIosys->Close(); + } + } + err = pIosys->GetError(); + Error( err ); +} + +// Zeichen ausgeben (+char) + +void SbiRuntime::StepPRCHAR( USHORT nOp1 ) +{ + ByteString s( (char) nOp1 ); + pIosys->Write( s ); + Error( pIosys->GetError() ); +} + +// Check, ob TOS eine bestimmte Objektklasse ist (+StringID) + +void SbiRuntime::StepCLASS( USHORT nOp1 ) +{ + String aClass( pImg->GetString( nOp1 ) ); + SbxVariable* pVar = GetTOS(); + if( pVar->GetType() != SbxOBJECT ) + Error( SbERR_NEEDS_OBJECT ); + else + { + SbxObject* pObj; + if( pVar->IsA( TYPE(SbxObject) ) ) + pObj = (SbxObject*) pVar; + else + { + pObj = (SbxObject*) pVar->GetObject(); + if( pObj && !pObj->IsA( TYPE(SbxObject) ) ) + pObj = NULL; + } + if( !pObj || !pObj->IsClass( aClass ) ) + Error( SbERR_INVALID_USAGE_OBJECT ); + } +} + +// Library fuer anschliessenden Declare-Call definieren + +void SbiRuntime::StepLIB( USHORT nOp1 ) +{ + aLibName = pImg->GetString( nOp1 ); +} + +// TOS wird um BASE erhoeht, BASE davor gepusht (+BASE) +// Dieser Opcode wird vor DIM/REDIM-Anweisungen gepusht, +// wenn nur ein Index angegeben wurde. + +void SbiRuntime::StepBASED( USHORT nOp1 ) +{ + SbxVariable* p1 = new SbxVariable; + SbxVariableRef x2 = PopVar(); + p1->PutInteger( nOp1 ); + x2->Compute( SbxPLUS, *p1 ); + PushVar( x2 ); // erst die Expr + PushVar( p1 ); // dann die Base +} + + + + + diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx new file mode 100644 index 000000000000..34e03c96045c --- /dev/null +++ b/basic/source/runtime/step2.cxx @@ -0,0 +1,960 @@ +/************************************************************************* + * + * $RCSfile: step2.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ + +#include <svtools/sbxdef.hxx> +#include <svtools/sbx.hxx> +#include "runtime.hxx" +#pragma hdrstop +#include "iosys.hxx" +#include "image.hxx" +#include "sbintern.hxx" +#include "sbunoobj.hxx" +#include "opcodes.hxx" + +#include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/uno/Any.hxx> + +using namespace com::sun::star::container; +using namespace com::sun::star::lang; + + +#include "segmentc.hxx" +#pragma SW_SEGMENT_CLASS( SBRUNTIME, SBRUNTIME_CODE ) + + +/* +// #72488 Spezielle SbxVariable, die beim get das Verhalten +// einer nicht initialisierten Variable simuliert. Wenn als +// Typ SbxOBJECT verlangt wird, geht das jedoch nicht. +class UnoClassSbxVariable : public SbxVariable +{ + SbxDataType eOrgType; + BOOL bOverWritten; + const SbiImage* mpImg; + SbiRuntime* mpRuntime; + +public: + UnoClassSbxVariable( SbxDataType eType, const SbiImage* pImg_, SbiRuntime* pRuntime_ ) + : SbxVariable( SbxVARIANT ), mpImg( pImg_ ), mpRuntime( pRuntime_ ) + { + eOrgType = eType; + bOverWritten = FALSE; + } + + virtual BOOL Get( SbxValues& ) const; + virtual BOOL Put( const SbxValues& ); +}; +*/ + +BOOL UnoClassSbxVariable::Get( SbxValues& rRes ) const +{ + static SbxVariable* pDummy = new SbxVariable( SbxVARIANT ); + if( mbOverWritten || rRes.eType == SbxOBJECT || rRes.eType == SbxVARIANT ) + { + return SbxVariable::Get( rRes ); + } + if( mpImg->GetFlag( SBIMG_EXPLICIT ) ) + { + mpRuntime->Error( SbERR_VAR_UNDEFINED ); + return FALSE; + } + return pDummy->Get( rRes ); +} + +BOOL UnoClassSbxVariable::Put( const SbxValues& rRes ) +{ + // Sonst, falls keine Parameter sind, anderen Error Code verwenden + if( !mbOverWritten ) + { + if( mpImg->GetFlag( SBIMG_EXPLICIT ) ) + { + mpRuntime->Error( SbERR_VAR_UNDEFINED ); + return FALSE; + } + mbOverWritten = TRUE; + + SetType( meOrgType ); + if( meOrgType != SbxVARIANT ) + SetFlag( SBX_FIXED ); + } + return SbxVariable::Put( rRes ); +} + +TYPEINIT1(UnoClassSbxVariable,SbxVariable) + + +// Suchen eines Elements +// Die Bits im String-ID: +// 0x8000 - Argv ist belegt + +SbxVariable* SbiRuntime::FindElement + ( SbxObject* pObj, USHORT nOp1, USHORT nOp2, SbError nNotFound, BOOL bLocal ) +{ + SbxVariable* pElem = NULL; + if( !pObj ) + { + Error( SbERR_NO_OBJECT ); + pElem = new SbxVariable; + } + else + { + BOOL bFatalError = FALSE; + SbxDataType t = (SbxDataType) nOp2; + String aName( pImg->GetString( nOp1 & 0x7FFF ) ); + if( bLocal ) + pElem = refLocals->Find( aName, SbxCLASS_DONTCARE ); + if( !pElem ) + { + // Die RTL brauchen wir nicht mehr zu durchsuchen! + BOOL bSave = rBasic.bNoRtl; + rBasic.bNoRtl = TRUE; + pElem = pObj->Find( aName, SbxCLASS_DONTCARE ); + rBasic.bNoRtl = bSave; + + // Ist es ein globaler Uno-Bezeichner? + if( bLocal && !pElem ) + { + // #72382 VORSICHT! Liefert jetzt wegen unbekannten + // Modulen IMMER ein Ergebnis! + SbxVariable* pUnoClass = findUnoClass( aName ); + pElem = new UnoClassSbxVariable( t, pImg, this ); + SbxValues aRes( SbxOBJECT ); + aRes.pObj = pUnoClass; + pElem->SbxVariable::Put( aRes ); + //pElem->SbxVariable::PutObject( pUnoClass ); + + // #62939 Wenn eine Uno-Klasse gefunden wurde, muss + // das Wrapper-Objekt gehalten werden, da sonst auch + // die Uno-Klasse, z.B. "stardiv" immer wieder neu + // aus der Registry gelesen werden muss + //if( pElem ) + //{ + // #63774 Darf nicht mit gespeichert werden!!! + pElem->SetFlag( SBX_DONTSTORE ); + pElem->SetFlag( SBX_NO_MODIFY); + + // #72382 Lokal speichern, sonst werden alle implizit + // deklarierten Vars automatisch global ! + pElem->SetName( aName ); + refLocals->Put( pElem, refLocals->Count() ); + // OLD: rBasic.Insert( pElem ); + //} + } + + if( !pElem ) + { + // Nicht da und nicht im Objekt? + // Hat das Ding Parameter, nicht einrichten! + if( nOp1 & 0x8000 ) + bFatalError = TRUE; + // ALT: StarBASIC::FatalError( nNotFound ); + + // Sonst, falls keine Parameter sind, anderen Error Code verwenden + if( !bLocal || pImg->GetFlag( SBIMG_EXPLICIT ) ) + { + // #39108 Bei explizit und als ELEM immer ein Fatal Error + bFatalError = TRUE; + + // Falls keine Parameter sind, anderen Error Code verwenden + if( !( nOp1 & 0x8000 ) && nNotFound == SbERR_PROC_UNDEFINED ) + nNotFound = SbERR_VAR_UNDEFINED; + } + if( bFatalError ) + { + // #39108 Statt FatalError zu setzen, Dummy-Variable liefern + if( !xDummyVar.Is() ) + xDummyVar = new SbxVariable( SbxVARIANT ); + pElem = xDummyVar; + + // Parameter von Hand loeschen + ClearArgvStack(); + + // Normalen Error setzen + Error( nNotFound ); + } + else + { + // Sonst Variable neu anlegen + pElem = new SbxVariable( t ); + if( t != SbxVARIANT ) + pElem->SetFlag( SBX_FIXED ); + pElem->SetName( aName ); + refLocals->Put( pElem, refLocals->Count() ); + } + } + } + // #39108 Args koennen schon geloescht sein! + if( !bFatalError ) + SetupArgs( pElem, nOp1 ); + // Ein bestimmter Call-Type wurde gewuenscht, daher muessen + // wir hier den Typ setzen und das Ding anfassen, um den + // korrekten Returnwert zu erhalten! + if( pElem->IsA( TYPE(SbxMethod) ) ) + { + // Soll der Typ konvertiert werden? + SbxDataType t2 = pElem->GetType(); + BOOL bSet = FALSE; + if( !( pElem->GetFlags() & SBX_FIXED ) ) + { + if( t != SbxVARIANT && t != t2 && + t >= SbxINTEGER && t <= SbxSTRING ) + pElem->SetType( t ), bSet = TRUE; + } + // pElem auf eine Ref zuweisen, um ggf. eine Temp-Var zu loeschen + SbxVariableRef refTemp = pElem; + + // Moegliche Reste vom letzten Aufruf der SbxMethod beseitigen + // Vorher Schreiben freigeben, damit kein Error gesetzt wird. + USHORT nFlags = pElem->GetFlags(); + pElem->SetFlag( SBX_READWRITE | SBX_NO_BROADCAST ); + pElem->SbxValue::Clear(); + pElem->SetFlags( nFlags ); + + // Erst nach dem Setzen anfassen, da z.B. LEFT() + // den Unterschied zwischen Left$() und Left() kennen muss + + // AB 12.8.96: Da in PopVar() die Parameter von Methoden weggehauen + // werden, muessen wir hier explizit eine neue SbxMethod anlegen + SbxVariable* pNew = new SbxMethod( *((SbxMethod*)pElem) ); // das ist der Call! + //ALT: SbxVariable* pNew = new SbxVariable( *pElem ); // das ist der Call! + + pElem->SetParameters(0); // sonst bleibt Ref auf sich selbst + pNew->SetFlag( SBX_READWRITE ); + + // den Datentypen zuruecksetzen? + if( bSet ) + pElem->SetType( t2 ); + pElem = pNew; + } + // Index-Access bei UnoObjekten beruecksichtigen + /* + else if( pElem->ISA(SbUnoProperty) ) + { + // pElem auf eine Ref zuweisen, um ggf. eine Temp-Var zu loeschen + SbxVariableRef refTemp = pElem; + + // Variable kopieren und dabei den Notify aufloesen + SbxVariable* pNew = new SbxVariable( *((SbxVariable*)pElem) ); // das ist der Call! + pElem->SetParameters( NULL ); // sonst bleibt Ref auf sich selbst + pElem = pNew; + } + */ + } + return CheckArray( pElem ); +} + +// Find-Funktion ueber Name fuer aktuellen Scope (z.B. Abfrage aus BASIC-IDE) +SbxBase* SbiRuntime::FindElementExtern( const String& rName ) +{ + // Hinweis zu #35281#: Es darf nicht davon ausgegangen werden, dass + // pMeth != null, da im RunInit noch keine gesetzt ist. + + SbxVariable* pElem = NULL; + if( !pMod || !rName.Len() ) + return NULL; + + // Lokal suchen + if( refLocals ) + pElem = refLocals->Find( rName, SbxCLASS_DONTCARE ); + + // In Statics suchen + if ( !pElem && pMeth ) + { + // Bei Statics, Name der Methode davor setzen + String aMethName = pMeth->GetName(); + aMethName += ':'; + aMethName += rName; + pElem = pMod->Find(aMethName, SbxCLASS_DONTCARE); + } + + // In Parameter-Liste suchen + if( !pElem && pMeth ) + { + SbxInfo* pInfo = pMeth->GetInfo(); + if( pInfo && refParams ) + { + USHORT j = 1; + const SbxParamInfo* pParam = pInfo->GetParam( j ); + while( pParam ) + { + if( pParam->aName.EqualsIgnoreCaseAscii( rName ) ) + { + pElem = refParams->Get( j ); + break; + } + pParam = pInfo->GetParam( ++j ); + } + } + } + + // Im Modul suchen + if( !pElem ) + { + // RTL nicht durchsuchen! + BOOL bSave = rBasic.bNoRtl; + rBasic.bNoRtl = TRUE; + pElem = pMod->Find( rName, SbxCLASS_DONTCARE ); + rBasic.bNoRtl = bSave; + } + return pElem; +} + + +// Argumente eines Elements setzen +// Dabei auch die Argumente umsetzen, falls benannte Parameter +// verwendet wurden + +void SbiRuntime::SetupArgs( SbxVariable* p, USHORT nOp1 ) +{ + if( nOp1 & 0x8000 ) + { + if( !refArgv ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + BOOL bHasNamed = FALSE; + USHORT i; + for( i = 1; i < refArgv->Count(); i++ ) + { + if( refArgv->GetAlias( i ).Len() ) + { + bHasNamed = TRUE; break; + } + } + if( bHasNamed ) + { + // Wir haben mindestens einen benannten Parameter! + // Wir muessen also umsortieren + // Gibt es Parameter-Infos? + SbxInfo* pInfo = p->GetInfo(); + if( !pInfo ) + Error( SbERR_NO_NAMED_ARGS ); + else + { + USHORT nCurPar = 1; + SbxArray* pArg = new SbxArray; + for( i = 1; i < refArgv->Count(); i++ ) + { + SbxVariable* pVar = refArgv->Get( i ); + const String& rName = refArgv->GetAlias( i ); + if( rName.Len() ) + { + // nCurPar wird auf den gefundenen Parameter gesetzt + USHORT j = 1; + const SbxParamInfo* pParam = pInfo->GetParam( j ); + while( pParam ) + { + if( pParam->aName.EqualsIgnoreCaseAscii( rName ) ) + { + nCurPar = j; + break; + } + pParam = pInfo->GetParam( ++j ); + } + if( !pParam ) + { + Error( SbERR_NAMED_NOT_FOUND ); break; + } + } + pArg->Put( pVar, nCurPar++ ); + } + refArgv = pArg; + } + } + // Eigene Var als Parameter 0 + refArgv->Put( p, 0 ); + p->SetParameters( refArgv ); + PopArgv(); + } + else + p->SetParameters( NULL ); +} + +// Holen eines Array-Elements + +SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) +{ + // Falls wir ein Array haben, wollen wir bitte das Array-Element! + SbxArray* pPar; + if( pElem->GetType() & SbxARRAY ) + { + SbxBase* pElemObj = pElem->GetObject(); + SbxDimArray* pDimArray = PTR_CAST(SbxDimArray,pElemObj); + pPar = pElem->GetParameters(); + if( pDimArray ) + { + // Die Parameter koennen fehlen, wenn ein Array als + // Argument uebergeben wird. + if( pPar ) + pElem = pDimArray->Get( pPar ); + } + else + { + SbxArray* pArray = PTR_CAST(SbxArray,pElemObj); + if( pArray ) + { + if( !pPar ) + { + Error( SbERR_OUT_OF_RANGE ); + pElem = new SbxVariable; + } + else + pElem = pArray->Get( pPar->Get( 1 )->GetInteger() ); + } + } + + // #42940, 0.Parameter zu NULL setzen, damit sich Var nicht selbst haelt + if( pPar ) + pPar->Put( NULL, 0 ); + } + // Index-Access bei UnoObjekten beruecksichtigen + else if( pElem->GetType() == SbxOBJECT && !pElem->ISA(SbxMethod) && (pPar = pElem->GetParameters()) ) + { + // Ist es ein Uno-Objekt? + SbxBaseRef pObj = (SbxBase*)pElem->GetObject(); + if( pObj && pObj->ISA(SbUnoObject) ) + { + SbUnoObject* pUnoObj = (SbUnoObject*)(SbxBase*)pObj; + Any aAny = pUnoObj->getUnoAny(); + + if( aAny.getValueType().getTypeClass() == TypeClass_INTERFACE ) + { + Reference< XInterface > x = *(Reference< XInterface >*)aAny.getValue(); + Reference< XIndexAccess > xIndexAccess( x, UNO_QUERY ); + + // Haben wir Index-Access? + if( xIndexAccess.is() ) + { + UINT32 nParamCount = (UINT32)pPar->Count() - 1; + if( nParamCount != 1 ) + { + StarBASIC::Error( SbERR_BAD_ARGUMENT ); + return pElem; + } + + // Index holen + INT32 nIndex = pPar->Get( 1 )->GetLong(); + Reference< XInterface > xRet; + try + { + Any aAny = xIndexAccess->getByIndex( nIndex ); + TypeClass eType = aAny.getValueType().getTypeClass(); + if( eType == TypeClass_INTERFACE ) + xRet = *(Reference< XInterface >*)aAny.getValue(); + } + catch (IndexOutOfBoundsException& e1) + { + // Bei Exception erstmal immer von Konvertierungs-Problem ausgehen + StarBASIC::Error( SbERR_OUT_OF_RANGE ); + } + + // #57847 Immer neue Variable anlegen, sonst Fehler + // durch PutObject(NULL) bei ReadOnly-Properties. + pElem = new SbxVariable( SbxVARIANT ); + if( xRet.is() ) + { + aAny <<= xRet; + + // #67173 Kein Namen angeben, damit echter Klassen-Namen eintragen wird + String aName; + SbxObjectRef xWrapper = (SbxObject*)new SbUnoObject( aName, aAny ); + pElem->PutObject( xWrapper ); + } + else + { + pElem->PutObject( NULL ); + } + } + } + } + + // #42940, 0.Parameter zu NULL setzen, damit sich Var nicht selbst haelt + if( pPar ) + pPar->Put( NULL, 0 ); + } + + return pElem; +} + +// Laden eines Elements aus der Runtime-Library (+StringID+Typ) + +void SbiRuntime::StepRTL( USHORT nOp1, USHORT nOp2 ) +{ + PushVar( FindElement( rBasic.pRtl, nOp1, nOp2, SbERR_PROC_UNDEFINED, FALSE ) ); +} + +// Laden einer lokalen/globalen Variablen (+StringID+Typ) + +void SbiRuntime::StepFIND( USHORT nOp1, USHORT nOp2 ) +{ + if( !refLocals ) + refLocals = new SbxArray; + PushVar( FindElement( pMod, nOp1, nOp2, SbERR_PROC_UNDEFINED, TRUE ) ); +} + +// Laden eines Objekt-Elements (+StringID+Typ) +// Das Objekt liegt auf TOS + +void SbiRuntime::StepELEM( USHORT nOp1, USHORT nOp2 ) +{ + // Liegt auf dem TOS ein Objekt? + SbxVariableRef pObjVar = PopVar(); + + SbxObject* pObj = PTR_CAST(SbxObject,(SbxVariable*) pObjVar); + if( !pObj ) + { + SbxBase* pObjVarObj = pObjVar->GetObject(); + pObj = PTR_CAST(SbxObject,pObjVarObj); + } + + // #56368 Bei StepElem Referenz sichern, sonst koennen Objekte + // in Qualifizierungsketten wie ActiveComponent.Selection(0).Text + // zu fueh die Referenz verlieren + // #74254 Jetzt per Liste + if( pObj ) + SaveRef( (SbxVariable*)pObj ); + + PushVar( FindElement( pObj, nOp1, nOp2, SbERR_NO_METHOD, FALSE ) ); +} + +// Laden eines Parameters (+Offset+Typ) +// Wenn der Datentyp nicht stimmen sollte, eine Kopie anlegen +// Der Datentyp SbxEMPTY zeigt an, da kein Parameter angegeben ist. +// Get( 0 ) darf EMPTY sein + +void SbiRuntime::StepPARAM( USHORT nOp1, USHORT nOp2 ) +{ + USHORT i = nOp1 & 0x7FFF; + SbxDataType t = (SbxDataType) nOp2; + SbxVariable* p; + + // #57915 Missing sauberer loesen + BOOL bIsMissing = FALSE; + USHORT nParamCount = refParams->Count(); + // Wurden ueberhaupt genug Parameter uebergeben + if( i >= nParamCount ) + { + p = new SbxVariable(); + p->PutErr( 448 ); // Wie in VB: Error-Code 448 (SbERR_NAMED_NOT_FOUND) + refParams->Put( p, i ); + } + else + { + p = refParams->Get( i ); + } + if( p->GetType() == SbxERROR && ( i ) ) + //if( p->GetType() == SbxEMPTY && ( i ) ) + { + // Wenn ein Parameter fehlt, kann er OPTIONAL sein + BOOL bOpt = FALSE; + SbxInfo* pInfo; + if( pMeth && ( pInfo = pMeth->GetInfo() ) ) + { + const SbxParamInfo* pParam = pInfo->GetParam( i ); + if( pParam && ( (pParam->nFlags & SBX_OPTIONAL) != 0 ) ) + bOpt = TRUE; + } + if( bOpt == FALSE ) + Error( SbERR_NOT_OPTIONAL ); + } + else if( t != SbxVARIANT && (SbxDataType)(p->GetType() & 0x0FFF ) != t ) + { + SbxVariable* q = new SbxVariable( t ); + SaveRef( q ); + *q = *p; + p = q; + } + SetupArgs( p, nOp1 ); + PushVar( CheckArray( p ) ); +} + +// Case-Test (+True-Target+Test-Opcode) + +void SbiRuntime::StepCASEIS( USHORT nOp1, USHORT nOp2 ) +{ + if( !refCaseStk || !refCaseStk->Count() ) + StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); + else + { + SbxVariableRef xComp = PopVar(); + SbxVariableRef xCase = refCaseStk->Get( refCaseStk->Count() - 1 ); + if( xCase->Compare( (SbxOperator) nOp2, *xComp ) ) + StepJUMP( nOp1 ); + } +} + +// Aufruf einer DLL-Prozedur (+StringID+Typ) +// Auch hier zeigt das MSB des StringIDs an, dass Argv belegt ist + +void SbiRuntime::StepCALL( USHORT nOp1, USHORT nOp2 ) +{ + String aName = pImg->GetString( nOp1 & 0x7FFF ); + SbxArray* pArgs = NULL; + if( nOp1 & 0x8000 ) + pArgs = refArgv; + DllCall( aName, aLibName, pArgs, (SbxDataType) nOp2, FALSE ); + aLibName = String(); + if( nOp1 & 0x8000 ) + PopArgv(); +} + +// Aufruf einer DLL-Prozedur nach CDecl (+StringID+Typ) +// Auch hier zeigt das MSB des StringIDs an, dass Argv belegt ist + +void SbiRuntime::StepCALLC( USHORT nOp1, USHORT nOp2 ) +{ + String aName = pImg->GetString( nOp1 & 0x7FFF ); + SbxArray* pArgs = NULL; + if( nOp1 & 0x8000 ) + pArgs = refArgv; + DllCall( aName, aLibName, pArgs, (SbxDataType) nOp2, TRUE ); + aLibName = String(); + if( nOp1 & 0x8000 ) + PopArgv(); +} + + +// Beginn eines Statements (+Line+Col) + +void SbiRuntime::StepSTMNT( USHORT nOp1, USHORT nOp2 ) +{ + // Wenn der Expr-Stack am Anfang einen Statements eine Variable enthaelt, + // hat ein Trottel X als Funktion aufgerufen, obwohl es eine Variable ist! + BOOL bFatalExpr = FALSE; + if( nExprLvl > 1 ) + bFatalExpr = TRUE; + else if( nExprLvl ) + { + SbxVariable* p = refExprStk->Get( 0 ); + if( p->GetRefCount() > 1 + && refLocals.Is() && refLocals->Find( p->GetName(), p->GetClass() ) ) + bFatalExpr = TRUE; + } + // Der Expr-Stack ist nun nicht mehr notwendig + ClearExprStack(); + + // #56368 Kuenstliche Referenz fuer StepElem wieder freigeben, + // damit sie nicht ueber ein Statement hinaus erhalten bleibt + //refSaveObj = NULL; + // #74254 Jetzt per Liste + ClearRefs(); + + // Wir muessen hier hart abbrechen, da sonst Zeile und Spalte nicht mehr + // stimmen! + if( bFatalExpr) + { + StarBASIC::FatalError( SbERR_NO_METHOD ); + return; + } + pStmnt = pCode - 5; + USHORT nOld = nLine; + nLine = nOp1; + + // #29955 & 0xFF, um for-Schleifen-Ebene wegzufiltern + nCol1 = nOp2 & 0xFF; + + // Suchen des naechsten STMNT-Befehls, + // um die End-Spalte dieses Statements zu setzen + nCol2 = -1; + USHORT n1, n2; + const BYTE* p = pMod->FindNextStmnt( pCode, n1, n2 ); + if( p ) + { + if( n1 == nOp1 ) + { + // #29955 & 0xFF, um for-Schleifen-Ebene wegzufiltern + nCol2 = (n2 & 0xFF) - 1; + } + } + + // #29955 for-Schleifen-Ebene korrigieren, #67452 NICHT im Error-Handler sonst Chaos + if( !bInError ) + { + // (Bei Sprngen aus Schleifen tritt hier eine Differenz auf) + USHORT nExspectedForLevel = nOp2 / 0x100; + USHORT nRealForLevel = 0; + SbiForStack* pFor = pForStk; + while( pFor ) + { + nRealForLevel++; + pFor = pFor->pNext; + } + + // Wenn der tatsaechliche For-Level zu klein ist, wurde aus + // einer Schleife heraus gesprungen -> korrigieren + while( nRealForLevel > nExspectedForLevel ) + { + PopFor(); + nRealForLevel--; + } + } + + // 16.10.96: #31460 Neues Konzept fuer StepInto/Over/Out + // Erklrung siehe bei _ImplGetBreakCallLevel. + if( pInst->nCallLvl <= pInst->nBreakCallLvl ) + //if( nFlags & SbDEBUG_STEPINTO ) + { + StarBASIC* pStepBasic = GetCurrentBasic( &rBasic ); + USHORT nNewFlags = pStepBasic->StepPoint( nLine, nCol1, nCol2 ); + + // Neuen BreakCallLevel ermitteln + pInst->CalcBreakCallLevel( nNewFlags ); + } + + // Breakpoints nur bei STMNT-Befehlen in neuer Zeile! + else if( ( nOp1 != nOld ) + && ( nFlags & SbDEBUG_BREAK ) + && pMod->IsBP( nOp1 ) ) + { + StarBASIC* pBreakBasic = GetCurrentBasic( &rBasic ); + USHORT nNewFlags = pBreakBasic->BreakPoint( nLine, nCol1, nCol2 ); + + // Neuen BreakCallLevel ermitteln + pInst->CalcBreakCallLevel( nNewFlags ); + //16.10.96, ALT: + //if( nNewFlags != SbDEBUG_CONTINUE ) + // nFlags = nNewFlags; + } +} + +// (+SvStreamFlags+Flags) +// Stack: Blocklaenge +// Kanalnummer +// Dateiname + +void SbiRuntime::StepOPEN( USHORT nOp1, USHORT nOp2 ) +{ + SbxVariableRef pName = PopVar(); + SbxVariableRef pChan = PopVar(); + SbxVariableRef pLen = PopVar(); + short nBlkLen = pLen->GetInteger(); + short nChan = pChan->GetInteger(); + ByteString aName( pName->GetString(), gsl_getSystemTextEncoding() ); + pIosys->Open( nChan, aName, nOp1, nOp2, nBlkLen ); + Error( pIosys->GetError() ); +} + +// Objekt kreieren (+StringID+StringID) + +void SbiRuntime::StepCREATE( USHORT nOp1, USHORT nOp2 ) +{ + String aClass( pImg->GetString( nOp2 ) ); + SbxObject *pObj = SbxBase::CreateObject( aClass ); + if( !pObj ) + Error( SbERR_INVALID_OBJECT ); + else + { + String aName( pImg->GetString( nOp1 ) ); + pObj->SetName( aName ); + // Das Objekt muss BASIC rufen koennen + pObj->SetParent( &rBasic ); + SbxVariable* pNew = new SbxVariable; + pNew->PutObject( pObj ); + PushVar( pNew ); + } +} + +// #56204 Objekt-Array kreieren (+StringID+StringID), DCREATE == Dim-Create +void SbiRuntime::StepDCREATE( USHORT nOp1, USHORT nOp2 ) +{ + SbxVariableRef refVar = PopVar(); + DimImpl( refVar ); + + // Das Array mit Instanzen der geforderten Klasse fuellen + SbxBaseRef xObj = (SbxBase*)refVar->GetObject(); + if( !xObj ) + { + StarBASIC::Error( SbERR_INVALID_OBJECT ); + return; + } + + if( xObj->ISA(SbxDimArray) ) + { + SbxBase* pObj = (SbxBase*)xObj; + SbxDimArray* pArray = (SbxDimArray*)pObj; + + // Dimensionen auswerten + short nDims = pArray->GetDims(); + USHORT nTotalSize = 0; + + // es muss ein eindimensionales Array sein + short nLower, nUpper, nSize; + USHORT i; + for( i = 0 ; i < nDims ; i++ ) + { + pArray->GetDim( i+1, nLower, nUpper ); + nSize = nUpper - nLower + 1; + if( i == 0 ) + nTotalSize = nSize; + else + nTotalSize *= nSize; + } + + // Objekte anlegen und ins Array eintragen + String aClass( pImg->GetString( nOp2 ) ); + for( i = 0 ; i < nTotalSize ; i++ ) + { + SbxObject *pObj = SbxBase::CreateObject( aClass ); + if( !pObj ) + { + Error( SbERR_INVALID_OBJECT ); + break; + } + else + { + String aName( pImg->GetString( nOp1 ) ); + pObj->SetName( aName ); + // Das Objekt muss BASIC rufen koennen + pObj->SetParent( &rBasic ); + pArray->SbxArray::Put( pObj, i ); + } + } + } +} + +// Objekt aus User-Type kreieren (+StringID+StringID) +void SbiRuntime::StepTCREATE( USHORT nOp1, USHORT nOp2 ) +{ + String aName( pImg->GetString( nOp1 ) ); + String aClass( pImg->GetString( nOp2 ) ); + const SbxObject* pObj = pImg->FindType(aClass); + if (pObj) + { + SbxObject *pCopyObj = new SbxObject(*pObj); + pCopyObj->SetName(pImg->GetString( nOp1 )); + SbxVariable* pNew = new SbxVariable; + pNew->PutObject( pCopyObj ); + PushVar( pNew ); + } + else + Error( SbERR_INVALID_OBJECT ); +} + + + +// Einrichten einer lokalen Variablen (+StringID+Typ) + +void SbiRuntime::StepLOCAL( USHORT nOp1, USHORT nOp2 ) +{ + if( !refLocals.Is() ) + refLocals = new SbxArray; + String aName( pImg->GetString( nOp1 ) ); + SbxDataType t = (SbxDataType) nOp2; + SbxVariable* p = new SbxVariable( t ); + p->SetName( aName ); + refLocals->Put( p, refLocals->Count() ); +} + +// Einrichten einer modulglobalen Variablen (+StringID+Typ) + +void SbiRuntime::StepPUBLIC( USHORT nOp1, USHORT nOp2 ) +{ + String aName( pImg->GetString( nOp1 ) ); + SbxDataType t = (SbxDataType) nOp2; + BOOL bFlag = pMod->IsSet( SBX_NO_MODIFY ); + pMod->SetFlag( SBX_NO_MODIFY ); + SbProperty* pProp = pMod->GetProperty( aName, t ); + if( !bFlag ) + pMod->ResetFlag( SBX_NO_MODIFY ); + if( pProp ) + { + pProp->SetFlag( SBX_DONTSTORE ); + // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden' + pProp->SetFlag( SBX_NO_MODIFY); + } + +} + +// Einrichten einer globalen Variablen (+StringID+Typ) + +void SbiRuntime::StepGLOBAL( USHORT nOp1, USHORT nOp2 ) +{ + String aName( pImg->GetString( nOp1 ) ); + SbxDataType t = (SbxDataType) nOp2; + BOOL bFlag = rBasic.IsSet( SBX_NO_MODIFY ); + rBasic.SetFlag( SBX_NO_MODIFY ); + SbxVariableRef p = rBasic.Find( aName, SbxCLASS_PROPERTY ); + if( p.Is() ) + rBasic.Remove (p); + p = rBasic.Make( aName, SbxCLASS_PROPERTY, t ); + if( !bFlag ) + rBasic.ResetFlag( SBX_NO_MODIFY ); + if( p ) + { + p->SetFlag( SBX_DONTSTORE ); + // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden' + p->SetFlag( SBX_NO_MODIFY); + } + +} + +// Einrichten einer statischen Variablen (+StringID+Typ) + +void SbiRuntime::StepSTATIC( USHORT nOp1, USHORT nOp2 ) +{ + /* AB #40689, wird nicht mehr verwendet + String aName( pImg->GetString( nOp1 ) ); + SbxDataType t = (SbxDataType) nOp2; + SbxVariable* p = new SbxVariable( t ); + p->SetName( aName ); + pInst -> GetStatics()->Put( p, pInst->GetStatics()->Count() ); + */ +} + + diff --git a/basic/source/runtime/win.asm b/basic/source/runtime/win.asm new file mode 100644 index 000000000000..067766a05173 --- /dev/null +++ b/basic/source/runtime/win.asm @@ -0,0 +1,72 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; WINOS2.ASM +;; +;; Ersterstellung MD 26.02.91 +;; +;; Stand +;; XX in Arbeit +;; XX fertiggestellt +;; __ abgenommen +;; __ freigegeben +;; +;; Anmerkungen +;; Direktaufruf von C- und PASCAL-Routinen, Windows und OS/2 +;; +;; Source Code Control System - Header +;; $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/basic/source/runtime/win.asm,v 1.1.1.1 2000-09-18 16:12:11 hr Exp $ +;; +;; Copyright (c) 1990,95 by STAR DIVISION GmbH +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Inhalt: +; type = CallXXX (far *proc, char *stack, short nstack) +; +; Kopie des Basic-Stacks (nstack Bytes) auf den C-Stack +; und Aufruf der Prozedur. + + .MODEL LARGE,C + + .CODE + + PUBLIC CallINT + PUBLIC CallLNG + PUBLIC CallSNG + PUBLIC CallDBL + PUBLIC CallSTR + PUBLIC CallFIX + +CallINT LABEL byte +CallLNG LABEL byte +CallSNG LABEL byte +CallDBL LABEL byte +CallSTR LABEL byte +CallFIX PROC p:PTR,stk:PTR,n:WORD + + PUSH SI + PUSH DI + MOV DX,DS + SUB SP,[n] + MOV DI,SP + MOV AX,SS + MOV ES,AX + LDS SI,[stk] + MOV CX,[n] + SHR CX,1 + CLD + JCXZ $1 + REP MOVSW ; Stack uebernehmen +$1: MOV DS,DX + CALL [p] ; Aufruf der Prozedur + CLI + MOV SP,BP + SUB SP,4 ; wegen gepushter Register + STI + POP DI + POP SI + RET + +CallFIX ENDP + + END diff --git a/basic/source/runtime/wnt.asm b/basic/source/runtime/wnt.asm new file mode 100644 index 000000000000..036959843ee9 --- /dev/null +++ b/basic/source/runtime/wnt.asm @@ -0,0 +1,84 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; WNT.ASM +;; +;; Ersterstellung MD 26.02.91 +;; +;; Stand +;; XX in Arbeit +;; XX fertiggestellt +;; __ abgenommen +;; __ freigegeben +;; +;; Anmerkungen +;; Direktaufruf von C- und PASCAL-Routinen, Windows und OS/2 +;; +;; Source Code Control System - Header +;; $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/basic/source/runtime/wnt.asm,v 1.1.1.1 2000-09-18 16:12:11 hr Exp $ +;; +;; Copyright (c) 1990,95 by STAR DIVISION GmbH +;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Inhalt: +; type = CallXXX (far *pProc, char *pStack, short nStack) +; +; Kopie des Basic-Stacks (nStack Bytes) auf den C-Stack +; und Aufruf der Prozedur. + + .386 + +_TEXT SEGMENT DWORD PUBLIC 'CODE' USE32 + + ASSUME CS:_TEXT + + PUBLIC _CallINT@12 + PUBLIC _CallLNG@12 + PUBLIC _CallDBL@12 + PUBLIC _CallSTR@12 + PUBLIC _CallFIX@12 + +_CallINT@12 LABEL byte +_CallLNG@12 LABEL byte +_CallDBL@12 LABEL byte +_CallSTR@12 LABEL byte + +_CallFIX@12: PUSH EBP + MOV EBP,ESP + PUSH ESI + PUSH EDI + + PUSH ECX + PUSH EDX + + MOV DX,DS + MOVZX EAX,WORD PTR [EBP+16] ; EAX == nStack + SUB ESP,EAX ; Stack um nStack Bytes vergroessern + MOV EDI,ESP + MOV AX,SS + MOV ES,AX ; ES:EDI = Startadresse des fuer + ; Parameter reservierten Stackbereichs + MOV ESI,[EBP+12] ; DS:ESI == pStack + + MOVZX ECX,WORD PTR [EBP+16] ; ECX == nStack + SHR ECX,1 + CLD + JCXZ $1 + REP MOVSW ; Stack uebernehmen +$1: MOV DS,DX + CALL DWORD PTR [EBP+8] ; Aufruf der Prozedur + ; CLI ; unter NT nicht erlaubt (privileged instruction) + MOV ESP,EBP + SUB ESP,16 ; wegen gepushter Register + ; (ESI, EDI) + ; STI + POP EDX + POP ECX + POP EDI + POP ESI + POP EBP + RET 12 + +_TEXT ENDS + + END diff --git a/basic/source/sample/collelem.cxx b/basic/source/sample/collelem.cxx new file mode 100644 index 000000000000..1b183e403a62 --- /dev/null +++ b/basic/source/sample/collelem.cxx @@ -0,0 +1,120 @@ +/************************************************************************* + * + * $RCSfile: collelem.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _ERRCODE_HXX //autogen +#include <tools/errcode.hxx> +#endif +#ifndef _SV_MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#pragma hdrstop +#include "collelem.hxx" + +// Das Sample-Element ist ein kleines Objekt, das die Properties +// Name und Value enthlt sowie die Methode Say, die den bergebenen +// Text mit dem eigenen Namen verkoppelt und ausgibt. + +SampleElement::SampleElement( const String& r ) : SbxObject( r ) +{ + // Methode Say mit einem String-Parameter + SbxVariable* pMeth = Make( String( RTL_CONSTASCII_USTRINGPARAM("Say") ), SbxCLASS_METHOD, SbxEMPTY ); + pMeth->SetUserData( 0x12345678 ); + pMeth->ResetFlag( SBX_FIXED ); + SbxInfo* pInfo = new SbxInfo; + pInfo->AddParam( String( RTL_CONSTASCII_USTRINGPARAM("text") ), SbxSTRING, SBX_READ ); + pMeth->SetInfo( pInfo ); +} + +void SampleElement::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) +{ + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbxArray* pPar = pVar->GetParameters(); + ULONG t = pHint->GetId(); + if( t == SBX_HINT_DATAWANTED && pVar->GetUserData() == 0x12345678 ) + { + // Die Say-Methode: + // 1 Parameter + Returnwert + if( !pPar || pPar->Count() != 2 ) + SetError( SbxERR_WRONG_ARGS ); + else + { + String s( GetName() ); + s.AppendAscii( " says: " ); + s += pPar->Get( 1 )->GetString(); + // Aus Gag: den String zurueckliefern + SbxVariable *pRet = pPar->Get( 0 ); + pPar->Get( 0 )->SetType(SbxSTRING); + pPar->Get( 0 )->PutString( s ); + InfoBox( NULL, s ).Execute(); + } + return; + } + SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + } +} + diff --git a/basic/source/sample/makefile.mk b/basic/source/sample/makefile.mk new file mode 100644 index 000000000000..1e0c9c32855b --- /dev/null +++ b/basic/source/sample/makefile.mk @@ -0,0 +1,95 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ +# +# 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): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/.. + +PRJNAME=BASIC +TARGET=sample + +# --- Settings ------------------------------------------------------------ + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + +# --- Allgemein ------------------------------------------------------------ + +CXXFILES = \ + object.cxx \ + collelem.cxx + + +OBJFILES = \ + $(OBJ)$/object.obj \ + $(OBJ)$/collelem.obj + + +LIBTARGET = NO + +LIB1TARGET=$(LB)$/sample.lib +LIB1ARCHIV=$(LB)$/libsample.a + +LIB1OBJFILES = $(OBJFILES) + +# --- Targets ------------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/basic/source/sample/object.cxx b/basic/source/sample/object.cxx new file mode 100644 index 000000000000..137892c67352 --- /dev/null +++ b/basic/source/sample/object.cxx @@ -0,0 +1,319 @@ +/************************************************************************* + * + * $RCSfile: object.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:11 $ + * + * 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 _ERRCODE_HXX //autogen +#include <tools/errcode.hxx> +#endif +#ifndef _SBX_SBXOBJECT_HXX //autogen +#include <svtools/sbxobj.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef __SBX_SBXVARIABLE_HXX //autogen +#include <svtools/sbxvar.hxx> +#endif +#ifndef _MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif + +#pragma hdrstop +#include "object.hxx" +#include "collelem.hxx" +// Makro MEMBER() +#include "macfix.hxx" + +// Das Sample-Objekt hat folgende Elemente: +// 1) Properties: +// Name der Name +// Value ein double-Wert, beide bereits als Default drin +// 2) Methoden: +// Create Erzeugen eines neuen Unterelements +// Display Ausgabe eines Textes +// Square Argument * Argument +// Event Aufruf eines Basic-Eventhandlers +// 3) Unterobjekte: +// Per Create() kann ein neues Unterelement eingerichtet werden, +// das indiziert werden kann, falls mehrere Objekte gleichen Namens +// existieren. +// Diese Implementation ist ein Beispiel fuer eine tabellengesteuerte +// Version, die sehr viele Elemente enthalten kann. Die Elemente werden +// je nach Bedarf aus der Tabelle in das Objekt uebernommen. +// Die Collection findet sich in COLLECTN.*, die in der Collection +// enthaltenen Objekte in COLLELEM.* + +// Das Sample-Objekt wird in ..\app\mybasic.cxx wie folgt in StarBASIC +// eingebaut: + +// MyBasic::MyBasic() : StarBASIC() +// { +// AddFactory( new SampleObjectFac() ); +// } + +// Das nArgs-Feld eines Tabelleneintrags ist wie folgt verschluesselt: + +#define _ARGSMASK 0x00FF // Bis zu 255 Argumente +#define _RWMASK 0x0F00 // Maske fuer R/W-Bits +#define _TYPEMASK 0xF000 // Maske fuer den Typ des Eintrags + +#define _READ 0x0100 // kann gelesen werden +#define _BWRITE 0x0200 // kann as Lvalue verwendet werden +#define _LVALUE _BWRITE // kann as Lvalue verwendet werden +#define _READWRITE 0x0300 // beides +#define _OPT 0x0400 // TRUE: optionaler Parameter +#define _METHOD 0x1000 // Masken-Bit fuer eine Methode +#define _PROPERTY 0x2000 // Masken-Bit fuer eine Property +#define _COLL 0x4000 // Masken-Bit fuer eine Collection + // Kombination von oberen Bits: +#define _FUNCTION 0x1100 // Maske fuer Function +#define _LFUNCTION 0x1300 // Maske fuer Function, die auch als Lvalue geht +#define _ROPROP 0x2100 // Maske Read Only-Property +#define _WOPROP 0x2200 // Maske Write Only-Property +#define _RWPROP 0x2300 // Maske Read/Write-Property +#define _COLLPROP 0x4100 // Maske Read-Collection-Element + +#define COLLNAME "Elements" // Name der Collection, hier mal hart verdrahtet + +SampleObject::Methods SampleObject::aMethods[] = { +// Eine Sample-Methode (der Returnwert ist SbxNULL) +{ "Display", SbxEMPTY, 1 | _FUNCTION, MEMBER(SampleObject::Display) }, + // Ein Named Parameter + { "message",SbxSTRING }, +// Eine Sample-Funktion +{ "Square", SbxDOUBLE, 1 | _FUNCTION, MEMBER(SampleObject::Square) }, + // Ein Named Parameter + { "value", SbxDOUBLE }, +// Basic-Callback +{ "Event", SbxEMPTY, 1 | _FUNCTION, MEMBER(SampleObject::Event) }, + // Ein Named Parameter + { "event", SbxSTRING }, +// Element erzeugen +{ "Create", SbxEMPTY, 1 | _FUNCTION, MEMBER(SampleObject::Create) }, + // Ein Named Parameter + { "name", SbxSTRING }, + +{ NULL, SbxNULL, -1 }}; // Tabellenende + +SampleObject::SampleObject( const String& rClass ) : SbxObject( rClass ) +{ + SetName( String( RTL_CONSTASCII_USTRINGPARAM("Sample") ) ); + PutDouble( 1.0 ); // Startwert fuer Value +} + +// Suche nach einem Element: +// Hier wird linear durch die Methodentabelle gegangen, bis eine +// passende Methode gefunden wurde. +// Wenn die Methode/Property nicht gefunden wurde, nur NULL ohne +// Fehlercode zurueckliefern, da so auch eine ganze Chain von +// Objekten nach der Methode/Property befragt werden kann. + +SbxVariable* SampleObject::Find( const String& rName, SbxClassType t ) +{ + // Ist das Element bereits vorhanden? + SbxVariable* pRes = SbxObject::Find( rName, t ); + if( !pRes && t != SbxCLASS_OBJECT ) + { + // sonst suchen + Methods* p = aMethods; + short nIndex = 0; + BOOL bFound = FALSE; + while( p->nArgs != -1 ) + { + if( rName.EqualsIgnoreCaseAscii( p->pName ) ) + { + bFound = TRUE; break; + } + nIndex += ( p->nArgs & _ARGSMASK ) + 1; + p = aMethods + nIndex; + } + if( bFound ) + { + // Args-Felder isolieren: + short nAccess = ( p->nArgs & _RWMASK ) >> 8; + short nType = ( p->nArgs & _TYPEMASK ); + String aName = String::CreateFromAscii( p->pName ); + SbxClassType eCT = SbxCLASS_OBJECT; + if( nType & _PROPERTY ) + eCT = SbxCLASS_PROPERTY; + else if( nType & _METHOD ) + eCT = SbxCLASS_METHOD; + pRes = Make( aName, eCT, p->eType ); + // Wir setzen den Array-Index + 1, da ja noch andere + // Standard-Properties existieren, die auch aktiviert + // werden muessen. + pRes->SetUserData( nIndex + 1 ); + pRes->SetFlags( nAccess ); + } + } + return pRes; +} + +// Aktivierung eines Elements oder Anfordern eines Infoblocks + +void SampleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCT, + const SfxHint& rHint, const TypeId& rHT ) +{ + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbxArray* pPar = pVar->GetParameters(); + USHORT nIndex = (USHORT) pVar->GetUserData(); + // kein Index: weiterreichen! + if( nIndex ) + { + ULONG t = pHint->GetId(); + if( t == SBX_HINT_INFOWANTED ) + pVar->SetInfo( GetInfo( (short) pVar->GetUserData() ) ); + else + { + BOOL bWrite = FALSE; + if( t == SBX_HINT_DATACHANGED ) + bWrite = TRUE; + if( t == SBX_HINT_DATAWANTED || bWrite ) + { + // Parameter-Test fuer Methoden: + USHORT nPar = aMethods[ --nIndex ].nArgs & 0x00FF; + // Element 0 ist der Returnwert + if( ( !pPar && nPar ) + || ( pPar->Count() != nPar+1 ) ) + SetError( SbxERR_WRONG_ARGS ); + // Alles klar, man kann den Call ausfuehren + else + { + (this->*(aMethods[ nIndex ].pFunc))( pVar, pPar, bWrite ); + } + } + } + } + SbxObject::SFX_NOTIFY( rBC, rBCT, rHint, rHT ); + } +} + +// Zusammenbau der Infostruktur fuer einzelne Elemente + +SbxInfo* SampleObject::GetInfo( short nIdx ) +{ + Methods* p = &aMethods[ nIdx ]; + // Wenn mal eine Hilfedatei zur Verfuegung steht: + // SbxInfo* pInfo = new SbxInfo( Hilfedateiname, p->nHelpId ); + SbxInfo* pInfo = new SbxInfo; + short nPar = p->nArgs & _ARGSMASK; + for( short i = 0; i < nPar; i++ ) + { + p++; + String aName = String::CreateFromAscii( p->pName ); + USHORT nFlags = ( p->nArgs >> 8 ) & 0x03; + if( p->nArgs & _OPT ) + nFlags |= SBX_OPTIONAL; + pInfo->AddParam( aName, p->eType, nFlags ); + } + return pInfo; +} + +//////////////////////////////////////////////////////////////////////////// + +// Properties und Methoden legen beim Get (bPut = FALSE) den Returnwert +// im Element 0 des Argv ab; beim Put (bPut = TRUE) wird der Wert aus +// Element 0 gespeichert. + +// Die Methoden: + +void SampleObject::Display( SbxVariable*, SbxArray* pPar, BOOL ) +{ + // GetString() loest u.U. auch einen Error aus! + String s( pPar->Get( 1 )->GetString() ); + if( !IsError() ) + InfoBox( NULL, s ).Execute(); +} + +void SampleObject::Square( SbxVariable* pVar, SbxArray* pPar, BOOL ) +{ + double n = pPar->Get( 1 )->GetDouble(); + pVar->PutDouble( n * n ); +} + +// Callback nach BASIC: + +void SampleObject::Event( SbxVariable*, SbxArray* pPar, BOOL ) +{ + Call( pPar->Get( 1 )->GetString(), NULL ); +} + +// Neues Element anlegen + +void SampleObject::Create( SbxVariable* pVar, SbxArray* pPar, BOOL ) +{ + pVar->PutObject( + MakeObject( pPar->Get( 1 )->GetString(), String( RTL_CONSTASCII_USTRINGPARAM("SampleElement") ) ) ); +} + +// Die Factory legt unsere beiden Objekte an. + +SbxObject* SampleObjectFac::CreateObject( const String& rClass ) +{ + if( rClass.EqualsIgnoreCaseAscii( "SampleObject" ) ) + return new SampleObject( rClass ); + if( rClass.EqualsIgnoreCaseAscii( "SampleElement" ) ) + return new SampleElement( rClass ); + return NULL; +} + diff --git a/basic/source/sample/sample.bas b/basic/source/sample/sample.bas new file mode 100644 index 000000000000..d0e416871af0 --- /dev/null +++ b/basic/source/sample/sample.bas @@ -0,0 +1,39 @@ +' Sample-Programm fuer Sample-Objekte + +Sub Main + Dim Sample As SampleObject + Dim Element1 As Object, Element2 As Object + Set Element1 = Sample!Create "Objekt" + Set Element2 = Sample.Create "Objekt" + Element1 = "Element 1" + Element2 = "Element 2" + For i = 0 to 1 + Print Sample.Objekt( i ) + Next + 'Test der Event-Methode im Sample-Objekt + Sample.Event "Bang" +End Sub + +Sub Bang + print "Sample-Callback: BANG!" +End Sub + + + + + + + + + + + + + + + + + + + + diff --git a/basic/util/makefile.mk b/basic/util/makefile.mk new file mode 100644 index 000000000000..33d23435464a --- /dev/null +++ b/basic/util/makefile.mk @@ -0,0 +1,363 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:12:12 $ +# +# 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): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=.. + +PRJNAME=basic +TARGET=sb +#basic.hid generieren +GEN_HID=TRUE + +# --- Settings --------------------------------------------------- + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + +.IF "$(GUI)"=="WIN" +.IF "$(product)" != "" +LINKFLAGS=$(LINKFLAGS) /NOPACKC +.ENDIF +.ENDIF + +.IF "$(depend)" == "" + +# --- Allgemein --------------------------------------------------- + +USE_LDUMP2=TRUE + +.IF "$(header)" == "" + +#SRSFILES= $(SRS)$/app.srs $(SRS)$/testtool.srs + + +LIB1TARGET=$(SLB)$/sb.lib +LIB1FILES= \ + $(SLB)$/basicmgr.lib \ + $(SLB)$/classes.lib \ + $(SLB)$/comp.lib \ + $(SLB)$/runtime.lib + +SHL1TARGET= sb$(UPD)$(DLLPOSTFIX) +SHL1IMPLIB= basic + +SHL1STDLIBS= \ + $(CPPULIB) \ + $(CPPUHELPERLIB) \ + $(TOOLSLIB) \ + $(SVTOOLLIB) \ + $(SVLLIB) \ + $(SVLIB) \ + $(SJLIB) \ + $(VOSLIB) \ + $(SALLIB) \ + $(SVMEMLIB) \ + $(UNOTOOLSLIB) + +.IF "$(GUI)"=="WNT" +SHL1STDLIBS+=$(LIBCIMT) +.ENDIF + +.IF "$(SO3)" != "" +SHL1STDLIBS+=\ + $(SOTLIB) \ + $(VOSLIB) +.ENDIF + + + +.IF "$(GUI)" != "UNX" +SHL1OBJS= \ + $(SLO)$/sb.obj +.ENDIF + +SHL1DEF= $(MISC)$/$(SHL1TARGET).def +SHL1LIBS= $(SLB)$/sb.lib + +DEF1NAME =$(SHL1TARGET) +DEF1DEPN = \ + $(MISC)$/$(SHL1TARGET).flt + +DEFLIB1NAME =sb +DEF1DES =StarBasic + +# --- SBASIC IDE -------------------------------------------------------- + +APP1TARGET=$(PRJNAME) +.IF "$(GUI)" != "MAC" +APP1STDLIBS= \ + $(SALLIB) \ + $(TOOLSLIB) \ + $(SVTOOLLIB) \ + $(SVLLIB) \ + $(SVLIB) \ + $(SO2LIB) \ + $(UNOTOOLSLIB) \ + $(UCBHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SJLIB) \ + $(VOSLIB) \ + $(SVMEMLIB) +.IF "$(GUI)"=="WNT" || "$(COM)"=="GCC" +APP1STDLIBS+=$(CPPULIB) +.ENDIF +.ELSE +APP1STDLIBS= \ + $(SOLARLIBDIR)$/SALMAIN.OBJ \ + $(SOLARLIBDIR)$/NOSHAREDMAIN.LIB \ + $(TOOLSLIB) \ + $(SVTOOLLIB) \ + $(SVLIB) \ + $(SJLIB) \ + $(SO2LIB) +.ENDIF +.IF "$(GUI)"=="UNX" +APP1STDLIBS+= \ + $(VOSLIB) \ + $(SALLIB) +.ENDIF + +APP1LIBS= \ + $(LIBPRE) $(LB)$/basic.lib \ + $(LIBPRE) $(LB)$/app.lib \ + $(LIBPRE) $(LB)$/sample.lib +.IF "$(GUI)"=="UNX" +APP1STDLIBS+= \ + $(BASICLIB) +.ENDIF + + +.IF "$(SO3)" != "" +APP1STDLIBS+=\ + $(SOTLIB) +.ENDIF + +.IF "$(GUI)" != "MAC" +APP1DEPN= $(L)$/itools.lib $(SVLIBDEPEND) $(LB)$/basic.lib $(LB)$/app.lib $(LB)$/sample.lib +.ELSE +APP1DEPN = $(APP1STDLIBS) $(APP1LIBS) +MACRES = $(SV_RES)SV.R $(SV_RES)SV_DEMO.R $(SV_RES)SV_POWER.R +.ENDIF + +APP1OBJS = $(OBJ)$/ttbasic.obj + +.IF "$(GUI)" != "UNX" +APP1OBJS+= \ + $(OBJ)$/app.obj + +.IF "$(COM)"!="ICC" +APP1OBJS+= \ + $(SLO)$/sbintern.obj +.ENDIF +.ENDIF + +#APP1DEF= $(MISC)$/$(PRJNAME).def +#APP1RES= $(RES)$/sb.res + +RES1TARGET=$(PRJNAME) +SRS1FILES= \ + $(SRS)$/classes.srs + +# --- TESTTOOL IDE ------------------------------------------------------ +# die ressourcen werden hier gelinkt + +RESLIB1NAME=stt +RESLIB1SRSFILES= \ + $(SRS)$/app.srs \ + $(SRS)$/classes.srs + +# --- jstest ------------------------------------------------------ + +#.IF "$(GUI)" != "MAC" + +#APP4TARGET=jstest +#APP4STDLIBS= \ +# $(TOOLSLIB) \ +# $(SVTOOLLIB) \ +# $(SVLIB) \ +# $(SVMEMLIB) \ +# $(SO2LIB) \ +# $(SALLIB) \ +# $(ONELIB) \ +# $(LB)$/basic.lib + +#.IF "$(GUI)"=="UNX" +#APP4STDLIBS+= \ +# $(VOSLIB) $(SALLIB) +#.ENDIF + + +#APP4DEPN=\ +# $(L)$/svtool.lib \ +# $(L)$/itools.lib \ +# $(SVLIBDEPEND) \ +# $(OBJ)$/jstest.obj + +#APP4OBJS= $(OBJ)$/jstest.obj + +#.ENDIF + +# --- Targets ----------------------------------------------------------- + +ALL: $(LIB1TARGET) \ + $(LB)$/basic.lib \ + ALLTAR + + +#------------------------------------------------------------------------- +# Windows 3.x +#------------------------------------------------------------------------- + + +.IF "$(GUI)" == "WIN" + +LINKFLAGS+=/NOCV /IG +LINK=$(DEVROOT)$/bin\optlinks\optlinks + +$(MISC)$/$(PRJNAME).def: makefile.mk + echo NAME BASIC >$@ + echo DESCRIPTION 'StarBASIC DevSystem (C)1994 STAR DIVISION GmbH'>>$@ + echo EXETYPE WINDOWS >>$@ + echo PROTMODE >>$@ + echo STUB 'winSTUB.EXE' >>$@ + echo CODE LOADONCALL MOVEABLE >>$@ + echo DATA PRELOAD MULTIPLE MOVEABLE >>$@ + echo HEAPSIZE 4096 >>$@ + echo STACKSIZE 30000 >>$@ +.ENDIF # GUI == WIN + +#------------------------------------------------------------------------- +# MAC +#------------------------------------------------------------------------- + +.IF "$(GUI)" == "MAC" + +$(MISC)$/$(PRJNAME).def: makefile.mk + echo Kein def-File fuer Applikationen auf Mac +.ENDIF # GUI == MAC + +#------------------------------------------------------------------------- +# OS/2 +#------------------------------------------------------------------------- + +.IF "$(GUI)" == "OS2" + +$(MISC)$/$(PRJNAME).def: makefile.mk +.IF "$(COM)"!="WTC" + echo NAME BASIC WINDOWAPI >$@ + echo DESCRIPTION 'StarBASIC DevSystem (C)1993 STAR DIVISION GmbH' >>$@ + echo EXETYPE OS2 >>$@ + echo PROTMODE >>$@ + echo STUB 'OS2STUB.EXE' >>$@ + echo CODE LOADONCALL >>$@ + echo DATA PRELOAD MULTIPLE >>$@ + echo HEAPSIZE 4096 >>$@ + echo STACKSIZE 30000 >>$@ +.ELSE + @echo option DESCRIPTION 'StarBasic DLL' >$@ + @echo name $(BIN)$/$(SHL1TARGET).dll >>$@ +# @ldump -E1 -A -F$(MISC)$/$(SHL1TARGET).flt $(SLB)$/sb.lib >>temp.def + @ldump -E1 -A -F$(MISC)$/$(SHL1TARGET).flt $(LIB1TARGET) >>temp.def + @awk -f s:\util\exp.awk temp.def + del temp.def +.ENDIF + +.ENDIF # GUI == OS2 + +#------------------------------------------------------------------------- +# Windows NT +#------------------------------------------------------------------------- +# +# default targets aus target.mk +# + +# --- Basic-Filter-Datei --- + +$(MISC)$/$(SHL1TARGET).flt: makefile.mk + @echo ------------------------------ + @echo Making: $@ + @echo WEP > $@ + @echo LIBMAIN >> $@ + @echo LibMain >> $@ + @echo Sbi >> $@ + @echo SvRTL >> $@ + @echo SbRtl_ >> $@ + @echo exception >> $@ + @echo bad_alloc >> $@ + @echo __CT >> $@ +.IF "$(GUI)"=="OS2" + @echo __alloc >> $@ + @echo __malloc >> $@ +.ENDIF + +.ENDIF + +# ------------------------------------------------------------------------ +.ENDIF + +.INCLUDE : target.mk + +$(SRS)$/basic.srs: + +$(TYPE) $(SRS)$/classes.srs + $(SRS)$/runtime.srs > $@ + + diff --git a/basic/win/res/basic.ico b/basic/win/res/basic.ico Binary files differnew file mode 100644 index 000000000000..c453a0fa988f --- /dev/null +++ b/basic/win/res/basic.ico diff --git a/basic/win/res/testtool.ico b/basic/win/res/testtool.ico Binary files differnew file mode 100644 index 000000000000..db880c8678a7 --- /dev/null +++ b/basic/win/res/testtool.ico diff --git a/basic/win/res/work.ico b/basic/win/res/work.ico Binary files differnew file mode 100644 index 000000000000..43e3b5b3df03 --- /dev/null +++ b/basic/win/res/work.ico diff --git a/basic/workben/basmgr.src b/basic/workben/basmgr.src new file mode 100644 index 000000000000..630a7f8ff732 --- /dev/null +++ b/basic/workben/basmgr.src @@ -0,0 +1,65 @@ +/************************************************************************* + * + * $RCSfile: basmgr.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:12 $ + * + * 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): _______________________________________ + * + * + ************************************************************************/ +#pragma CHARSET_IBMPC + +String 300 { + Text = "Dummy"; +}; diff --git a/basic/workben/makefile.mk b/basic/workben/makefile.mk new file mode 100644 index 000000000000..11197e87b0a0 --- /dev/null +++ b/basic/workben/makefile.mk @@ -0,0 +1,221 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:12:12 $ +# +# 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): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=.. + +PRJNAME=basic +TARGET=sb +#basic.hid generieren +GEN_HID=TRUE + +# --- Settings --------------------------------------------------- + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + +.IF "$(GUI)"=="WIN" +.IF "$(product)" != "" +LINKFLAGS=$(LINKFLAGS) /NOPACKC +.ENDIF +.ENDIF + +.IF "$(depend)" == "" + +# --- Allgemein --------------------------------------------------- + +.IF "$(header)" == "" + + +# --- TESTTOOL MINIAPP ------------------------------------------------------ + +.IF "$(GUI)" != "MAC" +SRS3FILES= $(SRS)$/miniapp.srs +RES3TARGET=miniapp + +APP3TARGET=miniapp +APP3STDLIBS= \ + $(TOOLSLIB) \ + $(SVTOOLLIB) \ + $(PLUGCTORLIB) \ + $(SVLIB) \ + $(SVMEMLIB) \ + $(SJLIB) \ + $(SO2LIB) +.IF "$(GUI)"=="UNX" +APP3STDLIBS+= \ + $(VOSLIB) $(OSLLIB) +.ENDIF + + +APP3LIBS= \ + $(LIBPRE) $(LB)$/miniapp.lib + +APP3DEPN=\ + $(L)$/svtool.lib \ + $(L)$/itools.lib \ + $(SVLIBDEPEND) \ + $(LB)$/miniapp.lib + +.IF "$(GUI)" != "UNX" +# win16 braucht ein appobj +APP3OBJS= $(OBJ)$/testapp.obj +.ENDIF + +#APP3DEF= $(MISC)$/$(PRJNAME).def +APP3RES= $(RES)$/miniapp.res + +.ENDIF + +# --- Targets ----------------------------------------------------------- + +ALL: ALLTAR + + +#------------------------------------------------------------------------- +# Windows 3.x +#------------------------------------------------------------------------- + + +.IF "$(GUI)" == "WIN" + +LINKFLAGS+=/NOCV /IG +LINK=$(DEVROOT)$/bin\optlinks\optlinks + +$(MISC)$/$(PRJNAME).def: makefile + echo NAME BASIC >$@ + echo DESCRIPTION 'StarBASIC DevSystem (C)1994 STAR DIVISION GmbH'>>$@ + echo EXETYPE WINDOWS >>$@ + echo PROTMODE >>$@ + echo STUB 'winSTUB.EXE' >>$@ + echo CODE LOADONCALL MOVEABLE >>$@ + echo DATA PRELOAD MULTIPLE MOVEABLE >>$@ + echo HEAPSIZE 4096 >>$@ + echo STACKSIZE 30000 >>$@ +.ENDIF # GUI == WIN + +#------------------------------------------------------------------------- +# MAC +#------------------------------------------------------------------------- + +.IF "$(GUI)" == "MAC" + +$(MISC)$/$(PRJNAME).def: makefile + echo Kein def-File fuer Applikationen auf Mac +.ENDIF # GUI == MAC + +#------------------------------------------------------------------------- +# OS/2 +#------------------------------------------------------------------------- + +.IF "$(GUI)" == "OS2" + +$(MISC)$/$(PRJNAME).def: makefile +.IF "$(COM)"!="WTC" + echo NAME BASIC WINDOWAPI >$@ + echo DESCRIPTION 'StarBASIC DevSystem (C)1993 STAR DIVISION GmbH' >>$@ + echo EXETYPE OS2 >>$@ + echo PROTMODE >>$@ + echo STUB 'OS2STUB.EXE' >>$@ + echo CODE LOADONCALL >>$@ + echo DATA PRELOAD MULTIPLE >>$@ + echo HEAPSIZE 4096 >>$@ + echo STACKSIZE 30000 >>$@ +.ELSE + @echo option DESCRIPTION 'StarBasic DLL' >$@ + @echo name $(BIN)$/$(SHL1TARGET).dll >>$@ +# @ldump -E1 -A -F$(MISC)$/$(SHL1TARGET).flt $(SLB)$/sb.lib >>temp.def + @ldump -E1 -A -F$(MISC)$/$(SHL1TARGET).flt $(LIB1TARGET) >>temp.def + @awk -f s:\util\exp.awk temp.def + del temp.def +.ENDIF + +.ENDIF # GUI == OS2 + +#------------------------------------------------------------------------- +# Windows NT +#------------------------------------------------------------------------- +# +# default targets aus target.mk +# + +# --- Basic-Filter-Datei --- + +$(MISC)$/$(SHL1TARGET).flt: makefile + @echo ------------------------------ + @echo Making: $@ + @echo WEP > $@ + @echo LIBMAIN >> $@ + @echo LibMain >> $@ + @echo Sbi >> $@ + @echo SvRTL >> $@ + @echo SbRtl_ >> $@ + +.ENDIF + +# ------------------------------------------------------------------------ +.ENDIF + +.INCLUDE : target.mk + + + diff --git a/basic/workben/mgrtest.cxx b/basic/workben/mgrtest.cxx new file mode 100644 index 000000000000..bcc5643f3903 --- /dev/null +++ b/basic/workben/mgrtest.cxx @@ -0,0 +1,644 @@ +/************************************************************************* + * + * $RCSfile: mgrtest.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:12:12 $ + * + * 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 _SV_SVAPP_HXX //autogen +#include <vcl/svapp.hxx> +#endif +#ifndef _SV_WRKWIN_HXX //autogen +#include <vcl/wrkwin.hxx> +#endif +#ifndef _SV_TOOLBOX_HXX //autogen +#include <vcl/toolbox.hxx> +#endif +#ifndef _SV_MSGBOX_HXX //autogen +#include <vcl/msgbox.hxx> +#endif +#ifndef _SV_SOUND_HXX //autogen +#include <vcl/sound.hxx> +#endif +#ifndef _BASMGR_HXX //autogen +#include <basic/basmgr.hxx> +#endif +#ifndef _SVSTOR_HXX //autogen +#include <so3/svstor.hxx> +#endif +#ifndef _SBXCLASS_HXX //autogen +#include <svtools/sbx.hxx> +#endif +#ifndef _SB_SBMOD_HXX //autogen +#include <basic/sbmod.hxx> +#endif +#ifndef _BASRDLL_HXX //autogen +#include <basrdll.hxx> +#endif + +//#include <sv.hxx> +//#include <basic.hxx> +//#include <sostor.hxx> + +// Defines fuer ToolBox-Id's +#define TB_NEW 1 +#define TB_OPENSTORAGE 2 +#define TB_SAVESTORAGE 3 +#define TB_ORG 4 +#define TB_CREATELIB1 10 +#define TB_CREATELIB2 11 +#define TB_CREATELIB3 12 +#define TB_LOADLIB1 20 +#define TB_LOADLIB2 21 +#define TB_LOADLIB3 22 +#define TB_STORELIBX 30 +#define TB_UNLOADX 31 +#define TB_LOADX 32 +#define TB_EXECX 33 +#define TB_REMOVEX 34 +#define TB_REMOVEDELX 35 + +#define TB_LIB0 40 +#define TB_LIB1 41 +#define TB_LIB2 42 +#define TB_LIB3 43 + +const char* pLib1Str = "Lib1"; +const char* pLib2Str = "Lib2"; +const char* pLib3Str = "Lib3"; + +// Test-Applikation +class TestApp : public Application +{ +public: + virtual void Main( void ); + virtual void Main( int, char*[] ); +}; + +// Test-Fenster mit ToolBox zur Auswahl eines Tests +// und den typischerweise verwendeten virtuellen Methoden +class TestWindow : public WorkWindow +{ +private: + ToolBox aToolBox; + BasicManager* pBasMgr; + + void CheckError(); + USHORT nLibX; + DECL_LINK( BasicErrorHdl, StarBASIC * ); + + +public: + TestWindow(); + ~TestWindow(); + + virtual void Paint( const Rectangle& ); + virtual void Resize(); + virtual void KeyInput( const KeyEvent& rKeyEvt ); + virtual void MouseMove( const MouseEvent& rMEvt ); + virtual void MouseButtonDown( const MouseEvent& rMEvt ); + virtual void MouseButtonUp( const MouseEvent& rMEvt ); + + DECL_LINK( TBSelect, ToolBox * ); + void UpdateToolBox(); + void ShowInfo(); +}; + +TestWindow::~TestWindow() +{ +} + +TestWindow::TestWindow() : + WorkWindow( NULL, WB_APP | WB_STDWORK | WB_SVLOOK | WB_CLIPCHILDREN ) , + aToolBox( this, WinBits( WB_BORDER | WB_SVLOOK | WB_SCROLL | WB_LINESPACING ) ) +{ + nLibX = 0; + + aToolBox.SetButtonType( BUTTON_TEXT ); + aToolBox.SetLineCount( 2 ); + aToolBox.SetPosPixel( Point( 0, 0 ) ); + aToolBox.SetSelectHdl( LINK( this, TestWindow, TBSelect ) ); + + Font aFont; + aFont.SetName( "Helv" ); + aFont.SetSize( Size( 0, 6 ) ); + aFont.SetPitch( PITCH_VARIABLE ); + aFont.SetFamily( FAMILY_SWISS ); + aFont.SetTransparent( TRUE ); + aFont.SetAlign( ALIGN_TOP ); + aToolBox.SetFont( aFont ); + SetFont( aFont ); + + aToolBox.InsertItem( TB_NEW, "New" ); + aToolBox.SetHelpText( TB_NEW, "New BasicManager" ); + aToolBox.InsertItem( TB_OPENSTORAGE, "Load" ); + aToolBox.SetHelpText( TB_OPENSTORAGE, "Load Storage D:\\MYSTORE.SVS" ); + aToolBox.InsertItem( TB_SAVESTORAGE, "Save" ); + aToolBox.SetHelpText( TB_SAVESTORAGE, "Save Storage D:\\MYSTORE.SVS" ); + + aToolBox.InsertSeparator(); + + aToolBox.InsertItem( TB_ORG, "Verwalten" ); + aToolBox.SetHelpText( TB_ORG, "Libaries verwalten" ); + + aToolBox.InsertSeparator(); + + aToolBox.InsertItem( TB_LIB0, "0" ); + aToolBox.SetHelpText( TB_LIB0, "Aktuelle Lib: STANDARD" ); + aToolBox.InsertItem( TB_LIB1, "1" ); + aToolBox.SetHelpText( TB_LIB1, "Aktuelle Lib: 1" ); + aToolBox.InsertItem( TB_LIB2, "2" ); + aToolBox.SetHelpText( TB_LIB2, "Aktuelle Lib: 2" ); + aToolBox.InsertItem( TB_LIB3, "3" ); + aToolBox.SetHelpText( TB_LIB3, "Aktuelle Lib: 3" ); + + aToolBox.InsertBreak(); + aToolBox.InsertItem( TB_CREATELIB1, "CreateLib1" ); + aToolBox.SetHelpText( TB_CREATELIB1, "Create Libary LIB1" ); + aToolBox.InsertItem( TB_CREATELIB2, "CreateLib2" ); + aToolBox.SetHelpText( TB_CREATELIB2, "Create Libary LIB2" ); + aToolBox.InsertItem( TB_CREATELIB3, "CreateLib3" ); + aToolBox.SetHelpText( TB_CREATELIB3, "Create Libary LIB3" ); + + aToolBox.InsertSeparator(); + aToolBox.InsertItem( TB_LOADLIB1, "LoadLib1" ); + aToolBox.SetHelpText( TB_LOADLIB1, "Load Libary LIB1" ); + aToolBox.InsertItem( TB_LOADLIB2, "LoadLib2" ); + aToolBox.SetHelpText( TB_LOADLIB2, "Load Libary LIB2" ); + aToolBox.InsertItem( TB_LOADLIB3, "LoadLib3" ); + aToolBox.SetHelpText( TB_LOADLIB3, "Load Libary LIB3" ); + + aToolBox.InsertSeparator(); + aToolBox.InsertItem( TB_STORELIBX, "StoreLibX" ); + aToolBox.SetHelpText( TB_STORELIBX, "Store Libary LIBX" ); + aToolBox.InsertItem( TB_UNLOADX, "UnloadX" ); + aToolBox.SetHelpText( TB_UNLOADX, "Unload Libary LIBX" ); + aToolBox.InsertItem( TB_LOADX, "LoadX" ); + aToolBox.SetHelpText( TB_LOADX, "Load Libary LIBX" ); + aToolBox.InsertItem( TB_EXECX, "ExecX" ); + aToolBox.SetHelpText( TB_EXECX, "Execute 'Libary' LIBX" ); + aToolBox.InsertItem( TB_REMOVEX, "RemoveX" ); + aToolBox.SetHelpText( TB_REMOVEX, "Remove Libary LIBX" ); + aToolBox.InsertItem( TB_REMOVEDELX, "RemDelX" ); + aToolBox.SetHelpText( TB_REMOVEDELX, "Remove and delete Libary LIBX" ); + + pBasMgr = 0; + + Show(); + UpdateToolBox(); + aToolBox.Show(); +} +void TestWindow::ShowInfo() +{ + Invalidate(); + Update(); + long nH = GetTextSize( "X" ).Height(); + if ( pBasMgr ) + { + Point aPos( 10, aToolBox.GetSizePixel().Height()+5 ); + for ( USHORT nLib = 0; nLib < pBasMgr->GetLibCount(); nLib++ ) + { + String aOutStr( nLib ); + aOutStr +=": "; + StarBASIC* pL = pBasMgr->GetLib( nLib ); + aOutStr += '['; + aOutStr += pBasMgr->GetLibName( nLib ); + aOutStr += "]<"; + if ( pL ) + aOutStr += pL->GetName(); + else + aOutStr += "NoLoaded"; + aOutStr += ">, Storage='"; + aOutStr += pBasMgr->GetLibStorageName( nLib ); + aOutStr += "', bLoaded="; + aOutStr += (USHORT)pBasMgr->IsLibLoaded( nLib ); + DrawText( aPos, aOutStr ); + aPos.Y() += nH; + } + } +} + +void TestWindow::UpdateToolBox() +{ + // Darstellung bestimmter Buttons als gecheckt oder disabled, + // falls fuer Test gewuenscht + aToolBox.EnableItem( TB_ORG, (BOOL)(ULONG)pBasMgr ); + + aToolBox.EnableItem( TB_CREATELIB1, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_CREATELIB2, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_CREATELIB3, (BOOL)(ULONG)pBasMgr ); + + aToolBox.EnableItem( TB_LOADLIB1, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_LOADLIB2, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_LOADLIB3, (BOOL)(ULONG)pBasMgr ); + + aToolBox.EnableItem( TB_STORELIBX, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_EXECX, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_UNLOADX, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_LOADX, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_REMOVEX, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_REMOVEDELX, (BOOL)(ULONG)pBasMgr ); + + aToolBox.CheckItem( TB_LIB0, nLibX == 0 ); + aToolBox.CheckItem( TB_LIB1, nLibX == 1 ); + aToolBox.CheckItem( TB_LIB2, nLibX == 2 ); + aToolBox.CheckItem( TB_LIB3, nLibX == 3 ); +} + +IMPL_LINK( TestWindow, TBSelect, ToolBox *, p ) +{ + USHORT nId = aToolBox.GetCurItemId(); + BOOL bChecked = aToolBox.IsItemChecked( nId ); + switch ( nId ) + { + case TB_NEW: + { + delete pBasMgr; + pBasMgr = new BasicManager( new StarBASIC ); + pBasMgr->SetStorageName( "d:\\mystore.svs" ); + } + break; + case TB_OPENSTORAGE: + { + delete pBasMgr; + SvStorageRef xStorage = new SvStorage( "d:\\mystore.svs", STREAM_READ | STREAM_SHARE_DENYWRITE ); + DBG_ASSERT( xStorage.Is(), "Kein Storage!" ); + pBasMgr = new BasicManager( *xStorage ); + } + break; + case TB_SAVESTORAGE: + { + if ( pBasMgr) + { + SvStorageRef xStorage = new SvStorage( "d:\\mystore.svs" ); + DBG_ASSERT( xStorage.Is(), "Kein Storage!" ); + pBasMgr->Store( *xStorage ); + } + } + break; + case TB_ORG: + { + if ( pBasMgr) + { + InfoBox( 0, "Organisieren..." ).Execute(); + } + } + break; + case TB_CREATELIB1: + { + if ( pBasMgr ) + { + USHORT nLib = pBasMgr->GetLibId( pBasMgr->CreateLib( pLib1Str ) ); + if ( nLib != LIB_NOTFOUND ) + { + pBasMgr->SetLibStorageName( nLib, "d:\\mystore.svs" ); + StarBASIC* pLib = pBasMgr->GetLib( pLib1Str ); + DBG_ASSERT( pLib, "Lib?!" ); + String aSource( "Sub SubInLib1Mod1\nprint\"XXX\"\nEnd Sub"); + SbModule* pM = pLib->MakeModule( "ModLib1", aSource ); + DBG_ASSERT( pM, "Modul?" ); + pLib->Compile( pM ); + } + else + InfoBox( 0, "CreateLibary fehlgeschlagen..." ).Execute(); + } + } + break; + case TB_CREATELIB2: + { + if ( pBasMgr ) + { + USHORT nLib = pBasMgr->GetLibId( pBasMgr->CreateLib( pLib2Str ) ); + if ( nLib != LIB_NOTFOUND ) + { + pBasMgr->SetLibStorageName( nLib, "d:\\mystore.svs" ); + StarBASIC* pLib = pBasMgr->GetLib( pLib2Str ); + DBG_ASSERT( pLib, "Lib?!" ); + SbModule* pM = pLib->MakeModule( "ModuleLib2", "Sub SubInLib2\n print \"Tralala\" \nEnd Sub\n" ); + pLib->Compile( pM ); + } + else + InfoBox( 0, "CreateLibary fehlgeschlagen..." ).Execute(); + } + } + break; + case TB_CREATELIB3: + { + if ( pBasMgr ) + { + // liegt in einem anderen Storage !!! + USHORT nLib = pBasMgr->GetLibId( pBasMgr->CreateLib( pLib3Str ) ); + if ( nLib != LIB_NOTFOUND ) + { + pBasMgr->SetLibStorageName( nLib, "d:\\mystore2.svs" ); + StarBASIC* pLib = pBasMgr->GetLib( pLib3Str ); + DBG_ASSERT( pLib, "Lib?!" ); + SbModule* pM = pLib->MakeModule( "ModuleLib2", "Sub XYZInLib3\n print \"?!\" \nEnd Sub\n" ); + pLib->Compile( pM ); + } + else + InfoBox( 0, "CreateLibary fehlgeschlagen..." ).Execute(); + } + } + break; + case TB_LOADLIB1: + { + if ( pBasMgr ) + { + SvStorageRef xStorage = new SvStorage( "d:\\mystore.svs" ); + if ( !pBasMgr->AddLib( *xStorage, pLib1Str, FALSE ) ) + Sound::Beep(); + } + } + break; + case TB_LOADLIB2: + { + if ( pBasMgr ) + { + SvStorageRef xStorage = new SvStorage( "d:\\mystore.svs" ); + if ( !pBasMgr->AddLib( *xStorage, pLib2Str, FALSE ) ) + Sound::Beep(); + } + } + break; + case TB_LOADLIB3: + { + if ( pBasMgr ) + { + // liegt in einem anderen Storage !!! + SvStorageRef xStorage = new SvStorage( "d:\\mystore2.svs" ); + if ( !pBasMgr->AddLib( *xStorage, pLib3Str, FALSE ) ) + Sound::Beep(); + } + } + break; + case TB_STORELIBX: + { + if ( pBasMgr ) + pBasMgr->StoreLib( nLibX ); + } + break; + case TB_UNLOADX: + { + if ( pBasMgr ) + pBasMgr->UnloadLib( nLibX ); + } + break; + case TB_LOADX: + { + if ( pBasMgr ) + pBasMgr->LoadLib( nLibX ); + } + break; + case TB_REMOVEX: + { + if ( pBasMgr ) + pBasMgr->RemoveLib( nLibX, FALSE ); + } + break; + case TB_REMOVEDELX: + { + if ( pBasMgr ) + pBasMgr->RemoveLib( nLibX, TRUE ); + } + break; + case TB_EXECX: + { + if ( pBasMgr ) + { + StarBASIC* pBasic = pBasMgr->GetLib( nLibX ); + if ( pBasic && pBasic->GetModules()->Count() ) + { + pBasic->SetErrorHdl( LINK( this, TestWindow, BasicErrorHdl ) ); + + SbModule* pMod = (SbModule*)pBasic->GetModules()->Get( 0 ); + if ( pMod && pMod->GetMethods()->Count() ) + pMod->GetMethods()->Get(0)->GetInteger(); + } + } + } + break; + + case TB_LIB0: nLibX = 0; + break; + case TB_LIB1: nLibX = 1; + break; + case TB_LIB2: nLibX = 2; + break; + case TB_LIB3: nLibX = 3; + break; + } + + UpdateToolBox(); + CheckError(); + ShowInfo(); + return 0; +} + +void TestWindow::CheckError() +{ + if ( pBasMgr ) + { + BasicError* pError = pBasMgr->GetFirstError(); + while ( pError ) + { + String aErrorStr; + String aReasonStr; + switch ( pError->GetErrorId() ) + { + case BASERR_ID_STDLIBOPEN: + aErrorStr = "Standard-Lib konnte nicht geoffnet werden."; + break; + case BASERR_ID_STDLIBSAVE: + aErrorStr = "Standard-Lib konnte nicht gespeichert werden."; + break; + case BASERR_ID_LIBLOAD: + aErrorStr = "Lib konnte nicht geoffnet werden."; + break; + case BASERR_ID_LIBCREATE: + aErrorStr = "Lib konnte nicht erzeugt werden."; + break; + case BASERR_ID_LIBSAVE: + aErrorStr = "Lib konnte nicht gespeichert werden."; + break; + case BASERR_ID_MGROPEN: + aErrorStr = "Manager konnte nicht geladen werden."; + break; + case BASERR_ID_MGRSAVE: + aErrorStr = "Manager konnte nicht gespeichert werden."; + break; + case BASERR_ID_UNLOADLIB: + aErrorStr = "Libary konnte nicht entladen werden."; + break; + case BASERR_ID_REMOVELIB: + aErrorStr = "Libary konnte nicht entfernt werden."; + break; + default: + aErrorStr = "Unbekannter Fehler!"; + } + + switch ( pError->GetReason() ) + { + case BASERR_REASON_OPENSTORAGE: + aReasonStr = "Der Storage konnte nicht geoeffnet werden"; + break; + case BASERR_REASON_OPENLIBSTORAGE: + aReasonStr = "Der Lib-Storage konnte nicht geoeffnet werden"; + break; + case BASERR_REASON_OPENMGRSTREAM: + aReasonStr = "Der Manager-Stream konnte nicht geoeffnet werden"; + break; + case BASERR_REASON_OPENLIBSTREAM: + aReasonStr = "Der Basic-Stream konnte nicht geoeffnet werden"; + break; + case BASERR_REASON_STDLIB: + aReasonStr = "STANDARD-Lib"; + break; + case BASERR_REASON_BASICLOADERROR: + aReasonStr = "Fehler beim Laden des Basics"; + default: + aReasonStr = " - "; + } + + String aErr( aErrorStr ); + aErr += "\nGrund: "; + aErr += aReasonStr; + InfoBox( 0, aErr ).Execute(); + + pError = pBasMgr->GetNextError(); + } + pBasMgr->ClearErrors(); + } +} + +void __EXPORT TestWindow::Paint( const Rectangle& rRec ) +{ +} + +void __EXPORT TestWindow::Resize() +{ + Size aTBSz = aToolBox.CalcWindowSizePixel(); + aToolBox.SetSizePixel( Size( GetOutputSizePixel().Width(), aTBSz.Height()) ); + Invalidate(); + ShowInfo(); +} + +void __EXPORT TestWindow::KeyInput( const KeyEvent& rKEvt ) +{ + char nCharCode = rKEvt.GetCharCode(); + USHORT nCode = rKEvt.GetKeyCode().GetCode(); + + // Nur bei Alt-Return + if ( ( nCode == KEY_RETURN ) && rKEvt.GetKeyCode().IsMod2() ) + ; + else + WorkWindow::KeyInput( rKEvt ); + + UpdateToolBox(); +} + +void __EXPORT TestWindow::MouseMove( const MouseEvent& rMEvt ) +{ +} + +void __EXPORT TestWindow::MouseButtonDown( const MouseEvent& rMEvt ) +{ + ShowInfo(); +} + +void __EXPORT TestWindow::MouseButtonUp( const MouseEvent& rMEvt ) +{ + UpdateToolBox(); +} + +IMPL_LINK( TestWindow, BasicErrorHdl, StarBASIC *, pBasic ) +{ + String aErrorText( pBasic->GetErrorText() ); + + String aErrorTextPrefix; + if( pBasic->IsCompilerError() ) + { + aErrorTextPrefix = "Compilererror: "; + } + else + { + aErrorTextPrefix = "Runtimeerror: "; + aErrorTextPrefix += pBasic->GetErrorCode(); + aErrorTextPrefix += " "; + } + + InfoBox( 0, String( aErrorTextPrefix + aErrorText ) ).Execute(); + return 0; +} + +void __EXPORT TestApp::Main( void ) +{ + Main( 0, NULL ); +} + +void __EXPORT TestApp::Main( int, char*[] ) +{ + BasicDLL aBasiDLL; + SvFactory::Init(); + EnableSVLook(); + TestWindow aWindow; + Execute(); + SvFactory::DeInit(); +} + + +TestApp aTestApp; |