home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 March
/
Chip_1998-03_cd.bin
/
zkuste
/
SVET_GEO
/
TEXTDESK
/
TEXTDESK.ZIP
/
PROCESS.GOC
< prev
next >
Wrap
Text File
|
1996-05-19
|
5KB
|
129 lines
/********************************************************************
*
* Copyright (C) 1996 Blue Marsh Softworks -- All Rights Reserved.
* Portions Copyright (c) Geoworks 1992 -- All Rights Reserved
*
* PROJECT: Text Editor
* MODULE: Process Methods
* FILE: process.goc
*
* AUTHORS: Lawrence Hosken
* Nathan Fiedler
*
* REVISION HISTORY:
* Name Date Description
* ---- ---- -----------
* LH 09/21/92 Initial version
* EB 12/16/93 Fixed up scrolling, default focus, and
* targeting Text object for EditControl.
* NF 04/01/95 Started work on Zoomer Text File Editor
* NF 06/06/95 Started desktop version
*
* DESCRIPTION:
* These are the function definitions and method definitions
* for the process object.
*
*******************************************************************/
/********************************************************************
* Headers
*******************************************************************/
@include <stdapp.goh>
@include <objects/vltextc.goh> /* VisLargeText definitions */
#include <initfile.h> /* GEOS.INI file routines */
@include "app.goh" /* Includes classes and constants. */
@include "global.goh" /* Must be after app.goh. Includes
* globals, objects, prototypes. */
/********************************************************************
* Local Function Definitions
*******************************************************************/
/********************************************************************
* Code for TFEProcessClass
*******************************************************************/
/********************************************************************
* MSG_GEN_PROCESS_OPEN_APPLICATION
********************************************************************
* SYNOPSIS: This is sent by the UI when the app is being
* loaded.
* PARAMETERS: void ( AppAttachFlags attachFlags,
* MemHandle launchBlock,
* MemHandle extraState )
* SIDE EFFECTS: Changes pointSize_g
* STRATEGY: Read saved point size from GEOS.INI file.
*******************************************************************/
@extern method TFEProcessClass, MSG_GEN_PROCESS_OPEN_APPLICATION {
word sizeOfData; /* Size of data read from INI file. */
@callsuper();
/*
* Read saved point size from GEOS.INI file.
* If there is an error, set size to default.
* Error indicates our category hasn't been added yet.
*/
sizeOfData = 0;
InitFileReadDataBuffer( INI_CATEGORY,
INI_PTSZ_KEYWORD,
&pointSize_g,
sizeof( pointSize_g ),
&sizeOfData );
if ( sizeOfData != sizeof( pointSize_g ) ) {
pointSize_g.WWF_int = TFE_DEFAULT_PS;
pointSize_g.WWF_frac = 0;
}
/*
* Read saved font ID from GEOS.INI file.
* If there is an error, set font to default.
* Error indicates our category hasn't been added yet.
*/
sizeOfData = 0;
InitFileReadDataBuffer( INI_CATEGORY,
INI_FONT_KEYWORD,
&fontID_g,
sizeof( fontID_g ),
&sizeOfData );
if ( sizeOfData != sizeof( fontID_g ) ) {
fontID_g = 0;
}
@ifndef ZOOMER
/*
* Set the undo context for the text object.
* Added for the OmniGo version.
*/
@send process::MSG_GEN_PROCESS_UNDO_SET_CONTEXT( 1 );
@endif
} /* MSG_GEN_PROCESS_OPEN_APPLICATION */
/********************************************************************
* MSG_META_SAVE_OPTIONS
********************************************************************
* SYNOPSIS: Tells application to save configuration.
* CALLED BY: TFESaveOptsTrigger
* PARAMETERS: void ( void )
* STRATEGY: Save current point size to GEOS.INI file, then
* call GenApplication to save it's options.
*******************************************************************/
@extern method TFEProcessClass, MSG_META_SAVE_OPTIONS {
/* Save point size to GEOS.INI file. */
InitFileWriteData( INI_CATEGORY,
INI_PTSZ_KEYWORD,
&pointSize_g,
sizeof( pointSize_g ) );
/* Save font ID to GEOS.INI file. */
InitFileWriteData( INI_CATEGORY,
INI_FONT_KEYWORD,
&fontID_g,
sizeof( fontID_g ) );
/* Make sure other options are saved, too. */
@send application::MSG_META_SAVE_OPTIONS();
} /* MSG_META_SAVE_OPTIONS */