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->first_selected = NULL;
10 cd->root_selected = NULL;
17 gtk_math_view_control_data_destroy(GtkMathViewControlData* cd)
19 GdomeException exc = 0;
20 //gtk_object_unref(cd->math_view);
22 if (cd->first_selected != NULL)
24 gdome_el_unref(cd->first_selected, &exc);
26 cd->first_selected = NULL;
28 if (cd->root_selected != NULL)
30 gdome_el_unref(cd->root_selected, &exc);
32 cd->root_selected = NULL;
34 if (cd->id_ns_uri != NULL)
36 gdome_str_unref(cd->id_ns_uri);
39 if (cd->id_name != NULL)
41 gdome_str_unref(cd->id_name);
48 gtk_math_view_control_data_set_id_attribute(GtkMathViewControlData* cd,
49 const char* ns_uri, const char* name)
51 g_return_if_fail(cd != NULL);
52 if (cd->id_ns_uri != NULL)
54 gdome_str_unref(cd->id_ns_uri);
57 if (cd->id_name != NULL)
59 gdome_str_unref(cd->id_name);
62 if (ns_uri) cd->id_ns_uri = gdome_str_mkref(ns_uri);
63 if (name) cd->id_name = gdome_str_mkref(name);