Commit ce5a5cb4 authored by Sascha Steinbiss's avatar Sascha Steinbiss

New upstream version 0.0~git20170505.0.901a95d

parent 1ccdd320
# 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
}
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.
type Format int
const (
FORMAT_INVALID Format = C.CAIRO_FORMAT_INVALID
FORMAT_ARGB32 Format = C.CAIRO_FORMAT_ARGB32
FORMAT_RGB24 Format = C.CAIRO_FORMAT_RGB24
FORMAT_A8 Format = C.CAIRO_FORMAT_A8
FORMAT_A1 Format = C.CAIRO_FORMAT_A1
FORMAT_RGB16_565 Format = C.CAIRO_FORMAT_RGB16_565
FORMAT_RGB30 Format = C.CAIRO_FORMAT_RGB30
)
func marshalFormat(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return Format(c), nil
}
package cairo
// #cgo pkg-config: cairo cairo-gobject
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"unsafe"
)
// LineCap is a representation of Cairo's cairo_line_cap_t.
type LineCap int
const (
LINE_CAP_BUTT LineCap = C.CAIRO_LINE_CAP_BUTT
LINE_CAP_ROUND LineCap = C.CAIRO_LINE_CAP_ROUND
LINE_CAP_SQUARE LineCap = C.CAIRO_LINE_CAP_SQUARE
)
func marshalLineCap(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return LineCap(c), nil
}
package cairo
// #cgo pkg-config: cairo cairo-gobject
// #include <stdlib.h>
// #include <cairo.h>
// #include <cairo-gobject.h>
import "C"
import (
"unsafe"
)
// LineJoin is a representation of Cairo's cairo_line_join_t.
type LineJoin int
const (
LINE_JOIN_MITER LineJoin = C.CAIRO_LINE_JOIN_MITER
LINE_JOIN_ROUND LineJoin = C.CAIRO_LINE_JOIN_ROUND
LINE_JOIN_BEVEL LineJoin = C.CAIRO_LINE_JOIN_BEVEL
)
func marshalLineJoin(p uintptr) (interface{}, error) {
c := C.g_value_get_enum((*C.GValue)(unsafe.Pointer(p)))
return LineJoin(c), nil
}
package cairo
// MimeType is a representation of Cairo's CAIRO_MIME_TYPE_*
// preprocessor constants.
type MimeType string
const (
MIME_TYPE_JP2 MimeType = "image/jp2"
MIME_TYPE_JPEG MimeType = "image/jpeg"
MIME_TYPE_PNG MimeType = "image/png"
MIME_TYPE_URI MimeType = "image/x-uri"
MIME_TYPE_UNIQUE_ID MimeType = "application/x-cairo.uuid"
)