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 include $(GOROOT)/src/Make.inc
TARG=gettingStarted testdraw2d testX11draw testandroid testgopher testpostscript TARG=gettingStarted testdraw2d testX11draw testandroid testgopher testimage testpostscript
OFILES=$(TARG:%=%.$O) OFILES=$(TARG:%=%.$O)

View File

@ -11,8 +11,7 @@ import (
"image" "image"
"image/png" "image/png"
//"draw2d" "draw2d.googlecode.com/hg/draw2d"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/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" "exp/draw/x11"
"image" "image"
"math" "math"
//"draw2d" "draw2d.googlecode.com/hg/draw2d"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
) )
func main() { func main() {

View File

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

View File

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

View File

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

View File

@ -9,8 +9,7 @@ import (
"image" "image"
"time" "time"
"image/png" "image/png"
//"draw2d" "draw2d.googlecode.com/hg/draw2d"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d"
) )
@ -67,7 +66,7 @@ func testBubble(gc *draw2d.GraphicContext) {
func main() { func main() {
source := loadFromPngFile("../../Varna_Railway_Station_HDR.png") source := loadFromPngFile("../resource/image/Varna_Railway_Station_HDR.png")
i := image.NewRGBA(1024, 768) i := image.NewRGBA(1024, 768)
gc := draw2d.NewGraphicContext(i) gc := draw2d.NewGraphicContext(i)
gc.Scale(2, 0.5) gc.Scale(2, 0.5)
@ -77,5 +76,5 @@ func main() {
gc.DrawImage(source) gc.DrawImage(source)
dt := time.Nanoseconds() - lastTime dt := time.Nanoseconds() - lastTime
fmt.Printf("Draw image: %f ms\n", float64(dt)*1e-6) 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" "strings"
"image" "image"
"image/png" "image/png"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d" "draw2d.googlecode.com/hg/draw2d"
"postscript" "draw2d.googlecode.com/hg/postscript"
//"postscript-go.googlecode.com/svn/trunk/postscript-go/src/pkg/postscript"
) )
@ -45,7 +44,7 @@ func main() {
gc.Scale(1, -1) gc.Scale(1, -1)
gc.Translate(0, -380) gc.Translate(0, -380)
lastTime := time.Nanoseconds() 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 { if err != nil {
return return
} }
@ -56,5 +55,5 @@ func main() {
interpreter.Execute(reader) interpreter.Execute(reader)
dt := time.Nanoseconds() - lastTime dt := time.Nanoseconds() - lastTime
fmt.Printf("Draw image: %f ms\n", float64(dt)*1e-6) 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 include $(GOROOT)/src/Make.inc
TARG=draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d TARG=draw2d.googlecode.com/hg/draw2d
GOFILES=\ GOFILES=\
arc.go\ arc.go\
curves.go\ curves.go\

View File

@ -14,7 +14,7 @@ import (
var ( var (
fontFolder = "../../fonts/" fontFolder = "../resource/font/"
fonts = make(map[string]*truetype.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 { func (p *PathStorage) RQuadCurveTo(dcx, dcy, dx, dy float64) *PathStorage {
x, y := p.LastPoint() 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 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 { func (p *PathStorage) RCubicCurveTo(dcx1, dcy1, dcx2, dcy2, dx, dy float64) *PathStorage {
x, y := p.LastPoint() 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 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 { func (p *PathStorage) RArcTo(dcx, dcy, rx, ry, startAngle, angle float64) *PathStorage {
x, y := p.LastPoint() 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 return p
} }

View File

@ -1,6 +1,6 @@
include $(GOROOT)/src/Make.inc 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\ GOFILES=operators_array.go\
operators_dictionary.go\ operators_dictionary.go\
operators_misc.go\ operators_misc.go\

View File

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

View File

@ -6,7 +6,7 @@ package postscript
import ( import (
"image" "image"
"draw2d.googlecode.com/svn/trunk/draw2d/src/pkg/draw2d" "draw2d.googlecode.com/hg/draw2d"
"math" "math"
"log" "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.0 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