gdk

package
v0.0.0-...-e0143e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2014 License: ISC Imports: 6 Imported by: 4

Documentation

Overview

Go bindings for GDK 3. Supports version 3.6 and later.

Index

Constants

View Source
const (
	SHIFT_MASK    ModifierType = C.GDK_SHIFT_MASK
	LOCK_MASK                  = C.GDK_LOCK_MASK
	CONTROL_MASK               = C.GDK_CONTROL_MASK
	MOD1_MASK                  = C.GDK_MOD1_MASK
	MOD2_MASK                  = C.GDK_MOD2_MASK
	MOD3_MASK                  = C.GDK_MOD3_MASK
	MOD4_MASK                  = C.GDK_MOD4_MASK
	MOD5_MASK                  = C.GDK_MOD5_MASK
	BUTTON1_MASK               = C.GDK_BUTTON1_MASK
	BUTTON2_MASK               = C.GDK_BUTTON2_MASK
	BUTTON3_MASK               = C.GDK_BUTTON3_MASK
	BUTTON4_MASK               = C.GDK_BUTTON4_MASK
	BUTTON5_MASK               = C.GDK_BUTTON5_MASK
	SUPER_MASK                 = C.GDK_SUPER_MASK
	HYPER_MASK                 = C.GDK_HYPER_MASK
	META_MASK                  = C.GDK_META_MASK
	RELEASE_MASK               = C.GDK_RELEASE_MASK
	MODIFIER_MASK              = C.GDK_MODIFIER_MASK
)

Variables

This section is empty.

Functions

func KeyvalConvertCase

func KeyvalConvertCase(v uint) (lower, upper uint)

func KeyvalFromName

func KeyvalFromName(keyvalName string) uint

KeyvalFromName() is a wrapper around gdk_keyval_from_name().

func KeyvalIsLower

func KeyvalIsLower(v uint) bool

func KeyvalIsUpper

func KeyvalIsUpper(v uint) bool

func KeyvalToLower

func KeyvalToLower(v uint) uint

func KeyvalToUpper

func KeyvalToUpper(v uint) uint

Types

type Atom

type Atom uintptr

Atom is a representation of GDK's GdkAtom.

const (
	SELECTION_PRIMARY       Atom = 1
	SELECTION_SECONDARY     Atom = 2
	SELECTION_CLIPBOARD     Atom = 69
	TARGET_BITMAP           Atom = 5
	TARGET_COLORMAP         Atom = 7
	TARGET_DRAWABLE         Atom = 17
	TARGET_PIXMAP           Atom = 20
	TARGET_STRING           Atom = 31
	SELECTION_TYPE_ATOM     Atom = 4
	SELECTION_TYPE_BITMAP   Atom = 5
	SELECTION_TYPE_COLORMAP Atom = 7
	SELECTION_TYPE_DRAWABLE Atom = 17
	SELECTION_TYPE_INTEGER  Atom = 19
	SELECTION_TYPE_PIXMAP   Atom = 20
	SELECTION_TYPE_WINDOW   Atom = 33
	SELECTION_TYPE_STRING   Atom = 31
)

Selections

func (Atom) Name

func (v Atom) Name() string

type Colorspace

type Colorspace int

Colorspace is a representation of GDK's GdkColorspace.

const (
	COLORSPACE_RGB Colorspace = C.GDK_COLORSPACE_RGB
)

type Device

type Device struct {
	*glib.Object
}

Device is a representation of GDK's GdkDevice.

func (*Device) Native

func (v *Device) Native() uintptr

Native returns a pointer to the underlying GdkDevice.

type DeviceManager

type DeviceManager struct {
	*glib.Object
}

DeviceManager is a representation of GDK's GdkDeviceManager.

func (*DeviceManager) Native

func (v *DeviceManager) Native() uintptr

Native returns a pointer to the underlying GdkDeviceManager.

type Display

type Display struct {
	*glib.Object
}

Display is a representation of GDK's GdkDisplay.

func DisplayGetDefault

func DisplayGetDefault() (*Display, error)

DisplayGetDefault() is a wrapper around gdk_display_get_default().

func DisplayOpen

func DisplayOpen(displayName string) (*Display, error)

DisplayOpen() is a wrapper around gdk_display_open().

func (*Display) Beep

func (v *Display) Beep()

Beep() is a wrapper around gdk_display_beep().

func (*Display) Close

func (v *Display) Close()

Close() is a wrapper around gdk_display_close().

func (*Display) DeviceIsGrabbed

func (v *Display) DeviceIsGrabbed(device *Device) bool

DeviceIsGrabbed() is a wrapper around gdk_display_device_is_grabbed().

func (*Display) Flush

func (v *Display) Flush()

Flush() is a wrapper around gdk_display_flush().

func (*Display) GetAppLaunchContext

func (v *Display) GetAppLaunchContext()

TODO(jrick) glib.AppLaunchContext GdkAppLaunchContext

func (*Display) GetDefaultCursorSize

func (v *Display) GetDefaultCursorSize() uint

GetDefaultCursorSize() is a wrapper around gdk_display_get_default_cursor_size().

func (*Display) GetDefaultGroup

func (v *Display) GetDefaultGroup() (*Window, error)

GetDefaultGroup() is a wrapper around gdk_display_get_default_group().

func (*Display) GetDefaultScreen

func (v *Display) GetDefaultScreen() (*Screen, error)

GetDefaultScreen() is a wrapper around gdk_display_get_default_screen().

func (*Display) GetDeviceManager

func (v *Display) GetDeviceManager() (*DeviceManager, error)

GetDeviceManager() is a wrapper around gdk_display_get_device_manager().

func (*Display) GetEvent

func (v *Display) GetEvent() (*Event, error)

GetEvent() is a wrapper around gdk_display_get_event().

func (*Display) GetMaximalCursorSize

func (v *Display) GetMaximalCursorSize() (width, height uint)

GetMaximalCursorSize() is a wrapper around gdk_display_get_maximal_cursor_size().

func (*Display) GetName

func (v *Display) GetName() (string, error)

GetName() is a wrapper around gdk_display_get_name().

func (*Display) GetScreen

func (v *Display) GetScreen(screenNum int) (*Screen, error)

GetScreen() is a wrapper around gdk_display_get_screen().

func (*Display) HasPending

func (v *Display) HasPending() bool

HasPending() is a wrapper around gdk_display_has_pending().

func (*Display) IsClosed

func (v *Display) IsClosed() bool

IsClosed() is a wrapper around gdk_display_is_closed().

func (*Display) Native

func (v *Display) Native() uintptr

Native returns a pointer to the underlying GdkDisplay.

func (*Display) NotifyStartupComplete

func (v *Display) NotifyStartupComplete(startupID string)

NotifyStartupComplete() is a wrapper around gdk_display_notify_startup_complete().

func (*Display) PeekEvent

func (v *Display) PeekEvent() (*Event, error)

PeekEvent() is a wrapper around gdk_display_peek_event().

func (*Display) PutEvent

func (v *Display) PutEvent(event *Event)

PutEvent() is a wrapper around gdk_display_put_event().

func (*Display) RequestSelectionNotification

func (v *Display) RequestSelectionNotification(selection Atom) bool

RequestSelectionNotification() is a wrapper around gdk_display_request_selection_notification().

func (*Display) SetDoubleClickDistance

func (v *Display) SetDoubleClickDistance(distance uint)

SetDoubleClickDistance() is a wrapper around gdk_display_set_double_click_distance().

func (*Display) SetDoubleClickTime

func (v *Display) SetDoubleClickTime(msec uint)

SetDoubleClickTime() is a wrapper around gdk_display_set_double_click_time().

func (*Display) StoreClipboard

func (v *Display) StoreClipboard(clipboardWindow *Window, time uint32, targets ...Atom)

TODO(jrick)

func (*Display) SupportsClipboardPersistence

func (v *Display) SupportsClipboardPersistence() bool

SupportsClipboardPersistence() is a wrapper around gdk_display_supports_clipboard_persistence().

func (*Display) SupportsColorCursor

func (v *Display) SupportsColorCursor() bool

SupportsColorCursor() is a wrapper around gdk_display_supports_cursor_color().

func (*Display) SupportsComposite

func (v *Display) SupportsComposite() bool

SupportsComposite() is a wrapper around gdk_display_supports_composite().

func (*Display) SupportsCursorAlpha

func (v *Display) SupportsCursorAlpha() bool

SupportsCursorAlpha() is a wrapper around gdk_display_supports_cursor_alpha().

func (*Display) SupportsInputShapes

func (v *Display) SupportsInputShapes() bool

SupportsInputShapes() is a wrapper around gdk_display_supports_input_shapes().

func (*Display) SupportsSelectionNotification

func (v *Display) SupportsSelectionNotification() bool

SupportsSelectionNotification() is a wrapper around gdk_display_supports_selection_notification().

func (*Display) SupportsShapes

func (v *Display) SupportsShapes() bool

SupportsShapes() is a wrapper around gdk_display_supports_shapes().

func (*Display) Sync

func (v *Display) Sync()

Sync() is a wrapper around gdk_display_sync().

type DragAction

type DragAction int

DragAction is a representation of GDK's GdkDragAction.

const (
	ACTION_DEFAULT DragAction = C.GDK_ACTION_DEFAULT
	ACTION_COPY    DragAction = C.GDK_ACTION_COPY
	ACTION_MOVE    DragAction = C.GDK_ACTION_MOVE
	ACTION_LINK    DragAction = C.GDK_ACTION_LINK
	ACTION_PRIVATE DragAction = C.GDK_ACTION_PRIVATE
	ACTION_ASK     DragAction = C.GDK_ACTION_ASK
)

type DragContext

type DragContext struct {
	*glib.Object
}

DragContext is a representation of GDK's GdkDragContext.

func (*DragContext) ListTargets

func (v *DragContext) ListTargets() *glib.List

func (*DragContext) Native

func (v *DragContext) Native() uintptr

Native returns a pointer to the underlying GdkDragContext.

type Event

type Event struct {
	GdkEvent *C.GdkEvent
}

Event is a representation of GDK's GdkEvent.

func (*Event) Native

func (v *Event) Native() uintptr

Native returns a pointer to the underlying GdkEvent.

type EventButton

type EventButton struct {
	*Event
}

EventButton is a representation of GDK's GdkEventButton.

func (*EventButton) Button

func (v *EventButton) Button() uint

func (*EventButton) Native

func (v *EventButton) Native() uintptr

Native returns a pointer to the underlying GdkEventButton.

func (*EventButton) State

func (v *EventButton) State() uint

func (*EventButton) Time

func (v *EventButton) Time() uint32

Time returns the time of the event in milliseconds.

func (*EventButton) Type

func (v *EventButton) Type() EventType

func (*EventButton) X

func (v *EventButton) X() float64

func (*EventButton) XRoot

func (v *EventButton) XRoot() float64

XRoot returns the x coordinate of the pointer relative to the root of the screen.

func (*EventButton) Y

func (v *EventButton) Y() float64

func (*EventButton) YRoot

func (v *EventButton) YRoot() float64

YRoot returns the y coordinate of the pointer relative to the root of the screen.

type EventKey

type EventKey struct {
	*Event
}

EventKey is a representation of GDK's GdkEventKey.

func (*EventKey) KeyVal

func (v *EventKey) KeyVal() uint

func (*EventKey) Native

func (v *EventKey) Native() uintptr

Native returns a pointer to the underlying GdkEventKey.

func (*EventKey) Type

func (v *EventKey) Type() EventType

type EventType

type EventType int

EventType is a representation of GDK's GdkEventType. Do not confuse these event types with the signals that GTK+ widgets emit

const (
	EVENT_NOTHING             EventType = C.GDK_NOTHING
	EVENT_DELETE              EventType = C.GDK_DELETE
	EVENT_DESTROY             EventType = C.GDK_DESTROY
	EVENT_EXPOSE              EventType = C.GDK_EXPOSE
	EVENT_MOTION_NOTIFY       EventType = C.GDK_MOTION_NOTIFY
	EVENT_BUTTON_PRESS        EventType = C.GDK_BUTTON_PRESS
	EVENT_2BUTTON_PRESS       EventType = C.GDK_2BUTTON_PRESS
	EVENT_DOUBLE_BUTTON_PRESS EventType = C.GDK_DOUBLE_BUTTON_PRESS
	EVENT_3BUTTON_PRESS       EventType = C.GDK_3BUTTON_PRESS
	EVENT_TRIPLE_BUTTON_PRESS EventType = C.GDK_TRIPLE_BUTTON_PRESS
	EVENT_BUTTON_RELEASE      EventType = C.GDK_BUTTON_RELEASE
	EVENT_KEY_PRESS           EventType = C.GDK_KEY_PRESS
	EVENT_KEY_RELEASE         EventType = C.GDK_KEY_RELEASE
	EVENT_LEAVE_NOTIFY        EventType = C.GDK_ENTER_NOTIFY
	EVENT_FOCUS_CHANGE        EventType = C.GDK_FOCUS_CHANGE
	EVENT_CONFIGURE           EventType = C.GDK_CONFIGURE
	EVENT_MAP                 EventType = C.GDK_MAP
	EVENT_UNMAP               EventType = C.GDK_UNMAP
	EVENT_PROPERTY_NOTIFY     EventType = C.GDK_PROPERTY_NOTIFY
	EVENT_SELECTION_CLEAR     EventType = C.GDK_SELECTION_CLEAR
	EVENT_SELECTION_REQUEST   EventType = C.GDK_SELECTION_REQUEST
	EVENT_SELECTION_NOTIFY    EventType = C.GDK_SELECTION_NOTIFY
	EVENT_PROXIMITY_IN        EventType = C.GDK_PROXIMITY_IN
	EVENT_PROXIMITY_OUT       EventType = C.GDK_PROXIMITY_OUT
	EVENT_DRAG_ENTER          EventType = C.GDK_DRAG_ENTER
	EVENT_DRAG_LEAVE          EventType = C.GDK_DRAG_LEAVE
	EVENT_DRAG_MOTION         EventType = C.GDK_DRAG_MOTION
	EVENT_DRAG_STATUS         EventType = C.GDK_DRAG_STATUS
	EVENT_DROP_START          EventType = C.GDK_DROP_START
	EVENT_DROP_FINISHED       EventType = C.GDK_DROP_FINISHED
	EVENT_CLIENT_EVENT        EventType = C.GDK_CLIENT_EVENT
	EVENT_VISIBILITY_NOTIFY   EventType = C.GDK_VISIBILITY_NOTIFY
	EVENT_SCROLL              EventType = C.GDK_SCROLL
	EVENT_WINDOW_STATE        EventType = C.GDK_WINDOW_STATE
	EVENT_SETTING             EventType = C.GDK_SETTING
	EVENT_OWNER_CHANGE        EventType = C.GDK_OWNER_CHANGE
	EVENT_GRAB_BROKEN         EventType = C.GDK_GRAB_BROKEN
	EVENT_DAMAGE              EventType = C.GDK_DAMAGE
	EVENT_TOUCH_BEGIN         EventType = C.GDK_TOUCH_BEGIN
	EVENT_TOUCH_UPDATE        EventType = C.GDK_TOUCH_UPDATE
	EVENT_TOUCH_END           EventType = C.GDK_TOUCH_END
	EVENT_TOUCH_CANCEL        EventType = C.GDK_TOUCH_CANCEL
	EVENT_LAST                EventType = C.GDK_EVENT_LAST
)

type InterpType

type InterpType int

InterpType is a representation of GDK's GdkInterpType.

const (
	INTERP_NEAREST  InterpType = C.GDK_INTERP_NEAREST
	INTERP_TILES    InterpType = C.GDK_INTERP_TILES
	INTERP_BILINEAR InterpType = C.GDK_INTERP_BILINEAR
	INTERP_HYPER    InterpType = C.GDK_INTERP_HYPER
)

type ModifierType

type ModifierType uint

ModifierType is a representation of GDK's GdkModifierType.

type Pixbuf

type Pixbuf struct {
	*glib.Object
}

Pixbuf is a representation of GDK's GdkPixbuf.

func PixbufNew

func PixbufNew(colorspace Colorspace, hasAlpha bool, bitsPerSample, width, height int) (*Pixbuf, error)

PixbufNew is a wrapper around gdk_pixbuf_new().

func PixbufNewFromFile

func PixbufNewFromFile(filename string) (*Pixbuf, error)

PixbufNewFromFile is a wrapper around gdk_pixbuf_new_from_file().

func (*Pixbuf) GetBitsPerSample

func (v *Pixbuf) GetBitsPerSample() int

GetBitsPerSample is a wrapper around gdk_pixbuf_get_bits_per_sample().

func (*Pixbuf) GetByteLength

func (v *Pixbuf) GetByteLength() int

GetByteLength is a wrapper around gdk_pixbuf_get_byte_length().

func (*Pixbuf) GetColorspace

func (v *Pixbuf) GetColorspace() Colorspace

GetColorspace is a wrapper around gdk_pixbuf_get_colorspace().

func (*Pixbuf) GetHasAlpha

func (v *Pixbuf) GetHasAlpha() bool

GetHasAlpha is a wrapper around gdk_pixbuf_get_has_alpha().

func (*Pixbuf) GetHeight

func (v *Pixbuf) GetHeight() int

GetHeight is a wrapper around gdk_pixbuf_get_height().

func (*Pixbuf) GetNChannels

func (v *Pixbuf) GetNChannels() int

GetNChannels is a wrapper around gdk_pixbuf_get_n_channels().

func (*Pixbuf) GetOption

func (v *Pixbuf) GetOption(key string) (value string, ok bool)

GetOption is a wrapper around gdk_pixbuf_get_option(). ok is true if the key has an associated value.

func (*Pixbuf) GetPixels

func (v *Pixbuf) GetPixels() (channels []byte)

GetPixels is a wrapper around gdk_pixbuf_get_pixels_with_length(). A Go slice is used to represent the underlying Pixbuf data array, one byte per channel.

func (*Pixbuf) GetRowstride

func (v *Pixbuf) GetRowstride() int

GetRowstride is a wrapper around gdk_pixbuf_get_rowstride().

func (*Pixbuf) GetWidth

func (v *Pixbuf) GetWidth() int

GetWidth is a wrapper around gdk_pixbuf_get_width().

func (*Pixbuf) Native

func (v *Pixbuf) Native() uintptr

Native returns a pointer to the underlying GdkPixbuf.

func (*Pixbuf) RotateSimple

func (v *Pixbuf) RotateSimple(angle PixbufRotation) (*Pixbuf, error)

RotateSimple is a wrapper around gdk_pixbuf_rotate_simple().

func (*Pixbuf) ScaleSimple

func (v *Pixbuf) ScaleSimple(destWidth, destHeight int, interpType InterpType) (*Pixbuf, error)

ScaleSimple is a wrapper around gdk_pixbuf_scale_simple().

type PixbufAlphaMode

type PixbufAlphaMode int

PixbufAlphaMode is a representation of GDK's GdkPixbufAlphaMode.

const (
	GDK_PIXBUF_ALPHA_BILEVEL PixbufAlphaMode = C.GDK_PIXBUF_ALPHA_BILEVEL
	GDK_PIXBUF_ALPHA_FULL    PixbufAlphaMode = C.GDK_PIXBUF_ALPHA_FULL
)

type PixbufRotation

type PixbufRotation int

PixbufRotation is a representation of GDK's GdkPixbufRotation.

const (
	PIXBUF_ROTATE_NONE             PixbufRotation = C.GDK_PIXBUF_ROTATE_NONE
	PIXBUF_ROTATE_COUNTERCLOCKWISE PixbufRotation = C.GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE
	PIXBUF_ROTATE_UPSIDEDOWN       PixbufRotation = C.GDK_PIXBUF_ROTATE_UPSIDEDOWN
	PIXBUF_ROTATE_CLOCKWISE        PixbufRotation = C.GDK_PIXBUF_ROTATE_CLOCKWISE
)

type Screen

type Screen struct {
	*glib.Object
}

Screen is a representation of GDK's GdkScreen.

func (*Screen) GetHeight

func (v *Screen) GetHeight() int

GetHeight is a wrapper around gdk_screen_get_height().

func (*Screen) GetRGBAVisual

func (v *Screen) GetRGBAVisual() (*Visual, error)

GetRGBAVisual is a wrapper around gdk_screen_get_rgba_visual().

func (*Screen) GetSystemVisual

func (v *Screen) GetSystemVisual() (*Visual, error)

GetSystemVisual is a wrapper around gdk_screen_get_system_visual().

func (*Screen) GetWidth

func (v *Screen) GetWidth() int

GetWidth is a wrapper around gdk_screen_get_width().

func (*Screen) Native

func (v *Screen) Native() uintptr

Native returns a pointer to the underlying GdkScreen.

type Visual

type Visual struct {
	*glib.Object
}

Visual is a representation of GDK's GdkVisual.

func (*Visual) Native

func (v *Visual) Native() uintptr

type Window

type Window struct {
	*glib.Object
}

Window is a representation of GDK's GdkWindow.

func (*Window) Native

func (v *Window) Native() uintptr

Native returns a pointer to the underlying GdkWindow.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL