home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / layout / laytrav.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.9 KB  |  65 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #include "xp.h"
  20. #include "net.h"
  21. #include "pa_parse.h"
  22. #include "layout.h"
  23. #include "laylayer.h"
  24. #include "layers.h"
  25. #include "laytrav.h"
  26.  
  27. extern int MK_OUT_OF_MEMORY;
  28.  
  29. #ifdef PROFILE
  30. #pragma profile on
  31. #endif
  32.  
  33. #ifdef TEST_16BIT
  34. #define XP_WIN16
  35. #endif /* TEST_16BIT */
  36.  
  37. #ifdef XP_WIN16
  38. #define SIZE_LIMIT        32000
  39. #endif /* XP_WIN16 */
  40.  
  41. /*    Right now we are just using the line list and not worrying about how to jump out of cells.
  42.  *    Instead of using bina's lo_JumpCellWall(), I think we should store a ptr to the parent cell
  43.  *    in each layout element when we create it.  Would make life much easier and faster.
  44.  */
  45.  
  46. LO_Element * lo_tv_GetFirstLayoutElement( lo_DocState *state )
  47. {
  48.     LO_Element **    line_array;
  49.     
  50.     XP_LOCK_BLOCK ( line_array, LO_Element **, state->line_array );
  51.     return line_array[0];
  52. }
  53.  
  54. LO_Element * lo_tv_GetNextLayoutElement( lo_DocState *state, LO_Element *curr_ele, Bool skipContainers )
  55. {
  56.     LO_Element *next;
  57.  
  58.     next = curr_ele->lo_any.next;
  59.     if (skipContainers == FALSE && curr_ele->lo_any.type == LO_CELL) {
  60.         next = curr_ele->lo_cell.cell_list;
  61.     }
  62.  
  63.     return next;
  64. }
  65.