]> matita.cs.unibo.it Git - helm.git/blob - helm/gtkmathview-bonobo/src/control-data.c
* code cleanup
[helm.git] / helm / gtkmathview-bonobo / src / control-data.c
1
2 #include "control-data.h"
3
4 GtkMathViewControlData*
5 gtk_math_view_control_data_new(GtkMathView *math_view)
6 {
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;
12   return cd;
13 }
14
15 void
16 gtk_math_view_control_data_destroy(GtkMathViewControlData* cd)
17 {
18   GdomeException exc = 0;
19   //gtk_object_unref(cd->math_view);
20   cd->math_view = NULL;
21   if (cd->first_selected != NULL)
22     {
23       gdome_el_unref(cd->first_selected, &exc);
24       g_assert(exc == 0);
25       cd->first_selected = NULL;
26     }
27   if (cd->root_selected != NULL)
28     {
29       gdome_el_unref(cd->root_selected, &exc);
30       g_assert(exc == 0);
31       cd->root_selected = NULL;
32     }
33   g_free(cd);
34 }
35