This is MiscTableCell.h in view mode; [Download] [Up]
#ifndef __MiscTableCell_h #define __MiscTableCell_h //============================================================================= // // Copyright (C) 1995-1997 by Paul S. McCarthy and Eric Sunshine. // Written by Paul S. McCarthy and Eric Sunshine. // All Rights Reserved. // // This notice may not be removed from this source code. // // This object is included in the MiscKit by permission from the authors // and its use is governed by the MiscKit license, found in the file // "License.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. // //============================================================================= //----------------------------------------------------------------------------- // MiscTableCell.h // // Default cell class used by MiscTableScroll to display text. // // NOTE: // By default, new cells are initialized to useOwner... everything. // // Calling any of the -setFont:, -setTextColor:, -setBackgroundColor: // -setHighlightTextColor:, or -setHighlightBackgroundColor: // methods implicitly turns off the corresponding "useOwner" value. In // the case of colors, this also causes space to be allocated to store // the corresponding color. // // Calling any of the -setOwnerFont:, -setOwnerTextColor:, or // -setOwnerBackgroundColor: methods do *NOT* set these values in the // owner, and do not necessarily make any changes in the object. They // are primarily notification messages. They give the cell the ability // to distinguish between cell-specific -setXxx messages and ones that // are propagated globally by the owner. // //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // $Id: MiscTableCell.h,v 1.10 97/06/10 05:42:22 sunshine Exp $ // $Log: MiscTableCell.h,v $ // Revision 1.10 97/06/10 05:42:22 sunshine // v127: Upgraded formatting. Fixed up comments. Added explicit (id). // // Revision 1.9 96/12/16 10:17:58 zarnuk // v111 -- Added table scroll retire/revive call back methods. // // Revision 1.8 96/09/25 07:17:22 sunshine // Ripped out all dragging-source support and promoted it to TableView. //----------------------------------------------------------------------------- #import <misckit/MiscTableTypes.h> MISC_TS_EXTERN_BEGIN( "Objective-C" ) #import <appkit/Cell.h> MISC_TS_EXTERN_END @class NXImage, Pasteboard; @class MiscTableScroll; #define MISC_TC1_HAS_TAG (1 << 0) // Obsolete. #define MISC_TC1_SELF_FONT (1 << 1) #define MISC_TC1_SELF_TEXT_COLOR (1 << 2) #define MISC_TC1_SELF_BACKGROUND_COLOR (1 << 3) #define MISC_TC1_SELF_TEXT_COLOR_H (1 << 4) #define MISC_TC1_SELF_BACKGROUND_COLOR_H (1 << 5) #define MISC_TC1_IS_SELECTED (1 << 6) #define MISC_TC1_SELF_DRAW (1 << 7) // !ownerDraw #define MISC_TC1_LAST_BIT (1 << 7) @interface MiscTableCell : Cell { id owner; int tag; unsigned int tc1_flags; void* tc1_data; } - (id)initTextCell:(char const*)s; - (id)initIconCell:(char const*)s; - (id)free; - (id)copyFromZone:(NXZone*)zone; - (id)read:(NXTypedStream*)stream; - (id)write:(NXTypedStream*)stream; - (id)drawInside:(NXRect const*)r inView:(id)v; - (id)drawSelf: (NXRect const*)r inView:(id)v; - (id)highlight: (NXRect const*)r inView:(id)v lit:(BOOL)flag; - (BOOL)isOpaque; - (void)setSelected:(BOOL)flag; - (BOOL)isSelected; - (int)tag; - (id)setTag:(int)tag; - (id)image; - (id)setImage:(id)image; - (id)owner; - (id)setOwner:(id)obj; - (id)font; - (id)setFont:(id)obj; // Turns off -useOwnerFont - (NXColor)textColor; - (NXColor)backgroundColor; - (NXColor)highlightBackgroundColor; - (NXColor)highlightTextColor; - (id)setTextColor:(NXColor)c; // Turns off -useOwnerTextCo... - (id)setBackgroundColor:(NXColor)c; // Turns off -useOwnerBackgr... - (id)setHighlightTextColor:(NXColor)c; // Turns off -useOwnerHighli... - (id)setHighlightBackgroundColor:(NXColor)c; // Turns off -useOwnerHighli... - (float)textGray; // Gray values are translated - (float)backgroundGray; // to/from color values. - (float)highlightTextGray; - (float)highlightBackgroundGray; - (id)setTextGray:(float)g; // Calls setTextColor: - (id)setBackgroundGray:(float)g; // Calls setBackgroundColor: - (id)setHighlightTextGray:(float)g; // Calls setHighlightTextColor: - (id)setHighlightBackgroundGray:(float)g; // Calls setHighlightBack... - (BOOL)ownerDraw; - (BOOL)useOwnerFont; - (BOOL)useOwnerTextColor; - (BOOL)useOwnerBackgroundColor; - (BOOL)useOwnerHighlightTextColor; - (BOOL)useOwnerHighlightBackgroundColor; - (id)setOwnerDraw:(BOOL)flag; - (id)setUseOwnerFont:(BOOL)flag; - (id)setUseOwnerTextColor:(BOOL)flag; - (id)setUseOwnerBackgroundColor:(BOOL)flag; - (id)setUseOwnerHighlightTextColor:(BOOL)flag; - (id)setUseOwnerHighlightBackgroundColor:(BOOL)flag; - (id)setOwnerFont:(id)obj; - (id)setOwnerTextColor:(NXColor)c; - (id)setOwnerBackgroundColor:(NXColor)c; - (id)setOwnerHighlightTextColor:(NXColor)c; - (id)setOwnerHighlightBackgroundColor:(NXColor)c; - (unsigned int)tc1Flags; - (unsigned int)tc1DataSize; - (unsigned int)tc1TextColorPos; - (unsigned int)tc1BackgroundColorPos; - (unsigned int)tc1HighlightTextColorPos; - (unsigned int)tc1HighlightBackgroundColorPos; - (unsigned int)tc1TextColorLen; - (unsigned int)tc1BackgroundColorLen; - (unsigned int)tc1HighlightTextColorLen; - (unsigned int)tc1HighlightBackgroundColorLen; - (NXColor*)tc1TextColorPtr; - (NXColor*)tc1BackgroundColorPtr; - (NXColor*)tc1HighlightTextColorPtr; - (NXColor*)tc1HighlightBackgroundColorPtr; - (void*)tc1InsertData:(void const*)data pos:(unsigned int)pos len:(unsigned int)len; - (void)tc1DeleteDataPos:(unsigned int)pos len:(unsigned int)len; - (void)tc1DestroyData; - (void)tc1FreeData; - (NXColor)fgColor; // Returns appropriate color based upon -isSelected. - (NXColor)bgColor; // Returns appropriate color based upon -isSelected. + (id)defaultFont; + (NXColor)defaultTextColor; + (NXColor)defaultBackgroundColor; + (NXColor)defaultHighlightTextColor; + (NXColor)defaultHighlightBackgroundColor; - (id)tableScroll:(MiscTableScroll*)scroll reviveAt:(int)row :(int)col; - (id)tableScroll:(MiscTableScroll*)scroll retireAt:(int)row :(int)col; @end #endif // __MiscTableCell_h
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.