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
57
votes
5 answers

pygobject-2.28.6 won't configure: No package 'gobject-introspection-1.0' found, how do I resolve?

I'm trying to get pygobject-2.28.6 to compile in cygwin (version in repository is 2.28.4 which has some issues). Here is the tail of ./configure: checking for GLIB - version >= 2.24.0... yes (version 2.34.3) checking for ffi... checking for FFI...…
Stupac
  • 631
  • 1
  • 6
  • 6
10
votes
1 answer

How does one declare a dependency on gi.repository in setup.py (and required C library)?

I am packaging a python application that depends on several C libraries through gobject introspection. I would like to make sure that, at least, the python module from the glib is installed (that is the gi module, packaged as python-gi in Debian, I…
Cans
  • 434
  • 3
  • 11
8
votes
2 answers

Why is my Moo object that inherits from a non-Moo class blessed into the parent's package for some modules?

I'm trying to create a Gtk3 application in Perl using GObject Introspection and Moo. There's a non-Moo class from Gtk, Gtk::ApplicationWindow, which I subclass through Moo using extends 'Gtk::ApplicationWindow'. The issue is that when an object of…
hsrv
  • 83
  • 4
8
votes
1 answer

GOBJECT_INTROSPECTION_CHECK syntax error on configure

On "./configure" of an open source project I get: user agent OS = Linux ./configure: line 13957: syntax error near unexpected token 0.9.3' ./configure: line 13957: GOBJECT_INTROSPECTION_CHECK(0.9.3)' make: *** [config.status] Error 2 Ubuntu 12.04…
Bryce
  • 8,313
  • 6
  • 55
  • 73
6
votes
1 answer

Adding a row to ListStore not working - ridiculous exception

First the code: from gi.repository import Gtk, GtkSource, GObject import os.path import shelve class MusicCollection(object): def __init__(self): self.builder = Gtk.Builder() self.glade_file = 'music.glade' …
Siekacz
  • 303
  • 1
  • 9
5
votes
1 answer

How do I get Geoclue Geolocation in Python? - What is desktop id parameter?

I'm trying to get the location (lat/lon) using GeoClue for Linux, and the Python interface (gir1.2-geoclue-2.0 package). The documentation for c nearly matches the api functions here, but I'm not sure what "desktop id" I should send... any valid…
NoBugs
  • 9,310
  • 13
  • 80
  • 146
5
votes
2 answers

ImportError: cannot import name GstRtspServer, introspection typelib not found

Im trying to get a simple GstRtspServer program working on an external amazon linux EC2 server at the moment, but I am having serious issues getting it to actually run. No matter what I do I keep getting this same error when I try to run it, even if…
4
votes
1 answer

How can I call methods on a GObject class written in C from python?

I am trying to create a GObject class in C and annotate it in a way, so that I can use the class from Python - but I think am missing something, since I get weird errors that I can't understand. Any help would be much appreciated! The class works as…
AHM
  • 5,145
  • 34
  • 37
4
votes
1 answer

Couldn't find include 'GObject-2.0.gir'

I am trying to install totem-pl-parser-3.10.7 on my Ubuntu 14.04, and after the autogen.sh + configure end successfully, I build with make. But I receive the following error: Couldn't find include 'GObject-2.0.gir' (search path: ['.', '.',…
Carlo Benussi
  • 165
  • 1
  • 14
4
votes
3 answers

Error "Could not find any typelib for Gtk" with Python3 and GTK3

I cannot make Python3 work with GTK3. I'm in a cluster context and I had everything recompiled from the sources. When I run a simple example : from gi.repository import Gtk win = Gtk.Window() win.connect("delete-event",…
Michael Dussere
  • 498
  • 7
  • 25
4
votes
1 answer

gobject-introspection overrides cause import errors

I am using gobject-introspection in python2.7 on ubuntu raring and I run into an import error while building some packages. I have isolated a minimal set of steps to replicate it: Make a local directory structure: gi: __init__.py …
pre-kidney
  • 193
  • 9
3
votes
1 answer

How does one call `gdk_frame_clock_get_refresh_info` from Python

While trying to use GTK 3 frame clock in a Python 3 script, I discovered that I don't understand how to invoke the equivalent of gdk_frame_clock_get_refresh_info(). I have first tried the obvious, to call the get_refresh_info() method on the object…
user4815162342
  • 141,790
  • 18
  • 296
  • 355
3
votes
1 answer

Is it possible to import the Gvc typelib outside of the Gnome Shell environment?

I'd like to use Gvc (libgnome-volume-control) as used in Gnome Shell GIR in GJS, but can't find a way to access it except within the Gnome Shell environment (eg. a Gnome Shell extension). Actually, I can't even figure out where it is. Is this…
3
votes
0 answers

GTK_DEBUG not respected when using Python + Gtk+

I am using Python 3.6 and Gtk+ 3.22.18 on macOS Sierra 10.12.4 (both Python and Gtk+ installed via Homebrew). I've found that neither the GTK_DEBUG environment variable, nor the --gtk-debug argument have any effect. However: They work for…
jdm
  • 9,470
  • 12
  • 58
  • 110
3
votes
1 answer

Adding button_press_event to Gtk.Image?

I try to create a custom Gtk.Image that handles the "clicked" signal but when I try to emit a signal from the custom Gtk.Image ,but can't figure out why doesn't the signal emit when there is a button press event. class WindowButton(Gtk.Image): …
user6778973
1
2 3 4 5 6 7