Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /*
0002  * Motif
0003  *
0004  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
0005  *
0006  * These libraries and programs are free software; you can
0007  * redistribute them and/or modify them under the terms of the GNU
0008  * Lesser General Public License as published by the Free Software
0009  * Foundation; either version 2 of the License, or (at your option)
0010  * any later version.
0011  *
0012  * These libraries and programs are distributed in the hope that
0013  * they will be useful, but WITHOUT ANY WARRANTY; without even the
0014  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
0015  * PURPOSE. See the GNU Lesser General Public License for more
0016  * details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with these librararies and programs; if not, write
0020  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
0021  * Floor, Boston, MA 02110-1301 USA
0022  * 
0023  */
0024 
0025 #ifndef _XmColorSelectorP_h
0026 #define _XmColorSelectorP_h
0027 
0028 #if defined(VMS) || defined(__VMS)
0029 #include <X11/apienvset.h>
0030 #endif
0031 
0032 /************************************************************
0033  *      INCLUDE FILES
0034  *************************************************************/
0035         
0036 #include <Xm/ManagerP.h>
0037 #include <Xm/ColorS.h>
0038 
0039 /************************************************************
0040  *      TYPEDEFS AND DEFINES
0041  *************************************************************/
0042 
0043 #ifdef __cplusplus
0044 extern "C" {
0045 #endif
0046 
0047 #define XmColorSelector_COLOR_NAME_SIZE 100
0048 #define XmColorSelector_NUM_TOGGLES 2
0049 
0050 typedef struct _ColorSelStrings {
0051     XmString slider_labels[3];
0052 
0053     XmString tog_labels[XmColorSelector_NUM_TOGGLES];
0054     XmString no_cell_error, file_read_error;
0055 } ColorSelStrings;
0056 
0057 typedef struct _ColorInfo {
0058     char name[XmColorSelector_COLOR_NAME_SIZE], no_space_lower_name[XmColorSelector_COLOR_NAME_SIZE];
0059     unsigned short red, green, blue;
0060 } ColorInfo;
0061 
0062 typedef struct _ColorSelectorClassPart {
0063     XtPointer       extension; 
0064 } ColorSelectorClassPart;
0065 
0066 typedef struct _XmColorSelectorClassRec
0067 {
0068     CoreClassPart       core_class;
0069     CompositeClassPart      composite_class;
0070     ConstraintClassPart         constraint_class;
0071     XmManagerClassPart          manager_class;
0072     ColorSelectorClassPart  color_selector_class;
0073 } XmColorSelectorClassRec;
0074 
0075 typedef struct _XmColorSelectorPart
0076 {
0077     /* resources */
0078 
0079     XmColorMode     color_mode;     /* selector mode       */
0080     char           *color_name;     /* the colorname we select */ 
0081     String          rgb_file;           /* where to look for       */
0082     Dimension       margin_width;           /* for geom management     */
0083     Dimension       margin_height;          /* for geom management     */
0084 
0085     ColorSelStrings     strings;                /* strings for I18N. */
0086 
0087     /* private state */
0088 
0089     int         slider_red; /* slider values            */
0090     int         slider_green;   /* slider values            */
0091     int         slider_blue;    /* slider values            */
0092     Widget      bb;     /* area to hold all the sliders     */
0093     Widget      sliders[3]; /* red,green,blue sliders(slider)   */
0094     Widget      scrolled_list;  /* list (scrolled window)       */
0095     Widget      list;       /* list (simple)            */
0096     Widget      color_window;   /* label to show selected color     */
0097     Widget      chose_radio;    /* selector type radio box      */
0098     Widget      chose_mode[2];  /* selector type toggles        */
0099 
0100     Pixel       color_pixel;        /* pixel value for colors  */
0101     Boolean         good_cell;      /* does color_pixel contain
0102                      * a good value? */
0103     ColorInfo       *colors;        /* infomation about all color names */
0104     short       num_colors;     /* The number of colors. */
0105 } XmColorSelectorPart;
0106 
0107 typedef struct _XmColorSelectorRec
0108 {
0109     CorePart        core;
0110     CompositePart   composite;
0111     ConstraintPart      constraint;
0112     XmManagerPart       manager;
0113     XmColorSelectorPart cs;
0114 } XmColorSelectorRec;
0115 
0116 typedef struct _XmColorSelectorConstraintPart
0117 {
0118     XtPointer extension;
0119 } XmColorSelectorConstraintPart;
0120 
0121 typedef struct _XmColorSelectorConstraintRec
0122 {
0123     XmManagerConstraintPart       manager;
0124     XmColorSelectorConstraintPart cs;
0125 } XmColorSelectorConstraintRec;
0126 
0127 /************************************************************
0128  *      MACROS
0129  *************************************************************/
0130 
0131 #define XmColorSelectorIndex (XmManagerIndex + 1)
0132 
0133 #define XmColorS_color_mode(w) (((XmColorSelectorWidget)(w))->cs.color_mode)
0134 #define XmColorS_color_name(w) (((XmColorSelectorWidget)(w))->cs.color_name)
0135 #define XmColorS_rgb_file(w) (((XmColorSelectorWidget)(w))->cs.rgb_file)
0136 #define XmColorS_margin_width(w) (((XmColorSelectorWidget)(w))->cs.margin_width)
0137 #define XmColorS_margin_height(w) (((XmColorSelectorWidget)(w))->cs.margin_height)
0138 #define XmColorS_strings(w) (((XmColorSelectorWidget)(w))->cs.strings)
0139 #define XmColorS_slider_red(w) (((XmColorSelectorWidget)(w))->cs.slider_red)
0140 #define XmColorS_slider_green(w) (((XmColorSelectorWidget)(w))->cs.slider_green)
0141 #define XmColorS_slider_blue(w) (((XmColorSelectorWidget)(w))->cs.slider_blue)
0142 #define XmColorS_bb(w) (((XmColorSelectorWidget)(w))->cs.bb)
0143 #define XmColorS_sliders(w) (((XmColorSelectorWidget)(w))->cs.sliders)
0144 #define XmColorS_scrolled_list(w) (((XmColorSelectorWidget)(w))->cs.scrolled_list)
0145 #define XmColorS_list(w) (((XmColorSelectorWidget)(w))->cs.list)
0146 #define XmColorS_color_window(w) (((XmColorSelectorWidget)(w))->cs.color_window)
0147 #define XmColorS_chose_radio(w) (((XmColorSelectorWidget)(w))->cs.chose_radio)
0148 #define XmColorS_chose_mode(w) (((XmColorSelectorWidget)(w))->cs.chose_mode)
0149 #define XmColorS_color_pixel(w) (((XmColorSelectorWidget)(w))->cs.color_pixel)
0150 #define XmColorS_good_cell(w) (((XmColorSelectorWidget)(w))->cs.good_cell)
0151 #define XmColorS_colors(w) (((XmColorSelectorWidget)(w))->cs.colors)
0152 #define XmColorS_num_colors(w) (((XmColorSelectorWidget)(w))->cs.num_colors)
0153 
0154 /************************************************************
0155  *      GLOBAL DECLARATIONS
0156  *************************************************************/
0157 
0158 /************************************************************
0159  *       EXTERNAL DECLARATIONS
0160  ************************************************************/
0161 
0162 extern XmColorSelectorClassRec  xmColorSelectorClassRec;
0163 
0164 /************************************************************
0165  *       STATIC DECLARATIONS
0166  ************************************************************/
0167 
0168 #ifdef __cplusplus
0169 }   /* Closes scope of 'extern "C"' declaration */
0170 #endif
0171 
0172 #if defined(VMS) || defined(__VMS)
0173 #include <X11/apienvrst.h>
0174 #endif
0175 
0176 #endif /* _XmColorSelectP_h DON'T ADD STUFF AFTER THIS #endif */