Re: contribution

From: Martin Sevior <msevior_at_gmail.com>
Date: Mon Dec 22 2008 - 01:24:36 CET

Hi Daniel,
              Sorry for taking so long to get back to you. I'll have
to refresh my memory to give you the correct answers to your very good
questions.

I'll respond within a day or two.

Cheers

Martin

On Sat, Dec 20, 2008 at 9:19 AM, Daniel Carvalho <idnael@gmail.com> wrote:
> Hi Martin!
>
>
> 2008/12/6 Martin Sevior <msevior@gmail.com>:
>> Hi Daniel,
>> You don;t need a deep understanding of abiword's
>> internals for most new features we might expose via the pyhton
>> interface.
>>
>> For example setting the background colour can be accomplished with a
>> about 20 lines of C++ in AbiWidget.cpp,h and then writing the
>> appropriate interface in the pyabiword bindings.
>>
>
> I have been tracking how the method delete_left is implemented, to try
> to understand it in general. Can you give me some comments?
> (thanks!)
>
>
> 1.
> first there is the pyabiword-0.6.1/src/pyabiword.defs which is a
> schema file that describes the association between python methods and
> c functions...
>
> (define-method delete_left
> (of-object "AbiWidget")
> (c-name "abi_widget_delete_left")
> (return-type "gboolean")
> )
>
>
> 2.
> Second, there is the pyabiword-0.6.1/src/pyabiword.c
>
> I suppose this is a wrapper because the python program cannot call
> directly the abiwidget C functions...
>
> static PyObject *
> _wrap_abi_widget_delete_left(PyGObject *self)
> {
> int ret;
> ret = abi_widget_delete_left(ABI_WIDGET(self->obj));
> return PyBool_FromLong(ret);
> }
>
> And this, what is for??
>
> static const PyMethodDef _PyAbiWidget_methods[] = {
> ....
> { "delete_left", (PyCFunction)_wrap_abi_widget_delete_left, METH_NOARGS,
> NULL },
>
>
> 3.
> Then we have the headers in abiword-2.6.4/src/wp/ap/unix/abiwidget.h
> where two functions are declared:
>
> Abi_Void__Bool_EditMethod delete_left;
> and
> gboolean abi_widget_delete_left (AbiWidget * w);
>
> What is the purpose of each one?
>
>
> 4.
> And finally the implementation in abiword-2.6.4/src/wp/ap/unix/abiwidget.cpp
>
> // Here we define our EditMethods which will later be mapped back onto
> // Our AbiWidgetClass' member functions
> EM_VOID__BOOL(delLeft, delete_left)
>
> And later, in function static void abi_widget_class_init
> (AbiWidgetClass *abi_class) we have a line with:
> abi_class->delete_left = EM_NAME(delLeft);
>
Received on Mon Dec 22 01:33:08 2008

This archive was generated by hypermail 2.1.8 : Mon Dec 22 2008 - 01:33:08 CET