2015-10-24 18:18:24 +03:00
|
|
|
package gui
|
|
|
|
|
2015-12-06 02:56:16 +03:00
|
|
|
//#include "gui.h"
|
2015-10-24 18:18:24 +03:00
|
|
|
import "C"
|
|
|
|
import (
|
2015-12-15 04:01:51 +03:00
|
|
|
"github.com/therecipe/qt"
|
2015-10-24 18:18:24 +03:00
|
|
|
"github.com/therecipe/qt/core"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QPicture struct {
|
|
|
|
QPaintDevice
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
type QPicture_ITF interface {
|
|
|
|
QPaintDevice_ITF
|
|
|
|
QPicture_PTR() *QPicture
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func PointerFromQPicture(ptr QPicture_ITF) unsafe.Pointer {
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
return ptr.QPicture_PTR().Pointer()
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func NewQPictureFromPointer(ptr unsafe.Pointer) *QPicture {
|
2015-10-24 18:18:24 +03:00
|
|
|
var n = new(QPicture)
|
|
|
|
n.SetPointer(ptr)
|
2015-12-15 04:01:51 +03:00
|
|
|
for len(n.ObjectNameAbs()) < len("QPicture_") {
|
|
|
|
n.SetObjectNameAbs("QPicture_" + qt.Identifier())
|
|
|
|
}
|
2015-10-24 18:18:24 +03:00
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func (ptr *QPicture) QPicture_PTR() *QPicture {
|
2015-10-24 18:18:24 +03:00
|
|
|
return ptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ptr *QPicture) IsNull() bool {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QPicture::isNull")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr.Pointer() != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
return C.QPicture_IsNull(ptr.Pointer()) != 0
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2015-12-16 04:02:59 +03:00
|
|
|
func (ptr *QPicture) BoundingRect() *core.QRect {
|
|
|
|
defer qt.Recovering("QPicture::boundingRect")
|
|
|
|
|
|
|
|
if ptr.Pointer() != nil {
|
|
|
|
return core.NewQRectFromPointer(C.QPicture_BoundingRect(ptr.Pointer()))
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func (ptr *QPicture) Load2(dev core.QIODevice_ITF, format string) bool {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QPicture::load")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr.Pointer() != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
return C.QPicture_Load2(ptr.Pointer(), core.PointerFromQIODevice(dev), C.CString(format)) != 0
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ptr *QPicture) Load(fileName string, format string) bool {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QPicture::load")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr.Pointer() != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
return C.QPicture_Load(ptr.Pointer(), C.CString(fileName), C.CString(format)) != 0
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func (ptr *QPicture) Play(painter QPainter_ITF) bool {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QPicture::play")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr.Pointer() != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
return C.QPicture_Play(ptr.Pointer(), PointerFromQPainter(painter)) != 0
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func (ptr *QPicture) Save2(dev core.QIODevice_ITF, format string) bool {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QPicture::save")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr.Pointer() != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
return C.QPicture_Save2(ptr.Pointer(), core.PointerFromQIODevice(dev), C.CString(format)) != 0
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ptr *QPicture) Save(fileName string, format string) bool {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QPicture::save")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr.Pointer() != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
return C.QPicture_Save(ptr.Pointer(), C.CString(fileName), C.CString(format)) != 0
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func (ptr *QPicture) SetBoundingRect(r core.QRect_ITF) {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QPicture::setBoundingRect")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr.Pointer() != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
C.QPicture_SetBoundingRect(ptr.Pointer(), core.PointerFromQRect(r))
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func (ptr *QPicture) Swap(other QPicture_ITF) {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QPicture::swap")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr.Pointer() != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
C.QPicture_Swap(ptr.Pointer(), PointerFromQPicture(other))
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ptr *QPicture) DestroyQPicture() {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QPicture::~QPicture")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr.Pointer() != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
C.QPicture_DestroyQPicture(ptr.Pointer())
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
}
|
2015-12-15 04:01:51 +03:00
|
|
|
|
|
|
|
func (ptr *QPicture) ObjectNameAbs() string {
|
|
|
|
defer qt.Recovering("QPicture::objectNameAbs")
|
|
|
|
|
|
|
|
if ptr.Pointer() != nil {
|
|
|
|
return C.GoString(C.QPicture_ObjectNameAbs(ptr.Pointer()))
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ptr *QPicture) SetObjectNameAbs(name string) {
|
|
|
|
defer qt.Recovering("QPicture::setObjectNameAbs")
|
|
|
|
|
|
|
|
if ptr.Pointer() != nil {
|
|
|
|
C.QPicture_SetObjectNameAbs(ptr.Pointer(), C.CString(name))
|
|
|
|
}
|
|
|
|
}
|