To: vim-dev@vim.org Subject: Patch 6.0.247 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.247 Problem: GTK GUI: Can't use gvim in a kpart widget. Solution: Add the "--echo-wid" argument to let Vim echo the window ID on stdout. (Philippe Fremy) Files: runtime/doc/starting.txt, src/globals.h, src/gui_gtk_x11.c, src/main.c *** ../vim60.246/runtime/doc/starting.txt Mon Feb 18 12:08:34 2002 --- runtime/doc/starting.txt Thu Feb 21 17:01:14 2002 *************** *** 1,4 **** ! *starting.txt* For Vim version 6.0. Last change: 2002 Feb 18 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *starting.txt* For Vim version 6.0. Last change: 2002 Feb 21 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 483,488 **** --- 483,495 ---- GTK+ GUI Vim only. Make gvim try to use GtkPlug mechanism, so that it runs inside another window. See |gui-gtk-socketid| for details. {not in Vi} + + --echo-wid *--echo-wid* + GTK+ GUI Vim only. Make gvim echo the Window ID on stdout, + which can be used to run gvim in a kpart widget. The format + of the output is: + WID: 12345\n + {not in Vi} Example for using a script file to change a name in several files: *** ../vim60.246/src/globals.h Mon Feb 18 12:08:34 2002 --- src/globals.h Thu Feb 21 16:57:02 2002 *************** *** 965,970 **** --- 966,972 ---- #ifdef FEAT_GUI_GTK EXTERN guint32 gtk_socket_id INIT(= 0); + EXTERN int echo_wid_arg INIT(= FALSE); /* --echo-wid argument */ #endif #ifdef FEAT_CLIENTSERVER *** ../vim60.246/src/gui_gtk_x11.c Mon Feb 11 12:01:33 2002 --- src/gui_gtk_x11.c Thu Feb 21 16:53:14 2002 *************** *** 1632,1637 **** --- 1632,1644 ---- XIconSize *size; int number_sizes; + /* When started with "--echo-wid" argument, write window ID on stdout. */ + if (echo_wid_arg) + { + printf("WID: %ld\n", (long)GDK_WINDOW_XWINDOW(gui.mainwin->window)); + fflush(stdout); + } + if (vim_strchr(p_go, GO_ICON) != NULL) { /* *** ../vim60.246/src/main.c Mon Feb 18 12:08:34 2002 --- src/main.c Thu Feb 21 16:59:30 2002 *************** *** 292,297 **** --- 292,299 ---- mainerr(ME_INVALID_ARG, (char_u *)argv[i]); i++; } + else if (STRICMP(argv[i], "--echo-wid") == 0) + echo_wid_arg = TRUE; # endif } #endif *************** *** 563,568 **** --- 565,574 ---- --argc; ++argv; } + } + else if (STRNICMP(argv[0] + argv_idx, "echo-wid", 8) == 0) + { + /* already processed, skip */ } #endif else *** ../vim60.246/src/version.c Thu Feb 21 16:37:34 2002 --- src/version.c Thu Feb 21 17:07:15 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 247, /**/ -- The only way the average employee can speak to an executive is by taking a second job as a golf caddie. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///