MinWin API Reference

minwin

app
button
canvas
combo
component
dialog
event
font
geometry
group
icon
image
label
layout
listbox
menu
multidg
paint
peer
peerimpl
scroll
text
window

minwin.geometry

Defines Point, Rect, Region and Color and associated functions. These are structs with a single field called "native" that stores the native type or, in the case of color on Unix system, an int with the RGB triple. A Region is a class wrapping a system region resource.

alias RectNative;
Platform-specific rectangle type

Windows RECT
GTK GdkRectangle

alias PointNative;
Platform-specific point type

Windows POINT
GTK GdkPoint

alias ColorNative;
Platform-specific color type for RGB tuples.

On X-based systems a uint is used to pack the red, green and blue components.

Windows COLORREF
GTK uint

alias RegionPeer;
Alias for native region type.

Windows HRGN
GTK GdkRegion*

struct Rect;
Struct wrapping the native integer rectangle type.

RectNative_ native;
The native rectangle.

void LTWH(int left, int top, int width, int height);
Set the rectangle's data to left,top,width,height.

void LTRB(int left, int top, int right, int bottom);
Set the rectangle's data to left,top,right,bottom.

int left;
Read/write property for left value of rectangle Setting left might preserve either right or width depending on the platform.

int top;
Read/write property for top value of rectangle. Setting top might preserve either bottom or height depending on the platform.

int right;
Read/write property for right value of rectangle.

int bottom;
Read/write property for bottom value of rectangle.

int width;
Read/write property for width of rectangle.

int height;
Read/write property for height of rectangle.

bool contains(Point pt);
Test if a point is inside the rectangle.

char[] toString();
Returns a string representing the rectangle.

Rect LTWH(int left, int top, int width, int height);
Construct a rectangle with data left,top,width,height.

Rect LTRB(int left, int top, int right, int bottom);
Construct a rectangle with data left,top,right,bottom.

Rect toRect(RectNative_ c);
Construct a rect from a native rect.

void intersectRect(inout Rect res, inout Rect r1, inout Rect r2);
Make res the intersection of r1 and r2.

void unionRect(inout Rect res, inout Rect r1, inout Rect r2);
Make res the union of r1 and r2.

void offsetRect(inout Rect res, int x, int y);
Translate res by x and y.

struct Point;
Struct wrapping the native integer point type.

PointNative_ native;
The native point.

void XY(int x, int y);
Set the point's data to x,y.

int x;
Read/write property for the x coordinate.

int y;
Read/write property for the y coordinate.

Point opAdd(Point b);
Performs a vector addition of two points.

Point opSub(Point b);
Performs a vector subtraction of two points.

char[] toString();
Returns a string representing the point.

Point XY(int x, int y);
Construct a point with data x,y.

Point toPoint(PointNative_ c);
Construct a point from a native point.

struct Color;
Struct wrapping the native color type.

ColorNative_ native;
The native color.

void RGB(ubyte r, ubyte g, ubyte b);
Set a color's data to r,g,b.

int red;
Read/write property for the red component.

int blue;
Read/write property for the blue component.

int green;
Read/write property for the green component.

char[] toString();
Returns a string representing the color.

Color RGB(ubyte r, ubyte g, ubyte b);
Construct a color with data r,g,b.

Color toColor(ColorNative_ c);
Construct a color from a native color.

Color systemBackgroundColor();
Returns the default background color.

enum FillRule;
Enumeration of allowed fill rules

EvenOdd


Winding


class Region;
A region is an area made of combining graphics primitives like rectangles.

this(inout Rect r);
Construct a region from rectangle r.

this(Point [] pts, FillRule rule = cast(FillRule)1);
Construct a region from the filled polygon pts.

this(RegionPeer_ rgn);
Construct a region object for the given native region.

int opEquals(Object o);
Test equality of two regions.

Region unionRgn(Region r);
Add the region r to this region and return this.

Region unionRect(inout Rect r);
Add the rectangle r to this region and return this.

Region intersectRgn(Region r);
Intersect the region r with this region and return this.

bool contains(Point p);
Test if a point is in the region.

Region dup();
Duplicate the native region.