Commit abb2c39a authored by Arturo Espinosa's avatar Arturo Espinosa
Browse files

Flush

parent 3169c74a
......@@ -7,7 +7,9 @@ INCLUDES = \
-I$(top_srcdir) \
$(EXTRA_GNOME_CFLAGS)
bin_PROGRAMS = graph
bin_PROGRAMS = graph
noinst_PROGRAMS = sample
GRAPH_CORBA_GENERATED = \
......@@ -44,6 +46,14 @@ graph_LDADD = \
$(EXTRA_GNOME_LIBS) \
$(INTLLIBS)
sample_SOURCES = \
sample.c
$(GRAPH_CORBA_GENERATED)
sample_LDADD = \
$(EXTRA_GNOME_LIBS) \
$(INTLLIBS)
$(GRAPH_CORBA_GENERATED): Graph.idl $(top_srcdir)/src/Gnumeric-value.idl $(top_srcdir)/src/Gnumeric.idl
orbit-idl -I`$(GNOME_CONFIG) --datadir`/idl -I$(srcdir) -I$(top_srcdir) $(srcdir)/Graph.idl
touch my_graph_idl
......
......@@ -12,7 +12,7 @@
#include "layout-view.h"
#include "graph-view.h"
static GnomeCanvasClass *layout_view_parent_class;
static GnomeViewClass *layout_view_parent_class;
static void
layout_view_destroy (GtkObject *object)
......@@ -20,30 +20,12 @@ layout_view_destroy (GtkObject *object)
GTK_OBJECT_CLASS (layout_view_parent_class)->destroy (object);
}
GtkWidget *
layout_view_new (Layout *layout)
{
LayoutView *layout_view;
layout_view = gtk_type_new (LAYOUT_VIEW_TYPE);
layout_view->graph_view = GRAPH_VIEW (gnome_canvas_item_new (
gnome_canvas_root (GNOME_CANVAS (layout_view)),
graph_view_get_type (),
NULL));
graph_view_set_graph (layout_view->graph_view, layout->graph);
return GTK_WIDGET (layout);
}
/*
* For now we just cover everything
*/
static void
layout_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
layout_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation, LayoutView *layout_view)
{
LayoutView *layout_view = LAYOUT_VIEW (widget);
ArtIRect bbox;
bbox.x0 = allocation->x;
......@@ -54,13 +36,41 @@ layout_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
graph_view_set_bbox (layout_view->graph_view, &bbox);
}
GnomeView *
layout_view_new (Layout *layout)
{
LayoutView *layout_view;
GNOME_View corba_layout_view;
layout_view = gtk_type_new (LAYOUT_VIEW_TYPE);
corba_layout_view = gnome_view_corba_object_create (GNOME_OBJECT (layout_view));
if (corba_layout_view == CORBA_OBJECT_NIL){
gtk_object_destroy (GTK_OBJECT (corba_layout_view));
return NULL;
}
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));
layout_view->graph_view = GRAPH_VIEW (gnome_canvas_item_new (
gnome_canvas_root (layout_view->canvas),
graph_view_get_type (),
NULL));
graph_view_set_graph (layout_view->graph_view, layout->graph);
gtk_signal_connect (GTK_OBJECT (layout_view->canvas), "size_allocate",
GTK_SIGNAL_FUNC (layout_view_size_allocate), layout_view);
return GNOME_VIEW (layout_view);
}
static void
layout_view_class_init (GtkObjectClass *object_class)
{
GtkWidgetClass *widget_class = (GtkWidgetClass *) object_class;
object_class->destroy = layout_view_destroy;
widget_class->size_allocate = layout_view_size_allocate;
}
static void
......@@ -85,7 +95,7 @@ layout_view_get_type (void)
(GtkClassInitFunc) NULL
};
type = gtk_type_unique (gnome_canvas_get_type (), &info);
type = gtk_type_unique (gnome_view_get_type (), &info);
}
return type;
......
......@@ -18,18 +18,19 @@ BEGIN_GNOME_DECLS
typedef struct _LayoutView LayoutView;
struct _LayoutView {
GnomeCanvas canvas;
Layout *layout;
GraphView *graph_view;
GnomeView parent;
GnomeCanvas *canvas;
Layout *layout;
GraphView *graph_view;
};
typedef struct {
GnomeCanvasClass parent_class;
GnomeViewClass parent_class;
} LayoutViewClass;
GtkType layout_view_get_type (void);
GtkWidget *layout_view_new (Layout *layout);
GnomeView *layout_view_new (Layout *layout);
END_GNOME_DECLS
......
......@@ -101,7 +101,7 @@ init_layout_corba_class (void)
static void
layout_class_init (GtkObjectClass *object_class)
{
layout_parent_class = gtk_type_class (gnome_object_get_type ());
layout_parent_class = gtk_type_class (gnome_embeddable_get_type ());
init_layout_corba_class ();
object_class->destroy = layout_destroy;
......
......@@ -3,7 +3,7 @@
#define GRAPH_LAYOUT_H_
#include <libgnome/gnome-defs.h>
#include <bonobo/gnome-object.h>
#include <bonobo/gnome-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 {
GnomeObject base;
GnomeEmbeddable parent;
Graph *graph;
......@@ -30,13 +30,13 @@ struct _Layout {
};
typedef struct {
GnomeObjectClass parent_class;
GnomeEmbeddableClass parent_class;
} LayoutClass;
GtkType layout_get_type (void);
Layout *layout_new (void);
GtkType layout_get_type (void);
Layout *layout_new (void);
void layout_bind_view (Layout *layout, void *layout_view);
void layout_bind_view (Layout *layout, void *layout_view);
void layout_get_n_series (Layout *layout);
GraphVector *layout_get_series (Layout *layout, int n);
......
......@@ -65,7 +65,7 @@ layout_factory_init (void)
{
factory = gnome_embeddable_factory_new (
"embeddable-factory:Graph:Layout", layout_factory, NULL);
"GOADID:embeddable-factory:Graph:Layout", layout_factory, NULL);
if (factory == NULL)
g_error ("It was not possible to register a new layout factory");
......
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