Back to home page

EIC code displayed by LXR

 
 

    


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

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 #ifndef _XmLabelP_h_
0024 #define _XmLabelP_h_
0025 
0026 #include <Xm/Label.h>
0027 #include <Xm/PrimitiveP.h>
0028 #include <Xm/XmP.h>
0029 
0030 
0031 #ifdef __cplusplus
0032 extern "C" {
0033 #endif
0034 
0035 /*  The Label Widget Class and instance records  */
0036 
0037 typedef struct _XmLabelClassPart     /* label class record */
0038 {
0039   XtWidgetProc  setOverrideCallback;
0040   XmMenuProc    menuProcs;
0041   String    translations;
0042   XtPointer extension;
0043 } XmLabelClassPart;
0044 
0045 typedef struct _XmLabelClassRec
0046 {
0047   CoreClassPart     core_class;
0048   XmPrimitiveClassPart  primitive_class;
0049   XmLabelClassPart  label_class;
0050 } XmLabelClassRec;
0051 
0052 externalref XmLabelClassRec xmLabelClassRec;
0053 
0054 
0055 /* Inherited  Functions exported by label */
0056 
0057 #define XmInheritSetOverrideCallback    ((XtWidgetProc) _XtInherit)
0058 #define XmInheritResize         ((XtWidgetProc) _XtInherit)
0059 #define XmInheritRealize        ((XtRealizeProc) _XtInherit)
0060 
0061 /* The padding between label text and accelerator text */
0062 
0063 # define LABEL_ACC_PAD      15
0064 
0065 /*  The Label instance record  */
0066 
0067 typedef struct _XmLabelPart
0068 {
0069   _XmString   _label;    /* String sent to this widget */
0070   _XmString   _acc_text;
0071   KeySym      mnemonic;
0072   XmStringCharSet mnemonicCharset;
0073   char       *accelerator;
0074   unsigned char   label_type;
0075   unsigned char   alignment;
0076   unsigned char   string_direction;
0077   XmFontList      font;
0078     
0079   Dimension   margin_height;  /* margin around widget */
0080   Dimension   margin_width;
0081   
0082   Dimension       margin_left;    /* additional margins on */
0083   Dimension   margin_right;   /* each side of widget */
0084   Dimension   margin_top;     /* text (or pixmap) is placed */
0085   Dimension   margin_bottom;  /* inside the margins */
0086   
0087   Boolean     recompute_size;
0088   
0089   Pixmap      pixmap; 
0090   Pixmap      pixmap_insen; 
0091   
0092   /* PRIVATE members -- values computed by LabelWidgetClass methods */
0093   
0094   GC          normal_GC;   /* GC for text */    
0095   GC          insensitive_GC;
0096   XRectangle      TextRect; /* The bounding box of the text or clip */
0097   XRectangle      acc_TextRect; /* rectangle of the window; whichever is */
0098                 /* smaller */
0099   
0100   Boolean     skipCallback; /* set by RowColumn with entryCallback. */
0101   unsigned char   menu_type;
0102   Boolean     computing_size; /* suppresses DrawnB resize callbacks. */
0103   
0104   Dimension   acc_left_delta;  /* Amount we increased the margins */
0105   Dimension   acc_right_delta; /* to accomodate accelerator text. */
0106 
0107   Dimension * baselines;    /* Cached baseline information */
0108   
0109   Boolean     check_set_render_table;
0110 
0111   XmPixmapPlacement pixmap_placement; /* Where to place the icon label. */
0112   Dimension pixmap_text_padding; /* padding between the icon and the text. */
0113 
0114   XRectangle      PixmapRect;   /* The bounding box of the pixmap in TextRect */
0115   XRectangle      StringRect;   /* The bounding box of the string in TextRect */
0116 #ifdef FIX_1381
0117   GC          shadow_GC;
0118 #endif
0119 } XmLabelPart;
0120 
0121 
0122 typedef struct _XmLabelRec
0123 {
0124    CorePart         core;
0125    XmPrimitivePart  primitive;
0126    XmLabelPart      label;
0127 } XmLabelRec;
0128 
0129 
0130 /* MACROS */
0131 
0132 #define Lab_MarginWidth(w)  (((XmLabelWidget)(w)) ->label.margin_width)
0133 #define Lab_MarginHeight(w) (((XmLabelWidget)(w)) ->label.margin_height)
0134 #define Lab_MarginTop(w)    (((XmLabelWidget)(w)) ->label.margin_top)
0135 #define Lab_MarginBottom(w) (((XmLabelWidget)(w)) ->label.margin_bottom)
0136 #define Lab_MarginRight(w)  (((XmLabelWidget)(w)) ->label.margin_right)
0137 #define Lab_MarginLeft(w)   (((XmLabelWidget)(w)) ->label.margin_left)
0138 #define Lab_TextRect_x(w)   (((XmLabelWidget)(w)) ->label.TextRect.x)
0139 #define Lab_TextRect_y(w)   (((XmLabelWidget)(w)) ->label.TextRect.y)
0140 #define Lab_TextRect_width(w)   (((XmLabelWidget)(w)) ->label.TextRect.width)
0141 #define Lab_TextRect_height(w)  (((XmLabelWidget)(w)) ->label.TextRect.height)
0142 
0143 #define Lab_IsText(w)   (((XmLabelWidget)(w)) ->label.label_type == XmSTRING)
0144 #define Lab_IsPixmap(w) (((XmLabelWidget)(w)) ->label.label_type == XmPIXMAP)
0145 #define Lab_IsPixmapAndText(w)  (((XmLabelWidget)(w)) ->label.label_type == \
0146                 XmPIXMAP_AND_STRING)
0147 
0148 #define Lab_Font(w)     (((XmLabelWidget)(w)) ->label.font)
0149 
0150 #define Lab_Mnemonic(w)     (((XmLabelWidget)(w)) ->label.mnemonic)
0151 #define Lab_Accelerator(w)  (((XmLabelWidget)(w)) ->label.accelerator)
0152 #define Lab_AcceleratorText(w)  (((XmLabelWidget)(w)) ->label.acc_text)
0153 #define Lab_MenuType(w)     (((XmLabelWidget)(w))->label.menu_type)
0154 #define Lab_Shadow(w)    (((XmLabelWidget)(w))->primitive.shadow_thickness)
0155 #define Lab_Highlight(w) (((XmLabelWidget)(w))->primitive.highlight_thickness)
0156 #define Lab_Baseline(w)                     \
0157   (_XmStringBaseline (((XmLabelWidget)(w))->label.font,     \
0158               ((XmLabelWidget)(w))->label._label))
0159 
0160 #define Lab_ComputingSize(w)    (((XmLabelWidget)(w))->label.computing_size)
0161 #define Lab_IsMenupane(w)   ((Lab_MenuType(w) == XmMENU_POPUP) ||   \
0162                  (Lab_MenuType(w) == XmMENU_PULLDOWN))
0163 
0164 
0165 #ifdef __cplusplus
0166 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0167 #endif
0168 
0169 #endif /* _XmLabelP_h */
0170 /* DON'T ADD ANYTHING AFTER THIS #endif */