Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* $XConsortium: ColorObjP.h /main/10 1996/12/16 18:30:49 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 /*
0026  * HISTORY
0027  */
0028 #ifndef _XmColorObjP_h
0029 #define _XmColorObjP_h
0030 
0031 #include <Xm/VendorSP.h>
0032 
0033 #ifdef __cplusplus
0034 extern "C" {
0035 #endif
0036 
0037 /** misc structures, defines, and functions for using ColorObj **/
0038 
0039 #define XmCO_MAX_NUM_COLORS  8
0040 #define XmCO_NUM_COLORS      XmCO_MAX_NUM_COLORS
0041 #define XmPIXEL_SET_PROP_VERSION '1'
0042 
0043 /* Constants for color usage */
0044 enum { XmCO_BLACK_WHITE, XmCO_LOW_COLOR, XmCO_MEDIUM_COLOR, XmCO_HIGH_COLOR };
0045 
0046 typedef struct {
0047     Pixel fg;
0048     Pixel bg;
0049     Pixel ts;
0050     Pixel bs;
0051     Pixel sc;
0052 } XmPixelSet;
0053 
0054 typedef XmPixelSet Colors[XmCO_NUM_COLORS];
0055 
0056 typedef struct _XmColorObjPart {
0057     XtArgsProc          RowColInitHook;
0058     XmPixelSet          *myColors;     /* colors for my (application) screen */
0059     int                 myScreen;
0060     Display             *display;     /* display connection for "pseudo-app" */
0061     Colors          *colors;      /* colors per screen for workspace mgr */
0062     int                 numScreens;   /*               for workspace manager */
0063     Atom            *atoms;       /* to identify colorsrv screen numbers */
0064     Boolean             colorIsRunning;   /* used for any color problem      */
0065     Boolean             done;
0066     int             *colorUse;
0067     int                 primary;
0068     int                 secondary;
0069     int                 text;          /* color set id for text widgets */
0070     int                 active;
0071     int                 inactive;
0072     Boolean             useColorObj;  /* read only resource variable */
0073     Boolean             useText;        /* use text color set id for text? */
0074     Boolean             useTextForList; /* use text color set id for lists? */
0075     
0076     Boolean     useMask;
0077     Boolean     useMultiColorIcons;
0078     Boolean     useIconFileCache;
0079 
0080 } XmColorObjPart;
0081 
0082 
0083 typedef struct _XmColorObjRec {
0084     CorePart        core;
0085     CompositePart   composite;
0086     ShellPart       shell;
0087     WMShellPart     wm;
0088     XmColorObjPart  color_obj;
0089 } XmColorObjRec;
0090 
0091 typedef struct _XmColorObjClassPart {
0092     XtPointer        extension;
0093 } XmColorObjClassPart;
0094 
0095 /* 
0096  * we make it a appShell subclass so it can have it's own instance
0097  * hierarchy
0098  */
0099 typedef struct _XmColorObjClassRec{
0100     CoreClassPart           core_class;
0101     CompositeClassPart      composite_class;
0102     ShellClassPart          shell_class;
0103     WMShellClassPart        wm_shell_class;
0104     XmColorObjClassPart     color_obj_class;
0105 } XmColorObjClassRec;
0106 
0107 
0108 externalref XmColorObjClassRec xmColorObjClassRec;
0109 
0110 
0111 #ifndef XmIsColorObj
0112 #define XmIsColorObj(w) (XtIsSubclass(w, xmColorObjClass))
0113 #endif /* XmIsXmDisplay */
0114 
0115 externalref WidgetClass  xmColorObjClass;
0116 typedef struct _XmColorObjClassRec *XmColorObjClass;
0117 typedef struct _XmColorObjRec      *XmColorObj;
0118 
0119 
0120 #define  XmCO_DitherTopShadow(display, screen, pixelSet) \
0121                         ((pixelSet)->bs == BlackPixel((display), (screen)))
0122 
0123 #define  XmCO_DitherBottomShadow(display, screen, pixelSet) \
0124                         ((pixelSet)->ts == WhitePixel((display), (screen)))
0125 
0126 #define  XmCO_DITHER     XmS50_foreground
0127 #define  XmCO_NO_DITHER  XmSunspecified_pixmap
0128 
0129 
0130 /********    Private Function Declarations    ********/
0131 
0132 extern Boolean XmeGetIconControlInfo( 
0133                         Screen *screen,
0134                         Boolean *useMaskRtn,
0135                         Boolean *useMultiColorIconsRtn,
0136                         Boolean *useIconFileCacheRtn) ;
0137 
0138 extern Boolean XmeUseColorObj( void ) ;
0139 
0140 
0141 extern Boolean XmeGetColorObjData(
0142                    Screen * screen,
0143                    int *colorUse,
0144            XmPixelSet *pixelSet,
0145            unsigned short num_pixelSet,
0146            short *active_id,
0147            short *inactive_id,
0148            short *primary_id,
0149            short *secondary_id,
0150            short *text_id) ;
0151 
0152 extern Boolean XmeGetDesktopColorCells (
0153                          Screen * screen, 
0154              Colormap colormap, 
0155              XColor * colors,  
0156              int n_colors,     
0157              int * ncolors_returns) ;
0158 
0159 extern Boolean XmeGetPixelData (
0160             int screen_number,
0161             int *colorUse,
0162             XmPixelSet *pixelSet,
0163             short *a,
0164             short *i,
0165             short *p,
0166             short *s) ;
0167 
0168 /********    End Private Function Declarations    ********/
0169 
0170 
0171 #ifdef __cplusplus
0172 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0173 #endif
0174 
0175 #endif /* _XmColorObjP_h */
0176