home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14561 < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.6 KB  |  81 lines

  1. Path: sparky!uunet!olivea!hal.com!decwrl!sun-barr!ames!data.nas.nasa.gov!taligent!keith@taligent.com
  2. From: keith@taligent.com (Keith Rollin)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: How does MPW store font and tab info?
  5. Message-ID: <BtLwu7.HCL@taligent.com>
  6. Date: 26 Aug 92 19:58:55 GMT
  7. References: <THOR.92Aug26030603@haydn.vivaldi.psu.edu>
  8. Sender: usenet@taligent.com (More Bytes Than You Can Read)
  9. Distribution: comp
  10. Organization: Taligent
  11. Lines: 68
  12.  
  13. In article <THOR.92Aug26030603@haydn.vivaldi.psu.edu>, thor@vivaldi.psu.edu
  14. (Thomas Moertel) writes:
  15. > I need to know how MPW stores the font/tab information for TEXT files
  16. > it creates.  I'm pretty sure this info is a 'MPSR' resource.  I would
  17. > love to get a Rez definition or C/C++ struct declaration for the
  18. > beast.  Thanks in advance for your help!
  19.  
  20. #define resourceType    'MPSR'
  21. #define editResID        1005
  22.  
  23. struct TABRSRC
  24. {
  25.     short width;                            // width of space in points
  26.     short count;                            // tab width in spaces
  27. };
  28.  
  29. struct FONTRSRC
  30. {
  31.     short       size;                       // font size
  32.     character   name[32];                   // font name
  33. };
  34.  
  35. struct WINDRSRC
  36. {
  37.     Rect openrect;                          // rectangle of window zoomed out
  38.     Rect closerect;                         // rectangle of window zoomed in
  39. };
  40.  
  41. struct SELRSRC
  42. {
  43.     unsigned int date;                      // time of last edit
  44.     int start;                              // offset to start of selection
  45.     int end;                                // offset to end of selection
  46.     int pos;                                // offset to first char in window
  47. };
  48.  
  49. struct EditRsrc
  50. {
  51.     struct FONTRSRC     fontrsrc;
  52.     struct TABRSRC      tabrsrc;
  53.     struct WINDRSRC     windrsrc;
  54.     struct SELRSRC      selrsrc;
  55.     character           autoindent,         // true if auto indent is on
  56.                         invisibles;         // true if show invisibles is on
  57. };
  58.  
  59.  
  60. #define resourceType    'MPSR'
  61. #define editMarkID       1007
  62.  
  63. struct MarkElement {
  64.     int             start;                  // start position of mark
  65.     int             end;                    // end position
  66.     unsigned char   charCount;              // number of chars in mark name
  67.     char            name[1];                // first char of mark name
  68. };                                          // (name is null terminated)
  69.  
  70.  
  71. struct MarkRsrc {
  72.     short count;                            // number of marks in the resource
  73.     MarkElement mark[0];                    // zero or more mark elements
  74. };
  75.  
  76. --
  77. Keith Rollin
  78. Phantom Programmer
  79. Taligent, Inc.
  80.