Sat, 04 Oct 2025 14:52:59 +0200
fix repolist menu button
| 100 | 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 | ||
|
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
43 | // resources |
|
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
44 | #define gridColumnSpacing "gridColumnSpacing" |
|
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
45 | #define gridRowSpacing "gridRowSpacing" |
|
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
46 | #define gridMargin "gridMargin" |
|
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
47 | |
|
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
48 | // constraints |
| 100 | 49 | #define gridColumn "gridColumn" |
| 50 | #define gridRow "gridRow" | |
| 51 | #define gridColspan "gridColspan" | |
| 52 | #define gridRowspan "gridRowspan" | |
| 53 | #define gridHExpand "gridHExpand" | |
| 54 | #define gridVExpand "gridVExpand" | |
| 55 | #define gridHFill "gridHFill" | |
| 56 | #define gridVFill "gridVFill" | |
| 57 | #define gridMarginLeft "gridMarginLeft" | |
| 58 | #define gridMarginRight "gridMarginRight" | |
| 59 | #define gridMarginTop "gridMarginTop" | |
| 60 | #define gridMarginBottom "gridMarginBottom" | |
|
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
61 | #define gridMinWidth "gridMinWidth" |
| 100 | 62 | |
| 63 | ||
| 64 | typedef struct GridDef { | |
| 65 | Dimension size; | |
| 66 | Dimension pos; | |
| 67 | Boolean expand; | |
| 68 | } GridDef; | |
| 69 | ||
| 70 | typedef struct GridClassPart { | |
| 71 | int test; | |
| 72 | } GridClassPart; | |
| 73 | ||
| 74 | typedef struct GridClassRec { | |
| 75 | CoreClassPart core_class; | |
| 76 | CompositeClassPart composite_class; | |
| 77 | ConstraintClassPart constraint_class; | |
| 78 | XmManagerClassPart manager_class; | |
| 79 | GridClassPart mywidgetclass; | |
| 80 | } GridClassRec; | |
| 81 | ||
| 82 | ||
| 83 | typedef struct GridPart { | |
| 84 | int margin_left; | |
| 85 | int margin_right; | |
| 86 | int margin_top; | |
| 87 | int margin_bottom; | |
| 88 | int max_col; | |
| 89 | int max_row; | |
|
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
90 | Dimension columnspacing; |
|
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
91 | Dimension rowspacing; |
|
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
92 | Dimension margin; |
| 100 | 93 | |
| 94 | Boolean sizerequest; | |
| 95 | } GridPart; | |
| 96 | ||
| 97 | typedef struct GridRec { | |
| 98 | CorePart core; | |
| 99 | CompositePart composite; | |
| 100 | ConstraintPart constraint; | |
| 101 | XmManagerPart manager; | |
| 102 | GridPart mywidget; | |
| 103 | } GridRec; | |
| 104 | ||
| 105 | typedef struct GridContraintPart { | |
| 106 | Dimension x; | |
| 107 | Dimension y; | |
| 108 | Dimension margin_left; | |
| 109 | Dimension margin_right; | |
| 110 | Dimension margin_top; | |
| 111 | Dimension margin_bottom; | |
| 112 | Boolean hexpand; | |
| 113 | Boolean vexpand; | |
| 114 | Boolean hfill; | |
| 115 | Boolean vfill; | |
| 116 | Dimension colspan; | |
| 117 | Dimension rowspan; | |
| 118 | Dimension pref_width; | |
| 119 | Dimension pref_height; | |
|
101
7b3a3130be44
update ucx, toolkit
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
100
diff
changeset
|
120 | Dimension min_width; |
| 100 | 121 | } GridContraintPart; |
| 122 | ||
| 123 | typedef struct GridConstraintRec { | |
| 124 | XmManagerConstraintPart manager; | |
| 125 | GridContraintPart grid; | |
| 126 | } GridConstraintRec; | |
| 127 | ||
|
110
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
128 | typedef GridRec* Grid; |
| 100 | 129 | |
| 130 | extern WidgetClass gridClass; | |
| 131 | ||
|
110
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
132 | void grid_class_initialize(void); |
|
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
133 | void grid_initialize(Widget request, Widget new, ArgList args, Cardinal num_args); |
|
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
134 | void grid_realize(Widget w,XtValueMask *valueMask,XSetWindowAttributes *attributes); |
|
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
135 | void grid_destroy(Grid widget); |
|
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
136 | void grid_resize(Grid widget); |
|
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
137 | void grid_expose(Grid widget, XEvent *event, Region region); |
|
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
138 | Boolean grid_set_values(Widget old, Widget request, Widget neww, ArgList args, Cardinal *num_args); |
| 100 | 139 | Boolean grid_acceptfocus(Widget , Time*); |
| 140 | ||
|
110
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
141 | void grid_place_children(Grid w); |
| 100 | 142 | |
|
110
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
143 | void grid_getfocus(Widget myw, XEvent *event, String *params, Cardinal *nparam); |
|
c00e968d018b
fix repolist menu button
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
101
diff
changeset
|
144 | void grid_loosefocus(Widget myw, XEvent *event, String *params, Cardinal *nparam); |
| 100 | 145 | |
| 146 | void grid_constraint_init( | |
| 147 | Widget request, | |
| 148 | Widget neww, | |
| 149 | ArgList args, | |
| 150 | Cardinal* num_args | |
| 151 | ); | |
| 152 | ||
| 153 | XtGeometryResult GridGeometryManager(Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *reply); | |
| 154 | void GridChangeManaged(Widget widget); | |
| 155 | Boolean ConstraintSetValues(Widget old, Widget request, Widget neww, ArgList args, Cardinal *num_args); | |
| 156 | ||
| 157 | ||
| 158 | #ifdef __cplusplus | |
| 159 | } | |
| 160 | #endif | |
| 161 | ||
| 162 | #endif /* GRID_H */ | |
| 163 |