Commit 86019e8c authored by Arturo Espinosa's avatar Arturo Espinosa

Sorry guys. This is the real one :-)



Sorry guys.  This is the real one :-)

This stuff actually works dudes!   It is pretty awesome.

Miguel.
parent de741043
1999-05-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
* configure.in: Laptop does not have resources. Make guile
optional until at least.
* src: Now we only support two modes: Gnumeric and
Gnumeric-Bonobo. The later includes all of the CORBA support,
there is no longer a non-Bonobo CORBA version.
* src/corba-workbook.c, src/corba-sheet.c, src/workbook-factory.c:
New files that support the Gnumeric CORBA interfaces.
1999-05-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/corba-workbook.c (WorkbookFactory_init): Add workbook
factory servant initialization.
1999-05-04 Morten Welinder <terra@diku.dk>
* src/eval.c (dependency_remove_cell): Remove unused assignment.
......
1999-05-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
* configure.in: Laptop does not have resources. Make guile
optional until at least.
* src: Now we only support two modes: Gnumeric and
Gnumeric-Bonobo. The later includes all of the CORBA support,
there is no longer a non-Bonobo CORBA version.
* src/corba-workbook.c, src/corba-sheet.c, src/workbook-factory.c:
New files that support the Gnumeric CORBA interfaces.
1999-05-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/corba-workbook.c (WorkbookFactory_init): Add workbook
factory servant initialization.
1999-05-04 Morten Welinder <terra@diku.dk>
* src/eval.c (dependency_remove_cell): Remove unused assignment.
......
SUBDIRS = intl po macros libglade plugins src doc
EXTRA_DIST = \
gnumeric.desktop README HACKING gnumeric.spec.in \
gnumeric.keys.in gnumeric.mime $(appicon_DATA)
gnumeric.desktop README HACKING gnumeric.spec.in \
gnumeric.keys.in gnumeric.mime $(appicon_DATA) \
gnumeric.gnorba
appicondir = $(datadir)/pixmaps
appicon_DATA = gnome-gnumeric.png gnome-gnumeric-xl.png
......@@ -16,6 +17,9 @@ Mime_DATA = gnumeric.keys gnumeric.mime
gnewdir = $(datadir)/mc/templates
gnew_DATA = gnumeric.desktop
gnorbadir = $(sysconfdir)/CORBA/servers
gnorba_DATA = gnumeric.gnorba
gnumeric.keys: gnumeric.keys.in Makefile
sed -e 's^\@icondir\@^$(appicondir)^g' < $(srcdir)/gnumeric.keys.in > gnumeric.keys.tmp \
&& mv gnumeric.keys.tmp gnumeric.keys
......
1999-05-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
* configure.in: Laptop does not have resources. Make guile
optional until at least.
* src: Now we only support two modes: Gnumeric and
Gnumeric-Bonobo. The later includes all of the CORBA support,
there is no longer a non-Bonobo CORBA version.
* src/corba-workbook.c, src/corba-sheet.c, src/workbook-factory.c:
New files that support the Gnumeric CORBA interfaces.
1999-05-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/corba-workbook.c (WorkbookFactory_init): Add workbook
factory servant initialization.
1999-05-04 Morten Welinder <terra@diku.dk>
* src/eval.c (dependency_remove_cell): Remove unused assignment.
......
1999-05-05 Miguel de Icaza <miguel@nuclecu.unam.mx>
* configure.in: Laptop does not have resources. Make guile
optional until at least.
* src: Now we only support two modes: Gnumeric and
Gnumeric-Bonobo. The later includes all of the CORBA support,
there is no longer a non-Bonobo CORBA version.
* src/corba-workbook.c, src/corba-sheet.c, src/workbook-factory.c:
New files that support the Gnumeric CORBA interfaces.
1999-05-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/corba-workbook.c (WorkbookFactory_init): Add workbook
factory servant initialization.
1999-05-04 Morten Welinder <terra@diku.dk>
* src/eval.c (dependency_remove_cell): Remove unused assignment.
......
......@@ -24,9 +24,7 @@ AC_SUBST(TERMCAP_LIB)
AC_SUBST(READLINE_LIB)
AC_SUBST(GUILE_LIBS)
AC_SUBST(GUILE_INCS)
GNOME_CHECK_GUILE
dnl AC_ARG_WITH(guile,[--with-guile Include Guile support],[GNOME_CHECK_GUILE])
AC_ARG_WITH(guile,[--with-guile Include Guile support],[GNOME_CHECK_GUILE])
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
......@@ -158,6 +156,7 @@ libglade/glade/Makefile
doc/Makefile
doc/C/Makefile
doc/es/Makefile
corba-test/Makefile
plugins/Makefile
plugins/sample/Makefile
plugins/excel/Makefile
......@@ -174,3 +173,4 @@ macros/Makefile
stamp.h
],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
#include <gnome-factory.idl>
#include <gnome-object.idl>
module GNOME {
module Gnumeric {
......@@ -25,6 +26,7 @@ module GNOME {
interface Sheet {
exception OutOfRange {};
exception ParseError {};
exception InvalidValue {};
void cursor_set (in long base_col, in long base_row,
in long start_col, in long start_row,
......@@ -75,6 +77,8 @@ module GNOME {
//
// Cell management
//
void cell_set_value (in long col, in long row, in Value value)
raises (OutOfRange);
Value cell_get_value (in long col, in long row)
raises (OutOfRange);
......@@ -90,7 +94,8 @@ module GNOME {
raises (OutOfRange);
string cell_get_format (in long col, in long row)
raises (OutOfRange);
void cell_set_font (in long col, in long row, in string font)
void cell_set_font (in long col, in long row, in string font, in short points)
raises (OutOfRange);
string cell_get_font (in long col, in long row)
raises (OutOfRange);
......@@ -104,6 +109,7 @@ module GNOME {
raises (OutOfRange);
string cell_get_foreground (in long col, in long row)
raises (OutOfRange);
void cell_set_background (in long col, in long row, in string color)
raises (OutOfRange);
string cell_get_background (in long col, in long row)
......@@ -135,6 +141,31 @@ module GNOME {
out long orientation, out boolean auto_return)
raises (OutOfRange);
//
// Cell regions
//
typedef sequence<Value> ValueVector;
ValueVector range_get_values (in string range)
raises (OutOfRange);
void range_set_text (in string range, in string text)
raises (OutOfRange);
void range_set_formula (in string range, in string formula)
raises (OutOfRange);
void range_set_format (in string range, in string format)
raises (OutOfRange);
void range_set_font (in string range, in string font, in short points)
raises (OutOfRange);
void range_set_foreground (in string range, in string color)
raises (OutOfRange);
void range_set_background (in string range, in string color)
raises (OutOfRange);
void range_set_pattern (in string range, in long pattern)
raises (OutOfRange);
void range_set_alignment (in string range,
in long halign, in long valign,
in long orientation, in boolean auto_return)
raises (OutOfRange);
//
// Sheet administrivia
......@@ -157,7 +188,7 @@ module GNOME {
};
interface Workbook {
interface Workbook : GNOME::object {
exception NameExists {};
Sheet sheet_new (in string name) raises (NameExists);
......
......@@ -20,7 +20,7 @@
if BONOBO
bin_PROGRAMS = gnumeric-bonobo
else
bin_PROGRAMS = gnumeric-corba gnumeric
bin_PROGRAMS = gnumeric
endif
#noinst_PROGRAMS = number-match
......@@ -162,19 +162,12 @@ gnumeric_SOURCES = \
normal-args.c \
$(GNUMERIC_BASE_SOURCES)
gnumeric_corba_SOURCES = \
main.c \
corba-args.c \
corba-sheet.c \
corba-workbook.c \
$(GNUMERIC_CORBA_GENERATED) \
$(GNUMERIC_BASE_SOURCES)
gnumeric_bonobo_SOURCES = \
main.c \
corba-args.c \
corba-sheet.c \
corba-workbook.c \
corba-workbook-factory.c \
$(GNUMERIC_CORBA_GENERATED) \
$(GNUMERIC_BASE_SOURCES) \
$(GNUMERIC_BONOBO_SOURCES)
......@@ -190,10 +183,6 @@ gnumeric_LDADD = \
$(GUILE_LIBS) \
$(INTLLIBS)
gnumeric_corba_LDADD = \
$(gnumeric_LDADD) \
$(GNOMEGNORBA_LIBS)
gnumeric_bonobo_LDADD = \
../plugins/excel/libexcel.a \
../libglade/glade/libglade.a \
......
......@@ -26,9 +26,10 @@ gnumeric_arg_parse (int argc, char *argv [])
gnome_CORBA_init_with_popt_table (
"gnumeric", VERSION, &argc, argv, gnumeric_popt_options, 0, &ctx, 0, &ev);
#ifdef ENABLE_BONOBO
if (bonobo_init (gnome_CORBA_ORB (), NULL, NULL) == FALSE){
g_error ("Failure starting up Bonobo");
}
#endif
if (!WorkbookFactory_init ()){
g_warning (_("Could not initialize the Gnumeric Workbook factory"));
}
}
......@@ -11,6 +11,8 @@
#include "sheet.h"
#include "gnumeric.h"
#include "Gnumeric.h"
#include "corba.h"
#include "utils.h"
#define verify(cond) if (!(cond)){ out_of_range (ev); return; }
#define verify_val(cond,val) if (!(cond)){ out_of_range (ev); return (val); }
......@@ -23,16 +25,26 @@
verify(c1 <= c2);\
verify (r1 <= r2);
static POA_GNOME_Gnumeric_Sheet__vepv gnome_gnumeric_sheet_vepv;
static POA_GNOME_Gnumeric_Sheet__epv gnome_gnumeric_sheet_epv;
typedef struct {
POA_GNOME_Gnumeric_Sheet servant;
Sheet *sheet;
} SheetServant;
static void
out_of_range (CORBA_Environment *ev)
{
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Gnumeric_Sheet_OutOfRange, NULL);
}
static Sheet *
static inline Sheet *
sheet_from_servant (PortableServer_Servant servant)
{
return NULL;
SheetServant *ss = (SheetServant *) servant;
return ss->sheet;
}
static void
......@@ -207,8 +219,65 @@ Sheet_clear_region_formats (PortableServer_Servant servant,
sheet_clear_region_formats (sheet, start_col, start_row, end_col, end_row);
}
static void
Sheet_cell_set_value (PortableServer_Servant servant,
const CORBA_long col, const CORBA_long row,
const GNOME_Gnumeric_Value *value,
CORBA_Environment * ev)
{
Sheet *sheet = sheet_from_servant (servant);
Cell *cell;
Value *v;
verify_col (col);
verify_row (row);
cell = sheet_cell_fetch (sheet, col, row);
switch (value->_d){
case GNOME_Gnumeric_VALUE_STRING:
v = value_str (value->_u.str);
break;
case GNOME_Gnumeric_VALUE_INTEGER:
v = value_int (value->_u.v_int);
break;
case GNOME_Gnumeric_VALUE_FLOAT:
v = value_float (value->_u.v_float);
break;
case GNOME_Gnumeric_VALUE_CELLRANGE: {
CellRef a, b;
parse_cell_name (value->_u.cell_range.cell_a, &a.col, &a.row);
parse_cell_name (value->_u.cell_range.cell_b, &b.col, &b.row);
a.sheet = sheet;
b.sheet = sheet;
a.col_relative = 0;
b.col_relative = 0;
a.row_relative = 0;
b.row_relative = 0;
v = value_cellrange (&a, &b);
break;
}
case GNOME_Gnumeric_VALUE_ARRAY:
g_error ("FIXME: Implement me");
break;
default:
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Gnumeric_Sheet_InvalidValue, NULL);
return;
}
cell_set_value (cell, v);
}
static GNOME_Gnumeric_Value *
Sheet_cell_get_value (PortableServer_Servant servant, const CORBA_long col, const CORBA_long row, CORBA_Environment * ev)
Sheet_cell_get_value (PortableServer_Servant servant,
const CORBA_long col, const CORBA_long row,
CORBA_Environment * ev)
{
Sheet *sheet = sheet_from_servant (servant);
GNOME_Gnumeric_Value *value;
......@@ -252,7 +321,7 @@ Sheet_cell_get_value (PortableServer_Servant servant, const CORBA_long col, cons
}
case VALUE_ARRAY:
g_error ("FIXME");
g_error ("FIXME: Implement me");
}
} else {
value->_d = GNOME_Gnumeric_VALUE_INTEGER;
......@@ -359,6 +428,7 @@ Sheet_cell_set_font (PortableServer_Servant servant,
const CORBA_long col,
const CORBA_long row,
const CORBA_char * font,
const CORBA_short points,
CORBA_Environment * ev)
{
Sheet *sheet = sheet_from_servant (servant);
......@@ -735,8 +805,89 @@ Sheet_shift_cols (PortableServer_Servant servant,
}
static void
Sheet_corba_class_init (void)
{
static int inited;
if (inited)
return;
inited = TRUE;
gnome_gnumeric_sheet_vepv.GNOME_Gnumeric_Sheet_epv =
&gnome_gnumeric_sheet_epv;
gnome_gnumeric_sheet_epv.cursor_set = Sheet_cursor_set;
gnome_gnumeric_sheet_epv.cursor_move = Sheet_cursor_move;
gnome_gnumeric_sheet_epv.make_cell_visible = Sheet_make_cell_visible;
gnome_gnumeric_sheet_epv.select_all = Sheet_select_all;
gnome_gnumeric_sheet_epv.is_all_selected = Sheet_is_all_selected;
gnome_gnumeric_sheet_epv.selection_reset = Sheet_selection_reset;
gnome_gnumeric_sheet_epv.selection_append = Sheet_selection_append;
gnome_gnumeric_sheet_epv.selection_append_range = Sheet_selection_append_range;
gnome_gnumeric_sheet_epv.selection_copy = Sheet_selection_copy;
gnome_gnumeric_sheet_epv.selection_cut = Sheet_selection_cut;
gnome_gnumeric_sheet_epv.selection_paste = Sheet_selection_paste;
gnome_gnumeric_sheet_epv.clear_region = Sheet_clear_region;
gnome_gnumeric_sheet_epv.clear_region_content = Sheet_clear_region_content;
gnome_gnumeric_sheet_epv.clear_region_comments = Sheet_clear_region_comments;
gnome_gnumeric_sheet_epv.clear_region_formats = Sheet_clear_region_formats;
gnome_gnumeric_sheet_epv.cell_set_value = Sheet_cell_set_value;
gnome_gnumeric_sheet_epv.cell_get_value = Sheet_cell_get_value;
gnome_gnumeric_sheet_epv.cell_set_text = Sheet_cell_set_text;
gnome_gnumeric_sheet_epv.cell_get_text = Sheet_cell_get_text;
gnome_gnumeric_sheet_epv.cell_set_formula = Sheet_cell_set_formula;
gnome_gnumeric_sheet_epv.cell_set_format = Sheet_cell_set_format;
gnome_gnumeric_sheet_epv.cell_get_format = Sheet_cell_get_format;
gnome_gnumeric_sheet_epv.cell_set_font = Sheet_cell_set_font;
gnome_gnumeric_sheet_epv.cell_get_font = Sheet_cell_get_font;
gnome_gnumeric_sheet_epv.cell_set_foreground = Sheet_cell_set_foreground;
gnome_gnumeric_sheet_epv.cell_get_foreground = Sheet_cell_get_foreground;
gnome_gnumeric_sheet_epv.cell_set_background = Sheet_cell_set_background;
gnome_gnumeric_sheet_epv.cell_get_background = Sheet_cell_get_background;
gnome_gnumeric_sheet_epv.cell_set_pattern = Sheet_cell_set_pattern;
gnome_gnumeric_sheet_epv.cell_get_pattern = Sheet_cell_get_pattern;
gnome_gnumeric_sheet_epv.cell_set_alignment = Sheet_cell_set_alignment;
gnome_gnumeric_sheet_epv.cell_get_alignment = Sheet_cell_get_alignment;
gnome_gnumeric_sheet_epv.set_dirty = Sheet_set_dirty;
}
void
sheet_corba_setup (Sheet *sheet)
{
SheetServant *ss;
CORBA_Environment ev;
PortableServer_ObjectId *objid;
Sheet_corba_class_init ();
ss = g_new0 (SheetServant, 1);
ss->servant.vepv = &gnome_gnumeric_sheet_vepv;
ss->sheet = sheet;
CORBA_exception_init (&ev);
POA_GNOME_Gnumeric_Sheet__init ((PortableServer_Servant) ss, &ev);
objid = PortableServer_POA_activate_object (gnumeric_poa, ss, &ev);
CORBA_free (objid);
sheet->corba_server = PortableServer_POA_servant_to_reference (gnumeric_poa, ss, &ev);
CORBA_exception_free (&ev);
}
void
sheet_corba_shutdown (Sheet *sheet)
{
CORBA_Environment ev;
g_return_if_fail (sheet != NULL);
g_return_if_fail (IS_SHEET (sheet));
g_return_if_fail (sheet->corba_server != NULL);
g_warning ("Should release all the corba resources here");
CORBA_exception_init (&ev);
PortableServer_POA_deactivate_object (gnumeric_poa, sheet->corba_server, &ev);
CORBA_exception_free (&ev);
}
/*
* corba-workbook-factory.c: CORBA Workbook factory.
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
*/
#include <config.h>
#include <libgnorba/gnome-factory.h>
#include <gnome.h>
#include "sheet.h"
#include "gnumeric.h"
#include "Gnumeric.h"
#include "xml-io.h"
#include "corba.h"
PortableServer_POA gnumeric_poa;
typedef struct {
POA_GNOME_Gnumeric_WorkbookFactory servant;
PortableServer_POA poa;
} WorkbookFactoryServant;
/* The servant for the workbook factory */
static WorkbookFactoryServant workbook_factory_servant;
/* The workbook factory object */
static GNOME_Gnumeric_WorkbookFactory gnumeric_workbook_factory;
static PortableServer_ServantBase__epv gnumeric_workbook_factory_base_epv;
static POA_GNOME_GenericFactory__epv gnumeric_workbook_generic_factory_epv;
static POA_GNOME_Gnumeric_WorkbookFactory__epv gnumeric_workbook_factory_epv;
static POA_GNOME_Gnumeric_WorkbookFactory__vepv gnumeric_workbook_factory_vepv;
static GNOME_Gnumeric_Workbook
WorkbookFactory_read (PortableServer_Servant servant, const CORBA_char * filename, CORBA_Environment * ev)
{
WorkbookFactoryServant *wfs = (WorkbookFactoryServant *) servant;
Workbook *workbook;
workbook = workbook_read (filename);
gtk_widget_show (workbook->toplevel);
if (workbook)
return workbook->corba_server;
else
return CORBA_OBJECT_NIL;
}
static CORBA_boolean
WorkbookFactory_supports (PortableServer_Servant servant,
const CORBA_char * obj_goad_id,
CORBA_Environment * ev)
{
g_warning ("Request for: %s\n", obj_goad_id);
printf ("Getting: %s\n", obj_goad_id);
if (strcmp (obj_goad_id, "IDL:GNOME:Gnumeric:Workbook:1.0") == 0)
return CORBA_TRUE;
else
return CORBA_FALSE;
}
static CORBA_Object
WorkbookFactory_create_object (PortableServer_Servant servant,
const CORBA_char *goad_id,
const GNOME_stringlist *params,
CORBA_Environment *ev)
{
Workbook *workbook;
if (strcmp (goad_id, "IDL:GNOME:Gnumeric:Workbook:1.0") != 0){
CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
ex_GNOME_GenericFactory_CannotActivate,
NULL);
return CORBA_OBJECT_NIL;
}
workbook = workbook_new ();
gtk_widget_show (workbook->toplevel);
return workbook->corba_server;
}
/*
* Workbook factory server bootstrap
*/
static GNOME_Gnumeric_WorkbookFactory
GNOME_Gnumeric_WorkbookFactory__create (PortableServer_POA poa, CORBA_Environment *ev)
{
WorkbookFactoryServant *wfs = &workbook_factory_servant;
PortableServer_ObjectId *objid;
/*
* Set up our tables
*/
gnumeric_workbook_factory_epv.read = WorkbookFactory_read;
gnumeric_workbook_generic_factory_epv.supports = WorkbookFactory_supports;
gnumeric_workbook_generic_factory_epv.create_object = WorkbookFactory_create_object;
gnumeric_workbook_factory_vepv.GNOME_Gnumeric_WorkbookFactory_epv =
&gnumeric_workbook_factory_epv;
gnumeric_workbook_factory_vepv.GNOME_GenericFactory_epv =
&gnumeric_workbook_generic_factory_epv;
gnumeric_workbook_factory_vepv._base_epv =
&gnumeric_workbook_factory_base_epv;
wfs->servant.vepv = &gnumeric_workbook_factory_vepv;
POA_GNOME_Gnumeric_WorkbookFactory__init ((PortableServer_Servant) wfs, ev);
objid = PortableServer_POA_activate_object (poa, wfs, ev);
CORBA_free (objid);
return PortableServer_POA_servant_to_reference (poa, wfs, ev);
}
/*
* CORBA services bootstrap
*/
static gboolean
_WorkbookFactory_init (CORBA_Environment *ev)
{
PortableServer_POAManager poa_manager;
int v;
/*
* Get the POA and create the server
*/
gnumeric_poa = (PortableServer_POA)
CORBA_ORB_resolve_initial_references (
gnome_CORBA_ORB (), "RootPOA", ev);
if (ev->_major != CORBA_NO_EXCEPTION)
return FALSE;
poa_manager = PortableServer_POA__get_the_POAManager (gnumeric_poa, ev);
if (ev->_major != CORBA_NO_EXCEPTION)
return FALSE;
PortableServer_POAManager_activate (poa_manager, ev);
if (ev->_major != CORBA_NO_EXCEPTION)
return FALSE;
/*
* Create our workbook factory
*/
gnumeric_workbook_factory = GNOME_Gnumeric_WorkbookFactory__create (gnumeric_poa, ev);
if (ev->_major != CORBA_NO_EXCEPTION)
return FALSE;
/* Register the server and see if it was already there */
v = goad_server_register (CORBA_OBJECT_NIL, gnumeric_workbook_factory,
"IDL:GNOME:Gnumeric:WorkbookFactory:1.0", "server", ev);
if (v == 0)
return TRUE;
return FALSE;
}
gboolean
WorkbookFactory_init (void)
{
CORBA_Environment ev;
gboolean retval;
CORBA_exception_init (&ev);
retval = _WorkbookFactory_init (&ev);
CORBA_exception_free (&ev);
return retval;
}
/*
* corba-workbook.c: CORBA Workbook exporting.
*
* Author:
* Miguel de Icaza (miguel@gnu.org)
*/
#include <config.h>
#include <libgnorba/gnome-factory.h>
#include <gnome.h>
#include <bonobo/gnome-object.h>
#include "sheet.h"
#include "gnumeric.h"
#include "Gnumeric.h"
#include "xml-io.h"
#include "corba.h"
typedef struct {
POA_GNOME_Gnumeric_Workbook servant;
Workbook *workbook;
} WorkbookServant;
static POA_GNOME_Gnumeric_Workbook__vepv gnome_gnumeric_workbook_vepv;
static POA_GNOME_Gnumeric_Workbook__epv gnome_gnumeric_workbook_epv;
static Workbook *
workbook_from_servant (PortableServer_Servant servant)
{
WorkbookServant *ws = (WorkbookServant *) servant;
return ws->workbook;
}
static inline GNOME_Gnumeric_Sheet
corba_sheet (Sheet *sheet)
{
return sheet->corba_server;
}
static GNOME_Gnumeric_Sheet
Workbook_sheet_new (PortableServer_Servant servant, const CORBA_char * name, CORBA_Environment * ev)
{
GNOME_Gnumeric_Sheet ggs;
Workbook *workbook = workbook_from_servant (servant);
Sheet *sheet;
if (workbook_sheet_lookup (workbook, name)){
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Gnumeric_Workbook_NameExists, NULL);
return CORBA_OBJECT_NIL;
}
sheet = sheet_new (workbook, name);
workbook_attach_sheet (workbook, sheet);
return corba_sheet (sheet);
}
static GNOME_Gnumeric_Sheet
Workbook_sheet_lookup (PortableServer_Servant servant, const CORBA_char * name, CORBA_Environment * ev)
{
Workbook *workbook = workbook_from_servant (servant);
Sheet *sheet;
sheet = workbook_sheet_lookup (workbook, name);
if (sheet == NULL)
return CORBA_OBJECT_NIL;
return corba_sheet (sheet);
}
static void
Workbook_set_filename (PortableServer_Servant servant, const CORBA_char * name, CORBA_Environment * ev)
{
Workbook *workbook = workbook_from_servant (servant);
workbook_set_filename (workbook, name);
}
static void
Workbook_save_to (PortableServer_Servant servant, const CORBA_char * filename, CORBA_Environment * ev)
{
Workbook *workbook = workbook_from_servant (servant);
gnumericWriteXmlWorkbook (workbook, filename);
}
static GNOME_Gnumeric_Sheet
Workbook_sheet_current (PortableServer_Servant servant, CORBA_Environment * ev)
{
Workbook *workbook = workbook_from_servant (servant);
Sheet *sheet = workbook_get_current_sheet (workbook);
return corba_sheet (sheet);
}
static GNOME_Gnumeric_Sheet
Workbook_sheet_nth (PortableServer_Servant servant, const CORBA_long n, CORBA_Environment * ev)
{
g_error ("Same stuff!");
return CORBA_OBJECT_NIL;
}
static CORBA_long