home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Headers / misckit / MiscMatrix.h < prev    next >
Encoding:
Text File  |  1994-03-23  |  2.0 KB  |  83 lines

  1. //
  2. //    MiscMatrix.h -- a class to implement variable-sized matrices
  3. //        Written by Mike Ferris Copyright (c) 1994 by Mike Ferris.
  4. //        Modified from original MOKit "MOMatrix" class by Don Yacktman.
  5. //                Version 1.0.  All rights reserved.
  6. //
  7. //        This notice may not be removed from this source code.
  8. //
  9. //    This object is included in the MiscKit by permission from the author
  10. //    and its use is governed by the MiscKit license, found in the file
  11. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  12. //    for a list of all applicable permissions and restrictions.
  13. //    
  14.  
  15. // MiscMatrix is a subclass of Matrix that allows independantly sizable
  16. // rows and columns.  Each row can have a different height and each column
  17. // can have a different width.
  18.  
  19. #import <appkit/appkit.h>
  20.  
  21. typedef struct _MiscColumnSize_ {
  22.     NXCoord        x;
  23.     NXCoord        width;
  24. }  MiscColumnSize;
  25. #define MISC_COLUMNSIZE_DESC        "{ff}"
  26.  
  27. typedef struct _MiscRowSize_ {
  28.     NXCoord        y;
  29.     NXCoord        height;
  30. }  MiscRowSize;
  31. #define MISC_ROWSIZE_DESC        "{ff}"
  32.  
  33.  
  34. @interface MiscMatrix : Matrix
  35. {
  36.     Storage *columnSizes, *rowSizes;
  37.     
  38. }
  39.  
  40. + initialize;
  41.  
  42. - initFrame:(const NXRect *)frm mode:(int)aMode prototype:cellId 
  43.             numRows:(int)rowsHigh numCols:(int)colsWide;
  44. - initFrame:(const NXRect *)frm mode:(int)aMode cellClass:factoryId 
  45.             numRows:(int)rowsHigh numCols:(int)colsWide;
  46.  
  47. - copyFromZone:(NXZone *)zone;
  48.  
  49. - free;
  50.  
  51. - setWidth:(NXCoord)newWidth ofCol:(int)col;
  52. - setHeight:(NXCoord)newHeight ofRow:(int)row;
  53.  
  54. - sizeToCells;
  55.  
  56. - renewRows:(int)newRows cols:(int)newCols;
  57.  
  58. - addCol;
  59. - addRow;
  60. - insertColAt:(int)col;
  61. - insertRowAt:(int)row;
  62. - removeColAt:(int)col andFree:(BOOL)flag;
  63. - removeRowAt:(int)row andFree:(BOOL)flag;
  64.  
  65. - drawSelf:(const NXRect *)rects :(int)rectCount;
  66.  
  67. - getCellFrame:(NXRect *)theRect at:(int)row :(int)col;
  68. - getRow:(int *)row andCol:(int *)col forPoint:(const NXPoint *)aPoint;
  69.  
  70. - setIntercell:(const NXSize *)aSize;
  71.  
  72. - write:(NXTypedStream *)typedStream;
  73. - read:(NXTypedStream *)typedStream;
  74.  
  75. @end
  76.  
  77. @interface Storage(MiscLastElementCategory)
  78.     
  79. - (void *)lastElement;
  80.  
  81. @end
  82.  
  83.