Commit 06eb9b72 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa

Use properly the command_context_corba, passing a workbook argument in all

1999-12-31  Miguel de Icaza  <miguel@gnu.org>

	* src/corba-sheet.c: Use properly the command_context_corba,
	passing a workbook argument in all functions.

	* src/command-context-corba.c, src/command-context-corba.h:
	Implement CORBA versions of the CommandContext.
parent 9df2b28f
1999-12-31 Miguel de Icaza <miguel@gnu.org>
* src/corba-sheet.c: Use properly the command_context_corba,
passing a workbook argument in all functions.
* src/command-context-corba.c, src/command-context-corba.h:
Implement CORBA versions of the CommandContext.
1999-12-30 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_command_context_gui) : minor warning
......
1999-12-31 Miguel de Icaza <miguel@gnu.org>
* src/corba-sheet.c: Use properly the command_context_corba,
passing a workbook argument in all functions.
* src/command-context-corba.c, src/command-context-corba.h:
Implement CORBA versions of the CommandContext.
1999-12-30 Jody Goldberg <jgoldberg@home.com>
* src/workbook.c (workbook_command_context_gui) : minor warning
......
......@@ -66,8 +66,10 @@ GNUMERIC_BASE_SOURCES = \
color.h \
command-context.h \
command-context.c \
command-context-gui.h \
command-context-corba.c \
command-context-corba.h \
command-context-gui.c \
command-context-gui.h \
complex.h \
complex.c \
corba.h \
......
/*
* command-context-corba.c: A Command Context for the CORBA interface
*
* Authors:
* Jody Goldberg
* Miguel de Icaza (miguel@gnu.org)
*
*/
#include <config.h>
#include "gnumeric-type-util.h"
#include "command-context-corba.h"
#include "gnumeric-util.h"
#define PARENT_TYPE command_context_get_type ()
#define CCG_CLASS(o) CMD_CONTEXT_CORBA_CLASS (GTK_OBJECT (o)->klass)
static void
ccc_error_plugin_problem (CommandContext *context, char const * const app_ver)
{
/* FIXME set exception */
}
static void
ccc_error_splits_array (CommandContext *context)
{
CommandContextCorba *ccc = COMMAND_CONTEXT_CORBA (context);
/* FIXME set exception */
}
static void
ccc_init_class (GtkObjectClass *object_class)
{
CommandContextClass *cc_class = (CommandContextClass *) object_class;
cc_class->error_plugin_problem = ccc_error_plugin_problem;
cc_class->error_splits_array = ccc_error_splits_array;
}
GNUMERIC_MAKE_TYPE(command_context_corba, "CommandContextCorba", CommandContextCorba, ccc_init_class, NULL, PARENT_TYPE)
CommandContext *
command_context_corba_new (Workbook *wb)
{
CommandContextCorba *ccg;
ccg = gtk_type_new (command_context_corba_get_type ());
ccg->wb = wb;
return COMMAND_CONTEXT (ccg);
}
#ifndef GNUMERIC_COMMAND_CONTEXT_CORBA_H
#define GNUMERIC_COMMAND_CONTEXT_CORBA_H
#include "gnumeric.h"
#include "command-context.h"
#define COMMAND_CONTEXT_CORBA_TYPE (command_context_corba_get_type ())
#define COMMAND_CONTEXT_CORBA(o) (GTK_CHECK_CAST ((o), COMMAND_CONTEXT_CORBA_TYPE, CommandContextCorba))
#define COMMAND_CONTEXT_CORBA_CLASS(k) (GTK_CHECK_CLASS_CAST((k), COMMAND_CONTEXT_CORBA_TYPE, CommandContextCorbaClass))
#define IS_COMMAND_CONTEXT_CORBA(o) (GTK_CHECK_TYPE ((o), COMMAND_CONTEXT_CORBA_TYPE))
#define IS_COMMAND_CONTEXT_CORBA_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), COMMAND_CONTEXT_CORBA_TYPE))
typedef struct {
CommandContext parent;
Workbook *wb;
} CommandContextCorba;
typedef struct {
CommandContextClass parent_class;
} CommandContextCorbaClass;
GtkType command_context_corba_get_type (void);
CommandContext *command_context_corba_new (Workbook *wb);
#endif /* GNUMERIC_COMMAND_CONTEXT_CORBA_H */
......@@ -16,6 +16,7 @@
#include "utils.h"
#include "ranges.h"
#include "selection.h"
#include "command-context-corba.h"
#define verify(cond) if (!(cond)){ out_of_range (ev); return; }
#define verify_val(cond,val) if (!(cond)){ out_of_range (ev); return (val); }
......@@ -48,13 +49,6 @@ out_of_range (CORBA_Environment *ev)
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Gnumeric_Sheet_OutOfRange, NULL);
}
CommandContext *
command_context_corba (void)
{
/* FIXME FIXME FIXME : corba context */
return NULL;
}
/*
* Parses a list of ranges, returns a GList containing pointers to
* Value structures. Sets the return_list pointer to point to a
......@@ -184,7 +178,7 @@ Sheet_selection_copy (PortableServer_Servant servant, CORBA_Environment *ev)
{
Sheet *sheet = sheet_from_servant (servant);
sheet_selection_copy (command_context_corba (), sheet);
sheet_selection_copy (command_context_corba (sheet->workbook), sheet);
}
static void
......@@ -192,7 +186,7 @@ Sheet_selection_cut (PortableServer_Servant servant, CORBA_Environment *ev)
{
Sheet *sheet = sheet_from_servant (servant);
sheet_selection_cut (command_context_corba (), sheet);
sheet_selection_cut (command_context_corba (sheet->workbook), sheet);
}
static void
......@@ -205,8 +199,9 @@ Sheet_selection_paste (PortableServer_Servant servant,
verify_col (dest_col);
verify_row (dest_row);
sheet_selection_paste (command_context_corba (), sheet,
dest_col, dest_row, paste_flags, 0);
sheet_selection_paste (
command_context_corba (sheet->workbook), sheet,
dest_col, dest_row, paste_flags, 0);
}
static void
......@@ -219,8 +214,10 @@ Sheet_clear_region (PortableServer_Servant servant,
verify_region (start_col, start_row, end_col, end_row);
sheet_clear_region (command_context_corba (), sheet, start_col, start_row,
end_col, end_row, TRUE);
sheet_clear_region (
command_context_corba (sheet->workbook),
sheet, start_col, start_row,
end_col, end_row, TRUE);
}
static void
......@@ -232,8 +229,9 @@ Sheet_clear_region_content (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_region (start_col, start_row, end_col, end_row);
sheet_clear_region_content (command_context_corba (), sheet,
start_col, start_row, end_col, end_row);
sheet_clear_region_content (
command_context_corba (sheet->workbook), sheet,
start_col, start_row, end_col, end_row);
}
static void
......@@ -805,8 +803,9 @@ Sheet_insert_col (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_col (col);
sheet_insert_cols (command_context_corba (), sheet,
col, count);
sheet_insert_cols (
command_context_corba (sheet->workbook), sheet,
col, count);
}
static void
......@@ -817,8 +816,9 @@ Sheet_delete_col (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_col (col);
sheet_delete_cols (command_context_corba (), sheet,
col, count);
sheet_delete_cols (
command_context_corba (sheet->workbook), sheet,
col, count);
}
static void
......@@ -829,8 +829,9 @@ Sheet_insert_row (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_row (row);
sheet_insert_rows (command_context_corba (), sheet,
row, count);
sheet_insert_rows (
command_context_corba (sheet->workbook), sheet,
row, count);
}
static void
......@@ -841,8 +842,9 @@ Sheet_delete_row (PortableServer_Servant servant,
Sheet *sheet = sheet_from_servant (servant);
verify_row (row);
sheet_delete_rows (command_context_corba (), sheet,
row, count);
sheet_delete_rows (
command_context_corba (sheet->workbook), sheet,
row, count);
}
static void
......@@ -857,8 +859,9 @@ Sheet_shift_rows (PortableServer_Servant servant,
verify_row (end_row);
verify_col (col);
sheet_shift_rows (command_context_corba (), sheet,
col, start_row, end_row, count);
sheet_shift_rows (
command_context_corba (sheet->workbook), sheet,
col, start_row, end_row, count);
}
static void
......@@ -873,8 +876,9 @@ Sheet_shift_cols (PortableServer_Servant servant,
verify_row (start_row);
verify_row (end_row);
sheet_shift_cols (command_context_corba (), sheet,
col, start_row, end_row, count);
sheet_shift_cols (
command_context_corba (sheet->workbook), sheet,
col, start_row, end_row, count);
}
static GNOME_Gnumeric_Sheet_ValueVector *
......
......@@ -4,6 +4,4 @@
extern PortableServer_POA gnumeric_poa;
gboolean WorkbookFactory_init (void);
CommandContext *command_context_corba (void);
#endif
/*
* command-context-corba.c: A Command Context for the CORBA interface
*
* Authors:
* Jody Goldberg
* Miguel de Icaza (miguel@gnu.org)
*
*/
#include <config.h>
#include "gnumeric-type-util.h"
#include "command-context-corba.h"
#include "gnumeric-util.h"
#define PARENT_TYPE command_context_get_type ()
#define CCG_CLASS(o) CMD_CONTEXT_CORBA_CLASS (GTK_OBJECT (o)->klass)
static void
ccc_error_plugin_problem (CommandContext *context, char const * const app_ver)
{
/* FIXME set exception */
}
static void
ccc_error_splits_array (CommandContext *context)
{
CommandContextCorba *ccc = COMMAND_CONTEXT_CORBA (context);
/* FIXME set exception */
}
static void
ccc_init_class (GtkObjectClass *object_class)
{
CommandContextClass *cc_class = (CommandContextClass *) object_class;
cc_class->error_plugin_problem = ccc_error_plugin_problem;
cc_class->error_splits_array = ccc_error_splits_array;
}
GNUMERIC_MAKE_TYPE(command_context_corba, "CommandContextCorba", CommandContextCorba, ccc_init_class, NULL, PARENT_TYPE)
CommandContext *
command_context_corba_new (Workbook *wb)
{
CommandContextCorba *ccg;
ccg = gtk_type_new (command_context_corba_get_type ());
ccg->wb = wb;
return COMMAND_CONTEXT (ccg);
}
#ifndef GNUMERIC_COMMAND_CONTEXT_CORBA_H
#define GNUMERIC_COMMAND_CONTEXT_CORBA_H
#include "gnumeric.h"
#include "command-context.h"
#define COMMAND_CONTEXT_CORBA_TYPE (command_context_corba_get_type ())
#define COMMAND_CONTEXT_CORBA(o) (GTK_CHECK_CAST ((o), COMMAND_CONTEXT_CORBA_TYPE, CommandContextCorba))
#define COMMAND_CONTEXT_CORBA_CLASS(k) (GTK_CHECK_CLASS_CAST((k), COMMAND_CONTEXT_CORBA_TYPE, CommandContextCorbaClass))
#define IS_COMMAND_CONTEXT_CORBA(o) (GTK_CHECK_TYPE ((o), COMMAND_CONTEXT_CORBA_TYPE))
#define IS_COMMAND_CONTEXT_CORBA_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), COMMAND_CONTEXT_CORBA_TYPE))
typedef struct {
CommandContext parent;
Workbook *wb;
} CommandContextCorba;
typedef struct {
CommandContextClass parent_class;
} CommandContextCorbaClass;
GtkType command_context_corba_get_type (void);
CommandContext *command_context_corba_new (Workbook *wb);
#endif /* GNUMERIC_COMMAND_CONTEXT_CORBA_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment