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 >
Text File  |  1996-05-19  |  5KB  |  129 lines

  1. /********************************************************************
  2.  *
  3.  * Copyright (C) 1996 Blue Marsh Softworks -- All Rights Reserved.
  4.  * Portions Copyright (c) Geoworks 1992 -- All Rights Reserved
  5.  *
  6.  * PROJECT:      Text Editor
  7.  * MODULE:       Process Methods
  8.  * FILE:         process.goc
  9.  *
  10.  * AUTHORS:      Lawrence Hosken
  11.  *               Nathan Fiedler
  12.  *
  13.  * REVISION HISTORY:
  14.  *      Name     Date      Description
  15.  *      ----     ----      -----------
  16.  *       LH      09/21/92  Initial version
  17.  *       EB      12/16/93  Fixed up scrolling, default focus, and
  18.  *                         targeting Text object for EditControl.
  19.  *       NF      04/01/95  Started work on Zoomer Text File Editor
  20.  *       NF      06/06/95  Started desktop version
  21.  *
  22.  * DESCRIPTION:
  23.  *      These are the function definitions and method definitions
  24.  *      for the process object.
  25.  *
  26.  *******************************************************************/
  27.  
  28. /********************************************************************
  29.  *                 Headers
  30.  *******************************************************************/
  31.     @include <stdapp.goh>
  32.     @include <objects/vltextc.goh> /* VisLargeText definitions */
  33.     #include <initfile.h>          /* GEOS.INI file routines */
  34.     @include "app.goh"             /* Includes classes and constants. */
  35.     @include "global.goh"          /* Must be after app.goh. Includes
  36.                                     * globals, objects, prototypes. */
  37.  
  38. /********************************************************************
  39.  *                 Local Function Definitions
  40.  *******************************************************************/
  41.  
  42. /********************************************************************
  43.  *                 Code for TFEProcessClass
  44.  *******************************************************************/
  45.  
  46. /********************************************************************
  47.  *                 MSG_GEN_PROCESS_OPEN_APPLICATION
  48.  ********************************************************************
  49.  * SYNOPSIS:     This is sent by the UI when the app is being
  50.  *               loaded.
  51.  * PARAMETERS:   void ( AppAttachFlags attachFlags,
  52.  *                      MemHandle      launchBlock,
  53.  *                      MemHandle      extraState )
  54.  * SIDE EFFECTS: Changes pointSize_g
  55.  * STRATEGY:     Read saved point size from GEOS.INI file.
  56.  *******************************************************************/
  57. @extern method TFEProcessClass, MSG_GEN_PROCESS_OPEN_APPLICATION {
  58.   word sizeOfData; /* Size of data read from INI file. */
  59.  
  60.   @callsuper();
  61.  
  62.      /*
  63.       * Read saved point size from GEOS.INI file.
  64.       * If there is an error, set size to default.
  65.       * Error indicates our category hasn't been added yet.
  66.       */
  67.   sizeOfData = 0;
  68.   InitFileReadDataBuffer( INI_CATEGORY,
  69.                           INI_PTSZ_KEYWORD,
  70.                           &pointSize_g,
  71.                           sizeof( pointSize_g ),
  72.                           &sizeOfData );
  73.   if ( sizeOfData != sizeof( pointSize_g ) ) {
  74.     pointSize_g.WWF_int  = TFE_DEFAULT_PS;
  75.     pointSize_g.WWF_frac = 0;
  76.   }
  77.  
  78.      /*
  79.       * Read saved font ID from GEOS.INI file.
  80.       * If there is an error, set font to default.
  81.       * Error indicates our category hasn't been added yet.
  82.       */
  83.   sizeOfData = 0;
  84.   InitFileReadDataBuffer( INI_CATEGORY,
  85.                           INI_FONT_KEYWORD,
  86.                           &fontID_g,
  87.                           sizeof( fontID_g ),
  88.                           &sizeOfData );
  89.   if ( sizeOfData != sizeof( fontID_g ) ) {
  90.     fontID_g = 0;
  91.   }
  92.  
  93. @ifndef ZOOMER
  94.      /*
  95.       * Set the undo context for the text object.
  96.       * Added for the OmniGo version.
  97.       */
  98.   @send process::MSG_GEN_PROCESS_UNDO_SET_CONTEXT( 1 );
  99. @endif
  100. } /* MSG_GEN_PROCESS_OPEN_APPLICATION */
  101.  
  102. /********************************************************************
  103.  *                 MSG_META_SAVE_OPTIONS
  104.  ********************************************************************
  105.  * SYNOPSIS:     Tells application to save configuration.
  106.  * CALLED BY:    TFESaveOptsTrigger
  107.  * PARAMETERS:   void ( void )
  108.  * STRATEGY:     Save current point size to GEOS.INI file, then
  109.  *               call GenApplication to save it's options.
  110.  *******************************************************************/
  111. @extern method TFEProcessClass, MSG_META_SAVE_OPTIONS {
  112.  
  113.      /* Save point size to GEOS.INI file. */
  114.   InitFileWriteData( INI_CATEGORY,
  115.                      INI_PTSZ_KEYWORD,
  116.                      &pointSize_g,
  117.                      sizeof( pointSize_g ) );
  118.  
  119.      /* Save font ID to GEOS.INI file. */
  120.   InitFileWriteData( INI_CATEGORY,
  121.                      INI_FONT_KEYWORD,
  122.                      &fontID_g,
  123.                      sizeof( fontID_g ) );
  124.  
  125.      /* Make sure other options are saved, too. */
  126.   @send application::MSG_META_SAVE_OPTIONS();
  127. } /* MSG_META_SAVE_OPTIONS */
  128.  
  129.