/* $XConsortium: ComboBoxP.h /main/8 1995/09/19 23:00:21 cde-sun $ */
/*
 *  @OSF_COPYRIGHT@
 *  COPYRIGHT NOTICE
 *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
 *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
 *  the full copyright text.
 */
/*
 * HISTORY
 */
/*	ComboBoxP.h  */
#ifndef _XmComboBoxP_H
#define _XmComboBoxP_H

#include <Xm/ManagerP.h>
#include <Xm/ComboBox.h> 


#ifdef __cplusplus
extern "C" {
#endif

#ifdef _SGIMOTIF
typedef struct __SG_XmComboBoxClassExtPart {
  SgRenderShadowsProc render_shadows;
  visual_state_array  default_state_array;
}_SG_XmComboBoxClassExtPart;

typedef struct __SG_XmComboBoxClassExt {
  _SgClassExtensionRec common;
  _SG_XmComboBoxClassExtPart combo_box;
} _SG_XmComboBoxClassExtRec, *_SG_XmComboBoxClassExt;
	

typedef struct __SG_XmComboBoxExtPart {
  Boolean use_overlay_plane;
} _SG_XmComboBoxExtPart;
	
typedef struct __SG_XmComboBoxExt {
  
	_SgInstanceExtensionRec common;   /* Stuff all instance rec's have */
  	_SG_XmComboBoxExtPart	instance;
} _SG_XmComboBoxExtRec, *_SG_XmComboBoxExt;

#define _SG_ComboBoxPtr(w) \
((_SG_XmComboBoxExt)(((XmComboBoxWidget)(w))->combo_box._SG_vendorExtension))

#define _SG_ComboBoxClassPtr(wc) \
((_SG_XmComboBoxClassExt)((XmComboBoxClassRec*)(wc))->combo_box_class._SG_vendorExtension)

#endif /* _SGIMOTIF */
/* New fields for the ComboBox widget class record. */

typedef struct _XmComboBoxClassPart {
  XtPointer extension;		/* Pointer to extension record. */
  
#ifdef _SGIMOTIF
  XtPointer	_SG_vendorExtension;
#endif

} XmComboBoxClassPart;


/* Full class record declaration. */	
typedef struct _XmComboBoxClassRec {
  CoreClassPart		core_class;
  CompositeClassPart	composite_class;
  ConstraintClassPart	constraint_class;
  XmManagerClassPart	manager_class;
  XmComboBoxClassPart	combo_box_class;
} XmComboBoxClassRec;

externalref XmComboBoxClassRec xmComboBoxClassRec;

/*
 * New fields for the ComboBox widget record.	
 */

typedef struct _XmComboBoxPart {
  /* Resources */
  unsigned char 	type;
  unsigned char		match_behavior;
  Dimension 		highlight_thickness;
  Dimension 		arrow_size;
  Dimension 		arrow_spacing;
  Dimension 		margin_width;
  Dimension 		margin_height;
  XtCallbackList	selection_callback;
  XmString		selected_item; /* synthetic, not updated */
  int			selected_position;
  XmFontList		render_table;

  /* Internal data */
  Widget		list_shell; 
  Widget		list;		/* Now accessible as a resource */
  Widget		scrolled_w; 
  Widget		vsb;
  Widget		hsb;
  int 			ideal_ebheight;
  int			ideal_ebwidth;
  GC 			arrow_GC;
  XRectangle 		hit_rect;
  Dimension 		arrow_shadow_width;
  Boolean 		arrow_pressed;
  Boolean		highlighted;
  Boolean		scrolling;
  XtEnum		shell_state;
  /* NOTE that text_changed is also used for MT_safe resolution of
   * the XmNRenderTable, XmNFontList resource settings 
   */
  Boolean		text_changed;

  /* New resources/data for CDE compatibility. */
  Widget		edit_box;
  XmStringTable		items;
  int			item_count;
  int			visible_item_count;
  short			columns;
  XtEnum		position_mode;

  
#ifdef _SGIMOTIF
  XtPointer	_SG_vendorExtension;
#endif

} XmComboBoxPart;


/* Full instance record declaration. */	

typedef struct _XmComboBoxRec {
  CorePart		core;
  CompositePart		composite;
  ConstraintPart	constraint;
  XmManagerPart		manager;
  XmComboBoxPart 	combo_box;
} XmComboBoxRec;


/********    Private Function Declarations    ********/

/********    End Private Function Declarations    ********/


/* Access macros */
#define CB_ArrowPressed(w)   (((XmComboBoxWidget)(w))->combo_box.arrow_pressed)
#define CB_ArrowSize(w)	     (((XmComboBoxWidget)(w))->combo_box.arrow_size)
#define CB_ArrowSpacing(w)   (((XmComboBoxWidget)(w))->combo_box.arrow_spacing)
#define CB_EditBox(w) 	     (((XmComboBoxWidget)(w))->combo_box.edit_box)
#define CB_HighlightThickness(w)	\
	(((XmComboBoxWidget)(w))->combo_box.highlight_thickness)
#define CB_Highlighted(w)    (((XmComboBoxWidget)(w))->combo_box.highlighted)
#define CB_HitRect(w)	     (((XmComboBoxWidget)(w))->combo_box.hit_rect)
#define CB_List(w) 	     (((XmComboBoxWidget)(w))->combo_box.list)
#define CB_ListShell(w)      (((XmComboBoxWidget)(w))->combo_box.list_shell)
#define CB_MarginHeight(w)   (((XmComboBoxWidget)(w))->combo_box.margin_height)
#define CB_MarginWidth(w)    (((XmComboBoxWidget)(w))->combo_box.margin_width)
#define CB_MatchBehavior(w)		\
	(((XmComboBoxWidget)(w))->combo_box.match_behavior)
#define CB_PositionMode(w)   (((XmComboBoxWidget)(w))->combo_box.position_mode)
#define CB_RenderTable(w)    (((XmComboBoxWidget)(w))->combo_box.render_table)
#define CB_ScrolledW(w)      (((XmComboBoxWidget)(w))->combo_box.scrolled_w)
#define CB_SelectionCB(w)		\
	(((XmComboBoxWidget)(w))->combo_box.selection_callback)
#define CB_ShellState(w)     (((XmComboBoxWidget)(w))->combo_box.shell_state)
#define CB_TextChanged(w)    (((XmComboBoxWidget)(w))->combo_box.text_changed)
#define CB_Type(w) 	     (((XmComboBoxWidget)(w))->combo_box.type)


#ifdef __cplusplus
}  /* Close scope of 'extern "C"' declaration which encloses file. */
#endif


#endif /* _XmComboBoxP_H */
/* DON'T ADD ANYTHING AFTER THIS #endif */
