Go bindings for GLib type system.

Go bindings for GLib type system.

This package is designed for building bindings to C libraries based on GLib type system (like GTK, GStreamer, and others).

See example GTK bindings or GStreamer bindings for example code.

See glib_test.go for signal/event handling model.

Dependencies

You need glib 2.0 library with C headers to install this package (libglib2.0-dev on Debian/Ubuntu).

Documentation

http://gopkgdoc.appspot.com/pkg/github.com/ziutek/glib

Owner
Comments
  • g_value_get_char & g_value_set_char deprecated in latest GLib

    g_value_get_char & g_value_set_char deprecated in latest GLib

    It is stopping "go get ..." from working - stopping at compilation step.

    Replaced with g_value_get_schar & g_value_set_schar respectively.

  • compile problem

    compile problem

    I get this error during install:

    github.com/ziutek/glib

    1: error: 'g_value_set_schar' undeclared (first use in this function) 1: note: each undeclared identifier is reported only once for each function it appears

  • Compile error

    Compile error

    Hi,

    i get following error while trying to install your library.

    go get github.com/ziutek/glib
    # github.com/ziutek/glib
    /tmp/go-build642310031/github.com/ziutek/glib/_obj/type.cgo2.o: In function `_cgo_4dd0e201dc87_Cfunc_g_thread_init':
    /usr/share/go/src/pkg/github.com/ziutek/glib/type.go:81: undefined reference to `g_thread_init'
    collect2: ld gab 1 als Ende-Status zurück
    

    I've installed libglib2 and libglib2-dev with

    sudo apt-get install libglib2.0 and libglib2.0-dev
    

    My system is: Ubuntu 12.04 LTS Golang 1.0.1

    Thank you!

    (might this link has something to do with it?) http://osdir.com/ml/commits.gnome/2011-10/msg08477.html)

    pkg-config --cflags glib-2.0 gobject-2.0
    -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
    
  • adding CFLAGS to work around deprecated-declarations.

    adding CFLAGS to work around deprecated-declarations.

    Versions:

    • libglib2.0-dev 2.36.3-2
    • gcc 4:4.8.1-1

    Error: # github.com/ziutek/glib type.go:19:1: error: 'g_type_init' is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:669) [-Werror=deprecated-declarations] ) ^ cc1: all warnings being treated as errors

  • fix install error

    fix install error

    fix

    value.go:28:1: error: 'g_value_get_char' is deprecated (declared at /usr/include/glib-2.0/gobject/gvaluetypes.h:184): Use 'g_value_get_schar' instead [-Werror=deprecated-declarations]
    value.go:40:1: error: 'g_value_set_char' is deprecated (declared at /usr/include/glib-2.0/gobject/gvaluetypes.h:181): Use 'g_value_set_schar' instead [-Werror=deprecated-declarations]
    cc1: all warnings being treated as errors
    
  • g_thread_init depreciated, cannot compile the module on the ubuntu nightly builds

    g_thread_init depreciated, cannot compile the module on the ubuntu nightly builds

    I normally run the Ubuntu nightly and I cannot get the glib module. go get github.com/ziutek/glib fails with the following (actually I only need this module for the gst module which as well is failing due to this): type.go:74:1: error: 'g_thread_init' is deprecated (declared at /usr/include/glib-2.0/glib/deprecated/gthread.h:259) [-Werror=deprecated-declarations] cc1: all warnings being treated as errors

    A hack would be to change the cgo command and remove the -Werror flag (in go/src/cmd/cgo/gcc.go), any ideas for a better solution (the package I have installed for glib in ubuntu is libglib2.0-0)

    P.S awesome work with the gst and other go modules, I am just getting started with go and these look really what I needed to start shifting my work.

  • GParam signal callback parameter

    GParam signal callback parameter

    Good afternoon,

    I'm trying to connect to the notify::current-level-buffers signal of the gstreamer 1.0 queue. Unfortunately, the callback parameter needs to be of type GParam, which is not a type recognized by Type.Match in object.go#L247. (Type.Match() source)

    The following is a super simplified version of what I'm trying to do. Any thoughts on either what I'm doing wrong or how to extend this package to handle the signal?

    package main
    
    import (
            "fmt"
            "github.com/ziutek/gst"
    )
    
    func main() {
            pl := gst.NewPipeline("pipeline")
    
            el := gst.ElementFactoryMake("queue", "queue")
            pl.Add(el)
    
            queue := pl.GetByName("queue")
            queue.ConnectNoi("notify::current-level-buffers", cbNotifyBuffers, nil)
    }
    
    func cbNotifyBuffers(bufferLevel interface{}) {
            fmt.Println(bufferLevel)
    }
    

    Running I get the following panic:

    panic: Callback #0 param. type interface {} doesn't match signal spec GParam
    

    (Obviously the callback shouldn't be an interface{}, but I don't think there is currently a type which would satisfy Type.Match())

    Thank you for your help, and for the glib and gst packages!

  • Can not connect to signal

    Can not connect to signal

    /*
    #cgo pkg-config: nice
    #include <agent.h>
    */
    import "C"
    
    agent := C.nice_agent_new(C.g_main_context_default(), C.NICE_COMPATIBILITY_RFC5245)
    obj := &glib.Object{}
    obj.SetPtr((glib.Pointer)(agent))
    obj.Connect("component-state-changed", onStateChange, nil)
    
    func (agent *C.NiceAgent, str, comp, state C.guint, data glib.Pointer) {
    }
    
    ...
    panic: Callback #0 param. type nice._Ctype_struct__NiceAgent doesn't match signal source: NiceAgent
    

    Reference: http://nice.freedesktop.org/libnice/NiceAgent.html#NiceAgent-component-state-changed

[TOOL, CLI] - Filter and examine Go type structures, interfaces and their transitive dependencies and relationships. Export structural types as TypeScript value object or bare type representations.

typex Examine Go types and their transitive dependencies. Export results as TypeScript value objects (or types) declaration. Installation go get -u gi

Dec 6, 2022
Go generator to copy values from type to type and fields from struct to struct. Copier without reflection.

Copygen is a command-line code generator that generates type-to-type and field-to-field struct code without adding any reflection or dependenc

Dec 29, 2022
convert JSON of a specific format to a type structure(Typescript type or more)

json2type convert JSON of a specific format to a type structure(Typescript type or more) Quick Start CLI Install use go tool install go install github

Mar 28, 2022
A drop-in replacement to any Writer type, which also calculates a hash using the provided hash type.

writehasher A drop-in replacement to any Writer type, which also calculates a hash using the provided hash type. Example package main import ( "fmt"

Jan 10, 2022
Package cdp provides type-safe bindings for the Chrome DevTools Protocol (CDP), written in the Go programming language.

cdp Package cdp provides type-safe bindings for the Chrome DevTools Protocol (CDP), written in the Go programming language. The bindings are generated

Jan 7, 2023
Lithia is an experimental functional programming language with an implicit but strong and dynamic type system.

Lithia is an experimental functional programming language with an implicit but strong and dynamic type system. Lithia is designed around a few core concepts in mind all language features contribute to.

Dec 24, 2022
Ransomware: a type of malware that prevents or limits users from accessing their system
Ransomware: a type of malware that prevents or limits users from accessing their system

Ransomware Note 1: This project is purely academic, use at your own risk. I do not encourage in any way the use of this software illegally or to attac

Nov 17, 2021
Cloudinsight Agent is a system tool that monitors system processes and services, and sends information back to your Cloudinsight account.

Cloudinsight Agent 中文版 README Cloudinsight Agent is written in Go for collecting metrics from the system it's running on, or from other services, and

Nov 3, 2022
System resource usage profiler tool which regularly takes snapshots of the memory and CPU load of one or more running processes so as to dynamically build up a profile of their usage of system resources.
System resource usage profiler tool which regularly takes snapshots of the memory and CPU load of one or more running processes so as to dynamically build up a profile of their usage of system resources.

Vegeta is a system resource usage tracking tool built to regularly take snapshots of the memory and CPU load of one or more running processes, so as to dynamically build up a profile of their usage of system resources.

Jan 16, 2022
remindme is a simple application to set reminders from the CLI that integrates with your system's notification system.
remindme is a simple application to set reminders from the CLI that integrates with your system's notification system.

remindme remindme is a simple application to set reminders from the CLI that integrates with your system's notification system. Examples Once the serv

Nov 24, 2022
CBuild build system - A tiny build system for C

cuild - CBuild A build system for C Building $ go build . Usage Similar to GNU Make, a file named "Cuildfile" is required. You have a few flags to us

Jan 17, 2022
get windows system call number dynamically, it doesn't need the system call table.

GetSyscallID get windows system call number dynamically, it doesn't need the system call table. Try download go get github.com/akkuman/getsyscallid/cm

Jun 1, 2022
Virtual-Operating-System - Virtual Operating System Using Golang And Fyne Implemented Gallery app
Virtual-Operating-System - Virtual Operating System Using Golang And Fyne Implemented Gallery app

Virtual Operating System Virtual Operating System Using Golang And Fyne Implemen

Jan 1, 2022
Update-java-ca-certificates - Small utility to convert the system trust store to a system Java KeyStore

update-java-ca-certificates This small utility takes care of creating a system-w

Dec 28, 2022
Simple-crm-system - Simple CRM system CRUD backend using Go, Fiber, SQLite, Gorm

Simple CRM system CRUD backend using GO, Fiber, Gorm, SQLite Developent go mod t

Nov 13, 2022
EdgeLog is a lightweight log management system, and Agent is a part of EdgeLog system

EdgeLog is a lightweight log management system, and Agent is a part of EdgeLog system. It is installed on host machine and its main duty is to collect host program log statics.

Oct 10, 2022
Jsos - A operating system that runs system-level javascript, based on the Linux kernel

JsOS ?? An linux-based operating system that runs Javascript code at the system-

Jan 6, 2023
Tapestry is an underlying distributed object location and retrieval system (DOLR) which can be used to store and locate objects. This distributed system provides an interface for storing and retrieving key-value pairs.

Tapestry This project implements Tapestry, an underlying distributed object location and retrieval system (DOLR) which can be used to store and locate

Mar 16, 2022