Questions tagged [gobject-introspection]

GObject introspection is a middleware layer between C GObject libraries and language bindings. The C library is scanned at compile time to generate a metadata file. At runtime, language bindings can read this metadata and automatically provide bindings to call into the native C library.

GObject introspection is a middleware layer between C libraries (which must use ) and language bindings. The C library can be scanned at compile time and generate a metadata file, in addition to the actual native C library. Then at runtime, language bindings can read this metadata and automatically provide bindings to call into the C library.

Two-level applications: C and your favorite runtime.

It makes sense to build many kinds of applications using (at least) two different levels and languages. Those being C + GObject, and a managed () runtime. C is good for graphics, multimedia, and lower level systems. However, writing complex software is difficult and error-prone without garbage collection. A managed runtime such as Vala, JavaScript, Python, Java, Lua, .NET, Scheme etc. makes a lot of sense for non-fast-path application logic such as configuration, layout and dialogs.

Thus, one of the major goals of the GObject introspection project is to be a convenient bridge between these two worlds, and allow you to choose the right tool for the job, rather than being limited inside one or the other. With the introspection project, you can write for example a ClutterActor or GtkWidget subclass in C, and then without any additional work use that class in JavaScript.

95 questions
3
votes
1 answer

python bindings for gstreamer: how to import typelib

I was building gstreamer latest version on my raspberry pi. I wanted to have python bindings, hence I installed gobject-introspection-1.0 and pygobject-3.18.2 before compiling the gstreamer and its plugins. At the end of the build of gstreamer and…
3
votes
1 answer

How to get raw bytes from GLib.GString in Python?

I have an application written in Python using GTK3 through the GObject introspection (Python 2.7 and PyGObject 3.14). I am trying to load a web page using WebKit and access the contents of all the resources it loads. I'm able to accomplish this by…
zeroSteiner
  • 53
  • 1
  • 5
3
votes
2 answers

Cairo and Gdk.Window with Gtk.DrawingArea using python gobject-introspection and gtk3

I am trying to follow the Gtk+ v3 tutorial found in the reference documentation. Specifically the first Drawing example using cairo to handle the drawing onto a Gtk.DrawingArea. https://developer.gnome.org/gtk3/stable/ch01s03.html For reference, I…
John
  • 1,709
  • 1
  • 24
  • 27
3
votes
2 answers

Key binding for window/app in python Gtk+ 3 without menu items, UI manager, etc

I'm trying to use GTK3 and Cairo from Python for a minimal plotting application where the on-screen display of Cairo's output is for user convenience. The typical usage is that I run a command, a plot pops up on screen and is also written to file,…
andybuckley
  • 1,114
  • 2
  • 11
  • 24
3
votes
1 answer

Travis-ci & Gobject introspection

I'm trying to setup Travis for Getting Things GNOME!. My .travis.yml: language: python python: - '3.3' before_install: - sudo apt-get update - sudo apt-get install -qq python3-gi gir1.2-gtk-3.0 virtualenv: system_site_packages:…
izidor
  • 4,068
  • 5
  • 33
  • 43
3
votes
2 answers

GStreamer error "assertion 'GST_IS_ELEMENT (src)' failed" when linking elements

I'm working on a GStreamer-based program using Python and the GObject introspection bindings. I'm trying to build this pipeline: videomixer name=mix ! autovideosink \ uridecodebin uri=v4l2:///dev/video0 ! mix. The pipeline works perfectly using…
3
votes
2 answers

How to tell vala which getters and setters to use using GObjectIntrospection and vapigen?

I've written a C library and used vapigen to create the vapis for it. In the generated files there are some properties defined like: public int index { get; set; } And the accessor methods (which I use from C and only return the value of the…
3
votes
2 answers

In Python with GStreamer, how do I use a file object as the input source?

I am currently doing: source_path = 'file:///home/raj/videos/sample.mpg' descr = 'uridecodebin uri=%s ! videoconvert ! gdkpixbufsink name=sink' % (source_path) pipeline = Gst.parse_launch(descr) But instead of using uri, how can I use a raw file…
Raj
  • 1,479
  • 3
  • 15
  • 29
3
votes
2 answers

g-ir-scanner fails to generate gir-file

I am trying to generate a .gir-file from a very simple library; it's basically the GObject example from the GLib documentation. When using g-ir-scanner, it fails with the follwing error: $ g-ir-scanner -I./ --library=foo --library-path=./…
user2018273
  • 43
  • 1
  • 5
3
votes
1 answer

Python GI Notify How can I call the Gtk.main()?

I'm trying to create a Python notification application. To make it short here is what I wanted to do : 1. Checking my gmail account 2. Display a notification with the number of unread mails 3. Display a button that permits me to open chromium…
Depado
  • 4,811
  • 3
  • 41
  • 63
3
votes
2 answers

Gtk.Entry in Gtk.TreeView (CellRenderer)

I want to pack a Gtk.Entry (with Gtk.EntryCompletion hooked up) into a cell in a Gtk.TreeView. Does anyone know how this can be done? (I just need entry completion on a text entry in a tabular view.) Do I perhaps need to subclass Gtk.CellRenderer…
simon
  • 15,344
  • 5
  • 45
  • 67
2
votes
0 answers

gobject-introspection install failure, not build

I am trying to install gobject-introduction in mac M1 using homebrew, but it will occur the following errors. I can not find relevant solution for it. Does any one have experience on it why i can not install gobject-introspection?
Edward
  • 71
  • 1
  • 2
2
votes
3 answers

autocompletion for own gobject derived library in python using jedi-vim using gobject introspection

I'm trying to create a shared C library that uses the gobject library as foundation. So my object inherits in GObject speak from GObject. GObject allows bindings to all different scripting languages such as Python via GObject introspection. Then…
hetepeperfan
  • 4,292
  • 1
  • 29
  • 47
2
votes
1 answer

Cairo::SolidPattern is not of type GooCanvas2::CairoPattern

I'm trying to convert old Gtk2 perl script to Gtk3. Here is how the Gtk2 version looks like: #!/usr/bin/perl use 5.30.0; use strict; use warnings; use diagnostics; use Gtk2 '-init'; use Goo::Canvas; my $canvas = Goo::Canvas->new; my $pattern =…
Alexey Sokolov
  • 109
  • 1
  • 6
2
votes
1 answer

Unable to install gobject-introspection - symbol lookup error: and undefined symbol: g_unicode_type_get_type

Unable to install gobject-introspection - symbol lookup error: and undefined symbol: g_unicode_type_get_type I tried to compile Gtk4, and download gobject-introspection 1.30, 1.40, 1.50, 1.64.1. All failed with the same exact error except the last…
Estatistics
  • 874
  • 9
  • 24