gotk3: github.com/gotk3/gotk3/glib Index | Files

package glib

import "github.com/gotk3/gotk3/glib"

Package glib provides Go bindings for GLib 2. Supports version 2.36 and later.

Index

Package Files

application.go connect.go gaction.go gactiongroup.go gactionmap.go gbinding.go glib.go glib_extension.go gmain_context.go gsimpleactiongroup.go gsource.go gvariant.go gvariantbuilder.go gvariantclass.go gvariantdict.go gvariantiter.go gvarianttype.go list.go menu.go notifications.go settings.go settings_backend.go settings_schema.go settings_schema_source.go slist.go

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 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_ANY               = newVariantType(C._G_VARIANT_TYPE_ANY)
    VARIANT_TYPE_BASIC             = newVariantType(C._G_VARIANT_TYPE_BASIC)
    VARIANT_TYPE_TUPLE             = newVariantType(C._G_VARIANT_TYPE_TUPLE)
    VARIANT_TYPE_UNIT              = newVariantType(C._G_VARIANT_TYPE_UNIT)
    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.

var (
    IGlibConvertType reflect.Type
)

func ActionNameIsValid Uses

func ActionNameIsValid(actionName string) bool

ActionNameIsValid is a wrapper around g_action_name_is_valid

func ApplicationIDIsValid Uses

func ApplicationIDIsValid(id string) bool

ApplicationIDIsValid is a wrapper around g_application_id_is_valid().

func ClosureNew Uses

func ClosureNew(f interface{}, marshalData ...interface{}) (*C.GClosure, error)

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 Uses

func GetApplicationName() string

GetApplicationName is a wrapper around g_get_application_name().

func GetHomeDir Uses

func GetHomeDir() string

GetHomeDir is a wrapper around g_get_home_dir().

func GetUserCacheDir Uses

func GetUserCacheDir() string

GetUserCacheDir is a wrapper around g_get_user_cache_dir().

func GetUserConfigDir Uses

func GetUserConfigDir() string

GetUserConfigDir is a wrapper around g_get_user_config_dir().

func GetUserDataDir Uses

func GetUserDataDir() string

GetUserDataDir is a wrapper around g_get_user_data_dir().

func GetUserRuntimeDir Uses

func GetUserRuntimeDir() string

GetUserRuntimeDir is a wrapper around g_get_user_runtime_dir().

func GetUserSpecialDir Uses

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 InitI18n Uses

func InitI18n(domain string, dir string)

InitI18n initializes the i18n subsystem.

func Local Uses

func Local(input string) string

Local localizes a string using gettext

func MainDepth Uses

func MainDepth() int

MainDepth is a wrapper around g_main_depth().

func RegisterGValueMarshalers Uses

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 Uses

func SetApplicationName(name string)

SetApplicationName is a wrapper around g_set_application_name().

func SettingsSync Uses

func SettingsSync()

SettingsSync is a wrapper around g_settings_sync().

func SourceRemove Uses

func SourceRemove(src SourceHandle) bool

SourceRemove is a wrapper around g_source_remove()

func ToGObject Uses

func ToGObject(p unsafe.Pointer) *C.GObject

ToGObject type converts an unsafe.Pointer as a native C GObject. This function is exported for visibility in other gotk3 packages and is not meant to be used by applications.

type Action Uses

type Action struct {
    *Object
}

Action is a representation of glib's GAction GInterface.

func (*Action) Activate Uses

func (v *Action) Activate(parameter *Variant)

Activate is a wrapper around g_action_activate

func (*Action) ChangeState Uses

func (v *Action) ChangeState(value *Variant)

ChangeState is a wrapper around g_action_change_state

func (*Action) GetEnabled Uses

func (v *Action) GetEnabled() bool

GetEnabled is a wrapper around g_action_get_enabled

func (*Action) GetName Uses

func (v *Action) GetName() string

GetName is a wrapper around g_action_get_name

func (*Action) GetParameterType Uses

func (v *Action) GetParameterType() *VariantType

GetParameterType is a wrapper around g_action_get_parameter_type

func (*Action) GetState Uses

func (v *Action) GetState() *Variant

GetState is a wrapper around g_action_get_state

func (*Action) GetStateHint Uses

func (v *Action) GetStateHint() *Variant

GetStateHint is a wrapper around g_action_get_state_hint

func (*Action) GetStateType Uses

func (v *Action) GetStateType() *VariantType

GetStateType is a wrapper around g_action_get_state_type

func (*Action) Native Uses

func (v *Action) Native() uintptr

type ActionGroup Uses

type ActionGroup struct {
    *Object
}

ActionGroup is a representation of glib's GActionGroup GInterface

func (*ActionGroup) Activate Uses

func (v *ActionGroup) Activate(actionName string, parameter *Variant)

Activate is a wrapper around g_action_group_activate_action

func (*ActionGroup) ChangeActionState Uses

func (v *ActionGroup) ChangeActionState(actionName string, value *Variant)

ChangeActionState is a wrapper around g_action_group_change_action_state

func (*ActionGroup) GetActionEnabled Uses

func (v *ActionGroup) GetActionEnabled(actionName string) bool

GetActionEnabled is a wrapper around g_action_group_get_action_enabled().

func (*ActionGroup) GetActionParameterType Uses

func (v *ActionGroup) GetActionParameterType(actionName string) *VariantType

GetActionParameterType is a wrapper around g_action_group_get_action_parameter_type().

func (*ActionGroup) GetActionState Uses

func (v *ActionGroup) GetActionState(actionName string) *Variant

GetActionState is a wrapper around g_action_group_get_action_state().

func (*ActionGroup) GetActionStateHint Uses

func (v *ActionGroup) GetActionStateHint(actionName string) *Variant

GetActionStateHint is a wrapper around g_action_group_get_action_state_hint().

func (*ActionGroup) GetActionStateType Uses

func (v *ActionGroup) GetActionStateType(actionName string) *VariantType

GetActionStateType is a wrapper around g_action_group_get_action_state_type().

func (*ActionGroup) HasAction Uses

func (v *ActionGroup) HasAction(actionName string) bool

HasAction is a wrapper around g_action_group_has_action().

func (*ActionGroup) Native Uses

func (v *ActionGroup) Native() uintptr

type ActionMap Uses

type ActionMap struct {
    *Object
}

ActionMap is a representation of glib's GActionMap GInterface

func (*ActionMap) AddAction Uses

func (v *ActionMap) AddAction(action IAction)

AddAction is a wrapper around g_action_map_add_action

func (*ActionMap) LookupAction Uses

func (v *ActionMap) LookupAction(actionName string) *Action

LookupAction is a wrapper around g_action_map_lookup_action

func (*ActionMap) Native Uses

func (v *ActionMap) Native() uintptr

func (*ActionMap) RemoveAction Uses

func (v *ActionMap) RemoveAction(actionName string)

RemoveAction is a wrapper around g_action_map_remove_action

type Application Uses

type Application struct {
    *Object

    // Interfaces
    IActionMap
    IActionGroup
}

Application is a representation of GApplication.

func ApplicationGetDefault Uses

func ApplicationGetDefault() *Application

ApplicationGetDefault is a wrapper around g_application_get_default().

func ApplicationNew Uses

func ApplicationNew(appID string, flags ApplicationFlags) *Application

ApplicationNew is a wrapper around g_application_new().

func (*Application) Activate Uses

func (v *Application) Activate()

Activate is a wrapper around g_application_activate().

func (*Application) GetApplicationID Uses

func (v *Application) GetApplicationID() string

GetApplicationID is a wrapper around g_application_get_application_id().

func (*Application) GetDbusObjectPath Uses

func (v *Application) GetDbusObjectPath() string

GetDbusObjectPath is a wrapper around g_application_get_dbus_object_path().

func (*Application) GetFlags Uses

func (v *Application) GetFlags() ApplicationFlags

GetFlags is a wrapper around g_application_get_flags().

func (*Application) GetInactivityTimeout Uses

func (v *Application) GetInactivityTimeout() uint

GetInactivityTimeout is a wrapper around g_application_get_inactivity_timeout().

func (*Application) GetIsRegistered Uses

func (v *Application) GetIsRegistered() bool

GetIsRegistered is a wrapper around g_application_get_is_registered().

func (*Application) GetIsRemote Uses

func (v *Application) GetIsRemote() bool

GetIsRemote is a wrapper around g_application_get_is_remote().

func (*Application) Hold Uses

func (v *Application) Hold()

Hold is a wrapper around g_application_hold().

func (*Application) MarkBusy Uses

func (v *Application) MarkBusy()

MarkBusy is a wrapper around g_application_mark_busy().

func (*Application) Native Uses

func (v *Application) Native() uintptr

func (*Application) Quit Uses

func (v *Application) Quit()

Quit is a wrapper around g_application_quit().

func (*Application) Release Uses

func (v *Application) Release()

Release is a wrapper around g_application_release().

func (*Application) Run Uses

func (v *Application) Run(args []string) int

Run is a wrapper around g_application_run().

func (*Application) SendNotification Uses

func (v *Application) SendNotification(id string, notification *Notification)

SendNotification is a wrapper around g_application_send_notification().

func (*Application) SetApplicationID Uses

func (v *Application) SetApplicationID(id string)

SetApplicationID is a wrapper around g_application_set_application_id().

func (*Application) SetDefault Uses

func (v *Application) SetDefault()

SetDefault is a wrapper around g_application_set_default().

func (*Application) SetFlags Uses

func (v *Application) SetFlags(flags ApplicationFlags)

SetFlags is a wrapper around g_application_set_flags().

func (*Application) SetInactivityTimeout Uses

func (v *Application) SetInactivityTimeout(timeout uint)

SetInactivityTimeout is a wrapper around g_application_set_inactivity_timeout().

func (*Application) UnmarkBusy Uses

func (v *Application) UnmarkBusy()

UnmarkBusy is a wrapper around g_application_unmark_busy().

func (*Application) WithdrawNotification Uses

func (v *Application) WithdrawNotification(id string)

WithdrawNotification is a wrapper around g_application_withdraw_notification().

type ApplicationFlags Uses

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 Binding Uses

type Binding struct {
    *Object
}

func BindProperty Uses

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 Uses

func (v *Binding) GetFlags() BindingFlags

Retrieves the flags passed when constructing the GBinding.

func (*Binding) GetSource Uses

func (v *Binding) GetSource() *Object

Retrieves the GObject instance used as the source of the binding

func (*Binding) GetSourceProperty Uses

func (v *Binding) GetSourceProperty() string

Retrieves the name of the property of “source” used as the source of the binding.

func (*Binding) GetTarget Uses

func (v *Binding) GetTarget() *Object

Retrieves the GObject instance used as the target of the binding.

func (*Binding) GetTargetProperty Uses

func (v *Binding) GetTargetProperty() string

Retrieves the name of the property of “target” used as the target of the binding.

func (*Binding) Unbind Uses

func (v *Binding) Unbind()

Explicitly releases the binding between the source and the target property expressed by Binding

type BindingFlags Uses

type BindingFlags int

type GValueMarshaler Uses

type GValueMarshaler func(uintptr) (interface{}, error)

GValueMarshaler is a marshal function to convert a GValue into an appropriate Go type. The uintptr parameter is a *C.GValue.

type IAction Uses

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 Uses

type IActionGroup interface {
    Native() uintptr

    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 Uses

type IActionMap interface {
    Native() uintptr

    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 IGlibConvert Uses

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 IObject Uses

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 Uses

type IVariant interface {
    ToGVariant() *C.GVariant
    ToVariant() *Variant
}

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 InitiallyUnowned Uses

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 Uses

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 Uses

type List struct {
    // contains filtered or unexported fields
}

List is a representation of Glib's GList.

func WrapList Uses

func WrapList(obj uintptr) *List

func (*List) Append Uses

func (v *List) Append(data uintptr) *List

Append is a wrapper around g_list_append().

func (*List) Data Uses

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 Uses

func (v *List) DataWrapper(fn func(unsafe.Pointer) interface{})

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 Uses

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) Free Uses

func (v *List) Free()

Free is a wrapper around g_list_free().

func (*List) FreeFull Uses

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) Insert Uses

func (v *List) Insert(data uintptr, position int) *List

Insert is a wrapper around g_list_insert().

func (*List) Length Uses

func (v *List) Length() uint

Length is a wrapper around g_list_length().

func (*List) Native Uses

func (v *List) Native() uintptr

func (*List) Next Uses

func (v *List) Next() *List

Next is a wrapper around the next struct field

func (*List) Nth Uses

func (v *List) Nth(n uint) *List

Nth() is a wrapper around g_list_nth().

func (*List) NthData Uses

func (v *List) NthData(n uint) interface{}

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.

func (*List) Prepend Uses

func (v *List) Prepend(data uintptr) *List

Prepend is a wrapper around g_list_prepend().

func (*List) Previous Uses

func (v *List) Previous() *List

Previous is a wrapper around the prev struct field

type MainContext Uses

type MainContext C.GMainContext

func MainContextDefault Uses

func MainContextDefault() *MainContext

MainContextDefault is a wrapper around g_main_context_default().

func (*MainContext) FindSourceById Uses

func (v *MainContext) FindSourceById(hdlSrc SourceHandle) *Source

FindSourceById is a wrapper around g_main_context_find_source_by_id()

func (*MainContext) Pending Uses

func (v *MainContext) Pending(src SourceHandle) bool

SourceRemove is a wrapper around g_main_context_pending()

type Menu struct {
    MenuModel
}

Menu is a representation of GMenu.

func MenuNew() *Menu

MenuNew is a wrapper around g_menu_new().

func (v *Menu) Append(label, detailed_action string)

Append is a wrapper around g_menu_append().

func (v *Menu) AppendItem(item *MenuItem)

AppendItem is a wrapper around g_menu_append_item().

func (v *Menu) AppendSection(label string, section *MenuModel)

AppendSection is a wrapper around g_menu_append_section().

func (v *Menu) AppendSectionWithoutLabel(section *MenuModel)

AppendSectionWithoutLabel is a wrapper around g_menu_append_section() with label set to null.

func (v *Menu) AppendSubmenu(label string, submenu *MenuModel)

AppendSubmenu is a wrapper around g_menu_append_submenu().

func (v *Menu) Freeze()

Freeze is a wrapper around g_menu_freeze().

func (v *Menu) Insert(position int, label, detailed_action string)

Insert is a wrapper around g_menu_insert().

func (v *Menu) InsertItem(position int, item *MenuItem)

InsertItem is a wrapper around g_menu_insert_item().

func (v *Menu) InsertSection(position int, label string, section *MenuModel)

InsertSection is a wrapper around g_menu_insert_section().

func (v *Menu) InsertSectionWithoutLabel(position int, section *MenuModel)

InsertSectionWithoutLabel is a wrapper around g_menu_insert_section() with label set to null.

func (v *Menu) InsertSubmenu(position int, label string, submenu *MenuModel)

InsertSubmenu is a wrapper around g_menu_insert_submenu().

func (v *Menu) Prepend(label, detailed_action string)

Prepend is a wrapper around g_menu_prepend().

func (v *Menu) PrependItem(item *MenuItem)

PrependItem is a wrapper around g_menu_prepend_item().

func (v *Menu) PrependSection(label string, section *MenuModel)

PrependSection is a wrapper around g_menu_prepend_section().

func (v *Menu) PrependSectionWithoutLabel(section *MenuModel)

PrependSectionWithoutLabel is a wrapper around g_menu_prepend_section() with label set to null.

func (v *Menu) PrependSubmenu(label string, submenu *MenuModel)

PrependSubmenu is a wrapper around g_menu_prepend_submenu().

func (v *Menu) Remove(position int)

Remove is a wrapper around g_menu_remove().

func (v *Menu) RemoveAll()

RemoveAll is a wrapper around g_menu_remove_all().

type MenuItem struct {
    *Object
}

MenuItem is a representation of GMenuItem.

func MenuItemNew(label, detailed_action string) *MenuItem

MenuItemNew is a wrapper around g_menu_item_new().

func MenuItemNewFromModel(model *MenuModel, index int) *MenuItem

MenuItemNewFromModel is a wrapper around g_menu_item_new_from_model().

func MenuItemNewSection(label string, section *MenuModel) *MenuItem

MenuItemNewSection is a wrapper around g_menu_item_new_section().

func MenuItemNewSubmenu(label string, submenu *MenuModel) *MenuItem

MenuItemNewSubmenu is a wrapper around g_menu_item_new_submenu().

func (v *MenuItem) GetLink(link string) *MenuModel

GetLink is a wrapper around g_menu_item_get_link().

func (v *MenuItem) SetDetailedAction(act string)

SetDetailedAction is a wrapper around g_menu_item_set_detailed_action().

func (v *MenuItem) SetLabel(label string)

SetLabel is a wrapper around g_menu_item_set_label().

func (v *MenuItem) SetLink(link string, model *MenuModel)

SetLink is a wrapper around g_menu_item_Set_link().

func (v *MenuItem) SetSection(section *MenuModel)

SetSection is a wrapper around g_menu_item_set_section().

func (v *MenuItem) SetSubmenu(submenu *MenuModel)

SetSubmenu is a wrapper around g_menu_item_set_submenu().

type MenuModel struct {
    *Object
}

MenuModel is a representation of GMenuModel.

func (v *MenuModel) GetItemLink(index int, link string) *MenuModel

GetItemLink is a wrapper around g_menu_model_get_item_link().

func (v *MenuModel) GetNItems() int

GetNItems is a wrapper around g_menu_model_get_n_items().

func (v *MenuModel) IsMutable() bool

IsMutable is a wrapper around g_menu_model_is_mutable().

func (v *MenuModel) ItemsChanged(position, removed, added int)

ItemsChanged is a wrapper around g_menu_model_items_changed().

func (v *MenuModel) Native() uintptr

type Notification Uses

type Notification struct {
    *Object
}

Notification is a representation of GNotification.

func NotificationNew Uses

func NotificationNew(title string) *Notification

NotificationNew is a wrapper around g_notification_new().

func (*Notification) AddButton Uses

func (v *Notification) AddButton(label, detailedAction string)

AddButton is a wrapper around g_notification_add_button().

func (*Notification) Native Uses

func (v *Notification) Native() uintptr

func (*Notification) SetBody Uses

func (v *Notification) SetBody(body string)

SetBody is a wrapper around g_notification_set_body().

func (*Notification) SetDefaultAction Uses

func (v *Notification) SetDefaultAction(detailedAction string)

SetDefaultAction is a wrapper around g_notification_set_default_action().

func (*Notification) SetTitle Uses

func (v *Notification) SetTitle(title string)

SetTitle is a wrapper around g_notification_set_title().

type Object Uses

type Object struct {
    GObject *C.GObject
}

Object is a representation of GLib's GObject.

func Take Uses

func Take(ptr unsafe.Pointer) *Object

Take wraps a unsafe.Pointer as a glib.Object, taking ownership of it. This function is exported for visibility in other gotk3 packages and is not meant to be used by applications.

func (*Object) Connect Uses

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 Uses

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 Uses

func (v *Object) Emit(s string, args ...interface{}) (interface{}, error)

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 Uses

func (v *Object) ForceFloating()

ForceFloating is a wrapper around g_object_force_floating().

func (*Object) GetProperty Uses

func (v *Object) GetProperty(name string) (interface{}, error)

GetProperty is a wrapper around g_object_get_property().

func (*Object) GetPropertyType Uses

func (v *Object) GetPropertyType(name string) (Type, error)

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 Uses

func (v *Object) HandlerBlock(handle SignalHandle)

HandlerBlock is a wrapper around g_signal_handler_block().

func (*Object) HandlerDisconnect Uses

func (v *Object) HandlerDisconnect(handle SignalHandle)

HandlerDisconnect is a wrapper around g_signal_handler_disconnect().

func (*Object) HandlerUnblock Uses

func (v *Object) HandlerUnblock(handle SignalHandle)

HandlerUnblock is a wrapper around g_signal_handler_unblock().

func (*Object) IsA Uses

func (v *Object) IsA(typ Type) bool

IsA is a wrapper around g_type_is_a().

func (*Object) IsFloating Uses

func (v *Object) IsFloating() bool

IsFloating is a wrapper around g_object_is_floating().

func (*Object) Native Uses

func (v *Object) Native() uintptr

Native returns a pointer to the underlying GObject.

func (*Object) Ref Uses

func (v *Object) Ref()

Ref is a wrapper around g_object_ref().

func (*Object) RefSink Uses

func (v *Object) RefSink()

RefSink is a wrapper around g_object_ref_sink().

func (*Object) Set Uses

func (v *Object) Set(name string, value interface{}) error

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 Uses

func (v *Object) SetProperty(name string, value interface{}) error

SetProperty is a wrapper around g_object_set_property().

func (*Object) StopEmission Uses

func (v *Object) StopEmission(s string)

StopEmission is a wrapper around g_signal_stop_emission_by_name().

func (*Object) TypeFromInstance Uses

func (v *Object) TypeFromInstance() Type

TypeFromInstance is a wrapper around g_type_from_instance().

func (*Object) Unref Uses

func (v *Object) Unref()

Unref is a wrapper around g_object_unref().

type PropertyAction Uses

type PropertyAction struct {
    Action
}

PropertyAction is a representation of GPropertyAction

func PropertyActionNew Uses

func PropertyActionNew(name string, object *Object, propertyName string) *PropertyAction

PropertyActionNew is a wrapper around g_property_action_new

func (*PropertyAction) Native Uses

func (v *PropertyAction) Native() uintptr

type Quark Uses

type Quark uint32

type SList Uses

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 WrapSList Uses

func WrapSList(obj uintptr) *SList

func (*SList) Append Uses

func (v *SList) Append(data uintptr) *SList

func (*SList) Foreach Uses

func (v *SList) Foreach(fn func(ptr unsafe.Pointer))

Foreach acts the same as g_slist_foreach(). No user_data argument is implemented because of Go clojure capabilities.

func (*SList) Free Uses

func (v *SList) Free()

Free is a wrapper around g_slist_free().

func (*SList) FreeFull Uses

func (v *SList) FreeFull()

FreeFull is a wrapper around g_slist_free_full().

func (*SList) Length Uses

func (v *SList) Length() uint

Length is a wrapper around g_slist_length().

func (*SList) Native Uses

func (v *SList) Native() uintptr

func (*SList) Next Uses

func (v *SList) Next() *SList

Next is a wrapper around the next struct field

type Settings Uses

type Settings struct {
    *Object
}

Settings is a representation of GSettings.

func SettingsNew Uses

func SettingsNew(schemaID string) *Settings

SettingsNew is a wrapper around g_settings_new().

func SettingsNewFull Uses

func SettingsNewFull(schema *SettingsSchema, backend *SettingsBackend, path string) *Settings

SettingsNewFull is a wrapper around g_settings_new_full().

func SettingsNewWithBackend Uses

func SettingsNewWithBackend(schemaID string, backend *SettingsBackend) *Settings

SettingsNewWithBackend is a wrapper around g_settings_new_with_backend().

func SettingsNewWithBackendAndPath Uses

func SettingsNewWithBackendAndPath(schemaID string, backend *SettingsBackend, path string) *Settings

SettingsNewWithBackendAndPath is a wrapper around g_settings_new_with_backend_and_path().

func SettingsNewWithPath Uses

func SettingsNewWithPath(schemaID, path string) *Settings

SettingsNewWithPath is a wrapper around g_settings_new_with_path().

func (*Settings) Apply Uses

func (v *Settings) Apply()

Apply is a wrapper around g_settings_apply().

func (*Settings) Delay Uses

func (v *Settings) Delay()

Delay is a wrapper around g_settings_delay().

func (*Settings) GetBoolean Uses

func (v *Settings) GetBoolean(name string) bool

GetBoolean is a wrapper around g_settings_get_boolean().

func (*Settings) GetChild Uses

func (v *Settings) GetChild(name string) *Settings

GetChild is a wrapper around g_settings_get_child().

func (*Settings) GetDouble Uses

func (v *Settings) GetDouble(name string) float64

GetDouble is a wrapper around g_settings_get_double().

func (*Settings) GetEnum Uses

func (v *Settings) GetEnum(name string) int

GetEnum is a wrapper around g_settings_get_enum().

func (*Settings) GetFlags Uses

func (v *Settings) GetFlags(name string) uint

GetFlags is a wrapper around g_settings_get_flags().

func (*Settings) GetHasUnapplied Uses

func (v *Settings) GetHasUnapplied() bool

GetHasUnapplied is a wrapper around g_settings_get_has_unapplied().

func (*Settings) GetInt Uses

func (v *Settings) GetInt(name string) int

GetInt is a wrapper around g_settings_get_int().

func (*Settings) GetString Uses

func (v *Settings) GetString(name string) string

GetString is a wrapper around g_settings_get_string().

func (*Settings) GetStrv Uses

func (v *Settings) GetStrv(name string) []string

GetStrv is a wrapper around g_settings_get_strv().

func (*Settings) GetUInt Uses

func (v *Settings) GetUInt(name string) uint

GetUInt is a wrapper around g_settings_get_uint().

func (*Settings) GetValue Uses

func (v *Settings) GetValue(name string) *Variant

func (*Settings) IsWritable Uses

func (v *Settings) IsWritable(name string) bool

IsWritable is a wrapper around g_settings_is_writable().

func (*Settings) ListChildren Uses

func (v *Settings) ListChildren() []string

ListChildren is a wrapper around g_settings_list_children().

func (*Settings) Native Uses

func (v *Settings) Native() uintptr

func (*Settings) Reset Uses

func (v *Settings) Reset(name string)

Reset is a wrapper around g_settings_reset().

func (*Settings) Revert Uses

func (v *Settings) Revert()

Revert is a wrapper around g_settings_revert().

func (*Settings) SetBoolean Uses

func (v *Settings) SetBoolean(name string, value bool) bool

SetBoolean is a wrapper around g_settings_set_boolean().

func (*Settings) SetDouble Uses

func (v *Settings) SetDouble(name string, value float64) bool

SetDouble is a wrapper around g_settings_set_double().

func (*Settings) SetEnum Uses

func (v *Settings) SetEnum(name string, value int) bool

SetEnum is a wrapper around g_settings_set_enum().

func (*Settings) SetFlags Uses

func (v *Settings) SetFlags(name string, value uint) bool

SetFlags is a wrapper around g_settings_set_flags().

func (*Settings) SetInt Uses

func (v *Settings) SetInt(name string, value int) bool

SetInt is a wrapper around g_settings_set_int().

func (*Settings) SetString Uses

func (v *Settings) SetString(name string, value string) bool

SetString is a wrapper around g_settings_set_string().

func (*Settings) SetStrv Uses

func (v *Settings) SetStrv(name string, values []string) bool

SetStrv is a wrapper around g_settings_set_strv().

func (*Settings) SetUInt Uses

func (v *Settings) SetUInt(name string, value uint) bool

SetUInt is a wrapper around g_settings_set_uint().

type SettingsBackend Uses

type SettingsBackend struct {
    *Object
}

SettingsBackend is a representation of GSettingsBackend.

func KeyfileSettingsBackendNew Uses

func KeyfileSettingsBackendNew(filename, rootPath, rootGroup string) *SettingsBackend

KeyfileSettingsBackendNew is a wrapper around g_keyfile_settings_backend_new().

func MemorySettingsBackendNew Uses

func MemorySettingsBackendNew() *SettingsBackend

MemorySettingsBackendNew is a wrapper around g_memory_settings_backend_new().

func NullSettingsBackendNew Uses

func NullSettingsBackendNew() *SettingsBackend

NullSettingsBackendNew is a wrapper around g_null_settings_backend_new().

func SettingsBackendGetDefault Uses

func SettingsBackendGetDefault() *SettingsBackend

SettingsBackendGetDefault is a wrapper around g_settings_backend_get_default().

func (*SettingsBackend) Native Uses

func (v *SettingsBackend) Native() uintptr

type SettingsSchema Uses

type SettingsSchema struct {
    // contains filtered or unexported fields
}

SettingsSchema is a representation of GSettingsSchema.

func (*SettingsSchema) GetID Uses

func (v *SettingsSchema) GetID() string

GetID() is a wrapper around g_settings_schema_get_id().

func (*SettingsSchema) GetPath Uses

func (v *SettingsSchema) GetPath() string

GetPath() is a wrapper around g_settings_schema_get_path().

func (*SettingsSchema) HasKey Uses

func (v *SettingsSchema) HasKey(v1 string) bool

HasKey() is a wrapper around g_settings_schema_has_key().

func (*SettingsSchema) Native Uses

func (v *SettingsSchema) Native() uintptr

func (*SettingsSchema) Ref Uses

func (v *SettingsSchema) Ref() *SettingsSchema

Ref() is a wrapper around g_settings_schema_ref().

func (*SettingsSchema) Unref Uses

func (v *SettingsSchema) Unref()

Unref() is a wrapper around g_settings_schema_unref().

type SettingsSchemaSource Uses

type SettingsSchemaSource struct {
    // contains filtered or unexported fields
}

SettingsSchemaSource is a representation of GSettingsSchemaSource.

func SettingsSchemaSourceGetDefault Uses

func SettingsSchemaSourceGetDefault() *SettingsSchemaSource

SettingsSchemaSourceGetDefault is a wrapper around g_settings_schema_source_get_default().

func SettingsSchemaSourceNewFromDirectory Uses

func SettingsSchemaSourceNewFromDirectory(dir string, parent *SettingsSchemaSource, trusted bool) *SettingsSchemaSource

SettingsSchemaSourceNewFromDirectory() is a wrapper around g_settings_schema_source_new_from_directory().

func (*SettingsSchemaSource) ListSchemas Uses

func (v *SettingsSchemaSource) ListSchemas(recursive bool) (nonReolcatable, relocatable []string)

ListSchemas is a wrapper around g_settings_schema_source_list_schemas().

func (*SettingsSchemaSource) Lookup Uses

func (v *SettingsSchemaSource) Lookup(schema string, recursive bool) *SettingsSchema

Lookup() is a wrapper around g_settings_schema_source_lookup().

func (*SettingsSchemaSource) Native Uses

func (v *SettingsSchemaSource) Native() uintptr

func (*SettingsSchemaSource) Ref Uses

func (v *SettingsSchemaSource) Ref() *SettingsSchemaSource

Ref() is a wrapper around g_settings_schema_source_ref().

func (*SettingsSchemaSource) Unref Uses

func (v *SettingsSchemaSource) Unref()

Unref() is a wrapper around g_settings_schema_source_unref().

type Signal Uses

type Signal struct {
    // contains filtered or unexported fields
}

func SignalNew Uses

func SignalNew(s string) (*Signal, error)

func (*Signal) String Uses

func (s *Signal) String() string

type SignalHandle Uses

type SignalHandle uint

type SimpleAction Uses

type SimpleAction struct {
    Action
}

SimpleAction is a representation of GSimpleAction

func SimpleActionNew Uses

func SimpleActionNew(name string, parameterType *VariantType) *SimpleAction

SimpleActionNew is a wrapper around g_simple_action_new

func SimpleActionNewStateful Uses

func SimpleActionNewStateful(name string, parameterType *VariantType, state *Variant) *SimpleAction

SimpleActionNewStateful is a wrapper around g_simple_action_new_stateful

func (*SimpleAction) Native Uses

func (v *SimpleAction) Native() uintptr

func (*SimpleAction) SetEnabled Uses

func (v *SimpleAction) SetEnabled(enabled bool)

SetEnabled is a wrapper around g_simple_action_set_enabled

func (*SimpleAction) SetState Uses

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.

type SimpleActionGroup Uses

type SimpleActionGroup struct {
    *Object

    // Interfaces
    IActionMap
    IActionGroup
}

SimpleActionGroup is a representation of glib's GSimpleActionGroup

func SimpleActionGroupNew Uses

func SimpleActionGroupNew() *SimpleActionGroup

SimpleActionGroupNew is a wrapper around g_simple_action_group_new

func (*SimpleActionGroup) Native Uses

func (v *SimpleActionGroup) Native() uintptr

type Source Uses

type Source C.GSource

func MainCurrentSource Uses

func MainCurrentSource() *Source

MainCurrentSource is a wrapper around g_main_current_source().

func (*Source) Destroy Uses

func (v *Source) Destroy()

Destroy is a wrapper around g_source_destroy()

func (*Source) IsDestroyed Uses

func (v *Source) IsDestroyed() bool

IsDestroyed is a wrapper around g_source_is_destroyed()

func (*Source) Ref Uses

func (v *Source) Ref() *Source

Ref is a wrapper around g_source_ref()

func (*Source) Unref Uses

func (v *Source) Unref()

Unref is a wrapper around g_source_unref()

type SourceHandle Uses

type SourceHandle uint

func IdleAdd Uses

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 Uses

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 Uses

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
)

func (Type) Depth Uses

func (t Type) Depth() uint

Depth is a wrapper around g_type_depth().

func (Type) Name Uses

func (t Type) Name() string

Name is a wrapper around g_type_name().

func (Type) Parent Uses

func (t Type) Parent() Type

Parent is a wrapper around g_type_parent().

type TypeMarshaler Uses

type TypeMarshaler struct {
    T   Type
    F   GValueMarshaler
}

TypeMarshaler represents an actual type and it's associated marshaler.

type UserDirectory Uses

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 Uses

type Value struct {
    GValue *C.GValue
}

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 Uses

func GValue(v interface{}) (gvalue *Value, err error)

GValue converts a Go type to a comparable GValue. GValue() returns a non-nil error if the conversion was unsuccessful.

func ValueAlloc Uses

func ValueAlloc() (*Value, error)

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 Uses

func ValueFromNative(l unsafe.Pointer) *Value

ValueFromNative returns a type-asserted pointer to the Value.

func ValueInit Uses

func ValueInit(t Type) (*Value, error)

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 Uses

func (v *Value) GetPointer() unsafe.Pointer

GetPointer is a wrapper around g_value_get_pointer().

func (*Value) GetString Uses

func (v *Value) GetString() (string, error)

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 Uses

func (v *Value) GoValue() (interface{}, error)

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) Native Uses

func (v *Value) Native() unsafe.Pointer

Native returns a pointer to the underlying GValue.

func (*Value) SetBool Uses

func (v *Value) SetBool(val bool)

SetBool is a wrapper around g_value_set_boolean().

func (*Value) SetDouble Uses

func (v *Value) SetDouble(val float64)

SetDouble is a wrapper around g_value_set_double().

func (*Value) SetFloat Uses

func (v *Value) SetFloat(val float32)

SetFloat is a wrapper around g_value_set_float().

func (*Value) SetInstance Uses

func (v *Value) SetInstance(instance uintptr)

SetInstance is a wrapper around g_value_set_instance().

func (*Value) SetInt Uses

func (v *Value) SetInt(val int)

SetInt is a wrapper around g_value_set_int().

func (*Value) SetInt64 Uses

func (v *Value) SetInt64(val int64)

SetInt64 is a wrapper around g_value_set_int64().

func (*Value) SetPointer Uses

func (v *Value) SetPointer(p uintptr)

SetPointer is a wrapper around g_value_set_pointer().

func (*Value) SetSChar Uses

func (v *Value) SetSChar(val int8)

SetSChar is a wrapper around g_value_set_schar().

func (*Value) SetString Uses

func (v *Value) SetString(val string)

SetString is a wrapper around g_value_set_string().

func (*Value) SetUChar Uses

func (v *Value) SetUChar(val uint8)

SetUChar is a wrapper around g_value_set_uchar().

func (*Value) SetUInt Uses

func (v *Value) SetUInt(val uint)

SetUInt is a wrapper around g_value_set_uint().

func (*Value) SetUInt64 Uses

func (v *Value) SetUInt64(val uint64)

SetUInt64 is a wrapper around g_value_set_uint64().

func (*Value) Type Uses

func (v *Value) Type() (actual Type, fundamental Type, err error)

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 Variant Uses

type Variant struct {
    GVariant *C.GVariant
}

A Variant is a representation of GLib's GVariant.

func (*Variant) AnnotatedString Uses

func (v *Variant) AnnotatedString() string

AnnotatedString wraps g_variant_print(), but returns a type-annotated string.

func (*Variant) GetBoolean Uses

func (v *Variant) GetBoolean() bool

GetBoolean returns the bool value of this variant.

func (*Variant) GetInt Uses

func (v *Variant) GetInt() (int64, error)

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) GetString Uses

func (v *Variant) GetString() string

GetString returns the string value of the variant.

func (*Variant) GetStrv Uses

func (v *Variant) GetStrv() []string

GetStrv returns a slice of strings from this variant. It wraps g_variant_get_strv, but returns copies of the strings instead.

func (*Variant) IsContainer Uses

func (v *Variant) IsContainer() bool

IsContainer returns true if the variant is a container and false otherwise.

func (*Variant) IsType Uses

func (v *Variant) IsType(t *VariantType) bool

IsType returns true if the variant's type matches t.

func (*Variant) Native Uses

func (v *Variant) Native() uintptr

Native returns a pointer to the underlying GVariant.

func (*Variant) String Uses

func (v *Variant) String() string

String wraps g_variant_print(). It returns a string understood by g_variant_parse().

func (*Variant) ToGVariant Uses

func (v *Variant) ToGVariant() *C.GVariant

ToGVariant exposes the underlying *C.GVariant type for this Variant, necessary to implement IVariant.

func (*Variant) ToVariant Uses

func (v *Variant) ToVariant() *Variant

ToVariant returns this Variant, necessary to implement IVariant.

func (*Variant) Type Uses

func (v *Variant) Type() *VariantType

Type returns the VariantType for this variant.

func (*Variant) TypeString Uses

func (v *Variant) TypeString() string

TypeString returns the g variant type string for this variant.

type VariantBuilder Uses

type VariantBuilder struct {
    GVariantBuilder *C.GVariantBuilder
}

VariantBuilder is a representation of GLib's VariantBuilder.

func (*VariantBuilder) Native Uses

func (v *VariantBuilder) Native() uintptr

Native returns a pointer to the underlying GVariantBuilder.

type VariantClass Uses

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 Uses

type VariantDict struct {
    GVariantDict *C.GVariantDict
}

VariantDict is a representation of GLib's VariantDict.

func (*VariantDict) Native Uses

func (v *VariantDict) Native() uintptr

Native returns a pointer to the underlying GVariantDict.

type VariantIter Uses

type VariantIter struct {
    GVariantIter *C.GVariantIter
}

VariantIter is a representation of GLib's GVariantIter.

func (*VariantIter) Native Uses

func (v *VariantIter) Native() uintptr

Native returns a pointer to the underlying GVariantIter.

type VariantType Uses

type VariantType struct {
    GVariantType *C.GVariantType
}

A VariantType is a wrapper for the GVariantType, which encodes type information for GVariants.

func (*VariantType) String Uses

func (v *VariantType) String() string

String returns a copy of this VariantType's type string.

Package glib imports 8 packages (graph) and is imported by 133 packages. Updated 2019-09-29. Refresh now. Tools for package owners.