staticvoid
demo_layout_measure (GtkLayoutManager *layout_manager,
GtkWidget *widget,
GtkOrientation orientation, int for_size, int *minimum, int *natural, int *minimum_baseline, int *natural_baseline)
{
GtkWidget *child; int minimum_size = 0; int natural_size = 0;
for (child = gtk_widget_get_first_child (widget);
child != NULL;
child = gtk_widget_get_next_sibling (child))
{ int child_min = 0, child_nat = 0;
if (!gtk_widget_should_layout (child)) continue;
gtk_widget_measure (child, orientation, -1,
&child_min, &child_nat,
NULL, NULL);
minimum_size = MAX (minimum_size, child_min);
natural_size = MAX (natural_size, child_nat);
}
/* The grid position of child. */
gx = x0 + (i % 4 - 2) * child_width;
gy = y0 + (i / 4 - 2) * child_height;
/* The circle position of child. Note that we *areadjustingthepositionbyhalfthechildsize *toplacethecenterofchildonacenteredcircle. *Thisassumesthatthechildrendon'tusealignflags *orunevenmarginsthatwouldshiftthecenter.
*/
cx = x0 + sin (a) * r - child_req.width / 2;
cy = y0 + cos (a) * r - child_req.height / 2;
/* we interpolate between the two layouts according to *thepositionvaluethathasbeensetonthelayout.
*/
x = t * cx + (1 - t) * gx;
y = t * cy + (1 - t) * gy;
/* Shuffle the circle positions of the children. *Shouldbecalledwhenweareinthegridlayout.
*/ void
demo_layout_shuffle (DemoLayout *layout)
{ int i, j, tmp;
for (i = 0; i < 16; i++)
{
j = g_random_int_range (0, i + 1);
tmp = layout->pos[i];
layout->pos[i] = layout->pos[j];
layout->pos[j] = tmp;
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-07-02)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.