document.cpp File Reference

(r1785/r1668)

#include "camtypes.h"
#include <fstream>
#include <ctype.h>
#include <string>
#include <stdlib.h>
#include "camdoc.h"
#include "dumbnode.h"
#include "noderect.h"
#include "lineattr.h"
#include "colcontx.h"
#include "csrstack.h"
#include "grid.h"
#include "nodedoc.h"
#include "chapter.h"
#include "page.h"
#include "wrkrect.h"
#include "sprdmsg.h"
#include "layer.h"
#include "insertnd.h"
#include "camview.h"
#include "nativeps.h"
#include "saveeps.h"
#include "zoomops.h"
#include "qualops.h"
#include "ai_eps.h"
#include "ai_epsrr.h"
#include "fontlist.h"
#include "fontman.h"
#include "progress.h"
#include "bmpcomp.h"
#include "ralphdoc.h"
#include "camelot.h"
#include "ngsentry.h"
#include "opnudge.h"
#include "ophist.h"

Go to the source code of this file.

Defines

#define EUI_BUFFER_SIZE   256

Functions

 DECLARE_SOURCE ("$Revision: 1668 $")
 CC_IMPLEMENT_DYNAMIC (Document, BaseDocument) CC_IMPLEMENT_DYNAMIC(DocChangingMsg
Msg CC_IMPLEMENT_DYNAMIC (SpreadMsg, Msg) CC_IMPLEMENT_DYNAMIC(TranspModeMsg
Msg Msg CC_IMPLEMENT_DYNAMIC (SafeRenderPointer, CCObject) const MILLIPOINT PageWidth
BOOL ReadNextNumber (INT32 *Number, TCHAR *Comment, INT32 *Offset)
 Called by Document::ProcessEPSComment to help tidy up the code a little. This actually just reads a number out of a string.
BOOL ReadNextNumber (UINT32 *Number, TCHAR *Comment, INT32 *Offset)
 Called by Document::ProcessEPSComment to help tidy up the code a little. This actually just reads a number out of a string.
BOOL ReadNextNumber (double *Number, TCHAR *Comment, INT32 *Offset)
 Called by Document::ProcessEPSComment to help tidy up the code a little. This actually just reads a number out of a string.
BOOL ReadNextString (StringBase *pString, INT32 MaxLen, TCHAR *Comment, INT32 *Offset)
 Called by Document::ProcessEPSComment to help tidy up the code a little. This actually just reads a string out of a string.

Variables

const MILLIPOINT PageHeight = (11 * 72000)
const MILLIPOINT Gap = 72000L
const MILLIPOINT PasteBoardWidth = PageWidth + (Gap * 2)
const MILLIPOINT PasteBoardHeight = PageHeight + (Gap * 2)
const MILLIPOINT DefBleedSize = 72000L/4
static String_256 ClipboardNameText (TEXT("Clipboard"))
const UINT32 DEFAULT_NUDGE_SIZE = 2835


Define Documentation

#define EUI_BUFFER_SIZE   256
 


Function Documentation

Msg Msg CC_IMPLEMENT_DYNAMIC SafeRenderPointer  ,
CCObject 
const
 

Msg CC_IMPLEMENT_DYNAMIC SpreadMsg  ,
Msg 
 

CC_IMPLEMENT_DYNAMIC Document  ,
BaseDocument 
 

DECLARE_SOURCE "$Revision: 1668 $"   ) 
 

BOOL ReadNextNumber double *  Number,
TCHAR Comment,
INT32 *  Offset
 

Called by Document::ProcessEPSComment to help tidy up the code a little. This actually just reads a number out of a string.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/2/95
Parameters:
Comment - The string we are reading from [INPUTS] Offset - the offset into the string that we start from
Number - holds the number in the string if the function returns TRUE [OUTPUTS] Offset - Holds the offset to just after the number in the string if the function returns TRUE
Returns:
TRUE if it worked, FALSE if it could not find a number

Definition at line 3259 of file document.cpp.

03260 {
03261     INT32& i = *Offset;
03262 
03263     // Skip till we get to the first number
03264     while (camIsspace(Comment[i]) && (Comment[i]!=0))
03265         i++;
03266 
03267     // Read in the number
03268     if (!camIsspace(Comment[i]))
03269     {
03270         // get the Number
03271         *Number=0.0;
03272         camSscanf(&(Comment[i]),_T("%lf"),Number);
03273 
03274         // Skip to the next number
03275         while (!camIsspace(Comment[i]))
03276             i++;
03277 
03278         // finished
03279         return TRUE;
03280     }
03281 
03282     // Failed
03283     return FALSE;
03284 }

BOOL ReadNextNumber UINT32 Number,
TCHAR Comment,
INT32 *  Offset
 

Called by Document::ProcessEPSComment to help tidy up the code a little. This actually just reads a number out of a string.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/07/95
Parameters:
Comment - The string we are reading from [INPUTS] Offset - the offset into the string that we start from
Number - holds the number in the string if the function returns TRUE [OUTPUTS] Offset - Holds the offset to just after the number in the string if the function returns TRUE
Returns:
TRUE if it worked, FALSE if it could not find a number

Definition at line 3213 of file document.cpp.

03214 {
03215     INT32& i = *Offset;
03216 
03217     // Skip till we get to the first number
03218     while (!isdigit(Comment[i]) && (Comment[i] != 0))
03219         i++;
03220 
03221     // Read in the number
03222     if (isdigit(Comment[i]))
03223     {
03224         // get the Number
03225         *Number=0;
03226         camSscanf(&(Comment[i]),_T("%ud"),Number);
03227 
03228         // Skip to the next number
03229         while (isdigit(Comment[i]))
03230             i++;
03231 
03232         // finished
03233         return TRUE;
03234     }
03235 
03236     // Failed
03237     return FALSE;
03238 }

BOOL ReadNextNumber INT32 *  Number,
TCHAR Comment,
INT32 *  Offset
 

Called by Document::ProcessEPSComment to help tidy up the code a little. This actually just reads a number out of a string.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/2/95
Parameters:
Comment - The string we are reading from [INPUTS] Offset - the offset into the string that we start from
Number - holds the number in the string if the function returns TRUE [OUTPUTS] Offset - Holds the offset to just after the number in the string if the function returns TRUE
Returns:
TRUE if it worked, FALSE if it could not find a number

Definition at line 3157 of file document.cpp.

03158 {
03159     INT32& i = *Offset;
03160     BOOL IsNegative = FALSE;
03161 
03162     // Skip till we get to the first number
03163     while (!isdigit(Comment[i]) && (Comment[i] != 0) && (Comment[i]!='-'))
03164         i++;
03165 
03166     if (Comment[i]=='-')
03167     {
03168         // Negative number
03169         IsNegative = TRUE;
03170         i++;
03171     }
03172 
03173     // Read in the number
03174     if (isdigit(Comment[i]))
03175     {
03176         // get the Number
03177         *Number=0;
03178         camSscanf(&(Comment[i]),_T("%d"),Number);
03179 
03180         // Set the sign
03181         if (IsNegative)
03182             *Number = -(*Number);
03183 
03184         // Skip to the next number
03185         while (isdigit(Comment[i]))
03186             i++;
03187 
03188         // finished
03189         return TRUE;
03190     }
03191 
03192     // Failed
03193     return FALSE;
03194 }

BOOL ReadNextString StringBase pString,
INT32  MaxLen,
TCHAR Comment,
INT32 *  Offset
 

Called by Document::ProcessEPSComment to help tidy up the code a little. This actually just reads a string out of a string.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/3/95
Parameters:
MaxLen - the max length of the output string [INPUTS] Comment - The string we are reading from Offset - the offset into the string that we start from
pString - Holds the string [OUTPUTS] Offset - Holds the offset to just after the number in the string if the function returns TRUE
Returns:
TRUE if it worked, FALSE if it could not find a string

Definition at line 3305 of file document.cpp.

03306 {
03307     INT32& i = *Offset;
03308     TCHAR TempStr[256];
03309 
03310     // Skip till we get to the start of the string (Which is the '(' char)
03311     while ((Comment[i]!='(') && (Comment[i]!=0))
03312         i++;
03313 
03314     // ok, read the string in
03315     if (Comment[i]=='(')
03316     {
03317         // Eat the open bracket
03318         i++;
03319 
03320         // Start to copy the string
03321         TCHAR Ch;
03322         INT32 Dst = 0;
03323         do
03324         {
03325             // Get this char and store it
03326             Ch = Comment[i];
03327             TempStr[Dst] = Ch;
03328             Dst++;
03329             i++;
03330             
03331             if (Ch=='\\')
03332             {
03333                 // This is the escape char, so store the char that follows it,
03334                 // but do not change the value of Ch or it may think that the comment is ending
03335                 TempStr[Dst-1] = Comment[i];
03336                 i++;
03337             } 
03338         } while (((Ch!=0) && (Ch!=')')) || (Dst==MaxLen-1));
03339 
03340         // Terminate the string
03341         TempStr[Dst-1] = 0;
03342 
03343         // Copy the string into the StringBase
03344         pString->Empty();
03345         *pString += (TCHAR*)TempStr;
03346         return TRUE;
03347     }
03348 
03349     // if we get here, we did not extract the string
03350     return FALSE;
03351 }


Variable Documentation

String_256 ClipboardNameText(TEXT("Clipboard")) [static]
 

const UINT32 DEFAULT_NUDGE_SIZE = 2835
 

Definition at line 195 of file document.cpp.

const MILLIPOINT DefBleedSize = 72000L/4
 

Definition at line 178 of file document.cpp.

const MILLIPOINT Gap = 72000L
 

Definition at line 175 of file document.cpp.

const MILLIPOINT PageHeight = (11 * 72000)
 

Definition at line 172 of file document.cpp.

const MILLIPOINT PasteBoardHeight = PageHeight + (Gap * 2)
 

Definition at line 177 of file document.cpp.

const MILLIPOINT PasteBoardWidth = PageWidth + (Gap * 2)
 

Definition at line 176 of file document.cpp.


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