Blame lib/Xm/PanedP.h

Packit b099d7
/*
Packit b099d7
 * Motif
Packit b099d7
 *
Packit b099d7
 * Copyright (c) 1987-2012, The Open Group. All rights reserved.
Packit b099d7
 *
Packit b099d7
 * These libraries and programs are free software; you can
Packit b099d7
 * redistribute them and/or modify them under the terms of the GNU
Packit b099d7
 * Lesser General Public License as published by the Free Software
Packit b099d7
 * Foundation; either version 2 of the License, or (at your option)
Packit b099d7
 * any later version.
Packit b099d7
 *
Packit b099d7
 * These libraries and programs are distributed in the hope that
Packit b099d7
 * they will be useful, but WITHOUT ANY WARRANTY; without even the
Packit b099d7
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
Packit b099d7
 * PURPOSE. See the GNU Lesser General Public License for more
Packit b099d7
 * details.
Packit b099d7
 *
Packit b099d7
 * You should have received a copy of the GNU Lesser General Public
Packit b099d7
 * License along with these librararies and programs; if not, write
Packit b099d7
 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
Packit b099d7
 * Floor, Boston, MA 02110-1301 USA
Packit b099d7
 * 
Packit b099d7
 */
Packit b099d7
Packit b099d7
#ifndef _XmPanedP_h
Packit b099d7
#define _XmPanedP_h
Packit b099d7
Packit b099d7
#if defined(VMS) || defined(__VMS)
Packit b099d7
#include <X11/apienvset.h>
Packit b099d7
#endif
Packit b099d7
Packit b099d7
#include <Xm/ManagerP.h>
Packit b099d7
#include <Xm/Paned.h>
Packit b099d7
Packit b099d7
#ifdef __cplusplus
Packit b099d7
extern "C" {
Packit b099d7
#endif
Packit b099d7
Packit b099d7
/*********************************************************************
Packit b099d7
 *
Packit b099d7
 * Paned Widget Private Data
Packit b099d7
 *
Packit b099d7
 *********************************************************************/
Packit b099d7
Packit b099d7
/* New fields for the Paned widget class record */
Packit b099d7
Packit b099d7
typedef struct _XmPanedClassPart {
Packit b099d7
    XtPointer extension;	
Packit b099d7
} XmPanedClassPart;
Packit b099d7
Packit b099d7
/* Full Class record declaration */
Packit b099d7
typedef struct _XmPanedClassRec {
Packit b099d7
    CoreClassPart       core_class;
Packit b099d7
    CompositeClassPart  composite_class;
Packit b099d7
    ConstraintClassPart constraint_class;
Packit b099d7
    XmManagerClassPart	manager_class;
Packit b099d7
    XmPanedClassPart     paned_class;
Packit b099d7
} XmPanedClassRec;
Packit b099d7
Packit b099d7
extern XmPanedClassRec xmPanedClassRec;
Packit b099d7
Packit b099d7
/* Paned constraint record */
Packit b099d7
typedef struct _XmPanedConstraintsPart {
Packit b099d7
  /* Resources. */
Packit b099d7
    Dimension	min;		/* Minimum height */
Packit b099d7
    Dimension	max;		/* Maximum height */
Packit b099d7
    Boolean	allow_resize;	/* TRUE iff child resize requests are ok */
Packit b099d7
    Boolean     show_sash;	/* TRUE iff child will have sash below it,
Packit b099d7
				   when it is not the bottom pane. */
Packit b099d7
    Boolean	skip_adjust;	/* TRUE iff child's height should not be */
Packit b099d7
				/* changed without explicit user action. */
Packit b099d7
    int		position;	/* position location in Paned (relative to
Packit b099d7
				   other children) ** NIY ** */
Packit b099d7
    Dimension   preferred_size;	/* The Preferred size of the pane.
Packit b099d7
				   Iff this is zero then ask child for size.*/
Packit b099d7
    Boolean     resize_to_pref;	/* resize this pane to its preferred size
Packit b099d7
				   on a resize or change managed after 
Packit b099d7
				   realize. */
Packit b099d7
    Boolean     is_a_pane;	/* INTERNAL INFO */
Packit b099d7
Packit b099d7
Packit b099d7
  /* Private state. */
Packit b099d7
    Position	delta;		/* Desired Location */
Packit b099d7
    Position	olddelta;	/* The last value of delta. */
Packit b099d7
    Dimension	wp_size;	/* widget's preferred on size */ 
Packit b099d7
    Dimension	wp_off_size;	/* widget's preferred off size */ 
Packit b099d7
    int         size;		/* the size the widget will actually get. */
Packit b099d7
    Widget	sash;		/* The sash for this child */
Packit b099d7
    Widget      separator;      /* The separator for this child */
Packit b099d7
Packit b099d7
    Boolean     prefs_inited;	/* Preferences have been inited... */
Packit b099d7
} XmPanedConstraintsPart, *Pane;
Packit b099d7
Packit b099d7
typedef struct _XmPanedConstraintsRec {
Packit b099d7
    XmManagerConstraintPart	manager;
Packit b099d7
    XmPanedConstraintsPart	paned;
Packit b099d7
} XmPanedConstraintsRec, *XmPanedConstraints;
Packit b099d7
Packit b099d7
/*
Packit b099d7
 * Ugliness:  the XmOffset macros require this naming convention, yet
Packit b099d7
 * epak already depends on the pluralized name ;(
Packit b099d7
 */
Packit b099d7
typedef XmPanedConstraintsPart XmPanedConstraintPart;
Packit b099d7
Packit b099d7
/*
Packit b099d7
 * The Pane Stack Structure.
Packit b099d7
 */
Packit b099d7
Packit b099d7
typedef struct _PaneStack {
Packit b099d7
    struct _PaneStack * next;	/* The next element on the stack. */
Packit b099d7
    Pane pane;			/* The pane in this element on the stack. */
Packit b099d7
    int start_size;		/* The size of this element when it was pushed
Packit b099d7
				   onto the stack. */
Packit b099d7
} PaneStack;
Packit b099d7
Packit b099d7
#define NO_ADJUST    ((char) 0)
Packit b099d7
#define BEGAN_ADJUST ((char) 1)
Packit b099d7
Packit b099d7
/* New Fields for the XmPaned widget record */
Packit b099d7
typedef struct {
Packit b099d7
    /* resources */
Packit b099d7
    Position    sash_indent;               /* Location of sashs (per motif) */
Packit b099d7
    Boolean     refiguremode;              /* Whether to refigure changes 
Packit b099d7
					      right now */
Packit b099d7
    XtTranslations sash_translations;      /* sash translation table */
Packit b099d7
    Dimension   internal_bw;	           /* internal border width. */
Packit b099d7
    unsigned char orientation;	           /* Orientation of paned widget. */
Packit b099d7
Packit b099d7
    Cursor	cursor;		/* Cursor for paned window */
Packit b099d7
Packit b099d7
    /* Things from Motif behaviour */
Packit b099d7
    Boolean     separator_on;        /* make separator visible */
Packit b099d7
    Dimension   margin_width;        /* space between right and left edges of
Packit b099d7
                                        Paned window and it's children */
Packit b099d7
    Dimension   margin_height;       /* space between top and bottom edges of
Packit b099d7
                                        Paned window and it's children */
Packit b099d7
Packit b099d7
    /* sash modifying resources */
Packit b099d7
    Dimension   sash_width;            /* Modify sash width */
Packit b099d7
    Dimension   sash_height;           /* Modify sash height */
Packit b099d7
    Dimension   sash_shadow_thickness; /* Modify sash shadow_thickness */
Packit b099d7
Packit b099d7
    /* Private */
Packit b099d7
    Boolean	recursively_called;        /* for ChangeManaged */
Packit b099d7
    Boolean	resize_children_to_pref;   /* override constraint resources
Packit b099d7
					      and resize all children to
Packit b099d7
					      preferred size. */
Packit b099d7
    short       increment_count;           /* Sash increment count */
Packit b099d7
    char	repane_status;		   /* current adjust state. */
Packit b099d7
    Position    start_loc;	           /* mouse origin when adjusting */
Packit b099d7
    GC          flipgc;                    /* GC to use when animating
Packit b099d7
					      borders */
Packit b099d7
    short	num_panes;                 /* count of managed panes */
Packit b099d7
    short       num_slots;            	   /*number of avail. slots for kids */
Packit b099d7
Packit b099d7
    PaneStack * stack;		           /* The pane stack for this widget.*/
Packit b099d7
    WidgetList  managed_children;	   /* keep track of managed children */
Packit b099d7
 
Packit b099d7
    Boolean     allow_unused_space;      /* should the paned widget allow
Packit b099d7
                                          * a pane to be shrunk to the point
Packit b099d7
                                          * that there is unused space at
Packit b099d7
                                          * the bottom/right of the widget */
Packit b099d7
} XmPanedPart;
Packit b099d7
Packit b099d7
/**************************************************************************
Packit b099d7
 *
Packit b099d7
 * Full instance record declaration
Packit b099d7
 *
Packit b099d7
 **************************************************************************/
Packit b099d7
Packit b099d7
typedef struct _XmPanedRec {
Packit b099d7
    CorePart       core;
Packit b099d7
    CompositePart  composite;
Packit b099d7
    ConstraintPart constraint;
Packit b099d7
    XmManagerPart  manager;
Packit b099d7
    XmPanedPart     paned;
Packit b099d7
} XmPanedRec;
Packit b099d7
Packit b099d7
/************************************************************
Packit b099d7
 *
Packit b099d7
 *  Functions
Packit b099d7
 *
Packit b099d7
 ************************************************************/
Packit b099d7
void _XmFromPanedPixels(Widget, int, XtArgVal *);
Packit b099d7
XmImportOperator _XmToPanedPixels(Widget, int, XtArgVal *);
Packit b099d7
Packit b099d7
Packit b099d7
/************************************************************
Packit b099d7
 *
Packit b099d7
 *  Macros
Packit b099d7
 *
Packit b099d7
 ************************************************************/
Packit b099d7
/*
Packit b099d7
 * XmResolvePartOffsets stuff follows
Packit b099d7
 */
Packit b099d7
Packit b099d7
#define XmPaned_sash_indent(w) (((XmPanedWidget)(w))->paned.sash_indent)
Packit b099d7
#define XmPaned_refiguremode(w) (((XmPanedWidget)(w))->paned.refiguremode)
Packit b099d7
#define XmPaned_sash_translations(w) (((XmPanedWidget)(w))->paned.sash_translations)
Packit b099d7
#define XmPaned_internal_bw(w) (((XmPanedWidget)(w))->paned.internal_bw)
Packit b099d7
#define XmPaned_orientation(w) (((XmPanedWidget)(w))->paned.orientation)
Packit b099d7
#define XmPaned_cursor(w) (((XmPanedWidget)(w))->paned.cursor)
Packit b099d7
#define XmPaned_separator_on(w) (((XmPanedWidget)(w))->paned.separator_on)
Packit b099d7
#define XmPaned_margin_width(w) (((XmPanedWidget)(w))->paned.margin_width)
Packit b099d7
#define XmPaned_margin_height(w) (((XmPanedWidget)(w))->paned.margin_height)
Packit b099d7
#define XmPaned_sash_width(w) (((XmPanedWidget)(w))->paned.sash_width)
Packit b099d7
#define XmPaned_sash_height(w) (((XmPanedWidget)(w))->paned.sash_height)
Packit b099d7
#define XmPaned_sash_shadow_thickness(w) (((XmPanedWidget)(w))->paned.sash_shadow_thickness)
Packit b099d7
#define XmPaned_recursively_called(w) (((XmPanedWidget)(w))->paned.recursively_called)
Packit b099d7
#define XmPaned_resize_children_to_pref(w) (((XmPanedWidget)(w))->paned.resize_children_to_pref)
Packit b099d7
#define XmPaned_increment_count(w) (((XmPanedWidget)(w))->paned.increment_count)
Packit b099d7
#define XmPaned_repane_status(w) (((XmPanedWidget)(w))->paned.repane_status)
Packit b099d7
#define XmPaned_start_loc(w) (((XmPanedWidget)(w))->paned.start_loc)
Packit b099d7
#define XmPaned_flipgc(w) (((XmPanedWidget)(w))->paned.flipgc)
Packit b099d7
#define XmPaned_num_panes(w) (((XmPanedWidget)(w))->paned.num_panes)
Packit b099d7
#define XmPaned_num_slots(w) (((XmPanedWidget)(w))->paned.num_slots)
Packit b099d7
#define XmPaned_stack(w) (((XmPanedWidget)(w))->paned.stack)
Packit b099d7
#define XmPaned_managed_children(w) (((XmPanedWidget)(w))->paned.managed_children)
Packit b099d7
#define XmPaned_allow_unused_space(w) (((XmPanedWidget)(w))->paned.allow_unused_space)
Packit b099d7
Packit b099d7
#define XmPanedC_min(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.min)
Packit b099d7
#define XmPanedC_max(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.max)
Packit b099d7
#define XmPanedC_allow_resize(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.allow_resize)
Packit b099d7
#define XmPanedC_show_sash(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.show_sash)
Packit b099d7
#define XmPanedC_skip_adjust(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.skip_adjust)
Packit b099d7
#define XmPanedC_position(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.position)
Packit b099d7
#define XmPanedC_preferred_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.preferred_size)
Packit b099d7
#define XmPanedC_resize_to_pref(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.resize_to_pref)
Packit b099d7
#define XmPanedC_is_a_pane(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.is_a_pane)
Packit b099d7
#define XmPanedC_delta(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.delta)
Packit b099d7
#define XmPanedC_olddelta(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.olddelta)
Packit b099d7
#define XmPanedC_wp_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.wp_size)
Packit b099d7
#define XmPanedC_wp_off_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.wp_off_size)
Packit b099d7
#define XmPanedC_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.size)
Packit b099d7
#define XmPanedC_sash(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.sash)
Packit b099d7
#define XmPanedC_separator(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.separator)
Packit b099d7
#define XmPanedC_prefs_inited(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.prefs_inited)
Packit b099d7
Packit b099d7
#define ForceSashOff(pane) ((pane)->min == (pane)->max)
Packit b099d7
#define PaneConsRec(w)	((XmPanedConstraints)(w)->core.constraints)
Packit b099d7
#define PaneInfo(w) (&(((XmPanedConstraintsRec*)((w)->core.constraints))->paned))
Packit b099d7
#define HasSash(w)	(XmPanedC_sash(w) != NULL)
Packit b099d7
#define HasSep(w)	(XmPanedC_separator(w) != NULL)
Packit b099d7
Packit b099d7
#define PaneIndex(w)	(XmPanedC_position(w))
Packit b099d7
#define IsVert(w)       (XmPaned_orientation(w) == XmVERTICAL)
Packit b099d7
Packit b099d7
#define IsLastPane(pw, childP) ((XmPaned_managed_children((pw)) + \
Packit b099d7
				 XmPaned_num_panes((pw)) - 1) == childP)
Packit b099d7
Packit b099d7
#define ForAllPaned(pw, childP) \
Packit b099d7
  for ( ((childP) = (XmPaned_managed_children((pw)))) ; \
Packit b099d7
	((childP) < ((XmPaned_managed_children((pw))) \
Packit b099d7
                    + (XmPaned_num_panes((pw))))) ; \
Packit b099d7
	(childP)++ )
Packit b099d7
Packit b099d7
#define NthPane(pw, paneIndex) (XmPaned_managed_children((pw)) + (paneIndex))
Packit b099d7
Packit b099d7
#ifdef _cplusplus
Packit b099d7
}	/* Closes scope of 'extern "C"' declaration */
Packit b099d7
#endif
Packit b099d7
Packit b099d7
#if defined(VMS) || defined(__VMS)
Packit b099d7
#include <X11/apienvrst.h>
Packit b099d7
#endif
Packit b099d7
Packit b099d7
#endif /* _XmPanedP_h */
Packit b099d7
/* DON'T ADD STUFF AFTER THIS #endif */