From: John H. Kelm <johnhkelm@us...> - 2005-08-18 22:12:07
Update of /cvsroot/gaim/web/htdocs/summerofcode/john/posts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18684
--- NEW FILE: 2005-08-17.txt ---
HOWTO Updated and Gtk2-Perl Working
Documentation is a wonderful thing. To make the Gaim perl API accessible to the user it is not only necessary for the Perl plugin to function, but for it to be explained well. The first draft of the new HOWTO has been added to the gaim/doc directory for your viewing pleasure. It does not cover everything as to be redundant; Rather I have attemtped to cover each of the major sections of XSUBs, the differences between the C and Gaim perl API, and some basic examples to get even a novice (hopefully) started in programming Perl plugins for Gaim. I alaready have some changes to make, but I will leave it as is until I get feedback or run out of time at which time I will post a final version incorporating all changes and feedback.
More importantly I have figured out how to solve a nagging bug in the perl interpreter that would not allow dynamically loaded packages (such as Gtk2-Perl) to be loaded outside of an <code>eval</code> block without crashing Gaim. The crashing problem was due to multiple perl interpreters running concurrently and the twice loading of the packages: once when the Perl script is probed and once while it is run. By setting the proper context for each interpreter to run in and switching some of the Perl script <code>use 'module'</code> to <code>require 'module'</code> I was able to get the desired results. No more <code>eval</code> blocks for loading packages! Hooray!
So, now the only vexing problem left (If you interpret it as a problem) is the hack needed to load perl without namespace problems. The hack is little more than a library that reloads the Perl plugin without local binding of modules. It may not be possible to load the Perl plugin without placing all of its symbols in the global sybol table. Other than that, the Perl plugin is pretty much usable. One more test build and I will check in my revisions to the CVS repository. So enjoy and let me know if you find anything that is broken.