--- /dev/null
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(gtkmathview-bonobo, [0.0.1])
+AC_CONFIG_SRCDIR(src/GNOME_GtkMathView.server.in)
+AM_INIT_AUTOMAKE($AC_PACKAGE_NAME, $AC_PACKAGE_VERSION)
+
+PACKAGE=$PACKAGE_NAME
+VERSION=$PACKAGE_VERSION
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+
+GTKMATHVIEW_BONOBO_VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'`
+AC_SUBST(EDITEX_VERSION_INFO)
+
+AC_ARG_ENABLE(
+ profile,
+ [ --enable-profile[=ARG] include profiling information [default=no]],
+ profile=$enableval,
+ profile=no
+)
+
+AC_ARG_ENABLE(
+ debug,
+ [ --enable-debug[=ARG] include debugging debug [default=yes]],
+ enable_debug=$enableval,
+ enable_debug=yes
+)
+
+if test "x$enable_debug" = "xyes"; then
+ AC_DEFINE(ENABLE_DEBUG,,[Define to 1 if you want to enable validity checks while running])
+fi
+
+dnl AC_CONFIG_HEADERS([config.h])
+AM_CONFIG_HEADER(config.h)
+
+AH_TOP([
+/* This file is part of GtkMathView-Bonobo, an implementation of
+ * some Bonobo interfaces for GtkMathView.
+ *
+ * Copyright (C) 2003 Luca Padovani <lpadovan@cs.unibo.it>,
+ * Pouria Masoudi <pmasoudi@cs.unibo.it>.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * For more information, please visit the project's home page
+ * http://helm.cs.unibo.it/gtkmathview-bonobo/
+ * or send an email to <lpadovan@cs.unibo.it>
+ */
+
+#ifndef config_h
+#define config_h
+])
+
+AH_BOTTOM([
+#endif /* config_h */
+])
+
+AC_PROG_CC
+AC_PROG_CXX
+AC_PROG_INSTALL
+AC_HEADER_STDC([])
+
+AC_SUBST(CFLAGS)
+AC_SUBST(CPPFLAGS)
+AC_SUBST(LDFLAGS)
+
+AM_PROG_LIBTOOL
+
+PKG_CHECK_MODULES(GTKMATHVIEW, gtkmathview >= 0.4.3)
+AC_SUBST(GTKMATHVIEW_CFLAGS)
+AC_SUBST(GTKMATHVIEW_LIBS)
+
+PKG_CHECK_MODULES(BONOBO, libbonobo-2.0)
+AC_SUBST(BONOBO_CFLAGS)
+AC_SUBST(BONOBO_LIBS)
+
+PKG_CHECK_MODULES(BONOBOUI, libbonoboui-2.0)
+AC_SUBST(BONOBOUI_CFLAGS)
+AC_SUBST(BONOBOUI_LIBS)
+
+AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
+ src/GNOME_GtkMathView.server
+])
+AC_OUTPUT
--- /dev/null
+
+#include <bonobo.h>
+
+#if 1
+#include <gtkmathview.h>
+#endif
+
+enum {
+ MATH_VIEW_WIDTH,
+ MATH_VIEW_HEIGHT,
+ MATH_VIEW_TOP_X,
+ MATH_VIEW_TOP_Y,
+ MATH_VIEW_TOP,
+ MATH_VIEW_FONT_SIZE,
+ MATH_VIEW_ANTI_ALIASING,
+ MATH_VIEW_TRANSPARENCY,
+ MATH_VIEW_VERBOSITY,
+ MATH_VIEW_FONT_MANAGER
+} math_args;
+
+
+/*static char *
+make_reg_id(const char *iid)
+{
+ char *id;
+ id = bonobo_activation_make_registration_id(iid,Display_String(gdk_display));
+ return id;
+}*/
+
+static void
+get_prop(BonoboPropertyBag *bag,
+ BonoboArg *arg,
+ guint arg_id,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ GtkMathView *math_view;
+
+ g_return_if_fail(GTK_IS_MATH_VIEW(user_data));
+
+ math_view = GTK_MATH_VIEW(user_data);
+
+ switch(arg_id)
+ {
+ case MATH_VIEW_WIDTH:
+ {
+ gint i = gtk_math_view_get_width(math_view);
+ g_assert(arg->_type == BONOBO_ARG_INT);
+ BONOBO_ARG_SET_INT(arg,i);
+ }
+ break;
+ case MATH_VIEW_HEIGHT:
+ {
+ guint i = gtk_math_view_get_height(math_view);
+
+ g_assert(arg->_type == BONOBO_ARG_INT);
+ BONOBO_ARG_SET_INT(arg,i);
+ }
+ break;
+ case MATH_VIEW_TOP_X:
+ {
+ guint new_top_y,new_top_x;
+
+ g_assert(arg->_type == BONOBO_ARG_INT);
+ gtk_math_view_get_top(math_view,&new_top_x, &new_top_y);
+ BONOBO_ARG_SET_INT(arg,new_top_x);
+ }
+ break;
+ case MATH_VIEW_TOP_Y:
+ {
+ guint new_top_y,new_top_x;
+
+ g_assert(arg->_type == BONOBO_ARG_INT);
+ gtk_math_view_get_top(math_view,&new_top_x,&new_top_y);
+ BONOBO_ARG_SET_INT(arg,new_top_y);
+ }
+ break;
+ case MATH_VIEW_FONT_SIZE:
+ {
+ guint i = gtk_math_view_get_font_size(math_view);
+ g_assert(arg->_type == BONOBO_ARG_INT);
+
+ BONOBO_ARG_SET_INT(arg,i);
+ }
+ break;
+ case MATH_VIEW_ANTI_ALIASING:
+ {
+ gboolean i = gtk_math_view_get_anti_aliasing(math_view);
+ g_assert(arg->_type == BONOBO_ARG_BOOLEAN);
+
+ BONOBO_ARG_SET_BOOLEAN(arg,i);
+ }
+ break;
+ case MATH_VIEW_TRANSPARENCY:
+ {
+ gboolean i = gtk_math_view_get_transparency(math_view);
+ g_assert(arg->_type == BONOBO_ARG_BOOLEAN);
+
+ BONOBO_ARG_SET_BOOLEAN(arg,i);
+ }
+ break;
+ case MATH_VIEW_VERBOSITY:
+ {
+ gint i = gtk_math_view_get_log_verbosity(math_view);
+ g_assert(arg->_type == BONOBO_ARG_INT);
+
+ BONOBO_ARG_SET_INT(arg,i);
+ }
+ break;
+ case MATH_VIEW_FONT_MANAGER:
+ {gint i = (gint) gtk_math_view_get_font_manager_type(math_view);
+ BONOBO_ARG_SET_INT(arg,i);
+ }
+ break;
+ default:
+ g_assert(FALSE);
+ }
+}
+
+static void
+set_prop(BonoboPropertyBag *bag,
+ const BonoboArg *arg,
+ guint arg_id,
+ CORBA_Environment *ev,
+ gpointer user_data)
+{
+ GtkMathView *math_view;
+
+ g_return_if_fail(GTK_IS_MATH_VIEW(user_data));
+
+ math_view = GTK_MATH_VIEW(user_data);
+
+ switch(arg_id)
+ {
+ /*case MATH_VIEW_WIDTH:
+ g_assert(arg->_type == BONOBO_ARG_INT);
+
+ guint i = gtk_math_view_set_width(math_view);
+ BONOBO_ARG_SET_INT(arg,i);
+ break;
+ case MATH_VIEW_HEIGHT:
+ g_assert(arg->_type == BONOBO_ARG_INT);
+
+ guint i = gtk_math_view_get_height(math_view);
+ BONOBO_ARG_SET_INT(arg,i);
+ break;*/
+ case MATH_VIEW_TOP_X:
+ {
+ guint old_top_y;
+ g_assert(arg->_type == BONOBO_ARG_INT);
+
+ gtk_math_view_get_top(math_view, NULL, &old_top_y);
+ gtk_math_view_set_top(math_view, BONOBO_ARG_GET_INT(arg), old_top_y);
+ }
+ break;
+ case MATH_VIEW_TOP_Y:
+ {
+ guint old_top_x;
+ g_assert(arg->_type == BONOBO_ARG_INT);
+
+ gtk_math_view_get_top(math_view, &old_top_x, NULL);
+ gtk_math_view_set_top(math_view, BONOBO_ARG_GET_INT(arg), old_top_x);
+ }
+ break;
+ case MATH_VIEW_FONT_SIZE:
+ {
+ guint i = gtk_math_view_get_font_size(math_view);
+ g_assert(arg->_type == BONOBO_ARG_INT);
+
+ BONOBO_ARG_SET_INT(arg,i);
+ }
+ break;
+ case MATH_VIEW_ANTI_ALIASING:
+ {
+ gboolean i = gtk_math_view_get_anti_aliasing(math_view);
+ g_assert(arg->_type == BONOBO_ARG_BOOLEAN);
+
+ BONOBO_ARG_SET_BOOLEAN(arg,i);
+ }
+ break;
+ case MATH_VIEW_TRANSPARENCY:
+ {
+ gboolean i = gtk_math_view_get_transparency(math_view);
+ g_assert(arg->_type == BONOBO_ARG_BOOLEAN);
+
+ BONOBO_ARG_SET_BOOLEAN(arg,i);
+ }
+ break;
+ case MATH_VIEW_VERBOSITY:
+ {
+ gint i = gtk_math_view_get_log_verbosity(math_view);
+ g_assert(arg->_type == BONOBO_ARG_INT);
+
+ BONOBO_ARG_SET_INT(arg,i);
+ }
+ break;
+ case MATH_VIEW_FONT_MANAGER:
+ {
+ gint i = (gint) gtk_math_view_get_font_manager_type(math_view);
+ BONOBO_ARG_SET_INT(arg,i);
+ }
+ break;
+ default:
+ g_assert(FALSE);
+ }
+}
+
+static BonoboControl*
+instantiate_func(void)
+{
+ BonoboControl *control;
+ GtkWidget *math_view;
+ BonoboPropertyBag *prop_bag;
+
+ math_view = gtk_math_view_new(NULL,NULL);
+
+ gtk_widget_show(math_view);
+
+ control = bonobo_control_new(math_view);
+
+ prop_bag = bonobo_property_bag_new(get_prop, set_prop, math_view);
+
+ bonobo_control_set_properties(control,BONOBO_OBJREF(prop_bag), NULL);
+
+ bonobo_property_bag_add(prop_bag,"width",MATH_VIEW_WIDTH,BONOBO_ARG_INT,
+ NULL,"width",0);
+
+ bonobo_property_bag_add(prop_bag,"height",MATH_VIEW_HEIGHT,BONOBO_ARG_INT,
+ NULL,"height",0);
+
+ bonobo_property_bag_add(prop_bag,"top_x",MATH_VIEW_TOP_X,BONOBO_ARG_INT,
+ NULL,"top_x",0);
+
+ bonobo_property_bag_add(prop_bag,"top_y",MATH_VIEW_TOP_Y,BONOBO_ARG_INT,
+ NULL,"top_y",0);
+
+ bonobo_property_bag_add(prop_bag,"font_size",MATH_VIEW_FONT_SIZE,BONOBO_ARG_INT,
+ NULL,"font_size",0);
+
+ bonobo_property_bag_add(prop_bag,"anti_aliasing",MATH_VIEW_ANTI_ALIASING,BONOBO_ARG_BOOLEAN,
+ NULL,"anti_aliasing",0);
+
+ bonobo_property_bag_add(prop_bag,"transparency",MATH_VIEW_TRANSPARENCY,BONOBO_ARG_BOOLEAN,
+ NULL,"transparency",0);
+
+ bonobo_property_bag_add(prop_bag,"verbosity",MATH_VIEW_VERBOSITY,BONOBO_ARG_INT,
+ NULL,"verbosity",0);
+
+ bonobo_property_bag_add(prop_bag,"font_manager",MATH_VIEW_FONT_MANAGER,BONOBO_ARG_NULL,
+ NULL,"font_manager",0);
+ return control;
+}
+
+static void
+notify_property_bag(GtkMathView *math_view,gpointer data)
+{
+ BonoboPropertyBag *prop_bag;
+ BonoboArg *arg;
+
+ g_return_if_fail(BONOBO_IS_PROPERTY_BAG(data));
+ prop_bag = BONOBO_PROPERTY_BAG(data);
+
+ //we use arg to notify the container that somthing has changed
+
+ arg = bonobo_arg_new(BONOBO_ARG_INT);
+ BONOBO_ARG_SET_INT(arg,0);
+
+ //bonobo_property_bag_notify_listeners(prop_bag,);
+}
--- /dev/null
+/*
+ * gtk_math_view_bonobo.c
+ * This file is part of gedit
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include <bonobo.h>
+#include <glib.h>
+#include <bonobo/bonobo-control.h>
+
+#include <gtkmathview.h>
+
+
+enum math_args;
+
+static void get_prop(BonoboPropertyBag*, BonoboArg *, guint , CorbaEnvironment*, gpointer);
+static void set_prop(BonoboPropertyBag*, BonoboArg *, guint , CorbaEnvironment*, gpointer);
+
+static BonoboControl* instantiate_func(void);
+
+static void notify_property_bag(GtkMathView* ,gpointer);
+
+