| 1 | /* |
| 2 | * Copyright © 2025 Red Hat, Inc |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2.1 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 16 | * |
| 17 | * SPDX-License-Identifier: LGPL-2.1-or-later |
| 18 | * |
| 19 | * Authors: Matthias Clasen <[email protected]> |
| 20 | */ |
| 21 | |
| 22 | #include "range-editor.h"cxx . . $ `<file>/demos/gtk-demo/range-editor.h`/ |
| 23 | |
| 24 | /* {{{ Gizmo */ |
| 25 | |
| 26 | #define GIZMO_TYPEcxx . . $ `demos/gtk-demo/range-editor.c:26:9`! (gizmo_get_type ()) |
| 27 | G_DECLARE_FINAL_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1608:9`! (Gizmo, gizmo, GIZ, MO, GtkWidget) |
| 28 | |
| 29 | typedef void (* GizmoMeasureFunccxx . . $ GizmoMeasureFunc#) (Gizmocxx . . $ Gizmo# *gizmo, |
| 30 | GtkOrientationcxx . . $ GtkOrientation# orientation, |
| 31 | int for_size, |
| 32 | int *minimum, |
| 33 | int *natural, |
| 34 | int *minimum_baseline, |
| 35 | int *natural_baseline); |
| 36 | typedef void (* GizmoAllocateFunccxx . . $ GizmoAllocateFunc#) (Gizmocxx . . $ Gizmo# *gizmo, |
| 37 | int width, |
| 38 | int height, |
| 39 | int baseline); |
| 40 | typedef void (* GizmoSnapshotFunccxx . . $ GizmoSnapshotFunc#) (Gizmocxx . . $ Gizmo# *gizmo, |
| 41 | GtkSnapshotcxx . . $ GtkSnapshot# *snapshot); |
| 42 | |
| 43 | struct _Gizmocxx . . $ _Gizmo# |
| 44 | { |
| 45 | GtkWidgetcxx . . $ GtkWidget# parent_instancecxx . . $ _Gizmo#parent_instance.; |
| 46 | |
| 47 | GizmoMeasureFunccxx . . $ GizmoMeasureFunc# measure_funccxx . . $ _Gizmo#measure_func.; |
| 48 | GizmoAllocateFunccxx . . $ GizmoAllocateFunc# allocate_funccxx . . $ _Gizmo#allocate_func.; |
| 49 | GizmoSnapshotFunccxx . . $ GizmoSnapshotFunc# snapshot_funccxx . . $ _Gizmo#snapshot_func.; |
| 50 | }; |
| 51 | |
| 52 | struct _GizmoClasscxx . . $ _GizmoClass# |
| 53 | { |
| 54 | GtkWidgetClasscxx . . $ GtkWidgetClass# parent_classcxx . . $ _GizmoClass#parent_class.; |
| 55 | }; |
| 56 | |
| 57 | G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (Gizmo, gizmo, GTK_TYPE_WIDGETcxx . . $ `gtk/gtkwidget.h:43:9`!); |
| 58 | |
| 59 | static void |
| 60 | gizmo_measurecxx . . $ gizmo_measure(d91afbd837fc0c19). (GtkWidgetcxx . . $ GtkWidget# *widget, |
| 61 | GtkOrientationcxx . . $ GtkOrientation# orientation, |
| 62 | int for_size, |
| 63 | int *minimum, |
| 64 | int *natural, |
| 65 | int *minimum_baseline, |
| 66 | int *natural_baseline) |
| 67 | { |
| 68 | Gizmocxx . . $ Gizmo# *self = GIZ_MOcxx . . $ GIZ_MO(59d18246bcab4df9). (widget); |
| 69 | |
| 70 | if (self->measure_funccxx . . $ _Gizmo#measure_func.) |
| 71 | self->measure_funccxx . . $ _Gizmo#measure_func. (self, orientation, for_size, |
| 72 | minimum, natural, |
| 73 | minimum_baseline, natural_baseline); |
| 74 | } |
| 75 | |
| 76 | static void |
| 77 | gizmo_size_allocatecxx . . $ gizmo_size_allocate(598a503332136822). (GtkWidgetcxx . . $ GtkWidget# *widget, |
| 78 | int width, |
| 79 | int height, |
| 80 | int baseline) |
| 81 | { |
| 82 | Gizmocxx . . $ Gizmo# *self = GIZ_MOcxx . . $ GIZ_MO(59d18246bcab4df9). (widget); |
| 83 | |
| 84 | if (self->allocate_funccxx . . $ _Gizmo#allocate_func.) |
| 85 | self->allocate_funccxx . . $ _Gizmo#allocate_func. (self, width, height, baseline); |
| 86 | } |
| 87 | |
| 88 | static void |
| 89 | gizmo_snapshotcxx . . $ gizmo_snapshot(80012d1141bb3efa). (GtkWidgetcxx . . $ GtkWidget# *widget, |
| 90 | GtkSnapshotcxx . . $ GtkSnapshot# *snapshot) |
| 91 | { |
| 92 | Gizmocxx . . $ Gizmo# *self = GIZ_MOcxx . . $ GIZ_MO(59d18246bcab4df9). (widget); |
| 93 | |
| 94 | if (self->snapshot_funccxx . . $ _Gizmo#snapshot_func.) |
| 95 | self->snapshot_funccxx . . $ _Gizmo#snapshot_func. (self, snapshot); |
| 96 | else |
| 97 | GTK_WIDGET_CLASScxx . . $ `gtk/gtkwidget.h:45:9`! (gizmo_parent_class)->snapshotcxx . . $ _GtkWidgetClass#snapshot. (widget, snapshot); |
| 98 | } |
| 99 | |
| 100 | static void |
| 101 | gizmo_finalizecxx . . $ gizmo_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 102 | { |
| 103 | Gizmocxx . . $ Gizmo# *self = GIZ_MOcxx . . $ GIZ_MO(59d18246bcab4df9). (object); |
| 104 | GtkWidgetcxx . . $ GtkWidget# *child; |
| 105 | |
| 106 | while ((child = gtk_widget_get_first_childcxx . . $ gtk_widget_get_first_child(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (self))) != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 107 | gtk_widget_unparentcxx . . $ gtk_widget_unparent(d7cf858254b37903). (child); |
| 108 | |
| 109 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gizmo_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object); |
| 110 | } |
| 111 | |
| 112 | static void |
| 113 | gizmo_class_initcxx . . $ gizmo_class_init(3e799598cc687c12). (GizmoClasscxx . . $ GizmoClass# *klass) |
| 114 | { |
| 115 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 116 | GtkWidgetClasscxx . . $ GtkWidgetClass# *widget_class = GTK_WIDGET_CLASScxx . . $ `gtk/gtkwidget.h:45:9`! (klass); |
| 117 | |
| 118 | object_class->finalizecxx . . $ _GObjectClass#finalize. = gizmo_finalizecxx . . $ gizmo_finalize(6087475fa43034d3).; |
| 119 | |
| 120 | widget_class->measurecxx . . $ _GtkWidgetClass#measure. = gizmo_measurecxx . . $ gizmo_measure(d91afbd837fc0c19).; |
| 121 | widget_class->size_allocatecxx . . $ _GtkWidgetClass#size_allocate. = gizmo_size_allocatecxx . . $ gizmo_size_allocate(598a503332136822).; |
| 122 | widget_class->snapshotcxx . . $ _GtkWidgetClass#snapshot. = gizmo_snapshotcxx . . $ gizmo_snapshot(80012d1141bb3efa).; |
| 123 | } |
| 124 | |
| 125 | static void |
| 126 | gizmo_initcxx . . $ gizmo_init(5efa2a55063848cd). (Gizmocxx . . $ Gizmo# *self) |
| 127 | { |
| 128 | } |
| 129 | |
| 130 | static GtkWidgetcxx . . $ GtkWidget# * |
| 131 | gizmo_newcxx . . $ gizmo_new(d700917ee0cea3f8). (const char *css_name, |
| 132 | GizmoMeasureFunccxx . . $ GizmoMeasureFunc# measure_func, |
| 133 | GizmoAllocateFunccxx . . $ GizmoAllocateFunc# allocate_func, |
| 134 | GizmoSnapshotFunccxx . . $ GizmoSnapshotFunc# snapshot_func) |
| 135 | { |
| 136 | Gizmocxx . . $ Gizmo# *gizmo; |
| 137 | |
| 138 | gizmo = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GIZMO_TYPEcxx . . $ `demos/gtk-demo/range-editor.c:26:9`!, |
| 139 | "css-name", css_name, |
| 140 | "accessible-role", GTK_ACCESSIBLE_ROLE_NONEcxx . . $ GTK_ACCESSIBLE_ROLE_NONE., |
| 141 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 142 | |
| 143 | gizmo->measure_funccxx . . $ _Gizmo#measure_func. = measure_func; |
| 144 | gizmo->allocate_funccxx . . $ _Gizmo#allocate_func. = allocate_func; |
| 145 | gizmo->snapshot_funccxx . . $ _Gizmo#snapshot_func. = snapshot_func; |
| 146 | |
| 147 | return GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (gizmo); |
| 148 | } |
| 149 | |
| 150 | /* }}} */ |
| 151 | |
| 152 | struct _RangeEditorcxx . . $ _RangeEditor# |
| 153 | { |
| 154 | GtkWidgetcxx . . $ GtkWidget# parent_instancecxx . . $ _RangeEditor#parent_instance.; |
| 155 | |
| 156 | float lowercxx . . $ _RangeEditor#lower.; |
| 157 | float uppercxx . . $ _RangeEditor#upper.; |
| 158 | float value1cxx . . $ _RangeEditor#value1.; |
| 159 | float value2cxx . . $ _RangeEditor#value2.; |
| 160 | |
| 161 | GtkWidgetcxx . . $ GtkWidget# *troughcxx . . $ _RangeEditor#trough.; |
| 162 | GtkWidgetcxx . . $ GtkWidget# *highlightcxx . . $ _RangeEditor#highlight.; |
| 163 | GtkWidgetcxx . . $ GtkWidget# *slider1cxx . . $ _RangeEditor#slider1.; |
| 164 | GtkWidgetcxx . . $ GtkWidget# *slider2cxx . . $ _RangeEditor#slider2.; |
| 165 | |
| 166 | GtkGesturecxx . . $ GtkGesture# *drag_gesturecxx . . $ _RangeEditor#drag_gesture.; |
| 167 | GtkWidgetcxx . . $ GtkWidget# *mouse_locationcxx . . $ _RangeEditor#mouse_location.; |
| 168 | }; |
| 169 | |
| 170 | enumcxx . . $ $anonymous_type_f8063fa478bccfe6_1# |
| 171 | { |
| 172 | PROP_LOWERcxx . . $ PROP_LOWER. = 1, |
| 173 | PROP_UPPERcxx . . $ PROP_UPPER., |
| 174 | PROP_VALUE1cxx . . $ PROP_VALUE1., |
| 175 | PROP_VALUE2cxx . . $ PROP_VALUE2., |
| 176 | NUM_PROPERTIEScxx . . $ NUM_PROPERTIES., |
| 177 | }; |
| 178 | |
| 179 | static GParamSpeccxx . . $ GParamSpec# *propertiescxx . . $ properties.[NUM_PROPERTIEScxx . . $ NUM_PROPERTIES.]; |
| 180 | |
| 181 | struct _RangeEditorClasscxx . . $ _RangeEditorClass# |
| 182 | { |
| 183 | GtkWidgetClasscxx . . $ GtkWidgetClass# parent_classcxx . . $ _RangeEditorClass#parent_class.; |
| 184 | }; |
| 185 | |
| 186 | G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (RangeEditor, range_editor, GTK_TYPE_WIDGETcxx . . $ `gtk/gtkwidget.h:43:9`!) |
| 187 | |
| 188 | /* {{{ Setters */ |
| 189 | |
| 190 | static void |
| 191 | range_editor_set_valuescxx . . $ range_editor_set_values(c63f313beadc0972). (RangeEditorcxx . . $ RangeEditor# *self, |
| 192 | float value1, |
| 193 | float value2) |
| 194 | { |
| 195 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (self->lower <= value1); |
| 196 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (value1 <= value2); |
| 197 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (value2 <= self->upper); |
| 198 | |
| 199 | if (self->value1cxx . . $ _RangeEditor#value1. == value1 && self->value2cxx . . $ _RangeEditor#value2. == value2) |
| 200 | return; |
| 201 | |
| 202 | g_object_freeze_notifycxx . . $ g_object_freeze_notify(6087475fa43034d3). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self)); |
| 203 | |
| 204 | if (self->value1cxx . . $ _RangeEditor#value1. != value1) |
| 205 | { |
| 206 | self->value1cxx . . $ _RangeEditor#value1. = value1; |
| 207 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_VALUE1cxx . . $ PROP_VALUE1.]); |
| 208 | } |
| 209 | |
| 210 | if (self->value2cxx . . $ _RangeEditor#value2. != value2) |
| 211 | { |
| 212 | self->value2cxx . . $ _RangeEditor#value2. = value2; |
| 213 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_VALUE2cxx . . $ PROP_VALUE2.]); |
| 214 | } |
| 215 | |
| 216 | g_object_thaw_notifycxx . . $ g_object_thaw_notify(6087475fa43034d3). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self)); |
| 217 | gtk_widget_queue_resizecxx . . $ gtk_widget_queue_resize(d7cf858254b37903). (self->highlightcxx . . $ _RangeEditor#highlight.); |
| 218 | gtk_widget_queue_resizecxx . . $ gtk_widget_queue_resize(d7cf858254b37903). (self->slider1cxx . . $ _RangeEditor#slider1.); |
| 219 | gtk_widget_queue_resizecxx . . $ gtk_widget_queue_resize(d7cf858254b37903). (self->slider2cxx . . $ _RangeEditor#slider2.); |
| 220 | } |
| 221 | |
| 222 | static void |
| 223 | range_editor_set_limitscxx . . $ range_editor_set_limits(c63f313beadc0972). (RangeEditorcxx . . $ RangeEditor# *self, |
| 224 | float lower, |
| 225 | float upper) |
| 226 | { |
| 227 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (lower <= upper); |
| 228 | |
| 229 | if (self->lowercxx . . $ _RangeEditor#lower. == lower && self->uppercxx . . $ _RangeEditor#upper. == upper) |
| 230 | return; |
| 231 | |
| 232 | g_object_freeze_notifycxx . . $ g_object_freeze_notify(6087475fa43034d3). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self)); |
| 233 | |
| 234 | if (self->lowercxx . . $ _RangeEditor#lower. != lower) |
| 235 | { |
| 236 | self->lowercxx . . $ _RangeEditor#lower. = lower; |
| 237 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_LOWERcxx . . $ PROP_LOWER.]); |
| 238 | } |
| 239 | |
| 240 | if (self->uppercxx . . $ _RangeEditor#upper. != upper) |
| 241 | { |
| 242 | self->uppercxx . . $ _RangeEditor#upper. = upper; |
| 243 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_UPPERcxx . . $ PROP_UPPER.]); |
| 244 | } |
| 245 | |
| 246 | range_editor_set_valuescxx . . $ range_editor_set_values(c63f313beadc0972). (self, |
| 247 | CLAMPcxx . . $ `<external>/12741050725406041920/gmacros.h:984:9`! (self->value1, self->lower, self->upper), |
| 248 | CLAMPcxx . . $ `<external>/12741050725406041920/gmacros.h:984:9`! (self->value2, self->lower, self->upper)); |
| 249 | |
| 250 | g_object_thaw_notifycxx . . $ g_object_thaw_notify(6087475fa43034d3). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self)); |
| 251 | gtk_widget_queue_resizecxx . . $ gtk_widget_queue_resize(d7cf858254b37903). (self->highlightcxx . . $ _RangeEditor#highlight.); |
| 252 | } |
| 253 | |
| 254 | /* }}} */ |
| 255 | /* {{{ Utilities */ |
| 256 | |
| 257 | static void |
| 258 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (GtkWidgetcxx . . $ GtkWidget# *widget, |
| 259 | GtkOrientationcxx . . $ GtkOrientation# orientation, |
| 260 | int *min, |
| 261 | int *nat) |
| 262 | { |
| 263 | gtk_widget_measurecxx . . $ gtk_widget_measure(d91afbd837fc0c19). (widget, orientation, -1, min, nat, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 264 | } |
| 265 | |
| 266 | /* }}} */ |
| 267 | /* {{{ Trough */ |
| 268 | |
| 269 | static void |
| 270 | measure_troughcxx . . $ measure_trough(b275086766978540). (Gizmocxx . . $ Gizmo# *gizmo, |
| 271 | GtkOrientationcxx . . $ GtkOrientation# orientation, |
| 272 | int for_size, |
| 273 | int *minimum, |
| 274 | int *natural, |
| 275 | int *minimum_baseline, |
| 276 | int *natural_baseline) |
| 277 | { |
| 278 | RangeEditorcxx . . $ RangeEditor# *self = RANGE_EDITORcxx . . $ RANGE_EDITOR(393ac873f5ced9f4). (gtk_widget_get_parentcxx . . $ gtk_widget_get_parent(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (gizmo))); |
| 279 | int min, nat; |
| 280 | |
| 281 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->highlightcxx . . $ _RangeEditor#highlight., orientation, minimum, natural); |
| 282 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->slider1cxx . . $ _RangeEditor#slider1., orientation, &min, &nat); |
| 283 | |
| 284 | if (orientation == GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL.) |
| 285 | { |
| 286 | *minimum += min; |
| 287 | *natural += nat; |
| 288 | } |
| 289 | else |
| 290 | { |
| 291 | *minimum = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (*minimum, min); |
| 292 | *natural = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (*natural, nat); |
| 293 | } |
| 294 | |
| 295 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->slider2cxx . . $ _RangeEditor#slider2., orientation, &min, &nat); |
| 296 | |
| 297 | if (orientation == GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL.) |
| 298 | { |
| 299 | *minimum += min; |
| 300 | *natural += nat; |
| 301 | } |
| 302 | else |
| 303 | { |
| 304 | *minimum = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (*minimum, min); |
| 305 | *natural = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (*natural, nat); |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | static void |
| 310 | allocate_troughcxx . . $ allocate_trough(260faa454412689c). (Gizmocxx . . $ Gizmo# *gizmo, |
| 311 | int width, |
| 312 | int height, |
| 313 | int baseline) |
| 314 | { |
| 315 | RangeEditorcxx . . $ RangeEditor# *self = RANGE_EDITORcxx . . $ RANGE_EDITOR(393ac873f5ced9f4). (gtk_widget_get_parentcxx . . $ gtk_widget_get_parent(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (gizmo))); |
| 316 | GtkAllocationcxx . . $ GtkAllocation# alloc; |
| 317 | float x1, x2; |
| 318 | int slider_width, slider_height; |
| 319 | |
| 320 | x1 = width * (self->value1cxx . . $ _RangeEditor#value1. - self->lowercxx . . $ _RangeEditor#lower.) / (self->uppercxx . . $ _RangeEditor#upper. - self->lowercxx . . $ _RangeEditor#lower.); |
| 321 | x2 = width * (self->value2cxx . . $ _RangeEditor#value2. - self->lowercxx . . $ _RangeEditor#lower.) / (self->uppercxx . . $ _RangeEditor#upper. - self->lowercxx . . $ _RangeEditor#lower.); |
| 322 | |
| 323 | alloc.xcxx . . $ _cairo_rectangle_int#x. = x1; |
| 324 | alloc.ycxx . . $ _cairo_rectangle_int#y. = 0; |
| 325 | alloc.widthcxx . . $ _cairo_rectangle_int#width. = x2 - x1; |
| 326 | alloc.heightcxx . . $ _cairo_rectangle_int#height. = height; |
| 327 | |
| 328 | gtk_widget_size_allocatecxx . . $ gtk_widget_size_allocate(6dbef67925be57e3). (self->highlightcxx . . $ _RangeEditor#highlight., &alloc, -1); |
| 329 | |
| 330 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->slider1cxx . . $ _RangeEditor#slider1., GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL., &slider_width, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 331 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->slider1cxx . . $ _RangeEditor#slider1., GTK_ORIENTATION_VERTICALcxx . . $ GTK_ORIENTATION_VERTICAL., &slider_height, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 332 | |
| 333 | alloc.xcxx . . $ _cairo_rectangle_int#x. = x1 - slider_width; |
| 334 | alloc.ycxx . . $ _cairo_rectangle_int#y. = (height - slider_height) / 2; |
| 335 | alloc.widthcxx . . $ _cairo_rectangle_int#width. = slider_width; |
| 336 | alloc.heightcxx . . $ _cairo_rectangle_int#height. = slider_height; |
| 337 | |
| 338 | gtk_widget_size_allocatecxx . . $ gtk_widget_size_allocate(6dbef67925be57e3). (self->slider1cxx . . $ _RangeEditor#slider1., &alloc, -1); |
| 339 | |
| 340 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->slider2cxx . . $ _RangeEditor#slider2., GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL., &slider_width, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 341 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->slider2cxx . . $ _RangeEditor#slider2., GTK_ORIENTATION_VERTICALcxx . . $ GTK_ORIENTATION_VERTICAL., &slider_height, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 342 | |
| 343 | alloc.xcxx . . $ _cairo_rectangle_int#x. = x2; |
| 344 | alloc.ycxx . . $ _cairo_rectangle_int#y. = (height - slider_height) / 2; |
| 345 | alloc.widthcxx . . $ _cairo_rectangle_int#width. = slider_width; |
| 346 | alloc.heightcxx . . $ _cairo_rectangle_int#height. = slider_height; |
| 347 | |
| 348 | gtk_widget_size_allocatecxx . . $ gtk_widget_size_allocate(6dbef67925be57e3). (self->slider2cxx . . $ _RangeEditor#slider2., &alloc, -1); |
| 349 | } |
| 350 | |
| 351 | static void |
| 352 | render_troughcxx . . $ render_trough(10a56c44b34c623b). (Gizmocxx . . $ Gizmo# *gizmo, |
| 353 | GtkSnapshotcxx . . $ GtkSnapshot# *snapshot) |
| 354 | { |
| 355 | RangeEditorcxx . . $ RangeEditor# *self = RANGE_EDITORcxx . . $ RANGE_EDITOR(393ac873f5ced9f4). (gtk_widget_get_parentcxx . . $ gtk_widget_get_parent(ef973e1b01680070). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (gizmo))); |
| 356 | |
| 357 | gtk_widget_snapshot_childcxx . . $ gtk_widget_snapshot_child(70f87a8b59fe0054). (self->troughcxx . . $ _RangeEditor#trough., self->highlightcxx . . $ _RangeEditor#highlight., snapshot); |
| 358 | gtk_widget_snapshot_childcxx . . $ gtk_widget_snapshot_child(70f87a8b59fe0054). (self->troughcxx . . $ _RangeEditor#trough., self->slider1cxx . . $ _RangeEditor#slider1., snapshot); |
| 359 | gtk_widget_snapshot_childcxx . . $ gtk_widget_snapshot_child(70f87a8b59fe0054). (self->troughcxx . . $ _RangeEditor#trough., self->slider2cxx . . $ _RangeEditor#slider2., snapshot); |
| 360 | } |
| 361 | |
| 362 | /* }}} */ |
| 363 | /* {{{ Input */ |
| 364 | |
| 365 | static void |
| 366 | drag_gesture_begincxx . . $ drag_gesture_begin(121df8fdf805d774). (GtkGestureDragcxx . . $ GtkGestureDrag# *gesture, |
| 367 | double offset_x, |
| 368 | double offset_y, |
| 369 | RangeEditorcxx . . $ RangeEditor# *self) |
| 370 | { |
| 371 | self->mouse_locationcxx . . $ _RangeEditor#mouse_location. = gtk_widget_pickcxx . . $ gtk_widget_pick(1e218a8e6450ca93). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (self), offset_x, offset_y, 0); |
| 372 | |
| 373 | if (self->mouse_locationcxx . . $ _RangeEditor#mouse_location. == self->slider1cxx . . $ _RangeEditor#slider1. || |
| 374 | self->mouse_locationcxx . . $ _RangeEditor#mouse_location. == self->slider2cxx . . $ _RangeEditor#slider2.) |
| 375 | gtk_gesture_set_statecxx . . $ gtk_gesture_set_state(e8b82f7bdf7c1c23). (self->drag_gesturecxx . . $ _RangeEditor#drag_gesture., GTK_EVENT_SEQUENCE_CLAIMEDcxx . . $ GTK_EVENT_SEQUENCE_CLAIMED.); |
| 376 | } |
| 377 | |
| 378 | static void |
| 379 | drag_gesture_endcxx . . $ drag_gesture_end(121df8fdf805d774). (GtkGestureDragcxx . . $ GtkGestureDrag# *gesture, |
| 380 | double offset_x, |
| 381 | double offset_y, |
| 382 | RangeEditorcxx . . $ RangeEditor# *self) |
| 383 | { |
| 384 | self->mouse_locationcxx . . $ _RangeEditor#mouse_location. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 385 | } |
| 386 | |
| 387 | static void |
| 388 | drag_gesture_updatecxx . . $ drag_gesture_update(121df8fdf805d774). (GtkGestureDragcxx . . $ GtkGestureDrag# *gesture, |
| 389 | double offset_x, |
| 390 | double offset_y, |
| 391 | RangeEditorcxx . . $ RangeEditor# *self) |
| 392 | { |
| 393 | double start_x, start_y; |
| 394 | |
| 395 | if (self->mouse_locationcxx . . $ _RangeEditor#mouse_location. == self->slider1cxx . . $ _RangeEditor#slider1. || |
| 396 | self->mouse_locationcxx . . $ _RangeEditor#mouse_location. == self->slider2cxx . . $ _RangeEditor#slider2.) |
| 397 | { |
| 398 | int mouse_x; |
| 399 | float v; |
| 400 | graphene_rect_tcxx . . $ graphene_rect_t# bounds; |
| 401 | |
| 402 | gtk_gesture_drag_get_start_pointcxx . . $ gtk_gesture_drag_get_start_point(6882bde6afecff9c). (gesture, &start_x, &start_y); |
| 403 | mouse_x = start_x + offset_x; |
| 404 | |
| 405 | if (!gtk_widget_compute_boundscxx . . $ gtk_widget_compute_bounds(167d30efbd6565d7). (self->troughcxx . . $ _RangeEditor#trough., GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (self), &bounds)) |
| 406 | g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! (); |
| 407 | |
| 408 | v = self->lowercxx . . $ _RangeEditor#lower. + (mouse_x - bounds.origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x.) / bounds.sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. * (self->uppercxx . . $ _RangeEditor#upper. - self->lowercxx . . $ _RangeEditor#lower.); |
| 409 | |
| 410 | if (self->mouse_locationcxx . . $ _RangeEditor#mouse_location. == self->slider1cxx . . $ _RangeEditor#slider1.) |
| 411 | { |
| 412 | v = CLAMPcxx . . $ `<external>/12741050725406041920/gmacros.h:984:9`! (v, self->lower, self->upper); |
| 413 | range_editor_set_valuescxx . . $ range_editor_set_values(c63f313beadc0972). (self, MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (v, self->value2), self->value2cxx . . $ _RangeEditor#value2.); |
| 414 | } |
| 415 | else if (self->mouse_locationcxx . . $ _RangeEditor#mouse_location. == self->slider2cxx . . $ _RangeEditor#slider2.) |
| 416 | { |
| 417 | v = CLAMPcxx . . $ `<external>/12741050725406041920/gmacros.h:984:9`! (v, self->lower, self->upper); |
| 418 | range_editor_set_valuescxx . . $ range_editor_set_values(c63f313beadc0972). (self, self->value1cxx . . $ _RangeEditor#value1., MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (self->value1, v)); |
| 419 | } |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | /* }}} */ |
| 424 | /* {{{ GtkWidget implementation */ |
| 425 | |
| 426 | static void |
| 427 | range_editor_measurecxx . . $ range_editor_measure(d91afbd837fc0c19). (GtkWidgetcxx . . $ GtkWidget# *widget, |
| 428 | GtkOrientationcxx . . $ GtkOrientation# orientation, |
| 429 | int for_size, |
| 430 | int *minimum, |
| 431 | int *natural, |
| 432 | int *minimum_baseline, |
| 433 | int *natural_baseline) |
| 434 | { |
| 435 | RangeEditorcxx . . $ RangeEditor# *self = RANGE_EDITORcxx . . $ RANGE_EDITOR(393ac873f5ced9f4). (widget); |
| 436 | |
| 437 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->troughcxx . . $ _RangeEditor#trough., orientation, minimum, natural); |
| 438 | } |
| 439 | |
| 440 | static void |
| 441 | range_editor_size_allocatecxx . . $ range_editor_size_allocate(598a503332136822). (GtkWidgetcxx . . $ GtkWidget# *widget, |
| 442 | int width, |
| 443 | int height, |
| 444 | int baseline) |
| 445 | { |
| 446 | RangeEditorcxx . . $ RangeEditor# *self = RANGE_EDITORcxx . . $ RANGE_EDITOR(393ac873f5ced9f4). (widget); |
| 447 | GtkAllocationcxx . . $ GtkAllocation# alloc; |
| 448 | int min_height; |
| 449 | int slider1_width, slider2_width; |
| 450 | |
| 451 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->slider1cxx . . $ _RangeEditor#slider1., GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL., &slider1_width, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 452 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->slider2cxx . . $ _RangeEditor#slider2., GTK_ORIENTATION_HORIZONTALcxx . . $ GTK_ORIENTATION_HORIZONTAL., &slider2_width, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 453 | measure_widgetcxx . . $ measure_widget(ef918bae23eb42e2). (self->troughcxx . . $ _RangeEditor#trough., GTK_ORIENTATION_VERTICALcxx . . $ GTK_ORIENTATION_VERTICAL., &min_height, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 454 | |
| 455 | alloc.xcxx . . $ _cairo_rectangle_int#x. = slider1_width; |
| 456 | alloc.ycxx . . $ _cairo_rectangle_int#y. = (height - min_height) / 2; |
| 457 | alloc.widthcxx . . $ _cairo_rectangle_int#width. = width - slider1_width - slider2_width; |
| 458 | alloc.heightcxx . . $ _cairo_rectangle_int#height. = min_height; |
| 459 | |
| 460 | gtk_widget_size_allocatecxx . . $ gtk_widget_size_allocate(6dbef67925be57e3). (self->troughcxx . . $ _RangeEditor#trough., &alloc, -1); |
| 461 | } |
| 462 | |
| 463 | /* }}} */ |
| 464 | /* {{{ GObject boilerplate */ |
| 465 | |
| 466 | static void |
| 467 | range_editor_initcxx . . $ range_editor_init(654f1eabd1acf56f). (RangeEditorcxx . . $ RangeEditor# *self) |
| 468 | { |
| 469 | self->lowercxx . . $ _RangeEditor#lower. = 0; |
| 470 | self->uppercxx . . $ _RangeEditor#upper. = 0; |
| 471 | self->value1cxx . . $ _RangeEditor#value1. = 0; |
| 472 | self->value2cxx . . $ _RangeEditor#value2. = 0; |
| 473 | |
| 474 | self->troughcxx . . $ _RangeEditor#trough. = gizmo_newcxx . . $ gizmo_new(d700917ee0cea3f8). ("trough", |
| 475 | measure_troughcxx . . $ measure_trough(b275086766978540)., |
| 476 | allocate_troughcxx . . $ allocate_trough(260faa454412689c)., |
| 477 | render_troughcxx . . $ render_trough(10a56c44b34c623b).); |
| 478 | gtk_widget_set_parentcxx . . $ gtk_widget_set_parent(4f261c0971c30e7). (self->troughcxx . . $ _RangeEditor#trough., GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (self)); |
| 479 | |
| 480 | self->highlightcxx . . $ _RangeEditor#highlight. = gizmo_newcxx . . $ gizmo_new(d700917ee0cea3f8). ("highlight", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 481 | gtk_widget_set_parentcxx . . $ gtk_widget_set_parent(4f261c0971c30e7). (self->highlightcxx . . $ _RangeEditor#highlight., self->troughcxx . . $ _RangeEditor#trough.); |
| 482 | |
| 483 | self->slider1cxx . . $ _RangeEditor#slider1. = gizmo_newcxx . . $ gizmo_new(d700917ee0cea3f8). ("slider", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 484 | gtk_widget_set_parentcxx . . $ gtk_widget_set_parent(4f261c0971c30e7). (self->slider1cxx . . $ _RangeEditor#slider1., self->troughcxx . . $ _RangeEditor#trough.); |
| 485 | gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (self->slider1cxx . . $ _RangeEditor#slider1., "left"); |
| 486 | |
| 487 | self->slider2cxx . . $ _RangeEditor#slider2. = gizmo_newcxx . . $ gizmo_new(d700917ee0cea3f8). ("slider", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 488 | gtk_widget_set_parentcxx . . $ gtk_widget_set_parent(4f261c0971c30e7). (self->slider2cxx . . $ _RangeEditor#slider2., self->troughcxx . . $ _RangeEditor#trough.); |
| 489 | gtk_widget_add_css_classcxx . . $ gtk_widget_add_css_class(3e0616a87a6c51e5). (self->slider2cxx . . $ _RangeEditor#slider2., "right"); |
| 490 | |
| 491 | self->drag_gesturecxx . . $ _RangeEditor#drag_gesture. = gtk_gesture_drag_newcxx . . $ gtk_gesture_drag_new(5d22ad75f7119eec). (); |
| 492 | gtk_gesture_single_set_buttoncxx . . $ gtk_gesture_single_set_button(2f8820310a790616). (GTK_GESTURE_SINGLEcxx . . $ `gtk/gtkgesturesingle.h:32:9`! (self->drag_gesture), 0); |
| 493 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (self->drag_gesture, "drag-begin", |
| 494 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (drag_gesture_begin), self); |
| 495 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (self->drag_gesture, "drag-update", |
| 496 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (drag_gesture_update), self); |
| 497 | g_signal_connectcxx . . $ `<external>/15952772511652638895/gsignal.h:548:9`! (self->drag_gesture, "drag-end", |
| 498 | G_CALLBACKcxx . . $ `<external>/16473872192229286895/gclosure.h:73:9`! (drag_gesture_end), self); |
| 499 | |
| 500 | gtk_widget_add_controllercxx . . $ gtk_widget_add_controller(6d1262f1b7c2f702). (GTK_WIDGETcxx . . $ `gtk/gtkwidget.h:44:9`! (self), GTK_EVENT_CONTROLLERcxx . . $ `gtk/gtkeventcontroller.h:35:9`! (self->drag_gesture)); |
| 501 | } |
| 502 | |
| 503 | static void |
| 504 | range_editor_set_propertycxx . . $ range_editor_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object, |
| 505 | guintcxx . . $ guint# prop_id, |
| 506 | const GValuecxx . . $ GValue# *value, |
| 507 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 508 | { |
| 509 | RangeEditorcxx . . $ RangeEditor# *self = RANGE_EDITORcxx . . $ RANGE_EDITOR(393ac873f5ced9f4). (object); |
| 510 | float v; |
| 511 | |
| 512 | switch (prop_id) |
| 513 | { |
| 514 | case PROP_LOWERcxx . . $ PROP_LOWER.: |
| 515 | v = g_value_get_floatcxx . . $ g_value_get_float(19582a908f876f88). (value); |
| 516 | range_editor_set_limitscxx . . $ range_editor_set_limits(c63f313beadc0972). (self, v, MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (v, self->upper)); |
| 517 | break; |
| 518 | |
| 519 | case PROP_UPPERcxx . . $ PROP_UPPER.: |
| 520 | v = g_value_get_floatcxx . . $ g_value_get_float(19582a908f876f88). (value); |
| 521 | range_editor_set_limitscxx . . $ range_editor_set_limits(c63f313beadc0972). (self, MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (v, self->lower), v); |
| 522 | break; |
| 523 | |
| 524 | case PROP_VALUE1cxx . . $ PROP_VALUE1.: |
| 525 | v = g_value_get_floatcxx . . $ g_value_get_float(19582a908f876f88). (value); |
| 526 | range_editor_set_valuescxx . . $ range_editor_set_values(c63f313beadc0972). (self, v, MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (v, self->value2)); |
| 527 | break; |
| 528 | |
| 529 | case PROP_VALUE2cxx . . $ PROP_VALUE2.: |
| 530 | v = g_value_get_floatcxx . . $ g_value_get_float(19582a908f876f88). (value); |
| 531 | range_editor_set_valuescxx . . $ range_editor_set_values(c63f313beadc0972). (self, MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (v, self->value1), v); |
| 532 | break; |
| 533 | |
| 534 | default: |
| 535 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec); |
| 536 | break; |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | static void |
| 541 | range_editor_get_propertycxx . . $ range_editor_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object, |
| 542 | guintcxx . . $ guint# prop_id, |
| 543 | GValuecxx . . $ GValue# *value, |
| 544 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 545 | { |
| 546 | RangeEditorcxx . . $ RangeEditor# *self = RANGE_EDITORcxx . . $ RANGE_EDITOR(393ac873f5ced9f4). (object); |
| 547 | |
| 548 | switch (prop_id) |
| 549 | { |
| 550 | case PROP_LOWERcxx . . $ PROP_LOWER.: |
| 551 | g_value_set_floatcxx . . $ g_value_set_float(b22d5fe81e4f0ffb). (value, self->lowercxx . . $ _RangeEditor#lower.); |
| 552 | break; |
| 553 | |
| 554 | case PROP_UPPERcxx . . $ PROP_UPPER.: |
| 555 | g_value_set_floatcxx . . $ g_value_set_float(b22d5fe81e4f0ffb). (value, self->uppercxx . . $ _RangeEditor#upper.); |
| 556 | break; |
| 557 | |
| 558 | case PROP_VALUE1cxx . . $ PROP_VALUE1.: |
| 559 | g_value_set_floatcxx . . $ g_value_set_float(b22d5fe81e4f0ffb). (value, self->value1cxx . . $ _RangeEditor#value1.); |
| 560 | break; |
| 561 | |
| 562 | case PROP_VALUE2cxx . . $ PROP_VALUE2.: |
| 563 | g_value_set_floatcxx . . $ g_value_set_float(b22d5fe81e4f0ffb). (value, self->value2cxx . . $ _RangeEditor#value2.); |
| 564 | break; |
| 565 | |
| 566 | default: |
| 567 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec); |
| 568 | break; |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | static void |
| 573 | range_editor_disposecxx . . $ range_editor_dispose(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 574 | { |
| 575 | RangeEditorcxx . . $ RangeEditor# *self = RANGE_EDITORcxx . . $ RANGE_EDITOR(393ac873f5ced9f4). (object); |
| 576 | |
| 577 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->highlight, gtk_widget_unparent); |
| 578 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->slider1, gtk_widget_unparent); |
| 579 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->slider2, gtk_widget_unparent); |
| 580 | g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->trough, gtk_widget_unparent); |
| 581 | |
| 582 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (range_editor_parent_class)->disposecxx . . $ _GObjectClass#dispose. (object); |
| 583 | } |
| 584 | |
| 585 | static void |
| 586 | range_editor_finalizecxx . . $ range_editor_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 587 | { |
| 588 | // RangeEditor *self = RANGE_EDITOR (object); |
| 589 | |
| 590 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (range_editor_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object); |
| 591 | } |
| 592 | |
| 593 | static void |
| 594 | range_editor_class_initcxx . . $ range_editor_class_init(50d49b261c9274ce). (RangeEditorClasscxx . . $ RangeEditorClass# *class) |
| 595 | { |
| 596 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (class); |
| 597 | GtkWidgetClasscxx . . $ GtkWidgetClass# *widget_class = GTK_WIDGET_CLASScxx . . $ `gtk/gtkwidget.h:45:9`! (class); |
| 598 | |
| 599 | object_class->set_propertycxx . . $ _GObjectClass#set_property. = range_editor_set_propertycxx . . $ range_editor_set_property(d7c4bb29f36c0dc4).; |
| 600 | object_class->get_propertycxx . . $ _GObjectClass#get_property. = range_editor_get_propertycxx . . $ range_editor_get_property(cee2c52f22407c66).; |
| 601 | object_class->disposecxx . . $ _GObjectClass#dispose. = range_editor_disposecxx . . $ range_editor_dispose(6087475fa43034d3).; |
| 602 | object_class->finalizecxx . . $ _GObjectClass#finalize. = range_editor_finalizecxx . . $ range_editor_finalize(6087475fa43034d3).; |
| 603 | |
| 604 | widget_class->measurecxx . . $ _GtkWidgetClass#measure. = range_editor_measurecxx . . $ range_editor_measure(d91afbd837fc0c19).; |
| 605 | widget_class->size_allocatecxx . . $ _GtkWidgetClass#size_allocate. = range_editor_size_allocatecxx . . $ range_editor_size_allocate(598a503332136822).; |
| 606 | |
| 607 | propertiescxx . . $ properties.[PROP_LOWERcxx . . $ PROP_LOWER.] = |
| 608 | g_param_spec_floatcxx . . $ g_param_spec_float(62471560c2840e09). ("lower", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 609 | -G_MAXFLOATcxx . . $ `<external>/10505296616216143549/glibconfig.h:32:9`!, G_MAXFLOATcxx . . $ `<external>/10505296616216143549/glibconfig.h:32:9`!, 0, |
| 610 | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_NAMEcxx . . $ G_PARAM_STATIC_NAME. | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 611 | |
| 612 | propertiescxx . . $ properties.[PROP_UPPERcxx . . $ PROP_UPPER.] = |
| 613 | g_param_spec_floatcxx . . $ g_param_spec_float(62471560c2840e09). ("upper", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 614 | -G_MAXFLOATcxx . . $ `<external>/10505296616216143549/glibconfig.h:32:9`!, G_MAXFLOATcxx . . $ `<external>/10505296616216143549/glibconfig.h:32:9`!, 0, |
| 615 | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_NAMEcxx . . $ G_PARAM_STATIC_NAME. | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 616 | |
| 617 | propertiescxx . . $ properties.[PROP_VALUE1cxx . . $ PROP_VALUE1.] = |
| 618 | g_param_spec_floatcxx . . $ g_param_spec_float(62471560c2840e09). ("value1", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 619 | -G_MAXFLOATcxx . . $ `<external>/10505296616216143549/glibconfig.h:32:9`!, G_MAXFLOATcxx . . $ `<external>/10505296616216143549/glibconfig.h:32:9`!, 0, |
| 620 | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_NAMEcxx . . $ G_PARAM_STATIC_NAME. | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 621 | |
| 622 | propertiescxx . . $ properties.[PROP_VALUE2cxx . . $ PROP_VALUE2.] = |
| 623 | g_param_spec_floatcxx . . $ g_param_spec_float(62471560c2840e09). ("value2", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 624 | -G_MAXFLOATcxx . . $ `<external>/10505296616216143549/glibconfig.h:32:9`!, G_MAXFLOATcxx . . $ `<external>/10505296616216143549/glibconfig.h:32:9`!, 0, |
| 625 | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | G_PARAM_STATIC_NAMEcxx . . $ G_PARAM_STATIC_NAME. | G_PARAM_EXPLICIT_NOTIFYcxx . . $ G_PARAM_EXPLICIT_NOTIFY.); |
| 626 | |
| 627 | g_object_class_install_propertiescxx . . $ g_object_class_install_properties(569d03e6a4088541). (object_class, NUM_PROPERTIEScxx . . $ NUM_PROPERTIES., propertiescxx . . $ properties.); |
| 628 | |
| 629 | gtk_widget_class_set_css_namecxx . . $ gtk_widget_class_set_css_name(6333614c746ab65a). (widget_class, "rangeeditor"); |
| 630 | } |
| 631 | |
| 632 | /* }}} */ |
| 633 | /* {{{ Public API */ |
| 634 | |
| 635 | RangeEditorcxx . . $ RangeEditor# * |
| 636 | range_editor_newcxx . . $ range_editor_new(d194e2c0cd372a68). (void) |
| 637 | { |
| 638 | return g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (RANGE_EDITOR_TYPEcxx . . $ `demos/gtk-demo/range-editor.h:27:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 639 | } |
| 640 | |
| 641 | void |
| 642 | range_editor_get_limitscxx . . $ range_editor_get_limits(3cb9d44acddc74f2). (RangeEditorcxx . . $ RangeEditor# *self, |
| 643 | float *lower, |
| 644 | float *upper) |
| 645 | { |
| 646 | if (lower) |
| 647 | *lower = self->lowercxx . . $ _RangeEditor#lower.; |
| 648 | |
| 649 | if (upper) |
| 650 | *upper = self->uppercxx . . $ _RangeEditor#upper.; |
| 651 | } |
| 652 | |
| 653 | void |
| 654 | range_editor_get_valuescxx . . $ range_editor_get_values(3cb9d44acddc74f2). (RangeEditorcxx . . $ RangeEditor# *self, |
| 655 | float *value1, |
| 656 | float *value2) |
| 657 | { |
| 658 | if (value1) |
| 659 | *value1 = self->value1cxx . . $ _RangeEditor#value1.; |
| 660 | |
| 661 | if (value2) |
| 662 | *value2 = self->value2cxx . . $ _RangeEditor#value2.; |
| 663 | } |
| 664 | |
| 665 | void |
| 666 | range_editor_configurecxx . . $ range_editor_configure(6ae024b572af1ef8). (RangeEditorcxx . . $ RangeEditor# *self, |
| 667 | float lower, |
| 668 | float upper, |
| 669 | float value1, |
| 670 | float value2) |
| 671 | { |
| 672 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (lower <= value1); |
| 673 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (value1 <= value2); |
| 674 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (value2 <= upper); |
| 675 | |
| 676 | g_object_freeze_notifycxx . . $ g_object_freeze_notify(6087475fa43034d3). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self)); |
| 677 | |
| 678 | if (self->lowercxx . . $ _RangeEditor#lower. != lower) |
| 679 | { |
| 680 | self->lowercxx . . $ _RangeEditor#lower. = lower; |
| 681 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_LOWERcxx . . $ PROP_LOWER.]); |
| 682 | } |
| 683 | |
| 684 | if (self->uppercxx . . $ _RangeEditor#upper. != upper) |
| 685 | { |
| 686 | self->uppercxx . . $ _RangeEditor#upper. = upper; |
| 687 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_UPPERcxx . . $ PROP_UPPER.]); |
| 688 | } |
| 689 | |
| 690 | if (self->value1cxx . . $ _RangeEditor#value1. != value1) |
| 691 | { |
| 692 | self->value1cxx . . $ _RangeEditor#value1. = value1; |
| 693 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_VALUE1cxx . . $ PROP_VALUE1.]); |
| 694 | } |
| 695 | |
| 696 | if (self->value2cxx . . $ _RangeEditor#value2. != value2) |
| 697 | { |
| 698 | self->value2cxx . . $ _RangeEditor#value2. = value2; |
| 699 | g_object_notify_by_pspeccxx . . $ g_object_notify_by_pspec(89706f8943b9e738). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self), propertiescxx . . $ properties.[PROP_VALUE2cxx . . $ PROP_VALUE2.]); |
| 700 | } |
| 701 | |
| 702 | g_object_thaw_notifycxx . . $ g_object_thaw_notify(6087475fa43034d3). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (self)); |
| 703 | |
| 704 | gtk_widget_queue_resizecxx . . $ gtk_widget_queue_resize(d7cf858254b37903). (self->highlightcxx . . $ _RangeEditor#highlight.); |
| 705 | gtk_widget_queue_resizecxx . . $ gtk_widget_queue_resize(d7cf858254b37903). (self->slider1cxx . . $ _RangeEditor#slider1.); |
| 706 | gtk_widget_queue_resizecxx . . $ gtk_widget_queue_resize(d7cf858254b37903). (self->slider2cxx . . $ _RangeEditor#slider2.); |
| 707 | } |
| 708 | |
| 709 | /* }}} */ |
| 710 | |
| 711 | /* vim:set foldmethod=marker: */ |