Filewatcher File Search
FTP Search
  
Directory 
  
Content Search 
   
pkg://swarm-cvs-latest.tar.gz:13287713/swarm/cvs-latest/swarm/swarm/src/tkobjc/Attic/XColormap.h,v  downloads

head	1.7;
access;
symbols
	Swarm-1_0_5c:1.4
	Swarm-1_0_5b:1.4
	Swarm-1_0_5a:1.4
	Swarm-1_0_5:1.3
	Swarm-1_0_4c:1.3
	Swarm-1_0_4b:1.3
	Swarm-1_0_4a:1.3
	Swarm-1_0_4:1.3
	Swarm-1_0_2:1.1.1.1
	Swarm-1_0_1-Alpha-Port:1.1.1.1
	Swarm-1_0_1:1.1.1.1
	swarm-1_0_0_p1:1.1.1.1
	swarm-1_0_0:1.1.1.1
	SwarmKernel-0_7:1.1.1.1
	SwarmKernel-0_6:1.1.1.1
	SwarmKernel-0_5:1.1.1.1
	SwarmKernel-0_4:1.1.1.1
	SwarmKernel-0_3:1.1.1.1
	Swarm-961002:1.1.1.1
	SwarmKernel-0_2:1.1.1.1
	start:1.1.1.1
	Kernel:1.1.1;
locks; strict;
comment	@ * @;


1.7
date	98.01.27.23.48.33;	author mgd;	state dead;
branches;
next	1.6;

1.6
date	98.01.27.21.53.11;	author mgd;	state Exp;
branches;
next	1.5;

1.5
date	98.01.24.22.37.57;	author mgd;	state Exp;
branches;
next	1.4;

1.4
date	98.01.16.04.38.39;	author mgd;	state Exp;
branches;
next	1.3;

1.3
date	97.12.11.02.57.51;	author mgd;	state Exp;
branches;
next	1.2;

1.2
date	97.11.13.03.54.08;	author gepr;	state Exp;
branches;
next	1.1;

1.1
date	96.10.02.02.53.07;	author gepr;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	96.10.02.02.53.07;	author gepr;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Note renaming of BLTGraph -> Graph and XColormap -> Colormap
@
text
@// Swarm library. Copyright (C) 1996-1998 Santa Fe Institute.
// This library is distributed without any warranty; without even the
// implied warranty of merchantability or fitness for a particular purpose.
// See file LICENSE for details and terms of copying.

// basic Colormap object for X windows programming.
// used for now only in Raster, may come in handy later for other
// Xlib programming. It'd be great if we could lever private colormaps
// into this object.

// Terminology:
//   Color - a number in [0,MAXCOLORS]. The swarm programmer uses these.
//   PixelValue - what value Xlib expects. Colors are mapped to this.
// main Swarm programmer interface:
//   setColor:To: declare that Color c looks like the provide colorname.

#import <tk.h>
#import <X11/Xlib.h>
#import <defobj/Create.h>
#import <gui.h>

#define MAXCOLORS 256

@@interface XColormap: CreateDrop <Colormap>
{
  // state for the Object
  PixelValue white, black;
  PixelValue map[MAXCOLORS];
  BOOL isSet[MAXCOLORS];
  
  // data necessary for Xlib.
  Tk_Window tkwin;
  Display *display;
  Window xwin;
  Colormap cmap;
}

- (PixelValue *)map;
- (PixelValue)pixelValue: (Color)c;
- (BOOL)setColor: (Color)c ToName: (const char *)colorName;
- (BOOL)setColor: (Color)c ToGrey: (double)g;
- (BOOL)setColor: (Color)c ToRed: (double)r Green: (double)g Blue: (double)b;
- (PixelValue)white;
- (PixelValue)black;
- (BOOL)colorIsSet: (Color)c;

@@end
@


1.6
log
@* tkobjc.m: Include internal.h and gui.h.  Don't include
tkobjc/TkExtra.h Define globalTkInterp to conform to the TkExtra
protocol.
(initTkObjc): Constify argv.  Use tkobjc_initTclInterp and
tkobjc_initTkInterp.  Set Colormap to XColormap.

* global.h: Make globalTkInterp extern conform to TkExtra
protocol, declared immediately above.  Constify argv argument to
initTkObjc declaration.

* common.m: Include defobj.h and tk.h.
(tkobjc_dragAndDropTarget, dragAndDropTargetArg,
oldSetupDragAndDrop, newSetupDragAndDrop, oldSetupDragAndDropArg,
newSetupDragAndDropArg, tkobjc_bindButton3ToSpawn,
tkobjc_bindButton3ToArgSpawn): Use getObjectName method instead of
tclObjc_objectToName.
(tkobjc_drag_and_drop_object): Use getObjectNamed function instead
of tclObjc_nameToObject.

* common.h: Use #include <objc/objc.h>, not #import <objc/objc.h>.

* ZoomRaster.m: Don't include string.h, stdio.h, stdlib.h,
tclObjc.h, tkobjc/TkExtra.h, or X11/Xutil.h.  Include
internal.h. Reformatting throughout.

* XPixmap.m ([XPixmap -setFile:]): Include internal.h.
Don't include tkobjc/TkExtra.h or X11/xpm.h.
([XPixmap -createEnd]): Use tkobjc_nameToWindow.

* XPixmap.h: Include gui.h.  Don't include tk.h.

* XColormap.m: Don't include TkInterp.h.  Include gui.h.
([XColormap -map]): Return PixelValue, again.
([XColormap -pixelValue:]): Likewise.
([XColormap -setColor:ToName:]): Use Color not GUI_Color.
([XColormap -setColor:ToRed:Green:Blue:]): Likewise.
([XColormap -setColor:ToGrey:]): Likewise.
([XColormap -white]): Return PixelValue, not GUI_PixelValue.
([XColormap -black]): Likewise.
([XColormap -colorIsSet:]): Take Color as argument, not GUI_Color.

* XColormap.h: Don't provide typedefs for PixelValue or Color,
they come from gui.h now.  map, pixelValue:, white, and black return
a PixelValue again.  The setColor methods and colorIsSet: once
again use PixelValue, not GUI_PixelValue.

* TkExtra.h: Don't include tk.h.

* SuperButton.m: Don't include tclObjc.h, tkobjc/common.h, stdlib.h,
or string.h.
(tkobjc_configureWidgetToPackBeforeAndFillLeftThenDisableAndResize):
Don't use tclObjc_objectToName, use getObjectName.

* Raster.m: Don't include string.h, stdio.h, stdlib.h, tclObjc.h,
or TkInterp.h.  Include internal.h.
([Raster -createEnd]): Use tkobjc_nameToWindow.
([Raster -setButton:Client:Message:]): Use ButtonLeft/Middle/Right
symbols instead of integers in case statement.
([Raster -handleButton:X:Y:]): Likewise.

* Raster.h: Don't include tk.h, or XColormap.h.  Don't
define ButtonLeft, ButtonMiddle, or ButtonRight, they come
from gui.h now.  Include internal.h.  Minor reformatting.

* Makefile (OBJECTS,HEADERS): Add internal.
(internal.o): Add.

* InputWidget.m:  Include internal.h.  Don't include TkInterp.h,
stding.h, or stdio.h.
([InputWidget -linkVariable:Type:]): Use tkobjc_unlinkVar and
tkobjc_linkVar.

* internal.[hm]:  New files.  These routines encapsulate
sorts of interpreter access only used internally.  The header
file loads X headers files, but keeps Colormap free.
@
text
@@


1.5
log
@Provide support for eliminating all use of Tk outside of this library.

* ClassDisplayHideButton.[hm], CompleteProbeDisplayLabel.[hm],
MessageProbeEntry.[hm], ProbeCanvas.[hm],
SimpleProbeDisplayHideButton.[hm],
SuperButton.[hm],VarProbeEntry.[hm]: New classes to encapsulate
tkobjc_* functionality and give some explict semantics.

* Histogram.[hm]:  Renamed from Histo.[hm].

* tkobjc.m (registerInterp): New static function.
(initTkObjc): Use registerInterp instead of
tkobjc_registerCommand.

* tkobjc.h: Use Histogram.h instead of Histo.h.
Add ClassDisplayHideButton.h, SimpleProbeDisplayHideButton.h,
SuperButton.h, MessageProbeEntry.h, VarProbeEntry.h, ProbeCanvas.h.
Drop DragDrop.h.

* common.[hm]: Add (remaining tkobjc_* routines from control).

* control.[hm], DragDrop.[hm]:  Remove.

* ZoomRaster.h: Reformatting throughout.

* XColormap.m ([XColormap -map], [XColormap -pixelValue:],
[XColormap -white], [XColormap -black]): Use GUI_PixelValue for
return type.
([XColormap -setColor:ToName:], [XColormap -colorIsSet:]): Use
GUI_Color for first argument.
([XColormap -setColor:ToRed:Green:Blue:]): Likewise.
([XColormap -setColor:ToGrey:]): Likewise.

* XColormap.h: Include <gui.h>
Make XColormap conform to <Colormap>.
Use GUI_PixelValue for map, pixelValue, white, black methods.
Use GUI_Color for pixelValue for colorIsSet: and setColor methods.

* Widget.m: Don't include string.h, stdio.h, stdlib.h, stdarg.h,
tclObjc.h, and TkInterp.h.  Include tkobjc/common.h.
([Widget -createEnd]): Use new method setWidgetNameFromParent:
instead of makeNameFromParentName:.
([Widget -pack]): Use tclobjc_pack instead of calling
globalTkInterp directly.
(makeWidgetName): New static function (functionality of
makeNameFromParentName).
([Widget -makeWidgetNameFor:], [Widget -setWidgetNameFromParent:],
[Widget -setWidgetNameFromParentName:], [Widget -packToRight:],
[Widget -packBeforeAndFillLeft:expand:],
[Widget -packFillLeft:], [Widget -packFill], [Widget
-packForgetAndExpand], [Widget -setActiveFlag:], [Widget
-enableRelief], [Widget -setBorderWidth:], [Widget
-setupWindowEntryColor], [Widget -setupWindowExitColor], [Widget
-focus]): New methods for tkobjc_* functionality.

* Widget.h: New methods packToRight:,
packBeforeAndFillLeft:expand:, packFillleft:, packFill,
packForgetAndExpand, setActiveFlag:, enableRelief,
setBorderWidth:, setupWindowEntryColor, setupWindowExitColor,
focus, setWidgetNameFromParent:, setWidgetNameFromParentName:,
makeWidgetNameFor:.

* Raster.m ([Raster -getColormap]): Return id <Colormap>.
([Raster -setColormap:]): Take id <Colormap>.

* Raster.h: Include gui.h.
(Raster): Make colormap an id conforming to Colormap protocol
not a XColormap *.
getColormap now returns a id <Colormap>.
setColormap takes a id <Colormap>.
drawPointX:Y:Color:, fillRectangleX0:Y0:X1:Color:  Use GUI_Color.

* Makefile (OBJECTS, HEADERS): Add ClassDisplayHideButton,
SimpleProbeDisplayHideButton, SuperButton, MessageProbeEntry,
VarProbeEntry, CompleteProbeDisplayLabel, ProbeCanvas, and common.
Drop DragDrop and control.  Change Histo to Histogram.
(OTHERCLEAN): Change testHisto to testHistogram.
(testHistogram): Change from testHisto.
(Histogram.o): Replaces Histo.o.
(DragDrop.o, control.o): Drop.
(ClassDisplayHideButton.o, SimpleProbeDisplayHideButton.o,
SuperButton.o, MessageProbeEntry.o, VarProbeEntry.o,
ProbeCanvas.o, common.o): Add.

* Label.m ([Label -anchorEast], [Label -anchorWest], [Label
-colorBlue]): New methods to replace tkobjc_* functionality.

* Label.h: Declare new methods anchorEast, anchorWest, and colorBlue.

* Frame.m: Don't include string.h, stdio.h, stdlib.h, or
TkInterp.h.  Include tkobjc/common.h.
([Frame -createEnd]): Use new method setWidgetNameFromParentName
instead of removed makeNameFromParentName.
([Frame -createEnd]): Use tkobjc_makeFrame to create a frame
instead of calling globalTkInterp directly.
([Frame -assertPosition], [Frame -assertGeometry], [Frame
-withdraw], [Frame -deiconify]): New methods replace tkobjc_*
functionality.

* Frame.h: Declare new methods assertGeometry, assertPosition,
withdraw, and deiconify.

* Entry.m: Reformatting throughout.

* Entry.h: Declare createEnd, setValue:, and setWidth:.

* CompositeItem.h: Reformatting throughout.

* ButtonPanel.m: Don't include tclObjc.h or TkInterp.h.
([ButtonPanel -setButtonTarget:]): New method, drop
setTargetName.
([ButtonPanel -addButtonName:actionName:]): Use targetName
instead of defaultTargetName.

* ButtonPanel.h: New method setButtonTarget:.
(ButtonPanel): Rename instance variable defaultTargetName to
targetName.  Drop setTargetName.

* Button.m ([Button -createEnd]): Don't include tclObjc.h or
TkInterp.h.
([Button -setButtonTarget:method:]): New method.

* Button.h: Declare new method setButtonTarget:.

* BLTGraph.m ([BLTGraph -setTitle:]): Rename from title:.
([BLTGraph -setAxisLabelsX:Y:]): Rename from axisLabelsX:Y:.

* BLTGraph.h: Rename title: to setTitle: and axisLabelsX:Y:
to setAxisLabelsX:Y:.
@
text
@a23 3
typedef unsigned long PixelValue;
typedef unsigned char Color;

d38 8
a45 8
- (GUI_PixelValue *)map;
- (GUI_PixelValue)pixelValue: (GUI_Color)c;
- (BOOL)setColor: (GUI_Color)c ToName: (const char *)colorName;
- (BOOL)setColor: (GUI_Color)c ToGrey: (double)g;
- (BOOL)setColor: (GUI_Color)c ToRed: (double)r Green: (double)g Blue: (double)b;
- (GUI_PixelValue)white;
- (GUI_PixelValue)black;
- (BOOL)colorIsSet: (GUI_Color)c;
@


1.4
log
@Update copyright year.
@
text
@d20 1
d27 1
a27 1
@@interface XColormap : CreateDrop
d41 8
a48 8
- (PixelValue *) map;
- (PixelValue)pixelValue: (Color)c;
- (BOOL)setColor: (Color)c ToName: (const char *)colorName;
- (BOOL)setColor: (Color)c ToGrey: (double)g;
- (BOOL)setColor: (Color)c ToRed: (double)r Green: (double)g Blue: (double)b;
- (PixelValue)white;
- (PixelValue)black;
- (BOOL) colorIsSet: (Color)c;
@


1.3
log
@* XPixmap.m ([XPixmap -setFile:]): Constify argument.
Reformatting throughout.

* XPixmap.h (XPixmap): Constify filename.
Constify argument to setFile.
Reformatting throughout.

* XColormap.m ([XColormap -setColor:ToName:]): Constify ToName
argument.  Reformatting throughout.

* XColormap.h: Constify ToName argument to setColor.
Reformatting throughout.

* Form.m ([Form -addLineName:Variable:Type:]): Constify first
argument.  Reformatting throughout.

* Form.h: Constify first argument to addLineName.
Reformatting throughout.

* CanvasItem.m: Reformatting throughout.

* CanvasItem.h (CanvasItem): Constify item.
Reformatting throughout.
@
text
@d1 1
a1 1
// Swarm library. Copyright (C) 1996-1997 Santa Fe Institute.
@


1.2
log
@Changed Copyright notice to include this year. --gepr
@
text
@d26 2
a27 1
@@interface XColormap : CreateDrop {
d32 1
a32 1

d35 1
a35 1
  Display * display;
d40 8
a47 8
-(PixelValue *) map;
-(PixelValue) pixelValue: (Color) c;
-(BOOL) setColor: (Color) c ToName: (char *) colorName;
-(BOOL) setColor: (Color) c ToGrey: (double) g;
-(BOOL) setColor: (Color) c ToRed: (double) r Green: (double) g Blue: (double) b;
-(PixelValue) white;
-(PixelValue) black;
-(BOOL) colorIsSet: (Color) c;
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
// Swarm library. Copyright (C) 1996 Santa Fe Institute.
@


1.1.1.1
log
@Imported Swarm
@
text
@@
Results 1 - 1
Help - FTP Sites List - Software Dir.
Searching half a billion files worldwide
© 1997-2009 MARUHN Internet Solutions