From e446d5f0746b4f3edc1b9742888410af310d815e Mon Sep 17 00:00:00 2001 From: Luca Padovani Date: Tue, 9 Sep 2003 13:42:40 +0000 Subject: [PATCH] * snapshot --- helm/gtkmathview-bonobo/src/control-factory.c | 2 +- helm/gtkmathview-bonobo/src/view.c | 24 ++++++++++++++----- helm/gtkmathview-bonobo/src/view.h | 4 +++- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/helm/gtkmathview-bonobo/src/control-factory.c b/helm/gtkmathview-bonobo/src/control-factory.c index f3ba19fc1..c5fe90150 100644 --- a/helm/gtkmathview-bonobo/src/control-factory.c +++ b/helm/gtkmathview-bonobo/src/control-factory.c @@ -203,7 +203,7 @@ gtk_math_view_control_init(BonoboControl *control, GtkWidget *scrolled_window) gtk_container_add(GTK_CONTAINER (scrolled_window), GTK_WIDGET (control_data->math_view)); - view = view_new(); + view = view_new(control_data); bonobo_object_add_interface(BONOBO_OBJECT(control), BONOBO_OBJECT(view)); persist_file = gtk_math_view_persist_file_new(GTK_MATH_VIEW(math_view)); diff --git a/helm/gtkmathview-bonobo/src/view.c b/helm/gtkmathview-bonobo/src/view.c index dc8226e39..95848730f 100644 --- a/helm/gtkmathview-bonobo/src/view.c +++ b/helm/gtkmathview-bonobo/src/view.c @@ -14,19 +14,28 @@ view_object_finalize(GObject* object) } static void -impl_view_freeze(PortableServer_Servant servant, +impl_view_freeze(PortableServer_Servant servant, CORBA_Environment *ev) { View* view = VIEW (bonobo_object (servant)); - printf("called freeze\n"); + gtk_math_view_freeze(view->control_data->math_view); } static void -impl_view_thaw(PortableServer_Servant servant, +impl_view_thaw(PortableServer_Servant servant, CORBA_Environment *ev) { View* view = VIEW (bonobo_object (servant)); - printf("called thaw\n"); + gtk_math_view_thaw(view->control_data->math_view); +} + +static void +impl_view_load(PortableServer_Servant servant, + const CORBA_char *uri, + CORBA_Environment *ev) +{ + View* view = VIEW (bonobo_object (servant)); + gtk_math_view_load_uri(view->control_data->math_view, uri); } static void @@ -51,8 +60,11 @@ view_init(View* view) BONOBO_TYPE_FUNC_FULL (View, GNOME_GtkMathView_View, BONOBO_TYPE_OBJECT, view) View* -view_new() +view_new(GtkMathViewControlData* control_data) { - View* view = g_object_new(VIEW_TYPE, NULL); + View* view; + g_return_val_if_fail(control_data != NULL, NULL); + view = g_object_new(VIEW_TYPE, NULL); + view->control_data = control_data; return view; } diff --git a/helm/gtkmathview-bonobo/src/view.h b/helm/gtkmathview-bonobo/src/view.h index 1d88c0cfc..9116a3c98 100644 --- a/helm/gtkmathview-bonobo/src/view.h +++ b/helm/gtkmathview-bonobo/src/view.h @@ -5,6 +5,7 @@ #include #include "GNOME_GtkMathView_View.h" +#include "control-data.h" #define VIEW_TYPE (view_get_type()) #define VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), VIEW_TYPE, View)) @@ -15,6 +16,7 @@ typedef struct { BonoboObject parent; + GtkMathViewControlData* control_data; } View; typedef struct { @@ -23,7 +25,7 @@ typedef struct { } ViewClass; GType view_get_type(void); -View* view_new(void); +View* view_new(GtkMathViewControlData*); #endif /* __view_h__ */ -- 2.39.2