2 #include "control-data.h"
4 GtkMathViewControlData*
5 gtk_math_view_control_data_new(GtkMathView *math_view)
7 GtkMathViewControlData *cd = g_new(GtkMathViewControlData,1);
8 cd->math_view = math_view;
9 cd->semantic_selection = FALSE;
10 cd->first_selected = NULL;
11 cd->root_selected = NULL;
18 gtk_math_view_control_data_destroy(GtkMathViewControlData* cd)
20 GdomeException exc = 0;
21 //gtk_object_unref(cd->math_view);
23 if (cd->first_selected != NULL)
25 gdome_el_unref(cd->first_selected, &exc);
27 cd->first_selected = NULL;
29 if (cd->root_selected != NULL)
31 gdome_el_unref(cd->root_selected, &exc);
33 cd->root_selected = NULL;
35 if (cd->id_ns_uri != NULL)
37 gdome_str_unref(cd->id_ns_uri);
40 if (cd->id_name != NULL)
42 gdome_str_unref(cd->id_name);
49 gtk_math_view_control_data_set_id_attribute(GtkMathViewControlData* cd,
50 const char* ns_uri, const char* name)
52 g_return_if_fail(cd != NULL);
53 if (cd->id_ns_uri != NULL)
55 gdome_str_unref(cd->id_ns_uri);
58 if (cd->id_name != NULL)
60 gdome_str_unref(cd->id_name);
63 if (ns_uri) cd->id_ns_uri = gdome_str_mkref(ns_uri);
64 if (name) cd->id_name = gdome_str_mkref(name);