Diff for /Amaya/amaya/styleparser.c between versions 1.400 and 1.401

version 1.400, 2008/02/21 10:51:58 version 1.401, 2008/03/04 11:41:28
Line 69  CSSProperty; Line 69  CSSProperty;
 static int           LineNumber = -1; /* The line where the error occurs */  static int           LineNumber = -1; /* The line where the error occurs */
 static int           NewLineSkipped = 0;  static int           NewLineSkipped = 0;
 static int           RedisplayImages = 0; /* number of BG images loading */  static int           RedisplayImages = 0; /* number of BG images loading */
 static int           RedisplayDoc = 0; /* document to be redisplayed */  
 static int           Style_parsing = 0; /* > 0 when parsing a set of CSS rules */  static int           Style_parsing = 0; /* > 0 when parsing a set of CSS rules */
 static char         *ImportantPos = NULL;  static char         *ImportantPos = NULL;
 static ThotBool      RedisplayBGImage = FALSE; /* TRUE when a BG image is inserted */  static ThotBool      RedisplayBGImage = FALSE; /* TRUE when a BG image is inserted */
Line 2166  void ParseCSSImageCallback (Document doc Line 2165  void ParseCSSImageCallback (Document doc
   CSSImageCallbackPtr        callblock;    CSSImageCallbackPtr        callblock;
   Element                    el;    Element                    el;
   PSchema                    tsch;    PSchema                    tsch;
   PInfoPtr                   pInfo;    Document                   redisplaydoc;
     PInfoPtr                   pInfo = NULL;
   CSSInfoPtr                 css;    CSSInfoPtr                 css;
   PresentationContext        ctxt;    PresentationContext        ctxt;
   PresentationValue          image;    PresentationValue          image;
Line 2181  void ParseCSSImageCallback (Document doc Line 2181  void ParseCSSImageCallback (Document doc
   el = callblock->el;    el = callblock->el;
   tsch = callblock->tsch;    tsch = callblock->tsch;
   ctxt = callblock->ctxt;    ctxt = callblock->ctxt;
     redisplaydoc = ctxt->doc;
   if (doc == 0 && !isnew)    if (doc == 0 && !isnew)
     /* apply to the current document only */      /* apply to the current document only */
     doc = ctxt->doc;      doc = redisplaydoc;
   if (doc)    if (doc)
     {      redisplaydoc = doc;
       /* avoid too many redisplay */  
       dispMode = TtaGetDisplayMode (doc);  
       if (dispMode == DisplayImmediately)  
         TtaSetDisplayMode (doc, DeferredDisplay);  
     }  
   else    else
     {      {
       dispMode = TtaGetDisplayMode (RedisplayDoc);  
       /* check if the CSS still exists */        /* check if the CSS still exists */
       css = CSSList;        css = CSSList;
       while (css && css != callblock->css)        while (css && css != callblock->css)
Line 2203  void ParseCSSImageCallback (Document doc Line 2198  void ParseCSSImageCallback (Document doc
         tsch = NULL;          tsch = NULL;
     }      }
   
   if (tsch && css && ctxt && ctxt->doc)    if (tsch && css && ctxt && redisplaydoc)
     {      {
       // check if the presentation schema is still there        // check if the presentation schema is still there
       pInfo = css->infos[ctxt->doc];        pInfo = css->infos[redisplaydoc];
         if (pInfo == NULL && DocumentURLs[redisplaydoc] == NULL)
           {
             // the redisplaydoc was probably an object
             while (redisplaydoc > 0 && pInfo == 0)
               pInfo = css->infos[--redisplaydoc];
             if (redisplaydoc)
               ctxt->doc = redisplaydoc;
           }
   
       found = FALSE;        found = FALSE;
       while (!found && pInfo)        while (!found && pInfo)
         {          {
Line 2243  void ParseCSSImageCallback (Document doc Line 2247  void ParseCSSImageCallback (Document doc
   TtaFreeMemory (callblock);    TtaFreeMemory (callblock);
   if (css)    if (css)
     RedisplayImages--;      RedisplayImages--;
   if (doc)    if (redisplaydoc &&
     {        /* check if all background images are now loaded */
       if (dispMode == DisplayImmediately)        (css == NULL || (pInfo && Style_parsing == 0 && RedisplayImages == 0)))
         /* restore the display mode */      {
         TtaSetDisplayMode (doc, dispMode);        /* don't manage a document used by make book */
     }        if (DocumentMeta[redisplaydoc] == NULL ||
   else if (css && Style_parsing == 0 && RedisplayImages == 0 && RedisplayDoc)            DocumentMeta[redisplaydoc]->method != CE_MAKEBOOK)
     {  
       /* all background images are now loaded */  
       if (css->infos[RedisplayDoc] &&  
           /* don't manage a document used by make book */  
           (DocumentMeta[RedisplayDoc] == NULL ||  
            DocumentMeta[RedisplayDoc]->method != CE_MAKEBOOK))  
         {          {
           /* Change the Display Mode to take into account the new            /* Change the Display Mode to take into account the new
              presentation */               presentation */
           dispMode = TtaGetDisplayMode (RedisplayDoc);            dispMode = TtaGetDisplayMode (redisplaydoc);
 #ifdef AMAYA_DEBUG  
           //printf ("ParseCSSImageCallback Show BGimages\n");  
 #endif /* AMAYA_DEBUG */  
           /* force the redisplay of this box */            /* force the redisplay of this box */
           TtaSetDisplayMode (RedisplayDoc, NoComputedDisplay);            TtaSetDisplayMode (redisplaydoc, NoComputedDisplay);
           TtaSetDisplayMode (RedisplayDoc, dispMode);            TtaSetDisplayMode (redisplaydoc, dispMode);
         }          }
       RedisplayBGImage = FALSE;        RedisplayBGImage = FALSE;
     }      }
Line 2340  static char *SetCSSImage (Element elemen Line 2335  static char *SetCSSImage (Element elemen
                   /* check if the image url is related to an external CSS */                    /* check if the image url is related to an external CSS */
                   if (css)                    if (css)
                     {                      {
                       RedisplayDoc = ctxt->doc;  
                       /* fetch and display background image of element */                        /* fetch and display background image of element */
                       if (FetchImage (0, el, tempname, AMAYA_LOAD_IMAGE,                        if (FetchImage (0, el, tempname, AMAYA_LOAD_IMAGE,
                                       ParseCSSImageCallback, callblock))                                        ParseCSSImageCallback, callblock))
Line 8050  char ReadCSSRules (Document docRef, CSSI Line 8044  char ReadCSSRules (Document docRef, CSSI
       RedisplayBGImage = FALSE;        RedisplayBGImage = FALSE;
       if (dispMode != NoComputedDisplay)        if (dispMode != NoComputedDisplay)
         {          {
           RedisplayDoc = 0;  
           //printf ("ReadCSS Show BGimages\n");            //printf ("ReadCSS Show BGimages\n");
           TtaSetDisplayMode (docRef, NoComputedDisplay);            TtaSetDisplayMode (docRef, NoComputedDisplay);
           TtaSetDisplayMode (docRef, dispMode);            TtaSetDisplayMode (docRef, dispMode);

Removed from v.1.400  
changed lines
  Added in v.1.401


Webmaster