cutego/gui/qscreen.go

209 lines
5.1 KiB
Go
Raw Normal View History

2015-10-24 18:18:24 +03:00
package gui
//#include "qscreen.h"
import "C"
import (
"github.com/therecipe/qt"
"github.com/therecipe/qt/core"
"unsafe"
)
type QScreen struct {
core.QObject
}
2015-11-09 20:23:42 +03:00
type QScreen_ITF interface {
core.QObject_ITF
QScreen_PTR() *QScreen
2015-10-24 18:18:24 +03:00
}
2015-11-09 20:23:42 +03:00
func PointerFromQScreen(ptr QScreen_ITF) unsafe.Pointer {
2015-10-24 18:18:24 +03:00
if ptr != nil {
2015-11-09 20:23:42 +03:00
return ptr.QScreen_PTR().Pointer()
2015-10-24 18:18:24 +03:00
}
return nil
}
2015-11-09 20:23:42 +03:00
func NewQScreenFromPointer(ptr unsafe.Pointer) *QScreen {
2015-10-24 18:18:24 +03:00
var n = new(QScreen)
n.SetPointer(ptr)
2015-11-09 20:23:42 +03:00
if len(n.ObjectName()) == 0 {
2015-10-24 18:18:24 +03:00
n.SetObjectName("QScreen_" + qt.RandomIdentifier())
}
return n
}
2015-11-09 20:23:42 +03:00
func (ptr *QScreen) QScreen_PTR() *QScreen {
2015-10-24 18:18:24 +03:00
return ptr
}
func (ptr *QScreen) Depth() int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QScreen_Depth(ptr.Pointer()))
}
return 0
}
func (ptr *QScreen) DevicePixelRatio() float64 {
if ptr.Pointer() != nil {
return float64(C.QScreen_DevicePixelRatio(ptr.Pointer()))
}
return 0
}
func (ptr *QScreen) LogicalDotsPerInch() float64 {
if ptr.Pointer() != nil {
return float64(C.QScreen_LogicalDotsPerInch(ptr.Pointer()))
}
return 0
}
func (ptr *QScreen) LogicalDotsPerInchX() float64 {
if ptr.Pointer() != nil {
return float64(C.QScreen_LogicalDotsPerInchX(ptr.Pointer()))
}
return 0
}
func (ptr *QScreen) LogicalDotsPerInchY() float64 {
if ptr.Pointer() != nil {
return float64(C.QScreen_LogicalDotsPerInchY(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QScreen) Name() string {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.GoString(C.QScreen_Name(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return ""
}
func (ptr *QScreen) NativeOrientation() core.Qt__ScreenOrientation {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return core.Qt__ScreenOrientation(C.QScreen_NativeOrientation(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QScreen) Orientation() core.Qt__ScreenOrientation {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return core.Qt__ScreenOrientation(C.QScreen_Orientation(ptr.Pointer()))
}
return 0
}
func (ptr *QScreen) PhysicalDotsPerInch() float64 {
if ptr.Pointer() != nil {
return float64(C.QScreen_PhysicalDotsPerInch(ptr.Pointer()))
}
return 0
}
func (ptr *QScreen) PhysicalDotsPerInchX() float64 {
if ptr.Pointer() != nil {
return float64(C.QScreen_PhysicalDotsPerInchX(ptr.Pointer()))
}
return 0
}
func (ptr *QScreen) PhysicalDotsPerInchY() float64 {
if ptr.Pointer() != nil {
return float64(C.QScreen_PhysicalDotsPerInchY(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QScreen) PrimaryOrientation() core.Qt__ScreenOrientation {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return core.Qt__ScreenOrientation(C.QScreen_PrimaryOrientation(ptr.Pointer()))
}
return 0
}
func (ptr *QScreen) RefreshRate() float64 {
if ptr.Pointer() != nil {
return float64(C.QScreen_RefreshRate(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QScreen) AngleBetween(a core.Qt__ScreenOrientation, b core.Qt__ScreenOrientation) int {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return int(C.QScreen_AngleBetween(ptr.Pointer(), C.int(a), C.int(b)))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QScreen) IsLandscape(o core.Qt__ScreenOrientation) bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QScreen_IsLandscape(ptr.Pointer(), C.int(o)) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QScreen) IsPortrait(o core.Qt__ScreenOrientation) bool {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return C.QScreen_IsPortrait(ptr.Pointer(), C.int(o)) != 0
2015-10-24 18:18:24 +03:00
}
return false
}
func (ptr *QScreen) ConnectOrientationChanged(f func(orientation core.Qt__ScreenOrientation)) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QScreen_ConnectOrientationChanged(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.ConnectSignal(ptr.ObjectName(), "orientationChanged", f)
}
}
func (ptr *QScreen) DisconnectOrientationChanged() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QScreen_DisconnectOrientationChanged(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.DisconnectSignal(ptr.ObjectName(), "orientationChanged")
}
}
//export callbackQScreenOrientationChanged
func callbackQScreenOrientationChanged(ptrName *C.char, orientation C.int) {
qt.GetSignal(C.GoString(ptrName), "orientationChanged").(func(core.Qt__ScreenOrientation))(core.Qt__ScreenOrientation(orientation))
}
func (ptr *QScreen) OrientationUpdateMask() core.Qt__ScreenOrientation {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
return core.Qt__ScreenOrientation(C.QScreen_OrientationUpdateMask(ptr.Pointer()))
2015-10-24 18:18:24 +03:00
}
return 0
}
func (ptr *QScreen) ConnectPrimaryOrientationChanged(f func(orientation core.Qt__ScreenOrientation)) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QScreen_ConnectPrimaryOrientationChanged(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.ConnectSignal(ptr.ObjectName(), "primaryOrientationChanged", f)
}
}
func (ptr *QScreen) DisconnectPrimaryOrientationChanged() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QScreen_DisconnectPrimaryOrientationChanged(ptr.Pointer())
2015-10-24 18:18:24 +03:00
qt.DisconnectSignal(ptr.ObjectName(), "primaryOrientationChanged")
}
}
//export callbackQScreenPrimaryOrientationChanged
func callbackQScreenPrimaryOrientationChanged(ptrName *C.char, orientation C.int) {
qt.GetSignal(C.GoString(ptrName), "primaryOrientationChanged").(func(core.Qt__ScreenOrientation))(core.Qt__ScreenOrientation(orientation))
}
func (ptr *QScreen) SetOrientationUpdateMask(mask core.Qt__ScreenOrientation) {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QScreen_SetOrientationUpdateMask(ptr.Pointer(), C.int(mask))
2015-10-24 18:18:24 +03:00
}
}
func (ptr *QScreen) DestroyQScreen() {
if ptr.Pointer() != nil {
2015-11-09 20:23:42 +03:00
C.QScreen_DestroyQScreen(ptr.Pointer())
2015-10-24 18:18:24 +03:00
ptr.SetPointer(nil)
}
}