• Stars
    star
    141
  • Rank 259,971 (Top 6 %)
  • Language
    Ruby
  • License
    GNU Lesser Genera...
  • Created about 15 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Auto-generate bindings for GObject based libraries at run time using FFI

GirFFI

by Matijs van Zuijlen

Description

Ruby bindings for GNOME using the GObject Introspection Repository.

Status

Gem Version Build Status Code Climate Documentation Status

Features

  • Create bindings to any GObject-based library.
  • Bindings are generated at runtime.
  • Provides overridden bindings for selected methods.
  • Install gir_ffi-gtk and require gir_ffi-gtk2 or gir_ffi-gtk3 to load overrides for Gtk2 or Gtk3.

Usage

require 'gir_ffi'

# Set up the namespace you wish to use
GirFFI.setup :Gio

# Create an object
inet_address = Gio::InetAddress.new_from_string "127.0.0.1"

# Call some methods on the object
inet_address.is_loopback    # => true
inet_address.is_multicast   # => false

# Call a function in the namespace
Gio.dbus_is_name "foo"   # => false

See the documentation for more usage information.

Examples

Have a look in the examples/ directory for some simple examples. More examples can be found in the repositories for gir_ffi-gtk and gir_ffi-gst.

Install

gem install gir_ffi

Requirements

GirFFI is supported on CRuby 2.7, 3.0 and 3.1.

You will also need gobject-introspection installed with some introspection data.

Depending on the GIR data, GirFFI needs the actual libraries to be available under the name ending in plain .so. If GirFFI complains that it cannot find the library, try installing development packages for those libraries.

GirFFI should work with gobject-introspection 1.56.0 and up, and glib 2.56.0 and up.

On Debian and Ubuntu, installing libgirepository-1.0-1 and gir1.2-glib-2.0 should be enough to use GirFFI in your application.

To run the tests, you should additionally install libgirepository1.0-dev, gobject-introspection, libcairo2-dev, gir1.2-gtop-2.0, gir1.2-gtk-3.0, gir1.2-pango-1.0, gir1.2-gtksource-3.0, gir1.2-secret-1 and gir1.2-gstreamer-1.0. This should be enough to get rake test working.

GirFFI has not been tested on Mac OS X or Microsoft Windows. YMMV. Pull requests to support these platforms are welcome.

Overrides

Sometimes, the GIR data is incorrect, or not detailed enough, and a reasonable binding cannot be created automatically. For these cases, overrides can be defined. The following gems with overrides already exist:

  • gir_ffi-gtk: overrides for Gtk+ 2 and 3.
  • gir_ffi-gnome_keyring: overrides for GnomeKeyring
  • gir_ffi-cairo: overrides for Cairo
  • gir_ffi-pango: overrides for Pango
  • gir_ffi-tracker: overrides for Tracker
  • gir_ffi-gst: overrides for GStreamer

Contributing

Please see CONTRIBUTING.md for contribution guidelines.

Contributors

The following people have contributed to GirFFI over the years:

  • John Cupitt
  • Marius Hanne
  • Antonio Terceiro
  • Matijs van Zuijlen

License

Copyright © 2009–2022 Matijs van Zuijlen

GirFFI is free software, distributed under the terms of the GNU Lesser General Public License, version 2.1 or later. See the file COPYING.LIB for more information.

More Repositories

1

email-outlook-message-perl

Email::Outlook::Message Perl module for reading Outlook .msg files
Perl
164
star
2

msgconvert

The old repository for the msgconvert script
Perl
38
star
3

memory_test_fix

The memory_test_fix rails plugin, as a gem
Ruby
37
star
4

alexandria-book-collection-manager

Fork of the Alexandria Book Collection Manager
Ruby
25
star
5

gir_ffi-gtk

GirFFI-based bindings for Gtk+. Supports both Gtk+ 2 and Gtk+ 3
Ruby
17
star
6

ripper_ruby_parser

Drop-in replacement for RubyParser using Ripper
Ruby
16
star
7

keep_up

Automatically update your gem dependencies
Ruby
11
star
8

ghtml2pdf

HTML to PDF converter based on WebKit2GTK+ and GirFFI
Ruby
7
star
9

mdv

Simple Markdown Viewer for GNOME 3
Ruby
7
star
10

git-subrepo-ng

Experimental re-implementation of git-subrepo in Ruby with Rugged
Shell
5
star
11

vb6-to-x

Converts VB6 projects to a more future-proof platform, such as Ruby
VBA
4
star
12

mubdub

Reads iTunes backup manifests
Ruby
3
star
13

pinhole

Tracker-based photo manager for Gnome
Ruby
3
star
14

litl

Lisp-inspired template language
Ruby
3
star
15

gir_ffi-gtk4

GirFFI-based bindings for Gtk+ 4
Ruby
3
star
16

nautilus-trash-date-deleted

Python plugin for Nautilus to show the date a file was put in the trash
Python
2
star
17

ripper_parser

Parse with Ripper, produce sexps that are compatible with Parser.
Ruby
2
star
18

gir_ffi-tracker

Ruby bindings for Tracker using GirFFI
Ruby
2
star
19

gir_ffi-gnome_keyring

GirFFI-based binding to GnomeKeyring
Ruby
2
star
20

gir_ffi-pango

GirFFI-based bindings for Pango
Ruby
2
star
21

rrb-ruby-refactoring-browser

Ruby Refactoring Browser
Ruby
2
star
22

iba

Introspective Block Assertions
Ruby
2
star
23

playdate

Plan recurring get-togethers.
Ruby
2
star
24

vb2py

Fork of http://vb2py.sourceforge.net/
Python
2
star
25

synttree

Typeset syntactic trees in LaTeX
1
star
26

phew-font-viewer

Focused Font Viewer for GNOME 3
Ruby
1
star
27

gnome_app_driver

Test Ruby-GNOME2 applications using Atspi
Ruby
1
star
28

mbrowser

Simple WebKit-based browser using GirFFI
Ruby
1
star
29

gir_ffi-cairo

GirFFI-based bindings for Cairo
Ruby
1
star
30

ffi-webkit-js

[Unmaintained] GirFFI-based bridge between WebKit and RubyJS
Ruby
1
star
31

deo

Only merge code that smells nice
Ruby
1
star
32

atspi_app_driver

Test drive GNOME applications via Atspi
Ruby
1
star
33

gir_ffi-gst

GirFFI-based bindings for GStreamer
Ruby
1
star