EXTRA_DIST = config.h.in
-SUBDIRS = src test
+SUBDIRS = idl src test
CLEANFILES = core *.log *.eps
pkgconfigdir = $(libdir)/pkgconfig
AC_SUBST(GNOMEUI_CFLAGS)
AC_SUBST(GNOMEUI_LIBS)
+ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
+AC_SUBST(ORBIT_IDL)
+
+BONOBO_IDL_INCLUDES="-I`$PKG_CONFIG --variable=idldir libbonobo-2.0` -I`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
+AC_SUBST(BONOBO_IDL_INCLUDES)
+
AC_CONFIG_FILES([
Makefile
gtkmathview-bonobo.pc
+ idl/Makefile
src/Makefile
src/GNOME_GtkMathView.server.in
test/Makefile
--- /dev/null
+Makefile
+Makefile.in
--- /dev/null
+
+#include <Bonobo.idl>
+
+module GNOME {
+
+ module GtkMathView {
+
+ interface View : Bonobo::Unknown {
+
+ void freeze ();
+ void thaw ();
+
+ };
+
+ };
+
+};
+
--- /dev/null
+
+idldir = $(datadir)/idl/bonobo-2.0
+idl_DATA = GNOME_GtkMathView_View.idl
+
+EXTRA_DIST = $(idl_DATA)
Makefile.in
libgtkmathview-bonobo.la
control-factory.lo
+view.lo
persist-file.lo
+persist-stream.lo
+GNOME_GtkMathView_View-common.c
+GNOME_GtkMathView_View-common.lo
+GNOME_GtkMathView_View-skels.c
+GNOME_GtkMathView_View-skels.lo
+GNOME_GtkMathView_View-stubs.c
+GNOME_GtkMathView_View-stubs.lo
+GNOME_GtkMathView_View.h
<oaf_server iid="OAFIID:GNOME_GtkMathView:@GTKMATHVIEW_API_VERSION@" type="factory" location="OAFIID:GNOME_GtkMathView_Factory:@GTKMATHVIEW_API_VERSION@">
<oaf_attribute name="repo_ids" type="stringv">
+ <item value="IDL:GNOME/GtkMathView/View:1.0"/>
<item value="IDL:Bonobo/Control:1.0"/>
<item value="IDL:Bonobo/Unkown:1.0"/>
<item value="IDL:Bonobo/PersistFile:1.0"/>
CLEANFILES = $(server_in_files:.server.in.in=.server)
+IDL = $(top_srcdir)/idl/GNOME_GtkMathView_View.idl
+
+IDL_GENERATED_C = \
+ GNOME_GtkMathView_View-common.c \
+ GNOME_GtkMathView_View-skels.c \
+ GNOME_GtkMathView_View-stubs.c
+
+IDL_GENERATED_H = \
+ GNOME_GtkMathView_View.h
+
+IDL_GENERATED = $(IDL_GENERATED_C) $(IDL_GENERATED_H)
+
lib_LTLIBRARIES = libgtkmathview-bonobo.la
-libgtkmathview_bonobo_la_LIBADD = $(GTKMATHVIEW_LIBS) $(BONOBOUI_LIBS) $(BONOBO_LIBS)
+libgtkmathview_bonobo_la_LIBADD = \
+ $(GTKMATHVIEW_LIBS) \
+ $(BONOBOUI_LIBS) \
+ $(BONOBO_LIBS)
+
libgtkmathview_bonobo_la_LDFLAGS = -version-info @GTKMATHVIEW_CONTROL_VERSION_INFO@
libgtkmathview_bonobo_la_SOURCES = \
+ $(IDL_GENERATED_C) \
control-factory.c \
persist-file.c \
- persist-stream.c
+ persist-stream.c \
+ view.c
pkginclude_HEADERS = \
control-factory.h \
persist-file.h \
- persist-stream.h
+ persist-stream.h \
+ view.h
server_DATA = $(server_in_files:.server.in.in=.server)
$(server_in_files:.server.in.in=.server): $(server_in_files:.server.in.in=.server.in) Makefile
sed -e "s|\@GTKMATHVIEW_FACTORY_LOCATION\@|$(location)|g" $< >$@
+view.c : $(VIEW_CORBA_GENERATED)
+
+$(IDL_GENERATED): $(IDL)
+ $(ORBIT_IDL) $(BONOBO_IDL_INCLUDES) $<
+
+EXTRA_DIST = $(server_DATA)
+
INCLUDES = \
$(BONOBOUI_CFLAGS) \
$(BONOBO_CFLAGS) \
+
#include <bonobo.h>
#include <bonobo/bonobo-shlib-factory.h>
#include <gtkmathview.h>
#include "control-factory.h"
+#include "view.h"
typedef struct _GtkMathViewControlData
{
BonoboPropertyBag *prop_bag;
BonoboObject *persist_file;
BonoboObject *persist_stream;
-
+ View* view;
+
math_view = gtk_math_view_new(NULL,NULL);
gtk_widget_show(math_view);
gtk_container_add(GTK_CONTAINER (scrolled_window), GTK_WIDGET (control_data->math_view));
+ view = view_new();
+ bonobo_object_add_interface(BONOBO_OBJECT(control), BONOBO_OBJECT(view));
+
persist_file = gtk_math_view_persist_file_new(GTK_MATH_VIEW(math_view));
bonobo_object_add_interface(BONOBO_OBJECT(control), persist_file);
--- /dev/null
+
+#include <config.h>
+
+#include "view.h"
+
+static GObjectClass* view_parent_class;
+
+static void
+view_object_finalize(GObject* object)
+{
+ View* view = VIEW(object);
+ /* free resources */
+ view_parent_class->finalize(object);
+}
+
+static void
+impl_view_freeze(PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ View* view = VIEW (bonobo_object (servant));
+ printf("called freeze\n");
+}
+
+static void
+impl_view_thaw(PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ View* view = VIEW (bonobo_object (servant));
+ printf("called thaw\n");
+}
+
+static void
+view_class_init(ViewClass* klass)
+{
+ GObjectClass* object_class = (GObjectClass *) klass;
+ POA_GNOME_GtkMathView_View__epv* epv = &klass->epv;
+
+ view_parent_class = g_type_class_peek_parent (klass);
+ object_class->finalize = view_object_finalize;
+
+ epv->freeze = impl_view_freeze;
+ epv->thaw = impl_view_thaw;
+}
+
+static void
+view_init(View* view)
+{
+ /* do some initialization */
+}
+
+BONOBO_TYPE_FUNC_FULL (View, GNOME_GtkMathView_View, BONOBO_TYPE_OBJECT, view)
+
+View*
+view_new()
+{
+ View* view = g_object_new(VIEW_TYPE, NULL);
+ return view;
+}
--- /dev/null
+
+#ifndef __view_h__
+#define __view_h__
+
+#include <bonobo.h>
+
+#include "GNOME_GtkMathView_View.h"
+
+#define VIEW_TYPE (view_get_type())
+#define VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), VIEW_TYPE, View))
+#define VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), VIEW_TYPE, ViewClass))
+#define VIEW_IS_OBJECT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), VIEW_TYPE))
+#define VIEW_IS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), VIEW_TYPE))
+#define VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), VIEW_TYPE, ViewClass))
+
+typedef struct {
+ BonoboObject parent;
+} View;
+
+typedef struct {
+ BonoboObjectClass parent_class;
+ POA_GNOME_GtkMathView_View__epv epv;
+} ViewClass;
+
+GType view_get_type(void);
+View* view_new(void);
+
+#endif /* __view_h__ */
+
noinst_PROGRAMS = viewer
-viewer_SOURCES = main.c
+viewer_SOURCES = \
+ main.c \
+ $(top_srcdir)/src/GNOME_GtkMathView_View-common.c \
+ $(top_srcdir)/src/GNOME_GtkMathView_View-stubs.c
viewer_LDADD = \
$(BONOBOUI_LIBS) \
#include <glib.h>
#include "control-factory.h"
+#include "GNOME_GtkMathView_View.h"
static GtkWidget *control;
else
{
const gchar *fname;
- fname = gtk_file_selection_get_filename
- (GTK_FILE_SELECTION (file_selection_info.widget));
+ fname = gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_selection_info.widget));
switch (file_selection_info.Operations) {
- case LOAD_STREAM:
- load_through_persist_stream (fname, interface);
- break;
- case LOAD_FILE:
- load_through_persist_file (fname, interface);
- break;
+ case LOAD_STREAM:
+ load_through_persist_stream (fname, interface);
+ break;
+ case LOAD_FILE:
+ load_through_persist_file (fname, interface);
+ break;
}
}
open_through_persist_file_cb (GtkWidget *widget,
gpointer data)
{
- open_dialog (BONOBO_WINDOW (data),LOAD_FILE);
+ open_dialog (BONOBO_WINDOW (data), LOAD_FILE);
}
static void
open_through_persist_stream_cb(GtkWidget *widget,
gpointer data)
{
- open_dialog(BONOBO_WINDOW(data),LOAD_STREAM);
+ open_dialog(BONOBO_WINDOW(data), LOAD_STREAM);
+}
+
+static void
+test_view(GtkWidget* widget, gpointer data)
+{
+ CORBA_Object interface;
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+ interface = Bonobo_Unknown_queryInterface (bonobo_widget_get_objref (BONOBO_WIDGET (bonobo_window_get_contents (BONOBO_WINDOW(data)))),
+ "IDL:GNOME/GtkMathView/View:1.0", &ev);
+ CORBA_exception_free (&ev);
+
+ if (interface == CORBA_OBJECT_NIL)
+ {
+ g_warning ("The Control does not seem to support `View'.");
+ }
+
+ CORBA_exception_init (&ev);
+ GNOME_GtkMathView_View_freeze(interface, &ev);
+ CORBA_exception_free (&ev);
+
+ CORBA_exception_init (&ev);
+ GNOME_GtkMathView_View_thaw(interface, &ev);
+ CORBA_exception_free (&ev);
+
+ CORBA_exception_init (&ev);
+ Bonobo_Unknown_unref (interface, &ev);
+ CORBA_Object_release (interface, &ev);
+ CORBA_exception_free (&ev);
}
static void
static BonoboUIVerb verbs [] = {
BONOBO_UI_UNSAFE_VERB ("OpenFile", open_through_persist_file_cb),
BONOBO_UI_UNSAFE_VERB ("OpenStream", open_through_persist_stream_cb),
+ BONOBO_UI_UNSAFE_VERB ("TestView", test_view),
BONOBO_UI_UNSAFE_VERB ("Size", get_size),
BONOBO_UI_UNSAFE_VERB ("Top", get_top),
BONOBO_UI_UNSAFE_VERB ("Font Size", get_font_size),
" <menuitem name=\"ViewHTMLSource\" verb=\"\" _label=\"View HTML Source\" _tip=\"View the html source of the current document\"/>"
" <menuitem name=\"ViewHTMLSourceHTML\" verb=\"\" _label=\"View HTML Output\" _tip=\"View the html source of the current document as html\"/>"
" <menuitem name=\"ViewPlainSource\" verb=\"\" _label=\"View PLAIN Source\" _tip=\"View the plain text source of the current document\"/>"
+" <menuitem name=\"TestView\" verb=\"\" _label=\"Test View\" _tip=\"Test the View interface\"/>"
" <separator/>"
" <menuitem name=\"FileExit\" verb=\"\" _label=\"E_xit\"/>"
" </submenu>"
" <placeholder name=\"Component\"/>"
-" <submenu name=\"PropertyBags\" _label=\"Property_Bags\">"
+" <submenu name=\"PropertyBags\" _label=\"Property_Bag\">"
" <menuitem name=\"Size\" verb=\"\" _label=\"Size(PropertyBag)\" _tip=\"Get size\""
" pixtype=\"stock\" pixname=\"Get Size\"/>"