dlangui.core.types

DLANGUI library.

This module declares basic data types for usage in dlangui library.

Synopsis:

import dlangui.core.types;

// points 
Point p(5, 10);

// rectangles
Rect r(5, 13, 120, 200);
writeln(r);

// reference counted objects, useful for RAII / resource management.
class Foo : RefCountedObject {
	int[] resource;
	~this() {
		writeln("freeing Foo resources");
	}
}
{
	Ref!Foo ref1;
	{
		Ref!Foo fooRef = new RefCountedObject();
		ref1 = fooRef;
	}
	// RAII: will destroy object when no more references
}

Members

Classes

RefCountedObject
class RefCountedObject

base class for reference counted objects, maintains reference counter inplace.

Enums

State
enum State

widget state flags - bits

Functions

appendPath
string appendPath(string[] pathItems)

appends file path parts with proper delimiters e.g. appendPath("/home/user", ".myapp", "config") => "/home/user/.myapp/config"

appendPath
char[] appendPath(char[] buf, string[] pathItems)

appends file path parts with proper delimiters (as well converts delimiters inside path to system) to buffer e.g. appendPath("/home/user", ".myapp", "config") => "/home/user/.myapp/config"

convertPathDelimiters
char[] convertPathDelimiters(char[] buf)

converts path delimiters to standard for platform inplace in buffer(e.g. / to \ on windows, \ to / on posix), returns buf

convertPathDelimiters
string convertPathDelimiters(string src)

converts path delimiters to standard for platform (e.g. / to \ on windows, \ to / on posix)

fromStringz
string fromStringz(const(char[]) s)
Undocumented in source. Be warned that the author may not have intended to support it.
fromStringz
string fromStringz(const(char*) s)
Undocumented in source. Be warned that the author may not have intended to support it.
fromWStringz
wstring fromWStringz(const(wchar[]) s)
Undocumented in source. Be warned that the author may not have intended to support it.
isPathDelimiter
bool isPathDelimiter(char ch)

returns true if char ch is / or \ slash

Properties

exePath
string exePath [@property getter]

returns current executable path only, including last path delimiter

Structs

Glyph
struct Glyph

character glyph

Point
struct Point
Undocumented in source.
Rect
struct Rect
Undocumented in source.
Ref
struct Ref(T)
Undocumented in source.

Variables

PATH_DELIMITER
char PATH_DELIMITER;
Undocumented in source.
PATH_DELIMITER
char PATH_DELIMITER;
Undocumented in source.

Meta