mirror of https://github.com/buggins/dlangui.git
external platforms support, some comments added, console compilation fix
This commit is contained in:
parent
e4b54778d9
commit
c250ebdd6f
5
dub.json
5
dub.json
|
@ -69,6 +69,11 @@
|
|||
"versions": ["USE_CONSOLE", "EmbedStandardResources"],
|
||||
"excludedSourceFiles": ["3rdparty/*"]
|
||||
},
|
||||
{
|
||||
"name": "external",
|
||||
"versions": ["USE_EXTERNAL"],
|
||||
"excludedSourceFiles": ["3rdparty/*"]
|
||||
},
|
||||
{
|
||||
"name": "minimal",
|
||||
"versions": ["EmbedStandardResources", "ForceLogs"],
|
||||
|
|
|
@ -15,7 +15,10 @@ version(USE_CONSOLE) {
|
|||
enum BACKEND_WIN32 = false;
|
||||
enum BACKEND_ANDROID = false;
|
||||
} else {
|
||||
enum BACKEND_GUI = true;
|
||||
version(USE_EXTERNAL) {}
|
||||
else
|
||||
enum BACKEND_GUI = true;
|
||||
|
||||
version (NO_FREETYPE) {
|
||||
enum ENABLE_FREETYPE = false;
|
||||
} else version (USE_FREETYPE) {
|
||||
|
@ -93,6 +96,19 @@ version(USE_CONSOLE) {
|
|||
enum BACKEND_WIN32 = false;
|
||||
enum BACKEND_ANDROID = false;
|
||||
enum BACKEND_CONSOLE = false;
|
||||
} else version (USE_EXTERNAL) {
|
||||
// External backend already selected using version identifier
|
||||
version (USE_OPENGL) {
|
||||
enum ENABLE_OPENGL = true;
|
||||
} else {
|
||||
enum ENABLE_OPENGL = false;
|
||||
}
|
||||
enum BACKEND_GUI = false;
|
||||
enum BACKEND_CONSOLE = false;
|
||||
enum BACKEND_SDL = false;
|
||||
enum BACKEND_X11 = false;
|
||||
enum BACKEND_DSFML = false;
|
||||
enum BACKEND_WIN32 = false;
|
||||
} else {
|
||||
// no backend selected: set default based on platform
|
||||
version (Windows) {
|
||||
|
|
|
@ -364,11 +364,16 @@ class FileDialog : Dialog, CustomGridCellAdapter {
|
|||
return sz;
|
||||
}
|
||||
if (BACKEND_CONSOLE)
|
||||
{
|
||||
return Point(0, 0);
|
||||
DrawableRef icon = rowIcon(row);
|
||||
if (icon.isNull)
|
||||
return Point(0, 0);
|
||||
return Point(icon.width + 2.pointsToPixels, icon.height + 2.pointsToPixels);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawableRef icon = rowIcon(row);
|
||||
if (icon.isNull)
|
||||
return Point(0, 0);
|
||||
return Point(icon.width + 2.pointsToPixels, icon.height + 2.pointsToPixels);
|
||||
}
|
||||
}
|
||||
|
||||
/// draw data cell content
|
||||
|
|
|
@ -196,7 +196,7 @@ class Font : RefCountedObject {
|
|||
*
|
||||
* Params:
|
||||
* text = text string to measure
|
||||
* widths = output buffer to put measured widths (widths[i] will be set to cumulative widths text[0..i])
|
||||
* widths = output buffer to put measured widths (widths[i] will be set to cumulative widths text[0..i], see also _textSizeBuffer description)
|
||||
* maxWidth = maximum width to measure - measure is stopping if max width is reached (pass MAX_WIDTH_UNSPECIFIED to measure all characters)
|
||||
* tabSize = tabulation size, in number of spaces
|
||||
* tabOffset = when string is drawn not from left position, use to move tab stops left/right
|
||||
|
@ -257,7 +257,15 @@ class Font : RefCountedObject {
|
|||
return charsMeasured;
|
||||
}
|
||||
|
||||
protected int[] _textSizeBuffer; // buffer to reuse while measuring strings - to avoid GC
|
||||
/*************************************************************************
|
||||
* Buffer to reuse while measuring strings to avoid GC
|
||||
*
|
||||
* This array store character widths cumulatively.
|
||||
* For example, after measure of monospaced 10-pixel-width font line
|
||||
* "abc def" _textSizeBuffer should contain something like:
|
||||
* [10, 20, 30, 40, 50, 60, 70]
|
||||
************************************************************************/
|
||||
protected int[] _textSizeBuffer;
|
||||
|
||||
/*************************************************************************
|
||||
* Measure text string as single line, returns width and height
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
module dlangui.platforms.external;
|
||||
|
||||
|
||||
version(USE_EXTERNAL):
|
Loading…
Reference in New Issue