|
1 /* |
|
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
|
3 * |
|
4 * Copyright 2024 Olaf Wintermann. All rights reserved. |
|
5 * |
|
6 * Redistribution and use in source and binary forms, with or without |
|
7 * modification, are permitted provided that the following conditions are met: |
|
8 * |
|
9 * 1. Redistributions of source code must retain the above copyright |
|
10 * notice, this list of conditions and the following disclaimer. |
|
11 * |
|
12 * 2. Redistributions in binary form must reproduce the above copyright |
|
13 * notice, this list of conditions and the following disclaimer in the |
|
14 * documentation and/or other materials provided with the distribution. |
|
15 * |
|
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
|
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
26 * POSSIBILITY OF SUCH DAMAGE. |
|
27 */ |
|
28 |
|
29 #ifndef GRID_H |
|
30 #define GRID_H |
|
31 |
|
32 #include <X11/Intrinsic.h> |
|
33 #include <X11/IntrinsicP.h> |
|
34 #include <Xm/XmAll.h> |
|
35 #include <Xm/Primitive.h> |
|
36 #include <Xm/PrimitiveP.h> |
|
37 #include <Xm/ManagerP.h> |
|
38 |
|
39 #ifdef __cplusplus |
|
40 extern "C" { |
|
41 #endif |
|
42 |
|
43 #define gridColumn "gridColumn" |
|
44 #define gridRow "gridRow" |
|
45 #define gridColspan "gridColspan" |
|
46 #define gridRowspan "gridRowspan" |
|
47 #define gridHExpand "gridHExpand" |
|
48 #define gridVExpand "gridVExpand" |
|
49 #define gridHFill "gridHFill" |
|
50 #define gridVFill "gridVFill" |
|
51 #define gridMarginLeft "gridMarginLeft" |
|
52 #define gridMarginRight "gridMarginRight" |
|
53 #define gridMarginTop "gridMarginTop" |
|
54 #define gridMarginBottom "gridMarginBottom" |
|
55 |
|
56 |
|
57 typedef struct GridDef { |
|
58 Dimension size; |
|
59 Dimension pos; |
|
60 Boolean expand; |
|
61 } GridDef; |
|
62 |
|
63 typedef struct GridClassPart { |
|
64 int test; |
|
65 } GridClassPart; |
|
66 |
|
67 typedef struct GridClassRec { |
|
68 CoreClassPart core_class; |
|
69 CompositeClassPart composite_class; |
|
70 ConstraintClassPart constraint_class; |
|
71 XmManagerClassPart manager_class; |
|
72 GridClassPart mywidgetclass; |
|
73 } GridClassRec; |
|
74 |
|
75 |
|
76 typedef struct GridPart { |
|
77 int margin_left; |
|
78 int margin_right; |
|
79 int margin_top; |
|
80 int margin_bottom; |
|
81 int max_col; |
|
82 int max_row; |
|
83 } GridPart; |
|
84 |
|
85 typedef struct GridRec { |
|
86 CorePart core; |
|
87 CompositePart composite; |
|
88 ConstraintPart constraint; |
|
89 XmManagerPart manager; |
|
90 GridPart mywidget; |
|
91 } GridRec; |
|
92 |
|
93 typedef struct GridContraintPart { |
|
94 Dimension x; |
|
95 Dimension y; |
|
96 Dimension margin_left; |
|
97 Dimension margin_right; |
|
98 Dimension margin_top; |
|
99 Dimension margin_bottom; |
|
100 Boolean hexpand; |
|
101 Boolean vexpand; |
|
102 Boolean hfill; |
|
103 Boolean vfill; |
|
104 Dimension colspan; |
|
105 Dimension rowspan; |
|
106 Dimension pref_width; |
|
107 Dimension pref_height; |
|
108 } GridContraintPart; |
|
109 |
|
110 typedef struct GridConstraintRec { |
|
111 XmManagerConstraintPart manager; |
|
112 GridContraintPart grid; |
|
113 } GridConstraintRec; |
|
114 |
|
115 typedef GridRec* MyWidget; |
|
116 |
|
117 extern WidgetClass gridClass; |
|
118 |
|
119 void grid_class_initialize(); |
|
120 void grid_initialize(); |
|
121 void grid_realize(); |
|
122 void grid_destroy(); |
|
123 void grid_resize(); |
|
124 void grid_expose(); |
|
125 Boolean grid_set_values(); |
|
126 Boolean grid_acceptfocus(Widget , Time*); |
|
127 |
|
128 void grid_place_children(MyWidget w); |
|
129 |
|
130 void grid_getfocus(); |
|
131 void grid_loosefocus(); |
|
132 |
|
133 void grid_constraint_init( |
|
134 Widget request, |
|
135 Widget neww, |
|
136 ArgList args, |
|
137 Cardinal* num_args |
|
138 ); |
|
139 |
|
140 XtGeometryResult GridGeometryManager(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *reply); |
|
141 void GridChangeManaged(Widget widget); |
|
142 Boolean ConstraintSetValues(Widget old, Widget request, Widget neww, ArgList args, Cardinal *num_args); |
|
143 |
|
144 |
|
145 #ifdef __cplusplus |
|
146 } |
|
147 #endif |
|
148 |
|
149 #endif /* GRID_H */ |
|
150 |