gtk_container_add(GTK_CONTAINER (scrolled_window), GTK_WIDGET (control_data->math_view));
- view = view_new();
+ view = view_new(control_data);
bonobo_object_add_interface(BONOBO_OBJECT(control), BONOBO_OBJECT(view));
persist_file = gtk_math_view_persist_file_new(GTK_MATH_VIEW(math_view));
}
static void
-impl_view_freeze(PortableServer_Servant servant,
+impl_view_freeze(PortableServer_Servant servant,
CORBA_Environment *ev)
{
View* view = VIEW (bonobo_object (servant));
- printf("called freeze\n");
+ gtk_math_view_freeze(view->control_data->math_view);
}
static void
-impl_view_thaw(PortableServer_Servant servant,
+impl_view_thaw(PortableServer_Servant servant,
CORBA_Environment *ev)
{
View* view = VIEW (bonobo_object (servant));
- printf("called thaw\n");
+ gtk_math_view_thaw(view->control_data->math_view);
+}
+
+static void
+impl_view_load(PortableServer_Servant servant,
+ const CORBA_char *uri,
+ CORBA_Environment *ev)
+{
+ View* view = VIEW (bonobo_object (servant));
+ gtk_math_view_load_uri(view->control_data->math_view, uri);
}
static void
BONOBO_TYPE_FUNC_FULL (View, GNOME_GtkMathView_View, BONOBO_TYPE_OBJECT, view)
View*
-view_new()
+view_new(GtkMathViewControlData* control_data)
{
- View* view = g_object_new(VIEW_TYPE, NULL);
+ View* view;
+ g_return_val_if_fail(control_data != NULL, NULL);
+ view = g_object_new(VIEW_TYPE, NULL);
+ view->control_data = control_data;
return view;
}
#include <bonobo.h>
#include "GNOME_GtkMathView_View.h"
+#include "control-data.h"
#define VIEW_TYPE (view_get_type())
#define VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), VIEW_TYPE, View))
typedef struct {
BonoboObject parent;
+ GtkMathViewControlData* control_data;
} View;
typedef struct {
} ViewClass;
GType view_get_type(void);
-View* view_new(void);
+View* view_new(GtkMathViewControlData*);
#endif /* __view_h__ */