File indexing completed on 2025-01-18 10:15:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef _XmContainerP_h
0028 #define _XmContainerP_h
0029
0030 #include <Xm/XmP.h>
0031 #include <Xm/ManagerP.h>
0032 #include <Xm/DragCP.h>
0033 #include <Xm/Container.h>
0034
0035 #ifdef __cplusplus
0036 extern "C" {
0037 #endif
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050 typedef struct _XmCwidNodeRec
0051 {
0052 struct _XmCwidNodeRec * next_ptr;
0053 struct _XmCwidNodeRec * prev_ptr;
0054 struct _XmCwidNodeRec * child_ptr;
0055 struct _XmCwidNodeRec * parent_ptr;
0056 Widget widget_ptr;
0057 } XmCwidNodeRec, *CwidNode;
0058
0059
0060
0061
0062
0063
0064 typedef struct _XmContainerXfrActionRec
0065 {
0066 Widget wid;
0067 XEvent *event;
0068 String *params;
0069 Cardinal *num_params;
0070 Atom operation;
0071 } XmContainerXfrActionRec, *ContainerXfrAction;
0072
0073
0074
0075
0076
0077
0078
0079 typedef struct _XmContainerCwidCellInfoRec
0080 {
0081 int cwid_width_in_cells;
0082 int cwid_height_in_cells;
0083 } XmContainerCwidCellInfoRec, *ContainerCwidCellInfo;
0084
0085
0086 typedef struct _XmContainerConstraintPart
0087 {
0088 Widget entry_parent;
0089 Widget related_cwid;
0090 CwidNode node_ptr;
0091 int position_index;
0092 int depth;
0093 int cell_idx;
0094 Boolean visible_in_outline;
0095 Position user_x;
0096 Position user_y;
0097 unsigned char outline_state;
0098 unsigned char selection_visual;
0099 unsigned char selection_state;
0100 unsigned char cwid_type;
0101 } XmContainerConstraintPart, * XmContainerConstraint;
0102
0103 typedef struct _XmContainerConstraintRec
0104 {
0105 XmManagerConstraintPart manager;
0106 XmContainerConstraintPart container;
0107 } XmContainerConstraintRec, * XmContainerConstraintPtr;
0108
0109
0110 typedef void (*XmSpatialGetSize)(Widget, Dimension *, Dimension *);
0111
0112
0113 typedef struct _XmContainerClassPart
0114 {
0115 XmSpatialTestFitProc test_fit_item;
0116 XmSpatialPlacementProc place_item;
0117 XmSpatialRemoveProc remove_item;
0118 XmSpatialGetSize get_spatial_size;
0119 XtPointer extension;
0120 } XmContainerClassPart;
0121
0122
0123 typedef struct _XmContainerClassRec
0124 {
0125 CoreClassPart core_class;
0126 CompositeClassPart composite_class;
0127 ConstraintClassPart constraint_class;
0128 XmManagerClassPart manager_class;
0129 XmContainerClassPart container_class;
0130 } XmContainerClassRec, *XmContainerClass;
0131
0132 externalref XmContainerClassRec xmContainerClassRec;
0133
0134
0135 typedef struct _XmContainerPart
0136 {
0137 WidgetList selected_items;
0138 Widget icon_header;
0139 Widget anchor_cwid;
0140 Widget druggee;
0141 Widget size_ob;
0142 Widget drag_context;
0143 CwidNode first_node;
0144 CwidNode last_node;
0145 Cardinal * detail_order;
0146 XmString * detail_heading;
0147 XSegment * outline_segs;
0148 XtCallbackList convert_cb;
0149 XtCallbackList default_action_cb;
0150 XtCallbackList destination_cb;
0151 XtCallbackList outline_cb;
0152 XtCallbackList selection_cb;
0153 XmTabList detail_tablist;
0154 XmFontList render_table;
0155 Pixel select_color;
0156 Pixmap collapsed_state_pixmap;
0157 Pixmap expanded_state_pixmap;
0158 GC normalGC;
0159 GC marqueeGC;
0160 Time last_click_time;
0161 Region cells_region;
0162 ContainerXfrAction transfer_action;
0163 XtIntervalId transfer_timer_id;
0164 XPoint anchor_point;
0165 XPoint marquee_start;
0166 XPoint marquee_end;
0167 XPoint marquee_smallest;
0168 XPoint marquee_largest;
0169 XPoint dropspot;
0170 unsigned long dynamic_resource;
0171 int max_depth;
0172 int outline_seg_count;
0173 int *cells;
0174 int cell_count;
0175 int next_free_cell;
0176 int current_width_in_cells;
0177 int current_height_in_cells;
0178 int drag_offset_x;
0179 int drag_offset_y;
0180 unsigned int selected_item_count;
0181 Cardinal detail_heading_count;
0182 Cardinal saved_detail_heading_count;
0183 Cardinal detail_order_count;
0184 Dimension first_col_width;
0185 Dimension real_first_col_width;
0186 Dimension large_cell_height;
0187 Dimension large_cell_width;
0188 Dimension small_cell_height;
0189 Dimension small_cell_width;
0190 Dimension real_large_cellh;
0191 Dimension real_large_cellw;
0192 Dimension real_small_cellh;
0193 Dimension real_small_cellw;
0194 Dimension margin_h;
0195 Dimension margin_w;
0196 Dimension outline_indent;
0197 Dimension ob_width;
0198 Dimension ob_height;
0199 Dimension prev_width;
0200 Dimension ideal_width;
0201 Dimension ideal_height;
0202
0203
0204
0205 Boolean first_change_managed;
0206 Boolean extending_mode;
0207 Boolean marquee_mode;
0208 Boolean self;
0209 Boolean toggle_pressed;
0210 Boolean extend_pressed;
0211 Boolean ob_pressed;
0212 Boolean cancel_pressed;
0213 Boolean kaddmode;
0214 Boolean no_auto_sel_changes;
0215 Boolean started_in_anchor;
0216 Boolean marquee_drawn;
0217 Boolean have_primary;
0218 Boolean selecting;
0219 Boolean large_cell_dim_fixed;
0220 Boolean small_cell_dim_fixed;
0221 unsigned char automatic;
0222 unsigned char entry_viewtype;
0223 unsigned char include_model;
0224 unsigned char layout_type;
0225 unsigned char ob_policy;
0226 unsigned char outline_sep_style;
0227 unsigned char spatial_style;
0228 unsigned char primary_ownership;
0229 unsigned char resize_model;
0230 unsigned char selection_policy;
0231 unsigned char selection_technique;
0232 unsigned char snap_model;
0233 unsigned char create_cwid_type;
0234 unsigned char selection_state;
0235 unsigned char LeaveDir;
0236 XtIntervalId scroll_proc_id;
0237 int last_xmotion_x;
0238 int last_xmotion_y;
0239 XmString * cache_detail_heading;
0240
0241 } XmContainerPart;
0242
0243
0244 typedef struct _XmContainerRec
0245 {
0246 CorePart core;
0247 CompositePart composite;
0248 ConstraintPart constraint;
0249 XmManagerPart manager;
0250 XmContainerPart container;
0251 } XmContainerRec;
0252
0253
0254 enum { CONTAINER_ICON,
0255 CONTAINER_OUTLINE_BUTTON,
0256 CONTAINER_HEADER};
0257
0258 #define TABLIST (1L<<0)
0259 #define FIRSTCW (1L<<1)
0260 #define CtrIsDynamic(w,mask) \
0261 (((XmContainerWidget)(w))->container.dynamic_resource & mask)
0262
0263 #define CtrDynamicSmallCellHeight(w) \
0264 (((XmContainerWidget)(w))->container.small_cell_height == 0)
0265 #define CtrDynamicSmallCellWidth(w) \
0266 (((XmContainerWidget)(w))->container.small_cell_width == 0)
0267 #define CtrDynamicLargeCellHeight(w) \
0268 (((XmContainerWidget)(w))->container.large_cell_height == 0)
0269 #define CtrDynamicLargeCellWidth(w) \
0270 (((XmContainerWidget)(w))->container.large_cell_width == 0)
0271
0272 #define CtrIsAUTO_SELECT(w) \
0273 ((((XmContainerWidget)(w))->container.automatic == XmAUTO_SELECT) && \
0274 (((XmContainerWidget)(w))->container.selection_policy \
0275 != XmSINGLE_SELECT))
0276 #define CtrViewIsLARGE_ICON(w) \
0277 (((XmContainerWidget)(w))->container.entry_viewtype == XmLARGE_ICON)
0278 #define CtrViewIsSMALL_ICON(w) \
0279 (((XmContainerWidget)(w))->container.entry_viewtype == XmSMALL_ICON)
0280 #define CtrViewIsANY_ICON(w) \
0281 (((XmContainerWidget)(w))->container.entry_viewtype == XmANY_ICON)
0282 #define CtrIsHORIZONTAL(w) \
0283 (XmDirectionMatchPartial \
0284 (((XmContainerWidget)(w))->manager.string_direction,\
0285 XmDEFAULT_DIRECTION,XmPRECEDENCE_HORIZ_MASK))
0286 #define CtrIsVERTICAL(w) \
0287 (XmDirectionMatchPartial \
0288 (((XmContainerWidget)(w))->manager.string_direction,\
0289 XmDEFAULT_DIRECTION,XmPRECEDENCE_VERT_MASK))
0290 #define CtrLayoutIsDETAIL(w) \
0291 (((XmContainerWidget)(w))->container.layout_type == XmDETAIL)
0292 #define CtrLayoutIsOUTLINE_DETAIL(w) \
0293 ((((XmContainerWidget)(w))->container.layout_type == XmDETAIL) || \
0294 (((XmContainerWidget)(w))->container.layout_type == XmOUTLINE))
0295
0296 #define CtrDrawLinesOUTLINE(w) \
0297 (CtrLayoutIsOUTLINE_DETAIL(w) && \
0298 (((XmContainerWidget)(w))->container.outline_sep_style \
0299 == XmSINGLE))
0300 #define CtrLayoutIsSPATIAL(w) \
0301 (((XmContainerWidget)(w))->container.layout_type == XmSPATIAL)
0302 #define CtrSpatialStyleIsNONE(w) \
0303 (((XmContainerWidget)(w))->container.spatial_style == XmNONE)
0304 #define CtrSpatialStyleIsGRID(w) \
0305 (((XmContainerWidget)(w))->container.spatial_style == XmGRID)
0306 #define CtrSpatialStyleIsCELLS(w) \
0307 (((XmContainerWidget)(w))->container.spatial_style == XmCELLS)
0308 #define CtrIncludeIsAPPEND(w) \
0309 (((XmContainerWidget)(w))->container.include_model == XmAPPEND)
0310 #define CtrIncludeIsCLOSEST(w) \
0311 (((XmContainerWidget)(w))->container.include_model == XmCLOSEST)
0312 #define CtrIncludeIsFIRST_FIT(w) \
0313 (((XmContainerWidget)(w))->container.include_model == XmFIRST_FIT)
0314 #define CtrSnapModelIsNONE(w) \
0315 (((XmContainerWidget)(w))->container.snap_model == XmNONE)
0316 #define CtrSnapModelIsSNAP(w) \
0317 (((XmContainerWidget)(w))->container.snap_model == XmSNAP_TO_GRID)
0318 #define CtrSnapModelIsCENTER(w) \
0319 (((XmContainerWidget)(w))->container.snap_model == XmCENTER)
0320 #define CtrResizeModelIsGROW_MINOR(w) \
0321 (((XmContainerWidget)(w))->container.resize_model == XmGROW_MINOR)
0322 #define CtrResizeModelIsGROW_MAJOR(w) \
0323 (((XmContainerWidget)(w))->container.resize_model == XmGROW_MAJOR)
0324 #define CtrResizeModelIsGROW_BALANCED(w) \
0325 (((XmContainerWidget)(w))->container.resize_model == XmGROW_BALANCED)
0326 #define CtrPolicyIsSINGLE(w) \
0327 (((XmContainerWidget)(w))->container.selection_policy \
0328 == XmSINGLE_SELECT)
0329 #define CtrPolicyIsBROWSE(w) \
0330 (((XmContainerWidget)(w))->container.selection_policy \
0331 == XmBROWSE_SELECT)
0332 #define CtrPolicyIsMULTIPLE(w) \
0333 (((XmContainerWidget)(w))->container.selection_policy \
0334 == XmMULTIPLE_SELECT)
0335 #define CtrPolicyIsEXTENDED(w) \
0336 (((XmContainerWidget)(w))->container.selection_policy \
0337 == XmEXTENDED_SELECT)
0338 #define CtrTechIsTOUCH_OVER(w) \
0339 (((XmContainerWidget)(w))->container.selection_technique \
0340 == XmTOUCH_OVER)
0341 #define CtrTechIsTOUCH_ONLY(w) \
0342 (((XmContainerWidget)(w))->container.selection_technique \
0343 == XmTOUCH_ONLY)
0344 #define CtrTechIsMARQUEE(w) \
0345 (((XmContainerWidget)(w))->container.selection_technique \
0346 == XmMARQUEE)
0347 #define CtrTechIsMARQUEE_ES(w) \
0348 (((XmContainerWidget)(w))->container.selection_technique \
0349 == XmMARQUEE_EXTEND_START)
0350 #define CtrTechIsMARQUEE_EB(w) \
0351 (((XmContainerWidget)(w))->container.selection_technique \
0352 == XmMARQUEE_EXTEND_BOTH)
0353 #define CtrOB_PRESENT(w) \
0354 (((XmContainerWidget)(w))->container.ob_policy \
0355 == XmOUTLINE_BUTTON_PRESENT)
0356 #define CtrOB_ABSENT(w) \
0357 (((XmContainerWidget)(w))->container.ob_policy \
0358 == XmOUTLINE_BUTTON_ABSENT)
0359 #define GetContainerConstraint(w) \
0360 (&((XmContainerConstraintPtr) (w)->core.constraints)->container)
0361 #define CtrItemIsPlaced(w) \
0362 (((XmContainerConstraintPtr)(w)->core.constraints)->container.cell_idx \
0363 != NO_CELL)
0364 #define CtrICON(w) \
0365 (((XmContainerConstraintPtr)(w)->core.constraints)->container.cwid_type\
0366 == CONTAINER_ICON)
0367 #define CtrOUTLINE_BUTTON(w) \
0368 (((XmContainerConstraintPtr)(w)->core.constraints)->container.cwid_type\
0369 == CONTAINER_OUTLINE_BUTTON)
0370 #define CtrHEADER(w) \
0371 (((XmContainerConstraintPtr)(w)->core.constraints)->container.cwid_type\
0372 == CONTAINER_HEADER)
0373
0374 #define XmInheritSpatialTestFitProc ((XmSpatialTestFitProc) _XtInherit)
0375 #define XmInheritSpatialPlacementProc ((XmSpatialPlacementProc) _XtInherit)
0376 #define XmInheritSpatialRemoveProc ((XmSpatialRemoveProc) _XtInherit)
0377 #define XmInheritSpatialGetSize ((XmSpatialGetSize) _XtInherit)
0378
0379
0380 #define TOPLEAVE (1<<0)
0381 #define BOTTOMLEAVE (1<<1)
0382 #define LEFTLEAVE (1<<2)
0383 #define RIGHTLEAVE (1<<3)
0384
0385 #ifdef __cplusplus
0386 }
0387 #endif
0388
0389 #endif
0390
0391
0392