File: LayoutGP.h

package info (click to toggle)
gridengine 6.2-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 51,532 kB
  • ctags: 51,172
  • sloc: ansic: 418,155; java: 37,080; sh: 22,593; jsp: 7,699; makefile: 5,292; csh: 4,244; xml: 2,901; cpp: 2,086; perl: 1,895; tcl: 1,188; lisp: 669; ruby: 642; yacc: 393; lex: 266
file content (241 lines) | stat: -rw-r--r-- 8,927 bytes parent folder | download | duplicates (3)
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
/* 
 * Motif Tools Library, Version 3.1
 * $Id$
 * 
 * Written by David Flanagan.
 * Copyright (c) 1992-2001 by David Flanagan.
 * All Rights Reserved.  See the file COPYRIGHT for details.
 * This is open source software.  See the file LICENSE for details.
 * There is no warranty for this software.  See NO_WARRANTY for details.
 *
 * $Log$
 * Revision 1.1.1.1  2001/07/18 11:06:02  root
 * Initial checkin.
 *
 * Revision 1.2  2001/06/12 16:25:28  andre
 * *** empty log message ***
 *
 *
 */

#ifndef _XmtLayoutGP_h
#define _XmtLayoutGP_h
    
#include <Xm/XmP.h>
#include <X11/RectObjP.h>
#include <Xmt/LayoutG.h>
#include <Xmt/LayoutP.h>

/*
 * Define an XmtLayoutGadget class as a subclass of Object.
 * Give it class and instance fields identical to RectObj, and
 * also (in a separate structure) a change_font method.
 * We'll be able to cast this to a RectObj or Widget for most uses,
 * but XtIsRectObj will return False, so Motif won't mess with it.
 * We'll still have to fake _XmConfigureObject() out to make it
 * think that it is a rectobj for that one case...
 * Or if _XmConfigureObject() is causing too many redraws, then
 * we can write our own version that doesn't need to be faked out.
 */

/*
 * The following definitions for LayoutGadget are modified from the
 * X11R5 source code mit/lib/Xt/RectObjP.h  See XCOPYRIGHT for copyright info.
 */

/* these fields match CorePart and can not be changed */
typedef struct _XmtLayoutGadgetRectPart {
    Position        x, y;               /* rectangle position               */
    Dimension       width, height;      /* rectangle dimensions             */
    Dimension       border_width;       /* rectangle border width           */
    Boolean         managed;            /* is widget geometry managed?       */
    Boolean         sensitive;          /* is widget sensitive to user events*/
    Boolean         ancestor_sensitive; /* are all ancestors sensitive?      */
}XmtLayoutGadgetRectPart;

typedef struct _XmtLayoutGadgetRec {
    ObjectPart object;
    XmtLayoutGadgetRectPart rectangle;
} XmtLayoutGadgetRec;


/* these fields match CoreClassPart and can not be changed */
typedef struct _XmtLayoutGadgetRectClassPart {
    WidgetClass     superclass;         /* pointer to superclass ClassRec   */
    String          class_name;         /* widget resource class name       */
    Cardinal        widget_size;        /* size in bytes of widget record   */
    XtProc          class_initialize;   /* class initialization proc        */
    XtWidgetClassProc class_part_initialize; /* dynamic initialization      */
    XtEnum          class_inited;       /* has class been initialized?      */
    XtInitProc      initialize;         /* initialize subclass fields       */
    XtArgsProc      initialize_hook;    /* notify that initialize called    */
    XtProc          rect1;		/* NULL                             */
    XtPointer       rect2;              /* NULL                             */
    Cardinal        rect3;              /* NULL                             */
    XtResourceList  resources;          /* resources for subclass fields    */
    Cardinal        num_resources;      /* number of entries in resources   */
    XrmClass        xrm_class;          /* resource class quarkified        */
    Boolean         rect4;              /* NULL                             */
    Boolean         rect5;              /* NULL                             */
    Boolean         rect6;              /* NULL				    */
    Boolean         rect7;              /* NULL                             */
    XtWidgetProc    destroy;            /* free data for subclass pointers  */
    XtWidgetProc    resize;             /* geom manager changed widget size */
    XtExposeProc    expose;             /* rediplay rectangle               */
    XtSetValuesFunc set_values;         /* set subclass resource values     */
    XtArgsFunc      set_values_hook;    /* notify that set_values called    */
    XtAlmostProc    set_values_almost;  /* set values almost for geometry   */
    XtArgsProc      get_values_hook;    /* notify that get_values called    */
    XtProc          rect9;              /* NULL                             */
    XtVersionType   version;            /* version of intrinsics used       */
    XtPointer       callback_private;   /* list of callback offsets         */
    String          rect10;             /* NULL                             */
    XtGeometryHandler query_geometry;   /* return preferred geometry        */
    XtProc          rect11;             /* NULL                             */
    XtPointer       extension;          /* pointer to extension record      */
} XmtLayoutGadgetRectClassPart;

typedef struct _XmtLayoutGadgetClassPart {
    XtWidgetProc    change_font;  /* method called when parent font changes */
} XmtLayoutGadgetClassPart;

typedef struct _XmtLayoutGadgetClassRec {
    XmtLayoutGadgetRectClassPart rect_class;
    XmtLayoutGadgetClassPart layout_gadget_class;
} XmtLayoutGadgetClassRec;

externalref XmtLayoutGadgetClassRec xmtLayoutGadgetClassRec;

typedef struct {
    XtPointer extension;
} XmtLayoutEmptyClassPart;

typedef struct _XmtLayoutBoxClassRec {
    XmtLayoutGadgetRectClassPart rect_class;
    XmtLayoutGadgetClassPart layout_gadget_class;
    XmtLayoutEmptyClassPart layout_box_class;
} XmtLayoutBoxClassRec;

externalref XmtLayoutBoxClassRec xmtLayoutBoxClassRec;

typedef struct {
    /* resources */
    unsigned char orientation;
    Pixel background;
    Boolean equal;
    unsigned char space_type;
    Dimension space;
    Dimension space_stretch;
    Dimension item_stretch;
    /* private */
    GC gc;                            /* to draw our background color with */
    int total_stretch, total_shrink;  /* sum over all kids */
    Dimension equal_size;             /* size of elements of an "equal" box */
    Dimension num_items;              /* # of items in the box */
} XmtLayoutBoxPart;

typedef struct _XmtLayoutBoxRec {
    ObjectPart object;
    XmtLayoutGadgetRectPart rectangle;
    XmtLayoutBoxPart layout_box;
} XmtLayoutBoxRec;

typedef struct _XmtLayoutStringClassRec {
    XmtLayoutGadgetRectClassPart rect_class;
    XmtLayoutGadgetClassPart layout_gadget_class;
    XmtLayoutEmptyClassPart layout_string_class;
} XmtLayoutStringClassRec;

externalref XmtLayoutStringClassRec xmtLayoutStringClassRec;

typedef struct {
    /* resources */
    String label;
    XmString label_string;
    Pixel foreground,  background;
    /* private */
    Dimension width, height;
    GC gc;
    GC background_gc;
} XmtLayoutStringPart;

typedef struct _XmtLayoutStringRec {
    ObjectPart object;
    XmtLayoutGadgetRectPart rectangle;
    XmtLayoutStringPart layout_string;
} XmtLayoutStringRec;

typedef struct _XmtLayoutPixmapClassRec {
    XmtLayoutGadgetRectClassPart rect_class;
    XmtLayoutGadgetClassPart layout_gadget_class;
    XmtLayoutEmptyClassPart layout_pixmap_class;
} XmtLayoutPixmapClassRec;

externalref XmtLayoutPixmapClassRec xmtLayoutPixmapClassRec;

typedef struct {
    /* resources */
    Pixmap pixmap;
    Pixmap bitmap;
    Pixmap bitmask;
    Pixel foreground, background;
    /* private */
    Dimension width, height, depth;
    GC gc;
} XmtLayoutPixmapPart;

typedef struct _XmtLayoutPixmapRec {
    ObjectPart object;
    XmtLayoutGadgetRectPart rectangle;
    XmtLayoutPixmapPart layout_pixmap;
} XmtLayoutPixmapRec;

typedef struct _XmtLayoutSeparatorClassRec {
    XmtLayoutGadgetRectClassPart rect_class;
    XmtLayoutGadgetClassPart layout_gadget_class;
    XmtLayoutEmptyClassPart layout_separator_class;
} XmtLayoutSeparatorClassRec;

externalref XmtLayoutSeparatorClassRec xmtLayoutSeparatorClassRec;

typedef struct {
    /* resources */
    unsigned char orientation;
    /* private */
} XmtLayoutSeparatorPart;

typedef struct _XmtLayoutSeparatorRec {
    ObjectPart object;
    XmtLayoutGadgetRectPart rectangle;
    XmtLayoutSeparatorPart layout_separator;
} XmtLayoutSeparatorRec;

typedef struct _XmtLayoutSpaceClassRec {
    XmtLayoutGadgetRectClassPart rect_class;
    XmtLayoutGadgetClassPart layout_gadget_class;
    XmtLayoutEmptyClassPart layout_space_class;
} XmtLayoutSpaceClassRec;

externalref XmtLayoutSpaceClassRec xmtLayoutSpaceClassRec;

typedef struct {
    /* resources */
    /* private */
    Boolean unused;
} XmtLayoutSpacePart;

typedef struct _XmtLayoutSpaceRec {
    ObjectPart object;
    XmtLayoutGadgetRectPart rectangle;
    XmtLayoutSpacePart layout_space;
} XmtLayoutSpaceRec;

#define _XmtRedisplayGadget(w, e, r)\
  if (((XmtLayoutGadgetClass)XtClass(w))->rect_class.expose)\
    ((*((XmtLayoutGadgetClass)XtClass(w))->rect_class.expose)((Widget)w, e, r))

#define _XmtCallChangeFontMethod(w)\
  if (((XmtLayoutGadgetClass)XtClass(w))->layout_gadget_class.change_font)\
    ((*((XmtLayoutGadgetClass)XtClass(w))->layout_gadget_class.change_font)(w))

#endif