File: GeometryP.h

package info (click to toggle)
gridengine 8.1.9%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 56,880 kB
  • sloc: ansic: 432,689; java: 87,068; cpp: 31,958; sh: 29,429; jsp: 7,757; perl: 6,336; xml: 5,828; makefile: 4,701; csh: 3,928; ruby: 2,221; tcl: 1,676; lisp: 669; yacc: 519; python: 503; lex: 361; javascript: 200
file content (194 lines) | stat: -rw-r--r-- 5,617 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/* 
 * Copyright 1994 Alastair Gourlay
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose and without fee is hereby granted, provided 
 * that the above copyright notice appear in all copies and that both that 
 * copyright notice and this permission notice appear in supporting 
 * documentation.
 */

/*
 *
 * GeometryP.h - XmpGeometry Private header
 *
 */

#ifndef _XmpGeometryP_h
#define _XmpGeometryP_h

#if XmVersion > 1001
#include <Xm/ManagerP.h>
#else
#include <Xm/XmP.h>
#endif

#include "Geometry.h"

/**
***  gcc gives a warning when ints are converted to XtPointers
***  and vice versa because they are the wrong size on my AXP.
***  So these macros will convert the integral type to something
***  the size of an XtPointer to solve these warnings.  The type
***  (long) may need to be changed on different hardwares.
**/

#ifdef TARGET_64BIT
typedef long PointerSizedIntegral;
#else
typedef int PointerSizedIntegral;
#endif

#define int2xtp(a) ((XtPointer)((PointerSizedIntegral)(a)))
#define xtp2int(a) ((int)((PointerSizedIntegral)(a)))


#ifdef _NO_PROTO
typedef void (*XmpSizeProc)();
#else
typedef void (*XmpSizeProc)(Widget,Dimension*,Dimension*);
#endif

#define XmpInheritInitializePostHook ((XtInitProc) _XtInherit)
#define XmpInheritSetValuesPostHook ((XtSetValuesFunc) _XtInherit)
#define XmpInheritConstraintInitializePostHook ((XtInitProc) _XtInherit)
#define XmpInheritConstraintSetValuesPostHook ((XtSetValuesFunc) _XtInherit)
#define XmpInheritSize ((XmpSizeProc) _XtInherit)
#define XmpInheritBitGravity ( (long) _XtInherit )

typedef struct
{
	long	bit_gravity;
	XtInitProc		initialize_post_hook;
	XtSetValuesFunc		set_values_post_hook;
	XtInitProc		constraint_initialize_post_hook;
	XtSetValuesFunc		constraint_set_values_post_hook;
	XmpSizeProc		size;
	XtPointer		extension;
} XmpGeometryClassPart;

typedef struct _XmpGeometryClassRec
{
	CoreClassPart		core_class;
	CompositeClassPart	composite_class;
	ConstraintClassPart	constraint_class;
	XmManagerClassPart	manager_class;
	XmpGeometryClassPart	geometry_class;
} XmpGeometryClassRec;

externalref XmpGeometryClassRec xmpGeometryClassRec;

typedef struct
{
	Dimension		pref_width;
	Dimension		pref_height;
	Boolean			compute_width;
	Boolean			compute_height;
	Boolean			reconfigure;
	Boolean			constraint_reconfigure;
	Widget			instigator;
} XmpGeometryPart, *XmpGeometryPartPtr;

typedef struct _XmpGeometryRec
{
	CorePart		core;
	CompositePart		composite;
	ConstraintPart		constraint;
	XmManagerPart		manager;
	XmpGeometryPart		geometry;
} XmpGeometryRec;

typedef struct _XmpGeometryConstraintPart
{
	XtPointer		reserved;
} XmpGeometryConstraintPart, *XmpGeometryConstraintPartPtr;

typedef struct _XmpGeometryConstraintRec
{
	XmManagerConstraintPart	manager;
	XmpGeometryConstraintPart geometry;
} XmpGeometryConstraintRec, *XmpGeometryConstraint;



#ifdef _NO_PROTO
extern void XmpPreferredGeometry();
extern void XmpSetGeometry();
extern void XmpWarning();
#else
extern void XmpPreferredGeometry(Widget,Dimension*,Dimension*);
extern void XmpSetGeometry(Widget,Position,Position,Dimension,Dimension,Dimension);
extern void XmpWarning(Widget,String);
#endif
/* Instance field access macros */

#define PrefWidth(w) (w->geometry.pref_width)
#define PrefHeight(w) (w->geometry.pref_height)
#define ComputeWidth(w) (w->geometry.compute_width)
#define ComputeHeight(w) (w->geometry.compute_height)
#define Reconfigure(w) (w->geometry.reconfigure)
#define ConstraintReconfigure(w) (w->geometry.constraint_reconfigure)
#define Instigator(w) (w->geometry.instigator)

#define Children(w) (w->composite.children)
#define NumChildren(w) (w->composite.num_children)

#define X(w) (w->core.x)
#define Y(w) (w->core.y)
#define Width(w) (w->core.width)
#define Height(w) (w->core.height)
#define BorderWidth(w) (w->core.border_width)

/* Constraint field access macros */

#define GeometryConstraint(w) ((XmpGeometryConstraint)(w->core.constraints)

#define GeometryReserved(w) (GeometryConstraint(w)->geometry.reserved)

/* Class method macros  - used by subclass to envelop XmpGeometry methods */

#define XmpGeometryRedisplay(w,ev,rg) \
		(*xmpGeometryWidgetClass->core_class.expose)(w,ev,rg)
#define XmpGeometryChangeManaged(w) \
	(*xmpGeometryWidgetClass->composite_class.change_managed)(w)
#define XmpGeometryRealize(w,m,a) \
		(*xmpGeometryWidgetClass->core_class.realize(w,m,a)

/* Class field access macros */

#define BitGravity(w) (GeometryClass(w)->geometry_class.bit_gravity)

/* XmpGeometry hook method support macros */

#define GeometryClass(w) ((XmpGeometryWidgetClass)XtClass(w))
#define GeometryClassPart(w) (GeometryClass(w)->geometry_class)

#define XmpGeometryInitialize(wc,rw,nw,a,na) \
    if (wc == XtClass(nw)) \
	(*GeometryClassPart(nw).initialize_post_hook)(rw,nw,a,na)

#define XmpGeometrySetValues(wc,ow,rw,nw,a,na) \
    (wc == XtClass(nw) ? \
	(*GeometryClassPart(nw).set_values_post_hook)(ow,rw,nw,a,na) \
	: False)

#define XmpGeometryConstraintInitialize(wc,rw,nw,a,na) \
    if (wc == XtClass(nw)) \
	(*GeometryClassPart(nw).constraint_initialize_post_hook)(rw,nw,a,na)

#define XmpGeometryConstraintSetValues(wc,ow,rw,nw,a,na) \
    (wc == XtClass(nw) ? \
	(*GeometryClassPart(nw).constraint_set_values_post_hook)(ow,rw,nw,a,na) \
	: False)

/* Useful Resize/Size macros */

/* Do the subtraction (a-b), but honor the specified minimum result (d) */
#define XmpSubtract(a,b,d) ((a)>((b)+(d)) ? (a)-(b) : d)

/* the usual Max */
#ifndef Max
#define Max(x, y) (((unsigned)(x) > (unsigned)(y)) ? (x) : (y))
#endif

#endif /* _XmpGeometryP_h */