From 98033071444bc980e023ab17bdb35bd6a0ca1458 Mon Sep 17 00:00:00 2001 From: Luca Padovani Date: Thu, 17 Jul 2003 10:22:38 +0000 Subject: [PATCH] * the container seems to work now --- helm/gtkmathview-bonobo/Makefile.am | 2 +- helm/gtkmathview-bonobo/configure.ac | 18 ++++--- .../src/GNOME_GtkMathView.server.in | 6 +-- helm/gtkmathview-bonobo/src/Makefile.am | 8 ++-- helm/gtkmathview-bonobo/src/control-factory.c | 48 +++++++------------ helm/gtkmathview-bonobo/src/control-factory.h | 17 ++----- 6 files changed, 40 insertions(+), 59 deletions(-) diff --git a/helm/gtkmathview-bonobo/Makefile.am b/helm/gtkmathview-bonobo/Makefile.am index 38452e227..1119be901 100644 --- a/helm/gtkmathview-bonobo/Makefile.am +++ b/helm/gtkmathview-bonobo/Makefile.am @@ -1,5 +1,5 @@ EXTRA_DIST = BUGS HISTORY LICENSE ANNOUNCEMENT CONTRIBUTORS config.h.in -SUBDIRS = src +SUBDIRS = src test CLEANFILES = core *.log *.eps pkgconfigdir = $(libdir)/pkgconfig diff --git a/helm/gtkmathview-bonobo/configure.ac b/helm/gtkmathview-bonobo/configure.ac index db0e236ff..ba11d0608 100644 --- a/helm/gtkmathview-bonobo/configure.ac +++ b/helm/gtkmathview-bonobo/configure.ac @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(gtkmathview-bonobo, [0.0.1]) +AC_INIT(gtkmathview-control, [0.0.1]) AC_CONFIG_SRCDIR(src/GNOME_GtkMathView.server.in) AM_INIT_AUTOMAKE($AC_PACKAGE_NAME, $AC_PACKAGE_VERSION) @@ -8,11 +8,12 @@ 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(GTKMATHVIEW_BONOBO_VERSION_INFO) +GTKMATHVIEW_CONTROL_VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'` +AC_SUBST(GTKMATHVIEW_CONTROL_VERSION_INFO) -GTKMATHVIEW_BONOBO_IDL_INTERFACE_VERSION=`echo $VERSION | awk -F. '{ printf "%d.%d", $1, $2 }'` -AC_SUBST(GTKMATHVIEW_BONOBO_IDL_INTERFACE_VERSION) +GTKMATHVIEW_API_VERSION="1.0" +AC_SUBST(GTKMATHVIEW_API_VERSION) +AC_DEFINE_UNQUOTED(MATH_VIEW_API_VERSION, "$GTKMATHVIEW_API_VERSION", [Version number of the API implemented]) AC_ARG_ENABLE( profile, @@ -80,7 +81,7 @@ AC_SUBST(LDFLAGS) AM_PROG_LIBTOOL -PKG_CHECK_MODULES(GTKMATHVIEW, gtkmathview >= 0.4.3) +PKG_CHECK_MODULES(GTKMATHVIEW, gtkmathview >= 0.5.0) AC_SUBST(GTKMATHVIEW_CFLAGS) AC_SUBST(GTKMATHVIEW_LIBS) @@ -92,10 +93,15 @@ PKG_CHECK_MODULES(BONOBOUI, libbonoboui-2.0) AC_SUBST(BONOBOUI_CFLAGS) AC_SUBST(BONOBOUI_LIBS) +PKG_CHECK_MODULES(GNOMEUI, libgnomeui-2.0) +AC_SUBST(GNOMEUI_CFLAGS) +AC_SUBST(GNOMEUI_LIBS) + AC_CONFIG_FILES([ Makefile gtkmathview-bonobo.pc src/Makefile src/GNOME_GtkMathView.server + test/Makefile ]) AC_OUTPUT diff --git a/helm/gtkmathview-bonobo/src/GNOME_GtkMathView.server.in b/helm/gtkmathview-bonobo/src/GNOME_GtkMathView.server.in index b867a3d02..57c689bc9 100644 --- a/helm/gtkmathview-bonobo/src/GNOME_GtkMathView.server.in +++ b/helm/gtkmathview-bonobo/src/GNOME_GtkMathView.server.in @@ -1,7 +1,7 @@ - + @@ -10,7 +10,7 @@ - + diff --git a/helm/gtkmathview-bonobo/src/Makefile.am b/helm/gtkmathview-bonobo/src/Makefile.am index ca93f9ee5..1a922964c 100644 --- a/helm/gtkmathview-bonobo/src/Makefile.am +++ b/helm/gtkmathview-bonobo/src/Makefile.am @@ -1,10 +1,10 @@ -lib_LTLIBRARIES = libgtkmathview-bonobo.la +lib_LTLIBRARIES = libgtkmathview-control.la -libgtkmathview_bonobo_la_LIBADD = $(GTKMATHVIEW_LIBS) $(BONOBOUI_LIBS) $(BONOBO_LIBS) -libgtkmathview_bonobo_la_LDFLAGS = -version-info @GTKMATHVIEW_BONOBO_VERSION_INFO@ +libgtkmathview_control_la_LIBADD = $(GTKMATHVIEW_LIBS) $(BONOBOUI_LIBS) $(BONOBO_LIBS) +libgtkmathview_control_la_LDFLAGS = -version-info @GTKMATHVIEW_CONTROL_VERSION_INFO@ -libgtkmathview_bonobo_la_SOURCES = \ +libgtkmathview_control_la_SOURCES = \ control-factory.c pkginclude_HEADERS = \ diff --git a/helm/gtkmathview-bonobo/src/control-factory.c b/helm/gtkmathview-bonobo/src/control-factory.c index 9a7226259..ba20733cf 100644 --- a/helm/gtkmathview-bonobo/src/control-factory.c +++ b/helm/gtkmathview-bonobo/src/control-factory.c @@ -1,16 +1,16 @@ #include +#include -#if 1 #include -#endif + +#include "control-factory.h" 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, @@ -205,65 +205,49 @@ set_prop(BonoboPropertyBag *bag, } } -static BonoboControl* -gtk_math_view_control_factory(void) +static BonoboObject* +gtk_math_view_control_factory(BonoboGenericFactory* factory, const gchar* component_id, gpointer closure) { BonoboControl *control; - GtkWidget *math_view; BonoboPropertyBag *prop_bag; + GtkWidget *math_view; 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); + /* + persist_file = gtk_math_view_persist_file_new(GTK_MATH_VIEW(math_view)); + bonobo_object_add_interface(BONOBO_OBJECT(control), persist_file); + */ - bonobo_control_set_properties(control,BONOBO_OBJREF(prop_bag), NULL); + 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; + bonobo_object_unref(BONOBO_OBJECT(prop_bag)); - g_return_if_fail(BONOBO_IS_PROPERTY_BAG(data)); - prop_bag = BONOBO_PROPERTY_BAG(data); + return BONOBO_OBJECT(control); +} - //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_ACTIVATION_SHLIB_FACTORY (CONTROL_FACTORY_ID, "GtkMathView Factory", gtk_math_view_control_factory, NULL); - //bonobo_property_bag_notify_listeners(prop_bag,); -} diff --git a/helm/gtkmathview-bonobo/src/control-factory.h b/helm/gtkmathview-bonobo/src/control-factory.h index ff75a2538..e91e8a7a5 100644 --- a/helm/gtkmathview-bonobo/src/control-factory.h +++ b/helm/gtkmathview-bonobo/src/control-factory.h @@ -18,23 +18,14 @@ * Boston, MA 02111-1307, USA. */ -#ifdef GTK_MATH_VIEW_CONTROL_FACTORY_H_ -#define GTK_MATH_VIEW_CONTROL_FACTORY_H_ +#ifndef __control_factory_h__ +#define __control_factory_h__ +#include #include -#include #include -#include #define CONTROL_FACTORY_ID "OAFIID:GNOME_GtkMathView_Factory:" MATH_VIEW_API_VERSION #define CONTROL_ID "OAFIID:GNOME_GtkMathView:" MATH_VIEW_API_VERSION -enum math_args; - -BonoboControl *gtk_math_view_control_factory(BonoboGenericFactory *factory,const gchar *component_id, gpointer closure); -static void get_prop(BonoboPropertyBag*, BonoboArg *, guint , CorbaEnvironment*, gpointer); -static void set_prop(BonoboPropertyBag*, BonoboArg *, guint , CorbaEnvironment*, gpointer); - -static void notify_property_bag(GtkMathView* ,gpointer); - -#endif +#endif /* __control_factory_h__ */ -- 2.39.2