1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #include <tools/stack.hxx> 28 29 #include <hash_set> 30 #include <rtl/strbuf.hxx> 31 #include <rtl/string.hxx> 32 33 // a buffer for unique strings 34 class StringContainer 35 { 36 std::hash_set< rtl::OString, rtl::OStringHash > m_aStrings; 37 public: 38 StringContainer() {} 39 ~StringContainer() {} 40 41 const char* putString( const char* pString ); 42 }; 43 44 45 enum MODE_ENUM { MODE_MODELESS, MODE_APPLICATIONMODAL, MODE_SYSTEMMODAL }; 46 47 enum JUSTIFY_ENUM { JUST_CENTER, JUST_RIGHT, JUST_LEFT }; 48 49 enum SHOW_ENUM { SHOW_NORMAL, SHOW_MINIMIZED, SHOW_MAXIMIZED }; 50 51 enum ENUMHEADER { HEADER_NAME, HEADER_NUMBER }; 52 53 enum REF_ENUM { TYPE_NOTHING, TYPE_REF, TYPE_COPY }; 54 55 struct RSCHEADER { 56 RscTop * pClass; 57 RscExpType nName1; 58 REF_ENUM nTyp; 59 RscTop * pRefClass; 60 RscExpType nName2; 61 }; 62 63 /************** O b j e c t s t a c k ************************************/ 64 struct Node { 65 Node* pPrev; 66 RSCINST aInst; 67 sal_uInt32 nTupelRec; // Rekursionstiefe fuer Tupel 68 Node() { pPrev = NULL; nTupelRec = 0; }; 69 }; 70 71 class ObjectStack { 72 private : 73 Node* pRoot; 74 public : 75 76 ObjectStack () { pRoot = NULL; } 77 78 const RSCINST & Top () { return pRoot->aInst; } 79 sal_Bool IsEmpty() { return( pRoot == NULL ); } 80 void IncTupelRec() { pRoot->nTupelRec++; } 81 void DecTupelRec() { pRoot->nTupelRec--; } 82 sal_uInt32 TupelRecCount() const { return pRoot->nTupelRec; } 83 void Push( RSCINST aInst ) 84 { 85 Node* pTmp; 86 87 pTmp = pRoot; 88 pRoot = new Node; 89 pRoot->aInst = aInst; 90 pRoot->pPrev = pTmp; 91 } 92 void Pop() 93 { 94 Node* pTmp; 95 96 pTmp = pRoot; 97 pRoot = pTmp->pPrev; 98 delete pTmp; 99 } 100 }; 101 102 /****************** F o r w a r d s **************************************/ 103 #if defined( RS6000 ) 104 extern "C" int yyparse(); // forward Deklaration fuer erzeugte Funktion 105 extern "C" void yyerror( char * ); 106 extern "C" int yylex( void ); 107 #elif defined( HP9000 ) || defined( SCO ) || defined ( SOLARIS ) 108 extern "C" int yyparse(); // forward Deklaration fuer erzeugte Funktion 109 extern "C" void yyerror( const char * ); 110 extern "C" int yylex( void ); 111 #else 112 #if defined ( WTC ) || defined ( GCC ) || (_MSC_VER >= 1400) 113 int yyparse(); // forward Deklaration fuer erzeugte Funktion 114 #else 115 yyparse(); // forward Deklaration fuer erzeugte Funktion 116 #endif 117 void yyerror( char * ); 118 int yylex( void ); 119 #endif 120 121 class RscTypCont; 122 class RscFileInst; 123 124 extern RscTypCont* pTC; 125 extern RscFileInst * pFI; 126 extern RscExpression * pExp; 127 extern ObjectStack S; 128 extern StringContainer* pStringContainer; 129