GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - gstreamer-java/gir2java: An attempt at creating Java bindings sources from GObject Introspection XML files

BranchesTags
Open more actions menu

Latest commit

 

History

111 Commits
111 Commits

Folders and files

NameName
Last commit message
Last commit date
ext
ext
 
 
generated-src/generated
generated-src/generated
 
 
gir
gir
 
 
src/gir2java
src/gir2java
 
 
tests-src/gir2java/tests
tests-src/gir2java/tests
 
 
.classpath
.classpath
 
 
.gitignore
.gitignore
 
 
.project
.project
 
 
COPYING
COPYING
 
 
COPYING.lesser
COPYING.lesser
 
 
README.md
README.md
 
 
build.xml
build.xml
 
 
c-typedefs
c-typedefs
 
 
static-mappings
static-mappings
 
 
test.ogv
test.ogv
 
 

Repository files navigation

gir2java

This is an experimental parser and generator that creates Java bindings sources from GObject Introspection .gir XML files. XOM is used for parsing the XMLs. The generated Java code is built and exported using CodeModel. The native interoperability library used is BridJ.

Status

Currently, gir2java is capable of:

  • generating enums for <enumeration> and <bitfield> elements found in .girs
  • using <package> elements to generate package names
  • creating empty interfaces for opaque structs
  • creating classes for <record> and <class> elements with fields
  • tracking types defined in the .gir files, and resolving references to them
  • handling array types to some degree
  • reading a static mappings list
  • keeping a diagnostic list of referenced, and defined types, and their difference to help identify any external dependencies
  • parsing the given files in topologically sorted order based on includes, which means the parser should see type definitions before references to them
  • generating class-specific and namespace-wide functions/methods

While it currently seems that a modern system provides enough information in .gir files to generate a GStreamer bindings set from them down to GLib primitive types, a previous effort was made to generate low-level GLib/GObject bindings using a different approach at gstreamer-1.x-java. This is because GObject and below were expected to be special and not able to be generated from .gir files, especially following a discussion on gir-devel-list.

Building

The repository contains an Eclipse (3.8.1) project that you can import straight to your workspace. You can run the Gir2Java class, which will print usage information.

An Ant buildfile is also provided. To try and build a set of bindings to the point of having generated class files, put your input .gir files into the gir directory, and run the compile-bindings target. It takes care of compiling gir2java, running the parser, and compiling the results. An ant clean might help if you encounter any problems. If you are not just curious about the layout of the generated code, this step is definitely recommended, as an example output is already present in the generated-src directory, and it is not cleared before generation. Compile-time errors in the generated code may still occur, unfortunately.

GLib, GObject, Gio, GModule, Gst-1.0, GstBase-1.0, and GstVideo-1.0, however, should build without errors on an Ubuntu 14.04 amd64 system.

Testing

There is a run-tests build target you can run, which generates and compiles everything, then runs all the test cases. Currently, you should see a simple GList test, a test that plays a video file using a playbin, and one that assembles and runs a simple video pipeline.

About

An attempt at creating Java bindings sources from GObject Introspection XML files

Resources

Readme
Activity
Custom properties

Stars

3 stars

Watchers

4 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.