[gnu.gcc.bug] Complicated assignment causes gcc 1.33 self-abort if using -O

earle@SUN.COM (Greg Earle) (02/20/89)

The following source file self-aborts if using the optimizer.  The compiler
aborts when compiling the first two lines of function `RedrawButtonFace'.
(I wish I could make this shorter, but X programs have the problem of
massive include file dependancies, so even though you've shrunken down the
problem to one function, you end up having to suck in most of the .cpp file
anyway, just to satisfy all the type declarations et al.  *sigh* ... )

Note that the compilation works just fine without the optimizer.  I have this
sneaking suspicion that the same problem that plagued me before (which caused
X11 R3's fonts/bdftosnf/showsnf.c to blow up) is again the culprit; gcc is
self-aborting at the very same place (line 808 of `final.c'), when the
PREV_INSN(insn) != last_ignored_compare.  Arrgggh ...

	- Greg Earle
	  Sun Los Angeles - JPL on-site Software Support
	  earle@Sun.COM

---------------------  >8  Cut here `PButton.cpp'  8<  ----------------------

# 1 "PButton.c"

# 1 "/usr/include/stdio.h"

extern	struct	_iobuf {
	int	_cnt;
	unsigned char *_ptr;
	unsigned char *_base;
	int	_bufsiz;
	short	_flag;
	char	_file;		 
} _iob[];

extern struct _iobuf 	*fopen();
extern struct _iobuf 	*fdopen();
extern struct _iobuf 	*freopen();
extern struct _iobuf 	*popen();
extern struct _iobuf 	*tmpfile();
extern long	ftell();
extern char	*fgets();
extern char	*gets();

extern char	*ctermid();
extern char	*cuserid();
extern char	*tempnam();
extern char	*tmpnam();

# 31 "PButton.c"

# 1 "/usr/include/string.h"

extern char
	*strcpy(),
	*strncpy(),
	*strcat(),
	*strncat(),
	*strchr(),
	*strrchr(),
	*strpbrk(),
	*strtok(),
	*strdup();
extern int
	strcmp(),
	strncmp(),
	strlen(),
	strspn(),
	strcspn();
# 32 "PButton.c"

# 1 "/usr/include/ctype.h"
 
extern	char	_ctype_[];

# 33 "PButton.c"

# 1 "../..//X11/Intrinsic.h"
 
# 1 "../..//X11/Xlib.h"
 
# 1 "/usr/local/lib/gcc-include/sys/types.h"
 
# 1 "/usr/include/sys/sysmacros.h"
 
# 16 "/usr/local/lib/gcc-include/sys/types.h"

typedef	unsigned char	u_char;
typedef	unsigned short	u_short;
typedef	unsigned int	u_int;
typedef	unsigned long	u_long;
typedef	unsigned short	ushort;		 
typedef	unsigned int	uint;		 

typedef	struct	_physadr { short r[1]; } *physadr;
typedef	struct	label_t	{
	int	val[13];
} label_t;

typedef	struct	_quad { long val[2]; } quad;
typedef	long	daddr_t;
typedef	char *	caddr_t;
typedef	u_long	ino_t;
typedef	long	swblk_t;

# 1 "/usr/local/lib/gcc-include/stddef.h"

typedef long ptrdiff_t;

typedef unsigned long size_t;

# 56 "/usr/local/lib/gcc-include/sys/types.h"
 
typedef	long	time_t;

typedef	short	dev_t;
typedef	long	off_t;
typedef	u_short	uid_t;
typedef	u_short	gid_t;
typedef	long	key_t;

typedef	long	fd_mask;

typedef	struct fd_set {
	fd_mask	fds_bits[(((256 )+(( (sizeof(fd_mask) * 8		)	)-1))/( (sizeof(fd_mask) * 8		)	)) ];
} fd_set;

typedef	char *	addr_t;

# 119 "/usr/local/lib/gcc-include/sys/types.h"

# 34 "../..//X11/Xlib.h"

# 1 "../..//X11/X.h"
 
typedef unsigned long XID;

typedef XID Window;
typedef XID Drawable;
typedef XID Font;
typedef XID Pixmap;
typedef XID Cursor;
typedef XID Colormap;
typedef XID GContext;
typedef XID KeySym;

typedef unsigned long Mask;

typedef unsigned long Atom;

typedef unsigned long VisualID;

typedef unsigned long Time;

typedef unsigned char KeyCode;

# 311 "../..//X11/X.h"

# 37 "../..//X11/Xlib.h"

typedef struct _XExtData {
	int number;		 
	struct _XExtData *next;	 
	int (*free_private)();	 
	char *private_data;	 
} XExtData;

typedef struct {		 
	int extension;		 
	int major_opcode;	 
	int first_event;	 
	int first_error;	 
} XExtCodes;

typedef struct _XExten {	 
	struct _XExten *next;	 
	XExtCodes codes;	 
	int (*create_GC)();	 
	int (*copy_GC)();	 
	int (*flush_GC)();	 
	int (*free_GC)();	 
	int (*create_Font)();	 
	int (*free_Font)();	 
	int (*close_display)();	 
	int (*error)();		 
	int (*error_string)();   
} _XExtension;

typedef struct {
	int function;		 
	unsigned long plane_mask; 
	unsigned long foreground; 
	unsigned long background; 
	int line_width;		 
	int line_style;	 	 
	int cap_style;	  	 

	int join_style;	 	 
	int fill_style;	 	 

	int fill_rule;	  	 
	int arc_mode;		 
	Pixmap tile;		 
	Pixmap stipple;		 
	int ts_x_origin;	 
	int ts_y_origin;
        Font font;	         
	int subwindow_mode;      
	int  graphics_exposures; 
	int clip_x_origin;	 
	int clip_y_origin;
	Pixmap clip_mask;	 
	int dash_offset;	 
	char dashes;
} XGCValues;

typedef struct _XGC {
    XExtData *ext_data;	 
    GContext gid;	 
    int  rects;		 
    int  dashes;	 
    unsigned long dirty; 
    XGCValues values;	 
} *GC;

typedef struct {
	XExtData *ext_data;	 
	VisualID visualid;	 
	int class;		 
	unsigned long red_mask, green_mask, blue_mask;	 
	int bits_per_rgb;	 
	int map_entries;	 
} Visual;

typedef struct {
	int depth;		 
	int nvisuals;		 
	Visual *visuals;	 
} Depth;

typedef struct {
	XExtData *ext_data;	 
	struct _XDisplay *display; 
	Window root;		 
	int width, height;	 
	int mwidth, mheight;	 
	int ndepths;		 
	Depth *depths;		 
	int root_depth;		 
	Visual *root_visual;	 
	GC default_gc;		 
	Colormap cmap;		 
	unsigned long white_pixel;
	unsigned long black_pixel;	 
	int max_maps, min_maps;	 
	int backing_store;	 
	int  save_unders;	
	long root_input_mask;	 
} Screen;

typedef struct {
	XExtData *ext_data;	 
	int depth;		 
	int bits_per_pixel;	 
	int scanline_pad;	 
} ScreenFormat;

typedef struct {
    Pixmap background_pixmap;	 
    unsigned long background_pixel;	 
    Pixmap border_pixmap;	 
    unsigned long border_pixel;	 
    int bit_gravity;		 
    int win_gravity;		 
    int backing_store;		 
    unsigned long backing_planes; 
    unsigned long backing_pixel; 
    int  save_under;		 
    long event_mask;		 
    long do_not_propagate_mask;	 
    int  override_redirect;	 
    Colormap colormap;		 
    Cursor cursor;		 
} XSetWindowAttributes;

typedef struct {
    int x, y;			 
    int width, height;		 
    int border_width;		 
    int depth;          	 
    Visual *visual;		 
    Window root;        	 
    int class;			 
    int bit_gravity;		 
    int win_gravity;		 
    int backing_store;		 
    unsigned long backing_planes; 
    unsigned long backing_pixel; 
    int  save_under;		 
    Colormap colormap;		 
    int  map_installed;		 
    int map_state;		 
    long all_event_masks;	 
    long your_event_mask;	 
    long do_not_propagate_mask;  
    int  override_redirect;	 
    Screen *screen;		 
} XWindowAttributes;

typedef struct {
	int family;		 
	int length;		 
	char *address;		 
} XHostAddress;

typedef struct _XImage {
    int width, height;		 
    int xoffset;		 
    int format;			 
    char *data;			 
    int byte_order;		 
    int bitmap_unit;		 
    int bitmap_bit_order;	 
    int bitmap_pad;		 
    int depth;			 
    int bytes_per_line;		 
    int bits_per_pixel;		 
    unsigned long red_mask;	 
    unsigned long green_mask;
    unsigned long blue_mask;
    char *obdata;		 
    struct funcs {		 
	struct _XImage *(*create_image)();
	int (*destroy_image)();
	unsigned long (*get_pixel)();
	int (*put_pixel)();
	struct _XImage *(*sub_image)();
	int (*add_pixel)();
	} f;
} XImage;

typedef struct {
    int x, y;
    int width, height;
    int border_width;
    Window sibling;
    int stack_mode;
} XWindowChanges;

typedef struct {
	unsigned long pixel;
	unsigned short red, green, blue;
	char flags;   
	char pad;
} XColor;

typedef struct {
    short x1, y1, x2, y2;
} XSegment;

typedef struct {
    short x, y;
} XPoint;
    
typedef struct {
    short x, y;
    unsigned short width, height;
} XRectangle;
    
typedef struct {
    short x, y;
    unsigned short width, height;
    short angle1, angle2;
} XArc;

typedef struct {
        int key_click_percent;
        int bell_percent;
        int bell_pitch;
        int bell_duration;
        int led;
        int led_mode;
        int key;
        int auto_repeat_mode;    
} XKeyboardControl;

typedef struct {
        int key_click_percent;
	int bell_percent;
	unsigned int bell_pitch, bell_duration;
	unsigned long led_mask;
	int global_auto_repeat;
	char auto_repeats[32];
} XKeyboardState;

typedef struct {
        Time time;
	short x, y;
} XTimeCoord;

typedef struct {
 	int max_keypermod;	 
 	KeyCode *modifiermap;	 
} XModifierKeymap;

XModifierKeymap *XNewModifiermap(),
		*XGetModifierMapping(),
		*XDeleteModifiermapEntry(),
		*XInsertModifiermapEntry();

typedef struct _XDisplay {
	XExtData *ext_data;	 
	struct _XDisplay *next;  
	int fd;			 
	int lock;		 
	int proto_major_version; 
	int proto_minor_version; 
	char *vendor;		 
        long resource_base;	 
	long resource_mask;	 
	long resource_id;	 
	int resource_shift;	 
	XID (*resource_alloc)();  
	int byte_order;		 
	int bitmap_unit;	 
	int bitmap_pad;		 
	int bitmap_bit_order;	 
	int nformats;		 
	ScreenFormat *pixmap_format;	 
	int vnumber;		 
	int release;		 
	struct _XSQEvent *head, *tail;	 
	int qlen;		 
	unsigned long last_request_read;  
	unsigned long request;	 
	char *last_req;		 
	char *buffer;		 
	char *bufptr;		 
	char *bufmax;		 
	unsigned max_request_size;  
	struct _XrmHashBucketRec *db;
	int (*synchandler)();	 
	char *display_name;	 
	int default_screen;	 
	int nscreens;		 
	Screen *screens;	 
	unsigned long motion_buffer;	 
	Window current;		 
	int min_keycode;	 
	int max_keycode;	 
	KeySym *keysyms;	 
	XModifierKeymap *modifiermap;	 
	int keysyms_per_keycode; 
	char *xdefaults;	 
	char *scratch_buffer;	 
	unsigned long scratch_length;	 
	int ext_number;		 
	_XExtension *ext_procs;	 

	int  (*event_vec[128])();   
	int  (*wire_vec[128])();  
	KeySym lock_meaning;	    
	struct XKeytrans *key_bindings;  
	Font cursor_font;	    
} Display;

typedef struct {
	int type;		 
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;	         
	Window root;	         
	Window subwindow;	 
	Time time;		 
	int x, y;		 
	int x_root, y_root;	 
	unsigned int state;	 
	unsigned int keycode;	 
	int  same_screen;	 
} XKeyEvent;
typedef XKeyEvent XKeyPressedEvent;
typedef XKeyEvent XKeyReleasedEvent;

typedef struct {
	int type;		 
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;	         
	Window root;	         
	Window subwindow;	 
	Time time;		 
	int x, y;		 
	int x_root, y_root;	 
	unsigned int state;	 
	unsigned int button;	 
	int  same_screen;	 
} XButtonEvent;
typedef XButtonEvent XButtonPressedEvent;
typedef XButtonEvent XButtonReleasedEvent;

typedef struct {
	int type;		 
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;	         
	Window root;	         
	Window subwindow;	 
	Time time;		 
	int x, y;		 
	int x_root, y_root;	 
	unsigned int state;	 
	char is_hint;		 
	int  same_screen;	 
} XMotionEvent;
typedef XMotionEvent XPointerMovedEvent;

typedef struct {
	int type;		 
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;	         
	Window root;	         
	Window subwindow;	 
	Time time;		 
	int x, y;		 
	int x_root, y_root;	 
	int mode;		 
	int detail;
	 
	int  same_screen;	 
	int  focus;		 
	unsigned int state;	 
} XCrossingEvent;
typedef XCrossingEvent XEnterWindowEvent;
typedef XCrossingEvent XLeaveWindowEvent;

typedef struct {
	int type;		 
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;		 
	int mode;		 
	int detail;
	 
} XFocusChangeEvent;
typedef XFocusChangeEvent XFocusInEvent;
typedef XFocusChangeEvent XFocusOutEvent;

 
typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;
	char key_vector[32];
} XKeymapEvent;	

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;
	int x, y;
	int width, height;
	int count;		 
} XExposeEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Drawable drawable;
	int x, y;
	int width, height;
	int count;		 
	int major_code;		 
	int minor_code;		 
} XGraphicsExposeEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Drawable drawable;
	int major_code;		 
	int minor_code;		 
} XNoExposeEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;
	int state;		 
} XVisibilityEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window parent;		 
	Window window;		 
	int x, y;		 
	int width, height;	 
	int border_width;	 
	int  override_redirect;	 
} XCreateWindowEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window event;
	Window window;
} XDestroyWindowEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window event;
	Window window;
	int  from_configure;
} XUnmapEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window event;
	Window window;
	int  override_redirect;	 
} XMapEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window parent;
	Window window;
} XMapRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window event;
	Window window;
	Window parent;
	int x, y;
	int  override_redirect;
} XReparentEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window event;
	Window window;
	int x, y;
	int width, height;
	int border_width;
	Window above;
	int  override_redirect;
} XConfigureEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window event;
	Window window;
	int x, y;
} XGravityEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;
	int width, height;
} XResizeRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window parent;
	Window window;
	int x, y;
	int width, height;
	int border_width;
	Window above;
	int detail;		 
	unsigned long value_mask;
} XConfigureRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window event;
	Window window;
	int place;		 
} XCirculateEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window parent;
	Window window;
	int place;		 
} XCirculateRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;
	Atom atom;
	Time time;
	int state;		 
} XPropertyEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;
	Atom selection;
	Time time;
} XSelectionClearEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window owner;
	Window requestor;
	Atom selection;
	Atom target;
	Atom property;
	Time time;
} XSelectionRequestEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window requestor;
	Atom selection;
	Atom target;
	Atom property;		 
	Time time;
} XSelectionEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;
	Colormap colormap;	 
	int  new;
	int state;		 
} XColormapEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;
	Atom message_type;
	int format;
	union {
		char b[20];
		short s[10];
		long l[5];
		} data;
} XClientMessageEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display;	 
	Window window;		 
	int request;		 

	int first_keycode;	 
	int count;		 
} XMappingEvent;

typedef struct {
	int type;
	Display *display;	 
	XID resourceid;		 
	unsigned long serial;	 
	unsigned char error_code;	 
	unsigned char request_code;	 
	unsigned char minor_code;	 
} XErrorEvent;

typedef struct {
	int type;
	unsigned long serial;	 
	int  send_event;	 
	Display *display; 
	Window window;	 
} XAnyEvent;

typedef union _XEvent {
        int type;		 
	XAnyEvent xany;
	XKeyEvent xkey;
	XButtonEvent xbutton;
	XMotionEvent xmotion;
	XCrossingEvent xcrossing;
	XFocusChangeEvent xfocus;
	XExposeEvent xexpose;
	XGraphicsExposeEvent xgraphicsexpose;
	XNoExposeEvent xnoexpose;
	XVisibilityEvent xvisibility;
	XCreateWindowEvent xcreatewindow;
	XDestroyWindowEvent xdestroywindow;
	XUnmapEvent xunmap;
	XMapEvent xmap;
	XMapRequestEvent xmaprequest;
	XReparentEvent xreparent;
	XConfigureEvent xconfigure;
	XGravityEvent xgravity;
	XResizeRequestEvent xresizerequest;
	XConfigureRequestEvent xconfigurerequest;
	XCirculateEvent xcirculate;
	XCirculateRequestEvent xcirculaterequest;
	XPropertyEvent xproperty;
	XSelectionClearEvent xselectionclear;
	XSelectionRequestEvent xselectionrequest;
	XSelectionEvent xselection;
	XColormapEvent xcolormap;
	XClientMessageEvent xclient;
	XMappingEvent xmapping;
	XErrorEvent xerror;
	XKeymapEvent xkeymap;
	long pad[24];
} XEvent;
 
typedef struct _XSQEvent {
    struct _XSQEvent *next;
    XEvent event;
} _XQEvent;

typedef struct {
    short	lbearing;	 
    short	rbearing;	 
    short	width;		 
    short	ascent;		 
    short	descent;	 
    unsigned short attributes;	 
} XCharStruct;

typedef struct {
    Atom name;
    unsigned long card32;
} XFontProp;

typedef struct {
    XExtData	*ext_data;	 
    Font        fid;             
    unsigned	direction;	 
    unsigned	min_char_or_byte2; 
    unsigned	max_char_or_byte2; 
    unsigned	min_byte1;	 
    unsigned	max_byte1;	 
    int 	all_chars_exist; 
    unsigned	default_char;	 
    int         n_properties;    
    XFontProp	*properties;	 
    XCharStruct	min_bounds;	 
    XCharStruct	max_bounds;	 
    XCharStruct	*per_char;	 
    int		ascent;		 
    int		descent;	 
} XFontStruct;

typedef struct {
    char *chars;		 
    int nchars;			 
    int delta;			 
    Font font;			 
} XTextItem;

typedef struct {		 
    unsigned char byte1;
    unsigned char byte2;
} XChar2b;

typedef struct {
    XChar2b *chars;		 
    int nchars;			 
    int delta;			 
    Font font;			 
} XTextItem16;

XFontStruct *XLoadQueryFont(), *XQueryFont();

XTimeCoord *XGetMotionEvents();

typedef union { Display *display;
		GC gc;
		Visual *visual;
		Screen *screen;
		ScreenFormat *pixmap_format;
		XFontStruct *font; } XEDataObject;

Display *XOpenDisplay();

char *XFetchBytes();
char *XFetchBuffer();
char *XGetAtomName();
char *XGetDefault();
char *XDisplayName();
char *XKeysymToString();

int (*XSynchronize())();
int (*XSetAfterFunction())();
Atom XInternAtom();
Colormap XCopyColormapAndFree(), XCreateColormap();
Cursor XCreatePixmapCursor(), XCreateGlyphCursor(), XCreateFontCursor();
Font XLoadFont();
GC XCreateGC();
GContext XGContextFromGC();
Pixmap XCreatePixmap();
Pixmap XCreateBitmapFromData(), XCreatePixmapFromBitmapData();
Window XCreateSimpleWindow(), XGetSelectionOwner();
Window XCreateWindow(); 
Colormap *XListInstalledColormaps();
char **XListFonts(), **XListFontsWithInfo(), **XGetFontPath();
char **XListExtensions();
Atom *XListProperties();
XImage *XCreateImage(), *XGetImage(), *XGetSubImage();
XHostAddress *XListHosts();
KeySym XKeycodeToKeysym(), XLookupKeysym(), *XGetKeyboardMapping();
KeySym XStringToKeysym();
long XMaxRequestSize();
char *XResourceManagerString();
unsigned long XDisplayMotionBufferSize();
VisualID XVisualIDFromVisual();

XExtCodes *XInitExtension();
int (*XESetCreateGC())(), (*XESetCopyGC())(), (*XESetFlushGC())(),
    (*XESetFreeGC())(), (*XESetCreateFont())(), (*XESetFreeFont())(), 
    (*XESetCloseDisplay())(),
    (*XESetError())(), (*XESetErrorString())();
int  (*XESetWireToEvent())();
int  (*XESetEventToWire())();
XExtCodes *XAddExtension();
XExtData *XFindOnExtensionList();
XExtData **XEHeadOfExtensionList();
 
Window XRootWindow(), XDefaultRootWindow(), XRootWindowOfScreen();
Visual *XDefaultVisual(), *XDefaultVisualOfScreen();
GC XDefaultGC(), XDefaultGCOfScreen();
unsigned long XBlackPixel(), XWhitePixel(), XAllPlanes();
unsigned long XBlackPixelOfScreen(), XWhitePixelOfScreen();
unsigned long XNextRequest(), XLastKnownRequestProcessed();
char *XServerVendor(), *XDisplayString();
Colormap XDefaultColormap(), XDefaultColormapOfScreen();
Display *XDisplayOfScreen();
Screen *XScreenOfDisplay(), *XDefaultScreenOfDisplay();
long XEventMaskOfScreen();

# 32 "../..//X11/Intrinsic.h"

# 1 "../..//X11/Xutil.h"
 
typedef struct {
    	long flags;	 
	int x, y;
	int width, height;
	int min_width, min_height;
	int max_width, max_height;
    	int width_inc, height_inc;
	struct {
		int x;	 
		int y;	 
	} min_aspect, max_aspect;
} XSizeHints;

typedef struct {
	long flags;	 
	int  input;	 

	int initial_state;	 
	Pixmap icon_pixmap;	 
	Window icon_window; 	 
	int icon_x, icon_y; 	 
	Pixmap icon_mask;	 
	XID window_group;	 
	 
} XWMHints;

typedef struct {
	int min_width, min_height;
	int max_width, max_height;
	int width_inc, height_inc;
} XIconSize;

typedef struct {
	char *res_name;
	char *res_class;
} XClassHint;

typedef struct _XComposeStatus {
    char *compose_ptr;		 
    int chars_matched;		 
} XComposeStatus;

typedef struct _XRegion *Region; 

typedef struct {
  Visual *visual;
  VisualID visualid;
  int screen;
  int depth;
  int class;
  unsigned long red_mask;
  unsigned long green_mask;
  unsigned long blue_mask;
  int colormap_size;
  int bits_per_rgb;
} XVisualInfo;

typedef struct {
	Colormap colormap;
	unsigned long red_max;
	unsigned long red_mult;
	unsigned long green_max;
	unsigned long green_mult;
	unsigned long blue_max;
	unsigned long blue_mult;
	unsigned long base_pixel;
} XStandardColormap;

typedef int XContext;

extern int XSaveContext();  

extern int XFindContext();  

extern int XDeleteContext();  

XWMHints *XGetWMHints();
Region XCreateRegion(), XPolygonRegion();
XImage *XCreateImage();

XVisualInfo *XGetVisualInfo();

# 33 "../..//X11/Intrinsic.h"

# 1 "../..//X11/Xresource.h"
 
# 1 "/usr/local/lib/gcc-include/sys/types.h"
 
# 121 "/usr/local/lib/gcc-include/sys/types.h"

# 54 "../..//X11/Xresource.h"

extern char *Xpermalloc();
     
typedef int     XrmQuark, *XrmQuarkList;

typedef char *XrmString;
 
extern XrmQuark XrmStringToQuark();  
 
extern XrmString XrmQuarkToString();  

extern XrmQuark XrmUniqueQuark();

extern void XrmStringToQuarkList();
     
extern void XrmStringToBindingQuarkList();
     
typedef XrmQuark     XrmName;
typedef XrmQuarkList XrmNameList;

typedef XrmQuark     XrmClass;
typedef XrmQuarkList XrmClassList;

typedef XrmQuark     XrmRepresentation;

typedef struct {
    unsigned int    size;
    caddr_t	    addr;
} XrmValue, *XrmValuePtr;

typedef enum {XrmBindTightly, XrmBindLoosely} XrmBinding, *XrmBindingList;

typedef struct _XrmHashBucketRec *XrmHashBucket;
typedef XrmHashBucket *XrmHashTable;
typedef XrmHashTable XrmSearchList[];
typedef struct _XrmHashBucketRec *XrmDatabase;

extern void XrmInitialize();

extern void XrmQPutResource();

extern void XrmPutResource();

extern void XrmQPutStringResource();
     
extern void XrmPutStringResource();
     
extern void XrmPutLineResource();
     
extern  XrmQGetResource();

extern int  XrmGetResource();

extern int  XrmQGetSearchList();
     
extern int  XrmQGetSearchResource();
     
extern XrmDatabase XrmGetFileDatabase();
     
extern XrmDatabase XrmGetStringDatabase();

extern void XrmPutFileDatabase();

extern void XrmMergeDatabases();
     
typedef enum {
    XrmoptionNoArg,	 
    XrmoptionIsArg,      
    XrmoptionStickyArg,  
    XrmoptionSepArg,     
    XrmoptionResArg,	 
    XrmoptionSkipArg,    
    XrmoptionSkipLine    
} XrmOptionKind;

typedef struct {
    char	    *option;	     
    char	    *specifier;      
    XrmOptionKind   argKind;	     
    caddr_t	    value;	     
} XrmOptionDescRec, *XrmOptionDescList;

extern void XrmParseCommand();
     
# 34 "../..//X11/Intrinsic.h"

# 1 "../..//X11/Xos.h"
 
# 1 "/usr/local/lib/gcc-include/sys/types.h"
 
# 121 "/usr/local/lib/gcc-include/sys/types.h"

# 37 "../..//X11/Xos.h"

# 1 "/usr/include/strings.h"
 
char	*strcat();
char	*strncat();
int	strcmp();
int	strncmp();
char	*strcpy();
char	*strncpy();
int	strlen();
char	*index();
char	*rindex();
# 68 "../..//X11/Xos.h"

# 1 "/usr/include/sys/file.h"
 
# 37 "/usr/include/sys/file.h"

# 1 "/usr/include/sys/fcntlcom.h"
 
struct flock {
        short   l_type;		 
        short   l_whence;	 
        long    l_start;	 
        long    l_len;           
        short   l_pid;		 
        short   l_xxx;		 
};

# 39 "/usr/include/sys/file.h"

# 93 "/usr/include/sys/file.h"

# 79 "../..//X11/Xos.h"

# 1 "/usr/include/sys/time.h"
 
struct timeval {
	long	tv_sec;		 
	long	tv_usec;	 
};

struct timezone {
	int	tz_minuteswest;	 
	int	tz_dsttime;	 
};

struct	itimerval {
	struct	timeval it_interval;	 
	struct	timeval it_value;	 
};


# 1 "/usr/include/time.h"
 
struct tm {
	int	tm_sec;
	int	tm_min;
	int	tm_hour;
	int	tm_mday;
	int	tm_mon;
	int	tm_year;
	int	tm_wday;
	int	tm_yday;
	int	tm_isdst;
	char	*tm_zone;
	long	tm_gmtoff;
};

extern	struct tm *gmtime(), *localtime();
extern	char *asctime(), *ctime();
extern	void tzset(), tzsetwall();
# 62 "/usr/include/sys/time.h"

# 96 "../..//X11/Xos.h"

# 35 "../..//X11/Intrinsic.h"

typedef char *String;
typedef struct _WidgetRec *Widget;
typedef Widget *WidgetList;
typedef struct _WidgetClassRec *WidgetClass;
typedef struct _CompositeRec *CompositeWidget;
typedef struct _XtActionsRec *XtActionList;
typedef struct _XtEventRec *XtEventTable;
typedef struct _XtBoundAccActionRec *XtBoundAccActions;
typedef unsigned int   Cardinal;
typedef unsigned short  ShortCard;
typedef char	Boolean;
typedef unsigned long	*Opaque;
typedef struct _XtAppStruct *XtAppContext;
typedef unsigned long   XtValueMask;
typedef unsigned long   XtIntervalId;
typedef unsigned long   XtInputId;
typedef unsigned long	XtWorkProcId;
typedef unsigned int    XtGeometryMask;
typedef unsigned long   XtGCMask;    
typedef unsigned long   Pixel;	     
typedef short		Position;    
typedef ShortCard	Dimension;   

typedef long XtArgVal;

# 1 "../..//X11/Core.h"
 
extern  WidgetClass widgetClass;

# 95 "../..//X11/Intrinsic.h"

# 1 "../..//X11/Composite.h"
 
typedef struct _CompositeClassRec *CompositeWidgetClass;

extern void XtManageChildren ();
     
extern void XtManageChild ();

extern void XtUnmanageChildren ();

extern void XtUnmanageChild ();

extern  WidgetClass compositeWidgetClass;

# 96 "../..//X11/Intrinsic.h"

# 1 "../..//X11/Constraint.h"
 
typedef struct _ConstraintClassRec *ConstraintWidgetClass;

extern  WidgetClass constraintWidgetClass;
 
# 97 "../..//X11/Intrinsic.h"

extern void _XtConvertInitialize();

extern void XtStringConversionWarning();
        
typedef void (*XtConverter)();
     
typedef enum {
 
    XtAddress,      	 
    XtBaseOffset,   	 
    XtImmediate,    	 
    XtResourceString,	 
    XtResourceQuark	 
} XtAddressMode;

typedef struct {
    XtAddressMode   address_mode;
    caddr_t	    address_id;
    Cardinal	    size;
} XtConvertArgRec, *XtConvertArgList;

extern XtConvertArgRec colorConvertArgs[];
extern XtConvertArgRec screenConvertArg[];

extern void XtAppAddConverter();
     
     
extern void XtAddConverter();
     
extern void XtConvert();
     
extern void XtDirectConvert();
     
typedef struct _TranslationData *XtTranslations;
typedef struct _TranslationData *XtAccelerators;
typedef unsigned int Modifiers;

typedef void (*XtActionProc)();
     
typedef XtActionProc* XtBoundActions;

typedef struct _XtActionsRec{
    char    *string;
    XtActionProc proc;
} XtActionsRec;

extern XtTranslations XtParseTranslationTable();  
     
extern XtAccelerators XtParseAcceleratorTable();

extern void XtOverrideTranslations();  

extern void XtAugmentTranslations();  

extern void XtInstallAccelerators();

extern void XtInstallAllAccelerators();

extern void XtUninstallTranslations();

extern void XtAppAddActions();  

extern void XtAddActions();  
    
typedef void (*XtKeyProc)();
 
extern void XtTranslateKeycode();
 
extern void XtTranslateKey();
 
extern void XtSetKeyTranslator();
 
typedef void (*XtCaseProc)();
 
extern void XtRegisterCaseConverter();
 
extern void XtConvertCase();

typedef void (*XtEventHandler)();  
     
typedef void (*XtAsyncHandler)();  
     
typedef unsigned long EventMask;

extern void XtAddEventHandler();  
     
extern void XtRemoveEventHandler();  
     
extern void XtAddRawEventHandler();  
     
extern void XtRemoveRawEventHandler();  
     
extern EventMask XtBuildEventMask();  
     
extern void XtAddGrab();
     
extern void XtRemoveGrab();
     
extern void XtDispatchEvent();  
     
extern void XtProcessEvent();
     
extern void XtAppProcessEvent();
     
extern void XtMainLoop();

extern void XtAppMainLoop();

extern void XtAddExposureToRegion();

extern void XtSetAsyncEventHandler();  

extern void XtMakeToolkitAsync();

extern void XtSetKeyboardFocus();

typedef unsigned long	XtInputMask;

typedef void (*XtTimerCallbackProc)();
     
extern XtIntervalId XtAddTimeOut();

extern XtIntervalId XtAppAddTimeOut();

extern void XtRemoveTimeOut();

typedef void (* XtInputCallbackProc)();
     
extern XtInputId XtAddInput();  
     
extern XtInputId XtAppAddInput();  
     
extern void XtRemoveInput();  
     
extern void XtNextEvent();  
     
extern void XtAppNextEvent();
     
extern Boolean XtPeekEvent();  

extern Boolean XtAppPeekEvent();
     
extern XtInputMask XtPending ();

extern XtInputMask XtAppPending();
     
extern Boolean XtIsSubclass ();
     
extern void XtRealizeWidget ();
     
void XtUnrealizeWidget ();  
     
extern void XtDestroyWidget ();
     
extern void XtSetSensitive ();
     
extern void XtSetMappedWhenManaged ();
     
extern Widget XtNameToWidget();  
     
extern Widget XtWindowToWidget();  
     
typedef struct {
    String	name;
    XtArgVal	value;
} Arg, *ArgList;

extern ArgList XtMergeArgLists();  
     
extern Display *XtDisplay();

extern Screen *XtScreen();

extern Window XtWindow();

extern WidgetClass XtSuperclass();

extern WidgetClass XtClass();

extern Boolean XtIsManaged();

extern Boolean XtIsRealized ();

extern Boolean XtIsSensitive();

extern Widget XtParent();
     
typedef struct _XtCallbackRec*    XtCallbackList;

typedef void (*XtCallbackProc)();
     
typedef struct _XtCallbackRec {
    XtCallbackProc  callback;
    caddr_t         closure;
} XtCallbackRec;

extern void XtAddCallback ();
     
extern void XtRemoveCallback ();
     
extern void XtAddCallbacks ();
     
extern void XtRemoveCallbacks ();
     
extern void XtRemoveAllCallbacks ();
     
extern void XtCallCallbacks ();
     
typedef enum {
        XtCallbackNoList,
        XtCallbackHasNone,
        XtCallbackHasSome
} XtCallbackStatus;

extern XtCallbackStatus XtHasCallbacks();  
     
typedef struct {
    XtGeometryMask request_mode;
    Position x, y;
    Dimension width, height, border_width;
    Widget sibling;
    int stack_mode;     
} XtWidgetGeometry;

typedef enum  {
    XtGeometryYes,         
    XtGeometryNo,          
    XtGeometryAlmost,      
    XtGeometryDone         
} XtGeometryResult;

extern XtGeometryResult XtMakeGeometryRequest();
     
extern XtGeometryResult XtMakeResizeRequest ();
     
extern void XtTransformCoords();
     
extern XtGeometryResult XtQueryGeometry();
     
extern Widget XtCreatePopupShell();

typedef enum {XtGrabNone, XtGrabNonexclusive, XtGrabExclusive} XtGrabKind;

extern void XtPopup();
     
extern void XtCallbackNone();
     
extern void XtCallbackNonexclusive();
     
extern void XtCallbackExclusive();
     
extern void XtPopdown();
     
typedef struct {
    Widget  shell_widget;
    Widget  enable_widget;
} XtPopdownIDRec, *XtPopdownID;

extern void XtCallbackPopdown();
     
extern Widget XtCreateWidget ();
     
extern Widget XtCreateManagedWidget ();
     
extern Widget XtCreateApplicationShell ();
     
extern Widget XtAppCreateShell ();
     
extern void XtToolkitInitialize();

extern void XtDisplayInitialize();
     
extern Widget XtInitialize();
     
extern Display *XtOpenDisplay();         
    
extern XtAppContext XtCreateApplicationContext();

extern void XtDestroyApplicationContext();

extern XtAppContext XtWidgetToApplicationContext();

extern XrmDatabase XtDatabase();
     
extern void XtCloseDisplay();            
     
typedef struct {
    XrmQuark	xrm_name;	   
    XrmQuark	xrm_class;	   
    XrmQuark	xrm_type;	   
    Cardinal	xrm_size;	   
    long int	xrm_offset;	   
    XrmQuark	xrm_default_type;  
    caddr_t	xrm_default_addr;  
} XrmResource, *XrmResourceList;

extern void XtCopyFromParent();

extern void XtCopyDefaultDepth();

extern void XtCopyDefaultColormap();

extern void XtCopyAncestorSensitive();

extern void XtCopyScreen();

typedef struct _XtResource *XtResourceList;

extern void XrmCompileResourceList();  
     
extern void XtGetSubresources();
     
extern void XtSetValues();
     
extern void XtGetValues();
     
extern void XtSetSubvalues();
     
extern void XtGetSubvalues();
     
extern void XtGetResourceList();
     
typedef struct _XtResource {
    String     resource_name;    
    String     resource_class;   
    String     resource_type;    
    Cardinal    resource_size;   
    Cardinal    resource_offset; 
    String     default_type;     
    caddr_t     default_addr;    
} XtResource;

typedef void (*XtErrorMsgHandler)();
 
extern void XtAppSetErrorMsgHandler();
     
extern void XtSetErrorMsgHandler();
     
extern void XtAppSetWarningMsgHandler();
     
extern void XtSetWarningMsgHandler();

extern void XtAppErrorMsg();
     
extern void XtErrorMsg();
 
extern void XtAppWarningMsg();
     
extern void XtWarningMsg();
 
typedef void (*XtErrorHandler)();
 
extern void XtAppSetErrorHandler();
     
extern void XtSetErrorHandler();
     
extern void XtAppSetWarningHandler();
     
extern void XtSetWarningHandler();
     
extern void XtAppError();
     
extern void XtError();

extern void XtAppWarning();
     
 


extern void XtWarning();
 


extern XrmDatabase *XtAppGetErrorDatabase();
     

extern XrmDatabase *XtGetErrorDatabase();
 


extern void XtAppGetErrorDatabaseText();
     
 






extern void XtGetErrorDatabaseText();
 





 








extern char *XtMalloc();  
     

extern char *XtCalloc();  
     

extern char *XtRealloc();  
     
     

extern void XtFree();  
         


 





typedef Boolean (*XtWorkProc)();
     
     

extern XtWorkProcId XtAddWorkProc();
     
     

extern XtWorkProcId XtAppAddWorkProc();
     
     
     

extern void  XtRemoveWorkProc();
     


 




extern GC XtGetGC();  
     
     
     

extern void XtDestroyGC ();  
     
     
 
 


 

# 34 "PButton.c"

# 1 "../..//X11/IntrinsicP.h"
 




 


























# 1 "../..//X11/Intrinsic.h"
 




 























# 1041 "../..//X11/Intrinsic.h"

 

# 33 "../..//X11/IntrinsicP.h"


typedef unsigned long XtVersionType;






extern void _XtInherit();
     

typedef void (*XtProc)();
     

typedef void (*XtWidgetClassProc)();
     

typedef void (*XtWidgetProc)();
     

typedef Boolean (*XtAcceptFocusProc)();
     
       

typedef void (*XtArgsProc)();
     
     
     

typedef void (*XtInitProc)();
     
     

typedef Boolean (*XtSetValuesFunc)();   
     
     
     

typedef Boolean (*XtArgsFunc)();
     
     
     

typedef void (*XtAlmostProc)();
     
     
     
     

typedef void (*XtExposeProc)();
     
     
     

typedef void (*XtRealizeProc) ();
     
     
     

typedef void (*XtCreatePopupChildProc)();

typedef XtGeometryResult (*XtGeometryHandler)();
     
     
     

typedef void (*XtStringProc)();
     
     

typedef struct _StateRec *StatePtr;

typedef struct _XtTMRec {
    XtTranslations  translations;	 
    XtBoundActions  proc_table;		 
    StatePtr        current_state;       
    unsigned long   lastEventTime;
} XtTMRec, *XtTM;

# 1 "../..//X11/CoreP.h"
 




 


























extern  int _XtInheritTranslations;










 





typedef struct _CorePart {
    Widget	    self;		 
    WidgetClass	    widget_class;	 
    Widget	    parent;		 
    XrmName         xrm_name;		 
    Boolean         being_destroyed;	 
    XtCallbackList  destroy_callbacks;	 
    caddr_t         constraints;         
    Position        x, y;		 
    Dimension       width, height;	 
    Dimension       border_width;	 
    Boolean         managed;             
    Boolean	    sensitive;		 
    Boolean         ancestor_sensitive;	 
    XtEventTable    event_table;	 
    XtTMRec	    tm;                  
    XtTranslations  accelerators;        
    Pixel	    border_pixel;	 
    Pixmap          border_pixmap;	 
    WidgetList      popup_list;          
    Cardinal        num_popups;          
    String          name;		 
    Screen	    *screen;		 
    Colormap        colormap;            
    Window	    window;		 
    Cardinal        depth;		 
    Pixel	    background_pixel;	 
    Pixmap          background_pixmap;	 
    Boolean         visible;		 
    Boolean	    mapped_when_managed; 
} CorePart;

typedef struct _WidgetRec {
    CorePart    core;
 } WidgetRec;



 














typedef struct _CoreClassPart {
    WidgetClass     superclass;		 
    String          class_name;		 
    Cardinal        widget_size;	 
    XtProc	    class_initialize;    
    XtWidgetClassProc class_part_initialize;  
    Boolean         class_inited;        
    XtInitProc      initialize;		 
    XtArgsProc      initialize_hook;     
    XtRealizeProc   realize;		 
    XtActionList    actions;		 
    Cardinal	    num_actions;	 
    XtResourceList  resources;		 
    Cardinal        num_resources;       
    XrmClass        xrm_class;		 
    Boolean         compress_motion;     
    Boolean         compress_exposure;   
    Boolean         compress_enterleave; 
    Boolean         visible_interest;    
    XtWidgetProc    destroy;		 
    XtWidgetProc    resize;		 
    XtExposeProc    expose;		 
    XtSetValuesFunc set_values;		 
    XtArgsFunc      set_values_hook;     
    XtAlmostProc    set_values_almost;   
    XtArgsProc      get_values_hook;     
    XtAcceptFocusProc accept_focus;       
    XtVersionType   version;	         
    struct _XtOffsetRec *callback_private; 
    String          tm_table;            
    XtGeometryHandler query_geometry;	 
    XtStringProc    display_accelerator; 
    caddr_t	    extension;		 
 } CoreClassPart;

typedef struct _WidgetClassRec {
    CoreClassPart core_class;
} WidgetClassRec;

extern  WidgetClassRec widgetClassRec;



 
# 113 "../..//X11/IntrinsicP.h"

# 1 "../..//X11/CompositeP.h"
 
 
 


























 





typedef Cardinal (*XtOrderProc)();
     

typedef struct _CompositePart {
    WidgetList  children;	      
    Cardinal    num_children;	      
    Cardinal    num_slots;            
    XtOrderProc insert_position;      
} CompositePart,*CompositePtr;

typedef struct _CompositeRec {
    CorePart      core;
    CompositePart composite;
} CompositeRec;

 





typedef struct _CompositeClassPart {
    XtGeometryHandler geometry_manager;	   
    XtWidgetProc      change_managed;	   
    XtWidgetProc      insert_child;	   
    XtWidgetProc      delete_child;	   
    caddr_t	    extension;		 
} CompositeClassPart,*CompositePartPtr;

typedef struct _CompositeClassRec {
     CoreClassPart      core_class;
     CompositeClassPart composite_class;
} CompositeClassRec;

extern  CompositeClassRec compositeClassRec;







 
# 114 "../..//X11/IntrinsicP.h"

# 1 "../..//X11/ConstrainP.h"
 
 
 



























typedef struct _ConstraintPart {
    caddr_t     mumble;		 
} ConstraintPart;

typedef struct _ConstraintRec {
    CorePart	    core;
    CompositePart   composite;
    ConstraintPart  constraint;
} ConstraintRec, *ConstraintWidget;

typedef struct _ConstraintClassPart {
    XtResourceList resources;	       
    Cardinal   num_resources;          
    Cardinal   constraint_size;        
    XtInitProc initialize;             
    XtWidgetProc destroy;              
    XtSetValuesFunc set_values;        
    caddr_t	    extension;		 
} ConstraintClassPart;

typedef struct _ConstraintClassRec {
    CoreClassPart       core_class;
    CompositeClassPart  composite_class;
    ConstraintClassPart constraint_class;
} ConstraintClassRec;

extern  ConstraintClassRec constraintClassRec;


 
# 115 "../..//X11/IntrinsicP.h"













# 141 "../..//X11/IntrinsicP.h"




extern void XtCreateWindow ();
     
     
     
     
     

extern void XtResizeWidget();  
     
     

extern void XtMoveWidget();  
     
     

extern void XtConfigureWidget();  
     
     
     


 
# 35 "PButton.c"

# 1 "../..//X11/StringDefs.h"
 




 


























 




















































































  

































































 

































 








 




 





 




 




# 36 "PButton.c"

# 1 "../..//X11/Misc.h"
 



 























 












# 37 "PButton.c"

# 1 "..//Xw/Xw.h"
 



































 



























































































 









































 












 





 



































































 











 















 
































































 





 







 






 





 












typedef enum {
	XwALIGN_NONE,
	XwALIGN_LEFT,
	XwALIGN_CENTER,
	XwALIGN_RIGHT
} XwAlignment;

typedef enum {
	XwUNKNOWN,
	XwPULLDOWN,
	XwTITLE,
	XwWORK_SPACE
} XwWidgetType;



 








 









 
































 





































 

















 

























 











 







 





 
















 






 








 









 












 









 







 








































 


















 





extern WidgetClass XwprimitiveWidgetClass;

typedef struct _XwPrimitiveClassRec * XwPrimitiveWidgetClass;
typedef struct _XwPrimitiveRec      * XwPrimitiveWidget;


 












 







 







 







 





 










 





extern WidgetClass XwmanagerWidgetClass;

typedef struct _XwManagerClassRec * XwManagerWidgetClass;
typedef struct _XwManagerRec      * XwManagerWidget;



extern WidgetClass XwbuttonWidgetClass;

typedef struct _XwButtonClassRec * XwButtonWidgetClass;
typedef struct _XwButtonRec      * XwButtonWidget;


extern WidgetClass XwmenupaneWidgetClass;

typedef struct _XwMenuPaneClassRec *XwMenuPaneWidgetClass;
typedef struct _XwMenuPaneRec      *XwMenuPaneWidget;


extern WidgetClass XwmenumgrWidgetClass;

typedef struct _XwMenuMgrClassRec *XwMenuMgrWidgetClass;
typedef struct _XwMenuMgrRec      *XwMenuMgrWidget;




 


# 38 "PButton.c"

# 1 "..//Xw/XwP.h"
 





























 











 





typedef struct _XwPrimitiveClassPart
{
   XtWidgetProc border_highlight;
   XtWidgetProc border_unhighlight;
   XtWidgetProc select_proc;
   XtWidgetProc release_proc;
   XtWidgetProc toggle_proc;
   XtTranslations translations;
} XwPrimitiveClassPart;

typedef struct _XwPrimitiveClassRec
{
    CoreClassPart        core_class;
    XwPrimitiveClassPart primitive_class;
} XwPrimitiveClassRec;

extern XwPrimitiveClassRec XwprimitiveClassRec;







extern void _XwHighlightBorder();
extern void _XwUnhighlightBorder();

extern void _XwPrimitiveEnter();
extern void _XwPrimitiveLeave();
extern void _XwPrimitiveFocusIn();
extern void _XwPrimitiveFocusOut();
extern void _XwPrimitiveVisibility();
extern void _XwPrimitiveUnmap();

extern void _XwTraverseLeft();
extern void _XwTraverseRight();
extern void _XwTraverseUp();
extern void _XwTraverseDown();
extern void _XwTraverseNext();
extern void _XwTraversePrev();
extern void _XwTraverseHome();
extern void _XwTraverseNextTop();


typedef struct _XwPrimitivePart
{
   Pixel   foreground;
   int     background_tile;

   int     traversal_type;
   Boolean I_have_traversal;

   int     highlight_thickness;
   int     highlight_style;
   Pixel   highlight_color;
   int     highlight_tile;


   Boolean recompute_size;

   GC      highlight_GC;

   Boolean display_sensitive;
   Boolean highlighted;
   Boolean display_highlighted;

   XtCallbackList select;
   XtCallbackList release;
   XtCallbackList toggle;
} XwPrimitivePart;

typedef struct _XwPrimitiveRec
{
   CorePart      core;
   XwPrimitivePart primitive;
} XwPrimitiveRec;



 





typedef void (*XwTraversalProc)();
     
     
     

typedef struct _XwManagerClassPart
{
   XwTraversalProc traversal_handler;
   XtTranslations translations;
} XwManagerClassPart;

typedef struct _XwManagerClassRec
{
    CoreClassPart       core_class;
    CompositeClassPart  composite_class;
    ConstraintClassPart constraint_class;
    XwManagerClassPart  manager_class;
} XwManagerClassRec;

extern XwManagerClassRec XwmanagerClassRec;

typedef struct _XwManagerPart
{
   Pixel   foreground;
   int     background_tile;

   Boolean traversal_on;

   int     highlight_thickness;

   GC      highlight_GC;

   Widget     active_child;
   WidgetList managed_children;
   Cardinal   num_slots;
   Cardinal   num_managed_children;
   int        layout;
   XtCallbackList next_top;
} XwManagerPart;

typedef struct _XwManagerRec
{
   CorePart       core;
   CompositePart  composite;
   ConstraintPart constraint;
   XwManagerPart  manager;
} XwManagerRec;




 




extern void _XwManagerEnter();              
extern void _XwManagerLeave();              
extern void _XwManagerFocusIn();            
extern void _XwManagerVisibility();  
extern void _XwManagerUnmap();      
extern Boolean _XwFindTraversablePrim();    
extern void _XwReManageChildren();          
extern void _XwManagerInsertChild();        
extern Cardinal _XwInsertOrder();           


 






extern void mgr_traversal();
extern void XwSetFocusPath();
extern void XwProcessTraversal();
extern void XwSetInputFocus();
extern void _XwInitCheckList();


 












 




extern void _XwSetTextWidthAndHeight();
extern void _XwGetNormalGC();
extern void _XwGetSensitiveGC();
extern void _XwGetInverseGC();
extern void _XwInitializeButton();
extern void _XwRealize();
extern void _XwResizeButton();
extern void _XwRegisterName();
extern Boolean XwTestTraversability();

 






typedef struct _XwButtonClassPart
{
   int mumble;
} XwButtonClassPart;

typedef struct _XwButtonClassRec
{
   CoreClassPart        core_class;
   XwPrimitiveClassPart primitive_class;
   XwButtonClassPart    button_class;
} XwButtonClassRec;

extern XwButtonClassRec XwbuttonClassRec;


 






typedef struct _XwButtonPart
{
   XFontStruct * font;
   char        * label;
   int           label_location;
   Dimension     internal_height;
   Dimension     internal_width;
   int		 sensitive_tile;
   GC            normal_GC;
   GC            inverse_GC;
   Position      label_x;
   Position      label_y;
   Dimension     label_width;
   Dimension     label_height;
   unsigned int  label_len;
   Boolean       set;
   Boolean       display_set;
} XwButtonPart;

typedef struct _XwButtonRec
{
   CorePart        core;
   XwPrimitivePart primitive;
   XwButtonPart    button;
} XwButtonRec;


 











 






typedef struct {
     XtWidgetProc setTraversalFlag;   
} XwMenuPaneClassPart;

 
typedef struct _XwMenuPaneClassRec {
    CoreClassPart	core_class;
    CompositeClassPart  composite_class;
    ConstraintClassPart constraint_class;
    XwManagerClassPart  manager_class;
    XwMenuPaneClassPart	menu_pane_class;
} XwMenuPaneClassRec;

extern XwMenuPaneClassRec XwmenupaneClassRec;
extern Boolean _XwAllAttachesAreSensitive();




 






typedef struct {
     
    GC            titleGC;
    Widget        attachId;

     
    XFontStruct * title_font;
    String        title_string;
    Boolean       title_showing;
    String        attach_to;
    XImage      * titleImage;
    Boolean       title_override;
    int           title_type;
    String        mnemonic;
    XtCallbackList select;
} XwMenuPanePart;


typedef struct _XwMenuPaneRec {
    CorePart	    core;
    CompositePart   composite;
    ConstraintPart  constraint;
    XwManagerPart   manager;
    XwMenuPanePart  menu_pane;
} XwMenuPaneRec;



 





typedef Boolean (*XwBooleanProc)();

extern Boolean _XwMatchBtnEvent();
extern Boolean _XwMapBtnEvent();
extern Boolean _XwMapKeyEvent();
extern Boolean _XwMatchKeyEvent();
extern Boolean _XwValidModifier();
extern String  _XwMapToHex();
extern int     _XwMapFromHex();

extern void _XwSetMappedManagedChildrenList();



















 






typedef struct {
    XtProc        attachPane;
    XtProc        detachPane;
    XtProc        addPane;
    XtProc        setSelectAccelerator;
    XtProc        clearSelectAccelerator;
    XtProc        setPostMnemonic;
    XtProc        clearPostMnemonic;
    XtProc        addButton;
    XwBooleanProc processSelect;
    XwBooleanProc validEvent;
    XwBooleanProc doICascade;
    XtProc        setSelectMnemonic;
    XtProc        clearSelectMnemonic;
    XtProc        setTitleAttributes;
    XtProc        paneManagedChildren;
    XtProc        traverseLeft;
    XtProc        traverseRight;
    XtProc        traverseNext;
    XtProc        traversePrev;
    XtProc        traverseHome;
    XtProc        traverseUp;
    XtProc        traverseDown;
    XtProc        traverseNextTop;
    XtProc        btnSensitivityChanged;
    XtProc        paneSensitivityChanged;
} XwMenuMgrClassPart;

 
typedef struct _XwMenuMgrClassRec {
    CoreClassPart	core_class;
    CompositeClassPart  composite_class;
    ConstraintClassPart constraint_class;
    XwManagerClassPart  manager_class;
    XwMenuMgrClassPart	menu_mgr_class;
} XwMenuMgrClassRec;

extern XwMenuMgrClassRec XwmenumgrClassRec;

 






 
typedef struct {
    String       accelString;
    unsigned int accelEventType;
    KeyCode      accelKey;
    unsigned int accelModifiers;
    Widget       menuBtn;
} XwKeyAccel;

 
typedef struct {
    String  menuBtnName;
    Widget  menupaneId;
} XwAttachList;

typedef struct {
     
    unsigned int   postEventType;
    unsigned int   postButton;
    unsigned int   postModifiers;
    unsigned int   selectEventType;
    unsigned int   selectButton;
    unsigned int   selectModifiers;
    XwKeyAccel   * menuBtnAccelTable;
    int            numAccels;
    int            sizeAccelTable;
    XwAttachList * pendingAttachList;
    int            numAttachReqs;
    int            sizeAttachList;
    Boolean        menuActive;
    unsigned int   unpostEventType;
    KeyCode        unpostKey;
    unsigned int   unpostModifiers;
    unsigned int   kbdSelectEventType;
    KeyCode        kbdSelectKey;
    unsigned int   kbdSelectModifiers;

     
    Boolean       associateChildren;
    String        postString;
    String        selectString;
    String        unpostString;
    String        kbdSelectString;
} XwMenuMgrPart;


typedef struct _XwMenuMgrRec {
    CorePart	    core;
    CompositePart   composite;
    ConstraintPart  constraint;
    XwManagerPart   manager;
    XwMenuMgrPart   menu_mgr;
} XwMenuMgrRec;



# 39 "PButton.c"

# 1 "..//Xw/PButtonP.h"
 




























 






typedef struct {int foo;} XwPushButtonClassPart;


 




typedef struct _XwPushButtonClassRec {
    CoreClassPart	  core_class;
    XwPrimitiveClassPart  primitive_class;
    XwButtonClassPart     button_class;
    XwPushButtonClassPart pushbutton_class;
} XwPushButtonClassRec;


extern XwPushButtonClassRec XwpushButtonClassRec;


 





typedef struct _XwPushButtonPart{
     Boolean toggle;
} XwPushButtonPart;



 





typedef struct _XwPushButtonRec {
    CorePart	     core;
    XwPrimitivePart  primitive;
    XwButtonPart     button;
    XwPushButtonPart pushbutton;
} XwPushButtonRec;
# 40 "PButton.c"

# 1 "..//Xw/PButton.h"
 


























 






extern WidgetClass XwpushButtonWidgetClass;

typedef struct _XwPushButtonClassRec *XwPushButtonWidgetClass;
typedef struct _XwPushButtonRec      *XwPushButtonWidget;






# 41 "PButton.c"

# 1 "../..//X11/keysymdef.h"
 

 























# 195 "../..//X11/keysymdef.h"


 



# 394 "../..//X11/keysymdef.h"


 




# 455 "../..//X11/keysymdef.h"


 




# 485 "../..//X11/keysymdef.h"



 




# 529 "../..//X11/keysymdef.h"


 




# 602 "../..//X11/keysymdef.h"


 




# 659 "../..//X11/keysymdef.h"


 



# 759 "../..//X11/keysymdef.h"


 




# 839 "../..//X11/keysymdef.h"


 




# 896 "../..//X11/keysymdef.h"


 




# 928 "../..//X11/keysymdef.h"


 




# 1019 "../..//X11/keysymdef.h"


 




# 1046 "../..//X11/keysymdef.h"


 




# 1082 "../..//X11/keysymdef.h"


# 42 "PButton.c"

   




static void Redisplay();
static void RedrawButtonFace();
static Boolean SetValues();
static void ClassInitialize();
static void Initialize();
static void Toggle();
static void ToggleRelease();
static void Select();
static void Unselect();
static void Resize();


 









static char defaultTranslations[] =
   "<Btn1Down>:             select() \n    <Btn1Up>:             unselect() \n    <EnterWindow>:          enter() \n    <LeaveWindow>:          leave() \n    <KeyDown>Select:   select() \n    <KeyUp>Select:     unselect()";








 











static XtActionsRec actionsList[] =
{
  {"toggle", (XtActionProc) Toggle},
  {"select", (XtActionProc) Select},
  {"unselect", (XtActionProc) Unselect},
  {"enter", (XtActionProc) _XwPrimitiveEnter},
  {"leave", (XtActionProc) _XwPrimitiveLeave},
};


 

static XtResource resources[] = 
{     
   {
                   "toggle" ,               "Toggle" , 	"Boolean" , sizeof (Boolean),
     ((unsigned int) (((char *) (&(((XwPushButtonWidget)((void *)0) )-> pushbutton.toggle))) - ((char *) ((void *)0) ))) , 	"String" , "False"
   }
};



 









XwPushButtonClassRec XwpushButtonClassRec = {
  {
 	
     	(WidgetClass) &XwbuttonClassRec,
     	"PushButton",
     	sizeof(XwPushButtonRec),
         ClassInitialize,
         ((void *)0) ,				
     	0 ,
     	Initialize,
         ((void *)0) ,
     	_XwRealize,
     	actionsList,
     		((Cardinal) (sizeof(actionsList) / sizeof(actionsList[0]))) ,
     	resources,
     		((Cardinal) (sizeof(resources) / sizeof(resources[0]))) ,
     	((XrmQuark) 0) ,
     	1 ,
     	1 ,
         1 ,
     	0 ,
     	((void *)0) ,
     	Resize,
     	Redisplay,
     	SetValues,
         ((void *)0) ,
         ((XtAlmostProc) _XtInherit) ,
     	((void *)0) ,
     	((void *)0) ,
     	(11  * 1000 + 3 ) ,
           ((void *)0) ,
           defaultTranslations,
     	((void *)0) , 
  }
};
WidgetClass XwpushButtonWidgetClass = (WidgetClass)&XwpushButtonClassRec;


 



























static void Toggle (w,event)
Widget w;
XEvent *event;

{
   XwPushButtonWidget pb = (XwPushButtonWidget)w;


   if (pb -> button.set) 
      pb -> button.set = 0 ;
   else 
      pb -> button.set = 1 ;

   RedrawButtonFace (w, event, 0 );
   XFlush(((w)->core.screen->display) );
   XtCallCallbacks (w, ((pb->button.set) ?              "select"  :             "release" ), ((void *)0) );
}


 

























static void Select (w,event)
Widget w;
XEvent *event;

{
   XwPushButtonWidget pb = (XwPushButtonWidget) w;

   if (pb->pushbutton.toggle == 1 )
      Toggle(w,event);
   else
     {
       pb->button.set = 1 ;

       RedrawButtonFace (w, event, 0 );
       XFlush (((w)->core.screen->display) );
       XtCallCallbacks (w,              "select" , ((void *)0) );
     }
}




 
























static void Unselect(w,event)
Widget w;
XEvent *event;

{
   XwPushButtonWidget pb = (XwPushButtonWidget) w;

 
   if (! pb->pushbutton.toggle)
     {
       pb->button.set = 0 ;

       RedrawButtonFace (w, event, 0 );
       XFlush(((w)->core.screen->display) );
       XtCallCallbacks (w,             "release" , ((void *)0) );
     }
}


static void ToggleRelease(w,event)
Widget w;
XEvent *event;

{
   XwPushButtonWidget pb = (XwPushButtonWidget) w;

   pb->button.set = 0 ;

   RedrawButtonFace (w, event, 0 );
   XFlush(((w)->core.screen->display) );
   XtCallCallbacks (w,             "release" , ((void *)0) );
}



 


























static void Initialize (request, new)
Widget request, new;

{
   XwPushButtonWidget pb = (XwPushButtonWidget) new;

    














   if (request->core.width == 0)  pb->core.width =  pb->button.label_width +
	      2 * ( pb->button.internal_width +     
		     pb->primitive.highlight_thickness + 2 );
    
   if (request->core.height == 0) pb->core.height = pb->button.label_height + 
       2 * (pb->button.internal_height + pb->primitive.highlight_thickness + 2 );
    
   Resize(new);
}



 










static void ClassInitialize()
{
   XwpushButtonClassRec.primitive_class.select_proc = (XtWidgetProc) Select;
   XwpushButtonClassRec.primitive_class.release_proc =
      (XtWidgetProc) ToggleRelease;
   XwpushButtonClassRec.primitive_class.toggle_proc = (XtWidgetProc) Toggle;
}



 






















static void Redisplay (w, event, region)
Widget w;
XEvent *event;
Region region;

{
    RedrawButtonFace (w, event, 1 );
}


static void RedrawButtonFace (w, event, all)
XwPushButtonWidget w;
XEvent *event;
Boolean all;

{
   register XwPushButtonWidget pb = (XwPushButtonWidget) w;
   int available_height, available_width;
   Boolean clipHeight, clipWidth;

    

   available_width = (((0) > ((int)pb->core.width - 2*((int)pb->button.internal_width + pb->primitive.highlight_thickness + 2 ))) ? (0) : ((int)pb->core.width - 2*((int)pb->button.internal_width + pb->primitive.highlight_thickness + 2 ))) ;

   available_height = (((0) > ( (int)pb->core.height - 2*((int)pb->button.internal_height + pb->primitive.highlight_thickness + 2 ))) ? (0) : ( (int)pb->core.height - 2*((int)pb->button.internal_height + pb->primitive.highlight_thickness + 2 ))) ;


   
    

   if (pb->button.label_width > available_width)
       clipWidth = 1 ;
   else 
       clipWidth = 0 ;


   if (pb->button.label_height > available_height)
       clipHeight = 1 ;
   else 
       clipHeight = 0 ;



    



    
    XFillRectangle (((w)->core.screen->display) , ((w)->core.window) ,
		         ((pb->button.set
                          )
                                     ? pb->button.normal_GC
		                     : pb->button.inverse_GC),
                      w -> primitive.highlight_thickness + 1 + 2 ,
                      w -> primitive.highlight_thickness + 1 + 2 ,
                      w->core.width- 2 * (w->primitive.highlight_thickness
                                          + 1 + 2 ),
                      w->core.height- 2 * (w->primitive.highlight_thickness
                                          + 1 + 2 ));

   if (pb->button.label_len > 0)
   {
      XDrawString(((w)->core.screen->display) , ((w)->core.window) ,
		   ((pb->button.set
                    )
                                     ? pb->button.inverse_GC
		                     : pb->button.normal_GC),
                   (((int)pb->core.width + 1 - pb->button.label_width) / 2),
	            pb->button.label_y,  pb->button.label, 
		    pb->button.label_len);


     if (clipWidth)
       {
         XClearArea (((w)->core.screen->display) , ((w)->core.window) , 0,0,
		     (pb->primitive.highlight_thickness + 2  +
		       pb->button.internal_width), pb->core.height, 0 );

         XClearArea (((w)->core.screen->display) , ((w)->core.window) , 
		     ((int)pb->core.width - pb->primitive.highlight_thickness -
		       2  - (int)pb->button.internal_width),0,
		     (pb->primitive.highlight_thickness + 2  +
		       pb->button.internal_width), pb->core.height, 0 );
       }
   
     if (clipHeight)
       {
         XClearArea (((w)->core.screen->display) , ((w)->core.window) , 0,0, pb->core.width, 
		     (pb->primitive.highlight_thickness + 2  +
		       pb->button.internal_height), 0 );
         XClearArea (((w)->core.screen->display) , ((w)->core.window) , 0,
		     ((int)pb->core.height - pb->primitive.highlight_thickness -
		       2  - (int)pb->button.internal_height), pb->core.width,
		     (pb->primitive.highlight_thickness + 2  +
		       pb->button.internal_height), 0 );
       }
   }


   _XwDrawBox (((w)->core.screen->display) , ((w)->core.window) , 
                  w -> button.normal_GC, 2 ,
                  w -> primitive.highlight_thickness,
                  w -> primitive.highlight_thickness,
                  w->core.width - 2 * w->primitive.highlight_thickness,
                  w->core.height - 2 * w->primitive.highlight_thickness);



    




   if (all || clipWidth || clipHeight) 
   {
      if (pb->primitive.highlighted)
         _XwHighlightBorder(w);
      else if (pb->primitive.display_highlighted) 
         _XwUnhighlightBorder(w);
   }
}



 


























static Boolean SetValues(current, request, new)
Widget current, request, new;

{
    XtWidgetGeometry	reqGeo;
    XwPushButtonWidget curpb = (XwPushButtonWidget) current;
    XwPushButtonWidget newpb = (XwPushButtonWidget) new;
    Boolean  flag = 0 ;     
    
    
     







    if ((curpb->core.width == newpb->core.width) &&
         (_XwRecomputeSize(current, new)))
     {
	newpb->core.width =
	    newpb->button.label_width + 2*(newpb->button.internal_width +
     		    newpb->primitive.highlight_thickness + 2 );
	flag = 1 ;
     }

    if ((curpb->core.height == newpb->core.height) &&
         (_XwRecomputeSize(current, new)))
     {
	newpb->core.height =
	    newpb->button.label_height + 2*(newpb->button.internal_height +
     		    newpb->primitive.highlight_thickness + 2 );
	flag = 1 ;
     }

   return(flag);
}




 















static void Resize(w)
    Widget w;
{
    XwPushButtonWidget pb = (XwPushButtonWidget) w;

    pb->button.label_x = ((int)pb->core.width + 1 - pb->button.label_width) / 2;

    pb->button.label_y =
       ((int)pb->core.height - pb->button.label_height) / 2
	+ pb->button.font->max_bounds.ascent;
}