InterviewSolution
| 1. |
How Do I Extend Pygtk (or The Art Of Wrapping)? |
|
Answer» In order to make a new wrapper for PyGObject/PyGTK, you can use this FAQ as a guideline or checklist. Don't miss out FAQ 6.3 which has a link to an online article, additionally. Let's call the library "foo" (how original) 1) foo.defs.
h2defs.py /usr/include/foo-1.0/*.h > foo.defs 2) foomodule.c
3) foo.override
4) Makefile.am AUTOMAKE_OPTIONS=1.5 Should be ENOUGH for you to get STARTED 5) configure.in
PKG_CHECK_MODULES(FOO, foo >= 1.2,,) Finally, copy autogen.sh and hopefully you'll have most FUNCTIONS wrapped. Eventually you'll have to wrap a few functions by hand, functions that the code generator cannot handle. Mostly functions with inout params (**) and GSList/GList parameters. In order to make a new wrapper for PyGObject/PyGTK, you can use this FAQ as a guideline or checklist. Don't miss out FAQ 6.3 which has a link to an online article, additionally. Let's call the library "foo" (how original) 1) foo.defs. h2defs.py /usr/include/foo-1.0/*.h > foo.defs 2) foomodule.c 3) foo.override 4) Makefile.am AUTOMAKE_OPTIONS=1.5 Should be enough for you to get started 5) configure.in PKG_CHECK_MODULES(FOO, foo >= 1.2,,) Finally, copy autogen.sh and hopefully you'll have most functions wrapped. Eventually you'll have to wrap a few functions by hand, functions that the code generator cannot handle. Mostly functions with inout params (**) and GSList/GList parameters. |
|