# HG changeset patch # User David Bryant # Date 1343887363 -34200 # Node ID bc5baa585b325f6d27c3efdb977153d0eb97f914 # Parent 1bc3475624d37dc88d4d306f47dd9514d557e850 Updated to dmd 2.060 diff -r 1bc3475624d3 -r bc5baa585b32 builder.d --- a/builder.d Thu Jan 12 18:20:58 2012 +1030 +++ b/builder.d Thu Aug 02 15:32:43 2012 +0930 @@ -125,8 +125,8 @@ if (!exists(path)) { return 0; } - getTimesPosix(path, fileStatusChangeTime, fileAccessTime, fileModificationTime); - return fileStatusChangeTime.stdTime; + getTimes(path, fileAccessTime, fileModificationTime); + return fileModificationTime.stdTime; } @@ -191,7 +191,7 @@ void parseForImport(char[] line) { static string[] leaders = ["private ", "public ", "static ", "import "]; bool found; - auto stripped = stripl(line); + auto stripped = stripLeft(line); if (stripped.length > 8) { foreach (i, leader ; leaders) { if (stripped[0..leader.length] == leader) { @@ -328,7 +328,7 @@ mTime = mPath.exists ? 1 : 0; // this directory depends on its parent directory chain - string parent_path = path.dirname; + string parent_path = path.dirName; if (parent_path.length > 0 && parent_path[0] != '.' && parent_path != "/") { Item* parent = parent_path in mItems; if (parent) { @@ -387,7 +387,7 @@ } // and all other group's higher-level groups until common ancestor - string other_parent_path = other.mPath.dirname; + string other_parent_path = other.mPath.dirName; if (other_parent_path != "." && other_parent_path.length < mPath.length && mPath[0..other_parent_path.length] != other_parent_path) @@ -420,7 +420,7 @@ group.addMember(this); // this file depends on on its parent directory - string parent_path = path.dirname; + string parent_path = path.dirName; Item* parent = parent_path in mItems; if (parent) { assert(cast(DirectoryItem *)parent); @@ -443,7 +443,7 @@ this(string path, GroupItem group) { super("source", path, group); - if (!isfile(path)) error(format("source file %s not found", path)); + if (!isFile(path)) error(format("source file %s not found", path)); } // set the object item @@ -515,13 +515,14 @@ writefln("Object %s", mPath); scope cmd = new StringFormatter; - cmd.format("dmd -m32 -c"); + cmd.format("dmd -m64 -c"); foreach (path; Global.bundlePaths) { cmd.format(" -I%s", path); } - cmd.format(" -od%s %s", dirname(mPath), mSource.mPath); + cmd.format(" -od%s %s", dirName(mPath), mSource.mPath); cmd.format(" @%s", Global.optionsPath); + //writefln("cmd: %s", cmd.str); if (std.process.system(cmd.str)) { writefln("%s", cmd.str); error(format("build of %s failed", mPath)); @@ -552,6 +553,7 @@ cmd.format(" %s", obj.mPath); } } + //writefln("cmd: %s", cmd.str); if (std.process.system(cmd.str)) { writefln("%s", cmd.str); error("command failed"); @@ -601,7 +603,7 @@ writefln("Program %s", mPath); scope cmd = new StringFormatter(); - cmd.format("dmd -m32 -L-L%s", std.path.join(Global.buildPath, "lib")); + cmd.format("dmd -m64 -L-L%s", buildPath(Global.buildPath, "lib")); cmd.format(" -of%s %s", mPath, mObject.mPath); // add the libraries we need @@ -617,6 +619,7 @@ } cmd.format(" @%s", Global.optionsPath); + //writefln("cmd: %s", cmd.str); if (std.process.system(cmd.str)) { writefln("%s", cmd.str); error("command failed"); @@ -646,6 +649,7 @@ scope tmpPath = mPath ~ ".failed"; cmd.format("%s > %s 2>&1", mProgram.mPath, tmpPath); + //writefln("cmd: %s", cmd.str); if (std.process.system(cmd.str)) { // failed writefln(" failed"); @@ -694,7 +698,7 @@ mParent = parent; if (parent.mName.length) { // child of non-root - mSlashName = parent.mSlashName ~ sep ~ mName; + mSlashName = parent.mSlashName ~ "/" ~ mName; mDotName = parent.mDotName ~ "." ~ mName; } else { @@ -745,7 +749,7 @@ this(string name, string path, Node parent, GroupItem group) { super(name, parent); - string obj_path = std.path.join(Global.buildPath, "obj", mSlashName ~ ".o"); + string obj_path = buildPath(Global.buildPath, "obj", mSlashName ~ ".o"); mSource = new SourceItem(path, group); mObject = new ObjectItem(obj_path, mSource, group); mSource.set_object(mObject); @@ -812,11 +816,11 @@ this(string name, string path, Node parent, bool test, GroupItem group) { super(name, path, parent, group); if (test) { - mProgram = new ProgramItem(std.path.join(Global.buildPath, "test", mSlashName), mObject, group); - mResult = new ResultItem(std.path.join(Global.buildPath, "test", mSlashName ~ ".result"), mProgram, group); + mProgram = new ProgramItem(buildPath(Global.buildPath, "test", mSlashName), mObject, group); + mResult = new ResultItem(buildPath(Global.buildPath, "test", mSlashName ~ ".result"), mProgram, group); } else { - mProgram = new ProgramItem(std.path.join(Global.buildPath, "bin", mName), mObject, group); + mProgram = new ProgramItem(buildPath(Global.buildPath, "bin", mName), mObject, group); } setClump(mProgram); //writefln("loaded Program %s", mProgram.mPath); @@ -839,24 +843,25 @@ string lib_name = replace(mDotName, ".", "_"); // examine all the children of the package's directory - foreach (string child; listdir(path)) { - string p = std.path.join(path, child); + foreach (string child; dirEntries(path, SpanMode.shallow)) { + child = baseName(child); + string p = buildPath(path, child); if (child[0] != '.') { - if (isfile(p)) { + if (isFile(p)) { if (child.length > 2 && child[$-2..$] == ".d") { // a library module if (!mLibrary) { - mLibrary = new LibraryItem(std.path.join(Global.buildPath, "lib", "lib" ~ lib_name ~ ".a"), + mLibrary = new LibraryItem(buildPath(Global.buildPath, "lib", "lib" ~ lib_name ~ ".a"), lib_name, mGroup); } - Module m = new Module(getName(child), p, this, mGroup); + Module m = new Module(stripExtension(child), p, this, mGroup); m.setClump(mLibrary); } } - else if (isdir(p)) { + else if (isDir(p)) { if (child == "build-tool") { // reserved for build-tool @@ -869,27 +874,29 @@ } else if (child == "test") { // test programs - foreach (string grandchild; listdir(p)) { - string p2 = std.path.join(p, grandchild); + foreach (string grandchild; dirEntries(p, SpanMode.shallow)) { + grandchild = baseName(grandchild); + string p2 = buildPath(p, grandchild); if (grandchild[0] != '.' && - isfile(p2) && + isFile(p2) && grandchild.length > 2 && grandchild[$-2..$] == ".d") { - Exe exe = new Exe(getName(grandchild), p2, this, true, mGroup); + Exe exe = new Exe(stripExtension(grandchild), p2, this, true, mGroup); } } } else if (child == "prog") { // deliverable programs - foreach (string grandchild; listdir(p)) { - string p2 = std.path.join(p, grandchild); + foreach (string grandchild; dirEntries(p, SpanMode.shallow)) { + grandchild = baseName(grandchild); + string p2 = buildPath(p, grandchild); if (child[0] != '.' && - isfile(p2) && + isFile(p2) && grandchild.length > 2 && grandchild[$-2..$] == ".d") { - Exe exe = new Exe(getName(grandchild), p2, this, false, mGroup); + Exe exe = new Exe(stripExtension(grandchild), p2, this, false, mGroup); } } } @@ -950,27 +957,28 @@ // add path to Global for use when compiling Global.bundlePaths ~= path; - Global.optionsPath = std.path.join(path, "options"); + Global.optionsPath = buildPath(path, "options"); // // load bundles specified in the uses file - lines are bundle paths relative to path // - string uses_path = std.path.join(path, "uses"); - if (exists(uses_path) && isfile(uses_path)) { + string uses_path = buildPath(path, "uses"); + if (exists(uses_path) && isFile(uses_path)) { //writefln("reading uses file: %s", uses_path); scope file = new BufferedFile(uses_path); foreach (char[] line; file) { - load(std.path.join(path, line.idup)); + load(buildPath(path, line.idup)); } } // // load local products // - foreach (string name; listdir(path)) { + foreach (string name; dirEntries(path, SpanMode.shallow)) { + name = baseName(name); if (name[0] != '.' && name != "nobuild") { - string p = std.path.join(path, name); - if (isdir(p)) { + string p = buildPath(path, name); + if (isDir(p)) { foreach (node; mChildren) { Product existing = cast(Product)node; if (existing && existing.mName == name) { diff -r 1bc3475624d3 -r bc5baa585b32 configure.d --- a/configure.d Thu Jan 12 18:20:58 2012 +1030 +++ b/configure.d Thu Aug 02 15:32:43 2012 +0930 @@ -46,7 +46,7 @@ // check that source_path looks like a source tree by making sure // that a README and options file are present writefln("Examining source"); - if (!std.path.join(sourcePath, "README").exists || !std.path.join(sourcePath, "options").exists) { + if (!buildPath(sourcePath, "README").exists || !buildPath(sourcePath, "options").exists) { writefln("Error - current directory must contain README and options"); return -1; } @@ -58,26 +58,26 @@ return -1; } targetPath.mkdirRecurse; - string binPath = std.path.join(targetPath, "bin"); + string binPath = buildPath(targetPath, "bin"); binPath.mkdir; // compile builder into bin_path writefln("Building the builder"); - int ret = system(format("dmd -m32 -w -wi %s -O -of%s", - std.path.join(sourcePath, "builder.d"), std.path.join(binPath, "builder"))); + int ret = system(format("dmd -m64 -w -wi %s -O -of%s", + buildPath(sourcePath, "builder.d"), buildPath(binPath, "builder"))); if (ret) { writefln("Error - builder failed to compile"); return -1; } - std.path.join(binPath, "builder.o").remove; + buildPath(binPath, "builder.o").remove; // set up scripts { - auto file = File(std.path.join(targetPath, "build"), "w"); + auto file = File(buildPath(targetPath, "build"), "w"); file.writefln("#!/bin/bash"); - file.writefln("%s %s %s", std.path.join(binPath, "builder"), sourcePath, targetPath); + file.writefln("%s %s %s", buildPath(binPath, "builder"), sourcePath, targetPath); } - system("chmod +x " ~ std.path.join(targetPath, "build")); + system("chmod +x " ~ buildPath(targetPath, "build")); writefln("All done"); return 0; diff -r 1bc3475624d3 -r bc5baa585b32 doodle/core/backtrace.d --- a/doodle/core/backtrace.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/core/backtrace.d Thu Aug 02 15:32:43 2012 +0930 @@ -1,5 +1,7 @@ module doodle.core.backtrace; +/+ + // // Provides support for a readable backtrace on a program crash. // @@ -36,7 +38,7 @@ } } - throw new Error(format("Got signal %s %s", sig, name)); + throw new Error(format("Got signal %s %s", sig, name())); } shared static this() { @@ -111,3 +113,4 @@ char** framelist; } } ++/ diff -r 1bc3475624d3 -r bc5baa585b32 doodle/core/undo.d --- a/doodle/core/undo.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/core/undo.d Thu Aug 02 15:32:43 2012 +0930 @@ -36,7 +36,7 @@ this(in string description) { _description = description; - _timeStamp = Clock.currTime; + _timeStamp = Clock.currTime(); } this(in string description, SysTime timeStamp) { @@ -105,20 +105,20 @@ } void undo() { - assert(canUndo); + assert(canUndo()); auto edit = _undoEdits.back; - edit.undo; - _undoEdits.popBack; + edit.undo(); + _undoEdits.popBack(); _redoEdits ~= edit; notifyObservers(); } void redo() { - assert(canRedo); + assert(canRedo()); auto edit = _redoEdits.back; - edit.redo; - _redoEdits.popBack; + edit.redo(); + _redoEdits.popBack(); _undoEdits ~= edit; notifyObservers(); @@ -150,8 +150,8 @@ void notifyObservers() { foreach (o; _observers) { - o.undoRedoUpdate(canUndo, canUndo ? _undoEdits.back.description : null, - canRedo, canRedo ? _redoEdits.back.description : null); + o.undoRedoUpdate(canUndo(), canUndo() ? _undoEdits.back.description() : null, + canRedo(), canRedo() ? _redoEdits.back.description() : null); } } } diff -r 1bc3475624d3 -r bc5baa585b32 doodle/dia/grid_layer.d --- a/doodle/dia/grid_layer.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/dia/grid_layer.d Thu Aug 02 15:32:43 2012 +0930 @@ -38,7 +38,7 @@ const z = screenModel.zoom; const lineWidthModel = LINE_WIDTH_SCREEN / z; - modelRenderer.pushState; { + modelRenderer.pushState(); { modelRenderer.setColor(doodle.tk.color.Color(0.0, 0.0, 0.7, 1.0)); modelRenderer.setLineWidth(lineWidthModel); @@ -57,7 +57,7 @@ y += _spacing; if (y > modelDamage.corner1.y) break; } - } modelRenderer.popState; + } modelRenderer.popState(); } // IGrid overrides: diff -r 1bc3475624d3 -r bc5baa585b32 doodle/dia/icanvas.d --- a/doodle/dia/icanvas.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/dia/icanvas.d Thu Aug 02 15:32:43 2012 +0930 @@ -65,9 +65,9 @@ _name = name; } - string name() const { return _name; } + @property string name() const { return _name; } - Rectangle bounds() const; + @property Rectangle bounds() const; //bool snap(in Point a, out Point b) const; diff -r 1bc3475624d3 -r bc5baa585b32 doodle/dia/layer_stack.d --- a/doodle/dia/layer_stack.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/dia/layer_stack.d Thu Aug 02 15:32:43 2012 +0930 @@ -9,7 +9,7 @@ _layers = layers.dup; } - Rectangle bounds() const { + @property Rectangle bounds() const { // Take the union of all layer bounds Rectangle bounds; foreach (layer; _layers) { bounds = bounds | layer.bounds; } diff -r 1bc3475624d3 -r bc5baa585b32 doodle/dia/page_layer.d --- a/doodle/dia/page_layer.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/dia/page_layer.d Thu Aug 02 15:32:43 2012 +0930 @@ -25,15 +25,15 @@ in ScreenModel screenModel) const { // Make the paper white, with a border - modelRenderer.pushState; { + modelRenderer.pushState(); { modelRenderer.setColor(Color(0.0, 0.0, 0.0, 1.0)); modelRenderer.drawRectangle(_pageGeometry, false); - } modelRenderer.popState; + } modelRenderer.popState(); - modelRenderer.pushState; { + modelRenderer.pushState(); { modelRenderer.setColor(Color(1.0, 1.0, 1.0, 1.0)); modelRenderer.drawRectangle(_pageGeometry, true); - } modelRenderer.popState; + } modelRenderer.popState(); } // IPage overrides: diff -r 1bc3475624d3 -r bc5baa585b32 doodle/dia/tool.d --- a/doodle/dia/tool.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/dia/tool.d Thu Aug 02 15:32:43 2012 +0930 @@ -13,7 +13,7 @@ _name = name; } - string name() const { return _name; } + @property string name() const { return _name; } bool handleButtonPress(scope IViewport viewport, in ButtonEvent event) { return false; } bool handleButtonRelease(scope IViewport viewport, in ButtonEvent event) { return false; } diff -r 1bc3475624d3 -r bc5baa585b32 doodle/fig/diagram_elements.d --- a/doodle/fig/diagram_elements.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/fig/diagram_elements.d Thu Aug 02 15:32:43 2012 +0930 @@ -13,7 +13,7 @@ } abstract class DiagramElement { - Rectangle bounds() const; + @property Rectangle bounds() const; void draw(in Rectangle damage, scope Renderer cr) const; @@ -48,7 +48,7 @@ } final class GraphNode : GraphElement { - override Rectangle bounds() const { return _bounds; } + @property override Rectangle bounds() const { return _bounds; } override void draw(in Rectangle damage, scope Renderer cr) const { } @@ -59,7 +59,7 @@ } final class GraphEdge : GraphElement { - override Rectangle bounds() const { return _bounds; } + @property override Rectangle bounds() const { return _bounds; } override void draw(in Rectangle damage, scope Renderer cr) const { } @@ -75,7 +75,7 @@ } class TextElement : LeafElement { - override Rectangle bounds() const { return _bounds; } + @property override Rectangle bounds() const { return _bounds; } override void draw(in Rectangle damage, scope Renderer cr) const { } @@ -89,7 +89,7 @@ } class PolylinePrimitive : GraphicPrimitive { - override Rectangle bounds() const { return _bounds; } + @property override Rectangle bounds() const { return _bounds; } override void draw(in Rectangle damage, scope Renderer cr) const { } @@ -101,7 +101,7 @@ } final class RectanglePrimitive : GraphicPrimitive { - override Rectangle bounds() const { return _bounds; } + @property override Rectangle bounds() const { return _bounds; } override void draw(in Rectangle damage, scope Renderer drawable) const { drawable.drawRectangle(bounds, false); diff -r 1bc3475624d3 -r bc5baa585b32 doodle/fig/select_tool.d --- a/doodle/fig/select_tool.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/fig/select_tool.d Thu Aug 02 15:32:43 2012 +0930 @@ -45,12 +45,12 @@ override void draw(in Rectangle screenDamage, scope Renderer screenRenderer) const { if (_active) { - screenRenderer.pushState; { + screenRenderer.pushState(); { screenRenderer.setLineStyle(Renderer.LineStyle.DASHED); screenRenderer.setLineWidth(LINE_WIDTH); screenRenderer.setColor(Color(0.0, 0.0, 0.5, 1.0)); screenRenderer.drawRectangle(Rectangle(_currentPoint, _anchorPoint), false); - } screenRenderer.popState; + } screenRenderer.popState(); } } diff -r 1bc3475624d3 -r bc5baa585b32 doodle/gtk/cairo_canvas.d --- a/doodle/gtk/cairo_canvas.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/gtk/cairo_canvas.d Thu Aug 02 15:32:43 2012 +0930 @@ -35,7 +35,7 @@ import std.stdio; } -final class CairoCanvas : Table, private IViewport { +final class CairoCanvas : Table, IViewport { static this() { _cursors = [ Cursor.DEFAULT : CursorType.ARROW, @@ -146,19 +146,19 @@ void zoomRelative(in double factor, in Point screenDatum) { _screenModel.zoomRelative(factor, screenDatum); - consolidateBounds; - updateAdjustments; - updateRulers; + consolidateBounds(); + updateAdjustments(); + updateRulers(); _grid.zoomChanged(_screenModel.zoom); - queueDraw; + queueDraw(); } void panRelative(in Vector screenDisplacement) { _screenModel.panRelativeScreen(screenDisplacement); - consolidateBounds; - updateAdjustments; - updateRulers; - queueDraw; + consolidateBounds(); + updateAdjustments(); + updateRulers(); + queueDraw(); } void setCursor(in Cursor cursor) { @@ -181,8 +181,8 @@ Rectangle paddedLayerBounds = growCentre(layerBounds, 2 * layerBounds.size); _screenModel.consolidateCanvasBounds(paddedLayerBounds); - updateAdjustments; - updateRulers; + updateAdjustments(); + updateRulers(); } bool onConfigure(GdkEventConfigure * event, Widget widget) { @@ -196,12 +196,12 @@ _screenModel = new ScreenModel(0.25 * _pixelsPerMillimetre, paddedLayerBounds, viewBoundsScreen); _grid.zoomChanged(_screenModel.zoom); - updateAdjustments; - updateRulers; + updateAdjustments(); + updateRulers(); } else { _screenModel.setViewBoundsScreen(viewBoundsScreen); - consolidateBounds; + consolidateBounds(); } return true; @@ -210,7 +210,7 @@ bool onExpose(GdkEventExpose * event, Widget widget) { assert(widget is _drawingArea); - auto dr = _drawingArea.getWindow; + auto dr = _drawingArea.getWindow(); scope modelCr = new Context(dr); // Causing a memory leak! scope screenCr = new Context(dr); // Causing a memory leak! @@ -221,7 +221,7 @@ Rectangle modelDamage = _screenModel.screenToModel(screenDamage); - modelCr.save; screenCr.save; { + modelCr.save(); screenCr.save(); { { // Setup model context and clip modelCr.translate(0.0, _screenModel.viewBoundsScreen.h); @@ -231,7 +231,7 @@ modelCr.translate(-viewLeftBottom.x, -viewLeftBottom.y); modelCr.rectangle(modelDamage.x0, modelDamage.y0, modelDamage.w, modelDamage.h); - modelCr.clip; + modelCr.clip(); } { @@ -240,20 +240,20 @@ screenCr.scale(1.0, -1.0); screenCr.rectangle(screenDamage.x0, screenDamage.y0, screenDamage.w, screenDamage.h); - screenCr.clip; + screenCr.clip(); } - screenCr.save; { + screenCr.save(); { // Fill the background with light grey screenCr.setSourceRgba(0.9, 0.9, 0.9, 1.0); screenCr.rectangle(screenDamage.x0, screenDamage.y0, screenDamage.w, screenDamage.h); - screenCr.fill; - } screenCr.restore; + screenCr.fill(); + } screenCr.restore(); _layerStack.draw(screenDamage, new CairoRenderer(screenCr), modelDamage, new CairoRenderer(modelCr), _screenModel); - } screenCr.restore; modelCr.restore; + } screenCr.restore(); modelCr.restore(); return true; } @@ -261,28 +261,28 @@ bool onButtonPress(GdkEventButton * event, Widget widget) { assert(widget is _drawingArea); _eventHandler.handleButtonPress(this, makeButtonEvent(event, _screenModel)); - fixDamage; + fixDamage(); return true; } bool onButtonRelease(GdkEventButton * event, Widget widget) { assert(widget is _drawingArea); _eventHandler.handleButtonRelease(this, makeButtonEvent(event, _screenModel)); - fixDamage; + fixDamage(); return true; } bool onKeyPressEvent(GdkEventKey * event, Widget widget) { assert(widget is _drawingArea); _eventHandler.handleKeyPress(this, makeKeyEvent(event, _screenModel)); - fixDamage; + fixDamage(); return true; } bool onKeyReleaseEvent(GdkEventKey * event, Widget widget) { assert(widget is _drawingArea); _eventHandler.handleKeyRelease(this, makeKeyEvent(event, _screenModel)); - fixDamage; + fixDamage(); return true; } @@ -294,28 +294,28 @@ gtk_widget_event(_vRuler.getWidgetStruct(), cast(GdkEvent *)event); _eventHandler.handleMotion(this, makeMotionEvent(event, _screenModel)); - fixDamage; + fixDamage(); return true; } bool onScroll(GdkEventScroll * event, Widget widget) { assert(widget is _drawingArea); _eventHandler.handleScroll(this, makeScrollEvent(event, _screenModel)); - fixDamage; + fixDamage(); return true; } bool onEnterNotify(GdkEventCrossing * event, Widget widget) { assert(widget is _drawingArea); _eventHandler.handleEnter(this, makeCrossingEvent(event, _screenModel)); - fixDamage; + fixDamage(); return true; } bool onLeaveNotify(GdkEventCrossing * event, Widget widget) { assert(widget is _drawingArea); _eventHandler.handleLeave(this, makeCrossingEvent(event, _screenModel)); - fixDamage; + fixDamage(); return true; } @@ -347,8 +347,8 @@ } void onAdjustmentValueChanged(Adjustment adjustment) { - GtkAdjustment * hGtkAdjustment = _hAdjustment.getAdjustmentStruct; - GtkAdjustment * vGtkAdjustment = _vAdjustment.getAdjustmentStruct; + GtkAdjustment * hGtkAdjustment = _hAdjustment.getAdjustmentStruct(); + GtkAdjustment * vGtkAdjustment = _vAdjustment.getAdjustmentStruct(); Point oldViewLeftBottom = _screenModel.screenToModel(Point(0.0, 0.0)); Point newViewLeftBottom = Point(gtk_adjustment_get_value(hGtkAdjustment), @@ -356,8 +356,8 @@ _screenModel.panRelativeModel(newViewLeftBottom - oldViewLeftBottom); - updateRulers; - queueDraw; + updateRulers(); + queueDraw(); } void updateRulers() { diff -r 1bc3475624d3 -r bc5baa585b32 doodle/gtk/cairo_renderer.d --- a/doodle/gtk/cairo_renderer.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/gtk/cairo_renderer.d Thu Aug 02 15:32:43 2012 +0930 @@ -36,13 +36,13 @@ void translate(in Point p) { _cr.translate(p.x, p.y); } void scale(in double s) { _cr.scale(s, s); } - void pushState() { _cr.save; } - void popState() { _cr.restore; } + void pushState() { _cr.save(); } + void popState() { _cr.restore(); } void drawRectangle(in Rectangle rectangle, bool fill = false) { _cr.rectangle(rectangle.position.x, rectangle.position.y, rectangle.size.x, rectangle.size.y); - if (fill) { _cr.fill; } else { _cr.stroke; } + if (fill) { _cr.fill(); } else { _cr.stroke(); } } void drawEllipse(in Rectangle rectangle, bool fill = false) { @@ -52,19 +52,19 @@ void drawSegment(in Segment segment) { _cr.moveTo(segment.begin.x, segment.begin.y); _cr.lineTo(segment.end.x, segment.end.y); - _cr.stroke; + _cr.stroke(); } void drawHLine(in double y, in double x0, in double x1) { _cr.moveTo(x0, y); _cr.lineTo(x1, y); - _cr.stroke; + _cr.stroke(); } void drawVLine(in double x, in double y0, in double y1) { _cr.moveTo(x, y0); _cr.lineTo(x, y1); - _cr.stroke; + _cr.stroke(); } void drawPoly(in Point[] points, bool fill = false) { @@ -73,7 +73,7 @@ if (i == 0) { _cr.moveTo(p.x, p.y); } else { _cr.lineTo(p.x, p.y); } } - if (fill) { _cr.fill; } else { _cr.stroke; } + if (fill) { _cr.fill(); } else { _cr.stroke(); } } void setFontFace(in FontFace face) { diff -r 1bc3475624d3 -r bc5baa585b32 doodle/gtk/palette.d --- a/doodle/gtk/palette.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/gtk/palette.d Thu Aug 02 15:32:43 2012 +0930 @@ -60,7 +60,7 @@ void activate(T t) { RadioToolButton button = _buttons[t]; - if (!button.getActive) { + if (!button.getActive()) { button.setActive(true); } } @@ -74,7 +74,7 @@ void onClicked(ToolButton toolButton) { RadioToolButton button = cast(RadioToolButton)toolButton; - if (button.getActive) { + if (button.getActive()) { T t = cast(T)button.getData(_indexStr); _callback(t); } diff -r 1bc3475624d3 -r bc5baa585b32 doodle/main/prog/chess.d --- a/doodle/main/prog/chess.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/main/prog/chess.d Thu Aug 02 15:32:43 2012 +0930 @@ -209,6 +209,7 @@ this () { } + // Restore a previous game this (Board board, Flags whiteFlags, Flags blackFlags, Side nextPly) { _board = board; _nextPly = nextPly; @@ -222,6 +223,9 @@ } Acceptance apply(in Ply ply) { + auto source = _board.square(ply.source); + auto dest = _board.square(ply.dest); + /+ auto sq1 = square(update.source); auto sq2 = square(update.dest); diff -r 1bc3475624d3 -r bc5baa585b32 doodle/main/prog/doodler.d --- a/doodle/main/prog/doodler.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/main/prog/doodler.d Thu Aug 02 15:32:43 2012 +0930 @@ -26,7 +26,7 @@ import std.stdio; } -final class TopLevel : private IToolStackObserver { +final class TopLevel : /*private*/ IToolStackObserver { this(string[] args) { Main.init(args); auto window = new MainWindow("Doodle"); diff -r 1bc3475624d3 -r bc5baa585b32 doodle/tk/color.d --- a/doodle/tk/color.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/tk/color.d Thu Aug 02 15:32:43 2012 +0930 @@ -12,10 +12,10 @@ // TODO // hsv, grey, etc. - double r() const { return _r; } - double g() const { return _g; } - double b() const { return _b; } - double a() const { return _a; } + @property double r() const { return _r; } + @property double g() const { return _g; } + @property double b() const { return _b; } + @property double a() const { return _a; } private { double _r = 0.0, _g = 0.0, _b = 0.0, _a = 1.0; diff -r 1bc3475624d3 -r bc5baa585b32 doodle/tk/events.d --- a/doodle/tk/events.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/tk/events.d Thu Aug 02 15:32:43 2012 +0930 @@ -96,7 +96,7 @@ _mask = mask; } - Mask mask() const { return _mask; } + @property Mask mask() const { return _mask; } private { Mask _mask; @@ -110,8 +110,8 @@ _value = value; } - string str() const { return _str; } - uint value() const { return _value; } + @property string str() const { return _str; } + @property uint value() const { return _value; } override string toString() const { return std.string.format("Key event: %s, %d, %s", _str, _value, _mask); @@ -130,8 +130,8 @@ _modelPoint = modelPoint; } - Point screenPoint() const { return _screenPoint; } - Point modelPoint() const { return _modelPoint; } + @property Point screenPoint() const { return _screenPoint; } + @property Point modelPoint() const { return _modelPoint; } private { Point _screenPoint; @@ -148,7 +148,7 @@ _crossingMode = crossingMode; } - CrossingMode crossingMode() const { return _crossingMode; } + @property CrossingMode crossingMode() const { return _crossingMode; } override string toString() const { return std.string.format("Crossing event: %s, %s, %s, %s", to!string(_crossingMode), screenPoint, modelPoint, mask); @@ -176,8 +176,8 @@ _screenPoint, _modelPoint, _mask); } - ButtonAction buttonAction() const { return _buttonAction; } - ButtonName buttonName() const { return _buttonName; } + @property ButtonAction buttonAction() const { return _buttonAction; } + @property ButtonName buttonName() const { return _buttonName; } private { ButtonAction _buttonAction; @@ -212,7 +212,7 @@ to!string(_scrollDirection), _screenPoint, _modelPoint, _mask); } - ScrollDirection scrollDirection() const { return _scrollDirection; } + @property ScrollDirection scrollDirection() const { return _scrollDirection; } private { ScrollDirection _scrollDirection; diff -r 1bc3475624d3 -r bc5baa585b32 doodle/tk/geometry.d --- a/doodle/tk/geometry.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/tk/geometry.d Thu Aug 02 15:32:43 2012 +0930 @@ -45,8 +45,8 @@ return std.string.format("(%f, %f)", _x, _y); } - double x() const { return _x; } - double y() const { return _y; } + @property double x() const { return _x; } + @property double y() const { return _y; } private { double _x = 0.0, _y = 0.0; @@ -93,7 +93,7 @@ return Vector(_x / d, _y / d); } - double length() const { + @property double length() const { return sqrt(_x * _x + _y * _y); } @@ -101,8 +101,8 @@ return std.string.format("[%f, %f]", _x, _y); } - double x() const { return _x; } - double y() const { return _y; } + @property double x() const { return _x; } + @property double y() const { return _y; } private { double _x = 0.0, _y = 0.0; @@ -144,25 +144,25 @@ this(corner1.x, corner1.y, corner.x - corner1.x, corner.y - corner1.y); } - double x0() const { return _position.x; } - double y0() const { return _position.y; } - double w() const { return _size.x; } - double h() const { return _size.y; } - double x1() const { return x0 + w; } - double y1() const { return y0 + h; } + @property double x0() const { return _position.x; } + @property double y0() const { return _position.y; } + @property double w() const { return _size.x; } + @property double h() const { return _size.y; } + @property double x1() const { return x0 + w; } + @property double y1() const { return y0 + h; } alias position corner0; - Point position() const { return _position; } + @property Point position() const { return _position; } - Vector size() const { return _size; } + @property Vector size() const { return _size; } - Point corner1() const { return _position + _size; } + @property Point corner1() const { return _position + _size; } - bool valid() const { return _size.x > 0.0 && _size.y > 0.0; } + @property bool valid() const { return _size.x > 0.0 && _size.y > 0.0; } - bool invalid() const { return !valid(); } + @property bool invalid() const { return !valid(); } - double area() const { return _size.x * _size.y; } + @property double area() const { return _size.x * _size.y; } // Intersection Rectangle opAnd(in Rectangle r) const { @@ -209,7 +209,7 @@ // - Point centre() const { return _position + _size / 2.0; } + @property Point centre() const { return _position + _size / 2.0; } string toString() { return std.string.format("{%s, %s}", _position, _size); @@ -335,8 +335,8 @@ assert(_gradient.length > 1e-6); // FIXME as above } - Point point() const { return _point; } - Vector gradient() const { return _gradient; } + @property Point point() const { return _point; } + @property Vector gradient() const { return _gradient; } string toString() { return std.string.format("{%s %s}", _point, _gradient); @@ -380,8 +380,8 @@ _end = b; } - Point begin() const { return _begin; } - Point end() const { return _end; } + @property Point begin() const { return _begin; } + @property Point end() const { return _end; } string toString() { return std.string.format("{%s %s}", _begin, _end); diff -r 1bc3475624d3 -r bc5baa585b32 doodle/tk/screen_model.d --- a/doodle/tk/screen_model.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/tk/screen_model.d Thu Aug 02 15:32:43 2012 +0930 @@ -56,11 +56,11 @@ // For userZoom 1.0 -> 100% means the presentation on the screen is one-to-one with real-life double userZoom(in double pixelsPerMillimetre) const { return _zoom / pixelsPerMillimetre; } - double zoom() const { return _zoom; } - Rectangle viewBoundsScreen() const { return _viewBoundsScreen; } - Rectangle viewBoundsModel() const { return screenToModel(_viewBoundsScreen); } - Rectangle canvasBoundsModel() const { return _canvasBoundsModel; } - Rectangle canvasBoundsScreen() const { return modelToScreen(_canvasBoundsModel); } + @property double zoom() const { return _zoom; } + @property Rectangle viewBoundsScreen() const { return _viewBoundsScreen; } + @property Rectangle viewBoundsModel() const { return screenToModel(_viewBoundsScreen); } + @property Rectangle canvasBoundsModel() const { return _canvasBoundsModel; } + @property Rectangle canvasBoundsScreen() const { return modelToScreen(_canvasBoundsModel); } Point modelToScreen(in Point model) const { return _viewBoundsScreen.centre + _zoom * (model - _viewCentreModel); } Point screenToModel(in Point screen) const { return _viewCentreModel + (screen - _viewBoundsScreen.centre) / _zoom; } diff -r 1bc3475624d3 -r bc5baa585b32 doodle/utils/prog/dupes.d --- a/doodle/utils/prog/dupes.d Thu Jan 12 18:20:58 2012 +1030 +++ b/doodle/utils/prog/dupes.d Thu Aug 02 15:32:43 2012 +0930 @@ -66,7 +66,7 @@ ubyte[16] digest; auto file = File(filename, "r"); - scope(exit) file.close; + scope(exit) file.close(); MD5_CTX context; context.start(); diff -r 1bc3475624d3 -r bc5baa585b32 options.template --- a/options.template Thu Jan 12 18:20:58 2012 +1030 +++ b/options.template Thu Aug 02 15:32:43 2012 +0930 @@ -6,3 +6,4 @@ -gc -unittest -debug +-property