]> git.pld-linux.org Git - packages/vim.git/blob - vim-bonobo-20040115.patch
- license change to GPL
[packages/vim.git] / vim-bonobo-20040115.patch
1 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/Make_container.mak vim/src/Make_container.mak
2 --- vimcopy/src/Make_container.mak      Wed Dec 31 18:00:00 1969
3 +++ vim/src/Make_container.mak  Sat Jul 26 13:16:46 2003
4 @@ -0,0 +1,11 @@
5 +gnomeccFlags = `pkg-config --cflags libgnomeui-2.0 libgnome-2.0`
6 +ccFlags = -g -c ${gnomeccFlags}
7 +ldFlags = `pkg-config --libs libgnomeui-2.0 libgnome-2.0`
8 +
9 +all: container
10 +
11 +container: container.o
12 +       gcc -o container ${ldFlags} container.o
13 +
14 +%.o: %.c
15 +       gcc ${ccFlags} $< -o $@
16 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/Makefile vim/src/Makefile
17 --- vimcopy/src/Makefile        Thu Jan 15 10:17:10 2004
18 +++ vim/src/Makefile    Thu Jan 15 10:13:18 2004
19 @@ -1041,6 +1041,18 @@
20  GTK_MAN_TARGETS = installghelplinks
21  GTK_TESTTARGET = gui
22  
23 +### Bonobo GUI
24 +BONOBO_SRC     = $(GTK_SRC)
25 +BONOBO_OBJ     = $(GTK_OBJ)
26 +BONOBO_DEFS    = $(GTK_DEFS) 
27 +BONOBO_IPATH   = $(GTK_IPATH)
28 +BONOBO_LIBS_DIR        =  $(GTK_LIBS_DIR)
29 +BONOBO_LIBS1   = $(GTK_LIBS1)
30 +BONOBO_LIBS2   =  $(GTK_LIBS2)
31 +BONOBO_TARGETS =  $(GTK_TARGETS) vim-factory
32 +BONOBO_MAN_TARGETS =  $(GTK_MAN_TARGETS)
33 +BONOBO_TESTTARGET =  $(GTK_TESTTARGET)
34 +
35  ### Motif GUI
36  MOTIF_SRC      = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c
37  MOTIF_OBJ      = objects/gui.o objects/gui_motif.o objects/gui_x11.o \
38 @@ -1323,6 +1335,10 @@
39         objects/fileio.o \
40         objects/fold.o \
41         objects/getchar.o \
42 +        objects/gtkhtml_editor.o \
43 +        objects/gtkhtml_editor_common.o \
44 +        objects/gtkhtml_editor_skels.o \
45 +        objects/gtkhtml_editor_stubs.o \
46         $(HANGULIN_OBJ) \
47         objects/if_cscope.o \
48         objects/if_xcmdsrv.o \
49 @@ -1351,6 +1367,9 @@
50         objects/term.o \
51         objects/ui.o \
52         objects/undo.o \
53 +       objects/vim_bonobo_main.o \
54 +       objects/vim_bonobo_factory.o \
55 +       objects/vim_bonobo_control.o \
56         objects/window.o \
57         $(GUI_OBJ) \
58         $(PERL_OBJ) \
59 @@ -1360,7 +1379,7 @@
60         $(OS_EXTRA_OBJ) \
61         $(WORKSHOP_OBJ) \
62         $(NETBEANS_OBJ) \
63 -       $(WSDEBUG_OBJ)
64 +       $(WSDEBUG_OBJ)
65  
66  PRO_AUTO = \
67         buffer.pro \
68 @@ -1418,7 +1437,7 @@
69         os_mswin.pro os_beos.pro os_vms.pro os_riscos.pro $(PERL_PRO)
70  
71  # Default target is making the executable and tools
72 -all: $(VIMTARGET) $(TOOLS) languages
73 +all: $(VIMTARGET) $(TOOLS) $(EXTRA_TARGETS) languages
74  
75  tools: $(TOOLS)
76  
77 @@ -1596,6 +1615,10 @@
78  testclean:
79         cd testdir; $(MAKE) -f Makefile clean
80  
81 +vim-factory: objects/vim_proxy_factory.o
82 +       gcc -o vim-factory $(ALL_LIB_DIRS) $(LDFLAGS) objects/vim_proxy_factory.o $(ALL_LIBS)
83 +
84 +
85  #
86  # Avoid overwriting an existing executable, somebody might be running it and
87  # overwriting it could cause it to crash.  Deleting it is OK, it won't be
88 @@ -1622,6 +1645,23 @@
89  # may create a link to the new executable from /usr/bin/vi
90         -$(LINKIT)
91  
92 +Vim_Control.server: Vim_Control.server.in auto/config.mk
93 +       rm -f Vim_Control.server Vim_Control.server.tmp
94 +       sed -e 's,@DEST_BIN\@,$(DEST_BIN),g' \
95 +           -e 's,@VIMNAME\@,$(VIMNAME),g' \
96 +               Vim_Control.server.in >Vim_Control.server.tmp
97 +       mv Vim_Control.server.tmp Vim_Control.server
98 +
99 +installbonobo: installvimbin
100 +#      install factory to destbin
101 +       $(INSTALL_PROG) vim-factory $(DEST_BIN)
102 +       $(STRIP) $(DEST_BIN)/vim-factory
103 +       
104 +#      install server file to /usr/lib/bonobo/servers (modulo prefix)
105 +       -$(SHELL) ./mkinstalldirs $(DESTDIR)$(prefix)/lib/bonobo/servers
106 +       $(INSTALL_PROG) Vim_Control.server $(DESTDIR)$(prefix)/lib/bonobo/servers
107 +
108 +
109  # install the help files; first adjust the contents for the location
110  installruntime: $(HELPSOURCE)/vim.1 $(DEST_MAN) $(DEST_VIM) $(DEST_RT) \
111                 $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) \
112 @@ -1965,6 +2005,7 @@
113         if test -d $(PODIR); then \
114                 cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) clean; \
115         fi
116 +       -rm -f Vim_Control.server vim-factory vim-component
117  
118  # Make a shadow directory for compilation on another system or with different
119  # features.
120 @@ -2172,6 +2213,18 @@
121  objects/gui_mac.o: gui_mac.c
122         $(CCC) -o $@ gui_mac.c
123  
124 +objects/gtkhtml_editor.o: gtkhtml_editor.c
125 +       $(CCC) -o $@ gtkhtml_editor.c
126 +
127 +objects/gtkhtml_editor_common.o: gtkhtml_editor_common.c
128 +       $(CCC) -o $@ gtkhtml_editor_common.c
129 +
130 +objects/gtkhtml_editor_skels.o: gtkhtml_editor_skels.c
131 +       $(CCC) -o $@ gtkhtml_editor_skels.c
132 +
133 +objects/gtkhtml_editor_stubs.o: gtkhtml_editor_stubs.c
134 +       $(CCC) -o $@ gtkhtml_editor_stubs.c
135 +
136  objects/hangulin.o: hangulin.c
137         $(CCC) -o $@ hangulin.c
138  
139 @@ -2295,6 +2348,18 @@
140  objects/undo.o: undo.c
141         $(CCC) -o $@ undo.c
142  
143 +objects/vim_bonobo_control.o: vim_bonobo_control.c
144 +       $(CCC) -o $@ vim_bonobo_control.c
145 +
146 +objects/vim_bonobo_factory.o: vim_bonobo_factory.c
147 +       $(CCC) -o $@ vim_bonobo_factory.c
148 +
149 +objects/vim_bonobo_main.o: vim_bonobo_main.c
150 +       $(CCC) -o $@ vim_bonobo_main.c
151 +
152 +objects/vim_proxy_factory.o: vim_proxy_factory.c
153 +       $(CCC) -o $@ vim_proxy_factory.c
154 +
155  objects/window.o: window.c
156         $(CCC) -o $@ window.c
157  
158 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/Vim_Control.server.in vim/src/Vim_Control.server.in
159 --- vimcopy/src/Vim_Control.server.in   Wed Dec 31 18:00:00 1969
160 +++ vim/src/Vim_Control.server.in       Sat Jan 10 10:45:47 2004
161 @@ -0,0 +1,42 @@
162 +<oaf_info>
163 +
164 +<oaf_server iid="OAFIID:Vim_Proxy_Factory" type="exe" location="@DEST_BIN@/vim-factory">
165 +  <oaf_attribute name="repo_ids" type="stringv">
166 +    <item value="IDL:Bonobo/GenericFactory:1.0"/>
167 +  </oaf_attribute>
168 +  <oaf_attribute name="name" type="string" value="Vim Control factory"/>
169 +  <oaf_attribute name="description" type="string" value="Vim Control factory"/>
170 +</oaf_server>
171 +
172 +<oaf_server iid="OAFIID:Vim_Control_Factory" type="exe" location="@DEST_BIN@/@VIMNAME@">
173 +  <oaf_attribute name="repo_ids" type="stringv">
174 +    <item value="IDL:Bonobo/GenericFactory:1.0"/>
175 +  </oaf_attribute>
176 +  <oaf_attribute name="name" type="string" value="Vim Control factory"/>
177 +  <oaf_attribute name="description" type="string" value="Vim Control factory"/>
178 +</oaf_server>
179 +
180 +<oaf_server iid="OAFIID:Vim_Control" type="factory"
181 + location="OAFIID:Vim_Proxy_Factory">
182 +  <oaf_attribute name="repo_ids" type="stringv">
183 +    <item value="IDL:Bonobo/Unknown:1.0"/>
184 +    <item value="IDL:Bonobo/Control:1.0"/>
185 +    <item value="IDL:Bonobo/ItemContainer:1.0"/>
186 +    <item value="IDL:Bonobo/PersistStream:1.0"/>
187 +    <item value="IDL:Bonobo/PersistFile:1.0"/>
188 +    <item value="IDL:Bonobo/Persist:1.0"/>
189 +    <item value="IDL:Nautilus/View:1.0"/>
190 +  </oaf_attribute>
191 +  <oaf_attribute name="name" type="string" value="Vim Control"/>
192 +  <oaf_attribute name="description" type="string" value="Vim Control"/>
193 +  <oaf_attribute name="bonobo:editable" type="boolean" value="false"/>
194 +  <oaf_attribute name="bonobo:supported_mime_types" type="stringv">
195 +    <item value="text/plain"/>
196 +    <item value="text/*"/>
197 +  </oaf_attribute>
198 +  <oaf_attribute name="nautilus:view_as_name" type="string" value="Text"/>
199 +  <oaf_attribute name="nautilus:view_as_label" type="string" value="View/Edit in Vim"/>
200 +  <oaf_attribute name="nautilus:viewer_label" type="string" value="Vim"/>
201 +</oaf_server>
202 +
203 +</oaf_info>
204 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/buffer.c vim/src/buffer.c
205 --- vimcopy/src/buffer.c        Sat Jan 10 13:10:01 2004
206 +++ vim/src/buffer.c    Sat Jan 10 13:06:38 2004
207 @@ -28,6 +28,10 @@
208  
209  #include "vim.h"
210  
211 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
212 +#include "vim_bonobo_control.h"
213 +#endif
214 +
215  #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
216  static char_u  *buflist_match __ARGS((regprog_T *prog, buf_T *buf));
217  # define HAVE_BUFLIST_MATCH
218 @@ -132,10 +136,20 @@
219         if (curbuf->b_help)
220             fix_help_buffer();
221      }
222 -    else if (read_stdin)
223 +    else if (read_stdin
224 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
225 +                || read_from_container
226 +#endif
227 +            )
228      {
229         int             save_bin = curbuf->b_p_bin;
230         linenr_T        line_count;
231 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
232 +        int flags = READ_NEW + READ_EMB_STREAM;
233 +       curbuf->emb_buffer = TRUE;
234 +#else
235 +        int flags = READ_NEW + READ_STDIN;
236 +#endif
237  
238         /*
239          * First read the text in binary mode into the buffer.
240 @@ -145,7 +159,7 @@
241          */
242         curbuf->b_p_bin = TRUE;
243         retval = readfile(NULL, NULL, (linenr_T)0,
244 -                 (linenr_T)0, (linenr_T)MAXLNUM, eap, READ_NEW + READ_STDIN);
245 +                 (linenr_T)0, (linenr_T)MAXLNUM, eap, flags);
246         curbuf->b_p_bin = save_bin;
247         if (retval == OK)
248         {
249 @@ -167,14 +181,21 @@
250             /* Put the cursor on the first line. */
251             curwin->w_cursor.lnum = 1;
252             curwin->w_cursor.col = 0;
253 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
254 +            if (read_stdin) 
255 +            {
256 +#endif
257  #ifdef FEAT_AUTOCMD
258  # ifdef FEAT_EVAL
259 -           apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
260 +                apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, FALSE,
261                                                         curbuf, &retval);
262  # else
263 -           apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
264 +                apply_autocmds(EVENT_STDINREADPOST, NULL, NULL, FALSE, curbuf);
265  # endif
266  #endif
267 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
268 +            }
269 +#endif
270         }
271      }
272  
273 @@ -4547,6 +4568,11 @@
274         if (buf->b_sfname != NULL)
275             return (char *)buf->b_sfname;
276         return "[Scratch]";
277 +    }
278 +#endif
279 +#if defined(FEAT_QUICKFIX) && defined(FEAT_GUI_COMPONENT)
280 +    if ( buf->emb_buffer ) {
281 +       return "[Embedded File]";
282      }
283  #endif
284      if (buf->b_fname == NULL)
285 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/config.h.in vim/src/config.h.in
286 --- vimcopy/src/config.h.in     Mon May 26 10:45:01 2003
287 +++ vim/src/config.h.in Sat Jul 26 13:16:46 2003
288 @@ -316,6 +316,9 @@
289  /* Define if GTK+ multihead support is available (requires GTK+ >= 2.1.1). */
290  #undef HAVE_GTK_MULTIHEAD
291  
292 +/* Define if you want component (i.e. Bonobo) support. */
293 +#undef FEAT_GUI_COMPONENT
294
295  /* Define if your X has own locale library */
296  #undef X_LOCALE
297  
298 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/config.mk.in vim/src/config.mk.in
299 --- vimcopy/src/config.mk.in    Sat Jan 10 13:10:01 2004
300 +++ vim/src/config.mk.in        Thu Jan 15 09:50:04 2004
301 @@ -106,6 +106,9 @@
302  ### Prefix for location of man pages
303  MANDIR         = @mandir@
304  
305 +### Extra targets to be built by default
306 +EXTRA_TARGETS = @EXTRA_TARGETS@
307 +
308  ### Do we have a GUI
309  GUI_INC_LOC    = @GUI_INC_LOC@
310  GUI_LIB_LOC    = @GUI_LIB_LOC@
311 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/configure.in vim/src/configure.in
312 --- vimcopy/src/configure.in    Sat Jan 10 13:10:01 2004
313 +++ vim/src/configure.in        Thu Jan 15 09:48:54 2004
314 @@ -56,6 +56,7 @@
315    sh ./toolcheck 1>&AC_FD_MSG
316  fi
317  
318 +EXTRA_TARGETS="";
319  OS_EXTRA_SRC=""; OS_EXTRA_OBJ=""
320  
321  dnl Check for BeOS, which needs an extra source file
322 @@ -123,6 +124,7 @@
323  
324  AC_SUBST(OS_EXTRA_SRC)
325  AC_SUBST(OS_EXTRA_OBJ)
326 +AC_SUBST(EXTRA_TARGETS)
327  
328  dnl Add /usr/local/lib to $LDFLAGS and /usr/local/include to CFLAGS.
329  dnl Only when the directory exists and it wasn't there yet.
330 @@ -1410,6 +1412,23 @@
331           AC_DEFINE(FEAT_GUI_GNOME)
332           GUI_INC_LOC="$GUI_INC_LOC $GNOME_INCLUDEDIR"
333           GTK_LIBNAME="$GTK_LIBNAME $GNOME_LIBDIR $GNOME_LIBS"
334 +          AC_MSG_CHECKING(whether or not to include bonobo support)
335 +          AC_ARG_ENABLE(bonobo,
336 +            [  --enable-bonobo         If using GNOME, enable bonobo support [default=no]],
337 +            , enable_bonobo="no")
338 +          if test "x$enable_bonobo" = "xno"; then
339 +            AC_MSG_RESULT($enable_bonobo);
340 +          else
341 +            if test "x$SKIP_BONOBO" != "xYES" -a $gtk_major_version -ge 2; then
342 +              AC_MSG_RESULT(yes);
343 +              AC_DEFINE(FEAT_GUI_COMPONENT) 
344 +              GUITYPE=BONOBO
345 +              VIMNAME="vim-component"
346 +              EXTRA_TARGETS="vim-factory Vim_Control.server"
347 +            else
348 +              AC_MSG_RESULT(no (Bonobo requires Gnome 2));
349 +            fi
350 +          fi
351         fi
352        }
353        fi
354 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/container.c vim/src/container.c
355 --- vimcopy/src/container.c     Wed Dec 31 18:00:00 1969
356 +++ vim/src/container.c Sat Jul 26 13:16:46 2003
357 @@ -0,0 +1,266 @@
358 +
359 +#include <bonobo.h>
360 +#include <glib.h>
361 +
362 +BonoboControlFrame  *ctrl_frame;
363 +BonoboUIComponent   *ui_comp;
364 +
365 +/* vbox */
366 +GtkWidget           *box;
367 +GtkWidget           *ctrl_widget;
368 +
369 +char * filename;
370 +
371 +static Bonobo_Control
372 +instantiate_control()
373 +{
374 +       Bonobo_Control control;
375 +       Bonobo_PersistFile pfile;
376 +       Bonobo_PersistStream pstream;
377 +       CORBA_Environment ev;
378 +    Bonobo_Stream stream;
379 +
380 +       CORBA_exception_init (&ev);
381 +
382 +       /* get control component */
383 +       control = bonobo_get_object ("OAFIID:Vim_Control",
384 +                                    "Bonobo/Control", &ev);
385 +       if (BONOBO_EX (&ev) || (control == CORBA_OBJECT_NIL))
386 +    {
387 +               CORBA_exception_free (&ev);
388 +        return NULL;
389 +    }
390 +       
391 +#if 0
392 +       /* get PersistFile interface */
393 +    pfile = Bonobo_Unknown_queryInterface (control, "IDL:Bonobo/PersistFile:1.0", &ev);
394 +    if (BONOBO_EX (&ev) || (pfile == CORBA_OBJECT_NIL))
395 +    exit(1);
396 +       
397 +       /* load the file */
398 +    Bonobo_PersistFile_load (pfile, filename, &ev);
399 +       bonobo_object_release_unref (pfile, NULL);
400 +#endif
401 +
402 +       /* get PersistStream interface */
403 +    pstream = Bonobo_Unknown_queryInterface (control, "IDL:Bonobo/PersistStream:1.0", &ev);
404 +    if (BONOBO_EX (&ev) || (pstream == CORBA_OBJECT_NIL))
405 +    {
406 +               CORBA_exception_free (&ev);
407 +        return NULL;
408 +    }
409 +       
410 +       /* load the file */
411 +    stream = bonobo_get_object(filename, "IDL:Bonobo/Stream:1.0", &ev);
412 +       if (ev._major != CORBA_NO_EXCEPTION) {
413 +        g_warning("Error getting stream interface");
414 +               bonobo_object_unref (BONOBO_OBJECT (stream));
415 +               CORBA_exception_free (&ev);
416 +               return NULL;
417 +       }
418 +    Bonobo_PersistStream_load (pstream, stream, "text/plain", &ev);
419 +       if (ev._major != CORBA_NO_EXCEPTION) {
420 +        g_warning("Error loading stream!");
421 +               bonobo_object_unref (BONOBO_OBJECT (stream));
422 +               CORBA_exception_free (&ev);
423 +               return NULL;
424 +       }
425 +       bonobo_object_release_unref (pstream, NULL);
426 +    return control;
427 +}
428 +
429 +static void
430 +verb_FileNewWindow (BonoboUIComponent *uic, gpointer user_data, const char *cname)
431 +{
432 +    printf("Got New Window!\n");
433 +}
434 +
435 +static void
436 +verb_DoNothing (BonoboUIComponent *uic, gpointer user_data, const char *cname)
437 +{
438 +}
439 +
440 +static BonoboUIVerb app_verbs[] = {
441 +       BONOBO_UI_VERB ("FileNewWindow", verb_FileNewWindow),
442 +       BONOBO_UI_VERB ("FileOpen",      verb_DoNothing),
443 +       BONOBO_UI_VERB ("FileCloseWindow", verb_DoNothing),
444 +       BONOBO_UI_VERB ("FileExit",      verb_DoNothing),
445 +       BONOBO_UI_VERB ("Preferences",   verb_DoNothing),
446 +       BONOBO_UI_VERB ("HelpAbout",     verb_DoNothing),
447 +       BONOBO_UI_VERB ("Help",          verb_DoNothing),
448 +       BONOBO_UI_VERB ("DnDNewWindow",  verb_DoNothing),
449 +       BONOBO_UI_VERB ("DnDSameWindow", verb_DoNothing),
450 +       BONOBO_UI_VERB ("DnDCancel",     verb_DoNothing),
451 +       BONOBO_UI_VERB_END
452 +};
453 +
454 +static void 
455 +add_control_to_ui (BonoboWindow *window, Bonobo_Control control)
456 +{
457 +       CORBA_Environment ev;
458 +       Bonobo_PropertyControl prop_control;
459 +       BonoboUIContainer *ui_container;
460 +    char *curdir;
461 +
462 +       g_return_if_fail (window != NULL);
463 +       g_return_if_fail (BONOBO_IS_WINDOW (window));
464 +       
465 +       CORBA_exception_init (&ev);
466 +
467 +       ui_container = bonobo_window_get_ui_container (BONOBO_WINDOW (window));
468 +       ctrl_frame = bonobo_control_frame_new (BONOBO_OBJREF (ui_container));
469 +
470 +       /* bind and view new control widget */
471 +       bonobo_control_frame_bind_to_control (ctrl_frame, control, &ev);
472 +       bonobo_control_frame_control_activate (ctrl_frame);
473 +       if (control != CORBA_OBJECT_NIL && ctrl_widget == NULL) {
474 +               ctrl_widget = bonobo_control_frame_get_widget (ctrl_frame);
475 +               if (!ctrl_widget)
476 +                       g_assert_not_reached ();
477 +
478 +        bonobo_window_set_contents (BONOBO_WINDOW(window), GTK_WIDGET(ctrl_widget));
479 +               gtk_widget_show (ctrl_widget);
480 +       }
481 +
482 +       ui_comp = bonobo_ui_component_new ("vim-container");
483 +       bonobo_ui_component_set_container (ui_comp, BONOBO_OBJREF (ui_container), NULL);
484 +
485 +    curdir = (char *)getcwd(NULL, 0);
486 +       bonobo_ui_util_set_ui (ui_comp, curdir, "vim-container.xml", "Vim", NULL);
487 +    free( curdir );
488 +    bonobo_ui_component_add_verb_list_with_data (ui_comp, app_verbs, window);
489 +
490 +       /* update sensitivity of the properties menu item */
491 +       prop_control = Bonobo_Unknown_queryInterface (control, 
492 +                                                     "IDL:Bonobo/PropertyControl:1.0", &ev);
493 +       bonobo_ui_component_set_prop (ui_comp,
494 +                                     "/commands/Preferences",
495 +                                     "sensitive",
496 +                                     prop_control == CORBA_OBJECT_NIL ? "0" : "1",
497 +                                     &ev);
498 +       
499 +       bonobo_object_release_unref (prop_control, &ev);
500 +
501 +       /* enable view menu */
502 +       /* FIXME: We should check if the component adds anything to 
503 +        *        the menu, so that we don't view an empty menu.
504 +        */
505 +       /*bonobo_ui_component_set_prop (ui_comp, "/menu/View", "hidden", "0", &ev);*/
506 +
507 +       CORBA_exception_free (&ev);
508 +
509 +       /* retrieve control properties and install listeners */
510 +       //check_for_control_properties (window);
511 +}
512 +
513 +static void write_stream_to_file(Bonobo_Control control)
514 +{
515 +    Bonobo_Storage storage;
516 +    gchar * dirname;
517 +    gchar * basename;
518 +       CORBA_Environment ev;
519 +       Bonobo_PersistStream pstream;
520 +    Bonobo_Stream stream;
521 +
522 +    g_warning("write stream to file!");
523 +       CORBA_exception_init (&ev);
524 +
525 +    dirname = g_path_get_dirname(filename);
526 +    storage = bonobo_get_object(dirname, "IDL:Bonobo/Storage:1.0", &ev);
527 +    g_free(dirname);
528 +    if (BONOBO_EX (&ev) || (storage == CORBA_OBJECT_NIL))
529 +    {
530 +               CORBA_exception_free (&ev);
531 +        return;
532 +    }
533 +
534 +    pstream = Bonobo_Unknown_queryInterface (control, "IDL:Bonobo/PersistStream:1.0", &ev);
535 +    if (BONOBO_EX (&ev) || (pstream == CORBA_OBJECT_NIL))
536 +    {
537 +        bonobo_object_release_unref(storage, NULL);
538 +               CORBA_exception_free (&ev);
539 +        return;
540 +    }
541 +
542 +    basename = g_path_get_basename(filename);
543 +    stream = Bonobo_Storage_openStream(storage, basename, Bonobo_Storage_WRITE, &ev );
544 +    g_free(basename);
545 +    if (BONOBO_EX (&ev) || (stream == CORBA_OBJECT_NIL))
546 +    {
547 +        bonobo_object_release_unref(pstream, NULL);
548 +        bonobo_object_release_unref(storage, NULL);
549 +               CORBA_exception_free (&ev);
550 +        return;
551 +    }
552 +
553 +    Bonobo_PersistStream_save (pstream, stream, "text/plain", &ev);
554 +       if (ev._major != CORBA_NO_EXCEPTION) {
555 +        g_warning("Error saving stream!");
556 +               bonobo_object_unref (BONOBO_OBJECT (stream));
557 +        bonobo_object_release_unref(pstream, NULL);
558 +        bonobo_object_release_unref(storage, NULL);
559 +               CORBA_exception_free (&ev);
560 +               return;
561 +       }
562 +    bonobo_object_release_unref(stream, NULL);
563 +    bonobo_object_release_unref(pstream, NULL);
564 +    bonobo_object_release_unref(storage, NULL);
565 +    return;
566 +}
567 +
568 +static void
569 +window_destroyed (GtkWindow *window, char * data)
570 +{
571 +    Bonobo_Control control;
572 +
573 +    control = bonobo_control_frame_get_control(ctrl_frame);
574 +    write_stream_to_file(control);
575 +    bonobo_control_frame_control_deactivate(ctrl_frame);
576 +    bonobo_object_release_unref( control, NULL );
577 +    bonobo_main_quit();
578 +}
579 +
580 +int main(int argc, char * argv[] ) 
581 +{
582 +    BonoboWidget * bw;
583 +    BonoboWindow      *window;
584 +       BonoboUIEngine    *engine;
585 +       BonoboUIContainer *container;
586 +    Bonobo_Control    control;
587 +    gchar             *cwd;
588 +
589 +    if( argc <= 1 ) { 
590 +        fprintf(stderr, "%s: not enough args\n", argv[0] );
591 +        fprintf(stderr, "Usage: %s <text file>\n", argv[0]);
592 +        exit(1);
593 +    }
594 +    cwd = g_get_current_dir();
595 +    filename = g_build_filename( "file:", cwd, argv[1], NULL );
596 +    g_free(cwd);
597 +
598 +    bonobo_ui_init ("container", "1.0", &argc, argv);
599 +
600 +       if(gnome_vfs_init () == FALSE)
601 +               g_error (_("Could not initialize GnomeVFS!\n"));
602 +
603 +       window = BONOBO_WINDOW ( bonobo_window_new ("Window", "Vim Test Container"));
604 +
605 +    // instantiate a control
606 +    control = instantiate_control();
607 +    if( control == NULL )
608 +        return 1;
609 +    
610 +    // put it into our window
611 +    add_control_to_ui (window, control);
612 +
613 +    g_signal_connect (window, "destroy",
614 +          G_CALLBACK (window_destroyed),
615 +          &window);
616 +
617 +
618 +    gtk_widget_show_all( GTK_WIDGET( window ));
619 +
620 +    bonobo_main();
621 +
622 +    return 0;
623 +}
624 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/ex_cmds2.c vim/src/ex_cmds2.c
625 --- vimcopy/src/ex_cmds2.c      Sat Jan 10 13:10:01 2004
626 +++ vim/src/ex_cmds2.c  Sat Jan 10 13:06:40 2004
627 @@ -704,6 +704,12 @@
628      int                forceit;
629      int                allbuf;         /* may write all buffers */
630  {
631 +#ifdef FEAT_GUI_COMPONENT
632 +    if ( buf->emb_buffer ) {
633 +       EMSG(_("E467: Cannot close embedded file"));
634 +        return TRUE;
635 +    }
636 +#endif
637      if (       !forceit
638             && bufIsChanged(buf)
639             && (mult_win || buf->b_nwindows <= 1)
640 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/ex_docmd.c vim/src/ex_docmd.c
641 --- vimcopy/src/ex_docmd.c      Sat Jan 10 13:10:01 2004
642 +++ vim/src/ex_docmd.c  Sat Jan 10 13:06:41 2004
643 @@ -5413,8 +5413,13 @@
644      }
645      else
646      {
647 +#ifdef FEAT_GUI_COMPONENT
648 +        EMSG(_(e_compnoquit));
649 +        not_exiting();
650 +        return;
651 +#endif
652  #ifdef FEAT_WINDOWS
653 -       if (only_one_window())      /* quit last window */
654 +        if (only_one_window())             /* quit last window */
655  #endif
656             getout(0);
657  #ifdef FEAT_WINDOWS
658 @@ -5435,8 +5440,12 @@
659  ex_cquit(eap)
660      exarg_T    *eap;
661  {
662 +#ifdef FEAT_GUI_COMPONENT
663 +    EMSG(_(e_compnoquit));
664 +    return;
665 +#endif
666      getout(1); /* this does not always pass on the exit code to the Manx
667 -                  compiler. why? */
668 +                   compiler. why? */
669  }
670  
671  /*
672 @@ -5456,6 +5465,10 @@
673         return;
674      }
675  # endif
676 +#ifdef FEAT_GUI_COMPONENT
677 +    EMSG(_(e_compnoquit));
678 +    return;
679 +#endif
680      exiting = TRUE;
681      if (eap->forceit || !check_changed_any(FALSE))
682         getout(0);
683 @@ -5650,8 +5663,13 @@
684      }
685      else
686      {
687 +#ifdef FEAT_GUI_COMPONENT
688 +        EMSG(_(e_compnoquit));
689 +        not_exiting();
690 +        return;
691 +#endif
692  #ifdef FEAT_WINDOWS
693 -       if (only_one_window())      /* quit last window, exit Vim */
694 +        if ( only_one_window())            /* quit last window, exit Vim */
695  #endif
696             getout(0);
697  #ifdef FEAT_WINDOWS
698 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/fileio.c vim/src/fileio.c
699 --- vimcopy/src/fileio.c        Sat Jan 10 13:10:01 2004
700 +++ vim/src/fileio.c    Sat Jan 10 13:06:42 2004
701 @@ -41,6 +41,10 @@
702  # define CRYPT_MAGIC_LEN       12              /* must be multiple of 4! */
703  #endif
704  
705 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME) 
706 +#include "vim_bonobo_control.h"
707 +#endif
708 +
709  /* Is there any system that doesn't have access()? */
710  #ifndef MACOS_CLASSIC /* Not available on MacOS 9 */
711  # define USE_MCH_ACCESS
712 @@ -196,6 +200,7 @@
713   * READ_BUFFER read from curbuf instead of a file (converting after reading
714   *             stdin)
715   * READ_DUMMY  read into a dummy buffer (to check if file contents changed)
716 + * READ_EMB_STREAM read from a bonobo persist stream
717   *
718   * return FAIL for failure, OK otherwise
719   */
720 @@ -215,6 +220,11 @@
721      int                filtering = (flags & READ_FILTER);
722      int                read_stdin = (flags & READ_STDIN);
723      int                read_buffer = (flags & READ_BUFFER);
724 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
725 +    int                read_pstream = (flags & READ_EMB_STREAM);
726 +#else
727 +#define read_pstream 0
728 +#endif
729      linenr_T   read_buf_lnum = 1;      /* next line to read from curbuf */
730      colnr_T    read_buf_col = 0;       /* next char to read from this line */
731      char_u     c;
732 @@ -318,7 +328,7 @@
733       * The BufReadCmd and FileReadCmd events intercept the reading process by
734       * executing the associated commands instead.
735       */
736 -    if (!filtering && !read_stdin && !read_buffer)
737 +    if (!filtering && !read_stdin && !read_buffer && !read_pstream)
738      {
739         pos_T       pos;
740  
741 @@ -377,7 +387,7 @@
742       * On Unix it is possible to read a directory, so we have to
743       * check for it before the mch_open().
744       */
745 -    if (!read_stdin && !read_buffer)
746 +    if (!read_stdin && !read_buffer && !read_pstream)
747      {
748         perm = mch_getperm(fname);
749         if (perm >= 0 && !S_ISREG(perm)             /* not a regular file ... */
750 @@ -419,7 +429,7 @@
751      if (check_readonly && !readonlymode)    /* default: set file not readonly */
752         curbuf->b_p_ro = FALSE;
753  
754 -    if (newfile && !read_stdin && !read_buffer)
755 +    if (newfile && !read_stdin && !read_buffer && !read_pstream)
756      {
757         /* Remember time of file.
758          * For RISCOS, also remember the filetype.
759 @@ -479,6 +489,11 @@
760         setmode(0, O_BINARY);
761  #endif
762      }
763 +#ifdef FEAT_GUI_COMPONENT
764 +    else if (read_pstream)
765 +    {
766 +    }
767 +#endif
768      else if (!read_buffer)
769      {
770  #ifdef USE_MCH_ACCESS
771 @@ -606,7 +621,7 @@
772      /* If "Quit" selected at ATTENTION dialog, don't load the file */
773      if (swap_exists_action == SEA_QUIT)
774      {
775 -       if (!read_buffer && !read_stdin)
776 +       if (!read_buffer && !read_stdin && !read_pstream)
777             close(fd);
778         return FAIL;
779      }
780 @@ -631,7 +646,7 @@
781          * The file must be closed again, the autocommands may want to change
782          * the file before reading it.
783          */
784 -       if (!read_stdin)
785 +       if (!read_stdin && !read_pstream)
786             close(fd);          /* ignore errors */
787  
788         /*
789 @@ -668,7 +683,7 @@
790          * Don't allow the autocommands to change the current buffer.
791          * Try to re-open the file.
792          */
793 -       if (!read_stdin && (curbuf != old_curbuf
794 +       if (!read_stdin && !read_pstream && (curbuf != old_curbuf
795                 || (fd = mch_open((char *)fname, O_RDONLY | O_EXTRA, 0)) < 0))
796         {
797             --no_wait_return;
798 @@ -708,7 +723,7 @@
799             }
800  #endif
801         }
802 -       else if (!read_buffer)
803 +       else if (!read_buffer && !read_pstream)
804             filemess(curbuf, sfname, (char_u *)"", 0);
805      }
806  
807 @@ -788,7 +803,7 @@
808             read_buf_lnum = 1;
809             read_buf_col = 0;
810         }
811 -       else if (read_stdin || lseek(fd, (off_t)0L, SEEK_SET) != 0)
812 +       else if (read_stdin || read_pstream || lseek(fd, (off_t)0L, SEEK_SET) != 0)
813         {
814             /* Can't rewind the file, give up. */
815             error = TRUE;
816 @@ -927,7 +942,7 @@
817          * Use the 'charconvert' expression when conversion is required
818          * and we can't do it internally or with iconv().
819          */
820 -       if (fio_flags == 0 && !read_stdin && !read_buffer && *p_ccv != NUL
821 +       if (fio_flags == 0 && !read_stdin && !read_buffer && !read_pstream && *p_ccv != NUL
822  #  ifdef USE_ICONV
823                                                     && iconv_fd == (iconv_t)-1
824  #  endif
825 @@ -976,7 +991,7 @@
826      /* Set can_retry when it's possible to rewind the file and try with
827       * another "fenc" value.  It's FALSE when no other "fenc" to try, reading
828       * stdin or "fenc" was specified with "++enc=". */
829 -    can_retry = (*fenc != NUL && !read_stdin
830 +    can_retry = (*fenc != NUL && !read_stdin && !read_pstream
831                                      && (eap == NULL || eap->force_enc == 0));
832  #endif
833  
834 @@ -1141,6 +1156,11 @@
835                         }
836                     }
837                 }
838 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME) 
839 +                else if( read_pstream ) {
840 +                    size = vim_control_persist_stream_read(ptr, size);   
841 +                }
842 +#endif
843                 else
844                 {
845                     /*
846 @@ -1734,7 +1754,7 @@
847                             else if (ff_error != EOL_DOS)
848                             {
849                                 if (   try_unix
850 -                                   && !read_stdin
851 +                                   && !read_stdin && !read_pstream
852                                     && (read_buffer
853                                         || lseek(fd, (off_t)0L, SEEK_SET) == 0))
854                                 {
855 @@ -1823,7 +1843,7 @@
856  # endif
857  #endif
858  
859 -    if (!read_buffer && !read_stdin)
860 +    if (!read_buffer && !read_stdin && !read_pstream)
861         close(fd);                              /* errors are ignored */
862      vim_free(buffer);
863  
864 @@ -2012,7 +2032,7 @@
865  #ifdef ALWAYS_USE_GUI
866             /* Don't show the message when reading stdin, it would end up in a
867              * message box (which might be shown when exiting!) */
868 -           if (read_stdin || read_buffer)
869 +           if (read_stdin || read_buffer )
870                 p = msg_may_trunc(FALSE, IObuff);
871             else
872  #endif
873 @@ -2078,7 +2098,7 @@
874       */
875      write_no_eol_lnum = read_no_eol_lnum;
876  
877 -    if (!read_stdin && !read_buffer)
878 +    if (!read_stdin && !read_buffer && !read_pstream)
879      {
880         int m = msg_scroll;
881         int n = msg_scrolled;
882 @@ -2404,6 +2424,11 @@
883      int                    prev_got_int = got_int;
884      int                    file_readonly = FALSE;  /* overwritten file is read-only */
885      static char            *err_readonly = "is read-only (cannot override: \"W\" in 'cpoptions')";
886 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
887 +    int                    write_pstream = write_to_container;
888 +#else
889 +#define write_pstream 0
890 +#endif
891  #if defined(UNIX) || defined(__EMX__XX)            /*XXX fix me sometime? */
892      int                    made_writable = FALSE;  /* 'w' bit has been set */
893  #endif
894 @@ -2747,7 +2772,7 @@
895      }
896  #endif /* !UNIX */
897  
898 -    if (!device && !newfile)
899 +    if (!device && !newfile && !write_pstream )
900      {
901         /*
902          * Check if the file is really writable (when renaming the file to
903 @@ -2806,6 +2831,10 @@
904      if (dobackup && *p_bsk != NUL && match_file_list(p_bsk, sfname, ffname))
905         dobackup = FALSE;
906  #endif
907 +#ifdef FEAT_GUI_COMPONENT
908 +    if( write_pstream )
909 +        dobackup = FALSE;
910 +#endif
911  
912      /*
913       * Save the value of got_int and reset it.  We don't want a previous
914 @@ -3421,95 +3450,97 @@
915       * (this may happen when the user reached his quotum for number of files).
916       * Appending will fail if the file does not exist and forceit is FALSE.
917       */
918 -    while ((fd = mch_open((char *)wfname, O_WRONLY | O_EXTRA | (append
919 -                       ? (forceit ? (O_APPEND | O_CREAT) : O_APPEND)
920 -                       : (O_CREAT | O_TRUNC))
921 -                       , 0666)) < 0)
922 -    {
923 -       /*
924 -        * A forced write will try to create a new file if the old one is
925 -        * still readonly. This may also happen when the directory is
926 -        * read-only. In that case the mch_remove() will fail.
927 -        */
928 -       if (errmsg == NULL)
929 -       {
930 +    if (!write_pstream) {
931 +        while ((fd = mch_open((char *)wfname, O_WRONLY | O_EXTRA | (append
932 +                            ? (forceit ? (O_APPEND | O_CREAT) : O_APPEND)
933 +                            : (O_CREAT | O_TRUNC))
934 +                            , 0666)) < 0)
935 +        {
936 +            /*
937 +             * A forced write will try to create a new file if the old one is
938 +             * still readonly. This may also happen when the directory is
939 +             * read-only. In that case the mch_remove() will fail.
940 +             */
941 +            if (errmsg == NULL)
942 +            {
943  #ifdef UNIX
944 -           struct stat st;
945 +                struct stat    st;
946  
947 -           /* Don't delete the file when it's a hard or symbolic link. */
948 -           if ((!newfile && st_old.st_nlink > 1)
949 -                   || (mch_lstat((char *)fname, &st) == 0
950 -                       && (st.st_dev != st_old.st_dev
951 -                           || st.st_ino != st_old.st_ino)))
952 -               errmsg = (char_u *)_("E166: Can't open linked file for writing");
953 -           else
954 -#endif
955 -           {
956 -               errmsg = (char_u *)_("E212: Can't open file for writing");
957 -               if (forceit && vim_strchr(p_cpo, CPO_FWRITE) == NULL
958 -                                                                && perm >= 0)
959 -               {
960 +                /* Don't delete the file when it's a hard or symbolic link. */
961 +                if ((!newfile && st_old.st_nlink > 1)
962 +                        || (mch_lstat((char *)fname, &st) == 0
963 +                            && (st.st_dev != st_old.st_dev
964 +                                || st.st_ino != st_old.st_ino)))
965 +                    errmsg = (char_u *)_("E166: Can't open linked file for writing");
966 +                else
967 +#endif
968 +                {
969 +                    errmsg = (char_u *)_("E212: Can't open file for writing");
970 +                    if (forceit && vim_strchr(p_cpo, CPO_FWRITE) == NULL
971 +                                                                     && perm >= 0)
972 +                    {
973  #ifdef UNIX
974 -                   /* we write to the file, thus it should be marked
975 -                      writable after all */
976 -                   if (!(perm & 0200))
977 -                       made_writable = TRUE;
978 -                   perm |= 0200;
979 -                   if (st_old.st_uid != getuid() || st_old.st_gid != getgid())
980 -                       perm &= 0777;
981 -#endif
982 -                   if (!append)            /* don't remove when appending */
983 -                       mch_remove(wfname);
984 -                   continue;
985 -               }
986 -           }
987 -       }
988 -
989 -restore_backup:
990 -       {
991 -           struct stat st;
992 -
993 -           /*
994 -            * If we failed to open the file, we don't need a backup. Throw it
995 -            * away.  If we moved or removed the original file try to put the
996 -            * backup in its place.
997 -            */
998 -           if (backup != NULL && wfname == fname)
999 -           {
1000 -               if (backup_copy)
1001 -               {
1002 -                   /*
1003 -                    * There is a small chance that we removed the original,
1004 -                    * try to move the copy in its place.
1005 -                    * This may not work if the vim_rename() fails.
1006 -                    * In that case we leave the copy around.
1007 -                    */
1008 -                   /* If file does not exist, put the copy in its place */
1009 -                   if (mch_stat((char *)fname, &st) < 0)
1010 -                       vim_rename(backup, fname);
1011 -                   /* if original file does exist throw away the copy */
1012 -                   if (mch_stat((char *)fname, &st) >= 0)
1013 -                       mch_remove(backup);
1014 -               }
1015 -               else
1016 -               {
1017 -                   /* try to put the original file back */
1018 -                   vim_rename(backup, fname);
1019 -               }
1020 -           }
1021 -
1022 -           /* if original file no longer exists give an extra warning */
1023 -           if (!newfile && mch_stat((char *)fname, &st) < 0)
1024 -               end = 0;
1025 -       }
1026 +                        /* we write to the file, thus it should be marked
1027 +                           writable after all */
1028 +                        if (!(perm & 0200))
1029 +                            made_writable = TRUE;
1030 +                        perm |= 0200;
1031 +                        if (st_old.st_uid != getuid() || st_old.st_gid != getgid())
1032 +                            perm &= 0777;
1033 +#endif
1034 +                        if (!append)       /* don't remove when appending */
1035 +                            mch_remove(wfname);
1036 +                        continue;
1037 +                    }
1038 +                }
1039 +            }
1040 +
1041 +    restore_backup:
1042 +            {
1043 +                struct stat st;
1044 +
1045 +                /*
1046 +                 * If we failed to open the file, we don't need a backup. Throw it
1047 +                 * away.  If we moved or removed the original file try to put the
1048 +                 * backup in its place.
1049 +                 */
1050 +                if (backup != NULL && wfname == fname)
1051 +                {
1052 +                    if (backup_copy)
1053 +                    {
1054 +                        /*
1055 +                         * There is a small chance that we removed the original,
1056 +                         * try to move the copy in its place.
1057 +                         * This may not work if the vim_rename() fails.
1058 +                         * In that case we leave the copy around.
1059 +                         */
1060 +                        /* If file does not exist, put the copy in its place */
1061 +                        if (mch_stat((char *)fname, &st) < 0)
1062 +                            vim_rename(backup, fname);
1063 +                        /* if original file does exist throw away the copy */
1064 +                        if (mch_stat((char *)fname, &st) >= 0)
1065 +                            mch_remove(backup);
1066 +                    }
1067 +                    else
1068 +                    {
1069 +                        /* try to put the original file back */
1070 +                        vim_rename(backup, fname);
1071 +                    }
1072 +                }
1073 +
1074 +                /* if original file no longer exists give an extra warning */
1075 +                if (!newfile && mch_stat((char *)fname, &st) < 0)
1076 +                    end = 0;
1077 +            }
1078  
1079  #ifdef FEAT_MBYTE
1080 -       if (wfname != fname)
1081 -           vim_free(wfname);
1082 +            if (wfname != fname)
1083 +                vim_free(wfname);
1084  #endif
1085 -       goto fail;
1086 +            goto fail;
1087 +        }
1088 +        errmsg = NULL;
1089      }
1090 -    errmsg = NULL;
1091  
1092  #if defined(MACOS_CLASSIC) || defined(WIN3264)
1093      /* TODO: Is it need for MACOS_X? (Dany) */
1094 @@ -3693,7 +3724,7 @@
1095         nchars += len;
1096      }
1097  
1098 -    if (close(fd) != 0)
1099 +    if (!write_pstream && close(fd) != 0)
1100      {
1101         errmsg = (char_u *)_("E512: Close failed");
1102         end = 0;
1103 @@ -4111,6 +4142,10 @@
1104      buf_T      *buf;
1105      char_u     *fname;
1106  {
1107 +#ifdef FEAT_GUI_COMPONENT
1108 +    if (buf->emb_buffer)
1109 +        fname = (char_u *)"[Embedded File]";
1110 +#endif
1111      if (fname == NULL)
1112         fname = (char_u *)"-stdin-";
1113      home_replace(buf, fname, IObuff + 1, IOSIZE - 4, TRUE);
1114 @@ -4499,7 +4534,12 @@
1115      /* Repeat the write(), it may be interrupted by a signal. */
1116      while (len)
1117      {
1118 -       wlen = vim_write(ip->bw_fd, buf, len);
1119 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
1120 +        if( write_to_container )
1121 +            wlen = vim_control_persist_stream_write(buf, len);
1122 +        else
1123 +#endif
1124 +            wlen = vim_write(ip->bw_fd, buf, len);
1125         if (wlen <= 0)              /* error! */
1126             return FAIL;
1127         len -= wlen;
1128 @@ -6086,6 +6126,7 @@
1129      {"BufWriteCmd",    EVENT_BUFWRITECMD},
1130      {"CmdwinEnter",    EVENT_CMDWINENTER},
1131      {"CmdwinLeave",    EVENT_CMDWINLEAVE},
1132 +    {"EmbeddingOn",    EVENT_EMBEDDED_COMPONENT},
1133      {"EncodingChanged",        EVENT_ENCODINGCHANGED},
1134      {"FileEncoding",   EVENT_ENCODINGCHANGED},
1135      {"CursorHold",     EVENT_CURSORHOLD},
1136 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/globals.h vim/src/globals.h
1137 --- vimcopy/src/globals.h       Sat Jan 10 13:10:01 2004
1138 +++ vim/src/globals.h   Sat Jan 10 13:06:42 2004
1139 @@ -802,6 +802,12 @@
1140  EXTERN int     readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
1141  EXTERN int     recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
1142  
1143 +#ifdef FEAT_GUI_COMPONENT
1144 +EXTERN int      read_from_container INIT(= 0); /* read the buffer from the container app */
1145 +EXTERN int      write_to_container INIT(= 0); /* write the buffer to the container app */
1146 +EXTERN buf_T    *persistent_buffer INIT(= NULL); /* the buffer which the container is interested in */
1147 +#endif
1148 +
1149  EXTERN struct buffheader stuffbuff     /* stuff buffer */
1150  #ifdef DO_INIT
1151                     = {{NULL, {NUL}}, NULL, 0, 0}
1152 @@ -1322,6 +1328,9 @@
1153  #endif
1154  #ifdef FEAT_NETBEANS_INTG
1155  EXTERN char_u e_guarded[]      INIT(=N_("E463: Region is guarded, cannot modify"));
1156 +#endif
1157 +#ifdef FEAT_GUI_COMPONENT
1158 +EXTERN char_u e_compnoquit[]   INIT(=N_("E464: Quit not allowed from embedded component"));
1159  #endif
1160  #ifdef MACOS_X_UNIX
1161  EXTERN short disallow_gui      INIT(= FALSE);
1162 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml.h vim/src/gtkhtml.h
1163 --- vimcopy/src/gtkhtml.h       Wed Dec 31 18:00:00 1969
1164 +++ vim/src/gtkhtml.h   Sat Jul 26 13:16:47 2003
1165 @@ -0,0 +1,480 @@
1166 +/*
1167 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
1168 + */
1169 +
1170 +#ifndef Editor_H
1171 +#define Editor_H 1
1172 +#include <glib.h>
1173 +#define ORBIT_IDL_SERIAL 19
1174 +#include <orbit/orbit-types.h>
1175 +
1176 +#ifdef __cplusplus
1177 +extern "C"
1178 +{
1179 +#endif                         /* __cplusplus */
1180 +
1181 +/** typedefs **/
1182 +#include <bonobo/Bonobo.h>
1183 +#if !defined(ORBIT_DECL_GNOME_GtkHTML_Editor_Listener) && !defined(_GNOME_GtkHTML_Editor_Listener_defined)
1184 +#define ORBIT_DECL_GNOME_GtkHTML_Editor_Listener 1
1185 +#define _GNOME_GtkHTML_Editor_Listener_defined 1
1186 +#define GNOME_GtkHTML_Editor_Listener__freekids CORBA_Object__freekids
1187 +   typedef CORBA_Object GNOME_GtkHTML_Editor_Listener;
1188 +   extern CORBA_unsigned_long GNOME_GtkHTML_Editor_Listener__classid;
1189 +#if !defined(TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_0)
1190 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_0 'E'
1191 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_1 'd'
1192 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_2 'i'
1193 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_3 't'
1194 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_4 'o'
1195 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_5 'r'
1196 +#ifdef ORBIT_IDL_C_IMODULE
1197 +   static
1198 +#else
1199 +   extern
1200 +#endif
1201 +   const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Listener_struct;
1202 +#define TC_GNOME_GtkHTML_Editor_Listener ((CORBA_TypeCode)&TC_GNOME_GtkHTML_Editor_Listener_struct)
1203 +#endif
1204 +#endif
1205 +#if !defined(ORBIT_DECL_GNOME_GtkHTML_Editor_Engine) && !defined(_GNOME_GtkHTML_Editor_Engine_defined)
1206 +#define ORBIT_DECL_GNOME_GtkHTML_Editor_Engine 1
1207 +#define _GNOME_GtkHTML_Editor_Engine_defined 1
1208 +#define GNOME_GtkHTML_Editor_Engine__freekids CORBA_Object__freekids
1209 +   typedef CORBA_Object GNOME_GtkHTML_Editor_Engine;
1210 +   extern CORBA_unsigned_long GNOME_GtkHTML_Editor_Engine__classid;
1211 +#if !defined(TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_0)
1212 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_0 'E'
1213 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_1 'd'
1214 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_2 'i'
1215 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_3 't'
1216 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_4 'o'
1217 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_5 'r'
1218 +#ifdef ORBIT_IDL_C_IMODULE
1219 +   static
1220 +#else
1221 +   extern
1222 +#endif
1223 +   const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Engine_struct;
1224 +#define TC_GNOME_GtkHTML_Editor_Engine ((CORBA_TypeCode)&TC_GNOME_GtkHTML_Editor_Engine_struct)
1225 +#endif
1226 +#endif
1227 +#if !defined(_GNOME_GtkHTML_Editor_URLRequestEvent_defined)
1228 +#define _GNOME_GtkHTML_Editor_URLRequestEvent_defined 1
1229 +   typedef struct GNOME_GtkHTML_Editor_URLRequestEvent_type
1230 +      GNOME_GtkHTML_Editor_URLRequestEvent;
1231 +   struct GNOME_GtkHTML_Editor_URLRequestEvent_type
1232 +   {
1233 +      CORBA_string url;
1234 +      Bonobo_Stream stream;
1235 +   };
1236 +
1237 +#if !defined(TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_0)
1238 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_0 'E'
1239 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_1 'd'
1240 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_2 'i'
1241 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_3 't'
1242 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_4 'o'
1243 +#define TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_5 'r'
1244 +#ifdef ORBIT_IDL_C_IMODULE
1245 +   static
1246 +#else
1247 +   extern
1248 +#endif
1249 +   const struct CORBA_TypeCode_struct
1250 +      TC_GNOME_GtkHTML_Editor_URLRequestEvent_struct;
1251 +#define TC_GNOME_GtkHTML_Editor_URLRequestEvent ((CORBA_TypeCode)&TC_GNOME_GtkHTML_Editor_URLRequestEvent_struct)
1252 +#endif
1253 +#define GNOME_GtkHTML_Editor_URLRequestEvent__alloc() ((GNOME_GtkHTML_Editor_URLRequestEvent *)ORBit_small_alloc (TC_GNOME_GtkHTML_Editor_URLRequestEvent))
1254 +#define GNOME_GtkHTML_Editor_URLRequestEvent__freekids(m,d) ORBit_small_freekids (TC_GNOME_GtkHTML_Editor_URLRequestEvent,(m),(d))
1255 +#endif
1256 +
1257 +/** POA structures **/
1258 +#ifndef _defined_POA_GNOME_GtkHTML_Editor_Listener
1259 +#define _defined_POA_GNOME_GtkHTML_Editor_Listener 1
1260 +   typedef struct
1261 +   {
1262 +      void *_private;
1263 +      CORBA_any *(*event) (PortableServer_Servant _servant,
1264 +                          const CORBA_char * name, const CORBA_any * arg,
1265 +                          CORBA_Environment * ev);
1266 +   }
1267 +   POA_GNOME_GtkHTML_Editor_Listener__epv;
1268 +   typedef struct
1269 +   {
1270 +      PortableServer_ServantBase__epv *_base_epv;
1271 +      POA_Bonobo_Unknown__epv *Bonobo_Unknown_epv;
1272 +      POA_GNOME_GtkHTML_Editor_Listener__epv
1273 +        *GNOME_GtkHTML_Editor_Listener_epv;
1274 +   }
1275 +   POA_GNOME_GtkHTML_Editor_Listener__vepv;
1276 +   typedef struct
1277 +   {
1278 +      void *_private;
1279 +      POA_GNOME_GtkHTML_Editor_Listener__vepv *vepv;
1280 +   }
1281 +   POA_GNOME_GtkHTML_Editor_Listener;
1282 +   extern void POA_GNOME_GtkHTML_Editor_Listener__init(PortableServer_Servant
1283 +                                                      servant,
1284 +                                                      CORBA_Environment *
1285 +                                                      ev);
1286 +   extern void POA_GNOME_GtkHTML_Editor_Listener__fini(PortableServer_Servant
1287 +                                                      servant,
1288 +                                                      CORBA_Environment *
1289 +                                                      ev);
1290 +#endif                         /* _defined_POA_GNOME_GtkHTML_Editor_Listener */
1291 +#ifndef _defined_POA_GNOME_GtkHTML_Editor_Engine
1292 +#define _defined_POA_GNOME_GtkHTML_Editor_Engine 1
1293 +   typedef struct
1294 +   {
1295 +      void *_private;
1296 +       GNOME_GtkHTML_Editor_Listener(*_get_listener) (PortableServer_Servant
1297 +                                                     _servant,
1298 +                                                     CORBA_Environment * ev);
1299 +      void (*_set_listener) (PortableServer_Servant _servant,
1300 +                            const GNOME_GtkHTML_Editor_Listener value,
1301 +                            CORBA_Environment * ev);
1302 +       CORBA_boolean(*runCommand) (PortableServer_Servant _servant,
1303 +                                  const CORBA_char * command,
1304 +                                  CORBA_Environment * ev);
1305 +       CORBA_string(*getParagraphData) (PortableServer_Servant _servant,
1306 +                                       const CORBA_char * key,
1307 +                                       CORBA_Environment * ev);
1308 +      void (*setParagraphData) (PortableServer_Servant _servant,
1309 +                               const CORBA_char * key,
1310 +                               const CORBA_char * value,
1311 +                               CORBA_Environment * ev);
1312 +      void (*setObjectDataByType) (PortableServer_Servant _servant,
1313 +                                  const CORBA_char * type_name,
1314 +                                  const CORBA_char * key,
1315 +                                  const CORBA_char * data,
1316 +                                  CORBA_Environment * ev);
1317 +       CORBA_boolean(*searchByData) (PortableServer_Servant _servant,
1318 +                                    const CORBA_long level,
1319 +                                    const CORBA_char * klass,
1320 +                                    const CORBA_char * key,
1321 +                                    const CORBA_char * value,
1322 +                                    CORBA_Environment * ev);
1323 +       CORBA_boolean(*isParagraphEmpty) (PortableServer_Servant _servant,
1324 +                                        CORBA_Environment * ev);
1325 +       CORBA_boolean(*isPreviousParagraphEmpty) (PortableServer_Servant
1326 +                                                _servant,
1327 +                                                CORBA_Environment * ev);
1328 +      void (*insertHTML) (PortableServer_Servant _servant,
1329 +                         const CORBA_char * html, CORBA_Environment * ev);
1330 +      void (*freeze) (PortableServer_Servant _servant,
1331 +                     CORBA_Environment * ev);
1332 +      void (*thaw) (PortableServer_Servant _servant, CORBA_Environment * ev);
1333 +      void (*undoBegin) (PortableServer_Servant _servant,
1334 +                        const CORBA_char * undo_name,
1335 +                        const CORBA_char * redo_name,
1336 +                        CORBA_Environment * ev);
1337 +      void (*undoEnd) (PortableServer_Servant _servant,
1338 +                      CORBA_Environment * ev);
1339 +      void (*ignoreWord) (PortableServer_Servant _servant,
1340 +                         const CORBA_char * word, CORBA_Environment * ev);
1341 +      void (*dropUndo) (PortableServer_Servant _servant,
1342 +                       CORBA_Environment * ev);
1343 +       CORBA_boolean(*hasUndo) (PortableServer_Servant _servant,
1344 +                               CORBA_Environment * ev);
1345 +   }
1346 +   POA_GNOME_GtkHTML_Editor_Engine__epv;
1347 +   typedef struct
1348 +   {
1349 +      PortableServer_ServantBase__epv *_base_epv;
1350 +      POA_Bonobo_Unknown__epv *Bonobo_Unknown_epv;
1351 +      POA_GNOME_GtkHTML_Editor_Engine__epv *GNOME_GtkHTML_Editor_Engine_epv;
1352 +   }
1353 +   POA_GNOME_GtkHTML_Editor_Engine__vepv;
1354 +   typedef struct
1355 +   {
1356 +      void *_private;
1357 +      POA_GNOME_GtkHTML_Editor_Engine__vepv *vepv;
1358 +   }
1359 +   POA_GNOME_GtkHTML_Editor_Engine;
1360 +   extern void POA_GNOME_GtkHTML_Editor_Engine__init(PortableServer_Servant
1361 +                                                    servant,
1362 +                                                    CORBA_Environment * ev);
1363 +   extern void POA_GNOME_GtkHTML_Editor_Engine__fini(PortableServer_Servant
1364 +                                                    servant,
1365 +                                                    CORBA_Environment * ev);
1366 +#endif                         /* _defined_POA_GNOME_GtkHTML_Editor_Engine */
1367 +
1368 +/** skel prototypes **/
1369 +   void
1370 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Listener_event
1371 +      (POA_GNOME_GtkHTML_Editor_Listener * _ORBIT_servant,
1372 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1373 +       CORBA_Environment * ev,
1374 +       CORBA_any * (*_impl_event) (PortableServer_Servant _servant,
1375 +                                  const CORBA_char * name,
1376 +                                  const CORBA_any * arg,
1377 +                                  CORBA_Environment * ev));
1378 +   void
1379 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__get_listener
1380 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1381 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1382 +       CORBA_Environment * ev,
1383 +       GNOME_GtkHTML_Editor_Listener(*_impl__get_listener)
1384 +       (PortableServer_Servant _servant, CORBA_Environment * ev));
1385 +   void
1386 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__set_listener
1387 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1388 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1389 +       CORBA_Environment * ev,
1390 +       void (*_impl__set_listener) (PortableServer_Servant _servant,
1391 +                                   const GNOME_GtkHTML_Editor_Listener value,
1392 +                                   CORBA_Environment * ev));
1393 +   void
1394 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_runCommand
1395 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1396 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1397 +       CORBA_Environment * ev,
1398 +       CORBA_boolean(*_impl_runCommand) (PortableServer_Servant _servant,
1399 +                                        const CORBA_char * command,
1400 +                                        CORBA_Environment * ev));
1401 +   void
1402 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_getParagraphData
1403 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1404 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1405 +       CORBA_Environment * ev,
1406 +       CORBA_string(*_impl_getParagraphData) (PortableServer_Servant _servant,
1407 +                                             const CORBA_char * key,
1408 +                                             CORBA_Environment * ev));
1409 +   void
1410 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setParagraphData
1411 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1412 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1413 +       CORBA_Environment * ev,
1414 +       void (*_impl_setParagraphData) (PortableServer_Servant _servant,
1415 +                                      const CORBA_char * key,
1416 +                                      const CORBA_char * value,
1417 +                                      CORBA_Environment * ev));
1418 +   void
1419 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setObjectDataByType
1420 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1421 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1422 +       CORBA_Environment * ev,
1423 +       void (*_impl_setObjectDataByType) (PortableServer_Servant _servant,
1424 +                                         const CORBA_char * type_name,
1425 +                                         const CORBA_char * key,
1426 +                                         const CORBA_char * data,
1427 +                                         CORBA_Environment * ev));
1428 +   void
1429 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_searchByData
1430 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1431 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1432 +       CORBA_Environment * ev,
1433 +       CORBA_boolean(*_impl_searchByData) (PortableServer_Servant _servant,
1434 +                                          const CORBA_long level,
1435 +                                          const CORBA_char * klass,
1436 +                                          const CORBA_char * key,
1437 +                                          const CORBA_char * value,
1438 +                                          CORBA_Environment * ev));
1439 +   void
1440 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isParagraphEmpty
1441 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1442 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1443 +       CORBA_Environment * ev,
1444 +       CORBA_boolean(*_impl_isParagraphEmpty) (PortableServer_Servant
1445 +                                              _servant,
1446 +                                              CORBA_Environment * ev));
1447 +   void
1448 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
1449 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1450 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1451 +       CORBA_Environment * ev,
1452 +       CORBA_boolean(*_impl_isPreviousParagraphEmpty) (PortableServer_Servant
1453 +                                                      _servant,
1454 +                                                      CORBA_Environment *
1455 +                                                      ev));
1456 +   void
1457 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_insertHTML
1458 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1459 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1460 +       CORBA_Environment * ev,
1461 +       void (*_impl_insertHTML) (PortableServer_Servant _servant,
1462 +                                const CORBA_char * html,
1463 +                                CORBA_Environment * ev));
1464 +   void
1465 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_freeze
1466 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1467 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1468 +       CORBA_Environment * ev,
1469 +       void (*_impl_freeze) (PortableServer_Servant _servant,
1470 +                            CORBA_Environment * ev));
1471 +   void
1472 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_thaw
1473 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1474 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1475 +       CORBA_Environment * ev,
1476 +       void (*_impl_thaw) (PortableServer_Servant _servant,
1477 +                          CORBA_Environment * ev));
1478 +   void
1479 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoBegin
1480 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1481 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1482 +       CORBA_Environment * ev,
1483 +       void (*_impl_undoBegin) (PortableServer_Servant _servant,
1484 +                               const CORBA_char * undo_name,
1485 +                               const CORBA_char * redo_name,
1486 +                               CORBA_Environment * ev));
1487 +   void
1488 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoEnd
1489 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1490 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1491 +       CORBA_Environment * ev,
1492 +       void (*_impl_undoEnd) (PortableServer_Servant _servant,
1493 +                             CORBA_Environment * ev));
1494 +   void
1495 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_ignoreWord
1496 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1497 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1498 +       CORBA_Environment * ev,
1499 +       void (*_impl_ignoreWord) (PortableServer_Servant _servant,
1500 +                                const CORBA_char * word,
1501 +                                CORBA_Environment * ev));
1502 +   void
1503 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_dropUndo
1504 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1505 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1506 +       CORBA_Environment * ev,
1507 +       void (*_impl_dropUndo) (PortableServer_Servant _servant,
1508 +                              CORBA_Environment * ev));
1509 +   void
1510 +      _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_hasUndo
1511 +      (POA_GNOME_GtkHTML_Editor_Engine * _ORBIT_servant,
1512 +       gpointer _ORBIT_retval, gpointer * _ORBIT_args, CORBA_Context ctx,
1513 +       CORBA_Environment * ev,
1514 +       CORBA_boolean(*_impl_hasUndo) (PortableServer_Servant _servant,
1515 +                                     CORBA_Environment * ev));
1516 +
1517 +/** stub prototypes **/
1518 +#define GNOME_GtkHTML_Editor_Listener_ref Bonobo_Unknown_ref
1519 +#define GNOME_GtkHTML_Editor_Listener_unref Bonobo_Unknown_unref
1520 +#define GNOME_GtkHTML_Editor_Listener_queryInterface Bonobo_Unknown_queryInterface
1521 +   CORBA_any
1522 +      *GNOME_GtkHTML_Editor_Listener_event(GNOME_GtkHTML_Editor_Listener _obj,
1523 +                                          const CORBA_char * name,
1524 +                                          const CORBA_any * arg,
1525 +                                          CORBA_Environment * ev);
1526 +#define GNOME_GtkHTML_Editor_Engine_ref Bonobo_Unknown_ref
1527 +#define GNOME_GtkHTML_Editor_Engine_unref Bonobo_Unknown_unref
1528 +#define GNOME_GtkHTML_Editor_Engine_queryInterface Bonobo_Unknown_queryInterface
1529 +   GNOME_GtkHTML_Editor_Listener
1530 +      GNOME_GtkHTML_Editor_Engine__get_listener(GNOME_GtkHTML_Editor_Engine
1531 +                                               _obj, CORBA_Environment * ev);
1532 +   void GNOME_GtkHTML_Editor_Engine__set_listener(GNOME_GtkHTML_Editor_Engine
1533 +                                                 _obj,
1534 +                                                 const
1535 +                                                 GNOME_GtkHTML_Editor_Listener
1536 +                                                 value,
1537 +                                                 CORBA_Environment * ev);
1538 +   CORBA_boolean
1539 +      GNOME_GtkHTML_Editor_Engine_runCommand(GNOME_GtkHTML_Editor_Engine _obj,
1540 +                                            const CORBA_char * command,
1541 +                                            CORBA_Environment * ev);
1542 +   CORBA_string
1543 +      GNOME_GtkHTML_Editor_Engine_getParagraphData(GNOME_GtkHTML_Editor_Engine
1544 +                                                  _obj,
1545 +                                                  const CORBA_char * key,
1546 +                                                  CORBA_Environment * ev);
1547 +   void
1548 +      GNOME_GtkHTML_Editor_Engine_setParagraphData(GNOME_GtkHTML_Editor_Engine
1549 +                                                  _obj,
1550 +                                                  const CORBA_char * key,
1551 +                                                  const CORBA_char * value,
1552 +                                                  CORBA_Environment * ev);
1553 +   void
1554 +      GNOME_GtkHTML_Editor_Engine_setObjectDataByType
1555 +      (GNOME_GtkHTML_Editor_Engine _obj, const CORBA_char * type_name,
1556 +       const CORBA_char * key, const CORBA_char * data,
1557 +       CORBA_Environment * ev);
1558 +   CORBA_boolean
1559 +      GNOME_GtkHTML_Editor_Engine_searchByData(GNOME_GtkHTML_Editor_Engine
1560 +                                              _obj, const CORBA_long level,
1561 +                                              const CORBA_char * klass,
1562 +                                              const CORBA_char * key,
1563 +                                              const CORBA_char * value,
1564 +                                              CORBA_Environment * ev);
1565 +   CORBA_boolean
1566 +      GNOME_GtkHTML_Editor_Engine_isParagraphEmpty(GNOME_GtkHTML_Editor_Engine
1567 +                                                  _obj,
1568 +                                                  CORBA_Environment * ev);
1569 +   CORBA_boolean
1570 +      GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
1571 +      (GNOME_GtkHTML_Editor_Engine _obj, CORBA_Environment * ev);
1572 +   void GNOME_GtkHTML_Editor_Engine_insertHTML(GNOME_GtkHTML_Editor_Engine
1573 +                                              _obj, const CORBA_char * html,
1574 +                                              CORBA_Environment * ev);
1575 +   void GNOME_GtkHTML_Editor_Engine_freeze(GNOME_GtkHTML_Editor_Engine _obj,
1576 +                                          CORBA_Environment * ev);
1577 +   void GNOME_GtkHTML_Editor_Engine_thaw(GNOME_GtkHTML_Editor_Engine _obj,
1578 +                                        CORBA_Environment * ev);
1579 +   void GNOME_GtkHTML_Editor_Engine_undoBegin(GNOME_GtkHTML_Editor_Engine
1580 +                                             _obj,
1581 +                                             const CORBA_char * undo_name,
1582 +                                             const CORBA_char * redo_name,
1583 +                                             CORBA_Environment * ev);
1584 +   void GNOME_GtkHTML_Editor_Engine_undoEnd(GNOME_GtkHTML_Editor_Engine _obj,
1585 +                                           CORBA_Environment * ev);
1586 +   void GNOME_GtkHTML_Editor_Engine_ignoreWord(GNOME_GtkHTML_Editor_Engine
1587 +                                              _obj, const CORBA_char * word,
1588 +                                              CORBA_Environment * ev);
1589 +   void GNOME_GtkHTML_Editor_Engine_dropUndo(GNOME_GtkHTML_Editor_Engine _obj,
1590 +                                            CORBA_Environment * ev);
1591 +   CORBA_boolean
1592 +      GNOME_GtkHTML_Editor_Engine_hasUndo(GNOME_GtkHTML_Editor_Engine _obj,
1593 +                                         CORBA_Environment * ev);
1594 +
1595 +/** more internals **/
1596 +#if !defined(MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_0)
1597 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_0 'E'
1598 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_1 'd'
1599 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_2 'i'
1600 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_3 't'
1601 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_4 'o'
1602 +#define MARSHAL_IMPL_GNOME_GtkHTML_Editor_URLRequestEvent_5 'r'
1603 +#endif
1604 +#include <orbit/orb-core/orbit-interface.h>
1605 +
1606 +#ifdef ORBIT_IDL_C_IMODULE
1607 +   static
1608 +#else
1609 +   extern
1610 +#endif
1611 +   ORBit_IInterface GNOME_GtkHTML_Editor_Listener__iinterface;
1612 +#define GNOME_GtkHTML_Editor_Listener_IMETHODS_LEN 1
1613 +#ifdef ORBIT_IDL_C_IMODULE
1614 +   static
1615 +#else
1616 +   extern
1617 +#endif
1618 +   ORBit_IMethod
1619 +      GNOME_GtkHTML_Editor_Listener__imethods
1620 +      [GNOME_GtkHTML_Editor_Listener_IMETHODS_LEN];
1621 +#ifdef ORBIT_IDL_C_IMODULE
1622 +   static
1623 +#else
1624 +   extern
1625 +#endif
1626 +   ORBit_IInterface GNOME_GtkHTML_Editor_Engine__iinterface;
1627 +#define GNOME_GtkHTML_Editor_Engine_IMETHODS_LEN 17
1628 +#ifdef ORBIT_IDL_C_IMODULE
1629 +   static
1630 +#else
1631 +   extern
1632 +#endif
1633 +   ORBit_IMethod
1634 +      GNOME_GtkHTML_Editor_Engine__imethods
1635 +      [GNOME_GtkHTML_Editor_Engine_IMETHODS_LEN];
1636 +#ifdef __cplusplus
1637 +}
1638 +#endif                         /* __cplusplus */
1639 +
1640 +#ifndef EXCLUDE_ORBIT_H
1641 +#include <orbit/orbit.h>
1642 +
1643 +#endif                         /* EXCLUDE_ORBIT_H */
1644 +#endif
1645 +#undef ORBIT_IDL_SERIAL
1646 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor.c vim/src/gtkhtml_editor.c
1647 --- vimcopy/src/gtkhtml_editor.c        Wed Dec 31 18:00:00 1969
1648 +++ vim/src/gtkhtml_editor.c    Sat Nov  1 18:19:52 2003
1649 @@ -0,0 +1,385 @@
1650 +#include "vim.h"
1651 +
1652 +#include <bonobo.h>
1653 +#include "gtkhtml_editor.h"
1654 +
1655 +static BonoboObjectClass *engine_parent_class;
1656 +
1657 +inline static EditorEngine *
1658 +gtkhtml_editor_engine_from_servant (PortableServer_Servant servant)
1659 +{
1660 +       return EDITOR_ENGINE (bonobo_object_from_servant (servant));
1661 +}
1662 +
1663 +static CORBA_char *
1664 +impl_get_paragraph_data (PortableServer_Servant servant, const CORBA_char * key, CORBA_Environment * ev)
1665 +{
1666 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1667 +}
1668 +
1669 +static void
1670 +impl_set_paragraph_data (PortableServer_Servant servant,
1671 +                        const CORBA_char * key, const CORBA_char * value,
1672 +                        CORBA_Environment * ev)
1673 +{
1674 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1675 +}
1676 +
1677 +static void
1678 +impl_set_object_data_by_type (PortableServer_Servant servant,
1679 +                        const CORBA_char * type_name, const CORBA_char * key, const CORBA_char * value,
1680 +                        CORBA_Environment * ev)
1681 +{
1682 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1683 +}
1684 +
1685 +static void
1686 +impl_set_listener (PortableServer_Servant servant, const GNOME_GtkHTML_Editor_Listener value, CORBA_Environment * ev)
1687 +{
1688 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1689 +
1690 +       bonobo_object_release_unref (e->listener, NULL);
1691 +       e->listener        = bonobo_object_dup_ref (value, NULL);
1692 +}
1693 +
1694 +static GNOME_GtkHTML_Editor_Listener
1695 +impl_get_listener (PortableServer_Servant servant, CORBA_Environment * ev)
1696 +{
1697 +       return gtkhtml_editor_engine_from_servant (servant)->listener;
1698 +}
1699 +
1700 +
1701 +
1702 +static CORBA_boolean
1703 +impl_run_command (PortableServer_Servant servant, const CORBA_char * command, CORBA_Environment * ev)
1704 +{
1705 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1706 +       printf ("command: %s\n", command);
1707 +    CORBA_boolean retval = CORBA_TRUE;
1708 +    int save_p_report = p_report;
1709 +
1710 +    p_report = 1000;
1711 +
1712 +    aco_save_T aco;
1713 +    aucmd_prepbuf(&aco, persistent_buffer);
1714 +
1715 +    if( strcmp( command, "cursor-position-save" ) == 0 ) {
1716 +        do_cmdline_cmd("normal mz");
1717 +    } else if( strcmp( command, "cursor-position-restore" ) == 0 ) {
1718 +        do_cmdline_cmd("normal 'z");
1719 +        update_screen(CLEAR);
1720 +        gui_update_cursor(TRUE, FALSE);
1721 +    } else if( strcmp( command, "cursor-bod" ) == 0 ) {
1722 +        do_cmdline_cmd("normal G");
1723 +    } else if( strcmp( command, "select-paragraph" ) == 0 ) {
1724 +        do_cmdline_cmd("normal V}");
1725 +    } else if( strcmp( command, "delete" ) == 0 ) {
1726 +        do_cmdline_cmd("normal d");
1727 +    } else if( strcmp( command, "is-saved" ) == 0 ) {
1728 +        retval = !persistent_buffer->b_changed;
1729 +    } else if( strcmp( command, "insert-paragraph" ) == 0 ) {
1730 +        do_cmdline_cmd("normal o");
1731 +    }
1732 +    aucmd_restbuf(&aco);
1733 +    p_report = save_p_report;
1734 +       return retval;
1735 +}
1736 +
1737 +static CORBA_boolean
1738 +impl_is_paragraph_empty (PortableServer_Servant servant, CORBA_Environment * ev)
1739 +{
1740 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1741 +       return CORBA_FALSE;
1742 +}
1743 +
1744 +static CORBA_boolean
1745 +impl_is_previous_paragraph_empty (PortableServer_Servant servant, CORBA_Environment * ev)
1746 +{
1747 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1748 +       return CORBA_FALSE;
1749 +}
1750 +
1751 +struct keyvalue {
1752 +    char * key;
1753 +    char * value;
1754 +    char mark;
1755 +};
1756 +
1757 +static GSList * keylist = NULL;
1758 +static char free_mark = 'y';
1759 +
1760 +static void set_mark_at_cursor( char * key, char * value ) 
1761 +{
1762 +    char cmd[5];
1763 +    struct keyvalue * kv = NULL;
1764 +    GSList * node = keylist;
1765 +    while( node != NULL ) {
1766 +        kv = node->data; 
1767 +        if( strcmp( kv->key, key ) == 0 && strcmp( kv->value, value ) == 0 ) {
1768 +            break;
1769 +        }
1770 +        node = node->next;
1771 +    }
1772 +    if( kv == NULL ) {
1773 +        kv = g_new0( struct keyvalue, 1 );
1774 +        kv->key = g_strdup( key );
1775 +        kv->value = g_strdup( value );
1776 +
1777 +        kv->mark = free_mark;
1778 +        free_mark -= 1;
1779 +        keylist = g_slist_prepend( keylist, kv );
1780 +    }
1781 +
1782 +    setmark(kv->mark);
1783 +}
1784 +
1785 +static void
1786 +impl_insert_html (PortableServer_Servant servant, const CORBA_char * html, CORBA_Environment * ev)
1787 +{
1788 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1789 +    const char * c;
1790 +    const char * s;
1791 +    char * d;
1792 +    int level = 0;
1793 +    gboolean in_data = 0;
1794 +    char key[50];
1795 +    char value[50];
1796 +    char cmd[50];
1797 +    gchar **lines;
1798 +    int curline;
1799 +    int begin;
1800 +    int i;
1801 +
1802 +       g_warning("insert html: \"%s\"", html ); 
1803 +    
1804 +    aco_save_T aco;
1805 +    aucmd_prepbuf(&aco, persistent_buffer);
1806 +
1807 +    // This gets a bit ugly...
1808 +    // Look for DATA tags with KEY and VALUE attributes.  We set a mark
1809 +    // in vim on the first line of the inserted HTML if one of these tags is present
1810 +    // (we assume that they occur at the beginning of the inserted paragraph).
1811 +    // we also assume that only one of these sequences will occur in the html.
1812 +    strcpy( key, "" );
1813 +    strcpy( value, "" );
1814 +    for( c = html; *c != '\0'; c++ ) {
1815 +        if( *c == '<' ) {
1816 +            level += 1;
1817 +            if( strncmp( c, "<DATA", 5 ) == 0 ) {
1818 +                in_data = TRUE;
1819 +            }
1820 +        } else if( *c == '>' ) {
1821 +            level -= 1;
1822 +            if( in_data ) {
1823 +                if( *key && *value ) {
1824 +                    g_warning( "got key=%s and value=%s", key, value );
1825 +                }
1826 +                in_data = FALSE;
1827 +            }
1828 +        } else if( in_data && strncmp( c, "key=", 4 ) == 0 ) {
1829 +            // extract the key
1830 +            d = key;
1831 +            for( s = &c[4]; *s != '\"'; s++ );
1832 +            s++;
1833 +            for( ; *s != '\"'; s++ ) {
1834 +                *d++ = *s; 
1835 +            }
1836 +            *d = '\0';
1837 +        } else if( in_data && strncmp( c, "value=", 6 ) == 0 ) {
1838 +            // extract the value
1839 +            d = value;
1840 +            for( s = &c[4]; *s != '\"'; s++ );
1841 +            s++;
1842 +            for( ; *s != '\"'; s++ ) {
1843 +                *d++ = *s; 
1844 +            }
1845 +            *d = '\0';
1846 +        }
1847 +    }
1848 +
1849 +    /* insert the html into the buffer, remembering the starting line */
1850 +    begin = curwin->w_cursor.lnum;
1851 +    curline = begin;
1852 +    lines = g_strsplit(html, "\n", 0);
1853 +    for(i = 0; lines[i]; i += 1) {
1854 +        ml_append(curline, lines[i], strlen(html) + 1, FALSE); 
1855 +        appended_lines_mark(curwin->w_cursor.lnum, 1);
1856 +        curline += 1;
1857 +    }
1858 +    g_strfreev(lines);
1859 +
1860 +    /* run a filter to obtain plain text from the html */
1861 +    vim_bonobo_call_begin();
1862 +    g_snprintf( cmd, 50, "%d,%d!html2text -nobs", begin, curline);
1863 +    do_cmdline_cmd(cmd);
1864 +    vim_bonobo_call_end();
1865 +    if( *key && *value ) {
1866 +        set_mark_at_cursor( key, value );
1867 +    }
1868 +    aucmd_restbuf(&aco);
1869 +}
1870 +
1871 +static CORBA_boolean
1872 +impl_search_by_data (PortableServer_Servant servant, const CORBA_long level, const CORBA_char * klass,
1873 +                    const CORBA_char * key, const CORBA_char * value, CORBA_Environment * ev)
1874 +{
1875 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1876 +
1877 +    GSList * node = keylist;
1878 +    struct keyvalue * kv = NULL;
1879 +    char cmd[15];
1880 +    char * data;
1881 +    aco_save_T aco;
1882 +    int retval = FALSE;
1883 +
1884 +    aucmd_prepbuf(&aco, persistent_buffer);
1885 +
1886 +       g_warning("search by data: key=\"%s\" value=\"%s\"", key, value ); 
1887 +    while( node != NULL ) {
1888 +        kv = node->data; 
1889 +        if( strcmp( kv->key, key ) == 0 && strcmp( kv->value, value ) == 0 ) {
1890 +            break;
1891 +        }
1892 +        node = node->next;
1893 +    }
1894 +    if( kv != NULL ) {
1895 +        pos_T *pos;
1896 +
1897 +        pos = getmark(kv->mark, FALSE);
1898 +        if( pos->lnum != 0 ) {
1899 +            /* jump to the mark in the text */
1900 +            g_snprintf( cmd, 15, "normal '%c", kv->mark );
1901 +            do_cmdline_cmd( cmd );
1902 +            g_warning( "Found key!" );
1903 +            retval = TRUE;
1904 +        } else {
1905 +            g_warning( "Key not found" );
1906 +            // mark not found.  Delete it from our list.
1907 +            g_free( kv->key );
1908 +            g_free( kv->value );
1909 +            g_free( kv );
1910 +            keylist = g_slist_remove( keylist, kv );
1911 +        }
1912 +    }
1913 +    aucmd_restbuf(&aco);
1914 +       return retval;
1915 +}
1916 +
1917 +static void
1918 +impl_freeze (PortableServer_Servant servant, CORBA_Environment * ev)
1919 +{
1920 +}
1921 +
1922 +static void
1923 +impl_thaw (PortableServer_Servant servant, CORBA_Environment * ev)
1924 +{
1925 +}
1926 +
1927 +static void
1928 +impl_undo_begin (PortableServer_Servant servant, const CORBA_char * undo_name, const CORBA_char * redo_name,
1929 +                CORBA_Environment * ev)
1930 +{
1931 +}
1932 +
1933 +static void
1934 +impl_undo_end (PortableServer_Servant servant, CORBA_Environment * ev)
1935 +{
1936 +}
1937 +
1938 +static void
1939 +impl_ignore_word (PortableServer_Servant servant, const CORBA_char * word, CORBA_Environment * ev)
1940 +{
1941 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1942 +}
1943 +
1944 +/* Return whether we have any undos. */
1945 +static CORBA_boolean
1946 +impl_has_undo (PortableServer_Servant servant, CORBA_Environment * ev)
1947 +{
1948 +    u_header_T *curhead;
1949 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1950 +
1951 +    if( !persistent_buffer) {
1952 +        return CORBA_FALSE;
1953 +    }
1954 +    /* this logic comes from undo.c */
1955 +    curhead = persistent_buffer->b_u_curhead;
1956 +    if (persistent_buffer->b_u_curhead == NULL) {              /* first undo */
1957 +               curhead = persistent_buffer->b_u_newhead;
1958 +    } else if (p_ul > 0) {                     /* multi level undo */ 
1959 +               curhead = persistent_buffer->b_u_curhead->uh_next;
1960 +    }
1961 +    if (curbuf->b_u_numhead == 0 || curhead == NULL) {
1962 +        return CORBA_FALSE;
1963 +    }
1964 +    return CORBA_TRUE;
1965 +}
1966 +
1967 +static void
1968 +impl_drop_undo (PortableServer_Servant servant, CORBA_Environment * ev)
1969 +{
1970 +       EditorEngine *e = gtkhtml_editor_engine_from_servant (servant);
1971 +       printf ("dropUndo\n");
1972 +}
1973 +
1974 +static void
1975 +engine_object_finalize (GObject *object)
1976 +{
1977 +       EditorEngine *e = EDITOR_ENGINE (object);
1978 +
1979 +       bonobo_object_release_unref (e->listener, NULL);
1980 +
1981 +       G_OBJECT_CLASS (engine_parent_class)->finalize (object);
1982 +}
1983 +
1984 +static void
1985 +editor_engine_init (GObject *object)
1986 +{
1987 +       EditorEngine *e = EDITOR_ENGINE (object);
1988 +
1989 +       e->listener = CORBA_OBJECT_NIL;
1990 +}
1991 +
1992 +static void
1993 +editor_engine_class_init (EditorEngineClass *klass)
1994 +{
1995 +       GObjectClass *object_class = G_OBJECT_CLASS (klass);
1996 +       POA_GNOME_GtkHTML_Editor_Engine__epv *epv = &klass->epv;
1997 +
1998 +       engine_parent_class = g_type_class_peek_parent (klass);
1999 +       object_class->finalize = engine_object_finalize;
2000 +
2001 +       epv->_set_listener            = impl_set_listener;
2002 +       epv->_get_listener            = impl_get_listener;
2003 +       epv->setParagraphData         = impl_set_paragraph_data;
2004 +       epv->getParagraphData         = impl_get_paragraph_data;
2005 +       epv->setObjectDataByType      = impl_set_object_data_by_type;
2006 +       epv->runCommand               = impl_run_command;
2007 +       epv->isParagraphEmpty         = impl_is_paragraph_empty;
2008 +       epv->isPreviousParagraphEmpty = impl_is_previous_paragraph_empty;
2009 +       epv->searchByData             = impl_search_by_data;
2010 +       epv->insertHTML               = impl_insert_html;
2011 +       epv->freeze                   = impl_freeze;
2012 +       epv->thaw                     = impl_thaw;
2013 +       epv->undoBegin                = impl_undo_begin;
2014 +       epv->undoEnd                  = impl_undo_end;
2015 +       epv->ignoreWord               = impl_ignore_word;
2016 +       epv->hasUndo                  = impl_has_undo;
2017 +       epv->dropUndo                 = impl_drop_undo;
2018 +}
2019 +
2020 +BONOBO_TYPE_FUNC_FULL (
2021 +       EditorEngine,                  /* Glib class name */
2022 +       GNOME_GtkHTML_Editor_Engine,   /* CORBA interface name */
2023 +       BONOBO_TYPE_OBJECT,            /* parent type */
2024 +       editor_engine);                /* local prefix ie. 'echo'_class_init */
2025 +
2026 +EditorEngine *
2027 +editor_engine_new (void)
2028 +{
2029 +       EditorEngine *ee;
2030 +
2031 +       ee = g_object_new (EDITOR_ENGINE_TYPE, NULL);
2032 +
2033 +       return ee;
2034 +}
2035 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor.h vim/src/gtkhtml_editor.h
2036 --- vimcopy/src/gtkhtml_editor.h        Wed Dec 31 18:00:00 1969
2037 +++ vim/src/gtkhtml_editor.h    Sat Jul 26 13:16:47 2003
2038 @@ -0,0 +1,34 @@
2039 +#ifndef GTKHTML_ENGINE_H_
2040 +#define GTKHTML_ENGINE_H_
2041 +
2042 +G_BEGIN_DECLS
2043 +
2044 +typedef struct _EditorEngine EditorEngine;
2045 +
2046 +#include <gtk/gtktypeutils.h>
2047 +#include <bonobo/bonobo-object.h>
2048 +#include "gtkhtml.h"
2049 +
2050 +#define EDITOR_ENGINE_TYPE        (editor_engine_get_type ())
2051 +#define EDITOR_ENGINE(o)          (GTK_CHECK_CAST ((o), EDITOR_ENGINE_TYPE, EditorEngine))
2052 +#define EDITOR_ENGINE_CLASS(k)    (GTK_CHECK_CLASS_CAST((k), EDITOR_ENGINE_TYPE, EditorEngineClass))
2053 +#define IS_EDITOR_ENGINE(o)       (GTK_CHECK_TYPE ((o), EDITOR_ENGINE_TYPE))
2054 +#define IS_EDITOR_ENGINE_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), EDITOR_ENGINE_TYPE))
2055 +
2056 +struct _EditorEngine {
2057 +       BonoboObject parent;
2058 +       GNOME_GtkHTML_Editor_Listener listener;
2059 +};
2060 +
2061 +typedef struct {
2062 +       BonoboObjectClass parent_class;
2063 +       POA_GNOME_GtkHTML_Editor_Engine__epv epv;
2064 +} EditorEngineClass;
2065 +
2066 +GtkType                               editor_engine_get_type   (void);
2067 +EditorEngine                         *editor_engine_new        (void);
2068 +POA_GNOME_GtkHTML_Editor_Engine__epv *editor_engine_get_epv    (void);
2069 +
2070 +G_END_DECLS
2071 +
2072 +#endif /* GTKHTML_ENGINE_H_ */
2073 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor_common.c vim/src/gtkhtml_editor_common.c
2074 --- vimcopy/src/gtkhtml_editor_common.c Wed Dec 31 18:00:00 1969
2075 +++ vim/src/gtkhtml_editor_common.c     Sat Jul 26 13:16:47 2003
2076 @@ -0,0 +1,306 @@
2077 +/*
2078 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
2079 + */
2080 +
2081 +#include <string.h>
2082 +#define ORBIT2_STUBS_API
2083 +#define ORBIT_IDL_C_COMMON
2084 +#define Editor_COMMON
2085 +#include "gtkhtml.h"
2086 +
2087 +static const CORBA_unsigned_long ORBit_zero_int = 0;
2088 +
2089 +#if ( (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_0 == 'E') \
2090 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_1 == 'd') \
2091 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_2 == 'i') \
2092 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_3 == 't') \
2093 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_4 == 'o') \
2094 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Listener_5 == 'r') \
2095 +) && !defined(TC_DEF_TC_GNOME_GtkHTML_Editor_Listener)
2096 +#define TC_DEF_TC_GNOME_GtkHTML_Editor_Listener 1
2097 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2098 +static
2099 +#endif
2100 +const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Listener_struct = {
2101 +   {&ORBit_TypeCode_epv, ORBIT_REFCOUNT_STATIC},
2102 +   CORBA_tk_objref,
2103 +   0,
2104 +   0,
2105 +   ORBIT_ALIGNOF_CORBA_POINTER,
2106 +   0,
2107 +   0,
2108 +   NULL,
2109 +   CORBA_OBJECT_NIL,
2110 +   "Listener",
2111 +   "IDL:GNOME/GtkHTML/Editor/Listener:1.0",
2112 +   NULL,
2113 +   NULL,
2114 +   -1,
2115 +   0,
2116 +   0, 0
2117 +};
2118 +#endif
2119 +#if ( (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_0 == 'E') \
2120 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_1 == 'd') \
2121 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_2 == 'i') \
2122 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_3 == 't') \
2123 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_4 == 'o') \
2124 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_Engine_5 == 'r') \
2125 +) && !defined(TC_DEF_TC_GNOME_GtkHTML_Editor_Engine)
2126 +#define TC_DEF_TC_GNOME_GtkHTML_Editor_Engine 1
2127 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2128 +static
2129 +#endif
2130 +const struct CORBA_TypeCode_struct TC_GNOME_GtkHTML_Editor_Engine_struct = {
2131 +   {&ORBit_TypeCode_epv, ORBIT_REFCOUNT_STATIC},
2132 +   CORBA_tk_objref,
2133 +   0,
2134 +   0,
2135 +   ORBIT_ALIGNOF_CORBA_POINTER,
2136 +   0,
2137 +   0,
2138 +   NULL,
2139 +   CORBA_OBJECT_NIL,
2140 +   "Engine",
2141 +   "IDL:GNOME/GtkHTML/Editor/Engine:1.0",
2142 +   NULL,
2143 +   NULL,
2144 +   -1,
2145 +   0,
2146 +   0, 0
2147 +};
2148 +#endif
2149 +#if ( (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_0 == 'E') \
2150 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_1 == 'd') \
2151 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_2 == 'i') \
2152 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_3 == 't') \
2153 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_4 == 'o') \
2154 +&& (TC_IMPL_TC_GNOME_GtkHTML_Editor_URLRequestEvent_5 == 'r') \
2155 +) && !defined(TC_DEF_TC_GNOME_GtkHTML_Editor_URLRequestEvent)
2156 +#define TC_DEF_TC_GNOME_GtkHTML_Editor_URLRequestEvent 1
2157 +static const char *anon_subnames_array6[] = { "url", "stream" };
2158 +static const CORBA_TypeCode anon_subtypes_array7[] =
2159 +   { (CORBA_TypeCode) & TC_CORBA_string_struct,
2160 +      (CORBA_TypeCode) & TC_Bonobo_Stream_struct };
2161 +
2162 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2163 +static
2164 +#endif
2165 +const struct CORBA_TypeCode_struct
2166 +   TC_GNOME_GtkHTML_Editor_URLRequestEvent_struct = {
2167 +   {&ORBit_TypeCode_epv, ORBIT_REFCOUNT_STATIC},
2168 +   CORBA_tk_struct,
2169 +   0,
2170 +   0,
2171 +   ORBIT_ALIGNOF_CORBA_POINTER,
2172 +   0,
2173 +   2,
2174 +   (CORBA_TypeCode *) anon_subtypes_array7,
2175 +   CORBA_OBJECT_NIL,
2176 +   "URLRequestEvent",
2177 +   "IDL:GNOME/GtkHTML/Editor/URLRequestEvent:1.0",
2178 +   (char **) anon_subnames_array6,
2179 +   NULL,
2180 +   -1,
2181 +   0,
2182 +   0, 0
2183 +};
2184 +#endif
2185 +
2186 +#ifndef ORBIT_IDL_C_IMODULE_Editor
2187 +CORBA_unsigned_long GNOME_GtkHTML_Editor_Listener__classid = 0;
2188 +#endif
2189 +
2190 +#ifndef ORBIT_IDL_C_IMODULE_Editor
2191 +CORBA_unsigned_long GNOME_GtkHTML_Editor_Engine__classid = 0;
2192 +#endif
2193 +
2194 +/* Interface type data */
2195 +
2196 +static ORBit_IArg GNOME_GtkHTML_Editor_Listener_event__arginfo[] = {
2197 +   {TC_CORBA_string, ORBit_I_ARG_IN, "name"},
2198 +   {TC_CORBA_any, ORBit_I_ARG_IN, "arg"}
2199 +};
2200 +
2201 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2202 +static
2203 +#endif
2204 +ORBit_IMethod GNOME_GtkHTML_Editor_Listener__imethods[] = {
2205 +   {
2206 +    {2, 2, GNOME_GtkHTML_Editor_Listener_event__arginfo, FALSE},
2207 +    {0, 0, NULL, FALSE},
2208 +    {0, 0, NULL, FALSE},
2209 +    TC_CORBA_any, "event", 5,
2210 +    0}
2211 +};
2212 +static CORBA_string GNOME_GtkHTML_Editor_Listener__base_itypes[] = {
2213 +   "IDL:Bonobo/Unknown:1.0",
2214 +   "IDL:omg.org/CORBA/Object:1.0"
2215 +};
2216 +
2217 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2218 +static
2219 +#endif
2220 +ORBit_IInterface GNOME_GtkHTML_Editor_Listener__iinterface = {
2221 +   TC_GNOME_GtkHTML_Editor_Listener, {1, 1,
2222 +                                     GNOME_GtkHTML_Editor_Listener__imethods,
2223 +                                     FALSE},
2224 +   {2, 2, GNOME_GtkHTML_Editor_Listener__base_itypes, FALSE}
2225 +};
2226 +
2227 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine__set_listener__arginfo[] = {
2228 +   {TC_GNOME_GtkHTML_Editor_Listener, ORBit_I_ARG_IN, "value"}
2229 +};
2230 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_runCommand__arginfo[] = {
2231 +   {TC_CORBA_string, ORBit_I_ARG_IN, "command"}
2232 +};
2233 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_getParagraphData__arginfo[] = {
2234 +   {TC_CORBA_string, ORBit_I_ARG_IN, "key"}
2235 +};
2236 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_setParagraphData__arginfo[] = {
2237 +   {TC_CORBA_string, ORBit_I_ARG_IN, "key"},
2238 +   {TC_CORBA_string, ORBit_I_ARG_IN, "value"}
2239 +};
2240 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_setObjectDataByType__arginfo[] = {
2241 +   {TC_CORBA_string, ORBit_I_ARG_IN, "type_name"},
2242 +   {TC_CORBA_string, ORBit_I_ARG_IN, "key"},
2243 +   {TC_CORBA_string, ORBit_I_ARG_IN, "data"}
2244 +};
2245 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_searchByData__arginfo[] = {
2246 +   {TC_CORBA_long, ORBit_I_ARG_IN | ORBit_I_COMMON_FIXED_SIZE, "level"},
2247 +   {TC_CORBA_string, ORBit_I_ARG_IN, "klass"},
2248 +   {TC_CORBA_string, ORBit_I_ARG_IN, "key"},
2249 +   {TC_CORBA_string, ORBit_I_ARG_IN, "value"}
2250 +};
2251 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_insertHTML__arginfo[] = {
2252 +   {TC_CORBA_string, ORBit_I_ARG_IN, "html"}
2253 +};
2254 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_undoBegin__arginfo[] = {
2255 +   {TC_CORBA_string, ORBit_I_ARG_IN, "undo_name"},
2256 +   {TC_CORBA_string, ORBit_I_ARG_IN, "redo_name"}
2257 +};
2258 +static ORBit_IArg GNOME_GtkHTML_Editor_Engine_ignoreWord__arginfo[] = {
2259 +   {TC_CORBA_string, ORBit_I_ARG_IN, "word"}
2260 +};
2261 +
2262 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2263 +static
2264 +#endif
2265 +ORBit_IMethod GNOME_GtkHTML_Editor_Engine__imethods[] = {
2266 +   {
2267 +    {0, 0, NULL, FALSE},
2268 +    {0, 0, NULL, FALSE},
2269 +    {0, 0, NULL, FALSE},
2270 +    TC_GNOME_GtkHTML_Editor_Listener, "_get_listener", 13,
2271 +    0}
2272 +   , {
2273 +      {1, 1, GNOME_GtkHTML_Editor_Engine__set_listener__arginfo, FALSE},
2274 +      {0, 0, NULL, FALSE},
2275 +      {0, 0, NULL, FALSE},
2276 +      TC_void, "_set_listener", 13,
2277 +      0}
2278 +   , {
2279 +      {1, 1, GNOME_GtkHTML_Editor_Engine_runCommand__arginfo, FALSE},
2280 +      {0, 0, NULL, FALSE},
2281 +      {0, 0, NULL, FALSE},
2282 +      TC_CORBA_boolean, "runCommand", 10,
2283 +      0 | ORBit_I_COMMON_FIXED_SIZE}
2284 +   , {
2285 +      {1, 1, GNOME_GtkHTML_Editor_Engine_getParagraphData__arginfo, FALSE},
2286 +      {0, 0, NULL, FALSE},
2287 +      {0, 0, NULL, FALSE},
2288 +      TC_CORBA_string, "getParagraphData", 16,
2289 +      0}
2290 +   , {
2291 +      {2, 2, GNOME_GtkHTML_Editor_Engine_setParagraphData__arginfo, FALSE},
2292 +      {0, 0, NULL, FALSE},
2293 +      {0, 0, NULL, FALSE},
2294 +      TC_void, "setParagraphData", 16,
2295 +      0}
2296 +   , {
2297 +      {3, 3, GNOME_GtkHTML_Editor_Engine_setObjectDataByType__arginfo, FALSE},
2298 +      {0, 0, NULL, FALSE},
2299 +      {0, 0, NULL, FALSE},
2300 +      TC_void, "setObjectDataByType", 19,
2301 +      0}
2302 +   , {
2303 +      {4, 4, GNOME_GtkHTML_Editor_Engine_searchByData__arginfo, FALSE},
2304 +      {0, 0, NULL, FALSE},
2305 +      {0, 0, NULL, FALSE},
2306 +      TC_CORBA_boolean, "searchByData", 12,
2307 +      0 | ORBit_I_COMMON_FIXED_SIZE}
2308 +   , {
2309 +      {0, 0, NULL, FALSE},
2310 +      {0, 0, NULL, FALSE},
2311 +      {0, 0, NULL, FALSE},
2312 +      TC_CORBA_boolean, "isParagraphEmpty", 16,
2313 +      0 | ORBit_I_COMMON_FIXED_SIZE}
2314 +   , {
2315 +      {0, 0, NULL, FALSE},
2316 +      {0, 0, NULL, FALSE},
2317 +      {0, 0, NULL, FALSE},
2318 +      TC_CORBA_boolean, "isPreviousParagraphEmpty", 24,
2319 +      0 | ORBit_I_COMMON_FIXED_SIZE}
2320 +   , {
2321 +      {1, 1, GNOME_GtkHTML_Editor_Engine_insertHTML__arginfo, FALSE},
2322 +      {0, 0, NULL, FALSE},
2323 +      {0, 0, NULL, FALSE},
2324 +      TC_void, "insertHTML", 10,
2325 +      0}
2326 +   , {
2327 +      {0, 0, NULL, FALSE},
2328 +      {0, 0, NULL, FALSE},
2329 +      {0, 0, NULL, FALSE},
2330 +      TC_void, "freeze", 6,
2331 +      0}
2332 +   , {
2333 +      {0, 0, NULL, FALSE},
2334 +      {0, 0, NULL, FALSE},
2335 +      {0, 0, NULL, FALSE},
2336 +      TC_void, "thaw", 4,
2337 +      0}
2338 +   , {
2339 +      {2, 2, GNOME_GtkHTML_Editor_Engine_undoBegin__arginfo, FALSE},
2340 +      {0, 0, NULL, FALSE},
2341 +      {0, 0, NULL, FALSE},
2342 +      TC_void, "undoBegin", 9,
2343 +      0}
2344 +   , {
2345 +      {0, 0, NULL, FALSE},
2346 +      {0, 0, NULL, FALSE},
2347 +      {0, 0, NULL, FALSE},
2348 +      TC_void, "undoEnd", 7,
2349 +      0}
2350 +   , {
2351 +      {1, 1, GNOME_GtkHTML_Editor_Engine_ignoreWord__arginfo, FALSE},
2352 +      {0, 0, NULL, FALSE},
2353 +      {0, 0, NULL, FALSE},
2354 +      TC_void, "ignoreWord", 10,
2355 +      0}
2356 +   , {
2357 +      {0, 0, NULL, FALSE},
2358 +      {0, 0, NULL, FALSE},
2359 +      {0, 0, NULL, FALSE},
2360 +      TC_void, "dropUndo", 8,
2361 +      0}
2362 +   , {
2363 +      {0, 0, NULL, FALSE},
2364 +      {0, 0, NULL, FALSE},
2365 +      {0, 0, NULL, FALSE},
2366 +      TC_CORBA_boolean, "hasUndo", 7,
2367 +      0 | ORBit_I_COMMON_FIXED_SIZE}
2368 +};
2369 +static CORBA_string GNOME_GtkHTML_Editor_Engine__base_itypes[] = {
2370 +   "IDL:Bonobo/Unknown:1.0",
2371 +   "IDL:omg.org/CORBA/Object:1.0"
2372 +};
2373 +
2374 +#ifdef ORBIT_IDL_C_IMODULE_Editor
2375 +static
2376 +#endif
2377 +ORBit_IInterface GNOME_GtkHTML_Editor_Engine__iinterface = {
2378 +   TC_GNOME_GtkHTML_Editor_Engine, {17, 17,
2379 +                                   GNOME_GtkHTML_Editor_Engine__imethods,
2380 +                                   FALSE},
2381 +   {2, 2, GNOME_GtkHTML_Editor_Engine__base_itypes, FALSE}
2382 +};
2383 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor_skels.c vim/src/gtkhtml_editor_skels.c
2384 --- vimcopy/src/gtkhtml_editor_skels.c  Wed Dec 31 18:00:00 1969
2385 +++ vim/src/gtkhtml_editor_skels.c      Sat Jul 26 13:16:47 2003
2386 @@ -0,0 +1,658 @@
2387 +/*
2388 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
2389 + */
2390 +
2391 +#include <string.h>
2392 +#define ORBIT2_STUBS_API
2393 +#include "gtkhtml.h"
2394 +
2395 +void
2396 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Listener_event
2397 +   (POA_GNOME_GtkHTML_Editor_Listener * _o_servant, gpointer _o_retval,
2398 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2399 +    CORBA_any * (*_impl_event) (PortableServer_Servant _servant,
2400 +                               const CORBA_char * name,
2401 +                               const CORBA_any * arg,
2402 +                               CORBA_Environment * ev))
2403 +{
2404 +   *(CORBA_any * *)_o_retval =
2405 +      _impl_event(_o_servant, *(const CORBA_char * *) _o_args[0],
2406 +                 (const CORBA_any *) _o_args[1], _o_ev);
2407 +}
2408 +
2409 +void
2410 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__get_listener
2411 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2412 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2413 +    GNOME_GtkHTML_Editor_Listener(*_impl__get_listener)
2414 +    (PortableServer_Servant _servant, CORBA_Environment * ev))
2415 +{
2416 +   *(GNOME_GtkHTML_Editor_Listener *) _o_retval =
2417 +      _impl__get_listener(_o_servant, _o_ev);
2418 +}
2419 +
2420 +void
2421 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__set_listener
2422 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2423 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2424 +    void (*_impl__set_listener) (PortableServer_Servant _servant,
2425 +                                const GNOME_GtkHTML_Editor_Listener value,
2426 +                                CORBA_Environment * ev))
2427 +{
2428 +   _impl__set_listener(_o_servant,
2429 +                      *(const GNOME_GtkHTML_Editor_Listener *) _o_args[0],
2430 +                      _o_ev);
2431 +}
2432 +
2433 +void
2434 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_runCommand
2435 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2436 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2437 +    CORBA_boolean(*_impl_runCommand) (PortableServer_Servant _servant,
2438 +                                     const CORBA_char * command,
2439 +                                     CORBA_Environment * ev))
2440 +{
2441 +   *(CORBA_boolean *) _o_retval =
2442 +      _impl_runCommand(_o_servant, *(const CORBA_char * *) _o_args[0], _o_ev);
2443 +}
2444 +
2445 +void
2446 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_getParagraphData
2447 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2448 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2449 +    CORBA_string(*_impl_getParagraphData) (PortableServer_Servant _servant,
2450 +                                          const CORBA_char * key,
2451 +                                          CORBA_Environment * ev))
2452 +{
2453 +   *(CORBA_string *) _o_retval =
2454 +      _impl_getParagraphData(_o_servant, *(const CORBA_char * *) _o_args[0],
2455 +                            _o_ev);
2456 +}
2457 +
2458 +void
2459 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setParagraphData
2460 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2461 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2462 +    void (*_impl_setParagraphData) (PortableServer_Servant _servant,
2463 +                                   const CORBA_char * key,
2464 +                                   const CORBA_char * value,
2465 +                                   CORBA_Environment * ev))
2466 +{
2467 +   _impl_setParagraphData(_o_servant, *(const CORBA_char * *) _o_args[0],
2468 +                         *(const CORBA_char * *) _o_args[1], _o_ev);
2469 +}
2470 +
2471 +void
2472 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setObjectDataByType
2473 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2474 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2475 +    void (*_impl_setObjectDataByType) (PortableServer_Servant _servant,
2476 +                                      const CORBA_char * type_name,
2477 +                                      const CORBA_char * key,
2478 +                                      const CORBA_char * data,
2479 +                                      CORBA_Environment * ev))
2480 +{
2481 +   _impl_setObjectDataByType(_o_servant, *(const CORBA_char * *) _o_args[0],
2482 +                            *(const CORBA_char * *) _o_args[1],
2483 +                            *(const CORBA_char * *) _o_args[2], _o_ev);
2484 +}
2485 +
2486 +void
2487 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_searchByData
2488 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2489 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2490 +    CORBA_boolean(*_impl_searchByData) (PortableServer_Servant _servant,
2491 +                                       const CORBA_long level,
2492 +                                       const CORBA_char * klass,
2493 +                                       const CORBA_char * key,
2494 +                                       const CORBA_char * value,
2495 +                                       CORBA_Environment * ev))
2496 +{
2497 +   *(CORBA_boolean *) _o_retval =
2498 +      _impl_searchByData(_o_servant, *(const CORBA_long *) _o_args[0],
2499 +                        *(const CORBA_char * *) _o_args[1],
2500 +                        *(const CORBA_char * *) _o_args[2],
2501 +                        *(const CORBA_char * *) _o_args[3], _o_ev);
2502 +}
2503 +
2504 +void
2505 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isParagraphEmpty
2506 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2507 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2508 +    CORBA_boolean(*_impl_isParagraphEmpty) (PortableServer_Servant _servant,
2509 +                                           CORBA_Environment * ev))
2510 +{
2511 +   *(CORBA_boolean *) _o_retval = _impl_isParagraphEmpty(_o_servant, _o_ev);
2512 +}
2513 +
2514 +void
2515 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
2516 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2517 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2518 +    CORBA_boolean(*_impl_isPreviousParagraphEmpty) (PortableServer_Servant
2519 +                                                   _servant,
2520 +                                                   CORBA_Environment * ev))
2521 +{
2522 +   *(CORBA_boolean *) _o_retval =
2523 +      _impl_isPreviousParagraphEmpty(_o_servant, _o_ev);
2524 +}
2525 +
2526 +void
2527 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_insertHTML
2528 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2529 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2530 +    void (*_impl_insertHTML) (PortableServer_Servant _servant,
2531 +                             const CORBA_char * html,
2532 +                             CORBA_Environment * ev))
2533 +{
2534 +   _impl_insertHTML(_o_servant, *(const CORBA_char * *) _o_args[0], _o_ev);
2535 +}
2536 +
2537 +void
2538 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_freeze
2539 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2540 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2541 +    void (*_impl_freeze) (PortableServer_Servant _servant,
2542 +                         CORBA_Environment * ev))
2543 +{
2544 +   _impl_freeze(_o_servant, _o_ev);
2545 +}
2546 +
2547 +void
2548 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_thaw
2549 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2550 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2551 +    void (*_impl_thaw) (PortableServer_Servant _servant,
2552 +                       CORBA_Environment * ev))
2553 +{
2554 +   _impl_thaw(_o_servant, _o_ev);
2555 +}
2556 +
2557 +void
2558 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoBegin
2559 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2560 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2561 +    void (*_impl_undoBegin) (PortableServer_Servant _servant,
2562 +                            const CORBA_char * undo_name,
2563 +                            const CORBA_char * redo_name,
2564 +                            CORBA_Environment * ev))
2565 +{
2566 +   _impl_undoBegin(_o_servant, *(const CORBA_char * *) _o_args[0],
2567 +                  *(const CORBA_char * *) _o_args[1], _o_ev);
2568 +}
2569 +
2570 +void
2571 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoEnd
2572 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2573 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2574 +    void (*_impl_undoEnd) (PortableServer_Servant _servant,
2575 +                          CORBA_Environment * ev))
2576 +{
2577 +   _impl_undoEnd(_o_servant, _o_ev);
2578 +}
2579 +
2580 +void
2581 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_ignoreWord
2582 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2583 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2584 +    void (*_impl_ignoreWord) (PortableServer_Servant _servant,
2585 +                             const CORBA_char * word,
2586 +                             CORBA_Environment * ev))
2587 +{
2588 +   _impl_ignoreWord(_o_servant, *(const CORBA_char * *) _o_args[0], _o_ev);
2589 +}
2590 +
2591 +void
2592 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_dropUndo
2593 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2594 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2595 +    void (*_impl_dropUndo) (PortableServer_Servant _servant,
2596 +                           CORBA_Environment * ev))
2597 +{
2598 +   _impl_dropUndo(_o_servant, _o_ev);
2599 +}
2600 +
2601 +void
2602 +_ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_hasUndo
2603 +   (POA_GNOME_GtkHTML_Editor_Engine * _o_servant, gpointer _o_retval,
2604 +    gpointer * _o_args, CORBA_Context _o_ctx, CORBA_Environment * _o_ev,
2605 +    CORBA_boolean(*_impl_hasUndo) (PortableServer_Servant _servant,
2606 +                                  CORBA_Environment * ev))
2607 +{
2608 +   *(CORBA_boolean *) _o_retval = _impl_hasUndo(_o_servant, _o_ev);
2609 +}
2610 +static ORBitSmallSkeleton
2611 +get_skel_small_GNOME_GtkHTML_Editor_Listener(POA_GNOME_GtkHTML_Editor_Listener
2612 +                                            * servant, const char *opname,
2613 +                                            gpointer * m_data,
2614 +                                            gpointer * impl)
2615 +{
2616 +   switch (opname[0]) {
2617 +     case 'e':
2618 +      if (strcmp((opname + 1), "vent"))
2619 +        break;
2620 +      *impl =
2621 +        (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Listener_epv->event;
2622 +      *m_data =
2623 +        (gpointer) & GNOME_GtkHTML_Editor_Listener__iinterface.methods.
2624 +        _buffer[0];
2625 +      return (ORBitSmallSkeleton)
2626 +        _ORBIT_skel_small_GNOME_GtkHTML_Editor_Listener_event;
2627 +      break;
2628 +     case 'q':
2629 +      if (strcmp((opname + 1), "ueryInterface"))
2630 +        break;
2631 +      *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->queryInterface;
2632 +      *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[2];
2633 +      return (ORBitSmallSkeleton)
2634 +        _ORBIT_skel_small_Bonobo_Unknown_queryInterface;
2635 +      break;
2636 +     case 'r':
2637 +      if (strcmp((opname + 1), "ef"))
2638 +        break;
2639 +      *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->ref;
2640 +      *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[0];
2641 +      return (ORBitSmallSkeleton) _ORBIT_skel_small_Bonobo_Unknown_ref;
2642 +      break;
2643 +     case 'u':
2644 +      if (strcmp((opname + 1), "nref"))
2645 +        break;
2646 +      *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->unref;
2647 +      *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[1];
2648 +      return (ORBitSmallSkeleton) _ORBIT_skel_small_Bonobo_Unknown_unref;
2649 +      break;
2650 +     default:
2651 +      break;
2652 +   }
2653 +   return NULL;
2654 +}
2655 +
2656 +void
2657 +POA_GNOME_GtkHTML_Editor_Listener__init(PortableServer_Servant servant,
2658 +                                       CORBA_Environment * env)
2659 +{
2660 +   static PortableServer_ClassInfo class_info =
2661 +      { NULL,
2662 +(ORBit_small_impl_finder) & get_skel_small_GNOME_GtkHTML_Editor_Listener,
2663 +        "IDL:GNOME/GtkHTML/Editor/Listener:1.0",
2664 +        &GNOME_GtkHTML_Editor_Listener__classid, NULL,
2665 +        &GNOME_GtkHTML_Editor_Listener__iinterface };
2666 +   POA_GNOME_GtkHTML_Editor_Listener__vepv *fakevepv = NULL;
2667 +
2668 +   if (((PortableServer_ServantBase *) servant)->vepv[0]->finalize == 0) {
2669 +      ((PortableServer_ServantBase *) servant)->vepv[0]->finalize =
2670 +        POA_GNOME_GtkHTML_Editor_Listener__fini;
2671 +   }
2672 +   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant),
2673 +                                   env);
2674 +   POA_Bonobo_Unknown__init(servant, env);
2675 +   ORBit_classinfo_register(&class_info);
2676 +   ORBIT_SERVANT_SET_CLASSINFO(servant, &class_info);
2677 +
2678 +   if (!class_info.vepvmap) {
2679 +      class_info.vepvmap =
2680 +        g_new0(ORBit_VepvIdx, GNOME_GtkHTML_Editor_Listener__classid + 1);
2681 +      class_info.vepvmap[Bonobo_Unknown__classid] =
2682 +        (((char *) &(fakevepv->Bonobo_Unknown_epv)) -
2683 +         ((char *) (fakevepv))) / sizeof(GFunc);
2684 +      class_info.vepvmap[GNOME_GtkHTML_Editor_Listener__classid] =
2685 +        (((char *) &(fakevepv->GNOME_GtkHTML_Editor_Listener_epv)) -
2686 +         ((char *) (fakevepv))) / sizeof(GFunc);
2687 +   }
2688 +}
2689 +
2690 +void
2691 +POA_GNOME_GtkHTML_Editor_Listener__fini(PortableServer_Servant servant,
2692 +                                       CORBA_Environment * env)
2693 +{
2694 +   POA_Bonobo_Unknown__fini(servant, env);
2695 +   PortableServer_ServantBase__fini(servant, env);
2696 +}
2697 +
2698 +static ORBitSmallSkeleton
2699 +get_skel_small_GNOME_GtkHTML_Editor_Engine(POA_GNOME_GtkHTML_Editor_Engine *
2700 +                                          servant, const char *opname,
2701 +                                          gpointer * m_data, gpointer * impl)
2702 +{
2703 +   switch (opname[0]) {
2704 +     case '_':
2705 +      switch (opname[1]) {
2706 +       case 'g':
2707 +        if (strcmp((opname + 2), "et_listener"))
2708 +           break;
2709 +        *impl =
2710 +           (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2711 +           _get_listener;
2712 +        *m_data =
2713 +           (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2714 +           _buffer[0];
2715 +        return (ORBitSmallSkeleton)
2716 +           _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__get_listener;
2717 +        break;
2718 +       case 's':
2719 +        if (strcmp((opname + 2), "et_listener"))
2720 +           break;
2721 +        *impl =
2722 +           (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2723 +           _set_listener;
2724 +        *m_data =
2725 +           (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2726 +           _buffer[1];
2727 +        return (ORBitSmallSkeleton)
2728 +           _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine__set_listener;
2729 +        break;
2730 +       default:
2731 +        break;
2732 +      }
2733 +      break;
2734 +     case 'd':
2735 +      if (strcmp((opname + 1), "ropUndo"))
2736 +        break;
2737 +      *impl =
2738 +        (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->dropUndo;
2739 +      *m_data =
2740 +        (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2741 +        _buffer[15];
2742 +      return (ORBitSmallSkeleton)
2743 +        _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_dropUndo;
2744 +      break;
2745 +     case 'f':
2746 +      if (strcmp((opname + 1), "reeze"))
2747 +        break;
2748 +      *impl =
2749 +        (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->freeze;
2750 +      *m_data =
2751 +        (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2752 +        _buffer[10];
2753 +      return (ORBitSmallSkeleton)
2754 +        _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_freeze;
2755 +      break;
2756 +     case 'g':
2757 +      if (strcmp((opname + 1), "etParagraphData"))
2758 +        break;
2759 +      *impl =
2760 +        (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2761 +        getParagraphData;
2762 +      *m_data =
2763 +        (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2764 +        _buffer[3];
2765 +      return (ORBitSmallSkeleton)
2766 +        _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_getParagraphData;
2767 +      break;
2768 +     case 'h':
2769 +      if (strcmp((opname + 1), "asUndo"))
2770 +        break;
2771 +      *impl =
2772 +        (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->hasUndo;
2773 +      *m_data =
2774 +        (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2775 +        _buffer[16];
2776 +      return (ORBitSmallSkeleton)
2777 +        _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_hasUndo;
2778 +      break;
2779 +     case 'i':
2780 +      switch (opname[1]) {
2781 +       case 'g':
2782 +        if (strcmp((opname + 2), "noreWord"))
2783 +           break;
2784 +        *impl =
2785 +           (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2786 +           ignoreWord;
2787 +        *m_data =
2788 +           (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2789 +           _buffer[14];
2790 +        return (ORBitSmallSkeleton)
2791 +           _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_ignoreWord;
2792 +        break;
2793 +       case 'n':
2794 +        if (strcmp((opname + 2), "sertHTML"))
2795 +           break;
2796 +        *impl =
2797 +           (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2798 +           insertHTML;
2799 +        *m_data =
2800 +           (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2801 +           _buffer[9];
2802 +        return (ORBitSmallSkeleton)
2803 +           _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_insertHTML;
2804 +        break;
2805 +       case 's':
2806 +        switch (opname[2]) {
2807 +          case 'P':
2808 +           switch (opname[3]) {
2809 +             case 'a':
2810 +              if (strcmp((opname + 4), "ragraphEmpty"))
2811 +                 break;
2812 +              *impl =
2813 +                 (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2814 +                 isParagraphEmpty;
2815 +              *m_data =
2816 +                 (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2817 +                 methods._buffer[7];
2818 +              return (ORBitSmallSkeleton)
2819 +                 _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isParagraphEmpty;
2820 +              break;
2821 +             case 'r':
2822 +              if (strcmp((opname + 4), "eviousParagraphEmpty"))
2823 +                 break;
2824 +              *impl =
2825 +                 (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2826 +                 isPreviousParagraphEmpty;
2827 +              *m_data =
2828 +                 (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2829 +                 methods._buffer[8];
2830 +              return (ORBitSmallSkeleton)
2831 +                 _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty;
2832 +              break;
2833 +             default:
2834 +              break;
2835 +           }
2836 +           break;
2837 +          default:
2838 +           break;
2839 +        }
2840 +        break;
2841 +       default:
2842 +        break;
2843 +      }
2844 +      break;
2845 +     case 'q':
2846 +      if (strcmp((opname + 1), "ueryInterface"))
2847 +        break;
2848 +      *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->queryInterface;
2849 +      *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[2];
2850 +      return (ORBitSmallSkeleton)
2851 +        _ORBIT_skel_small_Bonobo_Unknown_queryInterface;
2852 +      break;
2853 +     case 'r':
2854 +      switch (opname[1]) {
2855 +       case 'e':
2856 +        if (strcmp((opname + 2), "f"))
2857 +           break;
2858 +        *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->ref;
2859 +        *m_data = (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[0];
2860 +        return (ORBitSmallSkeleton) _ORBIT_skel_small_Bonobo_Unknown_ref;
2861 +        break;
2862 +       case 'u':
2863 +        if (strcmp((opname + 2), "nCommand"))
2864 +           break;
2865 +        *impl =
2866 +           (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2867 +           runCommand;
2868 +        *m_data =
2869 +           (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2870 +           _buffer[2];
2871 +        return (ORBitSmallSkeleton)
2872 +           _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_runCommand;
2873 +        break;
2874 +       default:
2875 +        break;
2876 +      }
2877 +      break;
2878 +     case 's':
2879 +      switch (opname[1]) {
2880 +       case 'e':
2881 +        switch (opname[2]) {
2882 +          case 'a':
2883 +           if (strcmp((opname + 3), "rchByData"))
2884 +              break;
2885 +           *impl =
2886 +              (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2887 +              searchByData;
2888 +           *m_data =
2889 +              (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2890 +              _buffer[6];
2891 +           return (ORBitSmallSkeleton)
2892 +              _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_searchByData;
2893 +           break;
2894 +          case 't':
2895 +           switch (opname[3]) {
2896 +             case 'O':
2897 +              if (strcmp((opname + 4), "bjectDataByType"))
2898 +                 break;
2899 +              *impl =
2900 +                 (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2901 +                 setObjectDataByType;
2902 +              *m_data =
2903 +                 (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2904 +                 methods._buffer[5];
2905 +              return (ORBitSmallSkeleton)
2906 +                 _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setObjectDataByType;
2907 +              break;
2908 +             case 'P':
2909 +              if (strcmp((opname + 4), "aragraphData"))
2910 +                 break;
2911 +              *impl =
2912 +                 (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->
2913 +                 setParagraphData;
2914 +              *m_data =
2915 +                 (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2916 +                 methods._buffer[4];
2917 +              return (ORBitSmallSkeleton)
2918 +                 _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_setParagraphData;
2919 +              break;
2920 +             default:
2921 +              break;
2922 +           }
2923 +           break;
2924 +          default:
2925 +           break;
2926 +        }
2927 +        break;
2928 +       default:
2929 +        break;
2930 +      }
2931 +      break;
2932 +     case 't':
2933 +      if (strcmp((opname + 1), "haw"))
2934 +        break;
2935 +      *impl = (gpointer) servant->vepv->GNOME_GtkHTML_Editor_Engine_epv->thaw;
2936 +      *m_data =
2937 +        (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.methods.
2938 +        _buffer[11];
2939 +      return (ORBitSmallSkeleton)
2940 +        _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_thaw;
2941 +      break;
2942 +     case 'u':
2943 +      switch (opname[1]) {
2944 +       case 'n':
2945 +        switch (opname[2]) {
2946 +          case 'd':
2947 +           switch (opname[3]) {
2948 +             case 'o':
2949 +              switch (opname[4]) {
2950 +                case 'B':
2951 +                 if (strcmp((opname + 5), "egin"))
2952 +                    break;
2953 +                 *impl =
2954 +                    (gpointer) servant->vepv->
2955 +                    GNOME_GtkHTML_Editor_Engine_epv->undoBegin;
2956 +                 *m_data =
2957 +                    (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2958 +                    methods._buffer[12];
2959 +                 return (ORBitSmallSkeleton)
2960 +                    _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoBegin;
2961 +                 break;
2962 +                case 'E':
2963 +                 if (strcmp((opname + 5), "nd"))
2964 +                    break;
2965 +                 *impl =
2966 +                    (gpointer) servant->vepv->
2967 +                    GNOME_GtkHTML_Editor_Engine_epv->undoEnd;
2968 +                 *m_data =
2969 +                    (gpointer) & GNOME_GtkHTML_Editor_Engine__iinterface.
2970 +                    methods._buffer[13];
2971 +                 return (ORBitSmallSkeleton)
2972 +                    _ORBIT_skel_small_GNOME_GtkHTML_Editor_Engine_undoEnd;
2973 +                 break;
2974 +                default:
2975 +                 break;
2976 +              }
2977 +              break;
2978 +             default:
2979 +              break;
2980 +           }
2981 +           break;
2982 +          case 'r':
2983 +           if (strcmp((opname + 3), "ef"))
2984 +              break;
2985 +           *impl = (gpointer) servant->vepv->Bonobo_Unknown_epv->unref;
2986 +           *m_data =
2987 +              (gpointer) & Bonobo_Unknown__iinterface.methods._buffer[1];
2988 +           return (ORBitSmallSkeleton)
2989 +              _ORBIT_skel_small_Bonobo_Unknown_unref;
2990 +           break;
2991 +          default:
2992 +           break;
2993 +        }
2994 +        break;
2995 +       default:
2996 +        break;
2997 +      }
2998 +      break;
2999 +     default:
3000 +      break;
3001 +   }
3002 +   return NULL;
3003 +}
3004 +
3005 +void
3006 +POA_GNOME_GtkHTML_Editor_Engine__init(PortableServer_Servant servant,
3007 +                                     CORBA_Environment * env)
3008 +{
3009 +   static PortableServer_ClassInfo class_info =
3010 +      { NULL,
3011 +(ORBit_small_impl_finder) & get_skel_small_GNOME_GtkHTML_Editor_Engine, "IDL:GNOME/GtkHTML/Editor/Engine:1.0",
3012 +        &GNOME_GtkHTML_Editor_Engine__classid, NULL,
3013 +        &GNOME_GtkHTML_Editor_Engine__iinterface };
3014 +   POA_GNOME_GtkHTML_Editor_Engine__vepv *fakevepv = NULL;
3015 +
3016 +   if (((PortableServer_ServantBase *) servant)->vepv[0]->finalize == 0) {
3017 +      ((PortableServer_ServantBase *) servant)->vepv[0]->finalize =
3018 +        POA_GNOME_GtkHTML_Editor_Engine__fini;
3019 +   }
3020 +   PortableServer_ServantBase__init(((PortableServer_ServantBase *) servant),
3021 +                                   env);
3022 +   POA_Bonobo_Unknown__init(servant, env);
3023 +   ORBit_classinfo_register(&class_info);
3024 +   ORBIT_SERVANT_SET_CLASSINFO(servant, &class_info);
3025 +
3026 +   if (!class_info.vepvmap) {
3027 +      class_info.vepvmap =
3028 +        g_new0(ORBit_VepvIdx, GNOME_GtkHTML_Editor_Engine__classid + 1);
3029 +      class_info.vepvmap[Bonobo_Unknown__classid] =
3030 +        (((char *) &(fakevepv->Bonobo_Unknown_epv)) -
3031 +         ((char *) (fakevepv))) / sizeof(GFunc);
3032 +      class_info.vepvmap[GNOME_GtkHTML_Editor_Engine__classid] =
3033 +        (((char *) &(fakevepv->GNOME_GtkHTML_Editor_Engine_epv)) -
3034 +         ((char *) (fakevepv))) / sizeof(GFunc);
3035 +   }
3036 +}
3037 +
3038 +void
3039 +POA_GNOME_GtkHTML_Editor_Engine__fini(PortableServer_Servant servant,
3040 +                                     CORBA_Environment * env)
3041 +{
3042 +   POA_Bonobo_Unknown__fini(servant, env);
3043 +   PortableServer_ServantBase__fini(servant, env);
3044 +}
3045 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gtkhtml_editor_stubs.c vim/src/gtkhtml_editor_stubs.c
3046 --- vimcopy/src/gtkhtml_editor_stubs.c  Wed Dec 31 18:00:00 1969
3047 +++ vim/src/gtkhtml_editor_stubs.c      Sat Jul 26 13:16:47 2003
3048 @@ -0,0 +1,496 @@
3049 +/*
3050 + * This file was generated by orbit-idl-2 - DO NOT EDIT!
3051 + */
3052 +
3053 +#include <string.h>
3054 +#define ORBIT2_STUBS_API
3055 +#include "gtkhtml.h"
3056 +
3057 +CORBA_any *
3058 +GNOME_GtkHTML_Editor_Listener_event(GNOME_GtkHTML_Editor_Listener _obj,
3059 +                                   const CORBA_char * name,
3060 +                                   const CORBA_any * arg,
3061 +                                   CORBA_Environment * ev)
3062 +{
3063 +   CORBA_any *_ORBIT_retval;
3064 +   POA_GNOME_GtkHTML_Editor_Listener__epv *_ORBIT_epv;
3065 +
3066 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3067 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Listener__classid) &&
3068 +       (_ORBIT_epv =
3069 +       (POA_GNOME_GtkHTML_Editor_Listener__epv *) ORBIT_STUB_GetEpv(_obj,
3070 +                                                                    GNOME_GtkHTML_Editor_Listener__classid))->
3071 +       event) {
3072 +      ORBIT_STUB_PreCall(_obj);
3073 +      _ORBIT_retval =
3074 +        _ORBIT_epv->event(ORBIT_STUB_GetServant(_obj), name, arg, ev);
3075 +      ORBIT_STUB_PostCall(_obj);
3076 +   } else {                    /* remote marshal */
3077 +      gpointer _args[2];
3078 +
3079 +      _args[0] = (gpointer) & name;
3080 +      _args[1] = (gpointer) arg;
3081 +      ORBit_small_invoke_stub_n(_obj,
3082 +                               &GNOME_GtkHTML_Editor_Listener__iinterface.
3083 +                               methods, 0, &_ORBIT_retval, _args, NULL, ev);
3084 +
3085 +   }
3086 +   return _ORBIT_retval;
3087 +}
3088 +
3089 +GNOME_GtkHTML_Editor_Listener
3090 +GNOME_GtkHTML_Editor_Engine__get_listener(GNOME_GtkHTML_Editor_Engine _obj,
3091 +                                         CORBA_Environment * ev)
3092 +{
3093 +   GNOME_GtkHTML_Editor_Listener _ORBIT_retval;
3094 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3095 +
3096 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3097 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3098 +       (_ORBIT_epv =
3099 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3100 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3101 +       _get_listener) {
3102 +      ORBIT_STUB_PreCall(_obj);
3103 +      _ORBIT_retval =
3104 +        _ORBIT_epv->_get_listener(ORBIT_STUB_GetServant(_obj), ev);
3105 +      ORBIT_STUB_PostCall(_obj);
3106 +   } else {                    /* remote marshal */
3107 +      ORBit_small_invoke_stub_n(_obj,
3108 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3109 +                               methods, 0, &_ORBIT_retval, NULL, NULL, ev);
3110 +
3111 +   }
3112 +   return _ORBIT_retval;
3113 +}
3114 +
3115 +void
3116 +GNOME_GtkHTML_Editor_Engine__set_listener(GNOME_GtkHTML_Editor_Engine _obj,
3117 +                                         const GNOME_GtkHTML_Editor_Listener
3118 +                                         value, CORBA_Environment * ev)
3119 +{
3120 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3121 +
3122 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3123 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3124 +       (_ORBIT_epv =
3125 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3126 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3127 +       _set_listener) {
3128 +      ORBIT_STUB_PreCall(_obj);
3129 +      _ORBIT_epv->_set_listener(ORBIT_STUB_GetServant(_obj), value, ev);
3130 +      ORBIT_STUB_PostCall(_obj);
3131 +   } else {                    /* remote marshal */
3132 +      gpointer _args[1];
3133 +
3134 +      _args[0] = (gpointer) & value;
3135 +      ORBit_small_invoke_stub_n(_obj,
3136 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3137 +                               methods, 1, NULL, _args, NULL, ev);
3138 +
3139 +   }
3140 +}
3141 +CORBA_boolean
3142 +GNOME_GtkHTML_Editor_Engine_runCommand(GNOME_GtkHTML_Editor_Engine _obj,
3143 +                                      const CORBA_char * command,
3144 +                                      CORBA_Environment * ev)
3145 +{
3146 +   CORBA_boolean _ORBIT_retval;
3147 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3148 +
3149 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3150 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3151 +       (_ORBIT_epv =
3152 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3153 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3154 +       runCommand) {
3155 +      ORBIT_STUB_PreCall(_obj);
3156 +      _ORBIT_retval =
3157 +        _ORBIT_epv->runCommand(ORBIT_STUB_GetServant(_obj), command, ev);
3158 +      ORBIT_STUB_PostCall(_obj);
3159 +   } else {                    /* remote marshal */
3160 +      gpointer _args[1];
3161 +
3162 +      _args[0] = (gpointer) & command;
3163 +      ORBit_small_invoke_stub_n(_obj,
3164 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3165 +                               methods, 2, &_ORBIT_retval, _args, NULL, ev);
3166 +
3167 +   }
3168 +   return _ORBIT_retval;
3169 +}
3170 +
3171 +CORBA_string
3172 +GNOME_GtkHTML_Editor_Engine_getParagraphData(GNOME_GtkHTML_Editor_Engine _obj,
3173 +                                            const CORBA_char * key,
3174 +                                            CORBA_Environment * ev)
3175 +{
3176 +   CORBA_string _ORBIT_retval;
3177 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3178 +
3179 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3180 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3181 +       (_ORBIT_epv =
3182 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3183 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3184 +       getParagraphData) {
3185 +      ORBIT_STUB_PreCall(_obj);
3186 +      _ORBIT_retval =
3187 +        _ORBIT_epv->getParagraphData(ORBIT_STUB_GetServant(_obj), key, ev);
3188 +      ORBIT_STUB_PostCall(_obj);
3189 +   } else {                    /* remote marshal */
3190 +      gpointer _args[1];
3191 +
3192 +      _args[0] = (gpointer) & key;
3193 +      ORBit_small_invoke_stub_n(_obj,
3194 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3195 +                               methods, 3, &_ORBIT_retval, _args, NULL, ev);
3196 +
3197 +   }
3198 +   return _ORBIT_retval;
3199 +}
3200 +
3201 +void
3202 +GNOME_GtkHTML_Editor_Engine_setParagraphData(GNOME_GtkHTML_Editor_Engine _obj,
3203 +                                            const CORBA_char * key,
3204 +                                            const CORBA_char * value,
3205 +                                            CORBA_Environment * ev)
3206 +{
3207 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3208 +
3209 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3210 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3211 +       (_ORBIT_epv =
3212 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3213 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3214 +       setParagraphData) {
3215 +      ORBIT_STUB_PreCall(_obj);
3216 +      _ORBIT_epv->setParagraphData(ORBIT_STUB_GetServant(_obj), key, value,
3217 +                                  ev);
3218 +      ORBIT_STUB_PostCall(_obj);
3219 +   } else {                    /* remote marshal */
3220 +      gpointer _args[2];
3221 +
3222 +      _args[0] = (gpointer) & key;
3223 +      _args[1] = (gpointer) & value;
3224 +      ORBit_small_invoke_stub_n(_obj,
3225 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3226 +                               methods, 4, NULL, _args, NULL, ev);
3227 +
3228 +   }
3229 +}
3230 +void
3231 +GNOME_GtkHTML_Editor_Engine_setObjectDataByType(GNOME_GtkHTML_Editor_Engine
3232 +                                               _obj,
3233 +                                               const CORBA_char * type_name,
3234 +                                               const CORBA_char * key,
3235 +                                               const CORBA_char * data,
3236 +                                               CORBA_Environment * ev)
3237 +{
3238 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3239 +
3240 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3241 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3242 +       (_ORBIT_epv =
3243 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3244 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3245 +       setObjectDataByType) {
3246 +      ORBIT_STUB_PreCall(_obj);
3247 +      _ORBIT_epv->setObjectDataByType(ORBIT_STUB_GetServant(_obj), type_name,
3248 +                                     key, data, ev);
3249 +      ORBIT_STUB_PostCall(_obj);
3250 +   } else {                    /* remote marshal */
3251 +      gpointer _args[3];
3252 +
3253 +      _args[0] = (gpointer) & type_name;
3254 +      _args[1] = (gpointer) & key;
3255 +      _args[2] = (gpointer) & data;
3256 +      ORBit_small_invoke_stub_n(_obj,
3257 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3258 +                               methods, 5, NULL, _args, NULL, ev);
3259 +
3260 +   }
3261 +}
3262 +CORBA_boolean
3263 +GNOME_GtkHTML_Editor_Engine_searchByData(GNOME_GtkHTML_Editor_Engine _obj,
3264 +                                        const CORBA_long level,
3265 +                                        const CORBA_char * klass,
3266 +                                        const CORBA_char * key,
3267 +                                        const CORBA_char * value,
3268 +                                        CORBA_Environment * ev)
3269 +{
3270 +   CORBA_boolean _ORBIT_retval;
3271 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3272 +
3273 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3274 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3275 +       (_ORBIT_epv =
3276 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3277 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3278 +       searchByData) {
3279 +      ORBIT_STUB_PreCall(_obj);
3280 +      _ORBIT_retval =
3281 +        _ORBIT_epv->searchByData(ORBIT_STUB_GetServant(_obj), level, klass,
3282 +                                 key, value, ev);
3283 +      ORBIT_STUB_PostCall(_obj);
3284 +   } else {                    /* remote marshal */
3285 +      gpointer _args[4];
3286 +
3287 +      _args[0] = (gpointer) & level;
3288 +      _args[1] = (gpointer) & klass;
3289 +      _args[2] = (gpointer) & key;
3290 +      _args[3] = (gpointer) & value;
3291 +      ORBit_small_invoke_stub_n(_obj,
3292 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3293 +                               methods, 6, &_ORBIT_retval, _args, NULL, ev);
3294 +
3295 +   }
3296 +   return _ORBIT_retval;
3297 +}
3298 +
3299 +CORBA_boolean
3300 +GNOME_GtkHTML_Editor_Engine_isParagraphEmpty(GNOME_GtkHTML_Editor_Engine _obj,
3301 +                                            CORBA_Environment * ev)
3302 +{
3303 +   CORBA_boolean _ORBIT_retval;
3304 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3305 +
3306 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3307 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3308 +       (_ORBIT_epv =
3309 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3310 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3311 +       isParagraphEmpty) {
3312 +      ORBIT_STUB_PreCall(_obj);
3313 +      _ORBIT_retval =
3314 +        _ORBIT_epv->isParagraphEmpty(ORBIT_STUB_GetServant(_obj), ev);
3315 +      ORBIT_STUB_PostCall(_obj);
3316 +   } else {                    /* remote marshal */
3317 +      ORBit_small_invoke_stub_n(_obj,
3318 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3319 +                               methods, 7, &_ORBIT_retval, NULL, NULL, ev);
3320 +
3321 +   }
3322 +   return _ORBIT_retval;
3323 +}
3324 +
3325 +CORBA_boolean
3326 +GNOME_GtkHTML_Editor_Engine_isPreviousParagraphEmpty
3327 +   (GNOME_GtkHTML_Editor_Engine _obj, CORBA_Environment * ev)
3328 +{
3329 +   CORBA_boolean _ORBIT_retval;
3330 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3331 +
3332 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3333 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3334 +       (_ORBIT_epv =
3335 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3336 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3337 +       isPreviousParagraphEmpty) {
3338 +      ORBIT_STUB_PreCall(_obj);
3339 +      _ORBIT_retval =
3340 +        _ORBIT_epv->isPreviousParagraphEmpty(ORBIT_STUB_GetServant(_obj),
3341 +                                             ev);
3342 +      ORBIT_STUB_PostCall(_obj);
3343 +   } else {                    /* remote marshal */
3344 +      ORBit_small_invoke_stub_n(_obj,
3345 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3346 +                               methods, 8, &_ORBIT_retval, NULL, NULL, ev);
3347 +
3348 +   }
3349 +   return _ORBIT_retval;
3350 +}
3351 +
3352 +void
3353 +GNOME_GtkHTML_Editor_Engine_insertHTML(GNOME_GtkHTML_Editor_Engine _obj,
3354 +                                      const CORBA_char * html,
3355 +                                      CORBA_Environment * ev)
3356 +{
3357 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3358 +
3359 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3360 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3361 +       (_ORBIT_epv =
3362 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3363 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3364 +       insertHTML) {
3365 +      ORBIT_STUB_PreCall(_obj);
3366 +      _ORBIT_epv->insertHTML(ORBIT_STUB_GetServant(_obj), html, ev);
3367 +      ORBIT_STUB_PostCall(_obj);
3368 +   } else {                    /* remote marshal */
3369 +      gpointer _args[1];
3370 +
3371 +      _args[0] = (gpointer) & html;
3372 +      ORBit_small_invoke_stub_n(_obj,
3373 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3374 +                               methods, 9, NULL, _args, NULL, ev);
3375 +
3376 +   }
3377 +}
3378 +void
3379 +GNOME_GtkHTML_Editor_Engine_freeze(GNOME_GtkHTML_Editor_Engine _obj,
3380 +                                  CORBA_Environment * ev)
3381 +{
3382 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3383 +
3384 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3385 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3386 +       (_ORBIT_epv =
3387 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3388 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3389 +       freeze) {
3390 +      ORBIT_STUB_PreCall(_obj);
3391 +      _ORBIT_epv->freeze(ORBIT_STUB_GetServant(_obj), ev);
3392 +      ORBIT_STUB_PostCall(_obj);
3393 +   } else {                    /* remote marshal */
3394 +      ORBit_small_invoke_stub_n(_obj,
3395 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3396 +                               methods, 10, NULL, NULL, NULL, ev);
3397 +
3398 +   }
3399 +}
3400 +void
3401 +GNOME_GtkHTML_Editor_Engine_thaw(GNOME_GtkHTML_Editor_Engine _obj,
3402 +                                CORBA_Environment * ev)
3403 +{
3404 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3405 +
3406 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3407 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3408 +       (_ORBIT_epv =
3409 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3410 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3411 +       thaw) {
3412 +      ORBIT_STUB_PreCall(_obj);
3413 +      _ORBIT_epv->thaw(ORBIT_STUB_GetServant(_obj), ev);
3414 +      ORBIT_STUB_PostCall(_obj);
3415 +   } else {                    /* remote marshal */
3416 +      ORBit_small_invoke_stub_n(_obj,
3417 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3418 +                               methods, 11, NULL, NULL, NULL, ev);
3419 +
3420 +   }
3421 +}
3422 +void
3423 +GNOME_GtkHTML_Editor_Engine_undoBegin(GNOME_GtkHTML_Editor_Engine _obj,
3424 +                                     const CORBA_char * undo_name,
3425 +                                     const CORBA_char * redo_name,
3426 +                                     CORBA_Environment * ev)
3427 +{
3428 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3429 +
3430 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3431 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3432 +       (_ORBIT_epv =
3433 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3434 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3435 +       undoBegin) {
3436 +      ORBIT_STUB_PreCall(_obj);
3437 +      _ORBIT_epv->undoBegin(ORBIT_STUB_GetServant(_obj), undo_name, redo_name,
3438 +                           ev);
3439 +      ORBIT_STUB_PostCall(_obj);
3440 +   } else {                    /* remote marshal */
3441 +      gpointer _args[2];
3442 +
3443 +      _args[0] = (gpointer) & undo_name;
3444 +      _args[1] = (gpointer) & redo_name;
3445 +      ORBit_small_invoke_stub_n(_obj,
3446 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3447 +                               methods, 12, NULL, _args, NULL, ev);
3448 +
3449 +   }
3450 +}
3451 +void
3452 +GNOME_GtkHTML_Editor_Engine_undoEnd(GNOME_GtkHTML_Editor_Engine _obj,
3453 +                                   CORBA_Environment * ev)
3454 +{
3455 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3456 +
3457 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3458 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3459 +       (_ORBIT_epv =
3460 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3461 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3462 +       undoEnd) {
3463 +      ORBIT_STUB_PreCall(_obj);
3464 +      _ORBIT_epv->undoEnd(ORBIT_STUB_GetServant(_obj), ev);
3465 +      ORBIT_STUB_PostCall(_obj);
3466 +   } else {                    /* remote marshal */
3467 +      ORBit_small_invoke_stub_n(_obj,
3468 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3469 +                               methods, 13, NULL, NULL, NULL, ev);
3470 +
3471 +   }
3472 +}
3473 +void
3474 +GNOME_GtkHTML_Editor_Engine_ignoreWord(GNOME_GtkHTML_Editor_Engine _obj,
3475 +                                      const CORBA_char * word,
3476 +                                      CORBA_Environment * ev)
3477 +{
3478 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3479 +
3480 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3481 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3482 +       (_ORBIT_epv =
3483 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3484 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3485 +       ignoreWord) {
3486 +      ORBIT_STUB_PreCall(_obj);
3487 +      _ORBIT_epv->ignoreWord(ORBIT_STUB_GetServant(_obj), word, ev);
3488 +      ORBIT_STUB_PostCall(_obj);
3489 +   } else {                    /* remote marshal */
3490 +      gpointer _args[1];
3491 +
3492 +      _args[0] = (gpointer) & word;
3493 +      ORBit_small_invoke_stub_n(_obj,
3494 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3495 +                               methods, 14, NULL, _args, NULL, ev);
3496 +
3497 +   }
3498 +}
3499 +void
3500 +GNOME_GtkHTML_Editor_Engine_dropUndo(GNOME_GtkHTML_Editor_Engine _obj,
3501 +                                    CORBA_Environment * ev)
3502 +{
3503 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3504 +
3505 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3506 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3507 +       (_ORBIT_epv =
3508 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3509 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3510 +       dropUndo) {
3511 +      ORBIT_STUB_PreCall(_obj);
3512 +      _ORBIT_epv->dropUndo(ORBIT_STUB_GetServant(_obj), ev);
3513 +      ORBIT_STUB_PostCall(_obj);
3514 +   } else {                    /* remote marshal */
3515 +      ORBit_small_invoke_stub_n(_obj,
3516 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3517 +                               methods, 15, NULL, NULL, NULL, ev);
3518 +
3519 +   }
3520 +}
3521 +CORBA_boolean
3522 +GNOME_GtkHTML_Editor_Engine_hasUndo(GNOME_GtkHTML_Editor_Engine _obj,
3523 +                                   CORBA_Environment * ev)
3524 +{
3525 +   CORBA_boolean _ORBIT_retval;
3526 +   POA_GNOME_GtkHTML_Editor_Engine__epv *_ORBIT_epv;
3527 +
3528 +   if (ORBit_small_flags & ORBIT_SMALL_FAST_LOCALS &&
3529 +       ORBIT_STUB_IsBypass(_obj, GNOME_GtkHTML_Editor_Engine__classid) &&
3530 +       (_ORBIT_epv =
3531 +       (POA_GNOME_GtkHTML_Editor_Engine__epv *) ORBIT_STUB_GetEpv(_obj,
3532 +                                                                  GNOME_GtkHTML_Editor_Engine__classid))->
3533 +       hasUndo) {
3534 +      ORBIT_STUB_PreCall(_obj);
3535 +      _ORBIT_retval = _ORBIT_epv->hasUndo(ORBIT_STUB_GetServant(_obj), ev);
3536 +      ORBIT_STUB_PostCall(_obj);
3537 +   } else {                    /* remote marshal */
3538 +      ORBit_small_invoke_stub_n(_obj,
3539 +                               &GNOME_GtkHTML_Editor_Engine__iinterface.
3540 +                               methods, 16, &_ORBIT_retval, NULL, NULL, ev);
3541 +
3542 +   }
3543 +   return _ORBIT_retval;
3544 +}
3545 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gui.c vim/src/gui.c
3546 --- vimcopy/src/gui.c   Sat Jan 10 13:10:01 2004
3547 +++ vim/src/gui.c       Sat Jan 10 13:06:43 2004
3548 @@ -439,8 +439,12 @@
3549       * Create the GUI shell.
3550       */
3551      gui.in_use = TRUE;         /* Must be set after menus have been set up */
3552 +#ifdef FEAT_GUI_COMPONENT
3553 +    vim_bonobo_wait_for_instantiation();
3554 +#else
3555      if (gui_mch_init() == FAIL)
3556         goto error;
3557 +#endif
3558  
3559      /* Avoid a delay for an error message that was printed in the terminal
3560       * where Vim was started. */
3561 @@ -4061,8 +4065,8 @@
3562  
3563  #ifdef FEAT_GUI_GTK
3564         /* Need to wake up the main loop */
3565 -       if (gtk_main_level() > 0)
3566 -           gtk_main_quit();
3567 +       if (MAIN_LEVEL() > 0)
3568 +           MAIN_QUIT();
3569  #endif
3570      }
3571  }
3572 @@ -4275,8 +4279,12 @@
3573      int
3574  no_console_input()
3575  {
3576 -    return ((!gui.in_use || gui.starting)
3577 -# ifndef NO_CONSOLE
3578 +    return ((!gui.in_use || gui.starting || !gui.shell_created
3579 +#ifdef FEAT_GUI_COMPONENT
3580 +            || gui.processing_call
3581 +#endif
3582 +                )
3583 +# if !defined(NO_CONSOLE) && !defined(FEAT_GUI_COMPONENT)
3584             && !isatty(0) && !isatty(2)
3585  # endif
3586             );
3587 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gui.h vim/src/gui.h
3588 --- vimcopy/src/gui.h   Tue May  6 12:02:22 2003
3589 +++ vim/src/gui.h       Mon Oct 27 22:28:19 2003
3590 @@ -35,6 +35,22 @@
3591  # include <gtk/gtk.h>
3592  #endif
3593  
3594 +# if defined(FEAT_GUI_GNOME) && defined(FEAT_GUI_COMPONENT)
3595 +    #include "libbonoboui.h"
3596 +    #include "vim_bonobo_main.h"
3597 +    #include "vim_bonobo_factory.h"
3598 +    #define MAIN vim_bonobo_main
3599 +    #define MAIN_LEVEL vim_bonobo_main_level
3600 +    #define MAIN_QUIT vim_bonobo_main_quit
3601 +    #define MAIN_ITERATION_DO vim_bonobo_main_iteration_do
3602 +    #define NO_CONSOLE
3603 +# else
3604 +    #define MAIN gtk_main
3605 +    #define MAIN_LEVEL gtk_main_level
3606 +    #define MAIN_QUIT gtk_main_quit
3607 +    #define MAIN_ITERATION_DO gtk_main_iteration_do
3608 +#endif
3609 +
3610  #ifdef FEAT_GUI_BEOS
3611  # include "gui_beos.h"
3612  #endif
3613 @@ -392,6 +408,14 @@
3614      GtkWidget  *toolbar;           /* toolbar */
3615  # endif
3616  # ifdef FEAT_GUI_GNOME
3617 +#  ifdef FEAT_GUI_COMPONENT
3618 +    GtkWidget     *vbox;
3619 +    BonoboPlug    *plug;
3620 +    BonoboControl *control;
3621 +    BonoboPersistStream * pstream;
3622 +    BonoboPersistFile * pfile;
3623 +    int                 processing_call;   /* gui loop is handling a call */
3624 +#  endif
3625      GtkWidget  *menubar_h;         /* menubar handle */
3626      GtkWidget  *toolbar_h;         /* toolbar handle */
3627  # endif
3628 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gui_gtk.c vim/src/gui_gtk.c
3629 --- vimcopy/src/gui_gtk.c       Thu Jan 15 10:17:11 2004
3630 +++ vim/src/gui_gtk.c   Thu Jan 15 10:13:18 2004
3631 @@ -39,7 +39,7 @@
3632  
3633  #include "vim.h"
3634  
3635 -#ifdef FEAT_GUI_GNOME
3636 +#if 0
3637  /* Gnome redefines _() and N_().  Grrr... */
3638  # ifdef _
3639  #  undef _
3640 @@ -549,9 +549,332 @@
3641  
3642  # endif /* !HAVE_GTK2 */
3643  
3644 +#ifdef FEAT_GUI_COMPONENT
3645 +
3646 +
3647 +static void
3648 +verb_activate( BonoboUIComponent *uic, gpointer data, const char *cname )
3649 +{
3650 +    gui_menu_cb((vimmenu_T *) data);
3651 +
3652 +    /* make sure the menu action is taken immediately */
3653 +    if (MAIN_LEVEL() > 0)
3654 +       MAIN_QUIT();
3655 +}
3656 +
3657 +/* Takes name (a label), and appends a normalized version of name to
3658 + * the destination string.  Normalization in this case means taking only 
3659 + * alphanumeric characters, and discarding all others.  */
3660 +static void g_string_append_normalized_name( GString * dest, char_u * name )
3661 +{
3662 +    gchar * cur;
3663 +
3664 +    if( name == NULL ) 
3665 +    {
3666 +        return;
3667 +    }
3668 +    cur = name;
3669 +    while( *cur != '\0' ) {
3670 +        gunichar wc;
3671 +        wc = g_utf8_get_char(cur);
3672 +        if( g_unichar_isalnum( wc ) ) {
3673 +            g_string_append_unichar( dest, wc );
3674 +        }
3675 +        cur = g_utf8_next_char(cur);
3676 +    }
3677 +}
3678 +
3679 +/* for the given menu, create the corresponding xml path.
3680 + * if to_parent is TRUE, returns the path to the parent of the given menu.
3681 + */
3682 +static
3683 +char * xml_path_for_menu( vimmenu_T * menu, int to_parent )
3684 +{
3685 +    GString * normname;
3686 +    GString * path;
3687 +    char * retpath;
3688 +    
3689 +    normname = g_string_sized_new( 64 );
3690 +    path = g_string_sized_new( 128 );
3691 +    while( 1 ) {
3692 +        if( menu_is_toolbar(menu->name) ) {
3693 +            /* "Toolbar" is a standard Bonobo UI element, but Vim uses "ToolBar", so we
3694 +             * have to check for this. */
3695 +            g_string_prepend( path, "/Toolbar");
3696 +        } else {
3697 +            g_string_assign( normname, "" );
3698 +            g_string_append_normalized_name( normname, menu->dname );
3699 +            g_string_prepend( path, normname->str );
3700 +            g_string_prepend( path, "/" );
3701 +        }
3702 +        if( menu->parent == NULL ) {
3703 +            if( menu && menu_is_menubar( menu->name ) ) {
3704 +                g_string_prepend( path, "/menu" );
3705 +            }
3706 +            break;
3707 +        }
3708 +        menu = menu->parent;
3709 +    }
3710 +    g_string_free( normname, TRUE );
3711 +    retpath = path->str;
3712 +    g_string_free( path, FALSE );
3713 +
3714 +    if( to_parent ) {
3715 +        gchar * slash;
3716 +        slash = g_strrstr(retpath, "/");
3717 +        if( slash == retpath )
3718 +            slash[1] = '\0';
3719 +        else if( slash ) 
3720 +            *slash = '\0';
3721 +    }
3722 +    return( retpath );
3723 +}
3724 +
3725 +/* Because the container which embeds Vim may not have the same toolbar icons
3726 + * installed, we need to send the icons in the XML stream.  This function
3727 + * takes the given GtkImage, encodes it as XML and returns the resulting XML
3728 + * as a string. */
3729 +static char *
3730 +gtk_image_to_xml_attrs( GtkImage * image)
3731 +{
3732 +    GString * xml = g_string_sized_new(32);
3733 +    GtkImageType type = gtk_image_get_storage_type(image);
3734 +    char * attrs;
3735 +    char * imagexml;
3736 +
3737 +    if( type == GTK_IMAGE_STOCK ) {
3738 +        GtkIconSize size;
3739 +        GtkIconSet * iconset;
3740 +        gchar * stockname;
3741 +        GdkPixbuf * pixbuf;
3742 +
3743 +        gtk_image_get_stock(image, &stockname, &size);
3744 +        pixbuf = gtk_widget_render_icon(gui.drawarea, stockname, size, NULL);
3745 +        imagexml = bonobo_ui_util_pixbuf_to_xml(pixbuf);
3746 +        g_string_append_printf(xml, " pixtype=\"pixbuf\" pixname=\"%s\"", imagexml);
3747 +        g_object_unref(pixbuf);
3748 +        g_free(imagexml);
3749 +    } else if( type == GTK_IMAGE_PIXBUF ) {
3750 +        imagexml = bonobo_ui_util_pixbuf_to_xml(gtk_image_get_pixbuf(image));
3751 +        g_string_append_printf(xml, " pixtype=\"pixbuf\" pixname=\"%s\"", imagexml);
3752 +        g_free(imagexml);
3753 +    }
3754 +    attrs = xml->str;
3755 +    g_string_free(xml, FALSE);
3756 +    return( attrs );
3757 +}
3758 +
3759 +
3760 +/* Generate XML which represents Vim's menus and toolbars.  Starts from the
3761 + * given menu entry.  XML is appended to "xml", and commands/verbs are added
3762 + * to the "commands" list.  If do_siblings is true, XML is also generated for
3763 + * the siblings of the given menu (following the menu->next pointer); otherwise
3764 + * only the menu and its descendents are processed.
3765 + */
3766 +static
3767 +void generate_gui_xml_recurse( vimmenu_T * menu, GString * xml, GSList ** commands, int do_siblings)
3768 +{
3769 +    GString * normname = g_string_sized_new(16);
3770 +    GString * verbname = g_string_sized_new(32);
3771 +    char_u * label;
3772 +    int use_mnemonic;
3773 +    BonoboUIComponent *uic;
3774 +    gchar * command;
3775 +
3776 +    uic = bonobo_control_get_ui_component (BONOBO_CONTROL (gui.control));
3777 +
3778 +    while( menu ) 
3779 +    {
3780 +        use_mnemonic = (p_wak[0] != 'n' );
3781 +        label = translate_mnemonic_tag( menu->name, use_mnemonic );
3782 +        g_string_assign( normname, "" );
3783 +        g_string_append_normalized_name( normname, menu->dname );
3784 +        if( menu->children ) {
3785 +            if( menu_is_toolbar( menu->name )) {
3786 +                g_string_append( xml, "<dockitem name=\"Toolbar\" look=\"icon\" tips=\"1\">");
3787 +                generate_gui_xml_recurse( menu->children, xml, commands, TRUE );
3788 +                g_string_append( xml, "</dockitem>");
3789 +            } else {
3790 +                g_string_append_printf( xml, "<submenu name=\"%s\" label=\"%s\">\n", normname->str, label);
3791 +
3792 +                generate_gui_xml_recurse( menu->children, xml, commands, TRUE );
3793 +                g_string_append( xml, "</submenu>\n");
3794 +            }
3795 +        } else if( menu_is_separator(menu->name)) {
3796 +            g_string_append( xml, "<separator />\n" );
3797 +        } else if( menu->parent && menu_is_toolbar(menu->parent->name)) {
3798 +            char * menupath = xml_path_for_menu(menu, FALSE);
3799 +            GtkImage *image = NULL;
3800 +            char * imagexml;
3801 +            char_u *tooltip;
3802 +
3803 +            g_string_assign(verbname, "");
3804 +            g_string_append_normalized_name(verbname, menupath);
3805 +            vim_free(menupath);
3806 +            image = GTK_IMAGE(create_menu_icon(menu, GTK_ICON_SIZE_SMALL_TOOLBAR));
3807 +            imagexml = gtk_image_to_xml_attrs(image);
3808 +            tooltip = CONVERT_TO_UTF8(menu->strings[MENU_INDEX_TIP]);
3809 +            g_string_append_printf( xml, "<toolitem name=\"%s\" label=\"%s\" verb=\"%s\" tip=\"%s\" %s />\n", normname->str, label, verbname->str, tooltip, imagexml);
3810 +            gtk_object_sink(GTK_OBJECT(image));
3811 +            g_free(imagexml);
3812 +            CONVERT_TO_UTF8_FREE(tooltip);
3813 +            
3814 +            command = g_strdup_printf( "<cmd name=\"%s\" sensitive=\"%c\" />\n", verbname->str, menu->sensitive ? '1' : '0');
3815 +            *commands = g_slist_prepend( *commands, command );
3816 +            bonobo_ui_component_add_verb(uic, verbname->str, verb_activate, menu);
3817 +        } else if( menu_is_menubar(menu->name)) {
3818 +            char * menupath = xml_path_for_menu(menu, FALSE);
3819 +
3820 +            g_string_assign(verbname, "");
3821 +            g_string_append_normalized_name(verbname, menupath);
3822 +            vim_free(menupath);
3823 +            
3824 +            g_string_append_printf( xml, "<menuitem name=\"%s\" label=\"%s\" verb=\"%s\" />\n", normname->str, label, verbname->str);
3825 +
3826 +            command = g_strdup_printf( "<cmd name=\"%s\" sensitive=\"%c\" />\n", verbname->str, menu->sensitive ? '1' : '0');
3827 +            *commands = g_slist_prepend( *commands, command );
3828 +            bonobo_ui_component_add_verb(uic, verbname->str, verb_activate, menu);
3829 +        }
3830 +        if( label ) {
3831 +            vim_free( label );
3832 +        }
3833 +        if( do_siblings ) {
3834 +            menu = menu->next;
3835 +        } else {
3836 +            menu = NULL;
3837 +        }
3838 +    }
3839 +    g_string_free( normname, TRUE );
3840 +}
3841 +
3842 +/* Create XML representing the menus and toolbars, and send them to the
3843 + * container application.  We only need to process menu entries which
3844 + * have changed (they are marked "dirty"). */
3845 +static
3846 +void set_gui_xml(vimmenu_T * menu)
3847 +{
3848 +    GSList * commands = NULL;
3849 +    GSList * command;
3850 +    BonoboUIComponent *uic;
3851 +    GString * xml = g_string_sized_new(1024);
3852 +    int path_exists;
3853 +    uic = bonobo_control_get_ui_component (BONOBO_CONTROL (gui.control));
3854 +
3855 +    if( bonobo_ui_component_get_container(uic) == CORBA_OBJECT_NIL ) {
3856 +        return;
3857 +    }
3858 +
3859 +    while( menu ) {
3860 +        if( menu->dirty ) {
3861 +            if (menu_is_popup(menu->name)) {
3862 +                /* do nothing */            
3863 +            } else if( menu_is_menubar(menu->name)) {
3864 +                char * menupath = xml_path_for_menu(menu, TRUE);
3865 +                path_exists = bonobo_ui_component_path_exists(uic, menupath, NULL);
3866 +                g_string_assign(xml, "");
3867 +                generate_gui_xml_recurse (menu, xml, &commands, FALSE);
3868 +                /*fprintf(stdout, "set %s\n", menupath);*/
3869 +                /*fprintf(stdout, "set %s\n%s", menupath, xml->str);*/
3870 +                /*fflush(stdout);*/
3871 +                bonobo_ui_component_set(uic, menupath, xml->str, NULL);
3872 +                g_free(menupath);
3873 +            } else if( menu_is_toolbar(menu->name)) {
3874 +                char * menupath = xml_path_for_menu(menu, TRUE);
3875 +                path_exists = bonobo_ui_component_path_exists(uic, menupath, NULL);
3876 +                g_string_assign(xml, "");
3877 +                generate_gui_xml_recurse (menu, xml, &commands, FALSE);
3878 +                /*fprintf(stdout, "set %s\n", menupath);*/
3879 +                /*fprintf(stdout, "set %s\n%s", menupath, xml->str);*/
3880 +                /*fflush(stdout);*/
3881 +                bonobo_ui_component_set(uic, menupath, xml->str, NULL);
3882 +                g_free(menupath);
3883 +            }
3884 +            menu->dirty = FALSE;
3885 +        }
3886 +        menu = menu->next;
3887 +    }
3888 +    /* the commands are inserted separately into a list, and set one by one,
3889 +     * otherwise it's not possible to update a subtree of the UI 
3890 +     */
3891 +    command = commands;
3892 +    while( command ) {
3893 +        /*fprintf(stdout, "set %s\n%s", "/commands", command->data);
3894 +        fflush(stdout);*/
3895 +        bonobo_ui_component_set(uic, "/commands", command->data, NULL);
3896 +        g_free(command->data);
3897 +        command = command->next;
3898 +    }
3899 +    g_slist_free( commands );
3900 +}
3901 +
3902 +
3903 +/* remember whether a timeout has been scheduled for updating the gui */
3904 +static gboolean update_gui_idle_installed = FALSE;
3905 +
3906 +/* if we have been embedded in a container, update the gui now, otherwise
3907 + * wait awhile and try again. */
3908 +static gboolean
3909 +update_gui_idle(gpointer data)
3910 +{
3911 +    BonoboUIComponent *uic;
3912 +
3913 +    uic = bonobo_control_get_ui_component (BONOBO_CONTROL (gui.control));
3914 +    if( bonobo_ui_component_get_container(uic) == CORBA_OBJECT_NIL ) {
3915 +        /* we aren't in a container yet; try again later... */
3916 +        g_timeout_add(100, &update_gui_idle, NULL);
3917 +        return FALSE;
3918 +    }
3919 +    bonobo_ui_component_freeze(uic, NULL);
3920 +    set_gui_xml( (vimmenu_T *)root_menu );
3921 +    update_gui_idle_installed = FALSE;
3922 +    bonobo_ui_component_thaw(uic, NULL);
3923 +    return FALSE; /* don't call me again */
3924 +}
3925 +
3926 +/* Mark the given menu as dirty -- we need to re-send the XML representing
3927 + * this menu to the container.  But don't do the update immediately; otherwise
3928 + * we'd be generating the complete UI XML each time a menu entry is added,
3929 + * which would be very slow.  Instead, schedule an update in which all 
3930 + * dirty menus will be processed. */
3931 +void
3932 +update_menu_later(vimmenu_T *menu)
3933 +{
3934 +    if (!update_gui_idle_installed)
3935 +    {
3936 +        update_gui_idle_installed = TRUE;
3937 +        g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
3938 +                        &update_gui_idle, NULL, NULL);
3939 +    }
3940 +    while( menu->parent ) 
3941 +        menu = menu->parent;
3942 +    menu->dirty = TRUE;
3943 +}
3944 +
3945 +/* Schedule an update for the entire UI (all menus and toolbars) */
3946 +void update_ui_later()
3947 +{
3948 +    vimmenu_T *menu = root_menu;
3949 +
3950 +    if (!update_gui_idle_installed)
3951 +    {
3952 +        update_gui_idle_installed = TRUE;
3953 +        g_idle_add_full(GDK_PRIORITY_EVENTS + 10,
3954 +                        &update_gui_idle, NULL, NULL);
3955 +    }
3956 +    while( menu ) {
3957 +        menu->dirty = TRUE;
3958 +        menu = menu->next;
3959 +    }
3960 +}
3961 +#endif
3962 +
3963      void
3964  gui_mch_add_menu(vimmenu_T *menu, int idx)
3965  {
3966 +#ifdef FEAT_GUI_COMPONENT
3967 +    update_menu_later(menu);
3968 +    return;
3969 +#else
3970      vimmenu_T  *parent;
3971      GtkWidget  *parent_widget;
3972  
3973 @@ -597,6 +920,7 @@
3974      if (vim_strchr(p_go, GO_TEAROFF) != NULL)
3975         gtk_widget_show(menu->tearoff_handle);
3976      gtk_menu_prepend(GTK_MENU(menu->submenu_id), menu->tearoff_handle);
3977 +#endif
3978  }
3979  
3980  /*ARGSUSED*/
3981 @@ -613,8 +937,8 @@
3982  # endif
3983  
3984      /* make sure the menu action is taken immediately */
3985 -    if (gtk_main_level() > 0)
3986 -       gtk_main_quit();
3987 +    if (MAIN_LEVEL() > 0)
3988 +       MAIN_QUIT();
3989  }
3990  
3991  # if defined(FEAT_TOOLBAR) && !defined(HAVE_GTK2)
3992 @@ -719,6 +1043,10 @@
3993      void
3994  gui_mch_add_menu_item(vimmenu_T *menu, int idx)
3995  {
3996 +#ifdef FEAT_GUI_COMPONENT
3997 +    update_menu_later(menu);
3998 +    return;
3999 +#else
4000      vimmenu_T *parent;
4001  
4002      parent = menu->parent;
4003 @@ -821,6 +1149,7 @@
4004             gtk_signal_connect(GTK_OBJECT(menu->id), "activate",
4005                                GTK_SIGNAL_FUNC(menu_item_activate), menu);
4006      }
4007 +#endif
4008  }
4009  #endif /* FEAT_MENU */
4010  
4011 @@ -845,6 +1174,10 @@
4012      guint      accel_key;
4013  # endif
4014  
4015 +#ifdef FEAT_GUI_COMPONENT
4016 +    return;
4017 +#endif
4018 +
4019      for (menu = root_menu; menu != NULL; menu = menu->next)
4020      {
4021         if (menu->id == NULL)
4022 @@ -901,6 +1234,9 @@
4023      void
4024  gui_mch_toggle_tearoffs(int enable)
4025  {
4026 +#ifdef FEAT_GUI_COMPONENT
4027 +    return;
4028 +#endif
4029      recurse_tearoffs(root_menu, enable);
4030  }
4031  #endif /* FEAT_MENU */
4032 @@ -1005,6 +1341,9 @@
4033      void
4034  gui_mch_destroy_menu(vimmenu_T *menu)
4035  {
4036 +#ifdef FEAT_GUI_COMPONENT
4037 +    return;
4038 +#endif
4039  # ifdef FEAT_TOOLBAR
4040      if (menu->parent != NULL && menu_is_toolbar(menu->parent->name))
4041      {
4042 @@ -1119,8 +1458,8 @@
4043  
4044      gui_drag_scrollbar(sb, value, dragging);
4045  
4046 -    if (gtk_main_level() > 0)
4047 -       gtk_main_quit();
4048 +    if (MAIN_LEVEL() > 0)
4049 +       MAIN_QUIT();
4050  }
4051  
4052  /* SBAR_VERT or SBAR_HORIZ */
4053 @@ -1179,8 +1518,8 @@
4054      vw->browse_fname = (char_u *)g_strdup(gtk_file_selection_get_filename(
4055                                         GTK_FILE_SELECTION(vw->filedlg)));
4056      gtk_widget_hide(vw->filedlg);
4057 -    if (gtk_main_level() > 0)
4058 -       gtk_main_quit();
4059 +    if (MAIN_LEVEL() > 0)
4060 +       MAIN_QUIT();
4061  }
4062  
4063  /*ARGSUSED*/
4064 @@ -1195,8 +1534,8 @@
4065         vw->browse_fname = NULL;
4066      }
4067      gtk_widget_hide(vw->filedlg);
4068 -    if (gtk_main_level() > 0)
4069 -       gtk_main_quit();
4070 +    if (MAIN_LEVEL() > 0)
4071 +       MAIN_QUIT();
4072  }
4073  
4074  /*ARGSUSED*/
4075 @@ -1210,8 +1549,8 @@
4076      }
4077      gui.filedlg = NULL;
4078  
4079 -    if (gtk_main_level() > 0)
4080 -       gtk_main_quit();
4081 +    if (MAIN_LEVEL() > 0)
4082 +       MAIN_QUIT();
4083  
4084      return FALSE;
4085  }
4086 @@ -1294,7 +1633,7 @@
4087  
4088      gtk_widget_show(gui.filedlg);
4089      while (gui.filedlg && GTK_WIDGET_DRAWABLE(gui.filedlg))
4090 -       gtk_main_iteration_do(TRUE);
4091 +       MAIN_ITERATION_DO(TRUE);
4092  
4093      if (gui.browse_fname == NULL)
4094         return NULL;
4095 @@ -1514,8 +1853,8 @@
4096  dlg_destroy_cb(int *p)
4097  {
4098      *p = TRUE;         /* set dialog_destroyed to break out of the loop */
4099 -    if (gtk_main_level() > 0)
4100 -       gtk_main_quit();
4101 +    if (MAIN_LEVEL() > 0)
4102 +       MAIN_QUIT();
4103  }
4104  
4105  /* ARGSUSED */
4106 @@ -1815,7 +2154,7 @@
4107      /* loop here until the dialog goes away */
4108      while (dialog_status == -1 && !dialog_destroyed
4109                                                && GTK_WIDGET_DRAWABLE(dialog))
4110 -       gtk_main_iteration_do(TRUE);
4111 +       MAIN_ITERATION_DO(TRUE);
4112  
4113      if (dialog_status < 0)
4114         dialog_status = 0;
4115 @@ -2799,8 +3138,8 @@
4116      CONVERT_FROM_UTF8_FREE(find_text);
4117  #endif
4118  
4119 -    if (rc && gtk_main_level() > 0)
4120 -       gtk_main_quit(); /* make sure cmd will be handled immediately */
4121 +    if (rc && MAIN_LEVEL() > 0)
4122 +        MAIN_QUIT(); /* make sure cmd will be handled immediately */
4123  }
4124  
4125  /* our usual callback function */
4126 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/gui_gtk_x11.c vim/src/gui_gtk_x11.c
4127 --- vimcopy/src/gui_gtk_x11.c   Thu Jan 15 10:17:11 2004
4128 +++ vim/src/gui_gtk_x11.c       Thu Jan 15 10:13:19 2004
4129 @@ -24,6 +24,7 @@
4130  #include "vim.h"
4131  #ifdef FEAT_GUI_GNOME
4132  /* Gnome redefines _() and N_().  Grrr... */
4133 +#if 0
4134  # ifdef _
4135  #  undef _
4136  # endif
4137 @@ -36,6 +37,7 @@
4138  # ifdef bindtextdomain
4139  #  undef bindtextdomain
4140  # endif
4141 +#endif
4142  # if defined(FEAT_GETTEXT) && !defined(ENABLE_NLS)
4143  #  define ENABLE_NLS   /* so the texts in the dialog boxes are translated */
4144  # endif
4145 @@ -615,9 +617,10 @@
4146  expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
4147  {
4148      /* Skip this when the GUI isn't set up yet, will redraw later. */
4149 -    if (gui.starting)
4150 +    if (gui.starting) {
4151 +        g_warning("ignoring expose_event; gui still starting.\n");
4152         return FALSE;
4153 -
4154 +    }
4155      out_flush();               /* make sure all output has been processed */
4156      gui_redraw(event->area.x, event->area.y,
4157                event->area.width, event->area.height);
4158 @@ -658,8 +661,8 @@
4159         xev.xproperty.state = PropertyNewValue;
4160         serverEventProc(GDK_WINDOW_XDISPLAY(widget->window), &xev);
4161  
4162 -       if (gtk_main_level() > 0)
4163 -           gtk_main_quit();
4164 +       if (MAIN_LEVEL() > 0)
4165 +           MAIN_QUIT();
4166      }
4167      return FALSE;
4168  }
4169 @@ -760,6 +763,10 @@
4170      if (blink_state == BLINK_NONE)
4171         gui_mch_start_blink();
4172  
4173 +#ifdef FEAT_GUI_COMPONENT
4174 +    /*gtk_plug_grab_focus(GTK_PLUG(gui.plug));*/
4175 +    /*gtk_window_set_focus(GTK_WINDOW(gui.plug), gui.drawarea);*/
4176 +#endif
4177      /* make sure keyboard input goes there */
4178      if (gtk_socket_id == 0 || !GTK_WIDGET_HAS_FOCUS(gui.drawarea))
4179         gtk_widget_grab_focus(gui.drawarea);
4180 @@ -771,6 +778,11 @@
4181      static gint
4182  leave_notify_event(GtkWidget *widget, GdkEventCrossing *event, gpointer data)
4183  {
4184 +#ifdef FEAT_GUI_COMPONENT
4185 +    /*gtk_plug_ungrab_focus(GTK_PLUG(gui.plug));*/
4186 +    /*gdk_display_keyboard_ungrab (gtk_widget_get_display (gui.drawarea),
4187 +                                 gtk_get_current_event_time ());*/
4188 +#endif
4189      if (blink_state != BLINK_NONE)
4190         gui_mch_stop_blink();
4191  
4192 @@ -781,8 +793,16 @@
4193      static gint
4194  focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
4195  {
4196 +    GdkEventMask mask;
4197      gui_focus_change(TRUE);
4198  
4199 +#ifdef FEAT_GUI_COMPONENT
4200 +    gtk_widget_grab_focus(gui.drawarea);
4201 +    mask = gdk_window_get_events(gui.drawarea->window);
4202 +    mask |= GDK_KEY_PRESS | GDK_KEY_RELEASE;
4203 +    gdk_window_set_events(gui.drawarea->window, mask);
4204 +#endif
4205 +
4206      if (blink_state == BLINK_NONE)
4207         gui_mch_start_blink();
4208  
4209 @@ -797,6 +817,9 @@
4210      static gint
4211  focus_out_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
4212  {
4213 +#ifdef FEAT_GUI_COMPONENT
4214 +/*    gtk_plug_ungrab_focus(GTK_PLUG(gui.plug));*/
4215 +#endif
4216      gui_focus_change(FALSE);
4217  
4218      if (blink_state != BLINK_NONE)
4219 @@ -1138,8 +1161,8 @@
4220      if (p_mh)
4221         gui_mch_mousehide(TRUE);
4222  
4223 -    if (gtk_main_level() > 0)
4224 -       gtk_main_quit();
4225 +    if (MAIN_LEVEL() > 0)
4226 +        MAIN_QUIT();
4227  
4228      return TRUE;
4229  }
4230 @@ -1174,8 +1197,8 @@
4231      else
4232         clip_lose_selection(&clip_star);
4233  
4234 -    if (gtk_main_level() > 0)
4235 -       gtk_main_quit();
4236 +    if (MAIN_LEVEL() > 0)
4237 +       MAIN_QUIT();
4238  
4239      return TRUE;
4240  }
4241 @@ -1215,9 +1238,8 @@
4242         received_selection = RS_FAIL;
4243         /* clip_free_selection(cbd); ??? */
4244  
4245 -       if (gtk_main_level() > 0)
4246 -           gtk_main_quit();
4247 -
4248 +        if (MAIN_LEVEL() > 0)
4249 +            MAIN_QUIT();      /* make sure the above will be handled immediately */
4250         return;
4251      }
4252  
4253 @@ -1298,8 +1320,8 @@
4254      g_free(tmpbuf_utf8);
4255  #endif
4256  
4257 -    if (gtk_main_level() > 0)
4258 -       gtk_main_quit();
4259 +    if (MAIN_LEVEL() > 0)
4260 +        MAIN_QUIT();      /* make sure the above will be handled immediately */
4261  }
4262  
4263  /*
4264 @@ -1459,6 +1481,15 @@
4265         using_gnome = 1;
4266  #endif
4267  
4268 +
4269 +#ifdef FEAT_GUI_COMPONENT
4270 +    if( !vim_bonobo_init(&gui_argc, gui_argv))
4271 +    {
4272 +        /* in component mode, we don't care about trying to continue without 
4273 +         * a gui; if we can't create the factory, we might as well quit. */
4274 +        mch_exit(2);
4275 +    }
4276 +#else
4277      /* Don't use gtk_init() or gnome_init(), it exits on failure. */
4278      if (!gtk_init_check(&gui_argc, &gui_argv))
4279      {
4280 @@ -1466,10 +1497,29 @@
4281         EMSG(_(e_opendisp));
4282         return FAIL;
4283      }
4284 +#endif
4285  
4286      return OK;
4287  }
4288  
4289 +#if FEAT_GUI_COMPONENT
4290 +static gint
4291 +control_activate_event(BonoboControl *control, gboolean activated)
4292 +{
4293 +    if (activated) 
4294 +    {
4295 +        gui_focus_change (TRUE);
4296 +        if (blink_state == BLINK_NONE)
4297 +            gui_mch_start_blink();
4298 +    } else {
4299 +        gui_focus_change (FALSE);
4300 +        if (blink_state != BLINK_NONE)
4301 +            gui_mch_stop_blink();
4302 +    }
4303 +    return TRUE;
4304 +}
4305 +#endif
4306 +
4307  
4308  /****************************************************************************
4309   * Mouse handling callbacks
4310 @@ -1530,8 +1580,8 @@
4311      /* inform the editor engine about the occurence of this event */
4312      gui_send_mouse_event(button, x, y, FALSE, vim_modifiers);
4313  
4314 -    if (gtk_main_level() > 0)
4315 -       gtk_main_quit();
4316 +    if (MAIN_LEVEL() > 0)
4317 +       MAIN_QUIT();
4318  
4319      /*
4320       * Auto repeat timer handling.
4321 @@ -1726,8 +1776,8 @@
4322         vim_modifiers |= MOUSE_ALT;
4323  
4324      gui_send_mouse_event(button, x, y, repeated_click, vim_modifiers);
4325 -    if (gtk_main_level() > 0)
4326 -       gtk_main_quit(); /* make sure the above will be handled immediately */
4327 +    if (MAIN_LEVEL() > 0)
4328 +        MAIN_QUIT();      /* make sure the above will be handled immediately */
4329  
4330      return TRUE;
4331  }
4332 @@ -1775,8 +1825,8 @@
4333      gui_send_mouse_event(button, (int)event->x, (int)event->y,
4334                                                         FALSE, vim_modifiers);
4335  
4336 -    if (gtk_main_level() > 0)
4337 -       gtk_main_quit(); /* make sure the above will be handled immediately */
4338 +    if (MAIN_LEVEL() > 0)
4339 +       MAIN_QUIT();    /* make sure the above will be handled immediately */
4340  
4341      return TRUE;
4342  }
4343 @@ -1811,8 +1861,8 @@
4344         vim_modifiers |= MOUSE_ALT;
4345  
4346      gui_send_mouse_event(MOUSE_RELEASE, x, y, FALSE, vim_modifiers);
4347 -    if (gtk_main_level() > 0)
4348 -       gtk_main_quit();        /* make sure it will be handled immediately */
4349 +    if (MAIN_LEVEL() > 0)
4350 +        MAIN_QUIT();      /* make sure the above will be handled immediately */
4351  
4352      return TRUE;
4353  }
4354 @@ -2035,8 +2085,8 @@
4355      else
4356         add_to_input_buf(dropkey + 3, (int)(sizeof(dropkey) - 3));
4357  
4358 -    if (gtk_main_level() > 0)
4359 -       gtk_main_quit();
4360 +    if (MAIN_LEVEL() > 0)
4361 +        MAIN_QUIT();      /* make sure the above will be handled immediately */
4362  }
4363  
4364  /*
4365 @@ -2502,6 +2552,7 @@
4366      static void
4367  mainwin_realize(GtkWidget *widget, gpointer data)
4368  {
4369 +#ifndef FEAT_GUI_COMPONENT
4370  /* If you get an error message here, you still need to unpack the runtime
4371   * archive! */
4372  #ifdef magick
4373 @@ -2585,6 +2636,7 @@
4374  
4375  #endif /* !HAVE_GTK2 */
4376      }
4377 +#endif /* FEAT_GUI_COMPONENT */
4378  
4379  #if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION))
4380      /* Register a handler for WM_SAVE_YOURSELF with GDK's low-level X I/F */
4381 @@ -2603,7 +2655,7 @@
4382  #endif
4383         setup_save_yourself();
4384  
4385 -#ifdef FEAT_CLIENTSERVER
4386 +#if defined(FEAT_CLIENTSERVER) &&!defined(FEAT_GUI_COMPONENT)
4387      if (serverName == NULL && serverDelayedStartName != NULL)
4388      {
4389         /* This is a :gui command in a plain vim with no previous server */
4390 @@ -2651,7 +2703,7 @@
4391      return cursor;
4392  }
4393  
4394 -#ifdef HAVE_GTK_MULTIHEAD
4395 +#if defined(HAVE_GTK_MULTIHEAD) && !defined(FEAT_GUI_COMPONENT)
4396  /*ARGSUSED1*/
4397      static void
4398  mainwin_screen_changed_cb(GtkWidget  *widget,
4399 @@ -2976,7 +3028,11 @@
4400  #ifdef FEAT_GUI_GNOME
4401         if (using_gnome)
4402         {
4403 -           gui.mainwin = gnome_app_new("Vim", NULL);
4404 +# if defined(FEAT_GUI_COMPONENT)
4405 +            gui.mainwin = NULL;
4406 +# else
4407 +            gui.mainwin = gnome_app_new("vim", NULL);
4408 +# endif
4409  # ifdef USE_XSMP
4410             /* Use the GNOME save-yourself functionality now. */
4411             xsmp_close();
4412 @@ -2987,14 +3043,28 @@
4413             gui.mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
4414      }
4415  
4416 +#ifdef FEAT_GUI_COMPONENT
4417 +    vbox = gtk_vbox_new(FALSE, 0);
4418 +    gui.vbox = vbox;
4419 +#else
4420      gtk_widget_set_name(gui.mainwin, "vim-main-window");
4421 +#endif
4422  
4423  #ifdef HAVE_GTK2
4424      /* Create the PangoContext used for drawing all text. */
4425 +#ifdef FEAT_GUI_COMPONENT
4426 +    gui.text_context = gtk_widget_create_pango_context(GTK_WIDGET(gui.vbox));
4427 +#else
4428      gui.text_context = gtk_widget_create_pango_context(gui.mainwin);
4429 +#endif
4430      pango_context_set_base_dir(gui.text_context, PANGO_DIRECTION_LTR);
4431  #endif
4432  
4433 +#ifdef FEAT_GUI_COMPONENT
4434 +    bonobo_control_construct (BONOBO_CONTROL (gui.control), GTK_WIDGET(gui.vbox));
4435 +    gtk_widget_add_events(GTK_WIDGET(gui.drawarea), GDK_VISIBILITY_NOTIFY_MASK);
4436 +    gtk_widget_show_all(GTK_WIDGET(gui.vbox));
4437 +#else
4438  #ifndef HAVE_GTK2
4439      gtk_window_set_policy(GTK_WINDOW(gui.mainwin), TRUE, TRUE, TRUE);
4440  #endif
4441 @@ -3017,8 +3087,6 @@
4442      gui.accel_group = gtk_accel_group_get_default();
4443  #endif
4444  
4445 -    vbox = gtk_vbox_new(FALSE, 0);
4446 -
4447  #ifdef FEAT_GUI_GNOME
4448      if (using_gnome)
4449      {
4450 @@ -3034,6 +3102,9 @@
4451         gtk_container_add(GTK_CONTAINER(gui.mainwin), vbox);
4452         gtk_widget_show(vbox);
4453      }
4454 +#endif
4455 +  
4456 +#ifndef FEAT_GUI_COMPONENT
4457  
4458  #ifdef FEAT_MENU
4459      /*
4460 @@ -3139,6 +3210,7 @@
4461         gtk_box_pack_start(GTK_BOX(vbox), gui.toolbar, FALSE, FALSE, 0);
4462      }
4463  #endif /* FEAT_TOOLBAR */
4464 +#endif /* FEAT_GUI_COMPONENT */
4465  
4466      gui.formwin = gtk_form_new();
4467      gtk_container_border_width(GTK_CONTAINER(gui.formwin), 0);
4468 @@ -3166,6 +3238,11 @@
4469      gtk_widget_show(gui.formwin);
4470      gtk_box_pack_start(GTK_BOX(vbox), gui.formwin, TRUE, TRUE, 0);
4471  
4472 +#ifdef FEAT_GUI_COMPONENT
4473 +    GTK_WIDGET_SET_FLAGS (gui.drawarea, GTK_CAN_FOCUS);
4474 +    g_signal_connect(G_OBJECT(gui.drawarea), "key_press_event",
4475 +                        G_CALLBACK(key_press_event), NULL);
4476 +#else
4477      /* For GtkSockets, key-presses must go to the focus widget (drawarea)
4478       * and not the window. */
4479      gtk_signal_connect((gtk_socket_id == 0) ? GTK_OBJECT(gui.mainwin)
4480 @@ -3180,6 +3257,7 @@
4481                      "key_release_event",
4482                      G_CALLBACK(&key_release_event), NULL);
4483  #endif
4484 +#endif /* FEAT_GUI_COMPONENT */
4485      gtk_signal_connect(GTK_OBJECT(gui.drawarea), "realize",
4486                        GTK_SIGNAL_FUNC(drawarea_realize_cb), NULL);
4487      gtk_signal_connect(GTK_OBJECT(gui.drawarea), "unrealize",
4488 @@ -3211,16 +3289,27 @@
4489       */
4490      gui.border_offset = gui.border_width;
4491  
4492 +#ifdef FEAT_GUI_COMPONENT
4493 +    gtk_signal_connect(GTK_OBJECT(gui.drawarea), "visibility_notify_event",
4494 +                      GTK_SIGNAL_FUNC(visibility_event), NULL);
4495 +#else
4496      gtk_signal_connect(GTK_OBJECT(gui.mainwin), "visibility_notify_event",
4497                        GTK_SIGNAL_FUNC(visibility_event), NULL);
4498 +#endif
4499      gtk_signal_connect(GTK_OBJECT(gui.drawarea), "expose_event",
4500                        GTK_SIGNAL_FUNC(expose_event), NULL);
4501  
4502      /*
4503       * Only install these enter/leave callbacks when 'p' in 'guioptions'.
4504       * Only needed for some window managers.
4505 +     *
4506 +     * Force this on for bonobo, otherwise the toolbar gets the focus 
4507 +     * after you click a button, and you can't get the focus back to the 
4508 +     * drawarea.
4509       */
4510 +#ifndef FEAT_GUI_COMPONENT
4511      if (vim_strchr(p_go, GO_POINTER) != NULL)
4512 +#endif
4513      {
4514         gtk_signal_connect(GTK_OBJECT(gui.drawarea), "leave_notify_event",
4515                            GTK_SIGNAL_FUNC(leave_notify_event), NULL);
4516 @@ -3228,10 +3317,19 @@
4517                            GTK_SIGNAL_FUNC(enter_notify_event), NULL);
4518      }
4519  
4520 +#ifdef FEAT_GUI_COMPONENT
4521 +    g_signal_connect(G_OBJECT(gui.control), "activate",
4522 +                    G_CALLBACK (control_activate_event), NULL);
4523 +    gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_out_event",
4524 +                          GTK_SIGNAL_FUNC(focus_out_event), NULL);
4525 +    gtk_signal_connect(GTK_OBJECT(gui.drawarea), "focus_in_event",
4526 +                          GTK_SIGNAL_FUNC(focus_in_event), NULL);
4527 +#else  
4528      gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_out_event",
4529                            GTK_SIGNAL_FUNC(focus_out_event), NULL);
4530      gtk_signal_connect(GTK_OBJECT(gui.mainwin), "focus_in_event",
4531                            GTK_SIGNAL_FUNC(focus_in_event), NULL);
4532 +#endif
4533  
4534      gtk_signal_connect(GTK_OBJECT(gui.drawarea), "motion_notify_event",
4535                        GTK_SIGNAL_FUNC(motion_notify_event), NULL);
4536 @@ -3404,7 +3502,7 @@
4537       * otherwise the hints don't work. */
4538      width  = gui_get_base_width();
4539      height = gui_get_base_height();
4540 -# ifdef HAVE_GTK2
4541 +# if defined( HAVE_GTK2 ) && !defined(FEAT_GUI_COMPONENT)
4542      width  += get_menu_tool_width();
4543      height += get_menu_tool_height();
4544  # endif
4545 @@ -3451,8 +3549,18 @@
4546  form_configure_event(GtkWidget *widget, GdkEventConfigure *event,
4547                      gpointer data)
4548  {
4549 +    int height;
4550 +
4551      gtk_form_freeze(GTK_FORM(gui.formwin));
4552 -    gui_resize_shell(event->width, event->height);
4553 +#ifdef FEAT_GUI_COMPONENT
4554 +    /* width_inc and height_inc (see window manager hints, above) aren't
4555 +     * respected for embedded controls, so we have to make a slight adjustment
4556 +     * to make sure the bottom line doesn't get clipped. */
4557 +    height = gui.char_height * ((event->height - 2 )/ gui.char_height);
4558 +#else
4559 +    height = event->height;
4560 +#endif
4561 +    gui_resize_shell(event->width, height);
4562      gtk_form_thaw(GTK_FORM(gui.formwin));
4563  
4564      return TRUE;
4565 @@ -3584,8 +3692,10 @@
4566       * changed them). */
4567      highlight_gui_started();   /* re-init colors and fonts */
4568  
4569 +#ifndef FEAT_GUI_COMPONENT
4570      gtk_signal_connect(GTK_OBJECT(gui.mainwin), "destroy",
4571                        GTK_SIGNAL_FUNC(mainwin_destroy_cb), NULL);
4572 +#endif
4573  
4574  #ifdef FEAT_HANGULIN
4575      hangul_keyboard_set();
4576 @@ -3653,7 +3763,9 @@
4577                                                   NULL);
4578  # endif
4579  #endif
4580 -       gtk_widget_show(gui.mainwin);
4581 +#ifndef FEAT_GUI_COMPONENT
4582 +        gtk_widget_show(gui.mainwin);
4583 +#endif
4584  
4585  #if defined(FEAT_GUI_GNOME) && defined(HAVE_GTK2) && defined(FEAT_MENU)
4586         if (menu_handler != 0)
4587 @@ -3683,8 +3795,8 @@
4588      if (gui.mainwin != NULL)
4589         gtk_widget_destroy(gui.mainwin);
4590  
4591 -    if (gtk_main_level() > 0)
4592 -       gtk_main_quit();
4593 +    if (MAIN_LEVEL() > 0)
4594 +       MAIN_QUIT();    /* make sure the above will be handled immediately */
4595  }
4596  
4597  /*
4598 @@ -3731,6 +3843,7 @@
4599      static gboolean
4600  force_shell_resize_idle(gpointer data)
4601  {
4602 +    g_warning("force_shell_resize_idle called!");
4603      if (gui.mainwin != NULL
4604             && GTK_WIDGET_REALIZED(gui.mainwin)
4605             && GTK_WIDGET_VISIBLE(gui.mainwin))
4606 @@ -3779,7 +3892,7 @@
4607      /* this will cause the proper resizement to happen too */
4608      update_window_manager_hints();
4609  
4610 -#ifdef HAVE_GTK2
4611 +#if defined( HAVE_GTK2 ) && !defined(FEAT_GUI_COMPONENT)
4612      /* With GTK+ 2, changing the size of the form widget doesn't resize
4613       * the window.  So lets do it the other way around and resize the
4614       * main window instead. */
4615 @@ -3870,6 +3983,7 @@
4616  {
4617      GtkWidget *widget;
4618  
4619 +#ifndef FEAT_GUI_COMPONENT
4620  # ifdef FEAT_GUI_GNOME
4621      if (using_gnome)
4622         widget = gui.menubar_h;
4623 @@ -3886,6 +4000,7 @@
4624  
4625         update_window_manager_hints();
4626      }
4627 +#endif
4628  }
4629  #endif /* FEAT_MENU */
4630  
4631 @@ -3937,8 +4052,8 @@
4632  
4633      vw->fontname = (char_u *)gtk_font_selection_dialog_get_font_name(fs);
4634      gtk_widget_hide(vw->fontdlg);
4635 -    if (gtk_main_level() > 0)
4636 -       gtk_main_quit();
4637 +    if (MAIN_LEVEL() > 0)
4638 +        MAIN_QUIT();      /* make sure the above will be handled immediately */
4639  }
4640  
4641  /*ARGSUSED*/
4642 @@ -3948,8 +4063,8 @@
4643      gui_T *vw = (gui_T *)cbdata;
4644  
4645      gtk_widget_hide(vw->fontdlg);
4646 -    if (gtk_main_level() > 0)
4647 -       gtk_main_quit();
4648 +    if (MAIN_LEVEL() > 0)
4649 +        MAIN_QUIT();      /* make sure the above will be handled immediately */
4650  }
4651  
4652  /*ARGSUSED*/
4653 @@ -3959,8 +4074,8 @@
4654      gui_T *vw = (gui_T *)cbdata;
4655  
4656      vw->fontdlg = NULL;
4657 -    if (gtk_main_level() > 0)
4658 -       gtk_main_quit();
4659 +    if (MAIN_LEVEL() > 0)
4660 +        MAIN_QUIT();      /* make sure the above will be handled immediately */
4661  }
4662  #endif /* !HAVE_GTK2 */
4663  
4664 @@ -4127,7 +4242,7 @@
4665  
4666      /* Wait for the font dialog to be closed. */
4667      while (gui.fontdlg && GTK_WIDGET_DRAWABLE(gui.fontdlg))
4668 -       gtk_main_iteration_do(TRUE);
4669 +       MAIN_ITERATION_DO(TRUE);
4670  
4671      if (gui.fontname != NULL)
4672      {
4673 @@ -5640,8 +5755,13 @@
4674      void
4675  gui_mch_update(void)
4676  {
4677 +#ifdef FEAT_GUI_COMPONENT
4678 +    if( gui.processing_call ) {
4679 +        return;
4680 +    }
4681 +#endif
4682      while (gtk_events_pending() && !vim_is_input_buf_full())
4683 -       gtk_main_iteration_do(FALSE);
4684 +        MAIN_ITERATION_DO(TRUE);
4685  }
4686  
4687      static gint
4688 @@ -5652,8 +5772,8 @@
4689      /* Just inform the caller about the occurence of it */
4690      *timed_out = TRUE;
4691  
4692 -    if (gtk_main_level() > 0)
4693 -       gtk_main_quit();
4694 +    if (MAIN_LEVEL() > 0)
4695 +        MAIN_QUIT();      /* make sure the above will be handled immediately */
4696  
4697      return FALSE;              /* don't happen again */
4698  }
4699 @@ -5673,8 +5793,8 @@
4700  
4701      add_to_input_buf(bytes, 3);
4702  
4703 -    if (gtk_main_level() > 0)
4704 -       gtk_main_quit();
4705 +    if (MAIN_LEVEL() > 0)
4706 +       MAIN_QUIT();
4707  }
4708  #endif
4709  
4710 @@ -5741,7 +5861,7 @@
4711         /*
4712          * Loop in GTK+ processing  until a timeout or input occurs.
4713          */
4714 -       gtk_main();
4715 +       MAIN();
4716  
4717         /* Got char, return immediately */
4718         if (input_available())
4719 @@ -5816,6 +5936,7 @@
4720         gdk_window_clear(gui.drawarea->window);
4721  }
4722  
4723 +
4724  /*
4725   * Redraw any text revealed by scrolling up/down.
4726   */
4727 @@ -5930,7 +6051,7 @@
4728                               (guint32)GDK_CURRENT_TIME);
4729  
4730         while (received_selection == RS_NONE)
4731 -           gtk_main(); /* wait for selection_received_cb */
4732 +           MAIN();     /* wait for selection_received_cb */
4733  
4734         if (received_selection != RS_FAIL)
4735             return;
4736 @@ -5998,6 +6119,13 @@
4737      void
4738  gui_mch_menu_grey(vimmenu_T *menu, int grey)
4739  {
4740 +#ifdef FEAT_GUI_COMPONENT
4741 +    if( menu->sensitive != !grey ) {
4742 +        menu->sensitive = !grey;
4743 +        update_menu_later(menu);
4744 +    }
4745 +    return;
4746 +#endif
4747      if (menu->id == NULL)
4748         return;
4749  
4750 @@ -6133,6 +6261,40 @@
4751  /* The last set mouse pointer shape is remembered, to be used when it goes
4752   * from hidden to not hidden. */
4753  static int last_shape = 0;
4754 +#endif
4755 +
4756 +#if 0
4757 +static BonoboWindow *
4758 +bonobo_create_window(void)
4759 +{
4760 +    BonoboWindow      *win;
4761 +    BonoboUIContainer *ui_container;
4762 +    BonoboUIComponent *ui_component;
4763 +                                                                                
4764 +    win = BONOBO_WINDOW (bonobo_window_new ("vim", "vim"));                                                                                
4765 +    ui_container = bonobo_window_get_ui_container (win);
4766 +    bonobo_ui_engine_config_set_path (bonobo_window_get_ui_engine (win),
4767 +                      "/gnome-vim/UIConfig/kvps");
4768 +                                                                                
4769 +    /* Create a UI component with which to communicate with the window */
4770 +    ui_component = bonobo_ui_component_new_default ();
4771 +
4772 +    gui.component = ui_component;
4773 +                                                                                
4774 +    /* Associate the BonoboUIComponent with the container */
4775 +    bonobo_ui_component_set_container (
4776 +        ui_component, BONOBO_OBJREF (ui_container), NULL);
4777 +                                                                                
4778 +    //bonobo_ui_util_set_ui (ui_component, "", 
4779 +                   //HELLO_SRCDIR HELLO_UI_XML,
4780 +                   //"bonobo-hello", NULL);
4781 +                                                                                
4782 +    /* Associate our verb -> callback mapping with the BonoboWindow */
4783 +    /* All the callback's user_data pointers will be set to 'win' */
4784 +    //bonobo_ui_component_add_verb_list_with_data (ui_component, hello_verbs, win);
4785 +                                                                                
4786 +    return win;
4787 +}
4788  #endif
4789  
4790  /*
4791 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/main.c vim/src/main.c
4792 --- vimcopy/src/main.c  Sat Jan 10 13:10:02 2004
4793 +++ vim/src/main.c      Sat Jan 10 13:06:44 2004
4794 @@ -79,7 +79,7 @@
4795  # ifdef VIMDLL
4796  _export
4797  # endif
4798 -# ifdef FEAT_GUI_MSWIN
4799 +# if defined(FEAT_GUI_MSWIN)
4800  #  ifdef __BORLANDC__
4801  _cdecl
4802  #  endif
4803 @@ -239,8 +239,12 @@
4804      TIME_MSG("locale set");
4805  #endif
4806  
4807 -#ifdef FEAT_GUI
4808 +#if defined(FEAT_GUI_COMPONENT)
4809 +    gui.dofork = FALSE;                    /* don't use fork when running as component */
4810 +#else
4811 +# if defined(FEAT_GUI) && !defined(FEAT_GUI_COMPONENT)
4812      gui.dofork = TRUE;             /* default is to use fork() */
4813 +# endif
4814  #endif
4815  
4816  #if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER)
4817 @@ -439,6 +443,10 @@
4818         ++initstr;
4819      }
4820  
4821 +#ifdef FEAT_GUI_COMPONENT
4822 +    main_start_gui();
4823 +#endif
4824 +
4825      if (TOLOWER_ASC(initstr[0]) == 'g')
4826      {
4827         main_start_gui();
4828 @@ -1634,12 +1642,14 @@
4829       * Call settmode and starttermcap here, so the T_KS and T_TI may be
4830       * defined by termcapinit and redifined in .exrc.
4831       */
4832 +#ifndef FEAT_GUI_COMPONENT
4833      settmode(TMODE_RAW);
4834      if (need_wait_return || msg_didany)
4835      {
4836         wait_return(TRUE);
4837         TIME_MSG("waiting for return");
4838      }
4839 +#endif
4840  
4841      starttermcap();        /* start termcap if not done by wait_return() */
4842  #ifdef FEAT_MOUSE
4843 @@ -1766,6 +1776,9 @@
4844  #ifdef FEAT_WINDOWS
4845         curwin = firstwin;
4846         curbuf = curwin->w_buffer;
4847 +#endif
4848 +#ifdef FEAT_GUI_COMPONENT
4849 +       persistent_buffer = curbuf;
4850  #endif
4851      }
4852      TIME_MSG("opening buffers");
4853 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/mbyte.c vim/src/mbyte.c
4854 --- vimcopy/src/mbyte.c Thu Jan 15 10:17:11 2004
4855 +++ vim/src/mbyte.c     Thu Jan 15 10:13:20 2004
4856 @@ -3129,8 +3129,8 @@
4857  
4858      im_add_to_input((char_u *)str, (int)strlen(str));
4859  
4860 -    if (gtk_main_level() > 0)
4861 -       gtk_main_quit();
4862 +    if (MAIN_LEVEL() > 0)
4863 +       MAIN_QUIT();
4864  }
4865  
4866  /*
4867 @@ -4138,7 +4138,11 @@
4868             if (gui.fontset != NOFONTSET
4869                     && gui.fontset->type == GDK_FONT_FONTSET)
4870             {
4871 +#ifdef FEAT_GUI_COMPONENT
4872 +               widget = gui.drawarea;
4873 +#else
4874                 widget = gui.mainwin;
4875 +#endif
4876                 gdk_window_get_size(widget->window, &width, &height);
4877  
4878                 attrmask |= (int)GDK_IC_STATUS_AREA;
4879 @@ -4719,9 +4723,15 @@
4880         while (event_queue != NULL && processing_queued_event)
4881         {
4882             GdkEvent *ev = event_queue->data;
4883 -
4884 +            GtkWidget *output;
4885 +            
4886             gboolean *ret;
4887 -           gtk_signal_emit_by_name((GtkObject*)gui.mainwin, "key_press_event",
4888 +#ifdef FEAT_GUI_COMPONENT
4889 +            output = gui.drawarea;
4890 +#else
4891 +            output = gui.mainwin;
4892 +#endif
4893 +           gtk_signal_emit_by_name((GtkObject*)output, "key_press_event",
4894                                                                     ev, &ret);
4895             gdk_event_free(ev);
4896             event_queue = event_queue->next;
4897 @@ -4733,8 +4743,8 @@
4898             key_press_event_queue = NULL;
4899         }
4900      }
4901 -    if (gtk_main_level() > 0)
4902 -       gtk_main_quit();
4903 +    if (MAIN_LEVEL() > 0)
4904 +       MAIN_QUIT();
4905  }
4906  
4907  /*
4908 @@ -4869,7 +4879,11 @@
4909         GtkWidget       *widget = gui.drawarea;
4910  
4911         attr->style = (GdkIMStyle)xim_input_style;
4912 +#ifdef FEAT_GUI_COMPONENT
4913 +       attr->client_window = gui.drawarea->window;
4914 +#else
4915         attr->client_window = gui.mainwin->window;
4916 +#endif
4917  
4918         if ((colormap = gtk_widget_get_colormap(widget)) !=
4919             gtk_widget_get_default_colormap())
4920 @@ -4916,7 +4930,11 @@
4921             }
4922             else
4923             {
4924 +#ifdef FEAT_GUI_COMPONENT
4925 +               gdk_window_get_size(gui.drawarea->window, &width, &height);
4926 +#else
4927                 gdk_window_get_size(gui.mainwin->window, &width, &height);
4928 +#endif
4929                 attrmask |= (int)GDK_IC_STATUS_AREA_REQ;
4930                 attr->status_area.x = 0;
4931                 attr->status_area.y = height - gui.char_height - 1;
4932 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/misc1.c vim/src/misc1.c
4933 --- vimcopy/src/misc1.c Sat Jan 10 13:10:02 2004
4934 +++ vim/src/misc1.c     Sat Jan 10 13:06:46 2004
4935 @@ -2346,6 +2346,11 @@
4936  #ifdef FEAT_TITLE
4937         need_maketitle = TRUE;      /* set window title later */
4938  #endif
4939 +#if defined(FEAT_GUI_COMPONENT)
4940 +        if( curbuf == persistent_buffer) {
4941 +            component_set_dirty(TRUE);
4942 +        }
4943 +#endif
4944      }
4945      ++curbuf->b_changedtick;
4946      ++global_changedtick;
4947 @@ -2614,6 +2619,11 @@
4948  #endif
4949  #ifdef FEAT_TITLE
4950         need_maketitle = TRUE;      /* set window title later */
4951 +#endif
4952 +#if defined(FEAT_GUI_COMPONENT)
4953 +        if( curbuf == persistent_buffer) {
4954 +            component_set_dirty(FALSE);
4955 +        }
4956  #endif
4957      }
4958      ++buf->b_changedtick;
4959 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/quote vim/src/quote
4960 --- vimcopy/src/quote   Wed Dec 31 18:00:00 1969
4961 +++ vim/src/quote       Thu Oct 23 17:20:23 2003
4962 @@ -0,0 +1,7 @@
4963 +function! Quote()
4964 +normal msHmt
4965 +%g/^GtkHTML_QUOTE_ON/.,/GtkHTML_QUOTE_OFF/s/^/> /
4966 +%g/^> GtkHTML_QUOTE_ON/d
4967 +%g/^> GtkHTML_QUOTE_OFF/d
4968 +normal 'tzt's
4969 +endfunction
4970 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/structs.h vim/src/structs.h
4971 --- vimcopy/src/structs.h       Sat Jan 10 13:10:03 2004
4972 +++ vim/src/structs.h   Sat Jan 10 13:06:46 2004
4973 @@ -1039,6 +1039,10 @@
4974      char_u     *b_p_bh;        /* 'bufhidden' */
4975      char_u     *b_p_bt;        /* 'buftype' */
4976  #endif
4977 +#if defined(FEAT_GUI_COMPONENT)
4978 +    int         emb_buffer;     /* this buffer is associated with the container application,
4979 +                                   and cannot be removed */
4980 +#endif
4981      int                b_p_bl;         /* 'buflisted' */
4982  #ifdef FEAT_CINDENT
4983      int                b_p_cin;        /* 'cindent' */
4984 @@ -1231,6 +1235,9 @@
4985      signlist_T *b_signlist;    /* list of signs to draw */
4986  #endif
4987  
4988 +#if defined(FEAT_GUI_COMPONENT) && defined(FEAT_GUI_GNOME)
4989 +    pos_T      b_saved_cursor_pos;     /* start pos of last VIsual */
4990 +#endif
4991  };
4992  
4993  /*
4994 @@ -1716,8 +1723,11 @@
4995      GtkWidget  *tearoff_handle;
4996      GtkWidget   *label;                    /* Used by "set wak=" code. */
4997  #endif
4998 -#ifdef FEAT_GUI_MOTIF
4999 +#if defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_COMPONENT)
5000      int                sensitive;          /* turn button on/off */
5001 +#if defined(FEAT_GUI_COMPONENT)
5002 +    int         dirty;              /* menu item has been updated; container needs to know */
5003 +#endif
5004  #endif
5005  #if defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF)
5006      Pixmap     image;              /* Toolbar image */
5007 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/undo.c vim/src/undo.c
5008 --- vimcopy/src/undo.c  Sat Mar  8 14:01:28 2003
5009 +++ vim/src/undo.c      Sat Nov  1 18:03:21 2003
5010 @@ -725,6 +725,7 @@
5011  #endif
5012  }
5013  
5014 +
5015  /*
5016   * u_sync: stop adding to the current entry list
5017   */
5018 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim-container.xml vim/src/vim-container.xml
5019 --- vimcopy/src/vim-container.xml       Wed Dec 31 18:00:00 1969
5020 +++ vim/src/vim-container.xml   Sat Jul 26 13:16:48 2003
5021 @@ -0,0 +1,83 @@
5022 +<Root>
5023 +
5024 +<commands>
5025 +       <cmd name="FileNewWindow" _label="_New Window" _tip="Open a new window"
5026 +             pixtype="stock" pixname="gtk-new" accel="*Control*n"/>
5027 +
5028 +       <cmd name="FileOpen" _label="_Open..." _tip="Open a file"
5029 +            pixtype="stock" pixname="gtk-open" accel="*Control*o"/>
5030 +
5031 +       <cmd name="FileCloseWindow" _label="_Close" _tip="Close window"
5032 +             pixtype="stock" pixname="gtk-close" accel="*Control*w"/>
5033 +
5034 +        <cmd name="FileExit" _label="_Quit" _tip="Quit the program"
5035 +            pixtype="stock" pixname="gtk-quit" accel="*Control*q"/>
5036 +       
5037 +       <cmd name="Preferences" _label="_Preferences..." _tip="Change preferences"  sensitive="0"
5038 +            pixtype="stock" pixname="gtk-preferences"/>
5039 +
5040 +       <cmd name="HelpAbout" _label="_About" _tip="About this application"
5041 +            pixtype="stock" pixname="About"/>
5042 +       <cmd name="Help" _label="Contents" _tip="Help On this application"
5043 +            pixtype="stock" pixname="Help" accel="F1"/>
5044 +
5045 +
5046 +       <cmd name="DnDNewWindow" _label="Open in new window"/>
5047 +       <cmd name="DnDSameWindow" _label="Open in this window"/>
5048 +       <cmd name="DnDCancel" _label="Cancel"
5049 +            pixtype="stock" pixname="Cancel"/>
5050 +</commands>
5051 +
5052 +<menu>
5053 +        <submenu name="File" _label="_File">
5054 +
5055 +               <menuitem name="FileNewWindow" verb=""/>
5056 +
5057 +               <placeholder name="Open Placeholder" delimit="top">
5058 +                       <menuitem name="FileOpen" verb=""/>
5059 +               </placeholder>
5060 +
5061 +               <placeholder name="File Items Placeholder" delimit="top"/>
5062 +
5063 +               <separator/>
5064 +
5065 +               <menuitem name="FileCloseWindow" verb=""/>
5066 +
5067 +               <menuitem name="FileExit" verb=""/>
5068 +
5069 +       </submenu>
5070 +
5071 +       <submenu name="Edit" _label="_Edit">
5072 +               <menuitem name="Preferences" verb=""/>
5073 +        </submenu>
5074 +
5075 +       <submenu name="View" _label="_View" hidden="1">
5076 +               <placeholder name="View Preferences Placeholder"/>
5077 +               <placeholder name="View Items Placeholder" delimit="top"/>
5078 +       </submenu>
5079 +
5080 +       <submenu name="Help" _label="_Help">
5081 +               <menuitem name="Help" verb=""/>
5082 +               <menuitem name="HelpAbout" verb=""/>
5083 +       </submenu>
5084 +</menu>
5085 +
5086 +<dockitem name="Toolbar" relief="none" homogeneous="1" behavior="exclusive">
5087 +
5088 +        <toolitem name="TBOpen" _label="Open" pixtype="stock"
5089 +                  pixname="Open" verb="FileOpen"/>
5090 +
5091 +        <toolitem name="TBCloseWindow" _label="Close" pixtype="stock"
5092 +                  pixname="Close" verb="FileCloseWindow"/>
5093 +</dockitem>
5094 +
5095 +<popups>
5096 +        <popup name="dragndrop">
5097 +             <menuitem name="DnDNewWindow" verb=""/>
5098 +             <menuitem name="DnDSameWindow" verb=""/>
5099 +             <separator/>
5100 +             <menuitem name="DnDCancel" verb=""/>
5101 +        </popup>
5102 +</popups>
5103 +
5104 +</Root>
5105 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim.h vim/src/vim.h
5106 --- vimcopy/src/vim.h   Sat Jan 10 13:10:03 2004
5107 +++ vim/src/vim.h       Sat Jan 10 13:06:47 2004
5108 @@ -739,6 +739,10 @@
5109  #define READ_STDIN     0x04    /* read from stdin */
5110  #define READ_BUFFER    0x08    /* read from curbuf (converting stdin) */
5111  #define READ_DUMMY     0x10    /* reading into a dummy buffer */
5112 +#define READ_EMB_STREAM 0x20    /* read from container stream object 
5113 +                                        (i.e. Bonobo Persist Stream) */
5114 +#define READ_EMB_FILE   0x40    /* read from container file object 
5115 +                                        (i.e. Bonobo Persist File) */
5116  
5117  /* Values for change_indent() */
5118  #define INDENT_SET     1       /* set indent */
5119 @@ -1026,6 +1030,7 @@
5120      EVENT_CURSORHOLD,          /* cursor in same position for a while */
5121      EVENT_FUNCUNDEFINED,       /* if calling a function which doesn't exist */
5122      EVENT_REMOTEREPLY,         /* upon string reception from a remote vim */
5123 +    EVENT_EMBEDDED_COMPONENT,  /* upon embedding of vim as a component */
5124      NUM_EVENTS                 /* MUST be the last one */
5125  };
5126  
5127 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_control.c vim/src/vim_bonobo_control.c
5128 --- vimcopy/src/vim_bonobo_control.c    Wed Dec 31 18:00:00 1969
5129 +++ vim/src/vim_bonobo_control.c        Sat Jan 10 21:03:08 2004
5130 @@ -0,0 +1,612 @@
5131 +/**
5132 + * vim_bonobo_control.c
5133 + *
5134 + * Author:
5135 + *   Jason Hildebrand <jason@peaceworks.ca>
5136 + *
5137 + */
5138 +#include <stdio.h>
5139 +
5140 +#include "vim.h"
5141 +#include "vim_bonobo_control.h"
5142 +#include "gtkhtml_editor.h"
5143 +
5144 +#include <gnome.h>
5145 +#include <libbonoboui.h>
5146 +#include <libbonobo.h>
5147 +/*#include <libnautilus/nautilus-view.h>*/
5148 +#include <X11/Intrinsic.h>
5149 +#include <X11/Xatom.h>
5150 +#include <gdk/gdkx.h>
5151 +
5152 +struct _VimControlPrivate {
5153 +    BonoboUIComponent *component;
5154 +};
5155 +
5156 +static GObjectClass *vim_control_parent_class;
5157 +
5158 +static gboolean
5159 +quit_vim(gpointer data)
5160 +{
5161 +    getout_preserve_modified(0);
5162 +}
5163 +
5164 +static void
5165 +vim_control_destroy (BonoboObject *control)
5166 +{
5167 +       BonoboUIComponent *uic;
5168 +
5169 +       g_return_if_fail (control != NULL);
5170 +       g_return_if_fail (VIM_IS_CONTROL (control));
5171 +
5172 +    g_message ("Destroying VimControl...");
5173 +
5174 +       uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
5175 +    if( uic != CORBA_OBJECT_NIL )
5176 +        bonobo_ui_component_unset_container (uic, NULL);
5177 +
5178 +       BONOBO_OBJECT_CLASS (vim_control_parent_class)->destroy (control);
5179 +
5180 +    /* we only support creating one vim control per process, so when this one
5181 +     * is finished, we're done. */ 
5182 +    g_timeout_add(50, &quit_vim, NULL);
5183 +}
5184 +
5185 +static void
5186 +vim_control_finalize (GObject *object)
5187 +{
5188 +       VimControl *control;
5189 +
5190 +       g_return_if_fail (object != NULL);
5191 +       g_return_if_fail (VIM_IS_CONTROL (object));
5192 +
5193 +       control = VIM_CONTROL (object);
5194 +
5195 +       g_free (control->priv);
5196 +
5197 +       G_OBJECT_CLASS (vim_control_parent_class)->finalize (object);
5198 +}
5199 +
5200 +static void
5201 +vim_control_set_ui_container (VimControl *control,
5202 +                             Bonobo_UIContainer ui_container)
5203 +{
5204 +       BonoboUIComponent *uic;
5205 +       
5206 +       g_return_if_fail (control != NULL);
5207 +       g_return_if_fail (VIM_IS_CONTROL (control));
5208 +       g_return_if_fail (ui_container != CORBA_OBJECT_NIL);
5209 +
5210 +       uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
5211 +       bonobo_ui_component_set_container (uic, ui_container, NULL);
5212 +
5213 +    /* schedule a UI update */
5214 +    update_ui_later();
5215 +}
5216 +
5217 +static void
5218 +vim_control_unset_ui_container (VimControl *control)
5219 +{
5220 +       BonoboUIComponent *uic;
5221 +
5222 +       g_return_if_fail (control != NULL);
5223 +       g_return_if_fail (VIM_IS_CONTROL (control));
5224 +
5225 +       uic = bonobo_control_get_ui_component (BONOBO_CONTROL (control));
5226 +       bonobo_ui_component_unset_container (uic, NULL);
5227 +}
5228 +
5229 +static grab_keys = 0;
5230 +
5231 +#if 0
5232 +static GdkFilterReturn
5233 +filter_key_events (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data)
5234 +{
5235 + /* GdkScreen *screen = gdk_drawable_get_screen (event->any.window);
5236 +  GdkDisplay *display = gdk_screen_get_display (screen);*/
5237 +  XEvent *xevent = (XEvent *)gdk_xevent;
5238 +                                                                                
5239 +  GdkFilterReturn return_val;
5240 +                                                                                
5241 +  return_val = GDK_FILTER_CONTINUE;
5242 +                                                                                
5243 +  switch (xevent->type)
5244 +  {
5245 +      case KeyPress:
5246 +        g_warning("Key press!");
5247 +        break;
5248 +
5249 +      case KeyRelease:
5250 +        g_warning("Key release!");
5251 +        break;
5252 +
5253 +      default:
5254 +        break;
5255 +  }
5256 +  return return_val;
5257 +}
5258 +#endif
5259 +
5260 +static void
5261 +set_frame_cb (BonoboControl *object, gpointer data)
5262 +{
5263 +    Bonobo_ControlFrame frame;
5264 +       VimControl *control;
5265 +
5266 +       g_return_if_fail (object != NULL);
5267 +       g_return_if_fail (VIM_IS_CONTROL (object));
5268 +
5269 +    frame = bonobo_control_get_control_frame (object, NULL);
5270 +    if (frame == CORBA_OBJECT_NIL)
5271 +        return;
5272 +    CORBA_Object_release (frame, NULL);
5273 +
5274 +       control = VIM_CONTROL (object);
5275 +
5276 +    Bonobo_UIContainer ui_container;
5277 +
5278 +    ui_container = bonobo_control_get_remote_ui_container (BONOBO_CONTROL (control), NULL);
5279 +    if (ui_container != CORBA_OBJECT_NIL) {
5280 +        vim_control_set_ui_container (control, ui_container);
5281 +        bonobo_object_release_unref (ui_container, NULL);
5282 +    }
5283 +
5284 +}
5285 +
5286 +static void
5287 +embedded_cb (GtkPlug *plug)
5288 +{
5289 +    Atom     wm_class;
5290 +    Atom     actual_type;
5291 +    int        actual_format;
5292 +    unsigned long actual_length;
5293 +    unsigned long remaining_bytes;
5294 +    unsigned char * wm_class_value;
5295 +    Window   win;
5296 +    Window   root;
5297 +    Window   parent;
5298 +    Window * children = NULL;
5299 +    unsigned int nchildren;
5300 +    int     result;
5301 +
5302 +    wm_class = gdk_x11_get_xatom_by_name("WM_CLASS");
5303 +    win = GDK_WINDOW_XID(plug->socket_window);
5304 +
5305 +    while( TRUE ) {
5306 +        /*g_warning("checking xid %d", win);*/
5307 +        result = XGetWindowProperty (GDK_WINDOW_XDISPLAY (plug->socket_window), 
5308 +                            win, 
5309 +                            wm_class, 0, 120, False, XA_STRING, 
5310 +                            &actual_type, &actual_format,
5311 +                  &actual_length, &remaining_bytes, &wm_class_value);
5312 +        if( result == Success && actual_type != None) {
5313 +            /*g_warning("WM_CLASS is %s", wm_class_value);*/
5314 +            apply_autocmds(EVENT_EMBEDDED_COMPONENT, wm_class_value, NULL, FALSE, persistent_buffer);
5315 +            Xfree(wm_class_value);         
5316 +            break;
5317 +        }
5318 +        gdk_error_trap_push ();
5319 +        result = XQueryTree(GDK_WINDOW_XDISPLAY(plug->socket_window),
5320 +                       win,
5321 +                       &root, &parent, &children, &nchildren);
5322 +        if (gdk_error_trap_pop () || !result) {
5323 +            break;
5324 +        }
5325 +        if( children ) {
5326 +            Xfree(children);
5327 +            children = NULL;
5328 +        }
5329 +        if( root == parent) {
5330 +            /* we've reached the root window */
5331 +            break;
5332 +        }
5333 +        win = parent;
5334 +    }
5335 +}
5336 +
5337 +static void
5338 +vim_control_class_init (VimControl *klass)
5339 +{
5340 +       GObjectClass *gobject_class = (GObjectClass *)klass;
5341 +       BonoboObjectClass *bonobo_object_class = (BonoboObjectClass *)klass;
5342 +       BonoboControlClass *control_class = (BonoboControlClass *)klass;
5343 +
5344 +       vim_control_parent_class= g_type_class_peek_parent (klass);
5345 +
5346 +       bonobo_object_class->destroy = vim_control_destroy;
5347 +       gobject_class->finalize = vim_control_finalize;
5348 +}
5349 +
5350 +static char_u * stream_buffer = NULL;
5351 +static int stream_offset = 0;
5352 +static CORBA_long  stream_length = 0;
5353 +static Bonobo_Stream current_stream;
5354 +
5355 +/* It seems like it is an error to attempt to read more data
5356 + * than is available from a bonobo stream.  So we slurp in
5357 + * the entire file in one chunk, and then pass it back in 
5358 + * pieces to the caller. 
5359 + */
5360 +int
5361 +vim_control_persist_stream_read(char_u * buffer, int reqsize)
5362 +{
5363 +    int read_size;
5364 +
5365 +    if( stream_offset >= stream_length ) {
5366 +        return 0;
5367 +    }
5368 +    read_size = stream_length - stream_offset >= reqsize ? 
5369 +                    reqsize : stream_length - stream_offset;
5370 +    mch_memmove(buffer, &stream_buffer[stream_offset], read_size);
5371 +    stream_offset += read_size;
5372 +    return read_size;
5373 +}
5374 +
5375 +int
5376 +vim_control_persist_stream_write(char_u * buffer, int reqsize)
5377 +{
5378 +    CORBA_Environment ev;
5379 +
5380 +    CORBA_exception_init(&ev);
5381 +    bonobo_stream_client_write(current_stream, buffer, reqsize, &ev);
5382 +       if (ev._major != CORBA_NO_EXCEPTION ) {
5383 +        g_warning("Error writing to stream");
5384 +               CORBA_exception_free (&ev);
5385 +        return 0;
5386 +       }
5387 +    CORBA_exception_free (&ev);
5388 +    return reqsize;
5389 +}
5390 +
5391 +void
5392 +component_set_dirty(gboolean dirty)
5393 +{
5394 +    bonobo_persist_set_dirty(BONOBO_PERSIST(gui.pstream), dirty);
5395 +    bonobo_persist_set_dirty(BONOBO_PERSIST(gui.pfile), dirty);
5396 +}
5397 +
5398 +static void load_buffer_from_stream( const Bonobo_Stream         stream,
5399 +                      Bonobo_Persist_ContentType  type,
5400 +                      CORBA_Environment          *ev)
5401 +{
5402 +    exarg_T            ea;                     /* Ex command arguments */
5403 +
5404 +    g_warning ("load_buffer_from_stream");
5405 +
5406 +    stream_buffer = bonobo_stream_client_read( stream, -1, &stream_length, ev);
5407 +       if (ev->_major != CORBA_NO_EXCEPTION) {
5408 +        g_warning("Error reading from stream");
5409 +        return;
5410 +       }
5411 +    stream_offset = 0;
5412 +
5413 +    if( persistent_buffer ) {
5414 +        /* make it possible to delete the existing buffer, so that it 
5415 +         * can be replaced with what we are about to load */
5416 +        persistent_buffer->emb_buffer = FALSE;
5417 +    }
5418 +
5419 +    vim_memset(&ea, 0, sizeof(ea));
5420 +    ea.cmd = "e ++enc=utf-8";
5421 +    ea.force_enc = 8; /* this is the offset of "utf-8" in the cmd */
5422 +
5423 +    read_from_container = PERSIST_STREAM_IO;
5424 +    do_ecmd(0, NULL, NULL, &ea, 1, ECMD_OLDBUF|ECMD_FORCEIT);
5425 +    read_from_container = NORMAL_IO;
5426 +
5427 +    /* we've set the fileencoding to utf-8; set encoding to utf-8 as * well.*/
5428 +    do_cmdline_cmd("set encoding=utf-8");
5429 +
5430 +    /* remember this buffer */
5431 +       persistent_buffer = curbuf;
5432 +    ga_clear(&error_ga);
5433 +    g_free(stream_buffer);
5434 +
5435 +        
5436 +    /* run a filter to obtain plain text from the html */
5437 +    if( !strcmp( type, "text/html" )) {
5438 +        vim_bonobo_call_begin();
5439 +        /* Substitutions to recognize quoted text */
5440 +        do_cmdline_cmd("%s/<!--+GtkHTML[^>]*class=\"ClueFlow\"[^>]*key=\"orig\"[^>]*value=\"1\">-->/<pre>GtkHTML_QUOTE_ON<\\/pre>");
5441 +        do_cmdline_cmd("%s/<!--+GtkHTML[^>]*class=\"ClueFlow\"[^>]*clear=\"orig\"[^>]*>-->/<pre>GtkHTML_QUOTE_OFF<\\/pre>");
5442 +        do_cmdline_cmd("%s/<\\/i><\\/blockquote>/<\\/pre><\\/i><\\/blockquote>/");
5443 +        do_cmdline_cmd("%!html2text -nobs");
5444 +        do_cmdline_cmd("call EvoQuote()");
5445 +        vim_bonobo_call_end();
5446 +    }
5447 +    do_cmdline_cmd("set nomodified");
5448 +    component_set_dirty(FALSE);
5449 +}
5450 +
5451 +static void load_buffer_from_stream_cb(BonoboPersistStream *ps,
5452 +                      const Bonobo_Stream         stream,
5453 +                      Bonobo_Persist_ContentType  type,
5454 +                      void                       *closure,
5455 +                      CORBA_Environment          *ev)
5456 +{
5457 +    load_buffer_from_stream(stream, type, ev);
5458 +}
5459 +
5460 +static void 
5461 +save_buffer_to_stream( const Bonobo_Stream         stream,
5462 +                      Bonobo_Persist_ContentType  type,
5463 +                      CORBA_Environment          *ev)
5464 +{
5465 +    buf_T * buf;
5466 +    exarg_T            ea;                     /* Ex command arguments */
5467 +
5468 +    /*g_warning ("save_buffer_to_stream");*/
5469 +
5470 +    current_stream = stream;
5471 +    write_to_container = PERSIST_STREAM_IO;
5472 +
5473 +    if( !strcmp(type, "text/html")) {
5474 +        vim_control_persist_stream_write("<pre>", 5);
5475 +    }
5476 +
5477 +    vim_memset(&ea, 0, sizeof(ea));
5478 +    ea.cmd = "e ++enc=utf-8";
5479 +    ea.force_enc = 8; /* this is the offset of "utf-8" in the cmd */
5480 +
5481 +    buf = persistent_buffer;
5482 +    buf_write(buf, "dummy", "dummy", 1, buf->b_ml.ml_line_count, 
5483 +                &ea, FALSE, FALSE, TRUE, TRUE);
5484 +    if( !strcmp(type, "text/html")) {
5485 +        vim_control_persist_stream_write("</pre>", 6);
5486 +    }
5487 +    write_to_container = NORMAL_IO;
5488 +    ga_clear(&error_ga);
5489 +}
5490 +
5491 +static void 
5492 +save_buffer_to_stream_cb(BonoboPersistStream         *ps,
5493 +                      const Bonobo_Stream         stream,
5494 +                      Bonobo_Persist_ContentType  type,
5495 +                      void                       *closure,
5496 +                      CORBA_Environment          *ev)
5497 +{
5498 +    save_buffer_to_stream(stream, type, ev);
5499 +}
5500 +
5501 +static gint
5502 +load_buffer_from_file (BonoboPersistFile *pf,
5503 +                const CORBA_char  *filename,
5504 +                       CORBA_Environment *ev,
5505 +                void              *closure)
5506 +{
5507 +       Bonobo_PersistStream ps = closure;
5508 +       BonoboStream *stream;
5509 +       
5510 +    /* FIXME!! */
5511 +    stream = bonobo_get_object(filename, "IDL:Bonobo/Stream:1.0", ev);
5512 +
5513 +       if (!stream)
5514 +               return 0;
5515 +
5516 +       load_buffer_from_stream (ps, "text/plain", ev);
5517 +       return 0; /* Return 0 on success */
5518 +}
5519 +
5520 +static gint
5521 +save_to_file (BonoboPersistFile *pf,
5522 +              const CORBA_char  *filename,
5523 +              CORBA_Environment *ev,
5524 +              void              *closure)
5525 +{
5526 +       Bonobo_PersistStream ps = closure;
5527 +       BonoboStream *stream;
5528 +       
5529 +    
5530 +    /*
5531 +       stream = bonobo_stream_open (
5532 +               BONOBO_IO_DRIVER_FS,
5533 +               filename, Bonobo_STORAGE_WRITE | Bonobo_STORAGE_CREATE,
5534 +               S_IRUSR | S_IWUSR | S_IRGRP);
5535 +
5536 +       if (!stream)
5537 +               return 0;
5538 +
5539 +       save_buffer_to_stream (NULL, ps, "text/plain", ev);
5540 +    */
5541 +       return 0; /* Return 0 on success */
5542 +}
5543 +
5544 +
5545 +Bonobo_Persist_ContentTypeList * 
5546 +persist_stream_types( BonoboPersistStream * ps, void * closure, CORBA_Environment *ev )
5547 +{
5548 +    /*g_warning ("persist_stream_types");*/
5549 +    return bonobo_persist_generate_content_types(2, "text/plain", "text/html");
5550 +}
5551 +
5552 +
5553 +#if 0
5554 +static void
5555 +nv_load_location_cb (NautilusView *view, const char *location, gpointer user_data)
5556 +{
5557 +       g_return_if_fail (NAUTILUS_IS_VIEW (view));
5558 +       g_return_if_fail (location != NULL);
5559 +
5560 +       nautilus_view_report_load_underway (NAUTILUS_VIEW (view));
5561 +
5562 +    /* FIXME: load the file here (using gnome-vfs)! */
5563 +       nautilus_view_report_load_complete (NAUTILUS_VIEW (view));
5564 +}
5565 +#endif
5566 +
5567 +static enum {
5568 +    EDITOR_NEEDS_ESCAPE
5569 +} EditorControlProps;
5570 +
5571 +editor_get_prop (BonoboPropertyBag *bag,
5572 +         BonoboArg         *arg,
5573 +         guint              arg_id,
5574 +         CORBA_Environment *ev,
5575 +         gpointer           user_data)
5576 +{
5577 +    //GtkHTMLControlData *cd = user_data;
5578 +                                                                                
5579 +    switch (arg_id) {
5580 +    case EDITOR_NEEDS_ESCAPE:
5581 +        BONOBO_ARG_SET_BOOLEAN (arg, TRUE);
5582 +        break;
5583 +    default:
5584 +        bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound);
5585 +        break;
5586 +    }
5587 +}
5588 +
5589 +static void
5590 +editor_set_prop (BonoboPropertyBag *bag,
5591 +         const BonoboArg   *arg,
5592 +         guint              arg_id,
5593 +         CORBA_Environment *ev,
5594 +         gpointer           user_data)
5595 +{
5596 +    //GtkHTMLControlData *cd = user_data;
5597 +                                                                                
5598 +    switch (arg_id) {
5599 +    case EDITOR_NEEDS_ESCAPE:
5600 +        bonobo_exception_set (ev, ex_Bonobo_PropertyBag_ReadOnly);
5601 +        break;
5602 +    default:
5603 +        bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound);
5604 +        break;
5605 +    }
5606 +}
5607 +
5608 +static void
5609 +vim_control_init (VimControl *control)
5610 +{
5611 +       control->priv = g_new0 (VimControlPrivate, 1);
5612 +}
5613 +
5614 +BONOBO_TYPE_FUNC (VimControl, BONOBO_TYPE_CONTROL, vim_control);
5615 +
5616 +BonoboObject *
5617 +vim_control_add_interfaces (VimControl     *control,
5618 +                         BonoboObject *to_aggregate)
5619 +{
5620 +       BonoboPersistFile   *file;
5621 +    //NautilusView        *nv;
5622 +       BonoboPersistStream *stream;
5623 +    EditorEngine        *engine; /* GtkHTML editor engine interface */
5624 +       //BonoboItemContainer *item_container;
5625 +
5626 +       
5627 +       g_return_val_if_fail (VIM_IS_CONTROL (control), NULL);
5628 +       g_return_val_if_fail (BONOBO_IS_OBJECT (to_aggregate), NULL);
5629 +
5630 +       /* Interface Bonobo::PersistStream */
5631 +    stream = bonobo_persist_stream_new (load_buffer_from_stream_cb,
5632 +                                        save_buffer_to_stream_cb, 
5633 +                                        persist_stream_types, 
5634 +                                        VIM_OAFIID, 
5635 +                                        control);
5636 +    if (!stream) {
5637 +        bonobo_object_unref (BONOBO_OBJECT (to_aggregate));
5638 +        return NULL;
5639 +    }
5640 +       bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5641 +                                    BONOBO_OBJECT (stream));
5642 +    gui.pstream = stream;
5643 +
5644 +       /* Interface Bonobo::PersistFile */
5645 +       file = bonobo_persist_file_new (load_buffer_from_file, 
5646 +                                           save_buffer_to_stream, VIM_OAFIID, control);
5647 +       if (!file) {
5648 +               bonobo_object_unref (BONOBO_OBJECT (to_aggregate));
5649 +               return NULL;
5650 +       }
5651 +       bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5652 +                                    BONOBO_OBJECT (file));
5653 +    gui.pfile = file;
5654 +
5655 +    /*
5656 +    nv = nautilus_view_new_from_bonobo_control(BONOBO_CONTROL(control));
5657 +    if( !nv ) {
5658 +        bonobo_object_unref (BONOBO_OBJECT(to_aggregate));
5659 +        return NULL;
5660 +    }
5661 +       bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5662 +                                    BONOBO_OBJECT (nv));
5663 +
5664 +       g_signal_connect (G_OBJECT (nv), "load_location",
5665 +                         G_CALLBACK (nv_load_location_cb), NULL);
5666 +        */
5667 +
5668 +    engine = editor_engine_new();
5669 +    if( !engine ) {
5670 +        bonobo_object_unref (BONOBO_OBJECT(to_aggregate));
5671 +        return NULL;
5672 +    }
5673 +       bonobo_object_add_interface (BONOBO_OBJECT (to_aggregate),
5674 +                                    BONOBO_OBJECT (engine));
5675 +
5676 +       return to_aggregate;
5677 +}
5678 +
5679 +VimControl *
5680 +vim_control_construct (VimControl    *control)
5681 +{
5682 +       GtkWidget             *button;
5683 +       GtkWidget             *label;
5684 +    BonoboPlug            *plug;
5685 +    GtkAccelGroup         *group;
5686 +    GClosure              *closure;
5687 +       //VimControlPrivate     *priv;
5688 +    BonoboPropertyBag  *pb;
5689 +    BonoboArg          *def;
5690 +       
5691 +       g_return_val_if_fail (control != NULL, NULL);
5692 +       g_return_val_if_fail (VIM_IS_CONTROL (control), NULL);
5693 +
5694 +
5695 +       if (!vim_control_add_interfaces (control, BONOBO_OBJECT (control)))
5696 +               return NULL;
5697 +
5698 +    gui.control = BONOBO_CONTROL(control);
5699 +    gui.plug = (BonoboPlug *)bonobo_control_get_plug(control);
5700 +    gui.mainwin = GTK_WIDGET(gui.plug);
5701 +    gui_mch_init();
5702 +
5703 +    g_signal_connect (control, "set_frame", G_CALLBACK (set_frame_cb), NULL);
5704 +    g_signal_connect (gui.plug, "embedded", G_CALLBACK (embedded_cb), NULL);
5705 +
5706 +       /* Create the vim-view */
5707 +       //priv->image_view = vim_image_view_new (vim, FALSE);
5708 +       //if (!priv->image_view) {
5709 +               //bonobo_object_unref (BONOBO_OBJECT (control));
5710 +               //return NULL;
5711 +       //}
5712 +
5713 +    pb = bonobo_property_bag_new (editor_get_prop, editor_set_prop, NULL);
5714 +    bonobo_control_set_properties (control, BONOBO_OBJREF (pb), NULL);
5715 +                                                                                
5716 +    def = bonobo_arg_new (BONOBO_ARG_BOOLEAN);
5717 +    BONOBO_ARG_SET_BOOLEAN (def, TRUE);
5718 +                                                                                
5719 +    bonobo_property_bag_add (pb, "EditorNeedsEscape", EDITOR_NEEDS_ESCAPE,
5720 +                 BONOBO_ARG_BOOLEAN, def,
5721 +                 "Whether the editor requires Escape key events",
5722 +                 0);
5723 +                                                                                
5724 +    CORBA_free (def);
5725 +
5726 +    bonobo_object_unref (BONOBO_OBJECT (pb));
5727 +    
5728 +       return control;
5729 +}
5730 +
5731 +VimControl *
5732 +vim_control_new (void)
5733 +{
5734 +       VimControl *control;
5735 +       
5736 +    g_message ("Creating VimControl...");
5737 +
5738 +       control = g_object_new (VIM_CONTROL_TYPE, NULL);
5739 +
5740 +       return vim_control_construct (control);
5741 +}
5742 +
5743 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_control.h vim/src/vim_bonobo_control.h
5744 --- vimcopy/src/vim_bonobo_control.h    Wed Dec 31 18:00:00 1969
5745 +++ vim/src/vim_bonobo_control.h        Sat Jul 26 13:16:48 2003
5746 @@ -0,0 +1,50 @@
5747 +/*
5748 + * vim_bonobo_control.h
5749 + *
5750 + * Author:
5751 + *   Jason Hildebrand (jason@peaceworks.ca)
5752 + *
5753 + */
5754 +
5755 +#ifndef _VIM_CONTROL_H_
5756 +#define _VIM_CONTROL_H_
5757 +
5758 +#include <bonobo/bonobo-control.h>
5759 +#define VIM_OAFIID "OAFIID:Vim_Control"
5760 +#define NORMAL_IO 0
5761 +#define PERSIST_STREAM_IO 1
5762 +#define PERSIST_FILE_IO 2
5763 +
5764 +G_BEGIN_DECLS
5765
5766 +#define VIM_CONTROL_TYPE           (vim_control_get_type ())
5767 +#define VIM_CONTROL(o)             (G_TYPE_CHECK_INSTANCE_CAST ((o), VIM_CONTROL_TYPE, VimControl))
5768 +#define VIM_CONTROL_CLASS(k)       (G_TYPE_CHECK_CLASS_CAST((k), VIM_CONTROL_TYPE, VimControlClass))
5769 +
5770 +#define VIM_IS_CONTROL(o)          (G_TYPE_CHECK_INSTANCE_TYPE ((o), VIM_CONTROL_TYPE))
5771 +#define VIM_IS_CONTROL_CLASS(k)    (G_TYPE_CHECK_CLASS_TYPE ((k), VIM_CONTROL_TYPE))
5772 +#define VIM_CONTROL_GET_CLASS(o)   (G_TYPE_INSTANCE_GET_CLASS ((o), VIM_CONTROL_TYPE, VimControlClass))
5773 +
5774 +typedef struct _VimControl         VimControl;
5775 +typedef struct _VimControlClass    VimControlClass;
5776 +typedef struct _VimControlPrivate  VimControlPrivate;
5777 +
5778 +struct _VimControl {
5779 +       BonoboControl control;
5780 +
5781 +       VimControlPrivate *priv;
5782 +};
5783 +
5784 +struct _VimControlClass {
5785 +       BonoboControlClass parent_class;
5786 +};
5787 +
5788 +GType         vim_control_get_type                    (void);
5789 +VimControl    *vim_control_new                         (void);
5790 +VimControl    *vim_control_construct                   (VimControl    *control);
5791 +
5792 +void set_curbuf_persistent(void);
5793 +
5794 +G_END_DECLS
5795 +
5796 +#endif /* _VIM_CONTROL_H_*/
5797 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_factory.c vim/src/vim_bonobo_factory.c
5798 --- vimcopy/src/vim_bonobo_factory.c    Wed Dec 31 18:00:00 1969
5799 +++ vim/src/vim_bonobo_factory.c        Sun Oct 26 16:51:53 2003
5800 @@ -0,0 +1,73 @@
5801 +/*
5802 + * vim_bonobo_factory.c
5803 + *
5804 + * Author:
5805 + *   Jason Hildebrand (jason@peaceworks.ca)
5806 + *
5807 + */
5808 +
5809 +#include "vim.h"
5810 +#include "version.h"
5811 +#include <bonobo/bonobo-generic-factory.h>
5812 +#include "vim_bonobo_control.h"
5813 +
5814 +static BonoboGenericFactory *factory = NULL;
5815 +static int vim_instantiated = 0;
5816 +
5817 +static BonoboObject *
5818 +vim_bonobo_factory(BonoboGenericFactory *this,
5819 +              const char           *oaf_iid,
5820 +              void                 *data)
5821 +{
5822 +    VimControl     *vim;
5823 +    BonoboObject *retval;
5824 +
5825 +    g_return_val_if_fail (this != NULL, NULL);
5826 +    g_return_val_if_fail (oaf_iid != NULL, NULL);
5827 +
5828 +    if( vim_instantiated ) {
5829 +        /* we cannot instantiate more than one control from this process,
5830 +         * because of all of vim's global variables */
5831 +        return NULL;
5832 +    }
5833 +                                                                                
5834 +    g_message ("Trying to produce a '%s'...", oaf_iid);
5835 +                                                                                
5836 +    if (strcmp (oaf_iid, VIM_OAFIID) == 0) {
5837 +        vim = vim_control_new ();
5838 +        if (vim == NULL)
5839 +            return NULL;
5840 +        retval = BONOBO_OBJECT (vim);
5841 +    } else {
5842 +        g_warning ("Unknown IID `%s' requested", oaf_iid);
5843 +        return NULL;
5844 +    }
5845 +    vim_instantiated = 1;
5846 +                                                                                
5847 +    return retval;
5848 +}
5849 +
5850 +/* wait until this component is instantiated */
5851 +int vim_bonobo_wait_for_instantiation()
5852 +{
5853 +    while( !vim_instantiated) {
5854 +        MAIN_ITERATION_DO(TRUE);
5855 +    }
5856 +}
5857 +
5858 +
5859 +int vim_bonobo_init(int *argc, char *argv[])
5860 +{
5861 +    if (!bonobo_ui_init ("gnome-vim", VIM_VERSION_SHORT, argc, argv))
5862 +        g_error (_("Could not initialize Bonobo"));
5863 +                                                                                
5864 +    factory = bonobo_generic_factory_new (
5865 +        VIM_FACTORY_OAFIID, vim_bonobo_factory, NULL);
5866 +                                                                                
5867 +    if (factory == NULL) {
5868 +        g_error ("Couldn't create factory.\n");
5869 +        return 0;
5870 +    }
5871 +    return 1;
5872 +}
5873 +
5874 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_factory.h vim/src/vim_bonobo_factory.h
5875 --- vimcopy/src/vim_bonobo_factory.h    Wed Dec 31 18:00:00 1969
5876 +++ vim/src/vim_bonobo_factory.h        Sun Oct 26 16:55:12 2003
5877 @@ -0,0 +1,17 @@
5878 +/*
5879 + * vim_bonobo_factory.h
5880 + *
5881 + * Author:
5882 + *   Jason Hildebrand (jason@peaceworks.ca)
5883 + *
5884 + */
5885 +
5886 +#if !defined( _VIM_BONOBO_FACTORY_H)
5887 +#define _VIM_BONOBO_FACTORY_H
5888 +
5889 +#define VIM_FACTORY_OAFIID     "OAFIID:Vim_Control_Factory"
5890 +
5891 +void gui_component_init(int *argc, char *argv []);
5892 +int gui_component_wait_for_instantiation(void);
5893 +
5894 +#endif
5895 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_main.c vim/src/vim_bonobo_main.c
5896 --- vimcopy/src/vim_bonobo_main.c       Wed Dec 31 18:00:00 1969
5897 +++ vim/src/vim_bonobo_main.c   Sun Oct 26 20:04:35 2003
5898 @@ -0,0 +1,98 @@
5899 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
5900 +#include "vim.h"
5901 +
5902 +#include <glib/gmain.h>
5903 +#include <glib-object.h>
5904 +#include <bonobo/Bonobo.h>
5905 +
5906 +static guint              bonobo_main_loop_level = 0;
5907 +static GSList *           bonobo_main_loops = NULL;
5908 +
5909 +static gboolean           in_bonobo_call = FALSE;
5910 +
5911 +
5912 +/**
5913 + * bonobo_main:
5914 + * 
5915 + * Activates the Bonobo POA Manager and enters the main event loop.
5916 + */
5917 +void
5918 +vim_bonobo_main (void)
5919 +{
5920 +       GMainLoop *loop;
5921 +
5922 +    if( in_bonobo_call ) {
5923 +        return;
5924 +    }
5925 +
5926 +       bonobo_activate ();
5927 +
5928 +       bonobo_main_loop_level++;
5929 +  
5930 +       loop = g_main_loop_new (NULL, TRUE);
5931 +       bonobo_main_loops = g_slist_prepend (bonobo_main_loops, loop);
5932 +
5933 +       if (g_main_loop_is_running (bonobo_main_loops->data))
5934 +               g_main_loop_run (loop);
5935 +
5936 +       bonobo_main_loops = g_slist_remove (bonobo_main_loops, loop);
5937 +
5938 +       g_main_loop_unref (loop);
5939 +
5940 +       bonobo_main_loop_level--;
5941 +}
5942 +
5943 +/**
5944 + * bonobo_main_quit:
5945 + * 
5946 + * Quits the main event loop.
5947 + */
5948 +void
5949 +vim_bonobo_main_quit (void)
5950 +{
5951 +       g_return_if_fail (bonobo_main_loops != NULL);
5952 +
5953 +       g_main_loop_quit (bonobo_main_loops->data);
5954 +}
5955 +
5956 +int
5957 +vim_bonobo_main_level(void)
5958 +{
5959 +    return bonobo_main_loop_level;
5960 +}
5961 +
5962 +static long save_p_report;
5963 +static int save_msg_silent;
5964 +static int save_emsg_silent;
5965 +
5966 +void
5967 +vim_bonobo_call_begin(void)
5968 +{
5969 +    in_bonobo_call = TRUE;
5970 +    gui.processing_call = TRUE;
5971 +    save_p_report = p_report;
5972 +    p_report = 100000;
5973 +    save_msg_silent = msg_silent;
5974 +    msg_silent = TRUE;
5975 +    save_emsg_silent = emsg_silent;
5976 +    emsg_silent = TRUE;
5977 +}
5978 +
5979 +void
5980 +vim_bonobo_call_end(void)
5981 +{
5982 +    in_bonobo_call = FALSE;
5983 +    gui.processing_call = FALSE;
5984 +    msg_silent = save_msg_silent;
5985 +    emsg_silent = save_emsg_silent;
5986 +    p_report = save_p_report;
5987 +}
5988 +
5989 +gboolean
5990 +vim_bonobo_main_iteration_do(may_block)
5991 +{
5992 +    if( ! in_bonobo_call ) {
5993 +        g_main_context_iteration(NULL, may_block);
5994 +    }
5995 +}
5996 +
5997 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_bonobo_main.h vim/src/vim_bonobo_main.h
5998 --- vimcopy/src/vim_bonobo_main.h       Wed Dec 31 18:00:00 1969
5999 +++ vim/src/vim_bonobo_main.h   Sat Oct 11 10:22:11 2003
6000 @@ -0,0 +1,16 @@
6001 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
6002 +
6003 +#ifndef __VIM_BONOBO_MAIN_H__
6004 +#define __VIM_BONOBO_MAIN_H__
6005 +
6006 +#include <glib-object.h>
6007 +#include <bonobo/Bonobo.h>
6008 +
6009 +void                       vim_bonobo_main                      (void);
6010 +void                vim_bonobo_main_quit     (void);
6011 +int                 vim_bonobo_level(void);
6012 +gboolean            vim_bonobo_main_iteration_do(int may_block);
6013 +void                vim_bonobo_call_begin(void);
6014 +void                vim_bonobo_call_end(void);
6015 +
6016 +#endif /* __VIM_BONOBO_MAIN_H__ */
6017 diff --new-file -u -r --exclude-from=excludelist vimcopy/src/vim_proxy_factory.c vim/src/vim_proxy_factory.c
6018 --- vimcopy/src/vim_proxy_factory.c     Wed Dec 31 18:00:00 1969
6019 +++ vim/src/vim_proxy_factory.c Sun Oct 26 19:34:07 2003
6020 @@ -0,0 +1,66 @@
6021 +/*
6022 + * vim_proxy_factory.c
6023 + *
6024 + * Author:
6025 + *   Jason Hildebrand (jason@peaceworks.ca)
6026 + *
6027 + */
6028 +
6029 +#include "vim.h"
6030 +#include "version.h"
6031 +#include <libbonobo.h>
6032 +#include <bonobo/bonobo-foreign-object.h>
6033 +#include <bonobo/bonobo-generic-factory.h>
6034 +#include "vim_bonobo_control.h"
6035 +#include "vim_bonobo_factory.h"
6036 +
6037 +#define VIM_PROXY_OAFIID "OAFIID:Vim_Proxy_Factory"
6038 +
6039 +static BonoboGenericFactory *factory = NULL;
6040 +
6041 +static BonoboObject *
6042 +vim_proxy_factory(BonoboGenericFactory *this,
6043 +              const char           *oaf_iid,
6044 +              void                 *data)
6045 +{
6046 +    CORBA_Object realfactory;
6047 +    CORBA_Environment ev;
6048 +    BonoboObject * vim_control = NULL;
6049 +    CORBA_Object corba_control;
6050 +
6051 +    g_return_val_if_fail (this != NULL, NULL);
6052 +    g_return_val_if_fail (oaf_iid != NULL, NULL);
6053 +
6054 +    g_message ("Trying to produce a '%s'...", oaf_iid);
6055 +                                                                                
6056 +    if (strcmp (oaf_iid, VIM_OAFIID) == 0) {
6057 +        CORBA_exception_init(&ev);
6058 +
6059 +        realfactory = bonobo_activation_activate_from_id (VIM_FACTORY_OAFIID,
6060 +                                                  Bonobo_ACTIVATION_FLAG_PRIVATE,
6061 +                                                  NULL,
6062 +                                                  &ev);
6063 +        if (ev._major != CORBA_NO_EXCEPTION ) {
6064 +            CORBA_exception_free (&ev);
6065 +            return NULL;
6066 +        }
6067 +
6068 +        corba_control = Bonobo_GenericFactory_createObject(realfactory, VIM_OAFIID, &ev);
6069 +        if (ev._major != CORBA_NO_EXCEPTION ) {
6070 +            CORBA_exception_free (&ev);
6071 +            return NULL;
6072 +        }
6073 +        CORBA_exception_free (&ev);
6074 +        vim_control = bonobo_foreign_object_new(corba_control);
6075 +    } else {
6076 +        g_warning ("Unknown IID `%s' requested", oaf_iid);
6077 +        return NULL;
6078 +    }
6079 +    return vim_control;
6080 +}
6081 +
6082 +
6083 +BONOBO_ACTIVATION_FACTORY (VIM_PROXY_OAFIID,
6084 +               "Vim Proxy Factory", "1.0",
6085 +               vim_proxy_factory, NULL);
6086 +
This page took 1.359023 seconds and 3 git commands to generate.