Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /* $XConsortium: IconGP.h /main/9 1995/10/25 20:06:59 cde-sun $ */
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 #ifndef _XmIconGP_h
0028 #define _XmIconGP_h
0029 
0030 #include <Xm/XmP.h>
0031 #include <Xm/ManagerP.h>
0032 #include <Xm/GadgetP.h>
0033 #include <Xm/IconG.h>
0034 #include <Xm/ExtObjectP.h>
0035 
0036 #ifdef __cplusplus
0037 extern "C" {
0038 #endif
0039 
0040 typedef Widget (*XmGetContainerParentProc)(Widget) ;
0041 
0042 #define XmInheritGetContainerParentProc ((XmGetContainerParentProc) _XtInherit)
0043 
0044 
0045 /* IconGadget class record */
0046 typedef struct _XmIconGadgetClassPart
0047     {
0048     XmGetContainerParentProc    get_container_parent;
0049     XtPointer extension ;
0050     }   XmIconGadgetClassPart;
0051 
0052 
0053 /* Full class record declaration */
0054 typedef struct _XmIconGadgetClassRec
0055     {
0056     RectObjClassPart    rect_class;
0057     XmGadgetClassPart   gadget_class;
0058     XmIconGadgetClassPart   icong_class;
0059     }   XmIconGadgetClassRec;
0060 
0061 extern  XmIconGadgetClassRec    xmIconGadgetClassRec;
0062 
0063 /*****************************************************************/
0064 /* The Icon Gadget Cache Object's class and instance records*/
0065 /*****************************************************************/
0066 
0067 typedef struct _XmIconGCacheObjClassPart
0068 {
0069     XtPointer extension;
0070 } XmIconGCacheObjClassPart;
0071 
0072 
0073 typedef struct _XmIconGCacheObjClassRec  /* Icon cache class record */
0074 {
0075     ObjectClassPart                     object_class;
0076     XmExtClassPart                      ext_class;
0077     XmIconGCacheObjClassPart            icon_class_cache;
0078 } XmIconGCacheObjClassRec;
0079 
0080 externalref XmIconGCacheObjClassRec xmIconGCacheObjClassRec;
0081 
0082 /*  The Icon Gadget Cache instance record  */
0083 
0084 typedef struct _XmIconGCacheObjPart
0085 {
0086    XmRenderTable    render_table;       /* XmNrenderTable */
0087    GC               selected_GC;
0088    GC               inverse_GC;
0089     
0090    Pixel            background;
0091    Pixel            foreground;
0092    Pixel            top_shadow_color;
0093    Pixel            bottom_shadow_color;
0094    Pixel            highlight_color;
0095 
0096    Pixmap           background_pixmap;
0097    Pixmap           top_shadow_pixmap;
0098    Pixmap           bottom_shadow_pixmap;
0099    Pixmap           highlight_pixmap;
0100 
0101    GC               normal_GC;
0102    GC               background_GC;
0103    GC               insensitive_GC;
0104    GC               top_shadow_GC;
0105    GC               bottom_shadow_GC;
0106    GC               highlight_GC;
0107   
0108    unsigned char    alignment;
0109    Dimension        spacing;
0110    Dimension        margin_width;
0111    Dimension        margin_height;
0112 #ifdef FIX_1381
0113    GC               shadow_GC;
0114 #endif
0115 } XmIconGCacheObjPart;
0116 
0117 typedef struct _XmIconGCacheObjRec
0118 {
0119   ObjectPart                object;
0120   XmExtPart         ext;
0121   XmIconGCacheObjPart       icon_cache;
0122 } XmIconGCacheObjRec;
0123 
0124 typedef struct _XmIconGCacheObjRec   * XmIconGCacheObject;
0125 
0126 /* IconGadget instance record */
0127 typedef struct _XmIconGadgetPart
0128     {
0129     XmString    label_string;       /* XmNlabelString */
0130     Pixmap      large_icon_mask;    /* XmNlargeIconMask */
0131     Pixmap      large_icon_pixmap;  /* XmNlargeIconPixmap */
0132     Pixmap      small_icon_mask;    /* XmNsmallIconMask */
0133     Pixmap      small_icon_pixmap;  /* XmNsmallIconPixmap */
0134     unsigned char   viewtype;       /* XmNviewType */
0135     unsigned char   visual_emphasis;    /* XmNvisualEmphasis */
0136     XmString *  detail;                 /* XmNdetail */
0137     Cardinal    detail_count;           /* XmNdetailCount */
0138     /* Private variables */
0139     Dimension   label_rect_width ;
0140     Dimension   label_rect_height ;
0141     Dimension   large_icon_rect_width;
0142     Dimension   large_icon_rect_height;
0143     Dimension   small_icon_rect_width;
0144     Dimension   small_icon_rect_height;
0145     String          large_pixmap_name ;
0146     String          small_pixmap_name ;
0147 
0148     XmIconGCacheObjPart  *cache;
0149     Boolean         check_set_render_table;
0150 } XmIconGadgetPart;
0151 
0152 /* Full instance record declaration */
0153 typedef struct _XmIconGadgetRec
0154     {
0155     ObjectPart  object;
0156     RectObjPart rectangle;
0157     XmGadgetPart    gadget;
0158     XmIconGadgetPart icong;
0159     }   XmIconGadgetRec;
0160 
0161 
0162 /* Useful macros */
0163 #define IG_LabelString(w)   (((XmIconGadget)(w))->icong.label_string)
0164 #define IG_LargeIconMask(w) (((XmIconGadget)(w))->icong.large_icon_mask)
0165 #define IG_LargeIconPixmap(w)   (((XmIconGadget)(w))->icong.large_icon_pixmap)
0166 #define IG_SmallIconMask(w) (((XmIconGadget)(w))->icong.small_icon_mask)
0167 #define IG_SmallIconPixmap(w)   (((XmIconGadget)(w))->icong.small_icon_pixmap)
0168 #define IG_ViewType(w)      (((XmIconGadget)(w))->icong.viewtype)
0169 #define IG_VisualEmphasis(w)    (((XmIconGadget)(w))->icong.visual_emphasis)
0170 #define IG_Detail(w)            (((XmIconGadget)(w))->icong.detail)
0171 #define IG_DetailCount(w)   (((XmIconGadget)(w))->icong.detail_count)
0172 #define IG_LabelRectWidth(w)    (((XmIconGadget)(w))->icong.label_rect_width)
0173 #define IG_LabelRectHeight(w)   (((XmIconGadget)(w))->icong.label_rect_height)
0174 #define IG_LargeIconRectWidth(w) \
0175                 (((XmIconGadget)(w))->icong.large_icon_rect_width)
0176 #define IG_LargeIconRectHeight(w) \
0177         (((XmIconGadget)(w))->icong.large_icon_rect_height)
0178 #define IG_SmallIconRectWidth(w) \
0179         (((XmIconGadget)(w))->icong.small_icon_rect_width)
0180 #define IG_SmallIconRectHeight(w) \
0181         (((XmIconGadget)(w))->icong.small_icon_rect_height)
0182 #define IG_LargePixmapName(w) (((XmIconGadget)(w))->icong.large_pixmap_name)
0183 #define IG_SmallPixmapName(w) (((XmIconGadget)(w))->icong.small_pixmap_name)
0184 
0185 /* XmNrecomputeSize didn't make it as a resource, but since the
0186    code is already written, I'll keep it and force its value here.
0187    If it's ever wanted back, just replace that macro by:
0188  #define IG_RecomputeSize(w)    (((XmIconGadget)(w))->icong.recompute_size) */
0189 #define IG_RecomputeSize(w) (True) 
0190 
0191 #define IG_LayoutDirection(w)   (((XmIconGadget)(w))->gadget.layout_direction)
0192 #define IG_Highlighted(w)   (((XmIconGadget)(w))->gadget.highlighted)
0193 #define IG_HLThickness(w)     (((XmIconGadget)(w))->gadget.highlight_thickness)
0194 #define IG_ShadowThickness(w)   (((XmIconGadget)(w))->gadget.shadow_thickness)
0195 #define IG_Depth(w)     (((XmManagerWidget) \
0196                   (((XmGadget)(w))->object.parent))->core.depth)
0197 
0198 /* cached resources for IconGadget */
0199 #define IG_RenderTable(w)   (((XmIconGadget)(w))-> \
0200                  icong.cache->render_table)
0201 #define IG_SelectedGC(w)    (((XmIconGadget)(w))-> \
0202                  icong.cache->selected_GC)
0203 #define IG_InverseGC(w)         (((XmIconGadget)(w))-> \
0204                  icong.cache->inverse_GC)
0205 
0206 /** These are gadget resources really. hopefully in 2.1,
0207     that will be replaced by stuff like:
0208     #define IG_Background(w)    Gad_Background(w)
0209     #define IG_BackgroundGC(w)  Gad_BackgroundGC(w)
0210     etc, etc ***/
0211 #define IG_Background(w)    (((XmIconGadget)(w))-> \
0212                  icong.cache->background)
0213 #define IG_Foreground(w)    (((XmIconGadget)(w))-> \
0214                  icong.cache->foreground)
0215 #define IG_TopShadowColor(w)    (((XmIconGadget)(w))-> \
0216                  icong.cache->top_shadow_color)
0217 #define IG_BottomShadowColor(w) (((XmIconGadget)(w))-> \
0218                  icong.cache->bottom_shadow_color)
0219 #define IG_HighlightColor(w)    (((XmIconGadget)(w))-> \
0220                  icong.cache->highlight_color)
0221 
0222 #define IG_BackgroundPixmap(w)  (((XmIconGadget)(w))-> \
0223                  icong.cache->background_pixmap)
0224 #define IG_TopShadowPixmap(w)   (((XmIconGadget)(w))-> \
0225                  icong.cache->top_shadow_pixmap)
0226 #define IG_BottomShadowPixmap(w)    (((XmIconGadget)(w))-> \
0227                  icong.cache->bottom_shadow_pixmap)
0228 #define IG_HighlightPixmap(w)   (((XmIconGadget)(w))-> \
0229                  icong.cache->highlight_pixmap)
0230 
0231 #define IG_NormalGC(w)          (((XmIconGadget)(w))-> \
0232                  icong.cache->normal_GC)
0233 #define IG_BackgroundGC(w)  (((XmIconGadget)(w))-> \
0234                  icong.cache->background_GC)
0235 #define IG_InsensitiveGC(w) (((XmIconGadget)(w))-> \
0236                  icong.cache->insensitive_GC)
0237 #ifdef FIX_1381
0238 #define IG_ShadowGC(w)  (((XmIconGadget)(w))-> \
0239                  icong.cache->shadow_GC)
0240 #endif
0241 #define IG_TopShadowGC(w)   (((XmIconGadget)(w))-> \
0242                  icong.cache->top_shadow_GC)
0243 #define IG_BottomShadowGC(w)    (((XmIconGadget)(w))-> \
0244                  icong.cache->bottom_shadow_GC)
0245 #define IG_HighlightGC(w)   (((XmIconGadget)(w))-> \
0246                  icong.cache->highlight_GC)
0247 #define IG_Alignment(w)     (((XmIconGadget)(w))-> \
0248                  icong.cache->alignment)
0249 #define IG_Spacing(w)       (((XmIconGadget)(w))-> \
0250                  icong.cache->spacing)
0251 #define IG_MarginWidth(w)   (((XmIconGadget)(w))-> \
0252                  icong.cache->margin_width)
0253 #define IG_MarginHeight(w)  (((XmIconGadget)(w))-> \
0254                  icong.cache->margin_height)
0255 
0256 
0257 /* Convenience Macros */
0258 #define IG_Cache(w)            (((XmIconGadget)(w))->icong.cache)
0259 #define IG_ClassCachePart(w)   (((XmIconGadgetClass)xmIconGadgetClass)->\
0260                 gadget_class.cache_part)
0261 
0262 #ifdef __cplusplus
0263 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0264 #endif
0265 
0266 #endif /* _XmIconGP_h */
0267 /* DON'T ADD ANYTHING AFTER THIS #endif */