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  */
0024 
0025 #ifndef _XmIconButtonP_h
0026 #define _XmIconButtonP_h
0027 
0028 
0029 /************************************************************
0030 *   INCLUDE FILES
0031 *************************************************************/
0032 #include <Xm/PrimitiveP.h>
0033 #include <Xm/IconButton.h>
0034 #include <Xm/XmP.h>
0035 
0036 #ifdef __cplusplus
0037 extern "C" {
0038 #endif
0039 
0040 /************************************************************
0041 *   TYPEDEFS AND DEFINES
0042 *************************************************************/
0043 
0044 #define XmIconButtonIndex (XmPrimitiveIndex + 1)
0045 
0046 /************************************************************
0047 *   MACROS
0048 *************************************************************/
0049 
0050 /************************************************************
0051 *   GLOBAL DECLARATIONS
0052 *************************************************************/
0053 
0054 typedef struct {
0055     XtPointer extension;    /* Just in case we need it later. */
0056 } XmIconButtonClassPart;
0057 
0058 typedef struct _XmIconButtonClassRec {
0059     CoreClassPart       core_class;
0060     XmPrimitiveClassPart    primitive_class;
0061     XmIconButtonClassPart           icon_class;
0062 } XmIconButtonClassRec;
0063 
0064 typedef struct {
0065     /* resources */
0066 
0067     String label;       /* The label to display. */
0068     Pixmap pixmap;      /* The pixmap to display. */
0069     Pixel arm_color;        /* The color to arm this widget with. */
0070     XmFontList font_list;   /* The font in MOTIF(tm) format. */
0071     XmIconPlacement icon_placement; /* Where to place the icon label. */
0072     Boolean recompute;      /* Whether to recompute size every time. */
0073     Boolean set;        /* State of the button. */
0074     Boolean armed;      /* Armed value for button. */
0075 
0076     Dimension v_space;      /* The amount of space between the edges */
0077     Dimension h_space;      /* of the widget and the picture/text. */
0078 
0079     Dimension icon_text_padding; /* padding between the icon and the text. */
0080 
0081     XtCallbackList activate_callback; /* Called when I am selected */
0082     XtCallbackList double_click_callback; /* Called when I am 2 clicked. */
0083 
0084     /*
0085      * Added in 1.2 for I18N.
0086      */
0087 
0088     XmString label_string;  /* The label stored as an XmString. */
0089     unsigned char string_direction;
0090     unsigned char alignment;
0091 
0092     /* private state */
0093 
0094     Position pix_x, pix_y;  /* Location of the pixmap. */
0095 
0096     /* public state */
0097     Dimension pix_width, pix_height; /* size of the pixmap. */
0098     Dimension pix_depth;    /* Depth of the pixmap. */
0099 
0100     /* private state */
0101     Position text_x, text_y;    /* Location to begin drawing text. */
0102     Dimension max_text_width;   /* maximum space the text can take up. */
0103     Dimension max_text_height;  /* maximum vertical space for the text */
0104 
0105     XtIntervalId unset_timer;   /* The arm and activate timer. */
0106     GC gc;          /* The graphics context. */
0107     GC fill_gc;         /* The gc for filling on the arm. */
0108     GC pixmap_fill_gc;      /* The gc for drawing the pixmap when
0109                    the button is filled. */
0110 
0111     GC stippled_text_gc;    /* GC to use stippling text. */
0112     GC stippled_set_text_gc;    /* GC to use for stip. text in a set button. */
0113     GC stippled_set_gc;     /* GC to use for images when toggle is set. */
0114     GC stippled_unset_gc;   /* GC to use for images when toggle is unset.*/
0115 
0116     Time time;          /* The server time of the last button click. */
0117 
0118     Boolean label_from_name;
0119     Boolean check_set_render_table;
0120 #ifdef FIX_1381
0121         GC shadow_gc;           /* GC to use shadow for text. */
0122 #endif
0123 
0124 
0125 } XmIconButtonPart;
0126 
0127 #define XmIconButton_label(w) (((XmIconButtonWidget)(w))->icon.label)
0128 #define XmIconButton_pixmap(w) (((XmIconButtonWidget)(w))->icon.pixmap)
0129 #define XmIconButton_arm_color(w) (((XmIconButtonWidget)(w))->icon.arm_color)
0130 #define XmIconButton_font_list(w) (((XmIconButtonWidget)(w))->icon.font_list)
0131 #define XmIconButton_icon_placement(w) (((XmIconButtonWidget)(w))->icon.icon_placement)
0132 #define XmIconButton_recompute(w) (((XmIconButtonWidget)(w))->icon.recompute)
0133 #define XmIconButton_set(w) (((XmIconButtonWidget)(w))->icon.set)
0134 #define XmIconButton_armed(w) (((XmIconButtonWidget)(w))->icon.armed)
0135 #define XmIconButton_v_space(w) (((XmIconButtonWidget)(w))->icon.v_space)
0136 #define XmIconButton_h_space(w) (((XmIconButtonWidget)(w))->icon.h_space)
0137 #define XmIconButton_icon_text_padding(w) (((XmIconButtonWidget)(w))->icon.icon_text_padding)
0138 #define XmIconButton_activate_callback(w) (((XmIconButtonWidget)(w))->icon.activate_callback)
0139 #define XmIconButton_double_click_callback(w) (((XmIconButtonWidget)(w))->icon.double_click_callback)
0140 #define XmIconButton_label_string(w) (((XmIconButtonWidget)(w))->icon.label_string)
0141 #define XmIconButton_string_direction(w) (((XmIconButtonWidget)(w))->icon.string_direction)
0142 #define XmIconButton_alignment(w) (((XmIconButtonWidget)(w))->icon.alignment)
0143 #define XmIconButton_pix_x(w) (((XmIconButtonWidget)(w))->icon.pix_x)
0144 #define XmIconButton_pix_y(w) (((XmIconButtonWidget)(w))->icon.pix_y)
0145 #define XmIconButton_pix_width(w) (((XmIconButtonWidget)(w))->icon.pix_width)
0146 #define XmIconButton_pix_height(w) (((XmIconButtonWidget)(w))->icon.pix_height)
0147 #define XmIconButton_pix_depth(w) (((XmIconButtonWidget)(w))->icon.pix_depth)
0148 #define XmIconButton_text_x(w) (((XmIconButtonWidget)(w))->icon.text_x)
0149 #define XmIconButton_text_y(w) (((XmIconButtonWidget)(w))->icon.text_y)
0150 #define XmIconButton_max_text_width(w) (((XmIconButtonWidget)(w))->icon.max_text_width)
0151 #define XmIconButton_max_text_height(w) (((XmIconButtonWidget)(w))->icon.max_text_height)
0152 #define XmIconButton_unset_timer(w) (((XmIconButtonWidget)(w))->icon.unset_timer)
0153 #define XmIconButton_gc(w) (((XmIconButtonWidget)(w))->icon.gc)
0154 #define XmIconButton_fill_gc(w) (((XmIconButtonWidget)(w))->icon.fill_gc)
0155 #define XmIconButton_pixmap_fill_gc(w) (((XmIconButtonWidget)(w))->icon.pixmap_fill_gc)
0156 #define XmIconButton_stippled_text_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_text_gc)
0157 #ifdef FIX_1381
0158 #define XmIconButton_insensitive_text_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_text_gc)
0159 #endif
0160 #define XmIconButton_stippled_set_text_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_set_text_gc)
0161 #define XmIconButton_stippled_set_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_set_gc)
0162 #define XmIconButton_stippled_unset_gc(w) (((XmIconButtonWidget)(w))->icon.stippled_unset_gc)
0163 #define XmIconButton_time(w) (((XmIconButtonWidget)(w))->icon.time)
0164 #define XmIconButton_label_from_name(w) (((XmIconButtonWidget)(w))->icon.label_from_name)
0165 #ifdef FIX_1381
0166 #define XmIconButton_shadow_gc(w) (((XmIconButtonWidget)(w))->icon.shadow_gc)
0167 #endif
0168 typedef struct _XmIconButtonRec {
0169     CorePart        core;
0170     XmPrimitivePart primitive;
0171     XmIconButtonPart    icon;
0172 } XmIconButtonRec;
0173 
0174 /************************************************************
0175 *   EXTERNAL DECLARATIONS
0176 *************************************************************/
0177 
0178 extern XmIconButtonClassRec xmIconButtonClassRec;
0179 
0180 /************************************************************
0181 *   STATIC DECLARATIONS
0182 *************************************************************/
0183 
0184 #ifdef __cplusplus
0185 }   /* Closes scope of 'extern "C"' declaration */
0186 #endif
0187 
0188 
0189 
0190 void _XmPrimitiveEnter(
0191                  Widget wid,
0192                  XEvent *event,
0193                  String *params,
0194                  Cardinal *num_params) ;
0195 void _XmPrimitiveLeave(
0196                         Widget wid,
0197                         XEvent *event,
0198                         String *params,
0199                         Cardinal *num_params) ;
0200 
0201 
0202 
0203 #endif /* _XmIconButtonP_h */