Speeding up graphics

From: Johan Björk (phearbear_at_home.se)
Date: Sat Dec 13 2003 - 14:34:47 EST

  • Next message: Dom Lachowicz: "Re: Speeding up graphics"

    Hi guys

    This is the work I did. It uses offscreen buffers on QNX, and blits once
    all beginDraws() is complete.
    I would like to put the beginDraw() on more places, "higher" in the
    hierarchy, to reduce flicker even more. But I really havn't had time to
    work on this for a while.

    I won't have time to work more on this patch in the nearest weeks, so if
    anyone want to use this, please go ahead!

    /Johan


    ? patch
    ? flepp
    ? todo
    ? flepp_beforehugecommit
    ? src/flepp
    ? src/BillOfRights.abw
    ? src/af/gr/st732079
    ? src/af/gr/cocoa/gr_CocoaImage.c
    ? src/af/xap/qnx/st100131
    ? src/text/fmt/xp/draw
    ? src/wp/ap/qnx/st574129
    Index: src/af/gr/qnx/gr_QNXGraphics.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/af/gr/qnx/gr_QNXGraphics.cpp,v
    retrieving revision 1.116
    diff -u -r1.116 gr_QNXGraphics.cpp
    --- src/af/gr/qnx/gr_QNXGraphics.cpp 12 Nov 2003 21:49:13 -0000 1.116
    +++ src/af/gr/qnx/gr_QNXGraphics.cpp 13 Dec 2003 19:20:58 -0000
    @@ -56,6 +56,26 @@
     {
             return pszFontFamily;
     }
    +
    +bool GR_QNXGraphics::OSCIsValid() {
    +if(m_pOSC == NULL)
    + return false;
    +
    +if(m_pDraw->area.size.w != m_pOSC->dim.w || m_pDraw->area.size.h != m_pOSC->dim.h)
    +{
    +PhDCSetCurrent(0);
    +PhDCRelease(m_pOSC);
    +m_pOSC = PdCreateOffscreenContext(0,m_pDraw->area.size.w,m_pDraw->area.size.h,0);
    +PtDamageWidget(m_pDraw);
    +}
    +/*if(PdIsOffscreenValid(m_pOSC) == -1) {
    + PhDCRelease((PhDrawContext_t *)m_pOSC);
    + m_pOSC = NULL;
    + return false;
    +}*/
    +
    +return true;
    +}
     /***
      Initialization/Teardown for drawing on a widget outside of the normal
      stream of "damage" events
    @@ -69,11 +89,21 @@
             //sometimes abi is stupid and calls a raw draw function without making sure we want to draw it (ie, Left ruler in normal view mode), therefor we do a simple check if our widget is realized or not...
             if(PtWidgetIsRealized(m_pDraw) == 0) return -1;
     
    - m_pGC_old=PgSetGC(m_pGC);
     
    + if(OSCIsValid()) {
    + PtFlush();
    + if(PhDCSetCurrent(m_pOSC) == NULL)
    + UT_ASSERT(0); //we don't need a seperate GC as a DC already have one.
    + } else {
    + UT_ASSERT(0);
    + //TODO: try to create a new one!
    + }
             //Set the region and the draw offset
             PgSetRegion(PtWidgetRid(PtFindDisjoint(m_pDraw)));
     
    +// m_pGC_old=PgSetGC(m_pGC); //m_pOSC has it's own GC??
    +
    +#if 0
             PtWidgetOffset(m_pDraw, &m_OffsetPoint);
             m_OffsetPoint.y+=m_pDraw->area.pos.y;
             m_OffsetPoint.x+=m_pDraw->area.pos.x;
    @@ -83,7 +113,7 @@
             trans.x = -m_OffsetPoint.x;
             trans.y = -m_OffsetPoint.y;
             PdSetOffscreenTranslation(m_pOSC,&trans);*/
    -
    +#endif
             //Always clip to the canvas
             PhRect_t _rdraw;
             PtCalcCanvas(m_pDraw, &_rdraw);
    @@ -106,7 +136,6 @@
             PhDeTranslateRect(&_rdraw,&abs);*/
             PgSetUserClip(&_rdraw);
     
    -
             return 0;
     
     }
    @@ -140,31 +169,38 @@
     
             PgContextBlit(m_pOSC,&rect,NULL,&rect2); */
     
    +#if 0
             PgSetUserClip(NULL);
             PgClearTranslation();
    -
    - PgSetGC(m_pGC_old);
    -// PhDCSetCurrent(m_pOldDC);
    +#endif
    + PhDCSetCurrent(0);
    + PgFlush();
    +// PgSetGC(m_pGC_old);
     
             return 0;
     }
     
     
     GR_QNXGraphics::GR_QNXGraphics(PtWidget_t * win, PtWidget_t * draw, XAP_App *app)
    +:
    + m_pWin(win),
    + m_pDraw(draw),
    + m_pFont(NULL),
    + m_pFontGUI(NULL),
    + m_pClipList(NULL),
    + m_iLineWidth(1),
    + m_currentColor(Pg_BLACK),
    + m_pPrintContext(NULL),
    + m_iAscentCache(-1),
    + m_iDescentCache(-1),
    + m_iHeightCache(-1)
     {
             m_pApp = app;
    - m_pWin = win;
    - m_pDraw = draw;
    - m_pGC = PgCreateGC(0);
    - m_pFont = NULL;
    - m_pFontGUI = NULL;
    - m_pClipList = NULL;
    - m_iLineWidth = 1;
    - m_currentColor = Pg_BLACK;
    - m_pPrintContext = NULL;
    - m_iAscentCache = m_iDescentCache = m_iHeightCache -1;
    +// m_pGC = PgCreateGC(0);
    + memset(&m_DamagedArea,0,sizeof(m_DamagedArea));
    +
    + m_pOSC = PdCreateOffscreenContext(0,draw->area.size.w,draw->area.size.h,NULL);
     
    -// m_pOSC = PdCreateOffscreenContext(0,draw->area.size.w,draw->area.size.h,NULL);
             m_pFontCx = PfAttachCx("/dev/phfont",240000);
             
             m_cs = GR_Graphics::GR_COLORSPACE_COLOR;
    @@ -183,8 +219,10 @@
               PhImage_t * pImg = (PhImage_t *)m_vSaveRectBuf.getNthItem (i);
               PgShmemDestroy(pImg);
             }
    - PgDestroyGC(m_pGC);
    -// PhDCRelease(m_pOSC);
    +// PgDestroyGC(m_pGC);
    + PtFlush();
    + PhDCSetCurrent(0); //JIC
    + PhDCRelease(m_pOSC);
             PfDetach(m_pFontCx);
     }
     
    @@ -290,6 +328,7 @@
                                                                int * pCharWidths)
     {
     if(pCharWidths == NULL && iLength > 1) {
    + GR_CaretDisabler caretDisabler(getCaret());
             static int alloclen;
             static UT_UCS2Char *ucs2buffer;
     
    @@ -303,11 +342,11 @@
     
             PhPoint_t pos = {_tduX(xoff),tdu(getFontAscent()) + _tduY(yoff)};
             DRAW_START
    - GR_CaretDisabler caretDisabler(getCaret());
     // PgSetTextColor(m_currentColor);
     // PgSetFont(m_pFont->getDisplayFont());
             PgDrawText((const char *)ucs2buffer,iLength*2,&pos,Pg_TEXT_WIDECHAR|Pg_TEXT_LEFT);
             DRAW_END
    + setDamage(pos.x,pos.y,tdu(getFontHeight()),m_pDraw->area.size.w);
     }
     else
             for(int i=0;i<iLength;i++) {
    @@ -329,6 +368,7 @@
     //PgSetFont(m_pFont->getDisplayFont());
     PgDrawText((const char *)&ucs2buffer,2,&pos,Pg_TEXT_WIDECHAR|Pg_TEXT_LEFT);
     DRAW_END
    +setDamage(pos.x,pos.y,tdu(getFontHeight()),m_pDraw->area.size.w);
     }
     
     UT_uint32 GR_QNXGraphics::measureUnRemappedChar(const UT_UCSChar c)
    @@ -556,6 +596,7 @@
     // PgSetStrokeWidth(m_iLineWidth);
             PgDrawILine(x1, y1, x2, y2);
             DRAW_END
    + setDamage(__min(x1,x2),__min(y1,y2),__max(y1,y2),__max(x1,x2));
     }
     
     void GR_QNXGraphics::getCoverage(UT_Vector &coverage)
    @@ -599,6 +640,7 @@
             PgFlush();
             PgSetDrawMode(old);
             DRAW_END
    + setDamage(__min(x1,x2),__min(y1,y2),__max(y1,y2),__max(x1,x2));
     }
     
     void GR_QNXGraphics::polygon(UT_RGBColor& c,UT_Point *pts,UT_uint32 nPoints)
    @@ -622,6 +664,7 @@
     
             PgSetFillColor(oldc);
             DRAW_END
    + setDamage(0,0,-1,-1);
     }
     
     void GR_QNXGraphics::polyLine(UT_Point * pts, UT_uint32 nPoints)
    @@ -647,6 +690,7 @@
             PgSetDrawMode(old);
     
             DRAW_END
    + setDamage(tdu(pRect->left),tdu(pRect->top),tdu(pRect->height),tdu(pRect->width));
     }
     
     void GR_QNXGraphics::setClipRect(const UT_Rect* pRect)
    @@ -691,6 +735,7 @@
     // printf("fillRect RGB %d,%d %d/%d w/ %08x\n", x, y, w, h, newc);
             PgDrawIRect(x, y, x+w, y+h, Pg_DRAW_FILL);
             DRAW_END
    + setDamage(x,y,h,w);
     }
     
     inline void adjust_rect(PhRect_t *rect, PhPoint_t *offset) {
    @@ -711,7 +756,6 @@
             }
     }
     
    -//TODO: FIXup this code!
     void GR_QNXGraphics::scroll(UT_sint32 dx, UT_sint32 dy)
     {
             PhRect_t rect;
    @@ -727,6 +771,8 @@
             {
                     return;
             }
    +
    + //TODO: this + OSC?!??!
             PtCalcCanvas(m_pDraw, &rect);
             UT_sint32 iddy = labs(ddy);
             offset.x = ddx;
    @@ -734,6 +780,7 @@
             bool bEnableSmooth = m_pApp->isSmoothScrollingEnabled();
             bEnableSmooth = bEnableSmooth && (iddy < 30) && (ddx == 0);
     
    + bEnableSmooth=false; //XXX TEMPORARY!!
             if(bEnableSmooth)
             {
                     if(ddy < 0)
    @@ -758,11 +805,19 @@
                     }
             } else
             {
    - PhPoint_t shift;
    +/* PhPoint_t shift;
                     PtWidgetOffset(m_pDraw, &shift);
                     PhTranslateRect(&rect, &shift);
                     adjust_rect(&rect, &offset);
                     PhBlit(PtWidgetRid(PtFindDisjoint(m_pDraw)), &rect, &offset);
    +*/
    + PhRect_t dst_rect;
    +
    + dst_rect.ul.x = rect.ul.x + offset.x; //should be 0...
    + dst_rect.lr.x = rect.lr.x - offset.x;
    + dst_rect.ul.y = rect.ul.y + offset.y;
    + dst_rect.lr.y = rect.lr.y - offset.y;
    + PgContextBlit(m_pOSC,&rect,m_pOSC,&dst_rect);
             }
     }
     
    @@ -773,24 +828,34 @@
             GR_CaretDisabler caretDisabler(getCaret());
             PhPoint_t shift,offset;
             PhRect_t rect;
    + PhRect_t dst_rect;
     
             rect.ul.x = tdu(x_src);
             rect.ul.y = tdu(y_src);
             rect.lr.x = tdu(width+x_src);
             rect.lr.y = tdu(height+y_src);
     
    + dst_rect.ul.x = tdu(x_dest);
    + dst_rect.ul.y = tdu(y_dest);
    + dst_rect.lr.x = tdu(width+x_dest);
    + dst_rect.lr.y = tdu(height+y_dest);
    +
    +/*
             offset.x = tdu(x_dest - x_src);
             offset.y = tdu(y_dest - y_src);
     
             PtWidgetOffset(m_pDraw, &shift);
             PhTranslateRect(&rect, &shift);
             PhBlit(PtWidgetRid(PtFindDisjoint(m_pDraw)), &rect, &offset);
    +*/
    +
    + PgContextBlit(m_pOSC,&rect,m_pOSC,&dst_rect);
     }
     
     void GR_QNXGraphics::clearArea(UT_sint32 x, UT_sint32 y,
                                      UT_sint32 width, UT_sint32 height)
     {
    - UT_RGBColor clrWhite(255,255,255);
    + static const UT_RGBColor clrWhite(255,255,255);
             fillRect(clrWhite, x, y, width, height);
     }
     
    @@ -835,6 +900,7 @@
             pos.x = xDest; pos.y = yDest;
             PgDrawPhImage(&pos,image,NULL);
             DRAW_END
    + setDamage(pos.x,pos.y,image->size.h,image->size.w);
     }
     
     void GR_QNXGraphics::setColorSpace(GR_Graphics::ColorSpace /* c */)
    @@ -959,7 +1025,6 @@
             m_currentColor = m_3dColors[c];
             DRAW_START
     
    - GR_CaretDisabler caretDisabler(getCaret());
             PgSetStrokeColor(m_currentColor);
             PgSetFillColor(m_currentColor);
             PgSetTextColor(m_currentColor); //do we need this?
    @@ -991,6 +1056,7 @@
     // fprintf(stderr,"FillRect 3D %d,%d %d/%d w %08x\n", x, y, x+w, y+w, m_3dColors[c]);
             PgDrawIRect(x, y, x+w, y+h, Pg_DRAW_FILL);
             DRAW_END
    + setDamage(x,y,h,w);
     }
     
     void GR_QNXGraphics::fillRect(GR_Color3D c, UT_Rect &r)
    @@ -1082,6 +1148,11 @@
             short int x,y;
             PhImage_t *pImgshmem,*pImg;
     
    + //since this reads from the visual screen, make sure it's up to date!
    + endDraw();
    + PgFlush();
    + PgWaitDrawComplete();
    +
             PtGetAbsPosition(m_pDraw,&x,&y);
             rect.ul.x=x + _tduX(r.left);
             rect.ul.y=y + _tduY(r.top);
    @@ -1118,8 +1189,12 @@
         return;
       }
     #endif
    -
    - void * oldR = NULL;
    +
    + //this reads from the screen, make sure it's uptodate
    + endDraw();
    + PgFlush();
    + PgWaitDrawComplete();
    + void * oldR = NULL;
       m_vSaveRect.setNthItem(iIndx, (void*)new UT_Rect(r),&oldR);
       if(oldR)
         delete (UT_Rect*)oldR;
    @@ -1148,19 +1223,82 @@
     
       if((r && pImg))
         {
    - PhPoint_t pos;
    -
    - DRAW_START
    -
    + PhPoint_t pos;
    +
    + DRAW_START
             pos.x=_tduX(r->left);
    - pos.y=_tduY(r->top);
    + pos.y=_tduY(r->top);
           
             PgDrawPhImage(&pos,pImg,0);
    - DRAW_END
    + setDamage(pos.x,pos.y,pImg->size.h,pImg->size.w);
    + DRAW_END
         }
       return;
     }
     
    +void GR_QNXGraphics::startDraw() {
    +memset(&m_DamagedArea,0,sizeof(m_DamagedArea));
    +}
    +
    +//small helper function for endDraw that isn't encapsulated in DRAW_START/DRAW_END
    +void GR_QNXGraphics::blitScreen() {
    +
    +if(!m_DamagedArea.size.w || !m_DamagedArea.size.h) //don't blit if nothing changed.
    + return;
    +
    +if(OSCIsValid()) {
    + PhArea_t screenarea;
    + PhPoint_t pnt;
    + PtWidgetOffset(m_pDraw,&pnt);
    + screenarea.pos.x = pnt.x + m_DamagedArea.pos.x;
    + screenarea.pos.y = pnt.y + m_DamagedArea.pos.y;
    + screenarea.size.w = m_DamagedArea.size.w;
    + screenarea.size.h = m_DamagedArea.size.h;
    + PgFlush();
    + PgContextBlitArea(m_pOSC,&m_DamagedArea,NULL,&screenarea);
    + PgFlush();
    + UT_DEBUGMSG(("Blitted m_pOSC(0x%x) (%d,%d,%d,%d) to (%d,%d,%d,%d)",m_pOSC,m_DamagedArea.pos.x,m_DamagedArea.pos.y,m_DamagedArea.size.w,m_DamagedArea.size.h,screenarea.pos.x,screenarea.pos.y,screenarea.size.w,screenarea.size.h));
    +}
    +}
    +
    +void GR_QNXGraphics::endDraw() {
    +//blit to screen...
    +//we might need to do some magic here to make sure we don't blit the whole area everytime.. might be slow.. :P
    +//in every draw function, have a rect which you extend with the area which is being modified, then we'll reset it after drawing here...
    + DRAW_START
    + blitScreen();
    + DRAW_END
    +}
    +
    +void GR_QNXGraphics::setDamage(int ulx,int uly,int h,int w) {
    +
    + if(ulx < 0 || uly < 0 || h < 0 || w < 0) UT_ASSERT(0);
    +
    + UT_DEBUGMSG(("SetDamage input= %d,%d,%d,%d",ulx,uly,h,w));
    + //check clipping.. ?
    + if(ulx >= m_pDraw->area.size.w || uly >= m_pDraw->area.size.h) return;
    +
    + int lrx,lry;
    +
    + lrx = ulx+w;
    + lry = uly+h;
    +
    + if(lrx > m_pDraw->area.size.w) w=m_pDraw->area.size.w - ulx;
    + if(lry > m_pDraw->area.size.h) h=m_pDraw->area.size.h - uly;
    +
    + if(w == -1) w = m_pDraw->area.size.w - ulx;
    + if(h == -1) h = m_pDraw->area.size.h - uly;
    +
    + if(m_DamagedArea.size.w < w)
    + m_DamagedArea.size.w = w + ((ulx>m_DamagedArea.pos.x) ? (ulx - m_DamagedArea.pos.x) : 0);
    + if(m_DamagedArea.size.h < h)
    + m_DamagedArea.size.h = h + ((uly>m_DamagedArea.pos.y) ? (uly - m_DamagedArea.pos.y) : 0);
    + if(m_DamagedArea.pos.x > ulx)
    + m_DamagedArea.pos.x = ulx;
    + if(m_DamagedArea.pos.y > uly)
    + m_DamagedArea.pos.y = uly;
    + xxx_UT_DEBUGMSG(("SetDamage output=%d,%d,%d,%d",m_DamagedArea.pos.x,m_DamagedArea.pos.y,m_DamagedArea.size.h,m_DamagedArea.size.w));
    +}
     
     /* FONT ROUTINES */
     
    @@ -1237,7 +1375,6 @@
     }
     void GR_QNXGraphics::setZoomPercentage(UT_uint32 iZoom)
     {
    - UT_DEBUGMSG(("Set Zoom!!!! deleting: 0x%x",m_pFontGUI));
             DELETEP (m_pFontGUI);
             if(m_pFont)
                     m_pFont->deleteDisplayFont();
    Index: src/af/gr/qnx/gr_QNXGraphics.h
    ===================================================================
    RCS file: /cvsroot/abi/src/af/gr/qnx/gr_QNXGraphics.h,v
    retrieving revision 1.38
    diff -u -r1.38 gr_QNXGraphics.h
    --- src/af/gr/qnx/gr_QNXGraphics.h 1 Nov 2003 03:26:56 -0000 1.38
    +++ src/af/gr/qnx/gr_QNXGraphics.h 13 Dec 2003 19:20:58 -0000
    @@ -74,8 +74,10 @@
             virtual UT_uint32 getFontAscent();
             virtual UT_uint32 getFontDescent();
             virtual UT_uint32 getFontHeight();
    -
             virtual void getCoverage(UT_Vector &coverage);
    +
    + virtual void startDraw();
    + virtual void endDraw();
             virtual void drawLine(UT_sint32, UT_sint32, UT_sint32, UT_sint32);
             virtual void setLineWidth(UT_sint32);
             virtual void xorLine(UT_sint32, UT_sint32, UT_sint32, UT_sint32);
    @@ -181,9 +183,14 @@
     
             virtual void saveRectangle(UT_Rect &r, UT_uint32 iIndx);
             virtual void restoreRectangle(UT_uint32 iIndx);
    -
    + bool OSCIsValid();
    + void blitScreen();
    + void setDamage(int x,int y,int h,int w);
    +
             UT_Vector m_vSaveRect;
    - UT_Vector m_vSaveRectBuf;
    + UT_Vector m_vSaveRectBuf;
    + PdOffscreenContext_t *m_pOSC;
    + PhArea_t m_DamagedArea;
     };
     
     #endif /* GR_QNXGRAPHICS_H */
    Index: src/af/gr/xp/gr_Caret.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/af/gr/xp/gr_Caret.cpp,v
    retrieving revision 1.33
    diff -u -r1.33 gr_Caret.cpp
    --- src/af/gr/xp/gr_Caret.cpp 14 Nov 2003 01:40:09 -0000 1.33
    +++ src/af/gr/xp/gr_Caret.cpp 13 Dec 2003 19:20:58 -0000
    @@ -231,7 +231,7 @@
             if (m_bRecursiveDraw || !m_bPositionSet)
                     return;
     
    -
    + GR_DrawManager d(m_pG);
             // After any autoblink, we want there to be BLINK_TIME
             // until next autoblink.
             if (!bExplicit)
    Index: src/af/gr/xp/gr_Graphics.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/af/gr/xp/gr_Graphics.cpp,v
    retrieving revision 1.101
    diff -u -r1.101 gr_Graphics.cpp
    --- src/af/gr/xp/gr_Graphics.cpp 13 Dec 2003 16:54:18 -0000 1.101
    +++ src/af/gr/xp/gr_Graphics.cpp 13 Dec 2003 19:20:58 -0000
    @@ -119,8 +119,13 @@
               m_bDoMerge(false),
               m_iPrevYOffset(0),
               m_iPrevXOffset(0),
    +<<<<<<< gr_Graphics.cpp
    + m_hashFontCache(19),
    + m_drawManagerCount(0)
    +=======
               m_hashFontCache(19),
               m_paintCount(0)
    +>>>>>>> 1.101
     {
     }
     
    Index: src/af/gr/xp/gr_Graphics.h
    ===================================================================
    RCS file: /cvsroot/abi/src/af/gr/xp/gr_Graphics.h,v
    retrieving revision 1.107
    diff -u -r1.107 gr_Graphics.h
    --- src/af/gr/xp/gr_Graphics.h 13 Dec 2003 01:22:51 -0000 1.107
    +++ src/af/gr/xp/gr_Graphics.h 13 Dec 2003 19:20:59 -0000
    @@ -36,6 +36,7 @@
     class XAP_PrefsScheme;
     class XAP_Frame;
     class UT_String;
    +class GR_DrawManager;
     
     /*!
       GR_Font is a reference to a font. As it happens, everything about fonts
    @@ -124,6 +125,7 @@
     #define GR_OC_MAX_WIDTH 0x3fffffff
     class ABI_EXPORT GR_Graphics
     {
    + friend class GR_DrawManager;
             friend class GR_Caret;
             friend class GR_Painter;
     
    @@ -203,6 +205,8 @@
                                                                              UT_sint32 iHeight,
                                                                              GR_Image::GRType iType = GR_Image::GRT_Raster);
     
    + virtual void startDraw() = 0;
    + virtual void endDraw() = 0;
             /* For drawLine() and xorLine():
             ** x0,y0 give the starting pixel.
             ** x1,y1 give the first pixel ***not drawn***.
    @@ -448,7 +452,7 @@
             XAP_App * m_pApp;
             UT_uint32 m_iZoomPercentage;
             UT_uint32 m_iFontAllocNo;
    -
    + UT_uint32 m_drawManagerCount;
             static XAP_PrefsScheme *m_pPrefsScheme;
             static UT_uint32 m_uTick;
     
    @@ -480,5 +484,26 @@
     
     void xorRect(GR_Graphics* pG, UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h);
     void xorRect(GR_Graphics* pG, const UT_Rect& r);
    +
    +
    +/* DrawManager is a minimalistic class that wraps drawbatches with a GR_Graphics::startDraw() resp GR_Graphics::endDraw() which platforms can override to easily use for example a offscreen buffer. */
    +class GR_DrawManager {
    + public:
    + GR_DrawManager(GR_Graphics *pG)
    + : m_pG(pG)
    + {
    + if(m_pG->m_drawManagerCount == 0)
    + m_pG->startDraw();
    + m_pG->m_drawManagerCount++;
    + };
    + ~GR_DrawManager() {
    + m_pG->m_drawManagerCount--;
    + if(m_pG->m_drawManagerCount == 0)
    + m_pG->endDraw();
    + };
    +
    + private:
    + GR_Graphics *m_pG;
    +};
     
     #endif /* GR_GRAPHICS_H */
    Index: src/af/xap/qnx/xap_QNXDlg_PluginManager.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/af/xap/qnx/xap_QNXDlg_PluginManager.cpp,v
    retrieving revision 1.15
    diff -u -r1.15 xap_QNXDlg_PluginManager.cpp
    --- src/af/xap/qnx/xap_QNXDlg_PluginManager.cpp 25 Sep 2003 14:18:12 -0000 1.15
    +++ src/af/xap/qnx/xap_QNXDlg_PluginManager.cpp 13 Dec 2003 19:21:05 -0000
    @@ -309,6 +309,7 @@
     
     void XAP_QNXDialog_PluginManager::runModal(XAP_Frame * pFrame)
     {
    +#if 0
             m_pFrame = pFrame;
     
             XAP_QNXFrameImpl * pQNXFrameImpl = (XAP_QNXFrameImpl*)pFrame->getFrameImpl();
    @@ -342,6 +343,8 @@
     
             UT_QNXBlockWidget(parentWindow, 0);
             PtDestroyWidget(mainWindow);
    +#endif
    +
     }
     
     PtWidget_t * XAP_QNXDialog_PluginManager::_constructWindow ()
    Index: src/af/xap/qnx/xap_QNXDlg_Zoom.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/af/xap/qnx/xap_QNXDlg_Zoom.cpp,v
    retrieving revision 1.30
    diff -u -r1.30 xap_QNXDlg_Zoom.cpp
    --- src/af/xap/qnx/xap_QNXDlg_Zoom.cpp 19 Oct 2003 09:03:06 -0000 1.30
    +++ src/af/xap/qnx/xap_QNXDlg_Zoom.cpp 13 Dec 2003 19:21:05 -0000
    @@ -267,7 +267,6 @@
             UT_QNXCenterWindow(parentWindow, mainWindow);
             UT_QNXBlockWidget(parentWindow, 1);
             PtRealizeWidget(mainWindow);
    - PgFlush();
             
             int count;
             count = PtModalStart();
    Index: src/af/xap/qnx/xap_QNXFrameImpl.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/af/xap/qnx/xap_QNXFrameImpl.cpp,v
    retrieving revision 1.17
    diff -u -r1.17 xap_QNXFrameImpl.cpp
    --- src/af/xap/qnx/xap_QNXFrameImpl.cpp 2 Nov 2003 01:51:52 -0000 1.17
    +++ src/af/xap/qnx/xap_QNXFrameImpl.cpp 13 Dec 2003 19:21:05 -0000
    @@ -214,7 +214,7 @@
                             */
                             pView->setWindowSize(iNewWidth, iNewHeight);
                             pFrame->quickZoom();
    - PtFlush();
    +// PtFlush();
                     }
                     else
                     {
    Index: src/pkg/qnx/package.qpg
    ===================================================================
    RCS file: /cvsroot/abi/src/pkg/qnx/package.qpg,v
    retrieving revision 1.9
    diff -u -r1.9 package.qpg
    --- src/pkg/qnx/package.qpg 20 Feb 2003 08:17:47 -0000 1.9
    +++ src/pkg/qnx/package.qpg 13 Dec 2003 19:21:37 -0000
    @@ -73,7 +73,7 @@
     
                                              <QPM:Launch name="AbiWord" xmlmultiple="true">
                 <QPM:String name="Topic" value="Applications/Editors" xmlmultiple="true"/>
    - <QPM:String name="Command" value="ABISUITE_HOME=/opt/AbiSuite/ /usr/photon/bin/AbiWord_d" xmlmultiple="true"/>
    + <QPM:String name="Command" value="ABISUITE_HOME=/opt/AbiSuite/ /usr/photon/bin/AbiWord" xmlmultiple="true"/>
              </QPM:Launch>
     
                                             <QPM:ProductInstallationProcedure>
    Index: src/text/fmt/xp/fl_BlockLayout.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fl_BlockLayout.cpp,v
    retrieving revision 1.571
    diff -u -r1.571 fl_BlockLayout.cpp
    --- src/text/fmt/xp/fl_BlockLayout.cpp 13 Dec 2003 13:39:26 -0000 1.571
    +++ src/text/fmt/xp/fl_BlockLayout.cpp 13 Dec 2003 19:21:47 -0000
    @@ -1159,9 +1159,10 @@
                     return m_bIsHdrFtr;
     }
     
    -void fl_BlockLayout::clearScreen(GR_Graphics* /* pG */)
    +void fl_BlockLayout::clearScreen(GR_Graphics* pG )
     {
             fp_Line* pLine = static_cast<fp_Line *>(getFirstContainer());
    + GR_DrawManager d(pG);
             if(isHdrFtr())
             {
                     return;
    Index: src/text/fmt/xp/fp_Column.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_Column.cpp,v
    retrieving revision 1.161
    diff -u -r1.161 fp_Column.cpp
    --- src/text/fmt/xp/fp_Column.cpp 13 Dec 2003 13:39:28 -0000 1.161
    +++ src/text/fmt/xp/fp_Column.cpp 13 Dec 2003 19:21:48 -0000
    @@ -652,6 +652,7 @@
                     return;
             }
         if(getPage()->getDocLayout()->getView()->getShowPara() && getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)){
    + GR_DrawManager d(getGraphics());
             UT_sint32 xoffBegin = pDA->xoff - getGraphics()->tlu(1);
             UT_sint32 yoffBegin = pDA->yoff - getGraphics()->tlu(1);
             UT_sint32 xoffEnd = pDA->xoff + m_iWidth + getGraphics()->tlu(2);
    @@ -733,6 +734,8 @@
     #if DEBUG
     // validate();
     #endif
    + GR_DrawManager d(pDA->pG);
    +
             const UT_Rect * pClipRect = pDA->pG->getClipRect();
             UT_sint32 ytop = 0, ybot = (UT_sint32)(((UT_uint32)(1<<31)) - 1);
     
    @@ -1131,6 +1134,7 @@
             }
         if(getPage()->getDocLayout()->getView()->getShowPara() && getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN))
         {
    + GR_DrawManager d(getGraphics());
             getGraphics()->setColor(getPage()->getDocLayout()->getView()->getColorShowPara());
             UT_sint32 xoffBegin = pDA->xoff - getGraphics()->tlu(1);
             UT_sint32 yoffBegin = pDA->yoff - getGraphics()->tlu(1);
    @@ -1472,6 +1476,8 @@
                     UT_DEBUGMSG(("SEVIOR: Attempting to clear Header/Footer in Normal Mode \n"));
                     return;
             }
    + GR_DrawManager d(getGraphics());
    +
             int count = countCons();
             for (int i = 0; i<count; i++)
             {
    @@ -1491,12 +1497,14 @@
     
     void fp_ShadowContainer::draw(dg_DrawArgs* pDA)
     {
    + GR_DrawManager d(pDA->pG);
             FV_View * pView = getPage()->getDocLayout()->getView();
             if((pView->getViewMode() != VIEW_PRINT) && pDA->pG->queryProperties(GR_Graphics::DGP_SCREEN) )
             {
                     UT_DEBUGMSG(("SEVIOR: Attempting to draw Header/Footer in Normal Mode \n"));
                     return;
             }
    +
             if((pView->getViewMode() != VIEW_PRINT) && pDA->pG->queryProperties(GR_Graphics::DGP_PAPER) )
             {
                     layout(true);
    @@ -1557,6 +1565,8 @@
                     UT_DEBUGMSG(("SEVIOR: Attempting to draw Header/Footer in Normal Mode \n"));
                     return;
             }
    + GR_DrawManager d(getGraphics());
    +
     //
     // Can put this in to speed things up.
     //
    @@ -1589,9 +1599,11 @@
     {
             if(!m_bHdrFtrBoxDrawn)
                     return;
    + GR_DrawManager d(getGraphics());
             UT_RGBColor * pClr = getPage()->getFillType()->getColor();
             getGraphics()->setLineWidth(getGraphics()->tlu(1));
             getGraphics()->setColor(*pClr);
    +
     //
     // Paint over the previous lines with the page color
     //
    Index: src/text/fmt/xp/fp_ContainerObject.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_ContainerObject.cpp,v
    retrieving revision 1.32
    diff -u -r1.32 fp_ContainerObject.cpp
    --- src/text/fmt/xp/fp_ContainerObject.cpp 13 Dec 2003 13:39:29 -0000 1.32
    +++ src/text/fmt/xp/fp_ContainerObject.cpp 13 Dec 2003 19:21:48 -0000
    @@ -144,6 +144,7 @@
      */
     void fp_Container::clearBrokenContainers(void)
     {
    + GR_DrawManager(getGraphics());
             if(m_pMyBrokenContainer)
             {
                     fp_Container * pc = this;
    @@ -668,6 +669,7 @@
     //
     // Have to adjust for spacing between cells
     //
    + GR_DrawManager d(pG);
             if(m_pContainer && (m_pContainer->getContainerType() == FP_CONTAINER_CELL))
             {
                     fp_CellContainer * pCell = static_cast<fp_CellContainer *>(m_pContainer);
    Index: src/text/fmt/xp/fp_DirectionMarkerRun.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_DirectionMarkerRun.cpp,v
    retrieving revision 1.8
    diff -u -r1.8 fp_DirectionMarkerRun.cpp
    --- src/text/fmt/xp/fp_DirectionMarkerRun.cpp 13 Dec 2003 13:39:29 -0000 1.8
    +++ src/text/fmt/xp/fp_DirectionMarkerRun.cpp 13 Dec 2003 19:21:48 -0000
    @@ -183,6 +183,7 @@
     {
             UT_ASSERT(!isDirty());
             UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN));
    + GR_DrawManager d(getGraphics());
     
             if(getWidth())
             {
    @@ -212,6 +213,7 @@
         {
                 return;
         }
    + GR_DrawManager d(getGraphics());
     
             UT_ASSERT(pDA->pG == getGraphics());
     
    Index: src/text/fmt/xp/fp_FootnoteContainer.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_FootnoteContainer.cpp,v
    retrieving revision 1.30
    diff -u -r1.30 fp_FootnoteContainer.cpp
    --- src/text/fmt/xp/fp_FootnoteContainer.cpp 13 Dec 2003 13:39:29 -0000 1.30
    +++ src/text/fmt/xp/fp_FootnoteContainer.cpp 13 Dec 2003 19:21:49 -0000
    @@ -95,6 +95,7 @@
                     return;
             }
             UT_sint32 pos = getPage()->findFootnoteContainer(this);
    + GR_DrawManager d(getGraphics());
             if(pos == 0)
             {
                     fl_DocSectionLayout * pDSL = getPage()->getOwningSection();
    @@ -161,6 +162,7 @@
             {
                     return;
             }
    + GR_DrawManager d(pDA->pG);
             UT_sint32 pos = getPage()->findFootnoteContainer(this);
             xxx_UT_DEBUGMSG(("fp_Footnote:draw: pos %d \n",pos));
             if(pos == 0)
    @@ -379,6 +381,7 @@
             {
                     return;
             }
    + GR_DrawManager d(getGraphics());
             if(getColumn() && (getHeight() != 0))
             {
                     if(getPage() == NULL)
    @@ -463,6 +466,7 @@
      */
     void fp_EndnoteContainer::draw(dg_DrawArgs* pDA)
     {
    + GR_DrawManager d(pDA->pG);
             UT_DEBUGMSG(("Endnote: Drawing unbroken Endnote %x x %d, y %d width %d height %d \n",this,getX(),getY(),getWidth(),getHeight()));
             UT_DEBUGMSG(("pDA yoff %d \n",pDA->yoff));
             const UT_Rect * pClipRect = pDA->pG->getClipRect();
    Index: src/text/fmt/xp/fp_FrameContainer.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_FrameContainer.cpp,v
    retrieving revision 1.12
    diff -u -r1.12 fp_FrameContainer.cpp
    --- src/text/fmt/xp/fp_FrameContainer.cpp 13 Dec 2003 13:39:29 -0000 1.12
    +++ src/text/fmt/xp/fp_FrameContainer.cpp 13 Dec 2003 19:21:49 -0000
    @@ -94,6 +94,7 @@
             {
                     return;
             }
    + GR_DrawManager d(getGraphics());
             UT_sint32 srcX,srcY;
             UT_sint32 xoff,yoff;
             getView()->getPageScreenOffsets(pPage,xoff,yoff);
    @@ -191,6 +192,8 @@
     
             if (style.m_t_linestyle == PP_PropertyMap::linestyle_none)
                     return; // do not draw
    +
    + GR_DrawManager d(getGraphics());
             
             GR_Graphics::JoinStyle js = GR_Graphics::JOIN_MITER;
             GR_Graphics::CapStyle cs = GR_Graphics::CAP_BUTT;
    @@ -226,6 +229,7 @@
      */
     void fp_FrameContainer::drawBoundaries(dg_DrawArgs * pDA)
     {
    + GR_DrawManager d(pDA->pG);
             UT_sint32 iXlow = pDA->xoff - m_iXpad;
             UT_sint32 iXhigh = iXlow + getFullWidth() ;
             UT_sint32 iYlow = pDA->yoff - m_iYpad;
    @@ -242,6 +246,7 @@
      */
     void fp_FrameContainer::drawHandles(dg_DrawArgs * pDA)
     {
    + GR_DrawManager d(pDA->pG);
             UT_sint32 iXlow = pDA->xoff - m_iXpad;
             UT_sint32 iXhigh = iXlow + getFullWidth() ;
             UT_sint32 iYlow = pDA->yoff - m_iYpad;
    @@ -269,6 +274,8 @@
             UT_sint32 top = box.top;
             UT_sint32 right = box.left + box.width - getGraphics()->tlu(1);
             UT_sint32 bottom = box.top + box.height - getGraphics()->tlu(1);
    +
    + GR_DrawManager d(getGraphics());
             
             getGraphics()->setLineProperties(1.0,
                                                                      GR_Graphics::JOIN_MITER,
    @@ -302,6 +309,7 @@
             {
                     return;
             }
    + GR_DrawManager d(pDA->pG);
             if(getView())
             {
                     if(getView()->getFrameEdit()->getFrameEditMode() == FV_FrameEdit_DRAG_EXISTING)
    Index: src/text/fmt/xp/fp_Line.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_Line.cpp,v
    retrieving revision 1.262
    diff -u -r1.262 fp_Line.cpp
    --- src/text/fmt/xp/fp_Line.cpp 13 Dec 2003 01:22:57 -0000 1.262
    +++ src/text/fmt/xp/fp_Line.cpp 13 Dec 2003 19:21:51 -0000
    @@ -937,7 +937,7 @@
             if(count > 0 && !pRun->getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN))
                     return;
     
    -
    + GR_DrawManager d(getGraphics());
             // not sure what the reason for this is (Tomas, Oct 25, 2003)
             fp_Run * pFRun = pRun;
             bool bUseFirst = false;
    @@ -1172,6 +1172,7 @@
             {
                     return;
             }
    + GR_DrawManager d(getGraphics());
     
             fp_Run * pRun = NULL;
             UT_sint32 count = m_vecRuns.getItemCount();
    @@ -1206,6 +1207,7 @@
             {
                     return;
             }
    + GR_DrawManager d(getGraphics());
     
             _doClearScreenFromRunToEnd((UT_sint32)runIndex);
     }
    @@ -1253,6 +1255,7 @@
             if(count <= 0)
                     return;
     
    + GR_DrawManager d(pG);
             UT_sint32 my_xoff = 0, my_yoff = 0;
             fp_VerticalContainer * pVCon= (static_cast<fp_VerticalContainer *>(getContainer()));
             pVCon->getScreenOffsets(this, my_xoff, my_yoff);
    @@ -1338,6 +1341,7 @@
                     return;
     
             xxx_UT_DEBUGMSG(("SEVIOR: Drawing line %x in line pDA, width %d \n",this,getWidth()));
    + GR_DrawManager d(pDA->pG);
             pDA->yoff += m_iAscent;
             const UT_Rect* pRect = pDA->pG->getClipRect();
     
    Index: src/text/fmt/xp/fp_Page.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_Page.cpp,v
    retrieving revision 1.141
    diff -u -r1.141 fp_Page.cpp
    --- src/text/fmt/xp/fp_Page.cpp 18 Nov 2003 13:26:50 -0000 1.141
    +++ src/text/fmt/xp/fp_Page.cpp 13 Dec 2003 19:21:53 -0000
    @@ -384,7 +384,8 @@
             {
             fp_Column* pFirstColumnLeader = getNthColumnLeader(0);
             fl_DocSectionLayout* pFirstSectionLayout = (pFirstColumnLeader->getDocSectionLayout());
    - UT_ASSERT(m_pOwner == pFirstSectionLayout);
    + GR_DrawManager d(pDA->pG);
    + UT_ASSERT(m_pOwner == pFirstSectionLayout);
     
     
             UT_sint32 iLeftMargin = pFirstSectionLayout->getLeftMargin();
    @@ -431,6 +432,7 @@
     // only call this for printing and honour the option to not fill the paper with
     // color.
     //
    + GR_DrawManager d(pDA->pG);
             int i=0;
             if(!pDA->pG->queryProperties(GR_Graphics::DGP_SCREEN))
             {
    @@ -1546,6 +1548,7 @@
     
     void fp_Page::clearScreenFrames(void)
     {
    + GR_DrawManager(getGraphics());
             UT_sint32 i =0;
             for (i = 0; i < static_cast<UT_sint32>(countFrameContainers()); i++)
             {
    Index: src/text/fmt/xp/fp_Run.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_Run.cpp,v
    retrieving revision 1.353
    diff -u -r1.353 fp_Run.cpp
    --- src/text/fmt/xp/fp_Run.cpp 13 Dec 2003 13:39:30 -0000 1.353
    +++ src/text/fmt/xp/fp_Run.cpp 13 Dec 2003 19:21:56 -0000
    @@ -153,6 +153,7 @@
             {
                     return;
             }
    + GR_DrawManager d(pG);
             UT_sint32 srcX = 0;
             UT_sint32 srcY = 0;
             fp_Line * pLine = getLine();
    @@ -1039,21 +1040,20 @@
                     xxx_UT_DEBUGMSG(("fp_Run::Run %x not dirty returning \n",this));
                     return;
             }
    -
    + GR_Graphics *pG = pDA->pG;
    + GR_DrawManager d(pG);
             if(isHidden())
             {
                     // this run is marked as hidden, nothing to do
                     return;
             }
             
    -
             m_bIsCleared = false;
             if (getLine())
                     getLine()->setScreenCleared(false);
     
     // UT_usleep(100000); // 0.1 seconds useful for debugging
             xxx_UT_DEBUGMSG(("SEVIOR: draw Run this %x \n",this));
    - GR_Graphics * pG = pDA->pG;
             // shortcircuit drawing if we're way off base.
             long imax = (1 << 15) - 1;
             if (((pDA->yoff < -imax) || (pDA->yoff > imax)) && pG->queryProperties(GR_Graphics::DGP_SCREEN))
    @@ -1297,6 +1297,7 @@
             {
                     return;
             }
    + GR_DrawManager d(pG);
     
             const UT_sint32 old_LineWidth = m_iLineWidth;
             UT_sint32 cur_linewidth = pG->tlu(1) + UT_MAX(pG->tlu(10),static_cast<UT_sint32>(getAscent())-pG->tlu(10))/8;
    @@ -1595,6 +1596,7 @@
     {
     
         GR_Font *pFont = getGraphics()->getGUIFont();
    + GR_DrawManager d(getGraphics());
         getGraphics()->setFont(pFont);
     
         UT_uint32 iTextLen = UT_UCS4_strlen(pText);
    @@ -1837,6 +1839,7 @@
     {
             // UT_ASSERT(!isDirty());
             UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN));
    + GR_DrawManager d(getGraphics());
     
             UT_sint32 xoff = 0, yoff = 0;
     
    @@ -1851,6 +1854,8 @@
             return;
         }
     
    + GR_DrawManager d(getGraphics());
    +
     #define NPOINTS 6
     
         UT_Point points[NPOINTS];
    @@ -1921,6 +1926,7 @@
             xxx_UT_DEBUGMSG(("fp_TabRun::_draw (0x%x)\n",this));
             GR_Graphics * pG = pDA->pG;
     
    + GR_DrawManager d(pG);
             // need to draw to the full height of line to join with line above.
             UT_sint32 xoff= 0, yoff=0, DA_xoff = pDA->xoff;
     
    @@ -2182,7 +2188,7 @@
                     }
                 return;
         }
    -
    + GR_DrawManager d(getGraphics());
             UT_uint32 iRunBase = getBlock()->getPosition() + getBlockOffset();
     
             UT_uint32 iSelAnchor = pView->getSelectionAnchor();
    @@ -2470,6 +2476,7 @@
                 return;
         }
     
    + GR_DrawManager d(getGraphics());
     
             UT_sint32 xoff = 0, yoff = 0;
             getLine()->getScreenOffsets(this, xoff, yoff);
    @@ -2494,6 +2501,7 @@
                 return;
         }
     
    + GR_DrawManager d(pG);
     
             UT_uint32 iRunBase = getBlock()->getPosition() + getBlockOffset();
     
    @@ -2805,6 +2813,7 @@
             {
                     return;
             }
    + GR_DrawManager d(getGraphics());
             UT_sint32 xoff = 0, yoff = 0;
             getLine()->getScreenOffsets(this, xoff, yoff);
     
    @@ -2841,7 +2850,7 @@
                 }
                 return;
         }
    -
    + GR_DrawManager d(getGraphics());
             UT_uint32 iRunBase = getBlock()->getPosition() + getBlockOffset();
     
             UT_uint32 iSelAnchor = pView->getSelectionAnchor();
    @@ -3119,6 +3128,7 @@
             // UT_ASSERT(!isDirty());
     
             UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN));
    + GR_DrawManager d(getGraphics());
     
             UT_sint32 xoff = 0, yoff = 0;
     
    @@ -3135,7 +3145,7 @@
     
     void fp_ImageRun::_drawResizeBox(UT_Rect box)
     {
    -
    + GR_DrawManager d(getGraphics());
             UT_sint32 left = box.left;
             UT_sint32 top = box.top;
             UT_sint32 right = box.left + box.width - getGraphics()->tlu(1);
    @@ -3165,6 +3175,7 @@
     void fp_ImageRun::_draw(dg_DrawArgs* pDA)
     {
             GR_Graphics *pG = pDA->pG;
    + GR_DrawManager d(pG);
             if(getBlock()->getDocLayout()->getGraphicTick() != m_iGraphicTick)
             {
                     regenerateImage(pG);
    @@ -3189,7 +3200,6 @@
                     }
             }
             
    -
     //
     // Sevior's infamous + 1....
             yoff += getLine()->getAscent() - getAscent() + 1;
    @@ -3779,6 +3789,7 @@
     
             UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN));
             UT_sint32 xoff = 0, yoff = 0;
    + GR_DrawManager d(getGraphics());
     
             // need to clear full height of line, in case we had a selection
             getLine()->getScreenOffsets(this, xoff, yoff);
    @@ -3789,6 +3800,7 @@
     void fp_FieldRun::_defaultDraw(dg_DrawArgs* pDA)
     {
             GR_Graphics * pG = pDA->pG;
    + GR_DrawManager d(pG);
     
             // TODO is this really needed
             // should not be, since lookupProperties is called on
    @@ -4968,6 +4980,7 @@
     {
             // UT_ASSERT(!isDirty());
             UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN));
    + GR_DrawManager d(getGraphics());
     
         UT_sint32 xoff = 0, yoff = 0;
         getLine()->getScreenOffsets(this, xoff, yoff);
    @@ -4987,6 +5000,7 @@
         if(!pView->getShowPara()){
             return;
         }
    + GR_DrawManager d(pG);
     
         UT_sint32 iLineWidth = getLine()->getMaxWidth();
     
    @@ -5089,6 +5103,7 @@
     {
             // UT_ASSERT(!isDirty());
             UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN));
    + GR_DrawManager d(getGraphics());
     
         UT_sint32 xoff = 0, yoff = 0;
         getLine()->getScreenOffsets(this, xoff, yoff);
    @@ -5099,6 +5114,7 @@
     void fp_ForcedPageBreakRun::_draw(dg_DrawArgs* pDA)
     {
             GR_Graphics * pG = pDA->pG;
    + GR_DrawManager d(pG);
     
         if (!(pG->queryProperties(GR_Graphics::DGP_SCREEN))){
             return;
    Index: src/text/fmt/xp/fp_TableContainer.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_TableContainer.cpp,v
    retrieving revision 1.129
    diff -u -r1.129 fp_TableContainer.cpp
    --- src/text/fmt/xp/fp_TableContainer.cpp 28 Nov 2003 00:32:29 -0000 1.129
    +++ src/text/fmt/xp/fp_TableContainer.cpp 13 Dec 2003 19:21:58 -0000
    @@ -597,6 +597,7 @@
             {
                     return;
             }
    + GR_DrawManager d(getGraphics());
     
             UT_ASSERT(pLayout->getContainerType () == FL_CONTAINER_TABLE);
             if (pLayout->getContainerType () != FL_CONTAINER_TABLE) return;
    @@ -784,6 +785,7 @@
     void fp_CellContainer::_drawLine (const PP_PropertyMap::Line & style,
                                                                       UT_sint32 left, UT_sint32 top, UT_sint32 right, UT_sint32 bot,GR_Graphics * pGr)
     {
    + GR_DrawManager d(pGr);
     
             if (style.m_t_linestyle == PP_PropertyMap::linestyle_none &&
                     !pGr->queryProperties(GR_Graphics::DGP_SCREEN))
    @@ -979,6 +981,7 @@
             {
                     return;
             }
    + GR_DrawManager d(getGraphics());
             bool bNested = false;
             if(pBroke == NULL)
             {
    @@ -1202,6 +1205,7 @@
             UT_sint32 col_right = getRightAttach();
             UT_sint32 col_left = getLeftAttach();
             fp_TableContainer * pTab = static_cast<fp_TableContainer *>(getContainer());
    + GR_DrawManager d(getGraphics());
             if(pTab == NULL)
             {
                     return;
    @@ -1248,6 +1252,7 @@
      */
     void fp_CellContainer::_drawBoundaries(dg_DrawArgs* pDA, fp_TableContainer * pBroke)
     {
    + GR_DrawManager d(getGraphics());
             UT_ASSERT(getPage());
             if(getPage() == NULL)
             {
    @@ -1397,6 +1402,7 @@
     {
             m_bDrawTop = false;
             GR_Graphics * pG = pDA->pG;
    + GR_DrawManager d(pG);
             fp_TableContainer * pTab = static_cast<fp_TableContainer *>(getContainer());
     // draw bottom if this cell is the last of the table and fully contained on the page
     
    @@ -1474,6 +1480,7 @@
     void fp_CellContainer::draw(fp_Line * pLine)
     {
             UT_ASSERT(getPage());
    + GR_DrawManager d(getGraphics());
             if(!getPage())
             {
                     return;
    @@ -1560,6 +1567,7 @@
     fp_Container * fp_CellContainer::drawSelectedCell(fp_Line * pLine)
     {
             UT_ASSERT(getPage());
    + GR_DrawManager d(getGraphics());
             if(!getPage())
             {
                     return NULL;
    @@ -1698,6 +1706,7 @@
             m_bDrawLeft = false;
             m_bDrawTop = false;
             fp_TableContainer * pTab = NULL;
    + GR_DrawManager d(pDA->pG);
     
             if(pBroke && pBroke->isThisBroken())
             {
    @@ -2352,6 +2361,7 @@
      */
     void fp_TableContainer::drawLines(void)
     {
    + GR_DrawManager d(getGraphics());
             if(isThisBroken())
             {
                     m_bRedrawLines = false;
    @@ -3638,6 +3648,7 @@
             {
                     return;
             }
    + GR_DrawManager d(getGraphics());
             UT_sint32 iWidth =0;
             UT_sint32 iBorderWidth =0;
             if(isThisBroken())
    @@ -3708,6 +3719,7 @@
             // If table is nested, do a clear screen on the topmost cell that
             // contains it
             // This should be fixed later.
    + GR_DrawManager d(getGraphics());
             fp_Container *pUp = getContainer();
             bool bIsNested = (pUp && (pUp->getContainerType() == FP_CONTAINER_CELL));
             if(isThisBroken() && !bIsNested)
    @@ -3746,6 +3758,7 @@
     // Don't draw if the table is still being constructed.
     //
             xxx_UT_DEBUGMSG(("TablecONTAINER enter draw table %x \n",this));
    + GR_DrawManager d(pDA->pG);
             if(getSectionLayout()->getDocument()->isDontImmediateLayout())
             {
                     xxx_UT_DEBUGMSG(("TablecONTAINER leave draw dont immediately layout \n"));
    @@ -4038,6 +4051,7 @@
             UT_Rect * pClipRect = const_cast<UT_Rect *>(pDA->pG->getClipRect());
             fp_TableContainer * pBroke = const_cast<fp_TableContainer *>(this);
             bool bDirtyOnly = pDA->bDirtyRunsOnly;
    + GR_DrawManager d(pDA->pG);
             if(m_pFirstBrokenCell)
             {
                     pCell = m_pFirstBrokenCell;
    @@ -4147,6 +4161,7 @@
             {
                     return;
             }
    + GR_DrawManager d(getGraphics());
         if(getPage()->getDocLayout()->getView()->getShowPara() && getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN)){
             UT_sint32 xoffBegin = pDA->xoff - 1 + getX();
             UT_sint32 yoffBegin = pDA->yoff - 1;
    Index: src/text/fmt/xp/fp_TextRun.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fp_TextRun.cpp,v
    retrieving revision 1.261
    diff -u -r1.261 fp_TextRun.cpp
    --- src/text/fmt/xp/fp_TextRun.cpp 10 Dec 2003 23:57:43 -0000 1.261
    +++ src/text/fmt/xp/fp_TextRun.cpp 13 Dec 2003 19:22:01 -0000
    @@ -1300,6 +1300,7 @@
     {
     // UT_ASSERT(!isDirty());
             UT_ASSERT(getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN));
    + GR_DrawManager d(getGraphics());
     //
     // For justfied lines we have to clear the entire line
     //
    @@ -1408,6 +1409,8 @@
                     return;
     
             GR_Graphics * pG = pDA->pG;
    + GR_DrawManager d(pG);
    +
             _refreshDrawBuffer();
             xxx_UT_DEBUGMSG(("fp_TextRun::_draw (0x%x): m_iVisDirection %d, _getDirection() %d\n",
                                              this, m_iVisDirection, _getDirection()));
    @@ -1749,7 +1752,7 @@
             if (getGraphics()->queryProperties(GR_Graphics::DGP_SCREEN))
             {
                     //UT_Rect r;
    -
    + GR_DrawManager d(getGraphics());
                     _getPartRect(&r, xoff, yoff, iPos1, iLen, pgbCharWidths);
                     r.height = getLine()->getHeight();
                     r.top = r.top + getAscent() - getLine()->getAscent();
    @@ -1896,6 +1899,7 @@
     {
             if(!getLength())
                     return;
    + GR_DrawManager d(pG);
     
             // have to set font (and colour!), since we were called from a run using different font
             pG->setFont(_getFont());
    @@ -1927,6 +1931,7 @@
             if(!getLength())
                     return;
     
    + GR_DrawManager d(pG);
             // have to sent font (and colour!), since we were called from a run using different font
             pG->setFont(_getFont());
     
    @@ -2011,6 +2016,7 @@
             }
     
             m_bSquiggled = true;
    + GR_DrawManager d(getGraphics());
     
             UT_sint32 nPoints = getGraphics()->tdu((right - left + getGraphics()->tlu(3))/2);
             UT_ASSERT(nPoints >= 1); //can be 1 for overstriking chars
    @@ -2061,6 +2067,7 @@
                     // I think this is safe, although it begs the question, why did we get called if iLen is zero? TODO
                     return;
             }
    + GR_DrawManager d(getGraphics());
             if(getLine())
             {
                     getLine()->setScreenCleared(false);
    Index: src/text/fmt/xp/fv_FrameEdit.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fv_FrameEdit.cpp,v
    retrieving revision 1.16
    diff -u -r1.16 fv_FrameEdit.cpp
    --- src/text/fmt/xp/fv_FrameEdit.cpp 13 Dec 2003 13:39:30 -0000 1.16
    +++ src/text/fmt/xp/fv_FrameEdit.cpp 13 Dec 2003 19:22:01 -0000
    @@ -100,6 +100,7 @@
             UT_Rect expX(0,m_recCurFrame.top,0,m_recCurFrame.height);
             UT_Rect expY(m_recCurFrame.left,0,m_recCurFrame.width,0);
             UT_sint32 iext = getGraphics()->tlu(3);
    + GR_DrawManager d(getGraphics());
             switch (m_iDraggingWhat)
             {
             case FV_FrameEdit_DragTopLeftCorner:
    @@ -1072,6 +1073,7 @@
             m_pView->getPageScreenOffsets(pPage,xPage,yPage);
             da.xoff = xPage + m_pFrameContainer->getX();
             da.yoff = yPage + m_pFrameContainer->getY();
    + GR_DrawManager d(da.pG);
             if((m_pFrameImage == NULL) || (m_iDraggingWhat != FV_FrameEdit_DragWholeFrame) )
             {
                     m_pFrameContainer->clearScreen();
    Index: src/text/fmt/xp/fv_View.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fv_View.cpp,v
    retrieving revision 1.862
    diff -u -r1.862 fv_View.cpp
    --- src/text/fmt/xp/fv_View.cpp 13 Dec 2003 13:39:31 -0000 1.862
    +++ src/text/fmt/xp/fv_View.cpp 13 Dec 2003 19:22:12 -0000
    @@ -5850,6 +5850,7 @@
     {
             CHECK_WINDOW_SIZE
             UT_sint32 dx = v - m_xScrollOffset;
    + GR_DrawManager d(m_pG);
     
             if (dx == 0)
                     return;
    @@ -5885,6 +5886,7 @@
     {
             CHECK_WINDOW_SIZE
             UT_sint32 dy = v - m_yScrollOffset;
    + GR_DrawManager d(m_pG);
     
             if (dy == 0)
                     return;
    @@ -9898,6 +9900,7 @@
             UT_ASSERT(m_pDraggedImageRun);
             GR_Image * pImage = (static_cast<fp_ImageRun *>(m_pDraggedImageRun))->getImage();
             UT_ASSERT(pImage);
    + GR_DrawManager d(m_pG);
     
             // calculate the new image boundaries
             UT_Rect bounds = UT_Rect(xPos - (m_ixDragOrigin - m_dragImageRect.left), yPos - (m_iyDragOrigin - m_dragImageRect.top), m_dragImageRect.width, m_dragImageRect.height);
    Index: src/text/fmt/xp/fv_View_protected.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fv_View_protected.cpp,v
    retrieving revision 1.127
    diff -u -r1.127 fv_View_protected.cpp
    --- src/text/fmt/xp/fv_View_protected.cpp 13 Dec 2003 13:39:32 -0000 1.127
    +++ src/text/fmt/xp/fv_View_protected.cpp 13 Dec 2003 19:22:15 -0000
    @@ -3447,6 +3447,7 @@
                     return;
             }
     
    + GR_DrawManager d(m_pG);
             // TMN: Leave this rect at function scope!
             // gr_Graphics only stores a _pointer_ to it!
             UT_Rect rClip;
    Index: src/text/fmt/xp/fv_VisualDragText.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/text/fmt/xp/fv_VisualDragText.cpp,v
    retrieving revision 1.11
    diff -u -r1.11 fv_VisualDragText.cpp
    --- src/text/fmt/xp/fv_VisualDragText.cpp 13 Dec 2003 13:39:32 -0000 1.11
    +++ src/text/fmt/xp/fv_VisualDragText.cpp 13 Dec 2003 19:22:15 -0000
    @@ -438,4 +438,5 @@
                     UT_ASSERT(UT_SHOULD_NOT_HAPPEN);
                     return;
             }
    + GR_DrawManager d(getGraphics());
             getGraphics()->drawImage(m_pDragImage,m_recCurFrame.left,m_recCurFrame.top);}
    Index: src/wp/ap/qnx/ap_QNXApp.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/qnx/ap_QNXApp.cpp,v
    retrieving revision 1.66
    diff -u -r1.66 ap_QNXApp.cpp
    --- src/wp/ap/qnx/ap_QNXApp.cpp 19 Oct 2003 09:03:03 -0000 1.66
    +++ src/wp/ap/qnx/ap_QNXApp.cpp 13 Dec 2003 19:22:29 -0000
    @@ -427,6 +427,7 @@
     
     static int s_drawingarea_expose(PtWidget_t *widget, PhTile_t *damage) {
     
    + GR_DrawManager d(static_cast<GR_Graphics *>(pQNXGraphics));
             if (pQNXGraphics && pSplashImage) {
                     pQNXGraphics->drawImage(pSplashImage, 0, 0);
     
    Index: src/wp/ap/qnx/ap_QNXLeftRuler.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/qnx/ap_QNXLeftRuler.cpp,v
    retrieving revision 1.23
    diff -u -r1.23 ap_QNXLeftRuler.cpp
    --- src/wp/ap/qnx/ap_QNXLeftRuler.cpp 19 Apr 2003 17:28:35 -0000 1.23
    +++ src/wp/ap/qnx/ap_QNXLeftRuler.cpp 13 Dec 2003 19:22:29 -0000
    @@ -24,6 +24,7 @@
     #include "xap_QNXFrameImpl.h"
     #include "ap_QNXLeftRuler.h"
     #include "gr_QNXGraphics.h"
    +#include "fv_View.h"
     #include <stdio.h>
     
     #define REPLACEP(p,q) do { if (p) delete p; p = q; } while (0)
    @@ -217,7 +218,6 @@
             get_stuff(info, &ems, NULL, &mx, &my);
     
             pQNXLeftRuler->mouseMotion(ems, pQNXLeftRuler->getGraphics()->tlu(mx), pQNXLeftRuler->getGraphics()->tlu(my));
    - PgFlush();
     
             return Pt_CONTINUE;
     }
    Index: src/wp/ap/qnx/ap_QNXTopRuler.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/qnx/ap_QNXTopRuler.cpp,v
    retrieving revision 1.25
    diff -u -r1.25 ap_QNXTopRuler.cpp
    --- src/wp/ap/qnx/ap_QNXTopRuler.cpp 1 Jun 2003 23:38:24 -0000 1.25
    +++ src/wp/ap/qnx/ap_QNXTopRuler.cpp 13 Dec 2003 19:22:29 -0000
    @@ -25,8 +25,8 @@
     #include "xap_QNXFrameImpl.h"
     #include "gr_QNXGraphics.h"
     #include "ap_QNXTopRuler.h"
    -#include <stdio.h>
     #include "fv_View.h"
    +#include <stdio.h>
     
     #define REPLACEP(p,q) do { if (p) delete p; p = q; } while (0)
     #define ENSUREP(p) do { UT_ASSERT(p); if (!p) goto Cleanup; } while (0)
    @@ -233,7 +233,6 @@
             get_stuff(info, &ems, NULL, &mx, &my);
     
             pQNXTopRuler->mouseMotion(ems, pQNXTopRuler->getGraphics()->tlu(mx), pQNXTopRuler->getGraphics()->tlu(my));
    - PgFlush();
     
             return Pt_CONTINUE;
     }
    Index: src/wp/ap/xp/ap_Dialog_Columns.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Columns.cpp,v
    retrieving revision 1.25
    diff -u -r1.25 ap_Dialog_Columns.cpp
    --- src/wp/ap/xp/ap_Dialog_Columns.cpp 25 Mar 2003 23:03:03 -0000 1.25
    +++ src/wp/ap/xp/ap_Dialog_Columns.cpp 13 Dec 2003 19:22:31 -0000
    @@ -395,6 +395,7 @@
     {
             UT_sint32 iWidth = m_gc->tlu(getWindowWidth());
             UT_sint32 iHeight = m_gc->tlu(getWindowHeight());
    + GR_DrawManager d(m_gc);
     
             double maxHeightPercent = m_pColumns->getMaxHeightPercent();
             double SpacePercent = m_pColumns->getSpaceAfterPercent();
    @@ -431,6 +432,7 @@
     {
     
             UT_sint32 iHalfColumnGap = gc->tlu (rect.width / gc->tlu(20));
    + GR_DrawManager d(gc);
     
             UT_sint32 y_start = rect.top + iHalfColumnGap;
             UT_sint32 y_end = rect.top + rect.height - iHalfColumnGap;
    Index: src/wp/ap/xp/ap_Dialog_FormatTable.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_FormatTable.cpp,v
    retrieving revision 1.27
    diff -u -r1.27 ap_Dialog_FormatTable.cpp
    --- src/wp/ap/xp/ap_Dialog_FormatTable.cpp 13 Oct 2003 01:43:49 -0000 1.27
    +++ src/wp/ap/xp/ap_Dialog_FormatTable.cpp 13 Dec 2003 19:22:31 -0000
    @@ -706,6 +706,7 @@
             UT_sint32 iWidth = m_gc->tlu (getWindowWidth());
             UT_sint32 iHeight = m_gc->tlu (getWindowHeight());
             UT_Rect pageRect(m_gc->tlu(7), m_gc->tlu(7), iWidth - m_gc->tlu(14), iHeight - m_gc->tlu(14));
    + GR_DrawManager d(m_gc);
             
             m_gc->fillRect(GR_Graphics::CLR3D_Background, 0, 0, iWidth, iHeight);
             m_gc->clearArea(pageRect.left, pageRect.top, pageRect.width, pageRect.height);
    Index: src/wp/ap/xp/ap_Dialog_Lists.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Lists.cpp,v
    retrieving revision 1.81
    diff -u -r1.81 ap_Dialog_Lists.cpp
    --- src/wp/ap/xp/ap_Dialog_Lists.cpp 12 Oct 2003 00:01:58 -0000 1.81
    +++ src/wp/ap/xp/ap_Dialog_Lists.cpp 13 Dec 2003 19:22:33 -0000
    @@ -1056,6 +1056,7 @@
     void AP_Lists_preview::draw(void)
     {
             UT_return_if_fail(m_pFont);
    + GR_DrawManager d(m_gc);
             m_gc->setFont(m_pFont);
             
             UT_RGBColor clrGrey = UT_RGBColor(128,128,128);
    Index: src/wp/ap/xp/ap_Dialog_PageNumbers.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_PageNumbers.cpp,v
    retrieving revision 1.12
    diff -u -r1.12 ap_Dialog_PageNumbers.cpp
    --- src/wp/ap/xp/ap_Dialog_PageNumbers.cpp 18 Mar 2003 23:02:13 -0000 1.12
    +++ src/wp/ap/xp/ap_Dialog_PageNumbers.cpp 13 Dec 2003 19:22:34 -0000
    @@ -114,6 +114,7 @@
             int x = 0, y = 0;
             
             UT_ASSERT (m_gc);
    + GR_DrawManager d(m_gc);
             
             UT_sint32 iWidth = m_gc->tlu (getWindowWidth());
             UT_sint32 iHeight = m_gc->tlu (getWindowHeight());
    Index: src/wp/ap/xp/ap_LeftRuler.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/xp/ap_LeftRuler.cpp,v
    retrieving revision 1.95
    diff -u -r1.95 ap_LeftRuler.cpp
    --- src/wp/ap/xp/ap_LeftRuler.cpp 24 Nov 2003 06:22:18 -0000 1.95
    +++ src/wp/ap/xp/ap_LeftRuler.cpp 13 Dec 2003 19:22:36 -0000
    @@ -1175,6 +1175,7 @@
     
     void AP_LeftRuler::scrollRuler(UT_sint32 yoff, UT_sint32 ylimit)
     {
    + GR_DrawManager d(m_pG);
             UT_Rect rClip;
             UT_Rect * prClip;
     
    @@ -1259,6 +1260,7 @@
             {
                     return;
             }
    + GR_DrawManager d(m_pG);
             fl_HdrFtrShadow * pShadow = pView->getEditShadow();
     
             bool hdr = (hdrftr &&
    @@ -1517,6 +1519,8 @@
             {
                     return;
             }
    + GR_DrawManager d(m_pG);
    +
             UT_sint32 left = prDrag->left;
             UT_sint32 right = left + prDrag->width - m_pG->tlu(1);
             UT_sint32 top = prDrag->top;
    @@ -1560,6 +1564,7 @@
             UT_ASSERT(lfi->m_yTopMargin >= 0);
             UT_Rect r;
             UT_Rect * pClipRect = NULL;
    + GR_DrawManager d(m_pG);
      
             if (pCR)
             {
    @@ -1744,6 +1749,7 @@
     void AP_LeftRuler::_xorGuide(bool bClear)
     {
             UT_sint32 y = m_draggingCenter;
    + GR_DrawManager d(m_pG);
     
             GR_Graphics * pG = (static_cast<FV_View *>(m_pView))->getGraphics();
             UT_ASSERT(pG);
    Index: src/wp/ap/xp/ap_Preview_Paragraph.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Preview_Paragraph.cpp,v
    retrieving revision 1.36
    diff -u -r1.36 ap_Preview_Paragraph.cpp
    --- src/wp/ap/xp/ap_Preview_Paragraph.cpp 12 Oct 2003 00:01:58 -0000 1.36
    +++ src/wp/ap/xp/ap_Preview_Paragraph.cpp 13 Dec 2003 19:22:38 -0000
    @@ -509,7 +509,7 @@
     void AP_Preview_Paragraph::draw(void)
     {
             UT_ASSERT(m_gc);
    -
    + GR_DrawManager d(m_gc);
             // paint white background (Word 97's background is always white, the
             // text is always black, and the font is always the same size, regardless
             // of the current document's real block formatting).
    @@ -543,6 +543,7 @@
     
     void AP_Preview_Paragraph::_drawPageBackground(void)
     {
    + GR_DrawManager d(m_gc);
             // clear area
             m_gc->fillRect(*m_clrWhite, 0, 0, m_gc->tlu(getWindowWidth()), m_gc->tlu(getWindowHeight()));
     }
    @@ -550,6 +551,7 @@
     void AP_Preview_Paragraph::_drawPageBorder(void)
     {
             // draw a black one pixel border
    + GR_DrawManager d(m_gc);
             m_gc->setColor(*m_clrBlack);
             m_gc->drawLine(0, 0, m_gc->tlu(getWindowWidth()), 0);
             m_gc->drawLine(m_gc->tlu(getWindowWidth()) - m_gc->tlu(1), 0, m_gc->tlu(getWindowWidth()) - m_gc->tlu(1), m_gc->tlu(getWindowHeight()));
    @@ -650,6 +652,7 @@
     {
     
             UT_ASSERT(words && widths);
    + GR_DrawManager d(m_gc);
     
             // width of space character in pixels
             UT_sint32 spaceCharWidth = m_gc->tlu(3);
    Index: src/wp/ap/xp/ap_TopRuler.cpp
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/ap/xp/ap_TopRuler.cpp,v
    retrieving revision 1.190
    diff -u -r1.190 ap_TopRuler.cpp
    --- src/wp/ap/xp/ap_TopRuler.cpp 24 Nov 2003 06:22:20 -0000 1.190
    +++ src/wp/ap/xp/ap_TopRuler.cpp 13 Dec 2003 19:22:43 -0000
    @@ -312,6 +312,7 @@
     {
             // scroll the window while excluding the portion
             // lining up with the LeftRuler.
    + GR_DrawManager d(m_pG);
     
             if (xlimit > 0)
                     m_xScrollLimit = xlimit;
    @@ -369,6 +370,7 @@
             if (!m_pG)
                     return;
     
    + GR_DrawManager d(m_pG);
             UT_Rect r;
             UT_Rect * pClipRect = NULL;
             
    @@ -405,6 +407,7 @@
             // where x is in page-relative coordinates. we need
             // to compensate for fixed portion, the page-view margin,
             // and the scroll.
    + GR_DrawManager d(m_pG);
     
             UT_uint32 yTop = m_pG->tlu(s_iFixedHeight)/4;
             UT_uint32 yBar = m_pG->tlu(s_iFixedHeight)/2;
    @@ -448,6 +451,8 @@
                                                                     GR_Graphics::GR_Color3D clr3d, GR_Font * pFont,
                                                                     UT_sint32 k, UT_sint32 xTick)
     {
    + GR_DrawManager d(m_pG);
    +
             UT_sint32 yTop = m_pG->tlu(s_iFixedHeight)/4;
             UT_sint32 yBar = m_pG->tlu(s_iFixedHeight)/2;
     
    @@ -510,6 +515,7 @@
             // xFrom gives the page-relative x-coordinate of where we should begin drawing.
             // xTo gives the page-relative x-coordinate of where we should end drawing.
             // if xTo is less than xFrom we draw with values increasing to the left.
    + GR_DrawManager d(m_pG);
     
             UT_ASSERT(xFrom != xTo);
             UT_ASSERT(xFrom >= 0);
    @@ -731,7 +737,7 @@
             _getParagraphMarkerRects(pInfo,
                                                              leftCenter, rightCenter, firstLineCenter,
                                                              &rLeftIndent, &rRightIndent, &rFirstLineIndent);
    -
    + GR_DrawManager d(m_pG);
             FV_View * pView = (static_cast<FV_View *>(m_pView));
             bool bRTL = pView->getCurrentBlock()->getDominantDirection() == FRIBIDI_TYPE_RTL;
             xxx_UT_DEBUGMSG(("ap_TopRulerDrawPara: bRTL = %d \n",bRTL));
    @@ -895,6 +901,7 @@
             UT_Rect rect;
             eTabType iType;
             eTabLeader iLeader;
    + GR_DrawManager d(m_pG);
     
             if (m_draggingWhat == DW_TABSTOP)
             {
    @@ -1112,6 +1119,7 @@
                                                                                     AP_TopRulerInfo * pInfo, GR_Graphics::GR_Color3D clr)
     {
             UT_Rect rLeft, rRight;
    + GR_DrawManager d(m_pG);
     
             _getMarginMarkerRects(pInfo,rLeft,rRight);
     
    @@ -1170,6 +1178,7 @@
                     pInfo = &infoLocal;
                     pView->getTopRulerInfo(pInfo);
             }
    + GR_DrawManager d(m_pG);
     
             // draw the tab toggle inside the fixed area in the left-hand corner
             _drawTabToggle(pClipRect, false);
    @@ -1371,6 +1380,7 @@
             {
                     xFixed = 0;
             }
    + GR_DrawManager d(pG);
     
             UT_sint32 x = m_draggingCenter - xFixed;
     
    @@ -1652,6 +1662,7 @@
             if(m_pG == NULL)
                     return;
     
    + GR_DrawManager d(m_pG);
             UT_sint32 left = prDrag->left + m_pG->tlu(2);
             UT_sint32 right = left + prDrag->width -m_pG->tlu(4);
             UT_sint32 top = prDrag->top + m_pG->tlu(2);
    @@ -1688,6 +1699,7 @@
     {
             if(m_pG == NULL)
                     return;
    + GR_DrawManager d(m_pG);
     
             if (m_draggingWhat == DW_CELLMARK)
             {
    @@ -1738,6 +1750,8 @@
             {
                     return;
             }
    + GR_DrawManager d(m_pG);
    +
             if(pInfo->m_mode != AP_TopRulerInfo::TRI_MODE_TABLE)
             {
                     return;
    @@ -1795,6 +1809,7 @@
     {
             if(m_pG == NULL)
                     return;
    + GR_DrawManager d(m_pG);
     
             UT_Rect lCell, cCell, rCell;
             UT_sint32 left,right,top,height;
    @@ -3915,6 +3930,7 @@
     {
             GR_Graphics::GR_Color3D clr3dBorder, clr3dBevel;
             _computeEffects(bFilled,clr3dBorder,clr3dBevel);
    + GR_DrawManager d(m_pG);
     
             UT_sint32 l = rect.left;
             UT_sint32 t = rect.top;
    @@ -3992,6 +4008,7 @@
     {
             GR_Graphics::GR_Color3D clr3dBorder, clr3dBevel;
             _computeEffects(bFilled,clr3dBorder,clr3dBevel);
    + GR_DrawManager d(m_pG);
     
             UT_sint32 l = rect.left;
             UT_sint32 t = rect.top;
    @@ -4068,6 +4085,7 @@
     {
             GR_Graphics::GR_Color3D clr3dBorder, clr3dBevel;
             _computeEffects(bFilled,clr3dBorder,clr3dBevel);
    + GR_DrawManager d(m_pG);
     
             UT_sint32 l = rect.left;
             UT_sint32 t = rect.top;
    @@ -4106,6 +4124,7 @@
             // draw in normal and print layout modes, not online
             if(static_cast<FV_View*>(m_pView)->getViewMode() == VIEW_WEB)
               return;
    + GR_DrawManager d(m_pG);
     
             UT_Rect rect;
             _getTabToggleRect(&rect);
    @@ -4149,6 +4168,7 @@
     void AP_TopRuler::_drawTabStop(UT_Rect & rect, eTabType iType, bool bFilled)
     {
             GR_Graphics::GR_Color3D clr3d;
    + GR_DrawManager d(m_pG);
             if (bFilled)
                     clr3d = GR_Graphics::CLR3D_Foreground;
             else
    @@ -4202,6 +4222,7 @@
     {
             GR_Graphics::GR_Color3D clr3dBorder, clr3dBevel;
             _computeEffects(true,clr3dBorder,clr3dBevel);
    + GR_DrawManager d(m_pG);
     
             UT_sint32 l = rect.left;
             UT_sint32 t = rect.top;
    Index: src/wp/main/cocoa/bundle/Info.plist
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/main/cocoa/bundle/Info.plist,v
    retrieving revision 1.12
    diff -u -r1.12 Info.plist
    --- src/wp/main/cocoa/bundle/Info.plist 14 Nov 2003 00:10:39 -0000 1.12
    +++ src/wp/main/cocoa/bundle/Info.plist 13 Dec 2003 19:22:49 -0000
    @@ -107,10 +107,14 @@
             <key>CFBundleSignature</key>
             <string>AbiW</string>
             <key>CFBundleVersion</key>
    +<<<<<<< Info.plist
    + <string>2.1.0</string>
    +=======
             <string>2.1.0</string>
             <key>NSMainNibFile</key>
             <string>MainMenu</string>
             <key>NSPrincipalClass</key>
             <string>NSApplication</string>
    +>>>>>>> 1.12
     </dict>
     </plist>
    Index: src/wp/main/qnx/Icon.wgti
    ===================================================================
    RCS file: /cvsroot/abi/src/wp/main/qnx/Icon.wgti,v
    retrieving revision 1.1
    diff -u -r1.1 Icon.wgti
    Binary files /tmp/cvsboWDi8 and Icon.wgti differ



    This archive was generated by hypermail 2.1.4 : Sat Dec 13 2003 - 14:34:00 EST