Plot idl




Hi,

Thought I'd send off this IDL for any comments. I sort of absorbed
Gnumeric.idl, we can sort out later which definitions are where I guess. 

Havoc

module Gnome {

  // Don't want names like "Value" in the global Gnome namespace
  module Plot {
    
    // I think the query service has this too, it can be used
    // eventually.
    enum ValueType {
      TypeDouble,
      TypeInteger,
      TypeString
    };
    
    // Not all plot types have to support all value
    //  types. Kind of sucky.
    union Value switch (ValueType) {
    case TypeDouble: double d;
    case TypeInteger: long i;
    case TypeString: string str;
    };
 
    exception OutOfRange {};

    // Just a glorified array, for now anyway. 

    interface Values {
      attribute string name;
      readonly attribute unsigned long size;

      Value get_value(in unsigned long index) 
	raises (OutOfRange);
      void  set_value(in unsigned long index, in Value value)
	raises (OutOfRange);

      // Can get the whole array at once, if desired.
      typedef sequence<Value> Data;
      attribute Data values;
    };

    interface Table {
      // Each sequence is a "row" (arbitrarily, could have 
      //  been a column), and rows are the unit of plotting.
      //  i.e. an axis will represent a row not a column.
      // This is backward from Guppi internals but consistent with 
      //  some of the plot widget's internals. 

      typedef sequence<Values> Data;
      attribute Data rows;

      // Number of rows and columns for a square Table;
      //  if the Table is ragged the number of rows/columns 
      //  in the longest row/column.

      readonly attribute unsigned long num_columns;
      readonly attribute unsigned long num_rows;

      // convenience for getting a single value.
      Value get_value(in unsigned long row, in unsigned long column)
	raises (OutOfRange);
    };

    // Base class; all plots can do this
    interface Plot {
      // display on screen in a window.
      //  The window may offer a way to edit the plot.
      void display();
    
      // Currently not supported by any plots
      string get_postscript();

      // A pool of Values the plot should make available
      //  in its editor.
      attribute Table table;

      // The title of the plot - user can 
      //  probably change this with the editor.
      attribute string title;

      // Eventually we want a way to get an embeddable object,
      //  to embed in the spreadsheet or whatever. 
      // Then display() is just a shortcut for obtaining this object
      //  and sticking it in a standalone window.
    };
  
    interface Axis {
      // Data to plot.
      attribute Values data;

      // Beginning and end value to plot.
      attribute Value start_value;
      attribute Value stop_value;

      attribute string title;
    };

    interface TwoDPlot : Plot {
      // User may be able to set these too, with the plot's built-in
      // editor facilities.
      attribute Axis x_axis;
      attribute Axis y_axis;
    };

    interface ThreeDPlot : Plot {
      attribute Axis x_axis;
      attribute Axis y_axis;
      attribute Axis z_axis;
    };

    interface ScatterPlot : TwoDPlot {
    

    };

  };

  // This module should eventually be broken into another file; it's
really
  //  unrelated.
  module Math {
    interface DataSet {
      // Uh, doesn't do anything much yet.

      double max();
      double min();
      
      // Can add all the DataSet functionality here.
    };


  };
};




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]