All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gnome.gobject.ParamSpecDouble Maven / Gradle / Ivy

The newest version!
// 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.gobject;

import io.github.jwharm.javagi.gobject.types.Types;
import io.github.jwharm.javagi.interop.Interop;
import io.github.jwharm.javagi.interop.MemoryCleaner;
import java.lang.foreign.MemoryLayout;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.ValueLayout;
import javax.annotation.processing.Generated;
import org.gnome.glib.Type;

/**
 * A {@code GParamSpec} derived structure that contains the meta data for double properties.
 */
@Generated("io.github.jwharm.JavaGI")
public class ParamSpecDouble extends ParamSpec {
    static {
        GObjects.javagi$ensureInitialized();
    }

    /**
     * Create a ParamSpecDouble proxy instance for the provided memory address.
     *
     * @param address the memory address of the native object
     */
    public ParamSpecDouble(MemorySegment address) {
        super(Interop.reinterpret(address, getMemoryLayout().byteSize()));
        MemoryCleaner.setFreeFunc(this, "g_param_spec_unref");
    }

    /**
     * Get the GType of the GParamSpecDouble class
     *
     * @return always {@link Types#PARAM}
     */
    public static Type getType() {
        return Types.PARAM;
    }

    /**
     * The memory layout of the native struct.
     * @return the memory layout
     */
    public static MemoryLayout getMemoryLayout() {
        return MemoryLayout.structLayout(
            ParamSpec.getMemoryLayout().withName("parent_instance"),
            ValueLayout.JAVA_DOUBLE.withName("minimum"),
            ValueLayout.JAVA_DOUBLE.withName("maximum"),
            ValueLayout.JAVA_DOUBLE.withName("default_value"),
            ValueLayout.JAVA_DOUBLE.withName("epsilon")
        ).withName("GParamSpecDouble");
    }

    /**
     * Returns this instance as if it were its parent type. This is mostly
     * synonymous to the Java {@code super} keyword, but will set the native
     * typeclass function pointers to the parent type. When overriding a native
     * virtual method in Java, "chaining up" with {@code super.methodName()}
     * doesn't work, because it invokes the overridden function pointer again.
     * To chain up, call {@code asParent().methodName()}. This will call the
     * native function pointer of this virtual method in the typeclass of the
     * parent type.
     */
    protected ParamSpecDouble asParent() {
        ParamSpecDouble _parent = new ParamSpecDouble(handle());
        _parent.callParent(true);
        return _parent;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy