Todo List for R-Gnumeric Plugin

  • Handle shared environments for functions when saving and restoring.
    Add
        if(TYPEOF(x) == ENVSXP && TYPEOF(y) == ENVSXP) {
            SEXP ans;
    	PROTECT(ans = allocVector(LGLSXP, 1));     
            LOGICAL(ans)[0] = (x->u.envsxp.enclos == y->u.envsxp.enclos);
            UNPROTECT(3);
            return(ans);
        }
    
    to
    SEXP do_relop_dflt(SEXP call, SEXP op, SEXP x, SEXP y)
    in relop.c
  • Put scrollbars on the text and list in the editor.
  • Methods from Gnumeric.idl
    cursor_move() select_all() selection_append_range()
    insert column and rows.

    Done:
    cursor_set() make_cell_visible()

  • Function to switch the view to a different sheet.
    Doesn't seem to be anything in the API.
  • Documentation for functions (in XML).
    And the manuals also. Actually the manuals are probably best since the help pages are hard to view when running Gnumeric.
  • Finish off the "$" operators for GnumericCellRef class.
    background and foreground color, font, format, border and protection.

    Most are done, need to do the get (set almost done) and handle borders.

    Can't set border currently. Just need to add the code.

  • Like to get the S functions and initialization (registration, etc.) into the XML file itself rather than depending on the R_GNUMERIC_PROFILE setting.
    Instead, put them in $HOME/.gnumeric/Rprofile, $HOME/.gnumeric/<version-number>/plugins/R/Rprofile and the environment variable R_GNUMERIC_PROFILE

    Maybe put the name of the file in a comment. Thinking of adding a plugin for reading and writing files which would just extend the existing Gnumeric mechanism.

  • Add a once function/argument which replaces the contents of the cell defining the S call with the value and so avoids recomputing it each time.
    Logistic problems when we save this!
  • getRegisteredFunctions() should take a full logical argument indicating whether a full description is desired which includes the argument types, etc.
  • Allowing setting a cell by expression.
    See sheet_cell_set_expr(). Need to figure out what the expressions look like.
  • Add support for the sheet pointers and methods.
    Are these the ones I have already implemented [, [[, etc?
  • General converter mechanism.
    Could also potentially convert S object to XML and then read that into gnumeric cells.
  • Add tests for the class of a reference object.
    Either at the S-level or C-level (preferrable).

    The general mechanism is there, just haven't transitioned the code to use it.

  • Handle classes (and general lists?) in conversion as references.
  • Working

  • Remove a sheet.
    See removeSheet in sheet.S

    Goes into an inifite loop. Not certain why, but it is the routines we call in Gnumeric that cause this. Perhaps we need to look at the API! :-)

    That problem is fixed now, but there is the inherent problem of removing a sheet causing the workbook to be recalculated and hence the cell expression and S call to removeSheet being repeated ad nauseam.

  • See if we can get the names of the columns.
    Doesn't appear that one can edit them in Gnumeric so they are fixed. So add support for using names and map them to column indices.

    The names are A...Z, AA...AZ, BA...BZ, CA...CZ, ....

  • Add variable number of arguments handler.
  • Handle errors correctly.
    Replace the jump_now() with what is coming in the exception C-level API for R.

    Requires Defn.h to get RCNTXT definition. Works now, but need to get this into the R API.

  • Apply formatCell to a range of cells.
    Use the mechanism in updateCell().

    Code implemented. Seems functional. See testFormat() and the formatting example sheet.

  • Function in S to read region of a sheet as a data frame.
    Also, function to get current selection region.
    See getSheetColumn() and getSheetRegion() in sheet.S.
  • Matrix-like [ and [<- operators.
    Current ones are element-wise, not column and row oriented.

    Basic version done in sheet.S

  • Text alignments must have names.
    Now done in gnumeric.getAlignValue()
  • Add a Gnumeric specific Profile that is sourced when we start.
    See .First.lib.

    Extend to multiple files separated by : (or the platform specific separator).

  • Formatting functions for a cell, range of cells, etc.
    See format.S

    Need to figure out

    • sharing the style across the cells within a column.
      Done now. See updateCell() and updateSCell().
  • Function in S to load a file into Gnumeric.
    See workbook_read(). Need WorkbookControl. Can we read a file directly into a sheet, or do we need a new workbook.

    Currently can start a new workbook with a file.

  • List of the existing sheet names (and sheet references).
    See workbook.S
  • Get dim or extent of a sheet.
    dim is the size of the bounding box. extent is the start and end cell of the box.
  • Recalc function.
    See recalcBook().
  • Get the naming of new sheets to be unique.
    Use the gnumeric facility. Since we can also get the names of a worksheet's sheets, we can do the computations in R.

    uniqueSheetName() function in workbook.S

  • Function in S to write an object into a region of a sheet.
    See insert.S for matrix.
    Matrix done. Vectors also via the "[<-" function. Need data frames and then other "primitive"/builtin types.
  • Want a way to determine if R is being run from within Gnumeric.
    Check the commandArgs() to see if RGnumeric is the first element.

  • Last modified: Mon Jul 2 06:56:30 EDT 2001