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 _XmIconBoxP_h
0026 #define _XmIconBoxP_h
0027 
0028 #if defined(VMS) || defined(__VMS)
0029 #include <X11/apienvset.h>
0030 #endif
0031 
0032 /************************************************************
0033 *   INCLUDE FILES
0034 *************************************************************/
0035 #include <Xm/ManagerP.h>
0036 #include <Xm/IconBox.h>
0037 
0038 #ifdef __cplusplus
0039 extern "C" {
0040 #endif
0041 
0042 /************************************************************
0043 *   TYPEDEFS AND DEFINES
0044 *************************************************************/
0045 
0046 
0047 /*
0048  * Hack to get around naming conventions.  The XmConstraintPartOffset macro
0049  * requires our contraint part structure to have this name
0050  */
0051 #define XmIconBoxConstraintPart IconInfo
0052 
0053 /*
0054  * Access macros for widget instance fields
0055  */
0056 #define XmIconBox_min_v_cells(w)    (((XmIconBoxWidget)(w))->box.min_v_cells)
0057 #define XmIconBox_min_h_cells(w)    (((XmIconBoxWidget)(w))->box.min_h_cells)
0058 #define XmIconBox_v_margin(w)   (((XmIconBoxWidget)(w))->box.v_margin)
0059 #define XmIconBox_h_margin(w)   (((XmIconBoxWidget)(w))->box.h_margin)
0060 #define XmIconBox_min_cell_width(w)  (((XmIconBoxWidget)(w))->box.min_cell_width)
0061 #define XmIconBox_min_cell_height(w) (((XmIconBoxWidget)(w))->box.min_cell_height)
0062 #define XmIconBox_cell_width(w) (((XmIconBoxWidget)(w))->box.cell_width)
0063 #define XmIconBox_cell_height(w)    (((XmIconBoxWidget)(w))->box.cell_height)
0064 
0065 #define XmIconBoxC_cell_x(w)      (((XmIconBoxConstraintsRec*)((w)->core.constraints))->icon.cell_x)
0066 #define XmIconBoxC_cell_y(w)      (((XmIconBoxConstraintsRec*)((w)->core.constraints))->icon.cell_y)
0067 #define XmIconBoxC_pref_width(w)  (((XmIconBoxConstraintsRec*)((w)->core.constraints))->icon.pref_width)
0068 #define XmIconBoxC_pref_height(w) (((XmIconBoxConstraintsRec*)((w)->core.constraints))->icon.pref_height)
0069 
0070 /************************************************************
0071 *   MACROS
0072 *************************************************************/
0073 
0074 /************************************************************
0075 *   GLOBAL DECLARATIONS
0076 *************************************************************/
0077 
0078 typedef struct {
0079     XtPointer extension;    /* Just in case we need it later. */
0080 } XmIconBoxClassPart;
0081 
0082 typedef struct _XmIconBoxClassRec {
0083     CoreClassPart       core_class;
0084     CompositeClassPart      composite_class;
0085     ConstraintClassPart     constraint_class;
0086     XmManagerClassPart      manager_class;
0087     XmIconBoxClassPart          box_class;
0088 } XmIconBoxClassRec;
0089 
0090 typedef struct {
0091     /* resources */
0092 
0093     Dimension min_v_cells;  /* Default number of cells in the vert dir. */
0094     Dimension min_h_cells;  /* Default number of cells in the horiz dir. */
0095     Dimension v_margin;     /* Amount of space to leave between cells */
0096     Dimension h_margin;     /* and window edges. */
0097     Dimension min_cell_width;   /* Minimum width of the cells. */
0098     Dimension min_cell_height;  /* Minimum height of the cells. */
0099 
0100     /* private state */
0101 
0102     Dimension cell_width;   /* Width and height of all cells. */
0103     Dimension cell_height;
0104 
0105 } XmIconBoxPart;
0106 
0107 
0108 typedef struct _XmIconBoxRec {
0109     CorePart        core;
0110     CompositePart   composite;
0111     ConstraintPart  constraint;
0112     XmManagerPart   manager;
0113     XmIconBoxPart   box;
0114 } XmIconBoxRec;
0115 
0116 typedef struct _IconInfo {
0117 
0118     /*
0119      * Resources.
0120      */
0121 
0122     short cell_x;       /* X location of this icon in cell space. */
0123     short cell_y;       /* Y location of this icon in cell space. */
0124 
0125     /*
0126      * Private state.
0127      */
0128 
0129     Dimension pref_width, pref_height; /* The preferred size of this widget. */
0130 } IconInfo;
0131 
0132 typedef struct _XmIconBoxConstraintsRec {
0133     XmManagerConstraintPart manager;
0134     IconInfo            icon;
0135 } XmIconBoxConstraintsRec, *XmIconBoxConstraints;
0136 
0137 /************************************************************
0138 *   EXTERNAL DECLARATIONS
0139 *************************************************************/
0140 
0141 extern XmIconBoxClassRec xmIconBoxClassRec;
0142 
0143 /************************************************************
0144 *   STATIC DECLARATIONS
0145 *************************************************************/
0146 
0147 #ifdef __cplusplus
0148 }   /* Closes scope of 'extern "C"' declaration */
0149 #endif
0150 
0151 #if defined(VMS) || defined(__VMS)
0152 #include <X11/apienvrst.h>
0153 #endif
0154 
0155 #endif /* _XmIconBoxP_h */