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 ...@@ -2,3 +2,7 @@ package gdk_mock
type MockPixbuf struct { type MockPixbuf struct {
} }
func (*MockPixbuf) SavePNG(string, int) error {
return nil
}
...@@ -17,6 +17,9 @@ func (*MockPixbufLoader) GetPixbuf() (gdki.Pixbuf, error) { ...@@ -17,6 +17,9 @@ func (*MockPixbufLoader) GetPixbuf() (gdki.Pixbuf, error) {
return nil, nil return nil, nil
} }
func (*MockPixbufLoader) SetSize(int, int) {
}
func (*MockPixbufLoader) Write(b []byte) (int, error) { func (*MockPixbufLoader) Write(b []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -26,3 +26,28 @@ func unwrapEvent(v gdki.Event) *gdk.Event { ...@@ -26,3 +26,28 @@ func unwrapEvent(v gdki.Event) *gdk.Event {
} }
return v.(*event).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 ( ...@@ -6,7 +6,7 @@ import (
) )
type pixbuf struct { type pixbuf struct {
*gdk.Pixbuf internal *gdk.Pixbuf
} }
func wrapPixbufSimple(v *gdk.Pixbuf) *pixbuf { func wrapPixbufSimple(v *gdk.Pixbuf) *pixbuf {
...@@ -24,5 +24,9 @@ func UnwrapPixbuf(v gdki.Pixbuf) *gdk.Pixbuf { ...@@ -24,5 +24,9 @@ func UnwrapPixbuf(v gdki.Pixbuf) *gdk.Pixbuf {
if v == nil { if v == nil {
return 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) { ...@@ -37,6 +37,10 @@ func (v *pixbufLoader) GetPixbuf() (gdki.Pixbuf, error) {
return wrapPixbuf(v.internal.GetPixbuf()) 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) { func (v *pixbufLoader) Write(b []byte) (int, error) {
return v.internal.Write(b) return v.internal.Write(b)
} }
package gdki package gdki
type Pixbuf interface{} type Pixbuf interface {
SavePNG(string, int) error
}
func AssertPixbuf(_ Pixbuf) {} func AssertPixbuf(_ Pixbuf) {}
...@@ -7,6 +7,7 @@ type PixbufLoader interface { ...@@ -7,6 +7,7 @@ type PixbufLoader interface {
Close() error Close() error
GetPixbuf() (Pixbuf, error) GetPixbuf() (Pixbuf, error)
SetSize(int, int)
Write([]byte) (int, error) Write([]byte) (int, error)
} }
......
...@@ -4,4 +4,35 @@ import "github.com/twstrike/gotk3adapter/gtki" ...@@ -4,4 +4,35 @@ import "github.com/twstrike/gotk3adapter/gtki"
type MockAssistant struct { type MockAssistant struct {
MockWindow 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 package gtk_mock
import "github.com/twstrike/gotk3adapter/gtki" import (
"github.com/twstrike/gotk3adapter/gdki"
"github.com/twstrike/gotk3adapter/gtki"
)
type MockMenu struct { type MockMenu struct {
MockMenuShell MockMenuShell
...@@ -8,3 +11,6 @@ type MockMenu struct { ...@@ -8,3 +11,6 @@ type MockMenu struct {
func (*MockMenu) PopupAtMouseCursor(v1 gtki.Menu, v2 gtki.MenuItem, v3 int, v4 uint32) { 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) { ...@@ -55,6 +55,14 @@ func (*Mock) CssProviderNew() (gtki.CssProvider, error) {
return nil, nil 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) { func (*Mock) EntryNew() (gtki.Entry, error) {
return nil, nil return nil, nil
} }
......
...@@ -35,6 +35,9 @@ func (*MockTextBuffer) GetStartIter() gtki.TextIter { ...@@ -35,6 +35,9 @@ func (*MockTextBuffer) GetStartIter() gtki.TextIter {
func (*MockTextBuffer) Insert(v1 gtki.TextIter, v2 string) { func (*MockTextBuffer) Insert(v1 gtki.TextIter, v2 string) {
} }
func (*MockTextBuffer) InsertAtCursor(v1 string) {
}
func (*MockTextBuffer) GetText(gtki.TextIter, gtki.TextIter, bool) string { func (*MockTextBuffer) GetText(gtki.TextIter, gtki.TextIter, bool) string {
return "" return ""
} }
......
...@@ -27,3 +27,39 @@ func unwrapAssistant(v gtki.Assistant) *gtk.Assistant { ...@@ -27,3 +27,39 @@ func unwrapAssistant(v gtki.Assistant) *gtk.Assistant {
} }
return v.(*assistant).internal 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 ...@@ -2,6 +2,8 @@ package gtka
import ( import (
"github.com/gotk3/gotk3/gtk" "github.com/gotk3/gotk3/gtk"
"github.com/twstrike/gotk3adapter/gdka"
"github.com/twstrike/gotk3adapter/gdki"
"github.com/twstrike/gotk3adapter/gtki" "github.com/twstrike/gotk3adapter/gtki"
) )
...@@ -38,3 +40,7 @@ func unwrapMenuToIMenu(v gtki.Menu) gtk.IMenu { ...@@ -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) { func (v *menu) PopupAtMouseCursor(v1 gtki.Menu, v2 gtki.MenuItem, v3 int, v4 uint32) {
v.internal.PopupAtMouseCursor(unwrapMenuToIMenu(v1), unwrapMenuItemToIMenuItem(v2), v3, v4) 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) { ...@@ -62,6 +62,14 @@ func (*RealGtk) CssProviderNew() (gtki.CssProvider, error) {
return wrapCssProvider(gtk.CssProviderNew()) 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) { func (*RealGtk) EntryNew() (gtki.Entry, error) {
return wrapEntry(gtk.EntryNew()) return wrapEntry(gtk.EntryNew())
} }
......
...@@ -57,6 +57,10 @@ func (v *textBuffer) Insert(v1 gtki.TextIter, v2 string) { ...@@ -57,6 +57,10 @@ func (v *textBuffer) Insert(v1 gtki.TextIter, v2 string) {
v.internal.Insert(unwrapTextIter(v1), v2) 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 { func (v *textBuffer) GetText(v1, v2 gtki.TextIter, v3 bool) string {
vx1, _ := v.internal.GetText(unwrapTextIter(v1), unwrapTextIter(v2), v3) vx1, _ := v.internal.GetText(unwrapTextIter(v1), unwrapTextIter(v2), v3)
return vx1 return vx1
......
...@@ -2,26 +2,26 @@ package gtki ...@@ -2,26 +2,26 @@ package gtki
type Assistant interface { type Assistant interface {
Window Window
// GetCurrentPage() int GetCurrentPage() int
// SetCurrentPage(pageNum int) SetCurrentPage(pageNum int)
// GetNPages() int // GetNPages() int
// GetNthPage(pageNum int) (*Widget, error) GetNthPage(pageNum int) (Widget, error)
// PrependPage(page Widget) int // PrependPage(page Widget) int
// AppendPage(page Widget) int AppendPage(page Widget) int
// InsertPage(page Widget, position int) int // InsertPage(page Widget, position int) int
// RemovePage(pageNum int) // RemovePage(pageNum int)
// SetPageType(page Widget, ptype gtk.AssistantPageType) // SetPageType(page Widget, ptype gtk.AssistantPageType)
// GetPageType(page Widget) gtk.AssistantPageType // GetPageType(page Widget) gtk.AssistantPageType
// SetPageTitle(page Widget, title string) // SetPageTitle(page Widget, title string)
// GetPageTitle(page Widget) string // GetPageTitle(page Widget) string
// SetPageComplete(page Widget, complete bool) SetPageComplete(page Widget, complete bool)
// GetPageComplete(page Widget) bool GetPageComplete(page Widget) bool
// AddActionWidget(child Widget) // AddActionWidget(child Widget)
// RemoveActionWidget(child Widget) // RemoveActionWidget(child Widget)
// UpdateButtonsState() // UpdateButtonsState()
// Commit() Commit()
// NextPage() NextPage()
// PreviousPage() PreviousPage()
} }
func AssertAssistant(_ Assistant) {} func AssertAssistant(_ Assistant) {}
...@@ -18,6 +18,8 @@ type Gtk interface { ...@@ -18,6 +18,8 @@ type Gtk interface {
CheckButtonNewWithMnemonic(string) (CheckButton, error) CheckButtonNewWithMnemonic(string) (CheckButton, error)
CheckMenuItemNewWithMnemonic(string) (CheckMenuItem, error) CheckMenuItemNewWithMnemonic(string) (CheckMenuItem, error)
CssProviderNew() (CssProvider, error) CssProviderNew() (CssProvider, error)
CssProviderGetDefault() (CssProvider, error)
CssProviderGetNamed(string, string) (CssProvider, error)
EntryNew() (Entry, error) EntryNew() (Entry, error)
FileChooserDialogNewWith2Buttons(string, Window, FileChooserAction, string, ResponseType, string, ResponseType) (FileChooserDialog, error) FileChooserDialogNewWith2Buttons(string, Window, FileChooserAction, string, ResponseType, string, ResponseType) (FileChooserDialog, error)
Init(*[]string) Init(*[]string)
......
package gtki package gtki
import "github.com/twstrike/gotk3adapter/gdki"
type Menu interface { type Menu interface {
MenuShell MenuShell
PopupAtMouseCursor(Menu, MenuItem, int, uint32) PopupAtMouseCursor(Menu, MenuItem, int, uint32)
PopupAtPointer(gdki.Event)
} }
func AssertMenu(_ Menu) {} func AssertMenu(_ Menu) {}
...@@ -16,6 +16,7 @@ type TextBuffer interface { ...@@ -16,6 +16,7 @@ type TextBuffer interface {
GetStartIter() TextIter GetStartIter() TextIter
GetText(TextIter, TextIter, bool) string GetText(TextIter, TextIter, bool) string
Insert(TextIter, string) Insert(TextIter, string)
InsertAtCursor(string)
} }
func AssertTextBuffer(_ TextBuffer) {} func AssertTextBuffer(_ TextBuffer) {}
...@@ -7,4 +7,10 @@ import ( ...@@ -7,4 +7,10 @@ import (
func init() { func init() {
pangoi.PANGO_SCALE = pango.PANGO_SCALE 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 ...@@ -3,3 +3,11 @@ package pangoi
var ( var (
PANGO_SCALE int 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
}
This diff is collapsed.
package cairo
type ErrorStatus Status
func (e ErrorStatus) Error() string {
return StatusToString(Status(e))
}
package cairo
// #cgo pkg-config: cairo cairo-gobject
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"unsafe"
)
// FillRule is a representation of Cairo's cairo_fill_rule_t.
type FillRule int
const (
FILL_RULE_WINDING FillRule = C.CAIRO_FILL_RULE_WINDING
FILL_RULE_EVEN_ODD FillRule = C.CAIRO_FILL_RULE_EVEN_ODD
)
func marshalFillRule(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return FillRule(c), nil
}
package cairo
// #cgo pkg-config: cairo cairo-gobject
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"unsafe"
)
// Format is a representation of Cairo's cairo_format_t.