1*1d2dbeb0SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*1d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*1d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*1d2dbeb0SAndrew Rist * distributed with this work for additional information 6*1d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*1d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*1d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 9*1d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 10*1d2dbeb0SAndrew Rist * 11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*1d2dbeb0SAndrew Rist * 13*1d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*1d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 15*1d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*1d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 17*1d2dbeb0SAndrew Rist * specific language governing permissions and limitations 18*1d2dbeb0SAndrew Rist * under the License. 19*1d2dbeb0SAndrew Rist * 20*1d2dbeb0SAndrew Rist *************************************************************/ 21*1d2dbeb0SAndrew Rist 22*1d2dbeb0SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _DBG_LAY_HXX 25cdf0e10cSrcweir #define _DBG_LAY_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #define PROT_FILE_INIT 0x00000000 28cdf0e10cSrcweir #define PROT_INIT 0x00000001 29cdf0e10cSrcweir #define PROT_MAKEALL 0x00000002 30cdf0e10cSrcweir #define PROT_MOVE_FWD 0x00000004 31cdf0e10cSrcweir #define PROT_MOVE_BWD 0x00000008 32cdf0e10cSrcweir #define PROT_GROW 0x00000010 33cdf0e10cSrcweir #define PROT_SHRINK 0x00000020 34cdf0e10cSrcweir #define PROT_GROW_TST 0x00000040 35cdf0e10cSrcweir #define PROT_SHRINK_TST 0x00000080 36cdf0e10cSrcweir #define PROT_SIZE 0x00000100 37cdf0e10cSrcweir #define PROT_PRTAREA 0x00000200 38cdf0e10cSrcweir #define PROT_POS 0x00000400 39cdf0e10cSrcweir #define PROT_ADJUSTN 0x00000800 40cdf0e10cSrcweir #define PROT_SECTION 0x00001000 41cdf0e10cSrcweir #define PROT_CUT 0x00002000 42cdf0e10cSrcweir #define PROT_PASTE 0x00004000 43cdf0e10cSrcweir #define PROT_LEAF 0x00008000 44cdf0e10cSrcweir #define PROT_TESTFORMAT 0x00010000 45cdf0e10cSrcweir #define PROT_FRMCHANGES 0x00020000 46cdf0e10cSrcweir #define PROT_SNAPSHOT 0x00040000 47cdf0e10cSrcweir 48cdf0e10cSrcweir #define ACT_START 1 49cdf0e10cSrcweir #define ACT_END 2 50cdf0e10cSrcweir #define ACT_CREATE_MASTER 3 51cdf0e10cSrcweir #define ACT_CREATE_FOLLOW 4 52cdf0e10cSrcweir #define ACT_DEL_MASTER 5 53cdf0e10cSrcweir #define ACT_DEL_FOLLOW 6 54cdf0e10cSrcweir #define ACT_MERGE 7 55cdf0e10cSrcweir #define ACT_NEXT_SECT 8 56cdf0e10cSrcweir #define ACT_PREV_SECT 9 57cdf0e10cSrcweir 58cdf0e10cSrcweir #define SNAP_LOWER 0x00000001 59cdf0e10cSrcweir #define SNAP_FLYFRAMES 0x00000002 60cdf0e10cSrcweir #define SNAP_TABLECONT 0x00000004 61cdf0e10cSrcweir 62cdf0e10cSrcweir #ifdef DBG_UTIL 63cdf0e10cSrcweir 64cdf0e10cSrcweir #include "swtypes.hxx" 65cdf0e10cSrcweir 66cdf0e10cSrcweir class SwImplProtocol; 67cdf0e10cSrcweir class SwFrm; 68cdf0e10cSrcweir class SwImplEnterLeave; 69cdf0e10cSrcweir 70cdf0e10cSrcweir class SwProtocol 71cdf0e10cSrcweir { 72cdf0e10cSrcweir static sal_uLong nRecord; 73cdf0e10cSrcweir static SwImplProtocol* pImpl; Start()74cdf0e10cSrcweir static sal_Bool Start() { return 0 != ( PROT_INIT & nRecord ); } 75cdf0e10cSrcweir public: Record()76cdf0e10cSrcweir static sal_uLong Record() { return nRecord; } SetRecord(sal_uLong nNew)77cdf0e10cSrcweir static void SetRecord( sal_uLong nNew ) { nRecord = nNew; } Record(sal_uLong nFunc)78cdf0e10cSrcweir static sal_Bool Record( sal_uLong nFunc ) { return 0 != (( nFunc | PROT_INIT ) & nRecord); } 79cdf0e10cSrcweir static void Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong nAction, void* pParam ); 80cdf0e10cSrcweir static void Init(); 81cdf0e10cSrcweir static void Stop(); 82cdf0e10cSrcweir static void SnapShot( const SwFrm* pFrm, sal_uLong nFlags ); 83cdf0e10cSrcweir static void GetVar( const sal_uInt16 nNo, long& rVar ); 84cdf0e10cSrcweir }; 85cdf0e10cSrcweir 86cdf0e10cSrcweir class SwEnterLeave 87cdf0e10cSrcweir { 88cdf0e10cSrcweir SwImplEnterLeave* pImpl; 89cdf0e10cSrcweir void Ctor( const SwFrm* pFrm, sal_uLong nFunc, sal_uLong nAct, void* pPar ); 90cdf0e10cSrcweir void Dtor(); 91cdf0e10cSrcweir public: SwEnterLeave(const SwFrm * pFrm,sal_uLong nFunc,sal_uLong nAct,void * pPar)92cdf0e10cSrcweir SwEnterLeave( const SwFrm* pFrm, sal_uLong nFunc, sal_uLong nAct, void* pPar ) 93cdf0e10cSrcweir { if( SwProtocol::Record( nFunc ) ) Ctor( pFrm, nFunc, nAct, pPar ); else pImpl = NULL; } ~SwEnterLeave()94cdf0e10cSrcweir ~SwEnterLeave() { if( pImpl ) Dtor(); } 95cdf0e10cSrcweir }; 96cdf0e10cSrcweir 97cdf0e10cSrcweir #define PROTOCOL( pFrm, nFunc, nAct, pPar ) { if( SwProtocol::Record( nFunc ) )\ 98cdf0e10cSrcweir SwProtocol::Record( pFrm, nFunc, nAct, pPar ); } 99cdf0e10cSrcweir #define PROTOCOL_INIT SwProtocol::Init(); 100cdf0e10cSrcweir #define PROTOCOL_STOP SwProtocol::Stop(); 101cdf0e10cSrcweir #define PROTOCOL_ENTER( pFrm, nFunc, nAct, pPar ) SwEnterLeave aEnter( pFrm, nFunc, nAct, pPar ); 102cdf0e10cSrcweir #define PROTOCOL_SNAPSHOT( pFrm, nFlags ) SwProtocol::SnapShot( pFrm, nFlags ); 103cdf0e10cSrcweir #define GET_VARIABLE( nNo, nVar ) SwProtocol::GetVar( nNo, nVar ); 104cdf0e10cSrcweir 105cdf0e10cSrcweir #else 106cdf0e10cSrcweir 107cdf0e10cSrcweir #define PROTOCOL( pFrm, nFunc, nAct, pPar ) 108cdf0e10cSrcweir #define PROTOCOL_INIT 109cdf0e10cSrcweir #define PROTOCOL_STOP 110cdf0e10cSrcweir #define PROTOCOL_ENTER( pFrm, nFunc, nAct, pPar ) 111cdf0e10cSrcweir #define PROTOCOL_SNAPSHOT( pFrm, nFlags ) 112cdf0e10cSrcweir #define GET_VARIABLE( nNo, nVar ) 113cdf0e10cSrcweir 114cdf0e10cSrcweir #endif 115cdf0e10cSrcweir 116cdf0e10cSrcweir #endif 117