Blame lib/Xm/ColorObjP.h

Packit b099d7
/* $XConsortium: ColorObjP.h /main/10 1996/12/16 18:30:49 drk $ */
Packit b099d7
/*
Packit b099d7
 * Motif
Packit b099d7
 *
Packit b099d7
 * Copyright (c) 1987-2012, The Open Group. All rights reserved.
Packit b099d7
 *
Packit b099d7
 * These libraries and programs are free software; you can
Packit b099d7
 * redistribute them and/or modify them under the terms of the GNU
Packit b099d7
 * Lesser General Public License as published by the Free Software
Packit b099d7
 * Foundation; either version 2 of the License, or (at your option)
Packit b099d7
 * any later version.
Packit b099d7
 *
Packit b099d7
 * These libraries and programs are distributed in the hope that
Packit b099d7
 * they will be useful, but WITHOUT ANY WARRANTY; without even the
Packit b099d7
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
Packit b099d7
 * PURPOSE. See the GNU Lesser General Public License for more
Packit b099d7
 * details.
Packit b099d7
 *
Packit b099d7
 * You should have received a copy of the GNU Lesser General Public
Packit b099d7
 * License along with these librararies and programs; if not, write
Packit b099d7
 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Packit b099d7
 * Floor, Boston, MA 02110-1301 USA
Packit b099d7
 * 
Packit b099d7
 */
Packit b099d7
/*
Packit b099d7
 * HISTORY
Packit b099d7
 */
Packit b099d7
#ifndef _XmColorObjP_h
Packit b099d7
#define _XmColorObjP_h
Packit b099d7
Packit b099d7
#include <Xm/VendorSP.h>
Packit b099d7
Packit b099d7
#ifdef __cplusplus
Packit b099d7
extern "C" {
Packit b099d7
#endif
Packit b099d7
Packit b099d7
/** misc structures, defines, and functions for using ColorObj **/
Packit b099d7
Packit b099d7
#define XmCO_MAX_NUM_COLORS	 8
Packit b099d7
#define XmCO_NUM_COLORS		 XmCO_MAX_NUM_COLORS
Packit b099d7
#define XmPIXEL_SET_PROP_VERSION '1'
Packit b099d7
Packit b099d7
/* Constants for color usage */
Packit b099d7
enum { XmCO_BLACK_WHITE, XmCO_LOW_COLOR, XmCO_MEDIUM_COLOR, XmCO_HIGH_COLOR };
Packit b099d7
Packit b099d7
typedef struct {
Packit b099d7
    Pixel fg;
Packit b099d7
    Pixel bg;
Packit b099d7
    Pixel ts;
Packit b099d7
    Pixel bs;
Packit b099d7
    Pixel sc;
Packit b099d7
} XmPixelSet;
Packit b099d7
Packit b099d7
typedef XmPixelSet Colors[XmCO_NUM_COLORS];
Packit b099d7
Packit b099d7
typedef struct _XmColorObjPart {
Packit b099d7
    XtArgsProc          RowColInitHook;
Packit b099d7
    XmPixelSet       	*myColors;     /* colors for my (application) screen */
Packit b099d7
    int             	myScreen;
Packit b099d7
    Display             *display;     /* display connection for "pseudo-app" */
Packit b099d7
    Colors         	*colors;      /* colors per screen for workspace mgr */
Packit b099d7
    int             	numScreens;   /*               for workspace manager */
Packit b099d7
    Atom           	*atoms;       /* to identify colorsrv screen numbers */
Packit b099d7
    Boolean         	colorIsRunning;   /* used for any color problem      */
Packit b099d7
    Boolean         	done;
Packit b099d7
    int            	*colorUse;
Packit b099d7
    int             	primary;
Packit b099d7
    int             	secondary;
Packit b099d7
    int             	text;          /* color set id for text widgets */
Packit b099d7
    int             	active;
Packit b099d7
    int             	inactive;
Packit b099d7
    Boolean         	useColorObj;  /* read only resource variable */
Packit b099d7
    Boolean             useText;        /* use text color set id for text? */
Packit b099d7
    Boolean             useTextForList; /* use text color set id for lists? */
Packit b099d7
    
Packit b099d7
    Boolean		useMask;
Packit b099d7
    Boolean		useMultiColorIcons;
Packit b099d7
    Boolean		useIconFileCache;
Packit b099d7
Packit b099d7
} XmColorObjPart;
Packit b099d7
Packit b099d7
Packit b099d7
typedef struct _XmColorObjRec {
Packit b099d7
    CorePart 		core;
Packit b099d7
    CompositePart 	composite;
Packit b099d7
    ShellPart 		shell;
Packit b099d7
    WMShellPart		wm;
Packit b099d7
    XmColorObjPart	color_obj;
Packit b099d7
} XmColorObjRec;
Packit b099d7
Packit b099d7
typedef struct _XmColorObjClassPart {
Packit b099d7
    XtPointer        extension;
Packit b099d7
} XmColorObjClassPart;
Packit b099d7
Packit b099d7
/* 
Packit b099d7
 * we make it a appShell subclass so it can have it's own instance
Packit b099d7
 * hierarchy
Packit b099d7
 */
Packit b099d7
typedef struct _XmColorObjClassRec{
Packit b099d7
    CoreClassPart      		core_class;
Packit b099d7
    CompositeClassPart 		composite_class;
Packit b099d7
    ShellClassPart  		shell_class;
Packit b099d7
    WMShellClassPart   		wm_shell_class;
Packit b099d7
    XmColorObjClassPart		color_obj_class;
Packit b099d7
} XmColorObjClassRec;
Packit b099d7
Packit b099d7
Packit b099d7
externalref XmColorObjClassRec xmColorObjClassRec;
Packit b099d7
Packit b099d7
Packit b099d7
#ifndef XmIsColorObj
Packit b099d7
#define XmIsColorObj(w) (XtIsSubclass(w, xmColorObjClass))
Packit b099d7
#endif /* XmIsXmDisplay */
Packit b099d7
Packit b099d7
externalref WidgetClass  xmColorObjClass;
Packit b099d7
typedef struct _XmColorObjClassRec *XmColorObjClass;
Packit b099d7
typedef struct _XmColorObjRec      *XmColorObj;
Packit b099d7
Packit b099d7
Packit b099d7
#define  XmCO_DitherTopShadow(display, screen, pixelSet) \
Packit b099d7
                        ((pixelSet)->bs == BlackPixel((display), (screen)))
Packit b099d7
Packit b099d7
#define  XmCO_DitherBottomShadow(display, screen, pixelSet) \
Packit b099d7
                        ((pixelSet)->ts == WhitePixel((display), (screen)))
Packit b099d7
Packit b099d7
#define  XmCO_DITHER     XmS50_foreground
Packit b099d7
#define  XmCO_NO_DITHER  XmSunspecified_pixmap
Packit b099d7
Packit b099d7
Packit b099d7
/********    Private Function Declarations    ********/
Packit b099d7
Packit b099d7
extern Boolean XmeGetIconControlInfo( 
Packit b099d7
                        Screen *screen,
Packit b099d7
                        Boolean *useMaskRtn,
Packit b099d7
                        Boolean *useMultiColorIconsRtn,
Packit b099d7
                        Boolean *useIconFileCacheRtn) ;
Packit b099d7
Packit b099d7
extern Boolean XmeUseColorObj( void ) ;
Packit b099d7
Packit b099d7
Packit b099d7
extern Boolean XmeGetColorObjData(
Packit b099d7
                   Screen * screen,
Packit b099d7
                   int *colorUse,
Packit b099d7
		   XmPixelSet *pixelSet,
Packit b099d7
		   unsigned short num_pixelSet,
Packit b099d7
		   short *active_id,
Packit b099d7
		   short *inactive_id,
Packit b099d7
		   short *primary_id,
Packit b099d7
		   short *secondary_id,
Packit b099d7
		   short *text_id) ;
Packit b099d7
Packit b099d7
extern Boolean XmeGetDesktopColorCells (
Packit b099d7
                         Screen * screen, 
Packit b099d7
			 Colormap colormap, 
Packit b099d7
			 XColor * colors,  
Packit b099d7
			 int n_colors,     
Packit b099d7
			 int * ncolors_returns) ;
Packit b099d7
Packit b099d7
extern Boolean XmeGetPixelData (
Packit b099d7
			int screen_number,
Packit b099d7
			int *colorUse,
Packit b099d7
			XmPixelSet *pixelSet,
Packit b099d7
			short *a,
Packit b099d7
			short *i,
Packit b099d7
			short *p,
Packit b099d7
			short *s) ;
Packit b099d7
Packit b099d7
/********    End Private Function Declarations    ********/
Packit b099d7
Packit b099d7
Packit b099d7
#ifdef __cplusplus
Packit b099d7
}  /* Close scope of 'extern "C"' declaration which encloses file. */
Packit b099d7
#endif
Packit b099d7
Packit b099d7
#endif /* _XmColorObjP_h */
Packit b099d7