]> matita.cs.unibo.it Git - helm.git/blob - helm/gtkmathview-bonobo/src/view.c
* snapshot
[helm.git] / helm / gtkmathview-bonobo / src / view.c
1
2 #include <config.h>
3
4 #include "view.h"
5
6 static GObjectClass* view_parent_class;
7
8 static void
9 view_object_finalize(GObject* object)
10 {
11   View* view = VIEW(object);
12   /* free resources */
13   view_parent_class->finalize(object);
14 }
15
16 static void
17 impl_view_freeze(PortableServer_Servant servant,
18                  CORBA_Environment *ev)
19 {
20   View* view = VIEW (bonobo_object (servant));
21   gtk_math_view_freeze(view->control_data->math_view);
22 }
23
24 static void
25 impl_view_thaw(PortableServer_Servant servant,
26                CORBA_Environment *ev)
27 {
28   View* view = VIEW (bonobo_object (servant));
29   gtk_math_view_thaw(view->control_data->math_view);
30 }
31
32 static void
33 impl_view_load(PortableServer_Servant servant,
34                const CORBA_char *uri,
35                CORBA_Environment *ev)
36 {
37   View* view = VIEW (bonobo_object (servant));
38   gtk_math_view_load_uri(view->control_data->math_view, uri);
39 }
40
41 static void
42 view_class_init(ViewClass* klass)
43 {
44   GObjectClass* object_class = (GObjectClass *) klass;
45   POA_GNOME_GtkMathView_View__epv* epv = &klass->epv;
46   
47   view_parent_class = g_type_class_peek_parent (klass);
48   object_class->finalize = view_object_finalize;
49   
50   epv->freeze = impl_view_freeze;
51   epv->thaw = impl_view_thaw;
52 }
53
54 static void
55 view_init(View* view)
56 {
57   /* do some initialization */
58 }
59
60 BONOBO_TYPE_FUNC_FULL (View, GNOME_GtkMathView_View, BONOBO_TYPE_OBJECT, view)
61
62 View*
63 view_new(GtkMathViewControlData* control_data)
64 {
65   View* view;
66   g_return_val_if_fail(control_data != NULL, NULL);
67   view = g_object_new(VIEW_TYPE, NULL);
68   view->control_data = control_data;
69   return view;
70 }