]> matita.cs.unibo.it Git - helm.git/commitdiff
* snapshot
authorLuca Padovani <luca.padovani@unito.it>
Tue, 9 Sep 2003 13:42:40 +0000 (13:42 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Tue, 9 Sep 2003 13:42:40 +0000 (13:42 +0000)
helm/gtkmathview-bonobo/src/control-factory.c
helm/gtkmathview-bonobo/src/view.c
helm/gtkmathview-bonobo/src/view.h

index f3ba19fc1c5a5e3cdea757f368b65d2323ad30d9..c5fe901501cea4b6250a43ad55c98dabbfdc2a76 100644 (file)
@@ -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));
index dc8226e39c97c22970a51af2a3db22b86c4dc815..95848730fba12caa963e93ff728e63175042e31c 100644 (file)
@@ -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;
 }                     
index 1d88c0cfccec95fd4841668ea0c5aef905e348e1..9116a3c98e7edcc7e6d41afe23d756e367d06a78 100644 (file)
@@ -5,6 +5,7 @@
 #include <bonobo.h>
 
 #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__ */