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
1
vote
0 answers

Setup macOS13 Ventura with Apple M2 chip - Unable to install header files for compiling C extensions

While setting up a new laptop, macOS 13 Ventura, Apple M2 chip, for RoR. The directions recommend running the following command: sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / The…
1
vote
0 answers

Gtk.ApplicationWindow cannot be a Parent

While porting my App (with modal dialogs) from Gtk(3.0) to Gtk(4.0) I found out that I want to use a Gtk.ApplicationWindow instead of a Gtk.Window. But now the Dialogs are not modal/they do not accept my Gtk.ApplicationWindow as Parent. As I know…
Heschy
  • 31
  • 5
1
vote
0 answers

How to install python and gobject runtime in Yocto / OpenEmbeded?

My helloword code: import gi gi.require_version('Poppler', '0.18') gi.require_version('Gtk', '3.0') from gi.repository import Poppler, Gtk def draw(vp, surface): surface.set_source_rgb(0.7, 0.7, 0.7) surface.paint() size =…
eri
  • 3,133
  • 1
  • 23
  • 35
1
vote
1 answer

Does Python have a "pointer" equivalent for the purposes of PyGObject?

I am trying to use Gtk.SelectionData.set, for which one parameter is data (bytes) – pointer to the data (will be copied) The data I want to pass is a Gtk.EventBox, but I am unclear on how to create a pointer to this data, or whether I even should.…
1
vote
0 answers

How to set font size of a GTK label with gi-gtk-declarative?

I want larger text but am not sure how. (I found Label has an attributes attribute of type PangoAttrList but can't figure out how to construct the latter (if indeed that is how one sets the font size) in a context where it can be set on the Label…
M Farkas-Dyck
  • 646
  • 4
  • 14
1
vote
1 answer

HarfBuzz language_from_string Python introspection method doesn't accept str

I'm just getting started with HarfBuzz, and have switched to using the GObject Introspection interface to explore its API. Everything has been easy so far, but I'm a bit confused with language_from_string, which has the following…
Sam Mason
  • 15,216
  • 1
  • 41
  • 60
1
vote
1 answer

How to get a GObject.Callback from PyGObject?

I'm trying to add callback functions to a Gtk.Builder using Gtk.Builder.add_callback_symbol. I tried to pass a python function to it, but that does not work. Documentation says I need to pass a GObject.Callback instead, so I tried to cast one by…
Bachsau
  • 1,213
  • 14
  • 21
1
vote
0 answers

gobject introspection property not available in python

I'm having some trouble with python introspection and a custom Gstreamer element...I'm unable to access properties on the element. Here's the relevant code in my gstreamer element: // Properties declared on the class object static void…
Trevor
  • 1,369
  • 2
  • 13
  • 28
1
vote
0 answers

does gi work in windows?

After days of research on stackoverflow and the web and trying imports and installs using pip, pacman, MSYS2, python -m, and researching here, I have concluded that gtk, gi.repository is not ready for windows just yet. So I am looking for another…
MrMulti
  • 11
  • 4
1
vote
1 answer

Using pygi, how can I override a virtual method from a GObject class that has the same name as a virtual method in its base class?

Using GObject Introspection in Python, I am trying to create a custom PushSrc element, which requires override create or fill virtual methods, without success. The issue seems to be that both PushSrc and its base class, BaseSrc, has these virtual…
1
vote
1 answer

Is there any .NET binding for GObject Introspection?

I googled it and in the official page, it said that they have .NET binding. But when I had a look on the list of bindings it provides, I couldn't find any binding for C#. So I wonder if such kind of binding really exist now.
Ivan
  • 341
  • 1
  • 4
  • 13
1
vote
1 answer

Asynchronuous call to GnomeKeyring using GObjectIntrospection

I am writing a gnome-shell extension that shows the current balance of prepaid-cards like phones (or electricity). As this needs credentials for the given services, I do not want to store the password in gsettings, but as entry in gnome…
1
vote
1 answer

Python GObject Introspection for Windows 7

I am trying to use matplotlib in Python but any imports fail with the following error: from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas Traceback (most recent call last): File "", line 1, in
enrm
  • 645
  • 1
  • 8
  • 22
1
vote
1 answer

Gnome GJS Error: Gdk.Keymap.get_modifier_state is not a function

I'm trying to get the keyboard modifier state, porting this GDK example here to Gnome GJS to use it in a Gnome extension. The code below is modified official demo from https://developer.gnome.org/gnome-devel-demos/stable/hellognome.js.html.en . The…
user.dz
  • 962
  • 2
  • 19
  • 39
1
vote
1 answer

How to generate the valadoc for a C library (or any library whose bindings ships with vala)?

I want to re-generate the valadoc for the gnome gio-2.0 library (that is part of glib). I'm aware that the complete documentation is available online. I want to be able to generate it locally (ideally without having to rebuild the library…
Name is carl
  • 5,961
  • 3
  • 29
  • 44