]> git.pld-linux.org Git - packages/vim.git/blame - 7.1.091
- updated to 7.1.326
[packages/vim.git] / 7.1.091
CommitLineData
0a7814d6
AG
1To: vim-dev@vim.org
2Subject: patch 7.1.091 (extra)
3Fcc: outbox
4From: Bram Moolenaar <Bram@moolenaar.net>
5Mime-Version: 1.0
6Content-Type: text/plain; charset=ISO-8859-1
7Content-Transfer-Encoding: 8bit
8------------
9
10Patch 7.1.091 (extra)
11Problem: Win32: Can't embed Vim inside another application.
12Solution: Add the --windowid argument. (Nageshwar)
13Files: runtime/doc/gui_w32.txt, runtime/doc/starting.txt,
14 runtime/doc/vi_diff.txt, src/globals.h, src/gui_w32.c, src/main.c
15
16
17*** ../vim-7.1.090/runtime/doc/gui_w32.txt Sat May 12 15:35:53 2007
18--- runtime/doc/gui_w32.txt Tue Aug 14 17:32:27 2007
19***************
20*** 1,4 ****
21! *gui_w32.txt* For Vim version 7.1. Last change: 2007 May 03
22
23
24 VIM REFERENCE MANUAL by Bram Moolenaar
25--- 1,4 ----
26! *gui_w32.txt* For Vim version 7.1. Last change: 2007 Aug 14
27
28
29 VIM REFERENCE MANUAL by Bram Moolenaar
30***************
31*** 52,57 ****
32--- 52,67 ----
33 *gui-w32s*
34 There is a specific version of gvim.exe that runs under the Win32s subsystem
35 of Windows 3.1 or 3.11. See |win32s|.
36+
37+
38+ Using Vim as a plugin *gui-w32-windowid*
39+
40+ When gvim starts up normally, it creates its own top level window. If you
41+ pass Vim the command-line option |--windowid| with a decimal or hexadecimal
42+ value, Vim will create a window that is a child of the window with the given
43+ ID. This enables Vim to act as a plugin in another application. This really
44+ is a programmer's interface, and is of no use without a supporting application
45+ to spawn Vim correctly.
46
47 ==============================================================================
48 2. Vim as default editor *vim-default-editor*
49*** ../vim-7.1.090/runtime/doc/starting.txt Sat May 12 16:56:17 2007
50--- runtime/doc/starting.txt Tue Aug 14 17:34:22 2007
51***************
52*** 1,4 ****
53! *starting.txt* For Vim version 7.1. Last change: 2007 May 12
54
55
56 VIM REFERENCE MANUAL by Bram Moolenaar
57--- 1,4 ----
58! *starting.txt* For Vim version 7.1. Last change: 2007 Aug 14
59
60
61 VIM REFERENCE MANUAL by Bram Moolenaar
62***************
63*** 547,552 ****
64--- 547,557 ----
65 GTK+ GUI Vim only. Make gvim try to use GtkPlug mechanism, so
66 that it runs inside another window. See |gui-gtk-socketid|
67 for details. {not in Vi}
68+
69+ --windowid {id} *--windowid*
70+ Win32 GUI Vim only. Make gvim try to use the window {id} as a
71+ parent, so that it runs inside that window. See
72+ |gui-w32-windowid| for details. {not in Vi}
73
74 --echo-wid *--echo-wid*
75 GTK+ GUI Vim only. Make gvim echo the Window ID on stdout,
76*** ../vim-7.1.090/runtime/doc/vi_diff.txt Sat May 12 14:54:28 2007
77--- runtime/doc/vi_diff.txt Tue Aug 14 17:35:10 2007
78***************
79*** 1,4 ****
80! *vi_diff.txt* For Vim version 7.1. Last change: 2007 May 07
81
82
83 VIM REFERENCE MANUAL by Bram Moolenaar
84--- 1,4 ----
85! *vi_diff.txt* For Vim version 7.1. Last change: 2007 Aug 14
86
87
88 VIM REFERENCE MANUAL by Bram Moolenaar
89***************
90*** 826,831 ****
91--- 826,833 ----
92 --servername {name} Vim: Specify Vim server name
93
94 --socketid {id} Vim: GTK window socket to run Vim in
95+
96+ --windowid {id} Vim: Win32 window ID to run Vim in
97
98 --version Vim: show version message and exit.
99
100*** ../vim-7.1.090/src/globals.h Thu May 10 19:26:02 2007
101--- src/globals.h Wed Aug 29 22:27:45 2007
102***************
103*** 876,882 ****
104 EXTERN int no_mapping INIT(= FALSE); /* currently no mapping allowed */
105 EXTERN int no_zero_mapping INIT(= 0); /* mapping zero not allowed */
106 EXTERN int allow_keys INIT(= FALSE); /* allow key codes when no_mapping
107! * is set */
108 EXTERN int no_u_sync INIT(= 0); /* Don't call u_sync() */
109
110 EXTERN int restart_edit INIT(= 0); /* call edit when next cmd finished */
111--- 876,882 ----
112 EXTERN int no_mapping INIT(= FALSE); /* currently no mapping allowed */
113 EXTERN int no_zero_mapping INIT(= 0); /* mapping zero not allowed */
114 EXTERN int allow_keys INIT(= FALSE); /* allow key codes when no_mapping
115! * is set */
116 EXTERN int no_u_sync INIT(= 0); /* Don't call u_sync() */
117
118 EXTERN int restart_edit INIT(= 0); /* call edit when next cmd finished */
119***************
120*** 1250,1255 ****
121--- 1250,1263 ----
122 #ifdef FEAT_GUI_GTK
123 EXTERN guint32 gtk_socket_id INIT(= 0);
124 EXTERN int echo_wid_arg INIT(= FALSE); /* --echo-wid argument */
125+ #endif
126+
127+ #ifdef FEAT_GUI_W32
128+ /*
129+ * The value of the --windowid argument.
130+ * For embedding gvim inside another application.
131+ */
132+ EXTERN int win_socket_id INIT(= 0);
133 #endif
134
135 #if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL)
136*** ../vim-7.1.090/src/gui_w32.c Tue Aug 14 16:57:04 2007
137--- src/gui_w32.c Tue Aug 14 17:13:41 2007
138***************
139*** 23,28 ****
140--- 23,30 ----
141 * e.g., replace LONG with LONG_PTR, etc.
142 */
143
144+ #include "vim.h"
145+
146 /*
147 * These are new in Windows ME/XP, only defined in recent compilers.
148 */
149***************
150*** 1432,1447 ****
151 }
152 }
153 else
154! /* Open toplevel window. */
155 s_hwnd = CreateWindow(
156! szVimWndClass, "Vim MSWindows GUI",
157! WS_OVERLAPPEDWINDOW,
158! gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
159! gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
160! 100, /* Any value will do */
161! 100, /* Any value will do */
162! NULL, NULL,
163! s_hinst, NULL);
164
165 if (s_hwnd == NULL)
166 return FAIL;
167--- 1434,1462 ----
168 }
169 }
170 else
171! {
172! /* If the provided windowid is not valid reset it to zero, so that it
173! * is ignored and we open our own window. */
174! if (IsWindow((HWND)win_socket_id) <= 0)
175! win_socket_id = 0;
176!
177! /* Create a window. If win_socket_id is not zero without border and
178! * titlebar, it will be reparented below. */
179 s_hwnd = CreateWindow(
180! szVimWndClass, "Vim MSWindows GUI",
181! win_socket_id == 0 ? WS_OVERLAPPEDWINDOW : WS_POPUP,
182! gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x,
183! gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y,
184! 100, /* Any value will do */
185! 100, /* Any value will do */
186! NULL, NULL,
187! s_hinst, NULL);
188! if (s_hwnd != NULL && win_socket_id != 0)
189! {
190! SetParent(s_hwnd, (HWND)win_socket_id);
191! ShowWindow(s_hwnd, SW_SHOWMAXIMIZED);
192! }
193! }
194
195 if (s_hwnd == NULL)
196 return FAIL;
197*** ../vim-7.1.090/src/main.c Fri Aug 10 21:32:41 2007
198--- src/main.c Tue Aug 14 17:22:52 2007
199***************
200*** 275,280 ****
201--- 275,281 ----
202 * -display or --display
203 * --server...
204 * --socketid
205+ * --windowid
206 */
207 early_arg_scan(&params);
208
209***************
210*** 1489,1495 ****
211 * Get the name of the display, before gui_prepare() removes it from
212 * argv[]. Used for the xterm-clipboard display.
213 *
214! * Also find the --server... arguments and --socketid
215 */
216 /*ARGSUSED*/
217 static void
218--- 1490,1496 ----
219 * Get the name of the display, before gui_prepare() removes it from
220 * argv[]. Used for the xterm-clipboard display.
221 *
222! * Also find the --server... arguments and --socketid and --windowid
223 */
224 /*ARGSUSED*/
225 static void
226***************
227*** 1536,1559 ****
228 # endif
229 }
230 # endif
231! # ifdef FEAT_GUI_GTK
232 else if (STRICMP(argv[i], "--socketid") == 0)
233 {
234! unsigned int socket_id;
235 int count;
236
237 if (i == argc - 1)
238 mainerr_arg_missing((char_u *)argv[i]);
239 if (STRNICMP(argv[i+1], "0x", 2) == 0)
240! count = sscanf(&(argv[i + 1][2]), "%x", &socket_id);
241 else
242! count = sscanf(argv[i+1], "%u", &socket_id);
243 if (count != 1)
244 mainerr(ME_INVALID_ARG, (char_u *)argv[i]);
245 else
246! gtk_socket_id = socket_id;
247 i++;
248 }
249 else if (STRICMP(argv[i], "--echo-wid") == 0)
250 echo_wid_arg = TRUE;
251 # endif
252--- 1537,1571 ----
253 # endif
254 }
255 # endif
256!
257! # if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)
258! # ifdef FEAT_GUI_W32
259! else if (STRICMP(argv[i], "--windowid") == 0)
260! # else
261 else if (STRICMP(argv[i], "--socketid") == 0)
262+ # endif
263 {
264! unsigned int id;
265 int count;
266
267 if (i == argc - 1)
268 mainerr_arg_missing((char_u *)argv[i]);
269 if (STRNICMP(argv[i+1], "0x", 2) == 0)
270! count = sscanf(&(argv[i + 1][2]), "%x", &id);
271 else
272! count = sscanf(argv[i+1], "%u", &id);
273 if (count != 1)
274 mainerr(ME_INVALID_ARG, (char_u *)argv[i]);
275 else
276! # ifdef FEAT_GUI_W32
277! win_socket_id = id;
278! # else
279! gtk_socket_id = id;
280! # endif
281 i++;
282 }
283+ # endif
284+ # ifdef FEAT_GUI_GTK
285 else if (STRICMP(argv[i], "--echo-wid") == 0)
286 echo_wid_arg = TRUE;
287 # endif
288***************
289*** 1683,1690 ****
290 }
291 }
292 #endif
293! #ifdef FEAT_GUI_GTK
294 else if (STRNICMP(argv[0] + argv_idx, "socketid", 8) == 0)
295 {
296 /* already processed -- snatch the following arg */
297 if (argc > 1)
298--- 1695,1706 ----
299 }
300 }
301 #endif
302! #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_W32)
303! # ifdef FEAT_GUI_GTK
304 else if (STRNICMP(argv[0] + argv_idx, "socketid", 8) == 0)
305+ # else
306+ else if (STRNICMP(argv[0] + argv_idx, "windowid", 8) == 0)
307+ # endif
308 {
309 /* already processed -- snatch the following arg */
310 if (argc > 1)
311***************
312*** 1693,1698 ****
313--- 1709,1716 ----
314 ++argv;
315 }
316 }
317+ #endif
318+ #ifdef FEAT_GUI_GTK
319 else if (STRNICMP(argv[0] + argv_idx, "echo-wid", 8) == 0)
320 {
321 /* already processed, skip */
322***************
323*** 3120,3125 ****
324--- 3138,3144 ----
325 #endif
326 #ifdef FEAT_GUI_W32
327 main_msg(_("-P <parent title>\tOpen Vim inside parent application"));
328+ main_msg(_("--windowid <HWND>\tOpen Vim inside another win32 widget"));
329 #endif
330
331 #ifdef FEAT_GUI_GNOME
332*** ../vim-7.1.090/src/version.c Thu Aug 30 11:46:46 2007
333--- src/version.c Thu Aug 30 12:21:02 2007
334***************
335*** 668,669 ****
336--- 668,671 ----
337 { /* Add new patch number below this line */
338+ /**/
339+ 91,
340 /**/
341
342--
343 We're knights of the Round Table
344 Our shows are formidable
345 But many times
346 We're given rhymes
347 That are quite unsingable
348 We're opera mad in Camelot
349 We sing from the diaphragm a lot.
350 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
351
352 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
353/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
354\\\ download, build and distribute -- http://www.A-A-P.org ///
355 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
This page took 0.090774 seconds and 4 git commands to generate.