diff options
Diffstat (limited to 'rsc/inc')
-rw-r--r-- | rsc/inc/pch/precompiled_rsc.cxx | 32 | ||||
-rw-r--r-- | rsc/inc/pch/precompiled_rsc.hxx | 35 | ||||
-rw-r--r-- | rsc/inc/rscall.h | 115 | ||||
-rw-r--r-- | rsc/inc/rscarray.hxx | 139 | ||||
-rw-r--r-- | rsc/inc/rscclass.hxx | 142 | ||||
-rw-r--r-- | rsc/inc/rscclobj.hxx | 115 | ||||
-rw-r--r-- | rsc/inc/rscconst.hxx | 113 | ||||
-rw-r--r-- | rsc/inc/rsccont.hxx | 156 | ||||
-rw-r--r-- | rsc/inc/rscdb.hxx | 362 | ||||
-rw-r--r-- | rsc/inc/rscdef.hxx | 277 | ||||
-rw-r--r-- | rsc/inc/rscerror.h | 165 | ||||
-rw-r--r-- | rsc/inc/rscflag.hxx | 109 | ||||
-rw-r--r-- | rsc/inc/rschash.hxx | 57 | ||||
-rw-r--r-- | rsc/inc/rscinst.hxx | 247 | ||||
-rw-r--r-- | rsc/inc/rsckey.hxx | 64 | ||||
-rw-r--r-- | rsc/inc/rsclst.hxx | 70 | ||||
-rw-r--r-- | rsc/inc/rscmgr.hxx | 83 | ||||
-rw-r--r-- | rsc/inc/rscpar.hxx | 95 | ||||
-rw-r--r-- | rsc/inc/rscrange.hxx | 212 | ||||
-rw-r--r-- | rsc/inc/rscrsc.hxx | 141 | ||||
-rw-r--r-- | rsc/inc/rscsfx.hxx | 65 | ||||
-rw-r--r-- | rsc/inc/rscstr.hxx | 82 | ||||
-rw-r--r-- | rsc/inc/rsctools.hxx | 204 | ||||
-rw-r--r-- | rsc/inc/rsctop.hxx | 250 | ||||
-rw-r--r-- | rsc/inc/rsctree.hxx | 121 | ||||
-rw-r--r-- | rsc/inc/vclrsc.hxx | 348 |
26 files changed, 3799 insertions, 0 deletions
diff --git a/rsc/inc/pch/precompiled_rsc.cxx b/rsc/inc/pch/precompiled_rsc.cxx new file mode 100644 index 000000000000..2f62f82c5896 --- /dev/null +++ b/rsc/inc/pch/precompiled_rsc.cxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: precompiled_rsc.cxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_rsc.hxx" + diff --git a/rsc/inc/pch/precompiled_rsc.hxx b/rsc/inc/pch/precompiled_rsc.hxx new file mode 100644 index 000000000000..01886ac647cf --- /dev/null +++ b/rsc/inc/pch/precompiled_rsc.hxx @@ -0,0 +1,35 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: precompiled_rsc.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): Generated on 2006-09-01 17:49:55.014369 + +#ifdef PRECOMPILED_HEADERS +#endif + diff --git a/rsc/inc/rscall.h b/rsc/inc/rscall.h new file mode 100644 index 000000000000..e3abe2673de7 --- /dev/null +++ b/rsc/inc/rscall.h @@ -0,0 +1,115 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscall.h,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCALL_H +#define _RSCALL_H + +#include <tools/string.hxx> +#include <rsctools.hxx> +#include <rscerror.h> +#include <rscdef.hxx> +#include <rschash.hxx> +#include <rtl/alloc.h> + +/******************* T y p e s *******************************************/ +typedef char * CLASS_DATA; // Zeiger auf die Daten einer Klasse + +/******************* C l a s s e s F o r w a r d s *********************/ +class RscCompiler; +class RscTop; +class RscTypCont; +class RscIncList; + +/******************* G l o b a l V a r i a b l e s *********************/ +extern ByteString* pStdParType; +extern ByteString* pStdPar1; +extern ByteString* pStdPar2; +extern ByteString* pWinParType; +extern ByteString* pWinPar1; +extern ByteString* pWinPar2; +extern sal_uInt32 nRefDeep; +extern sal_uInt32 nRsc_XYMAPMODEId; +extern sal_uInt32 nRsc_WHMAPMODEId; +extern sal_uInt32 nRsc_X; +extern sal_uInt32 nRsc_Y; +extern sal_uInt32 nRsc_WIDTH; +extern sal_uInt32 nRsc_HEIGHT; +extern sal_uInt32 nRsc_DELTALANG; +extern sal_uInt32 nRsc_DELTASYSTEM; +extern sal_uInt32 nRsc_EXTRADATA; +extern AtomContainer* pHS; + +/******************* D e f i n e s ***************************************/ + +#define HELP_FLAG 0x0001 // Hilfe anzeigen +#define NOPREPRO_FLAG 0x0002 // kein Preprozesor +#define NOSYNTAX_FLAG 0x0004 // keine Syntaxanalyse +#define NOLINK_FLAG 0x0008 // nicht linken +#define NORESFILE_FLAG 0x0010 // keine .res-Datei erzeugen +#define DEFINE_FLAG 0x0020 // es wurde Definitionen angegeben +#define INCLUDE_FLAG 0x0040 // der Include-Pfad wurde erweitert +#define MSCPREPRO_FLAG 0x0080 // spezial Preprozessor +#define PRINTSYNTAX_FLAG 0x0100 // Syntax ausgeben +#define PRELOAD_FLAG 0x0200 // Alle Ressourcen Preloaden +#define SMART_FLAG 0x0400 // abgekuertze Name +#define SRSDEFAULT_FLAG 0x1000 // immer der Default geschrieben +#define NOSYSRESTEST_FLAG 0x2000 // ueberprueft nicht die Richtigkeit von (bmp, ico, cur) + + +/******************* T y p e s *******************************************/ +enum RSCCLASS_TYPE { RSCCLASS_BOOL, RSCCLASS_STRING, RSCCLASS_NUMBER, + RSCCLASS_CONST, RSCCLASS_COMPLEX, RSCCLASS_ENUMARRAY }; + +typedef void (* VarEnumCallbackProc)( void * pData, RSCCLASS_TYPE, Atom ); + +/******************* S t r u c t s ***************************************/ +struct RSCINST { + RscTop * pClass; + CLASS_DATA pData; + + RSCINST(){ pClass = NULL; pData = NULL; } + RSCINST( RscTop * pCl, CLASS_DATA pClassData ){ + pClass = pCl; + pData = pClassData; + } + BOOL IsInst() const { return( pData != NULL ); } +}; + +/********************** S U B I N F O S T R U C T ************************/ +struct SUBINFO_STRUCT { + SUBINFO_STRUCT(){ nPos = 0; pClass = NULL; }; + RscId aId; // Identifier der Resource + sal_uInt32 nPos; // Position der Resource + RscTop * pClass; // Klasse des Eintrages +}; + +/******************* F u n c t i o n *************************************/ +void InitRscCompiler(); + +#endif // _RSCALL_H diff --git a/rsc/inc/rscarray.hxx b/rsc/inc/rscarray.hxx new file mode 100644 index 000000000000..b9269d6460a8 --- /dev/null +++ b/rsc/inc/rscarray.hxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscarray.hxx,v $ + * $Revision: 1.8 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCARRAY_HXX +#define _RSCARRAY_HXX + +#include <rscall.h> +#include <rscerror.h> +#include <rsctop.hxx> + +class RscEnum; + +/******************* R s c A r r a y ************************************/ +class RscInstNode : public IdNode +{ + sal_uInt32 nTypeId; +protected: + using NameNode::Search; +public: + RSCINST aInst; + RscInstNode( sal_uInt32 nId ); + ~RscInstNode(); + virtual sal_uInt32 GetId() const; + RscInstNode * Left() const { return (RscInstNode *)pLeft ; }; + RscInstNode * Right() const{ return (RscInstNode *)pRight ; }; + RscInstNode * Search( sal_uInt32 nId ) const + { + return (RscInstNode *)IdNode::Search( nId ); + } +}; + +struct RscArrayInst +{ + RscInstNode * pNode; +}; + +/* Der Baum wird ueber die Werte des Enums sortiert, nicht ueber + seine HashId. +*/ +class RscArray : public RscTop +{ +protected: + RscEnum * pTypeClass; // Typ der Eintraege + sal_uInt32 nSize; // Groesse der Instanzdaten dieser Klasse + // mit Superklassen + sal_uInt32 nOffInstData;// Offset auf eigen Instanzdaten + void WriteSrcArray( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); +public: + RscArray( Atom nId, sal_uInt32 nTypId, + RscTop * pSuper, RscEnum * pTypeClass ); + ~RscArray(); + virtual RSCCLASS_TYPE GetClassType() const; + + void SetTypeClass( RscEnum * pClass ) + { + pTypeClass = pClass; + } + virtual RscTop * GetTypeClass() const; + RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL ); + void Destroy( const RSCINST & rInst ); + virtual ERRTYPE GetValueEle( const RSCINST & rInst, INT32 lValue, + RscTop * pCreateClass, + RSCINST * pGetInst ); + virtual ERRTYPE GetArrayEle( const RSCINST & rInst, Atom nId, + RscTop * pCreateClass, + RSCINST * pGetInst ); + + // Gibt die Groesse der Klasse in Bytes + sal_uInt32 Size(){ return( nSize ); }; + + BOOL IsConsistent( const RSCINST & rInst, RscInconsList * pList ); + virtual void SetToDefault( const RSCINST & rInst ); + BOOL IsDefault( const RSCINST & rInst ); + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + + virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, + const RscId & aId, const char * ); + void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + virtual void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); +}; + +class RscClassArray : public RscArray +{ +public: + RscClassArray( Atom nId, sal_uInt32 nTypId, + RscTop * pSuper, RscEnum * pTypeClass ); + ~RscClassArray(); + virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, + const RscId & aId, const char * ); + void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + virtual ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, const RscId & aId, + sal_uInt32 nDeep, BOOL bExtra ); +}; + + +class RscLangArray : public RscArray +{ +public: + RscLangArray( Atom nId, sal_uInt32 nTypId, + RscTop * pSuper, RscEnum * pTypeClass ); + virtual RSCCLASS_TYPE GetClassType() const; +}; + +#endif //_RSCARRAY diff --git a/rsc/inc/rscclass.hxx b/rsc/inc/rscclass.hxx new file mode 100644 index 000000000000..ad077b4233a4 --- /dev/null +++ b/rsc/inc/rscclass.hxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscclass.hxx,v $ + * $Revision: 1.7 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCCLASS_HXX +#define _RSCCLASS_HXX + +#include <rscall.h> +#include <rscerror.h> +#include <rschash.hxx> +#include <rsctop.hxx> + +/******************* R s c C l a s s *************************************/ +class RscClass : public RscTop +{ +protected: + struct RscClassInst{ + ULONG nVarDflt; + }; + struct VARTYPE_STRUCT { + Atom nVarName; // Variablenname + RSCVAR nVarType; // Variablentyp + sal_uInt32 nMask; // Maskierungsbit + sal_uInt32 nOffset; // Beginn der Instanzdaten + RscTop * pClass; // Klasse + CLASS_DATA pDefault; // Zeiger auf DefaultDaten + Atom nDataBaseName;//Name fuer Fremddatenbereich + }; + sal_uInt32 nSuperSize; // Groesse der Instanzdaten der SuperKl. + sal_uInt32 nSize; // Groesse der Instanzdaten dieser Klasse + // mit Superklassen + sal_uInt32 nEntries; // Eintraege in pVarTypeList + VARTYPE_STRUCT * pVarTypeList; // Variablenliste + RSCINST GetInstData( CLASS_DATA pData, sal_uInt32 nEle, + BOOL bGetCopy = FALSE ); + CLASS_DATA GetDfltData( sal_uInt32 nEle ); + BOOL IsDflt( CLASS_DATA pData, sal_uInt32 nEle ); + BOOL IsValueDflt( CLASS_DATA pData, sal_uInt32 nEle ); + void SetVarDflt( CLASS_DATA pData, sal_uInt32 nEle, + BOOL bSet ); + INT32 GetCorrectValues( const RSCINST & rInst, sal_uInt32 nVarPos, + sal_uInt32 nTupelIdx, RscTypCont * pTC ); +public: + RscClass( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl ); + ~RscClass(); + + virtual RSCCLASS_TYPE GetClassType() const; + + void Pre_dtor(); + ERRTYPE SetVariable( Atom nVarName, RscTop * pClass, + RSCINST * pDflt, + RSCVAR nVarType, sal_uInt32 nMask, + Atom nDataBaseName ); + virtual void EnumVariables( void * pData, VarEnumCallbackProc ); + RSCINST GetVariable( const RSCINST & rInst, Atom nVarName, + const RSCINST & rInitInst, + BOOL nInitDflt = FALSE, + RscTop * pCreateClass = NULL ); + RSCINST GetCopyVar( const RSCINST & rInst, Atom nVarName ); + + // Gibt die Groesse der Klasse in Bytes + sal_uInt32 Size(){ return( nSize ); }; + + BOOL IsConsistent( const RSCINST & rInst, RscInconsList * pList ); + void SetToDefault( const RSCINST & rInst ); + BOOL IsDefault( const RSCINST & rInst ); + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + void SetDefault( const RSCINST & rData, Atom nVarId ); + using RscTop::GetDefault; + RSCINST GetDefault( Atom nVarId ); + + RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL ); + void Destroy( const RSCINST & rInst ); + void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteInstRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + void WriteSyntax( FILE * fOutput, RscTypCont * pTC ); + + void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); + void WriteRcCtor( FILE * fOutput, RscTypCont * pTC ); +}; + +class RscSysDepend : public RscClass +{ +public: + RscSysDepend( Atom nId, sal_uInt32 nTypId, RscTop * pSuper ); + ERRTYPE WriteSysDependRc( const RSCINST &, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra, + BOOL bFirst = FALSE ); + ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); +}; + +class RscFirstSysDepend : public RscSysDepend +{ +public: + RscFirstSysDepend( Atom nId, sal_uInt32 nTypId, + RscTop * pSuper ); + ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); +}; + +class RscTupel : public RscClass +{ +public: + RscTupel( Atom nId, sal_uInt32 nTypId, RscTop * pSuper ); + RSCINST GetTupelVar( const RSCINST & rInst, sal_uInt32 nPos, + const RSCINST & rInitInst ); + void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); +}; + +#endif //_RSCCLASS_HXX diff --git a/rsc/inc/rscclobj.hxx b/rsc/inc/rscclobj.hxx new file mode 100644 index 000000000000..ab31de2eaf32 --- /dev/null +++ b/rsc/inc/rscclobj.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscclobj.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCCLOBJ_HXX +#define _RSCCLOBJ_HXX + +#include <rsctree.hxx> +#include <rscdef.hxx> +#include <rscall.h> + +/****************** C L A S S E S ****************************************/ +class RscTypCont; + +/*********** R s c I n c o n s i s t e n t *******************************/ +class RscInconsistent { +public: + RscId aFirstId; //Paar von inkonsistenten Id's + RscId aSecondId; + RscInconsistent( const RscId & rFirst, const RscId & rSecond ){ + aFirstId = rFirst; + aSecondId = rSecond; + }; +}; + +DECLARE_LIST( RscInconsList, RscInconsistent * ) + +/******************* O b j N o d e ***************************************/ +class ObjNode : public IdNode{ + RscId aRscId; // Id der Resource + CLASS_DATA pRscObj;// pointer to a resourceobject + ULONG lFileKey;// Dateischluessel +protected: + using NameNode::Search; + +public: + using NameNode::Insert; + + ObjNode( const RscId & rId, CLASS_DATA pData, ULONG lKey ); + ObjNode * DelObjNode( RscTop * pClass, ULONG lFileKey ); + sal_uInt32 GetId() const; + RscId GetRscId(){ return( aRscId ); } + ULONG GetFileKey(){ return lFileKey; }; + ObjNode* Search( const RscId &rName ) const{ + // search the index in the b-tree + return( (ObjNode *)IdNode::Search( rName ) ); + } + BOOL Insert( ObjNode* pTN ){ + // insert a new node in the b-tree + return( IdNode::Insert( (IdNode *)pTN ) ); + } + CLASS_DATA GetRscObj(){ + // get the Object from this Node + return( pRscObj ); + } + BOOL IsConsistent( RscInconsList * pList = NULL ); +}; + +/******************* R e f N o d e ***************************************/ +class RefNode : public IdNode{ + Atom nTypNameId; // index of a Name in a hashtabel +protected: + using NameNode::Search; + +public: + using NameNode::Insert; + + ObjNode* pObjBiTree; // Zeiger auf Objektbaum + RefNode( Atom nTyp ); + sal_uInt32 GetId() const; + RefNode* Search( Atom typ ) const{ + // search the index in the b-tree + return( (RefNode *)IdNode::Search( typ ) ); + }; + BOOL Insert( RefNode* pTN ){ + // insert a new node in the b-tree + return( IdNode::Insert( (IdNode *)pTN ) ); + }; + BOOL PutObjNode( ObjNode * pPutObject ); + + // insert new node in b-tree pObjBiTree + ObjNode * GetObjNode( const RscId &rRscId ); + + ObjNode * GetObjNode(){ + // hole pObjBiTree + return( pObjBiTree ); + }; +}; + +#endif // _RSCCLOBJ_HXX diff --git a/rsc/inc/rscconst.hxx b/rsc/inc/rscconst.hxx new file mode 100644 index 000000000000..27a0b5453326 --- /dev/null +++ b/rsc/inc/rscconst.hxx @@ -0,0 +1,113 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscconst.hxx,v $ + * $Revision: 1.8 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCCONST_HXX +#define _RSCCONST_HXX + +#include <rscall.h> +#include <rscerror.h> +#include <rschash.hxx> +#include <rsctop.hxx> + +/******************* R s c C o n s t *************************************/ +class RscConst : public RscTop +{ +protected: + struct VarEle { + Atom nId; // Name der Konstante + INT32 lValue; // Wert der Konstante + }; + VarEle * pVarArray; // Zeiger auf das Feld mit Konstanten + sal_uInt32 nEntries; // Anzahle der Eintraege im Feld +public: + RscConst( Atom nId, sal_uInt32 nTypId ); + ~RscConst(); + virtual RSCCLASS_TYPE GetClassType() const; + sal_uInt32 GetEntryCount() const { return nEntries; } + // Die erlaubten Werte werden gesetzt + ERRTYPE SetConstant( Atom nVarName, INT32 lValue ); + Atom GetConstant( sal_uInt32 nPos ); + BOOL GetConstValue( Atom nConstId, INT32 * pVal ) const; + BOOL GetValueConst( INT32 nValue, Atom * pConstId ) const; + sal_uInt32 GetConstPos( Atom nConstId ); + virtual void WriteSyntax( FILE * fOutput, RscTypCont * pTC ); + virtual void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); +}; + +/******************* R s c E n u m ***************************************/ +class RscEnum : public RscConst { + struct RscEnumInst { + sal_uInt32 nValue; // Position der Konstanten im Array + BOOL bDflt; // Ist Default + }; + sal_uInt32 nSize; +public: + RscEnum( Atom nId, sal_uInt32 nTypId ); + RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL ); + sal_uInt32 Size(){ return nSize; } + + virtual void SetToDefault( const RSCINST & rInst ) + { + ((RscEnumInst*)rInst.pData)->bDflt = TRUE; + } + BOOL IsDefault( const RSCINST & rInst ) + { + return( ((RscEnumInst*)rInst.pData)->bDflt ); + }; + // Als Default setzen + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + + ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId, + INT32 nValue ); + ERRTYPE SetNumber( const RSCINST & rInst, INT32 nValue ); + ERRTYPE GetConst( const RSCINST & rInst, Atom * ); + ERRTYPE GetNumber( const RSCINST & rInst, INT32 * nValue ); + void WriteSrc( const RSCINST &rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); +}; + +class RscNameTable; + +sal_uInt32 GetLangId( const ByteString& alang); + +class RscLangEnum : public RscEnum +{ + long mnLangId; +public: + RscLangEnum(); + + void Init( RscNameTable& rNames ); + + Atom AddLanguage( const char* pLang, RscNameTable& rNames ); +}; + +#endif // _RSCCONST_HXX diff --git a/rsc/inc/rsccont.hxx b/rsc/inc/rsccont.hxx new file mode 100644 index 000000000000..e5a509205afc --- /dev/null +++ b/rsc/inc/rsccont.hxx @@ -0,0 +1,156 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rsccont.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCCONT_HXX +#define _RSCCONT_HXX + +#include <rscall.h> +#include <rscerror.h> +#include <rsctop.hxx> + +/******************* R s c B a s e C o n t *******************************/ +struct ENTRY_STRUCT { + RscId aName; + RSCINST aInst; + void Create(){ aName.Create(); aInst = RSCINST(); } + void Destroy(); +}; +struct RscBaseContInst { + sal_uInt32 nEntries; + ENTRY_STRUCT * pEntries; + BOOL bDflt; +}; + +class RscBaseCont : public RscTop +{ +protected: + RscTop * pTypeClass; // Typ der Eintraege + RscTop * pTypeClass1;// Zwei verschiedene Typen moeglich + BOOL bNoId; // Keine Identifier + sal_uInt32 nSize; // Groesse der Instanzdaten dieser Klasse + // mit Superklassen + sal_uInt32 nOffInstData;// Offset auf eigen Instanzdaten + void DestroyElements( RscBaseContInst * pClassData ); + RSCINST SearchElePos( const RSCINST & rInst, const RscId & rEleName, + RscTop * pClass, sal_uInt32 nPos ); +protected: + void ContWriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE ContWriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + void ContWriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char *, BOOL nWriteSize ); +public: + RscBaseCont( Atom nId, sal_uInt32 nTypId, + RscTop * pSuper = NULL, + BOOL bNoId = TRUE ); + ~RscBaseCont(); + virtual RSCCLASS_TYPE GetClassType() const; + void SetTypeClass( RscTop * pClass, RscTop * pClass1 = NULL ) + { + pTypeClass = pClass; + pTypeClass1 = pClass1; + }; + RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL ); + void Destroy( const RSCINST & rInst ); + ERRTYPE GetElement( const RSCINST & rInst, const RscId & rEleName, + RscTop * pCreateClass, const RSCINST & rCreateInst, + RSCINST * pGetInst ); + RSCINST SearchEle( const RSCINST & rInst, const RscId & rEleName, + RscTop * pClass ); + sal_uInt32 GetCount( const RSCINST & rInst ); + RSCINST GetPosEle( const RSCINST & rInst, sal_uInt32 nPos ); + ERRTYPE MovePosEle( const RSCINST & rInst, sal_uInt32 nDestPos, + sal_uInt32 nSourcePos ); + virtual ERRTYPE SetPosRscId( const RSCINST & rInst, sal_uInt32 nPos, + const RscId & rRscId); + SUBINFO_STRUCT GetInfoEle( const RSCINST & rInst, sal_uInt32 nPos ); + ERRTYPE SetString( const RSCINST &, const char * pStr ); + ERRTYPE SetNumber( const RSCINST &, INT32 lValue ); + ERRTYPE SetBool( const RSCINST & rInst, BOOL bValue ); + ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId, + INT32 nValue ); + ERRTYPE SetRef( const RSCINST & rInst, const RscId & rRefId ); + + // Gibt die Groesse der Klasse in Bytes + sal_uInt32 Size(){ return( nSize ); }; + + BOOL IsConsistent( const RSCINST & rInst, RscInconsList * pList ); + void SetToDefault( const RSCINST & rInst ); + BOOL IsDefault( const RSCINST & rInst ); + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + + void Delete( const RSCINST & rInst, RscTop * pClass, + const RscId & rId ); + void DeletePos( const RSCINST & rInst, sal_uInt32 nPos ); + + void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32 , BOOL bExtra); + ERRTYPE WriteHxx( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId & rId ); + ERRTYPE WriteCxx( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId &rId ); +}; + +/******************* R s c C o n t W r i t e S r c ***********************/ +class RscContWriteSrc : public RscBaseCont +{ +public: + RscContWriteSrc( Atom nId, sal_uInt32 nTypId, + RscTop * pSuper = NULL, + BOOL bNoId = TRUE ); + void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); +}; + +/******************* R s c C o n t ***************************************/ +class RscCont : public RscContWriteSrc { +public: + RscCont( Atom nId, sal_uInt32 nTypId, + RscTop * pSuper = NULL, + BOOL bNoId = TRUE ); + ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); +}; + +/******************* R s c C o n t E x t r a D a t a *********************/ +class RscContExtraData : public RscContWriteSrc { +public: + RscContExtraData( Atom nId, sal_uInt32 nTypId, + RscTop * pSuper = NULL, + BOOL bNoId = TRUE ); + ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); +}; + +#endif //_RSCCONT_HXX diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx new file mode 100644 index 000000000000..53bde7298485 --- /dev/null +++ b/rsc/inc/rscdb.hxx @@ -0,0 +1,362 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscdb.hxx,v $ + * $Revision: 1.17 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RSCDB_HXX +#define _RSCDB_HXX + +#include <rscall.h> +#include <rsckey.hxx> +#include <rscconst.hxx> +#include <rscflag.hxx> +#include <rscrange.hxx> +#include <rscstr.hxx> +#include <rscarray.hxx> +#include <rscdef.hxx> + +#include <vector> +#include <map> + +class RscError; +class REResourceList; +class RscTupel; +class RscCont; +class RscCmdLine; + +struct WriteRcContext +{ + FILE * fOutput; + rtl::OString aOutputRc; + rtl::OString aOutputSysList; + RscCmdLine* pCmdLine; +}; + +/****************** R s c T y p C o n ************************************/ +// Liste die alle Basistypen enthaelt +DECLARE_LIST( RscBaseList, RscTop * ) + +// Tabelle fuer Systemabhaengige Resourcen +struct RscSysEntry +{ + sal_uInt32 nKey; + sal_uInt32 nRscTyp; + ByteString aFileName; + sal_uInt32 nTyp; + sal_uInt32 nRefId; +}; +DECLARE_LIST( RscSysList, RscSysEntry * ) + +class RscTypCont +{ + CharSet nSourceCharSet; + sal_uInt32 nMachineId; // Globaler Maschinentyp + RSCBYTEORDER_TYPE nByteOrder; // Intel oder + ByteString aLanguage; // output language + std::vector< sal_uInt32 > aLangFallbacks; // language fallback list (entry 0 is language itself) + ByteString aSearchPath; // Suchen der Bitmap, Icon, Pointer + ByteString aSysSearchPath; // aSearchPath plus language specific paths + sal_uInt32 nUniqueId; // eindeutiger Id fuer Systemresourcen + ULONG nFilePos; // Position in der Datei ( MTF ) + sal_uInt32 nPMId; // eindeutiger Id fuer PM-Rseourcefile + // muss groesser als RSC_VERSIONCONTROL_ID sein + RscTop * pRoot; // Zeiger auf die Wurzel vom Typenbaum + RSCINST aVersion; // Versionskontrollinstanz + + RscBaseList aBaseLst; // Liste der einfachen Resourceklasse + RscSysList aSysLst; // Liste der Systemresourcen + + Atom nWinBitVarId; // Name der Winbitvariablen + Atom nBorderId; + Atom nHideId; + Atom nClipChildrenId; + Atom nSizeableId; + Atom nMoveableId; + Atom nMinimizeId; + Atom nMaximizeId; + Atom nCloseableId; + Atom nAppId; + Atom nTabstopId; + Atom nGroupId; + Atom nSysmodalId; + Atom nLeftId; + Atom nCenterId; + Atom nRightId; + Atom nTopId; + Atom nVCenterId; + Atom nBottomId; + Atom nHScrollId; + Atom nVScrollId; + Atom nSortId; + Atom nDefaultId; + Atom nSVLookId; + Atom nRepeatId; + Atom nDropDownId; + Atom nPassWordId; + Atom nReadOnlyId; + Atom nAutoSizeId; + Atom nSpinId; + Atom nTabControlId; + Atom nSimpleModeId; + Atom nDragId; + Atom nScrollId; + Atom nZoomableId; + Atom nHideWhenDeactivateId; + Atom nAutoHScrollId; + Atom nAutoVScrollId; + Atom nDDExtraWidthId; + Atom nWordBreakId; + Atom nLeftLabelId; + Atom nHasLinesId; + Atom nHasButtonsId; + Atom nRectStyleId; + Atom nLineSpacingId; + Atom nSmallStyleId; + Atom nEnableResizingId; + Atom nDockableId; + Atom nScaleId; + Atom nIgnoreTabId; + Atom nNoSplitDrawId; + Atom nTopImageId; + Atom nNoLabelId; + Atom nVertId; + Atom nSingleLineId; + Atom nSysWinId; + + void Init(); // Initialisiert Klassen und Tabelle + void SETCONST( RscConst *, const char *, UINT32 ); + void SETCONST( RscConst *, Atom, UINT32 ); + RscEnum * InitLangType(); + RscEnum * InitFieldUnitsType(); + RscEnum * InitTimeFieldFormat(); + RscEnum * InitColor(); + RscEnum * InitMapUnit(); + RscEnum * InitKey(); + RscEnum * InitTriState(); + RscEnum * InitMessButtons(); + RscEnum * InitMessDefButton(); + RscTupel * InitGeometry(); + RscArray * InitLangGeometry( RscTupel * pGeo ); + RscArray * InitSystemGeometry( RscTupel * pGeo ); + RscCont * InitStringList(); + RscArray * InitLangStringList( RscCont * pStrLst ); + RscTupel * InitStringTupel(); + RscTupel * InitStringLongTupel(); + RscCont * InitStringTupelList( RscTupel * pStringTupel ); + RscCont * InitStringLongTupelList( RscTupel * pStringLongTupel ); + RscArray * InitLangStringTupelList( RscCont * pStrTupelLst ); + RscArray * InitLangStringLongTupelList( RscCont * pStrLongTupelLst ); + + RscTop * InitClassMgr(); + RscTop * InitClassString( RscTop * pSuper ); + RscTop * InitClassBitmap( RscTop * pSuper ); + RscTop * InitClassColor( RscTop * pSuper, RscEnum * pColor ); + RscTop * InitClassImage( RscTop * pSuper, RscTop *pClassBitmap, + RscTop * pClassColor ); + RscTop * InitClassImageList( RscTop * pSuper, RscTop *pClassBitmap, + RscTop * pClassColor, RscCont * pStrLst ); + RscTop * InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit, + RscArray * pLangGeo ); + RscTop * InitClassSystemWindow( RscTop * pSuper ); + RscTop * InitClassWorkWindow( RscTop * pSuper ); + RscTop * InitClassModalDialog( RscTop * pSuper ); + RscTop * InitClassModelessDialog( RscTop * pSuper ); + RscTop * InitClassControl( RscTop * pSuper ); + RscTop * InitClassCheckBox( RscTop * pSuper ); + RscTop * InitClassPushButton( RscTop * pSuper ); + RscTop * InitClassTriStateBox( RscTop * pSuper, RscEnum * pTriState ); + RscTop * InitClassMenuButton( RscTop * pSuper, RscTop * pClasMenu ); + RscTop * InitClassImageButton( RscTop * pSuper, RscTop * pClassImage, + RscEnum * pTriState ); + RscTop * InitClassEdit( RscTop * pSuper ); + RscTop * InitClassMultiLineEdit( RscTop * pSuper ); + RscTop * InitClassScrollBar( RscTop * pSuper ); + RscTop * InitClassListBox( RscTop * pSuper, RscArray * pStrLst ); + RscTop * InitClassMultiListBox( RscTop * pSuper ); + RscTop * InitClassComboBox( RscTop * pSuper, RscArray * pStrLst ); + RscTop * InitClassFixedText( RscTop * pSuper ); + RscTop * InitClassFixedBitmap( RscTop * pSuper, RscTop * pClassBitmap ); + RscTop * InitClassFixedImage( RscTop * pSuper, RscTop * pClassImage ); + RscTop * InitClassRadioButton( RscTop * pSuper ); + RscTop * InitClassImageRadioButton( RscTop * pSuper, RscTop * pClassImage ); + RscTop * InitClassKeyCode( RscTop * pSuper, RscEnum * pKey ); + RscTop * InitClassAccelItem( RscTop * pSuper, RscTop * pKeyCode ); + RscTop * InitClassAccel( RscTop * pSuper, RscTop * pClassAccelItem ); + RscTop * InitClassMenuItem( RscTop * pSuper, RscTop * pClassBitmap, + RscTop * pClassKeyCode ); + RscTop * InitClassMenu( RscTop * pSuper, RscTop * pMenuItem ); + RscTop * InitClassMessBox( RscTop * pSuper, + RscEnum * pMessButtons, + RscEnum * pMessDefButton ); + RscTop * InitClassSplitter( RscTop * pSuper ); + RscTop * InitClassSplitWindow( RscTop * pSuper ); + RscTop * InitClassTime( RscTop * pSuper ); + RscTop * InitClassDate( RscTop * pSuper ); + + RscTop * InitClassPatternFormatter( RscTop * pSuper ); + RscTop * InitClassNumericFormatter( RscTop * pSuper ); + RscTop * InitClassMetricFormatter( RscTop * pSuper, + RscEnum * pFieldUnits ); + RscTop * InitClassCurrencyFormatter( RscTop * pSuper, + RscEnum * pFieldUnits ); + RscTop * InitClassDateFormatter( RscTop * pSuper, RscTop * pClassDate ); + RscTop * InitClassTimeFormatter( RscTop * pSuper, RscTop * pClassTime, + RscEnum * pTimeFieldFormat ); + + RscTop * InitClassSpinField( RscTop * pSuper ); + RscTop * InitClassPatternField( RscTop * pSuper ); + RscTop * InitClassNumericField( RscTop * pSuper ); + RscTop * InitClassMetricField( RscTop * pSuper ); + RscTop * InitClassCurrencyField( const char * pClassName, sal_uInt32 nRT, + RscTop * pSuper ); + RscTop * InitClassDateField( RscTop * pSuper, RscTop * pClassDate ); + RscTop * InitClassTimeField( RscTop * pSuper, RscTop * pClassTime ); + RscTop * InitClassPatternBox( RscTop * pSuper ); + RscTop * InitClassNumericBox( RscTop * pSuper ); + RscTop * InitClassMetricBox( RscTop * pSuper ); + RscTop * InitClassCurrencyBox( const char * pClassName, sal_uInt32 nRT, + RscTop * pSuper ); + RscTop * InitClassDateBox( RscTop * pSuper, RscTop * pClassDate ); + RscTop * InitClassTimeBox( RscTop * pSuper, RscTop * pClassTime ); + + RscTop * InitClassDockingWindow( RscTop * pSuper, + RscEnum * pMapUnit ); + RscTop * InitClassToolBoxItem( RscTop * pSuper, RscTop * pClassBitmap, + RscTop * pClassImage, + RscEnum * pTriState ); + RscTop * InitClassToolBox( RscTop * pSuper, RscTop * pClassToolBoxItem, + RscTop * pClassImageList ); + RscTop * InitClassStatusBar( RscTop * pSuper ); + RscTop * InitClassMoreButton( RscTop * pSuper, RscEnum * pMapUnit ); + RscTop * InitClassFloatingWindow( RscTop * pSuper, + RscEnum * pMapUnit ); + RscTop * InitClassTabControlItem( RscTop * pSuper, + RscTop * pClassTabPage ); + RscTop * InitClassTabControl( RscTop * pSuper, + RscTop * pClassTabControlItem ); + RscTop * InitClassSfxStyleFamilyItem( RscTop * pSuper, + RscTop * pClassBitmap, + RscTop * pClassImage, + RscArray * pStrLst ); + RscTop * InitClassSfxTemplateDialog( RscTop * pSuper, + RscTop * pStyleFamily ); + RscTop * InitClassSfxSlotInfo( RscTop * pSuper ); + + void InsWinBit( RscTop * pClass, const ByteString & rName, + Atom nVal ); + void WriteInc( FILE * fOutput, ULONG lKey ); + +public: + RscBool aBool; + RscRange aShort; + RscRange aUShort; + RscLongRange aLong; + RscLongEnumRange aEnumLong; + RscIdRange aIdUShort; + RscIdRange aIdNoZeroUShort; + RscBreakRange aNoZeroShort; + RscRange a1to12Short; + RscRange a0to23Short; + RscRange a1to31Short; + RscRange a0to59Short; + RscRange a0to99Short; + RscRange a0to9999Short; + RscIdRange aIdLong; + RscString aString; + RscFlag aWinBits; + RscLangEnum aLangType; + RscLangArray aLangString; + RscLangArray aLangShort; + + Atom nAcceleratorType; + + RscError* pEH; // Fehlerhandler + RscNameTable aNmTb; // Tabelle fuer Namen + RscFileTab aFileTab; // Tabelle der Dateinamen + sal_uInt32 nFlags; + std::map<sal_uInt64, ULONG> aIdTranslator; //Ordnet Resourcetypen und Id's einen Id zu + //(unter PM), oder eine Dateiposition (MTF) + + RscTypCont( RscError *, RSCBYTEORDER_TYPE, const ByteString & rSearchPath, sal_uInt32 nFlags ); + ~RscTypCont(); + + Atom AddLanguage( const char* ); + + BOOL IsPreload() const + { return (nFlags & PRELOAD_FLAG) ? TRUE : FALSE; } + BOOL IsSmart() const + { return (nFlags & SMART_FLAG) ? TRUE : FALSE; } + BOOL IsSysResTest() const + { return (nFlags & NOSYSRESTEST_FLAG) ? FALSE : TRUE; } + BOOL IsSrsDefault() const + { return (nFlags & SRSDEFAULT_FLAG) ? TRUE : FALSE; } + ByteString ChangeLanguage( const ByteString& rNewLang ); + const std::vector< sal_uInt32 >& GetFallbacks() const + { return aLangFallbacks; } + + RSCBYTEORDER_TYPE GetByteOrder() const { return nByteOrder; } + CharSet GetSourceCharSet() const { return nSourceCharSet; } + CharSet SetSourceCharSet( CharSet aCharSet ) + { + CharSet aOld = nSourceCharSet; + nSourceCharSet = aCharSet; + return aOld; + } + void SetSearchPath( const ByteString & rStr) { aSearchPath = rStr; } + ByteString GetSearchPath() const { return aSearchPath; } + void SetSysSearchPath( const ByteString& rStr ) { aSysSearchPath = rStr; } + ByteString GetSysSearchPath() const { return aSysSearchPath; } + void InsertType( RscTop * pType ) + { + aBaseLst.Insert( pType, LIST_APPEND ); + } + RscTop * SearchType( Atom nTypId ); + RscTop * Search( Atom typ ); + CLASS_DATA Search( Atom typ, const RscId & rId ); + void Delete( Atom typ, const RscId & rId ); + // loescht alle Resourceobjekte diese Datei + void Delete( ULONG lFileKey ); + RscTop * GetRoot() { return( pRoot ); }; + sal_uInt32 PutSysName( sal_uInt32 nRscTyp, char * pName, sal_uInt32 nConst, + sal_uInt32 nId, BOOL bFirst ); + void ClearSysNames(); + ERRTYPE WriteRc( WriteRcContext& rContext ); + void WriteSrc( FILE * fOutput, ULONG nFileIndex, + CharSet nCharSet, BOOL bName = TRUE ); + ERRTYPE WriteHxx( FILE * fOutput, ULONG nFileKey); + ERRTYPE WriteCxx( FILE * fOutput, ULONG nFileKey, + const ByteString & rHxxName ); + void WriteSyntax( FILE * fOutput ); + void WriteRcCtor( FILE * fOutput ); + void FillNameIdList( REResourceList * pList, ULONG lFileKey ); + BOOL MakeConsistent( RscInconsList * pList ); + sal_uInt32 PutTranslatorKey( sal_uInt64 nKey ); + void IncFilePos( ULONG nOffset ){ nFilePos += nOffset; } +}; + +#endif diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx new file mode 100644 index 000000000000..dc0e79cd4514 --- /dev/null +++ b/rsc/inc/rscdef.hxx @@ -0,0 +1,277 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscdef.hxx,v $ + * $Revision: 1.7 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCDEF_HXX +#define _RSCDEF_HXX + +#ifndef _TOOLS_UNQIDX_HXX +#include <tools/unqidx.hxx> +#endif +#include <rsctree.hxx> + +/****************** C L A S S E S ****************************************/ +class RscExpression; +class RscFileTab; +class RscDefine; + +/*********** R s c E x p r e s s i o n ***********************************/ +#define RSCEXP_LONG 0 +#define RSCEXP_EXP 1 +#define RSCEXP_DEF 2 +#define RSCEXP_NOTHING 3 + +class RscExpType +{ +public: + union { + RscExpression * pExp; + RscDefine * pDef; + struct { + short nHi; + unsigned short nLo; + } aLong; + } aExp; + char cType; + char cUnused; + BOOL IsNumber() const { return( RSCEXP_LONG == cType ); } + BOOL IsExpression()const { return( RSCEXP_EXP == cType ); } + BOOL IsDefinition()const { return( RSCEXP_DEF == cType ); } + BOOL IsNothing() const { return( RSCEXP_NOTHING == cType ); } + void SetLong( INT32 lValue ){ + aExp.aLong.nHi = (short)(lValue >> 16); + aExp.aLong.nLo = (unsigned short)lValue; + cType = RSCEXP_LONG; + } + INT32 GetLong() const{ + return aExp.aLong.nLo | + ((INT32)aExp.aLong.nHi << 16); + } + BOOL Evaluate( INT32 * pValue ) const; + void GetMacro( ByteString & ) const; +}; + +/*********** R s c I d ***************************************************/ +class RscId +{ + static BOOL bNames;// FALSE, bei den Namenoperation nur Zahlen +public: + RscExpType aExp; // Zahl, Define oder Ausdruck + INT32 GetNumber() const; + void Create( const RscExpType & rExpType ); + void Create(){ aExp.cType = RSCEXP_NOTHING; } + + RscId() { Create(); } + + RscId( RscDefine * pEle ); + RscId( INT32 lNumber ) + { aExp.SetLong( lNumber ); } + + RscId( const RscExpType & rExpType ) + { Create( rExpType ); } + + void Destroy(); + + ~RscId(){ + Destroy(); + } + + RscId( const RscId& rRscId ); + + RscId& operator = ( const RscId& rRscId ); + + static BOOL IsSetNames(); + static void SetNames( BOOL bSet = TRUE ); + operator INT32() const; // Gibt Nummer zurueck + ByteString GetName() const; // Gibt den Namen des Defines zurueck + ByteString GetMacro() const; // Gibt das Macro zurueck + BOOL operator < ( const RscId& rRscId ) const; + BOOL operator > ( const RscId& rRscId ) const; + BOOL operator == ( const RscId& rRscId ) const; + BOOL operator <= ( const RscId& rRscId ) const + { return !(operator > ( rRscId )); } + BOOL operator >= ( const RscId& rRscId ) const + { return !(operator < ( rRscId )); } + BOOL IsId() const { return !aExp.IsNothing(); } +}; + +/*********** R s c D e f i n e *******************************************/ +class RscDefine : public StringNode +{ +friend class RscFileTab; +friend class RscDefineList; +friend class RscDefTree; +friend class RscExpression; +friend class RscId; + ULONG lFileKey; // zu welcher Datei gehoert das Define + sal_uInt32 nRefCount; // Wieviele Referenzen auf dieses Objekt + INT32 lId; // Identifier + RscExpression * pExp; // Ausdruck +protected: + + RscDefine( ULONG lFileKey, const ByteString & rDefName, + INT32 lDefId ); + RscDefine( ULONG lFileKey, const ByteString & rDefName, + RscExpression * pExpression ); + ~RscDefine(); + void IncRef(){ nRefCount++; } + sal_uInt32 GetRefCount() const { return nRefCount; } + void DecRef(); + void DefineToNumber(); + void SetName( const ByteString & rNewName ){ aName = rNewName; } + void ChangeMacro( RscExpression * pExpression ); + void ChangeMacro( INT32 lIdentifier ); + + using StringNode::Search; +public: + RscDefine * Search( const char * ); + ULONG GetFileKey() const { return lFileKey; } + BOOL Evaluate(); + INT32 GetNumber() const { return lId; } + ByteString GetMacro(); +}; + +DECLARE_LIST( RscSubDefList, RscDefine * ) + +class RscDefineList : public RscSubDefList { +friend class RscFile; +friend class RscFileTab; +private: + // pExpression wird auf jedenfall Eigentum der Liste + RscDefine * New( ULONG lFileKey, const ByteString & rDefName, + INT32 lDefId, ULONG lPos ); + RscDefine * New( ULONG lFileKey, const ByteString & rDefName, + RscExpression * pExpression, ULONG lPos ); + BOOL Befor( const RscDefine * pFree, const RscDefine * pDepend ); + BOOL Remove( RscDefine * pDef ); + BOOL Remove( ULONG nIndex ); + BOOL Remove(); +public: + void WriteAll( FILE * fOutput ); +}; + +/*********** R s c E x p r e s s i o n ***********************************/ +class RscExpression { +friend class RscFileTab; + char cOperation; + RscExpType aLeftExp; + RscExpType aRightExp; +public: + RscExpression( RscExpType aLE, char cOp, + RscExpType aRE ); + ~RscExpression(); + BOOL Evaluate( INT32 * pValue ); + ByteString GetMacro(); +}; + +/********************** R S C F I L E ************************************/ +class RscDepend { + ULONG lKey; +public: + RscDepend( ULONG lIncKey ){ lKey = lIncKey; }; + ULONG GetFileKey(){ return lKey; } +}; +DECLARE_LIST( RscDependList, RscDepend * ) + +// Tabelle die alle Dateinamen enthaelt +class RscFile : public RscDependList +{ +friend class RscFileTab; + BOOL bIncFile; // Ist es eine Include-Datei +public: + BOOL bLoaded; // Ist die Datei geladen + BOOL bScanned; // Wurde Datei nach Inclide abgesucht + BOOL bDirty; // Dirty-Flag + ByteString aFileName; // Name der Datei + ByteString aPathName; // Pfad und Name der Datei + RscDefineList aDefLst; // Liste der Defines + + RscFile(); + ~RscFile(); + BOOL InsertDependFile( ULONG lDepFile, ULONG lPos ); + void RemoveDependFile( ULONG lDepFile ); + BOOL Depend( ULONG lDepend, ULONG lFree ); + void SetIncFlag(){ bIncFile = TRUE; }; + BOOL IsIncFile(){ return bIncFile; }; +}; + +DECLARE_UNIQUEINDEX( RscSubFileTab, RscFile * ) +#define NOFILE_INDEX UNIQUEINDEX_ENTRY_NOTFOUND + +class RscDefTree { + RscDefine * pDefRoot; +public: + static BOOL Evaluate( RscDefine * pDef ); + RscDefTree(){ pDefRoot = NULL; } + ~RscDefTree(); + void Remove(); + BOOL Evaluate(); + RscDefine * Search( const char * pName ); + void Insert( RscDefine * pDef ); + void Remove( RscDefine * pDef ); +}; + +class RscFileTab : public RscSubFileTab { + RscDefTree aDefTree; + ULONG Find( const ByteString & rName ); +public: + RscFileTab(); + ~RscFileTab(); + + RscDefine * FindDef( const char * ); + RscDefine * FindDef( const ByteString& rStr ) { return FindDef( rStr.GetBuffer() ); } + RscDefine * FindDef( ULONG lKey, const ByteString & ); + + BOOL Depend( ULONG lDepend, ULONG lFree ); + BOOL TestDef( ULONG lFileKey, ULONG lPos, + const RscDefine * pDefDec ); + BOOL TestDef( ULONG lFileKey, ULONG lPos, + const RscExpression * pExpDec ); + + RscDefine * NewDef( ULONG lKey, const ByteString & rDefName, + INT32 lId, ULONG lPos ); + RscDefine * NewDef( ULONG lKey, const ByteString & rDefName, + RscExpression *, ULONG lPos ); + + BOOL ChangeDef( const ByteString & rDefName, INT32 lId ); + BOOL ChangeDef( const ByteString & rDefName, RscExpression * ); + + BOOL IsDefUsed( const ByteString & ); + void DeleteDef( const ByteString & ); + BOOL ChangeDefName( const ByteString & rDefName, + const ByteString & rNewName ); + + // Alle Defines die in dieser Datei Definiert sind loeschen + void DeleteFileContext( ULONG lKey ); + void DeleteFile( ULONG lKey ); + ULONG NewCodeFile( const ByteString & rName ); + ULONG NewIncFile( const ByteString & rName, const ByteString & rPath ); + RscFile * GetFile( ULONG lFileKey ){ return Get( lFileKey ); } +}; + +#endif // _RSCDEF_HXX diff --git a/rsc/inc/rscerror.h b/rsc/inc/rscerror.h new file mode 100644 index 000000000000..a957e2c7b202 --- /dev/null +++ b/rsc/inc/rscerror.h @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscerror.h,v $ + * $Revision: 1.8 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCERROR_H +#define _RSCERROR_H + +#ifndef _TOOLS_SOLAR_H +#include <tools/solar.h> +#endif + +/****************** D E F I N I T I O N S ********************************/ +/******************* R e t u r n E r r o r s *******************/ +#define ERR_OK 0xFFFFFFFF + +#define ERR_ERROR 0x0100 +#define ERR_UNKNOWN_METHOD 0x0101 // Return +#define ERR_OPENFILE 0x0102 // Return +#define ERR_NOCHAR 0x0103 // Return +#define ERR_NORSCINST 0x0104 // Return +#define ERR_USAGE 0x0105 // +#define ERR_NOINPUT 0x0106 // Return +#define ERR_UNKNOWNSW 0x0107 // +#define ERR_REFTODEEP 0x0108 // Return +#define ERR_FILEFORMAT 0x0109 // Return +#define ERR_FILESIZE 0x010A // Return +#define ERR_RENAMEFILE 0x010B // Return +#define ERR_NOIMAGE 0x010C // Return + +#define ERR_RSCRANGE 0x0200 // Return +#define ERR_RSCRANGE_OUTDEFSET (ERR_RSCRANGE +1 ) + +#define ERR_RSCENUM 0x0210 // Return +#define ERR_RSCFLAG 0x0220 // Return +#define ERR_RSCCONT 0x0240 // Return +#define ERR_CONT_INVALIDPOS (ERR_RSCCONT +1 ) // Return +#define ERR_CONT_INVALIDTYPE (ERR_RSCCONT +2 ) // Return + +#define ERR_RSCCMPED 0x0250 +#define ERR_RSCINST 0x0260 +#define ERR_RSCINST_NOVARNAME (ERR_RSCINST +1 ) // Return +#define ERR_RSCINST_RESERVEDNAME (ERR_RSCINST +2 ) // Return + +#define ERR_LEX 0x0270 +#define ERR_YACC 0x0280 // +#define ERR_DOUBLEID (ERR_YACC +1 ) // +#define ERR_FALSETYPE (ERR_YACC +2 ) // +#define ERR_NOVARIABLENAME (ERR_YACC +3 ) // +#define ERR_USHORTRANGE (ERR_YACC +4 ) // +#define ERR_IDRANGE (ERR_YACC +5 ) // +#define ERR_NOCOPYOBJ (ERR_YACC +6 ) // +#define ERR_REFNOTALLOWED (ERR_YACC +7 ) // Return +#define ERR_DOUBLEDEFINE (ERR_YACC +8 ) // +#define ERR_COPYNOTALLOWED (ERR_YACC +9 ) // +#define ERR_IDEXPECTED (ERR_YACC +10) // +#define ERR_ZERODIVISION (ERR_YACC +11) // +#define ERR_PRAGMA (ERR_YACC +12) // +#define ERR_DECLAREDEFINE (ERR_YACC +13) // +#define ERR_NOTUPELNAME (ERR_YACC +14) // +#define ERR_NOTYPE (ERR_YACC +15) // + +#define ERR_RSCARRAY 0x02A0 // Return +#define ERR_ARRAY_INVALIDINDEX (ERR_RSCARRAY +1 ) // Return + +#define ERR_ERROREND 0x1000 + +#define ERR_WARNINGSTART 0x1001 +#define WRN_LOCALID (ERR_WARNINGSTART +1 ) +#define WRN_GLOBALID (ERR_WARNINGSTART +2 ) +#define WRN_SUBINMEMBER (ERR_WARNINGSTART +3 ) +#define WRN_CONT_NOID (ERR_WARNINGSTART +4 ) +#define WRN_STR_REFNOTFOUND (ERR_WARNINGSTART +5 ) +#define WRN_MGR_REFNOTFOUND (ERR_WARNINGSTART +6 ) +#define WRN_CONT_DOUBLEID (ERR_WARNINGSTART +7 ) + +#define ERR_WARNINGEND 0x2000 + +class ERRTYPE { + sal_uInt32 nError; +public: + ERRTYPE() { nError = ERR_OK; } + ERRTYPE( sal_uInt32 nErr ) { nError = nErr; } + ERRTYPE( const ERRTYPE & rErr ) { nError = rErr.nError; }; + ERRTYPE& operator = ( const ERRTYPE & rError ); + operator sal_uInt32() const { return( nError ); } + BOOL IsError() const { return( nError <= ERR_ERROREND ); } + BOOL IsOk() const { return( !IsError() ); } + BOOL IsWarning() const { + return( nError >= ERR_WARNINGSTART && nError <= ERR_WARNINGEND ); + }; + void Clear(){ nError = ERR_OK; } +}; + +/****************** R s c E r r o r **************************************/ +class RscId; +class RscTop; + +enum RscVerbosity +{ + RscVerbositySilent = 0, + RscVerbosityNormal = 1, + RscVerbosityVerbose = 2 +}; + +class RscError +{ + FILE * fListing; + RscVerbosity m_verbosity; + + void WriteError( const ERRTYPE& rError, const char * pMessage ); + void StdLstOut( const char * pStr ); + void StdLstErr( const char * pStr ); + void ErrorFormat( const ERRTYPE& rError, RscTop * pClass, + const RscId & aId ); +public: + sal_uInt32 nErrors;// Anzahl der Fehler + RscError( RscVerbosity _verbosity ) { + fListing = NULL; + nErrors = 0; + m_verbosity = _verbosity; + }; + void SetListFile( FILE * fList ){ + fListing = fList; + }; + FILE * GetListFile(){ + return fListing; + }; + RscVerbosity GetVerbosity() const { return m_verbosity; } + virtual void StdOut( const char *, const RscVerbosity _verbosityLevel = RscVerbosityNormal ); + virtual void StdErr( const char * ); + virtual void LstOut( const char * ); + virtual void Error( const ERRTYPE& rError, RscTop* pClass, const RscId &aId, + const char * pMessage = NULL ); + // Dieser Fehler sollte nur im Compilermodus auftreten, + // das Programm wird mit exit() verlassen + virtual void FatalError( const ERRTYPE& rError, const RscId &aId, + const char * pMessage = NULL ); +}; + +#endif // _RSCERROR_H diff --git a/rsc/inc/rscflag.hxx b/rsc/inc/rscflag.hxx new file mode 100644 index 000000000000..7dfb78c953e1 --- /dev/null +++ b/rsc/inc/rscflag.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscflag.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCFLAG_HXX +#define _RSCFLAG_HXX + +#include <rscall.h> +#include <rscerror.h> +#include <rschash.hxx> +#include <rscconst.hxx> + +/******************* R s c F l a g ***************************************/ +class RscFlag : public RscConst { + struct RscFlagInst{ + sal_uInt32 nFlags; + sal_uInt32 nDfltFlags; + }; + RSCINST CreateBasic( RSCINST * pInst ); +public: + RscFlag( Atom nId, sal_uInt32 nTypId ); + RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL ); + RSCINST CreateClient( RSCINST * pInst, const RSCINST & rDflt, + BOOL bOwnClass, Atom nConsId ); + sal_uInt32 Size(); + + virtual void SetToDefault( const RSCINST & rInst ); + BOOL IsDefault( const RSCINST & rInst ); + BOOL IsDefault( const RSCINST & rInst, Atom nConstId ); + + // Ist das Flag gesetzt + BOOL IsSet( const RSCINST & rInst, Atom nConstId ); + + // Als Default setzen + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef, + Atom nConstId ); + + ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId, + INT32 nValue ); + ERRTYPE SetNotConst( const RSCINST & rInst, Atom nConstId ); + void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); +}; + +/******************* R s c C l i e n t ***********************************/ +class RscClient : public RscTop +{ + RscFlag * pRefClass; //Klasse die als Server benutzt wird + Atom nConstId; //Id des zu setzenden Wertes +public: + RscClient( Atom nId, sal_uInt32 nTypId, RscFlag * pClass, + Atom nConstantId ); + virtual RSCCLASS_TYPE GetClassType() const; + RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL ); + sal_uInt32 Size(){ return( pRefClass->Size() ); }; + + // Eine Zuweisung an eine Variable + BOOL IsDefault( const RSCINST & rInst ){ + return( pRefClass->IsDefault( rInst, nConstId ) ); + }; + // Als Default setzen + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ){ + return pRefClass->IsValueDefault( rInst, + pDef, nConstId ); + } + ERRTYPE SetBool( const RSCINST & rInst, BOOL bValue ){ + if( bValue ) + return( pRefClass->SetConst( rInst, nConstId, bValue ) ); + else + return( pRefClass-> + SetNotConst( rInst, nConstId ) ); + }; + ERRTYPE GetBool( const RSCINST & rInst, BOOL * pB ){ + *pB = pRefClass->IsSet( rInst, nConstId ); + return( ERR_OK ); + }; + void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); +}; + +#endif // _RSCFLAG_HXX diff --git a/rsc/inc/rschash.hxx b/rsc/inc/rschash.hxx new file mode 100644 index 000000000000..a678bd9b5101 --- /dev/null +++ b/rsc/inc/rschash.hxx @@ -0,0 +1,57 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rschash.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCHASH_HXX +#define _RSCHASH_HXX + +#include <sal/types.h> +#include <rtl/string.hxx> +#include <hash_map> + +typedef sal_uInt32 Atom; + +#define InvalidAtom Atom( ~0 ) + +class AtomContainer +{ + Atom m_nNextID; + std::hash_map< rtl::OString, Atom, rtl::OStringHash > m_aStringToID; + std::hash_map< Atom, rtl::OString > m_aIDToString; + + public: + AtomContainer(); + ~AtomContainer(); + + Atom getID( const rtl::OString& rStr, bool bOnlyIfExists = false ); + const rtl::OString& getString( Atom nAtom ); + +}; + +#endif // _RSCHASH_HXX + diff --git a/rsc/inc/rscinst.hxx b/rsc/inc/rscinst.hxx new file mode 100644 index 000000000000..85c641aa3333 --- /dev/null +++ b/rsc/inc/rscinst.hxx @@ -0,0 +1,247 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscinst.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCINST_HXX +#define _RSCINST_HXX + +#include <rscall.h> +#include <rscerror.h> +#include <rsctools.hxx> + +/******************* C l a s s e s F o r w a r d s *********************/ +class RscTypCont; +class RscCmdLine; +class REResourceList; +class RscTop; +class RscInstCopy; + +/******************* F u n c t i o n F o r w a r d s *******************/ +Atom HashId( const char * ); // Gibt zu einem String eine HashId +const char * GetHashString( Atom ); // Gibt zu einer Atom einen String + // NULL, wenn kein Eintrag vorhanden + +/******************* S t r u c t s ***************************************/ + +/****************** C L A S S E S ****************************************/ +class RscInst +{ + void MakeCopy( RSCINST aCopyInst ); + static RSCINST GetSysLangInst( RSCINST & rInst ); +public: + RSCINST aInst; + + RscInst(); + RscInst( const RscInst & rInst ); + RscInst( RSCINST aTmpI ); + RscInst& operator = ( const RscInst& rRscInst ); + ~RscInst(); + void OverWrite( RscInstCopy & rInst ); + BOOL IsInst() const { return( aInst.IsInst() ); } + + // Listen Methoden + ERRTYPE SetElement( const RscId & rName, RscInstCopy & rInst ); + ERRTYPE SetPosEle( sal_uInt32 nPos, RscInstCopy & rInst ); + ERRTYPE SetPosRscId( sal_uInt32 nPos, const RscId & rId ); + SUBINFO_STRUCT GetInfoEle( sal_uInt32 nPos ); + sal_uInt32 GetCount(); + RscInst GetElement( RscTop * pClass, const RscId & rName ); + RscInst GetPosEle( sal_uInt32 nPos ); + ERRTYPE MovePosEle( sal_uInt32 nDestPos, sal_uInt32 nSourcePos ); + ERRTYPE DeleteElement( RscTop * pClass, const RscId & rName ); + ERRTYPE DeletePosEle( sal_uInt32 nPos ); + + ERRTYPE SetVar( Atom nVarName, RscInstCopy & rInst ); + ERRTYPE SetConst( Atom nVarName, Atom nConstId ); + ERRTYPE SetBool( Atom nVarName, BOOL ); + + // Hack fuer X, Y, Width, Height + static ERRTYPE SetCorrectValues( RSCINST & rInst, RSCINST & rVarInst, + INT32 lValue, sal_uInt32 nTupelIdx ); + ERRTYPE SetNumber( Atom nVarName, INT32 ); + + ERRTYPE SetString( Atom nVarName, const char * ); + ERRTYPE SetConst( Atom nConstId ); + ERRTYPE SetBool( BOOL ); + ERRTYPE SetNumber( INT32 ); + ERRTYPE SetString( const char * ); + ERRTYPE SetRef( const RscId & rRscId ); + ERRTYPE SetDefault( Atom nVarName ); + + RscInst GetVar( Atom nVarName ); + Atom GetConst( Atom nVarName = InvalidAtom ); + sal_uInt32 GetConstPos( Atom nVarName = InvalidAtom ); + BOOL GetBool( Atom nVarName = InvalidAtom ); + + // Hack fuer X, Y, Width, Height + static INT32 GetCorrectValues( RSCINST & rInst, RSCINST & rVarInst, + sal_uInt32 nTupelIdx ); + INT32 GetNumber( Atom nVarName = InvalidAtom ); + + const char *GetString( Atom nVarName = InvalidAtom ); + RscId GetRef(); + BOOL IsDefault( Atom nVarName ); + BOOL IsConsistent( RscInconsList * pList ); + + Atom GetClassEnum( Atom nVarName, sal_uInt32 nPos ); + Atom GetClassEnum( sal_uInt32 nPos ); + RscTop * GetClassType(){ return aInst.pClass; }; + Atom GetClassName(); + void EnumClassVariables( void * pData, VarEnumCallbackProc ) const; + ERRTYPE WriteRc( RscWriteRc & aMem ); +}; + +class RscInstCopy : public RscInst { + void MakeCopy( RSCINST aCopyInst ); +public: + RscInstCopy(); + RscInstCopy( const RscInstCopy & rInst ); + RscInstCopy( const RscInst & rInst ); + RscInstCopy( RSCINST aTmpI ); + RscInstCopy( RscTop * pNewType, const RscInst & rInst ); + RscInstCopy& operator = ( const RscInstCopy & rRscInst ); + RscInstCopy& operator = ( const RscInst & rRscInst ); + ~RscInstCopy(); +}; + +class RscDataBase +{ +friend class RscHrc; +friend class RscSrc; +friend class RscInst; + + RscCmdLine * pCmdLine; + RscTypCont * pTC; + LanguageType nLangType; +public: + RscDataBase( RscError * ); + ~RscDataBase(); + +// void SetLanguage( LanguageType nTyp ) { nLangType = nTyp; } + void SetLanguage( Atom nId ); + Atom GetLanguage() const; + + ByteString GetPath() const; + void SetPath( const ByteString & rPath ); + // Konvertiert einen Namen in einen Typ + RscTop* GetClassType( Atom nClassName ); + // Instanz einer Klasse erzeugen + BOOL MakeConsistent( RscInconsList * pList ); + // Array mit Dateinamen + RscFileTab* GetFileTab(); + // Eine Dateinamen-Instanz holen + RscFile * GetFileStruct( ULONG lKey ); + + ULONG AddSrcFile( const ByteString & rFileName ); + ULONG AddHrcFile( const ByteString & rFileName ); + // Traegt die Include-Dateien in die Abhaengigkeitsliste + // von lFileKey ein + void ScanForIncFiles( ULONG lFileKey ); + void RemoveFile( ULONG lKey ); + + // Suche ueber alle DEFINES + RscDefine * FindDef( const ByteString & rName ); + ULONG GetFileKey( const ByteString & rFileName ); +}; + +class RscHrc +{ +protected: + ULONG lFileKey; // Index der Instanz + RscDataBase * pDataBase;// Datenbasis +public: + + // Kompilerinstanz erzeugen + RscHrc( RscDataBase * pDBase, ULONG lKey ); + ~RscHrc(); + + // Daten von Datei uebernehmen + ERRTYPE ReadFile(); + + ULONG GetFileKey() const { return lFileKey; } + + void SetDirty( BOOL bSet ); + BOOL IsDirty(); + void SetPathName( const ByteString & ); + ByteString GetPathName(); + void SetFileName( const ByteString & ); + ByteString GetFileName(); + + //Depend-Datei anhaengen + void InsertDepend( ULONG lKey, ULONG lPos ); + + // DefineList holen + RscDefineList * GetDefineList(); + // Suche ueber all DEFINES im Zugriff + RscDefine * FindDef( const ByteString & rName ); + ERRTYPE NewDef( const ByteString & rMacroName, INT32 lValue, + ULONG lPos ); + ERRTYPE NewDef( const ByteString & rMacroName, const ByteString & rMacro, + ULONG lPos ); + ERRTYPE ChangeDef( const ByteString & rMacroName, INT32 lValue ); + ERRTYPE ChangeDef( const ByteString & rMacroName, + const ByteString & rMacro ); + BOOL IsDefUsed( const ByteString & ); + void DeleteDef( const ByteString & rMacroName ); + ERRTYPE ChangeDefName( const ByteString & rMacroName, + const ByteString & rNewName ); + + // Dateinamen-Instanz holen + RscFile * GetFileStruct(); + //Abhaengigkeitsliste holen holen + RscDependList * GetDependList(); + + // Datei schreiben + ERRTYPE WriteFile(); +}; + +class RscSrc : public RscHrc { +public: + // Kompilerinstanz erzeugen + RscSrc( RscDataBase * pDBase, ULONG lKey ); + ~RscSrc(); + + + RscInstCopy CreateRscInst( RscTop * pClass ); + // Instanz loeschen + ERRTYPE DeleteRscInst( RscTop * pClass, const RscId & rInstName ); + // Datenbasis nach Define Veraenderung wiederherstellen + //Instanz global zur Verfuegung stellen + ERRTYPE SetRscInst( const RscId & rInstName, RscInstCopy & ); + //Instanz holen + RscInst GetRscInst( RscTop* pClass, const RscId & rInstName ); + + // Namen und Identifier Liste fuellen + void FillNameIdList( REResourceList * pList ); + + // C++ Resourcekonstruktor schreiben + ERRTYPE WriteCxxFile( const ByteString &, const ByteString & rHxxName ); + ERRTYPE WriteHxxFile( const ByteString & ); // C++ Klasskopf schreiben +}; + +#endif //_RSCINST_HXX diff --git a/rsc/inc/rsckey.hxx b/rsc/inc/rsckey.hxx new file mode 100644 index 000000000000..0fc0ac0c1366 --- /dev/null +++ b/rsc/inc/rsckey.hxx @@ -0,0 +1,64 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rsckey.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCKEY_HXX +#define _RSCKEY_HXX + +/****************** C l a s s F o r w a r d s **************************/ +class RscTop; + +#include <rscall.h> + +typedef struct { + Atom nName; + sal_uInt32 nTyp; + long yylval; +} KEY_STRUCT; + +class RscNameTable { + BOOL bSort; //soll bei jedem einfuegen sortiert werden? + sal_uInt32 nEntries; //Anzahl der Eintr�ge + KEY_STRUCT * pTable; +public: + RscNameTable(); + ~RscNameTable(); + void SetSort( BOOL bSorted = TRUE ); + Atom Put( Atom nName, sal_uInt32 nTyp, long nValue ); + Atom Put( Atom nName, sal_uInt32 nTyp ); + Atom Put( const char * pName, sal_uInt32 nTyp, long nValue ); + Atom Put( const char * pName, sal_uInt32 nTyp ); + Atom Put( Atom nName, sal_uInt32 nTyp, RscTop * pClass ); + Atom Put( const char * pName, sal_uInt32 nTyp, RscTop * pClass ); + + // TRUE, wurde gefunden + BOOL Get( Atom nName, KEY_STRUCT * pEle ); +}; + + +#endif// _RSCKEY_HXX diff --git a/rsc/inc/rsclst.hxx b/rsc/inc/rsclst.hxx new file mode 100644 index 000000000000..df20562547e5 --- /dev/null +++ b/rsc/inc/rsclst.hxx @@ -0,0 +1,70 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rsclst.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _RSCLST_HXX +#define _RSCLST_HXX + +#ifndef _TOOLS_LIST_HXX +#include <tools/list.hxx> +#endif +#include <rscall.h> + +class REResourceList; + +DECLARE_LIST( RESubResourceList, REResourceList * ) + +class REResourceList : public RESubResourceList +{ +protected: + REResourceList* pParent; + RscId aRscId; //Id und Name des Resourceobjektes + ByteString aClassName; + BOOL bVisible; + +public: + REResourceList(); + REResourceList( REResourceList * pParentList, + ByteString& rClassName, + const RscId & rResourceID, + BOOL bVisible = FALSE ); + ~REResourceList(); + + REResourceList* GetParent() { return pParent; } + ByteString GetObjName() { return aRscId.GetName(); } + ByteString GetClassName() { return aClassName; } + RscId GetRscId() { return aRscId; } + void SetRscId( const RscId & rId ){ aRscId = rId; } + + void SetVisible( BOOL bVis ) + { bVisible = bVis; } + BOOL IsVisible() { return bVisible; } +}; + +#endif // _RSCLST_HXX diff --git a/rsc/inc/rscmgr.hxx b/rsc/inc/rscmgr.hxx new file mode 100644 index 000000000000..2af5b01d115f --- /dev/null +++ b/rsc/inc/rscmgr.hxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscmgr.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCMGR_HXX +#define _RSCMGR_HXX + +#include <rscall.h> +#include <rscerror.h> +#include <rschash.hxx> +#include <rsctop.hxx> +#include <rscclass.hxx> + +/******************* R s c M g r *****************************************/ +class RscMgr : public RscClass { + struct RscMgrInst { + RscId aRefId; // nRefId = Referenz Identifier + BOOL bDflt; // Ist Default + void Create(){ aRefId.Create(); bDflt = TRUE; } + void Destroy(){ aRefId.Destroy(); } + }; + ERRTYPE IsToDeep( const RSCINST & rInst, sal_uInt32 nDeep = 0 ); +public: + RscMgr( Atom nId, sal_uInt32 nTypId, RscTop * pSuperCl ); + + void SetToDefault( const RSCINST & rInst ); + BOOL IsDefault( const RSCINST & rInst ); + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + + RSCINST Create( RSCINST * pInst, const RSCINST & rDflt, BOOL ); + void Destroy( const RSCINST & rInst ); + sal_uInt32 Size(); + void WriteSrcHeader( const RSCINST & aInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, + const RscId & rId, const char * ); + + void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, const RscId & rId, + sal_uInt32, BOOL bExtra ); + ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + ERRTYPE WriteHxxHeader( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId & rId ); + ERRTYPE WriteHxx( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId & rId ); + ERRTYPE WriteCxxHeader( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId & rId ); + ERRTYPE WriteCxx( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId & rId ); + BOOL IsConsistent( const RSCINST & rInst, + RscInconsList * pList = NULL ); + ERRTYPE GetRef( const RSCINST & rInst, RscId * ); + ERRTYPE SetRef( const RSCINST & rInst, const RscId & rRefId ); +}; + +#endif //_RSCMGR_HXX diff --git a/rsc/inc/rscpar.hxx b/rsc/inc/rscpar.hxx new file mode 100644 index 000000000000..d390153e8232 --- /dev/null +++ b/rsc/inc/rscpar.hxx @@ -0,0 +1,95 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscpar.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCPAR_HXX +#define _RSCPAR_HXX + +#include <rsctools.hxx> +#include <rscerror.h> + +/****************** C L A S S E S ****************************************/ +class RscTypCont; +class RscExpression; +/*********** R s c F i l e I n s t ***************************************/ + +#define READBUFFER_MAX 256 +class RscFileInst +{ + ERRTYPE aFirstError;// Erster Fehler + sal_uInt32 nErrorLine; // Zeile des ersten Fehlers + sal_uInt32 nErrorPos; // Position des ersten Fehlers + BOOL bIncLine; // Muss Zeilennummer incrementiert werden + sal_uInt32 nLineNo; // Zeile in der Eingabedatei + ULONG lFileIndex; // Index auf Eingabedatei + ULONG lSrcIndex; // Index auf Basisdatei + FILE * fInputFile; // Eingabedatei + char * pInput; // Lesepuffer + sal_uInt32 nInputBufLen; // Laenge des Lesepuffers + sal_uInt32 nInputPos; // Position im Lesepuffer + sal_uInt32 nInputEndPos;// Ende im Lesepuffer + char * pLine; // Zeile + sal_uInt32 nLineBufLen;//Lange des Zeilenpuffres + sal_uInt32 nScanPos; // Position in der Zeile + int cLastChar; + BOOL bEof; + +public: + RscTypCont * pTypCont; + void Init(); // ctor initialisieren + RscFileInst( RscTypCont * pTC, ULONG lIndexSrc, + ULONG lFileIndex, FILE * fFile ); + RscFileInst( RscTypCont * pTC, ULONG lIndexSrc, + ULONG lFileIndex, const ByteString & ); + ~RscFileInst(); + BOOL IsEof() const { return bEof; } + void SetFileIndex( ULONG lFIndex ) { lFileIndex = lFIndex; } + ULONG GetFileIndex() { return( lFileIndex ); } + ULONG GetSrcIndex() { return( lSrcIndex ); } + void SetLineNo( sal_uInt32 nLine ) { nLineNo = nLine; } + sal_uInt32 GetLineNo() { return( nLineNo ); } + sal_uInt32 GetScanPos() { return( nScanPos ); } + char * GetLine() { return( pLine ); } + int GetChar(); + int GetFastChar() { return pLine[ nScanPos ] ? + pLine[ nScanPos++ ] : GetChar(); + } + void GetNewLine(); + // Fehlerbehandlung + void SetError( ERRTYPE aError ); + ERRTYPE GetError() { return aFirstError; } + sal_uInt32 GetErrorLine() { return nErrorLine; } + sal_uInt32 GetErrorPos() { return nErrorPos; } +}; + +/******************* F u n c t i o n *************************************/ +void IncludeParser( RscFileInst * pFileInst ); +ERRTYPE parser( RscFileInst * pFileInst ); +RscExpression * MacroParser( RscFileInst & rFileInst ); + +#endif // _RSCPAR_HXX diff --git a/rsc/inc/rscrange.hxx b/rsc/inc/rscrange.hxx new file mode 100644 index 000000000000..d702bef12586 --- /dev/null +++ b/rsc/inc/rscrange.hxx @@ -0,0 +1,212 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscrange.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCRANGE_HXX +#define _RSCRANGE_HXX + +#include <rscall.h> +#include <rscerror.h> +#include <rschash.hxx> +#include <rsctop.hxx> + +/******************* R s c R a n g e *************************************/ +class RscRange : public RscTop +{ +protected: + struct RscRangeInst { + sal_uInt16 nValue; // nValue = Ausgangswert - nMin + BOOL bDflt; // Ist Default + }; + INT32 nMin; // Minimum des Bereiches + INT32 nMax; // Maximum des Bereiches + sal_uInt32 nSize; +public: + RscRange( Atom nId, sal_uInt32 nTypId ); + virtual RSCCLASS_TYPE GetClassType() const; + RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL ); + // Der zulaessige Bereich wird gesetzt + ERRTYPE SetRange( INT32 nMinimum, INT32 nMaximum ); + // Gibt die Groesse der Klasse in Bytes + sal_uInt32 Size(){ return nSize; } + // Eine Zuweisung an eine Variable + virtual void SetToDefault( const RSCINST & rInst ) + { + ((RscRangeInst*)rInst.pData)->bDflt = TRUE; + } + BOOL IsDefault( const RSCINST & rInst) + { + return( ((RscRangeInst*)rInst.pData)->bDflt ); + }; + // Als Default setzen + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + ERRTYPE SetNumber( const RSCINST &, INT32 ); + ERRTYPE GetNumber( const RSCINST &, INT32 * ); + void WriteSrc( const RSCINST &, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); +}; + +/******************* R s c L o n g R a n g e ******************************/ +class RscLongRange : public RscTop +{ +protected: + struct RscLongRangeInst + { + INT32 nValue; // nValue = Ausgangswert - nMin + BOOL bDflt; // Ist Default + }; + INT32 nMin; // Minimum des Bereiches + INT32 nMax; // Maximum des Bereiches + sal_uInt32 nSize; +public: + RscLongRange( Atom nId, sal_uInt32 nTypId ); + virtual RSCCLASS_TYPE GetClassType() const; + RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL ); + // Der zulaessige Bereich wird gesetzt + ERRTYPE SetRange( INT32 nMinimum, INT32 nMaximum ); + // Gibt die Groesse der Klasse in Bytes + sal_uInt32 Size(){ return nSize; } + // Eine Zuweisung an eine Variable + virtual void SetToDefault( const RSCINST & rInst ) + { + ((RscLongRangeInst*)rInst.pData)->bDflt = TRUE; + } + BOOL IsDefault( const RSCINST & rInst) + { + return( ((RscLongRangeInst*)rInst.pData)->bDflt ); + }; + // Als Default setzen + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + ERRTYPE SetNumber( const RSCINST &, INT32 ); + ERRTYPE GetNumber( const RSCINST &, INT32 * ); + void WriteSrc( const RSCINST &, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); + +}; + +/******************* R s c L o n g E n u m R a n g e ******************/ +class RscLongEnumRange : public RscLongRange +{ +public: + RscLongEnumRange( Atom nId, sal_uInt32 nTypId ); + + ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId, + INT32 nValue ); +}; + +/******************* R s c I d R a n g e ***********************************/ +class RscIdRange : public RscTop +{ + sal_uInt32 nSize; +protected: + INT32 nMin; // Minimum des Bereiches + INT32 nMax; // Maximum des Bereiches +public: + RscIdRange( Atom nId, sal_uInt32 nTypId ); + virtual RSCCLASS_TYPE GetClassType() const; + // Der zulaessige Bereich wird gesetzt + ERRTYPE SetRange( INT32 nMinimum, INT32 nMaximum ){ + nMin = nMinimum; + nMax = nMaximum; + return ERR_OK; + } + RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL ); + void Destroy( const RSCINST & rInst ); + sal_uInt32 Size(){ return nSize; } + virtual void SetToDefault( const RSCINST & rInst ) + { + ((RscId*)rInst.pData)->aExp.cUnused = TRUE; + } + BOOL IsDefault( const RSCINST & rInst) + { + //cUnused wird fuer Defaultkennung verwendet + return ((RscId*)rInst.pData)->aExp.cUnused + ? TRUE : FALSE; + } + // Als Default setzen + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + ERRTYPE SetNumber( const RSCINST &, INT32 ); + ERRTYPE GetNumber( const RSCINST &, INT32 * ); + ERRTYPE SetRef( const RSCINST &, const RscId & rRscId ); + ERRTYPE GetRef( const RSCINST & rInst, RscId * ); + void WriteSrc( const RSCINST &, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + BOOL IsConsistent( const RSCINST & rInst, RscInconsList * pList ); + void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); + +}; + +/******************* R s c B o o l ***************************************/ +class RscBool : public RscRange +{ +public: + RscBool( Atom nId, sal_uInt32 nTypId ); + virtual RSCCLASS_TYPE GetClassType() const; + // Der zulaessige Bereich wird gesetzt + ERRTYPE SetRange( INT32, INT32 ){ + return( ERR_UNKNOWN_METHOD ); + }; + ERRTYPE SetBool( const RSCINST & rInst, BOOL b ){ + return( SetNumber( rInst, (INT32)b ) ); + }; + ERRTYPE GetBool( const RSCINST & rInst, BOOL * pB){ + INT32 l; + GetNumber( rInst, &l ); + *pB = (0 != l); + return( ERR_OK ); + }; + void WriteSrc( const RSCINST &, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); + +}; + +class RscBreakRange : public RscRange { + INT32 nOutRange; +public: + RscBreakRange( Atom nId, sal_uInt32 nTypId ); + void SetOutRange( INT32 nNumber ){ + nOutRange = nNumber; + } + RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL ); + ERRTYPE SetNumber( const RSCINST &, INT32 ); +}; + +#endif // _RSCRANGE_HXX diff --git a/rsc/inc/rscrsc.hxx b/rsc/inc/rscrsc.hxx new file mode 100644 index 000000000000..128a956e51f5 --- /dev/null +++ b/rsc/inc/rscrsc.hxx @@ -0,0 +1,141 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscrsc.hxx,v $ + * $Revision: 1.13 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCRSC_HXX +#define _RSCRSC_HXX + +#ifndef RSCALL_H +#include <rscall.h> +#endif +#ifndef RSCERROR_H +#include <rscerror.h> +#endif +#ifndef RSCTOOLS_HXX +#include <rsctools.hxx> +#endif + +#include <list> + +class RscTypCont; +class DirEntry; + +/****************** T Y P E S ********************************************/ + +#define MAX_INPUTFILES 100 +#define MAX_SYMBOLS 10 +#define MAX_INCLUDES 10 + +/****************** R s c C m d L i n e **********************************/ +class RscCmdLine +{ + void Init(); + +public: + + RscStrList aInputList; // Liste der Quelldateien + RscStrList aSymbolList; // Liste der Symbole + ByteString aPath; // Liste der Pfade + RSCBYTEORDER_TYPE nByteOrder; + unsigned short nCommands; // Steuerbits + ByteString aOutputLst; // Name der List-Ausgabedatei + ByteString aOutputSrs; // Name der Srs-Ausgabedatei + ByteString aOutputSrc; // Name der Src-Ausgabedatei + ByteString aOutputRcCtor; // Name der Ctor-Ausgabedatei + ByteString aOutputCxx; // Name der Cxx-Ausgabedatei + ByteString aOutputHxx; // Name der Hxx-Ausgabedatei + ByteString aTouchFile; // create this file when done in rsc2 + ByteString aILDir; + + struct OutputFile + { + ByteString aLangName; // language name + ByteString aOutputRc; // target file + ByteString aLangSearchPath; // language specific search path + ::std::list< ByteString > aSysSearchDirs; // pathes to search for images + + OutputFile() {} + }; + + std::list<OutputFile> m_aOutputFiles; + std::list< std::pair< rtl::OString, rtl::OString > > m_aReplacements; + + RscCmdLine( int argc, char ** argv, RscError * pEH ); + RscCmdLine(); + + ~RscCmdLine(); + + ::rtl::OString substitutePaths( const ::rtl::OString& rIn ); +}; +/****************** R s c ************************************************/ + +struct WriteRcContext; + +class RscCompiler +{ +private: + RscStrList aTmpFileList; // Liste der Tmp-Dateien + ByteString aTmpOutputHxx; // Name der TempHxx-Ausgabedatei + ByteString aTmpOutputCxx; // Name der TempCxx-Ausgabedatei + ByteString aTmpOutputRcCtor; // Name der Temp Ctor-Ausgabedatei + ByteString aTmpOutputSrc; // Name der TempSrc-Ausgabedatei + + void CreateResFile( const char * pRc ); + void Append( const ByteString& rOutputSrs, const ByteString& rTmpFile ); + void OpenInput( const ByteString& rInput ); + + bool GetImageFilePath( const RscCmdLine::OutputFile& rOutputFile, + const WriteRcContext& rContext, + const ByteString& rBaseFileName, + ByteString& rImagePath, + FILE* pSysListFile ); + void PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile, + const WriteRcContext& rContext, + const DirEntry& rSrsInPath, + const DirEntry& rSrsOutPath ); + +public: + RscTypCont* pTC; // String und Id-Verwalter + RscCmdLine* pCL; // Kommandozeile + FILE * fListing; // Ausgabedatei fuer Listings + FILE * fExitFile; // bei Abbruch muss diese Datei geschlossen werden + + RscCompiler( RscCmdLine *, RscTypCont * ); + ~RscCompiler(); + + ERRTYPE Start(); + ByteString GetTmpFileName(); // Die Dateien werden geloescht + + // Include Statements lesen + ERRTYPE IncludeParser( ULONG lFileKey ); + ERRTYPE ParseOneFile( ULONG lFileKey, const RscCmdLine::OutputFile* pOutputFile, const WriteRcContext* pContext ); + ERRTYPE Link(); + void EndCompile(); +}; + +#endif //_RSCRSC_HXX diff --git a/rsc/inc/rscsfx.hxx b/rsc/inc/rscsfx.hxx new file mode 100644 index 000000000000..e46a0225e394 --- /dev/null +++ b/rsc/inc/rscsfx.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscsfx.hxx,v $ + * $Revision: 1.4 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCSFX_HXX +#define _RSCSFX_HXX + +// StarView (RSC_NOTYPE) bis (RSC_NOTYPE + 0x190) +// Sfx (RSC_NOTYPE + 0x200) bis (RSC_NOTYPE + 0x20F) +#define RSC_SFX_STYLE_FAMILIES (0x100 + 0x201) +#define RSC_SFX_STYLE_FAMILY_ITEM (0x100 + 0x202) +#define RSC_SFX_SLOT_INFO (0x100 + 0x203) +// StarMoney (RSC_NOTYPE + 0x210) bis (RSC_NOTYPE + 0x22F) +// Public (RSC_NOTYPE + 0x300) bis (RSC_NOTYPE + 0x3FF) + +//========== S F X ======================================= +enum SfxStyleFamily { SFX_STYLE_FAMILY_CHAR = 1, + SFX_STYLE_FAMILY_PARA = 2, + SFX_STYLE_FAMILY_FRAME = 4, + SFX_STYLE_FAMILY_PAGE = 8, + SFX_STYLE_FAMILY_PSEUDO = 16, + SFX_STYLE_FAMILY_ALL = 0x7fff + }; + + +// SfxTemplateDialog +#define RSC_SFX_STYLE_ITEM_LIST 0x1 +#define RSC_SFX_STYLE_ITEM_BITMAP 0x2 +#define RSC_SFX_STYLE_ITEM_TEXT 0x4 +#define RSC_SFX_STYLE_ITEM_HELPTEXT 0x8 +#define RSC_SFX_STYLE_ITEM_STYLEFAMILY 0x10 +#define RSC_SFX_STYLE_ITEM_IMAGE 0x20 + + +// SfxSlotInfo +#define RSC_SFX_SLOT_INFO_SLOTNAME 0x1 +#define RSC_SFX_SLOT_INFO_HELPTEXT 0x2 + + +#endif diff --git a/rsc/inc/rscstr.hxx b/rsc/inc/rscstr.hxx new file mode 100644 index 000000000000..0a6efbac4979 --- /dev/null +++ b/rsc/inc/rscstr.hxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rscstr.hxx,v $ + * $Revision: 1.5 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCSTR_HXX +#define _RSCSTR_HXX + +#include <rscall.h> +#include <rscerror.h> +#include <rschash.hxx> +#include <rsctop.hxx> + +/******************* R s c S t r i n g ***********************************/ +class RscString : public RscTop +{ + RscTop * pRefClass; + struct RscStringInst { + char * pStr; // Zeiger auf String + BOOL bDflt; // Ist Default + RscId aRefId; // ReferenzName + }; + sal_uInt32 nSize; +public: + RscString( Atom nId, sal_uInt32 nTypId ); + virtual RSCCLASS_TYPE GetClassType() const; + + void SetRefClass( RscTop * pClass ) + { + pRefClass = pClass; + }; + RSCINST Create( RSCINST * pInst, const RSCINST & rDfltInst, BOOL ); + // Der zulaessige Bereich wird gesetzt + void Destroy( const RSCINST & rInst ); + sal_uInt32 Size(){ return nSize; } + void SetToDefault( const RSCINST & rInst ) + { + ((RscStringInst*)rInst.pData)->bDflt = TRUE; + } + BOOL IsDefault( const RSCINST & rInst) + { + return( ((RscStringInst*)rInst.pData)->bDflt ); + }; + // Als Default setzen + BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + ERRTYPE SetString( const RSCINST &, const char * pStr ); + ERRTYPE GetString( const RSCINST &, char ** ppStr ); + ERRTYPE GetRef( const RSCINST & rInst, RscId * ); + ERRTYPE SetRef( const RSCINST & rInst, const RscId & rRefId ); + void WriteSrc( const RSCINST &, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, const char * ); + ERRTYPE WriteRc( const RSCINST &, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32, BOOL bExtra ); + virtual void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); +}; + +#endif // _RSCSTR_HXX diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx new file mode 100644 index 000000000000..eb9f8937b939 --- /dev/null +++ b/rsc/inc/rsctools.hxx @@ -0,0 +1,204 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rsctools.hxx,v $ + * $Revision: 1.7 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +struct RSHEADER_TYPE; +class RscPtrPtr; + +#ifndef _RSCTOOLS_HXX +#define _RSCTOOLS_HXX + +#ifdef UNX +#include <stdlib.h> +#endif +#include <stdio.h> +#include <tools/string.hxx> +#include <tools/list.hxx> + +/******************* T y p e s *******************************************/ +// Zeichensatz +enum COMPARE { LESS = -1, EQUAL = 0, GREATER = 1 }; + +enum RSCBYTEORDER_TYPE { RSC_BIGENDIAN, RSC_LITTLEENDIAN, RSC_SYSTEMENDIAN }; + +/******************* M A K R O S *****************************************/ +#define ALIGNED_SIZE( nSize ) \ + (nSize + sizeof( void * ) -1) / sizeof( void * ) * sizeof( void * ) +/******************* F u n c t i o n F o r w a r d s *******************/ +ByteString GetTmpFileName(); +BOOL Append( ByteString aDestFile, ByteString aSourceFile ); +BOOL Append( FILE * fDest, ByteString aSourceFile ); +ByteString InputFile ( const char * pInput, const char * pExt ); +ByteString OutputFile( ByteString aInput, const char * ext ); +char * ResponseFile( RscPtrPtr * ppCmd, char ** ppArgv, + sal_uInt32 nArgc ); +void RscExit( sal_uInt32 nExit ); + +/********* A n s i - F u n c t i o n F o r w a r d s *******************/ +int rsc_strnicmp( const char *string1, const char *string2, size_t count ); +int rsc_stricmp( const char *string1, const char *string2 ); +char* rsc_strdup( const char* ); + +/****************** C L A S S E S ****************************************/ +DECLARE_LIST( RscStrList, ByteString * ) +/*********** R s c C h a r ***********************************************/ +class RscChar +{ +public: + static char * MakeUTF8( char * pStr, UINT16 nTextEncoding ); + static char * MakeUTF8FromL( char * pStr ); +}; + +/****************** R s c P t r P t r ************************************/ +class RscPtrPtr +{ + sal_uInt32 nCount; + void ** pMem; +public: + RscPtrPtr(); + ~RscPtrPtr(); + void Reset(); + sal_uInt32 Append( void * ); + sal_uInt32 Append( char * pStr ){ + return( Append( (void *)pStr ) ); + }; + sal_uInt32 GetCount(){ return( nCount ); }; + void * GetEntry( sal_uInt32 nEle ); + void ** GetBlock(){ return( pMem ); }; +}; + +/****************** R s c W r i t e R c **********************************/ +class RscWriteRc +{ + sal_uInt32 nLen; + BOOL bSwap; + RSCBYTEORDER_TYPE nByteOrder; + char * pMem; + char * GetPointer( sal_uInt32 nSize ); +public: + RscWriteRc( RSCBYTEORDER_TYPE nOrder = RSC_SYSTEMENDIAN ); + ~RscWriteRc(); + sal_uInt32 IncSize( sal_uInt32 nSize );// gibt die vorherige Groesse + void * GetBuffer() + { + return GetPointer( 0 ); + } + sal_uInt16 GetShort( sal_uInt32 nPos ) + { + sal_uInt16 nVal = 0; + char* pFrom = GetPointer(nPos); + char* pTo = (char*)&nVal; + *pTo++ = *pFrom++; + *pTo++ = *pFrom++; + return bSwap ? SWAPSHORT( nVal ) : nVal; + } + sal_uInt32 GetLong( sal_uInt32 nPos ) + { + sal_uInt32 nVal = 0; + char* pFrom = GetPointer(nPos); + char* pTo = (char*)&nVal; + *pTo++ = *pFrom++; + *pTo++ = *pFrom++; + *pTo++ = *pFrom++; + *pTo++ = *pFrom++; + return bSwap ? SWAPLONG( nVal ) : nVal; + } + char * GetUTF8( sal_uInt32 nPos ) + { + return GetPointer( nPos ); + } + + + RSCBYTEORDER_TYPE GetByteOrder() const { return nByteOrder; } + sal_uInt32 Size(){ return( nLen ); }; + void Put( sal_uInt64 lVal ) + { + if( bSwap ) + { + Put( *(((sal_uInt32*)&lVal)+1) ); + Put( *(sal_uInt32*)&lVal ); + } + else + { + Put( *(sal_uInt32*)&lVal ); + Put( *(((sal_uInt32*)&lVal)+1) ); + } + } + void Put( sal_Int32 lVal ) + { + if( bSwap ) + { + Put( *(((sal_uInt16*)&lVal) +1) ); + Put( *(sal_uInt16*)&lVal ); + } + else + { + Put( *(sal_uInt16*)&lVal ); + Put( *(((sal_uInt16*)&lVal) +1) ); + } + } + void Put( sal_uInt32 nValue ) + { Put( (sal_Int32)nValue ); } + void Put( sal_uInt16 nValue ); + void Put( sal_Int16 nValue ) + { Put( (sal_uInt16)nValue ); } + void PutUTF8( char * pData ); + + void PutAt( sal_uInt32 nPos, INT32 lVal ) + { + if( bSwap ) + { + PutAt( nPos, *(((sal_uInt16*)&lVal) +1) ); + PutAt( nPos + 2, *(sal_uInt16*)&lVal ); + } + else + { + PutAt( nPos, *(sal_uInt16*)&lVal ); + PutAt( nPos + 2, *(((sal_uInt16*)&lVal) +1) ); + } + } + void PutAt( sal_uInt32 nPos, sal_uInt32 lVal ) + { + PutAt( nPos, (INT32)lVal); + } + void PutAt( sal_uInt32 nPos, short nVal ) + { + PutAt( nPos, (sal_uInt16)nVal ); + } + void PutAt( sal_uInt32 nPos, sal_uInt16 nVal ) + { + if( bSwap ) + nVal = SWAPSHORT( nVal ); + char* pTo = GetPointer( nPos ); + char* pFrom = (char*)&nVal; + *pTo++ = *pFrom++; + *pTo++ = *pFrom++; + } +}; + +#endif // _RSCTOOLS_HXX diff --git a/rsc/inc/rsctop.hxx b/rsc/inc/rsctop.hxx new file mode 100644 index 000000000000..c651ae9d8a78 --- /dev/null +++ b/rsc/inc/rsctop.hxx @@ -0,0 +1,250 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rsctop.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCTOP_HXX +#define _RSCTOP_HXX + +#include <rscerror.h> +#include <rsctools.hxx> +#include <rschash.hxx> +#include <rscclobj.hxx> + +/****************** T Y P E S ********************************************/ +typedef sal_uInt32 RSCVAR; +#define VAR_POINTER 0x0001 +#define VAR_HIDDEN 0x0002 +#define VAR_NODATAINST 0x0004 +#define VAR_NORC 0x0008 +#define VAR_SVDYNAMIC 0x0010 +#define VAR_NOENUM 0x0020 +#define VAR_EXTENDABLE 0x0040 /* Auch die Ableitung einer Klasse kann angegeben werden */ + +/****************** C L A S S E S ****************************************/ +/******************* R s c C l a s s *************************************/ +class RscTop : public RefNode +{ + RscTop * pSuperClass; + RSCINST aDfltInst; + sal_uInt32 nTypId; + RscTop * pRefClass; + +protected: + RscTop( Atom nId, sal_uInt32 nTypIdent, + RscTop * pSuperCl = NULL ); + +public: + ByteString aCallPar1; // Klassenaufruf ohne Typen bis ResId + ByteString aCallPar2; // Klassenaufruf ohne Typen ab ResId + ByteString aCallParType; // Klassenaufruf mit Typen + + void SetSuperClass( RscTop * pClass ) + { + pSuperClass = pClass; + } + RscTop* GetSuperClass() const + { return pSuperClass; } + // Gibt den Typidentifier zurueck + sal_uInt32 GetTypId() const + { return nTypId; }; + // Gibt die Oberklasse zurueck + BOOL InHierarchy( RscTop * pClass ); + BOOL IsCodeWriteable() const + { + return( 0 != aCallParType.Len() ); + } + void SetCallPar( const ByteString & rPar1, const ByteString & rPar2, + const ByteString & rParType ); + void SetRefClass( RscTop * pRef ) { pRefClass = pRef; } + RscTop* GetRefClass() const { return pRefClass; } + virtual RSCCLASS_TYPE GetClassType() const = 0; + RSCINST GetDefault(); + + // Vorbereitung auf den dtor aufruf + // Da die Klassen gegenseitige Abhaengigkeiten + // aufweisen koennen, kann man im dtor nicht davon + // ausgehen, dass alle Klassenzeiger noch gueltig sind + virtual void Pre_dtor(); + + virtual Atom GetConstant( sal_uInt32 ); + + virtual RscTop * GetTypeClass() const; + + // Gibt die Groesse der Klasse in Bytes + virtual sal_uInt32 Size(); + + // Gibt die Referenz zurueck + virtual ERRTYPE GetRef( const RSCINST & rInst, RscId * ); + + // Gibt die Referenz zurueck + virtual ERRTYPE SetRef( const RSCINST & rInst, const RscId & rRefId ); + + // Variable anlegen + virtual ERRTYPE SetVariable( Atom nVarName, RscTop * pClass, + RSCINST * pDflt = NULL, + RSCVAR nVarType = 0, sal_uInt32 nMask = 0, + Atom nDataBaseName = InvalidAtom ); + + // Zaehlt alle Variablen auf + virtual void EnumVariables( void * pData, VarEnumCallbackProc ); + + // Liefert Instanz der Variablen zurueck + // pData, pClass im return koennen NULL sein + virtual RSCINST GetVariable( const RSCINST & rInst, Atom nVarName, + const RSCINST & rInitInst, + BOOL nInitDflt = FALSE, + RscTop * pCreateClass = NULL ); + virtual RSCINST GetCopyVar( const RSCINST & rInst, Atom nVarName ); + + virtual RSCINST GetTupelVar( const RSCINST & rInst, sal_uInt32 nPos, + const RSCINST & rInitInst ); + + // Liefert Instanz aus einem Feld zurueck + // pGetInst im return kann NULL sein + virtual ERRTYPE GetElement( const RSCINST & rInst, const RscId & rEleName, + RscTop *pCreateClass, const RSCINST & rCreateInst, + RSCINST * pGetInst ); + + // Liefert Instanz aus einem Feld zurueck + // pGetInst im return kann NULL sein + virtual ERRTYPE GetValueEle( const RSCINST & rInst, INT32 lValue, + RscTop * pCreateClass, + RSCINST * pGetInst ); + + // Liefert Instanz aus einem Feld zurueck + // pGetInst im return kann NULL sein + virtual ERRTYPE GetArrayEle( const RSCINST & rInst, Atom nId, + RscTop * pCreateClass, + RSCINST * pGetInst ); + + virtual RSCINST SearchEle( const RSCINST & rInst, const RscId & rEleName, + RscTop * pClass ); + + // Liefert Instanz an der Position zurueck + virtual RSCINST GetPosEle( const RSCINST & rInst, sal_uInt32 nPos ); + + // verschiebt eine Instanz + virtual ERRTYPE MovePosEle( const RSCINST & rInst, sal_uInt32 nDestPos, + sal_uInt32 nSourcePos ); + + // aendert RscId an Position + virtual ERRTYPE SetPosRscId( const RSCINST & rInst, sal_uInt32 nPos, + const RscId & rRscId); + + // Liefert Information ueber Instanz + // an der Position zurueck + virtual SUBINFO_STRUCT GetInfoEle( const RSCINST & rInst, sal_uInt32 nPos ); + + // Anzahl der Eintraege + virtual sal_uInt32 GetCount( const RSCINST & rInst ); + + // Eine Zuweisung an eine Variable + virtual ERRTYPE SetNumber( const RSCINST & rInst, INT32 lValue ); + + // Eine Zuweisung an eine Variable + virtual ERRTYPE SetBool( const RSCINST & rInst, BOOL bValue ); + + // Eine Zuweisung an eine Variable + virtual ERRTYPE SetConst( const RSCINST & rInst, Atom nValueId, + INT32 nValue ); + + // Eine Zuweisung an eine Variable + virtual ERRTYPE SetNotConst( const RSCINST & rInst, Atom nId ); + + virtual ERRTYPE SetString( const RSCINST & rInst, const char * pStr ); + + virtual ERRTYPE GetNumber( const RSCINST & rInst, INT32 * pN ); + + virtual ERRTYPE GetBool( const RSCINST & rInst, BOOL * pB ); + + virtual ERRTYPE GetConst( const RSCINST & rInst, Atom * pH ); + + virtual ERRTYPE GetString( const RSCINST & rInst, char ** ppStr ); + + virtual RSCINST Create( RSCINST * pInst, + const RSCINST & rDefInst, BOOL bOwnClass = FALSE ); + + // Instanz zerstoeren + virtual void Destroy( const RSCINST & rInst ); + + // prueft auf konsistenz + virtual BOOL IsConsistent( const RSCINST & rInst, + RscInconsList * pList = NULL ); + + // Alles auf Default setzen + virtual void SetToDefault( const RSCINST & rInst ); + + // Ist Eingabe = Default + virtual BOOL IsDefault( const RSCINST & rInst ); + + // Gleiche Werte auf Default setzen + virtual BOOL IsValueDefault( const RSCINST & rInst, CLASS_DATA pDef ); + + // Instanz auf Default setzen + virtual void SetDefault( const RSCINST & rInst, Atom nVarId ); + + // Default zu einer Variablen holen + virtual RSCINST GetDefault( Atom nVarId ); + + virtual void Delete( const RSCINST & rInst, RscTop * pClass, + const RscId & rId ); + + virtual void DeletePos( const RSCINST & rInst, sal_uInt32 nPos ); + + // Schreibt den Kopf und das Ende einer Resource + // Script Datei + virtual void WriteSrcHeader( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab, + const RscId & aId, const char * ); + virtual void WriteSrc( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, sal_uInt32 nTab,const char * ); + virtual ERRTYPE WriteRcHeader( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, const RscId & aId, + sal_uInt32 nDeep, BOOL bExtra ); + virtual ERRTYPE WriteRc( const RSCINST & rInst, RscWriteRc & aMem, + RscTypCont * pTC, sal_uInt32 nDeep, BOOL bExtra ); + + // Weiterleitung an Superklassen wird unterbunden + virtual ERRTYPE WriteHxxHeader( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId & rId ); + virtual ERRTYPE WriteHxx( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId &rId ); + virtual ERRTYPE WriteCxxHeader( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId &rId ); + virtual ERRTYPE WriteCxx( const RSCINST & rInst, FILE * fOutput, + RscTypCont * pTC, const RscId &rId ); + + void WriteSyntaxHeader( FILE * fOutput, RscTypCont * pTC ); + virtual void WriteSyntax( FILE * fOutput, RscTypCont * pTC ); + + virtual void WriteRcAccess( FILE * fOutput, RscTypCont * pTC, + const char * ); + virtual void WriteRcCtor( FILE * fOutput, RscTypCont * pTC ); +}; + +#endif //_RSCTOP_HXX diff --git a/rsc/inc/rsctree.hxx b/rsc/inc/rsctree.hxx new file mode 100644 index 000000000000..4893ad3fd292 --- /dev/null +++ b/rsc/inc/rsctree.hxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: rsctree.hxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _RSCTREE_HXX +#define _RSCTREE_HXX + +#include <tools/link.hxx> +#include <rsctools.hxx> + +/****************** C L A S S E S ****************************************/ +class BiNode +{ +protected: + BiNode* pLeft; // left subtree + BiNode* pRight; // right subtree + +public: + + // Wandelt eine doppelt verkettete Liste in + // einen binaeren Baum um + BiNode * ChangeDLListBTree( BiNode * pList ); + + BiNode(); + virtual ~BiNode(); + + + // Wandelt einen binaeren Baum in eine doppelt + // verkettete Liste um + BiNode* ChangeBTreeDLList(); + + BiNode * Left() const { return pLeft ; }; + BiNode * Right() const{ return pRight ; }; + void EnumNodes( Link aLink ) const; +}; + +/*************************************************************************/ +class NameNode : public BiNode +{ + void SubOrderTree( NameNode * pOrderNode ); + +protected: + // pCmp ist Zeiger auf Namen + NameNode* Search( const void * pCmp ) const; + +public: + NameNode* Left() const { return (NameNode *)pLeft ; }; + NameNode* Right() const{ return (NameNode *)pRight ; }; + NameNode* Search( const NameNode * pName ) const; + // insert a new node in the b-tree + BOOL Insert( NameNode * pTN, sal_uInt32 * nDepth ); + BOOL Insert( NameNode* pTN ); + virtual COMPARE Compare( const NameNode * ) const; + virtual COMPARE Compare( const void * ) const; + NameNode* SearchParent( const NameNode * ) const; + // return ist neue Root + NameNode* Remove( NameNode * ); + void OrderTree(); + BOOL IsOrderTree() const; + +}; + +/*************************************************************************/ +class IdNode : public NameNode +{ + virtual COMPARE Compare( const NameNode * ) const; + virtual COMPARE Compare( const void * ) const; +protected: + using NameNode::Search; + +public: + + IdNode* Search( sal_uInt32 nTypName ) const; + virtual sal_uInt32 GetId() const; +}; + +/*************************************************************************/ +class StringNode : public NameNode +{ + virtual COMPARE Compare( const NameNode * ) const; + virtual COMPARE Compare( const void * ) const; + +protected: + using NameNode::Search; + + ByteString aName; + +public: + StringNode(){}; + StringNode( const ByteString & rStr ) { aName = rStr; } + + StringNode* Search( const char * ) const; + ByteString GetName() const { return aName; } +}; + +#endif // _RSCTREE_HXX diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx new file mode 100644 index 000000000000..2704fced5c01 --- /dev/null +++ b/rsc/inc/vclrsc.hxx @@ -0,0 +1,348 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: vclrsc.hxx,v $ + * $Revision: 1.12 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLS_VCLRSC_HXX +#define _TOOLS_VCLRSC_HXX + +#include <sal/types.h> +#include <tools/solar.h> + +// --------------- +// - Window-Bits - +// --------------- + +// from vcl/inc/wintypes.hxx +typedef sal_Int64 WinBits; + +// Window-Bits fuer Window +#define WB_CLIPCHILDREN ((WinBits)0x00000001) +#define WB_DIALOGCONTROL ((WinBits)0x00000002) +#define WB_NODIALOGCONTROL ((WinBits)0x00000004) +#define WB_BORDER ((WinBits)0x00000008) +#define WB_NOBORDER ((WinBits)0x00000010) +#define WB_SIZEABLE ((WinBits)0x00000020) +#define WB_3DLOOK ((WinBits)0x00000040) +#define WB_AUTOSIZE ((WinBits)0x00000080) + +// Window-Bits fuer SystemWindows +#define WB_MOVEABLE ((WinBits)0x00000100) +#define WB_ROLLABLE ((WinBits)0x00000200) +#define WB_CLOSEABLE ((WinBits)0x00000400) +#define WB_STANDALONE ((WinBits)0x00000800) +#define WB_APP ((WinBits)0x00001000) +#define WB_PINABLE ((WinBits)0x00002000) +#define WB_SYSTEMWINDOW ((WinBits)0x40000000) +#define WB_SIZEMOVE (WB_SIZEABLE | WB_MOVEABLE) + +// Standard-Window-Bits fuer ChildWindows +#define WB_TABSTOP ((WinBits)0x00000100) +#define WB_NOTABSTOP ((WinBits)0x00000200) +#define WB_GROUP ((WinBits)0x00000400) +#define WB_NOGROUP ((WinBits)0x00000800) +#define WB_HORZ ((WinBits)0x00001000) +#define WB_VERT ((WinBits)0x00002000) +#define WB_LEFT ((WinBits)0x00004000) +#define WB_CENTER ((WinBits)0x00008000) +#define WB_RIGHT ((WinBits)0x00010000) +#define WB_TOP ((WinBits)0x00020000) +#define WB_VCENTER ((WinBits)0x00040000) +#define WB_BOTTOM ((WinBits)0x00080000) +#define WB_DRAG ((WinBits)0x00100000) +#define WB_SPIN ((WinBits)0x00200000) +#define WB_REPEAT ((WinBits)0x00400000) +#define WB_NOPOINTERFOCUS ((WinBits)0x00800000) +#define WB_WORDBREAK ((WinBits)0x01000000) +#define WB_NOLABEL ((WinBits)0x02000000) +#define WB_SORT ((WinBits)0x04000000) +#define WB_DROPDOWN ((WinBits)0x08000000) +#define WB_AUTOHSCROLL ((WinBits)0x10000000) +#define WB_DOCKABLE ((WinBits)0x20000000) +#define WB_AUTOVSCROLL ((WinBits)0x40000000) + +#define WB_HIDE ((WinBits)0x80000000) +#define WB_HSCROLL WB_HORZ +#define WB_VSCROLL WB_VERT +#define WB_TOPIMAGE WB_TOP + +// Window-Bits for PushButtons +#define WB_DEFBUTTON ((WinBits)0x10000000) +#define WB_NOLIGHTBORDER ((WinBits)0x20000000) +#define WB_RECTSTYLE ((WinBits)0x08000000) +#define WB_SMALLSTYLE ((WinBits)0x04000000) + +// Window-Bits for FixedText +#define WB_INFO ((WinBits)0x20000000) +#define WB_PATHELLIPSIS ((WinBits)0x00100000) + +// Window-Bits for Edit +#define WB_PASSWORD ((WinBits)0x01000000) +#define WB_READONLY ((WinBits)0x02000000) +#define WB_NOHIDESELECTION ((WinBits)SAL_CONST_INT64(0x1000000000)) + +// Window-Bits for MultiLineEdit +#define WB_IGNORETAB ((WinBits)0x20000000) + +// Window-Bits for ListBox and MultiListBox +#define WB_SIMPLEMODE ((WinBits)0x20000000) + +// Window-Bits for FixedBitmap +#define WB_FAST ((WinBits)0x04000000) +#define WB_SCALE ((WinBits)0x08000000) +#define WB_TOPLEFTVISIBLE ((WinBits)0x10000000) + +// Window-Bits for ToolBox +#define WB_LINESPACING ((WinBits)0x01000000) +#define WB_SCROLL ((WinBits)0x02000000) + +// Window-Bits for TabControl +#define WB_SINGLELINE ((WinBits)0x02000000) + +// Window-Bits for DockingWindows +#define WB_DOCKBORDER ((WinBits)0x00001000) + +// Window-Bits for SplitWindow +#define WB_NOSPLITDRAW ((WinBits)0x01000000) +#define WB_FLATSPLITDRAW ((WinBits)0x02000000) + +// Window-Bits for MessageBoxen +#define WB_OK ((WinBits)0x00100000) +#define WB_OK_CANCEL ((WinBits)0x00200000) +#define WB_YES_NO ((WinBits)0x00400000) +#define WB_YES_NO_CANCEL ((WinBits)0x00800000) +#define WB_RETRY_CANCEL ((WinBits)0x01000000) +#define WB_DEF_OK ((WinBits)0x02000000) +#define WB_DEF_CANCEL ((WinBits)0x04000000) +#define WB_DEF_RETRY ((WinBits)0x08000000) +#define WB_DEF_YES ((WinBits)0x10000000) +#define WB_DEF_NO ((WinBits)0x20000000) +#define WB_ABORT_RETRY_IGNORE ((WinBits)SAL_CONST_INT64(0x1000000000)) +#define WB_DEF_IGNORE ((WinBits)SAL_CONST_INT64(0x2000000000)) + +// Standard-WinBits +#define WB_STDWORK (WB_SIZEMOVE | WB_CLOSEABLE) +#define WB_STDMDI (WB_CLOSEABLE) +#define WB_STDDOCKWIN (WB_DOCKABLE | WB_MOVEABLE | WB_CLOSEABLE) +#define WB_STDFLOATWIN (WB_SIZEMOVE | WB_CLOSEABLE | WB_ROLLABLE) +#define WB_STDDIALOG (WB_MOVEABLE | WB_CLOSEABLE) +#define WB_STDMODELESS (WB_STDDIALOG) +#define WB_STDMODAL (WB_STDDIALOG) +#define WB_STDTABDIALOG (WB_STDDIALOG) +#define WB_STDTABCONTROL 0 + +// For TreeListBox +#define WB_HASBUTTONS ((WinBits)0x00800000) +#define WB_HASLINES ((WinBits)0x01000000) +#define WB_HASLINESATROOT ((WinBits)0x02000000) + +// -------------- +// - Help-Types - +// -------------- + +// from vcl/inc/help.hxx +#define OOO_HELP_INDEX ((ULONG)0xFFFFFFFF) +#define OOO_HELP_HELPONHELP ((ULONG)0xFFFFFFFE) + +// -------------- +// - FieldTypes - +// -------------- + +// from vcl/inc/fldunit.hxx +enum FieldUnit { FUNIT_NONE, FUNIT_MM, FUNIT_CM, FUNIT_M, FUNIT_KM, + FUNIT_TWIP, FUNIT_POINT, FUNIT_PICA, + FUNIT_INCH, FUNIT_FOOT, FUNIT_MILE, FUNIT_CUSTOM, + FUNIT_PERCENT, FUNIT_100TH_MM }; + + +// from vcl/inc/vclenum.hxx +#ifndef ENUM_TIMEFIELDFORMAT_DECLARED +#define ENUM_TIMEFIELDFORMAT_DECLARED + +enum TimeFieldFormat {TIMEF_NONE, TIMEF_SEC, TIMEF_100TH_SEC, TIMEF_SEC_CS, TimeFieldFormat_FORCE_EQUAL_SIZE=SAL_MAX_ENUM }; + +#endif + +// ----------------- +// - KeyCode-Types - +// ----------------- +#include <com/sun/star/awt/Key.hpp> +#include <com/sun/star/awt/KeyGroup.hpp> + +#define KEY_CODE ((sal_uInt16)0x0FFF) + +// Modifier-Tasten +#define KEY_SHIFT ((sal_uInt16)0x1000) +#define KEY_MOD1 ((sal_uInt16)0x2000) +#define KEY_MOD2 ((sal_uInt16)0x4000) +#define KEY_MOD3 ((sal_uInt16)0x8000) +#define KEY_MODTYPE ((sal_uInt16)0xF000) +#define KEY_ALLMODTYPE ((sal_uInt16)0xF000) + + +// from vcl/inc/vclenum.hxx +#ifndef ENUM_KEYFUNCTYPE_DECLARED +#define ENUM_KEYFUNCTYPE_DECLARED + +enum KeyFuncType { KEYFUNC_DONTKNOW, KEYFUNC_NEW, KEYFUNC_OPEN, KEYFUNC_SAVE, + KEYFUNC_SAVEAS, KEYFUNC_PRINT, KEYFUNC_CLOSE, KEYFUNC_QUIT, + KEYFUNC_CUT, KEYFUNC_COPY, KEYFUNC_PASTE, KEYFUNC_UNDO, + KEYFUNC_REDO, KEYFUNC_DELETE, KEYFUNC_REPEAT, KEYFUNC_FIND, + KEYFUNC_FINDBACKWARD, KEYFUNC_PROPERTIES, KEYFUNC_FRONT, + KeyFuncType_FORCE_EQUAL_SIZE=SAL_MAX_ENUM }; + +#endif + +// ------------ +// - TriState - +// ------------ + +// from vcl/inc/wintypes.hxx +enum TriState { STATE_NOCHECK, STATE_CHECK, STATE_DONTKNOW }; + +// ----------------- +// - MapMode-Types - +// ----------------- + +// from vcl/inc/mapmod.hxx +enum MapUnit { MAP_100TH_MM, MAP_10TH_MM, MAP_MM, MAP_CM, + MAP_1000TH_INCH, MAP_100TH_INCH, MAP_10TH_INCH, MAP_INCH, + MAP_POINT, MAP_TWIP, MAP_PIXEL, MAP_SYSFONT, MAP_APPFONT, + MAP_RELATIVE, MAP_REALAPPFONT }; + +// Das Resourcesystem benutzt den Wert 0xFFFF (freihalten) + + +// -------------------------- +// - Bits fuer ToolBoxItems - +// -------------------------- + +// from vcl/inc/toolbox.hxx +typedef sal_uInt16 ToolBoxItemBits; + +#define TIB_CHECKABLE ((ToolBoxItemBits)0x0001) +#define TIB_RADIOCHECK ((ToolBoxItemBits)0x0002) +#define TIB_AUTOCHECK ((ToolBoxItemBits)0x0004) +#define TIB_LEFT ((ToolBoxItemBits)0x0008) +#define TIB_AUTOSIZE ((ToolBoxItemBits)0x0010) +#define TIB_DROPDOWN ((ToolBoxItemBits)0x0020) +#define TIB_REPEAT ((ToolBoxItemBits)0x0040) + +enum ButtonType { BUTTON_SYMBOL, BUTTON_TEXT, BUTTON_SYMBOLTEXT }; + +enum ToolBoxItemType { TOOLBOXITEM_DONTKNOW, TOOLBOXITEM_BUTTON, + TOOLBOXITEM_SPACE, TOOLBOXITEM_SEPARATOR, + TOOLBOXITEM_BREAK }; + + +// --------------- +// - BorderStyle - +// --------------- + +typedef sal_uInt16 WindowBorderStyle; + +#define WINDOW_BORDER_NORMAL ((WindowBorderStyle)0x0001) +#define WINDOW_BORDER_MONO ((WindowBorderStyle)0x0002) +#define WINDOW_BORDER_ACTIVE ((WindowBorderStyle)0x0004) +#define WINDOW_BORDER_DOUBLEOUT ((WindowBorderStyle)0x0008) +#define WINDOW_BORDER_MENU ((WindowBorderStyle)0x0010) +#define WINDOW_BORDER_NOBORDER ((WindowBorderStyle)0x1000) + +// --------------- +// - WindowAlign - +// --------------- + +// from vcl/inc/wintypes.hxx +enum WindowAlign { WINDOWALIGN_LEFT, WINDOWALIGN_TOP, WINDOWALIGN_RIGHT, WINDOWALIGN_BOTTOM }; +enum ImageAlign { IMAGEALIGN_LEFT, IMAGEALIGN_TOP, IMAGEALIGN_RIGHT, IMAGEALIGN_BOTTOM }; + +// -------------- +// - Menu-Types - +// -------------- + +// from vcl/inc/menu.hxx +enum MenuItemType { MENUITEM_DONTKNOW, MENUITEM_STRING, MENUITEM_IMAGE, + MENUITEM_STRINGIMAGE, MENUITEM_SEPARATOR }; + +typedef sal_uInt16 MenuItemBits; + +#define MIB_CHECKABLE ((MenuItemBits)0x0001) +#define MIB_RADIOCHECK ((MenuItemBits)0x0002) +#define MIB_AUTOCHECK ((MenuItemBits)0x0004) +#define MIB_ABOUT ((MenuItemBits)0x0008) +#define MIB_HELP ((MenuItemBits)0x0010) +#define MIB_POPUPSELECT ((MenuItemBits)0x0020) + +// ---------------- +// - Symbol-Types - +// ---------------- + +// from vcl/inc/symbol.hxx +typedef sal_uInt16 SymbolType; +#define SYMBOL_DONTKNOW ((SymbolType)0) +#define SYMBOL_IMAGE ((SymbolType)1) +#define SYMBOL_ARROW_UP ((SymbolType)2) +#define SYMBOL_ARROW_DOWN ((SymbolType)3) +#define SYMBOL_ARROW_LEFT ((SymbolType)4) +#define SYMBOL_ARROW_RIGHT ((SymbolType)5) +#define SYMBOL_SPIN_UP ((SymbolType)6) +#define SYMBOL_SPIN_DOWN ((SymbolType)7) +#define SYMBOL_SPIN_LEFT ((SymbolType)8) +#define SYMBOL_SPIN_RIGHT ((SymbolType)9) +#define SYMBOL_FIRST ((SymbolType)10) +#define SYMBOL_LAST ((SymbolType)11) +#define SYMBOL_PREV ((SymbolType)12) +#define SYMBOL_NEXT ((SymbolType)13) +#define SYMBOL_PAGEUP ((SymbolType)14) +#define SYMBOL_PAGEDOWN ((SymbolType)15) +#define SYMBOL_PLAY ((SymbolType)16) +#define SYMBOL_REVERSEPLAY ((SymbolType)17) +#define SYMBOL_RECORD ((SymbolType)18) +#define SYMBOL_STOP ((SymbolType)19) +#define SYMBOL_PAUSE ((SymbolType)20) +#define SYMBOL_WINDSTART ((SymbolType)21) +#define SYMBOL_WINDEND ((SymbolType)22) +#define SYMBOL_WINDBACKWARD ((SymbolType)23) +#define SYMBOL_WINDFORWARD ((SymbolType)24) +#define SYMBOL_CLOSE ((SymbolType)25) +#define SYMBOL_ROLLUP ((SymbolType)26) +#define SYMBOL_ROLLDOWN ((SymbolType)27) +#define SYMBOL_CHECKMARK ((SymbolType)28) +#define SYMBOL_RADIOCHECKMARK ((SymbolType)29) +#define SYMBOL_SPIN_UPDOWN ((SymbolType)30) +#define SYMBOL_FLOAT ((SymbolType)31) +#define SYMBOL_DOCK ((SymbolType)32) +#define SYMBOL_HIDE ((SymbolType)33) +#define SYMBOL_HELP ((SymbolType)34) +#define SYMBOL_OS2CLOSE ((SymbolType)35) +#define SYMBOL_OS2FLOAT ((SymbolType)36) +#define SYMBOL_OS2HIDE ((SymbolType)37) + +#define SYMBOL_NOSYMBOL (SYMBOL_DONTKNOW) + +#endif |