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
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QGradient struct {
|
|
|
|
ptr unsafe.Pointer
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
type QGradient_ITF interface {
|
|
|
|
QGradient_PTR() *QGradient
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (p *QGradient) Pointer() unsafe.Pointer {
|
|
|
|
return p.ptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *QGradient) SetPointer(ptr unsafe.Pointer) {
|
|
|
|
p.ptr = ptr
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func PointerFromQGradient(ptr QGradient_ITF) unsafe.Pointer {
|
2015-10-24 18:18:24 +03:00
|
|
|
if ptr != nil {
|
2015-11-09 20:23:42 +03:00
|
|
|
return ptr.QGradient_PTR().Pointer()
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func NewQGradientFromPointer(ptr unsafe.Pointer) *QGradient {
|
2015-10-24 18:18:24 +03:00
|
|
|
var n = new(QGradient)
|
|
|
|
n.SetPointer(ptr)
|
|
|
|
return n
|
|
|
|
}
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func (ptr *QGradient) QGradient_PTR() *QGradient {
|
2015-10-24 18:18:24 +03:00
|
|
|
return ptr
|
|
|
|
}
|
|
|
|
|
|
|
|
//QGradient::CoordinateMode
|
2015-11-09 20:23:42 +03:00
|
|
|
type QGradient__CoordinateMode int64
|
2015-10-24 18:18:24 +03:00
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
const (
|
2015-10-24 18:18:24 +03:00
|
|
|
QGradient__LogicalMode = QGradient__CoordinateMode(0)
|
|
|
|
QGradient__StretchToDeviceMode = QGradient__CoordinateMode(1)
|
|
|
|
QGradient__ObjectBoundingMode = QGradient__CoordinateMode(2)
|
|
|
|
)
|
|
|
|
|
|
|
|
//QGradient::Spread
|
2015-11-09 20:23:42 +03:00
|
|
|
type QGradient__Spread int64
|
2015-10-24 18:18:24 +03:00
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
const (
|
2015-10-24 18:18:24 +03:00
|
|
|
QGradient__PadSpread = QGradient__Spread(0)
|
|
|
|
QGradient__ReflectSpread = QGradient__Spread(1)
|
|
|
|
QGradient__RepeatSpread = QGradient__Spread(2)
|
|
|
|
)
|
|
|
|
|
|
|
|
//QGradient::Type
|
2015-11-09 20:23:42 +03:00
|
|
|
type QGradient__Type int64
|
2015-10-24 18:18:24 +03:00
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
const (
|
2015-10-24 18:18:24 +03:00
|
|
|
QGradient__LinearGradient = QGradient__Type(0)
|
|
|
|
QGradient__RadialGradient = QGradient__Type(1)
|
|
|
|
QGradient__ConicalGradient = QGradient__Type(2)
|
|
|
|
QGradient__NoGradient = QGradient__Type(3)
|
|
|
|
)
|
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
func (ptr *QGradient) SetColorAt(position float64, color QColor_ITF) {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QGradient::setColorAt")
|
2015-12-06 02:56:16 +03:00
|
|
|
|
2015-11-09 20:23:42 +03:00
|
|
|
if ptr.Pointer() != nil {
|
|
|
|
C.QGradient_SetColorAt(ptr.Pointer(), C.double(position), PointerFromQColor(color))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-10-24 18:18:24 +03:00
|
|
|
func (ptr *QGradient) CoordinateMode() QGradient__CoordinateMode {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QGradient::coordinateMode")
|
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 QGradient__CoordinateMode(C.QGradient_CoordinateMode(ptr.Pointer()))
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ptr *QGradient) SetCoordinateMode(mode QGradient__CoordinateMode) {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QGradient::setCoordinateMode")
|
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.QGradient_SetCoordinateMode(ptr.Pointer(), C.int(mode))
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ptr *QGradient) SetSpread(method QGradient__Spread) {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QGradient::setSpread")
|
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.QGradient_SetSpread(ptr.Pointer(), C.int(method))
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ptr *QGradient) Spread() QGradient__Spread {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QGradient::spread")
|
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 QGradient__Spread(C.QGradient_Spread(ptr.Pointer()))
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (ptr *QGradient) Type() QGradient__Type {
|
2015-12-15 04:01:51 +03:00
|
|
|
defer qt.Recovering("QGradient::type")
|
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 QGradient__Type(C.QGradient_Type(ptr.Pointer()))
|
2015-10-24 18:18:24 +03:00
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|