1 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/Make_container.mak vim/src/Make_container.mak
2 --- vimcopy/src/Make_container.mak Wed Dec 31 18:00:00 1969
3 +++ vim/src/Make_container.mak Sat Jul 26 13:16:46 2003
5 +gnomeccFlags = `pkg-config --cflags libgnomeui-2.0 libgnome-2.0`
6 +ccFlags = -g -c ${gnomeccFlags}
7 +ldFlags = `pkg-config --libs libgnomeui-2.0 libgnome-2.0`
11 +container: container.o
12 + gcc -o container ${ldFlags} container.o
15 + gcc ${ccFlags} $< -o $@
16 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/Makefile vim/src/Makefile
17 --- vimcopy/src/Makefile Thu Jan 15 10:17:10 2004
18 +++ vim/src/Makefile Thu Jan 15 10:13:18 2004
19 @@ -1041,6 +1041,18 @@
20 GTK_MAN_TARGETS = installghelplinks
24 +BONOBO_SRC = $(GTK_SRC)
25 +BONOBO_OBJ = $(GTK_OBJ)
26 +BONOBO_DEFS = $(GTK_DEFS)
27 +BONOBO_IPATH = $(GTK_IPATH)
28 +BONOBO_LIBS_DIR = $(GTK_LIBS_DIR)
29 +BONOBO_LIBS1 = $(GTK_LIBS1)
30 +BONOBO_LIBS2 = $(GTK_LIBS2)
31 +BONOBO_TARGETS = $(GTK_TARGETS) vim-factory
32 +BONOBO_MAN_TARGETS = $(GTK_MAN_TARGETS)
33 +BONOBO_TESTTARGET = $(GTK_TESTTARGET)
36 MOTIF_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
37 MOTIF_OBJ = objects/gui.o objects/gui_motif.o objects/gui_x11.o \
38 @@ -1323,6 +1335,10 @@
42 + objects/gtkhtml_editor.o \
43 + objects/gtkhtml_editor_common.o \
44 + objects/gtkhtml_editor_skels.o \
45 + objects/gtkhtml_editor_stubs.o \
48 objects/if_xcmdsrv.o \
53 + objects/vim_bonobo_main.o \
54 + objects/vim_bonobo_factory.o \
55 + objects/vim_bonobo_control.o \
69 os_mswin.pro os_beos.pro os_vms.pro os_riscos.pro $(PERL_PRO)
71 # Default target is making the executable and tools
72 -all: $(VIMTARGET) $(TOOLS) languages
73 +all: $(VIMTARGET) $(TOOLS) $(EXTRA_TARGETS) languages
77 @@ -1596,6 +1615,10 @@
79 cd testdir; $(MAKE) -f Makefile clean
81 +vim-factory: objects/vim_proxy_factory.o
82 + gcc -o vim-factory $(ALL_LIB_DIRS) $(LDFLAGS) objects/vim_proxy_factory.o $(ALL_LIBS)
86 # Avoid overwriting an existing executable, somebody might be running it and
87 # overwriting it could cause it to crash. Deleting it is OK, it won't be
88 @@ -1622,6 +1645,23 @@
89 # may create a link to the new executable from /usr/bin/vi
92 +Vim_Control.server: Vim_Control.server.in auto/config.mk
93 + rm -f Vim_Control.server Vim_Control.server.tmp
94 + sed -e 's,@DEST_BIN\@,$(DEST_BIN),g' \
95 + -e 's,@VIMNAME\@,$(VIMNAME),g' \
96 + Vim_Control.server.in >Vim_Control.server.tmp
97 + mv Vim_Control.server.tmp Vim_Control.server
99 +installbonobo: installvimbin
100 +# install factory to destbin
101 + $(INSTALL_PROG) vim-factory $(DEST_BIN)
102 + $(STRIP) $(DEST_BIN)/vim-factory
104 +# install server file to /usr/lib/bonobo/servers (modulo prefix)
105 + -$(SHELL) ./mkinstalldirs $(DESTDIR)$(prefix)/lib/bonobo/servers
106 + $(INSTALL_PROG) Vim_Control.server $(DESTDIR)$(prefix)/lib/bonobo/servers
109 # install the help files; first adjust the contents for the location
110 installruntime: $(HELPSOURCE)/vim.1 $(DEST_MAN) $(DEST_VIM) $(DEST_RT) \
111 $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) \
112 @@ -1965,6 +2005,7 @@
113 if test -d $(PODIR); then \
114 cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) clean; \
116 + -rm -f Vim_Control.server vim-factory vim-component
118 # Make a shadow directory for compilation on another system or with different
120 @@ -2172,6 +2213,18 @@
121 objects/gui_mac.o: gui_mac.c
122 $(CCC) -o $@ gui_mac.c
124 +objects/gtkhtml_editor.o: gtkhtml_editor.c
125 + $(CCC) -o $@ gtkhtml_editor.c
127 +objects/gtkhtml_editor_common.o: gtkhtml_editor_common.c
128 + $(CCC) -o $@ gtkhtml_editor_common.c
130 +objects/gtkhtml_editor_skels.o: gtkhtml_editor_skels.c
131 + $(CCC) -o $@ gtkhtml_editor_skels.c
133 +objects/gtkhtml_editor_stubs.o: gtkhtml_editor_stubs.c
134 + $(CCC) -o $@ gtkhtml_editor_stubs.c
136 objects/hangulin.o: hangulin.c
137 $(CCC) -o $@ hangulin.c
139 @@ -2295,6 +2348,18 @@
140 objects/undo.o: undo.c
143 +objects/vim_bonobo_control.o: vim_bonobo_control.c
144 + $(CCC) -o $@ vim_bonobo_control.c
146 +objects/vim_bonobo_factory.o: vim_bonobo_factory.c
147 + $(CCC) -o $@ vim_bonobo_factory.c
149 +objects/vim_bonobo_main.o: vim_bonobo_main.c
150 + $(CCC) -o $@ vim_bonobo_main.c
152 +objects/vim_proxy_factory.o: vim_proxy_factory.c
153 + $(CCC) -o $@ vim_proxy_factory.c
155 objects/window.o: window.c
156 $(CCC) -o $@ window.c
158 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/Vim_Control.server.in vim/src/Vim_Control.server.in
159 --- vimcopy/src/Vim_Control.server.in Wed Dec 31 18:00:00 1969
160 +++ vim/src/Vim_Control.server.in Sat Jan 10 10:45:47 2004
164 +<oaf_server iid="OAFIID:Vim_Proxy_Factory" type="exe" location="@DEST_BIN@/vim-factory">
165 + <oaf_attribute name="repo_ids" type="stringv">
166 + <item value="IDL:Bonobo/GenericFactory:1.0"/>
168 + <oaf_attribute name="name" type="string" value="Vim Control factory"/>
169 + <oaf_attribute name="description" type="string" value="Vim Control factory"/>
172 +<oaf_server iid="OAFIID:Vim_Control_Factory" type="exe" location="@DEST_BIN@/@VIMNAME@">
173 + <oaf_attribute name="repo_ids" type="stringv">
174 + <item value="IDL:Bonobo/GenericFactory:1.0"/>
176 + <oaf_attribute name="name" type="string" value="Vim Control factory"/>
177 + <oaf_attribute name="description" type="string" value="Vim Control factory"/>
180 +<oaf_server iid="OAFIID:Vim_Control" type="factory"
181 + location="OAFIID:Vim_Proxy_Factory">
182 + <oaf_attribute name="repo_ids" type="stringv">
183 + <item value="IDL:Bonobo/Unknown:1.0"/>
184 + <item value="IDL:Bonobo/Control:1.0"/>
185 + <item value="IDL:Bonobo/ItemContainer:1.0"/>
186 + <item value="IDL:Bonobo/PersistStream:1.0"/>
187 + <item value="IDL:Bonobo/PersistFile:1.0"/>
188 + <item value="IDL:Bonobo/Persist:1.0"/>
189 + <item value="IDL:Nautilus/View:1.0"/>
191 + <oaf_attribute name="name" type="string" value="Vim Control"/>
192 + <oaf_attribute name="description" type="string" value="Vim Control"/>
193 + <oaf_attribute name="bonobo:editable" type="boolean" value="false"/>
194 + <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
195 + <item value="text/plain"/>
196 + <item value="text/*"/>
198 + <oaf_attribute name="nautilus:view_as_name" type="string" value="Text"/>
199 + <oaf_attribute name="nautilus:view_as_label" type="string" value="View/Edit in Vim"/>
200 + <oaf_attribute name="nautilus:viewer_label" type="string" value="Vim"/>
204 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/buffer.c vim/src/buffer.c
205 --- vimcopy/src/buffer.c Sat Jan 10 13:10:01 2004
206 +++ vim/src/buffer.c Sat Jan 10 13:06:38 2004
211 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
212 +#include "vim_bonobo_control.h"
215 #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
216 static char_u *buflist_match __ARGS((regprog_T *prog, buf_T *buf));
217 # define HAVE_BUFLIST_MATCH
218 @@ -132,10 +136,20 @@
222 - else if (read_stdin)
223 + else if (read_stdin
224 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
225 + || read_from_container
229 int save_bin = curbuf->b_p_bin;
231 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
232 + int flags = READ_NEW + READ_EMB_STREAM;
233 + curbuf->emb_buffer = TRUE;
235 + int flags = READ_NEW + READ_STDIN;
239 * First read the text in binary mode into the buffer.
242 curbuf->b_p_bin = TRUE;
243 retval = readfile(NULL, NULL, (linenr_T)0,
244 - (linenr_T)0, (linenr_T)MAXLNUM, eap, READ_NEW + READ_STDIN);
245 + (linenr_T)0, (linenr_T)MAXLNUM, eap, flags);
246 curbuf->b_p_bin = save_bin;
249 @@ -167,14 +181,21 @@
250 /* Put the cursor on the first line. */
251 curwin->w_cursor.lnum = 1;
252 curwin->w_cursor.col = 0;
253 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
259 - apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
260 + apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
263 - apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
264 + apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
267 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
273 @@ -4547,6 +4568,11 @@
274 if (buf->b_sfname != NULL)
275 return (char *)buf->b_sfname;
279 +#if defined(FEAT_QUICKFIX) && defined(FEAT_GUI_COMPONENT)
280 + if ( buf->emb_buffer ) {
281 + return "[Embedded File]";
284 if (buf->b_fname == NULL)
285 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/config.h.in vim/src/config.h.in
286 --- vimcopy/src/config.h.in Mon May 26 10:45:01 2003
287 +++ vim/src/config.h.in Sat Jul 26 13:16:46 2003
289 /* Define if GTK+ multihead support is available (requires GTK+ >= 2.1.1). */
290 #undef HAVE_GTK_MULTIHEAD
292 +/* Define if you want component (i.e. Bonobo) support. */
293 +#undef FEAT_GUI_COMPONENT
295 /* Define if your X has own locale library */
298 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/config.mk.in vim/src/config.mk.in
299 --- vimcopy/src/config.mk.in Sat Jan 10 13:10:01 2004
300 +++ vim/src/config.mk.in Thu Jan 15 09:50:04 2004
302 ### Prefix for location of man pages
305 +### Extra targets to be built by default
306 +EXTRA_TARGETS = @EXTRA_TARGETS@
309 GUI_INC_LOC = @GUI_INC_LOC@
310 GUI_LIB_LOC = @GUI_LIB_LOC@
311 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/configure.in vim/src/configure.in
312 --- vimcopy/src/configure.in Sat Jan 10 13:10:01 2004
313 +++ vim/src/configure.in Thu Jan 15 09:48:54 2004
315 sh ./toolcheck 1>&AC_FD_MSG
319 OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
321 dnl Check for BeOS, which needs an extra source file
324 AC_SUBST(OS_EXTRA_SRC)
325 AC_SUBST(OS_EXTRA_OBJ)
326 +AC_SUBST(EXTRA_TARGETS)
328 dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
329 dnl Only when the directory exists and it wasn't there yet.
330 @@ -1410,6 +1412,23 @@
331 AC_DEFINE(FEAT_GUI_GNOME)
332 GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
333 GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
334 + AC_MSG_CHECKING(whether or not to include bonobo support)
335 + AC_ARG_ENABLE(bonobo,
336 + [ --enable-bonobo If using GNOME, enable bonobo support [default=no]],
337 + , enable_bonobo="no")
338 + if test "x$enable_bonobo" = "xno"; then
339 + AC_MSG_RESULT($enable_bonobo);
341 + if test "x$SKIP_BONOBO" != "xYES" -a $gtk_major_version -ge 2; then
342 + AC_MSG_RESULT(yes);
343 + AC_DEFINE(FEAT_GUI_COMPONENT)
345 + VIMNAME="vim-component"
346 + EXTRA_TARGETS="vim-factory Vim_Control.server"
348 + AC_MSG_RESULT(no (Bonobo requires Gnome 2));
354 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/container.c vim/src/container.c
355 --- vimcopy/src/container.c Wed Dec 31 18:00:00 1969
356 +++ vim/src/container.c Sat Jul 26 13:16:46 2003
362 +BonoboControlFrame *ctrl_frame;
363 +BonoboUIComponent *ui_comp;
367 +GtkWidget *ctrl_widget;
371 +static Bonobo_Control
372 +instantiate_control()
374 + Bonobo_Control control;
375 + Bonobo_PersistFile pfile;
376 + Bonobo_PersistStream pstream;
377 + CORBA_Environment ev;
378 + Bonobo_Stream stream;
380 + CORBA_exception_init (&ev);
382 + /* get control component */
383 + control = bonobo_get_object ("OAFIID:Vim_Control",
384 + "Bonobo/Control", &ev);
385 + if (BONOBO_EX (&ev) || (control == CORBA_OBJECT_NIL))
387 + CORBA_exception_free (&ev);
392 + /* get PersistFile interface */
393 + pfile = Bonobo_Unknown_queryInterface (control, "IDL:Bonobo/PersistFile:1.0", &ev);
394 + if (BONOBO_EX (&ev) || (pfile == CORBA_OBJECT_NIL))
397 + /* load the file */
398 + Bonobo_PersistFile_load (pfile, filename, &ev);
399 + bonobo_object_release_unref (pfile, NULL);
402 + /* get PersistStream interface */
403 + pstream = Bonobo_Unknown_queryInterface (control, "IDL:Bonobo/PersistStream:1.0", &ev);
404 + if (BONOBO_EX (&ev) || (pstream == CORBA_OBJECT_NIL))
406 + CORBA_exception_free (&ev);
410 + /* load the file */
411 + stream = bonobo_get_object(filename, "IDL:Bonobo/Stream:1.0", &ev);
412 + if (ev._major != CORBA_NO_EXCEPTION) {
413 + g_warning("Error getting stream interface");
414 + bonobo_object_unref (BONOBO_OBJECT (stream));
415 + CORBA_exception_free (&ev);
418 + Bonobo_PersistStream_load (pstream, stream, "text/plain", &ev);
419 + if (ev._major != CORBA_NO_EXCEPTION) {
420 + g_warning("Error loading stream!");
421 + bonobo_object_unref (BONOBO_OBJECT (stream));
422 + CORBA_exception_free (&ev);
425 + bonobo_object_release_unref (pstream, NULL);
430 +verb_FileNewWindow (BonoboUIComponent *uic, gpointer user_data, const char *cname)
432 + printf("Got New Window!\n");
436 +verb_DoNothing (BonoboUIComponent *uic, gpointer user_data, const char *cname)
440 +static BonoboUIVerb app_verbs[] = {
441 + BONOBO_UI_VERB ("FileNewWindow", verb_FileNewWindow),
442 + BONOBO_UI_VERB ("FileOpen", verb_DoNothing),
443 + BONOBO_UI_VERB ("FileCloseWindow", verb_DoNothing),
444 + BONOBO_UI_VERB ("FileExit", verb_DoNothing),
445 + BONOBO_UI_VERB ("Preferences", verb_DoNothing),
446 + BONOBO_UI_VERB ("HelpAbout", verb_DoNothing),
447 + BONOBO_UI_VERB ("Help", verb_DoNothing),
448 + BONOBO_UI_VERB ("DnDNewWindow", verb_DoNothing),
449 + BONOBO_UI_VERB ("DnDSameWindow", verb_DoNothing),
450 + BONOBO_UI_VERB ("DnDCancel", verb_DoNothing),
455 +add_control_to_ui (BonoboWindow *window, Bonobo_Control control)
457 + CORBA_Environment ev;
458 + Bonobo_PropertyControl prop_control;
459 + BonoboUIContainer *ui_container;
462 + g_return_if_fail (window != NULL);
463 + g_return_if_fail (BONOBO_IS_WINDOW (window));
465 + CORBA_exception_init (&ev);
467 + ui_container = bonobo_window_get_ui_container (BONOBO_WINDOW (window));
468 + ctrl_frame = bonobo_control_frame_new (BONOBO_OBJREF (ui_container));
470 + /* bind and view new control widget */
471 + bonobo_control_frame_bind_to_control (ctrl_frame, control, &ev);
472 + bonobo_control_frame_control_activate (ctrl_frame);
473 + if (control != CORBA_OBJECT_NIL && ctrl_widget == NULL) {
474 + ctrl_widget = bonobo_control_frame_get_widget (ctrl_frame);
476 + g_assert_not_reached ();
478 + bonobo_window_set_contents (BONOBO_WINDOW(window), GTK_WIDGET(ctrl_widget));
479 + gtk_widget_show (ctrl_widget);
482 + ui_comp = bonobo_ui_component_new ("vim-container");
483 + bonobo_ui_component_set_container (ui_comp, BONOBO_OBJREF (ui_container), NULL);
485 + curdir = (char *)getcwd(NULL, 0);
486 + bonobo_ui_util_set_ui (ui_comp, curdir, "vim-container.xml", "Vim", NULL);
488 + bonobo_ui_component_add_verb_list_with_data (ui_comp, app_verbs, window);
490 + /* update sensitivity of the properties menu item */
491 + prop_control = Bonobo_Unknown_queryInterface (control,
492 + "IDL:Bonobo/PropertyControl:1.0", &ev);
493 + bonobo_ui_component_set_prop (ui_comp,
494 + "/commands/Preferences",
496 + prop_control == CORBA_OBJECT_NIL ? "0" : "1",
499 + bonobo_object_release_unref (prop_control, &ev);
501 + /* enable view menu */
502 + /* FIXME: We should check if the component adds anything to
503 + * the menu, so that we don't view an empty menu.
505 + /*bonobo_ui_component_set_prop (ui_comp, "/menu/View", "hidden", "0", &ev);*/
507 + CORBA_exception_free (&ev);
509 + /* retrieve control properties and install listeners */
510 + //check_for_control_properties (window);
513 +static void write_stream_to_file(Bonobo_Control control)
515 + Bonobo_Storage storage;
518 + CORBA_Environment ev;
519 + Bonobo_PersistStream pstream;
520 + Bonobo_Stream stream;
522 + g_warning("write stream to file!");
523 + CORBA_exception_init (&ev);
525 + dirname = g_path_get_dirname(filename);
526 + storage = bonobo_get_object(dirname, "IDL:Bonobo/Storage:1.0", &ev);
528 + if (BONOBO_EX (&ev) || (storage == CORBA_OBJECT_NIL))
530 + CORBA_exception_free (&ev);
534 + pstream = Bonobo_Unknown_queryInterface (control, "IDL:Bonobo/PersistStream:1.0", &ev);
535 + if (BONOBO_EX (&ev) || (pstream == CORBA_OBJECT_NIL))
537 + bonobo_object_release_unref(storage, NULL);
538 + CORBA_exception_free (&ev);
542 + basename = g_path_get_basename(filename);
543 + stream = Bonobo_Storage_openStream(storage, basename, Bonobo_Storage_WRITE, &ev );
545 + if (BONOBO_EX (&ev) || (stream == CORBA_OBJECT_NIL))
547 + bonobo_object_release_unref(pstream, NULL);
548 + bonobo_object_release_unref(storage, NULL);
549 + CORBA_exception_free (&ev);
553 + Bonobo_PersistStream_save (pstream, stream, "text/plain", &ev);
554 + if (ev._major != CORBA_NO_EXCEPTION) {
555 + g_warning("Error saving stream!");
556 + bonobo_object_unref (BONOBO_OBJECT (stream));
557 + bonobo_object_release_unref(pstream, NULL);
558 + bonobo_object_release_unref(storage, NULL);
559 + CORBA_exception_free (&ev);
562 + bonobo_object_release_unref(stream, NULL);
563 + bonobo_object_release_unref(pstream, NULL);
564 + bonobo_object_release_unref(storage, NULL);
569 +window_destroyed (GtkWindow *window, char * data)
571 + Bonobo_Control control;
573 + control = bonobo_control_frame_get_control(ctrl_frame);
574 + write_stream_to_file(control);
575 + bonobo_control_frame_control_deactivate(ctrl_frame);
576 + bonobo_object_release_unref( control, NULL );
577 + bonobo_main_quit();
580 +int main(int argc, char * argv[] )
583 + BonoboWindow *window;
584 + BonoboUIEngine *engine;
585 + BonoboUIContainer *container;
586 + Bonobo_Control control;
590 + fprintf(stderr, "%s: not enough args\n", argv[0] );
591 + fprintf(stderr, "Usage: %s <text file>\n", argv[0]);
594 + cwd = g_get_current_dir();
595 + filename = g_build_filename( "file:", cwd, argv[1], NULL );
598 + bonobo_ui_init ("container", "1.0", &argc, argv);
600 + if(gnome_vfs_init () == FALSE)
601 + g_error (_("Could not initialize GnomeVFS!\n"));
603 + window = BONOBO_WINDOW ( bonobo_window_new ("Window", "Vim Test Container"));
605 + // instantiate a control
606 + control = instantiate_control();
607 + if( control == NULL )
610 + // put it into our window
611 + add_control_to_ui (window, control);
613 + g_signal_connect (window, "destroy",
614 + G_CALLBACK (window_destroyed),
618 + gtk_widget_show_all( GTK_WIDGET( window ));
624 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/ex_cmds2.c vim/src/ex_cmds2.c
625 --- vimcopy/src/ex_cmds2.c Sat Jan 10 13:10:01 2004
626 +++ vim/src/ex_cmds2.c Sat Jan 10 13:06:40 2004
629 int allbuf; /* may write all buffers */
631 +#ifdef FEAT_GUI_COMPONENT
632 + if ( buf->emb_buffer ) {
633 + EMSG(_("E467: Cannot close embedded file"));
639 && (mult_win || buf->b_nwindows <= 1)
640 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/ex_docmd.c vim/src/ex_docmd.c
641 --- vimcopy/src/ex_docmd.c Sat Jan 10 13:10:01 2004
642 +++ vim/src/ex_docmd.c Sat Jan 10 13:06:41 2004
643 @@ -5413,8 +5413,13 @@
647 +#ifdef FEAT_GUI_COMPONENT
648 + EMSG(_(e_compnoquit));
653 - if (only_one_window()) /* quit last window */
654 + if (only_one_window()) /* quit last window */
658 @@ -5435,8 +5440,12 @@
662 +#ifdef FEAT_GUI_COMPONENT
663 + EMSG(_(e_compnoquit));
666 getout(1); /* this does not always pass on the exit code to the Manx
672 @@ -5456,6 +5465,10 @@
676 +#ifdef FEAT_GUI_COMPONENT
677 + EMSG(_(e_compnoquit));
681 if (eap->forceit || !check_changed_any(FALSE))
683 @@ -5650,8 +5663,13 @@
687 +#ifdef FEAT_GUI_COMPONENT
688 + EMSG(_(e_compnoquit));
693 - if (only_one_window()) /* quit last window, exit Vim */
694 + if ( only_one_window()) /* quit last window, exit Vim */
698 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/fileio.c vim/src/fileio.c
699 --- vimcopy/src/fileio.c Sat Jan 10 13:10:01 2004
700 +++ vim/src/fileio.c Sat Jan 10 13:06:42 2004
702 # define CRYPT_MAGIC_LEN 12 /* must be multiple of 4! */
705 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
706 +#include "vim_bonobo_control.h"
709 /* Is there any system that doesn't have access()? */
710 #ifndef MACOS_CLASSIC /* Not available on MacOS 9 */
711 # define USE_MCH_ACCESS
713 * READ_BUFFER read from curbuf instead of a file (converting after reading
715 * READ_DUMMY read into a dummy buffer (to check if file contents changed)
716 + * READ_EMB_STREAM read from a bonobo persist stream
718 * return FAIL for failure, OK otherwise
721 int filtering = (flags & READ_FILTER);
722 int read_stdin = (flags & READ_STDIN);
723 int read_buffer = (flags & READ_BUFFER);
724 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
725 + int read_pstream = (flags & READ_EMB_STREAM);
727 +#define read_pstream 0
729 linenr_T read_buf_lnum = 1; /* next line to read from curbuf */
730 colnr_T read_buf_col = 0; /* next char to read from this line */
733 * The BufReadCmd and FileReadCmd events intercept the reading process by
734 * executing the associated commands instead.
736 - if (!filtering && !read_stdin && !read_buffer)
737 + if (!filtering && !read_stdin && !read_buffer && !read_pstream)
742 * On Unix it is possible to read a directory, so we have to
743 * check for it before the mch_open().
745 - if (!read_stdin && !read_buffer)
746 + if (!read_stdin && !read_buffer && !read_pstream)
748 perm = mch_getperm(fname);
749 if (perm >= 0 && !S_ISREG(perm) /* not a regular file ... */
751 if (check_readonly && !readonlymode) /* default: set file not readonly */
752 curbuf->b_p_ro = FALSE;
754 - if (newfile && !read_stdin && !read_buffer)
755 + if (newfile && !read_stdin && !read_buffer && !read_pstream)
757 /* Remember time of file.
758 * For RISCOS, also remember the filetype.
760 setmode(0, O_BINARY);
763 +#ifdef FEAT_GUI_COMPONENT
764 + else if (read_pstream)
768 else if (!read_buffer)
770 #ifdef USE_MCH_ACCESS
772 /* If "Quit" selected at ATTENTION dialog, don't load the file */
773 if (swap_exists_action == SEA_QUIT)
775 - if (!read_buffer && !read_stdin)
776 + if (!read_buffer && !read_stdin && !read_pstream)
781 * The file must be closed again, the autocommands may want to change
782 * the file before reading it.
785 + if (!read_stdin && !read_pstream)
786 close(fd); /* ignore errors */
790 * Don't allow the autocommands to change the current buffer.
791 * Try to re-open the file.
793 - if (!read_stdin && (curbuf != old_curbuf
794 + if (!read_stdin && !read_pstream && (curbuf != old_curbuf
795 || (fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0)) < 0))
802 - else if (!read_buffer)
803 + else if (!read_buffer && !read_pstream)
804 filemess(curbuf, sfname, (char_u *)"", 0);
811 - else if (read_stdin || lseek(fd, (off_t)0L, SEEK_SET) != 0)
812 + else if (read_stdin || read_pstream || lseek(fd, (off_t)0L, SEEK_SET) != 0)
814 /* Can't rewind the file, give up. */
817 * Use the 'charconvert' expression when conversion is required
818 * and we can't do it internally or with iconv().
820 - if (fio_flags == 0 && !read_stdin && !read_buffer && *p_ccv != NUL
821 + if (fio_flags == 0 && !read_stdin && !read_buffer && !read_pstream && *p_ccv != NUL
823 && iconv_fd == (iconv_t)-1
826 /* Set can_retry when it's possible to rewind the file and try with
827 * another "fenc" value. It's FALSE when no other "fenc" to try, reading
828 * stdin or "fenc" was specified with "++enc=". */
829 - can_retry = (*fenc != NUL && !read_stdin
830 + can_retry = (*fenc != NUL && !read_stdin && !read_pstream
831 && (eap == NULL || eap->force_enc == 0));
834 @@ -1141,6 +1156,11 @@
838 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
839 + else if( read_pstream ) {
840 + size = vim_control_persist_stream_read(ptr, size);
846 @@ -1734,7 +1754,7 @@
847 else if (ff_error != EOL_DOS)
851 + && !read_stdin && !read_pstream
853 || lseek(fd, (off_t)0L, SEEK_SET) == 0))
855 @@ -1823,7 +1843,7 @@
859 - if (!read_buffer && !read_stdin)
860 + if (!read_buffer && !read_stdin && !read_pstream)
861 close(fd); /* errors are ignored */
864 @@ -2012,7 +2032,7 @@
865 #ifdef ALWAYS_USE_GUI
866 /* Don't show the message when reading stdin, it would end up in a
867 * message box (which might be shown when exiting!) */
868 - if (read_stdin || read_buffer)
869 + if (read_stdin || read_buffer )
870 p = msg_may_trunc(FALSE, IObuff);
873 @@ -2078,7 +2098,7 @@
875 write_no_eol_lnum = read_no_eol_lnum;
877 - if (!read_stdin && !read_buffer)
878 + if (!read_stdin && !read_buffer && !read_pstream)
881 int n = msg_scrolled;
882 @@ -2404,6 +2424,11 @@
883 int prev_got_int = got_int;
884 int file_readonly = FALSE; /* overwritten file is read-only */
885 static char *err_readonly = "is read-only (cannot override: \"W\" in 'cpoptions')";
886 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
887 + int write_pstream = write_to_container;
889 +#define write_pstream 0
891 #if defined(UNIX) || defined(__EMX__XX) /*XXX fix me sometime? */
892 int made_writable = FALSE; /* 'w' bit has been set */
894 @@ -2747,7 +2772,7 @@
898 - if (!device && !newfile)
899 + if (!device && !newfile && !write_pstream )
902 * Check if the file is really writable (when renaming the file to
903 @@ -2806,6 +2831,10 @@
904 if (dobackup && *p_bsk != NUL && match_file_list(p_bsk, sfname, ffname))
907 +#ifdef FEAT_GUI_COMPONENT
908 + if( write_pstream )
913 * Save the value of got_int and reset it. We don't want a previous
914 @@ -3421,95 +3450,97 @@
915 * (this may happen when the user reached his quotum for number of files).
916 * Appending will fail if the file does not exist and forceit is FALSE.
918 - while ((fd = mch_open((char *)wfname, O_WRONLY | O_EXTRA | (append
919 - ? (forceit ? (O_APPEND | O_CREAT) : O_APPEND)
920 - : (O_CREAT | O_TRUNC))
924 - * A forced write will try to create a new file if the old one is
925 - * still readonly. This may also happen when the directory is
926 - * read-only. In that case the mch_remove() will fail.
928 - if (errmsg == NULL)
930 + if (!write_pstream) {
931 + while ((fd = mch_open((char *)wfname, O_WRONLY | O_EXTRA | (append
932 + ? (forceit ? (O_APPEND | O_CREAT) : O_APPEND)
933 + : (O_CREAT | O_TRUNC))
937 + * A forced write will try to create a new file if the old one is
938 + * still readonly. This may also happen when the directory is
939 + * read-only. In that case the mch_remove() will fail.
941 + if (errmsg == NULL)
947 - /* Don't delete the file when it's a hard or symbolic link. */
948 - if ((!newfile && st_old.st_nlink > 1)
949 - || (mch_lstat((char *)fname, &st) == 0
950 - && (st.st_dev != st_old.st_dev
951 - || st.st_ino != st_old.st_ino)))
952 - errmsg = (char_u *)_("E166: Can't open linked file for writing");
956 - errmsg = (char_u *)_("E212: Can't open file for writing");
957 - if (forceit && vim_strchr(p_cpo, CPO_FWRITE) == NULL
960 + /* Don't delete the file when it's a hard or symbolic link. */
961 + if ((!newfile && st_old.st_nlink > 1)
962 + || (mch_lstat((char *)fname, &st) == 0
963 + && (st.st_dev != st_old.st_dev
964 + || st.st_ino != st_old.st_ino)))
965 + errmsg = (char_u *)_("E166: Can't open linked file for writing");
969 + errmsg = (char_u *)_("E212: Can't open file for writing");
970 + if (forceit && vim_strchr(p_cpo, CPO_FWRITE) == NULL
974 - /* we write to the file, thus it should be marked
975 - writable after all */
976 - if (!(perm & 0200))
977 - made_writable = TRUE;
979 - if (st_old.st_uid != getuid() || st_old.st_gid != getgid())
982 - if (!append) /* don't remove when appending */
983 - mch_remove(wfname);
994 - * If we failed to open the file, we don't need a backup. Throw it
995 - * away. If we moved or removed the original file try to put the
996 - * backup in its place.
998 - if (backup != NULL && wfname == fname)
1003 - * There is a small chance that we removed the original,
1004 - * try to move the copy in its place.
1005 - * This may not work if the vim_rename() fails.
1006 - * In that case we leave the copy around.
1008 - /* If file does not exist, put the copy in its place */
1009 - if (mch_stat((char *)fname, &st) < 0)
1010 - vim_rename(backup, fname);
1011 - /* if original file does exist throw away the copy */
1012 - if (mch_stat((char *)fname, &st) >= 0)
1013 - mch_remove(backup);
1017 - /* try to put the original file back */
1018 - vim_rename(backup, fname);
1022 - /* if original file no longer exists give an extra warning */
1023 - if (!newfile && mch_stat((char *)fname, &st) < 0)
1026 + /* we write to the file, thus it should be marked
1027 + writable after all */
1028 + if (!(perm & 0200))
1029 + made_writable = TRUE;
1031 + if (st_old.st_uid != getuid() || st_old.st_gid != getgid())
1034 + if (!append) /* don't remove when appending */
1035 + mch_remove(wfname);
1046 + * If we failed to open the file, we don't need a backup. Throw it
1047 + * away. If we moved or removed the original file try to put the
1048 + * backup in its place.
1050 + if (backup != NULL && wfname == fname)
1055 + * There is a small chance that we removed the original,
1056 + * try to move the copy in its place.
1057 + * This may not work if the vim_rename() fails.
1058 + * In that case we leave the copy around.
1060 + /* If file does not exist, put the copy in its place */
1061 + if (mch_stat((char *)fname, &st) < 0)
1062 + vim_rename(backup, fname);
1063 + /* if original file does exist throw away the copy */
1064 + if (mch_stat((char *)fname, &st) >= 0)
1065 + mch_remove(backup);
1069 + /* try to put the original file back */
1070 + vim_rename(backup, fname);
1074 + /* if original file no longer exists give an extra warning */
1075 + if (!newfile && mch_stat((char *)fname, &st) < 0)
1080 - if (wfname != fname)
1082 + if (wfname != fname)
1092 #if defined(MACOS_CLASSIC) || defined(WIN3264)
1093 /* TODO: Is it need for MACOS_X? (Dany) */
1094 @@ -3693,7 +3724,7 @@
1098 - if (close(fd) != 0)
1099 + if (!write_pstream && close(fd) != 0)
1101 errmsg = (char_u *)_("E512: Close failed");
1103 @@ -4111,6 +4142,10 @@
1107 +#ifdef FEAT_GUI_COMPONENT
1108 + if (buf->emb_buffer)
1109 + fname = (char_u *)"[Embedded File]";
1112 fname = (char_u *)"-stdin-";
1113 home_replace(buf, fname, IObuff + 1, IOSIZE - 4, TRUE);
1114 @@ -4499,7 +4534,12 @@
1115 /* Repeat the write(), it may be interrupted by a signal. */
1118 - wlen = vim_write(ip->bw_fd, buf, len);
1119 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
1120 + if( write_to_container )
1121 + wlen = vim_control_persist_stream_write(buf, len);
1124 + wlen = vim_write(ip->bw_fd, buf, len);
1125 if (wlen <= 0) /* error! */
1128 @@ -6086,6 +6126,7 @@
1129 {"BufWriteCmd", EVENT_BUFWRITECMD},
1130 {"CmdwinEnter", EVENT_CMDWINENTER},
1131 {"CmdwinLeave", EVENT_CMDWINLEAVE},
1132 + {"EmbeddingOn", EVENT_EMBEDDED_COMPONENT},
1133 {"EncodingChanged", EVENT_ENCODINGCHANGED},
1134 {"FileEncoding", EVENT_ENCODINGCHANGED},
1135 {"CursorHold", EVENT_CURSORHOLD},
1136 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/globals.h vim/src/globals.h
1137 --- vimcopy/src/globals.h Sat Jan 10 13:10:01 2004
1138 +++ vim/src/globals.h Sat Jan 10 13:06:42 2004
1139 @@ -802,6 +802,12 @@
1140 EXTERN int readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
1141 EXTERN int recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
1143 +#ifdef FEAT_GUI_COMPONENT
1144 +EXTERN int read_from_container INIT(= 0); /* read the buffer from the container app */
1145 +EXTERN int write_to_container INIT(= 0); /* write the buffer to the container app */
1146 +EXTERN buf_T *persistent_buffer INIT(= NULL); /* the buffer which the container is interested in */
1149 EXTERN struct buffheader stuffbuff /* stuff buffer */
1151 = {{NULL, {NUL}}, NULL, 0, 0}
1152 @@ -1322,6 +1328,9 @@
1154 #ifdef FEAT_NETBEANS_INTG
1155 EXTERN char_u e_guarded[] INIT(=N_("E463: Region is guarded, cannot modify"));
1157 +#ifdef FEAT_GUI_COMPONENT
1158 +EXTERN char_u e_compnoquit[] INIT(=N_("E464: Quit not allowed from embedded component"));
1161 EXTERN short disallow_gui INIT(= FALSE);
1162 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml.h vim/src/gtkhtml.h
1163 --- vimcopy/src/gtkhtml.h Wed Dec 31 18:00:00 1969
1164 +++ vim/src/gtkhtml.h Sat Jul 26 13:16:47 2003
1167 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
1173 +#define ORBIT_IDL_SERIAL 19
1174 +#include <orbit/orbit-types.h>
1179 +#endif /* __cplusplus */
1182 +#include <bonobo/Bonobo.h>
1183 +#if !defined(ORBIT_DECL_GNOME_GtkHTML_Editor_Listener) && !defined(_GNOME_GtkHTML_Editor_Listener_defined)
1184 +#define ORBIT_DECL_GNOME_GtkHTML_Editor_Listener 1
1185 +#define _GNOME_GtkHTML_Editor_Listener_defined 1
1186 +#define GNOME_GtkHTML_Editor_Listener__freekids CORBA_Object__freekids
1187 + typedef CORBA_Object GNOME_GtkHTML_Editor_Listener;
1188 + extern CORBA_unsigned_long GNOME_GtkHTML_Editor_Listener__classid;
1189 +#if !defined(TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_0)
1190 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_0 'E'
1191 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_1 'd'
1192 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_2 'i'
1193 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_3 't'
1194 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_4 'o'
1195 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_5 'r'
1196 +#ifdef ORBIT_IDL_C_IMODULE
1201 + const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Listener_struct;
1202 +#define TC_GNOME_GtkHTML_Editor_Listener ((CORBA_TypeCode)&TC_GNOME_GtkHTML_Editor_Listener_struct)
1205 +#if !defined(ORBIT_DECL_GNOME_GtkHTML_Editor_Engine) && !defined(_GNOME_GtkHTML_Editor_Engine_defined)
1206 +#define ORBIT_DECL_GNOME_GtkHTML_Editor_Engine 1
1207 +#define _GNOME_GtkHTML_Editor_Engine_defined 1
1208 +#define GNOME_GtkHTML_Editor_Engine__freekids CORBA_Object__freekids
1209 + typedef CORBA_Object GNOME_GtkHTML_Editor_Engine;
1210 + extern CORBA_unsigned_long GNOME_GtkHTML_Editor_Engine__classid;
1211 +#if !defined(TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_0)
1212 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_0 'E'
1213 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_1 'd'
1214 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_2 'i'
1215 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_3 't'
1216 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_4 'o'
1217 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_5 'r'
1218 +#ifdef ORBIT_IDL_C_IMODULE
1223 + const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Engine_struct;
1224 +#define TC_GNOME_GtkHTML_Editor_Engine ((CORBA_TypeCode)&TC_GNOME_GtkHTML_Editor_Engine_struct)
1227 +#if !defined(_GNOME_GtkHTML_Editor_URLRequestEvent_defined)
1228 +#define _GNOME_GtkHTML_Editor_URLRequestEvent_defined 1
1229 + typedef struct GNOME_GtkHTML_Editor_URLRequestEvent_type
1230 + GNOME_GtkHTML_Editor_URLRequestEvent;
1231 + struct GNOME_GtkHTML_Editor_URLRequestEvent_type
1234 + Bonobo_Stream stream;
1237 +#if !defined(TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_0)
1238 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_0 'E'
1239 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_1 'd'
1240 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_2 'i'
1241 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_3 't'
1242 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_4 'o'
1243 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_5 'r'
1244 +#ifdef ORBIT_IDL_C_IMODULE
1249 + const struct CORBA_TypeCode_struct
1250 + TC_GNOME_GtkHTML_Editor_URLRequestEvent_struct;
1251 +#define TC_GNOME_GtkHTML_Editor_URLRequestEvent ((CORBA_TypeCode)&TC_GNOME_GtkHTML_Editor_URLRequestEvent_struct)
1253 +#define GNOME_GtkHTML_Editor_URLRequestEvent__alloc() ((GNOME_GtkHTML_Editor_URLRequestEvent *)ORBit_small_alloc (TC_GNOME_GtkHTML_Editor_URLRequestEvent))
1254 +#define GNOME_GtkHTML_Editor_URLRequestEvent__freekids(m,d) ORBit_small_freekids (TC_GNOME_GtkHTML_Editor_URLRequestEvent,(m),(d))
1257 +/** POA structures **/
1258 +#ifndef _defined_POA_GNOME_GtkHTML_Editor_Listener
1259 +#define _defined_POA_GNOME_GtkHTML_Editor_Listener 1
1263 + CORBA_any *(*event) (PortableServer_Servant _servant,
1264 + const CORBA_char * name, const CORBA_any * arg,
1265 + CORBA_Environment * ev);
1267 + POA_GNOME_GtkHTML_Editor_Listener__epv;
1270 + PortableServer_ServantBase__epv *_base_epv;
1271 + POA_Bonobo_Unknown__epv *Bonobo_Unknown_epv;
1272 + POA_GNOME_GtkHTML_Editor_Listener__epv
1273 + *GNOME_GtkHTML_Editor_Listener_epv;
1275 + POA_GNOME_GtkHTML_Editor_Listener__vepv;
1279 + POA_GNOME_GtkHTML_Editor_Listener__vepv *vepv;
1281 + POA_GNOME_GtkHTML_Editor_Listener;
1282 + extern void POA_GNOME_GtkHTML_Editor_Listener__init(PortableServer_Servant
1284 + CORBA_Environment *
1286 + extern void POA_GNOME_GtkHTML_Editor_Listener__fini(PortableServer_Servant
1288 + CORBA_Environment *
1290 +#endif /* _defined_POA_GNOME_GtkHTML_Editor_Listener */
1291 +#ifndef _defined_POA_GNOME_GtkHTML_Editor_Engine
1292 +#define _defined_POA_GNOME_GtkHTML_Editor_Engine 1
1296 + GNOME_GtkHTML_Editor_Listener(*_get_listener) (PortableServer_Servant
1298 + CORBA_Environment * ev);
1299 + void (*_set_listener) (PortableServer_Servant _servant,
1300 + const GNOME_GtkHTML_Editor_Listener value,
1301 + CORBA_Environment * ev);
1302 + CORBA_boolean(*runCommand) (PortableServer_Servant _servant,
1303 + const CORBA_char * command,
1304 + CORBA_Environment * ev);
1305 + CORBA_string(*getParagraphData) (PortableServer_Servant _servant,
1306 + const CORBA_char * key,
1307 + CORBA_Environment * ev);
1308 + void (*setParagraphData) (PortableServer_Servant _servant,
1309 + const CORBA_char * key,
1310 + const CORBA_char * value,
1311 + CORBA_Environment * ev);
1312 + void (*setObjectDataByType) (PortableServer_Servant _servant,
1313 + const CORBA_char * type_name,
1314 + const CORBA_char * key,
1315 + const CORBA_char * data,
1316 + CORBA_Environment * ev);
1317 + CORBA_boolean(*searchByData) (PortableServer_Servant _servant,
1318 + const CORBA_long level,
1319 + const CORBA_char * klass,
1320 + const CORBA_char * key,
1321 + const CORBA_char * value,
1322 + CORBA_Environment * ev);
1323 + CORBA_boolean(*isParagraphEmpty) (PortableServer_Servant _servant,
1324 + CORBA_Environment * ev);
1325 + CORBA_boolean(*isPreviousParagraphEmpty) (PortableServer_Servant
1327 + CORBA_Environment * ev);
1328 + void (*insertHTML) (PortableServer_Servant _servant,
1329 + const CORBA_char * html, CORBA_Environment * ev);
1330 + void (*freeze) (PortableServer_Servant _servant,
1331 + CORBA_Environment * ev);
1332 + void (*thaw) (PortableServer_Servant _servant, CORBA_Environment * ev);
1333 + void (*undoBegin) (PortableServer_Servant _servant,
1334 + const CORBA_char * undo_name,
1335 + const CORBA_char * redo_name,
1336 + CORBA_Environment * ev);
1337 + void (*undoEnd) (PortableServer_Servant _servant,
1338 + CORBA_Environment * ev);
1339 + void (*ignoreWord) (PortableServer_Servant _servant,
1340 + const CORBA_char * word, CORBA_Environment * ev);
1341 + void (*dropUndo) (PortableServer_Servant _servant,
1342 + CORBA_Environment * ev);
1343 + CORBA_boolean(*hasUndo) (PortableServer_Servant _servant,
1344 + CORBA_Environment * ev);
1346 + POA_GNOME_GtkHTML_Editor_Engine__epv;
1349 + PortableServer_ServantBase__epv *_base_epv;
1350 + POA_Bonobo_Unknown__epv *Bonobo_Unknown_epv;
1351 + POA_GNOME_GtkHTML_Editor_Engine__epv *GNOME_GtkHTML_Editor_Engine_epv;
1353 + POA_GNOME_GtkHTML_Editor_Engine__vepv;
1357 + POA_GNOME_GtkHTML_Editor_Engine__vepv *vepv;
1359 + POA_GNOME_GtkHTML_Editor_Engine;
1360 + extern void POA_GNOME_GtkHTML_Editor_Engine__init(PortableServer_Servant
1362 + CORBA_Environment * ev);
1363 + extern void POA_GNOME_GtkHTML_Editor_Engine__fini(PortableServer_Servant
1365 + CORBA_Environment * ev);
1366 +#endif /* _defined_POA_GNOME_GtkHTML_Editor_Engine */
1368 +/** skel prototypes **/
1370 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Listener_event
1371 + (POA_GNOME_GtkHTML_Editor_Listener * _ORBIT_servant,
1372 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1373 + CORBA_Environment * ev,
1374 + CORBA_any * (*_impl_event) (PortableServer_Servant _servant,
1375 + const CORBA_char * name,
1376 + const CORBA_any * arg,
1377 + CORBA_Environment * ev));
1379 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__get_listener
1380 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1381 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1382 + CORBA_Environment * ev,
1383 + GNOME_GtkHTML_Editor_Listener(*_impl__get_listener)
1384 + (PortableServer_Servant _servant, CORBA_Environment * ev));
1386 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__set_listener
1387 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1388 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1389 + CORBA_Environment * ev,
1390 + void (*_impl__set_listener) (PortableServer_Servant _servant,
1391 + const GNOME_GtkHTML_Editor_Listener value,
1392 + CORBA_Environment * ev));
1394 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_runCommand
1395 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1396 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1397 + CORBA_Environment * ev,
1398 + CORBA_boolean(*_impl_runCommand) (PortableServer_Servant _servant,
1399 + const CORBA_char * command,
1400 + CORBA_Environment * ev));
1402 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_getParagraphData
1403 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1404 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1405 + CORBA_Environment * ev,
1406 + CORBA_string(*_impl_getParagraphData) (PortableServer_Servant _servant,
1407 + const CORBA_char * key,
1408 + CORBA_Environment * ev));
1410 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setParagraphData
1411 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1412 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1413 + CORBA_Environment * ev,
1414 + void (*_impl_setParagraphData) (PortableServer_Servant _servant,
1415 + const CORBA_char * key,
1416 + const CORBA_char * value,
1417 + CORBA_Environment * ev));
1419 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setObjectDataByType
1420 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1421 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1422 + CORBA_Environment * ev,
1423 + void (*_impl_setObjectDataByType) (PortableServer_Servant _servant,
1424 + const CORBA_char * type_name,
1425 + const CORBA_char * key,
1426 + const CORBA_char * data,
1427 + CORBA_Environment * ev));
1429 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_searchByData
1430 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1431 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1432 + CORBA_Environment * ev,
1433 + CORBA_boolean(*_impl_searchByData) (PortableServer_Servant _servant,
1434 + const CORBA_long level,
1435 + const CORBA_char * klass,
1436 + const CORBA_char * key,
1437 + const CORBA_char * value,
1438 + CORBA_Environment * ev));
1440 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isParagraphEmpty
1441 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1442 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1443 + CORBA_Environment * ev,
1444 + CORBA_boolean(*_impl_isParagraphEmpty) (PortableServer_Servant
1446 + CORBA_Environment * ev));
1448 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
1449 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1450 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1451 + CORBA_Environment * ev,
1452 + CORBA_boolean(*_impl_isPreviousParagraphEmpty) (PortableServer_Servant
1454 + CORBA_Environment *
1457 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_insertHTML
1458 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1459 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1460 + CORBA_Environment * ev,
1461 + void (*_impl_insertHTML) (PortableServer_Servant _servant,
1462 + const CORBA_char * html,
1463 + CORBA_Environment * ev));
1465 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_freeze
1466 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1467 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1468 + CORBA_Environment * ev,
1469 + void (*_impl_freeze) (PortableServer_Servant _servant,
1470 + CORBA_Environment * ev));
1472 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_thaw
1473 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1474 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1475 + CORBA_Environment * ev,
1476 + void (*_impl_thaw) (PortableServer_Servant _servant,
1477 + CORBA_Environment * ev));
1479 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoBegin
1480 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1481 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1482 + CORBA_Environment * ev,
1483 + void (*_impl_undoBegin) (PortableServer_Servant _servant,
1484 + const CORBA_char * undo_name,
1485 + const CORBA_char * redo_name,
1486 + CORBA_Environment * ev));
1488 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoEnd
1489 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1490 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1491 + CORBA_Environment * ev,
1492 + void (*_impl_undoEnd) (PortableServer_Servant _servant,
1493 + CORBA_Environment * ev));
1495 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_ignoreWord
1496 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1497 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1498 + CORBA_Environment * ev,
1499 + void (*_impl_ignoreWord) (PortableServer_Servant _servant,
1500 + const CORBA_char * word,
1501 + CORBA_Environment * ev));
1503 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_dropUndo
1504 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1505 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1506 + CORBA_Environment * ev,
1507 + void (*_impl_dropUndo) (PortableServer_Servant _servant,
1508 + CORBA_Environment * ev));
1510 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_hasUndo
1511 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1512 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1513 + CORBA_Environment * ev,
1514 + CORBA_boolean(*_impl_hasUndo) (PortableServer_Servant _servant,
1515 + CORBA_Environment * ev));
1517 +/** stub prototypes **/
1518 +#define GNOME_GtkHTML_Editor_Listener_ref Bonobo_Unknown_ref
1519 +#define GNOME_GtkHTML_Editor_Listener_unref Bonobo_Unknown_unref
1520 +#define GNOME_GtkHTML_Editor_Listener_queryInterface Bonobo_Unknown_queryInterface
1522 + *GNOME_GtkHTML_Editor_Listener_event(GNOME_GtkHTML_Editor_Listener _obj,
1523 + const CORBA_char * name,
1524 + const CORBA_any * arg,
1525 + CORBA_Environment * ev);
1526 +#define GNOME_GtkHTML_Editor_Engine_ref Bonobo_Unknown_ref
1527 +#define GNOME_GtkHTML_Editor_Engine_unref Bonobo_Unknown_unref
1528 +#define GNOME_GtkHTML_Editor_Engine_queryInterface Bonobo_Unknown_queryInterface
1529 + GNOME_GtkHTML_Editor_Listener
1530 + GNOME_GtkHTML_Editor_Engine__get_listener(GNOME_GtkHTML_Editor_Engine
1531 + _obj, CORBA_Environment * ev);
1532 + void GNOME_GtkHTML_Editor_Engine__set_listener(GNOME_GtkHTML_Editor_Engine
1535 + GNOME_GtkHTML_Editor_Listener
1537 + CORBA_Environment * ev);
1539 + GNOME_GtkHTML_Editor_Engine_runCommand(GNOME_GtkHTML_Editor_Engine _obj,
1540 + const CORBA_char * command,
1541 + CORBA_Environment * ev);
1543 + GNOME_GtkHTML_Editor_Engine_getParagraphData(GNOME_GtkHTML_Editor_Engine
1545 + const CORBA_char * key,
1546 + CORBA_Environment * ev);
1548 + GNOME_GtkHTML_Editor_Engine_setParagraphData(GNOME_GtkHTML_Editor_Engine
1550 + const CORBA_char * key,
1551 + const CORBA_char * value,
1552 + CORBA_Environment * ev);
1554 + GNOME_GtkHTML_Editor_Engine_setObjectDataByType
1555 + (GNOME_GtkHTML_Editor_Engine _obj, const CORBA_char * type_name,
1556 + const CORBA_char * key, const CORBA_char * data,
1557 + CORBA_Environment * ev);
1559 + GNOME_GtkHTML_Editor_Engine_searchByData(GNOME_GtkHTML_Editor_Engine
1560 + _obj, const CORBA_long level,
1561 + const CORBA_char * klass,
1562 + const CORBA_char * key,
1563 + const CORBA_char * value,
1564 + CORBA_Environment * ev);
1566 + GNOME_GtkHTML_Editor_Engine_isParagraphEmpty(GNOME_GtkHTML_Editor_Engine
1568 + CORBA_Environment * ev);
1570 + GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
1571 + (GNOME_GtkHTML_Editor_Engine _obj, CORBA_Environment * ev);
1572 + void GNOME_GtkHTML_Editor_Engine_insertHTML(GNOME_GtkHTML_Editor_Engine
1573 + _obj, const CORBA_char * html,
1574 + CORBA_Environment * ev);
1575 + void GNOME_GtkHTML_Editor_Engine_freeze(GNOME_GtkHTML_Editor_Engine _obj,
1576 + CORBA_Environment * ev);
1577 + void GNOME_GtkHTML_Editor_Engine_thaw(GNOME_GtkHTML_Editor_Engine _obj,
1578 + CORBA_Environment * ev);
1579 + void GNOME_GtkHTML_Editor_Engine_undoBegin(GNOME_GtkHTML_Editor_Engine
1581 + const CORBA_char * undo_name,
1582 + const CORBA_char * redo_name,
1583 + CORBA_Environment * ev);
1584 + void GNOME_GtkHTML_Editor_Engine_undoEnd(GNOME_GtkHTML_Editor_Engine _obj,
1585 + CORBA_Environment * ev);
1586 + void GNOME_GtkHTML_Editor_Engine_ignoreWord(GNOME_GtkHTML_Editor_Engine
1587 + _obj, const CORBA_char * word,
1588 + CORBA_Environment * ev);
1589 + void GNOME_GtkHTML_Editor_Engine_dropUndo(GNOME_GtkHTML_Editor_Engine _obj,
1590 + CORBA_Environment * ev);
1592 + GNOME_GtkHTML_Editor_Engine_hasUndo(GNOME_GtkHTML_Editor_Engine _obj,
1593 + CORBA_Environment * ev);
1595 +/** more internals **/
1596 +#if !defined(MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_0)
1597 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_0 'E'
1598 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_1 'd'
1599 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_2 'i'
1600 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_3 't'
1601 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_4 'o'
1602 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_5 'r'
1604 +#include <orbit/orb-core/orbit-interface.h>
1606 +#ifdef ORBIT_IDL_C_IMODULE
1611 + ORBit_IInterface GNOME_GtkHTML_Editor_Listener__iinterface;
1612 +#define GNOME_GtkHTML_Editor_Listener_IMETHODS_LEN 1
1613 +#ifdef ORBIT_IDL_C_IMODULE
1619 + GNOME_GtkHTML_Editor_Listener__imethods
1620 + [GNOME_GtkHTML_Editor_Listener_IMETHODS_LEN];
1621 +#ifdef ORBIT_IDL_C_IMODULE
1626 + ORBit_IInterface GNOME_GtkHTML_Editor_Engine__iinterface;
1627 +#define GNOME_GtkHTML_Editor_Engine_IMETHODS_LEN 17
1628 +#ifdef ORBIT_IDL_C_IMODULE
1634 + GNOME_GtkHTML_Editor_Engine__imethods
1635 + [GNOME_GtkHTML_Editor_Engine_IMETHODS_LEN];
1638 +#endif /* __cplusplus */
1640 +#ifndef EXCLUDE_ORBIT_H
1641 +#include <orbit/orbit.h>
1643 +#endif /* EXCLUDE_ORBIT_H */
1645 +#undef ORBIT_IDL_SERIAL
1646 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor.c vim/src/gtkhtml_editor.c
1647 --- vimcopy/src/gtkhtml_editor.c Wed Dec 31 18:00:00 1969
1648 +++ vim/src/gtkhtml_editor.c Sat Nov 1 18:19:52 2003
1652 +#include <bonobo.h>
1653 +#include "gtkhtml_editor.h"
1655 +static BonoboObjectClass *engine_parent_class;
1657 +inline static EditorEngine *
1658 +gtkhtml_editor_engine_from_servant (PortableServer_Servant servant)
1660 + return EDITOR_ENGINE (bonobo_object_from_servant (servant));
1663 +static CORBA_char *
1664 +impl_get_paragraph_data (PortableServer_Servant servant, const CORBA_char * key, CORBA_Environment * ev)
1666 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1670 +impl_set_paragraph_data (PortableServer_Servant servant,
1671 + const CORBA_char * key, const CORBA_char * value,
1672 + CORBA_Environment * ev)
1674 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1678 +impl_set_object_data_by_type (PortableServer_Servant servant,
1679 + const CORBA_char * type_name, const CORBA_char * key, const CORBA_char * value,
1680 + CORBA_Environment * ev)
1682 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1686 +impl_set_listener (PortableServer_Servant servant, const GNOME_GtkHTML_Editor_Listener value, CORBA_Environment * ev)
1688 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1690 + bonobo_object_release_unref (e->listener, NULL);
1691 + e->listener = bonobo_object_dup_ref (value, NULL);
1694 +static GNOME_GtkHTML_Editor_Listener
1695 +impl_get_listener (PortableServer_Servant servant, CORBA_Environment * ev)
1697 + return gtkhtml_editor_engine_from_servant (servant)->listener;
1702 +static CORBA_boolean
1703 +impl_run_command (PortableServer_Servant servant, const CORBA_char * command, CORBA_Environment * ev)
1705 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1706 + printf ("command: %s\n", command);
1707 + CORBA_boolean retval = CORBA_TRUE;
1708 + int save_p_report = p_report;
1713 + aucmd_prepbuf(&aco, persistent_buffer);
1715 + if( strcmp( command, "cursor-position-save" ) == 0 ) {
1716 + do_cmdline_cmd("normal mz");
1717 + } else if( strcmp( command, "cursor-position-restore" ) == 0 ) {
1718 + do_cmdline_cmd("normal 'z");
1719 + update_screen(CLEAR);
1720 + gui_update_cursor(TRUE, FALSE);
1721 + } else if( strcmp( command, "cursor-bod" ) == 0 ) {
1722 + do_cmdline_cmd("normal G");
1723 + } else if( strcmp( command, "select-paragraph" ) == 0 ) {
1724 + do_cmdline_cmd("normal V}");
1725 + } else if( strcmp( command, "delete" ) == 0 ) {
1726 + do_cmdline_cmd("normal d");
1727 + } else if( strcmp( command, "is-saved" ) == 0 ) {
1728 + retval = !persistent_buffer->b_changed;
1729 + } else if( strcmp( command, "insert-paragraph" ) == 0 ) {
1730 + do_cmdline_cmd("normal o");
1732 + aucmd_restbuf(&aco);
1733 + p_report = save_p_report;
1737 +static CORBA_boolean
1738 +impl_is_paragraph_empty (PortableServer_Servant servant, CORBA_Environment * ev)
1740 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1741 + return CORBA_FALSE;
1744 +static CORBA_boolean
1745 +impl_is_previous_paragraph_empty (PortableServer_Servant servant, CORBA_Environment * ev)
1747 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1748 + return CORBA_FALSE;
1757 +static GSList * keylist = NULL;
1758 +static char free_mark = 'y';
1760 +static void set_mark_at_cursor( char * key, char * value )
1763 + struct keyvalue * kv = NULL;
1764 + GSList * node = keylist;
1765 + while( node != NULL ) {
1767 + if( strcmp( kv->key, key ) == 0 && strcmp( kv->value, value ) == 0 ) {
1770 + node = node->next;
1772 + if( kv == NULL ) {
1773 + kv = g_new0( struct keyvalue, 1 );
1774 + kv->key = g_strdup( key );
1775 + kv->value = g_strdup( value );
1777 + kv->mark = free_mark;
1779 + keylist = g_slist_prepend( keylist, kv );
1782 + setmark(kv->mark);
1786 +impl_insert_html (PortableServer_Servant servant, const CORBA_char * html, CORBA_Environment * ev)
1788 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1793 + gboolean in_data = 0;
1802 + g_warning("insert html: \"%s\"", html );
1805 + aucmd_prepbuf(&aco, persistent_buffer);
1807 + // This gets a bit ugly...
1808 + // Look for DATA tags with KEY and VALUE attributes. We set a mark
1809 + // in vim on the first line of the inserted HTML if one of these tags is present
1810 + // (we assume that they occur at the beginning of the inserted paragraph).
1811 + // we also assume that only one of these sequences will occur in the html.
1812 + strcpy( key, "" );
1813 + strcpy( value, "" );
1814 + for( c = html; *c != '\0'; c++ ) {
1817 + if( strncmp( c, "<DATA", 5 ) == 0 ) {
1820 + } else if( *c == '>' ) {
1823 + if( *key && *value ) {
1824 + g_warning( "got key=%s and value=%s", key, value );
1828 + } else if( in_data && strncmp( c, "key=", 4 ) == 0 ) {
1829 + // extract the key
1831 + for( s = &c[4]; *s != '\"'; s++ );
1833 + for( ; *s != '\"'; s++ ) {
1837 + } else if( in_data && strncmp( c, "value=", 6 ) == 0 ) {
1838 + // extract the value
1840 + for( s = &c[4]; *s != '\"'; s++ );
1842 + for( ; *s != '\"'; s++ ) {
1849 + /* insert the html into the buffer, remembering the starting line */
1850 + begin = curwin->w_cursor.lnum;
1852 + lines = g_strsplit(html, "\n", 0);
1853 + for(i = 0; lines[i]; i += 1) {
1854 + ml_append(curline, lines[i], strlen(html) + 1, FALSE);
1855 + appended_lines_mark(curwin->w_cursor.lnum, 1);
1858 + g_strfreev(lines);
1860 + /* run a filter to obtain plain text from the html */
1861 + vim_bonobo_call_begin();
1862 + g_snprintf( cmd, 50, "%d,%d!html2text -nobs", begin, curline);
1863 + do_cmdline_cmd(cmd);
1864 + vim_bonobo_call_end();
1865 + if( *key && *value ) {
1866 + set_mark_at_cursor( key, value );
1868 + aucmd_restbuf(&aco);
1871 +static CORBA_boolean
1872 +impl_search_by_data (PortableServer_Servant servant, const CORBA_long level, const CORBA_char * klass,
1873 + const CORBA_char * key, const CORBA_char * value, CORBA_Environment * ev)
1875 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1877 + GSList * node = keylist;
1878 + struct keyvalue * kv = NULL;
1882 + int retval = FALSE;
1884 + aucmd_prepbuf(&aco, persistent_buffer);
1886 + g_warning("search by data: key=\"%s\" value=\"%s\"", key, value );
1887 + while( node != NULL ) {
1889 + if( strcmp( kv->key, key ) == 0 && strcmp( kv->value, value ) == 0 ) {
1892 + node = node->next;
1894 + if( kv != NULL ) {
1897 + pos = getmark(kv->mark, FALSE);
1898 + if( pos->lnum != 0 ) {
1899 + /* jump to the mark in the text */
1900 + g_snprintf( cmd, 15, "normal '%c", kv->mark );
1901 + do_cmdline_cmd( cmd );
1902 + g_warning( "Found key!" );
1905 + g_warning( "Key not found" );
1906 + // mark not found. Delete it from our list.
1907 + g_free( kv->key );
1908 + g_free( kv->value );
1910 + keylist = g_slist_remove( keylist, kv );
1913 + aucmd_restbuf(&aco);
1918 +impl_freeze (PortableServer_Servant servant, CORBA_Environment * ev)
1923 +impl_thaw (PortableServer_Servant servant, CORBA_Environment * ev)
1928 +impl_undo_begin (PortableServer_Servant servant, const CORBA_char * undo_name, const CORBA_char * redo_name,
1929 + CORBA_Environment * ev)
1934 +impl_undo_end (PortableServer_Servant servant, CORBA_Environment * ev)
1939 +impl_ignore_word (PortableServer_Servant servant, const CORBA_char * word, CORBA_Environment * ev)
1941 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1944 +/* Return whether we have any undos. */
1945 +static CORBA_boolean
1946 +impl_has_undo (PortableServer_Servant servant, CORBA_Environment * ev)
1948 + u_header_T *curhead;
1949 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1951 + if( !persistent_buffer) {
1952 + return CORBA_FALSE;
1954 + /* this logic comes from undo.c */
1955 + curhead = persistent_buffer->b_u_curhead;
1956 + if (persistent_buffer->b_u_curhead == NULL) { /* first undo */
1957 + curhead = persistent_buffer->b_u_newhead;
1958 + } else if (p_ul > 0) { /* multi level undo */
1959 + curhead = persistent_buffer->b_u_curhead->uh_next;
1961 + if (curbuf->b_u_numhead == 0 || curhead == NULL) {
1962 + return CORBA_FALSE;
1964 + return CORBA_TRUE;
1968 +impl_drop_undo (PortableServer_Servant servant, CORBA_Environment * ev)
1970 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1971 + printf ("dropUndo\n");
1975 +engine_object_finalize (GObject *object)
1977 + EditorEngine *e = EDITOR_ENGINE (object);
1979 + bonobo_object_release_unref (e->listener, NULL);
1981 + G_OBJECT_CLASS (engine_parent_class)->finalize (object);
1985 +editor_engine_init (GObject *object)
1987 + EditorEngine *e = EDITOR_ENGINE (object);
1989 + e->listener = CORBA_OBJECT_NIL;
1993 +editor_engine_class_init (EditorEngineClass *klass)
1995 + GObjectClass *object_class = G_OBJECT_CLASS (klass);
1996 + POA_GNOME_GtkHTML_Editor_Engine__epv *epv = &klass->epv;
1998 + engine_parent_class = g_type_class_peek_parent (klass);
1999 + object_class->finalize = engine_object_finalize;
2001 + epv->_set_listener = impl_set_listener;
2002 + epv->_get_listener = impl_get_listener;
2003 + epv->setParagraphData = impl_set_paragraph_data;
2004 + epv->getParagraphData = impl_get_paragraph_data;
2005 + epv->setObjectDataByType = impl_set_object_data_by_type;
2006 + epv->runCommand = impl_run_command;
2007 + epv->isParagraphEmpty = impl_is_paragraph_empty;
2008 + epv->isPreviousParagraphEmpty = impl_is_previous_paragraph_empty;
2009 + epv->searchByData = impl_search_by_data;
2010 + epv->insertHTML = impl_insert_html;
2011 + epv->freeze = impl_freeze;
2012 + epv->thaw = impl_thaw;
2013 + epv->undoBegin = impl_undo_begin;
2014 + epv->undoEnd = impl_undo_end;
2015 + epv->ignoreWord = impl_ignore_word;
2016 + epv->hasUndo = impl_has_undo;
2017 + epv->dropUndo = impl_drop_undo;
2020 +BONOBO_TYPE_FUNC_FULL (
2021 + EditorEngine, /* Glib class name */
2022 + GNOME_GtkHTML_Editor_Engine, /* CORBA interface name */
2023 + BONOBO_TYPE_OBJECT, /* parent type */
2024 + editor_engine); /* local prefix ie. 'echo'_class_init */
2027 +editor_engine_new (void)
2031 + ee = g_object_new (EDITOR_ENGINE_TYPE, NULL);
2035 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor.h vim/src/gtkhtml_editor.h
2036 --- vimcopy/src/gtkhtml_editor.h Wed Dec 31 18:00:00 1969
2037 +++ vim/src/gtkhtml_editor.h Sat Jul 26 13:16:47 2003
2039 +#ifndef GTKHTML_ENGINE_H_
2040 +#define GTKHTML_ENGINE_H_
2044 +typedef struct _EditorEngine EditorEngine;
2046 +#include <gtk/gtktypeutils.h>
2047 +#include <bonobo/bonobo-object.h>
2048 +#include "gtkhtml.h"
2050 +#define EDITOR_ENGINE_TYPE (editor_engine_get_type ())
2051 +#define EDITOR_ENGINE(o) (GTK_CHECK_CAST ((o), EDITOR_ENGINE_TYPE, EditorEngine))
2052 +#define EDITOR_ENGINE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), EDITOR_ENGINE_TYPE, EditorEngineClass))
2053 +#define IS_EDITOR_ENGINE(o) (GTK_CHECK_TYPE ((o), EDITOR_ENGINE_TYPE))
2054 +#define IS_EDITOR_ENGINE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), EDITOR_ENGINE_TYPE))
2056 +struct _EditorEngine {
2057 + BonoboObject parent;
2058 + GNOME_GtkHTML_Editor_Listener listener;
2062 + BonoboObjectClass parent_class;
2063 + POA_GNOME_GtkHTML_Editor_Engine__epv epv;
2064 +} EditorEngineClass;
2066 +GtkType editor_engine_get_type (void);
2067 +EditorEngine *editor_engine_new (void);
2068 +POA_GNOME_GtkHTML_Editor_Engine__epv *editor_engine_get_epv (void);
2072 +#endif /* GTKHTML_ENGINE_H_ */
2073 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor_common.c vim/src/gtkhtml_editor_common.c
2074 --- vimcopy/src/gtkhtml_editor_common.c Wed Dec 31 18:00:00 1969
2075 +++ vim/src/gtkhtml_editor_common.c Sat Jul 26 13:16:47 2003
2078 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
2081 +#include <string.h>
2082 +#define ORBIT2_STUBS_API
2083 +#define ORBIT_IDL_C_COMMON
2084 +#define Editor_COMMON
2085 +#include "gtkhtml.h"
2087 +static const CORBA_unsigned_long ORBit_zero_int = 0;
2089 +#if ( (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_0 == 'E') \
2090 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_1 == 'd') \
2091 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_2 == 'i') \
2092 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_3 == 't') \
2093 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_4 == 'o') \
2094 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_5 == 'r') \
2095 +) && !defined(TC_DEF_TC_GNOME_GtkHTML_Editor_Listener)
2096 +#define TC_DEF_TC_GNOME_GtkHTML_Editor_Listener 1
2097 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2100 +const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Listener_struct = {
2101 + {&ORBit_TypeCode_epv, ORBIT_REFCOUNT_STATIC},
2105 + ORBIT_ALIGNOF_CORBA_POINTER,
2111 + "IDL:GNOME/GtkHTML/Editor/Listener:1.0",
2119 +#if ( (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_0 == 'E') \
2120 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_1 == 'd') \
2121 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_2 == 'i') \
2122 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_3 == 't') \
2123 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_4 == 'o') \
2124 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_5 == 'r') \
2125 +) && !defined(TC_DEF_TC_GNOME_GtkHTML_Editor_Engine)
2126 +#define TC_DEF_TC_GNOME_GtkHTML_Editor_Engine 1
2127 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2130 +const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Engine_struct = {
2131 + {&ORBit_TypeCode_epv, ORBIT_REFCOUNT_STATIC},
2135 + ORBIT_ALIGNOF_CORBA_POINTER,
2141 + "IDL:GNOME/GtkHTML/Editor/Engine:1.0",
2149 +#if ( (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_0 == 'E') \
2150 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_1 == 'd') \
2151 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_2 == 'i') \
2152 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_3 == 't') \
2153 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_4 == 'o') \
2154 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_5 == 'r') \
2155 +) && !defined(TC_DEF_TC_GNOME_GtkHTML_Editor_URLRequestEvent)
2156 +#define TC_DEF_TC_GNOME_GtkHTML_Editor_URLRequestEvent 1
2157 +static const char *anon_subnames_array6[] = { "url", "stream" };
2158 +static const CORBA_TypeCode anon_subtypes_array7[] =
2159 + { (CORBA_TypeCode) & TC_CORBA_string_struct,
2160 + (CORBA_TypeCode) & TC_Bonobo_Stream_struct };
2162 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2165 +const struct CORBA_TypeCode_struct
2166 + TC_GNOME_GtkHTML_Editor_URLRequestEvent_struct = {
2167 + {&ORBit_TypeCode_epv, ORBIT_REFCOUNT_STATIC},
2171 + ORBIT_ALIGNOF_CORBA_POINTER,
2174 + (CORBA_TypeCode *) anon_subtypes_array7,
2176 + "URLRequestEvent",
2177 + "IDL:GNOME/GtkHTML/Editor/URLRequestEvent:1.0",
2178 + (char **) anon_subnames_array6,
2186 +#ifndef ORBIT_IDL_C_IMODULE_Editor
2187 +CORBA_unsigned_long GNOME_GtkHTML_Editor_Listener__classid = 0;
2190 +#ifndef ORBIT_IDL_C_IMODULE_Editor
2191 +CORBA_unsigned_long GNOME_GtkHTML_Editor_Engine__classid = 0;
2194 +/* Interface type data */
2196 +static ORBit_IArg GNOME_GtkHTML_Editor_Listener_event__arginfo[] = {
2197 + {TC_CORBA_string, ORBit_I_ARG_IN, "name"},
2198 + {TC_CORBA_any, ORBit_I_ARG_IN, "arg"}
2201 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2204 +ORBit_IMethod GNOME_GtkHTML_Editor_Listener__imethods[] = {
2206 + {2, 2, GNOME_GtkHTML_Editor_Listener_event__arginfo, FALSE},
2207 + {0, 0, NULL, FALSE},
2208 + {0, 0, NULL, FALSE},
2209 + TC_CORBA_any, "event", 5,
2212 +static CORBA_string GNOME_GtkHTML_Editor_Listener__base_itypes[] = {
2213 + "IDL:Bonobo/Unknown:1.0",
2214 + "IDL:omg.org/CORBA/Object:1.0"
2217 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2220 +ORBit_IInterface GNOME_GtkHTML_Editor_Listener__iinterface = {
2221 + TC_GNOME_GtkHTML_Editor_Listener, {1, 1,
2222 + GNOME_GtkHTML_Editor_Listener__imethods,
2224 + {2, 2, GNOME_GtkHTML_Editor_Listener__base_itypes, FALSE}
2227 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine__set_listener__arginfo[] = {
2228 + {TC_GNOME_GtkHTML_Editor_Listener, ORBit_I_ARG_IN, "value"}
2230 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_runCommand__arginfo[] = {
2231 + {TC_CORBA_string, ORBit_I_ARG_IN, "command"}
2233 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_getParagraphData__arginfo[] = {
2234 + {TC_CORBA_string, ORBit_I_ARG_IN, "key"}
2236 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_setParagraphData__arginfo[] = {
2237 + {TC_CORBA_string, ORBit_I_ARG_IN, "key"},
2238 + {TC_CORBA_string, ORBit_I_ARG_IN, "value"}
2240 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_setObjectDataByType__arginfo[] = {
2241 + {TC_CORBA_string, ORBit_I_ARG_IN, "type_name"},
2242 + {TC_CORBA_string, ORBit_I_ARG_IN, "key"},
2243 + {TC_CORBA_string, ORBit_I_ARG_IN, "data"}
2245 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_searchByData__arginfo[] = {
2246 + {TC_CORBA_long, ORBit_I_ARG_IN | ORBit_I_COMMON_FIXED_SIZE, "level"},
2247 + {TC_CORBA_string, ORBit_I_ARG_IN, "klass"},
2248 + {TC_CORBA_string, ORBit_I_ARG_IN, "key"},
2249 + {TC_CORBA_string, ORBit_I_ARG_IN, "value"}
2251 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_insertHTML__arginfo[] = {
2252 + {TC_CORBA_string, ORBit_I_ARG_IN, "html"}
2254 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_undoBegin__arginfo[] = {
2255 + {TC_CORBA_string, ORBit_I_ARG_IN, "undo_name"},
2256 + {TC_CORBA_string, ORBit_I_ARG_IN, "redo_name"}
2258 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_ignoreWord__arginfo[] = {
2259 + {TC_CORBA_string, ORBit_I_ARG_IN, "word"}
2262 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2265 +ORBit_IMethod GNOME_GtkHTML_Editor_Engine__imethods[] = {
2267 + {0, 0, NULL, FALSE},
2268 + {0, 0, NULL, FALSE},
2269 + {0, 0, NULL, FALSE},
2270 + TC_GNOME_GtkHTML_Editor_Listener, "_get_listener", 13,
2273 + {1, 1, GNOME_GtkHTML_Editor_Engine__set_listener__arginfo, FALSE},
2274 + {0, 0, NULL, FALSE},
2275 + {0, 0, NULL, FALSE},
2276 + TC_void, "_set_listener", 13,
2279 + {1, 1, GNOME_GtkHTML_Editor_Engine_runCommand__arginfo, FALSE},
2280 + {0, 0, NULL, FALSE},
2281 + {0, 0, NULL, FALSE},
2282 + TC_CORBA_boolean, "runCommand", 10,
2283 + 0 | ORBit_I_COMMON_FIXED_SIZE}
2285 + {1, 1, GNOME_GtkHTML_Editor_Engine_getParagraphData__arginfo, FALSE},
2286 + {0, 0, NULL, FALSE},
2287 + {0, 0, NULL, FALSE},
2288 + TC_CORBA_string, "getParagraphData", 16,
2291 + {2, 2, GNOME_GtkHTML_Editor_Engine_setParagraphData__arginfo, FALSE},
2292 + {0, 0, NULL, FALSE},
2293 + {0, 0, NULL, FALSE},
2294 + TC_void, "setParagraphData", 16,
2297 + {3, 3, GNOME_GtkHTML_Editor_Engine_setObjectDataByType__arginfo, FALSE},
2298 + {0, 0, NULL, FALSE},
2299 + {0, 0, NULL, FALSE},
2300 + TC_void, "setObjectDataByType", 19,
2303 + {4, 4, GNOME_GtkHTML_Editor_Engine_searchByData__arginfo, FALSE},
2304 + {0, 0, NULL, FALSE},
2305 + {0, 0, NULL, FALSE},
2306 + TC_CORBA_boolean, "searchByData", 12,
2307 + 0 | ORBit_I_COMMON_FIXED_SIZE}
2309 + {0, 0, NULL, FALSE},
2310 + {0, 0, NULL, FALSE},
2311 + {0, 0, NULL, FALSE},
2312 + TC_CORBA_boolean, "isParagraphEmpty", 16,
2313 + 0 | ORBit_I_COMMON_FIXED_SIZE}
2315 + {0, 0, NULL, FALSE},
2316 + {0, 0, NULL, FALSE},
2317 + {0, 0, NULL, FALSE},
2318 + TC_CORBA_boolean, "isPreviousParagraphEmpty", 24,
2319 + 0 | ORBit_I_COMMON_FIXED_SIZE}
2321 + {1, 1, GNOME_GtkHTML_Editor_Engine_insertHTML__arginfo, FALSE},
2322 + {0, 0, NULL, FALSE},
2323 + {0, 0, NULL, FALSE},
2324 + TC_void, "insertHTML", 10,
2327 + {0, 0, NULL, FALSE},
2328 + {0, 0, NULL, FALSE},
2329 + {0, 0, NULL, FALSE},
2330 + TC_void, "freeze", 6,
2333 + {0, 0, NULL, FALSE},
2334 + {0, 0, NULL, FALSE},
2335 + {0, 0, NULL, FALSE},
2336 + TC_void, "thaw", 4,
2339 + {2, 2, GNOME_GtkHTML_Editor_Engine_undoBegin__arginfo, FALSE},
2340 + {0, 0, NULL, FALSE},
2341 + {0, 0, NULL, FALSE},
2342 + TC_void, "undoBegin", 9,
2345 + {0, 0, NULL, FALSE},
2346 + {0, 0, NULL, FALSE},
2347 + {0, 0, NULL, FALSE},
2348 + TC_void, "undoEnd", 7,
2351 + {1, 1, GNOME_GtkHTML_Editor_Engine_ignoreWord__arginfo, FALSE},
2352 + {0, 0, NULL, FALSE},
2353 + {0, 0, NULL, FALSE},
2354 + TC_void, "ignoreWord", 10,
2357 + {0, 0, NULL, FALSE},
2358 + {0, 0, NULL, FALSE},
2359 + {0, 0, NULL, FALSE},
2360 + TC_void, "dropUndo", 8,
2363 + {0, 0, NULL, FALSE},
2364 + {0, 0, NULL, FALSE},
2365 + {0, 0, NULL, FALSE},
2366 + TC_CORBA_boolean, "hasUndo", 7,
2367 + 0 | ORBit_I_COMMON_FIXED_SIZE}
2369 +static CORBA_string GNOME_GtkHTML_Editor_Engine__base_itypes[] = {
2370 + "IDL:Bonobo/Unknown:1.0",
2371 + "IDL:omg.org/CORBA/Object:1.0"
2374 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2377 +ORBit_IInterface GNOME_GtkHTML_Editor_Engine__iinterface = {
2378 + TC_GNOME_GtkHTML_Editor_Engine, {17, 17,
2379 + GNOME_GtkHTML_Editor_Engine__imethods,
2381 + {2, 2, GNOME_GtkHTML_Editor_Engine__base_itypes, FALSE}
2383 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor_skels.c vim/src/gtkhtml_editor_skels.c
2384 --- vimcopy/src/gtkhtml_editor_skels.c Wed Dec 31 18:00:00 1969
2385 +++ vim/src/gtkhtml_editor_skels.c Sat Jul 26 13:16:47 2003
2388 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
2391 +#include <string.h>
2392 +#define ORBIT2_STUBS_API
2393 +#include "gtkhtml.h"
2396 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Listener_event
2397 + (POA_GNOME_GtkHTML_Editor_Listener * _o_servant, gpointer _o_retval,
2398 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2399 + CORBA_any * (*_impl_event) (PortableServer_Servant _servant,
2400 + const CORBA_char * name,
2401 + const CORBA_any * arg,
2402 + CORBA_Environment * ev))
2404 + *(CORBA_any * *)_o_retval =
2405 + _impl_event(_o_servant, *(const CORBA_char * *) _o_args[0],
2406 + (const CORBA_any *) _o_args[1], _o_ev);
2410 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__get_listener
2411 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2412 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2413 + GNOME_GtkHTML_Editor_Listener(*_impl__get_listener)
2414 + (PortableServer_Servant _servant, CORBA_Environment * ev))
2416 + *(GNOME_GtkHTML_Editor_Listener *) _o_retval =
2417 + _impl__get_listener(_o_servant, _o_ev);
2421 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__set_listener
2422 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2423 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2424 + void (*_impl__set_listener) (PortableServer_Servant _servant,
2425 + const GNOME_GtkHTML_Editor_Listener value,
2426 + CORBA_Environment * ev))
2428 + _impl__set_listener(_o_servant,
2429 + *(const GNOME_GtkHTML_Editor_Listener *) _o_args[0],
2434 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_runCommand
2435 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2436 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2437 + CORBA_boolean(*_impl_runCommand) (PortableServer_Servant _servant,
2438 + const CORBA_char * command,
2439 + CORBA_Environment * ev))
2441 + *(CORBA_boolean *) _o_retval =
2442 + _impl_runCommand(_o_servant, *(const CORBA_char * *) _o_args[0], _o_ev);
2446 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_getParagraphData
2447 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2448 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2449 + CORBA_string(*_impl_getParagraphData) (PortableServer_Servant _servant,
2450 + const CORBA_char * key,
2451 + CORBA_Environment * ev))
2453 + *(CORBA_string *) _o_retval =
2454 + _impl_getParagraphData(_o_servant, *(const CORBA_char * *) _o_args[0],
2459 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setParagraphData
2460 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2461 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2462 + void (*_impl_setParagraphData) (PortableServer_Servant _servant,
2463 + const CORBA_char * key,
2464 + const CORBA_char * value,
2465 + CORBA_Environment * ev))
2467 + _impl_setParagraphData(_o_servant, *(const CORBA_char * *) _o_args[0],
2468 + *(const CORBA_char * *) _o_args[1], _o_ev);
2472 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setObjectDataByType
2473 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2474 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2475 + void (*_impl_setObjectDataByType) (PortableServer_Servant _servant,
2476 + const CORBA_char * type_name,
2477 + const CORBA_char * key,
2478 + const CORBA_char * data,
2479 + CORBA_Environment * ev))
2481 + _impl_setObjectDataByType(_o_servant, *(const CORBA_char * *) _o_args[0],
2482 + *(const CORBA_char * *) _o_args[1],
2483 + *(const CORBA_char * *) _o_args[2], _o_ev);
2487 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_searchByData
2488 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2489 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2490 + CORBA_boolean(*_impl_searchByData) (PortableServer_Servant _servant,
2491 + const CORBA_long level,
2492 + const CORBA_char * klass,
2493 + const CORBA_char * key,
2494 + const CORBA_char * value,
2495 + CORBA_Environment * ev))
2497 + *(CORBA_boolean *) _o_retval =
2498 + _impl_searchByData(_o_servant, *(const CORBA_long *) _o_args[0],
2499 + *(const CORBA_char * *) _o_args[1],
2500 + *(const CORBA_char * *) _o_args[2],
2501 + *(const CORBA_char * *) _o_args[3], _o_ev);
2505 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isParagraphEmpty
2506 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2507 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2508 + CORBA_boolean(*_impl_isParagraphEmpty) (PortableServer_Servant _servant,
2509 + CORBA_Environment * ev))
2511 + *(CORBA_boolean *) _o_retval = _impl_isParagraphEmpty(_o_servant, _o_ev);
2515 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
2516 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2517 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2518 + CORBA_boolean(*_impl_isPreviousParagraphEmpty) (PortableServer_Servant
2520 + CORBA_Environment * ev))
2522 + *(CORBA_boolean *) _o_retval =
2523 + _impl_isPreviousParagraphEmpty(_o_servant, _o_ev);
2527 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_insertHTML
2528 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2529 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2530 + void (*_impl_insertHTML) (PortableServer_Servant _servant,
2531 + const CORBA_char * html,
2532 + CORBA_Environment * ev))
2534 + _impl_insertHTML(_o_servant, *(const CORBA_char * *) _o_args[0], _o_ev);
2538 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_freeze
2539 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2540 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2541 + void (*_impl_freeze) (PortableServer_Servant _servant,
2542 + CORBA_Environment * ev))
2544 + _impl_freeze(_o_servant, _o_ev);
2548 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_thaw
2549 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2550 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2551 + void (*_impl_thaw) (PortableServer_Servant _servant,
2552 + CORBA_Environment * ev))
2554 + _impl_thaw(_o_servant, _o_ev);
2558 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoBegin
2559 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2560 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2561 + void (*_impl_undoBegin) (PortableServer_Servant _servant,
2562 + const CORBA_char * undo_name,
2563 + const CORBA_char * redo_name,
2564 + CORBA_Environment * ev))
2566 + _impl_undoBegin(_o_servant, *(const CORBA_char * *) _o_args[0],
2567 + *(const CORBA_char * *) _o_args[1], _o_ev);
2571 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoEnd
2572 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2573 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2574 + void (*_impl_undoEnd) (PortableServer_Servant _servant,
2575 + CORBA_Environment * ev))
2577 + _impl_undoEnd(_o_servant, _o_ev);
2581 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_ignoreWord
2582 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2583 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2584 + void (*_impl_ignoreWord) (PortableServer_Servant _servant,
2585 + const CORBA_char * word,
2586 + CORBA_Environment * ev))
2588 + _impl_ignoreWord(_o_servant, *(const CORBA_char * *) _o_args[0], _o_ev);
2592 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_dropUndo
2593 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2594 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2595 + void (*_impl_dropUndo) (PortableServer_Servant _servant,
2596 + CORBA_Environment * ev))
2598 + _impl_dropUndo(_o_servant, _o_ev);
2602 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_hasUndo
2603 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2604 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2605 + CORBA_boolean(*_impl_hasUndo) (PortableServer_Servant _servant,
2606 + CORBA_Environment * ev))
2608 + *(CORBA_boolean *) _o_retval = _impl_hasUndo(_o_servant, _o_ev);
2610 +static ORBitSmallSkeleton
2611 +get_skel_small_GNOME_GtkHTML_Editor_Listener(POA_GNOME_GtkHTML_Editor_Listener
2612 + * servant, const char *opname,
2613 + gpointer * m_data,
2616 + switch (opname[0]) {
2618 + if (strcmp((opname + 1), "vent"))
2621 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Listener_epv->event;
2623 + (gpointer) & GNOME_GtkHTML_Editor_Listener__iinterface.methods.
2625 + return (ORBitSmallSkeleton)
2626 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Listener_event;
2629 + if (strcmp((opname + 1), "ueryInterface"))
2631 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->queryInterface;
2632 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[2];
2633 + return (ORBitSmallSkeleton)
2634 + _ORBIT_skel_small_Bonobo_Unknown_queryInterface;
2637 + if (strcmp((opname + 1), "ef"))
2639 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->ref;
2640 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[0];
2641 + return (ORBitSmallSkeleton) _ORBIT_skel_small_Bonobo_Unknown_ref;
2644 + if (strcmp((opname + 1), "nref"))
2646 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->unref;
2647 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[1];
2648 + return (ORBitSmallSkeleton) _ORBIT_skel_small_Bonobo_Unknown_unref;
2657 +POA_GNOME_GtkHTML_Editor_Listener__init(PortableServer_Servant servant,
2658 + CORBA_Environment * env)
2660 + static PortableServer_ClassInfo class_info =
2662 +(ORBit_small_impl_finder) & get_skel_small_GNOME_GtkHTML_Editor_Listener,
2663 + "IDL:GNOME/GtkHTML/Editor/Listener:1.0",
2664 + &GNOME_GtkHTML_Editor_Listener__classid, NULL,
2665 + &GNOME_GtkHTML_Editor_Listener__iinterface };
2666 + POA_GNOME_GtkHTML_Editor_Listener__vepv *fakevepv = NULL;
2668 + if (((PortableServer_ServantBase *) servant)->vepv[0]->finalize == 0) {
2669 + ((PortableServer_ServantBase *) servant)->vepv[0]->finalize =
2670 + POA_GNOME_GtkHTML_Editor_Listener__fini;
2672 + PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant),
2674 + POA_Bonobo_Unknown__init(servant, env);
2675 + ORBit_classinfo_register(&class_info);
2676 + ORBIT_SERVANT_SET_CLASSINFO(servant, &class_info);
2678 + if (!class_info.vepvmap) {
2679 + class_info.vepvmap =
2680 + g_new0(ORBit_VepvIdx, GNOME_GtkHTML_Editor_Listener__classid + 1);
2681 + class_info.vepvmap[Bonobo_Unknown__classid] =
2682 + (((char *) &(fakevepv->Bonobo_Unknown_epv)) -
2683 + ((char *) (fakevepv))) / sizeof(GFunc);
2684 + class_info.vepvmap[GNOME_GtkHTML_Editor_Listener__classid] =
2685 + (((char *) &(fakevepv->GNOME_GtkHTML_Editor_Listener_epv)) -
2686 + ((char *) (fakevepv))) / sizeof(GFunc);
2691 +POA_GNOME_GtkHTML_Editor_Listener__fini(PortableServer_Servant servant,
2692 + CORBA_Environment * env)
2694 + POA_Bonobo_Unknown__fini(servant, env);
2695 + PortableServer_ServantBase__fini(servant, env);
2698 +static ORBitSmallSkeleton
2699 +get_skel_small_GNOME_GtkHTML_Editor_Engine(POA_GNOME_GtkHTML_Editor_Engine *
2700 + servant, const char *opname,
2701 + gpointer * m_data, gpointer * impl)
2703 + switch (opname[0]) {
2705 + switch (opname[1]) {
2707 + if (strcmp((opname + 2), "et_listener"))
2710 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2713 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2715 + return (ORBitSmallSkeleton)
2716 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__get_listener;
2719 + if (strcmp((opname + 2), "et_listener"))
2722 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2725 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2727 + return (ORBitSmallSkeleton)
2728 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__set_listener;
2735 + if (strcmp((opname + 1), "ropUndo"))
2738 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->dropUndo;
2740 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2742 + return (ORBitSmallSkeleton)
2743 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_dropUndo;
2746 + if (strcmp((opname + 1), "reeze"))
2749 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->freeze;
2751 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2753 + return (ORBitSmallSkeleton)
2754 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_freeze;
2757 + if (strcmp((opname + 1), "etParagraphData"))
2760 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2763 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2765 + return (ORBitSmallSkeleton)
2766 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_getParagraphData;
2769 + if (strcmp((opname + 1), "asUndo"))
2772 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->hasUndo;
2774 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2776 + return (ORBitSmallSkeleton)
2777 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_hasUndo;
2780 + switch (opname[1]) {
2782 + if (strcmp((opname + 2), "noreWord"))
2785 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2788 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2790 + return (ORBitSmallSkeleton)
2791 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_ignoreWord;
2794 + if (strcmp((opname + 2), "sertHTML"))
2797 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2800 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2802 + return (ORBitSmallSkeleton)
2803 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_insertHTML;
2806 + switch (opname[2]) {
2808 + switch (opname[3]) {
2810 + if (strcmp((opname + 4), "ragraphEmpty"))
2813 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2816 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2817 + methods._buffer[7];
2818 + return (ORBitSmallSkeleton)
2819 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isParagraphEmpty;
2822 + if (strcmp((opname + 4), "eviousParagraphEmpty"))
2825 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2826 + isPreviousParagraphEmpty;
2828 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2829 + methods._buffer[8];
2830 + return (ORBitSmallSkeleton)
2831 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty;
2846 + if (strcmp((opname + 1), "ueryInterface"))
2848 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->queryInterface;
2849 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[2];
2850 + return (ORBitSmallSkeleton)
2851 + _ORBIT_skel_small_Bonobo_Unknown_queryInterface;
2854 + switch (opname[1]) {
2856 + if (strcmp((opname + 2), "f"))
2858 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->ref;
2859 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[0];
2860 + return (ORBitSmallSkeleton) _ORBIT_skel_small_Bonobo_Unknown_ref;
2863 + if (strcmp((opname + 2), "nCommand"))
2866 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2869 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2871 + return (ORBitSmallSkeleton)
2872 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_runCommand;
2879 + switch (opname[1]) {
2881 + switch (opname[2]) {
2883 + if (strcmp((opname + 3), "rchByData"))
2886 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2889 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2891 + return (ORBitSmallSkeleton)
2892 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_searchByData;
2895 + switch (opname[3]) {
2897 + if (strcmp((opname + 4), "bjectDataByType"))
2900 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2901 + setObjectDataByType;
2903 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2904 + methods._buffer[5];
2905 + return (ORBitSmallSkeleton)
2906 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setObjectDataByType;
2909 + if (strcmp((opname + 4), "aragraphData"))
2912 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2915 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2916 + methods._buffer[4];
2917 + return (ORBitSmallSkeleton)
2918 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setParagraphData;
2933 + if (strcmp((opname + 1), "haw"))
2935 + *impl = (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->thaw;
2937 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2939 + return (ORBitSmallSkeleton)
2940 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_thaw;
2943 + switch (opname[1]) {
2945 + switch (opname[2]) {
2947 + switch (opname[3]) {
2949 + switch (opname[4]) {
2951 + if (strcmp((opname + 5), "egin"))
2954 + (gpointer) servant->vepv->
2955 + GNOME_GtkHTML_Editor_Engine_epv->undoBegin;
2957 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2958 + methods._buffer[12];
2959 + return (ORBitSmallSkeleton)
2960 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoBegin;
2963 + if (strcmp((opname + 5), "nd"))
2966 + (gpointer) servant->vepv->
2967 + GNOME_GtkHTML_Editor_Engine_epv->undoEnd;
2969 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2970 + methods._buffer[13];
2971 + return (ORBitSmallSkeleton)
2972 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoEnd;
2983 + if (strcmp((opname + 3), "ef"))
2985 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->unref;
2987 + (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[1];
2988 + return (ORBitSmallSkeleton)
2989 + _ORBIT_skel_small_Bonobo_Unknown_unref;
3006 +POA_GNOME_GtkHTML_Editor_Engine__init(PortableServer_Servant servant,
3007 + CORBA_Environment * env)
3009 + static PortableServer_ClassInfo class_info =
3011 +(ORBit_small_impl_finder) & get_skel_small_GNOME_GtkHTML_Editor_Engine, "IDL:GNOME/GtkHTML/Editor/Engine:1.0",
3012 + &GNOME_GtkHTML_Editor_Engine__classid, NULL,
3013 + &GNOME_GtkHTML_Editor_Engine__iinterface };
3014 + POA_GNOME_GtkHTML_Editor_Engine__vepv *fakevepv = NULL;
3016 + if (((PortableServer_ServantBase *) servant)->vepv[0]->finalize == 0) {
3017 + ((PortableServer_ServantBase *) servant)->vepv[0]->finalize =
3018 + POA_GNOME_GtkHTML_Editor_Engine__fini;
3020 + PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant),
3022 + POA_Bonobo_Unknown__init(servant, env);
3023 + ORBit_classinfo_register(&class_info);
3024 + ORBIT_SERVANT_SET_CLASSINFO(servant, &class_info);
3026 + if (!class_info.vepvmap) {
3027 + class_info.vepvmap =
3028 + g_new0(ORBit_VepvIdx, GNOME_GtkHTML_Editor_Engine__classid + 1);
3029 + class_info.vepvmap[Bonobo_Unknown__classid] =
3030 + (((char *) &(fakevepv->Bonobo_Unknown_epv)) -
3031 + ((char *) (fakevepv))) / sizeof(GFunc);
3032 + class_info.vepvmap[GNOME_GtkHTML_Editor_Engine__classid] =
3033 + (((char *) &(fakevepv->GNOME_GtkHTML_Editor_Engine_epv)) -
3034 + ((char *) (fakevepv))) / sizeof(GFunc);
3039 +POA_GNOME_GtkHTML_Editor_Engine__fini(PortableServer_Servant servant,
3040 + CORBA_Environment * env)
3042 + POA_Bonobo_Unknown__fini(servant, env);
3043 + PortableServer_ServantBase__fini(servant, env);
3045 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor_stubs.c vim/src/gtkhtml_editor_stubs.c
3046 --- vimcopy/src/gtkhtml_editor_stubs.c Wed Dec 31 18:00:00 1969
3047 +++ vim/src/gtkhtml_editor_stubs.c Sat Jul 26 13:16:47 2003
3050 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
3053 +#include <string.h>
3054 +#define ORBIT2_STUBS_API
3055 +#include "gtkhtml.h"
3058 +GNOME_GtkHTML_Editor_Listener_event(GNOME_GtkHTML_Editor_Listener _obj,
3059 + const CORBA_char * name,
3060 + const CORBA_any * arg,
3061 + CORBA_Environment * ev)
3063 + CORBA_any *_ORBIT_retval;
3064 + POA_GNOME_GtkHTML_Editor_Listener__epv *_ORBIT_epv;
3066 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3067 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Listener__classid) &&
3069 + (POA_GNOME_GtkHTML_Editor_Listener__epv *) ORBIT_STUB_GetEpv(_obj,
3070 + GNOME_GtkHTML_Editor_Listener__classid))->
3072 + ORBIT_STUB_PreCall(_obj);
3074 + _ORBIT_epv->event(ORBIT_STUB_GetServant(_obj), name, arg, ev);
3075 + ORBIT_STUB_PostCall(_obj);
3076 + } else { /* remote marshal */
3077 + gpointer _args[2];
3079 + _args[0] = (gpointer) & name;
3080 + _args[1] = (gpointer) arg;
3081 + ORBit_small_invoke_stub_n(_obj,
3082 + &GNOME_GtkHTML_Editor_Listener__iinterface.
3083 + methods, 0, &_ORBIT_retval, _args, NULL, ev);
3086 + return _ORBIT_retval;
3089 +GNOME_GtkHTML_Editor_Listener
3090 +GNOME_GtkHTML_Editor_Engine__get_listener(GNOME_GtkHTML_Editor_Engine _obj,
3091 + CORBA_Environment * ev)
3093 + GNOME_GtkHTML_Editor_Listener _ORBIT_retval;
3094 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3096 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3097 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3099 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3100 + GNOME_GtkHTML_Editor_Engine__classid))->
3102 + ORBIT_STUB_PreCall(_obj);
3104 + _ORBIT_epv->_get_listener(ORBIT_STUB_GetServant(_obj), ev);
3105 + ORBIT_STUB_PostCall(_obj);
3106 + } else { /* remote marshal */
3107 + ORBit_small_invoke_stub_n(_obj,
3108 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3109 + methods, 0, &_ORBIT_retval, NULL, NULL, ev);
3112 + return _ORBIT_retval;
3116 +GNOME_GtkHTML_Editor_Engine__set_listener(GNOME_GtkHTML_Editor_Engine _obj,
3117 + const GNOME_GtkHTML_Editor_Listener
3118 + value, CORBA_Environment * ev)
3120 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3122 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3123 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3125 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3126 + GNOME_GtkHTML_Editor_Engine__classid))->
3128 + ORBIT_STUB_PreCall(_obj);
3129 + _ORBIT_epv->_set_listener(ORBIT_STUB_GetServant(_obj), value, ev);
3130 + ORBIT_STUB_PostCall(_obj);
3131 + } else { /* remote marshal */
3132 + gpointer _args[1];
3134 + _args[0] = (gpointer) & value;
3135 + ORBit_small_invoke_stub_n(_obj,
3136 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3137 + methods, 1, NULL, _args, NULL, ev);
3142 +GNOME_GtkHTML_Editor_Engine_runCommand(GNOME_GtkHTML_Editor_Engine _obj,
3143 + const CORBA_char * command,
3144 + CORBA_Environment * ev)
3146 + CORBA_boolean _ORBIT_retval;
3147 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3149 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3150 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3152 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3153 + GNOME_GtkHTML_Editor_Engine__classid))->
3155 + ORBIT_STUB_PreCall(_obj);
3157 + _ORBIT_epv->runCommand(ORBIT_STUB_GetServant(_obj), command, ev);
3158 + ORBIT_STUB_PostCall(_obj);
3159 + } else { /* remote marshal */
3160 + gpointer _args[1];
3162 + _args[0] = (gpointer) & command;
3163 + ORBit_small_invoke_stub_n(_obj,
3164 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3165 + methods, 2, &_ORBIT_retval, _args, NULL, ev);
3168 + return _ORBIT_retval;
3172 +GNOME_GtkHTML_Editor_Engine_getParagraphData(GNOME_GtkHTML_Editor_Engine _obj,
3173 + const CORBA_char * key,
3174 + CORBA_Environment * ev)
3176 + CORBA_string _ORBIT_retval;
3177 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3179 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3180 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3182 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3183 + GNOME_GtkHTML_Editor_Engine__classid))->
3184 + getParagraphData) {
3185 + ORBIT_STUB_PreCall(_obj);
3187 + _ORBIT_epv->getParagraphData(ORBIT_STUB_GetServant(_obj), key, ev);
3188 + ORBIT_STUB_PostCall(_obj);
3189 + } else { /* remote marshal */
3190 + gpointer _args[1];
3192 + _args[0] = (gpointer) & key;
3193 + ORBit_small_invoke_stub_n(_obj,
3194 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3195 + methods, 3, &_ORBIT_retval, _args, NULL, ev);
3198 + return _ORBIT_retval;
3202 +GNOME_GtkHTML_Editor_Engine_setParagraphData(GNOME_GtkHTML_Editor_Engine _obj,
3203 + const CORBA_char * key,
3204 + const CORBA_char * value,
3205 + CORBA_Environment * ev)
3207 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3209 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3210 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3212 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3213 + GNOME_GtkHTML_Editor_Engine__classid))->
3214 + setParagraphData) {
3215 + ORBIT_STUB_PreCall(_obj);
3216 + _ORBIT_epv->setParagraphData(ORBIT_STUB_GetServant(_obj), key, value,
3218 + ORBIT_STUB_PostCall(_obj);
3219 + } else { /* remote marshal */
3220 + gpointer _args[2];
3222 + _args[0] = (gpointer) & key;
3223 + _args[1] = (gpointer) & value;
3224 + ORBit_small_invoke_stub_n(_obj,
3225 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3226 + methods, 4, NULL, _args, NULL, ev);
3231 +GNOME_GtkHTML_Editor_Engine_setObjectDataByType(GNOME_GtkHTML_Editor_Engine
3233 + const CORBA_char * type_name,
3234 + const CORBA_char * key,
3235 + const CORBA_char * data,
3236 + CORBA_Environment * ev)
3238 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3240 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3241 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3243 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3244 + GNOME_GtkHTML_Editor_Engine__classid))->
3245 + setObjectDataByType) {
3246 + ORBIT_STUB_PreCall(_obj);
3247 + _ORBIT_epv->setObjectDataByType(ORBIT_STUB_GetServant(_obj), type_name,
3249 + ORBIT_STUB_PostCall(_obj);
3250 + } else { /* remote marshal */
3251 + gpointer _args[3];
3253 + _args[0] = (gpointer) & type_name;
3254 + _args[1] = (gpointer) & key;
3255 + _args[2] = (gpointer) & data;
3256 + ORBit_small_invoke_stub_n(_obj,
3257 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3258 + methods, 5, NULL, _args, NULL, ev);
3263 +GNOME_GtkHTML_Editor_Engine_searchByData(GNOME_GtkHTML_Editor_Engine _obj,
3264 + const CORBA_long level,
3265 + const CORBA_char * klass,
3266 + const CORBA_char * key,
3267 + const CORBA_char * value,
3268 + CORBA_Environment * ev)
3270 + CORBA_boolean _ORBIT_retval;
3271 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3273 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3274 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3276 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3277 + GNOME_GtkHTML_Editor_Engine__classid))->
3279 + ORBIT_STUB_PreCall(_obj);
3281 + _ORBIT_epv->searchByData(ORBIT_STUB_GetServant(_obj), level, klass,
3283 + ORBIT_STUB_PostCall(_obj);
3284 + } else { /* remote marshal */
3285 + gpointer _args[4];
3287 + _args[0] = (gpointer) & level;
3288 + _args[1] = (gpointer) & klass;
3289 + _args[2] = (gpointer) & key;
3290 + _args[3] = (gpointer) & value;
3291 + ORBit_small_invoke_stub_n(_obj,
3292 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3293 + methods, 6, &_ORBIT_retval, _args, NULL, ev);
3296 + return _ORBIT_retval;
3300 +GNOME_GtkHTML_Editor_Engine_isParagraphEmpty(GNOME_GtkHTML_Editor_Engine _obj,
3301 + CORBA_Environment * ev)
3303 + CORBA_boolean _ORBIT_retval;
3304 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3306 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3307 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3309 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3310 + GNOME_GtkHTML_Editor_Engine__classid))->
3311 + isParagraphEmpty) {
3312 + ORBIT_STUB_PreCall(_obj);
3314 + _ORBIT_epv->isParagraphEmpty(ORBIT_STUB_GetServant(_obj), ev);
3315 + ORBIT_STUB_PostCall(_obj);
3316 + } else { /* remote marshal */
3317 + ORBit_small_invoke_stub_n(_obj,
3318 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3319 + methods, 7, &_ORBIT_retval, NULL, NULL, ev);
3322 + return _ORBIT_retval;
3326 +GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
3327 + (GNOME_GtkHTML_Editor_Engine _obj, CORBA_Environment * ev)
3329 + CORBA_boolean _ORBIT_retval;
3330 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3332 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3333 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3335 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3336 + GNOME_GtkHTML_Editor_Engine__classid))->
3337 + isPreviousParagraphEmpty) {
3338 + ORBIT_STUB_PreCall(_obj);
3340 + _ORBIT_epv->isPreviousParagraphEmpty(ORBIT_STUB_GetServant(_obj),
3342 + ORBIT_STUB_PostCall(_obj);
3343 + } else { /* remote marshal */
3344 + ORBit_small_invoke_stub_n(_obj,
3345 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3346 + methods, 8, &_ORBIT_retval, NULL, NULL, ev);
3349 + return _ORBIT_retval;
3353 +GNOME_GtkHTML_Editor_Engine_insertHTML(GNOME_GtkHTML_Editor_Engine _obj,
3354 + const CORBA_char * html,
3355 + CORBA_Environment * ev)
3357 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3359 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3360 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3362 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3363 + GNOME_GtkHTML_Editor_Engine__classid))->
3365 + ORBIT_STUB_PreCall(_obj);
3366 + _ORBIT_epv->insertHTML(ORBIT_STUB_GetServant(_obj), html, ev);
3367 + ORBIT_STUB_PostCall(_obj);
3368 + } else { /* remote marshal */
3369 + gpointer _args[1];
3371 + _args[0] = (gpointer) & html;
3372 + ORBit_small_invoke_stub_n(_obj,
3373 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3374 + methods, 9, NULL, _args, NULL, ev);
3379 +GNOME_GtkHTML_Editor_Engine_freeze(GNOME_GtkHTML_Editor_Engine _obj,
3380 + CORBA_Environment * ev)
3382 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3384 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3385 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3387 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3388 + GNOME_GtkHTML_Editor_Engine__classid))->
3390 + ORBIT_STUB_PreCall(_obj);
3391 + _ORBIT_epv->freeze(ORBIT_STUB_GetServant(_obj), ev);
3392 + ORBIT_STUB_PostCall(_obj);
3393 + } else { /* remote marshal */
3394 + ORBit_small_invoke_stub_n(_obj,
3395 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3396 + methods, 10, NULL, NULL, NULL, ev);
3401 +GNOME_GtkHTML_Editor_Engine_thaw(GNOME_GtkHTML_Editor_Engine _obj,
3402 + CORBA_Environment * ev)
3404 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3406 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3407 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3409 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3410 + GNOME_GtkHTML_Editor_Engine__classid))->
3412 + ORBIT_STUB_PreCall(_obj);
3413 + _ORBIT_epv->thaw(ORBIT_STUB_GetServant(_obj), ev);
3414 + ORBIT_STUB_PostCall(_obj);
3415 + } else { /* remote marshal */
3416 + ORBit_small_invoke_stub_n(_obj,
3417 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3418 + methods, 11, NULL, NULL, NULL, ev);
3423 +GNOME_GtkHTML_Editor_Engine_undoBegin(GNOME_GtkHTML_Editor_Engine _obj,
3424 + const CORBA_char * undo_name,
3425 + const CORBA_char * redo_name,
3426 + CORBA_Environment * ev)
3428 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3430 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3431 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3433 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3434 + GNOME_GtkHTML_Editor_Engine__classid))->
3436 + ORBIT_STUB_PreCall(_obj);
3437 + _ORBIT_epv->undoBegin(ORBIT_STUB_GetServant(_obj), undo_name, redo_name,
3439 + ORBIT_STUB_PostCall(_obj);
3440 + } else { /* remote marshal */
3441 + gpointer _args[2];
3443 + _args[0] = (gpointer) & undo_name;
3444 + _args[1] = (gpointer) & redo_name;
3445 + ORBit_small_invoke_stub_n(_obj,
3446 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3447 + methods, 12, NULL, _args, NULL, ev);
3452 +GNOME_GtkHTML_Editor_Engine_undoEnd(GNOME_GtkHTML_Editor_Engine _obj,
3453 + CORBA_Environment * ev)
3455 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3457 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3458 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3460 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3461 + GNOME_GtkHTML_Editor_Engine__classid))->
3463 + ORBIT_STUB_PreCall(_obj);
3464 + _ORBIT_epv->undoEnd(ORBIT_STUB_GetServant(_obj), ev);
3465 + ORBIT_STUB_PostCall(_obj);
3466 + } else { /* remote marshal */
3467 + ORBit_small_invoke_stub_n(_obj,
3468 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3469 + methods, 13, NULL, NULL, NULL, ev);
3474 +GNOME_GtkHTML_Editor_Engine_ignoreWord(GNOME_GtkHTML_Editor_Engine _obj,
3475 + const CORBA_char * word,
3476 + CORBA_Environment * ev)
3478 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3480 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3481 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3483 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3484 + GNOME_GtkHTML_Editor_Engine__classid))->
3486 + ORBIT_STUB_PreCall(_obj);
3487 + _ORBIT_epv->ignoreWord(ORBIT_STUB_GetServant(_obj), word, ev);
3488 + ORBIT_STUB_PostCall(_obj);
3489 + } else { /* remote marshal */
3490 + gpointer _args[1];
3492 + _args[0] = (gpointer) & word;
3493 + ORBit_small_invoke_stub_n(_obj,
3494 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3495 + methods, 14, NULL, _args, NULL, ev);
3500 +GNOME_GtkHTML_Editor_Engine_dropUndo(GNOME_GtkHTML_Editor_Engine _obj,
3501 + CORBA_Environment * ev)
3503 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3505 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3506 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3508 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3509 + GNOME_GtkHTML_Editor_Engine__classid))->
3511 + ORBIT_STUB_PreCall(_obj);
3512 + _ORBIT_epv->dropUndo(ORBIT_STUB_GetServant(_obj), ev);
3513 + ORBIT_STUB_PostCall(_obj);
3514 + } else { /* remote marshal */
3515 + ORBit_small_invoke_stub_n(_obj,
3516 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3517 + methods, 15, NULL, NULL, NULL, ev);
3522 +GNOME_GtkHTML_Editor_Engine_hasUndo(GNOME_GtkHTML_Editor_Engine _obj,
3523 + CORBA_Environment * ev)
3525 + CORBA_boolean _ORBIT_retval;
3526 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3528 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3529 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3531 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3532 + GNOME_GtkHTML_Editor_Engine__classid))->
3534 + ORBIT_STUB_PreCall(_obj);
3535 + _ORBIT_retval = _ORBIT_epv->hasUndo(ORBIT_STUB_GetServant(_obj), ev);
3536 + ORBIT_STUB_PostCall(_obj);
3537 + } else { /* remote marshal */
3538 + ORBit_small_invoke_stub_n(_obj,
3539 + &GNOME_GtkHTML_Editor_Engine__iinterface.
3540 + methods, 16, &_ORBIT_retval, NULL, NULL, ev);
3543 + return _ORBIT_retval;
3545 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gui.c vim/src/gui.c
3546 --- vimcopy/src/gui.c Sat Jan 10 13:10:01 2004
3547 +++ vim/src/gui.c Sat Jan 10 13:06:43 2004
3548 @@ -439,8 +439,12 @@
3549 * Create the GUI shell.
3551 gui.in_use = TRUE; /* Must be set after menus have been set up */
3552 +#ifdef FEAT_GUI_COMPONENT
3553 + vim_bonobo_wait_for_instantiation();
3555 if (gui_mch_init() == FAIL)
3559 /* Avoid a delay for an error message that was printed in the terminal
3560 * where Vim was started. */
3561 @@ -4061,8 +4065,8 @@
3564 /* Need to wake up the main loop */
3565 - if (gtk_main_level() > 0)
3567 + if (MAIN_LEVEL() > 0)
3572 @@ -4275,8 +4279,12 @@
3576 - return ((!gui.in_use || gui.starting)
3577 -# ifndef NO_CONSOLE
3578 + return ((!gui.in_use || gui.starting || !gui.shell_created
3579 +#ifdef FEAT_GUI_COMPONENT
3580 + || gui.processing_call
3583 +# if !defined(NO_CONSOLE) && !defined(FEAT_GUI_COMPONENT)
3584 && !isatty(0) && !isatty(2)
3587 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gui.h vim/src/gui.h
3588 --- vimcopy/src/gui.h Tue May 6 12:02:22 2003
3589 +++ vim/src/gui.h Mon Oct 27 22:28:19 2003
3591 # include <gtk/gtk.h>
3594 +# if defined(FEAT_GUI_GNOME) && defined(FEAT_GUI_COMPONENT)
3595 + #include "libbonoboui.h"
3596 + #include "vim_bonobo_main.h"
3597 + #include "vim_bonobo_factory.h"
3598 + #define MAIN vim_bonobo_main
3599 + #define MAIN_LEVEL vim_bonobo_main_level
3600 + #define MAIN_QUIT vim_bonobo_main_quit
3601 + #define MAIN_ITERATION_DO vim_bonobo_main_iteration_do
3602 + #define NO_CONSOLE
3604 + #define MAIN gtk_main
3605 + #define MAIN_LEVEL gtk_main_level
3606 + #define MAIN_QUIT gtk_main_quit
3607 + #define MAIN_ITERATION_DO gtk_main_iteration_do
3610 #ifdef FEAT_GUI_BEOS
3611 # include "gui_beos.h"
3613 @@ -392,6 +408,14 @@
3614 GtkWidget *toolbar; /* toolbar */
3616 # ifdef FEAT_GUI_GNOME
3617 +# ifdef FEAT_GUI_COMPONENT
3620 + BonoboControl *control;
3621 + BonoboPersistStream * pstream;
3622 + BonoboPersistFile * pfile;
3623 + int processing_call; /* gui loop is handling a call */
3625 GtkWidget *menubar_h; /* menubar handle */
3626 GtkWidget *toolbar_h; /* toolbar handle */
3628 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gui_gtk.c vim/src/gui_gtk.c
3629 --- vimcopy/src/gui_gtk.c Thu Jan 15 10:17:11 2004
3630 +++ vim/src/gui_gtk.c Thu Jan 15 10:13:18 2004
3635 -#ifdef FEAT_GUI_GNOME
3637 /* Gnome redefines _() and N_(). Grrr... */
3640 @@ -549,9 +549,332 @@
3642 # endif /* !HAVE_GTK2 */
3644 +#ifdef FEAT_GUI_COMPONENT
3648 +verb_activate( BonoboUIComponent *uic, gpointer data, const char *cname )
3650 + gui_menu_cb((vimmenu_T *) data);
3652 + /* make sure the menu action is taken immediately */
3653 + if (MAIN_LEVEL() > 0)
3657 +/* Takes name (a label), and appends a normalized version of name to
3658 + * the destination string. Normalization in this case means taking only
3659 + * alphanumeric characters, and discarding all others. */
3660 +static void g_string_append_normalized_name( GString * dest, char_u * name )
3664 + if( name == NULL )
3669 + while( *cur != '\0' ) {
3671 + wc = g_utf8_get_char(cur);
3672 + if( g_unichar_isalnum( wc ) ) {
3673 + g_string_append_unichar( dest, wc );
3675 + cur = g_utf8_next_char(cur);
3679 +/* for the given menu, create the corresponding xml path.
3680 + * if to_parent is TRUE, returns the path to the parent of the given menu.
3683 +char * xml_path_for_menu( vimmenu_T * menu, int to_parent )
3685 + GString * normname;
3689 + normname = g_string_sized_new( 64 );
3690 + path = g_string_sized_new( 128 );
3692 + if( menu_is_toolbar(menu->name) ) {
3693 + /* "Toolbar" is a standard Bonobo UI element, but Vim uses "ToolBar", so we
3694 + * have to check for this. */
3695 + g_string_prepend( path, "/Toolbar");
3697 + g_string_assign( normname, "" );
3698 + g_string_append_normalized_name( normname, menu->dname );
3699 + g_string_prepend( path, normname->str );
3700 + g_string_prepend( path, "/" );
3702 + if( menu->parent == NULL ) {
3703 + if( menu && menu_is_menubar( menu->name ) ) {
3704 + g_string_prepend( path, "/menu" );
3708 + menu = menu->parent;
3710 + g_string_free( normname, TRUE );
3711 + retpath = path->str;
3712 + g_string_free( path, FALSE );
3716 + slash = g_strrstr(retpath, "/");
3717 + if( slash == retpath )
3722 + return( retpath );
3725 +/* Because the container which embeds Vim may not have the same toolbar icons
3726 + * installed, we need to send the icons in the XML stream. This function
3727 + * takes the given GtkImage, encodes it as XML and returns the resulting XML
3730 +gtk_image_to_xml_attrs( GtkImage * image)
3732 + GString * xml = g_string_sized_new(32);
3733 + GtkImageType type = gtk_image_get_storage_type(image);
3737 + if( type == GTK_IMAGE_STOCK ) {
3739 + GtkIconSet * iconset;
3740 + gchar * stockname;
3741 + GdkPixbuf * pixbuf;
3743 + gtk_image_get_stock(image, &stockname, &size);
3744 + pixbuf = gtk_widget_render_icon(gui.drawarea, stockname, size, NULL);
3745 + imagexml = bonobo_ui_util_pixbuf_to_xml(pixbuf);
3746 + g_string_append_printf(xml, " pixtype=\"pixbuf\" pixname=\"%s\"", imagexml);
3747 + g_object_unref(pixbuf);
3749 + } else if( type == GTK_IMAGE_PIXBUF ) {
3750 + imagexml = bonobo_ui_util_pixbuf_to_xml(gtk_image_get_pixbuf(image));
3751 + g_string_append_printf(xml, " pixtype=\"pixbuf\" pixname=\"%s\"", imagexml);
3755 + g_string_free(xml, FALSE);
3760 +/* Generate XML which represents Vim's menus and toolbars. Starts from the
3761 + * given menu entry. XML is appended to "xml", and commands/verbs are added
3762 + * to the "commands" list. If do_siblings is true, XML is also generated for
3763 + * the siblings of the given menu (following the menu->next pointer); otherwise
3764 + * only the menu and its descendents are processed.
3767 +void generate_gui_xml_recurse( vimmenu_T * menu, GString * xml, GSList ** commands, int do_siblings)
3769 + GString * normname = g_string_sized_new(16);
3770 + GString * verbname = g_string_sized_new(32);
3773 + BonoboUIComponent *uic;
3776 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (gui.control));
3780 + use_mnemonic = (p_wak[0] != 'n' );
3781 + label = translate_mnemonic_tag( menu->name, use_mnemonic );
3782 + g_string_assign( normname, "" );
3783 + g_string_append_normalized_name( normname, menu->dname );
3784 + if( menu->children ) {
3785 + if( menu_is_toolbar( menu->name )) {
3786 + g_string_append( xml, "<dockitem name=\"Toolbar\" look=\"icon\" tips=\"1\">");
3787 + generate_gui_xml_recurse( menu->children, xml, commands, TRUE );
3788 + g_string_append( xml, "</dockitem>");
3790 + g_string_append_printf( xml, "<submenu name=\"%s\" label=\"%s\">\n", normname->str, label);
3792 + generate_gui_xml_recurse( menu->children, xml, commands, TRUE );
3793 + g_string_append( xml, "</submenu>\n");
3795 + } else if( menu_is_separator(menu->name)) {
3796 + g_string_append( xml, "<separator />\n" );
3797 + } else if( menu->parent && menu_is_toolbar(menu->parent->name)) {
3798 + char * menupath = xml_path_for_menu(menu, FALSE);
3799 + GtkImage *image = NULL;
3803 + g_string_assign(verbname, "");
3804 + g_string_append_normalized_name(verbname, menupath);
3805 + vim_free(menupath);
3806 + image = GTK_IMAGE(create_menu_icon(menu, GTK_ICON_SIZE_SMALL_TOOLBAR));
3807 + imagexml = gtk_image_to_xml_attrs(image);
3808 + tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]);
3809 + g_string_append_printf( xml, "<toolitem name=\"%s\" label=\"%s\" verb=\"%s\" tip=\"%s\" %s />\n", normname->str, label, verbname->str, tooltip, imagexml);
3810 + gtk_object_sink(GTK_OBJECT(image));
3812 + CONVERT_TO_UTF8_FREE(tooltip);
3814 + command = g_strdup_printf( "<cmd name=\"%s\" sensitive=\"%c\" />\n", verbname->str, menu->sensitive ? '1' : '0');
3815 + *commands = g_slist_prepend( *commands, command );
3816 + bonobo_ui_component_add_verb(uic, verbname->str, verb_activate, menu);
3817 + } else if( menu_is_menubar(menu->name)) {
3818 + char * menupath = xml_path_for_menu(menu, FALSE);
3820 + g_string_assign(verbname, "");
3821 + g_string_append_normalized_name(verbname, menupath);
3822 + vim_free(menupath);
3824 + g_string_append_printf( xml, "<menuitem name=\"%s\" label=\"%s\" verb=\"%s\" />\n", normname->str, label, verbname->str);
3826 + command = g_strdup_printf( "<cmd name=\"%s\" sensitive=\"%c\" />\n", verbname->str, menu->sensitive ? '1' : '0');
3827 + *commands = g_slist_prepend( *commands, command );
3828 + bonobo_ui_component_add_verb(uic, verbname->str, verb_activate, menu);
3831 + vim_free( label );
3833 + if( do_siblings ) {
3834 + menu = menu->next;
3839 + g_string_free( normname, TRUE );
3842 +/* Create XML representing the menus and toolbars, and send them to the
3843 + * container application. We only need to process menu entries which
3844 + * have changed (they are marked "dirty"). */
3846 +void set_gui_xml(vimmenu_T * menu)
3848 + GSList * commands = NULL;
3850 + BonoboUIComponent *uic;
3851 + GString * xml = g_string_sized_new(1024);
3853 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (gui.control));
3855 + if( bonobo_ui_component_get_container(uic) == CORBA_OBJECT_NIL ) {
3860 + if( menu->dirty ) {
3861 + if (menu_is_popup(menu->name)) {
3863 + } else if( menu_is_menubar(menu->name)) {
3864 + char * menupath = xml_path_for_menu(menu, TRUE);
3865 + path_exists = bonobo_ui_component_path_exists(uic, menupath, NULL);
3866 + g_string_assign(xml, "");
3867 + generate_gui_xml_recurse (menu, xml, &commands, FALSE);
3868 + /*fprintf(stdout, "set %s\n", menupath);*/
3869 + /*fprintf(stdout, "set %s\n%s", menupath, xml->str);*/
3870 + /*fflush(stdout);*/
3871 + bonobo_ui_component_set(uic, menupath, xml->str, NULL);
3873 + } else if( menu_is_toolbar(menu->name)) {
3874 + char * menupath = xml_path_for_menu(menu, TRUE);
3875 + path_exists = bonobo_ui_component_path_exists(uic, menupath, NULL);
3876 + g_string_assign(xml, "");
3877 + generate_gui_xml_recurse (menu, xml, &commands, FALSE);
3878 + /*fprintf(stdout, "set %s\n", menupath);*/
3879 + /*fprintf(stdout, "set %s\n%s", menupath, xml->str);*/
3880 + /*fflush(stdout);*/
3881 + bonobo_ui_component_set(uic, menupath, xml->str, NULL);
3884 + menu->dirty = FALSE;
3886 + menu = menu->next;
3888 + /* the commands are inserted separately into a list, and set one by one,
3889 + * otherwise it's not possible to update a subtree of the UI
3891 + command = commands;
3892 + while( command ) {
3893 + /*fprintf(stdout, "set %s\n%s", "/commands", command->data);
3895 + bonobo_ui_component_set(uic, "/commands", command->data, NULL);
3896 + g_free(command->data);
3897 + command = command->next;
3899 + g_slist_free( commands );
3903 +/* remember whether a timeout has been scheduled for updating the gui */
3904 +static gboolean update_gui_idle_installed = FALSE;
3906 +/* if we have been embedded in a container, update the gui now, otherwise
3907 + * wait awhile and try again. */
3909 +update_gui_idle(gpointer data)
3911 + BonoboUIComponent *uic;
3913 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (gui.control));
3914 + if( bonobo_ui_component_get_container(uic) == CORBA_OBJECT_NIL ) {
3915 + /* we aren't in a container yet; try again later... */
3916 + g_timeout_add(100, &update_gui_idle, NULL);
3919 + bonobo_ui_component_freeze(uic, NULL);
3920 + set_gui_xml( (vimmenu_T *)root_menu );
3921 + update_gui_idle_installed = FALSE;
3922 + bonobo_ui_component_thaw(uic, NULL);
3923 + return FALSE; /* don't call me again */
3926 +/* Mark the given menu as dirty -- we need to re-send the XML representing
3927 + * this menu to the container. But don't do the update immediately; otherwise
3928 + * we'd be generating the complete UI XML each time a menu entry is added,
3929 + * which would be very slow. Instead, schedule an update in which all
3930 + * dirty menus will be processed. */
3932 +update_menu_later(vimmenu_T *menu)
3934 + if (!update_gui_idle_installed)
3936 + update_gui_idle_installed = TRUE;
3937 + g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
3938 + &update_gui_idle, NULL, NULL);
3940 + while( menu->parent )
3941 + menu = menu->parent;
3942 + menu->dirty = TRUE;
3945 +/* Schedule an update for the entire UI (all menus and toolbars) */
3946 +void update_ui_later()
3948 + vimmenu_T *menu = root_menu;
3950 + if (!update_gui_idle_installed)
3952 + update_gui_idle_installed = TRUE;
3953 + g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
3954 + &update_gui_idle, NULL, NULL);
3957 + menu->dirty = TRUE;
3958 + menu = menu->next;
3964 gui_mch_add_menu(vimmenu_T *menu, int idx)
3966 +#ifdef FEAT_GUI_COMPONENT
3967 + update_menu_later(menu);
3971 GtkWidget *parent_widget;
3974 if (vim_strchr(p_go, GO_TEAROFF) != NULL)
3975 gtk_widget_show(menu->tearoff_handle);
3976 gtk_menu_prepend(GTK_MENU(menu->submenu_id), menu->tearoff_handle);
3984 /* make sure the menu action is taken immediately */
3985 - if (gtk_main_level() > 0)
3987 + if (MAIN_LEVEL() > 0)
3991 # if defined(FEAT_TOOLBAR) && !defined(HAVE_GTK2)
3992 @@ -719,6 +1043,10 @@
3994 gui_mch_add_menu_item(vimmenu_T *menu, int idx)
3996 +#ifdef FEAT_GUI_COMPONENT
3997 + update_menu_later(menu);
4002 parent = menu->parent;
4003 @@ -821,6 +1149,7 @@
4004 gtk_signal_connect(GTK_OBJECT(menu->id), "activate",
4005 GTK_SIGNAL_FUNC(menu_item_activate), menu);
4009 #endif /* FEAT_MENU */
4011 @@ -845,6 +1174,10 @@
4015 +#ifdef FEAT_GUI_COMPONENT
4019 for (menu = root_menu; menu != NULL; menu = menu->next)
4021 if (menu->id == NULL)
4022 @@ -901,6 +1234,9 @@
4024 gui_mch_toggle_tearoffs(int enable)
4026 +#ifdef FEAT_GUI_COMPONENT
4029 recurse_tearoffs(root_menu, enable);
4031 #endif /* FEAT_MENU */
4032 @@ -1005,6 +1341,9 @@
4034 gui_mch_destroy_menu(vimmenu_T *menu)
4036 +#ifdef FEAT_GUI_COMPONENT
4039 # ifdef FEAT_TOOLBAR
4040 if (menu->parent != NULL && menu_is_toolbar(menu->parent->name))
4042 @@ -1119,8 +1458,8 @@
4044 gui_drag_scrollbar(sb, value, dragging);
4046 - if (gtk_main_level() > 0)
4048 + if (MAIN_LEVEL() > 0)
4052 /* SBAR_VERT or SBAR_HORIZ */
4053 @@ -1179,8 +1518,8 @@
4054 vw->browse_fname = (char_u *)g_strdup(gtk_file_selection_get_filename(
4055 GTK_FILE_SELECTION(vw->filedlg)));
4056 gtk_widget_hide(vw->filedlg);
4057 - if (gtk_main_level() > 0)
4059 + if (MAIN_LEVEL() > 0)
4064 @@ -1195,8 +1534,8 @@
4065 vw->browse_fname = NULL;
4067 gtk_widget_hide(vw->filedlg);
4068 - if (gtk_main_level() > 0)
4070 + if (MAIN_LEVEL() > 0)
4075 @@ -1210,8 +1549,8 @@
4079 - if (gtk_main_level() > 0)
4081 + if (MAIN_LEVEL() > 0)
4086 @@ -1294,7 +1633,7 @@
4088 gtk_widget_show(gui.filedlg);
4089 while (gui.filedlg && GTK_WIDGET_DRAWABLE(gui.filedlg))
4090 - gtk_main_iteration_do(TRUE);
4091 + MAIN_ITERATION_DO(TRUE);
4093 if (gui.browse_fname == NULL)
4095 @@ -1514,8 +1853,8 @@
4096 dlg_destroy_cb(int *p)
4098 *p = TRUE; /* set dialog_destroyed to break out of the loop */
4099 - if (gtk_main_level() > 0)
4101 + if (MAIN_LEVEL() > 0)
4106 @@ -1815,7 +2154,7 @@
4107 /* loop here until the dialog goes away */
4108 while (dialog_status == -1 && !dialog_destroyed
4109 && GTK_WIDGET_DRAWABLE(dialog))
4110 - gtk_main_iteration_do(TRUE);
4111 + MAIN_ITERATION_DO(TRUE);
4113 if (dialog_status < 0)
4115 @@ -2799,8 +3138,8 @@
4116 CONVERT_FROM_UTF8_FREE(find_text);
4119 - if (rc && gtk_main_level() > 0)
4120 - gtk_main_quit(); /* make sure cmd will be handled immediately */
4121 + if (rc && MAIN_LEVEL() > 0)
4122 + MAIN_QUIT(); /* make sure cmd will be handled immediately */
4125 /* our usual callback function */
4126 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gui_gtk_x11.c vim/src/gui_gtk_x11.c
4127 --- vimcopy/src/gui_gtk_x11.c Thu Jan 15 10:17:11 2004
4128 +++ vim/src/gui_gtk_x11.c Thu Jan 15 10:13:19 2004
4131 #ifdef FEAT_GUI_GNOME
4132 /* Gnome redefines _() and N_(). Grrr... */
4138 # ifdef bindtextdomain
4139 # undef bindtextdomain
4142 # if defined(FEAT_GETTEXT) && !defined(ENABLE_NLS)
4143 # define ENABLE_NLS /* so the texts in the dialog boxes are translated */
4145 @@ -615,9 +617,10 @@
4146 expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
4148 /* Skip this when the GUI isn't set up yet, will redraw later. */
4150 + if (gui.starting) {
4151 + g_warning("ignoring expose_event; gui still starting.\n");
4155 out_flush(); /* make sure all output has been processed */
4156 gui_redraw(event->area.x, event->area.y,
4157 event->area.width, event->area.height);
4159 xev.xproperty.state = PropertyNewValue;
4160 serverEventProc(GDK_WINDOW_XDISPLAY(widget->window), &xev);
4162 - if (gtk_main_level() > 0)
4164 + if (MAIN_LEVEL() > 0)
4169 @@ -760,6 +763,10 @@
4170 if (blink_state == BLINK_NONE)
4171 gui_mch_start_blink();
4173 +#ifdef FEAT_GUI_COMPONENT
4174 + /*gtk_plug_grab_focus(GTK_PLUG(gui.plug));*/
4175 + /*gtk_window_set_focus(GTK_WINDOW(gui.plug), gui.drawarea);*/
4177 /* make sure keyboard input goes there */
4178 if (gtk_socket_id == 0 || !GTK_WIDGET_HAS_FOCUS(gui.drawarea))
4179 gtk_widget_grab_focus(gui.drawarea);
4180 @@ -771,6 +778,11 @@
4182 leave_notify_event(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
4184 +#ifdef FEAT_GUI_COMPONENT
4185 + /*gtk_plug_ungrab_focus(GTK_PLUG(gui.plug));*/
4186 + /*gdk_display_keyboard_ungrab (gtk_widget_get_display (gui.drawarea),
4187 + gtk_get_current_event_time ());*/
4189 if (blink_state != BLINK_NONE)
4190 gui_mch_stop_blink();
4192 @@ -781,8 +793,16 @@
4194 focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
4196 + GdkEventMask mask;
4197 gui_focus_change(TRUE);
4199 +#ifdef FEAT_GUI_COMPONENT
4200 + gtk_widget_grab_focus(gui.drawarea);
4201 + mask = gdk_window_get_events(gui.drawarea->window);
4202 + mask |= GDK_KEY_PRESS | GDK_KEY_RELEASE;
4203 + gdk_window_set_events(gui.drawarea->window, mask);
4206 if (blink_state == BLINK_NONE)
4207 gui_mch_start_blink();
4211 focus_out_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
4213 +#ifdef FEAT_GUI_COMPONENT
4214 +/* gtk_plug_ungrab_focus(GTK_PLUG(gui.plug));*/
4216 gui_focus_change(FALSE);
4218 if (blink_state != BLINK_NONE)
4219 @@ -1138,8 +1161,8 @@
4221 gui_mch_mousehide(TRUE);
4223 - if (gtk_main_level() > 0)
4225 + if (MAIN_LEVEL() > 0)
4230 @@ -1174,8 +1197,8 @@
4232 clip_lose_selection(&clip_star);
4234 - if (gtk_main_level() > 0)
4236 + if (MAIN_LEVEL() > 0)
4241 @@ -1215,9 +1238,8 @@
4242 received_selection = RS_FAIL;
4243 /* clip_free_selection(cbd); ??? */
4245 - if (gtk_main_level() > 0)
4248 + if (MAIN_LEVEL() > 0)
4249 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4253 @@ -1298,8 +1320,8 @@
4254 g_free(tmpbuf_utf8);
4257 - if (gtk_main_level() > 0)
4259 + if (MAIN_LEVEL() > 0)
4260 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4264 @@ -1459,6 +1481,15 @@
4269 +#ifdef FEAT_GUI_COMPONENT
4270 + if( !vim_bonobo_init(&gui_argc, gui_argv))
4272 + /* in component mode, we don't care about trying to continue without
4273 + * a gui; if we can't create the factory, we might as well quit. */
4277 /* Don't use gtk_init() or gnome_init(), it exits on failure. */
4278 if (!gtk_init_check(&gui_argc, &gui_argv))
4280 @@ -1466,10 +1497,29 @@
4281 EMSG(_(e_opendisp));
4289 +#if FEAT_GUI_COMPONENT
4291 +control_activate_event(BonoboControl *control, gboolean activated)
4295 + gui_focus_change (TRUE);
4296 + if (blink_state == BLINK_NONE)
4297 + gui_mch_start_blink();
4299 + gui_focus_change (FALSE);
4300 + if (blink_state != BLINK_NONE)
4301 + gui_mch_stop_blink();
4308 /****************************************************************************
4309 * Mouse handling callbacks
4310 @@ -1530,8 +1580,8 @@
4311 /* inform the editor engine about the occurence of this event */
4312 gui_send_mouse_event(button, x, y, FALSE, vim_modifiers);
4314 - if (gtk_main_level() > 0)
4316 + if (MAIN_LEVEL() > 0)
4320 * Auto repeat timer handling.
4321 @@ -1726,8 +1776,8 @@
4322 vim_modifiers |= MOUSE_ALT;
4324 gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
4325 - if (gtk_main_level() > 0)
4326 - gtk_main_quit(); /* make sure the above will be handled immediately */
4327 + if (MAIN_LEVEL() > 0)
4328 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4332 @@ -1775,8 +1825,8 @@
4333 gui_send_mouse_event(button, (int)event->x, (int)event->y,
4334 FALSE, vim_modifiers);
4336 - if (gtk_main_level() > 0)
4337 - gtk_main_quit(); /* make sure the above will be handled immediately */
4338 + if (MAIN_LEVEL() > 0)
4339 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4343 @@ -1811,8 +1861,8 @@
4344 vim_modifiers |= MOUSE_ALT;
4346 gui_send_mouse_event(MOUSE_RELEASE, x, y, FALSE, vim_modifiers);
4347 - if (gtk_main_level() > 0)
4348 - gtk_main_quit(); /* make sure it will be handled immediately */
4349 + if (MAIN_LEVEL() > 0)
4350 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4354 @@ -2035,8 +2085,8 @@
4356 add_to_input_buf(dropkey + 3, (int)(sizeof(dropkey) - 3));
4358 - if (gtk_main_level() > 0)
4360 + if (MAIN_LEVEL() > 0)
4361 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4365 @@ -2502,6 +2552,7 @@
4367 mainwin_realize(GtkWidget *widget, gpointer data)
4369 +#ifndef FEAT_GUI_COMPONENT
4370 /* If you get an error message here, you still need to unpack the runtime
4373 @@ -2585,6 +2636,7 @@
4375 #endif /* !HAVE_GTK2 */
4377 +#endif /* FEAT_GUI_COMPONENT */
4379 #if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION))
4380 /* Register a handler for WM_SAVE_YOURSELF with GDK's low-level X I/F */
4381 @@ -2603,7 +2655,7 @@
4383 setup_save_yourself();
4385 -#ifdef FEAT_CLIENTSERVER
4386 +#if defined(FEAT_CLIENTSERVER) &&!defined(FEAT_GUI_COMPONENT)
4387 if (serverName == NULL && serverDelayedStartName != NULL)
4389 /* This is a :gui command in a plain vim with no previous server */
4390 @@ -2651,7 +2703,7 @@
4394 -#ifdef HAVE_GTK_MULTIHEAD
4395 +#if defined(HAVE_GTK_MULTIHEAD) && !defined(FEAT_GUI_COMPONENT)
4398 mainwin_screen_changed_cb(GtkWidget *widget,
4399 @@ -2976,7 +3028,11 @@
4400 #ifdef FEAT_GUI_GNOME
4403 - gui.mainwin = gnome_app_new("Vim", NULL);
4404 +# if defined(FEAT_GUI_COMPONENT)
4405 + gui.mainwin = NULL;
4407 + gui.mainwin = gnome_app_new("vim", NULL);
4410 /* Use the GNOME save-yourself functionality now. */
4412 @@ -2987,14 +3043,28 @@
4413 gui.mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
4416 +#ifdef FEAT_GUI_COMPONENT
4417 + vbox = gtk_vbox_new(FALSE, 0);
4420 gtk_widget_set_name(gui.mainwin, "vim-main-window");
4424 /* Create the PangoContext used for drawing all text. */
4425 +#ifdef FEAT_GUI_COMPONENT
4426 + gui.text_context = gtk_widget_create_pango_context(GTK_WIDGET(gui.vbox));
4428 gui.text_context = gtk_widget_create_pango_context(gui.mainwin);
4430 pango_context_set_base_dir(gui.text_context, PANGO_DIRECTION_LTR);
4433 +#ifdef FEAT_GUI_COMPONENT
4434 + bonobo_control_construct (BONOBO_CONTROL (gui.control), GTK_WIDGET(gui.vbox));
4435 + gtk_widget_add_events(GTK_WIDGET(gui.drawarea), GDK_VISIBILITY_NOTIFY_MASK);
4436 + gtk_widget_show_all(GTK_WIDGET(gui.vbox));
4439 gtk_window_set_policy(GTK_WINDOW(gui.mainwin), TRUE, TRUE, TRUE);
4441 @@ -3017,8 +3087,6 @@
4442 gui.accel_group = gtk_accel_group_get_default();
4445 - vbox = gtk_vbox_new(FALSE, 0);
4447 #ifdef FEAT_GUI_GNOME
4450 @@ -3034,6 +3102,9 @@
4451 gtk_container_add(GTK_CONTAINER(gui.mainwin), vbox);
4452 gtk_widget_show(vbox);
4456 +#ifndef FEAT_GUI_COMPONENT
4460 @@ -3139,6 +3210,7 @@
4461 gtk_box_pack_start(GTK_BOX(vbox), gui.toolbar, FALSE, FALSE, 0);
4463 #endif /* FEAT_TOOLBAR */
4464 +#endif /* FEAT_GUI_COMPONENT */
4466 gui.formwin = gtk_form_new();
4467 gtk_container_border_width(GTK_CONTAINER(gui.formwin), 0);
4468 @@ -3166,6 +3238,11 @@
4469 gtk_widget_show(gui.formwin);
4470 gtk_box_pack_start(GTK_BOX(vbox), gui.formwin, TRUE, TRUE, 0);
4472 +#ifdef FEAT_GUI_COMPONENT
4473 + GTK_WIDGET_SET_FLAGS (gui.drawarea, GTK_CAN_FOCUS);
4474 + g_signal_connect(G_OBJECT(gui.drawarea), "key_press_event",
4475 + G_CALLBACK(key_press_event), NULL);
4477 /* For GtkSockets, key-presses must go to the focus widget (drawarea)
4478 * and not the window. */
4479 gtk_signal_connect((gtk_socket_id == 0) ? GTK_OBJECT(gui.mainwin)
4480 @@ -3180,6 +3257,7 @@
4481 "key_release_event",
4482 G_CALLBACK(&key_release_event), NULL);
4484 +#endif /* FEAT_GUI_COMPONENT */
4485 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "realize",
4486 GTK_SIGNAL_FUNC(drawarea_realize_cb), NULL);
4487 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "unrealize",
4488 @@ -3211,16 +3289,27 @@
4490 gui.border_offset = gui.border_width;
4492 +#ifdef FEAT_GUI_COMPONENT
4493 + gtk_signal_connect(GTK_OBJECT(gui.drawarea), "visibility_notify_event",
4494 + GTK_SIGNAL_FUNC(visibility_event), NULL);
4496 gtk_signal_connect(GTK_OBJECT(gui.mainwin), "visibility_notify_event",
4497 GTK_SIGNAL_FUNC(visibility_event), NULL);
4499 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "expose_event",
4500 GTK_SIGNAL_FUNC(expose_event), NULL);
4503 * Only install these enter/leave callbacks when 'p' in 'guioptions'.
4504 * Only needed for some window managers.
4506 + * Force this on for bonobo, otherwise the toolbar gets the focus
4507 + * after you click a button, and you can't get the focus back to the
4510 +#ifndef FEAT_GUI_COMPONENT
4511 if (vim_strchr(p_go, GO_POINTER) != NULL)
4514 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "leave_notify_event",
4515 GTK_SIGNAL_FUNC(leave_notify_event), NULL);
4516 @@ -3228,10 +3317,19 @@
4517 GTK_SIGNAL_FUNC(enter_notify_event), NULL);
4520 +#ifdef FEAT_GUI_COMPONENT
4521 + g_signal_connect(G_OBJECT(gui.control), "activate",
4522 + G_CALLBACK (control_activate_event), NULL);
4523 + gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_out_event",
4524 + GTK_SIGNAL_FUNC(focus_out_event), NULL);
4525 + gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_in_event",
4526 + GTK_SIGNAL_FUNC(focus_in_event), NULL);
4528 gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_out_event",
4529 GTK_SIGNAL_FUNC(focus_out_event), NULL);
4530 gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_in_event",
4531 GTK_SIGNAL_FUNC(focus_in_event), NULL);
4534 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "motion_notify_event",
4535 GTK_SIGNAL_FUNC(motion_notify_event), NULL);
4536 @@ -3404,7 +3502,7 @@
4537 * otherwise the hints don't work. */
4538 width = gui_get_base_width();
4539 height = gui_get_base_height();
4541 +# if defined( HAVE_GTK2 ) && !defined(FEAT_GUI_COMPONENT)
4542 width += get_menu_tool_width();
4543 height += get_menu_tool_height();
4545 @@ -3451,8 +3549,18 @@
4546 form_configure_event(GtkWidget *widget, GdkEventConfigure *event,
4551 gtk_form_freeze(GTK_FORM(gui.formwin));
4552 - gui_resize_shell(event->width, event->height);
4553 +#ifdef FEAT_GUI_COMPONENT
4554 + /* width_inc and height_inc (see window manager hints, above) aren't
4555 + * respected for embedded controls, so we have to make a slight adjustment
4556 + * to make sure the bottom line doesn't get clipped. */
4557 + height = gui.char_height * ((event->height - 2 )/ gui.char_height);
4559 + height = event->height;
4561 + gui_resize_shell(event->width, height);
4562 gtk_form_thaw(GTK_FORM(gui.formwin));
4565 @@ -3584,8 +3692,10 @@
4567 highlight_gui_started(); /* re-init colors and fonts */
4569 +#ifndef FEAT_GUI_COMPONENT
4570 gtk_signal_connect(GTK_OBJECT(gui.mainwin), "destroy",
4571 GTK_SIGNAL_FUNC(mainwin_destroy_cb), NULL);
4574 #ifdef FEAT_HANGULIN
4575 hangul_keyboard_set();
4576 @@ -3653,7 +3763,9 @@
4580 - gtk_widget_show(gui.mainwin);
4581 +#ifndef FEAT_GUI_COMPONENT
4582 + gtk_widget_show(gui.mainwin);
4585 #if defined(FEAT_GUI_GNOME) && defined(HAVE_GTK2) && defined(FEAT_MENU)
4586 if (menu_handler != 0)
4587 @@ -3683,8 +3795,8 @@
4588 if (gui.mainwin != NULL)
4589 gtk_widget_destroy(gui.mainwin);
4591 - if (gtk_main_level() > 0)
4593 + if (MAIN_LEVEL() > 0)
4594 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4598 @@ -3731,6 +3843,7 @@
4600 force_shell_resize_idle(gpointer data)
4602 + g_warning("force_shell_resize_idle called!");
4603 if (gui.mainwin != NULL
4604 && GTK_WIDGET_REALIZED(gui.mainwin)
4605 && GTK_WIDGET_VISIBLE(gui.mainwin))
4606 @@ -3779,7 +3892,7 @@
4607 /* this will cause the proper resizement to happen too */
4608 update_window_manager_hints();
4611 +#if defined( HAVE_GTK2 ) && !defined(FEAT_GUI_COMPONENT)
4612 /* With GTK+ 2, changing the size of the form widget doesn't resize
4613 * the window. So lets do it the other way around and resize the
4614 * main window instead. */
4615 @@ -3870,6 +3983,7 @@
4619 +#ifndef FEAT_GUI_COMPONENT
4620 # ifdef FEAT_GUI_GNOME
4622 widget = gui.menubar_h;
4623 @@ -3886,6 +4000,7 @@
4625 update_window_manager_hints();
4629 #endif /* FEAT_MENU */
4631 @@ -3937,8 +4052,8 @@
4633 vw->fontname = (char_u *)gtk_font_selection_dialog_get_font_name(fs);
4634 gtk_widget_hide(vw->fontdlg);
4635 - if (gtk_main_level() > 0)
4637 + if (MAIN_LEVEL() > 0)
4638 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4642 @@ -3948,8 +4063,8 @@
4643 gui_T *vw = (gui_T *)cbdata;
4645 gtk_widget_hide(vw->fontdlg);
4646 - if (gtk_main_level() > 0)
4648 + if (MAIN_LEVEL() > 0)
4649 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4653 @@ -3959,8 +4074,8 @@
4654 gui_T *vw = (gui_T *)cbdata;
4657 - if (gtk_main_level() > 0)
4659 + if (MAIN_LEVEL() > 0)
4660 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4662 #endif /* !HAVE_GTK2 */
4664 @@ -4127,7 +4242,7 @@
4666 /* Wait for the font dialog to be closed. */
4667 while (gui.fontdlg && GTK_WIDGET_DRAWABLE(gui.fontdlg))
4668 - gtk_main_iteration_do(TRUE);
4669 + MAIN_ITERATION_DO(TRUE);
4671 if (gui.fontname != NULL)
4673 @@ -5640,8 +5755,13 @@
4675 gui_mch_update(void)
4677 +#ifdef FEAT_GUI_COMPONENT
4678 + if( gui.processing_call ) {
4682 while (gtk_events_pending() && !vim_is_input_buf_full())
4683 - gtk_main_iteration_do(FALSE);
4684 + MAIN_ITERATION_DO(TRUE);
4688 @@ -5652,8 +5772,8 @@
4689 /* Just inform the caller about the occurence of it */
4692 - if (gtk_main_level() > 0)
4694 + if (MAIN_LEVEL() > 0)
4695 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4697 return FALSE; /* don't happen again */
4699 @@ -5673,8 +5793,8 @@
4701 add_to_input_buf(bytes, 3);
4703 - if (gtk_main_level() > 0)
4705 + if (MAIN_LEVEL() > 0)
4710 @@ -5741,7 +5861,7 @@
4712 * Loop in GTK+ processing until a timeout or input occurs.
4717 /* Got char, return immediately */
4718 if (input_available())
4719 @@ -5816,6 +5936,7 @@
4720 gdk_window_clear(gui.drawarea->window);
4725 * Redraw any text revealed by scrolling up/down.
4727 @@ -5930,7 +6051,7 @@
4728 (guint32)GDK_CURRENT_TIME);
4730 while (received_selection == RS_NONE)
4731 - gtk_main(); /* wait for selection_received_cb */
4732 + MAIN(); /* wait for selection_received_cb */
4734 if (received_selection != RS_FAIL)
4736 @@ -5998,6 +6119,13 @@
4738 gui_mch_menu_grey(vimmenu_T *menu, int grey)
4740 +#ifdef FEAT_GUI_COMPONENT
4741 + if( menu->sensitive != !grey ) {
4742 + menu->sensitive = !grey;
4743 + update_menu_later(menu);
4747 if (menu->id == NULL)
4750 @@ -6133,6 +6261,40 @@
4751 /* The last set mouse pointer shape is remembered, to be used when it goes
4752 * from hidden to not hidden. */
4753 static int last_shape = 0;
4757 +static BonoboWindow *
4758 +bonobo_create_window(void)
4760 + BonoboWindow *win;
4761 + BonoboUIContainer *ui_container;
4762 + BonoboUIComponent *ui_component;
4764 + win = BONOBO_WINDOW (bonobo_window_new ("vim", "vim"));
4765 + ui_container = bonobo_window_get_ui_container (win);
4766 + bonobo_ui_engine_config_set_path (bonobo_window_get_ui_engine (win),
4767 + "/gnome-vim/UIConfig/kvps");
4769 + /* Create a UI component with which to communicate with the window */
4770 + ui_component = bonobo_ui_component_new_default ();
4772 + gui.component = ui_component;
4774 + /* Associate the BonoboUIComponent with the container */
4775 + bonobo_ui_component_set_container (
4776 + ui_component, BONOBO_OBJREF (ui_container), NULL);
4778 + //bonobo_ui_util_set_ui (ui_component, "",
4779 + //HELLO_SRCDIR HELLO_UI_XML,
4780 + //"bonobo-hello", NULL);
4782 + /* Associate our verb -> callback mapping with the BonoboWindow */
4783 + /* All the callback's user_data pointers will be set to 'win' */
4784 + //bonobo_ui_component_add_verb_list_with_data (ui_component, hello_verbs, win);
4791 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/main.c vim/src/main.c
4792 --- vimcopy/src/main.c Sat Jan 10 13:10:02 2004
4793 +++ vim/src/main.c Sat Jan 10 13:06:44 2004
4798 -# ifdef FEAT_GUI_MSWIN
4799 +# if defined(FEAT_GUI_MSWIN)
4800 # ifdef __BORLANDC__
4803 @@ -239,8 +239,12 @@
4804 TIME_MSG("locale set");
4808 +#if defined(FEAT_GUI_COMPONENT)
4809 + gui.dofork = FALSE; /* don't use fork when running as component */
4811 +# if defined(FEAT_GUI) && !defined(FEAT_GUI_COMPONENT)
4812 gui.dofork = TRUE; /* default is to use fork() */
4816 #if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER)
4817 @@ -439,6 +443,10 @@
4821 +#ifdef FEAT_GUI_COMPONENT
4825 if (TOLOWER_ASC(initstr[0]) == 'g')
4828 @@ -1634,12 +1642,14 @@
4829 * Call settmode and starttermcap here, so the T_KS and T_TI may be
4830 * defined by termcapinit and redifined in .exrc.
4832 +#ifndef FEAT_GUI_COMPONENT
4833 settmode(TMODE_RAW);
4834 if (need_wait_return || msg_didany)
4837 TIME_MSG("waiting for return");
4841 starttermcap(); /* start termcap if not done by wait_return() */
4843 @@ -1766,6 +1776,9 @@
4846 curbuf = curwin->w_buffer;
4848 +#ifdef FEAT_GUI_COMPONENT
4849 + persistent_buffer = curbuf;
4852 TIME_MSG("opening buffers");
4853 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/mbyte.c vim/src/mbyte.c
4854 --- vimcopy/src/mbyte.c Thu Jan 15 10:17:11 2004
4855 +++ vim/src/mbyte.c Thu Jan 15 10:13:20 2004
4856 @@ -3129,8 +3129,8 @@
4858 im_add_to_input((char_u *)str, (int)strlen(str));
4860 - if (gtk_main_level() > 0)
4862 + if (MAIN_LEVEL() > 0)
4867 @@ -4138,7 +4138,11 @@
4868 if (gui.fontset != NOFONTSET
4869 && gui.fontset->type == GDK_FONT_FONTSET)
4871 +#ifdef FEAT_GUI_COMPONENT
4872 + widget = gui.drawarea;
4874 widget = gui.mainwin;
4876 gdk_window_get_size(widget->window, &width, &height);
4878 attrmask |= (int)GDK_IC_STATUS_AREA;
4879 @@ -4719,9 +4723,15 @@
4880 while (event_queue != NULL && processing_queued_event)
4882 GdkEvent *ev = event_queue->data;
4884 + GtkWidget *output;
4887 - gtk_signal_emit_by_name((GtkObject*)gui.mainwin, "key_press_event",
4888 +#ifdef FEAT_GUI_COMPONENT
4889 + output = gui.drawarea;
4891 + output = gui.mainwin;
4893 + gtk_signal_emit_by_name((GtkObject*)output, "key_press_event",
4896 event_queue = event_queue->next;
4897 @@ -4733,8 +4743,8 @@
4898 key_press_event_queue = NULL;
4901 - if (gtk_main_level() > 0)
4903 + if (MAIN_LEVEL() > 0)
4908 @@ -4869,7 +4879,11 @@
4909 GtkWidget *widget = gui.drawarea;
4911 attr->style = (GdkIMStyle)xim_input_style;
4912 +#ifdef FEAT_GUI_COMPONENT
4913 + attr->client_window = gui.drawarea->window;
4915 attr->client_window = gui.mainwin->window;
4918 if ((colormap = gtk_widget_get_colormap(widget)) !=
4919 gtk_widget_get_default_colormap())
4920 @@ -4916,7 +4930,11 @@
4924 +#ifdef FEAT_GUI_COMPONENT
4925 + gdk_window_get_size(gui.drawarea->window, &width, &height);
4927 gdk_window_get_size(gui.mainwin->window, &width, &height);
4929 attrmask |= (int)GDK_IC_STATUS_AREA_REQ;
4930 attr->status_area.x = 0;
4931 attr->status_area.y = height - gui.char_height - 1;
4932 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/misc1.c vim/src/misc1.c
4933 --- vimcopy/src/misc1.c Sat Jan 10 13:10:02 2004
4934 +++ vim/src/misc1.c Sat Jan 10 13:06:46 2004
4935 @@ -2346,6 +2346,11 @@
4937 need_maketitle = TRUE; /* set window title later */
4939 +#if defined(FEAT_GUI_COMPONENT)
4940 + if( curbuf == persistent_buffer) {
4941 + component_set_dirty(TRUE);
4945 ++curbuf->b_changedtick;
4946 ++global_changedtick;
4947 @@ -2614,6 +2619,11 @@
4950 need_maketitle = TRUE; /* set window title later */
4952 +#if defined(FEAT_GUI_COMPONENT)
4953 + if( curbuf == persistent_buffer) {
4954 + component_set_dirty(FALSE);
4958 ++buf->b_changedtick;
4959 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/quote vim/src/quote
4960 --- vimcopy/src/quote Wed Dec 31 18:00:00 1969
4961 +++ vim/src/quote Thu Oct 23 17:20:23 2003
4965 +%g/^GtkHTML_QUOTE_ON/.,/GtkHTML_QUOTE_OFF/s/^/> /
4966 +%g/^> GtkHTML_QUOTE_ON/d
4967 +%g/^> GtkHTML_QUOTE_OFF/d
4970 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/structs.h vim/src/structs.h
4971 --- vimcopy/src/structs.h Sat Jan 10 13:10:03 2004
4972 +++ vim/src/structs.h Sat Jan 10 13:06:46 2004
4973 @@ -1039,6 +1039,10 @@
4974 char_u *b_p_bh; /* 'bufhidden' */
4975 char_u *b_p_bt; /* 'buftype' */
4977 +#if defined(FEAT_GUI_COMPONENT)
4978 + int emb_buffer; /* this buffer is associated with the container application,
4979 + and cannot be removed */
4981 int b_p_bl; /* 'buflisted' */
4983 int b_p_cin; /* 'cindent' */
4984 @@ -1231,6 +1235,9 @@
4985 signlist_T *b_signlist; /* list of signs to draw */
4988 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
4989 + pos_T b_saved_cursor_pos; /* start pos of last VIsual */
4994 @@ -1716,8 +1723,11 @@
4995 GtkWidget *tearoff_handle;
4996 GtkWidget *label; /* Used by "set wak=" code. */
4998 -#ifdef FEAT_GUI_MOTIF
4999 +#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_COMPONENT)
5000 int sensitive; /* turn button on/off */
5001 +#if defined(FEAT_GUI_COMPONENT)
5002 + int dirty; /* menu item has been updated; container needs to know */
5005 #if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF)
5006 Pixmap image; /* Toolbar image */
5007 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/undo.c vim/src/undo.c
5008 --- vimcopy/src/undo.c Sat Mar 8 14:01:28 2003
5009 +++ vim/src/undo.c Sat Nov 1 18:03:21 2003
5016 * u_sync: stop adding to the current entry list
5018 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim-container.xml vim/src/vim-container.xml
5019 --- vimcopy/src/vim-container.xml Wed Dec 31 18:00:00 1969
5020 +++ vim/src/vim-container.xml Sat Jul 26 13:16:48 2003
5025 + <cmd name="FileNewWindow" _label="_New Window" _tip="Open a new window"
5026 + pixtype="stock" pixname="gtk-new" accel="*Control*n"/>
5028 + <cmd name="FileOpen" _label="_Open..." _tip="Open a file"
5029 + pixtype="stock" pixname="gtk-open" accel="*Control*o"/>
5031 + <cmd name="FileCloseWindow" _label="_Close" _tip="Close window"
5032 + pixtype="stock" pixname="gtk-close" accel="*Control*w"/>
5034 + <cmd name="FileExit" _label="_Quit" _tip="Quit the program"
5035 + pixtype="stock" pixname="gtk-quit" accel="*Control*q"/>
5037 + <cmd name="Preferences" _label="_Preferences..." _tip="Change preferences" sensitive="0"
5038 + pixtype="stock" pixname="gtk-preferences"/>
5040 + <cmd name="HelpAbout" _label="_About" _tip="About this application"
5041 + pixtype="stock" pixname="About"/>
5042 + <cmd name="Help" _label="Contents" _tip="Help On this application"
5043 + pixtype="stock" pixname="Help" accel="F1"/>
5046 + <cmd name="DnDNewWindow" _label="Open in new window"/>
5047 + <cmd name="DnDSameWindow" _label="Open in this window"/>
5048 + <cmd name="DnDCancel" _label="Cancel"
5049 + pixtype="stock" pixname="Cancel"/>
5053 + <submenu name="File" _label="_File">
5055 + <menuitem name="FileNewWindow" verb=""/>
5057 + <placeholder name="Open Placeholder" delimit="top">
5058 + <menuitem name="FileOpen" verb=""/>
5061 + <placeholder name="File Items Placeholder" delimit="top"/>
5065 + <menuitem name="FileCloseWindow" verb=""/>
5067 + <menuitem name="FileExit" verb=""/>
5071 + <submenu name="Edit" _label="_Edit">
5072 + <menuitem name="Preferences" verb=""/>
5075 + <submenu name="View" _label="_View" hidden="1">
5076 + <placeholder name="View Preferences Placeholder"/>
5077 + <placeholder name="View Items Placeholder" delimit="top"/>
5080 + <submenu name="Help" _label="_Help">
5081 + <menuitem name="Help" verb=""/>
5082 + <menuitem name="HelpAbout" verb=""/>
5086 +<dockitem name="Toolbar" relief="none" homogeneous="1" behavior="exclusive">
5088 + <toolitem name="TBOpen" _label="Open" pixtype="stock"
5089 + pixname="Open" verb="FileOpen"/>
5091 + <toolitem name="TBCloseWindow" _label="Close" pixtype="stock"
5092 + pixname="Close" verb="FileCloseWindow"/>
5096 + <popup name="dragndrop">
5097 + <menuitem name="DnDNewWindow" verb=""/>
5098 + <menuitem name="DnDSameWindow" verb=""/>
5100 + <menuitem name="DnDCancel" verb=""/>
5105 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim.h vim/src/vim.h
5106 --- vimcopy/src/vim.h Sat Jan 10 13:10:03 2004
5107 +++ vim/src/vim.h Sat Jan 10 13:06:47 2004
5108 @@ -739,6 +739,10 @@
5109 #define READ_STDIN 0x04 /* read from stdin */
5110 #define READ_BUFFER 0x08 /* read from curbuf (converting stdin) */
5111 #define READ_DUMMY 0x10 /* reading into a dummy buffer */
5112 +#define READ_EMB_STREAM 0x20 /* read from container stream object
5113 + (i.e. Bonobo Persist Stream) */
5114 +#define READ_EMB_FILE 0x40 /* read from container file object
5115 + (i.e. Bonobo Persist File) */
5117 /* Values for change_indent() */
5118 #define INDENT_SET 1 /* set indent */
5119 @@ -1026,6 +1030,7 @@
5120 EVENT_CURSORHOLD, /* cursor in same position for a while */
5121 EVENT_FUNCUNDEFINED, /* if calling a function which doesn't exist */
5122 EVENT_REMOTEREPLY, /* upon string reception from a remote vim */
5123 + EVENT_EMBEDDED_COMPONENT, /* upon embedding of vim as a component */
5124 NUM_EVENTS /* MUST be the last one */
5127 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_control.c vim/src/vim_bonobo_control.c
5128 --- vimcopy/src/vim_bonobo_control.c Wed Dec 31 18:00:00 1969
5129 +++ vim/src/vim_bonobo_control.c Sat Jan 10 21:03:08 2004
5132 + * vim_bonobo_control.c
5135 + * Jason Hildebrand <jason@peaceworks.ca>
5141 +#include "vim_bonobo_control.h"
5142 +#include "gtkhtml_editor.h"
5145 +#include <libbonoboui.h>
5146 +#include <libbonobo.h>
5147 +/*#include <libnautilus/nautilus-view.h>*/
5148 +#include <X11/Intrinsic.h>
5149 +#include <X11/Xatom.h>
5150 +#include <gdk/gdkx.h>
5152 +struct _VimControlPrivate {
5153 + BonoboUIComponent *component;
5156 +static GObjectClass *vim_control_parent_class;
5159 +quit_vim(gpointer data)
5161 + getout_preserve_modified(0);
5165 +vim_control_destroy (BonoboObject *control)
5167 + BonoboUIComponent *uic;
5169 + g_return_if_fail (control != NULL);
5170 + g_return_if_fail (VIM_IS_CONTROL (control));
5172 + g_message ("Destroying VimControl...");
5174 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
5175 + if( uic != CORBA_OBJECT_NIL )
5176 + bonobo_ui_component_unset_container (uic, NULL);
5178 + BONOBO_OBJECT_CLASS (vim_control_parent_class)->destroy (control);
5180 + /* we only support creating one vim control per process, so when this one
5181 + * is finished, we're done. */
5182 + g_timeout_add(50, &quit_vim, NULL);
5186 +vim_control_finalize (GObject *object)
5188 + VimControl *control;
5190 + g_return_if_fail (object != NULL);
5191 + g_return_if_fail (VIM_IS_CONTROL (object));
5193 + control = VIM_CONTROL (object);
5195 + g_free (control->priv);
5197 + G_OBJECT_CLASS (vim_control_parent_class)->finalize (object);
5201 +vim_control_set_ui_container (VimControl *control,
5202 + Bonobo_UIContainer ui_container)
5204 + BonoboUIComponent *uic;
5206 + g_return_if_fail (control != NULL);
5207 + g_return_if_fail (VIM_IS_CONTROL (control));
5208 + g_return_if_fail (ui_container != CORBA_OBJECT_NIL);
5210 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
5211 + bonobo_ui_component_set_container (uic, ui_container, NULL);
5213 + /* schedule a UI update */
5214 + update_ui_later();
5218 +vim_control_unset_ui_container (VimControl *control)
5220 + BonoboUIComponent *uic;
5222 + g_return_if_fail (control != NULL);
5223 + g_return_if_fail (VIM_IS_CONTROL (control));
5225 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
5226 + bonobo_ui_component_unset_container (uic, NULL);
5229 +static grab_keys = 0;
5232 +static GdkFilterReturn
5233 +filter_key_events (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
5235 + /* GdkScreen *screen = gdk_drawable_get_screen (event->any.window);
5236 + GdkDisplay *display = gdk_screen_get_display (screen);*/
5237 + XEvent *xevent = (XEvent *)gdk_xevent;
5239 + GdkFilterReturn return_val;
5241 + return_val = GDK_FILTER_CONTINUE;
5243 + switch (xevent->type)
5246 + g_warning("Key press!");
5250 + g_warning("Key release!");
5256 + return return_val;
5261 +set_frame_cb (BonoboControl *object, gpointer data)
5263 + Bonobo_ControlFrame frame;
5264 + VimControl *control;
5266 + g_return_if_fail (object != NULL);
5267 + g_return_if_fail (VIM_IS_CONTROL (object));
5269 + frame = bonobo_control_get_control_frame (object, NULL);
5270 + if (frame == CORBA_OBJECT_NIL)
5272 + CORBA_Object_release (frame, NULL);
5274 + control = VIM_CONTROL (object);
5276 + Bonobo_UIContainer ui_container;
5278 + ui_container = bonobo_control_get_remote_ui_container (BONOBO_CONTROL (control), NULL);
5279 + if (ui_container != CORBA_OBJECT_NIL) {
5280 + vim_control_set_ui_container (control, ui_container);
5281 + bonobo_object_release_unref (ui_container, NULL);
5287 +embedded_cb (GtkPlug *plug)
5291 + int actual_format;
5292 + unsigned long actual_length;
5293 + unsigned long remaining_bytes;
5294 + unsigned char * wm_class_value;
5298 + Window * children = NULL;
5299 + unsigned int nchildren;
5302 + wm_class = gdk_x11_get_xatom_by_name("WM_CLASS");
5303 + win = GDK_WINDOW_XID(plug->socket_window);
5306 + /*g_warning("checking xid %d", win);*/
5307 + result = XGetWindowProperty (GDK_WINDOW_XDISPLAY (plug->socket_window),
5309 + wm_class, 0, 120, False, XA_STRING,
5310 + &actual_type, &actual_format,
5311 + &actual_length, &remaining_bytes, &wm_class_value);
5312 + if( result == Success && actual_type != None) {
5313 + /*g_warning("WM_CLASS is %s", wm_class_value);*/
5314 + apply_autocmds(EVENT_EMBEDDED_COMPONENT, wm_class_value, NULL, FALSE, persistent_buffer);
5315 + Xfree(wm_class_value);
5318 + gdk_error_trap_push ();
5319 + result = XQueryTree(GDK_WINDOW_XDISPLAY(plug->socket_window),
5321 + &root, &parent, &children, &nchildren);
5322 + if (gdk_error_trap_pop () || !result) {
5329 + if( root == parent) {
5330 + /* we've reached the root window */
5338 +vim_control_class_init (VimControl *klass)
5340 + GObjectClass *gobject_class = (GObjectClass *)klass;
5341 + BonoboObjectClass *bonobo_object_class = (BonoboObjectClass *)klass;
5342 + BonoboControlClass *control_class = (BonoboControlClass *)klass;
5344 + vim_control_parent_class= g_type_class_peek_parent (klass);
5346 + bonobo_object_class->destroy = vim_control_destroy;
5347 + gobject_class->finalize = vim_control_finalize;
5350 +static char_u * stream_buffer = NULL;
5351 +static int stream_offset = 0;
5352 +static CORBA_long stream_length = 0;
5353 +static Bonobo_Stream current_stream;
5355 +/* It seems like it is an error to attempt to read more data
5356 + * than is available from a bonobo stream. So we slurp in
5357 + * the entire file in one chunk, and then pass it back in
5358 + * pieces to the caller.
5361 +vim_control_persist_stream_read(char_u * buffer, int reqsize)
5365 + if( stream_offset >= stream_length ) {
5368 + read_size = stream_length - stream_offset >= reqsize ?
5369 + reqsize : stream_length - stream_offset;
5370 + mch_memmove(buffer, &stream_buffer[stream_offset], read_size);
5371 + stream_offset += read_size;
5376 +vim_control_persist_stream_write(char_u * buffer, int reqsize)
5378 + CORBA_Environment ev;
5380 + CORBA_exception_init(&ev);
5381 + bonobo_stream_client_write(current_stream, buffer, reqsize, &ev);
5382 + if (ev._major != CORBA_NO_EXCEPTION ) {
5383 + g_warning("Error writing to stream");
5384 + CORBA_exception_free (&ev);
5387 + CORBA_exception_free (&ev);
5392 +component_set_dirty(gboolean dirty)
5394 + bonobo_persist_set_dirty(BONOBO_PERSIST(gui.pstream), dirty);
5395 + bonobo_persist_set_dirty(BONOBO_PERSIST(gui.pfile), dirty);
5398 +static void load_buffer_from_stream( const Bonobo_Stream stream,
5399 + Bonobo_Persist_ContentType type,
5400 + CORBA_Environment *ev)
5402 + exarg_T ea; /* Ex command arguments */
5404 + g_warning ("load_buffer_from_stream");
5406 + stream_buffer = bonobo_stream_client_read( stream, -1, &stream_length, ev);
5407 + if (ev->_major != CORBA_NO_EXCEPTION) {
5408 + g_warning("Error reading from stream");
5411 + stream_offset = 0;
5413 + if( persistent_buffer ) {
5414 + /* make it possible to delete the existing buffer, so that it
5415 + * can be replaced with what we are about to load */
5416 + persistent_buffer->emb_buffer = FALSE;
5419 + vim_memset(&ea, 0, sizeof(ea));
5420 + ea.cmd = "e ++enc=utf-8";
5421 + ea.force_enc = 8; /* this is the offset of "utf-8" in the cmd */
5423 + read_from_container = PERSIST_STREAM_IO;
5424 + do_ecmd(0, NULL, NULL, &ea, 1, ECMD_OLDBUF|ECMD_FORCEIT);
5425 + read_from_container = NORMAL_IO;
5427 + /* we've set the fileencoding to utf-8; set encoding to utf-8 as * well.*/
5428 + do_cmdline_cmd("set encoding=utf-8");
5430 + /* remember this buffer */
5431 + persistent_buffer = curbuf;
5432 + ga_clear(&error_ga);
5433 + g_free(stream_buffer);
5436 + /* run a filter to obtain plain text from the html */
5437 + if( !strcmp( type, "text/html" )) {
5438 + vim_bonobo_call_begin();
5439 + /* Substitutions to recognize quoted text */
5440 + do_cmdline_cmd("%s/<!--+GtkHTML[^>]*class=\"ClueFlow\"[^>]*key=\"orig\"[^>]*value=\"1\">-->/<pre>GtkHTML_QUOTE_ON<\\/pre>");
5441 + do_cmdline_cmd("%s/<!--+GtkHTML[^>]*class=\"ClueFlow\"[^>]*clear=\"orig\"[^>]*>-->/<pre>GtkHTML_QUOTE_OFF<\\/pre>");
5442 + do_cmdline_cmd("%s/<\\/i><\\/blockquote>/<\\/pre><\\/i><\\/blockquote>/");
5443 + do_cmdline_cmd("%!html2text -nobs");
5444 + do_cmdline_cmd("call EvoQuote()");
5445 + vim_bonobo_call_end();
5447 + do_cmdline_cmd("set nomodified");
5448 + component_set_dirty(FALSE);
5451 +static void load_buffer_from_stream_cb(BonoboPersistStream *ps,
5452 + const Bonobo_Stream stream,
5453 + Bonobo_Persist_ContentType type,
5455 + CORBA_Environment *ev)
5457 + load_buffer_from_stream(stream, type, ev);
5461 +save_buffer_to_stream( const Bonobo_Stream stream,
5462 + Bonobo_Persist_ContentType type,
5463 + CORBA_Environment *ev)
5466 + exarg_T ea; /* Ex command arguments */
5468 + /*g_warning ("save_buffer_to_stream");*/
5470 + current_stream = stream;
5471 + write_to_container = PERSIST_STREAM_IO;
5473 + if( !strcmp(type, "text/html")) {
5474 + vim_control_persist_stream_write("<pre>", 5);
5477 + vim_memset(&ea, 0, sizeof(ea));
5478 + ea.cmd = "e ++enc=utf-8";
5479 + ea.force_enc = 8; /* this is the offset of "utf-8" in the cmd */
5481 + buf = persistent_buffer;
5482 + buf_write(buf, "dummy", "dummy", 1, buf->b_ml.ml_line_count,
5483 + &ea, FALSE, FALSE, TRUE, TRUE);
5484 + if( !strcmp(type, "text/html")) {
5485 + vim_control_persist_stream_write("</pre>", 6);
5487 + write_to_container = NORMAL_IO;
5488 + ga_clear(&error_ga);
5492 +save_buffer_to_stream_cb(BonoboPersistStream *ps,
5493 + const Bonobo_Stream stream,
5494 + Bonobo_Persist_ContentType type,
5496 + CORBA_Environment *ev)
5498 + save_buffer_to_stream(stream, type, ev);
5502 +load_buffer_from_file (BonoboPersistFile *pf,
5503 + const CORBA_char *filename,
5504 + CORBA_Environment *ev,
5507 + Bonobo_PersistStream ps = closure;
5508 + BonoboStream *stream;
5511 + stream = bonobo_get_object(filename, "IDL:Bonobo/Stream:1.0", ev);
5516 + load_buffer_from_stream (ps, "text/plain", ev);
5517 + return 0; /* Return 0 on success */
5521 +save_to_file (BonoboPersistFile *pf,
5522 + const CORBA_char *filename,
5523 + CORBA_Environment *ev,
5526 + Bonobo_PersistStream ps = closure;
5527 + BonoboStream *stream;
5531 + stream = bonobo_stream_open (
5532 + BONOBO_IO_DRIVER_FS,
5533 + filename, Bonobo_STORAGE_WRITE | Bonobo_STORAGE_CREATE,
5534 + S_IRUSR | S_IWUSR | S_IRGRP);
5539 + save_buffer_to_stream (NULL, ps, "text/plain", ev);
5541 + return 0; /* Return 0 on success */
5545 +Bonobo_Persist_ContentTypeList *
5546 +persist_stream_types( BonoboPersistStream * ps, void * closure, CORBA_Environment *ev )
5548 + /*g_warning ("persist_stream_types");*/
5549 + return bonobo_persist_generate_content_types(2, "text/plain", "text/html");
5555 +nv_load_location_cb (NautilusView *view, const char *location, gpointer user_data)
5557 + g_return_if_fail (NAUTILUS_IS_VIEW (view));
5558 + g_return_if_fail (location != NULL);
5560 + nautilus_view_report_load_underway (NAUTILUS_VIEW (view));
5562 + /* FIXME: load the file here (using gnome-vfs)! */
5563 + nautilus_view_report_load_complete (NAUTILUS_VIEW (view));
5568 + EDITOR_NEEDS_ESCAPE
5569 +} EditorControlProps;
5571 +editor_get_prop (BonoboPropertyBag *bag,
5574 + CORBA_Environment *ev,
5575 + gpointer user_data)
5577 + //GtkHTMLControlData *cd = user_data;
5580 + case EDITOR_NEEDS_ESCAPE:
5581 + BONOBO_ARG_SET_BOOLEAN (arg, TRUE);
5584 + bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound);
5590 +editor_set_prop (BonoboPropertyBag *bag,
5591 + const BonoboArg *arg,
5593 + CORBA_Environment *ev,
5594 + gpointer user_data)
5596 + //GtkHTMLControlData *cd = user_data;
5599 + case EDITOR_NEEDS_ESCAPE:
5600 + bonobo_exception_set (ev, ex_Bonobo_PropertyBag_ReadOnly);
5603 + bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound);
5609 +vim_control_init (VimControl *control)
5611 + control->priv = g_new0 (VimControlPrivate, 1);
5614 +BONOBO_TYPE_FUNC (VimControl, BONOBO_TYPE_CONTROL, vim_control);
5617 +vim_control_add_interfaces (VimControl *control,
5618 + BonoboObject *to_aggregate)
5620 + BonoboPersistFile *file;
5621 + //NautilusView *nv;
5622 + BonoboPersistStream *stream;
5623 + EditorEngine *engine; /* GtkHTML editor engine interface */
5624 + //BonoboItemContainer *item_container;
5627 + g_return_val_if_fail (VIM_IS_CONTROL (control), NULL);
5628 + g_return_val_if_fail (BONOBO_IS_OBJECT (to_aggregate), NULL);
5630 + /* Interface Bonobo::PersistStream */
5631 + stream = bonobo_persist_stream_new (load_buffer_from_stream_cb,
5632 + save_buffer_to_stream_cb,
5633 + persist_stream_types,
5637 + bonobo_object_unref (BONOBO_OBJECT (to_aggregate));
5640 + bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5641 + BONOBO_OBJECT (stream));
5642 + gui.pstream = stream;
5644 + /* Interface Bonobo::PersistFile */
5645 + file = bonobo_persist_file_new (load_buffer_from_file,
5646 + save_buffer_to_stream, VIM_OAFIID, control);
5648 + bonobo_object_unref (BONOBO_OBJECT (to_aggregate));
5651 + bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5652 + BONOBO_OBJECT (file));
5656 + nv = nautilus_view_new_from_bonobo_control(BONOBO_CONTROL(control));
5658 + bonobo_object_unref (BONOBO_OBJECT(to_aggregate));
5661 + bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5662 + BONOBO_OBJECT (nv));
5664 + g_signal_connect (G_OBJECT (nv), "load_location",
5665 + G_CALLBACK (nv_load_location_cb), NULL);
5668 + engine = editor_engine_new();
5670 + bonobo_object_unref (BONOBO_OBJECT(to_aggregate));
5673 + bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5674 + BONOBO_OBJECT (engine));
5676 + return to_aggregate;
5680 +vim_control_construct (VimControl *control)
5682 + GtkWidget *button;
5685 + GtkAccelGroup *group;
5686 + GClosure *closure;
5687 + //VimControlPrivate *priv;
5688 + BonoboPropertyBag *pb;
5691 + g_return_val_if_fail (control != NULL, NULL);
5692 + g_return_val_if_fail (VIM_IS_CONTROL (control), NULL);
5695 + if (!vim_control_add_interfaces (control, BONOBO_OBJECT (control)))
5698 + gui.control = BONOBO_CONTROL(control);
5699 + gui.plug = (BonoboPlug *)bonobo_control_get_plug(control);
5700 + gui.mainwin = GTK_WIDGET(gui.plug);
5703 + g_signal_connect (control, "set_frame", G_CALLBACK (set_frame_cb), NULL);
5704 + g_signal_connect (gui.plug, "embedded", G_CALLBACK (embedded_cb), NULL);
5706 + /* Create the vim-view */
5707 + //priv->image_view = vim_image_view_new (vim, FALSE);
5708 + //if (!priv->image_view) {
5709 + //bonobo_object_unref (BONOBO_OBJECT (control));
5713 + pb = bonobo_property_bag_new (editor_get_prop, editor_set_prop, NULL);
5714 + bonobo_control_set_properties (control, BONOBO_OBJREF (pb), NULL);
5716 + def = bonobo_arg_new (BONOBO_ARG_BOOLEAN);
5717 + BONOBO_ARG_SET_BOOLEAN (def, TRUE);
5719 + bonobo_property_bag_add (pb, "EditorNeedsEscape", EDITOR_NEEDS_ESCAPE,
5720 + BONOBO_ARG_BOOLEAN, def,
5721 + "Whether the editor requires Escape key events",
5726 + bonobo_object_unref (BONOBO_OBJECT (pb));
5732 +vim_control_new (void)
5734 + VimControl *control;
5736 + g_message ("Creating VimControl...");
5738 + control = g_object_new (VIM_CONTROL_TYPE, NULL);
5740 + return vim_control_construct (control);
5743 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_control.h vim/src/vim_bonobo_control.h
5744 --- vimcopy/src/vim_bonobo_control.h Wed Dec 31 18:00:00 1969
5745 +++ vim/src/vim_bonobo_control.h Sat Jul 26 13:16:48 2003
5748 + * vim_bonobo_control.h
5751 + * Jason Hildebrand (jason@peaceworks.ca)
5755 +#ifndef _VIM_CONTROL_H_
5756 +#define _VIM_CONTROL_H_
5758 +#include <bonobo/bonobo-control.h>
5759 +#define VIM_OAFIID "OAFIID:Vim_Control"
5760 +#define NORMAL_IO 0
5761 +#define PERSIST_STREAM_IO 1
5762 +#define PERSIST_FILE_IO 2
5766 +#define VIM_CONTROL_TYPE (vim_control_get_type ())
5767 +#define VIM_CONTROL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), VIM_CONTROL_TYPE, VimControl))
5768 +#define VIM_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), VIM_CONTROL_TYPE, VimControlClass))
5770 +#define VIM_IS_CONTROL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), VIM_CONTROL_TYPE))
5771 +#define VIM_IS_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), VIM_CONTROL_TYPE))
5772 +#define VIM_CONTROL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), VIM_CONTROL_TYPE, VimControlClass))
5774 +typedef struct _VimControl VimControl;
5775 +typedef struct _VimControlClass VimControlClass;
5776 +typedef struct _VimControlPrivate VimControlPrivate;
5778 +struct _VimControl {
5779 + BonoboControl control;
5781 + VimControlPrivate *priv;
5784 +struct _VimControlClass {
5785 + BonoboControlClass parent_class;
5788 +GType vim_control_get_type (void);
5789 +VimControl *vim_control_new (void);
5790 +VimControl *vim_control_construct (VimControl *control);
5792 +void set_curbuf_persistent(void);
5796 +#endif /* _VIM_CONTROL_H_*/
5797 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_factory.c vim/src/vim_bonobo_factory.c
5798 --- vimcopy/src/vim_bonobo_factory.c Wed Dec 31 18:00:00 1969
5799 +++ vim/src/vim_bonobo_factory.c Sun Oct 26 16:51:53 2003
5802 + * vim_bonobo_factory.c
5805 + * Jason Hildebrand (jason@peaceworks.ca)
5810 +#include "version.h"
5811 +#include <bonobo/bonobo-generic-factory.h>
5812 +#include "vim_bonobo_control.h"
5814 +static BonoboGenericFactory *factory = NULL;
5815 +static int vim_instantiated = 0;
5817 +static BonoboObject *
5818 +vim_bonobo_factory(BonoboGenericFactory *this,
5819 + const char *oaf_iid,
5823 + BonoboObject *retval;
5825 + g_return_val_if_fail (this != NULL, NULL);
5826 + g_return_val_if_fail (oaf_iid != NULL, NULL);
5828 + if( vim_instantiated ) {
5829 + /* we cannot instantiate more than one control from this process,
5830 + * because of all of vim's global variables */
5834 + g_message ("Trying to produce a '%s'...", oaf_iid);
5836 + if (strcmp (oaf_iid, VIM_OAFIID) == 0) {
5837 + vim = vim_control_new ();
5840 + retval = BONOBO_OBJECT (vim);
5842 + g_warning ("Unknown IID `%s' requested", oaf_iid);
5845 + vim_instantiated = 1;
5850 +/* wait until this component is instantiated */
5851 +int vim_bonobo_wait_for_instantiation()
5853 + while( !vim_instantiated) {
5854 + MAIN_ITERATION_DO(TRUE);
5859 +int vim_bonobo_init(int *argc, char *argv[])
5861 + if (!bonobo_ui_init ("gnome-vim", VIM_VERSION_SHORT, argc, argv))
5862 + g_error (_("Could not initialize Bonobo"));
5864 + factory = bonobo_generic_factory_new (
5865 + VIM_FACTORY_OAFIID, vim_bonobo_factory, NULL);
5867 + if (factory == NULL) {
5868 + g_error ("Couldn't create factory.\n");
5874 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_factory.h vim/src/vim_bonobo_factory.h
5875 --- vimcopy/src/vim_bonobo_factory.h Wed Dec 31 18:00:00 1969
5876 +++ vim/src/vim_bonobo_factory.h Sun Oct 26 16:55:12 2003
5879 + * vim_bonobo_factory.h
5882 + * Jason Hildebrand (jason@peaceworks.ca)
5886 +#if !defined( _VIM_BONOBO_FACTORY_H)
5887 +#define _VIM_BONOBO_FACTORY_H
5889 +#define VIM_FACTORY_OAFIID "OAFIID:Vim_Control_Factory"
5891 +void gui_component_init(int *argc, char *argv []);
5892 +int gui_component_wait_for_instantiation(void);
5895 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_main.c vim/src/vim_bonobo_main.c
5896 --- vimcopy/src/vim_bonobo_main.c Wed Dec 31 18:00:00 1969
5897 +++ vim/src/vim_bonobo_main.c Sun Oct 26 20:04:35 2003
5899 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5902 +#include <glib/gmain.h>
5903 +#include <glib-object.h>
5904 +#include <bonobo/Bonobo.h>
5906 +static guint bonobo_main_loop_level = 0;
5907 +static GSList * bonobo_main_loops = NULL;
5909 +static gboolean in_bonobo_call = FALSE;
5915 + * Activates the Bonobo POA Manager and enters the main event loop.
5918 +vim_bonobo_main (void)
5922 + if( in_bonobo_call ) {
5926 + bonobo_activate ();
5928 + bonobo_main_loop_level++;
5930 + loop = g_main_loop_new (NULL, TRUE);
5931 + bonobo_main_loops = g_slist_prepend (bonobo_main_loops, loop);
5933 + if (g_main_loop_is_running (bonobo_main_loops->data))
5934 + g_main_loop_run (loop);
5936 + bonobo_main_loops = g_slist_remove (bonobo_main_loops, loop);
5938 + g_main_loop_unref (loop);
5940 + bonobo_main_loop_level--;
5944 + * bonobo_main_quit:
5946 + * Quits the main event loop.
5949 +vim_bonobo_main_quit (void)
5951 + g_return_if_fail (bonobo_main_loops != NULL);
5953 + g_main_loop_quit (bonobo_main_loops->data);
5957 +vim_bonobo_main_level(void)
5959 + return bonobo_main_loop_level;
5962 +static long save_p_report;
5963 +static int save_msg_silent;
5964 +static int save_emsg_silent;
5967 +vim_bonobo_call_begin(void)
5969 + in_bonobo_call = TRUE;
5970 + gui.processing_call = TRUE;
5971 + save_p_report = p_report;
5972 + p_report = 100000;
5973 + save_msg_silent = msg_silent;
5974 + msg_silent = TRUE;
5975 + save_emsg_silent = emsg_silent;
5976 + emsg_silent = TRUE;
5980 +vim_bonobo_call_end(void)
5982 + in_bonobo_call = FALSE;
5983 + gui.processing_call = FALSE;
5984 + msg_silent = save_msg_silent;
5985 + emsg_silent = save_emsg_silent;
5986 + p_report = save_p_report;
5990 +vim_bonobo_main_iteration_do(may_block)
5992 + if( ! in_bonobo_call ) {
5993 + g_main_context_iteration(NULL, may_block);
5997 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_main.h vim/src/vim_bonobo_main.h
5998 --- vimcopy/src/vim_bonobo_main.h Wed Dec 31 18:00:00 1969
5999 +++ vim/src/vim_bonobo_main.h Sat Oct 11 10:22:11 2003
6001 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6003 +#ifndef __VIM_BONOBO_MAIN_H__
6004 +#define __VIM_BONOBO_MAIN_H__
6006 +#include <glib-object.h>
6007 +#include <bonobo/Bonobo.h>
6009 +void vim_bonobo_main (void);
6010 +void vim_bonobo_main_quit (void);
6011 +int vim_bonobo_level(void);
6012 +gboolean vim_bonobo_main_iteration_do(int may_block);
6013 +void vim_bonobo_call_begin(void);
6014 +void vim_bonobo_call_end(void);
6016 +#endif /* __VIM_BONOBO_MAIN_H__ */
6017 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_proxy_factory.c vim/src/vim_proxy_factory.c
6018 --- vimcopy/src/vim_proxy_factory.c Wed Dec 31 18:00:00 1969
6019 +++ vim/src/vim_proxy_factory.c Sun Oct 26 19:34:07 2003
6022 + * vim_proxy_factory.c
6025 + * Jason Hildebrand (jason@peaceworks.ca)
6030 +#include "version.h"
6031 +#include <libbonobo.h>
6032 +#include <bonobo/bonobo-foreign-object.h>
6033 +#include <bonobo/bonobo-generic-factory.h>
6034 +#include "vim_bonobo_control.h"
6035 +#include "vim_bonobo_factory.h"
6037 +#define VIM_PROXY_OAFIID "OAFIID:Vim_Proxy_Factory"
6039 +static BonoboGenericFactory *factory = NULL;
6041 +static BonoboObject *
6042 +vim_proxy_factory(BonoboGenericFactory *this,
6043 + const char *oaf_iid,
6046 + CORBA_Object realfactory;
6047 + CORBA_Environment ev;
6048 + BonoboObject * vim_control = NULL;
6049 + CORBA_Object corba_control;
6051 + g_return_val_if_fail (this != NULL, NULL);
6052 + g_return_val_if_fail (oaf_iid != NULL, NULL);
6054 + g_message ("Trying to produce a '%s'...", oaf_iid);
6056 + if (strcmp (oaf_iid, VIM_OAFIID) == 0) {
6057 + CORBA_exception_init(&ev);
6059 + realfactory = bonobo_activation_activate_from_id (VIM_FACTORY_OAFIID,
6060 + Bonobo_ACTIVATION_FLAG_PRIVATE,
6063 + if (ev._major != CORBA_NO_EXCEPTION ) {
6064 + CORBA_exception_free (&ev);
6068 + corba_control = Bonobo_GenericFactory_createObject(realfactory, VIM_OAFIID, &ev);
6069 + if (ev._major != CORBA_NO_EXCEPTION ) {
6070 + CORBA_exception_free (&ev);
6073 + CORBA_exception_free (&ev);
6074 + vim_control = bonobo_foreign_object_new(corba_control);
6076 + g_warning ("Unknown IID `%s' requested", oaf_iid);
6079 + return vim_control;
6083 +BONOBO_ACTIVATION_FACTORY (VIM_PROXY_OAFIID,
6084 + "Vim Proxy Factory", "1.0",
6085 + vim_proxy_factory, NULL);