]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gtkmathview-bonobo/src/control-data.c
Debugging stuff removed.
[helm.git] / helm / gtkmathview-bonobo / src / control-data.c
index 382ea8d1d12545412855d8c5051b1f14ac198b60..8668a3867b87f79aca1bf72557d94aa71c59457c 100644 (file)
@@ -1,3 +1,29 @@
+/* This file is part of GtkMathView-Bonobo, a Bonobo wrapper for GtkMathView.
+ * Copyright (C) 2003 Luca Padovani <lpadovan@cs.unibo.it>
+ *                    Pouria Masoudi <pmasoudi@cs.unibo.it>
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * For more information, please visit the project's home page
+ * http://helm.cs.unibo.it/gtkmathview-bonobo
+ * or send an email to <lpadovan@cs.unibo.it>
+ */
+
+#include <config.h>
+
+#include <gdome.h>
 
 #include "control-data.h"
 
@@ -6,9 +32,10 @@ gtk_math_view_control_data_new(GtkMathView *math_view)
 {
   GtkMathViewControlData *cd = g_new(GtkMathViewControlData,1);
   cd->math_view = math_view;
-  cd->semantic_selection = FALSE;
   cd->first_selected = NULL;
   cd->root_selected = NULL;
+  cd->id_ns_uri = gdome_str_mkref("http://www.cs.unibo.it/helm");
+  cd->id_name = gdome_str_mkref("xref");
   return cd;
 }
 
@@ -30,6 +57,45 @@ gtk_math_view_control_data_destroy(GtkMathViewControlData* cd)
       g_assert(exc == 0);
       cd->root_selected = NULL;
     }
+  if (cd->id_ns_uri != NULL)
+    {
+      gdome_str_unref(cd->id_ns_uri);
+      cd->id_ns_uri = NULL;
+    }
+  if (cd->id_name != NULL)
+    {
+      gdome_str_unref(cd->id_name);
+      cd->id_name = NULL;
+    }
   g_free(cd);
 }
 
+gchar*
+gtk_math_view_control_data_get_id_ns_uri(GtkMathViewControlData* cd)
+{
+  g_return_val_if_fail(cd != NULL, NULL);
+  return (cd->id_ns_uri != NULL) ? g_strdup(cd->id_ns_uri->str) : NULL;
+}
+                                        
+void
+gtk_math_view_control_data_set_id_ns_uri(GtkMathViewControlData* cd, const gchar* ns_uri)
+{
+  g_return_if_fail(cd != NULL);
+  if (cd->id_ns_uri != NULL) gdome_str_unref(cd->id_ns_uri);
+  cd->id_ns_uri = (ns_uri != NULL) ? gdome_str_mkref_dup(ns_uri) : NULL;
+}
+
+gchar*
+gtk_math_view_control_data_get_id_name(GtkMathViewControlData* cd)
+{
+  g_return_val_if_fail(cd != NULL, NULL);
+  return (cd->id_name != NULL) ? g_strdup(cd->id_name->str) : NULL;
+}
+                                        
+void
+gtk_math_view_control_data_set_id_name(GtkMathViewControlData* cd, const gchar* name)
+{
+  g_return_if_fail(cd != NULL);
+  if (cd->id_name != NULL) gdome_str_unref(cd->id_name);
+  cd->id_name = (name != NULL) ? gdome_str_mkref_dup(name) : NULL;
+}