glib

package
v0.0.0-...-48574e3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: BSD-3-Clause Imports: 4 Imported by: 227

Documentation

Index

Constants

View Source
const (
	G_TYPE_CHAR    = 3 << 2
	G_TYPE_UCHAR   = 4 << 2
	G_TYPE_BOOL    = 5 << 2
	G_TYPE_INT     = 6 << 2
	G_TYPE_UINT    = 7 << 2
	G_TYPE_LONG    = 8 << 2
	G_TYPE_ULONG   = 9 << 2
	G_TYPE_INT64   = 10 << 2
	G_TYPE_UINT64  = 11 << 2
	G_TYPE_ENUM    = 12 << 2
	G_TYPE_FLAGS   = 13 << 2
	G_TYPE_FLOAT   = 14 << 2
	G_TYPE_DOUBLE  = 15 << 2
	G_TYPE_STRING  = 16 << 2
	G_TYPE_POINTER = 17 << 2
	G_TYPE_BOXED   = 18 << 2
)

Variables

This section is empty.

Functions

func FilenameFromUri

func FilenameFromUri(uri string) (filename string, hostname string, err error)

func FilenameToUri

func FilenameToUri(filename string, hostname string) (uri string, err error)

func GPtrToString

func GPtrToString(p interface{}) string

func GValueFromNative

func GValueFromNative(value interface{}) *C.GValue

----------------------------------------------------------------------- GValue -----------------------------------------------------------------------

func GetApplicationName

func GetApplicationName() string

----------------------------------------------------------------------- Application -----------------------------------------------------------------------

func GetCurrentDir

func GetCurrentDir() string

func GetHomeDir

func GetHomeDir() string

func GetHostName

func GetHostName() string

func GetPrgName

func GetPrgName() string

func GetRealName

func GetRealName() string

func GetSystemConfigDirs

func GetSystemConfigDirs() []string

func GetSystemDataDirs

func GetSystemDataDirs() []string

----------------------------------------------------------------------- System Information -----------------------------------------------------------------------

func GetTmpDir

func GetTmpDir() string

func GetUserCacheDir

func GetUserCacheDir() string

func GetUserConfigDir

func GetUserConfigDir() string

func GetUserDataDir

func GetUserDataDir() string

func GetUserName

func GetUserName() string

----------------------------------------------------------------------- User Information -----------------------------------------------------------------------

func GetUserRuntimeDir

func GetUserRuntimeDir() string

func GetUserSpecialDir

func GetUserSpecialDir(directory UserDirectory) string

func IdleAdd

func IdleAdd(f interface{}, datas ...interface{})

func ReloadUserSpecialDirsCache

func ReloadUserSpecialDirsCache()

func SetApplicationName

func SetApplicationName(name string)

func SetPrgname

func SetPrgname(name string)

func ThreadInit

func ThreadInit(a ...interface{})

----------------------------------------------------------------------- thread -----------------------------------------------------------------------

func TimeoutAdd

func TimeoutAdd(interval uint, f interface{}, datas ...interface{})

func Utf8Validate

func Utf8Validate(str []byte, len int, bar **byte) bool

----------------------------------------------------------------------- String Convert -----------------------------------------------------------------------

Types

type CallbackArg

type CallbackArg uintptr

func (CallbackArg) ToString

func (c CallbackArg) ToString() string

type CallbackContext

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

----------------------------------------------------------------------- Events ----------------------------------------------------------------------- the go-gtk Callback is simpler than the one in C, because we have full closures, so there is never a need to pass additional data via a void * pointer. Where you might have wanted to do that, you can instead just use func () { ... using data } to pass the data in.

func (*CallbackContext) Args

func (c *CallbackContext) Args(n int) CallbackArg

func (*CallbackContext) Data

func (c *CallbackContext) Data() interface{}

func (*CallbackContext) Target

func (c *CallbackContext) Target() interface{}

type ConnectFlags

type ConnectFlags C.GConnectFlags
const (
	ConnectAfter   ConnectFlags = C.G_CONNECT_AFTER
	ConnectSwapped ConnectFlags = C.G_CONNECT_SWAPPED
)

type ContextStorage

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

func NewContextStorage

func NewContextStorage() *ContextStorage

func (*ContextStorage) Add

func (c *ContextStorage) Add(value interface{}) int

func (*ContextStorage) Get

func (c *ContextStorage) Get(id int) (value interface{}, found bool)

func (*ContextStorage) Len

func (c *ContextStorage) Len() int

func (*ContextStorage) Remove

func (c *ContextStorage) Remove(id int)

type Error

type Error struct {
	GError *C.GError
}

----------------------------------------------------------------------- g_error -----------------------------------------------------------------------

func ErrorFromNative

func ErrorFromNative(err unsafe.Pointer) *Error

func LocaleFromUtf8

func LocaleFromUtf8(utf8string string) (ret []byte, bytes_read int, bytes_written int, err *Error)

func LocaleToUtf8

func LocaleToUtf8(opsysstring []byte) (ret string, bytes_read int, bytes_written int, err *Error)

func (*Error) Error

func (v *Error) Error() string

func (*Error) Message

func (v *Error) Message() string

type GMainContext

type GMainContext struct {
	MainContext *C.GMainContext
}

----------------------------------------------------------------------- Main Loop -----------------------------------------------------------------------

func MainContextDefault

func MainContextDefault() *GMainContext

func NewMainContext

func NewMainContext() *GMainContext

func (*GMainContext) Iteration

func (v *GMainContext) Iteration(blocking bool) bool

func (*GMainContext) Pending

func (v *GMainContext) Pending() bool

func (*GMainContext) Ref

func (v *GMainContext) Ref() *GMainContext

func (*GMainContext) Unref

func (v *GMainContext) Unref()

type GMainLoop

type GMainLoop struct {
	MainLoop *C.GMainLoop
}

func NewMainLoop

func NewMainLoop(context *GMainContext, is_running bool) *GMainLoop

func (*GMainLoop) GetContext

func (v *GMainLoop) GetContext() *GMainContext

func (*GMainLoop) IsRunning

func (v *GMainLoop) IsRunning() bool

func (*GMainLoop) Quit

func (v *GMainLoop) Quit()

func (*GMainLoop) Ref

func (v *GMainLoop) Ref() *GMainLoop

func (*GMainLoop) Run

func (v *GMainLoop) Run()

func (*GMainLoop) Unref

func (v *GMainLoop) Unref()

type GObject

type GObject struct {
	Object unsafe.Pointer
}

func ObjectFromNative

func ObjectFromNative(object unsafe.Pointer) *GObject

func (*GObject) Connect

func (v *GObject) Connect(s string, f interface{}, datas ...interface{}) int

Return the handler call_id to use with HandlerBlock, HandlerUnblock and HandlerDisconnect.

func (*GObject) Emit

func (v *GObject) Emit(s string)

func (*GObject) GetData

func (v *GObject) GetData(s string) unsafe.Pointer

func (*GObject) HandlerBlock

func (v *GObject) HandlerBlock(call_id int)

func (*GObject) HandlerDisconnect

func (v *GObject) HandlerDisconnect(call_id int)

func (*GObject) HandlerUnblock

func (v *GObject) HandlerUnblock(call_id int)

func (*GObject) Ref

func (v *GObject) Ref()

func (*GObject) Set

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

func (*GObject) SetData

func (v *GObject) SetData(s string, p unsafe.Pointer)

func (*GObject) SetProperty

func (v *GObject) SetProperty(name string, val *GValue)

func (*GObject) SignalConnect

func (v *GObject) SignalConnect(s string, f interface{}, data interface{}, flags ConnectFlags) int

func (*GObject) SignalConnectAfter

func (v *GObject) SignalConnectAfter(s string, f interface{}, datas ...interface{}) int

func (*GObject) SignalConnectSwapped

func (v *GObject) SignalConnectSwapped(s string, f interface{}, datas ...interface{}) int

func (*GObject) StopEmission

func (v *GObject) StopEmission(s string)

func (*GObject) Unref

func (v *GObject) Unref()

type GValue

type GValue struct {
	Value C.GValue
}

func ValueFromNative

func ValueFromNative(val interface{}) *GValue

func (*GValue) GetBool

func (v *GValue) GetBool() bool

func (*GValue) GetInt

func (v *GValue) GetInt() int

func (*GValue) GetString

func (v *GValue) GetString() string

func (*GValue) Init

func (v *GValue) Init(t int)

type List

type List struct {
	GList *C.GList
}

----------------------------------------------------------------------- List -----------------------------------------------------------------------

func GListAlloc

func GListAlloc() *List

func ListFromNative

func ListFromNative(l unsafe.Pointer) *List

func (List) Append

func (v List) Append(data unsafe.Pointer) *List

func (List) Concat

func (v List) Concat(link List) *List

GList* g_list_sort (GList *list,

GCompareFunc compare_func);

gint (*GCompareFunc) (gconstpointer a,

gconstpointer b);

GList* g_list_insert_sorted_with_data (GList *list,

gpointer data,
GCompareDataFunc func,
gpointer user_data);

GList* g_list_sort_with_data (GList *list,

GCompareDataFunc compare_func,
gpointer user_data);

gint (*GCompareDataFunc) (gconstpointer a,

gconstpointer b,
gpointer user_data);

func (List) Copy

func (v List) Copy() *List

func (List) Data

func (v List) Data() interface{}
func (v List) DeleteLink(link List) *List

func (List) Find

func (v List) Find(data unsafe.Pointer) *List

func (List) First

func (v List) First() *List

func (List) ForEach

func (v List) ForEach(callback func(unsafe.Pointer, interface{}), user_datas ...interface{})

func (List) Free

func (v List) Free()

func (List) Free1

func (v List) Free1()

func (List) Index

func (v List) Index(data unsafe.Pointer) int

func (List) Insert

func (v List) Insert(data unsafe.Pointer, pos int) *List

func (List) InsertBefore

func (v List) InsertBefore(sib List, data unsafe.Pointer) *List

func (List) Last

func (v List) Last() *List

func (List) Length

func (v List) Length() uint

func (List) Nth

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

func (List) NthData

func (v List) NthData(n uint) unsafe.Pointer

func (List) NthPrev

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

func (List) Position

func (v List) Position(link List) int

GList* g_list_find_custom (GList *list,

gconstpointer data,
GCompareFunc func);

func (List) Prepend

func (v List) Prepend(data unsafe.Pointer) *List

func (List) Remove

func (v List) Remove(data unsafe.Pointer) *List

GList* g_list_insert_sorted (GList *list,

gpointer data,
GCompareFunc func);

func (List) RemoveAll

func (v List) RemoveAll(data unsafe.Pointer) *List
func (v List) RemoveLink(link List) *List

func (List) Reverse

func (v List) Reverse() *List

type ObjectLike

type ObjectLike interface {
	Ref()
	Unref()
	Connect(s string, f interface{}, data ...interface{})
}

----------------------------------------------------------------------- GObject -----------------------------------------------------------------------

type SList

type SList struct {
	GSList *C.GSList
}

----------------------------------------------------------------------- g_slist -----------------------------------------------------------------------

func GSListAlloc

func GSListAlloc() *SList

func SListFromNative

func SListFromNative(sl unsafe.Pointer) *SList

func (SList) Append

func (v SList) Append(data unsafe.Pointer) *SList

func (SList) Concat

func (v SList) Concat(llink SList) *SList

func (SList) Copy

func (v SList) Copy() *SList

func (SList) Data

func (v SList) Data() unsafe.Pointer
func (v SList) DeleteLink(llink SList) *SList

func (SList) Find

func (v SList) Find(data unsafe.Pointer) *SList

func (SList) ForEach

func (v SList) ForEach(callback func(unsafe.Pointer, interface{}), user_datas ...interface{})

func (SList) Free

func (v SList) Free()

func (SList) Free1

func (v SList) Free1()

func (SList) Index

func (v SList) Index(data unsafe.Pointer) int

func (SList) InsertBefore

func (v SList) InsertBefore(sibling SList, data unsafe.Pointer) *SList

GSList* g_slist_insert (GSList *list, gpointer data, gint position) G_GNUC_WARN_UNUSED_RESULT; GSList* g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func) G_GNUC_WARN_UNUSED_RESULT; GSList* g_slist_insert_sorted_with_data (GSList *list, gpointer data, GCompareDataFunc func, gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;

func (SList) Last

func (v SList) Last() *SList

func (SList) Length

func (v SList) Length() uint

func (SList) Nth

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

func (SList) NthData

func (v SList) NthData(n uint) unsafe.Pointer

GSList* g_slist_sort (GSList *list, GCompareFunc compare_func) G_GNUC_WARN_UNUSED_RESULT; GSList* g_slist_sort_with_data (GSList *list, GCompareDataFunc compare_func, gpointer user_data) G_GNUC_WARN_UNUSED_RESULT;

func (SList) Position

func (v SList) Position(llink SList) int

GSList* g_slist_find_custom (GSList *list, gconstpointer data, GCompareFunc func);

func (SList) Prepend

func (v SList) Prepend(data unsafe.Pointer) *SList

func (SList) Remove

func (v SList) Remove(data unsafe.Pointer) *SList

func (SList) RemoveAll

func (v SList) RemoveAll(data unsafe.Pointer) *SList
func (v SList) RemoveLink(llink SList) *SList

func (SList) Reverse

func (v SList) Reverse() *SList

func (SList) ToSList

func (v SList) ToSList() *C.GSList

type SourcefuncContext

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

type UserDirectory

type UserDirectory C.GUserDirectory
const (
	UserDirectoryDesktop     UserDirectory = C.G_USER_DIRECTORY_DESKTOP
	UserDirectoryDocuments   UserDirectory = C.G_USER_DIRECTORY_DOCUMENTS
	UserDirectoryDownload    UserDirectory = C.G_USER_DIRECTORY_DOWNLOAD
	UserDirectoryMusic       UserDirectory = C.G_USER_DIRECTORY_MUSIC
	UserDirectoryPictures    UserDirectory = C.G_USER_DIRECTORY_PICTURES
	UserDirectoryPublicShare UserDirectory = C.G_USER_DIRECTORY_PUBLIC_SHARE
	UserDirectoryTemplates   UserDirectory = C.G_USER_DIRECTORY_TEMPLATES
	UserDirectoryVideos      UserDirectory = C.G_USER_DIRECTORY_VIDEOS
)

type WrappedObject

type WrappedObject interface {
	GetInternalValue() unsafe.Pointer
}

----------------------------------------------------------------------- WrappedObject -----------------------------------------------------------------------

Jump to

Keyboard shortcuts

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