1 diff -Nur vim63/src/buffer.c vim63-bonobo/src/buffer.c
2 --- vim63/src/buffer.c 2005-09-09 20:11:09.929854000 +0200
3 +++ vim63-bonobo/src/buffer.c 2005-09-09 20:14:02.699589864 +0200
8 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
9 +#include "vim_bonobo_control.h"
12 #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
13 static char_u *buflist_match __ARGS((regprog_T *prog, buf_T *buf));
14 # define HAVE_BUFLIST_MATCH
19 - else if (read_stdin)
21 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
22 + || read_from_container
26 int save_bin = curbuf->b_p_bin;
28 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
29 + int flags = READ_NEW + READ_EMB_STREAM;
30 + curbuf->emb_buffer = TRUE;
32 + int flags = READ_NEW + READ_STDIN;
36 * First read the text in binary mode into the buffer.
39 curbuf->b_p_bin = TRUE;
40 retval = readfile(NULL, NULL, (linenr_T)0,
41 - (linenr_T)0, (linenr_T)MAXLNUM, NULL, READ_NEW + READ_STDIN);
42 + (linenr_T)0, (linenr_T)MAXLNUM, eap, flags);
43 curbuf->b_p_bin = save_bin;
47 /* Put the cursor on the first line. */
48 curwin->w_cursor.lnum = 1;
49 curwin->w_cursor.col = 0;
50 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
56 - apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
57 + apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
60 - apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
61 + apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
64 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
70 @@ -4634,6 +4655,11 @@
74 +#if defined(FEAT_QUICKFIX) && defined(FEAT_GUI_COMPONENT)
75 + if ( buf->emb_buffer ) {
76 + return "[Embedded File]";
79 if (buf->b_fname == NULL)
80 return _("[No File]");
82 diff -Nur vim63/src/config.h.in vim63-bonobo/src/config.h.in
83 --- vim63/src/config.h.in 2005-09-09 20:11:10.543761000 +0200
84 +++ vim63-bonobo/src/config.h.in 2005-09-09 20:14:02.700589712 +0200
86 /* Define if GTK+ multihead support is available (requires GTK+ >= 2.1.1). */
87 #undef HAVE_GTK_MULTIHEAD
89 +/* Define if you want component (i.e. Bonobo) support. */
90 +#undef FEAT_GUI_COMPONENT
92 /* Define if your X has own locale library */
95 diff -Nur vim63/src/config.mk.in vim63-bonobo/src/config.mk.in
96 --- vim63/src/config.mk.in 2005-09-09 20:11:10.543761000 +0200
97 +++ vim63-bonobo/src/config.mk.in 2005-09-09 20:14:02.700589712 +0200
99 ### Prefix for location of man pages
102 +### Extra targets to be built by default
103 +EXTRA_TARGETS = @EXTRA_TARGETS@
106 GUI_INC_LOC = @GUI_INC_LOC@
107 GUI_LIB_LOC = @GUI_LIB_LOC@
108 diff -Nur vim63/src/configure.in vim63-bonobo/src/configure.in
109 --- vim63/src/configure.in 2005-09-09 20:11:10.546761000 +0200
110 +++ vim63-bonobo/src/configure.in 2005-09-09 20:14:02.703589256 +0200
112 sh ./toolcheck 1>&AC_FD_MSG
116 OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
118 dnl Check for BeOS, which needs an extra source file
121 AC_SUBST(OS_EXTRA_SRC)
122 AC_SUBST(OS_EXTRA_OBJ)
123 +AC_SUBST(EXTRA_TARGETS)
125 dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
126 dnl Only when the directory exists and it wasn't there yet.
127 @@ -1831,6 +1833,23 @@
128 AC_DEFINE(FEAT_GUI_GNOME)
129 GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
130 GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
131 + AC_MSG_CHECKING(whether or not to include bonobo support)
132 + AC_ARG_ENABLE(bonobo,
133 + [ --enable-bonobo If using GNOME, enable bonobo support [default=no]],
134 + , enable_bonobo="no")
135 + if test "x$enable_bonobo" = "xno"; then
136 + AC_MSG_RESULT($enable_bonobo);
138 + if test "x$SKIP_BONOBO" != "xYES" -a $gtk_major_version -ge 2; then
139 + AC_MSG_RESULT(yes);
140 + AC_DEFINE(FEAT_GUI_COMPONENT)
142 + VIMNAME="vim-component"
143 + EXTRA_TARGETS="vim-factory Vim_Control.server"
145 + AC_MSG_RESULT(no (Bonobo requires Gnome 2));
151 diff -Nur vim63/src/container.c vim63-bonobo/src/container.c
152 --- vim63/src/container.c 1970-01-01 01:00:00.000000000 +0100
153 +++ vim63-bonobo/src/container.c 2005-09-09 20:14:02.704589104 +0200
159 +BonoboControlFrame *ctrl_frame;
160 +BonoboUIComponent *ui_comp;
164 +GtkWidget *ctrl_widget;
168 +static Bonobo_Control
169 +instantiate_control()
171 + Bonobo_Control control;
172 + Bonobo_PersistFile pfile;
173 + Bonobo_PersistStream pstream;
174 + CORBA_Environment ev;
175 + Bonobo_Stream stream;
177 + CORBA_exception_init (&ev);
179 + /* get control component */
180 + control = bonobo_get_object ("OAFIID:Vim_Control",
181 + "Bonobo/Control", &ev);
182 + if (BONOBO_EX (&ev) || (control == CORBA_OBJECT_NIL))
184 + CORBA_exception_free (&ev);
189 + /* get PersistFile interface */
190 + pfile = Bonobo_Unknown_queryInterface (control, "IDL:Bonobo/PersistFile:1.0", &ev);
191 + if (BONOBO_EX (&ev) || (pfile == CORBA_OBJECT_NIL))
194 + /* load the file */
195 + Bonobo_PersistFile_load (pfile, filename, &ev);
196 + bonobo_object_release_unref (pfile, NULL);
199 + /* get PersistStream interface */
200 + pstream = Bonobo_Unknown_queryInterface (control, "IDL:Bonobo/PersistStream:1.0", &ev);
201 + if (BONOBO_EX (&ev) || (pstream == CORBA_OBJECT_NIL))
203 + CORBA_exception_free (&ev);
207 + /* load the file */
208 + stream = bonobo_get_object(filename, "IDL:Bonobo/Stream:1.0", &ev);
209 + if (ev._major != CORBA_NO_EXCEPTION) {
210 + g_warning("Error getting stream interface");
211 + bonobo_object_unref (BONOBO_OBJECT (stream));
212 + CORBA_exception_free (&ev);
215 + Bonobo_PersistStream_load (pstream, stream, "text/plain", &ev);
216 + if (ev._major != CORBA_NO_EXCEPTION) {
217 + g_warning("Error loading stream!");
218 + bonobo_object_unref (BONOBO_OBJECT (stream));
219 + CORBA_exception_free (&ev);
222 + bonobo_object_release_unref (pstream, NULL);
227 +verb_FileNewWindow (BonoboUIComponent *uic, gpointer user_data, const char *cname)
229 + printf("Got New Window!\n");
233 +verb_DoNothing (BonoboUIComponent *uic, gpointer user_data, const char *cname)
237 +static BonoboUIVerb app_verbs[] = {
238 + BONOBO_UI_VERB ("FileNewWindow", verb_FileNewWindow),
239 + BONOBO_UI_VERB ("FileOpen", verb_DoNothing),
240 + BONOBO_UI_VERB ("FileCloseWindow", verb_DoNothing),
241 + BONOBO_UI_VERB ("FileExit", verb_DoNothing),
242 + BONOBO_UI_VERB ("Preferences", verb_DoNothing),
243 + BONOBO_UI_VERB ("HelpAbout", verb_DoNothing),
244 + BONOBO_UI_VERB ("Help", verb_DoNothing),
245 + BONOBO_UI_VERB ("DnDNewWindow", verb_DoNothing),
246 + BONOBO_UI_VERB ("DnDSameWindow", verb_DoNothing),
247 + BONOBO_UI_VERB ("DnDCancel", verb_DoNothing),
252 +add_control_to_ui (BonoboWindow *window, Bonobo_Control control)
254 + CORBA_Environment ev;
255 + Bonobo_PropertyControl prop_control;
256 + BonoboUIContainer *ui_container;
259 + g_return_if_fail (window != NULL);
260 + g_return_if_fail (BONOBO_IS_WINDOW (window));
262 + CORBA_exception_init (&ev);
264 + ui_container = bonobo_window_get_ui_container (BONOBO_WINDOW (window));
265 + ctrl_frame = bonobo_control_frame_new (BONOBO_OBJREF (ui_container));
267 + /* bind and view new control widget */
268 + bonobo_control_frame_bind_to_control (ctrl_frame, control, &ev);
269 + bonobo_control_frame_control_activate (ctrl_frame);
270 + if (control != CORBA_OBJECT_NIL && ctrl_widget == NULL) {
271 + ctrl_widget = bonobo_control_frame_get_widget (ctrl_frame);
273 + g_assert_not_reached ();
275 + bonobo_window_set_contents (BONOBO_WINDOW(window), GTK_WIDGET(ctrl_widget));
276 + gtk_widget_show (ctrl_widget);
279 + ui_comp = bonobo_ui_component_new ("vim-container");
280 + bonobo_ui_component_set_container (ui_comp, BONOBO_OBJREF (ui_container), NULL);
282 + curdir = (char *)getcwd(NULL, 0);
283 + bonobo_ui_util_set_ui (ui_comp, curdir, "vim-container.xml", "Vim", NULL);
285 + bonobo_ui_component_add_verb_list_with_data (ui_comp, app_verbs, window);
287 + /* update sensitivity of the properties menu item */
288 + prop_control = Bonobo_Unknown_queryInterface (control,
289 + "IDL:Bonobo/PropertyControl:1.0", &ev);
290 + bonobo_ui_component_set_prop (ui_comp,
291 + "/commands/Preferences",
293 + prop_control == CORBA_OBJECT_NIL ? "0" : "1",
296 + bonobo_object_release_unref (prop_control, &ev);
298 + /* enable view menu */
299 + /* FIXME: We should check if the component adds anything to
300 + * the menu, so that we don't view an empty menu.
302 + /*bonobo_ui_component_set_prop (ui_comp, "/menu/View", "hidden", "0", &ev);*/
304 + CORBA_exception_free (&ev);
306 + /* retrieve control properties and install listeners */
307 + //check_for_control_properties (window);
310 +static void write_stream_to_file(Bonobo_Control control)
312 + Bonobo_Storage storage;
315 + CORBA_Environment ev;
316 + Bonobo_PersistStream pstream;
317 + Bonobo_Stream stream;
319 + g_warning("write stream to file!");
320 + CORBA_exception_init (&ev);
322 + dirname = g_path_get_dirname(filename);
323 + storage = bonobo_get_object(dirname, "IDL:Bonobo/Storage:1.0", &ev);
325 + if (BONOBO_EX (&ev) || (storage == CORBA_OBJECT_NIL))
327 + CORBA_exception_free (&ev);
331 + pstream = Bonobo_Unknown_queryInterface (control, "IDL:Bonobo/PersistStream:1.0", &ev);
332 + if (BONOBO_EX (&ev) || (pstream == CORBA_OBJECT_NIL))
334 + bonobo_object_release_unref(storage, NULL);
335 + CORBA_exception_free (&ev);
339 + basename = g_path_get_basename(filename);
340 + stream = Bonobo_Storage_openStream(storage, basename, Bonobo_Storage_WRITE, &ev );
342 + if (BONOBO_EX (&ev) || (stream == CORBA_OBJECT_NIL))
344 + bonobo_object_release_unref(pstream, NULL);
345 + bonobo_object_release_unref(storage, NULL);
346 + CORBA_exception_free (&ev);
350 + Bonobo_PersistStream_save (pstream, stream, "text/plain", &ev);
351 + if (ev._major != CORBA_NO_EXCEPTION) {
352 + g_warning("Error saving stream!");
353 + bonobo_object_unref (BONOBO_OBJECT (stream));
354 + bonobo_object_release_unref(pstream, NULL);
355 + bonobo_object_release_unref(storage, NULL);
356 + CORBA_exception_free (&ev);
359 + bonobo_object_release_unref(stream, NULL);
360 + bonobo_object_release_unref(pstream, NULL);
361 + bonobo_object_release_unref(storage, NULL);
366 +window_destroyed (GtkWindow *window, char * data)
368 + Bonobo_Control control;
370 + control = bonobo_control_frame_get_control(ctrl_frame);
371 + write_stream_to_file(control);
372 + bonobo_control_frame_control_deactivate(ctrl_frame);
373 + bonobo_object_release_unref( control, NULL );
374 + bonobo_main_quit();
377 +int main(int argc, char * argv[] )
380 + BonoboWindow *window;
381 + BonoboUIEngine *engine;
382 + BonoboUIContainer *container;
383 + Bonobo_Control control;
387 + fprintf(stderr, "%s: not enough args\n", argv[0] );
388 + fprintf(stderr, "Usage: %s <text file>\n", argv[0]);
391 + cwd = g_get_current_dir();
392 + filename = g_build_filename( "file:", cwd, argv[1], NULL );
395 + bonobo_ui_init ("container", "1.0", &argc, argv);
397 + if(gnome_vfs_init () == FALSE)
398 + g_error (_("Could not initialize GnomeVFS!\n"));
400 + window = BONOBO_WINDOW ( bonobo_window_new ("Window", "Vim Test Container"));
402 + // instantiate a control
403 + control = instantiate_control();
404 + if( control == NULL )
407 + // put it into our window
408 + add_control_to_ui (window, control);
410 + g_signal_connect (window, "destroy",
411 + G_CALLBACK (window_destroyed),
415 + gtk_widget_show_all( GTK_WIDGET( window ));
421 diff -Nur vim63/src/ex_cmds2.c vim63-bonobo/src/ex_cmds2.c
422 --- vim63/src/ex_cmds2.c 2005-09-09 20:11:09.884861000 +0200
423 +++ vim63-bonobo/src/ex_cmds2.c 2005-09-09 20:14:02.707588648 +0200
426 int allbuf; /* may write all buffers */
428 +#ifdef FEAT_GUI_COMPONENT
429 + if ( buf->emb_buffer ) {
430 + EMSG(_("E467: Cannot close embedded file"));
436 && (mult_win || buf->b_nwindows <= 1)
437 diff -Nur vim63/src/ex_docmd.c vim63-bonobo/src/ex_docmd.c
438 --- vim63/src/ex_docmd.c 2005-09-09 20:11:10.556759000 +0200
439 +++ vim63-bonobo/src/ex_docmd.c 2005-09-09 20:14:02.712587888 +0200
440 @@ -5729,8 +5729,13 @@
444 +#ifdef FEAT_GUI_COMPONENT
445 + EMSG(_(e_compnoquit));
450 - if (only_one_window()) /* quit last window */
451 + if (only_one_window()) /* quit last window */
455 @@ -5751,8 +5756,12 @@
459 +#ifdef FEAT_GUI_COMPONENT
460 + EMSG(_(e_compnoquit));
463 getout(1); /* this does not always pass on the exit code to the Manx
469 @@ -5772,6 +5781,10 @@
473 +#ifdef FEAT_GUI_COMPONENT
474 + EMSG(_(e_compnoquit));
478 if (eap->forceit || !check_changed_any(FALSE))
480 @@ -5966,8 +5979,13 @@
484 +#ifdef FEAT_GUI_COMPONENT
485 + EMSG(_(e_compnoquit));
490 - if (only_one_window()) /* quit last window, exit Vim */
491 + if ( only_one_window()) /* quit last window, exit Vim */
495 diff -Nur vim63/src/fileio.c vim63-bonobo/src/fileio.c
496 --- vim63/src/fileio.c 2005-09-09 20:11:10.108827000 +0200
497 +++ vim63-bonobo/src/fileio.c 2005-09-09 20:18:45.327623872 +0200
499 # define CRYPT_MAGIC_LEN 12 /* must be multiple of 4! */
502 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
503 +#include "vim_bonobo_control.h"
506 /* Is there any system that doesn't have access()? */
507 #ifndef MACOS_CLASSIC /* Not available on MacOS 9 */
508 # define USE_MCH_ACCESS
510 * READ_BUFFER read from curbuf instead of a file (converting after reading
512 * READ_DUMMY read into a dummy buffer (to check if file contents changed)
513 + * READ_EMB_STREAM read from a bonobo persist stream
515 * return FAIL for failure, OK otherwise
518 int filtering = (flags & READ_FILTER);
519 int read_stdin = (flags & READ_STDIN);
520 int read_buffer = (flags & READ_BUFFER);
521 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
522 + int read_pstream = (flags & READ_EMB_STREAM);
524 +#define read_pstream 0
526 linenr_T read_buf_lnum = 1; /* next line to read from curbuf */
527 colnr_T read_buf_col = 0; /* next char to read from this line */
530 * The BufReadCmd and FileReadCmd events intercept the reading process by
531 * executing the associated commands instead.
533 - if (!filtering && !read_stdin && !read_buffer)
534 + if (!filtering && !read_stdin && !read_buffer && !read_pstream)
539 * On Unix it is possible to read a directory, so we have to
540 * check for it before the mch_open().
542 - if (!read_stdin && !read_buffer)
543 + if (!read_stdin && !read_buffer && !read_pstream)
545 perm = mch_getperm(fname);
546 if (perm >= 0 && !S_ISREG(perm) /* not a regular file ... */
548 if (check_readonly && !readonlymode) /* default: set file not readonly */
549 curbuf->b_p_ro = FALSE;
551 - if (newfile && !read_stdin && !read_buffer)
552 + if (newfile && !read_stdin && !read_buffer && !read_pstream)
554 /* Remember time of file.
555 * For RISCOS, also remember the filetype.
557 setmode(0, O_BINARY);
560 +#ifdef FEAT_GUI_COMPONENT
561 + else if (read_pstream)
565 else if (!read_buffer)
567 #ifdef USE_MCH_ACCESS
569 /* If "Quit" selected at ATTENTION dialog, don't load the file */
570 if (swap_exists_action == SEA_QUIT)
572 - if (!read_buffer && !read_stdin)
573 + if (!read_buffer && !read_stdin && !read_pstream)
578 * The file must be closed again, the autocommands may want to change
579 * the file before reading it.
582 + if (!read_stdin && !read_pstream)
583 close(fd); /* ignore errors */
587 * Don't allow the autocommands to change the current buffer.
588 * Try to re-open the file.
590 - if (!read_stdin && (curbuf != old_curbuf
591 + if (!read_stdin && !read_pstream && (curbuf != old_curbuf
592 || (fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0)) < 0))
599 - else if (!read_buffer)
600 + else if (!read_buffer && !read_pstream)
601 filemess(curbuf, sfname, (char_u *)"", 0);
608 - else if (read_stdin || lseek(fd, (off_t)0L, SEEK_SET) != 0)
609 + else if (read_stdin || read_pstream || lseek(fd, (off_t)0L, SEEK_SET) != 0)
611 /* Can't rewind the file, give up. */
614 * Use the 'charconvert' expression when conversion is required
615 * and we can't do it internally or with iconv().
617 - if (fio_flags == 0 && !read_stdin && !read_buffer && *p_ccv != NUL
618 + if (fio_flags == 0 && !read_stdin && !read_buffer && !read_pstream && *p_ccv != NUL
620 && iconv_fd == (iconv_t)-1
622 @@ -1045,7 +1060,7 @@
623 /* Set can_retry when it's possible to rewind the file and try with
624 * another "fenc" value. It's FALSE when no other "fenc" to try, reading
625 * stdin or "fenc" was specified with "++enc=". */
626 - can_retry = (*fenc != NUL && !read_stdin
627 + can_retry = (*fenc != NUL && !read_stdin && !read_pstream
628 && (eap == NULL || eap->force_enc == 0));
631 @@ -1214,6 +1229,11 @@
635 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
636 + else if( read_pstream ) {
637 + size = vim_control_persist_stream_read(ptr, size);
643 @@ -1927,7 +1947,7 @@
644 else if (ff_error != EOL_DOS)
648 + && !read_stdin && !read_pstream
650 || lseek(fd, (off_t)0L, SEEK_SET) == 0))
652 @@ -2016,7 +2036,7 @@
656 - if (!read_buffer && !read_stdin)
657 + if (!read_buffer && !read_stdin && !read_pstream)
658 close(fd); /* errors are ignored */
661 @@ -2205,7 +2225,7 @@
662 #ifdef ALWAYS_USE_GUI
663 /* Don't show the message when reading stdin, it would end up in a
664 * message box (which might be shown when exiting!) */
665 - if (read_stdin || read_buffer)
666 + if (read_stdin || read_buffer )
667 p = msg_may_trunc(FALSE, IObuff);
670 @@ -2271,7 +2291,7 @@
672 write_no_eol_lnum = read_no_eol_lnum;
674 - if (!read_stdin && !read_buffer)
675 + if (!read_stdin && !read_buffer && !read_pstream)
678 int n = msg_scrolled;
679 @@ -2608,6 +2628,11 @@
680 int prev_got_int = got_int;
681 int file_readonly = FALSE; /* overwritten file is read-only */
682 static char *err_readonly = "is read-only (cannot override: \"W\" in 'cpoptions')";
683 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
684 + int write_pstream = write_to_container;
686 +#define write_pstream 0
688 #if defined(UNIX) || defined(__EMX__XX) /*XXX fix me sometime? */
689 int made_writable = FALSE; /* 'w' bit has been set */
691 @@ -2984,7 +3009,7 @@
695 - if (!device && !newfile)
696 + if (!device && !newfile && !write_pstream )
699 * Check if the file is really writable (when renaming the file to
700 @@ -3043,6 +3068,10 @@
701 if (dobackup && *p_bsk != NUL && match_file_list(p_bsk, sfname, ffname))
704 +#ifdef FEAT_GUI_COMPONENT
705 + if( write_pstream )
710 * Save the value of got_int and reset it. We don't want a previous
711 @@ -3695,95 +3724,97 @@
712 * (this may happen when the user reached his quotum for number of files).
713 * Appending will fail if the file does not exist and forceit is FALSE.
715 - while ((fd = mch_open((char *)wfname, O_WRONLY | O_EXTRA | (append
716 - ? (forceit ? (O_APPEND | O_CREAT) : O_APPEND)
717 - : (O_CREAT | O_TRUNC))
718 - , perm < 0 ? 0666 : (perm & 0777))) < 0)
721 - * A forced write will try to create a new file if the old one is
722 - * still readonly. This may also happen when the directory is
723 - * read-only. In that case the mch_remove() will fail.
725 - if (errmsg == NULL)
726 + if (!write_pstream) {
727 + while ((fd = mch_open((char *)wfname, O_WRONLY | O_EXTRA | (append
728 + ? (forceit ? (O_APPEND | O_CREAT) : O_APPEND)
729 + : (O_CREAT | O_TRUNC))
730 + , perm < 0 ? 0666 : (perm & 0777))) < 0)
733 + * A forced write will try to create a new file if the old one is
734 + * still readonly. This may also happen when the directory is
735 + * read-only. In that case the mch_remove() will fail.
737 + if (errmsg == NULL)
743 - /* Don't delete the file when it's a hard or symbolic link. */
744 - if ((!newfile && st_old.st_nlink > 1)
745 - || (mch_lstat((char *)fname, &st) == 0
746 - && (st.st_dev != st_old.st_dev
747 - || st.st_ino != st_old.st_ino)))
748 - errmsg = (char_u *)_("E166: Can't open linked file for writing");
750 + /* Don't delete the file when it's a hard or symbolic link. */
751 + if ((!newfile && st_old.st_nlink > 1)
752 + || (mch_lstat((char *)fname, &st) == 0
753 + && (st.st_dev != st_old.st_dev
754 + || st.st_ino != st_old.st_ino)))
755 + errmsg = (char_u *)_("E166: Can't open linked file for writing");
759 - errmsg = (char_u *)_("E212: Can't open file for writing");
760 - if (forceit && vim_strchr(p_cpo, CPO_FWRITE) == NULL
763 + errmsg = (char_u *)_("E212: Can't open file for writing");
764 + if (forceit && vim_strchr(p_cpo, CPO_FWRITE) == NULL
768 - /* we write to the file, thus it should be marked
769 - writable after all */
770 - if (!(perm & 0200))
771 - made_writable = TRUE;
773 - if (st_old.st_uid != getuid() || st_old.st_gid != getgid())
775 + /* we write to the file, thus it should be marked
776 + writable after all */
777 + if (!(perm & 0200))
778 + made_writable = TRUE;
780 + if (st_old.st_uid != getuid() || st_old.st_gid != getgid())
783 - if (!append) /* don't remove when appending */
784 - mch_remove(wfname);
786 + if (!append) /* don't remove when appending */
787 + mch_remove(wfname);
799 - * If we failed to open the file, we don't need a backup. Throw it
800 - * away. If we moved or removed the original file try to put the
801 - * backup in its place.
803 - if (backup != NULL && wfname == fname)
810 + * If we failed to open the file, we don't need a backup. Throw it
811 + * away. If we moved or removed the original file try to put the
812 + * backup in its place.
814 + if (backup != NULL && wfname == fname)
817 - * There is a small chance that we removed the original,
818 - * try to move the copy in its place.
819 - * This may not work if the vim_rename() fails.
820 - * In that case we leave the copy around.
822 - /* If file does not exist, put the copy in its place */
823 - if (mch_stat((char *)fname, &st) < 0)
827 + * There is a small chance that we removed the original,
828 + * try to move the copy in its place.
829 + * This may not work if the vim_rename() fails.
830 + * In that case we leave the copy around.
832 + /* If file does not exist, put the copy in its place */
833 + if (mch_stat((char *)fname, &st) < 0)
834 + vim_rename(backup, fname);
835 + /* if original file does exist throw away the copy */
836 + if (mch_stat((char *)fname, &st) >= 0)
837 + mch_remove(backup);
841 + /* try to put the original file back */
842 vim_rename(backup, fname);
843 - /* if original file does exist throw away the copy */
844 - if (mch_stat((char *)fname, &st) >= 0)
845 - mch_remove(backup);
849 - /* try to put the original file back */
850 - vim_rename(backup, fname);
855 - /* if original file no longer exists give an extra warning */
856 - if (!newfile && mch_stat((char *)fname, &st) < 0)
859 + /* if original file no longer exists give an extra warning */
860 + if (!newfile && mch_stat((char *)fname, &st) < 0)
865 - if (wfname != fname)
867 + if (wfname != fname)
877 #if defined(MACOS_CLASSIC) || defined(WIN3264)
878 /* TODO: Is it need for MACOS_X? (Dany) */
879 @@ -3999,7 +4030,7 @@
883 - if (close(fd) != 0)
884 + if (!write_pstream && close(fd) != 0)
886 errmsg = (char_u *)_("E512: Close failed");
888 @@ -4415,6 +4446,10 @@
892 +#ifdef FEAT_GUI_COMPONENT
893 + if (buf->emb_buffer)
894 + fname = (char_u *)"[Embedded File]";
897 fname = (char_u *)"-stdin-";
898 home_replace(buf, fname, IObuff + 1, IOSIZE - 4, TRUE);
899 @@ -4939,7 +4974,12 @@
900 /* Repeat the write(), it may be interrupted by a signal. */
903 - wlen = vim_write(ip->bw_fd, buf, len);
904 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
905 + if( write_to_container )
906 + wlen = vim_control_persist_stream_write(buf, len);
909 + wlen = vim_write(ip->bw_fd, buf, len);
910 if (wlen <= 0) /* error! */
913 @@ -6672,6 +6712,7 @@
914 {"BufWriteCmd", EVENT_BUFWRITECMD},
915 {"CmdwinEnter", EVENT_CMDWINENTER},
916 {"CmdwinLeave", EVENT_CMDWINLEAVE},
917 + {"EmbeddingOn", EVENT_EMBEDDED_COMPONENT},
918 {"EncodingChanged", EVENT_ENCODINGCHANGED},
919 {"FileEncoding", EVENT_ENCODINGCHANGED},
920 {"CursorHold", EVENT_CURSORHOLD},
921 diff -Nur vim63/src/globals.h vim63-bonobo/src/globals.h
922 --- vim63/src/globals.h 2005-09-09 20:11:10.559759000 +0200
923 +++ vim63-bonobo/src/globals.h 2005-09-09 20:14:02.721586520 +0200
925 EXTERN int readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
926 EXTERN int recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
928 +#ifdef FEAT_GUI_COMPONENT
929 +EXTERN int read_from_container INIT(= 0); /* read the buffer from the container app */
930 +EXTERN int write_to_container INIT(= 0); /* write the buffer to the container app */
931 +EXTERN buf_T *persistent_buffer INIT(= NULL); /* the buffer which the container is interested in */
934 EXTERN struct buffheader stuffbuff /* stuff buffer */
936 = {{NULL, {NUL}}, NULL, 0, 0}
937 @@ -1363,6 +1369,9 @@
938 #ifdef FEAT_NETBEANS_INTG
939 EXTERN char_u e_guarded[] INIT(=N_("E463: Region is guarded, cannot modify"));
941 +#ifdef FEAT_GUI_COMPONENT
942 +EXTERN char_u e_compnoquit[] INIT(=N_("E464: Quit not allowed from embedded component"));
945 EXTERN short disallow_gui INIT(= FALSE);
947 diff -Nur vim63/src/gtkhtml_editor.c vim63-bonobo/src/gtkhtml_editor.c
948 --- vim63/src/gtkhtml_editor.c 1970-01-01 01:00:00.000000000 +0100
949 +++ vim63-bonobo/src/gtkhtml_editor.c 2005-09-09 20:14:02.726585760 +0200
954 +#include "gtkhtml_editor.h"
956 +static BonoboObjectClass *engine_parent_class;
958 +inline static EditorEngine *
959 +gtkhtml_editor_engine_from_servant (PortableServer_Servant servant)
961 + return EDITOR_ENGINE (bonobo_object_from_servant (servant));
965 +impl_get_paragraph_data (PortableServer_Servant servant, const CORBA_char * key, CORBA_Environment * ev)
967 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
971 +impl_set_paragraph_data (PortableServer_Servant servant,
972 + const CORBA_char * key, const CORBA_char * value,
973 + CORBA_Environment * ev)
975 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
979 +impl_set_object_data_by_type (PortableServer_Servant servant,
980 + const CORBA_char * type_name, const CORBA_char * key, const CORBA_char * value,
981 + CORBA_Environment * ev)
983 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
987 +impl_set_listener (PortableServer_Servant servant, const GNOME_GtkHTML_Editor_Listener value, CORBA_Environment * ev)
989 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
991 + bonobo_object_release_unref (e->listener, NULL);
992 + e->listener = bonobo_object_dup_ref (value, NULL);
995 +static GNOME_GtkHTML_Editor_Listener
996 +impl_get_listener (PortableServer_Servant servant, CORBA_Environment * ev)
998 + return gtkhtml_editor_engine_from_servant (servant)->listener;
1003 +static CORBA_boolean
1004 +impl_run_command (PortableServer_Servant servant, const CORBA_char * command, CORBA_Environment * ev)
1006 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1007 + printf ("command: %s\n", command);
1008 + CORBA_boolean retval = CORBA_TRUE;
1009 + int save_p_report = p_report;
1014 + aucmd_prepbuf(&aco, persistent_buffer);
1016 + if( strcmp( command, "cursor-position-save" ) == 0 ) {
1017 + do_cmdline_cmd("normal mz");
1018 + } else if( strcmp( command, "cursor-position-restore" ) == 0 ) {
1019 + do_cmdline_cmd("normal 'z");
1020 + update_screen(CLEAR);
1021 + gui_update_cursor(TRUE, FALSE);
1022 + } else if( strcmp( command, "cursor-bod" ) == 0 ) {
1023 + do_cmdline_cmd("normal G");
1024 + } else if( strcmp( command, "select-paragraph" ) == 0 ) {
1025 + do_cmdline_cmd("normal V}");
1026 + } else if( strcmp( command, "delete" ) == 0 ) {
1027 + do_cmdline_cmd("normal d");
1028 + } else if( strcmp( command, "is-saved" ) == 0 ) {
1029 + retval = !persistent_buffer->b_changed;
1030 + } else if( strcmp( command, "insert-paragraph" ) == 0 ) {
1031 + do_cmdline_cmd("normal o");
1033 + aucmd_restbuf(&aco);
1034 + p_report = save_p_report;
1038 +static CORBA_boolean
1039 +impl_is_paragraph_empty (PortableServer_Servant servant, CORBA_Environment * ev)
1041 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1042 + return CORBA_FALSE;
1045 +static CORBA_boolean
1046 +impl_is_previous_paragraph_empty (PortableServer_Servant servant, CORBA_Environment * ev)
1048 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1049 + return CORBA_FALSE;
1058 +static GSList * keylist = NULL;
1059 +static char free_mark = 'y';
1061 +static void set_mark_at_cursor( char * key, char * value )
1064 + struct keyvalue * kv = NULL;
1065 + GSList * node = keylist;
1066 + while( node != NULL ) {
1068 + if( strcmp( kv->key, key ) == 0 && strcmp( kv->value, value ) == 0 ) {
1071 + node = node->next;
1073 + if( kv == NULL ) {
1074 + kv = g_new0( struct keyvalue, 1 );
1075 + kv->key = g_strdup( key );
1076 + kv->value = g_strdup( value );
1078 + kv->mark = free_mark;
1080 + keylist = g_slist_prepend( keylist, kv );
1083 + setmark(kv->mark);
1087 +impl_insert_html (PortableServer_Servant servant, const CORBA_char * html, CORBA_Environment * ev)
1089 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1094 + gboolean in_data = 0;
1103 + g_warning("insert html: \"%s\"", html );
1106 + aucmd_prepbuf(&aco, persistent_buffer);
1108 + // This gets a bit ugly...
1109 + // Look for DATA tags with KEY and VALUE attributes. We set a mark
1110 + // in vim on the first line of the inserted HTML if one of these tags is present
1111 + // (we assume that they occur at the beginning of the inserted paragraph).
1112 + // we also assume that only one of these sequences will occur in the html.
1113 + strcpy( key, "" );
1114 + strcpy( value, "" );
1115 + for( c = html; *c != '\0'; c++ ) {
1118 + if( strncmp( c, "<DATA", 5 ) == 0 ) {
1121 + } else if( *c == '>' ) {
1124 + if( *key && *value ) {
1125 + g_warning( "got key=%s and value=%s", key, value );
1129 + } else if( in_data && strncmp( c, "key=", 4 ) == 0 ) {
1130 + // extract the key
1132 + for( s = &c[4]; *s != '\"'; s++ );
1134 + for( ; *s != '\"'; s++ ) {
1138 + } else if( in_data && strncmp( c, "value=", 6 ) == 0 ) {
1139 + // extract the value
1141 + for( s = &c[4]; *s != '\"'; s++ );
1143 + for( ; *s != '\"'; s++ ) {
1150 + /* insert the html into the buffer, remembering the starting line */
1151 + begin = curwin->w_cursor.lnum;
1153 + lines = g_strsplit(html, "\n", 0);
1154 + for(i = 0; lines[i]; i += 1) {
1155 + ml_append(curline, lines[i], strlen(html) + 1, FALSE);
1156 + appended_lines_mark(curwin->w_cursor.lnum, 1);
1159 + g_strfreev(lines);
1161 + /* run a filter to obtain plain text from the html */
1162 + vim_bonobo_call_begin();
1163 + g_snprintf( cmd, 50, "%d,%d!html2text -nobs", begin, curline);
1164 + do_cmdline_cmd(cmd);
1165 + vim_bonobo_call_end();
1166 + if( *key && *value ) {
1167 + set_mark_at_cursor( key, value );
1169 + aucmd_restbuf(&aco);
1172 +static CORBA_boolean
1173 +impl_search_by_data (PortableServer_Servant servant, const CORBA_long level, const CORBA_char * klass,
1174 + const CORBA_char * key, const CORBA_char * value, CORBA_Environment * ev)
1176 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1178 + GSList * node = keylist;
1179 + struct keyvalue * kv = NULL;
1183 + int retval = FALSE;
1185 + aucmd_prepbuf(&aco, persistent_buffer);
1187 + g_warning("search by data: key=\"%s\" value=\"%s\"", key, value );
1188 + while( node != NULL ) {
1190 + if( strcmp( kv->key, key ) == 0 && strcmp( kv->value, value ) == 0 ) {
1193 + node = node->next;
1195 + if( kv != NULL ) {
1198 + pos = getmark(kv->mark, FALSE);
1199 + if( pos->lnum != 0 ) {
1200 + /* jump to the mark in the text */
1201 + g_snprintf( cmd, 15, "normal '%c", kv->mark );
1202 + do_cmdline_cmd( cmd );
1203 + g_warning( "Found key!" );
1206 + g_warning( "Key not found" );
1207 + // mark not found. Delete it from our list.
1208 + g_free( kv->key );
1209 + g_free( kv->value );
1211 + keylist = g_slist_remove( keylist, kv );
1214 + aucmd_restbuf(&aco);
1219 +impl_freeze (PortableServer_Servant servant, CORBA_Environment * ev)
1224 +impl_thaw (PortableServer_Servant servant, CORBA_Environment * ev)
1229 +impl_undo_begin (PortableServer_Servant servant, const CORBA_char * undo_name, const CORBA_char * redo_name,
1230 + CORBA_Environment * ev)
1235 +impl_undo_end (PortableServer_Servant servant, CORBA_Environment * ev)
1240 +impl_ignore_word (PortableServer_Servant servant, const CORBA_char * word, CORBA_Environment * ev)
1242 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1245 +/* Return whether we have any undos. */
1246 +static CORBA_boolean
1247 +impl_has_undo (PortableServer_Servant servant, CORBA_Environment * ev)
1249 + u_header_T *curhead;
1250 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1252 + if( !persistent_buffer) {
1253 + return CORBA_FALSE;
1255 + /* this logic comes from undo.c */
1256 + curhead = persistent_buffer->b_u_curhead;
1257 + if (persistent_buffer->b_u_curhead == NULL) { /* first undo */
1258 + curhead = persistent_buffer->b_u_newhead;
1259 + } else if (p_ul > 0) { /* multi level undo */
1260 + curhead = persistent_buffer->b_u_curhead->uh_next;
1262 + if (curbuf->b_u_numhead == 0 || curhead == NULL) {
1263 + return CORBA_FALSE;
1265 + return CORBA_TRUE;
1269 +impl_drop_undo (PortableServer_Servant servant, CORBA_Environment * ev)
1271 + EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1272 + printf ("dropUndo\n");
1276 +engine_object_finalize (GObject *object)
1278 + EditorEngine *e = EDITOR_ENGINE (object);
1280 + bonobo_object_release_unref (e->listener, NULL);
1282 + G_OBJECT_CLASS (engine_parent_class)->finalize (object);
1286 +editor_engine_init (GObject *object)
1288 + EditorEngine *e = EDITOR_ENGINE (object);
1290 + e->listener = CORBA_OBJECT_NIL;
1294 +editor_engine_class_init (EditorEngineClass *klass)
1296 + GObjectClass *object_class = G_OBJECT_CLASS (klass);
1297 + POA_GNOME_GtkHTML_Editor_Engine__epv *epv = &klass->epv;
1299 + engine_parent_class = g_type_class_peek_parent (klass);
1300 + object_class->finalize = engine_object_finalize;
1302 + epv->_set_listener = impl_set_listener;
1303 + epv->_get_listener = impl_get_listener;
1304 + epv->setParagraphData = impl_set_paragraph_data;
1305 + epv->getParagraphData = impl_get_paragraph_data;
1306 + epv->setObjectDataByType = impl_set_object_data_by_type;
1307 + epv->runCommand = impl_run_command;
1308 + epv->isParagraphEmpty = impl_is_paragraph_empty;
1309 + epv->isPreviousParagraphEmpty = impl_is_previous_paragraph_empty;
1310 + epv->searchByData = impl_search_by_data;
1311 + epv->insertHTML = impl_insert_html;
1312 + epv->freeze = impl_freeze;
1313 + epv->thaw = impl_thaw;
1314 + epv->undoBegin = impl_undo_begin;
1315 + epv->undoEnd = impl_undo_end;
1316 + epv->ignoreWord = impl_ignore_word;
1317 + epv->hasUndo = impl_has_undo;
1318 + epv->dropUndo = impl_drop_undo;
1321 +BONOBO_TYPE_FUNC_FULL (
1322 + EditorEngine, /* Glib class name */
1323 + GNOME_GtkHTML_Editor_Engine, /* CORBA interface name */
1324 + BONOBO_TYPE_OBJECT, /* parent type */
1325 + editor_engine); /* local prefix ie. 'echo'_class_init */
1328 +editor_engine_new (void)
1332 + ee = g_object_new (EDITOR_ENGINE_TYPE, NULL);
1336 diff -Nur vim63/src/gtkhtml_editor_common.c vim63-bonobo/src/gtkhtml_editor_common.c
1337 --- vim63/src/gtkhtml_editor_common.c 1970-01-01 01:00:00.000000000 +0100
1338 +++ vim63-bonobo/src/gtkhtml_editor_common.c 2005-09-09 20:14:02.727585608 +0200
1341 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
1344 +#include <string.h>
1345 +#define ORBIT2_STUBS_API
1346 +#define ORBIT_IDL_C_COMMON
1347 +#define Editor_COMMON
1348 +#include "gtkhtml.h"
1350 +static const CORBA_unsigned_long ORBit_zero_int = 0;
1352 +#if ( (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_0 == 'E') \
1353 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_1 == 'd') \
1354 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_2 == 'i') \
1355 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_3 == 't') \
1356 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_4 == 'o') \
1357 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_5 == 'r') \
1358 +) && !defined(TC_DEF_TC_GNOME_GtkHTML_Editor_Listener)
1359 +#define TC_DEF_TC_GNOME_GtkHTML_Editor_Listener 1
1360 +#ifdef ORBIT_IDL_C_IMODULE_Editor
1363 +const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Listener_struct = {
1364 + {&ORBit_TypeCode_epv, ORBIT_REFCOUNT_STATIC},
1368 + ORBIT_ALIGNOF_CORBA_POINTER,
1374 + "IDL:GNOME/GtkHTML/Editor/Listener:1.0",
1382 +#if ( (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_0 == 'E') \
1383 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_1 == 'd') \
1384 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_2 == 'i') \
1385 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_3 == 't') \
1386 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_4 == 'o') \
1387 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_5 == 'r') \
1388 +) && !defined(TC_DEF_TC_GNOME_GtkHTML_Editor_Engine)
1389 +#define TC_DEF_TC_GNOME_GtkHTML_Editor_Engine 1
1390 +#ifdef ORBIT_IDL_C_IMODULE_Editor
1393 +const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Engine_struct = {
1394 + {&ORBit_TypeCode_epv, ORBIT_REFCOUNT_STATIC},
1398 + ORBIT_ALIGNOF_CORBA_POINTER,
1404 + "IDL:GNOME/GtkHTML/Editor/Engine:1.0",
1412 +#if ( (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_0 == 'E') \
1413 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_1 == 'd') \
1414 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_2 == 'i') \
1415 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_3 == 't') \
1416 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_4 == 'o') \
1417 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_5 == 'r') \
1418 +) && !defined(TC_DEF_TC_GNOME_GtkHTML_Editor_URLRequestEvent)
1419 +#define TC_DEF_TC_GNOME_GtkHTML_Editor_URLRequestEvent 1
1420 +static const char *anon_subnames_array6[] = { "url", "stream" };
1421 +static const CORBA_TypeCode anon_subtypes_array7[] =
1422 + { (CORBA_TypeCode) & TC_CORBA_string_struct,
1423 + (CORBA_TypeCode) & TC_Bonobo_Stream_struct };
1425 +#ifdef ORBIT_IDL_C_IMODULE_Editor
1428 +const struct CORBA_TypeCode_struct
1429 + TC_GNOME_GtkHTML_Editor_URLRequestEvent_struct = {
1430 + {&ORBit_TypeCode_epv, ORBIT_REFCOUNT_STATIC},
1434 + ORBIT_ALIGNOF_CORBA_POINTER,
1437 + (CORBA_TypeCode *) anon_subtypes_array7,
1439 + "URLRequestEvent",
1440 + "IDL:GNOME/GtkHTML/Editor/URLRequestEvent:1.0",
1441 + (char **) anon_subnames_array6,
1449 +#ifndef ORBIT_IDL_C_IMODULE_Editor
1450 +CORBA_unsigned_long GNOME_GtkHTML_Editor_Listener__classid = 0;
1453 +#ifndef ORBIT_IDL_C_IMODULE_Editor
1454 +CORBA_unsigned_long GNOME_GtkHTML_Editor_Engine__classid = 0;
1457 +/* Interface type data */
1459 +static ORBit_IArg GNOME_GtkHTML_Editor_Listener_event__arginfo[] = {
1460 + {TC_CORBA_string, ORBit_I_ARG_IN, "name"},
1461 + {TC_CORBA_any, ORBit_I_ARG_IN, "arg"}
1464 +#ifdef ORBIT_IDL_C_IMODULE_Editor
1467 +ORBit_IMethod GNOME_GtkHTML_Editor_Listener__imethods[] = {
1469 + {2, 2, GNOME_GtkHTML_Editor_Listener_event__arginfo, FALSE},
1470 + {0, 0, NULL, FALSE},
1471 + {0, 0, NULL, FALSE},
1472 + TC_CORBA_any, "event", 5,
1475 +static CORBA_string GNOME_GtkHTML_Editor_Listener__base_itypes[] = {
1476 + "IDL:Bonobo/Unknown:1.0",
1477 + "IDL:omg.org/CORBA/Object:1.0"
1480 +#ifdef ORBIT_IDL_C_IMODULE_Editor
1483 +ORBit_IInterface GNOME_GtkHTML_Editor_Listener__iinterface = {
1484 + TC_GNOME_GtkHTML_Editor_Listener, {1, 1,
1485 + GNOME_GtkHTML_Editor_Listener__imethods,
1487 + {2, 2, GNOME_GtkHTML_Editor_Listener__base_itypes, FALSE}
1490 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine__set_listener__arginfo[] = {
1491 + {TC_GNOME_GtkHTML_Editor_Listener, ORBit_I_ARG_IN, "value"}
1493 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_runCommand__arginfo[] = {
1494 + {TC_CORBA_string, ORBit_I_ARG_IN, "command"}
1496 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_getParagraphData__arginfo[] = {
1497 + {TC_CORBA_string, ORBit_I_ARG_IN, "key"}
1499 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_setParagraphData__arginfo[] = {
1500 + {TC_CORBA_string, ORBit_I_ARG_IN, "key"},
1501 + {TC_CORBA_string, ORBit_I_ARG_IN, "value"}
1503 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_setObjectDataByType__arginfo[] = {
1504 + {TC_CORBA_string, ORBit_I_ARG_IN, "type_name"},
1505 + {TC_CORBA_string, ORBit_I_ARG_IN, "key"},
1506 + {TC_CORBA_string, ORBit_I_ARG_IN, "data"}
1508 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_searchByData__arginfo[] = {
1509 + {TC_CORBA_long, ORBit_I_ARG_IN | ORBit_I_COMMON_FIXED_SIZE, "level"},
1510 + {TC_CORBA_string, ORBit_I_ARG_IN, "klass"},
1511 + {TC_CORBA_string, ORBit_I_ARG_IN, "key"},
1512 + {TC_CORBA_string, ORBit_I_ARG_IN, "value"}
1514 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_insertHTML__arginfo[] = {
1515 + {TC_CORBA_string, ORBit_I_ARG_IN, "html"}
1517 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_undoBegin__arginfo[] = {
1518 + {TC_CORBA_string, ORBit_I_ARG_IN, "undo_name"},
1519 + {TC_CORBA_string, ORBit_I_ARG_IN, "redo_name"}
1521 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_ignoreWord__arginfo[] = {
1522 + {TC_CORBA_string, ORBit_I_ARG_IN, "word"}
1525 +#ifdef ORBIT_IDL_C_IMODULE_Editor
1528 +ORBit_IMethod GNOME_GtkHTML_Editor_Engine__imethods[] = {
1530 + {0, 0, NULL, FALSE},
1531 + {0, 0, NULL, FALSE},
1532 + {0, 0, NULL, FALSE},
1533 + TC_GNOME_GtkHTML_Editor_Listener, "_get_listener", 13,
1536 + {1, 1, GNOME_GtkHTML_Editor_Engine__set_listener__arginfo, FALSE},
1537 + {0, 0, NULL, FALSE},
1538 + {0, 0, NULL, FALSE},
1539 + TC_void, "_set_listener", 13,
1542 + {1, 1, GNOME_GtkHTML_Editor_Engine_runCommand__arginfo, FALSE},
1543 + {0, 0, NULL, FALSE},
1544 + {0, 0, NULL, FALSE},
1545 + TC_CORBA_boolean, "runCommand", 10,
1546 + 0 | ORBit_I_COMMON_FIXED_SIZE}
1548 + {1, 1, GNOME_GtkHTML_Editor_Engine_getParagraphData__arginfo, FALSE},
1549 + {0, 0, NULL, FALSE},
1550 + {0, 0, NULL, FALSE},
1551 + TC_CORBA_string, "getParagraphData", 16,
1554 + {2, 2, GNOME_GtkHTML_Editor_Engine_setParagraphData__arginfo, FALSE},
1555 + {0, 0, NULL, FALSE},
1556 + {0, 0, NULL, FALSE},
1557 + TC_void, "setParagraphData", 16,
1560 + {3, 3, GNOME_GtkHTML_Editor_Engine_setObjectDataByType__arginfo, FALSE},
1561 + {0, 0, NULL, FALSE},
1562 + {0, 0, NULL, FALSE},
1563 + TC_void, "setObjectDataByType", 19,
1566 + {4, 4, GNOME_GtkHTML_Editor_Engine_searchByData__arginfo, FALSE},
1567 + {0, 0, NULL, FALSE},
1568 + {0, 0, NULL, FALSE},
1569 + TC_CORBA_boolean, "searchByData", 12,
1570 + 0 | ORBit_I_COMMON_FIXED_SIZE}
1572 + {0, 0, NULL, FALSE},
1573 + {0, 0, NULL, FALSE},
1574 + {0, 0, NULL, FALSE},
1575 + TC_CORBA_boolean, "isParagraphEmpty", 16,
1576 + 0 | ORBit_I_COMMON_FIXED_SIZE}
1578 + {0, 0, NULL, FALSE},
1579 + {0, 0, NULL, FALSE},
1580 + {0, 0, NULL, FALSE},
1581 + TC_CORBA_boolean, "isPreviousParagraphEmpty", 24,
1582 + 0 | ORBit_I_COMMON_FIXED_SIZE}
1584 + {1, 1, GNOME_GtkHTML_Editor_Engine_insertHTML__arginfo, FALSE},
1585 + {0, 0, NULL, FALSE},
1586 + {0, 0, NULL, FALSE},
1587 + TC_void, "insertHTML", 10,
1590 + {0, 0, NULL, FALSE},
1591 + {0, 0, NULL, FALSE},
1592 + {0, 0, NULL, FALSE},
1593 + TC_void, "freeze", 6,
1596 + {0, 0, NULL, FALSE},
1597 + {0, 0, NULL, FALSE},
1598 + {0, 0, NULL, FALSE},
1599 + TC_void, "thaw", 4,
1602 + {2, 2, GNOME_GtkHTML_Editor_Engine_undoBegin__arginfo, FALSE},
1603 + {0, 0, NULL, FALSE},
1604 + {0, 0, NULL, FALSE},
1605 + TC_void, "undoBegin", 9,
1608 + {0, 0, NULL, FALSE},
1609 + {0, 0, NULL, FALSE},
1610 + {0, 0, NULL, FALSE},
1611 + TC_void, "undoEnd", 7,
1614 + {1, 1, GNOME_GtkHTML_Editor_Engine_ignoreWord__arginfo, FALSE},
1615 + {0, 0, NULL, FALSE},
1616 + {0, 0, NULL, FALSE},
1617 + TC_void, "ignoreWord", 10,
1620 + {0, 0, NULL, FALSE},
1621 + {0, 0, NULL, FALSE},
1622 + {0, 0, NULL, FALSE},
1623 + TC_void, "dropUndo", 8,
1626 + {0, 0, NULL, FALSE},
1627 + {0, 0, NULL, FALSE},
1628 + {0, 0, NULL, FALSE},
1629 + TC_CORBA_boolean, "hasUndo", 7,
1630 + 0 | ORBit_I_COMMON_FIXED_SIZE}
1632 +static CORBA_string GNOME_GtkHTML_Editor_Engine__base_itypes[] = {
1633 + "IDL:Bonobo/Unknown:1.0",
1634 + "IDL:omg.org/CORBA/Object:1.0"
1637 +#ifdef ORBIT_IDL_C_IMODULE_Editor
1640 +ORBit_IInterface GNOME_GtkHTML_Editor_Engine__iinterface = {
1641 + TC_GNOME_GtkHTML_Editor_Engine, {17, 17,
1642 + GNOME_GtkHTML_Editor_Engine__imethods,
1644 + {2, 2, GNOME_GtkHTML_Editor_Engine__base_itypes, FALSE}
1646 diff -Nur vim63/src/gtkhtml_editor.h vim63-bonobo/src/gtkhtml_editor.h
1647 --- vim63/src/gtkhtml_editor.h 1970-01-01 01:00:00.000000000 +0100
1648 +++ vim63-bonobo/src/gtkhtml_editor.h 2005-09-09 20:14:02.727585608 +0200
1650 +#ifndef GTKHTML_ENGINE_H_
1651 +#define GTKHTML_ENGINE_H_
1655 +typedef struct _EditorEngine EditorEngine;
1657 +#include <gtk/gtktypeutils.h>
1658 +#include <bonobo/bonobo-object.h>
1659 +#include "gtkhtml.h"
1661 +#define EDITOR_ENGINE_TYPE (editor_engine_get_type ())
1662 +#define EDITOR_ENGINE(o) (GTK_CHECK_CAST ((o), EDITOR_ENGINE_TYPE, EditorEngine))
1663 +#define EDITOR_ENGINE_CLASS(k) (GTK_CHECK_CLASS_CAST((k), EDITOR_ENGINE_TYPE, EditorEngineClass))
1664 +#define IS_EDITOR_ENGINE(o) (GTK_CHECK_TYPE ((o), EDITOR_ENGINE_TYPE))
1665 +#define IS_EDITOR_ENGINE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), EDITOR_ENGINE_TYPE))
1667 +struct _EditorEngine {
1668 + BonoboObject parent;
1669 + GNOME_GtkHTML_Editor_Listener listener;
1673 + BonoboObjectClass parent_class;
1674 + POA_GNOME_GtkHTML_Editor_Engine__epv epv;
1675 +} EditorEngineClass;
1677 +GtkType editor_engine_get_type (void);
1678 +EditorEngine *editor_engine_new (void);
1679 +POA_GNOME_GtkHTML_Editor_Engine__epv *editor_engine_get_epv (void);
1683 +#endif /* GTKHTML_ENGINE_H_ */
1684 diff -Nur vim63/src/gtkhtml_editor_skels.c vim63-bonobo/src/gtkhtml_editor_skels.c
1685 --- vim63/src/gtkhtml_editor_skels.c 1970-01-01 01:00:00.000000000 +0100
1686 +++ vim63-bonobo/src/gtkhtml_editor_skels.c 2005-09-09 20:14:02.728585456 +0200
1689 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
1692 +#include <string.h>
1693 +#define ORBIT2_STUBS_API
1694 +#include "gtkhtml.h"
1697 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Listener_event
1698 + (POA_GNOME_GtkHTML_Editor_Listener * _o_servant, gpointer _o_retval,
1699 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1700 + CORBA_any * (*_impl_event) (PortableServer_Servant _servant,
1701 + const CORBA_char * name,
1702 + const CORBA_any * arg,
1703 + CORBA_Environment * ev))
1705 + *(CORBA_any * *)_o_retval =
1706 + _impl_event(_o_servant, *(const CORBA_char * *) _o_args[0],
1707 + (const CORBA_any *) _o_args[1], _o_ev);
1711 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__get_listener
1712 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1713 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1714 + GNOME_GtkHTML_Editor_Listener(*_impl__get_listener)
1715 + (PortableServer_Servant _servant, CORBA_Environment * ev))
1717 + *(GNOME_GtkHTML_Editor_Listener *) _o_retval =
1718 + _impl__get_listener(_o_servant, _o_ev);
1722 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__set_listener
1723 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1724 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1725 + void (*_impl__set_listener) (PortableServer_Servant _servant,
1726 + const GNOME_GtkHTML_Editor_Listener value,
1727 + CORBA_Environment * ev))
1729 + _impl__set_listener(_o_servant,
1730 + *(const GNOME_GtkHTML_Editor_Listener *) _o_args[0],
1735 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_runCommand
1736 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1737 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1738 + CORBA_boolean(*_impl_runCommand) (PortableServer_Servant _servant,
1739 + const CORBA_char * command,
1740 + CORBA_Environment * ev))
1742 + *(CORBA_boolean *) _o_retval =
1743 + _impl_runCommand(_o_servant, *(const CORBA_char * *) _o_args[0], _o_ev);
1747 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_getParagraphData
1748 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1749 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1750 + CORBA_string(*_impl_getParagraphData) (PortableServer_Servant _servant,
1751 + const CORBA_char * key,
1752 + CORBA_Environment * ev))
1754 + *(CORBA_string *) _o_retval =
1755 + _impl_getParagraphData(_o_servant, *(const CORBA_char * *) _o_args[0],
1760 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setParagraphData
1761 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1762 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1763 + void (*_impl_setParagraphData) (PortableServer_Servant _servant,
1764 + const CORBA_char * key,
1765 + const CORBA_char * value,
1766 + CORBA_Environment * ev))
1768 + _impl_setParagraphData(_o_servant, *(const CORBA_char * *) _o_args[0],
1769 + *(const CORBA_char * *) _o_args[1], _o_ev);
1773 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setObjectDataByType
1774 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1775 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1776 + void (*_impl_setObjectDataByType) (PortableServer_Servant _servant,
1777 + const CORBA_char * type_name,
1778 + const CORBA_char * key,
1779 + const CORBA_char * data,
1780 + CORBA_Environment * ev))
1782 + _impl_setObjectDataByType(_o_servant, *(const CORBA_char * *) _o_args[0],
1783 + *(const CORBA_char * *) _o_args[1],
1784 + *(const CORBA_char * *) _o_args[2], _o_ev);
1788 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_searchByData
1789 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1790 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1791 + CORBA_boolean(*_impl_searchByData) (PortableServer_Servant _servant,
1792 + const CORBA_long level,
1793 + const CORBA_char * klass,
1794 + const CORBA_char * key,
1795 + const CORBA_char * value,
1796 + CORBA_Environment * ev))
1798 + *(CORBA_boolean *) _o_retval =
1799 + _impl_searchByData(_o_servant, *(const CORBA_long *) _o_args[0],
1800 + *(const CORBA_char * *) _o_args[1],
1801 + *(const CORBA_char * *) _o_args[2],
1802 + *(const CORBA_char * *) _o_args[3], _o_ev);
1806 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isParagraphEmpty
1807 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1808 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1809 + CORBA_boolean(*_impl_isParagraphEmpty) (PortableServer_Servant _servant,
1810 + CORBA_Environment * ev))
1812 + *(CORBA_boolean *) _o_retval = _impl_isParagraphEmpty(_o_servant, _o_ev);
1816 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
1817 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1818 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1819 + CORBA_boolean(*_impl_isPreviousParagraphEmpty) (PortableServer_Servant
1821 + CORBA_Environment * ev))
1823 + *(CORBA_boolean *) _o_retval =
1824 + _impl_isPreviousParagraphEmpty(_o_servant, _o_ev);
1828 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_insertHTML
1829 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1830 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1831 + void (*_impl_insertHTML) (PortableServer_Servant _servant,
1832 + const CORBA_char * html,
1833 + CORBA_Environment * ev))
1835 + _impl_insertHTML(_o_servant, *(const CORBA_char * *) _o_args[0], _o_ev);
1839 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_freeze
1840 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1841 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1842 + void (*_impl_freeze) (PortableServer_Servant _servant,
1843 + CORBA_Environment * ev))
1845 + _impl_freeze(_o_servant, _o_ev);
1849 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_thaw
1850 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1851 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1852 + void (*_impl_thaw) (PortableServer_Servant _servant,
1853 + CORBA_Environment * ev))
1855 + _impl_thaw(_o_servant, _o_ev);
1859 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoBegin
1860 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1861 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1862 + void (*_impl_undoBegin) (PortableServer_Servant _servant,
1863 + const CORBA_char * undo_name,
1864 + const CORBA_char * redo_name,
1865 + CORBA_Environment * ev))
1867 + _impl_undoBegin(_o_servant, *(const CORBA_char * *) _o_args[0],
1868 + *(const CORBA_char * *) _o_args[1], _o_ev);
1872 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoEnd
1873 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1874 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1875 + void (*_impl_undoEnd) (PortableServer_Servant _servant,
1876 + CORBA_Environment * ev))
1878 + _impl_undoEnd(_o_servant, _o_ev);
1882 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_ignoreWord
1883 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1884 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1885 + void (*_impl_ignoreWord) (PortableServer_Servant _servant,
1886 + const CORBA_char * word,
1887 + CORBA_Environment * ev))
1889 + _impl_ignoreWord(_o_servant, *(const CORBA_char * *) _o_args[0], _o_ev);
1893 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_dropUndo
1894 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1895 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1896 + void (*_impl_dropUndo) (PortableServer_Servant _servant,
1897 + CORBA_Environment * ev))
1899 + _impl_dropUndo(_o_servant, _o_ev);
1903 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_hasUndo
1904 + (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
1905 + gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
1906 + CORBA_boolean(*_impl_hasUndo) (PortableServer_Servant _servant,
1907 + CORBA_Environment * ev))
1909 + *(CORBA_boolean *) _o_retval = _impl_hasUndo(_o_servant, _o_ev);
1911 +static ORBitSmallSkeleton
1912 +get_skel_small_GNOME_GtkHTML_Editor_Listener(POA_GNOME_GtkHTML_Editor_Listener
1913 + * servant, const char *opname,
1914 + gpointer * m_data,
1917 + switch (opname[0]) {
1919 + if (strcmp((opname + 1), "vent"))
1922 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Listener_epv->event;
1924 + (gpointer) & GNOME_GtkHTML_Editor_Listener__iinterface.methods.
1926 + return (ORBitSmallSkeleton)
1927 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Listener_event;
1930 + if (strcmp((opname + 1), "ueryInterface"))
1932 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->queryInterface;
1933 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[2];
1934 + return (ORBitSmallSkeleton)
1935 + _ORBIT_skel_small_Bonobo_Unknown_queryInterface;
1938 + if (strcmp((opname + 1), "ef"))
1940 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->ref;
1941 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[0];
1942 + return (ORBitSmallSkeleton) _ORBIT_skel_small_Bonobo_Unknown_ref;
1945 + if (strcmp((opname + 1), "nref"))
1947 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->unref;
1948 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[1];
1949 + return (ORBitSmallSkeleton) _ORBIT_skel_small_Bonobo_Unknown_unref;
1958 +POA_GNOME_GtkHTML_Editor_Listener__init(PortableServer_Servant servant,
1959 + CORBA_Environment * env)
1961 + static PortableServer_ClassInfo class_info =
1963 +(ORBit_small_impl_finder) & get_skel_small_GNOME_GtkHTML_Editor_Listener,
1964 + "IDL:GNOME/GtkHTML/Editor/Listener:1.0",
1965 + &GNOME_GtkHTML_Editor_Listener__classid, NULL,
1966 + &GNOME_GtkHTML_Editor_Listener__iinterface };
1967 + POA_GNOME_GtkHTML_Editor_Listener__vepv *fakevepv = NULL;
1969 + if (((PortableServer_ServantBase *) servant)->vepv[0]->finalize == 0) {
1970 + ((PortableServer_ServantBase *) servant)->vepv[0]->finalize =
1971 + POA_GNOME_GtkHTML_Editor_Listener__fini;
1973 + PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant),
1975 + POA_Bonobo_Unknown__init(servant, env);
1976 + ORBit_classinfo_register(&class_info);
1977 + ORBIT_SERVANT_SET_CLASSINFO(servant, &class_info);
1979 + if (!class_info.vepvmap) {
1980 + class_info.vepvmap =
1981 + g_new0(ORBit_VepvIdx, GNOME_GtkHTML_Editor_Listener__classid + 1);
1982 + class_info.vepvmap[Bonobo_Unknown__classid] =
1983 + (((char *) &(fakevepv->Bonobo_Unknown_epv)) -
1984 + ((char *) (fakevepv))) / sizeof(GFunc);
1985 + class_info.vepvmap[GNOME_GtkHTML_Editor_Listener__classid] =
1986 + (((char *) &(fakevepv->GNOME_GtkHTML_Editor_Listener_epv)) -
1987 + ((char *) (fakevepv))) / sizeof(GFunc);
1992 +POA_GNOME_GtkHTML_Editor_Listener__fini(PortableServer_Servant servant,
1993 + CORBA_Environment * env)
1995 + POA_Bonobo_Unknown__fini(servant, env);
1996 + PortableServer_ServantBase__fini(servant, env);
1999 +static ORBitSmallSkeleton
2000 +get_skel_small_GNOME_GtkHTML_Editor_Engine(POA_GNOME_GtkHTML_Editor_Engine *
2001 + servant, const char *opname,
2002 + gpointer * m_data, gpointer * impl)
2004 + switch (opname[0]) {
2006 + switch (opname[1]) {
2008 + if (strcmp((opname + 2), "et_listener"))
2011 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2014 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2016 + return (ORBitSmallSkeleton)
2017 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__get_listener;
2020 + if (strcmp((opname + 2), "et_listener"))
2023 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2026 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2028 + return (ORBitSmallSkeleton)
2029 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__set_listener;
2036 + if (strcmp((opname + 1), "ropUndo"))
2039 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->dropUndo;
2041 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2043 + return (ORBitSmallSkeleton)
2044 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_dropUndo;
2047 + if (strcmp((opname + 1), "reeze"))
2050 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->freeze;
2052 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2054 + return (ORBitSmallSkeleton)
2055 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_freeze;
2058 + if (strcmp((opname + 1), "etParagraphData"))
2061 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2064 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2066 + return (ORBitSmallSkeleton)
2067 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_getParagraphData;
2070 + if (strcmp((opname + 1), "asUndo"))
2073 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->hasUndo;
2075 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2077 + return (ORBitSmallSkeleton)
2078 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_hasUndo;
2081 + switch (opname[1]) {
2083 + if (strcmp((opname + 2), "noreWord"))
2086 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2089 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2091 + return (ORBitSmallSkeleton)
2092 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_ignoreWord;
2095 + if (strcmp((opname + 2), "sertHTML"))
2098 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2101 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2103 + return (ORBitSmallSkeleton)
2104 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_insertHTML;
2107 + switch (opname[2]) {
2109 + switch (opname[3]) {
2111 + if (strcmp((opname + 4), "ragraphEmpty"))
2114 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2117 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2118 + methods._buffer[7];
2119 + return (ORBitSmallSkeleton)
2120 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isParagraphEmpty;
2123 + if (strcmp((opname + 4), "eviousParagraphEmpty"))
2126 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2127 + isPreviousParagraphEmpty;
2129 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2130 + methods._buffer[8];
2131 + return (ORBitSmallSkeleton)
2132 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty;
2147 + if (strcmp((opname + 1), "ueryInterface"))
2149 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->queryInterface;
2150 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[2];
2151 + return (ORBitSmallSkeleton)
2152 + _ORBIT_skel_small_Bonobo_Unknown_queryInterface;
2155 + switch (opname[1]) {
2157 + if (strcmp((opname + 2), "f"))
2159 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->ref;
2160 + *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[0];
2161 + return (ORBitSmallSkeleton) _ORBIT_skel_small_Bonobo_Unknown_ref;
2164 + if (strcmp((opname + 2), "nCommand"))
2167 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2170 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2172 + return (ORBitSmallSkeleton)
2173 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_runCommand;
2180 + switch (opname[1]) {
2182 + switch (opname[2]) {
2184 + if (strcmp((opname + 3), "rchByData"))
2187 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2190 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2192 + return (ORBitSmallSkeleton)
2193 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_searchByData;
2196 + switch (opname[3]) {
2198 + if (strcmp((opname + 4), "bjectDataByType"))
2201 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2202 + setObjectDataByType;
2204 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2205 + methods._buffer[5];
2206 + return (ORBitSmallSkeleton)
2207 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setObjectDataByType;
2210 + if (strcmp((opname + 4), "aragraphData"))
2213 + (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2216 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2217 + methods._buffer[4];
2218 + return (ORBitSmallSkeleton)
2219 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setParagraphData;
2234 + if (strcmp((opname + 1), "haw"))
2236 + *impl = (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->thaw;
2238 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2240 + return (ORBitSmallSkeleton)
2241 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_thaw;
2244 + switch (opname[1]) {
2246 + switch (opname[2]) {
2248 + switch (opname[3]) {
2250 + switch (opname[4]) {
2252 + if (strcmp((opname + 5), "egin"))
2255 + (gpointer) servant->vepv->
2256 + GNOME_GtkHTML_Editor_Engine_epv->undoBegin;
2258 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2259 + methods._buffer[12];
2260 + return (ORBitSmallSkeleton)
2261 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoBegin;
2264 + if (strcmp((opname + 5), "nd"))
2267 + (gpointer) servant->vepv->
2268 + GNOME_GtkHTML_Editor_Engine_epv->undoEnd;
2270 + (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2271 + methods._buffer[13];
2272 + return (ORBitSmallSkeleton)
2273 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoEnd;
2284 + if (strcmp((opname + 3), "ef"))
2286 + *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->unref;
2288 + (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[1];
2289 + return (ORBitSmallSkeleton)
2290 + _ORBIT_skel_small_Bonobo_Unknown_unref;
2307 +POA_GNOME_GtkHTML_Editor_Engine__init(PortableServer_Servant servant,
2308 + CORBA_Environment * env)
2310 + static PortableServer_ClassInfo class_info =
2312 +(ORBit_small_impl_finder) & get_skel_small_GNOME_GtkHTML_Editor_Engine, "IDL:GNOME/GtkHTML/Editor/Engine:1.0",
2313 + &GNOME_GtkHTML_Editor_Engine__classid, NULL,
2314 + &GNOME_GtkHTML_Editor_Engine__iinterface };
2315 + POA_GNOME_GtkHTML_Editor_Engine__vepv *fakevepv = NULL;
2317 + if (((PortableServer_ServantBase *) servant)->vepv[0]->finalize == 0) {
2318 + ((PortableServer_ServantBase *) servant)->vepv[0]->finalize =
2319 + POA_GNOME_GtkHTML_Editor_Engine__fini;
2321 + PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant),
2323 + POA_Bonobo_Unknown__init(servant, env);
2324 + ORBit_classinfo_register(&class_info);
2325 + ORBIT_SERVANT_SET_CLASSINFO(servant, &class_info);
2327 + if (!class_info.vepvmap) {
2328 + class_info.vepvmap =
2329 + g_new0(ORBit_VepvIdx, GNOME_GtkHTML_Editor_Engine__classid + 1);
2330 + class_info.vepvmap[Bonobo_Unknown__classid] =
2331 + (((char *) &(fakevepv->Bonobo_Unknown_epv)) -
2332 + ((char *) (fakevepv))) / sizeof(GFunc);
2333 + class_info.vepvmap[GNOME_GtkHTML_Editor_Engine__classid] =
2334 + (((char *) &(fakevepv->GNOME_GtkHTML_Editor_Engine_epv)) -
2335 + ((char *) (fakevepv))) / sizeof(GFunc);
2340 +POA_GNOME_GtkHTML_Editor_Engine__fini(PortableServer_Servant servant,
2341 + CORBA_Environment * env)
2343 + POA_Bonobo_Unknown__fini(servant, env);
2344 + PortableServer_ServantBase__fini(servant, env);
2346 diff -Nur vim63/src/gtkhtml_editor_stubs.c vim63-bonobo/src/gtkhtml_editor_stubs.c
2347 --- vim63/src/gtkhtml_editor_stubs.c 1970-01-01 01:00:00.000000000 +0100
2348 +++ vim63-bonobo/src/gtkhtml_editor_stubs.c 2005-09-09 20:14:02.729585304 +0200
2351 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
2354 +#include <string.h>
2355 +#define ORBIT2_STUBS_API
2356 +#include "gtkhtml.h"
2359 +GNOME_GtkHTML_Editor_Listener_event(GNOME_GtkHTML_Editor_Listener _obj,
2360 + const CORBA_char * name,
2361 + const CORBA_any * arg,
2362 + CORBA_Environment * ev)
2364 + CORBA_any *_ORBIT_retval;
2365 + POA_GNOME_GtkHTML_Editor_Listener__epv *_ORBIT_epv;
2367 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2368 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Listener__classid) &&
2370 + (POA_GNOME_GtkHTML_Editor_Listener__epv *) ORBIT_STUB_GetEpv(_obj,
2371 + GNOME_GtkHTML_Editor_Listener__classid))->
2373 + ORBIT_STUB_PreCall(_obj);
2375 + _ORBIT_epv->event(ORBIT_STUB_GetServant(_obj), name, arg, ev);
2376 + ORBIT_STUB_PostCall(_obj);
2377 + } else { /* remote marshal */
2378 + gpointer _args[2];
2380 + _args[0] = (gpointer) & name;
2381 + _args[1] = (gpointer) arg;
2382 + ORBit_small_invoke_stub_n(_obj,
2383 + &GNOME_GtkHTML_Editor_Listener__iinterface.
2384 + methods, 0, &_ORBIT_retval, _args, NULL, ev);
2387 + return _ORBIT_retval;
2390 +GNOME_GtkHTML_Editor_Listener
2391 +GNOME_GtkHTML_Editor_Engine__get_listener(GNOME_GtkHTML_Editor_Engine _obj,
2392 + CORBA_Environment * ev)
2394 + GNOME_GtkHTML_Editor_Listener _ORBIT_retval;
2395 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2397 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2398 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2400 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2401 + GNOME_GtkHTML_Editor_Engine__classid))->
2403 + ORBIT_STUB_PreCall(_obj);
2405 + _ORBIT_epv->_get_listener(ORBIT_STUB_GetServant(_obj), ev);
2406 + ORBIT_STUB_PostCall(_obj);
2407 + } else { /* remote marshal */
2408 + ORBit_small_invoke_stub_n(_obj,
2409 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2410 + methods, 0, &_ORBIT_retval, NULL, NULL, ev);
2413 + return _ORBIT_retval;
2417 +GNOME_GtkHTML_Editor_Engine__set_listener(GNOME_GtkHTML_Editor_Engine _obj,
2418 + const GNOME_GtkHTML_Editor_Listener
2419 + value, CORBA_Environment * ev)
2421 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2423 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2424 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2426 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2427 + GNOME_GtkHTML_Editor_Engine__classid))->
2429 + ORBIT_STUB_PreCall(_obj);
2430 + _ORBIT_epv->_set_listener(ORBIT_STUB_GetServant(_obj), value, ev);
2431 + ORBIT_STUB_PostCall(_obj);
2432 + } else { /* remote marshal */
2433 + gpointer _args[1];
2435 + _args[0] = (gpointer) & value;
2436 + ORBit_small_invoke_stub_n(_obj,
2437 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2438 + methods, 1, NULL, _args, NULL, ev);
2443 +GNOME_GtkHTML_Editor_Engine_runCommand(GNOME_GtkHTML_Editor_Engine _obj,
2444 + const CORBA_char * command,
2445 + CORBA_Environment * ev)
2447 + CORBA_boolean _ORBIT_retval;
2448 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2450 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2451 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2453 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2454 + GNOME_GtkHTML_Editor_Engine__classid))->
2456 + ORBIT_STUB_PreCall(_obj);
2458 + _ORBIT_epv->runCommand(ORBIT_STUB_GetServant(_obj), command, ev);
2459 + ORBIT_STUB_PostCall(_obj);
2460 + } else { /* remote marshal */
2461 + gpointer _args[1];
2463 + _args[0] = (gpointer) & command;
2464 + ORBit_small_invoke_stub_n(_obj,
2465 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2466 + methods, 2, &_ORBIT_retval, _args, NULL, ev);
2469 + return _ORBIT_retval;
2473 +GNOME_GtkHTML_Editor_Engine_getParagraphData(GNOME_GtkHTML_Editor_Engine _obj,
2474 + const CORBA_char * key,
2475 + CORBA_Environment * ev)
2477 + CORBA_string _ORBIT_retval;
2478 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2480 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2481 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2483 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2484 + GNOME_GtkHTML_Editor_Engine__classid))->
2485 + getParagraphData) {
2486 + ORBIT_STUB_PreCall(_obj);
2488 + _ORBIT_epv->getParagraphData(ORBIT_STUB_GetServant(_obj), key, ev);
2489 + ORBIT_STUB_PostCall(_obj);
2490 + } else { /* remote marshal */
2491 + gpointer _args[1];
2493 + _args[0] = (gpointer) & key;
2494 + ORBit_small_invoke_stub_n(_obj,
2495 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2496 + methods, 3, &_ORBIT_retval, _args, NULL, ev);
2499 + return _ORBIT_retval;
2503 +GNOME_GtkHTML_Editor_Engine_setParagraphData(GNOME_GtkHTML_Editor_Engine _obj,
2504 + const CORBA_char * key,
2505 + const CORBA_char * value,
2506 + CORBA_Environment * ev)
2508 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2510 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2511 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2513 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2514 + GNOME_GtkHTML_Editor_Engine__classid))->
2515 + setParagraphData) {
2516 + ORBIT_STUB_PreCall(_obj);
2517 + _ORBIT_epv->setParagraphData(ORBIT_STUB_GetServant(_obj), key, value,
2519 + ORBIT_STUB_PostCall(_obj);
2520 + } else { /* remote marshal */
2521 + gpointer _args[2];
2523 + _args[0] = (gpointer) & key;
2524 + _args[1] = (gpointer) & value;
2525 + ORBit_small_invoke_stub_n(_obj,
2526 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2527 + methods, 4, NULL, _args, NULL, ev);
2532 +GNOME_GtkHTML_Editor_Engine_setObjectDataByType(GNOME_GtkHTML_Editor_Engine
2534 + const CORBA_char * type_name,
2535 + const CORBA_char * key,
2536 + const CORBA_char * data,
2537 + CORBA_Environment * ev)
2539 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2541 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2542 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2544 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2545 + GNOME_GtkHTML_Editor_Engine__classid))->
2546 + setObjectDataByType) {
2547 + ORBIT_STUB_PreCall(_obj);
2548 + _ORBIT_epv->setObjectDataByType(ORBIT_STUB_GetServant(_obj), type_name,
2550 + ORBIT_STUB_PostCall(_obj);
2551 + } else { /* remote marshal */
2552 + gpointer _args[3];
2554 + _args[0] = (gpointer) & type_name;
2555 + _args[1] = (gpointer) & key;
2556 + _args[2] = (gpointer) & data;
2557 + ORBit_small_invoke_stub_n(_obj,
2558 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2559 + methods, 5, NULL, _args, NULL, ev);
2564 +GNOME_GtkHTML_Editor_Engine_searchByData(GNOME_GtkHTML_Editor_Engine _obj,
2565 + const CORBA_long level,
2566 + const CORBA_char * klass,
2567 + const CORBA_char * key,
2568 + const CORBA_char * value,
2569 + CORBA_Environment * ev)
2571 + CORBA_boolean _ORBIT_retval;
2572 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2574 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2575 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2577 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2578 + GNOME_GtkHTML_Editor_Engine__classid))->
2580 + ORBIT_STUB_PreCall(_obj);
2582 + _ORBIT_epv->searchByData(ORBIT_STUB_GetServant(_obj), level, klass,
2584 + ORBIT_STUB_PostCall(_obj);
2585 + } else { /* remote marshal */
2586 + gpointer _args[4];
2588 + _args[0] = (gpointer) & level;
2589 + _args[1] = (gpointer) & klass;
2590 + _args[2] = (gpointer) & key;
2591 + _args[3] = (gpointer) & value;
2592 + ORBit_small_invoke_stub_n(_obj,
2593 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2594 + methods, 6, &_ORBIT_retval, _args, NULL, ev);
2597 + return _ORBIT_retval;
2601 +GNOME_GtkHTML_Editor_Engine_isParagraphEmpty(GNOME_GtkHTML_Editor_Engine _obj,
2602 + CORBA_Environment * ev)
2604 + CORBA_boolean _ORBIT_retval;
2605 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2607 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2608 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2610 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2611 + GNOME_GtkHTML_Editor_Engine__classid))->
2612 + isParagraphEmpty) {
2613 + ORBIT_STUB_PreCall(_obj);
2615 + _ORBIT_epv->isParagraphEmpty(ORBIT_STUB_GetServant(_obj), ev);
2616 + ORBIT_STUB_PostCall(_obj);
2617 + } else { /* remote marshal */
2618 + ORBit_small_invoke_stub_n(_obj,
2619 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2620 + methods, 7, &_ORBIT_retval, NULL, NULL, ev);
2623 + return _ORBIT_retval;
2627 +GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
2628 + (GNOME_GtkHTML_Editor_Engine _obj, CORBA_Environment * ev)
2630 + CORBA_boolean _ORBIT_retval;
2631 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2633 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2634 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2636 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2637 + GNOME_GtkHTML_Editor_Engine__classid))->
2638 + isPreviousParagraphEmpty) {
2639 + ORBIT_STUB_PreCall(_obj);
2641 + _ORBIT_epv->isPreviousParagraphEmpty(ORBIT_STUB_GetServant(_obj),
2643 + ORBIT_STUB_PostCall(_obj);
2644 + } else { /* remote marshal */
2645 + ORBit_small_invoke_stub_n(_obj,
2646 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2647 + methods, 8, &_ORBIT_retval, NULL, NULL, ev);
2650 + return _ORBIT_retval;
2654 +GNOME_GtkHTML_Editor_Engine_insertHTML(GNOME_GtkHTML_Editor_Engine _obj,
2655 + const CORBA_char * html,
2656 + CORBA_Environment * ev)
2658 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2660 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2661 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2663 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2664 + GNOME_GtkHTML_Editor_Engine__classid))->
2666 + ORBIT_STUB_PreCall(_obj);
2667 + _ORBIT_epv->insertHTML(ORBIT_STUB_GetServant(_obj), html, ev);
2668 + ORBIT_STUB_PostCall(_obj);
2669 + } else { /* remote marshal */
2670 + gpointer _args[1];
2672 + _args[0] = (gpointer) & html;
2673 + ORBit_small_invoke_stub_n(_obj,
2674 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2675 + methods, 9, NULL, _args, NULL, ev);
2680 +GNOME_GtkHTML_Editor_Engine_freeze(GNOME_GtkHTML_Editor_Engine _obj,
2681 + CORBA_Environment * ev)
2683 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2685 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2686 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2688 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2689 + GNOME_GtkHTML_Editor_Engine__classid))->
2691 + ORBIT_STUB_PreCall(_obj);
2692 + _ORBIT_epv->freeze(ORBIT_STUB_GetServant(_obj), ev);
2693 + ORBIT_STUB_PostCall(_obj);
2694 + } else { /* remote marshal */
2695 + ORBit_small_invoke_stub_n(_obj,
2696 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2697 + methods, 10, NULL, NULL, NULL, ev);
2702 +GNOME_GtkHTML_Editor_Engine_thaw(GNOME_GtkHTML_Editor_Engine _obj,
2703 + CORBA_Environment * ev)
2705 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2707 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2708 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2710 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2711 + GNOME_GtkHTML_Editor_Engine__classid))->
2713 + ORBIT_STUB_PreCall(_obj);
2714 + _ORBIT_epv->thaw(ORBIT_STUB_GetServant(_obj), ev);
2715 + ORBIT_STUB_PostCall(_obj);
2716 + } else { /* remote marshal */
2717 + ORBit_small_invoke_stub_n(_obj,
2718 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2719 + methods, 11, NULL, NULL, NULL, ev);
2724 +GNOME_GtkHTML_Editor_Engine_undoBegin(GNOME_GtkHTML_Editor_Engine _obj,
2725 + const CORBA_char * undo_name,
2726 + const CORBA_char * redo_name,
2727 + CORBA_Environment * ev)
2729 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2731 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2732 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2734 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2735 + GNOME_GtkHTML_Editor_Engine__classid))->
2737 + ORBIT_STUB_PreCall(_obj);
2738 + _ORBIT_epv->undoBegin(ORBIT_STUB_GetServant(_obj), undo_name, redo_name,
2740 + ORBIT_STUB_PostCall(_obj);
2741 + } else { /* remote marshal */
2742 + gpointer _args[2];
2744 + _args[0] = (gpointer) & undo_name;
2745 + _args[1] = (gpointer) & redo_name;
2746 + ORBit_small_invoke_stub_n(_obj,
2747 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2748 + methods, 12, NULL, _args, NULL, ev);
2753 +GNOME_GtkHTML_Editor_Engine_undoEnd(GNOME_GtkHTML_Editor_Engine _obj,
2754 + CORBA_Environment * ev)
2756 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2758 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2759 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2761 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2762 + GNOME_GtkHTML_Editor_Engine__classid))->
2764 + ORBIT_STUB_PreCall(_obj);
2765 + _ORBIT_epv->undoEnd(ORBIT_STUB_GetServant(_obj), ev);
2766 + ORBIT_STUB_PostCall(_obj);
2767 + } else { /* remote marshal */
2768 + ORBit_small_invoke_stub_n(_obj,
2769 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2770 + methods, 13, NULL, NULL, NULL, ev);
2775 +GNOME_GtkHTML_Editor_Engine_ignoreWord(GNOME_GtkHTML_Editor_Engine _obj,
2776 + const CORBA_char * word,
2777 + CORBA_Environment * ev)
2779 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2781 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2782 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2784 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2785 + GNOME_GtkHTML_Editor_Engine__classid))->
2787 + ORBIT_STUB_PreCall(_obj);
2788 + _ORBIT_epv->ignoreWord(ORBIT_STUB_GetServant(_obj), word, ev);
2789 + ORBIT_STUB_PostCall(_obj);
2790 + } else { /* remote marshal */
2791 + gpointer _args[1];
2793 + _args[0] = (gpointer) & word;
2794 + ORBit_small_invoke_stub_n(_obj,
2795 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2796 + methods, 14, NULL, _args, NULL, ev);
2801 +GNOME_GtkHTML_Editor_Engine_dropUndo(GNOME_GtkHTML_Editor_Engine _obj,
2802 + CORBA_Environment * ev)
2804 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2806 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2807 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2809 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2810 + GNOME_GtkHTML_Editor_Engine__classid))->
2812 + ORBIT_STUB_PreCall(_obj);
2813 + _ORBIT_epv->dropUndo(ORBIT_STUB_GetServant(_obj), ev);
2814 + ORBIT_STUB_PostCall(_obj);
2815 + } else { /* remote marshal */
2816 + ORBit_small_invoke_stub_n(_obj,
2817 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2818 + methods, 15, NULL, NULL, NULL, ev);
2823 +GNOME_GtkHTML_Editor_Engine_hasUndo(GNOME_GtkHTML_Editor_Engine _obj,
2824 + CORBA_Environment * ev)
2826 + CORBA_boolean _ORBIT_retval;
2827 + POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
2829 + if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
2830 + ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
2832 + (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
2833 + GNOME_GtkHTML_Editor_Engine__classid))->
2835 + ORBIT_STUB_PreCall(_obj);
2836 + _ORBIT_retval = _ORBIT_epv->hasUndo(ORBIT_STUB_GetServant(_obj), ev);
2837 + ORBIT_STUB_PostCall(_obj);
2838 + } else { /* remote marshal */
2839 + ORBit_small_invoke_stub_n(_obj,
2840 + &GNOME_GtkHTML_Editor_Engine__iinterface.
2841 + methods, 16, &_ORBIT_retval, NULL, NULL, ev);
2844 + return _ORBIT_retval;
2846 diff -Nur vim63/src/gtkhtml.h vim63-bonobo/src/gtkhtml.h
2847 --- vim63/src/gtkhtml.h 1970-01-01 01:00:00.000000000 +0100
2848 +++ vim63-bonobo/src/gtkhtml.h 2005-09-09 20:14:02.725585912 +0200
2851 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
2857 +#define ORBIT_IDL_SERIAL 19
2858 +#include <orbit/orbit-types.h>
2863 +#endif /* __cplusplus */
2866 +#include <bonobo/Bonobo.h>
2867 +#if !defined(ORBIT_DECL_GNOME_GtkHTML_Editor_Listener) && !defined(_GNOME_GtkHTML_Editor_Listener_defined)
2868 +#define ORBIT_DECL_GNOME_GtkHTML_Editor_Listener 1
2869 +#define _GNOME_GtkHTML_Editor_Listener_defined 1
2870 +#define GNOME_GtkHTML_Editor_Listener__freekids CORBA_Object__freekids
2871 + typedef CORBA_Object GNOME_GtkHTML_Editor_Listener;
2872 + extern CORBA_unsigned_long GNOME_GtkHTML_Editor_Listener__classid;
2873 +#if !defined(TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_0)
2874 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_0 'E'
2875 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_1 'd'
2876 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_2 'i'
2877 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_3 't'
2878 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_4 'o'
2879 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_5 'r'
2880 +#ifdef ORBIT_IDL_C_IMODULE
2885 + const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Listener_struct;
2886 +#define TC_GNOME_GtkHTML_Editor_Listener ((CORBA_TypeCode)&TC_GNOME_GtkHTML_Editor_Listener_struct)
2889 +#if !defined(ORBIT_DECL_GNOME_GtkHTML_Editor_Engine) && !defined(_GNOME_GtkHTML_Editor_Engine_defined)
2890 +#define ORBIT_DECL_GNOME_GtkHTML_Editor_Engine 1
2891 +#define _GNOME_GtkHTML_Editor_Engine_defined 1
2892 +#define GNOME_GtkHTML_Editor_Engine__freekids CORBA_Object__freekids
2893 + typedef CORBA_Object GNOME_GtkHTML_Editor_Engine;
2894 + extern CORBA_unsigned_long GNOME_GtkHTML_Editor_Engine__classid;
2895 +#if !defined(TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_0)
2896 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_0 'E'
2897 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_1 'd'
2898 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_2 'i'
2899 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_3 't'
2900 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_4 'o'
2901 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_5 'r'
2902 +#ifdef ORBIT_IDL_C_IMODULE
2907 + const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Engine_struct;
2908 +#define TC_GNOME_GtkHTML_Editor_Engine ((CORBA_TypeCode)&TC_GNOME_GtkHTML_Editor_Engine_struct)
2911 +#if !defined(_GNOME_GtkHTML_Editor_URLRequestEvent_defined)
2912 +#define _GNOME_GtkHTML_Editor_URLRequestEvent_defined 1
2913 + typedef struct GNOME_GtkHTML_Editor_URLRequestEvent_type
2914 + GNOME_GtkHTML_Editor_URLRequestEvent;
2915 + struct GNOME_GtkHTML_Editor_URLRequestEvent_type
2918 + Bonobo_Stream stream;
2921 +#if !defined(TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_0)
2922 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_0 'E'
2923 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_1 'd'
2924 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_2 'i'
2925 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_3 't'
2926 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_4 'o'
2927 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_5 'r'
2928 +#ifdef ORBIT_IDL_C_IMODULE
2933 + const struct CORBA_TypeCode_struct
2934 + TC_GNOME_GtkHTML_Editor_URLRequestEvent_struct;
2935 +#define TC_GNOME_GtkHTML_Editor_URLRequestEvent ((CORBA_TypeCode)&TC_GNOME_GtkHTML_Editor_URLRequestEvent_struct)
2937 +#define GNOME_GtkHTML_Editor_URLRequestEvent__alloc() ((GNOME_GtkHTML_Editor_URLRequestEvent *)ORBit_small_alloc (TC_GNOME_GtkHTML_Editor_URLRequestEvent))
2938 +#define GNOME_GtkHTML_Editor_URLRequestEvent__freekids(m,d) ORBit_small_freekids (TC_GNOME_GtkHTML_Editor_URLRequestEvent,(m),(d))
2941 +/** POA structures **/
2942 +#ifndef _defined_POA_GNOME_GtkHTML_Editor_Listener
2943 +#define _defined_POA_GNOME_GtkHTML_Editor_Listener 1
2947 + CORBA_any *(*event) (PortableServer_Servant _servant,
2948 + const CORBA_char * name, const CORBA_any * arg,
2949 + CORBA_Environment * ev);
2951 + POA_GNOME_GtkHTML_Editor_Listener__epv;
2954 + PortableServer_ServantBase__epv *_base_epv;
2955 + POA_Bonobo_Unknown__epv *Bonobo_Unknown_epv;
2956 + POA_GNOME_GtkHTML_Editor_Listener__epv
2957 + *GNOME_GtkHTML_Editor_Listener_epv;
2959 + POA_GNOME_GtkHTML_Editor_Listener__vepv;
2963 + POA_GNOME_GtkHTML_Editor_Listener__vepv *vepv;
2965 + POA_GNOME_GtkHTML_Editor_Listener;
2966 + extern void POA_GNOME_GtkHTML_Editor_Listener__init(PortableServer_Servant
2968 + CORBA_Environment *
2970 + extern void POA_GNOME_GtkHTML_Editor_Listener__fini(PortableServer_Servant
2972 + CORBA_Environment *
2974 +#endif /* _defined_POA_GNOME_GtkHTML_Editor_Listener */
2975 +#ifndef _defined_POA_GNOME_GtkHTML_Editor_Engine
2976 +#define _defined_POA_GNOME_GtkHTML_Editor_Engine 1
2980 + GNOME_GtkHTML_Editor_Listener(*_get_listener) (PortableServer_Servant
2982 + CORBA_Environment * ev);
2983 + void (*_set_listener) (PortableServer_Servant _servant,
2984 + const GNOME_GtkHTML_Editor_Listener value,
2985 + CORBA_Environment * ev);
2986 + CORBA_boolean(*runCommand) (PortableServer_Servant _servant,
2987 + const CORBA_char * command,
2988 + CORBA_Environment * ev);
2989 + CORBA_string(*getParagraphData) (PortableServer_Servant _servant,
2990 + const CORBA_char * key,
2991 + CORBA_Environment * ev);
2992 + void (*setParagraphData) (PortableServer_Servant _servant,
2993 + const CORBA_char * key,
2994 + const CORBA_char * value,
2995 + CORBA_Environment * ev);
2996 + void (*setObjectDataByType) (PortableServer_Servant _servant,
2997 + const CORBA_char * type_name,
2998 + const CORBA_char * key,
2999 + const CORBA_char * data,
3000 + CORBA_Environment * ev);
3001 + CORBA_boolean(*searchByData) (PortableServer_Servant _servant,
3002 + const CORBA_long level,
3003 + const CORBA_char * klass,
3004 + const CORBA_char * key,
3005 + const CORBA_char * value,
3006 + CORBA_Environment * ev);
3007 + CORBA_boolean(*isParagraphEmpty) (PortableServer_Servant _servant,
3008 + CORBA_Environment * ev);
3009 + CORBA_boolean(*isPreviousParagraphEmpty) (PortableServer_Servant
3011 + CORBA_Environment * ev);
3012 + void (*insertHTML) (PortableServer_Servant _servant,
3013 + const CORBA_char * html, CORBA_Environment * ev);
3014 + void (*freeze) (PortableServer_Servant _servant,
3015 + CORBA_Environment * ev);
3016 + void (*thaw) (PortableServer_Servant _servant, CORBA_Environment * ev);
3017 + void (*undoBegin) (PortableServer_Servant _servant,
3018 + const CORBA_char * undo_name,
3019 + const CORBA_char * redo_name,
3020 + CORBA_Environment * ev);
3021 + void (*undoEnd) (PortableServer_Servant _servant,
3022 + CORBA_Environment * ev);
3023 + void (*ignoreWord) (PortableServer_Servant _servant,
3024 + const CORBA_char * word, CORBA_Environment * ev);
3025 + void (*dropUndo) (PortableServer_Servant _servant,
3026 + CORBA_Environment * ev);
3027 + CORBA_boolean(*hasUndo) (PortableServer_Servant _servant,
3028 + CORBA_Environment * ev);
3030 + POA_GNOME_GtkHTML_Editor_Engine__epv;
3033 + PortableServer_ServantBase__epv *_base_epv;
3034 + POA_Bonobo_Unknown__epv *Bonobo_Unknown_epv;
3035 + POA_GNOME_GtkHTML_Editor_Engine__epv *GNOME_GtkHTML_Editor_Engine_epv;
3037 + POA_GNOME_GtkHTML_Editor_Engine__vepv;
3041 + POA_GNOME_GtkHTML_Editor_Engine__vepv *vepv;
3043 + POA_GNOME_GtkHTML_Editor_Engine;
3044 + extern void POA_GNOME_GtkHTML_Editor_Engine__init(PortableServer_Servant
3046 + CORBA_Environment * ev);
3047 + extern void POA_GNOME_GtkHTML_Editor_Engine__fini(PortableServer_Servant
3049 + CORBA_Environment * ev);
3050 +#endif /* _defined_POA_GNOME_GtkHTML_Editor_Engine */
3052 +/** skel prototypes **/
3054 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Listener_event
3055 + (POA_GNOME_GtkHTML_Editor_Listener * _ORBIT_servant,
3056 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3057 + CORBA_Environment * ev,
3058 + CORBA_any * (*_impl_event) (PortableServer_Servant _servant,
3059 + const CORBA_char * name,
3060 + const CORBA_any * arg,
3061 + CORBA_Environment * ev));
3063 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__get_listener
3064 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3065 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3066 + CORBA_Environment * ev,
3067 + GNOME_GtkHTML_Editor_Listener(*_impl__get_listener)
3068 + (PortableServer_Servant _servant, CORBA_Environment * ev));
3070 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__set_listener
3071 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3072 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3073 + CORBA_Environment * ev,
3074 + void (*_impl__set_listener) (PortableServer_Servant _servant,
3075 + const GNOME_GtkHTML_Editor_Listener value,
3076 + CORBA_Environment * ev));
3078 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_runCommand
3079 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3080 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3081 + CORBA_Environment * ev,
3082 + CORBA_boolean(*_impl_runCommand) (PortableServer_Servant _servant,
3083 + const CORBA_char * command,
3084 + CORBA_Environment * ev));
3086 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_getParagraphData
3087 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3088 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3089 + CORBA_Environment * ev,
3090 + CORBA_string(*_impl_getParagraphData) (PortableServer_Servant _servant,
3091 + const CORBA_char * key,
3092 + CORBA_Environment * ev));
3094 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setParagraphData
3095 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3096 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3097 + CORBA_Environment * ev,
3098 + void (*_impl_setParagraphData) (PortableServer_Servant _servant,
3099 + const CORBA_char * key,
3100 + const CORBA_char * value,
3101 + CORBA_Environment * ev));
3103 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setObjectDataByType
3104 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3105 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3106 + CORBA_Environment * ev,
3107 + void (*_impl_setObjectDataByType) (PortableServer_Servant _servant,
3108 + const CORBA_char * type_name,
3109 + const CORBA_char * key,
3110 + const CORBA_char * data,
3111 + CORBA_Environment * ev));
3113 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_searchByData
3114 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3115 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3116 + CORBA_Environment * ev,
3117 + CORBA_boolean(*_impl_searchByData) (PortableServer_Servant _servant,
3118 + const CORBA_long level,
3119 + const CORBA_char * klass,
3120 + const CORBA_char * key,
3121 + const CORBA_char * value,
3122 + CORBA_Environment * ev));
3124 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isParagraphEmpty
3125 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3126 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3127 + CORBA_Environment * ev,
3128 + CORBA_boolean(*_impl_isParagraphEmpty) (PortableServer_Servant
3130 + CORBA_Environment * ev));
3132 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
3133 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3134 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3135 + CORBA_Environment * ev,
3136 + CORBA_boolean(*_impl_isPreviousParagraphEmpty) (PortableServer_Servant
3138 + CORBA_Environment *
3141 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_insertHTML
3142 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3143 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3144 + CORBA_Environment * ev,
3145 + void (*_impl_insertHTML) (PortableServer_Servant _servant,
3146 + const CORBA_char * html,
3147 + CORBA_Environment * ev));
3149 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_freeze
3150 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3151 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3152 + CORBA_Environment * ev,
3153 + void (*_impl_freeze) (PortableServer_Servant _servant,
3154 + CORBA_Environment * ev));
3156 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_thaw
3157 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3158 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3159 + CORBA_Environment * ev,
3160 + void (*_impl_thaw) (PortableServer_Servant _servant,
3161 + CORBA_Environment * ev));
3163 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoBegin
3164 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3165 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3166 + CORBA_Environment * ev,
3167 + void (*_impl_undoBegin) (PortableServer_Servant _servant,
3168 + const CORBA_char * undo_name,
3169 + const CORBA_char * redo_name,
3170 + CORBA_Environment * ev));
3172 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoEnd
3173 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3174 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3175 + CORBA_Environment * ev,
3176 + void (*_impl_undoEnd) (PortableServer_Servant _servant,
3177 + CORBA_Environment * ev));
3179 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_ignoreWord
3180 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3181 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3182 + CORBA_Environment * ev,
3183 + void (*_impl_ignoreWord) (PortableServer_Servant _servant,
3184 + const CORBA_char * word,
3185 + CORBA_Environment * ev));
3187 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_dropUndo
3188 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3189 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3190 + CORBA_Environment * ev,
3191 + void (*_impl_dropUndo) (PortableServer_Servant _servant,
3192 + CORBA_Environment * ev));
3194 + _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_hasUndo
3195 + (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
3196 + gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
3197 + CORBA_Environment * ev,
3198 + CORBA_boolean(*_impl_hasUndo) (PortableServer_Servant _servant,
3199 + CORBA_Environment * ev));
3201 +/** stub prototypes **/
3202 +#define GNOME_GtkHTML_Editor_Listener_ref Bonobo_Unknown_ref
3203 +#define GNOME_GtkHTML_Editor_Listener_unref Bonobo_Unknown_unref
3204 +#define GNOME_GtkHTML_Editor_Listener_queryInterface Bonobo_Unknown_queryInterface
3206 + *GNOME_GtkHTML_Editor_Listener_event(GNOME_GtkHTML_Editor_Listener _obj,
3207 + const CORBA_char * name,
3208 + const CORBA_any * arg,
3209 + CORBA_Environment * ev);
3210 +#define GNOME_GtkHTML_Editor_Engine_ref Bonobo_Unknown_ref
3211 +#define GNOME_GtkHTML_Editor_Engine_unref Bonobo_Unknown_unref
3212 +#define GNOME_GtkHTML_Editor_Engine_queryInterface Bonobo_Unknown_queryInterface
3213 + GNOME_GtkHTML_Editor_Listener
3214 + GNOME_GtkHTML_Editor_Engine__get_listener(GNOME_GtkHTML_Editor_Engine
3215 + _obj, CORBA_Environment * ev);
3216 + void GNOME_GtkHTML_Editor_Engine__set_listener(GNOME_GtkHTML_Editor_Engine
3219 + GNOME_GtkHTML_Editor_Listener
3221 + CORBA_Environment * ev);
3223 + GNOME_GtkHTML_Editor_Engine_runCommand(GNOME_GtkHTML_Editor_Engine _obj,
3224 + const CORBA_char * command,
3225 + CORBA_Environment * ev);
3227 + GNOME_GtkHTML_Editor_Engine_getParagraphData(GNOME_GtkHTML_Editor_Engine
3229 + const CORBA_char * key,
3230 + CORBA_Environment * ev);
3232 + GNOME_GtkHTML_Editor_Engine_setParagraphData(GNOME_GtkHTML_Editor_Engine
3234 + const CORBA_char * key,
3235 + const CORBA_char * value,
3236 + CORBA_Environment * ev);
3238 + GNOME_GtkHTML_Editor_Engine_setObjectDataByType
3239 + (GNOME_GtkHTML_Editor_Engine _obj, const CORBA_char * type_name,
3240 + const CORBA_char * key, const CORBA_char * data,
3241 + CORBA_Environment * ev);
3243 + GNOME_GtkHTML_Editor_Engine_searchByData(GNOME_GtkHTML_Editor_Engine
3244 + _obj, const CORBA_long level,
3245 + const CORBA_char * klass,
3246 + const CORBA_char * key,
3247 + const CORBA_char * value,
3248 + CORBA_Environment * ev);
3250 + GNOME_GtkHTML_Editor_Engine_isParagraphEmpty(GNOME_GtkHTML_Editor_Engine
3252 + CORBA_Environment * ev);
3254 + GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
3255 + (GNOME_GtkHTML_Editor_Engine _obj, CORBA_Environment * ev);
3256 + void GNOME_GtkHTML_Editor_Engine_insertHTML(GNOME_GtkHTML_Editor_Engine
3257 + _obj, const CORBA_char * html,
3258 + CORBA_Environment * ev);
3259 + void GNOME_GtkHTML_Editor_Engine_freeze(GNOME_GtkHTML_Editor_Engine _obj,
3260 + CORBA_Environment * ev);
3261 + void GNOME_GtkHTML_Editor_Engine_thaw(GNOME_GtkHTML_Editor_Engine _obj,
3262 + CORBA_Environment * ev);
3263 + void GNOME_GtkHTML_Editor_Engine_undoBegin(GNOME_GtkHTML_Editor_Engine
3265 + const CORBA_char * undo_name,
3266 + const CORBA_char * redo_name,
3267 + CORBA_Environment * ev);
3268 + void GNOME_GtkHTML_Editor_Engine_undoEnd(GNOME_GtkHTML_Editor_Engine _obj,
3269 + CORBA_Environment * ev);
3270 + void GNOME_GtkHTML_Editor_Engine_ignoreWord(GNOME_GtkHTML_Editor_Engine
3271 + _obj, const CORBA_char * word,
3272 + CORBA_Environment * ev);
3273 + void GNOME_GtkHTML_Editor_Engine_dropUndo(GNOME_GtkHTML_Editor_Engine _obj,
3274 + CORBA_Environment * ev);
3276 + GNOME_GtkHTML_Editor_Engine_hasUndo(GNOME_GtkHTML_Editor_Engine _obj,
3277 + CORBA_Environment * ev);
3279 +/** more internals **/
3280 +#if !defined(MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_0)
3281 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_0 'E'
3282 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_1 'd'
3283 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_2 'i'
3284 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_3 't'
3285 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_4 'o'
3286 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_5 'r'
3288 +#include <orbit/orb-core/orbit-interface.h>
3290 +#ifdef ORBIT_IDL_C_IMODULE
3295 + ORBit_IInterface GNOME_GtkHTML_Editor_Listener__iinterface;
3296 +#define GNOME_GtkHTML_Editor_Listener_IMETHODS_LEN 1
3297 +#ifdef ORBIT_IDL_C_IMODULE
3303 + GNOME_GtkHTML_Editor_Listener__imethods
3304 + [GNOME_GtkHTML_Editor_Listener_IMETHODS_LEN];
3305 +#ifdef ORBIT_IDL_C_IMODULE
3310 + ORBit_IInterface GNOME_GtkHTML_Editor_Engine__iinterface;
3311 +#define GNOME_GtkHTML_Editor_Engine_IMETHODS_LEN 17
3312 +#ifdef ORBIT_IDL_C_IMODULE
3318 + GNOME_GtkHTML_Editor_Engine__imethods
3319 + [GNOME_GtkHTML_Editor_Engine_IMETHODS_LEN];
3322 +#endif /* __cplusplus */
3324 +#ifndef EXCLUDE_ORBIT_H
3325 +#include <orbit/orbit.h>
3327 +#endif /* EXCLUDE_ORBIT_H */
3329 +#undef ORBIT_IDL_SERIAL
3330 diff -Nur vim63/src/gui.c vim63-bonobo/src/gui.c
3331 --- vim63/src/gui.c 2005-09-09 20:11:10.562758000 +0200
3332 +++ vim63-bonobo/src/gui.c 2005-09-09 20:14:02.733584696 +0200
3333 @@ -440,8 +440,12 @@
3334 * Create the GUI shell.
3336 gui.in_use = TRUE; /* Must be set after menus have been set up */
3337 +#ifdef FEAT_GUI_COMPONENT
3338 + vim_bonobo_wait_for_instantiation();
3340 if (gui_mch_init() == FAIL)
3344 /* Avoid a delay for an error message that was printed in the terminal
3345 * where Vim was started. */
3346 @@ -4193,8 +4197,8 @@
3347 add_to_input_buf(st, 8);
3349 /* Need to wake up the main loop */
3350 - if (gtk_main_level() > 0)
3352 + if (MAIN_LEVEL() > 0)
3357 @@ -4407,8 +4411,12 @@
3361 - return ((!gui.in_use || gui.starting)
3362 -# ifndef NO_CONSOLE
3363 + return ((!gui.in_use || gui.starting || !gui.shell_created
3364 +#ifdef FEAT_GUI_COMPONENT
3365 + || gui.processing_call
3368 +# if !defined(NO_CONSOLE) && !defined(FEAT_GUI_COMPONENT)
3369 && !isatty(0) && !isatty(2)
3372 diff -Nur vim63/src/gui_gtk.c vim63-bonobo/src/gui_gtk.c
3373 --- vim63/src/gui_gtk.c 2005-09-09 20:11:09.520917000 +0200
3374 +++ vim63-bonobo/src/gui_gtk.c 2005-09-09 20:14:02.737584088 +0200
3379 -#ifdef FEAT_GUI_GNOME
3381 /* Gnome redefines _() and N_(). Grrr... */
3384 @@ -554,9 +554,332 @@
3386 # endif /* !HAVE_GTK2 */
3388 +#ifdef FEAT_GUI_COMPONENT
3392 +verb_activate( BonoboUIComponent *uic, gpointer data, const char *cname )
3394 + gui_menu_cb((vimmenu_T *) data);
3396 + /* make sure the menu action is taken immediately */
3397 + if (MAIN_LEVEL() > 0)
3401 +/* Takes name (a label), and appends a normalized version of name to
3402 + * the destination string. Normalization in this case means taking only
3403 + * alphanumeric characters, and discarding all others. */
3404 +static void g_string_append_normalized_name( GString * dest, char_u * name )
3408 + if( name == NULL )
3413 + while( *cur != '\0' ) {
3415 + wc = g_utf8_get_char(cur);
3416 + if( g_unichar_isalnum( wc ) ) {
3417 + g_string_append_unichar( dest, wc );
3419 + cur = g_utf8_next_char(cur);
3423 +/* for the given menu, create the corresponding xml path.
3424 + * if to_parent is TRUE, returns the path to the parent of the given menu.
3427 +char * xml_path_for_menu( vimmenu_T * menu, int to_parent )
3429 + GString * normname;
3433 + normname = g_string_sized_new( 64 );
3434 + path = g_string_sized_new( 128 );
3436 + if( menu_is_toolbar(menu->name) ) {
3437 + /* "Toolbar" is a standard Bonobo UI element, but Vim uses "ToolBar", so we
3438 + * have to check for this. */
3439 + g_string_prepend( path, "/Toolbar");
3441 + g_string_assign( normname, "" );
3442 + g_string_append_normalized_name( normname, menu->dname );
3443 + g_string_prepend( path, normname->str );
3444 + g_string_prepend( path, "/" );
3446 + if( menu->parent == NULL ) {
3447 + if( menu && menu_is_menubar( menu->name ) ) {
3448 + g_string_prepend( path, "/menu" );
3452 + menu = menu->parent;
3454 + g_string_free( normname, TRUE );
3455 + retpath = path->str;
3456 + g_string_free( path, FALSE );
3460 + slash = g_strrstr(retpath, "/");
3461 + if( slash == retpath )
3466 + return( retpath );
3469 +/* Because the container which embeds Vim may not have the same toolbar icons
3470 + * installed, we need to send the icons in the XML stream. This function
3471 + * takes the given GtkImage, encodes it as XML and returns the resulting XML
3474 +gtk_image_to_xml_attrs( GtkImage * image)
3476 + GString * xml = g_string_sized_new(32);
3477 + GtkImageType type = gtk_image_get_storage_type(image);
3481 + if( type == GTK_IMAGE_STOCK ) {
3483 + GtkIconSet * iconset;
3484 + gchar * stockname;
3485 + GdkPixbuf * pixbuf;
3487 + gtk_image_get_stock(image, &stockname, &size);
3488 + pixbuf = gtk_widget_render_icon(gui.drawarea, stockname, size, NULL);
3489 + imagexml = bonobo_ui_util_pixbuf_to_xml(pixbuf);
3490 + g_string_append_printf(xml, " pixtype=\"pixbuf\" pixname=\"%s\"", imagexml);
3491 + g_object_unref(pixbuf);
3493 + } else if( type == GTK_IMAGE_PIXBUF ) {
3494 + imagexml = bonobo_ui_util_pixbuf_to_xml(gtk_image_get_pixbuf(image));
3495 + g_string_append_printf(xml, " pixtype=\"pixbuf\" pixname=\"%s\"", imagexml);
3499 + g_string_free(xml, FALSE);
3504 +/* Generate XML which represents Vim's menus and toolbars. Starts from the
3505 + * given menu entry. XML is appended to "xml", and commands/verbs are added
3506 + * to the "commands" list. If do_siblings is true, XML is also generated for
3507 + * the siblings of the given menu (following the menu->next pointer); otherwise
3508 + * only the menu and its descendents are processed.
3511 +void generate_gui_xml_recurse( vimmenu_T * menu, GString * xml, GSList ** commands, int do_siblings)
3513 + GString * normname = g_string_sized_new(16);
3514 + GString * verbname = g_string_sized_new(32);
3517 + BonoboUIComponent *uic;
3520 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (gui.control));
3524 + use_mnemonic = (p_wak[0] != 'n' );
3525 + label = translate_mnemonic_tag( menu->name, use_mnemonic );
3526 + g_string_assign( normname, "" );
3527 + g_string_append_normalized_name( normname, menu->dname );
3528 + if( menu->children ) {
3529 + if( menu_is_toolbar( menu->name )) {
3530 + g_string_append( xml, "<dockitem name=\"Toolbar\" look=\"icon\" tips=\"1\">");
3531 + generate_gui_xml_recurse( menu->children, xml, commands, TRUE );
3532 + g_string_append( xml, "</dockitem>");
3534 + g_string_append_printf( xml, "<submenu name=\"%s\" label=\"%s\">\n", normname->str, label);
3536 + generate_gui_xml_recurse( menu->children, xml, commands, TRUE );
3537 + g_string_append( xml, "</submenu>\n");
3539 + } else if( menu_is_separator(menu->name)) {
3540 + g_string_append( xml, "<separator />\n" );
3541 + } else if( menu->parent && menu_is_toolbar(menu->parent->name)) {
3542 + char * menupath = xml_path_for_menu(menu, FALSE);
3543 + GtkImage *image = NULL;
3547 + g_string_assign(verbname, "");
3548 + g_string_append_normalized_name(verbname, menupath);
3549 + vim_free(menupath);
3550 + image = GTK_IMAGE(create_menu_icon(menu, GTK_ICON_SIZE_SMALL_TOOLBAR));
3551 + imagexml = gtk_image_to_xml_attrs(image);
3552 + tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]);
3553 + g_string_append_printf( xml, "<toolitem name=\"%s\" label=\"%s\" verb=\"%s\" tip=\"%s\" %s />\n", normname->str, label, verbname->str, tooltip, imagexml);
3554 + gtk_object_sink(GTK_OBJECT(image));
3556 + CONVERT_TO_UTF8_FREE(tooltip);
3558 + command = g_strdup_printf( "<cmd name=\"%s\" sensitive=\"%c\" />\n", verbname->str, menu->sensitive ? '1' : '0');
3559 + *commands = g_slist_prepend( *commands, command );
3560 + bonobo_ui_component_add_verb(uic, verbname->str, verb_activate, menu);
3561 + } else if( menu_is_menubar(menu->name)) {
3562 + char * menupath = xml_path_for_menu(menu, FALSE);
3564 + g_string_assign(verbname, "");
3565 + g_string_append_normalized_name(verbname, menupath);
3566 + vim_free(menupath);
3568 + g_string_append_printf( xml, "<menuitem name=\"%s\" label=\"%s\" verb=\"%s\" />\n", normname->str, label, verbname->str);
3570 + command = g_strdup_printf( "<cmd name=\"%s\" sensitive=\"%c\" />\n", verbname->str, menu->sensitive ? '1' : '0');
3571 + *commands = g_slist_prepend( *commands, command );
3572 + bonobo_ui_component_add_verb(uic, verbname->str, verb_activate, menu);
3575 + vim_free( label );
3577 + if( do_siblings ) {
3578 + menu = menu->next;
3583 + g_string_free( normname, TRUE );
3586 +/* Create XML representing the menus and toolbars, and send them to the
3587 + * container application. We only need to process menu entries which
3588 + * have changed (they are marked "dirty"). */
3590 +void set_gui_xml(vimmenu_T * menu)
3592 + GSList * commands = NULL;
3594 + BonoboUIComponent *uic;
3595 + GString * xml = g_string_sized_new(1024);
3597 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (gui.control));
3599 + if( bonobo_ui_component_get_container(uic) == CORBA_OBJECT_NIL ) {
3604 + if( menu->dirty ) {
3605 + if (menu_is_popup(menu->name)) {
3607 + } else if( menu_is_menubar(menu->name)) {
3608 + char * menupath = xml_path_for_menu(menu, TRUE);
3609 + path_exists = bonobo_ui_component_path_exists(uic, menupath, NULL);
3610 + g_string_assign(xml, "");
3611 + generate_gui_xml_recurse (menu, xml, &commands, FALSE);
3612 + /*fprintf(stdout, "set %s\n", menupath);*/
3613 + /*fprintf(stdout, "set %s\n%s", menupath, xml->str);*/
3614 + /*fflush(stdout);*/
3615 + bonobo_ui_component_set(uic, menupath, xml->str, NULL);
3617 + } else if( menu_is_toolbar(menu->name)) {
3618 + char * menupath = xml_path_for_menu(menu, TRUE);
3619 + path_exists = bonobo_ui_component_path_exists(uic, menupath, NULL);
3620 + g_string_assign(xml, "");
3621 + generate_gui_xml_recurse (menu, xml, &commands, FALSE);
3622 + /*fprintf(stdout, "set %s\n", menupath);*/
3623 + /*fprintf(stdout, "set %s\n%s", menupath, xml->str);*/
3624 + /*fflush(stdout);*/
3625 + bonobo_ui_component_set(uic, menupath, xml->str, NULL);
3628 + menu->dirty = FALSE;
3630 + menu = menu->next;
3632 + /* the commands are inserted separately into a list, and set one by one,
3633 + * otherwise it's not possible to update a subtree of the UI
3635 + command = commands;
3636 + while( command ) {
3637 + /*fprintf(stdout, "set %s\n%s", "/commands", command->data);
3639 + bonobo_ui_component_set(uic, "/commands", command->data, NULL);
3640 + g_free(command->data);
3641 + command = command->next;
3643 + g_slist_free( commands );
3647 +/* remember whether a timeout has been scheduled for updating the gui */
3648 +static gboolean update_gui_idle_installed = FALSE;
3650 +/* if we have been embedded in a container, update the gui now, otherwise
3651 + * wait awhile and try again. */
3653 +update_gui_idle(gpointer data)
3655 + BonoboUIComponent *uic;
3657 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (gui.control));
3658 + if( bonobo_ui_component_get_container(uic) == CORBA_OBJECT_NIL ) {
3659 + /* we aren't in a container yet; try again later... */
3660 + g_timeout_add(100, &update_gui_idle, NULL);
3663 + bonobo_ui_component_freeze(uic, NULL);
3664 + set_gui_xml( (vimmenu_T *)root_menu );
3665 + update_gui_idle_installed = FALSE;
3666 + bonobo_ui_component_thaw(uic, NULL);
3667 + return FALSE; /* don't call me again */
3670 +/* Mark the given menu as dirty -- we need to re-send the XML representing
3671 + * this menu to the container. But don't do the update immediately; otherwise
3672 + * we'd be generating the complete UI XML each time a menu entry is added,
3673 + * which would be very slow. Instead, schedule an update in which all
3674 + * dirty menus will be processed. */
3676 +update_menu_later(vimmenu_T *menu)
3678 + if (!update_gui_idle_installed)
3680 + update_gui_idle_installed = TRUE;
3681 + g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
3682 + &update_gui_idle, NULL, NULL);
3684 + while( menu->parent )
3685 + menu = menu->parent;
3686 + menu->dirty = TRUE;
3689 +/* Schedule an update for the entire UI (all menus and toolbars) */
3690 +void update_ui_later()
3692 + vimmenu_T *menu = root_menu;
3694 + if (!update_gui_idle_installed)
3696 + update_gui_idle_installed = TRUE;
3697 + g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
3698 + &update_gui_idle, NULL, NULL);
3701 + menu->dirty = TRUE;
3702 + menu = menu->next;
3708 gui_mch_add_menu(vimmenu_T *menu, int idx)
3710 +#ifdef FEAT_GUI_COMPONENT
3711 + update_menu_later(menu);
3715 GtkWidget *parent_widget;
3718 if (vim_strchr(p_go, GO_TEAROFF) != NULL)
3719 gtk_widget_show(menu->tearoff_handle);
3720 gtk_menu_prepend(GTK_MENU(menu->submenu_id), menu->tearoff_handle);
3728 /* make sure the menu action is taken immediately */
3729 - if (gtk_main_level() > 0)
3731 + if (MAIN_LEVEL() > 0)
3735 # if defined(FEAT_TOOLBAR) && !defined(HAVE_GTK2)
3736 @@ -724,6 +1048,10 @@
3738 gui_mch_add_menu_item(vimmenu_T *menu, int idx)
3740 +#ifdef FEAT_GUI_COMPONENT
3741 + update_menu_later(menu);
3746 parent = menu->parent;
3747 @@ -833,6 +1161,7 @@
3748 gtk_signal_connect(GTK_OBJECT(menu->id), "activate",
3749 GTK_SIGNAL_FUNC(menu_item_activate), menu);
3753 #endif /* FEAT_MENU */
3755 @@ -857,6 +1186,10 @@
3759 +#ifdef FEAT_GUI_COMPONENT
3763 for (menu = root_menu; menu != NULL; menu = menu->next)
3765 if (menu->id == NULL)
3766 @@ -913,6 +1246,9 @@
3768 gui_mch_toggle_tearoffs(int enable)
3770 +#ifdef FEAT_GUI_COMPONENT
3773 recurse_tearoffs(root_menu, enable);
3775 #endif /* FEAT_MENU */
3776 @@ -1019,6 +1355,9 @@
3778 gui_mch_destroy_menu(vimmenu_T *menu)
3780 +#ifdef FEAT_GUI_COMPONENT
3783 # ifdef FEAT_TOOLBAR
3784 if (menu->parent != NULL && menu_is_toolbar(menu->parent->name))
3786 @@ -1160,8 +1499,8 @@
3788 gui_drag_scrollbar(sb, value, dragging);
3790 - if (gtk_main_level() > 0)
3792 + if (MAIN_LEVEL() > 0)
3796 /* SBAR_VERT or SBAR_HORIZ */
3797 @@ -1220,8 +1559,8 @@
3798 vw->browse_fname = (char_u *)g_strdup(gtk_file_selection_get_filename(
3799 GTK_FILE_SELECTION(vw->filedlg)));
3800 gtk_widget_hide(vw->filedlg);
3801 - if (gtk_main_level() > 0)
3803 + if (MAIN_LEVEL() > 0)
3808 @@ -1236,8 +1575,8 @@
3809 vw->browse_fname = NULL;
3811 gtk_widget_hide(vw->filedlg);
3812 - if (gtk_main_level() > 0)
3814 + if (MAIN_LEVEL() > 0)
3819 @@ -1251,8 +1590,8 @@
3823 - if (gtk_main_level() > 0)
3825 + if (MAIN_LEVEL() > 0)
3830 @@ -1335,7 +1674,7 @@
3832 gtk_widget_show(gui.filedlg);
3833 while (gui.filedlg && GTK_WIDGET_DRAWABLE(gui.filedlg))
3834 - gtk_main_iteration_do(TRUE);
3835 + MAIN_ITERATION_DO(TRUE);
3837 if (gui.browse_fname == NULL)
3839 @@ -1560,8 +1899,8 @@
3840 dlg_destroy_cb(int *p)
3842 *p = TRUE; /* set dialog_destroyed to break out of the loop */
3843 - if (gtk_main_level() > 0)
3845 + if (MAIN_LEVEL() > 0)
3850 @@ -1865,7 +2204,7 @@
3851 /* loop here until the dialog goes away */
3852 while (dialog_status == -1 && !dialog_destroyed
3853 && GTK_WIDGET_DRAWABLE(dialog))
3854 - gtk_main_iteration_do(TRUE);
3855 + MAIN_ITERATION_DO(TRUE);
3857 if (dialog_status < 0)
3859 @@ -2898,8 +3237,8 @@
3860 CONVERT_FROM_UTF8_FREE(find_text);
3863 - if (rc && gtk_main_level() > 0)
3864 - gtk_main_quit(); /* make sure cmd will be handled immediately */
3865 + if (rc && MAIN_LEVEL() > 0)
3866 + MAIN_QUIT(); /* make sure cmd will be handled immediately */
3869 /* our usual callback function */
3870 diff -Nur vim63/src/gui_gtk_x11.c vim63-bonobo/src/gui_gtk_x11.c
3871 --- vim63/src/gui_gtk_x11.c 2004-05-03 11:19:17.000000000 +0200
3872 +++ vim63-bonobo/src/gui_gtk_x11.c 2005-09-09 20:14:02.742583328 +0200
3875 #ifdef FEAT_GUI_GNOME
3876 /* Gnome redefines _() and N_(). Grrr... */
3882 # ifdef bindtextdomain
3883 # undef bindtextdomain
3886 # if defined(FEAT_GETTEXT) && !defined(ENABLE_NLS)
3887 # define ENABLE_NLS /* so the texts in the dialog boxes are translated */
3889 @@ -627,9 +629,10 @@
3890 expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
3892 /* Skip this when the GUI isn't set up yet, will redraw later. */
3894 + if (gui.starting) {
3895 + g_warning("ignoring expose_event; gui still starting.\n");
3899 out_flush(); /* make sure all output has been processed */
3900 gui_redraw(event->area.x, event->area.y,
3901 event->area.width, event->area.height);
3903 xev.xproperty.state = PropertyNewValue;
3904 serverEventProc(GDK_WINDOW_XDISPLAY(widget->window), &xev);
3906 - if (gtk_main_level() > 0)
3908 + if (MAIN_LEVEL() > 0)
3913 @@ -772,6 +775,10 @@
3914 if (blink_state == BLINK_NONE)
3915 gui_mch_start_blink();
3917 +#ifdef FEAT_GUI_COMPONENT
3918 + /*gtk_plug_grab_focus(GTK_PLUG(gui.plug));*/
3919 + /*gtk_window_set_focus(GTK_WINDOW(gui.plug), gui.drawarea);*/
3921 /* make sure keyboard input goes there */
3922 if (gtk_socket_id == 0 || !GTK_WIDGET_HAS_FOCUS(gui.drawarea))
3923 gtk_widget_grab_focus(gui.drawarea);
3924 @@ -783,6 +790,11 @@
3926 leave_notify_event(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
3928 +#ifdef FEAT_GUI_COMPONENT
3929 + /*gtk_plug_ungrab_focus(GTK_PLUG(gui.plug));*/
3930 + /*gdk_display_keyboard_ungrab (gtk_widget_get_display (gui.drawarea),
3931 + gtk_get_current_event_time ());*/
3933 if (blink_state != BLINK_NONE)
3934 gui_mch_stop_blink();
3936 @@ -793,8 +805,16 @@
3938 focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
3940 + GdkEventMask mask;
3941 gui_focus_change(TRUE);
3943 +#ifdef FEAT_GUI_COMPONENT
3944 + gtk_widget_grab_focus(gui.drawarea);
3945 + mask = gdk_window_get_events(gui.drawarea->window);
3946 + mask |= GDK_KEY_PRESS | GDK_KEY_RELEASE;
3947 + gdk_window_set_events(gui.drawarea->window, mask);
3950 if (blink_state == BLINK_NONE)
3951 gui_mch_start_blink();
3955 focus_out_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
3957 +#ifdef FEAT_GUI_COMPONENT
3958 +/* gtk_plug_ungrab_focus(GTK_PLUG(gui.plug));*/
3960 gui_focus_change(FALSE);
3962 if (blink_state != BLINK_NONE)
3963 @@ -1167,8 +1190,8 @@
3965 gui_mch_mousehide(TRUE);
3967 - if (gtk_main_level() > 0)
3969 + if (MAIN_LEVEL() > 0)
3974 @@ -1203,8 +1226,8 @@
3976 clip_lose_selection(&clip_star);
3978 - if (gtk_main_level() > 0)
3980 + if (MAIN_LEVEL() > 0)
3985 @@ -1244,9 +1267,8 @@
3986 received_selection = RS_FAIL;
3987 /* clip_free_selection(cbd); ??? */
3989 - if (gtk_main_level() > 0)
3992 + if (MAIN_LEVEL() > 0)
3993 + MAIN_QUIT(); /* make sure the above will be handled immediately */
3997 @@ -1355,8 +1377,8 @@
3998 g_free(tmpbuf_utf8);
4001 - if (gtk_main_level() > 0)
4003 + if (MAIN_LEVEL() > 0)
4004 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4008 @@ -1538,6 +1560,15 @@
4013 +#ifdef FEAT_GUI_COMPONENT
4014 + if( !vim_bonobo_init(&gui_argc, gui_argv))
4016 + /* in component mode, we don't care about trying to continue without
4017 + * a gui; if we can't create the factory, we might as well quit. */
4021 /* Don't use gtk_init() or gnome_init(), it exits on failure. */
4022 if (!gtk_init_check(&gui_argc, &gui_argv))
4024 @@ -1545,10 +1576,29 @@
4025 EMSG(_(e_opendisp));
4033 +#if FEAT_GUI_COMPONENT
4035 +control_activate_event(BonoboControl *control, gboolean activated)
4039 + gui_focus_change (TRUE);
4040 + if (blink_state == BLINK_NONE)
4041 + gui_mch_start_blink();
4043 + gui_focus_change (FALSE);
4044 + if (blink_state != BLINK_NONE)
4045 + gui_mch_stop_blink();
4052 /****************************************************************************
4053 * Mouse handling callbacks
4054 @@ -1609,8 +1659,8 @@
4055 /* inform the editor engine about the occurence of this event */
4056 gui_send_mouse_event(button, x, y, FALSE, vim_modifiers);
4058 - if (gtk_main_level() > 0)
4060 + if (MAIN_LEVEL() > 0)
4064 * Auto repeat timer handling.
4065 @@ -1805,8 +1855,8 @@
4066 vim_modifiers |= MOUSE_ALT;
4068 gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
4069 - if (gtk_main_level() > 0)
4070 - gtk_main_quit(); /* make sure the above will be handled immediately */
4071 + if (MAIN_LEVEL() > 0)
4072 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4076 @@ -1854,8 +1904,8 @@
4077 gui_send_mouse_event(button, (int)event->x, (int)event->y,
4078 FALSE, vim_modifiers);
4080 - if (gtk_main_level() > 0)
4081 - gtk_main_quit(); /* make sure the above will be handled immediately */
4082 + if (MAIN_LEVEL() > 0)
4083 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4087 @@ -1890,8 +1940,8 @@
4088 vim_modifiers |= MOUSE_ALT;
4090 gui_send_mouse_event(MOUSE_RELEASE, x, y, FALSE, vim_modifiers);
4091 - if (gtk_main_level() > 0)
4092 - gtk_main_quit(); /* make sure it will be handled immediately */
4093 + if (MAIN_LEVEL() > 0)
4094 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4098 @@ -2073,8 +2123,8 @@
4100 add_to_input_buf(dropkey + 3, (int)(sizeof(dropkey) - 3));
4102 - if (gtk_main_level() > 0)
4104 + if (MAIN_LEVEL() > 0)
4105 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4109 @@ -2540,6 +2590,7 @@
4111 mainwin_realize(GtkWidget *widget, gpointer data)
4113 +#ifndef FEAT_GUI_COMPONENT
4114 /* If you get an error message here, you still need to unpack the runtime
4117 @@ -2623,6 +2674,7 @@
4119 #endif /* !HAVE_GTK2 */
4121 +#endif /* FEAT_GUI_COMPONENT */
4123 #if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION))
4124 /* Register a handler for WM_SAVE_YOURSELF with GDK's low-level X I/F */
4125 @@ -2641,7 +2693,7 @@
4127 setup_save_yourself();
4129 -#ifdef FEAT_CLIENTSERVER
4130 +#if defined(FEAT_CLIENTSERVER) &&!defined(FEAT_GUI_COMPONENT)
4131 if (serverName == NULL && serverDelayedStartName != NULL)
4133 /* This is a :gui command in a plain vim with no previous server */
4134 @@ -2689,7 +2741,7 @@
4138 -#ifdef HAVE_GTK_MULTIHEAD
4139 +#if defined(HAVE_GTK_MULTIHEAD) && !defined(FEAT_GUI_COMPONENT)
4142 mainwin_screen_changed_cb(GtkWidget *widget,
4143 @@ -3014,7 +3066,11 @@
4144 #ifdef FEAT_GUI_GNOME
4147 - gui.mainwin = gnome_app_new("Vim", NULL);
4148 +# if defined(FEAT_GUI_COMPONENT)
4149 + gui.mainwin = NULL;
4151 + gui.mainwin = gnome_app_new("vim", NULL);
4154 /* Use the GNOME save-yourself functionality now. */
4156 @@ -3025,14 +3081,28 @@
4157 gui.mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
4160 +#ifdef FEAT_GUI_COMPONENT
4161 + vbox = gtk_vbox_new(FALSE, 0);
4164 gtk_widget_set_name(gui.mainwin, "vim-main-window");
4168 /* Create the PangoContext used for drawing all text. */
4169 +#ifdef FEAT_GUI_COMPONENT
4170 + gui.text_context = gtk_widget_create_pango_context(GTK_WIDGET(gui.vbox));
4172 gui.text_context = gtk_widget_create_pango_context(gui.mainwin);
4174 pango_context_set_base_dir(gui.text_context, PANGO_DIRECTION_LTR);
4177 +#ifdef FEAT_GUI_COMPONENT
4178 + bonobo_control_construct (BONOBO_CONTROL (gui.control), GTK_WIDGET(gui.vbox));
4179 + gtk_widget_add_events(GTK_WIDGET(gui.drawarea), GDK_VISIBILITY_NOTIFY_MASK);
4180 + gtk_widget_show_all(GTK_WIDGET(gui.vbox));
4183 gtk_window_set_policy(GTK_WINDOW(gui.mainwin), TRUE, TRUE, TRUE);
4185 @@ -3055,8 +3125,6 @@
4186 gui.accel_group = gtk_accel_group_get_default();
4189 - vbox = gtk_vbox_new(FALSE, 0);
4191 #ifdef FEAT_GUI_GNOME
4194 @@ -3072,6 +3140,9 @@
4195 gtk_container_add(GTK_CONTAINER(gui.mainwin), vbox);
4196 gtk_widget_show(vbox);
4200 +#ifndef FEAT_GUI_COMPONENT
4204 @@ -3177,6 +3248,7 @@
4205 gtk_box_pack_start(GTK_BOX(vbox), gui.toolbar, FALSE, FALSE, 0);
4207 #endif /* FEAT_TOOLBAR */
4208 +#endif /* FEAT_GUI_COMPONENT */
4210 gui.formwin = gtk_form_new();
4211 gtk_container_border_width(GTK_CONTAINER(gui.formwin), 0);
4212 @@ -3204,6 +3276,11 @@
4213 gtk_widget_show(gui.formwin);
4214 gtk_box_pack_start(GTK_BOX(vbox), gui.formwin, TRUE, TRUE, 0);
4216 +#ifdef FEAT_GUI_COMPONENT
4217 + GTK_WIDGET_SET_FLAGS (gui.drawarea, GTK_CAN_FOCUS);
4218 + g_signal_connect(G_OBJECT(gui.drawarea), "key_press_event",
4219 + G_CALLBACK(key_press_event), NULL);
4221 /* For GtkSockets, key-presses must go to the focus widget (drawarea)
4222 * and not the window. */
4223 gtk_signal_connect((gtk_socket_id == 0) ? GTK_OBJECT(gui.mainwin)
4224 @@ -3218,6 +3295,7 @@
4225 "key_release_event",
4226 G_CALLBACK(&key_release_event), NULL);
4228 +#endif /* FEAT_GUI_COMPONENT */
4229 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "realize",
4230 GTK_SIGNAL_FUNC(drawarea_realize_cb), NULL);
4231 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "unrealize",
4232 @@ -3252,16 +3330,27 @@
4234 gui.border_offset = gui.border_width;
4236 +#ifdef FEAT_GUI_COMPONENT
4237 + gtk_signal_connect(GTK_OBJECT(gui.drawarea), "visibility_notify_event",
4238 + GTK_SIGNAL_FUNC(visibility_event), NULL);
4240 gtk_signal_connect(GTK_OBJECT(gui.mainwin), "visibility_notify_event",
4241 GTK_SIGNAL_FUNC(visibility_event), NULL);
4243 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "expose_event",
4244 GTK_SIGNAL_FUNC(expose_event), NULL);
4247 * Only install these enter/leave callbacks when 'p' in 'guioptions'.
4248 * Only needed for some window managers.
4250 + * Force this on for bonobo, otherwise the toolbar gets the focus
4251 + * after you click a button, and you can't get the focus back to the
4254 +#ifndef FEAT_GUI_COMPONENT
4255 if (vim_strchr(p_go, GO_POINTER) != NULL)
4258 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "leave_notify_event",
4259 GTK_SIGNAL_FUNC(leave_notify_event), NULL);
4260 @@ -3269,10 +3358,19 @@
4261 GTK_SIGNAL_FUNC(enter_notify_event), NULL);
4264 +#ifdef FEAT_GUI_COMPONENT
4265 + g_signal_connect(G_OBJECT(gui.control), "activate",
4266 + G_CALLBACK (control_activate_event), NULL);
4267 + gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_out_event",
4268 + GTK_SIGNAL_FUNC(focus_out_event), NULL);
4269 + gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_in_event",
4270 + GTK_SIGNAL_FUNC(focus_in_event), NULL);
4272 gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_out_event",
4273 GTK_SIGNAL_FUNC(focus_out_event), NULL);
4274 gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_in_event",
4275 GTK_SIGNAL_FUNC(focus_in_event), NULL);
4278 gtk_signal_connect(GTK_OBJECT(gui.drawarea), "motion_notify_event",
4279 GTK_SIGNAL_FUNC(motion_notify_event), NULL);
4280 @@ -3445,7 +3543,7 @@
4281 * otherwise the hints don't work. */
4282 width = gui_get_base_width();
4283 height = gui_get_base_height();
4285 +# if defined( HAVE_GTK2 ) && !defined(FEAT_GUI_COMPONENT)
4286 width += get_menu_tool_width();
4287 height += get_menu_tool_height();
4289 @@ -3492,8 +3590,18 @@
4290 form_configure_event(GtkWidget *widget, GdkEventConfigure *event,
4295 gtk_form_freeze(GTK_FORM(gui.formwin));
4296 - gui_resize_shell(event->width, event->height);
4297 +#ifdef FEAT_GUI_COMPONENT
4298 + /* width_inc and height_inc (see window manager hints, above) aren't
4299 + * respected for embedded controls, so we have to make a slight adjustment
4300 + * to make sure the bottom line doesn't get clipped. */
4301 + height = gui.char_height * ((event->height - 2 )/ gui.char_height);
4303 + height = event->height;
4305 + gui_resize_shell(event->width, height);
4306 gtk_form_thaw(GTK_FORM(gui.formwin));
4309 @@ -3625,8 +3733,10 @@
4311 highlight_gui_started(); /* re-init colors and fonts */
4313 +#ifndef FEAT_GUI_COMPONENT
4314 gtk_signal_connect(GTK_OBJECT(gui.mainwin), "destroy",
4315 GTK_SIGNAL_FUNC(mainwin_destroy_cb), NULL);
4318 #ifdef FEAT_HANGULIN
4319 hangul_keyboard_set();
4320 @@ -3694,7 +3804,9 @@
4324 - gtk_widget_show(gui.mainwin);
4325 +#ifndef FEAT_GUI_COMPONENT
4326 + gtk_widget_show(gui.mainwin);
4329 #if defined(FEAT_GUI_GNOME) && defined(HAVE_GTK2) && defined(FEAT_MENU)
4330 if (menu_handler != 0)
4331 @@ -3724,8 +3836,8 @@
4332 if (gui.mainwin != NULL)
4333 gtk_widget_destroy(gui.mainwin);
4335 - if (gtk_main_level() > 0)
4337 + if (MAIN_LEVEL() > 0)
4338 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4342 @@ -3778,6 +3890,7 @@
4344 force_shell_resize_idle(gpointer data)
4346 + g_warning("force_shell_resize_idle called!");
4347 if (gui.mainwin != NULL
4348 && GTK_WIDGET_REALIZED(gui.mainwin)
4349 && GTK_WIDGET_VISIBLE(gui.mainwin))
4350 @@ -3827,7 +3940,7 @@
4351 /* this will cause the proper resizement to happen too */
4352 update_window_manager_hints();
4355 +#if defined( HAVE_GTK2 ) && !defined(FEAT_GUI_COMPONENT)
4356 /* With GTK+ 2, changing the size of the form widget doesn't resize
4357 * the window. So lets do it the other way around and resize the
4358 * main window instead. */
4359 @@ -3916,6 +4029,7 @@
4363 +#ifndef FEAT_GUI_COMPONENT
4364 # ifdef FEAT_GUI_GNOME
4366 widget = gui.menubar_h;
4367 @@ -3932,6 +4046,7 @@
4369 update_window_manager_hints();
4373 #endif /* FEAT_MENU */
4375 @@ -3983,8 +4098,8 @@
4377 vw->fontname = (char_u *)gtk_font_selection_dialog_get_font_name(fs);
4378 gtk_widget_hide(vw->fontdlg);
4379 - if (gtk_main_level() > 0)
4381 + if (MAIN_LEVEL() > 0)
4382 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4386 @@ -3994,8 +4109,8 @@
4387 gui_T *vw = (gui_T *)cbdata;
4389 gtk_widget_hide(vw->fontdlg);
4390 - if (gtk_main_level() > 0)
4392 + if (MAIN_LEVEL() > 0)
4393 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4397 @@ -4005,8 +4120,8 @@
4398 gui_T *vw = (gui_T *)cbdata;
4401 - if (gtk_main_level() > 0)
4403 + if (MAIN_LEVEL() > 0)
4404 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4406 #endif /* !HAVE_GTK2 */
4408 @@ -4173,7 +4288,7 @@
4410 /* Wait for the font dialog to be closed. */
4411 while (gui.fontdlg && GTK_WIDGET_DRAWABLE(gui.fontdlg))
4412 - gtk_main_iteration_do(TRUE);
4413 + MAIN_ITERATION_DO(TRUE);
4415 if (gui.fontname != NULL)
4417 @@ -5727,8 +5842,13 @@
4419 gui_mch_update(void)
4421 +#ifdef FEAT_GUI_COMPONENT
4422 + if( gui.processing_call ) {
4426 while (gtk_events_pending() && !vim_is_input_buf_full())
4427 - gtk_main_iteration_do(FALSE);
4428 + MAIN_ITERATION_DO(TRUE);
4432 @@ -5739,8 +5859,8 @@
4433 /* Just inform the caller about the occurence of it */
4436 - if (gtk_main_level() > 0)
4438 + if (MAIN_LEVEL() > 0)
4439 + MAIN_QUIT(); /* make sure the above will be handled immediately */
4441 return FALSE; /* don't happen again */
4443 @@ -5760,8 +5880,8 @@
4445 add_to_input_buf(bytes, 3);
4447 - if (gtk_main_level() > 0)
4449 + if (MAIN_LEVEL() > 0)
4454 @@ -5828,7 +5948,7 @@
4456 * Loop in GTK+ processing until a timeout or input occurs.
4461 /* Got char, return immediately */
4462 if (input_available())
4463 @@ -5903,6 +6023,7 @@
4464 gdk_window_clear(gui.drawarea->window);
4469 * Redraw any text revealed by scrolling up/down.
4471 @@ -6017,7 +6138,7 @@
4472 (guint32)GDK_CURRENT_TIME);
4474 while (received_selection == RS_NONE)
4475 - gtk_main(); /* wait for selection_received_cb */
4476 + MAIN(); /* wait for selection_received_cb */
4478 if (received_selection != RS_FAIL)
4480 @@ -6085,6 +6206,13 @@
4482 gui_mch_menu_grey(vimmenu_T *menu, int grey)
4484 +#ifdef FEAT_GUI_COMPONENT
4485 + if( menu->sensitive != !grey ) {
4486 + menu->sensitive = !grey;
4487 + update_menu_later(menu);
4491 if (menu->id == NULL)
4494 @@ -6222,6 +6350,40 @@
4495 static int last_shape = 0;
4499 +static BonoboWindow *
4500 +bonobo_create_window(void)
4502 + BonoboWindow *win;
4503 + BonoboUIContainer *ui_container;
4504 + BonoboUIComponent *ui_component;
4506 + win = BONOBO_WINDOW (bonobo_window_new ("vim", "vim"));
4507 + ui_container = bonobo_window_get_ui_container (win);
4508 + bonobo_ui_engine_config_set_path (bonobo_window_get_ui_engine (win),
4509 + "/gnome-vim/UIConfig/kvps");
4511 + /* Create a UI component with which to communicate with the window */
4512 + ui_component = bonobo_ui_component_new_default ();
4514 + gui.component = ui_component;
4516 + /* Associate the BonoboUIComponent with the container */
4517 + bonobo_ui_component_set_container (
4518 + ui_component, BONOBO_OBJREF (ui_container), NULL);
4520 + //bonobo_ui_util_set_ui (ui_component, "",
4521 + //HELLO_SRCDIR HELLO_UI_XML,
4522 + //"bonobo-hello", NULL);
4524 + /* Associate our verb -> callback mapping with the BonoboWindow */
4525 + /* All the callback's user_data pointers will be set to 'win' */
4526 + //bonobo_ui_component_add_verb_list_with_data (ui_component, hello_verbs, win);
4533 * Use the blank mouse pointer or not.
4535 diff -Nur vim63/src/gui.h vim63-bonobo/src/gui.h
4536 --- vim63/src/gui.h 2005-09-09 20:11:10.563758000 +0200
4537 +++ vim63-bonobo/src/gui.h 2005-09-09 20:14:02.734584544 +0200
4539 # include <gtk/gtk.h>
4542 +# if defined(FEAT_GUI_GNOME) && defined(FEAT_GUI_COMPONENT)
4543 + #include "libbonoboui.h"
4544 + #include "vim_bonobo_main.h"
4545 + #include "vim_bonobo_factory.h"
4546 + #define MAIN vim_bonobo_main
4547 + #define MAIN_LEVEL vim_bonobo_main_level
4548 + #define MAIN_QUIT vim_bonobo_main_quit
4549 + #define MAIN_ITERATION_DO vim_bonobo_main_iteration_do
4550 + #define NO_CONSOLE
4552 + #define MAIN gtk_main
4553 + #define MAIN_LEVEL gtk_main_level
4554 + #define MAIN_QUIT gtk_main_quit
4555 + #define MAIN_ITERATION_DO gtk_main_iteration_do
4558 #ifdef FEAT_GUI_BEOS
4559 # include "gui_beos.h"
4561 @@ -427,6 +443,14 @@
4562 GtkWidget *toolbar; /* toolbar */
4564 # ifdef FEAT_GUI_GNOME
4565 +# ifdef FEAT_GUI_COMPONENT
4568 + BonoboControl *control;
4569 + BonoboPersistStream * pstream;
4570 + BonoboPersistFile * pfile;
4571 + int processing_call; /* gui loop is handling a call */
4573 GtkWidget *menubar_h; /* menubar handle */
4574 GtkWidget *toolbar_h; /* toolbar handle */
4576 diff -Nur vim63/src/main.c vim63-bonobo/src/main.c
4577 --- vim63/src/main.c 2005-09-09 20:11:10.571757000 +0200
4578 +++ vim63-bonobo/src/main.c 2005-09-09 20:19:37.444700872 +0200
4583 -# ifdef FEAT_GUI_MSWIN
4584 +# if defined(FEAT_GUI_MSWIN)
4585 # ifdef __BORLANDC__
4588 @@ -244,8 +244,12 @@
4589 TIME_MSG("locale set");
4593 +#if defined(FEAT_GUI_COMPONENT)
4594 + gui.dofork = FALSE; /* don't use fork when running as component */
4596 +# if defined(FEAT_GUI) && !defined(FEAT_GUI_COMPONENT)
4597 gui.dofork = TRUE; /* default is to use fork() */
4601 #if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER)
4602 @@ -444,6 +448,10 @@
4606 +#ifdef FEAT_GUI_COMPONENT
4610 if (TOLOWER_ASC(initstr[0]) == 'g' || initstr[0] == 'k')
4613 @@ -1679,6 +1687,7 @@
4614 * Call settmode and starttermcap here, so the T_KS and T_TI may be
4615 * defined by termcapinit and redifined in .exrc.
4617 +#ifndef FEAT_GUI_COMPONENT
4618 settmode(TMODE_RAW);
4619 TIME_MSG("setting raw mode");
4621 @@ -1687,6 +1696,7 @@
4623 TIME_MSG("waiting for return");
4627 starttermcap(); /* start termcap if not done by wait_return() */
4628 TIME_MSG("start termcap");
4629 @@ -1815,6 +1825,9 @@
4631 curbuf = curwin->w_buffer;
4633 +#ifdef FEAT_GUI_COMPONENT
4634 + persistent_buffer = curbuf;
4637 TIME_MSG("opening buffers");
4639 diff -Nur vim63/src/Make_container.mak vim63-bonobo/src/Make_container.mak
4640 --- vim63/src/Make_container.mak 1970-01-01 01:00:00.000000000 +0100
4641 +++ vim63-bonobo/src/Make_container.mak 2005-09-09 20:14:02.692590928 +0200
4643 +gnomeccFlags = `pkg-config --cflags libgnomeui-2.0 libgnome-2.0`
4644 +ccFlags = -g -c ${gnomeccFlags}
4645 +ldFlags = `pkg-config --libs libgnomeui-2.0 libgnome-2.0`
4649 +container: container.o
4650 + gcc -o container ${ldFlags} container.o
4653 + gcc ${ccFlags} $< -o $@
4654 diff -Nur vim63/src/Makefile vim63-bonobo/src/Makefile
4655 --- vim63/src/Makefile 2005-09-09 20:11:10.529763000 +0200
4656 +++ vim63-bonobo/src/Makefile 2005-09-09 20:14:02.695590472 +0200
4657 @@ -1103,6 +1103,18 @@
4658 GTK_MAN_TARGETS = installghelplinks
4659 GTK_TESTTARGET = gui
4662 +BONOBO_SRC = $(GTK_SRC)
4663 +BONOBO_OBJ = $(GTK_OBJ)
4664 +BONOBO_DEFS = $(GTK_DEFS)
4665 +BONOBO_IPATH = $(GTK_IPATH)
4666 +BONOBO_LIBS_DIR = $(GTK_LIBS_DIR)
4667 +BONOBO_LIBS1 = $(GTK_LIBS1)
4668 +BONOBO_LIBS2 = $(GTK_LIBS2)
4669 +BONOBO_TARGETS = $(GTK_TARGETS) vim-factory
4670 +BONOBO_MAN_TARGETS = $(GTK_MAN_TARGETS)
4671 +BONOBO_TESTTARGET = $(GTK_TESTTARGET)
4674 MOTIF_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
4675 MOTIF_OBJ = objects/gui.o objects/gui_motif.o objects/gui_x11.o \
4676 @@ -1385,6 +1397,10 @@
4680 + objects/gtkhtml_editor.o \
4681 + objects/gtkhtml_editor_common.o \
4682 + objects/gtkhtml_editor_skels.o \
4683 + objects/gtkhtml_editor_stubs.o \
4685 objects/if_cscope.o \
4686 objects/if_xcmdsrv.o \
4687 @@ -1413,6 +1429,9 @@
4691 + objects/vim_bonobo_main.o \
4692 + objects/vim_bonobo_factory.o \
4693 + objects/vim_bonobo_control.o \
4697 @@ -1422,7 +1441,7 @@
4706 @@ -1480,7 +1499,7 @@
4707 os_mswin.pro os_beos.pro os_vms.pro os_riscos.pro $(PERL_PRO)
4709 # Default target is making the executable and tools
4710 -all: $(VIMTARGET) $(TOOLS) languages
4711 +all: $(VIMTARGET) $(TOOLS) $(EXTRA_TARGETS) languages
4715 @@ -1658,6 +1677,10 @@
4717 cd testdir; $(MAKE) -f Makefile clean
4719 +vim-factory: objects/vim_proxy_factory.o
4720 + gcc -o vim-factory $(ALL_LIB_DIRS) $(LDFLAGS) objects/vim_proxy_factory.o $(ALL_LIBS)
4724 # Avoid overwriting an existing executable, somebody might be running it and
4725 # overwriting it could cause it to crash. Deleting it is OK, it won't be
4726 @@ -1684,6 +1707,23 @@
4727 # may create a link to the new executable from /usr/bin/vi
4730 +Vim_Control.server: Vim_Control.server.in auto/config.mk
4731 + rm -f Vim_Control.server Vim_Control.server.tmp
4732 + sed -e 's,@DEST_BIN\@,$(DEST_BIN),g' \
4733 + -e 's,@VIMNAME\@,$(VIMNAME),g' \
4734 + Vim_Control.server.in >Vim_Control.server.tmp
4735 + mv Vim_Control.server.tmp Vim_Control.server
4737 +installbonobo: installvimbin
4738 +# install factory to destbin
4739 + $(INSTALL_PROG) vim-factory $(DEST_BIN)
4740 + $(STRIP) $(DEST_BIN)/vim-factory
4742 +# install server file to /usr/lib/bonobo/servers (modulo prefix)
4743 + -$(SHELL) ./mkinstalldirs $(DESTDIR)$(prefix)/lib/bonobo/servers
4744 + $(INSTALL_PROG) Vim_Control.server $(DESTDIR)$(prefix)/lib/bonobo/servers
4747 # install the help files; first adjust the contents for the location
4748 installruntime: $(HELPSOURCE)/vim.1 $(DEST_MAN) $(DEST_VIM) $(DEST_RT) \
4749 $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) \
4750 @@ -2078,6 +2118,7 @@
4751 if test -d $(PODIR); then \
4752 cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) clean; \
4754 + -rm -f Vim_Control.server vim-factory vim-component
4756 # Make a shadow directory for compilation on another system or with different
4758 @@ -2285,6 +2326,18 @@
4759 objects/gui_mac.o: gui_mac.c
4760 $(CCC) -o $@ gui_mac.c
4762 +objects/gtkhtml_editor.o: gtkhtml_editor.c
4763 + $(CCC) -o $@ gtkhtml_editor.c
4765 +objects/gtkhtml_editor_common.o: gtkhtml_editor_common.c
4766 + $(CCC) -o $@ gtkhtml_editor_common.c
4768 +objects/gtkhtml_editor_skels.o: gtkhtml_editor_skels.c
4769 + $(CCC) -o $@ gtkhtml_editor_skels.c
4771 +objects/gtkhtml_editor_stubs.o: gtkhtml_editor_stubs.c
4772 + $(CCC) -o $@ gtkhtml_editor_stubs.c
4774 objects/hangulin.o: hangulin.c
4775 $(CCC) -o $@ hangulin.c
4777 @@ -2408,6 +2461,18 @@
4778 objects/undo.o: undo.c
4781 +objects/vim_bonobo_control.o: vim_bonobo_control.c
4782 + $(CCC) -o $@ vim_bonobo_control.c
4784 +objects/vim_bonobo_factory.o: vim_bonobo_factory.c
4785 + $(CCC) -o $@ vim_bonobo_factory.c
4787 +objects/vim_bonobo_main.o: vim_bonobo_main.c
4788 + $(CCC) -o $@ vim_bonobo_main.c
4790 +objects/vim_proxy_factory.o: vim_proxy_factory.c
4791 + $(CCC) -o $@ vim_proxy_factory.c
4793 objects/window.o: window.c
4794 $(CCC) -o $@ window.c
4796 diff -Nur vim63/src/mbyte.c vim63-bonobo/src/mbyte.c
4797 --- vim63/src/mbyte.c 2005-09-09 20:11:10.575756000 +0200
4798 +++ vim63-bonobo/src/mbyte.c 2005-09-09 20:14:02.751581960 +0200
4799 @@ -3382,8 +3382,8 @@
4800 /* This flag is used in changed() at next call. */
4801 xim_changed_while_preediting = TRUE;
4803 - if (gtk_main_level() > 0)
4805 + if (MAIN_LEVEL() > 0)
4810 @@ -4515,7 +4515,11 @@
4811 if (gui.fontset != NOFONTSET
4812 && gui.fontset->type == GDK_FONT_FONTSET)
4814 +#ifdef FEAT_GUI_COMPONENT
4815 + widget = gui.drawarea;
4817 widget = gui.mainwin;
4819 gdk_window_get_size(widget->window, &width, &height);
4821 attrmask |= (int)GDK_IC_STATUS_AREA;
4822 @@ -5121,9 +5125,15 @@
4823 while (event_queue != NULL && processing_queued_event)
4825 GdkEvent *ev = event_queue->data;
4827 + GtkWidget *output;
4830 - gtk_signal_emit_by_name((GtkObject*)gui.mainwin, "key_press_event",
4831 +#ifdef FEAT_GUI_COMPONENT
4832 + output = gui.drawarea;
4834 + output = gui.mainwin;
4836 + gtk_signal_emit_by_name((GtkObject*)output, "key_press_event",
4839 event_queue = event_queue->next;
4840 @@ -5135,8 +5145,8 @@
4841 key_press_event_queue = NULL;
4844 - if (gtk_main_level() > 0)
4846 + if (MAIN_LEVEL() > 0)
4851 @@ -5292,7 +5302,11 @@
4852 GtkWidget *widget = gui.drawarea;
4854 attr->style = (GdkIMStyle)xim_input_style;
4855 +#ifdef FEAT_GUI_COMPONENT
4856 + attr->client_window = gui.drawarea->window;
4858 attr->client_window = gui.mainwin->window;
4861 if ((colormap = gtk_widget_get_colormap(widget)) !=
4862 gtk_widget_get_default_colormap())
4863 @@ -5339,7 +5353,11 @@
4867 +#ifdef FEAT_GUI_COMPONENT
4868 + gdk_window_get_size(gui.drawarea->window, &width, &height);
4870 gdk_window_get_size(gui.mainwin->window, &width, &height);
4872 attrmask |= (int)GDK_IC_STATUS_AREA_REQ;
4873 attr->status_area.x = 0;
4874 attr->status_area.y = height - gui.char_height - 1;
4875 diff -Nur vim63/src/misc1.c vim63-bonobo/src/misc1.c
4876 --- vim63/src/misc1.c 2005-09-09 20:11:10.581755000 +0200
4877 +++ vim63-bonobo/src/misc1.c 2005-09-09 20:14:02.756581200 +0200
4878 @@ -2371,6 +2371,11 @@
4880 need_maketitle = TRUE; /* set window title later */
4882 +#if defined(FEAT_GUI_COMPONENT)
4883 + if( curbuf == persistent_buffer) {
4884 + component_set_dirty(TRUE);
4888 ++curbuf->b_changedtick;
4889 ++global_changedtick;
4890 @@ -2710,6 +2715,11 @@
4892 need_maketitle = TRUE; /* set window title later */
4894 +#if defined(FEAT_GUI_COMPONENT)
4895 + if( curbuf == persistent_buffer) {
4896 + component_set_dirty(FALSE);
4900 ++buf->b_changedtick;
4901 ++global_changedtick;
4902 diff -Nur vim63/src/quote vim63-bonobo/src/quote
4903 --- vim63/src/quote 1970-01-01 01:00:00.000000000 +0100
4904 +++ vim63-bonobo/src/quote 2005-09-09 20:14:02.757581048 +0200
4908 +%g/^GtkHTML_QUOTE_ON/.,/GtkHTML_QUOTE_OFF/s/^/> /
4909 +%g/^> GtkHTML_QUOTE_ON/d
4910 +%g/^> GtkHTML_QUOTE_OFF/d
4913 diff -Nur vim63/src/structs.h vim63-bonobo/src/structs.h
4914 --- vim63/src/structs.h 2005-09-09 20:11:10.607751000 +0200
4915 +++ vim63-bonobo/src/structs.h 2005-09-09 20:14:02.759580744 +0200
4916 @@ -1084,6 +1084,10 @@
4917 char_u *b_p_bh; /* 'bufhidden' */
4918 char_u *b_p_bt; /* 'buftype' */
4920 +#if defined(FEAT_GUI_COMPONENT)
4921 + int emb_buffer; /* this buffer is associated with the container application,
4922 + and cannot be removed */
4924 int b_p_bl; /* 'buflisted' */
4926 int b_p_cin; /* 'cindent' */
4927 @@ -1281,6 +1285,9 @@
4928 int b_was_netbeans_file;/* TRUE if b_netbeans_file was once set */
4931 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
4932 + pos_T b_saved_cursor_pos; /* start pos of last VIsual */
4937 @@ -1773,8 +1780,11 @@
4938 GtkWidget *tearoff_handle;
4939 GtkWidget *label; /* Used by "set wak=" code. */
4941 -#ifdef FEAT_GUI_MOTIF
4942 +#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_COMPONENT)
4943 int sensitive; /* turn button on/off */
4944 +#if defined(FEAT_GUI_COMPONENT)
4945 + int dirty; /* menu item has been updated; container needs to know */
4948 #if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF)
4949 Pixmap image; /* Toolbar image */
4950 diff -Nur vim63/src/undo.c vim63-bonobo/src/undo.c
4951 --- vim63/src/undo.c 2004-04-05 20:23:45.000000000 +0200
4952 +++ vim63-bonobo/src/undo.c 2005-09-09 20:14:02.760580592 +0200
4959 * u_sync: stop adding to the current entry list
4961 diff -Nur vim63/src/vim_bonobo_control.c vim63-bonobo/src/vim_bonobo_control.c
4962 --- vim63/src/vim_bonobo_control.c 1970-01-01 01:00:00.000000000 +0100
4963 +++ vim63-bonobo/src/vim_bonobo_control.c 2005-09-09 20:14:02.763580136 +0200
4966 + * vim_bonobo_control.c
4969 + * Jason Hildebrand <jason@peaceworks.ca>
4975 +#include "vim_bonobo_control.h"
4976 +#include "gtkhtml_editor.h"
4979 +#include <libbonoboui.h>
4980 +#include <libbonobo.h>
4981 +/*#include <libnautilus/nautilus-view.h>*/
4982 +#include <X11/Intrinsic.h>
4983 +#include <X11/Xatom.h>
4984 +#include <gdk/gdkx.h>
4986 +struct _VimControlPrivate {
4987 + BonoboUIComponent *component;
4990 +static GObjectClass *vim_control_parent_class;
4993 +quit_vim(gpointer data)
4995 + getout_preserve_modified(0);
4999 +vim_control_destroy (BonoboObject *control)
5001 + BonoboUIComponent *uic;
5003 + g_return_if_fail (control != NULL);
5004 + g_return_if_fail (VIM_IS_CONTROL (control));
5006 + g_message ("Destroying VimControl...");
5008 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
5009 + if( uic != CORBA_OBJECT_NIL )
5010 + bonobo_ui_component_unset_container (uic, NULL);
5012 + BONOBO_OBJECT_CLASS (vim_control_parent_class)->destroy (control);
5014 + /* we only support creating one vim control per process, so when this one
5015 + * is finished, we're done. */
5016 + g_timeout_add(50, &quit_vim, NULL);
5020 +vim_control_finalize (GObject *object)
5022 + VimControl *control;
5024 + g_return_if_fail (object != NULL);
5025 + g_return_if_fail (VIM_IS_CONTROL (object));
5027 + control = VIM_CONTROL (object);
5029 + g_free (control->priv);
5031 + G_OBJECT_CLASS (vim_control_parent_class)->finalize (object);
5035 +vim_control_set_ui_container (VimControl *control,
5036 + Bonobo_UIContainer ui_container)
5038 + BonoboUIComponent *uic;
5040 + g_return_if_fail (control != NULL);
5041 + g_return_if_fail (VIM_IS_CONTROL (control));
5042 + g_return_if_fail (ui_container != CORBA_OBJECT_NIL);
5044 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
5045 + bonobo_ui_component_set_container (uic, ui_container, NULL);
5047 + /* schedule a UI update */
5048 + update_ui_later();
5052 +vim_control_unset_ui_container (VimControl *control)
5054 + BonoboUIComponent *uic;
5056 + g_return_if_fail (control != NULL);
5057 + g_return_if_fail (VIM_IS_CONTROL (control));
5059 + uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
5060 + bonobo_ui_component_unset_container (uic, NULL);
5063 +static grab_keys = 0;
5066 +static GdkFilterReturn
5067 +filter_key_events (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
5069 + /* GdkScreen *screen = gdk_drawable_get_screen (event->any.window);
5070 + GdkDisplay *display = gdk_screen_get_display (screen);*/
5071 + XEvent *xevent = (XEvent *)gdk_xevent;
5073 + GdkFilterReturn return_val;
5075 + return_val = GDK_FILTER_CONTINUE;
5077 + switch (xevent->type)
5080 + g_warning("Key press!");
5084 + g_warning("Key release!");
5090 + return return_val;
5095 +set_frame_cb (BonoboControl *object, gpointer data)
5097 + Bonobo_ControlFrame frame;
5098 + VimControl *control;
5100 + g_return_if_fail (object != NULL);
5101 + g_return_if_fail (VIM_IS_CONTROL (object));
5103 + frame = bonobo_control_get_control_frame (object, NULL);
5104 + if (frame == CORBA_OBJECT_NIL)
5106 + CORBA_Object_release (frame, NULL);
5108 + control = VIM_CONTROL (object);
5110 + Bonobo_UIContainer ui_container;
5112 + ui_container = bonobo_control_get_remote_ui_container (BONOBO_CONTROL (control), NULL);
5113 + if (ui_container != CORBA_OBJECT_NIL) {
5114 + vim_control_set_ui_container (control, ui_container);
5115 + bonobo_object_release_unref (ui_container, NULL);
5121 +embedded_cb (GtkPlug *plug)
5125 + int actual_format;
5126 + unsigned long actual_length;
5127 + unsigned long remaining_bytes;
5128 + unsigned char * wm_class_value;
5132 + Window * children = NULL;
5133 + unsigned int nchildren;
5136 + wm_class = gdk_x11_get_xatom_by_name("WM_CLASS");
5137 + win = GDK_WINDOW_XID(plug->socket_window);
5140 + /*g_warning("checking xid %d", win);*/
5141 + result = XGetWindowProperty (GDK_WINDOW_XDISPLAY (plug->socket_window),
5143 + wm_class, 0, 120, False, XA_STRING,
5144 + &actual_type, &actual_format,
5145 + &actual_length, &remaining_bytes, &wm_class_value);
5146 + if( result == Success && actual_type != None) {
5147 + /*g_warning("WM_CLASS is %s", wm_class_value);*/
5148 + apply_autocmds(EVENT_EMBEDDED_COMPONENT, wm_class_value, NULL, FALSE, persistent_buffer);
5149 + XFree(wm_class_value);
5152 + gdk_error_trap_push ();
5153 + result = XQueryTree(GDK_WINDOW_XDISPLAY(plug->socket_window),
5155 + &root, &parent, &children, &nchildren);
5156 + if (gdk_error_trap_pop () || !result) {
5163 + if( root == parent) {
5164 + /* we've reached the root window */
5172 +vim_control_class_init (VimControl *klass)
5174 + GObjectClass *gobject_class = (GObjectClass *)klass;
5175 + BonoboObjectClass *bonobo_object_class = (BonoboObjectClass *)klass;
5176 + BonoboControlClass *control_class = (BonoboControlClass *)klass;
5178 + vim_control_parent_class= g_type_class_peek_parent (klass);
5180 + bonobo_object_class->destroy = vim_control_destroy;
5181 + gobject_class->finalize = vim_control_finalize;
5184 +static char_u * stream_buffer = NULL;
5185 +static int stream_offset = 0;
5186 +static CORBA_long stream_length = 0;
5187 +static Bonobo_Stream current_stream;
5189 +/* It seems like it is an error to attempt to read more data
5190 + * than is available from a bonobo stream. So we slurp in
5191 + * the entire file in one chunk, and then pass it back in
5192 + * pieces to the caller.
5195 +vim_control_persist_stream_read(char_u * buffer, int reqsize)
5199 + if( stream_offset >= stream_length ) {
5202 + read_size = stream_length - stream_offset >= reqsize ?
5203 + reqsize : stream_length - stream_offset;
5204 + mch_memmove(buffer, &stream_buffer[stream_offset], read_size);
5205 + stream_offset += read_size;
5210 +vim_control_persist_stream_write(char_u * buffer, int reqsize)
5212 + CORBA_Environment ev;
5214 + CORBA_exception_init(&ev);
5215 + bonobo_stream_client_write(current_stream, buffer, reqsize, &ev);
5216 + if (ev._major != CORBA_NO_EXCEPTION ) {
5217 + g_warning("Error writing to stream");
5218 + CORBA_exception_free (&ev);
5221 + CORBA_exception_free (&ev);
5226 +component_set_dirty(gboolean dirty)
5228 + bonobo_persist_set_dirty(BONOBO_PERSIST(gui.pstream), dirty);
5229 + bonobo_persist_set_dirty(BONOBO_PERSIST(gui.pfile), dirty);
5232 +static void load_buffer_from_stream( const Bonobo_Stream stream,
5233 + Bonobo_Persist_ContentType type,
5234 + CORBA_Environment *ev)
5236 + exarg_T ea; /* Ex command arguments */
5238 + g_warning ("load_buffer_from_stream");
5240 + stream_buffer = bonobo_stream_client_read( stream, -1, &stream_length, ev);
5241 + if (ev->_major != CORBA_NO_EXCEPTION) {
5242 + g_warning("Error reading from stream");
5245 + stream_offset = 0;
5247 + if( persistent_buffer ) {
5248 + /* make it possible to delete the existing buffer, so that it
5249 + * can be replaced with what we are about to load */
5250 + persistent_buffer->emb_buffer = FALSE;
5253 + vim_memset(&ea, 0, sizeof(ea));
5254 + ea.cmd = "e ++enc=utf-8";
5255 + ea.force_enc = 8; /* this is the offset of "utf-8" in the cmd */
5257 + read_from_container = PERSIST_STREAM_IO;
5258 + do_ecmd(0, NULL, NULL, &ea, 1, ECMD_OLDBUF|ECMD_FORCEIT);
5259 + read_from_container = NORMAL_IO;
5261 + /* we've set the fileencoding to utf-8; set encoding to utf-8 as * well.*/
5262 + do_cmdline_cmd("set encoding=utf-8");
5264 + /* remember this buffer */
5265 + persistent_buffer = curbuf;
5266 + ga_clear(&error_ga);
5267 + g_free(stream_buffer);
5270 + /* run a filter to obtain plain text from the html */
5271 + if( !strcmp( type, "text/html" )) {
5272 + vim_bonobo_call_begin();
5273 + /* Substitutions to recognize quoted text */
5274 + do_cmdline_cmd("%s/<!--+GtkHTML[^>]*class=\"ClueFlow\"[^>]*key=\"orig\"[^>]*value=\"1\">-->/<pre>GtkHTML_QUOTE_ON<\\/pre>");
5275 + do_cmdline_cmd("%s/<!--+GtkHTML[^>]*class=\"ClueFlow\"[^>]*clear=\"orig\"[^>]*>-->/<pre>GtkHTML_QUOTE_OFF<\\/pre>");
5276 + do_cmdline_cmd("%s/<\\/i><\\/blockquote>/<\\/pre><\\/i><\\/blockquote>/");
5277 + do_cmdline_cmd("%!html2text -nobs");
5278 + do_cmdline_cmd("call EvoQuote()");
5279 + vim_bonobo_call_end();
5281 + do_cmdline_cmd("set nomodified");
5282 + component_set_dirty(FALSE);
5285 +static void load_buffer_from_stream_cb(BonoboPersistStream *ps,
5286 + const Bonobo_Stream stream,
5287 + Bonobo_Persist_ContentType type,
5289 + CORBA_Environment *ev)
5291 + load_buffer_from_stream(stream, type, ev);
5295 +save_buffer_to_stream( const Bonobo_Stream stream,
5296 + Bonobo_Persist_ContentType type,
5297 + CORBA_Environment *ev)
5300 + exarg_T ea; /* Ex command arguments */
5302 + /*g_warning ("save_buffer_to_stream");*/
5304 + current_stream = stream;
5305 + write_to_container = PERSIST_STREAM_IO;
5307 + if( !strcmp(type, "text/html")) {
5308 + vim_control_persist_stream_write("<pre>", 5);
5311 + vim_memset(&ea, 0, sizeof(ea));
5312 + ea.cmd = "e ++enc=utf-8";
5313 + ea.force_enc = 8; /* this is the offset of "utf-8" in the cmd */
5315 + buf = persistent_buffer;
5316 + buf_write(buf, "dummy", "dummy", 1, buf->b_ml.ml_line_count,
5317 + &ea, FALSE, FALSE, TRUE, TRUE);
5318 + if( !strcmp(type, "text/html")) {
5319 + vim_control_persist_stream_write("</pre>", 6);
5321 + write_to_container = NORMAL_IO;
5322 + ga_clear(&error_ga);
5326 +save_buffer_to_stream_cb(BonoboPersistStream *ps,
5327 + const Bonobo_Stream stream,
5328 + Bonobo_Persist_ContentType type,
5330 + CORBA_Environment *ev)
5332 + save_buffer_to_stream(stream, type, ev);
5336 +load_buffer_from_file (BonoboPersistFile *pf,
5337 + const CORBA_char *filename,
5338 + CORBA_Environment *ev,
5341 + Bonobo_PersistStream ps = closure;
5342 + BonoboStream *stream;
5345 + stream = bonobo_get_object(filename, "IDL:Bonobo/Stream:1.0", ev);
5350 + load_buffer_from_stream (ps, "text/plain", ev);
5351 + return 0; /* Return 0 on success */
5355 +save_to_file (BonoboPersistFile *pf,
5356 + const CORBA_char *filename,
5357 + CORBA_Environment *ev,
5360 + Bonobo_PersistStream ps = closure;
5361 + BonoboStream *stream;
5365 + stream = bonobo_stream_open (
5366 + BONOBO_IO_DRIVER_FS,
5367 + filename, Bonobo_STORAGE_WRITE | Bonobo_STORAGE_CREATE,
5368 + S_IRUSR | S_IWUSR | S_IRGRP);
5373 + save_buffer_to_stream (NULL, ps, "text/plain", ev);
5375 + return 0; /* Return 0 on success */
5379 +Bonobo_Persist_ContentTypeList *
5380 +persist_stream_types( BonoboPersistStream * ps, void * closure, CORBA_Environment *ev )
5382 + /*g_warning ("persist_stream_types");*/
5383 + return bonobo_persist_generate_content_types(2, "text/plain", "text/html");
5389 +nv_load_location_cb (NautilusView *view, const char *location, gpointer user_data)
5391 + g_return_if_fail (NAUTILUS_IS_VIEW (view));
5392 + g_return_if_fail (location != NULL);
5394 + nautilus_view_report_load_underway (NAUTILUS_VIEW (view));
5396 + /* FIXME: load the file here (using gnome-vfs)! */
5397 + nautilus_view_report_load_complete (NAUTILUS_VIEW (view));
5402 + EDITOR_NEEDS_ESCAPE
5403 +} EditorControlProps;
5405 +editor_get_prop (BonoboPropertyBag *bag,
5408 + CORBA_Environment *ev,
5409 + gpointer user_data)
5411 + //GtkHTMLControlData *cd = user_data;
5414 + case EDITOR_NEEDS_ESCAPE:
5415 + BONOBO_ARG_SET_BOOLEAN (arg, TRUE);
5418 + bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound);
5424 +editor_set_prop (BonoboPropertyBag *bag,
5425 + const BonoboArg *arg,
5427 + CORBA_Environment *ev,
5428 + gpointer user_data)
5430 + //GtkHTMLControlData *cd = user_data;
5433 + case EDITOR_NEEDS_ESCAPE:
5434 + bonobo_exception_set (ev, ex_Bonobo_PropertyBag_ReadOnly);
5437 + bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound);
5443 +vim_control_init (VimControl *control)
5445 + control->priv = g_new0 (VimControlPrivate, 1);
5448 +BONOBO_TYPE_FUNC (VimControl, BONOBO_TYPE_CONTROL, vim_control);
5451 +vim_control_add_interfaces (VimControl *control,
5452 + BonoboObject *to_aggregate)
5454 + BonoboPersistFile *file;
5455 + //NautilusView *nv;
5456 + BonoboPersistStream *stream;
5457 + EditorEngine *engine; /* GtkHTML editor engine interface */
5458 + //BonoboItemContainer *item_container;
5461 + g_return_val_if_fail (VIM_IS_CONTROL (control), NULL);
5462 + g_return_val_if_fail (BONOBO_IS_OBJECT (to_aggregate), NULL);
5464 + /* Interface Bonobo::PersistStream */
5465 + stream = bonobo_persist_stream_new (load_buffer_from_stream_cb,
5466 + save_buffer_to_stream_cb,
5467 + persist_stream_types,
5471 + bonobo_object_unref (BONOBO_OBJECT (to_aggregate));
5474 + bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5475 + BONOBO_OBJECT (stream));
5476 + gui.pstream = stream;
5478 + /* Interface Bonobo::PersistFile */
5479 + file = bonobo_persist_file_new (load_buffer_from_file,
5480 + save_buffer_to_stream, VIM_OAFIID, control);
5482 + bonobo_object_unref (BONOBO_OBJECT (to_aggregate));
5485 + bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5486 + BONOBO_OBJECT (file));
5490 + nv = nautilus_view_new_from_bonobo_control(BONOBO_CONTROL(control));
5492 + bonobo_object_unref (BONOBO_OBJECT(to_aggregate));
5495 + bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5496 + BONOBO_OBJECT (nv));
5498 + g_signal_connect (G_OBJECT (nv), "load_location",
5499 + G_CALLBACK (nv_load_location_cb), NULL);
5502 + engine = editor_engine_new();
5504 + bonobo_object_unref (BONOBO_OBJECT(to_aggregate));
5507 + bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5508 + BONOBO_OBJECT (engine));
5510 + return to_aggregate;
5514 +vim_control_construct (VimControl *control)
5516 + GtkWidget *button;
5519 + GtkAccelGroup *group;
5520 + GClosure *closure;
5521 + //VimControlPrivate *priv;
5522 + BonoboPropertyBag *pb;
5525 + g_return_val_if_fail (control != NULL, NULL);
5526 + g_return_val_if_fail (VIM_IS_CONTROL (control), NULL);
5529 + if (!vim_control_add_interfaces (control, BONOBO_OBJECT (control)))
5532 + gui.control = BONOBO_CONTROL(control);
5533 + gui.plug = (BonoboPlug *)bonobo_control_get_plug(control);
5534 + gui.mainwin = GTK_WIDGET(gui.plug);
5537 + g_signal_connect (control, "set_frame", G_CALLBACK (set_frame_cb), NULL);
5538 + g_signal_connect (gui.plug, "embedded", G_CALLBACK (embedded_cb), NULL);
5540 + /* Create the vim-view */
5541 + //priv->image_view = vim_image_view_new (vim, FALSE);
5542 + //if (!priv->image_view) {
5543 + //bonobo_object_unref (BONOBO_OBJECT (control));
5547 + pb = bonobo_property_bag_new (editor_get_prop, editor_set_prop, NULL);
5548 + bonobo_control_set_properties (control, BONOBO_OBJREF (pb), NULL);
5550 + def = bonobo_arg_new (BONOBO_ARG_BOOLEAN);
5551 + BONOBO_ARG_SET_BOOLEAN (def, TRUE);
5553 + bonobo_property_bag_add (pb, "EditorNeedsEscape", EDITOR_NEEDS_ESCAPE,
5554 + BONOBO_ARG_BOOLEAN, def,
5555 + "Whether the editor requires Escape key events",
5560 + bonobo_object_unref (BONOBO_OBJECT (pb));
5566 +vim_control_new (void)
5568 + VimControl *control;
5570 + g_message ("Creating VimControl...");
5572 + control = g_object_new (VIM_CONTROL_TYPE, NULL);
5574 + return vim_control_construct (control);
5577 diff -Nur vim63/src/vim_bonobo_control.h vim63-bonobo/src/vim_bonobo_control.h
5578 --- vim63/src/vim_bonobo_control.h 1970-01-01 01:00:00.000000000 +0100
5579 +++ vim63-bonobo/src/vim_bonobo_control.h 2005-09-09 20:14:02.764579984 +0200
5582 + * vim_bonobo_control.h
5585 + * Jason Hildebrand (jason@peaceworks.ca)
5589 +#ifndef _VIM_CONTROL_H_
5590 +#define _VIM_CONTROL_H_
5592 +#include <bonobo/bonobo-control.h>
5593 +#define VIM_OAFIID "OAFIID:Vim_Control"
5594 +#define NORMAL_IO 0
5595 +#define PERSIST_STREAM_IO 1
5596 +#define PERSIST_FILE_IO 2
5600 +#define VIM_CONTROL_TYPE (vim_control_get_type ())
5601 +#define VIM_CONTROL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), VIM_CONTROL_TYPE, VimControl))
5602 +#define VIM_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), VIM_CONTROL_TYPE, VimControlClass))
5604 +#define VIM_IS_CONTROL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), VIM_CONTROL_TYPE))
5605 +#define VIM_IS_CONTROL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), VIM_CONTROL_TYPE))
5606 +#define VIM_CONTROL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), VIM_CONTROL_TYPE, VimControlClass))
5608 +typedef struct _VimControl VimControl;
5609 +typedef struct _VimControlClass VimControlClass;
5610 +typedef struct _VimControlPrivate VimControlPrivate;
5612 +struct _VimControl {
5613 + BonoboControl control;
5615 + VimControlPrivate *priv;
5618 +struct _VimControlClass {
5619 + BonoboControlClass parent_class;
5622 +GType vim_control_get_type (void);
5623 +VimControl *vim_control_new (void);
5624 +VimControl *vim_control_construct (VimControl *control);
5626 +void set_curbuf_persistent(void);
5630 +#endif /* _VIM_CONTROL_H_*/
5631 diff -Nur vim63/src/vim_bonobo_factory.c vim63-bonobo/src/vim_bonobo_factory.c
5632 --- vim63/src/vim_bonobo_factory.c 1970-01-01 01:00:00.000000000 +0100
5633 +++ vim63-bonobo/src/vim_bonobo_factory.c 2005-09-09 20:14:02.764579984 +0200
5636 + * vim_bonobo_factory.c
5639 + * Jason Hildebrand (jason@peaceworks.ca)
5644 +#include "version.h"
5645 +#include <bonobo/bonobo-generic-factory.h>
5646 +#include "vim_bonobo_control.h"
5648 +static BonoboGenericFactory *factory = NULL;
5649 +static int vim_instantiated = 0;
5651 +static BonoboObject *
5652 +vim_bonobo_factory(BonoboGenericFactory *this,
5653 + const char *oaf_iid,
5657 + BonoboObject *retval;
5659 + g_return_val_if_fail (this != NULL, NULL);
5660 + g_return_val_if_fail (oaf_iid != NULL, NULL);
5662 + if( vim_instantiated ) {
5663 + /* we cannot instantiate more than one control from this process,
5664 + * because of all of vim's global variables */
5668 + g_message ("Trying to produce a '%s'...", oaf_iid);
5670 + if (strcmp (oaf_iid, VIM_OAFIID) == 0) {
5671 + vim = vim_control_new ();
5674 + retval = BONOBO_OBJECT (vim);
5676 + g_warning ("Unknown IID `%s' requested", oaf_iid);
5679 + vim_instantiated = 1;
5684 +/* wait until this component is instantiated */
5685 +int vim_bonobo_wait_for_instantiation()
5687 + while( !vim_instantiated) {
5688 + MAIN_ITERATION_DO(TRUE);
5693 +int vim_bonobo_init(int *argc, char *argv[])
5695 + if (!bonobo_ui_init ("gnome-vim", VIM_VERSION_SHORT, argc, argv))
5696 + g_error (_("Could not initialize Bonobo"));
5698 + factory = bonobo_generic_factory_new (
5699 + VIM_FACTORY_OAFIID, vim_bonobo_factory, NULL);
5701 + if (factory == NULL) {
5702 + g_error ("Couldn't create factory.\n");
5708 diff -Nur vim63/src/vim_bonobo_factory.h vim63-bonobo/src/vim_bonobo_factory.h
5709 --- vim63/src/vim_bonobo_factory.h 1970-01-01 01:00:00.000000000 +0100
5710 +++ vim63-bonobo/src/vim_bonobo_factory.h 2005-09-09 20:14:02.765579832 +0200
5713 + * vim_bonobo_factory.h
5716 + * Jason Hildebrand (jason@peaceworks.ca)
5720 +#if !defined( _VIM_BONOBO_FACTORY_H)
5721 +#define _VIM_BONOBO_FACTORY_H
5723 +#define VIM_FACTORY_OAFIID "OAFIID:Vim_Control_Factory"
5725 +void gui_component_init(int *argc, char *argv []);
5726 +int gui_component_wait_for_instantiation(void);
5729 diff -Nur vim63/src/vim_bonobo_main.c vim63-bonobo/src/vim_bonobo_main.c
5730 --- vim63/src/vim_bonobo_main.c 1970-01-01 01:00:00.000000000 +0100
5731 +++ vim63-bonobo/src/vim_bonobo_main.c 2005-09-09 20:14:02.765579832 +0200
5733 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5736 +#include <glib/gmain.h>
5737 +#include <glib-object.h>
5738 +#include <bonobo/Bonobo.h>
5740 +static guint bonobo_main_loop_level = 0;
5741 +static GSList * bonobo_main_loops = NULL;
5743 +static gboolean in_bonobo_call = FALSE;
5749 + * Activates the Bonobo POA Manager and enters the main event loop.
5752 +vim_bonobo_main (void)
5756 + if( in_bonobo_call ) {
5760 + bonobo_activate ();
5762 + bonobo_main_loop_level++;
5764 + loop = g_main_loop_new (NULL, TRUE);
5765 + bonobo_main_loops = g_slist_prepend (bonobo_main_loops, loop);
5767 + if (g_main_loop_is_running (bonobo_main_loops->data))
5768 + g_main_loop_run (loop);
5770 + bonobo_main_loops = g_slist_remove (bonobo_main_loops, loop);
5772 + g_main_loop_unref (loop);
5774 + bonobo_main_loop_level--;
5778 + * bonobo_main_quit:
5780 + * Quits the main event loop.
5783 +vim_bonobo_main_quit (void)
5785 + g_return_if_fail (bonobo_main_loops != NULL);
5787 + g_main_loop_quit (bonobo_main_loops->data);
5791 +vim_bonobo_main_level(void)
5793 + return bonobo_main_loop_level;
5796 +static long save_p_report;
5797 +static int save_msg_silent;
5798 +static int save_emsg_silent;
5801 +vim_bonobo_call_begin(void)
5803 + in_bonobo_call = TRUE;
5804 + gui.processing_call = TRUE;
5805 + save_p_report = p_report;
5806 + p_report = 100000;
5807 + save_msg_silent = msg_silent;
5808 + msg_silent = TRUE;
5809 + save_emsg_silent = emsg_silent;
5810 + emsg_silent = TRUE;
5814 +vim_bonobo_call_end(void)
5816 + in_bonobo_call = FALSE;
5817 + gui.processing_call = FALSE;
5818 + msg_silent = save_msg_silent;
5819 + emsg_silent = save_emsg_silent;
5820 + p_report = save_p_report;
5824 +vim_bonobo_main_iteration_do(may_block)
5826 + if( ! in_bonobo_call ) {
5827 + g_main_context_iteration(NULL, may_block);
5831 diff -Nur vim63/src/vim_bonobo_main.h vim63-bonobo/src/vim_bonobo_main.h
5832 --- vim63/src/vim_bonobo_main.h 1970-01-01 01:00:00.000000000 +0100
5833 +++ vim63-bonobo/src/vim_bonobo_main.h 2005-09-09 20:14:02.765579832 +0200
5835 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5837 +#ifndef __VIM_BONOBO_MAIN_H__
5838 +#define __VIM_BONOBO_MAIN_H__
5840 +#include <glib-object.h>
5841 +#include <bonobo/Bonobo.h>
5843 +void vim_bonobo_main (void);
5844 +void vim_bonobo_main_quit (void);
5845 +int vim_bonobo_level(void);
5846 +gboolean vim_bonobo_main_iteration_do(int may_block);
5847 +void vim_bonobo_call_begin(void);
5848 +void vim_bonobo_call_end(void);
5850 +#endif /* __VIM_BONOBO_MAIN_H__ */
5851 diff -Nur vim63/src/vim-container.xml vim63-bonobo/src/vim-container.xml
5852 --- vim63/src/vim-container.xml 1970-01-01 01:00:00.000000000 +0100
5853 +++ vim63-bonobo/src/vim-container.xml 2005-09-09 20:14:02.761580440 +0200
5858 + <cmd name="FileNewWindow" _label="_New Window" _tip="Open a new window"
5859 + pixtype="stock" pixname="gtk-new" accel="*Control*n"/>
5861 + <cmd name="FileOpen" _label="_Open..." _tip="Open a file"
5862 + pixtype="stock" pixname="gtk-open" accel="*Control*o"/>
5864 + <cmd name="FileCloseWindow" _label="_Close" _tip="Close window"
5865 + pixtype="stock" pixname="gtk-close" accel="*Control*w"/>
5867 + <cmd name="FileExit" _label="_Quit" _tip="Quit the program"
5868 + pixtype="stock" pixname="gtk-quit" accel="*Control*q"/>
5870 + <cmd name="Preferences" _label="_Preferences..." _tip="Change preferences" sensitive="0"
5871 + pixtype="stock" pixname="gtk-preferences"/>
5873 + <cmd name="HelpAbout" _label="_About" _tip="About this application"
5874 + pixtype="stock" pixname="About"/>
5875 + <cmd name="Help" _label="Contents" _tip="Help On this application"
5876 + pixtype="stock" pixname="Help" accel="F1"/>
5879 + <cmd name="DnDNewWindow" _label="Open in new window"/>
5880 + <cmd name="DnDSameWindow" _label="Open in this window"/>
5881 + <cmd name="DnDCancel" _label="Cancel"
5882 + pixtype="stock" pixname="Cancel"/>
5886 + <submenu name="File" _label="_File">
5888 + <menuitem name="FileNewWindow" verb=""/>
5890 + <placeholder name="Open Placeholder" delimit="top">
5891 + <menuitem name="FileOpen" verb=""/>
5894 + <placeholder name="File Items Placeholder" delimit="top"/>
5898 + <menuitem name="FileCloseWindow" verb=""/>
5900 + <menuitem name="FileExit" verb=""/>
5904 + <submenu name="Edit" _label="_Edit">
5905 + <menuitem name="Preferences" verb=""/>
5908 + <submenu name="View" _label="_View" hidden="1">
5909 + <placeholder name="View Preferences Placeholder"/>
5910 + <placeholder name="View Items Placeholder" delimit="top"/>
5913 + <submenu name="Help" _label="_Help">
5914 + <menuitem name="Help" verb=""/>
5915 + <menuitem name="HelpAbout" verb=""/>
5919 +<dockitem name="Toolbar" relief="none" homogeneous="1" behavior="exclusive">
5921 + <toolitem name="TBOpen" _label="Open" pixtype="stock"
5922 + pixname="Open" verb="FileOpen"/>
5924 + <toolitem name="TBCloseWindow" _label="Close" pixtype="stock"
5925 + pixname="Close" verb="FileCloseWindow"/>
5929 + <popup name="dragndrop">
5930 + <menuitem name="DnDNewWindow" verb=""/>
5931 + <menuitem name="DnDSameWindow" verb=""/>
5933 + <menuitem name="DnDCancel" verb=""/>
5938 diff -Nur vim63/src/Vim_Control.server vim63-bonobo/src/Vim_Control.server
5939 --- vim63/src/Vim_Control.server 1970-01-01 01:00:00.000000000 +0100
5940 +++ vim63-bonobo/src/Vim_Control.server 2005-09-09 20:14:02.695590472 +0200
5944 +<oaf_server iid="OAFIID:Vim_Proxy_Factory" type="exe" location="/usr/local/bin/vim-factory">
5945 + <oaf_attribute name="repo_ids" type="stringv">
5946 + <item value="IDL:Bonobo/GenericFactory:1.0"/>
5948 + <oaf_attribute name="name" type="string" value="Vim Control factory"/>
5949 + <oaf_attribute name="description" type="string" value="Vim Control factory"/>
5952 +<oaf_server iid="OAFIID:Vim_Control_Factory" type="exe" location="/usr/local/bin/vim-component">
5953 + <oaf_attribute name="repo_ids" type="stringv">
5954 + <item value="IDL:Bonobo/GenericFactory:1.0"/>
5956 + <oaf_attribute name="name" type="string" value="Vim Control factory"/>
5957 + <oaf_attribute name="description" type="string" value="Vim Control factory"/>
5960 +<oaf_server iid="OAFIID:Vim_Control" type="factory"
5961 + location="OAFIID:Vim_Proxy_Factory">
5962 + <oaf_attribute name="repo_ids" type="stringv">
5963 + <item value="IDL:Bonobo/Unknown:1.0"/>
5964 + <item value="IDL:Bonobo/Control:1.0"/>
5965 + <item value="IDL:Bonobo/ItemContainer:1.0"/>
5966 + <item value="IDL:Bonobo/PersistStream:1.0"/>
5967 + <item value="IDL:Bonobo/PersistFile:1.0"/>
5968 + <item value="IDL:Bonobo/Persist:1.0"/>
5969 + <item value="IDL:Nautilus/View:1.0"/>
5971 + <oaf_attribute name="name" type="string" value="Vim Control"/>
5972 + <oaf_attribute name="description" type="string" value="Vim Control"/>
5973 + <oaf_attribute name="bonobo:editable" type="boolean" value="false"/>
5974 + <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
5975 + <item value="text/plain"/>
5976 + <item value="text/*"/>
5978 + <oaf_attribute name="nautilus:view_as_name" type="string" value="Text"/>
5979 + <oaf_attribute name="nautilus:view_as_label" type="string" value="View/Edit in Vim"/>
5980 + <oaf_attribute name="nautilus:viewer_label" type="string" value="Vim"/>
5984 diff -Nur vim63/src/Vim_Control.server.in vim63-bonobo/src/Vim_Control.server.in
5985 --- vim63/src/Vim_Control.server.in 1970-01-01 01:00:00.000000000 +0100
5986 +++ vim63-bonobo/src/Vim_Control.server.in 2005-09-09 20:14:02.696590320 +0200
5990 +<oaf_server iid="OAFIID:Vim_Proxy_Factory" type="exe" location="@DEST_BIN@/vim-factory">
5991 + <oaf_attribute name="repo_ids" type="stringv">
5992 + <item value="IDL:Bonobo/GenericFactory:1.0"/>
5994 + <oaf_attribute name="name" type="string" value="Vim Control factory"/>
5995 + <oaf_attribute name="description" type="string" value="Vim Control factory"/>
5998 +<oaf_server iid="OAFIID:Vim_Control_Factory" type="exe" location="@DEST_BIN@/@VIMNAME@">
5999 + <oaf_attribute name="repo_ids" type="stringv">
6000 + <item value="IDL:Bonobo/GenericFactory:1.0"/>
6002 + <oaf_attribute name="name" type="string" value="Vim Control factory"/>
6003 + <oaf_attribute name="description" type="string" value="Vim Control factory"/>
6006 +<oaf_server iid="OAFIID:Vim_Control" type="factory"
6007 + location="OAFIID:Vim_Proxy_Factory">
6008 + <oaf_attribute name="repo_ids" type="stringv">
6009 + <item value="IDL:Bonobo/Unknown:1.0"/>
6010 + <item value="IDL:Bonobo/Control:1.0"/>
6011 + <item value="IDL:Bonobo/ItemContainer:1.0"/>
6012 + <item value="IDL:Bonobo/PersistStream:1.0"/>
6013 + <item value="IDL:Bonobo/PersistFile:1.0"/>
6014 + <item value="IDL:Bonobo/Persist:1.0"/>
6015 + <item value="IDL:Nautilus/View:1.0"/>
6017 + <oaf_attribute name="name" type="string" value="Vim Control"/>
6018 + <oaf_attribute name="description" type="string" value="Vim Control"/>
6019 + <oaf_attribute name="bonobo:editable" type="boolean" value="false"/>
6020 + <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
6021 + <item value="text/plain"/>
6022 + <item value="text/*"/>
6024 + <oaf_attribute name="nautilus:view_as_name" type="string" value="Text"/>
6025 + <oaf_attribute name="nautilus:view_as_label" type="string" value="View/Edit in Vim"/>
6026 + <oaf_attribute name="nautilus:viewer_label" type="string" value="Vim"/>
6030 diff -Nur vim63/src/vim.h vim63-bonobo/src/vim.h
6031 --- vim63/src/vim.h 2005-09-09 20:11:10.612751000 +0200
6032 +++ vim63-bonobo/src/vim.h 2005-09-09 20:14:02.762580288 +0200
6033 @@ -755,6 +755,10 @@
6034 #define READ_STDIN 0x04 /* read from stdin */
6035 #define READ_BUFFER 0x08 /* read from curbuf (converting stdin) */
6036 #define READ_DUMMY 0x10 /* reading into a dummy buffer */
6037 +#define READ_EMB_STREAM 0x20 /* read from container stream object
6038 + (i.e. Bonobo Persist Stream) */
6039 +#define READ_EMB_FILE 0x40 /* read from container file object
6040 + (i.e. Bonobo Persist File) */
6042 /* Values for change_indent() */
6043 #define INDENT_SET 1 /* set indent */
6044 @@ -1045,6 +1049,7 @@
6045 EVENT_CURSORHOLD, /* cursor in same position for a while */
6046 EVENT_FUNCUNDEFINED, /* if calling a function which doesn't exist */
6047 EVENT_REMOTEREPLY, /* upon string reception from a remote vim */
6048 + EVENT_EMBEDDED_COMPONENT, /* upon embedding of vim as a component */
6049 NUM_EVENTS /* MUST be the last one */
6052 diff -Nur vim63/src/vim_proxy_factory.c vim63-bonobo/src/vim_proxy_factory.c
6053 --- vim63/src/vim_proxy_factory.c 1970-01-01 01:00:00.000000000 +0100
6054 +++ vim63-bonobo/src/vim_proxy_factory.c 2005-09-09 20:14:02.766579680 +0200
6057 + * vim_proxy_factory.c
6060 + * Jason Hildebrand (jason@peaceworks.ca)
6065 +#include "version.h"
6066 +#include <libbonobo.h>
6067 +#include <bonobo/bonobo-foreign-object.h>
6068 +#include <bonobo/bonobo-generic-factory.h>
6069 +#include "vim_bonobo_control.h"
6070 +#include "vim_bonobo_factory.h"
6072 +#define VIM_PROXY_OAFIID "OAFIID:Vim_Proxy_Factory"
6074 +static BonoboGenericFactory *factory = NULL;
6076 +static BonoboObject *
6077 +vim_proxy_factory(BonoboGenericFactory *this,
6078 + const char *oaf_iid,
6081 + CORBA_Object realfactory;
6082 + CORBA_Environment ev;
6083 + BonoboObject * vim_control = NULL;
6084 + CORBA_Object corba_control;
6086 + g_return_val_if_fail (this != NULL, NULL);
6087 + g_return_val_if_fail (oaf_iid != NULL, NULL);
6089 + g_message ("Trying to produce a '%s'...", oaf_iid);
6091 + if (strcmp (oaf_iid, VIM_OAFIID) == 0) {
6092 + CORBA_exception_init(&ev);
6094 + realfactory = bonobo_activation_activate_from_id (VIM_FACTORY_OAFIID,
6095 + Bonobo_ACTIVATION_FLAG_PRIVATE,
6098 + if (ev._major != CORBA_NO_EXCEPTION ) {
6099 + CORBA_exception_free (&ev);
6103 + corba_control = Bonobo_GenericFactory_createObject(realfactory, VIM_OAFIID, &ev);
6104 + if (ev._major != CORBA_NO_EXCEPTION ) {
6105 + CORBA_exception_free (&ev);
6108 + CORBA_exception_free (&ev);
6109 + vim_control = bonobo_foreign_object_new(corba_control);
6111 + g_warning ("Unknown IID `%s' requested", oaf_iid);
6114 + return vim_control;
6118 +BONOBO_ACTIVATION_FACTORY (VIM_PROXY_OAFIID,
6119 + "Vim Proxy Factory", "1.0",
6120 + vim_proxy_factory, NULL);