|
From: Matthew F. <mt...@fn...> - 2007-02-05 23:50:22
|
On Mon, 5 Feb 2007, James Lockie wrote:
> This Python code works:
> self.gaim.GaimSavedstatusSetMessage(self.status, message)
> self.gaim.GaimSavedstatusActivate(self.status)
I didn't know there was a Python API. Is it documented anywhere?
> I think you need
> gaim_savedstatus_activate
> in Perl which you can't find.
I fixed the problem by adding Gaim::SavedStatus::activate(saved_status)
into the source myself, and recompiling Gaim. I just needed to insert the
following lines into libgaim/plugins/perl/common/SavedStatuses.xs:
void
gaim_savedstatus_activate(saved_status)
Gaim::SavedStatus saved_status
This raises a question: why are there so many functions missing from the
Perl API? Surely all the hard work setting up the API is already done, and
Perl should now be able to handle every object type that exists in the C
API. We just need a more complete list of functions in those .xs files. Or
is there some complication I'm overlooking?
I also think that some work needs to be done on the documentation for the
C API, to make it more accessible to new developers. The "C Plugin HOWTO"
page is difficult to find, partway down an alphabetical list in the
"Related Pages" tab - I would expect this introduction to be linked
directly from http://gaim.sourceforge.net/api. Also the HOWTO is far too
brief, and it seems to finish unexpectedly. The last paragraph says, "Most
plugins will add their preferences to the pref tree here, more about that
later," - implying that this is the first chapter of a longer manual. But
where is "later"? In particular, I can't find any instructions for
building and installing C plugins. It would be useful to have a complete
standalone "Hello World" package as a starting point, and not just a C
file. Otherwise, as far as I can see, the only easy way to compile a new
package would be inside the Gaim source tree. Also, I think the
documentation should have line-by-line explanations for some slightly more
complicated/useful packages (like in the Perl HOWTO), including some
signal handling.
One further question: how would you implement Perl's "timeout" feature in
a C plugin - i.e. if you want Gaim to call your C function once every
60 seconds? I can't find any time-dependent signals in the documentation.
Matthew.
|