Skip to content

Commit

Permalink
Merge pull request #13 from gen2brain/master
Browse files Browse the repository at this point in the history
*[0]byte change, silence warning
  • Loading branch information
ungerik committed Oct 23, 2015
2 parents cb5caf2 + 9e93b9b commit a56583f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion png.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package cairo
// #cgo pkg-config: cairo
// #include <stdio.h>
// #include <stdlib.h>
// #include <strings.h>
// #include <string.h>
// #include <cairo.h>
//
// #define GO_CAIRO_VECTOR_INIT_SIZE 64
Expand Down
9 changes: 6 additions & 3 deletions surface.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ import (
"github.com/ungerik/go-cairo/extimage"
)

type Cairo_surface *C.cairo_surface_t
type Cairo_context *C.cairo_t

// Golang struct to hold both a cairo surface and a cairo context
type Surface struct {
surface *C.cairo_surface_t
context *C.cairo_t
surface Cairo_surface
context Cairo_context
}

func NewSurface(format Format, width, height int) *Surface {
Expand All @@ -30,7 +33,7 @@ func NewSurface(format Format, width, height int) *Surface {
// NewSurfaceFromC creates a new surface from C data types.
// This is useful, if you already obtained a surface by
// using a C library, for example an XCB surface.
func NewSurfaceFromC(s *C.cairo_surface_t, c *C.cairo_t) *Surface {
func NewSurfaceFromC(s Cairo_surface, c Cairo_context) *Surface {
return &Surface{surface: s, context: c}
}

Expand Down

0 comments on commit a56583f

Please sign in to comment.