Documentation ¶
Overview ¶
Package glib provides Go bindings for GLib 2. Supports version 2.36 and later.
Index ¶
- Constants
- Variables
- func ApplicationIDIsValid(id string) bool
- func ClosureNew(f interface{}, marshalData ...interface{}) (*C.GClosure, error)
- func GetApplicationName() 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 ToGObject(p unsafe.Pointer) *C.GObject
- 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) GetIsRegistered() bool
- func (v *Application) GetIsRemote() bool
- func (v *Application) Hold()
- func (v *Application) MarkBusy()
- func (v *Application) Native() uintptr
- 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) UnmarkBusy()
- func (v *Application) WithdrawNotification(id string)
- type ApplicationFlags
- type GValueMarshaler
- type IGlibConvert
- type IObject
- type InitiallyUnowned
- type List
- func (v *List) Append(data uintptr) *List
- func (v *List) Data() interface{}
- func (v *List) DataWrapper(fn func(unsafe.Pointer) interface{})
- 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 uintptr, position int) *List
- func (v *List) Length() uint
- func (v *List) Native() uintptr
- func (v *List) Next() *List
- func (v *List) Nth(n uint) *List
- func (v *List) NthData(n uint) interface{}
- func (v *List) Prepend(data uintptr) *List
- func (v *List) Previous() *List
- type MainContext
- type Menu
- func (v *Menu) Append(label, detailed_action string)
- func (v *Menu) AppendItem(item *MenuItem)
- func (v *Menu) AppendSection(label string, section *MenuModel)
- func (v *Menu) AppendSubmenu(label string, submenu *MenuModel)
- func (v *Menu) Freeze()
- func (v *Menu) Insert(position int, label, detailed_action string)
- func (v *Menu) InsertItem(position int, item *MenuItem)
- func (v *Menu) InsertSection(position int, label string, section *MenuModel)
- func (v *Menu) InsertSubmenu(position int, label string, submenu *MenuModel)
- func (v *Menu) Prepend(label, detailed_action string)
- func (v *Menu) PrependItem(item *MenuItem)
- func (v *Menu) PrependSection(label string, section *MenuModel)
- func (v *Menu) PrependSubmenu(label string, submenu *MenuModel)
- func (v *Menu) Remove(position int)
- func (v *Menu) RemoveAll()
- type MenuItem
- type MenuModel
- type Notification
- type Object
- 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) 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) Native() uintptr
- func (v *Object) Ref()
- 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) StopEmission(s string)
- func (v *Object) TypeFromInstance() Type
- func (v *Object) Unref()
- type Quark
- type 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) GetUInt(name string) uint
- func (v *Settings) IsWritable(name string) bool
- func (v *Settings) ListChildren() []string
- func (v *Settings) Native() uintptr
- 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) SetUInt(name string, value uint) bool
- type SettingsBackend
- type SettingsSchema
- type SettingsSchemaSource
- type Signal
- type SignalHandle
- type Source
- type SourceHandle
- type Type
- 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) Native() unsafe.Pointer
- func (v *Value) SetBool(val bool)
- func (v *Value) SetDouble(val float64)
- func (v *Value) SetFloat(val float32)
- func (v *Value) SetInstance(instance uintptr)
- func (v *Value) SetInt(val int)
- func (v *Value) SetInt64(val int64)
- func (v *Value) SetPointer(p uintptr)
- 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)
- type VariantClass
Constants ¶
const USER_N_DIRECTORIES int = C.G_USER_N_DIRECTORIES
Variables ¶
var (
IGlibConvertType reflect.Type
)
Functions ¶
func ApplicationIDIsValid ¶
ApplicationIDIsValid is a wrapper around g_application_id_is_valid().
func ClosureNew ¶
ClosureNew creates a new GClosure and adds its callback function to the internally-maintained map. It's exported for visibility to other gotk3 packages and shouldn't be used in application code.
func GetApplicationName ¶
func GetApplicationName() string
GetApplicationName is a wrapper around g_get_application_name().
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 witha 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().
Types ¶
type Application ¶
type Application struct {
*Object
}
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) 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) 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() uintptr
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) 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 GValueMarshaler ¶
GValueMarshaler is a marshal function to convert a GValue into an appropiate Go type. The uintptr parameter is a *C.GValue.
type IGlibConvert ¶
type IGlibConvert interface { // If convertion can't be done, function have 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 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 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() uintptr
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 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{}
DataWrapped 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 NthDataWrapped() and DataWrapped(). 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 arguement 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 ¶
NthDataWrapped 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().
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) 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) 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) PrependSubmenu ¶
PrependSubmenu is a wrapper around g_menu_prepend_submenu().
type MenuItem ¶
type MenuItem struct {
*Object
}
MenuItem is a representation of GMenuItem.
func MenuItemNew ¶
MenuItemNew is a wrapper around g_menu_item_new().
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 (*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().
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() uintptr
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) SetTitle ¶
func (v *Notification) SetTitle(title string)
SetTitle is a wrapper around g_notification_set_title().
type Object ¶
Object is a representation of GLib's GObject.
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 must be type asserted as the Go equivalent type to the return value for native C callback.
Note that this code is unsafe in that the types of values in args are not checked against whether they are suitable for the callback.
func (*Object) ForceFloating ¶
func (v *Object) ForceFloating()
ForceFloating is a wrapper around g_object_force_floating().
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) 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().
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().
type SList ¶
type SList struct {
// contains filtered or unexported fields
}
SList is a representation of Glib's GSList.
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() uintptr
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() uintptr
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) 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() uintptr
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
type Source ¶
func MainCurrentSource ¶
func MainCurrentSource() *Source
MainCurrentSource is a wrapper around g_main_current_source().
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 )
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 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.
func (*Value) SetInstance ¶
SetInstance is a wrapper around g_value_set_instance().
func (*Value) SetPointer ¶
SetPointer is a wrapper around g_value_set_pointer().
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. )