fix linux+dub build

This commit is contained in:
Vadim Lopatin 2014-04-24 23:19:27 +04:00
parent e9ecc3b26c
commit cbc647a60b
5 changed files with 1522 additions and 1458 deletions

View File

@ -159,6 +159,7 @@ xcb_image_create_native (xcb_connection_t * c,
if (depth != 1)
return null;
/* fall through */
goto case;
case XCB_IMAGE_FORMAT_XY_PIXMAP:
if (depth > 1) {
fmt = find_format_by_depth(setup, depth);

View File

@ -21,6 +21,35 @@
"targetPath": "lib",
"targetType": "staticLibrary",
"sourceFiles-posix": [
"3rdparty/X11/xcb/bigreq.d",
"3rdparty/X11/xcb/composite.d",
"3rdparty/X11/xcb/damage.d",
"3rdparty/X11/xcb/dpms.d",
"3rdparty/X11/xcb/glx.d",
"3rdparty/X11/xcb/randr.d",
"3rdparty/X11/xcb/record.d",
"3rdparty/X11/xcb/render.d",
"3rdparty/X11/xcb/res.d",
"3rdparty/X11/xcb/screensaver.d",
"3rdparty/X11/xcb/shape.d",
"3rdparty/X11/xcb/shm.d",
"3rdparty/X11/xcb/xcb.d",
"3rdparty/X11/xcb/xc_misc.d",
"3rdparty/X11/xcb/xevie.d",
"3rdparty/X11/xcb/xf86dri.d",
"3rdparty/X11/xcb/xfixes.d",
"3rdparty/X11/xcb/xinerama.d",
"3rdparty/X11/xcb/xprint.d",
"3rdparty/X11/xcb/xproto.d",
"3rdparty/X11/xcb/xtest.d",
"3rdparty/X11/xcb/xv.d",
"3rdparty/X11/xcb/xvmc.d",
"3rdparty/X11/xcb/image.d",
"3rdparty/X11/keysymdef.d",
"3rdparty/X11/X.d",
"3rdparty/X11/Xlib.d"
],
"sourceFiles-windows": [
"3rdparty/win32/basetsd.d",
"3rdparty/win32/basetyps.d",

View File

@ -11,6 +11,36 @@
"sourcePaths": ["../../src"],
"sourceFiles-posix": [
"../../3rdparty/X11/xcb/bigreq.d",
"../../3rdparty/X11/xcb/composite.d",
"../../3rdparty/X11/xcb/damage.d",
"../../3rdparty/X11/xcb/dpms.d",
"../../3rdparty/X11/xcb/glx.d",
"../../3rdparty/X11/xcb/randr.d",
"../../3rdparty/X11/xcb/record.d",
"../../3rdparty/X11/xcb/render.d",
"../../3rdparty/X11/xcb/res.d",
"../../3rdparty/X11/xcb/screensaver.d",
"../../3rdparty/X11/xcb/shape.d",
"../../3rdparty/X11/xcb/shm.d",
"../../3rdparty/X11/xcb/xcb.d",
"../../3rdparty/X11/xcb/xc_misc.d",
"../../3rdparty/X11/xcb/xevie.d",
"../../3rdparty/X11/xcb/xf86dri.d",
"../../3rdparty/X11/xcb/xfixes.d",
"../../3rdparty/X11/xcb/xinerama.d",
"../../3rdparty/X11/xcb/xprint.d",
"../../3rdparty/X11/xcb/xproto.d",
"../../3rdparty/X11/xcb/xtest.d",
"../../3rdparty/X11/xcb/xv.d",
"../../3rdparty/X11/xcb/xvmc.d",
"../../3rdparty/X11/xcb/image.d",
"../../3rdparty/X11/keysymdef.d",
"../../3rdparty/X11/X.d",
"../../3rdparty/X11/Xlib.d"
],
"sourceFiles-windows": [
"../../3rdparty/win32/basetsd.d",
"../../3rdparty/win32/basetyps.d",
@ -81,6 +111,8 @@
"libs-windows": ["dlanguilib", "phobos", "ole32", "kernel32", "user32", "comctl32", "comdlg32"],
"libs-posix": ["xcb", "xcb-util", "xcb-shm", "xcb-image", "xcb-keysyms", "X11-xcb", "X11"],
"versions-windows": ["USE_OPENGL", "Unicode"],

View File

@ -70,14 +70,16 @@ version(linux) {
xcb_gcontext_t _g;
xcb_image_t * _image;
xcb_shm_segment_info_t shminfo;
version(USE_OPENGL) {
/* Create GLX Window */
GLXDrawable _drawable;
GLXWindow _glxwindow;
private GLXDrawable _drawable;
private GLXWindow _glxwindow;
private GLXContext _context;
private GLXFBConfig _fb_config;
}
private int _visualID = 0;
private xcb_colormap_t _colormap;
private GLXFBConfig _fb_config;
@property xcb_window_t windowId() { return _w; }
this(string caption, Window parent) {
@ -112,7 +114,7 @@ version(linux) {
_w = xcb_generate_id(_xcbconnection);
Log.d("window=", _w, " gc=", _g);
version (USE_OPENGL) {
if (_enableOpengl) {
int visual_attribs[] = [
GLX_RENDER_TYPE, GLX_RGBA_BIT,
@ -152,6 +154,7 @@ version(linux) {
);
depth = cast(ubyte)vi.depth;
}
}
//mask = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
//values[0] = _xcbscreen.white_pixel;
@ -181,7 +184,7 @@ version(linux) {
//XCB_COPY_FROM_PARENT,//_xcbscreen.root_depth,
_w,
_xcbscreen.root,
50, 50, 500, 400,
30, 30, 800, 650,
1,
XCB_WINDOW_CLASS_INPUT_OUTPUT,
visualId,
@ -288,6 +291,7 @@ version(linux) {
xcb_map_window(_xcbconnection, _w);
xcb_flush(_xcbconnection);
//_enableOpengl = false; // test
version (USE_OPENGL) {
if (_enableOpengl && !_glxwindow) {
Log.d("Calling glXCreateWindow display=", _display, " fbconfig=", _fb_config, " window=", _w);
_glxwindow = glXCreateWindow(
@ -390,10 +394,14 @@ version(linux) {
}
}
}
string _caption;
}
protected string _caption;
override @property string windowCaption() {
return _caption;
}
override @property void windowCaption(string caption) {
_caption = caption;
const char * title = _caption.toStringz;
@ -410,6 +418,7 @@ version(linux) {
void redraw() {
if (_enableOpengl) {
version(USE_OPENGL) {
import std.c.linux.X11.Xlib;
Log.d("Drawing using opengl ", _dx, "x", _dy, " context=", _context);
//glXMakeContextCurrent(_display, _drawable, _drawable, _context);
@ -437,6 +446,7 @@ version(linux) {
xcb_flush(_xcbconnection);
glXMakeContextCurrent (_display, None, None, null);
glXWaitGL();
}
} else {
if (!_drawbuf)
_drawbuf = new ColorDrawBuf(_dx, _dy);
@ -573,9 +583,6 @@ version(linux) {
case XK_Linefeed:
case XK_Return:
return KeyCode.RETURN;
return KeyCode.SHIFT;
return KeyCode.CONTROL;
return KeyCode.ALT;
case XK_Shift_L:
return KeyCode.LSHIFT;
case XK_Shift_R:

View File

@ -1529,7 +1529,6 @@ class EditWidgetBase : WidgetGroup, EditableContentListener {
return "\t"d ~ src;
}
}
return src;
}
/// indent / unindent range
@ -2049,9 +2048,8 @@ class EditBox : EditWidgetBase, OnScrollHandler {
ensureCaretVisible();
_caretPos.line = _firstVisibleLine;
updateSelectionAfterCursorMovement(oldCaretPos, (a.id & 1) != 0);
return true;
}
break;
return true;
case EditorActions.PageEnd:
case EditorActions.SelectPageEnd:
{
@ -2062,9 +2060,8 @@ class EditBox : EditWidgetBase, OnScrollHandler {
newpos = _content.length - 1;
_caretPos.line = newpos;
updateSelectionAfterCursorMovement(oldCaretPos, (a.id & 1) != 0);
return true;
}
break;
return true;
case EditorActions.PageUp:
case EditorActions.SelectPageUp:
{
@ -2082,9 +2079,8 @@ class EditBox : EditWidgetBase, OnScrollHandler {
measureVisibleText();
updateScrollbars();
updateSelectionAfterCursorMovement(oldCaretPos, (a.id & 1) != 0);
return true;
}
break;
return true;
case EditorActions.PageDown:
case EditorActions.SelectPageDown:
{
@ -2101,9 +2097,8 @@ class EditBox : EditWidgetBase, OnScrollHandler {
measureVisibleText();
updateScrollbars();
updateSelectionAfterCursorMovement(oldCaretPos, (a.id & 1) != 0);
return true;
}
break;
return true;
case EditorActions.ScrollLeft:
{
if (_scrollPos.x > 0) {