home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Utilities / FileSpy-1.1-MIHS / SpyTextFieldCell.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-04  |  4.7 KB  |  157 lines

  1. /*
  2.  *   This sourcecode is part of FileSpy, a logfile observing utility.
  3.  *   Copyright (C) 1996  Felix Rauch
  4.  *
  5.  *   This program is free software; you can redistribute it and/or modify
  6.  *   it under the terms of the GNU General Public License as published by
  7.  *   the Free Software Foundation; either version 2 of the License, or
  8.  *   (at your option) any later version.
  9.  *   
  10.  *   Notice that this program may not be possessed, used, copied,
  11.  *   distributed or modified by people having to do with nuclear
  12.  *   weapons. See the file CONDITIONS for details.
  13.  *
  14.  *   This program is distributed in the hope that it will be useful,
  15.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  *   GNU General Public License for more details.
  18.  *
  19.  *   You should have received a copy of the GNU General Public License
  20.  *   along with this program; if not, write to the Free Software
  21.  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22.  *
  23.  *   To contact the original author, try:
  24.  *   e-mail: Felix.Rauch@nice.ch
  25.  *   Traditional mail:    Felix Rauch
  26.  *            Sempacherstrasse 33
  27.  *            8032 Zurich
  28.  *            Switzerland
  29.  */
  30.  
  31. #import <appkit/appkit.h>
  32.  
  33. #import <sys/types.h>
  34. #ifndef pid_t
  35. typedef int pid_t;        // this should be defined in <sys/types.h>!?!
  36. #endif
  37. #import <sys/dir.h>
  38. #import <sys/stat.h>
  39. #import <errno.h>
  40. #import <stdio.h>
  41. #import <string.h>
  42. #import <time.h>        // for timestamp-thing
  43.  
  44. #ifdef DEBUG
  45.     #include <assert.h>
  46. #endif
  47.  
  48. #import "Document.h"
  49. #import "Controller.h"
  50.  
  51. #define MAXFILENAMELENGHT MAXNAMLEN
  52. #define RADIO_ENTIRE 0
  53. #define RADIO_NEW 1
  54. #define FILETYPE_NOTHING 0
  55. #define FILETYPE_FILE 1
  56. #define FILETYPE_DIR 2
  57.  
  58. typedef struct nodedesc {
  59.     struct nodedesc *next;
  60.     char *string;
  61. } nodedesc;
  62. typedef nodedesc *node;
  63.  
  64. enum superFilenameState {ONCE, EACHLINE, NONE};
  65.  
  66. @interface SpyTextFieldCell:TextFieldCell
  67. {
  68.     long int lastFileLenght, fileLenght;
  69.     BOOL fileex, textloaded, permissionOK, dirloaded;
  70.     id myText, myWindow, myScrollView, myFont;
  71.     id myDoc;
  72.     id myDelegate;
  73.     NXRect textRect, windowRect, scrollViewRect;
  74.     int fileMode, fileType;
  75.     BOOL autoPopUp, beepOnChange, logToSuperlog, useFilter;
  76.     BOOL dontCopySuperlog;            // don't copy to superlog on startup
  77.     BOOL timeStamp;                // print timestamp in log or not
  78.     unsigned int superCopyFilename;        // whether filename should be copied in superlog
  79.     int maxLines;                // maxLines for windows, 0 if not active
  80.     id dirStore;
  81.     time_t mtime, lastmtime;
  82.     short int firstTime;
  83.     NXColor color;
  84.     BOOL zeroFlag;        // to avoid unnecessary 'File <...> reduced size to 0 bytes' msg
  85.     unsigned short int spytype;    // spy for contents and/or existence?
  86.     BOOL oldfileex;        // did the file exist last time we checked?
  87.     BOOL oldpermissionOK;    // was the permission ok when we last checked?
  88.     BOOL showTime;        // show duration of change in ExistenceLog
  89.     id exMatrix, exCell;    // existenceMatrix, existenceTextFieldCell
  90.     id EImage;
  91.     unsigned int nrEINVAL;    // for nfs-errors
  92. }
  93.  
  94. + (void)setSharedTmpList:newList;
  95. + sharedTmpList;
  96. - init;
  97. - delete;
  98. - free;
  99. - (long int)lastFileLenght;
  100. - setLastFileLenght:(long int)lenght;
  101. - (BOOL)fileExists;
  102. - updateFile;
  103. - updateText;
  104. - readText;
  105. - readDir;
  106. - addText:(char *)givenString;
  107. - appendText:(char *)string unfilteredString:(char *)ufString didChange:(BOOL)changed;
  108. - (BOOL)changedState;
  109. - displayWindow;
  110. - moveWindowTo:(NXCoord)x:(NXCoord)y;
  111. - setFileMode:(int)mode;
  112. - (int)fileMode;
  113. - setAutoPopUp:(BOOL)state;
  114. - (BOOL)autoPopUp;
  115. - window;
  116. - setMyDelegate:sender;
  117. - myDelegate;
  118. - setBeepOnChange:(BOOL)state;
  119. - (BOOL)beepOnChange;
  120. - setLogToSuperlog:(BOOL)state;
  121. - (BOOL)logToSuperlog;
  122. - setUseFilter:(BOOL)state;
  123. - (BOOL)useFilter;
  124. - setDontCopy:(BOOL)state;    // don't copy to superlog on startup
  125. - (BOOL)dontCopy;
  126. - setSuperCopyFilename:(unsigned int)state;
  127. - (unsigned int)superCopyFilename;
  128. - setTimeStamp:(BOOL)state;
  129. - (BOOL)timeStamp;
  130. - setSpytype:(unsigned short int)type;
  131. - (unsigned short int)spytype;
  132. - updateExistence;
  133. - clearBuffer:sender;
  134. - contentChanged;
  135. - fileRemoved;
  136. - windowDidBecomeKey:sender;
  137. - text;
  138. - (NXColor)color;
  139. - setColor:(NXColor)color;
  140. - setSpyFont:newFont;        // do NOT use setFont:! (method inherited from a superclass)
  141. - spyFont;            // do NOT use font!
  142. - addTimeStamp:(char **)string;    // insert timeStamp on each line of string
  143. - setMaxLines:(int)lines;    // set the max. lines per window
  144. - shortText;            // make text shorter
  145. - (BOOL)permissionOk;
  146. - setShowTime:(BOOL)state;
  147. - (BOOL)showTime;
  148. - (BOOL)askUpdateTime;
  149.  
  150. // overriden methods
  151. - setStringValue:(const char*)str;
  152. // overriden methods for special drawing
  153. - drawInside:(const NXRect *)cellFrame inView:controlView;
  154. - highlight:(const NXRect *)cellFrame inView:controlView lit:(BOOL)flag;
  155.  
  156. @end
  157.