Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:23

0001 /* $XConsortium: ColorP.h /main/4 1995/07/15 20:49:10 drk $ */
0002 /*
0003  * Motif
0004  *
0005  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
0006  *
0007  * These libraries and programs are free software; you can
0008  * redistribute them and/or modify them under the terms of the GNU
0009  * Lesser General Public License as published by the Free Software
0010  * Foundation; either version 2 of the License, or (at your option)
0011  * any later version.
0012  *
0013  * These libraries and programs are distributed in the hope that
0014  * they will be useful, but WITHOUT ANY WARRANTY; without even the
0015  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
0016  * PURPOSE. See the GNU Lesser General Public License for more
0017  * details.
0018  *
0019  * You should have received a copy of the GNU Lesser General Public
0020  * License along with these librararies and programs; if not, write
0021  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
0022  * Floor, Boston, MA 02110-1301 USA
0023  */
0024 /*
0025  * HISTORY
0026  */
0027 
0028 #ifndef _XmColorP_h
0029 #define _XmColorP_h
0030 
0031 #include <X11/Intrinsic.h>
0032 
0033 #ifdef __cplusplus
0034 extern "C" {
0035 #endif
0036 
0037 
0038 /* Default Color Allocation proc */
0039 
0040 #define DEFAULT_ALLOCCOLOR_PROC       (XAllocColor)
0041 
0042 /*  Defines and functions for processing dynamic defaults  */
0043 
0044 #define XmMAX_SHORT     65535
0045 
0046 #define XmCOLOR_PERCENTILE (XmMAX_SHORT / 100)
0047 #define BoundColor(value)\
0048     ((value < 0) ? 0 : (((value > XmMAX_SHORT) ? XmMAX_SHORT : value)))
0049 
0050 /* Contributions of each primary to overall luminosity, sum to 1.0 */
0051 
0052 #define XmRED_LUMINOSITY    0.30
0053 #define XmGREEN_LUMINOSITY  0.59
0054 #define XmBLUE_LUMINOSITY   0.11
0055 
0056 /* Percent effect of intensity, light, and luminosity & on brightness,
0057    sum to 100 */
0058 
0059 #define XmINTENSITY_FACTOR  75
0060 #define XmLIGHT_FACTOR       0
0061 #define XmLUMINOSITY_FACTOR 25
0062 
0063 /* LITE color model
0064    percent to interpolate RGB towards black for SEL, BS, TS */
0065 
0066 #define XmCOLOR_LITE_SEL_FACTOR  15
0067 #define XmCOLOR_LITE_BS_FACTOR   40
0068 #define XmCOLOR_LITE_TS_FACTOR   20
0069 
0070 /* DARK color model
0071    percent to interpolate RGB towards white for SEL, BS, TS */
0072 
0073 #define XmCOLOR_DARK_SEL_FACTOR  15
0074 #define XmCOLOR_DARK_BS_FACTOR   30
0075 #define XmCOLOR_DARK_TS_FACTOR   50
0076 
0077 /* STD color model
0078    percent to interpolate RGB towards black for SEL, BS
0079    percent to interpolate RGB towards white for TS
0080    HI values used for high brightness (within STD)
0081    LO values used for low brightness (within STD)
0082    Interpolate factors between HI & LO values based on brightness */
0083 
0084 #define XmCOLOR_HI_SEL_FACTOR  15
0085 #define XmCOLOR_HI_BS_FACTOR   40
0086 #define XmCOLOR_HI_TS_FACTOR   60
0087 
0088 #define XmCOLOR_LO_SEL_FACTOR  15
0089 #define XmCOLOR_LO_BS_FACTOR   60
0090 #define XmCOLOR_LO_TS_FACTOR   50
0091 
0092 
0093 /* For the default color calculation and caching */
0094 
0095 #define XmLOOK_AT_SCREEN          (1<<0)
0096 #define XmLOOK_AT_CMAP            (1<<1)
0097 #define XmLOOK_AT_BACKGROUND      (1<<2)
0098 #define XmLOOK_AT_FOREGROUND      (1<<3)
0099 #define XmLOOK_AT_TOP_SHADOW      (1<<4)
0100 #define XmLOOK_AT_BOTTOM_SHADOW   (1<<5)
0101 #define XmLOOK_AT_SELECT          (1<<6)
0102 
0103 #define XmBACKGROUND     ((unsigned char) (1<<0))
0104 #define XmFOREGROUND     ((unsigned char) (1<<1))
0105 #define XmTOP_SHADOW     ((unsigned char) (1<<2))
0106 #define XmBOTTOM_SHADOW  ((unsigned char) (1<<3))
0107 #define XmSELECT         ((unsigned char) (1<<4))
0108 #define XmHIGHLIGHT      ((unsigned char) (1<<5))
0109 
0110 /*  Structure used to hold color schemes  */
0111 typedef struct _XmColorData
0112 {  Screen * screen;
0113    Colormap color_map;
0114    unsigned char allocated;
0115    XColor background;
0116    XColor foreground;
0117    XColor top_shadow;
0118    XColor bottom_shadow;
0119    XColor select;
0120 } XmColorData;
0121 
0122 #ifdef __cplusplus
0123 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0124 #endif
0125 
0126 
0127 #endif /* _ColorP_h */
0128 /* DON'T ADD STUFF AFTER THIS #endif */