adapt project to the new structure && resolve issue 1

This commit is contained in:
Laurent Le Goff 2011-03-17 23:32:06 +01:00
parent bda17ba2dc
commit ae46b382b2
76 changed files with 41 additions and 47 deletions

16
Makefile Normal file
View file

@ -0,0 +1,16 @@
include $(GOROOT)/src/Make.inc
all: install
install:
cd draw2d && make install
cd postscript && make install
clean:
cd draw2d && make clean
cd postscript && make clean
nuke:
cd draw2d && make nuke
cd postscript && make nuke

View file

@ -1,7 +1,7 @@
include $(GOROOT)/src/Make.inc
TARG=gettingStarted testdraw2d testX11draw testandroid testgopher testpostscript
TARG=gettingStarted testdraw2d testX11draw testandroid testgopher testimage testpostscript
OFILES=$(TARG:%=%.$O)

View file

@ -11,8 +11,7 @@ import (
"image"
"image/png"
//"draw2d"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
"draw2d.googlecode.com/hg/draw2d"
)

View file

@ -1,15 +0,0 @@
package main
import (
"fmt"
)
func main() {
toto := make([]int, 2, 2)
toto[0] = 1
toto[1] = 2
fmt.Printf("%v\n", toto)
toto = toto[0:0]
fmt.Printf("%v\n", toto)
fmt.Printf("%v\n", cap(toto))
}

View file

@ -6,8 +6,7 @@ import (
"exp/draw/x11"
"image"
"math"
//"draw2d"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
"draw2d.googlecode.com/hg/draw2d"
)
func main() {

View file

@ -11,8 +11,7 @@ import (
"math"
"image"
"image/png"
//"draw2d"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
"draw2d.googlecode.com/hg/draw2d"
)
const (
@ -21,7 +20,7 @@ const (
var (
lastTime int64
folder = "../../../../wiki/test_results/"
folder = "../resource/result/"
)
func initGc(w, h int) (image.Image, *draw2d.GraphicContext) {

View file

@ -13,8 +13,7 @@ import (
"math"
"image"
"image/png"
//"draw2d"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
"draw2d.googlecode.com/hg/draw2d"
)
const (
@ -23,7 +22,7 @@ const (
var (
lastTime int64
folder = "../../../../wiki/test_results/"
folder = "../resource/result/"
)
func initGc(w, h int) (image.Image, *draw2d.GraphicContext) {
@ -489,7 +488,7 @@ func TestPathTransform() {
}
func TestFillString() {
draw2d.SetFontFolder("../../fonts/")
draw2d.SetFontFolder("../resource/font/")
i, gc := initGc(100, 100)
draw2d.RoundRect(gc, 5, 5, 95, 95, 10, 10)
gc.FillStroke()

View file

@ -11,8 +11,7 @@ import (
"image"
"image/png"
//"draw2d"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
"draw2d.googlecode.com/hg/draw2d"
)
const (
@ -21,7 +20,7 @@ const (
var (
lastTime int64
folder = "../../../../wiki/test_results/"
folder = "../resource/result/"
)
func initGc(w, h int) (image.Image, *draw2d.GraphicContext) {

View file

@ -9,8 +9,7 @@ import (
"image"
"time"
"image/png"
//"draw2d"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
"draw2d.googlecode.com/hg/draw2d"
)
@ -67,7 +66,7 @@ func testBubble(gc *draw2d.GraphicContext) {
func main() {
source := loadFromPngFile("../../Varna_Railway_Station_HDR.png")
source := loadFromPngFile("../resource/image/Varna_Railway_Station_HDR.png")
i := image.NewRGBA(1024, 768)
gc := draw2d.NewGraphicContext(i)
gc.Scale(2, 0.5)
@ -77,5 +76,5 @@ func main() {
gc.DrawImage(source)
dt := time.Nanoseconds() - lastTime
fmt.Printf("Draw image: %f ms\n", float64(dt)*1e-6)
saveToPngFile("../../TestDrawImage.png", i)
saveToPngFile("../resource/result/TestDrawImage.png", i)
}

View file

@ -11,9 +11,8 @@ import (
"strings"
"image"
"image/png"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
"postscript"
//"postscript-go.googlecode.com/svn/trunk/postscript-go/src/pkg/postscript"
"draw2d.googlecode.com/hg/draw2d"
"draw2d.googlecode.com/hg/postscript"
)
@ -45,7 +44,7 @@ func main() {
gc.Scale(1, -1)
gc.Translate(0, -380)
lastTime := time.Nanoseconds()
src, err := os.Open("../../test_files/tiger.ps", 0, 0)
src, err := os.Open("../resource/postscript/tiger.ps", 0, 0)
if err != nil {
return
}
@ -56,5 +55,5 @@ func main() {
interpreter.Execute(reader)
dt := time.Nanoseconds() - lastTime
fmt.Printf("Draw image: %f ms\n", float64(dt)*1e-6)
saveToPngFile("../../TestPostscript.png", i)
saveToPngFile("../resource/result/TestPostscript.png", i)
}

View file

@ -1,6 +1,6 @@
include $(GOROOT)/src/Make.inc
TARG=draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d
TARG=draw2d.googlecode.com/hg/draw2d
GOFILES=\
arc.go\
curves.go\

View file

@ -14,7 +14,7 @@ import (
var (
fontFolder = "../../fonts/"
fontFolder = "../resource/font/"
fonts = make(map[string]*truetype.Font)
)

View file

@ -85,7 +85,7 @@ func (p *PathStorage) QuadCurveTo(cx, cy, x, y float64) *PathStorage {
func (p *PathStorage) RQuadCurveTo(dcx, dcy, dx, dy float64) *PathStorage {
x, y := p.LastPoint()
p.RQuadCurveTo(x+dcx, y+dcy, x+dx, y+dy)
p.QuadCurveTo(x+dcx, y+dcy, x+dx, y+dy)
return p
}
@ -98,7 +98,7 @@ func (p *PathStorage) CubicCurveTo(cx1, cy1, cx2, cy2, x, y float64) *PathStorag
func (p *PathStorage) RCubicCurveTo(dcx1, dcy1, dcx2, dcy2, dx, dy float64) *PathStorage {
x, y := p.LastPoint()
p.RCubicCurveTo(x+dcx1, y+dcy1, x+dcx2, y+dcy2, x+dx, y+dy)
p.CubicCurveTo(x+dcx1, y+dcy1, x+dcx2, y+dcy2, x+dx, y+dy)
return p
}
@ -133,7 +133,7 @@ func (p *PathStorage) ArcTo(cx, cy, rx, ry, startAngle, angle float64) *PathStor
func (p *PathStorage) RArcTo(dcx, dcy, rx, ry, startAngle, angle float64) *PathStorage {
x, y := p.LastPoint()
p.RArcTo(x+dcx, y+dcy, rx, ry, startAngle, angle)
p.ArcTo(x+dcx, y+dcy, rx, ry, startAngle, angle)
return p
}

View file

@ -1,6 +1,6 @@
include $(GOROOT)/src/Make.inc
TARG=postscript-go.googlecode.com/svn/trunk/postscript-go/src/pkg/postscript
TARG=draw2d.googlecode.com/hg/postscript
GOFILES=operators_array.go\
operators_dictionary.go\
operators_misc.go\

View file

@ -8,7 +8,7 @@ import (
"log"
"strconv"
"io"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
"draw2d.googlecode.com/hg/draw2d"
)

View file

@ -6,7 +6,7 @@ package postscript
import (
"image"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
"draw2d.googlecode.com/hg/draw2d"
"math"
"log"
)

View file

Before

Width:  |  Height:  |  Size: 592 KiB

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 906 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 650 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 B