]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gtkmathview-bonobo/src/persist-file.c
* a few adjustments and debugging messages added
[helm.git] / helm / gtkmathview-bonobo / src / persist-file.c
index 36b4536a45b215b52bc1105804c368b9a5523040..5380ec42c3a0b0d3953df4cdeaac3195e9e2ecf1 100644 (file)
@@ -27,8 +27,7 @@ static void finalize(GObject *object)
 static Bonobo_Persist_ContentTypeList *
 get_content_types(BonoboPersist *persist,CORBA_Environment *ev)
 {
-       //FIXME: il tipo di dato non e` noto
-       return bonobo_persist_generate_content_types(0);
+  return bonobo_persist_generate_content_types(3, "application/mathml+xml", "text/mathml", "text/plain");
 }
 
 
@@ -83,32 +82,37 @@ gtk_math_view_persist_file_get_type(void)
 BonoboObject *
 gtk_math_view_persist_file_new(GtkMathView *math_view)
 {
-       BonoboObject *file;
+  BonoboObject *file;
 
-       printf("persist file new\n");
-       file = g_object_new(gtk_math_view_persist_file_get_type(),NULL);
-       bonobo_persist_construct(BONOBO_PERSIST(file),CONTROL_FACTORY_ID);
+  printf("persist file new\n");
+  file = g_object_new(gtk_math_view_persist_file_get_type(),NULL);
+  bonobo_persist_construct(BONOBO_PERSIST(file),CONTROL_FACTORY_ID);
 
-       g_object_ref(math_view);
-       GTK_MATH_VIEW_PERSIST_FILE(file)->math_view = math_view;
+  g_object_ref(math_view);
+  GTK_MATH_VIEW_PERSIST_FILE(file)->math_view = math_view;
 
-       return file;
+  printf("OK\n");
+
+  return file;
 }
 
 static void
 load_implementation(PortableServer_Servant servant,const gchar *path,CORBA_Environment *ev)
 {
-       gboolean result;
-       GtkMathViewPersistFile* file = GTK_MATH_VIEW_PERSIST_FILE(bonobo_object_from_servant(servant));
-       //fd = open(path, O_RDONLY);
-               
-       result = gtk_math_view_load_uri(file->math_view,path);
-       if(!result)
-       {
-               CORBA_exception_set(ev,CORBA_USER_EXCEPTION,ex_Bonobo_Persist_WrongDataType,NULL);
-       }
-    bonobo_object_unref(BONOBO_OBJECT(file));
-       return ;
+  gboolean result;
+  GtkMathViewPersistFile* file = GTK_MATH_VIEW_PERSIST_FILE(bonobo_object_from_servant(servant));
+  //fd = open(path, O_RDONLY);
+
+  printf("passing from here LOAD\n");
+
+  result = gtk_math_view_load_uri(file->math_view,path);
+  if(!result)
+    {
+      printf("exception here!\n");
+      CORBA_exception_set(ev,CORBA_USER_EXCEPTION,ex_Bonobo_Persist_WrongDataType,NULL);
+    }
+  bonobo_object_unref(BONOBO_OBJECT(file));
+  return ;
 }
 
 static void