home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 March
/
Chip_1998-03_cd.bin
/
zkuste
/
SVET_GEO
/
TEXTDESK
/
TEXTDESK.ZIP
/
GLOBAL.GOH
< prev
next >
Wrap
Text File
|
1996-02-14
|
8KB
|
174 lines
/********************************************************************
*
* Copyright (C) 1996 Blue Marsh Softworks -- All Rights Reserved.
*
* PROJECT: Text Editor
* MODULE: Global Header
* FILE: global.goh
*
* AUTHOR: Nathan Fiedler
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
* NF 04/01/95 Initial version
* NF 06/06/95 Started desktop version
*
* DESCRIPTION:
* This contains all the global variables, object declaractions,
* and routine declarations.
*
*******************************************************************/
#ifndef __GLOBAL_GOH
#define __GLOBAL_GOH
/********************************************************************
* Global Variable Declarations
*******************************************************************/
extern WWFixed pointSize_g;
extern FontID fontID_g;
/********************************************************************
* Object Declarations
*******************************************************************/
@extern object TFEApp;
@extern object TFEPrimary;
@extern object TFEDocumentControl;
@extern object TFEPrintControl;
@extern object TFEEditControl;
@extern object TFESearchReplaceControl;
@extern object TFEPtSizeControl;
@extern object TFEToolOptions;
@extern object TFESaveOptsTrigger;
@extern object TFEToolControl;
@extern object TFEToolbar;
@extern object TFEDisplayControl;
@extern object TFEDisplayDisplay;
@extern object TFEMoreAboutBox;
@extern object TFEText;
@extern chunk TFETextRegionArray;
/********************************************************************
* Function and Macro Declarations
*******************************************************************/
/********************************************************************
* badChar
********************************************************************
* SYNOPSIS: Check if passed character is a bad one or not.
* CALLED BY: ReadDataFromFile
* RemoveBadChars
* RETURNS: TRUE if character is bad
* STRATEGY: Do an if statement to check validity of character.
*******************************************************************/
Boolean badChar
(
unsigned char ch /* Character to test (in). */
);
#ifdef DEBUG
/********************************************************************
* ErrorMessage
********************************************************************
* SYNOPSIS: Displays an error message and then quits program.
* CALLED BY: Any function or method
* SIDE EFFECTS: Exits program
* STRATEGY: Call UserStandardDialog and then send MSG_META_QUIT
* to the application object.
*******************************************************************/
void ErrorMessage
(
unsigned char * errorString /* Message to be displayed (in) */
);
#endif
/********************************************************************
* ProcessString
********************************************************************
* SYNOPSIS: Removes bad characters from character string.
* CALLED BY: ReadDataFromFile
* STRATEGY: Check each character to see if it is a valid
* character. If not, remove it. Then append what's
* left to the text object.
*******************************************************************/
void ProcessString
(
word numCharsRead, /* Number of characters (in) */
optr ourText_p, /* Text object to append to (in) */
unsigned char * dataBlockPtr /* String of characters (in/out) */
);
/********************************************************************
* ReadDataFromFile
********************************************************************
* SYNOPSIS: Reads text from file and appends to text object.
* CALLED BY: MSG_GEN_DOCUMENT_PHYSICAL_REVERT
* MSG_GEN_DOCUMENT_OPEN
* RETURNS: TRUE if error occurred
* SIDE EFFECT: Resets undo.
* STRATEGY: Deletes text in text object and appends text from
* file.
*******************************************************************/
Boolean ReadDataFromFile
(
FileHandle file_p, /* Handle of file to read from (in). */
optr ourText_p, /* Pointer to text object to write to (in). */
word * error_p /* Pointer to error status word (out). */
);
/********************************************************************
* RemoveBadChars
********************************************************************
* SYNOPSIS: Remove some consecutive bad characters.
* CALLED BY: ReadDataFromFile
* STRATEGY: Look for consecutive bad characters and remove them.
*******************************************************************/
void RemoveBadChars
(
unsigned char * dataBlockPtr, /* String to examine (i/o) */
word curCharIndex, /* Position to start check (i/o) */
word * numCharsLeft /* Number of characters in array (i/o) */
);
/********************************************************************
* ResetUndo
********************************************************************
* SYNOPSIS: Set the undo status to nothing to undo.
* CALLED BY: ReadDataFromFile
* AUTHOR: Ed Ballot
* STRATEGY: To notify the undo/redo edit control that there is
* nothing to undo, send MSG_META_NOTIFY_WITH_DATA_BLOCK.
* The notification type is GWNT_UNDO_STATE_CHANGE
* and the block you want to send should contain
* the structure NotifyUndoStateChange (
* NUSC_undoTitle = NullOptr and
* NUSC_undoType = UD_UNDO ).
*******************************************************************/
void ResetUndo
(
void
);
/********************************************************************
* WriteDataToFile
********************************************************************
* SYNOPSIS: Write the contents of the document to a file.
* CALLED BY: MSG_GEN_DOCUMENT_SAVE
* MSG_GEN_DOCUMENT_UPDATE
* MSG_GEN_DOCUMENT_PHYSICAL_SAVE_AS_FILE_HANDLE
* RETURNS: TRUE if error occurred
* SIDE EFFECTS: Tells object it is not modified.
* STRATEGY: Using the text optr and file handle, seek to the
* start of the file and write the text out.
*******************************************************************/
Boolean WriteDataToFile
(
FileHandle file_p, /* File to write to. (in) */
optr ourText_p, /* Pointer to text object. (in) */
word * error /* Return error. (out) */
);
#endif