Commit 7918a8b8 authored by Sascha Steinbiss's avatar Sascha Steinbiss

Updated version 0.0~git20170505.0.901a95d from 'upstream/0.0_git20170505.0.901a95d'

with Debian dir 115e81a3b00d961cc67f24ad41723b410c728d3e
parents 4b03de88 ce5a5cb4
.pc
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof
{
"ImportPath": "github.com/twstrike/gotk3adapter",
"GoVersion": "go1.6",
"GodepVersion": "v74",
"Packages": [
"./..."
],
"Deps": [
{
"ImportPath": "github.com/gotk3/gotk3/cairo",
"Comment": "GOTK3_0_2_0-517-g3732904",
"Rev": "37329043822dea00ae853ce824c3360b0cdf9391"
},
{
"ImportPath": "github.com/gotk3/gotk3/gdk",
"Comment": "GOTK3_0_2_0-517-g3732904",
"Rev": "37329043822dea00ae853ce824c3360b0cdf9391"
},
{
"ImportPath": "github.com/gotk3/gotk3/glib",
"Comment": "GOTK3_0_2_0-517-g3732904",
"Rev": "37329043822dea00ae853ce824c3360b0cdf9391"
},
{
"ImportPath": "github.com/gotk3/gotk3/gtk",
"Comment": "GOTK3_0_2_0-517-g3732904",
"Rev": "37329043822dea00ae853ce824c3360b0cdf9391"
},
{
"ImportPath": "github.com/gotk3/gotk3/pango",
"Comment": "GOTK3_0_2_0-517-g3732904",
"Rev": "37329043822dea00ae853ce824c3360b0cdf9391"
}
]
}
This directory tree is generated automatically by godep.
Please do not edit.
See https://github.com/tools/godep for more information.
......@@ -2,3 +2,7 @@ package gdk_mock
type MockPixbuf struct {
}
func (*MockPixbuf) SavePNG(string, int) error {
return nil
}
......@@ -17,6 +17,9 @@ func (*MockPixbufLoader) GetPixbuf() (gdki.Pixbuf, error) {
return nil, nil
}
func (*MockPixbufLoader) SetSize(int, int) {
}
func (*MockPixbufLoader) Write(b []byte) (int, error) {
return 0, nil
}
......@@ -26,3 +26,28 @@ func unwrapEvent(v gdki.Event) *gdk.Event {
}
return v.(*event).Event
}
func UnwrapEvent(v gdki.Event) *gdk.Event {
switch oo := v.(type) {
case *eventButton:
val := unwrapEventButton(oo)
if val == nil {
return nil
}
return val.Event
case *eventKey:
val := unwrapEventKey(oo)
if val == nil {
return nil
}
return val.Event
case *event:
val := unwrapEvent(oo)
if val == nil {
return nil
}
return val
default:
return nil
}
}
......@@ -6,7 +6,7 @@ import (
)
type pixbuf struct {
*gdk.Pixbuf
internal *gdk.Pixbuf
}
func wrapPixbufSimple(v *gdk.Pixbuf) *pixbuf {
......@@ -24,5 +24,9 @@ func UnwrapPixbuf(v gdki.Pixbuf) *gdk.Pixbuf {
if v == nil {
return nil
}
return v.(*pixbuf).Pixbuf
return v.(*pixbuf).internal
}
func (v *pixbuf) SavePNG(filename string, compression int) error {
return v.internal.SavePNG(filename, compression)
}
......@@ -37,6 +37,10 @@ func (v *pixbufLoader) GetPixbuf() (gdki.Pixbuf, error) {
return wrapPixbuf(v.internal.GetPixbuf())
}
func (v *pixbufLoader) SetSize(width, height int) {
v.internal.SetSize(width, height)
}
func (v *pixbufLoader) Write(b []byte) (int, error) {
return v.internal.Write(b)
}
package gdki
type Pixbuf interface{}
type Pixbuf interface {
SavePNG(string, int) error
}
func AssertPixbuf(_ Pixbuf) {}
......@@ -7,6 +7,7 @@ type PixbufLoader interface {
Close() error
GetPixbuf() (Pixbuf, error)
SetSize(int, int)
Write([]byte) (int, error)
}
......
......@@ -4,4 +4,35 @@ import "github.com/twstrike/gotk3adapter/gtki"
type MockAssistant struct {
MockWindow
}
\ No newline at end of file
}
func (a *MockAssistant) Commit() {
}
func (a *MockAssistant) NextPage() {
}
func (a *MockAssistant) PreviousPage() {
}
func (a *MockAssistant) AppendPage(page gtki.Widget) int {
return 0
}
func (a *MockAssistant) SetPageComplete(page gtki.Widget, complete bool) {
}
func (a *MockAssistant) GetPageComplete(page gtki.Widget) bool {
return true
}
func (a *MockAssistant) GetCurrentPage() int {
return 0
}
func (a *MockAssistant) SetCurrentPage(pageNum int) {
}
func (a *MockAssistant) GetNthPage(pageNum int) (gtki.Widget, error) {
return nil, nil
}
package gtk_mock
import "github.com/twstrike/gotk3adapter/gtki"
import (
"github.com/twstrike/gotk3adapter/gdki"
"github.com/twstrike/gotk3adapter/gtki"
)
type MockMenu struct {
MockMenuShell
......@@ -8,3 +11,6 @@ type MockMenu struct {
func (*MockMenu) PopupAtMouseCursor(v1 gtki.Menu, v2 gtki.MenuItem, v3 int, v4 uint32) {
}
func (*MockMenu) PopupAtPointer(_ gdki.Event) {
}
......@@ -55,6 +55,14 @@ func (*Mock) CssProviderNew() (gtki.CssProvider, error) {
return nil, nil
}
func (*Mock) CssProviderGetDefault() (gtki.CssProvider, error) {
return nil, nil
}
func (*Mock) CssProviderGetNamed(string, string) (gtki.CssProvider, error) {
return nil, nil
}
func (*Mock) EntryNew() (gtki.Entry, error) {
return nil, nil
}
......
......@@ -35,6 +35,9 @@ func (*MockTextBuffer) GetStartIter() gtki.TextIter {
func (*MockTextBuffer) Insert(v1 gtki.TextIter, v2 string) {
}
func (*MockTextBuffer) InsertAtCursor(v1 string) {
}
func (*MockTextBuffer) GetText(gtki.TextIter, gtki.TextIter, bool) string {
return ""
}
......
......@@ -27,3 +27,39 @@ func unwrapAssistant(v gtki.Assistant) *gtk.Assistant {
}
return v.(*assistant).internal
}
func (a *assistant) Commit() {
a.internal.Commit()
}
func (a *assistant) NextPage() {
a.internal.NextPage()
}
func (a *assistant) PreviousPage() {
a.internal.PreviousPage()
}
func (a *assistant) AppendPage(page gtki.Widget) int {
return a.internal.AppendPage(unwrapWidget(page))
}
func (a *assistant) SetPageComplete(page gtki.Widget, complete bool) {
a.internal.SetPageComplete(unwrapWidget(page), complete)
}
func (a *assistant) GetPageComplete(page gtki.Widget) bool {
return a.internal.GetPageComplete(unwrapWidget(page))
}
func (a *assistant) GetCurrentPage() int {
return a.internal.GetCurrentPage()
}
func (a *assistant) SetCurrentPage(pageNum int) {
a.internal.SetCurrentPage(pageNum)
}
func (a *assistant) GetNthPage(pageNum int) (gtki.Widget, error) {
return wrapWidget(a.internal.GetNthPage(pageNum))
}
......@@ -2,6 +2,8 @@ package gtka
import (
"github.com/gotk3/gotk3/gtk"
"github.com/twstrike/gotk3adapter/gdka"
"github.com/twstrike/gotk3adapter/gdki"
"github.com/twstrike/gotk3adapter/gtki"
)
......@@ -38,3 +40,7 @@ func unwrapMenuToIMenu(v gtki.Menu) gtk.IMenu {
func (v *menu) PopupAtMouseCursor(v1 gtki.Menu, v2 gtki.MenuItem, v3 int, v4 uint32) {
v.internal.PopupAtMouseCursor(unwrapMenuToIMenu(v1), unwrapMenuItemToIMenuItem(v2), v3, v4)
}
func (v *menu) PopupAtPointer(v1 gdki.Event) {
v.internal.PopupAtPointer(gdka.UnwrapEvent(v1))
}
......@@ -62,6 +62,14 @@ func (*RealGtk) CssProviderNew() (gtki.CssProvider, error) {
return wrapCssProvider(gtk.CssProviderNew())
}
func (*RealGtk) CssProviderGetDefault() (gtki.CssProvider, error) {
return wrapCssProvider(gtk.CssProviderGetDefault())
}
func (*RealGtk) CssProviderGetNamed(name, variant string) (gtki.CssProvider, error) {
return wrapCssProvider(gtk.CssProviderGetNamed(name, variant))
}
func (*RealGtk) EntryNew() (gtki.Entry, error) {
return wrapEntry(gtk.EntryNew())
}
......
......@@ -57,6 +57,10 @@ func (v *textBuffer) Insert(v1 gtki.TextIter, v2 string) {
v.internal.Insert(unwrapTextIter(v1), v2)
}
func (v *textBuffer) InsertAtCursor(v1 string) {
v.internal.InsertAtCursor(v1)
}
func (v *textBuffer) GetText(v1, v2 gtki.TextIter, v3 bool) string {
vx1, _ := v.internal.GetText(unwrapTextIter(v1), unwrapTextIter(v2), v3)
return vx1
......
......@@ -2,26 +2,26 @@ package gtki
type Assistant interface {
Window
// GetCurrentPage() int
// SetCurrentPage(pageNum int)
GetCurrentPage() int
SetCurrentPage(pageNum int)
// GetNPages() int
// GetNthPage(pageNum int) (*Widget, error)
GetNthPage(pageNum int) (Widget, error)
// PrependPage(page Widget) int
// AppendPage(page Widget) int
AppendPage(page Widget) int
// InsertPage(page Widget, position int) int
// RemovePage(pageNum int)
// SetPageType(page Widget, ptype gtk.AssistantPageType)
// GetPageType(page Widget) gtk.AssistantPageType
// SetPageTitle(page Widget, title string)
// GetPageTitle(page Widget) string
// SetPageComplete(page Widget, complete bool)
// GetPageComplete(page Widget) bool
SetPageComplete(page Widget, complete bool)
GetPageComplete(page Widget) bool
// AddActionWidget(child Widget)
// RemoveActionWidget(child Widget)
// UpdateButtonsState()
// Commit()
// NextPage()
// PreviousPage()
Commit()
NextPage()
PreviousPage()
}
func AssertAssistant(_ Assistant) {}
......@@ -18,6 +18,8 @@ type Gtk interface {
CheckButtonNewWithMnemonic(string) (CheckButton, error)
CheckMenuItemNewWithMnemonic(string) (CheckMenuItem, error)
CssProviderNew() (CssProvider, error)
CssProviderGetDefault() (CssProvider, error)
CssProviderGetNamed(string, string) (CssProvider, error)
EntryNew() (Entry, error)
FileChooserDialogNewWith2Buttons(string, Window, FileChooserAction, string, ResponseType, string, ResponseType) (FileChooserDialog, error)
Init(*[]string)
......
package gtki
import "github.com/twstrike/gotk3adapter/gdki"
type Menu interface {
MenuShell
PopupAtMouseCursor(Menu, MenuItem, int, uint32)
PopupAtPointer(gdki.Event)
}
func AssertMenu(_ Menu) {}
......@@ -16,6 +16,7 @@ type TextBuffer interface {
GetStartIter() TextIter
GetText(TextIter, TextIter, bool) string
Insert(TextIter, string)
InsertAtCursor(string)
}
func AssertTextBuffer(_ TextBuffer) {}
......@@ -7,4 +7,10 @@ import (
func init() {
pangoi.PANGO_SCALE = pango.PANGO_SCALE
pangoi.UNDERLINE_NONE = int(pango.UNDERLINE_NONE)
pangoi.UNDERLINE_SINGLE = int(pango.UNDERLINE_SINGLE)
pangoi.UNDERLINE_DOUBLE = int(pango.UNDERLINE_DOUBLE)
pangoi.UNDERLINE_LOW = int(pango.UNDERLINE_LOW)
pangoi.UNDERLINE_ERROR = int(pango.UNDERLINE_ERROR)
}
......@@ -3,3 +3,11 @@ package pangoi
var (
PANGO_SCALE int
)
var (
UNDERLINE_NONE int
UNDERLINE_SINGLE int
UNDERLINE_DOUBLE int
UNDERLINE_LOW int
UNDERLINE_ERROR int
)
Copyright (c) 2013-2014 Conformal Systems LLC.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package cairo
// #cgo pkg-config: cairo cairo-gobject
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"unsafe"
)
// Antialias is a representation of Cairo's cairo_antialias_t.
type Antialias int
const (
ANTIALIAS_DEFAULT Antialias = C.CAIRO_ANTIALIAS_DEFAULT
ANTIALIAS_NONE Antialias = C.CAIRO_ANTIALIAS_NONE
ANTIALIAS_GRAY Antialias = C.CAIRO_ANTIALIAS_GRAY
ANTIALIAS_SUBPIXEL Antialias = C.CAIRO_ANTIALIAS_SUBPIXEL
// ANTIALIAS_FAST Antialias = C.CAIRO_ANTIALIAS_FAST (since 1.12)
// ANTIALIAS_GOOD Antialias = C.CAIRO_ANTIALIAS_GOOD (since 1.12)
// ANTIALIAS_BEST Antialias = C.CAIRO_ANTIALIAS_BEST (since 1.12)
)
func marshalAntialias(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return Antialias(c), nil
}
// Copyright (c) 2013-2014 Conformal Systems <info@conformal.com>
//
// This file originated from: http://opensource.conformal.com/
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
// Package cairo implements Go bindings for Cairo. Supports version 1.10 and
// later.
package cairo
// #cgo pkg-config: cairo cairo-gobject
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"unsafe"
"github.com/gotk3/gotk3/glib"
)
func init() {
tm := []glib.TypeMarshaler{
// Enums
{glib.Type(C.cairo_gobject_antialias_get_type()), marshalAntialias},
{glib.Type(C.cairo_gobject_content_get_type()), marshalContent},
{glib.Type(C.cairo_gobject_fill_rule_get_type()), marshalFillRule},
{glib.Type(C.cairo_gobject_line_cap_get_type()), marshalLineCap},
{glib.Type(C.cairo_gobject_line_join_get_type()), marshalLineJoin},
{glib.Type(C.cairo_gobject_operator_get_type()), marshalOperator},
{glib.Type(C.cairo_gobject_status_get_type()), marshalStatus},
{glib.Type(C.cairo_gobject_surface_type_get_type()), marshalSurfaceType},
// Boxed
{glib.Type(C.cairo_gobject_context_get_type()), marshalContext},
{glib.Type(C.cairo_gobject_surface_get_type()), marshalSurface},
}
glib.RegisterGValueMarshalers(tm)
}
// Constants
// Content is a representation of Cairo's cairo_content_t.
type Content int
const (
CONTENT_COLOR Content = C.CAIRO_CONTENT_COLOR
CONTENT_ALPHA Content = C.CAIRO_CONTENT_ALPHA
CONTENT_COLOR_ALPHA Content = C.CAIRO_CONTENT_COLOR_ALPHA
)
func marshalContent(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return Content(c), nil
}
package cairo
// #cgo pkg-config: cairo cairo-gobject
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"reflect"
"runtime"
"unsafe"
)
// Context is a representation of Cairo's cairo_t.
type Context struct {
context *C.cairo_t
}
// native returns a pointer to the underlying cairo_t.
func (v *Context) native() *C.cairo_t {
if v == nil {
return nil
}
return v.context
}
func (v *Context) GetCContext() *C.cairo_t {
return v.native()
}
// Native returns a pointer to the underlying cairo_t.
func (v *Context) Native() uintptr {
return uintptr(unsafe.Pointer(v.native()))
}
func marshalContext(p uintptr) (interface{}, error) {
c := C.g_value_get_boxed((*C.GValue)(unsafe.Pointer(p)))
context := (*C.cairo_t)(unsafe.Pointer(c))
return wrapContext(context), nil
}
func wrapContext(context *C.cairo_t) *Context {
return &Context{context}
}
// Create is a wrapper around cairo_create().
func Create(target *Surface) *Context {
c := C.cairo_create(target.native())
ctx := wrapContext(c)
runtime.SetFinalizer(ctx, (*Context).destroy)
return ctx
}
// reference is a wrapper around cairo_reference().
func (v *Context) reference() {
v.context = C.cairo_reference(v.native())
}
// destroy is a wrapper around cairo_destroy().
func (v *Context) destroy() {
C.cairo_destroy(v.native())
}
// Status is a wrapper around cairo_status().
func (v *Context) Status() Status {
c := C.cairo_status(v.native())
return Status(c)
}
// Save is a wrapper around cairo_save().
func (v *Context) Save() {
C.cairo_save(v.native())
}
// Restore is a wrapper around cairo_restore().
func (v *Context) Restore() {
C.cairo_restore(v.native())
}
// GetTarget is a wrapper around cairo_get_target().
func (v *Context) GetTarget() *Surface {
c := C.cairo_get_target(v.native())
s := wrapSurface(c)
s.reference()
runtime.SetFinalizer(s, (*Surface).destroy)
return s
}
// PushGroup is a wrapper around cairo_push_group().
func (v *Context) PushGroup() {
C.cairo_push_group(v.native())
}
// PushGroupWithContent is a wrapper around cairo_push_group_with_content().
func (v *Context) PushGroupWithContent(content Content) {
C.cairo_push_group_with_content(v.native(), C.cairo_content_t(content))
}
// TODO(jrick) PopGroup (depends on Pattern)
// PopGroupToSource is a wrapper around cairo_pop_group_to_source().
func (v *Context) PopGroupToSource() {
C.cairo_pop_group_to_source(v.native())
}
// GetGroupTarget is a wrapper around cairo_get_group_target().
func (v *Context) GetGroupTarget() *Surface {
c := C.cairo_get_group_target(v.native())
s := wrapSurface(c)
s.reference()
runtime.SetFinalizer(s, (*Surface).destroy)
return s
}
// SetSourceRGB is a wrapper around cairo_set_source_rgb().
func (v *Context) SetSourceRGB(red, green, blue float64) {
C.cairo_set_source_rgb(v.native(), C.double(red), C.double(green),
C.double(blue))
}
// SetSourceRGBA is a wrapper around cairo_set_source_rgba().
func (v *Context) SetSourceRGBA(red, green, blue, alpha float64) {
C.cairo_set_source_rgba(v.native(), C.double(red), C.double(green),
C.double(blue), C.double(alpha))
}
// TODO(jrick) SetSource (depends on Pattern)
// SetSourceSurface is a wrapper around cairo_set_source_surface().
func (v *Context) SetSourceSurface(surface *Surface, x, y float64) {
C.cairo_set_source_surface(v.native(), surface.native(), C.double(x),
C.double(y))
}
// TODO(jrick) GetSource (depends on Pattern)
// SetAntialias is a wrapper around cairo_set_antialias().