range.cpp File Reference

(r1785/r1744)

#include "camtypes.h"
#include "sprdmsg.h"
#include "layer.h"
#include "nodetext.h"
#include "nodetxtl.h"
#include "nodetxts.h"
#include "nodecont.h"
#include "nodeshad.h"
#include "objreg.h"
#include "attrmap.h"
#include "toolmsg.h"
#include "comattrmsg.h"
#include "qualattr.h"
#include "ngcore.h"
#include "objchge.h"
#include "effects_stack.h"
#include "fillattr2.h"

Go to the source code of this file.

Defines

#define new   CAM_DEBUG_NEW
#define ENABLE_FAST_XOR   1

Enumerations

enum  XORRenderPasses {
  RENDER_START, RENDER_HIGH, RENDER_MEDIUM, RENDER_LOW,
  RENDER_END
}
 Shared code used by the rotate, select, and scale tools to XOR the object(s) being dragged on/off screen. This function is called before starting to XOR the objects onto screen to reset the count of objects which have been rendered (for interruptible blob redraw) and other pertinent information. This should be called once before starting an outline drag, and under normal circumstances need never be called again, as it is called internally by RenderXOROutlinesOff at appropriate times. More...

Functions

 DECLARE_SOURCE ("$Revision: 1744 $")
 CC_IMPLEMENT_DYNAMIC (CommonAttrsChangedMsg, Msg)
static void DrawXORBoundingRect (RenderRegion *pRender, DocRect &TheRect)
 Shared code which renders the bounding rectangle of the XOR outline objects in the current colours. It is rendered as a path so that the rect.
BOOL SafeAppendString (StringBase *pstrAppendum, const StringBase &strAppendee, BOOL fAddSep=TRUE)
 update the status line with the given text, prefixed with the selection description (if valid to do so)


Define Documentation

#define ENABLE_FAST_XOR   1
 

Definition at line 168 of file range.cpp.

#define new   CAM_DEBUG_NEW
 

Definition at line 163 of file range.cpp.


Enumeration Type Documentation

enum XORRenderPasses
 

Shared code used by the rotate, select, and scale tools to XOR the object(s) being dragged on/off screen. This function is called before starting to XOR the objects onto screen to reset the count of objects which have been rendered (for interruptible blob redraw) and other pertinent information. This should be called once before starting an outline drag, and under normal circumstances need never be called again, as it is called internally by RenderXOROutlinesOff at appropriate times.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/2/94
Parameters:
FlushTheCache - This should ALWAYS be TRUE in external calls [INPUTS]
Notes: For example client code, see the selector and rotate tools. If you fail to call this before starting outline dragging, the cached drag information used by related calls will be wrong, and it'll break.

See also:
SelRange::RenderXOROutlinesOn; SelRange::RenderXOROutlinesOff; SelRange::RenderXOROutlinesToCatchUp; OpSelectorMove
Enumerator:
RENDER_START 
RENDER_HIGH 
RENDER_MEDIUM 
RENDER_LOW 
RENDER_END 

Definition at line 1626 of file range.cpp.

01627 {
01628     RENDER_START,       // About to start rendering passes from the beginning
01629     RENDER_HIGH,        // Render all high-priority objects
01630     RENDER_MEDIUM,      // Render all medium-priority objects
01631     RENDER_LOW,         // Render all low-priority objects (anything that's left!)
01632     RENDER_END          // Have rendered all available objects
01633 } XORRenderPasses;


Function Documentation

CC_IMPLEMENT_DYNAMIC CommonAttrsChangedMsg  ,
Msg 
 

DECLARE_SOURCE "$Revision: 1744 $"   ) 
 

static void DrawXORBoundingRect RenderRegion pRender,
DocRect TheRect
[inline, static]
 

Shared code which renders the bounding rectangle of the XOR outline objects in the current colours. It is rendered as a path so that the rect.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/4/95
Parameters:
pRender - a render region to render into [INPUTS] TheRect - the current bounding rectanglew of the XOR outline objects
Basically just a veneer for DrawDragBounds

See also:
OSRenderRegion::DrawDragBounds

Definition at line 1985 of file range.cpp.

01986 {
01987     if (!TheRect.IsValid() || TheRect.IsEmpty() || !DocView::OutlineShowBounds)
01988         return;
01989     
01990 #if !defined(EXCLUDE_FROM_RALPH)
01991     pRender->SaveContext();
01992 
01993     pRender->SetLineColour(COLOUR_XORSELECT);
01994     pRender->DrawDragBounds(&TheRect);
01995 
01996     pRender->RestoreContext();
01997 #endif
01998 }

BOOL SafeAppendString StringBase pstrAppendum,
const StringBase strAppendee,
BOOL  fAddSep = TRUE
 

update the status line with the given text, prefixed with the selection description (if valid to do so)

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/7/95
Parameters:
pstrAppendum pointer to the string to append to [INPUTS] strAppendee the string to append fAddSep if TRUE (the default) will append a space after strAppendee string.
pstrAppendum the appended string [OUTPUTS]
Returns:
TRUE if it was trivial to append, FALSE if the string to be appended had to be truncated.
See also:
SelRange::LayerDescription

Definition at line 5070 of file range.cpp.

05071 {
05072     INT32 nTotal = pstrAppendum->Length() + strAppendee.Length() + (fAddSep != 0);
05073     INT32 nMax = pstrAppendum->MaxLength();
05074     BOOL fNoTrunc= (nTotal < nMax);
05075     if (fNoTrunc)
05076     {
05077         // We can append without fear of overflow . . .
05078         *pstrAppendum += strAppendee;
05079         if (fAddSep) *pstrAppendum += TEXT(" ");
05080     }
05081     else
05082     {
05083         // We have to truncate the string to append, to avoid overflow . . .
05084         INT32 nTruncCount = strAppendee.Length() - (nTotal - nMax);
05085         if (nTruncCount > 0)
05086         {
05087             // We have some room for more text, so append the truncated string.
05088             String_256 strTrunc;
05089             strAppendee.Left(&strTrunc, nTruncCount);
05090             *pstrAppendum += strTrunc;
05091             if (fAddSep) *pstrAppendum += TEXT(" ");
05092         }
05093     }
05094 
05095     // Return FALSE if we had to truncate.
05096     return fNoTrunc;
05097 }


Generated on Sat Nov 10 03:49:19 2007 for Camelot by  doxygen 1.4.4