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   
C/C++ Source or Header  |  1991-08-28  |  8KB  |  280 lines

  1. /*
  2.  * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
  3.  *     All Rights Reserved
  4.  * 
  5.  * This file is a component of an X Window System client which uses the Xcms 
  6.  * Color Management System.  TekColor is a trademark of Tektronix, Inc.  The
  7.  * TekColor Editor is the subject of U.S. and foreign patents pending.  The
  8.  * term "TekHVC" designates a particular color space that is the subject of
  9.  * U.S. Patent No. 4,985,853 (equivalent foreign patents pending).
  10.  * Permission is hereby granted to use, copy, modify, sell, and otherwise
  11.  * distribute this software and its documentation for the X Window System
  12.  * environment, for any purpose and without fee, provided that:
  13.  * 
  14.  * 1.    The code and documentation are only used to implement a 
  15.  *      TekColor Editor in an X Window System environment; and
  16.  * 2.    This copyright and permission notice is reproduced in all copies
  17.  *     of the code and in supporting documentation.
  18.  * 
  19.  * Permission is granted to modify this code as required to allow it to
  20.  * be compiled on any host computer, provided that the functionality of
  21.  * the TekColor Editor is not modified in any way.  A description of any 
  22.  * modifications must be sent to Tektronix, Inc.  Contact 
  23.  * Tektronix Inc., P.O. Box 1000, Mail Station 60-850, 
  24.  * Network Displays Division Engineering, Wilsonville, OR 97070.
  25.  *
  26.  * Tektronix makes no representation about the suitability of this software
  27.  * for any purpose.  It is provided "as is" and with all faults.
  28.  * 
  29.  * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
  30.  * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  31.  * PARTICULAR PURPOSE.  IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
  32.  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  33.  * RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF
  34.  * CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  35.  * CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
  36.  * 
  37.  *    NAME
  38.  *        xtici.h -- various shared stuff for the TekColor Editor
  39.  *
  40.  *    DESCRIPTION
  41.  *        
  42.  *
  43.  *    HISTORY
  44.  *
  45.  *    HISTORY END
  46.  *
  47.  */
  48.  
  49. #ifndef LINT
  50. #ifdef RCS_ID
  51. static char *rcsid=  "$Header: xtici.h,v 1.2 91/08/28 10:03:56 adamsc Exp $";
  52. #endif /* RCS_ID */
  53. #endif /* LINT */
  54.  
  55. #ifndef _XTICI_H_
  56. #define _XTICI_H_
  57.  
  58. #include <stdio.h>
  59. #include <ctype.h>
  60. #include <string.h>
  61. #include <X11/Xlib.h>
  62. #include <X11/Intrinsic.h>
  63. #include <X11/StringDefs.h>
  64. #include <X11/Xcms.h>
  65. #include "widgets/TekBox.h"
  66.  
  67. extern Display *dpy;
  68. extern XcmsCCC  pDefaultCCC;
  69. extern XVisualInfo visInfo;
  70. extern Colormap cmap;
  71. extern Atom changeMessage, markerProp;
  72. extern Cursor normalCursor, hvcCursor, waitCursor, grabCursor;
  73. extern Boolean selectionMine;
  74.  
  75. extern Widget primary;
  76. /* The children of the main interface widget */
  77. extern Widget colormap, huebar, leaf, patch, hvcShow, uvyShow, rgbShow;
  78.  
  79. /*
  80.  * Macros identifying each of the above widgets
  81.  */
  82. #define NoWidget    (-1)
  83. #define MenuWidget     MENUBAR
  84. #define ColormapWidget     COLORMAP
  85. #define PatchWidget     PATCH
  86. #define ShowWidget     COORDINATES
  87. #define HuebarWidget     HUEBAR
  88. #define LeafWidget     HUELEAF
  89. /* These three widgets lay within the ShowWidget */
  90. #define HvcWidget     6
  91. #define RgbWidget     7
  92. #define UvyWidget     8
  93.  
  94.  
  95. /*
  96.  * Hints which indicate which color component has changed
  97.  */
  98. /* RGB and uvY defines must be this; widget callback returned */
  99. #define RedChange    1
  100. #define GreenChange    2
  101. #define BlueChange    4
  102. #define UprimeChange    1
  103. #define VprimeChange    2
  104. #define CapYChange    4
  105. #define HueChange    1
  106. #define ValueChange    2
  107. #define ChromaChange    4
  108. #define ValueChromaChange 6
  109. #define AllChange    7
  110. #define UnknownChange    7
  111.  
  112. /* 
  113.  * The method to use to gamut compress
  114.  */
  115. #define NO_ADJUST        0
  116. #define DECREASE_CHROMA        1
  117.  
  118. #define GrabNone    0
  119. #define GrabUp        1
  120. #define GrabDown    2
  121. #define GrabPixel   4
  122. #define GrabImage   8
  123. #define GrabCell   16
  124. #define GrabMap       32
  125. extern int grabState;
  126.  
  127. /* This is the local clipboard color store.  */
  128. extern XcmsColor clipColor;
  129.  
  130. /* This is the current color in u'v'Y coordinates */
  131. extern XcmsCIEuvY currentUvy;
  132.  
  133. /* This is the current pixel value */
  134. extern Pixel currentIndex;
  135. extern XcmsColor *currentMap;
  136. extern int currentPatch;
  137. extern int mapSize;
  138. extern int maxMapSize;
  139. extern XcmsColor currentHvc;
  140. extern XColor currentRgb;
  141.  
  142. /*
  143.  * Track if the user is in the middle of a logical gesture:
  144.  * Dragging the mouse or entering text into a widget.
  145.  */
  146. #define GestureNone         0
  147. #define GestureMouse         1
  148. #define GestureHue         2
  149. #define GestureValue         3
  150. #define GestureChroma         4
  151. #define GestureRed         5
  152. #define GestureGreen         6
  153. #define GestureBlue         7
  154. #define GestureUprime         8
  155. #define GestureVprime         9
  156. #define GestureCapY        10
  157. #define GestureCell0        11
  158. #define GestureCell1        12
  159. extern int gesture;
  160.  
  161. extern char *versionString;
  162.  
  163. /* This should match the visual against what we have saved */
  164. #define VisualMapSize(v)    ((v)->map_entries)
  165.  
  166. #define EditedIndex(i) (edited[i/32] & (1 << (i%32)))
  167. #define MarkIndexEdited(i) (edited[i/32] |= (1 << (i%32)))
  168. #define ClearIndexEdited(i) (edited[i/32] &= ~(1 << (i%32)))
  169. extern int *edited;
  170.  
  171. #define HvcShowing  (showMask & (1 << HvcWidget))
  172. #define RgbShowing  (showMask & (1 << RgbWidget))
  173. #define UvyShowing  (showMask & (1 << UvyWidget))
  174. extern int showMask;
  175.  
  176. /* order of defines important, from least restrictive to most */
  177. #define FillAny        0
  178. #define FillLeaf    FillAny
  179. #define FillHuebar    1
  180. #define FillNone    2
  181. extern int allowFill;
  182.  
  183. #define HuebarEmpty    0
  184. #define HuebarConstant    1
  185. #define HuebarDynamic    2
  186. extern int huebarState;
  187.  
  188. #define LeafEmpty    0
  189. #define LeafFilled    1
  190. extern int leafState;
  191.  
  192. #define GamutCompValue   0
  193. #define GamutCompClosest 1
  194. #define GamutCompChroma  2
  195. extern int GamutComp;
  196.  
  197. #define ClampNone    0
  198. #define ClampMonitor    1
  199. extern int clampState;
  200.  
  201. extern int reqVisual;
  202.  
  203. extern int textProgramInput;
  204.  
  205. #define MessageContinue    0
  206. #define MessageOK    0
  207. #define MessageCancel    1
  208.  
  209. extern int Ask();
  210.  
  211. extern void BeginGesture();
  212.  
  213. extern void CacheCell();
  214. extern void ChangeHvcCells();
  215. extern void ConstrainColor();
  216. extern Pixel ConstrainIndex();
  217. extern void CopyColormap();
  218.  
  219. extern void EditHvcCells();
  220. extern void EditRgbCells();
  221. extern void EditUvyCells();
  222. extern Pixel *EditingIndexes();
  223. extern void EndColor();
  224. extern void EndIndex();
  225. extern void Error();
  226.  
  227. extern Pixel GetPatchIndex();
  228. extern void GetShowHvc();
  229. extern void GetShowRgb();
  230. extern void GetShowUvy();
  231.  
  232. extern void HandleUserMessage();
  233. extern void HuebarRangeLoad();
  234. extern void HuebarRangeRestore();
  235. extern void HuebarRangeSave();
  236. extern void HuebarRangeUpdate();
  237.  
  238. extern void InformMsg();
  239. extern Boolean IndexProtected();
  240. extern void InitSelection();
  241. /* implemented as a macro for convenience */
  242. #define IsBWIndex(i) (((i) == WhitePixel(dpy,visInfo.screen)) || ((i) == BlackPixel(dpy,visInfo.screen)))
  243. extern Boolean IsHuebarIndex();
  244. extern Boolean IsIfIndex();
  245. extern Boolean IsLeafIndex();
  246.  
  247. extern void LeafRangeRestore();
  248. extern void LeafRangeSave();
  249. extern void LeafRealize();
  250.  
  251. extern Pixmap MakeIcon();
  252.  
  253. extern void NewCellRange();
  254. extern void NewColor();
  255. extern void NewHuebarState();
  256. extern void NewHvc();
  257. extern void NewIndex();
  258. extern void NewLeafState();
  259. extern void NewRgb();
  260. extern void NewUvy();
  261.  
  262. extern void RegisterIfPixel();
  263.  
  264. extern void SetCursor();
  265. extern void SetFirstIndex();
  266. extern void SetLeafBase();
  267. extern void StoreAllocColors();
  268.  
  269. extern void TakeSelection();
  270. extern void TerminateGesture();
  271.  
  272. extern void UpdateHueWidget();
  273. extern void UpdateLeafWidget();
  274. extern void UpdatePatchWidget();
  275. extern void UpdateShowWidget();
  276.  
  277. extern int Warning();
  278.  
  279. #endif /* _XTICI_H_ */
  280.