org.gnome.gtk.BaselinePosition Maven / Gradle / Ivy
// This file was automatically generated by Java-GI. Do not edit this file
// directly! Visit for more information.
//
// The API documentation in this file was derived from GObject-Introspection
// metadata and may include text or comments from the original C sources.
//
// Copyright (c), upstream authors as identified in the GObject-Introspection
// metadata.
//
// This generated file is distributed under the same license as the original
// GObject-Introspection data, unless otherwise specified. Users of this file
// are responsible for complying with any licenses or terms required by the
// original authors.
//
// THIS FILE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
//
package org.gnome.gtk;
import io.github.jwharm.javagi.base.Enumeration;
import io.github.jwharm.javagi.interop.Interop;
import java.lang.IllegalStateException;
import java.lang.Override;
import javax.annotation.processing.Generated;
import org.gnome.glib.Type;
/**
* Baseline position in a row of widgets.
*
* Whenever a container has some form of natural row it may align
* children in that row along a common typographical baseline. If
* the amount of vertical space in the row is taller than the total
* requested height of the baseline-aligned children then it can use a
* {@code GtkBaselinePosition} to select where to put the baseline inside the
* extra available space.
*/
@Generated("io.github.jwharm.JavaGI")
public enum BaselinePosition implements Enumeration {
/**
* Align the baseline at the top
*/
TOP(0),
/**
* Center the baseline
*/
CENTER(1),
/**
* Align the baseline at the bottom
*/
BOTTOM(2);
static {
Gtk.javagi$ensureInitialized();
}
private final int value;
/**
* Create a new BaselinePosition for the provided value
*
* @param value the enum value
*/
private BaselinePosition(int value) {
this.value = value;
}
/**
* Create a new BaselinePosition for the provided value
*
* @param value the enum value
* @return the enum for the provided value
*/
public static BaselinePosition of(int value) {
return switch(value) {
case 0 -> TOP;
case 1 -> CENTER;
case 2 -> BOTTOM;
default -> throw new IllegalStateException("Unexpected value: " + value);
} ;
}
/**
* Get the numeric value of this enum
*
* @return the enum value
*/
@Override
public int getValue() {
return value;
}
/**
* Get the GType of the BaselinePosition class
*
* @return the GType
*/
public static Type getType() {
return Interop.getType("gtk_baseline_position_get_type");
}
}