Documentation ¶
Overview ¶
Package glib provides Go bindings for GLib 2. Supports version 2.36 and later.
Index ¶
- Constants
- Variables
- func ActionNameIsValid(actionName string) bool
- func ApplicationIDIsValid(id string) bool
- func ClosureNew(f interface{}, marshalData ...interface{}) (*C.GClosure, error)
- func GetApplicationName() string
- func GetHomeDir() string
- func GetUserCacheDir() string
- func GetUserConfigDir() string
- func GetUserDataDir() string
- func GetUserRuntimeDir() string
- func GetUserSpecialDir(directory UserDirectory) (string, error)
- func InitI18n(domain string, dir string)
- func Local(input string) string
- func MainDepth() int
- func RegisterGValueMarshalers(tm []TypeMarshaler)
- func SetApplicationName(name string)
- func SettingsSync()
- func SourceRemove(src SourceHandle) bool
- func ToGObject(p unsafe.Pointer) *C.GObject
- func VariantTypeEqual(type1, type2 *VariantType) bool
- func VariantTypeStringIsValid(typeString string) bool
- func WithPointerTransferFull(o unsafe.Pointer, f func(*Object, GoObjectSubclass))
- func WithPointerTransferNone(o unsafe.Pointer, f func(*Object, GoObjectSubclass))
- func WithPointerTransferOriginal(o unsafe.Pointer, f func(*Object, GoObjectSubclass))
- type Action
- func (v *Action) Activate(parameter *Variant)
- func (v *Action) ChangeState(value *Variant)
- func (v *Action) GetEnabled() bool
- func (v *Action) GetName() string
- func (v *Action) GetParameterType() *VariantType
- func (v *Action) GetState() *Variant
- func (v *Action) GetStateHint() *Variant
- func (v *Action) GetStateType() *VariantType
- func (v *Action) Native() unsafe.Pointer
- type ActionGroup
- func (v *ActionGroup) Activate(actionName string, parameter *Variant)
- func (v *ActionGroup) ChangeActionState(actionName string, value *Variant)
- func (v *ActionGroup) GetActionEnabled(actionName string) bool
- func (v *ActionGroup) GetActionParameterType(actionName string) *VariantType
- func (v *ActionGroup) GetActionState(actionName string) *Variant
- func (v *ActionGroup) GetActionStateHint(actionName string) *Variant
- func (v *ActionGroup) GetActionStateType(actionName string) *VariantType
- func (v *ActionGroup) HasAction(actionName string) bool
- func (v *ActionGroup) Native() unsafe.Pointer
- type ActionMap
- type Application
- func (v *Application) Activate()
- func (v *Application) GetApplicationID() string
- func (v *Application) GetDbusObjectPath() string
- func (v *Application) GetFlags() ApplicationFlags
- func (v *Application) GetInactivityTimeout() uint
- func (v *Application) GetIsBusy() bool
- func (v *Application) GetIsRegistered() bool
- func (v *Application) GetIsRemote() bool
- func (v *Application) GetResourceBasePath() string
- func (v *Application) Hold()
- func (v *Application) MarkBusy()
- func (v *Application) Native() unsafe.Pointer
- func (v *Application) Quit()
- func (v *Application) Release()
- func (v *Application) Run(args []string) int
- func (v *Application) SendNotification(id string, notification *Notification)
- func (v *Application) SetApplicationID(id string)
- func (v *Application) SetDefault()
- func (v *Application) SetFlags(flags ApplicationFlags)
- func (v *Application) SetInactivityTimeout(timeout uint)
- func (v *Application) SetResourceBasePath(bp string)
- func (v *Application) UnmarkBusy()
- func (v *Application) WithdrawNotification(id string)
- type ApplicationFlags
- type AsyncReadyCallback
- type AsyncResult
- type Binding
- type BindingFlags
- type Bytes
- type Cancellable
- type CompareDataFunc
- type Extendable
- type File
- type FileIcon
- type FileInputStream
- type FileOutputStream
- type FlagsValue
- type GValueMarshaler
- type GoObject
- type GoObjectSubclass
- type IAction
- type IActionGroup
- type IActionMap
- type IAsyncResult
- type IGlibConvert
- type IOStream
- type IObject
- type IVariant
- type Icon
- type InitiallyUnowned
- type Initter
- type InputStream
- func (v *InputStream) ClearPending()
- func (v *InputStream) Close(cancellable *Cancellable) (bool, error)
- func (v *InputStream) HasPending() bool
- func (v *InputStream) IsClosed() bool
- func (v *InputStream) Native() unsafe.Pointer
- func (v *InputStream) NativePrivate() *C.GInputStream
- func (v *InputStream) Read(length uint, cancellable *Cancellable) (*bytes.Buffer, int, error)
- func (v *InputStream) SetPending() (bool, error)
- type Interface
- type List
- func (v *List) Append(data unsafe.Pointer) *List
- func (v *List) Data() interface{}
- func (v *List) DataWrapper(fn func(unsafe.Pointer) interface{})
- func (v *List) First() *List
- func (v *List) Foreach(fn func(item interface{}))
- func (v *List) Free()
- func (v *List) FreeFull(fn func(item interface{}))
- func (v *List) Insert(data unsafe.Pointer, position int) *List
- func (v *List) Last() *List
- func (v *List) Length() uint
- func (v *List) Native() unsafe.Pointer
- func (v *List) Next() *List
- func (v *List) Nth(n uint) *List
- func (v *List) NthData(n uint) interface{}
- func (v *List) Prepend(data unsafe.Pointer) *List
- func (v *List) Previous() *List
- func (v *List) Reverse() *List
- type MainContext
- type MainLoop
- type Menu
- func (v *Menu) Append(label, detailedAction string)
- func (v *Menu) AppendItem(item *MenuItem)
- func (v *Menu) AppendSection(label string, section *MenuModel)
- func (v *Menu) AppendSectionWithoutLabel(section *MenuModel)
- func (v *Menu) AppendSubmenu(label string, submenu *MenuModel)
- func (v *Menu) Freeze()
- func (v *Menu) Insert(position int, label, detailedAction string)
- func (v *Menu) InsertItem(position int, item *MenuItem)
- func (v *Menu) InsertSection(position int, label string, section *MenuModel)
- func (v *Menu) InsertSectionWithoutLabel(position int, section *MenuModel)
- func (v *Menu) InsertSubmenu(position int, label string, submenu *MenuModel)
- func (v *Menu) Prepend(label, detailedAction string)
- func (v *Menu) PrependItem(item *MenuItem)
- func (v *Menu) PrependSection(label string, section *MenuModel)
- func (v *Menu) PrependSectionWithoutLabel(section *MenuModel)
- func (v *Menu) PrependSubmenu(label string, submenu *MenuModel)
- func (v *Menu) Remove(position int)
- func (v *Menu) RemoveAll()
- type MenuItem
- func MenuItemNew() *MenuItem
- func MenuItemNewFromModel(model *MenuModel, index int) *MenuItem
- func MenuItemNewSection(label string, section *MenuModel) *MenuItem
- func MenuItemNewSubmenu(label string, submenu *MenuModel) *MenuItem
- func MenuItemNewWithAction(detailedAction string) *MenuItem
- func MenuItemNewWithLabel(label string) *MenuItem
- func MenuItemNewWithLabelAndAction(label, detailedAction string) *MenuItem
- func (v *MenuItem) GetAttributeValue(attribute string, expectedType *VariantType) *Variant
- func (v *MenuItem) GetLink(link string) *MenuModel
- func (v *MenuItem) SetActionAndTargetValue(action string, targetValue IVariant)
- func (v *MenuItem) SetAttributeValue(attribute string, value IVariant)
- func (v *MenuItem) SetDetailedAction(act string)
- func (v *MenuItem) SetLabel(label string)
- func (v *MenuItem) SetLink(link string, model *MenuModel)
- func (v *MenuItem) SetSection(section *MenuModel)
- func (v *MenuItem) SetSubmenu(submenu *MenuModel)
- func (v *MenuItem) UnsetAction()
- func (v *MenuItem) UnsetLabel()
- type MenuModel
- type Notification
- func (v *Notification) AddButton(label, detailedAction string)
- func (v *Notification) Native() unsafe.Pointer
- func (v *Notification) SetBody(body string)
- func (v *Notification) SetDefaultAction(detailedAction string)
- func (v *Notification) SetIcon(iconPath string)
- func (v *Notification) SetPriority(prio NotificationPriority)
- func (v *Notification) SetTitle(title string)
- type NotificationPriority
- type Object
- func (v *Object) Class() *ObjectClass
- func (v *Object) Connect(detailedSignal string, f interface{}, userData ...interface{}) (SignalHandle, error)
- func (v *Object) ConnectAfter(detailedSignal string, f interface{}, userData ...interface{}) (SignalHandle, error)
- func (v *Object) Emit(s string, args ...interface{}) (interface{}, error)
- func (v *Object) ForceFloating()
- func (v *Object) GetPrivate() unsafe.Pointer
- func (v *Object) GetProperty(name string) (interface{}, error)
- func (v *Object) GetPropertyType(name string) (Type, error)
- func (v *Object) HandlerBlock(handle SignalHandle)
- func (v *Object) HandlerDisconnect(handle SignalHandle)
- func (v *Object) HandlerUnblock(handle SignalHandle)
- func (v *Object) IsA(typ Type) bool
- func (v *Object) IsFloating() bool
- func (v *Object) Keep()
- func (v *Object) ListInterfaces() []string
- func (v *Object) Native() unsafe.Pointer
- func (v *Object) Notify(paramName string)
- func (v *Object) NotifyByPspec(pspec *ParamSpec)
- func (v *Object) Ref() *Object
- func (v *Object) RefSink()
- func (v *Object) Set(name string, value interface{}) error
- func (v *Object) SetProperty(name string, value interface{}) error
- func (v *Object) SetPropertyValue(name string, value *Value) error
- func (v *Object) StopEmission(s string)
- func (v *Object) TypeFromInstance() Type
- func (v *Object) Unref()
- func (v *Object) Unsafe() unsafe.Pointer
- func (v *Object) WithTransferOriginal(f func())
- type ObjectClass
- type OutputStream
- func (v *OutputStream) ClearPending()
- func (v *OutputStream) Close(cancellable *Cancellable) (bool, error)
- func (v *OutputStream) Flush(cancellable *Cancellable) (bool, error)
- func (v *OutputStream) HasPending() bool
- func (v *OutputStream) IsClosed() bool
- func (v *OutputStream) IsClosing() bool
- func (v *OutputStream) Native() unsafe.Pointer
- func (v *OutputStream) NativePrivate() *C.GOutputStream
- func (v *OutputStream) SetPending() (bool, error)
- func (v *OutputStream) Write(buffer *bytes.Buffer, cancellable *Cancellable) (int, error)
- type OutputStreamSpliceFlags
- type ParamSpec
- func NewBoolParam(name, nick, blurb string, defaultValue bool, flags ParameterFlags) *ParamSpec
- func NewBoxedParam(name, nick, blurb string, boxedType Type, flags ParameterFlags) *ParamSpec
- func NewFloat32Param(name, nick, blurb string, min, max, defaultValue float32, flags ParameterFlags) *ParamSpec
- func NewFloat64Param(name, nick, blurb string, min, max, defaultValue float64, flags ParameterFlags) *ParamSpec
- func NewInt64Param(name, nick, blurb string, min, max, defaultValue int64, flags ParameterFlags) *ParamSpec
- func NewIntParam(name, nick, blurb string, min, max, defaultValue int, flags ParameterFlags) *ParamSpec
- func NewStringParam(name, nick, blurb string, defaultValue *string, flags ParameterFlags) *ParamSpec
- func NewUint64Param(name, nick, blurb string, min, max, defaultValue uint64, flags ParameterFlags) *ParamSpec
- func NewUintParam(name, nick, blurb string, min, max, defaultValue uint, flags ParameterFlags) *ParamSpec
- func ToParamSpec(paramspec unsafe.Pointer) *ParamSpec
- type ParameterFlags
- type PropertyAction
- type Quark
- type SList
- func (v *SList) Append(data unsafe.Pointer) *SList
- func (v *SList) Data() interface{}
- func (v *SList) DataRaw() unsafe.Pointer
- func (v *SList) DataWrapper(fn func(unsafe.Pointer) interface{})
- func (v *SList) Foreach(fn func(item interface{}))
- func (v *SList) Free()
- func (v *SList) FreeFull()
- func (v *SList) Length() uint
- func (v *SList) Native() unsafe.Pointer
- func (v *SList) Next() *SList
- type Settings
- func SettingsNew(schemaID string) *Settings
- func SettingsNewFull(schema *SettingsSchema, backend *SettingsBackend, path string) *Settings
- func SettingsNewWithBackend(schemaID string, backend *SettingsBackend) *Settings
- func SettingsNewWithBackendAndPath(schemaID string, backend *SettingsBackend, path string) *Settings
- func SettingsNewWithPath(schemaID, path string) *Settings
- func (v *Settings) Apply()
- func (v *Settings) Delay()
- func (v *Settings) GetBoolean(name string) bool
- func (v *Settings) GetChild(name string) *Settings
- func (v *Settings) GetDouble(name string) float64
- func (v *Settings) GetEnum(name string) int
- func (v *Settings) GetFlags(name string) uint
- func (v *Settings) GetHasUnapplied() bool
- func (v *Settings) GetInt(name string) int
- func (v *Settings) GetString(name string) string
- func (v *Settings) GetStrv(name string) []string
- func (v *Settings) GetUInt(name string) uint
- func (v *Settings) GetValue(name string) *Variant
- func (v *Settings) IsWritable(name string) bool
- func (v *Settings) ListChildren() []string
- func (v *Settings) Native() unsafe.Pointer
- func (v *Settings) Reset(name string)
- func (v *Settings) Revert()
- func (v *Settings) SetBoolean(name string, value bool) bool
- func (v *Settings) SetDouble(name string, value float64) bool
- func (v *Settings) SetEnum(name string, value int) bool
- func (v *Settings) SetFlags(name string, value uint) bool
- func (v *Settings) SetInt(name string, value int) bool
- func (v *Settings) SetString(name string, value string) bool
- func (v *Settings) SetStrv(name string, values []string) bool
- func (v *Settings) SetUInt(name string, value uint) bool
- type SettingsBackend
- type SettingsBindFlags
- type SettingsSchema
- type SettingsSchemaSource
- func (v *SettingsSchemaSource) ListSchemas(recursive bool) (nonReolcatable, relocatable []string)
- func (v *SettingsSchemaSource) Lookup(schema string, recursive bool) *SettingsSchema
- func (v *SettingsSchemaSource) Native() unsafe.Pointer
- func (v *SettingsSchemaSource) Ref() *SettingsSchemaSource
- func (v *SettingsSchemaSource) Unref()
- type Signal
- type SignalHandle
- type SimpleAction
- type SimpleActionGroup
- type Socket
- type Source
- type SourceHandle
- type Type
- type TypeInstance
- type TypeMarshaler
- type UserDirectory
- type Value
- func (v *Value) GetPointer() unsafe.Pointer
- func (v *Value) GetString() (string, error)
- func (v *Value) GoValue() (interface{}, error)
- func (v *Value) IsValue() bool
- func (v *Value) Native() unsafe.Pointer
- func (v *Value) SetBool(val bool)
- func (v *Value) SetBoxed(p unsafe.Pointer)
- func (v *Value) SetDouble(val float64)
- func (v *Value) SetEnum(e int)
- func (v *Value) SetFloat(val float32)
- func (v *Value) SetInstance(instance unsafe.Pointer)
- func (v *Value) SetInt(val int)
- func (v *Value) SetInt64(val int64)
- func (v *Value) SetParam(p *ParamSpec)
- func (v *Value) SetPointer(p unsafe.Pointer)
- func (v *Value) SetSChar(val int8)
- func (v *Value) SetString(val string)
- func (v *Value) SetUChar(val uint8)
- func (v *Value) SetUInt(val uint)
- func (v *Value) SetUInt64(val uint64)
- func (v *Value) Type() (actual Type, fundamental Type, err error)
- func (v *Value) TypeName() string
- func (v *Value) Unsafe() unsafe.Pointer
- func (v *Value) Unset()
- type ValueTransformer
- type Variant
- func TakeVariant(ptr unsafe.Pointer) *Variant
- func VariantFromBoolean(value bool) *Variant
- func VariantFromByte(value uint8) *Variant
- func VariantFromInt16(value int16) *Variant
- func VariantFromInt32(value int32) *Variant
- func VariantFromInt64(value int64) *Variant
- func VariantFromString(value string) *Variant
- func VariantFromUint16(value uint16) *Variant
- func VariantFromUint32(value uint32) *Variant
- func VariantFromUint64(value uint64) *Variant
- func VariantFromVariant(value *Variant) *Variant
- func (v *Variant) AnnotatedString() string
- func (v *Variant) GetBoolean() bool
- func (v *Variant) GetInt() (int64, error)
- func (v *Variant) GetObjv() []string
- func (v *Variant) GetString() string
- func (v *Variant) GetStrv() []string
- func (v *Variant) GetUint() (uint64, error)
- func (v *Variant) GetVariant() *Variant
- func (v *Variant) IsContainer() bool
- func (v *Variant) IsFloating() bool
- func (v *Variant) IsType(t *VariantType) bool
- func (v *Variant) Native() unsafe.Pointer
- func (v *Variant) Ref()
- func (v *Variant) RefSink()
- func (v *Variant) String() string
- func (v *Variant) TakeRef()
- func (v *Variant) ToGVariant() *C.GVariant
- func (v *Variant) ToVariant() *Variant
- func (v *Variant) Type() *VariantType
- func (v *Variant) TypeString() string
- func (v *Variant) Unref()
- type VariantBuilder
- type VariantClass
- type VariantDict
- type VariantIter
- type VariantType
Constants ¶
const ( BINDING_DEFAULT BindingFlags = C.G_BINDING_DEFAULT BINDING_BIDIRECTIONAL BindingFlags = C.G_BINDING_BIDIRECTIONAL BINDING_SYNC_CREATE = C.G_BINDING_SYNC_CREATE BINDING_INVERT_BOOLEAN = C.G_BINDING_INVERT_BOOLEAN )
const ( OUTPUT_STREAM_SPLICE_NONE OutputStreamSpliceFlags = C.G_OUTPUT_STREAM_SPLICE_NONE OUTPUT_STREAM_SPLICE_CLOSE_SOURCE = C.G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE OUTPUT_STREAM_SPLICE_CLOSE_TARGET = C.G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET )
const ( ParameterReadable ParameterFlags = C.G_PARAM_READABLE // the parameter is readable ParameterWritable = C.G_PARAM_WRITABLE // the parameter is writable ParameterReadWrite = ParameterReadable | ParameterWritable ParameterConstruct = C.G_PARAM_CONSTRUCT // the parameter will be set upon object construction ParameterConstructOnly = C.G_PARAM_CONSTRUCT_ONLY // the parameter can only be set upon object construction ParameterLaxValidation = C.G_PARAM_LAX_VALIDATION // upon parameter conversion (see g_param_value_convert()) strict validation is not required ParameterStaticName = C.G_PARAM_STATIC_NAME // the string used as name when constructing the parameter is guaranteed to remain valid and unmodified for the lifetime of the parameter. Since 2.8 ParameterStaticNick = C.G_PARAM_STATIC_NICK // the string used as nick when constructing the parameter is guaranteed to remain valid and unmmodified for the lifetime of the parameter. Since 2.8 ParameterStaticBlurb = C.G_PARAM_STATIC_BLURB // the string used as blurb when constructing the parameter is guaranteed to remain valid and unmodified for the lifetime of the parameter. Since 2.8 ParameterExplicitNotify = C.G_PARAM_EXPLICIT_NOTIFY // calls to g_object_set_property() for this property will not automatically result in a "notify" signal being emitted: the implementation must call g_object_notify() themselves in case the property actually changes. Since: 2.42. ParameterDeprecated = C.G_PARAM_DEPRECATED // the parameter is deprecated and will be removed in a future version. A warning will be generated if it is used while running with G_ENABLE_DIAGNOSTIC=1. Since 2.26 )
Type casting of GParamFlags
const USER_N_DIRECTORIES int = C.G_USER_N_DIRECTORIES
Variables ¶
var ( VARIANT_TYPE_BOOLEAN = newVariantType(C._G_VARIANT_TYPE_BOOLEAN) VARIANT_TYPE_BYTE = newVariantType(C._G_VARIANT_TYPE_BYTE) VARIANT_TYPE_INT16 = newVariantType(C._G_VARIANT_TYPE_INT16) VARIANT_TYPE_UINT16 = newVariantType(C._G_VARIANT_TYPE_UINT16) VARIANT_TYPE_INT32 = newVariantType(C._G_VARIANT_TYPE_INT32) VARIANT_TYPE_UINT32 = newVariantType(C._G_VARIANT_TYPE_UINT32) VARIANT_TYPE_INT64 = newVariantType(C._G_VARIANT_TYPE_INT64) VARIANT_TYPE_UINT64 = newVariantType(C._G_VARIANT_TYPE_UINT64) VARIANT_TYPE_HANDLE = newVariantType(C._G_VARIANT_TYPE_HANDLE) VARIANT_TYPE_DOUBLE = newVariantType(C._G_VARIANT_TYPE_DOUBLE) VARIANT_TYPE_STRING = newVariantType(C._G_VARIANT_TYPE_STRING) VARIANT_TYPE_OBJECT_PATH = newVariantType(C._G_VARIANT_TYPE_OBJECT_PATH) VARIANT_TYPE_SIGNATURE = newVariantType(C._G_VARIANT_TYPE_SIGNATURE) VARIANT_TYPE_VARIANT = newVariantType(C._G_VARIANT_TYPE_VARIANT) VARIANT_TYPE_ANY = newVariantType(C._G_VARIANT_TYPE_ANY) VARIANT_TYPE_BASIC = newVariantType(C._G_VARIANT_TYPE_BASIC) VARIANT_TYPE_MAYBE = newVariantType(C._G_VARIANT_TYPE_MAYBE) VARIANT_TYPE_ARRAY = newVariantType(C._G_VARIANT_TYPE_ARRAY) VARIANT_TYPE_TUPLE = newVariantType(C._G_VARIANT_TYPE_TUPLE) VARIANT_TYPE_UNIT = newVariantType(C._G_VARIANT_TYPE_UNIT) VARIANT_TYPE_DICT_ENTRY = newVariantType(C._G_VARIANT_TYPE_DICT_ENTRY) VARIANT_TYPE_DICTIONARY = newVariantType(C._G_VARIANT_TYPE_DICTIONARY) VARIANT_TYPE_STRING_ARRAY = newVariantType(C._G_VARIANT_TYPE_STRING_ARRAY) VARIANT_TYPE_OBJECT_PATH_ARRAY = newVariantType(C._G_VARIANT_TYPE_OBJECT_PATH_ARRAY) VARIANT_TYPE_BYTESTRING = newVariantType(C._G_VARIANT_TYPE_BYTESTRING) VARIANT_TYPE_BYTESTRING_ARRAY = newVariantType(C._G_VARIANT_TYPE_BYTESTRING_ARRAY) VARIANT_TYPE_VARDICT = newVariantType(C._G_VARIANT_TYPE_VARDICT) )
Variant types for comparing between them. Cannot be const because they are pointers. Note that variant types cannot be compared by value, use VariantTypeEqual() instead.
var ( MENU_ATTRIBUTE_ACTION string = C.G_MENU_ATTRIBUTE_ACTION MENU_ATTRIBUTE_ACTION_NAMESPACE string = C.G_MENU_ATTRIBUTE_ACTION_NAMESPACE MENU_ATTRIBUTE_TARGET string = C.G_MENU_ATTRIBUTE_TARGET MENU_ATTRIBUTE_LABEL string = C.G_MENU_ATTRIBUTE_LABEL MENU_ATTRIBUTE_ICON string = C.G_MENU_ATTRIBUTE_ICON )
Predefined attribute names for GMenu
var ( MENU_LINK_SECTION string = C.G_MENU_LINK_SECTION MENU_LINK_SUBMENU string = C.G_MENU_LINK_SUBMENU )
Predefined link names for GMenu
var ErrSignalNotFound = errors.New("signal not found")
* GObject Signals
var ErrSignalWrongNumberOfArgs = errors.New("wrong number of arguments")
var (
IGlibConvertType reflect.Type
)
Functions ¶
func ActionNameIsValid ¶
ActionNameIsValid is a wrapper around g_action_name_is_valid
func ApplicationIDIsValid ¶
ApplicationIDIsValid is a wrapper around g_application_id_is_valid().
func ClosureNew ¶
ClosureNew creates a new GClosure with the given function f. The returned closure is floating. This is useful so that the finalizer of the closure gets automatically called when the signal is disconnected.
It's exported for visibility to go-gst packages and shouldn't be used in application code.
func GetApplicationName ¶
func GetApplicationName() string
GetApplicationName is a wrapper around g_get_application_name().
func GetUserCacheDir ¶
func GetUserCacheDir() string
GetUserCacheDir is a wrapper around g_get_user_cache_dir().
func GetUserConfigDir ¶
func GetUserConfigDir() string
GetUserConfigDir is a wrapper around g_get_user_config_dir().
func GetUserDataDir ¶
func GetUserDataDir() string
GetUserDataDir is a wrapper around g_get_user_data_dir().
func GetUserRuntimeDir ¶
func GetUserRuntimeDir() string
GetUserRuntimeDir is a wrapper around g_get_user_runtime_dir().
func GetUserSpecialDir ¶
func GetUserSpecialDir(directory UserDirectory) (string, error)
GetUserSpecialDir is a wrapper around g_get_user_special_dir(). A non-nil error is returned in the case that g_get_user_special_dir() returns NULL to differentiate between NULL and an empty string.
func RegisterGValueMarshalers ¶
func RegisterGValueMarshalers(tm []TypeMarshaler)
RegisterGValueMarshalers adds marshalers for several types to the internal marshalers map. Once registered, calling GoValue on any Value with a registered type will return the data returned by the marshaler.
func SetApplicationName ¶
func SetApplicationName(name string)
SetApplicationName is a wrapper around g_set_application_name().
func SourceRemove ¶
func SourceRemove(src SourceHandle) bool
SourceRemove is a wrapper around g_source_remove()
func ToGObject ¶
ToGObject type converts an unsafe.Pointer as a native C GObject. This function is exported for visibility in other go-gst packages and is not meant to be used by applications.
func VariantTypeEqual ¶
func VariantTypeEqual(type1, type2 *VariantType) bool
VariantTypeEqual is a wrapper around g_variant_type_equal
func VariantTypeStringIsValid ¶
VariantTypeStringIsValid is a wrapper around g_variant_type_string_is_valid.
func WithPointerTransferFull ¶
func WithPointerTransferFull(o unsafe.Pointer, f func(*Object, GoObjectSubclass))
WithPointerTransferFull will take a pointer to an object retrieved with transfer-full and call the corresponding function with it wrapped in an Object. If the object has an instantiated Go counterpart, it will be sent to the function as well. It is an alternative to using finalizers around binding calls.
func WithPointerTransferNone ¶
func WithPointerTransferNone(o unsafe.Pointer, f func(*Object, GoObjectSubclass))
WithPointerTransferNone will take a pointer to an object retrieved with transfer-none and call the corresponding function with it wrapped in an Object. If the object has an instantiated Go counterpart, it will be sent to the function as well. It is an alternative to using finalizers around bindings calls.
func WithPointerTransferOriginal ¶
func WithPointerTransferOriginal(o unsafe.Pointer, f func(*Object, GoObjectSubclass))
WithPointerTransferOriginal is a convenience wrapper for wrapping the given pointer in an object, capturing the ref state, executing the given function with that object, and then restoring the original state. It is intended to be used with objects that were extended via the bindings. If the Object has an instantiated Go counterpart, it will be sent to the function as well, otherwise GoObjectSubclass will be nil.
See WithTransferOriginal for more information.
Types ¶
type Action ¶
type Action struct {
*Object
}
Action is a representation of glib's GAction GInterface.
func (*Action) ChangeState ¶
ChangeState is a wrapper around g_action_change_state
func (*Action) GetEnabled ¶
GetEnabled is a wrapper around g_action_get_enabled
func (*Action) GetParameterType ¶
func (v *Action) GetParameterType() *VariantType
GetParameterType is a wrapper around g_action_get_parameter_type
func (*Action) GetStateHint ¶
GetStateHint is a wrapper around g_action_get_state_hint
func (*Action) GetStateType ¶
func (v *Action) GetStateType() *VariantType
GetStateType is a wrapper around g_action_get_state_type
type ActionGroup ¶
type ActionGroup struct {
*Object
}
ActionGroup is a representation of glib's GActionGroup GInterface
func (*ActionGroup) Activate ¶
func (v *ActionGroup) Activate(actionName string, parameter *Variant)
Activate is a wrapper around g_action_group_activate_action
func (*ActionGroup) ChangeActionState ¶
func (v *ActionGroup) ChangeActionState(actionName string, value *Variant)
ChangeActionState is a wrapper around g_action_group_change_action_state
func (*ActionGroup) GetActionEnabled ¶
func (v *ActionGroup) GetActionEnabled(actionName string) bool
GetActionEnabled is a wrapper around g_action_group_get_action_enabled().
func (*ActionGroup) GetActionParameterType ¶
func (v *ActionGroup) GetActionParameterType(actionName string) *VariantType
GetActionParameterType is a wrapper around g_action_group_get_action_parameter_type().
func (*ActionGroup) GetActionState ¶
func (v *ActionGroup) GetActionState(actionName string) *Variant
GetActionState is a wrapper around g_action_group_get_action_state().
func (*ActionGroup) GetActionStateHint ¶
func (v *ActionGroup) GetActionStateHint(actionName string) *Variant
GetActionStateHint is a wrapper around g_action_group_get_action_state_hint().
func (*ActionGroup) GetActionStateType ¶
func (v *ActionGroup) GetActionStateType(actionName string) *VariantType
GetActionStateType is a wrapper around g_action_group_get_action_state_type().
func (*ActionGroup) HasAction ¶
func (v *ActionGroup) HasAction(actionName string) bool
HasAction is a wrapper around g_action_group_has_action().
func (*ActionGroup) Native ¶
func (v *ActionGroup) Native() unsafe.Pointer
type ActionMap ¶
type ActionMap struct {
*Object
}
ActionMap is a representation of glib's GActionMap GInterface
func (*ActionMap) LookupAction ¶
LookupAction is a wrapper around g_action_map_lookup_action
func (*ActionMap) RemoveAction ¶
RemoveAction is a wrapper around g_action_map_remove_action
type Application ¶
type Application struct { *Object // Interfaces IActionMap IActionGroup }
Application is a representation of GApplication.
func ApplicationGetDefault ¶
func ApplicationGetDefault() *Application
ApplicationGetDefault is a wrapper around g_application_get_default().
func ApplicationNew ¶
func ApplicationNew(appID string, flags ApplicationFlags) *Application
ApplicationNew is a wrapper around g_application_new().
func (*Application) Activate ¶
func (v *Application) Activate()
Activate is a wrapper around g_application_activate().
func (*Application) GetApplicationID ¶
func (v *Application) GetApplicationID() string
GetApplicationID is a wrapper around g_application_get_application_id().
func (*Application) GetDbusObjectPath ¶
func (v *Application) GetDbusObjectPath() string
GetDbusObjectPath is a wrapper around g_application_get_dbus_object_path().
func (*Application) GetFlags ¶
func (v *Application) GetFlags() ApplicationFlags
GetFlags is a wrapper around g_application_get_flags().
func (*Application) GetInactivityTimeout ¶
func (v *Application) GetInactivityTimeout() uint
GetInactivityTimeout is a wrapper around g_application_get_inactivity_timeout().
func (*Application) GetIsBusy ¶
func (v *Application) GetIsBusy() bool
GetIsBusy is a wrapper around g_application_get_is_busy().
func (*Application) GetIsRegistered ¶
func (v *Application) GetIsRegistered() bool
GetIsRegistered is a wrapper around g_application_get_is_registered().
func (*Application) GetIsRemote ¶
func (v *Application) GetIsRemote() bool
GetIsRemote is a wrapper around g_application_get_is_remote().
func (*Application) GetResourceBasePath ¶
func (v *Application) GetResourceBasePath() string
GetResourceBasePath is a wrapper around g_application_get_resource_base_path().
func (*Application) Hold ¶
func (v *Application) Hold()
Hold is a wrapper around g_application_hold().
func (*Application) MarkBusy ¶
func (v *Application) MarkBusy()
MarkBusy is a wrapper around g_application_mark_busy().
func (*Application) Native ¶
func (v *Application) Native() unsafe.Pointer
Native returns the pointer to the underlying C instance.
func (*Application) Quit ¶
func (v *Application) Quit()
Quit is a wrapper around g_application_quit().
func (*Application) Release ¶
func (v *Application) Release()
Release is a wrapper around g_application_release().
func (*Application) Run ¶
func (v *Application) Run(args []string) int
Run is a wrapper around g_application_run().
func (*Application) SendNotification ¶
func (v *Application) SendNotification(id string, notification *Notification)
SendNotification is a wrapper around g_application_send_notification().
func (*Application) SetApplicationID ¶
func (v *Application) SetApplicationID(id string)
SetApplicationID is a wrapper around g_application_set_application_id().
func (*Application) SetDefault ¶
func (v *Application) SetDefault()
SetDefault is a wrapper around g_application_set_default().
func (*Application) SetFlags ¶
func (v *Application) SetFlags(flags ApplicationFlags)
SetFlags is a wrapper around g_application_set_flags().
func (*Application) SetInactivityTimeout ¶
func (v *Application) SetInactivityTimeout(timeout uint)
SetInactivityTimeout is a wrapper around g_application_set_inactivity_timeout().
func (*Application) SetResourceBasePath ¶
func (v *Application) SetResourceBasePath(bp string)
SetResourceBasePath is a wrapper around g_application_set_resource_base_path().
func (*Application) UnmarkBusy ¶
func (v *Application) UnmarkBusy()
UnmarkBusy is a wrapper around g_application_unmark_busy().
func (*Application) WithdrawNotification ¶
func (v *Application) WithdrawNotification(id string)
WithdrawNotification is a wrapper around g_application_withdraw_notification().
type ApplicationFlags ¶
type ApplicationFlags int
const ( APPLICATION_FLAGS_NONE ApplicationFlags = C.G_APPLICATION_FLAGS_NONE APPLICATION_IS_SERVICE ApplicationFlags = C.G_APPLICATION_IS_SERVICE APPLICATION_HANDLES_OPEN ApplicationFlags = C.G_APPLICATION_HANDLES_OPEN APPLICATION_HANDLES_COMMAND_LINE ApplicationFlags = C.G_APPLICATION_HANDLES_COMMAND_LINE APPLICATION_SEND_ENVIRONMENT ApplicationFlags = C.G_APPLICATION_SEND_ENVIRONMENT APPLICATION_NON_UNIQUE ApplicationFlags = C.G_APPLICATION_NON_UNIQUE )
type AsyncReadyCallback ¶
type AsyncReadyCallback func(object *Object, res *AsyncResult, data unsafe.Pointer)
AsyncReadyCallback is a representation of GAsyncReadyCallback
type AsyncResult ¶
type AsyncResult struct {
*Object
}
AsyncResult is a representation of GIO's GAsyncResult.
func (*AsyncResult) GetSourceObject ¶
func (v *AsyncResult) GetSourceObject() *Object
GetSourceObject is a wrapper around g_async_result_get_source_object
func (*AsyncResult) GetUserData ¶
func (v *AsyncResult) GetUserData() unsafe.Pointer
GetUserData is a wrapper around g_async_result_get_user_data()
func (*AsyncResult) IsTagged ¶
func (v *AsyncResult) IsTagged(sourceTag unsafe.Pointer) bool
IsTagged is a wrapper around g_async_result_is_tagged
func (*AsyncResult) LegacyPropagateError ¶
func (v *AsyncResult) LegacyPropagateError() error
LegacyPropagateError is a wrapper around g_async_result_legacy_propagate_error
type Binding ¶
type Binding struct {
*Object
}
func BindProperty ¶
func BindProperty(source *Object, sourceProperty string, target *Object, targetProperty string, flags BindingFlags) *Binding
Creates a binding between source property on source and target property on target . Whenever the source property is changed the target_property is updated using the same value.
func (*Binding) GetFlags ¶
func (v *Binding) GetFlags() BindingFlags
Retrieves the flags passed when constructing the GBinding.
func (*Binding) GetSourceProperty ¶
Retrieves the name of the property of “source” used as the source of the binding.
func (*Binding) GetTargetProperty ¶
Retrieves the name of the property of “target” used as the target of the binding.
type BindingFlags ¶
type BindingFlags int
type Bytes ¶
type Bytes struct {
// contains filtered or unexported fields
}
type Cancellable ¶
type Cancellable struct {
*Object
}
Cancellable is a representation of GIO's GCancellable.
func CancellableNew ¶
func CancellableNew() (*Cancellable, error)
CancellableNew is a wrapper around g_cancellable_new().
func (*Cancellable) GetFD ¶
func (v *Cancellable) GetFD() int
GetFD is a wrapper around g_cancellable_get_fd().
func (*Cancellable) IsCancelled ¶
func (v *Cancellable) IsCancelled() bool
IsCancelled is a wrapper around g_cancellable_is_cancelled().
func (*Cancellable) ReleaseFD ¶
func (v *Cancellable) ReleaseFD()
ReleaseFD is a wrapper around g_cancellable_release_fd().
func (*Cancellable) SetErrorIfCancelled ¶
func (v *Cancellable) SetErrorIfCancelled() error
SetErrorIfCancelled is a wrapper around g_cancellable_set_error_if_cancelled().
func (*Cancellable) SourceNew ¶
func (v *Cancellable) SourceNew() *Source
SourceNew is a wrapper around g_cancellable_source_new().
type CompareDataFunc ¶
type CompareDataFunc func(a, b interface{}, userData ...interface{}) bool
CompareDataFunc is a representation of GCompareDataFunc
type Extendable ¶
type Extendable interface { // Type should return the type of the extended object Type() Type // ClasSize should return the size of the extended class ClassSize() int64 // InstanceSize should return the size of the object itself InstanceSize() int64 // InitClass should take a pointer to a new subclass and a GoElement and override any // methods implemented by the GoElement in the subclass. InitClass(unsafe.Pointer, GoObjectSubclass) }
Extendable is an interface implemented by extendable classes. It provides the methods necessary to setup the vmethods on the object it represents. When the object is actually used, a pointer to the Go object can be retrieved from the C object with FromObjectUnsafePrivate.
var ExtendsObject Extendable = &extendObject{}
ExtendsObject signifies a GoElement that extends a GObject. It is the base Extendable that all other implementations should derive from.
type File ¶
type File struct {
*Object
}
File is a representation of GIO's GFile.
func FileNew ¶
FileNew is a wrapper around g_file_new_for_path(). To avoid breaking previous implementation of GFile ...
func FileNewForPath ¶
FileNewForPath is a wrapper around g_file_new_for_path().
func (*File) GetPath ¶
char * g_file_get_path (GFile *file);
GetPath is a wrapper around g_file_get_path().
func (*File) NativePrivate ¶
NativePrivate: to be used inside Gotk3 only.
func (*File) Read ¶
func (v *File) Read(cancellable *Cancellable) (*FileInputStream, error)
GFileInputStream * g_file_read (GFile *file,
GCancellable *cancellable, GError **error);
Read is a wrapper around g_file_read(). Object.Unref() must be used after use
type FileIcon ¶
type FileIcon struct {
*Object
}
FileIcon is a representation of GIO's GFileIcon.
func (*FileIcon) NativePrivate ¶
NativePrivate: to be used inside Gotk3 only.
type FileInputStream ¶
type FileInputStream struct {
*InputStream
}
FileInputStream is a representation of GIO's GFileInputStream.
func (*FileInputStream) Native ¶
func (v *FileInputStream) Native() unsafe.Pointer
Native returns a pointer to the underlying GFileInputStream.
func (*FileInputStream) NativePrivate ¶
func (v *FileInputStream) NativePrivate() *C.GFileInputStream
NativePrivate: to be used inside Gotk3 only.
type FileOutputStream ¶
type FileOutputStream struct {
*OutputStream
}
FileOutputStream is a representation of GIO's GFileOutputStream.
func (*FileOutputStream) Native ¶
func (v *FileOutputStream) Native() unsafe.Pointer
Native returns a pointer to the underlying GFileOutputStream.
func (*FileOutputStream) NativePrivate ¶
func (v *FileOutputStream) NativePrivate() *C.GFileOutputStream
NativePrivate: to be used inside Gotk3 only.
type FlagsValue ¶
FlagsValue is a go representation of GFlagsValue
type GValueMarshaler ¶
GValueMarshaler is a marshal function to convert a GValue into an appropriate Go type. The unsafe.Pointer parameter is a *C.GValue.
type GoObject ¶
type GoObject interface { // SetProperty should set the value of the property with the given id. ID is the index+1 of the parameter // in the order it was registered. SetProperty(obj *Object, id uint, value *Value) // GetProperty should retrieve the value of the property with the given id. ID is the index+1 of the parameter // in the order it was registered. GetProperty(obj *Object, id uint) *Value // Constructed is called when the Object has finished setting up. Constructed(*Object) }
GoObject is an interface that abstracts on the GObject. In almost all cases at least SetProperty and GetProperty should be implemented by objects built from the go bindings.
type GoObjectSubclass ¶
type GoObjectSubclass interface { // New should return a new instantiated GoElement ready to be used. New() GoObjectSubclass // ClassInit is called on the element after registering it with the type system. This is when the element // should install its properties and metadata. ClassInit(*ObjectClass) }
GoObjectSubclass is an interface that abstracts on the GObjectClass. It is the minimum that should be implemented by Go types that get registered as GObjects. For more information see RegisterGoType.
func FromObjectUnsafePrivate ¶
func FromObjectUnsafePrivate(obj unsafe.Pointer) GoObjectSubclass
FromObjectUnsafePrivate will return the GoObjectSubclass addressed in the private data of the given GObject.
type IAction ¶
type IAction interface {
// contains filtered or unexported methods
}
IAction is an interface type implemented by all structs embedding an Action. It is meant to be used as an argument type for wrapper functions that wrap around a C function taking a GAction.
type IActionGroup ¶
type IActionGroup interface { Native() unsafe.Pointer HasAction(actionName string) bool GetActionEnabled(actionName string) bool GetActionParameterType(actionName string) *VariantType GetActionStateType(actionName string) *VariantType GetActionState(actionName string) *Variant GetActionStateHint(actionName string) *Variant ChangeActionState(actionName string, value *Variant) Activate(actionName string, parameter *Variant) }
IActionGroup is an interface representation of ActionGroup, used to avoid duplication when embedding the type in a wrapper of another GObject-based type.
type IActionMap ¶
type IActionMap interface { Native() unsafe.Pointer LookupAction(actionName string) *Action AddAction(action IAction) RemoveAction(actionName string) }
IActionMap is an interface representation of ActionMap, used to avoid duplication when embedding the type in a wrapper of another GObject-based type.
type IAsyncResult ¶
type IAsyncResult interface { GetUserData() unsafe.Pointer GetSourceObject() *Object IsTagged(sourceTag unsafe.Pointer) bool LegacyPropagateError() error }
IAsyncResult is an interface representation of AsyncResult, used to avoid duplication when embedding the type in a wrapper of another GObject-based type.
type IGlibConvert ¶
type IGlibConvert interface { // If conversion can't be done, the function has to panic with a message that it can't convert to type Convert(reflect.Type) reflect.Value }
Should be implemented by any class which need special conversion like gtk.Application -> gio.Application
type IOStream ¶
type IOStream struct {
*Object
}
IOStream is a representation of GIO's GIOStream. Base class for implementing read/write streams
func (*IOStream) Close ¶
func (v *IOStream) Close(cancellable *Cancellable) (bool, error)
Close is a wrapper around g_io_stream_close().
func (*IOStream) NativePrivate ¶
NativePrivate: to be used inside Gotk3 only.
type IObject ¶
type IObject interface {
// contains filtered or unexported methods
}
IObject is an interface type implemented by Object and all types which embed an Object. It is meant to be used as a type for function arguments which require GObjects or any subclasses thereof.
type IVariant ¶
IVariant is an interface type implemented by Variant and all types which embed an Variant. It is meant to be used as a type for function arguments which require GVariants or any subclasses thereof.
type Icon ¶
type Icon struct {
*Object
}
Icon is a representation of GIO's GIcon. Interface for icons
func FileIconNew ¶
FileIconNew is a wrapper around g_file_icon_new(). To not break previous implementation of GFileIcon ...
func FileIconNewN ¶
FileIconNewN is a wrapper around g_file_icon_new(). This version respect Gtk3 documentation.
func IconNewForString ¶
IconNewForString is a wrapper around g_icon_new_for_string().
func (*Icon) NativePrivate ¶
NativePrivate: to be used inside Gotk3 only.
type InitiallyUnowned ¶
type InitiallyUnowned struct { // This must be a pointer so copies of the ref-sinked object // do not outlive the original object, causing an unref // finalizer to prematurely run. *Object }
InitiallyUnowned is a representation of GLib's GInitiallyUnowned.
func (*InitiallyUnowned) Native ¶
func (v *InitiallyUnowned) Native() unsafe.Pointer
Native returns a pointer to the underlying GObject. This is implemented here rather than calling Native on the embedded Object to prevent a nil pointer dereference.
type Initter ¶
type Initter interface {
InstanceInit(*Object)
}
Initter is an interface that can be implemented on top of a GoObjectSubclass. It provides a method that gets called with the GObject instance at instance initialization.
type InputStream ¶
type InputStream struct {
*Object
}
InputStream is a representation of GIO's GInputStream. Base class for implementing streaming input
func (*InputStream) ClearPending ¶
func (v *InputStream) ClearPending()
ClearPending is a wrapper around g_input_stream_clear_pending().
func (*InputStream) Close ¶
func (v *InputStream) Close(cancellable *Cancellable) (bool, error)
Close is a wrapper around g_input_stream_close().
func (*InputStream) HasPending ¶
func (v *InputStream) HasPending() bool
HasPending is a wrapper around g_input_stream_has_pending().
func (*InputStream) IsClosed ¶
func (v *InputStream) IsClosed() bool
IsClosed is a wrapper around g_input_stream_is_closed().
func (*InputStream) Native ¶
func (v *InputStream) Native() unsafe.Pointer
Native returns a pointer to the underlying GInputStream.
func (*InputStream) NativePrivate ¶
func (v *InputStream) NativePrivate() *C.GInputStream
NativePrivate: to be used inside Gotk3 only.
func (*InputStream) Read ¶
func (v *InputStream) Read(length uint, cancellable *Cancellable) (*bytes.Buffer, int, error)
Read is a wrapper around g_input_stream_read().
func (*InputStream) SetPending ¶
func (v *InputStream) SetPending() (bool, error)
SetPending is a wrapper around g_input_stream_set_pending().
type Interface ¶
type Interface interface { Type() Type Init(*TypeInstance) }
Interface can be implemented by extending packages. They provide the base type for the interface and a function to call during interface_init.
The function is called during class_init and is passed a TypeInstance populated with the GType corresponding to the Go object, a pointer to the underlying C object, and a pointer to a reference Go object. When the object is actually used, a pointer to it can be retrieved from the C object with FromObjectUnsafePrivate.
The user of the Interface is responsible for implementing the methods required by the interface. The GoType provided to the InterfaceInitFunc will be the object that is expected to carry the implementation.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List is a representation of Glib's GList.
func (*List) Data ¶
func (v *List) Data() interface{}
Data acts the same as data struct field, but passes retrieved value before returning through wrap function, set by DataWrapper(). If no wrap function is set, it returns raw unsafe.Pointer.
func (*List) DataWrapper ¶
DataWapper sets wrap functions, which is called during NthData() and Data(). It's used to cast raw C data into appropriate Go structures and types every time that data is retreived.
func (*List) Foreach ¶
func (v *List) Foreach(fn func(item interface{}))
Foreach acts the same as g_list_foreach(). No user_data argument is implemented because of Go clojure capabilities.
func (*List) FreeFull ¶
func (v *List) FreeFull(fn func(item interface{}))
FreeFull acts the same as g_list_free_full(). Calling list.FreeFull(fn) is equivalent to calling list.Foreach(fn) and list.Free() sequentially.
func (*List) NthData ¶
NthData acts the same as g_list_nth_data(), but passes retrieved value before returning through wrap function, set by DataWrapper(). If no wrap function is set, it returns raw unsafe.Pointer.
type MainContext ¶
type MainContext C.GMainContext
func MainContextDefault ¶
func MainContextDefault() *MainContext
MainContextDefault is a wrapper around g_main_context_default().
func (*MainContext) FindSourceById ¶
func (v *MainContext) FindSourceById(hdlSrc SourceHandle) *Source
FindSourceById is a wrapper around g_main_context_find_source_by_id()
func (*MainContext) Iteration ¶
func (v *MainContext) Iteration(mayBlock bool) bool
Iteration is a wrapper around g_main_context_iteration()
func (*MainContext) Pending ¶
func (v *MainContext) Pending() bool
Pending is a wrapper around g_main_context_pending()
type MainLoop ¶
type MainLoop struct {
// contains filtered or unexported fields
}
MainLoop is a go representation of a GMainLoop. It can be used to block execution while a pipeline is running, and also allows for event sources and signals to be used across gstreamer objects.
func NewMainLoop ¶
func NewMainLoop(ctx *MainContext, isRunning bool) *MainLoop
NewMainLoop creates a new GMainLoop. If ctx is nil then the default context is used. If isRunning is true the loop will automatically start, however, this function will not block. To block on the loop itself you will still need to call MainLoop.Run().
A MainLoop is required when wishing to handle signals to/from elements asynchronously. Otherwise you will need to iterate on the DefaultMainContext (or an external created one) manually.
func (*MainLoop) GetContext ¶
func (m *MainLoop) GetContext() *MainContext
GetContext returns the GMainContext for this loop.
func (*MainLoop) Quit ¶
func (m *MainLoop) Quit()
Quit stops a MainLoop from running. Any calls to Run() for the loop will return. Note that sources that have already been dispatched when Quit() is called will still be executed.
func (*MainLoop) Ref ¶
Ref increases the ref count on the main loop by one. It returns the original main loop for convenience in return functions.
func (*MainLoop) Run ¶
func (m *MainLoop) Run()
Run a main loop until Quit() is called on the loop. If this is called from the thread of the loop's GMainContext, it will process events from the loop, otherwise it will simply wait.
type Menu ¶
type Menu struct {
MenuModel
}
Menu is a representation of GMenu.
func (*Menu) AppendItem ¶
AppendItem is a wrapper around g_menu_append_item().
func (*Menu) AppendSection ¶
AppendSection is a wrapper around g_menu_append_section().
func (*Menu) AppendSectionWithoutLabel ¶
AppendSectionWithoutLabel is a wrapper around g_menu_append_section() with label set to null.
func (*Menu) AppendSubmenu ¶
AppendSubmenu is a wrapper around g_menu_append_submenu().
func (*Menu) InsertItem ¶
InsertItem is a wrapper around g_menu_insert_item().
func (*Menu) InsertSection ¶
InsertSection is a wrapper around g_menu_insert_section().
func (*Menu) InsertSectionWithoutLabel ¶
InsertSectionWithoutLabel is a wrapper around g_menu_insert_section() with label set to null.
func (*Menu) InsertSubmenu ¶
InsertSubmenu is a wrapper around g_menu_insert_submenu().
func (*Menu) PrependItem ¶
PrependItem is a wrapper around g_menu_prepend_item().
func (*Menu) PrependSection ¶
PrependSection is a wrapper around g_menu_prepend_section().
func (*Menu) PrependSectionWithoutLabel ¶
PrependSectionWithoutLabel is a wrapper around g_menu_prepend_section() with label set to null.
func (*Menu) PrependSubmenu ¶
PrependSubmenu is a wrapper around g_menu_prepend_submenu().
type MenuItem ¶
type MenuItem struct {
*Object
}
MenuItem is a representation of GMenuItem.
func MenuItemNew ¶
func MenuItemNew() *MenuItem
MenuItemNew is a wrapper around g_menu_item_new(NULL, NULL).
func MenuItemNewFromModel ¶
MenuItemNewFromModel is a wrapper around g_menu_item_new_from_model().
func MenuItemNewSection ¶
MenuItemNewSection is a wrapper around g_menu_item_new_section().
func MenuItemNewSubmenu ¶
MenuItemNewSubmenu is a wrapper around g_menu_item_new_submenu().
func MenuItemNewWithAction ¶
MenuItemNewWithAction is a wrapper around g_menu_item_new(NULL, detailedAction).
func MenuItemNewWithLabel ¶
MenuItemNewWithLabel is a wrapper around g_menu_item_new(label, NULL).
func MenuItemNewWithLabelAndAction ¶
MenuItemNewWithLabelAndAction is a wrapper around g_menu_item_new(label, detailedAction).
func (*MenuItem) GetAttributeValue ¶
func (v *MenuItem) GetAttributeValue(attribute string, expectedType *VariantType) *Variant
GetAttributeValue is a wrapper around g_menu_item_get_attribute_value()
func (*MenuItem) SetActionAndTargetValue ¶
SetActionAndTargetValue is a wrapper around g_menu_item_set_action_and_target_value()
func (*MenuItem) SetAttributeValue ¶
SetAttributeValue is a wrapper around g_menu_item_set_attribute_value()
func (*MenuItem) SetDetailedAction ¶
SetDetailedAction is a wrapper around g_menu_item_set_detailed_action().
func (*MenuItem) SetSection ¶
SetSection is a wrapper around g_menu_item_set_section().
func (*MenuItem) SetSubmenu ¶
SetSubmenu is a wrapper around g_menu_item_set_submenu().
func (*MenuItem) UnsetAction ¶
func (v *MenuItem) UnsetAction()
UnsetAction is a wrapper around g_menu_item_set_action_and_target_value(NULL, NULL) Unsets both action and target value. Unsetting the action also clears the target value.
func (*MenuItem) UnsetLabel ¶
func (v *MenuItem) UnsetLabel()
UnsetLabel is a wrapper around g_menu_item_set_label(NULL).
type MenuModel ¶
type MenuModel struct {
*Object
}
MenuModel is a representation of GMenuModel.
func (*MenuModel) GetItemLink ¶
GetItemLink is a wrapper around g_menu_model_get_item_link().
func (*MenuModel) ItemsChanged ¶
ItemsChanged is a wrapper around g_menu_model_items_changed().
type Notification ¶
type Notification struct {
*Object
}
Notification is a representation of GNotification.
func NotificationNew ¶
func NotificationNew(title string) *Notification
NotificationNew is a wrapper around g_notification_new().
func (*Notification) AddButton ¶
func (v *Notification) AddButton(label, detailedAction string)
AddButton is a wrapper around g_notification_add_button().
func (*Notification) Native ¶
func (v *Notification) Native() unsafe.Pointer
func (*Notification) SetBody ¶
func (v *Notification) SetBody(body string)
SetBody is a wrapper around g_notification_set_body().
func (*Notification) SetDefaultAction ¶
func (v *Notification) SetDefaultAction(detailedAction string)
SetDefaultAction is a wrapper around g_notification_set_default_action().
func (*Notification) SetIcon ¶
func (v *Notification) SetIcon(iconPath string)
SetIcon is a wrapper around g_notification_set_icon().
func (*Notification) SetPriority ¶
func (v *Notification) SetPriority(prio NotificationPriority)
SetPriority is a wrapper around g_notification_set_priority().
func (*Notification) SetTitle ¶
func (v *Notification) SetTitle(title string)
SetTitle is a wrapper around g_notification_set_title().
type NotificationPriority ¶
type NotificationPriority int
NotificationPriority is a representation of GLib's GNotificationPriority.
const ( NOTIFICATION_PRIORITY_NORMAL NotificationPriority = C.G_NOTIFICATION_PRIORITY_NORMAL NOTIFICATION_PRIORITY_LOW NotificationPriority = C.G_NOTIFICATION_PRIORITY_LOW NOTIFICATION_PRIORITY_HIGH NotificationPriority = C.G_NOTIFICATION_PRIORITY_HIGH NOTIFICATION_PRIORITY_URGENT NotificationPriority = C.G_NOTIFICATION_PRIORITY_URGENT )
type Object ¶
Object is a representation of GLib's GObject.
func Take ¶
Take wraps a unsafe.Pointer as a glib.Object, taking ownership of it. If the object is a floating reference a RefSink is taken, otherwise a Ref. A runtime finalizer is placed on the object to clear the ref when the object leaves scope.
func TransferFull ¶
TransferFull wraps a unsafe.Pointer as a glib.Object, taking ownership of it. it does not increase the ref count on the object. A finalizer is placed on the object to clear the transferred ref.
func (*Object) Class ¶
func (v *Object) Class() *ObjectClass
Class returns the GObjectClass of this instance.
func (*Object) Connect ¶
func (v *Object) Connect(detailedSignal string, f interface{}, userData ...interface{}) (SignalHandle, error)
Connect is a wrapper around g_signal_connect_closure(). f must be a function with a signaure matching the callback signature for detailedSignal. userData must either 0 or 1 elements which can be optionally passed to f. If f takes less arguments than it is passed from the GLib runtime, the extra arguments are ignored.
Arguments for f must be a matching Go equivalent type for the C callback, or an interface type which the value may be packed in. If the type is not suitable, a runtime panic will occur when the signal is emitted.
func (*Object) ConnectAfter ¶
func (v *Object) ConnectAfter(detailedSignal string, f interface{}, userData ...interface{}) (SignalHandle, error)
ConnectAfter is a wrapper around g_signal_connect_closure(). f must be a function with a signaure matching the callback signature for detailedSignal. userData must either 0 or 1 elements which can be optionally passed to f. If f takes less arguments than it is passed from the GLib runtime, the extra arguments are ignored.
Arguments for f must be a matching Go equivalent type for the C callback, or an interface type which the value may be packed in. If the type is not suitable, a runtime panic will occur when the signal is emitted.
The difference between Connect and ConnectAfter is that the latter will be invoked after the default handler, not before.
func (*Object) Emit ¶
Emit is a wrapper around g_signal_emitv() and emits the signal specified by the string s to an Object. Arguments to callback functions connected to this signal must be specified in args. Emit() returns an interface{} which contains the go equivalent of the C return value.
Make sure that the Types are known to go-glib. Special types need to be registered with RegisterGValueMarshalers before calling Emit.
func (*Object) ForceFloating ¶
func (v *Object) ForceFloating()
ForceFloating is a wrapper around g_object_force_floating().
func (*Object) GetPrivate ¶
GetPrivate returns a pointer to the private data stored inside this object.
func (*Object) GetProperty ¶
GetProperty is a wrapper around g_object_get_property().
func (*Object) GetPropertyType ¶
GetPropertyType returns the Type of a property of the underlying GObject. If the property is missing it will return TYPE_INVALID and an error.
func (*Object) HandlerBlock ¶
func (v *Object) HandlerBlock(handle SignalHandle)
HandlerBlock is a wrapper around g_signal_handler_block().
func (*Object) HandlerDisconnect ¶
func (v *Object) HandlerDisconnect(handle SignalHandle)
HandlerDisconnect is a wrapper around g_signal_handler_disconnect().
func (*Object) HandlerUnblock ¶
func (v *Object) HandlerUnblock(handle SignalHandle)
HandlerUnblock is a wrapper around g_signal_handler_unblock().
func (*Object) IsFloating ¶
IsFloating is a wrapper around g_object_is_floating().
func (*Object) Keep ¶
func (v *Object) Keep()
Keep will call runtime.KeepAlive on this or the extending object. It is useful for blocking a pending finalizer on this instance from firing and freeing the underlying C object. This is needed in the bindings where the Object goes out of scope but the C pointer is still needed.
func (*Object) ListInterfaces ¶
ListInterfaces returns the interfaces associated with this object.
func (*Object) NotifyByPspec ¶ added in v1.3.2
NotifyByPspec is a wrapper around g_object_notify_by_pspec().
func (*Object) RefSink ¶
func (v *Object) RefSink()
RefSink is a wrapper around g_object_ref_sink().
func (*Object) Set ¶
Set is a wrapper around g_object_set(). However, unlike g_object_set(), this function only sets one name value pair. Make multiple calls to this function to set multiple properties.
func (*Object) SetProperty ¶
SetProperty is a wrapper around g_object_set_property(). It attempts to convert the given Go value to a GValue before setting the property.
func (*Object) SetPropertyValue ¶
SetPropertyValue is like SetProperty except it operates on native GValues instead of first trying to convert from a Go value.
func (*Object) StopEmission ¶
StopEmission is a wrapper around g_signal_stop_emission_by_name().
func (*Object) TypeFromInstance ¶
TypeFromInstance is a wrapper around g_type_from_instance().
func (*Object) Unsafe ¶
Unsafe returns the unsafe pointer to the underlying object. This method is primarily for internal usage and is exposed for visibility in other packages.
func (*Object) WithTransferOriginal ¶
func (v *Object) WithTransferOriginal(f func())
WithTransferOriginal can be used to capture an object from transfer-none with a RefSink, and restore the original floating state of the ref after the given function's execution. Strictly speaking this is not thread safe, since additional references can be taken on the object elsewhere while the closure is executing. But for the lack of a better method for handling virtual methods this will suffice for now.
type ObjectClass ¶
type ObjectClass struct {
// contains filtered or unexported fields
}
ObjectClass is a binding around the glib GObjectClass. It exposes methods to be used during the construction of objects backed by the go runtime.
func (*ObjectClass) InstallProperties ¶
func (o *ObjectClass) InstallProperties(params []*ParamSpec)
InstallProperties will install the given ParameterSpecs to the object class. They will be IDed in the order they are provided.
func (*ObjectClass) Instance ¶
func (o *ObjectClass) Instance() *C.GObjectClass
Instance returns the underlying C GObjectClass pointer
func (*ObjectClass) ListProperties ¶
func (o *ObjectClass) ListProperties() []*ParamSpec
ListProperties returns a list of the properties associated with this object. The default values assumed in the parameter spec reflect the values currently set in this object, or their defaults.
func (*ObjectClass) Unsafe ¶
func (o *ObjectClass) Unsafe() unsafe.Pointer
Unsafe is a convenience wrapper to return the unsafe.Pointer of the underlying C instance.
type OutputStream ¶
type OutputStream struct {
*Object
}
OutputStream is a representation of GIO's GOutputStream. Base class for implementing streaming output
func (*OutputStream) ClearPending ¶
func (v *OutputStream) ClearPending()
ClearPending is a wrapper around g_output_stream_clear_pending().
func (*OutputStream) Close ¶
func (v *OutputStream) Close(cancellable *Cancellable) (bool, error)
Close is a wrapper around g_output_stream_close().
func (*OutputStream) Flush ¶
func (v *OutputStream) Flush(cancellable *Cancellable) (bool, error)
Flush is a wrapper around g_output_stream_flush().
func (*OutputStream) HasPending ¶
func (v *OutputStream) HasPending() bool
HasPending is a wrapper around g_output_stream_has_pending().
func (*OutputStream) IsClosed ¶
func (v *OutputStream) IsClosed() bool
IsClosed is a wrapper around g_output_stream_is_closed().
func (*OutputStream) IsClosing ¶
func (v *OutputStream) IsClosing() bool
IsClosing is a wrapper around g_output_stream_is_closing().
func (*OutputStream) Native ¶
func (v *OutputStream) Native() unsafe.Pointer
Native returns a pointer to the underlying GOutputStream.
func (*OutputStream) NativePrivate ¶
func (v *OutputStream) NativePrivate() *C.GOutputStream
NativePrivate: to be used inside Gotk3 only.
func (*OutputStream) SetPending ¶
func (v *OutputStream) SetPending() (bool, error)
SetPending is a wrapper around g_output_stream_set_pending().
func (*OutputStream) Write ¶
func (v *OutputStream) Write(buffer *bytes.Buffer, cancellable *Cancellable) (int, error)
Write is a wrapper around g_output_stream_write(). buffer := bytes.NewBuffer(make([]byte, length))
type OutputStreamSpliceFlags ¶
type OutputStreamSpliceFlags int
OutputStreamSpliceFlags is a representation of GTK's GOutputStreamSpliceFlags.
type ParamSpec ¶
type ParamSpec struct {
// contains filtered or unexported fields
}
ParamSpec is a go representation of a C GParamSpec
func NewBoolParam ¶
func NewBoolParam(name, nick, blurb string, defaultValue bool, flags ParameterFlags) *ParamSpec
NewBoolParam creates a new ParamSpec that will hold a boolean value.
func NewBoxedParam ¶
func NewBoxedParam(name, nick, blurb string, boxedType Type, flags ParameterFlags) *ParamSpec
NewBoxedParam creates a new ParamSpec containing a boxed type.
func NewFloat32Param ¶
func NewFloat32Param(name, nick, blurb string, min, max, defaultValue float32, flags ParameterFlags) *ParamSpec
NewFloat32Param creates a new ParamSpec that will hold a 32-bit float value.
func NewFloat64Param ¶
func NewFloat64Param(name, nick, blurb string, min, max, defaultValue float64, flags ParameterFlags) *ParamSpec
NewFloat64Param creates a new ParamSpec that will hold a 64-bit float value.
func NewInt64Param ¶
func NewInt64Param(name, nick, blurb string, min, max, defaultValue int64, flags ParameterFlags) *ParamSpec
NewInt64Param creates a new ParamSpec that will hold a signed 64-bit integer value.
func NewIntParam ¶
func NewIntParam(name, nick, blurb string, min, max, defaultValue int, flags ParameterFlags) *ParamSpec
NewIntParam creates a new ParamSpec that will hold a signed integer value.
func NewStringParam ¶
func NewStringParam(name, nick, blurb string, defaultValue *string, flags ParameterFlags) *ParamSpec
NewStringParam returns a new ParamSpec that will hold a string value.
func NewUint64Param ¶
func NewUint64Param(name, nick, blurb string, min, max, defaultValue uint64, flags ParameterFlags) *ParamSpec
NewUint64Param creates a new ParamSpec that will hold an unsigned 64-bit integer value.
func NewUintParam ¶
func NewUintParam(name, nick, blurb string, min, max, defaultValue uint, flags ParameterFlags) *ParamSpec
NewUintParam creates a new ParamSpec that will hold an unsigned integer value.
func ToParamSpec ¶
ToParamSpec wraps the given pointer in a ParamSpec instance.
func (*ParamSpec) Flags ¶
func (p *ParamSpec) Flags() ParameterFlags
Flags returns the flags for this parameter.
func (*ParamSpec) GetFlagValues ¶
func (p *ParamSpec) GetFlagValues() []*FlagsValue
GetFlagValues returns the possible flags for this parameter.
type ParameterFlags ¶
type ParameterFlags int
ParameterFlags is a go cast of GParamFlags.
func (ParameterFlags) Has ¶
func (p ParameterFlags) Has(b ParameterFlags) bool
Has returns true if these flags contain the provided ones.
type PropertyAction ¶
type PropertyAction struct {
Action
}
PropertyAction is a representation of GPropertyAction
func PropertyActionNew ¶
func PropertyActionNew(name string, object *Object, propertyName string) *PropertyAction
PropertyActionNew is a wrapper around g_property_action_new
func (*PropertyAction) Native ¶
func (v *PropertyAction) Native() unsafe.Pointer
type SList ¶
type SList struct {
// contains filtered or unexported fields
}
SList is a representation of Glib's GSList. A SList must be manually freed by either calling Free() or FreeFull()
func (*SList) Data ¶
func (v *SList) Data() interface{}
Data acts the same as data struct field, but it returns raw unsafe.Pointer as interface. TODO: Align with List struct and add member + logic for `dataWrap func(unsafe.Pointer) interface{}`?
func (*SList) DataWrapper ¶
DataWapper sets wrap functions, which is called during NthData() and Data(). It's used to cast raw C data into appropriate Go structures and types every time that data is retreived.
func (*SList) Foreach ¶
func (v *SList) Foreach(fn func(item interface{}))
Foreach acts the same as g_slist_foreach(). No user_data argument is implemented because of Go clojure capabilities.
type Settings ¶
type Settings struct {
*Object
}
Settings is a representation of GSettings.
func SettingsNew ¶
SettingsNew is a wrapper around g_settings_new().
func SettingsNewFull ¶
func SettingsNewFull(schema *SettingsSchema, backend *SettingsBackend, path string) *Settings
SettingsNewFull is a wrapper around g_settings_new_full().
func SettingsNewWithBackend ¶
func SettingsNewWithBackend(schemaID string, backend *SettingsBackend) *Settings
SettingsNewWithBackend is a wrapper around g_settings_new_with_backend().
func SettingsNewWithBackendAndPath ¶
func SettingsNewWithBackendAndPath(schemaID string, backend *SettingsBackend, path string) *Settings
SettingsNewWithBackendAndPath is a wrapper around g_settings_new_with_backend_and_path().
func SettingsNewWithPath ¶
SettingsNewWithPath is a wrapper around g_settings_new_with_path().
func (*Settings) GetBoolean ¶
GetBoolean is a wrapper around g_settings_get_boolean().
func (*Settings) GetHasUnapplied ¶
GetHasUnapplied is a wrapper around g_settings_get_has_unapplied().
func (*Settings) IsWritable ¶
IsWritable is a wrapper around g_settings_is_writable().
func (*Settings) ListChildren ¶
ListChildren is a wrapper around g_settings_list_children().
func (*Settings) Revert ¶
func (v *Settings) Revert()
Revert is a wrapper around g_settings_revert().
func (*Settings) SetBoolean ¶
SetBoolean is a wrapper around g_settings_set_boolean().
type SettingsBackend ¶
type SettingsBackend struct {
*Object
}
SettingsBackend is a representation of GSettingsBackend.
func KeyfileSettingsBackendNew ¶
func KeyfileSettingsBackendNew(filename, rootPath, rootGroup string) *SettingsBackend
KeyfileSettingsBackendNew is a wrapper around g_keyfile_settings_backend_new().
func MemorySettingsBackendNew ¶
func MemorySettingsBackendNew() *SettingsBackend
MemorySettingsBackendNew is a wrapper around g_memory_settings_backend_new().
func NullSettingsBackendNew ¶
func NullSettingsBackendNew() *SettingsBackend
NullSettingsBackendNew is a wrapper around g_null_settings_backend_new().
func SettingsBackendGetDefault ¶
func SettingsBackendGetDefault() *SettingsBackend
SettingsBackendGetDefault is a wrapper around g_settings_backend_get_default().
func (*SettingsBackend) Native ¶
func (v *SettingsBackend) Native() unsafe.Pointer
type SettingsBindFlags ¶
type SettingsBindFlags int
SettingsBindFlags is a representation of GLib's GSettingsBindFlags.
const ( SETTINGS_BIND_DEFAULT SettingsBindFlags = C.G_SETTINGS_BIND_DEFAULT SETTINGS_BIND_GET SettingsBindFlags = C.G_SETTINGS_BIND_GET SETTINGS_BIND_SET SettingsBindFlags = C.G_SETTINGS_BIND_SET SETTINGS_BIND_NO_SENSITIVITY SettingsBindFlags = C.G_SETTINGS_BIND_NO_SENSITIVITY SETTINGS_BIND_GET_NO_CHANGES SettingsBindFlags = C.G_SETTINGS_BIND_GET_NO_CHANGES SETTINGS_BIND_INVERT_BOOLEAN SettingsBindFlags = C.G_SETTINGS_BIND_INVERT_BOOLEAN )
type SettingsSchema ¶
type SettingsSchema struct {
// contains filtered or unexported fields
}
SettingsSchema is a representation of GSettingsSchema.
func (*SettingsSchema) GetID ¶
func (v *SettingsSchema) GetID() string
GetID() is a wrapper around g_settings_schema_get_id().
func (*SettingsSchema) GetPath ¶
func (v *SettingsSchema) GetPath() string
GetPath() is a wrapper around g_settings_schema_get_path().
func (*SettingsSchema) HasKey ¶
func (v *SettingsSchema) HasKey(v1 string) bool
HasKey() is a wrapper around g_settings_schema_has_key().
func (*SettingsSchema) Native ¶
func (v *SettingsSchema) Native() unsafe.Pointer
func (*SettingsSchema) Ref ¶
func (v *SettingsSchema) Ref() *SettingsSchema
Ref() is a wrapper around g_settings_schema_ref().
func (*SettingsSchema) Unref ¶
func (v *SettingsSchema) Unref()
Unref() is a wrapper around g_settings_schema_unref().
type SettingsSchemaSource ¶
type SettingsSchemaSource struct {
// contains filtered or unexported fields
}
SettingsSchemaSource is a representation of GSettingsSchemaSource.
func SettingsSchemaSourceGetDefault ¶
func SettingsSchemaSourceGetDefault() *SettingsSchemaSource
SettingsSchemaSourceGetDefault is a wrapper around g_settings_schema_source_get_default().
func SettingsSchemaSourceNewFromDirectory ¶
func SettingsSchemaSourceNewFromDirectory(dir string, parent *SettingsSchemaSource, trusted bool) *SettingsSchemaSource
SettingsSchemaSourceNewFromDirectory() is a wrapper around g_settings_schema_source_new_from_directory().
func (*SettingsSchemaSource) ListSchemas ¶
func (v *SettingsSchemaSource) ListSchemas(recursive bool) (nonReolcatable, relocatable []string)
ListSchemas is a wrapper around g_settings_schema_source_list_schemas().
func (*SettingsSchemaSource) Lookup ¶
func (v *SettingsSchemaSource) Lookup(schema string, recursive bool) *SettingsSchema
Lookup() is a wrapper around g_settings_schema_source_lookup().
func (*SettingsSchemaSource) Native ¶
func (v *SettingsSchemaSource) Native() unsafe.Pointer
func (*SettingsSchemaSource) Ref ¶
func (v *SettingsSchemaSource) Ref() *SettingsSchemaSource
Ref() is a wrapper around g_settings_schema_source_ref().
func (*SettingsSchemaSource) Unref ¶
func (v *SettingsSchemaSource) Unref()
Unref() is a wrapper around g_settings_schema_source_unref().
type SignalHandle ¶
type SignalHandle uint
SignalHandle is the identifier for a connected glib signal on a specific object. It is returned when connecting a signal and can be used to disconnect the signal.
Important: This is only unique per object. Different objects can return the same SignalHandle for different signals.
type SimpleAction ¶
type SimpleAction struct {
Action
}
SimpleAction is a representation of GSimpleAction
func SimpleActionNew ¶
func SimpleActionNew(name string, parameterType *VariantType) *SimpleAction
SimpleActionNew is a wrapper around g_simple_action_new
func SimpleActionNewStateful ¶
func SimpleActionNewStateful(name string, parameterType *VariantType, state *Variant) *SimpleAction
SimpleActionNewStateful is a wrapper around g_simple_action_new_stateful
func (*SimpleAction) Native ¶
func (v *SimpleAction) Native() unsafe.Pointer
func (*SimpleAction) SetEnabled ¶
func (v *SimpleAction) SetEnabled(enabled bool)
SetEnabled is a wrapper around g_simple_action_set_enabled
func (*SimpleAction) SetState ¶
func (v *SimpleAction) SetState(value *Variant)
SetState is a wrapper around g_simple_action_set_state This should only be called by the implementor of the action. Users of the action should not attempt to directly modify the 'state' property. Instead, they should call ChangeState [g_action_change_state()] to request the change.
func (*SimpleAction) SetStateHint ¶
func (v *SimpleAction) SetStateHint(stateHint *Variant)
SetStateHint is a wrapper around g_simple_action_set_state_hint
type SimpleActionGroup ¶
type SimpleActionGroup struct { *Object // Interfaces IActionMap IActionGroup }
SimpleActionGroup is a representation of glib's GSimpleActionGroup
func SimpleActionGroupNew ¶
func SimpleActionGroupNew() *SimpleActionGroup
SimpleActionGroupNew is a wrapper around g_simple_action_group_new
func (*SimpleActionGroup) Native ¶
func (v *SimpleActionGroup) Native() unsafe.Pointer
type Socket ¶
type Socket struct {
*Object
}
func SocketNewFromFd ¶
func SocketNewFromFd[T constraints.Integer](fd T) (*Socket, error)
generic because fd is 'syscall.Handle' (uintptr) for Windows and 'int' for others just to have same code for all platforms.
type Source ¶
func MainCurrentSource ¶
func MainCurrentSource() *Source
MainCurrentSource is a wrapper around g_main_current_source().
func (*Source) IsDestroyed ¶
IsDestroyed is a wrapper around g_source_is_destroyed()
type SourceHandle ¶
type SourceHandle uint
func IdleAdd ¶
func IdleAdd(f interface{}, args ...interface{}) (SourceHandle, error)
IdleAdd adds an idle source to the default main event loop context. After running once, the source func will be removed from the main event loop, unless f returns a single bool true.
This function will cause a panic when f eventually runs if the types of args do not match those of f.
func TimeoutAdd ¶
func TimeoutAdd(timeout uint, f interface{}, args ...interface{}) (SourceHandle, error)
TimeoutAdd adds an timeout source to the default main event loop context. After running once, the source func will be removed from the main event loop, unless f returns a single bool true.
This function will cause a panic when f eventually runs if the types of args do not match those of f. timeout is in milliseconds
type Type ¶
type Type uint
Type is a representation of GLib's GType.
const ( TYPE_INVALID Type = C.G_TYPE_INVALID TYPE_NONE Type = C.G_TYPE_NONE TYPE_INTERFACE Type = C.G_TYPE_INTERFACE TYPE_CHAR Type = C.G_TYPE_CHAR TYPE_UCHAR Type = C.G_TYPE_UCHAR TYPE_BOOLEAN Type = C.G_TYPE_BOOLEAN TYPE_INT Type = C.G_TYPE_INT TYPE_UINT Type = C.G_TYPE_UINT TYPE_LONG Type = C.G_TYPE_LONG TYPE_ULONG Type = C.G_TYPE_ULONG TYPE_INT64 Type = C.G_TYPE_INT64 TYPE_UINT64 Type = C.G_TYPE_UINT64 TYPE_ENUM Type = C.G_TYPE_ENUM TYPE_FLAGS Type = C.G_TYPE_FLAGS TYPE_FLOAT Type = C.G_TYPE_FLOAT TYPE_DOUBLE Type = C.G_TYPE_DOUBLE TYPE_STRING Type = C.G_TYPE_STRING TYPE_POINTER Type = C.G_TYPE_POINTER TYPE_BOXED Type = C.G_TYPE_BOXED TYPE_PARAM Type = C.G_TYPE_PARAM TYPE_OBJECT Type = C.G_TYPE_OBJECT TYPE_VARIANT Type = C.G_TYPE_VARIANT )
var TYPE_SOCKET Type = Type(C.G_TYPE_SOCKET) // is function g_socket_get_type() inside macro, can't be const in Go
func RegisterGoType ¶
func RegisterGoType(name string, goObject interface{}, extends Extendable, interfaces ...Interface) Type
RegisterGoType is used to register an interface implemented in the Go runtime with the GType system. It takes the name to assign the type, the interface containing the object itself, and an Extendable denoting the types it extends. It's the responsibility of packages using these bindings to implement Extendables that call up to the ExtendsObject.InitClass included in this package during their own implementations. ClassSize and InitClass are ignored in the Extendable if the object does not implement a GoObjectSubclass.
Interfaces are optional and flags additional interfaces as implemented on the class. Similar to the extendables, libraries using these bindings can implement the Interface interface to provide support for other GInterfaces.
func TypeFromName ¶
TypeFromName is a wrapper around g_type_from_name
func TypeNextBase ¶
TypeNextBase is a wrapper around g_type_next_base
type TypeInstance ¶
type TypeInstance struct { // The GType corresponding to this GoType GType Type // A pointer to the underlying C instance being instantiated. GTypeInstance unsafe.Pointer // A representation of the GoType. NOTE: This is the instantiated GoType as passed // to RegisterGoType and is not that which is being instantiated. It is safe to use // to verify implemented methods, but should not be relied on for executing runtime // functionality. It CAN be used in rare cases where methods need to be implemented // that don't pass a pointer to the object implementing the method. GoType GoObjectSubclass }
TypeInstance is a loose binding around the glib GTypeInstance. It holds the information required to assign various capabilities of a GoObjectSubclass.
type TypeMarshaler ¶
type TypeMarshaler struct { T Type F GValueMarshaler }
TypeMarshaler represents an actual type and it's associated marshaler.
type UserDirectory ¶
type UserDirectory int
UserDirectory is a representation of GLib's GUserDirectory.
const ( USER_DIRECTORY_DESKTOP UserDirectory = C.G_USER_DIRECTORY_DESKTOP USER_DIRECTORY_DOCUMENTS UserDirectory = C.G_USER_DIRECTORY_DOCUMENTS USER_DIRECTORY_DOWNLOAD UserDirectory = C.G_USER_DIRECTORY_DOWNLOAD USER_DIRECTORY_MUSIC UserDirectory = C.G_USER_DIRECTORY_MUSIC USER_DIRECTORY_PICTURES UserDirectory = C.G_USER_DIRECTORY_PICTURES USER_DIRECTORY_PUBLIC_SHARE UserDirectory = C.G_USER_DIRECTORY_PUBLIC_SHARE USER_DIRECTORY_TEMPLATES UserDirectory = C.G_USER_DIRECTORY_TEMPLATES USER_DIRECTORY_VIDEOS UserDirectory = C.G_USER_DIRECTORY_VIDEOS )
type Value ¶
Value is a representation of GLib's GValue.
Don't allocate Values on the stack or heap manually as they may not be properly unset when going out of scope. Instead, use ValueAlloc(), which will set the runtime finalizer to unset the Value after it has left scope.
func GValue ¶
GValue converts a Go type to a comparable GValue. GValue() returns a non-nil error if the conversion was unsuccessful.
func ValueAlloc ¶
ValueAlloc allocates a Value and sets a runtime finalizer to call g_value_unset() on the underlying GValue after leaving scope. ValueAlloc() returns a non-nil error if the allocation failed.
func ValueFromNative ¶
ValueFromNative returns a type-asserted pointer to the Value.
func ValueFromNativeOwned ¶
ValueFromNativeOwned is the same as ValueFromNative except a finalizer is placed on the Value afterwards to clear it when it leaves scope.
func ValueInit ¶
ValueInit is a wrapper around g_value_init() and allocates and initializes a new Value with the Type t. A runtime finalizer is set to call g_value_unset() on the underlying GValue after leaving scope. ValueInit() returns a non-nil error if the allocation failed.
func (*Value) GetPointer ¶
GetPointer is a wrapper around g_value_get_pointer().
func (*Value) GetString ¶
GetString is a wrapper around g_value_get_string(). GetString() returns a non-nil error if g_value_get_string() returned a NULL pointer to distinguish between returning a NULL pointer and returning an empty string.
func (*Value) GoValue ¶
GoValue converts a Value to comparable Go type. GoValue() returns a non-nil error if the conversion was unsuccessful. The returned interface{} must be type asserted as the actual Go representation of the Value.
This function is a wrapper around the many g_value_get_*() functions, depending on the type of the Value. This will return non-native go-types if marshalers have been implemented for them.
func (*Value) SetInstance ¶
SetInstance is a wrapper around g_value_set_instance().
func (*Value) SetPointer ¶
SetPointer is a wrapper around g_value_set_pointer().
func (*Value) Type ¶
Type is a wrapper around the G_VALUE_HOLDS_GTYPE() macro and the g_value_get_gtype() function. GetType() returns TYPE_INVALID if v does not hold a Type, or otherwise returns the Type of v.
type ValueTransformer ¶
ValueTransformer is an interface that can be implemented by types bindings C types. When converting from go types to GValues, the value is checked for this implementation and will use it before considering other options.
type Variant ¶
A Variant is a representation of GLib's GVariant.
func TakeVariant ¶
TakeVariant wraps a unsafe.Pointer as a glib.Variant, taking ownership of it. This function is exported for visibility in other gotk3 packages and is not meant to be used by applications.
func VariantFromBoolean ¶
VariantFromBoolean is a wrapper around g_variant_new_boolean
func VariantFromByte ¶
VariantFromByte is a wrapper around g_variant_new_byte
func VariantFromInt16 ¶
VariantFromInt16 is a wrapper around g_variant_new_int16
func VariantFromInt32 ¶
VariantFromInt32 is a wrapper around g_variant_new_int32
func VariantFromInt64 ¶
VariantFromInt64 is a wrapper around g_variant_new_int64
func VariantFromString ¶
VariantFromString is a wrapper around g_variant_new_string/g_variant_new_take_string. Uses g_variant_new_take_string to reduce memory allocations if possible.
func VariantFromUint16 ¶
VariantFromUint16 is a wrapper around g_variant_new_uint16
func VariantFromUint32 ¶
VariantFromUint32 is a wrapper around g_variant_new_uint32
func VariantFromUint64 ¶
VariantFromUint64 is a wrapper around g_variant_new_uint64
func VariantFromVariant ¶
VariantFromVariant is a wrapper around g_variant_new_variant.
func (*Variant) AnnotatedString ¶
AnnotatedString wraps g_variant_print(), but returns a type-annotated string.
func (*Variant) GetBoolean ¶
GetBoolean returns the bool value of this variant.
func (*Variant) GetInt ¶
GetInt returns the int64 value of the variant if it is an integer type, and an error otherwise. It wraps variouns `g_variant_get_*` functions dealing with integers of different sizes.
func (*Variant) GetObjv ¶
GetObjv returns a slice of object paths from this variant. It wraps g_variant_get_objv, but returns copies of the strings instead.
func (*Variant) GetString ¶
GetString is a wrapper around g_variant_get_string. It returns the string value of the variant.
func (*Variant) GetStrv ¶
GetStrv returns a slice of strings from this variant. It wraps g_variant_get_strv, but returns copies of the strings instead.
func (*Variant) GetUint ¶
GetUint returns the uint64 value of the variant if it is an integer type, and an error otherwise. It wraps variouns `g_variant_get_*` functions dealing with integers of different sizes.
func (*Variant) GetVariant ¶
GetVariant is a wrapper around g_variant_get_variant. It unboxes a nested GVariant.
func (*Variant) IsContainer ¶
IsContainer returns true if the variant is a container and false otherwise.
func (*Variant) IsFloating ¶
IsFloating returns true if the variant has a floating reference count. Reference counting is usually handled in the gotk layer, most applications should not call this.
func (*Variant) IsType ¶
func (v *Variant) IsType(t *VariantType) bool
IsType returns true if the variant's type matches t.
func (*Variant) Ref ¶
func (v *Variant) Ref()
Ref is a wrapper around g_variant_ref. Reference counting is usually handled in the gotk layer, most applications should not need to call this.
func (*Variant) RefSink ¶
func (v *Variant) RefSink()
RefSink is a wrapper around g_variant_ref_sink. Reference counting is usually handled in the gotk layer, most applications should not need to call this.
func (*Variant) String ¶
String wraps g_variant_print(). It returns a string understood by g_variant_parse().
func (*Variant) TakeRef ¶
func (v *Variant) TakeRef()
TakeRef is a wrapper around g_variant_take_ref. Reference counting is usually handled in the gotk layer, most applications should not need to call this.
func (*Variant) ToGVariant ¶
ToGVariant exposes the underlying *C.GVariant type for this Variant, necessary to implement IVariant.
func (*Variant) Type ¶
func (v *Variant) Type() *VariantType
Type returns the VariantType for this variant.
func (*Variant) TypeString ¶
TypeString returns the g variant type string for this variant.
type VariantBuilder ¶
type VariantBuilder struct {
GVariantBuilder *C.GVariantBuilder
}
VariantBuilder is a representation of GLib's VariantBuilder.
func (*VariantBuilder) Native ¶
func (v *VariantBuilder) Native() unsafe.Pointer
Native returns a pointer to the underlying GVariantBuilder.
type VariantClass ¶
type VariantClass int
const ( VARIANT_CLASS_BOOLEAN VariantClass = C.G_VARIANT_CLASS_BOOLEAN //The GVariant is a boolean. VARIANT_CLASS_BYTE VariantClass = C.G_VARIANT_CLASS_BYTE //The GVariant is a byte. VARIANT_CLASS_INT16 VariantClass = C.G_VARIANT_CLASS_INT16 //The GVariant is a signed 16 bit integer. VARIANT_CLASS_UINT16 VariantClass = C.G_VARIANT_CLASS_UINT16 //The GVariant is an unsigned 16 bit integer. VARIANT_CLASS_INT32 VariantClass = C.G_VARIANT_CLASS_INT32 //The GVariant is a signed 32 bit integer. VARIANT_CLASS_UINT32 VariantClass = C.G_VARIANT_CLASS_UINT32 //The GVariant is an unsigned 32 bit integer. VARIANT_CLASS_INT64 VariantClass = C.G_VARIANT_CLASS_INT64 //The GVariant is a signed 64 bit integer. VARIANT_CLASS_UINT64 VariantClass = C.G_VARIANT_CLASS_UINT64 //The GVariant is an unsigned 64 bit integer. VARIANT_CLASS_HANDLE VariantClass = C.G_VARIANT_CLASS_HANDLE //The GVariant is a file handle index. VARIANT_CLASS_DOUBLE VariantClass = C.G_VARIANT_CLASS_DOUBLE //The GVariant is a double precision floating point value. VARIANT_CLASS_STRING VariantClass = C.G_VARIANT_CLASS_STRING //The GVariant is a normal string. VARIANT_CLASS_OBJECT_PATH VariantClass = C.G_VARIANT_CLASS_OBJECT_PATH //The GVariant is a D-Bus object path string. VARIANT_CLASS_SIGNATURE VariantClass = C.G_VARIANT_CLASS_SIGNATURE //The GVariant is a D-Bus signature string. VARIANT_CLASS_VARIANT VariantClass = C.G_VARIANT_CLASS_VARIANT //The GVariant is a variant. VARIANT_CLASS_MAYBE VariantClass = C.G_VARIANT_CLASS_MAYBE //The GVariant is a maybe-typed value. VARIANT_CLASS_ARRAY VariantClass = C.G_VARIANT_CLASS_ARRAY //The GVariant is an array. VARIANT_CLASS_TUPLE VariantClass = C.G_VARIANT_CLASS_TUPLE //The GVariant is a tuple. VARIANT_CLASS_DICT_ENTRY VariantClass = C.G_VARIANT_CLASS_DICT_ENTRY //The GVariant is a dictionary entry. )
type VariantDict ¶
type VariantDict struct {
GVariantDict *C.GVariantDict
}
VariantDict is a representation of GLib's VariantDict.
func (*VariantDict) Native ¶
func (v *VariantDict) Native() unsafe.Pointer
Native returns a pointer to the underlying GVariantDict.
type VariantIter ¶
type VariantIter struct {
GVariantIter *C.GVariantIter
}
VariantIter is a representation of GLib's GVariantIter.
func (*VariantIter) Native ¶
func (v *VariantIter) Native() unsafe.Pointer
Native returns a pointer to the underlying GVariantIter.
type VariantType ¶
type VariantType struct {
GVariantType *C.GVariantType
}
A VariantType is a wrapper for the GVariantType, which encodes type information for GVariants.
func VariantTypeNew ¶
func VariantTypeNew(typeString string) *VariantType
VariantTypeNew is a wrapper around g_variant_type_new.
func (*VariantType) Free ¶
func (v *VariantType) Free()
Free is a wrapper around g_variant_type_free. Reference counting is usually handled in the gotk layer, most applications should not call this.
func (*VariantType) IsSubtypeOf ¶
func (v *VariantType) IsSubtypeOf(supertype *VariantType) bool
IsSubtypeOf is a wrapper around g_variant_type_is_subtype_of
func (*VariantType) String ¶
func (v *VariantType) String() string
String returns a copy of this VariantType's type string.
Source Files ¶
- application.go
- connect.go
- gaction.go
- gactiongroup.go
- gactionmap.go
- gasyncresult.go
- gbinding.go
- gbytes.go
- gcancellable.go
- gfile.go
- gicon.go
- giostream.go
- glib.go
- glib_extension.go
- glib_since_2_42.go
- glib_since_2_44.go
- glib_since_2_64.go
- gmain_context.go
- gmainloop.go
- go_object.go
- go_object_exports.go
- gobject.go
- gobjectclass.go
- gparamspec.go
- gparamspec_constructors.go
- gsimpleactiongroup.go
- gsocket.go
- gsource.go
- gvalue.go
- gvariant.go
- gvariantbuilder.go
- gvariantclass.go
- gvariantdict.go
- gvariantiter.go
- gvarianttype.go
- list.go
- menu.go
- notifications.go
- register.go
- settings.go
- settings_backend.go
- settings_schema.go
- settings_schema_source.go
- slist.go