fltk.types

FLTK High-Level API Common Types

This module provides common types and aliases for the high-level FLTK API. It re-exports and renames types from the low-level bindings to provide a cleaner, more D-idiomatic interface without the Fl prefix.

Authors

Dejan Lekić

License

BSD-3-Clause

Module Initializers 1

shared static this()

Types 5

structRect

Represents a rectangular region with position and size.

This is a convenience type for working with widget geometry.

Fields
int xX coordinate (left edge)
int yY coordinate (top edge)
int widthWidth in pixels
int heightHeight in pixels
Methods
int right() const @safe nothrow @nogcReturns the right edge coordinate.
int bottom() const @safe nothrow @nogcReturns the bottom edge coordinate.
bool contains(int px, int py) const @safe nothrow @nogcChecks if a point is inside the rectangle.
bool intersects(Rect other) const @safe nothrow @nogcChecks if this rectangle intersects with another.
Constructors
this(int x, int y, int width, int height)Creates a rectangle from position and size.
structSize

Represents a size with width and height.

Fields
int widthWidth in pixels
int heightHeight in pixels
Methods
int area() const @safe nothrow @nogcCalculates the area.
Constructors
this(int width, int height)Creates a size.
structPoint

Represents a 2D point.

Fields
int xX coordinate
int yY coordinate
Methods
double distanceTo(Point other) const @safe nothrow @nogcCalculates distance to another point.
Constructors
this(int x, int y)Creates a point.
aliasCallback = void delegate()

Callback delegate type for widget events.

This is the standard callback signature for widget interactions.

aliasCallbackWithData = void delegate(void * data)

Callback delegate type for widget events with user data.

Parameters

dataUser-provided data pointer

Functions 2

private fnint fltk_check() nothrow @nogc
fnbool isHeadless() nothrowChecks if running in a headless environment.

Variables 3

private varbool _headlessCached = false
private varbool _headlessValue = false
private varbool _fltkInitialized = false