LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Gnumeric plugins (http://www.linuxquestions.org/questions/programming-9/gnumeric-plugins-873626/)

kaiserkarl13 04-07-2011 01:23 PM

Gnumeric plugins: can they be in a compiled language?
 
Does anyone know whether it is possible to write compiled plugins for Gnumeric? I've had some experience writing plugins in Python, and I've encountered two problems:
(1) A plugin containing mathematical functions is actually slower than setting up the same formulas in the spreadsheet and adding them together. The spreadsheet becomes fairly unmanageable that way, hence the decision to write a plugin, but the plugin makes it take considerably longer to execute.
(2) I've encountered a fairly significant memory leak due to Gnumeric not cleaning up references after the Python functions exit. Each call to Python produces more references and leaked memory. The function in (1) leaks memory at the rate of about 1 GB per minute for one of my spreadsheets.

I'm wondering if there's another method, possibly involving a compiled language like C, C++, or Fortran, that would produce faster plugins and possibly solve/circumvent the memory leak problems.

There's a package that ships with Fedora and some other distros called "gnumeric-devel"; the description says it "includes files necessary to develop Gnumeric-based applications." What would a "Gnumeric-based application" be, exactly, and what files does it include?

Thanks in advance.

kaiserkarl13 04-15-2011 05:19 PM

For that matter...
 
For that matter, is there a better way to get actual numbers (instead of references to them) in the Python plugins? For example, I've had to do something like the following:

Code:

cellsum = Gnumeric.functions['sum']
index = Gnumeric.functions['index']
A = cellsum(index(cells,1,1))

to set A to the value of cell A1, when all I really wanted was something like
Code:

  A = cells(1,1)
OR
  A = cells[0][0]



All times are GMT -5. The time now is 11:51 PM.