home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
x
/
xtici.zip
/
xtici
/
xtici.h
< prev
Wrap
C/C++ Source or Header
|
1991-08-28
|
8KB
|
280 lines
/*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved
*
* This file is a component of an X Window System client which uses the Xcms
* Color Management System. TekColor is a trademark of Tektronix, Inc. The
* TekColor Editor is the subject of U.S. and foreign patents pending. The
* term "TekHVC" designates a particular color space that is the subject of
* U.S. Patent No. 4,985,853 (equivalent foreign patents pending).
* Permission is hereby granted to use, copy, modify, sell, and otherwise
* distribute this software and its documentation for the X Window System
* environment, for any purpose and without fee, provided that:
*
* 1. The code and documentation are only used to implement a
* TekColor Editor in an X Window System environment; and
* 2. This copyright and permission notice is reproduced in all copies
* of the code and in supporting documentation.
*
* Permission is granted to modify this code as required to allow it to
* be compiled on any host computer, provided that the functionality of
* the TekColor Editor is not modified in any way. A description of any
* modifications must be sent to Tektronix, Inc. Contact
* Tektronix Inc., P.O. Box 1000, Mail Station 60-850,
* Network Displays Division Engineering, Wilsonville, OR 97070.
*
* Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults.
*
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF
* CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
*
* NAME
* xtici.h -- various shared stuff for the TekColor Editor
*
* DESCRIPTION
*
*
* HISTORY
*
* HISTORY END
*
*/
#ifndef LINT
#ifdef RCS_ID
static char *rcsid= "$Header: xtici.h,v 1.2 91/08/28 10:03:56 adamsc Exp $";
#endif /* RCS_ID */
#endif /* LINT */
#ifndef _XTICI_H_
#define _XTICI_H_
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Xcms.h>
#include "widgets/TekBox.h"
extern Display *dpy;
extern XcmsCCC pDefaultCCC;
extern XVisualInfo visInfo;
extern Colormap cmap;
extern Atom changeMessage, markerProp;
extern Cursor normalCursor, hvcCursor, waitCursor, grabCursor;
extern Boolean selectionMine;
extern Widget primary;
/* The children of the main interface widget */
extern Widget colormap, huebar, leaf, patch, hvcShow, uvyShow, rgbShow;
/*
* Macros identifying each of the above widgets
*/
#define NoWidget (-1)
#define MenuWidget MENUBAR
#define ColormapWidget COLORMAP
#define PatchWidget PATCH
#define ShowWidget COORDINATES
#define HuebarWidget HUEBAR
#define LeafWidget HUELEAF
/* These three widgets lay within the ShowWidget */
#define HvcWidget 6
#define RgbWidget 7
#define UvyWidget 8
/*
* Hints which indicate which color component has changed
*/
/* RGB and uvY defines must be this; widget callback returned */
#define RedChange 1
#define GreenChange 2
#define BlueChange 4
#define UprimeChange 1
#define VprimeChange 2
#define CapYChange 4
#define HueChange 1
#define ValueChange 2
#define ChromaChange 4
#define ValueChromaChange 6
#define AllChange 7
#define UnknownChange 7
/*
* The method to use to gamut compress
*/
#define NO_ADJUST 0
#define DECREASE_CHROMA 1
#define GrabNone 0
#define GrabUp 1
#define GrabDown 2
#define GrabPixel 4
#define GrabImage 8
#define GrabCell 16
#define GrabMap 32
extern int grabState;
/* This is the local clipboard color store. */
extern XcmsColor clipColor;
/* This is the current color in u'v'Y coordinates */
extern XcmsCIEuvY currentUvy;
/* This is the current pixel value */
extern Pixel currentIndex;
extern XcmsColor *currentMap;
extern int currentPatch;
extern int mapSize;
extern int maxMapSize;
extern XcmsColor currentHvc;
extern XColor currentRgb;
/*
* Track if the user is in the middle of a logical gesture:
* Dragging the mouse or entering text into a widget.
*/
#define GestureNone 0
#define GestureMouse 1
#define GestureHue 2
#define GestureValue 3
#define GestureChroma 4
#define GestureRed 5
#define GestureGreen 6
#define GestureBlue 7
#define GestureUprime 8
#define GestureVprime 9
#define GestureCapY 10
#define GestureCell0 11
#define GestureCell1 12
extern int gesture;
extern char *versionString;
/* This should match the visual against what we have saved */
#define VisualMapSize(v) ((v)->map_entries)
#define EditedIndex(i) (edited[i/32] & (1 << (i%32)))
#define MarkIndexEdited(i) (edited[i/32] |= (1 << (i%32)))
#define ClearIndexEdited(i) (edited[i/32] &= ~(1 << (i%32)))
extern int *edited;
#define HvcShowing (showMask & (1 << HvcWidget))
#define RgbShowing (showMask & (1 << RgbWidget))
#define UvyShowing (showMask & (1 << UvyWidget))
extern int showMask;
/* order of defines important, from least restrictive to most */
#define FillAny 0
#define FillLeaf FillAny
#define FillHuebar 1
#define FillNone 2
extern int allowFill;
#define HuebarEmpty 0
#define HuebarConstant 1
#define HuebarDynamic 2
extern int huebarState;
#define LeafEmpty 0
#define LeafFilled 1
extern int leafState;
#define GamutCompValue 0
#define GamutCompClosest 1
#define GamutCompChroma 2
extern int GamutComp;
#define ClampNone 0
#define ClampMonitor 1
extern int clampState;
extern int reqVisual;
extern int textProgramInput;
#define MessageContinue 0
#define MessageOK 0
#define MessageCancel 1
extern int Ask();
extern void BeginGesture();
extern void CacheCell();
extern void ChangeHvcCells();
extern void ConstrainColor();
extern Pixel ConstrainIndex();
extern void CopyColormap();
extern void EditHvcCells();
extern void EditRgbCells();
extern void EditUvyCells();
extern Pixel *EditingIndexes();
extern void EndColor();
extern void EndIndex();
extern void Error();
extern Pixel GetPatchIndex();
extern void GetShowHvc();
extern void GetShowRgb();
extern void GetShowUvy();
extern void HandleUserMessage();
extern void HuebarRangeLoad();
extern void HuebarRangeRestore();
extern void HuebarRangeSave();
extern void HuebarRangeUpdate();
extern void InformMsg();
extern Boolean IndexProtected();
extern void InitSelection();
/* implemented as a macro for convenience */
#define IsBWIndex(i) (((i) == WhitePixel(dpy,visInfo.screen)) || ((i) == BlackPixel(dpy,visInfo.screen)))
extern Boolean IsHuebarIndex();
extern Boolean IsIfIndex();
extern Boolean IsLeafIndex();
extern void LeafRangeRestore();
extern void LeafRangeSave();
extern void LeafRealize();
extern Pixmap MakeIcon();
extern void NewCellRange();
extern void NewColor();
extern void NewHuebarState();
extern void NewHvc();
extern void NewIndex();
extern void NewLeafState();
extern void NewRgb();
extern void NewUvy();
extern void RegisterIfPixel();
extern void SetCursor();
extern void SetFirstIndex();
extern void SetLeafBase();
extern void StoreAllocColors();
extern void TakeSelection();
extern void TerminateGesture();
extern void UpdateHueWidget();
extern void UpdateLeafWidget();
extern void UpdatePatchWidget();
extern void UpdateShowWidget();
extern int Warning();
#endif /* _XTICI_H_ */