Commit 9124d3af authored by Arturo Espinosa's avatar Arturo Espinosa

Upgraded to new Bonobo names; Work, do not crash



Upgraded to new Bonobo names;  Work, do not crash

Miguel.
parent 6b1a937a
2000-01-30 Miguel de Icaza <miguel@gnu.org>
* graph-view-scatter.c (graph_view_scatter_plot): Pass the proper
GC to the init routine.
* graph-view-util.c (setup_view_ctx): New function, replaces the
old SETUP_VIEW_CTX macro.
2000-01-06 Miguel de Icaza <miguel@gnu.org>
* vector.c (init_vector_corba_class): Use new convention for EPV
......
......@@ -7,7 +7,7 @@
* (C) 1999 International GNOME Support (http://www.gnome-support.com)
*/
#include <bonobo.idl>
#include <Bonobo.idl>
#include "src/Gnumeric.idl"
module GNOME {
......@@ -176,7 +176,7 @@ module GNOME {
SURFACE_COLORED
};
interface Chart : GNOME::Unknown {
interface Chart : Bonobo::Unknown {
attribute ChartType chart_type;
attribute PlotMode plot_mode;
attribute ColBarMode col_bar_mode;
......@@ -205,7 +205,7 @@ module GNOME {
// * The axis
// * The chart background
//
interface Layout : GNOME::Embeddable {
interface Layout : Bonobo::Embeddable {
Chart get_chart ();
Axis get_axis (in AxisType axis);
......
......@@ -229,7 +229,7 @@ graph_view_colbar_draw (GraphView *graph_view, GdkDrawable *drawable, int x, int
if (graph_view->graph->divisions == 0)
return;
SETUP_VIEW_CTX (ctx, graph_view, drawable, x, y, width, height);
setup_view_ctx (&ctx, graph_view, drawable, NULL, x, y, width, height);
is_bar = ctx.graph->direction == GNOME_Graph_DIR_BAR;
......
......@@ -49,7 +49,7 @@ graph_view_line_plot (GraphView *graph_view, GdkDrawable *drawable,
int vector;
ViewDrawCtx ctx;
SETUP_VIEW_CTX (ctx, graph_view, drawable, x, y, width, height);
setup_view_ctx (&ctx, graph_view, drawable, graph_view->fill_gc, x, y, width, height);
for (vector = 1; vector < vector_count; vector ++){
double last_x, last_y;
......@@ -84,7 +84,7 @@ graph_view_scatter_plot (GraphView *graph_view, GdkDrawable *drawable,
int xi;
ViewDrawCtx ctx;
SETUP_VIEW_CTX (ctx, graph_view, drawable, x, y, width, height);
setup_view_ctx (&ctx, graph_view, drawable, graph_view->fill_gc, x, y, width, height);
ctx.dim = MIN (ctx.xl, ctx.yl) / 40;
......
......@@ -108,3 +108,20 @@ symbol_draw (ViewDrawCtx *ctx, Symbol sym, int px, int py)
}
}
void
setup_view_ctx (ViewDrawCtx *ctx, GraphView *gv, GdkDrawable *d, GdkGC *gc,
int x, int y, int width, int height)
{
ctx->x = x;
ctx->y = y;
ctx->width = width;
ctx->height = height;
ctx->drawable = d;
ctx->gc = gc;
ctx->graph_view = gv;
ctx->graph = gv->graph;
ctx->yl = gv->bbox.y1 - gv->bbox.y0;
ctx->xl = gv->bbox.x1 - gv->bbox.x0;
}
......@@ -39,16 +39,7 @@ typedef struct {
Symbol symbol_setup (ViewDrawCtx *ctx, int series);
void symbol_draw (ViewDrawCtx *ctx, Symbol sym, int px, int py);
#define SETUP_VIEW_CTX(ctx,gv,d,vx,vy,w,h) \
ctx.x = vx;\
ctx.y = vy;\
ctx.width = w;\
ctx.height = h;\
ctx.drawable = d;\
ctx.graph_view = gv;\
ctx.graph = gv->graph;\
ctx.yl = gv->bbox.y1 - gv->bbox.y0;\
ctx.xl = gv->bbox.x1 - gv->bbox.x0;
void setup_view_ctx (ViewDrawCtx *ctx, GraphView *gv, GdkDrawable *d, GdkGC *gc, int x, int y, int w, int h);
/*
* Macros used by various plotting modes.
......
......@@ -12,13 +12,13 @@
#include "graph-vector.h"
#include "graph-view.h"
static GnomeObjectClass *graph_parent_class;
static BonoboObjectClass *graph_parent_class;
/* The entry point vectors for the server we provide */
POA_GNOME_Graph_Chart__epv graph_epv;
POA_GNOME_Graph_Chart__vepv graph_vepv;
#define graph_from_servant(x) GRAPH (gnome_object_from_servant (x))
#define graph_from_servant(x) GRAPH (bonobo_object_from_servant (x))
static void
graph_destroy (GtkObject *object)
......@@ -447,14 +447,14 @@ init_graph_corba_class (void)
/*
* The Vepv
*/
graph_vepv.GNOME_Unknown_epv = gnome_object_get_epv ();
graph_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
graph_vepv.GNOME_Graph_Chart_epv = &graph_epv;
}
static void
graph_class_init (GtkObjectClass *object_class)
{
graph_parent_class = gtk_type_class (gnome_object_get_type ());
graph_parent_class = gtk_type_class (bonobo_object_get_type ());
object_class->destroy = graph_destroy;
......@@ -486,7 +486,7 @@ graph_get_type (void)
(GtkClassInitFunc) NULL
};
type = gtk_type_unique (gnome_object_get_type (), &info);
type = gtk_type_unique (bonobo_object_get_type (), &info);
}
return type;
......@@ -514,12 +514,12 @@ graph_bind_view (Graph *graph, GraphView *graph_view)
}
GNOME_Graph_Chart
graph_corba_object_create (GnomeObject *object)
graph_corba_object_create (BonoboObject *object)
{
POA_GNOME_Graph_Chart *servant;
CORBA_Environment ev;
servant = (POA_GNOME_Graph_Chart *) g_new0 (GnomeObjectServant, 1);
servant = (POA_GNOME_Graph_Chart *) g_new0 (BonoboObjectServant, 1);
servant->vepv = &graph_vepv;
CORBA_exception_init (&ev);
......@@ -531,7 +531,7 @@ graph_corba_object_create (GnomeObject *object)
}
CORBA_exception_free (&ev);
return (GNOME_View) gnome_object_activate_servant (object, servant);
return (Bonobo_View) bonobo_object_activate_servant (object, servant);
}
Graph *
......@@ -542,12 +542,12 @@ graph_new (Layout *layout)
graph = gtk_type_new (graph_get_type ());
graph_corba = graph_corba_object_create (GNOME_OBJECT (graph));
graph_corba = graph_corba_object_create (BONOBO_OBJECT (graph));
if (graph_corba == CORBA_OBJECT_NIL){
gtk_object_destroy (GTK_OBJECT (graph));
return NULL;
}
gnome_object_construct (GNOME_OBJECT (graph), graph_corba);
bonobo_object_construct (BONOBO_OBJECT (graph), graph_corba);
graph->layout = layout;
......
......@@ -3,7 +3,7 @@
#define GRAPH_GRAPH_H_
#include <libgnome/gnome-defs.h>
#include <bonobo/gnome-object.h>
#include <bonobo/bonobo-object.h>
#include "Graph.h"
BEGIN_GNOME_DECLS
......@@ -21,7 +21,7 @@ typedef struct _GraphView GraphView;
struct _Graph {
GnomeObject base;
BonoboObject base;
Layout *layout;
......@@ -60,7 +60,7 @@ struct _Graph {
};
typedef struct {
GnomeObjectClass parent_class;
BonoboObjectClass parent_class;
} GraphClass;
#define DIRTY_BBOX 1
......
......@@ -12,7 +12,7 @@
#include "layout-view.h"
#include "graph-view.h"
static GnomeViewClass *layout_view_parent_class;
static BonoboViewClass *layout_view_parent_class;
static void
layout_view_destroy (GtkObject *object)
......@@ -40,15 +40,15 @@ layout_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation, LayoutV
0, 0, allocation->width, allocation->height);
}
GnomeView *
BonoboView *
layout_view_new (Layout *layout)
{
LayoutView *layout_view;
GNOME_View corba_layout_view;
Bonobo_View corba_layout_view;
layout_view = gtk_type_new (LAYOUT_VIEW_TYPE);
corba_layout_view = gnome_view_corba_object_create (GNOME_OBJECT (layout_view));
corba_layout_view = bonobo_view_corba_object_create (BONOBO_OBJECT (layout_view));
if (corba_layout_view == CORBA_OBJECT_NIL){
gtk_object_destroy (GTK_OBJECT (corba_layout_view));
return NULL;
......@@ -57,7 +57,7 @@ layout_view_new (Layout *layout)
layout_view->canvas = GNOME_CANVAS (gnome_canvas_new ());
gtk_widget_show (GTK_WIDGET (layout_view->canvas));
gnome_view_construct (GNOME_VIEW (layout_view), corba_layout_view, GTK_WIDGET (layout_view->canvas));
bonobo_view_construct (BONOBO_VIEW (layout_view), corba_layout_view, GTK_WIDGET (layout_view->canvas));
layout_view->graph_view = GRAPH_VIEW (gnome_canvas_item_new (
gnome_canvas_root (layout_view->canvas),
graph_view_get_type (),
......@@ -68,7 +68,7 @@ layout_view_new (Layout *layout)
gtk_signal_connect (GTK_OBJECT (layout_view->canvas), "size_allocate",
GTK_SIGNAL_FUNC (layout_view_size_allocate), layout_view);
return GNOME_VIEW (layout_view);
return BONOBO_VIEW (layout_view);
}
static void
......@@ -76,7 +76,7 @@ layout_view_class_init (GtkObjectClass *object_class)
{
object_class->destroy = layout_view_destroy;
layout_view_parent_class = gtk_type_class (gnome_view_get_type ());
layout_view_parent_class = gtk_type_class (bonobo_view_get_type ());
}
static void
......@@ -101,7 +101,7 @@ layout_view_get_type (void)
(GtkClassInitFunc) NULL
};
type = gtk_type_unique (gnome_view_get_type (), &info);
type = gtk_type_unique (bonobo_view_get_type (), &info);
}
return type;
......
......@@ -18,7 +18,7 @@ BEGIN_GNOME_DECLS
typedef struct _LayoutView LayoutView;
struct _LayoutView {
GnomeView parent;
BonoboView parent;
GnomeCanvas *canvas;
Layout *layout;
......@@ -26,11 +26,11 @@ struct _LayoutView {
};
typedef struct {
GnomeViewClass parent_class;
BonoboViewClass parent_class;
} LayoutViewClass;
GtkType layout_view_get_type (void);
GnomeView *layout_view_new (Layout *layout);
BonoboView *layout_view_new (Layout *layout);
END_GNOME_DECLS
......
......@@ -8,18 +8,18 @@
* (C) 1999 International GNOME Support
*/
#include <config.h>
#include <bonobo/gnome-bonobo.h>
#include <bonobo.h>
#include "Graph.h"
#include "layout.h"
#include "layout-view.h"
static GnomeEmbeddableClass *layout_parent_class;
static BonoboEmbeddableClass *layout_parent_class;
/* The entry point vectors for the server we provide */
POA_GNOME_Graph_Layout__epv layout_epv;
POA_GNOME_Graph_Layout__vepv layout_vepv;
#define layout_from_servant(x) LAYOUT (gnome_object_from_servant (x))
#define layout_from_servant(x) LAYOUT (bonobo_object_from_servant (x))
static void
layout_destroy (GtkObject *object)
......@@ -27,7 +27,7 @@ layout_destroy (GtkObject *object)
Layout *layout = LAYOUT (object);
if (layout->graph)
gnome_object_unref (GNOME_OBJECT (layout->graph));
bonobo_object_unref (BONOBO_OBJECT (layout->graph));
GTK_OBJECT_CLASS (layout_parent_class)->destroy (object);
}
......@@ -36,11 +36,11 @@ static GNOME_Graph_Chart
impl_get_chart (PortableServer_Servant servant, CORBA_Environment *ev)
{
Layout *layout = layout_from_servant (servant);
GnomeObject *graph = GNOME_OBJECT (layout->graph);
BonoboObject *graph = BONOBO_OBJECT (layout->graph);
GNOME_Graph_Chart graph_corba;
gnome_object_ref (graph);
graph_corba = gnome_object_corba_objref (graph);
bonobo_object_ref (graph);
graph_corba = bonobo_object_corba_objref (graph);
return CORBA_Object_duplicate (graph_corba, ev);
}
......@@ -95,15 +95,15 @@ init_layout_corba_class (void)
layout_epv.reset_series = &impl_reset_series;
layout_epv.add_series = &impl_add_series;
layout_vepv.GNOME_Unknown_epv = gnome_object_get_epv ();
layout_vepv.GNOME_Embeddable_epv = gnome_embeddable_get_epv ();
layout_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
layout_vepv.Bonobo_Embeddable_epv = bonobo_embeddable_get_epv ();
layout_vepv.GNOME_Graph_Layout_epv = &layout_epv;
}
static void
layout_class_init (GtkObjectClass *object_class)
{
layout_parent_class = gtk_type_class (gnome_embeddable_get_type ());
layout_parent_class = gtk_type_class (bonobo_embeddable_get_type ());
init_layout_corba_class ();
object_class->destroy = layout_destroy;
......@@ -114,19 +114,19 @@ layout_init (GtkObject *object)
{
}
static GnomeView *
layout_view_factory (GnomeEmbeddable *embeddable, const GNOME_ViewFrame view_frame, void *data)
static BonoboView *
layout_view_factory (BonoboEmbeddable *embeddable, const Bonobo_ViewFrame view_frame, void *data)
{
return GNOME_VIEW (layout_view_new (LAYOUT (embeddable)));
return BONOBO_VIEW (layout_view_new (LAYOUT (embeddable)));
}
static GNOME_Graph_Layout
layout_corba_object_create (GnomeObject *layout)
layout_corba_object_create (BonoboObject *layout)
{
POA_GNOME_Graph_Layout *servant;
CORBA_Environment ev;
servant = (POA_GNOME_Graph_Layout *) g_new0 (GnomeObjectServant, 1);
servant = (POA_GNOME_Graph_Layout *) g_new0 (BonoboObjectServant, 1);
servant->vepv = &layout_vepv;
CORBA_exception_init (&ev);
......@@ -139,7 +139,7 @@ layout_corba_object_create (GnomeObject *layout)
}
CORBA_exception_free (&ev);
return gnome_object_activate_servant (layout, servant);
return bonobo_object_activate_servant (layout, servant);
}
Layout *
......@@ -150,13 +150,13 @@ layout_new (void)
layout = gtk_type_new (LAYOUT_TYPE);
corba_layout = layout_corba_object_create (GNOME_OBJECT (layout));
corba_layout = layout_corba_object_create (BONOBO_OBJECT (layout));
if (corba_layout == CORBA_OBJECT_NIL){
gtk_object_destroy (GTK_OBJECT (layout));
return NULL;
}
gnome_embeddable_construct (GNOME_EMBEDDABLE (layout),
(GNOME_Embeddable) corba_layout,
bonobo_embeddable_construct (BONOBO_EMBEDDABLE (layout),
(Bonobo_Embeddable) corba_layout,
layout_view_factory, NULL);
layout->graph = graph_new (layout);
......@@ -180,7 +180,7 @@ layout_get_type (void)
(GtkClassInitFunc) NULL
};
type = gtk_type_unique (gnome_embeddable_get_type (), &info);
type = gtk_type_unique (bonobo_embeddable_get_type (), &info);
}
return type;
......
......@@ -3,7 +3,7 @@
#define GRAPH_LAYOUT_H_
#include <libgnome/gnome-defs.h>
#include <bonobo/gnome-embeddable.h>
#include <bonobo/bonobo-embeddable.h>
#include "graph-vector.h"
BEGIN_GNOME_DECLS
......@@ -18,7 +18,7 @@ typedef struct _Layout Layout;
#define IS_LAYOUT_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), LAYOUT_TYPE))
struct _Layout {
GnomeEmbeddable parent;
BonoboEmbeddable parent;
Graph *graph;
......@@ -30,7 +30,7 @@ struct _Layout {
};
typedef struct {
GnomeEmbeddableClass parent_class;
BonoboEmbeddableClass parent_class;
} LayoutClass;
GtkType layout_get_type (void);
......
......@@ -7,14 +7,14 @@
* (C) 1999 International GNOME Support (http://www.gnome-support.com)
*/
#include <config.h>
#include <bonobo/gnome-bonobo.h>
#include <bonobo.h>
#include "Graph.h"
#include "layout.h"
CORBA_Environment ev;
CORBA_ORB orb;
static GnomeEmbeddableFactory *factory;
static BonoboEmbeddableFactory *factory;
static int active_layouts;
......@@ -39,12 +39,12 @@ layout_destroyed (GtkObject *layout_object)
if (active_layouts != 0)
return;
gnome_object_unref (GNOME_OBJECT (factory));
bonobo_object_unref (BONOBO_OBJECT (factory));
gtk_main_quit ();
}
static GnomeObject *
layout_factory (GnomeEmbeddableFactory *this, void *data)
static BonoboObject *
layout_factory (BonoboEmbeddableFactory *this, void *data)
{
Layout *layout;
......@@ -57,14 +57,14 @@ layout_factory (GnomeEmbeddableFactory *this, void *data)
GTK_OBJECT (layout), "destroy",
layout_destroyed, NULL);
return GNOME_OBJECT (layout);
return BONOBO_OBJECT (layout);
}
static void
layout_factory_init (void)
{
factory = gnome_embeddable_factory_new (
factory = bonobo_embeddable_factory_new (
"GOADID:embeddable-factory:Graph:Layout", layout_factory, NULL);
if (factory == NULL)
......
......@@ -5,14 +5,14 @@
*/
#include <gnome.h>
#include <libgnorba/gnorba.h>
#include <bonobo/gnome-bonobo.h>
#include <bonobo.h>
#include "Graph.h"
#include "vector.h"
/*
* This is the handle to the graphics object server
*/
GnomeObjectClient *object;
BonoboObjectClient *object;
/*
* Interface pointer for the Layout interface
......@@ -100,9 +100,9 @@ quit_cmd ()
/*
* Unref the layout interface
*/
GNOME_Unknown_unref ((GNOME_Unknown) layout, &ev);
Bonobo_Unknown_unref ((Bonobo_Unknown) layout, &ev);
GNOME_Unknown_unref ((GNOME_Unknown) chart, &ev);
Bonobo_Unknown_unref ((Bonobo_Unknown) chart, &ev);
/*
* Destroy our initial handle
......@@ -216,8 +216,8 @@ static GnomeUIInfo sample_menu [] = {
static void
create_gui (GtkWidget *content)
{
GnomeUIHandlerMenuItem *list;
GnomeUIHandler *uih;
BonoboUIHandlerMenuItem *list;
BonoboUIHandler *uih;
GtkWidget *toplevel;
toplevel = gnome_app_new ("Sample", "Sample");
......@@ -229,33 +229,33 @@ create_gui (GtkWidget *content)
/*
* Menus
*/
uih = gnome_ui_handler_new ();
gnome_ui_handler_set_app (uih, GNOME_APP (toplevel));
gnome_ui_handler_create_menubar (uih);
list = gnome_ui_handler_menu_parse_uiinfo_list_with_data (sample_menu, NULL);
gnome_ui_handler_menu_add_list (uih, "/", list);
gnome_ui_handler_menu_free_list (list);
uih = bonobo_ui_handler_new ();
bonobo_ui_handler_set_app (uih, GNOME_APP (toplevel));
bonobo_ui_handler_create_menubar (uih);
list = bonobo_ui_handler_menu_parse_uiinfo_list_with_data (sample_menu, NULL);
bonobo_ui_handler_menu_add_list (uih, "/", list);
bonobo_ui_handler_menu_free_list (list);
}
static GtkWidget *
create_test ()
{
GtkWidget *view_widget;
GnomeClientSite *client_site;
GnomeViewFrame *view_frame;
GnomeContainer *container;
BonoboClientSite *client_site;
BonoboViewFrame *view_frame;
BonoboContainer *container;
int i;
container = gnome_container_new ();
client_site = gnome_client_site_new (container);
container = bonobo_container_new ();
client_site = bonobo_client_site_new (container);
object = gnome_object_activate ("GOADID:embeddable:Graph:Layout", 0);
object = bonobo_object_activate ("GOADID:embeddable:Graph:Layout", 0);
if (!object){
printf ("Can not activate object\n");
exit (1);
}
layout = gnome_object_query_interface (GNOME_OBJECT (object), "IDL:GNOME/Graph/Layout:1.0");
layout = bonobo_object_query_interface (BONOBO_OBJECT (object), "IDL:GNOME/Graph/Layout:1.0");
if (layout == CORBA_OBJECT_NIL)
g_error ("interface Layout not supported");
......@@ -266,7 +266,7 @@ create_test ()
for (i = 0; i < VECS; i++){
GNOME_Graph_Layout_add_series (
layout,
gnome_object_corba_objref (GNOME_OBJECT (vecs [i].vector)),
bonobo_object_corba_objref (BONOBO_OBJECT (vecs [i].vector)),
&ev);
if (ev._major != CORBA_NO_EXCEPTION){
g_error ("Error while setting the vectors");
......@@ -276,10 +276,10 @@ create_test ()
/*
* User interface
*/
gnome_client_site_bind_embeddable (client_site, object);
bonobo_client_site_bind_embeddable (client_site, object);
view_frame = gnome_client_site_new_view (client_site);
view_widget = gnome_view_frame_get_wrapper (view_frame);
view_frame = bonobo_client_site_new_view (client_site);
view_widget = bonobo_view_frame_get_wrapper (view_frame);
return view_widget;
}
......
......@@ -8,16 +8,16 @@
*/
#include <config.h>
#include "Graph.h"
#include <bonobo/gnome-object.h>
#include <bonobo/bonobo-object.h>
#include "vector.h"
static GnomeObjectClass *vector_parent_class;
static BonoboObjectClass *vector_parent_class;
/* The entry point vectors for the server we provide */
POA_GNOME_Gnumeric_Vector__epv vector_epv;
POA_GNOME_Gnumeric_Vector__vepv vector_vepv;
#define vector_from_servant(x) VECTOR (gnome_object_from_servant (x))
#define vector_from_servant(x) VECTOR (bonobo_object_from_servant (x))
static void
vector_destroy (GtkObject *object)
......@@ -93,14 +93,14 @@ init_vector_corba_class (void)
vector_epv.count = impl_vector_count;
vector_epv.set_notify = impl_vector_set_notify;
vector_vepv.GNOME_Unknown_epv = gnome_object_get_epv ();
vector_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
vector_vepv.GNOME_Gnumeric_Vector_epv = &vector_epv;
}
static void
vector_class_init (GtkObjectClass *object_class)
{
vector_parent_class = gtk_type_class (gnome_object_get_type ());