Skip to content

Commit 39fe75e

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents ac477ca + 065f41c commit 39fe75e

20 files changed

Lines changed: 416 additions & 43 deletions

Filelist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ SRC_ALL = \
200200
src/libvterm/.gitignore \
201201
src/libvterm/LICENSE \
202202
src/libvterm/Makefile \
203+
src/libvterm/Makefile.msc \
203204
src/libvterm/README \
204205
src/libvterm/tbl2inc_c.pl \
205206
src/libvterm/vterm.pc.in \

src/INSTALLpc.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -706,17 +706,20 @@ Or when using MinGW (as one line):
706706
13. Building with Terminal support
707707
==================================
708708

709-
Vim with Terminal support can be built with MinGW or Cygwin.
710-
Terminal support require winpty which provide following two files.
709+
Vim with Terminal support can be built with either MSVC, or MinGW or Cygwin.
710+
This uses the included libvterm and winpty. No extra header files or
711+
libraries are needed for building.
712+
713+
Running Vim with terminal support requires the following two winpty files:
711714

712715
winpty.dll
713716
winpty-agent.dll
714717

715-
You can download following page:
718+
You can download them from the following page:
716719

717720
https://github.com/rprichard/winpty
718721

719-
It don't need header files or libraries. Just put them on your PATH.
722+
Just put the DLL files somewhere in your PATH.
720723

721724

722725
14. Windows 3.1x

src/Make_mvc.mak

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
# is yes)
3737
# Global IME support: GIME=yes (requires GUI=yes)
3838
#
39+
# Terminal support: TERMINAL=yes (default is no)
40+
#
3941
# Lua interface:
4042
# LUA=[Path to Lua directory]
4143
# DYNAMIC_LUA=yes (to load the Lua DLL dynamically)
@@ -354,7 +356,8 @@ CSCOPE_DEFS = -DFEAT_CSCOPE
354356
!if "$(TERMINAL)" == "yes"
355357
TERMINAL_OBJ = $(OBJDIR)/terminal.obj
356358
TERMINAL_DEFS = -DFEAT_TERMINAL
357-
TERMINAL_SRC = terminal.c
359+
TERMINAL_SRC = terminal.c
360+
VTERM_LIB = libvterm/vterm.lib
358361
!endif
359362

360363
!ifndef NETBEANS
@@ -1130,7 +1133,7 @@ conflags = $(conflags) /map /mapinfo:lines
11301133
LINKARGS1 = $(linkdebug) $(conflags)
11311134
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib \
11321135
$(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
1133-
$(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
1136+
$(TCL_LIB) $(NETBEANS_LIB) $(VTERM_LIB) $(XPM_LIB) $(LINK_PDB)
11341137

11351138
# Report link time code generation progress if used.
11361139
!ifdef NODEBUG
@@ -1544,5 +1547,9 @@ proto.h: \
15441547
.c.i:
15451548
$(CC) $(CFLAGS) /P /C $<
15461549

1550+
libvterm/vterm.lib :
1551+
cd libvterm
1552+
$(MAKE) /NOLOGO -f Makefile.msc
1553+
cd ..
15471554

15481555
# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0:

src/gui_gtk_x11.c

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5606,16 +5606,34 @@ gui_mch_get_color(char_u *name)
56065606
return name != NULL ? gui_get_color_cmn(name) : INVALCOLOR;
56075607
#else
56085608
guicolor_T color;
5609-
GdkColor gcolor;
5610-
int ret;
56115609

56125610
color = (name != NULL) ? gui_get_color_cmn(name) : INVALCOLOR;
56135611
if (color == INVALCOLOR)
56145612
return INVALCOLOR;
56155613

5616-
gcolor.red = (guint16)(((color & 0xff0000) >> 16) / 255.0 * 65535 + 0.5);
5617-
gcolor.green = (guint16)(((color & 0xff00) >> 8) / 255.0 * 65535 + 0.5);
5618-
gcolor.blue = (guint16)((color & 0xff) / 255.0 * 65535 + 0.5);
5614+
return gui_mch_get_rgb_color(
5615+
(color & 0xff0000) >> 16,
5616+
(color & 0xff00) >> 8,
5617+
color & 0xff);
5618+
#endif
5619+
}
5620+
5621+
/*
5622+
* Return the Pixel value (color) for the given RGB values.
5623+
* Return INVALCOLOR for error.
5624+
*/
5625+
guicolor_T
5626+
gui_mch_get_rgb_color(int r, int g, int b)
5627+
{
5628+
#if GTK_CHECK_VERSION(3,0,0)
5629+
return gui_get_rgb_color_cmn(r, g, b);
5630+
#else
5631+
GdkColor gcolor;
5632+
int ret;
5633+
5634+
gcolor.red = (guint16)(r / 255.0 * 65535 + 0.5);
5635+
gcolor.green = (guint16)(g / 255.0 * 65535 + 0.5);
5636+
gcolor.blue = (guint16)(b / 255.0 * 65535 + 0.5);
56195637

56205638
ret = gdk_colormap_alloc_color(gtk_widget_get_colormap(gui.drawarea),
56215639
&gcolor, FALSE, TRUE);

src/gui_mac.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,6 +3736,12 @@ gui_mch_get_color(char_u *name)
37363736
return gui_get_color_cmn(name);
37373737
}
37383738

3739+
guicolor_T
3740+
gui_mch_get_rgb_color(int r, int g, int b)
3741+
{
3742+
return gui_get_rgb_color_cmn(r, g, b);
3743+
}
3744+
37393745
/*
37403746
* Set the current text foreground color.
37413747
*/

src/gui_photon.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,12 @@ gui_mch_get_color(char_u *name)
19861986
return gui_get_color_cmn(name);
19871987
}
19881988

1989+
guicolor_T
1990+
gui_mch_get_rgb_color(int r, int g, int b)
1991+
{
1992+
return gui_get_rgb_color_cmn(r, g, b);
1993+
}
1994+
19891995
void
19901996
gui_mch_set_fg_color(guicolor_T color)
19911997
{

src/gui_w32.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,12 @@ gui_mch_get_color(char_u *name)
15971597
return gui_get_color_cmn(name);
15981598
}
15991599

1600+
guicolor_T
1601+
gui_mch_get_rgb_color(int r, int g, int b)
1602+
{
1603+
return gui_get_rgb_color_cmn(r, g, b);
1604+
}
1605+
16001606
/*
16011607
* Return OK if the key with the termcap name "name" is supported.
16021608
*/

src/gui_x11.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,8 +2272,6 @@ gui_mch_get_color(char_u *name)
22722272
guicolor_T requested;
22732273
XColor available;
22742274
Colormap colormap;
2275-
#define COLORSPECBUFSIZE 8 /* space enough to hold "#RRGGBB" */
2276-
char spec[COLORSPECBUFSIZE];
22772275

22782276
/* can't do this when GUI not running */
22792277
if (!gui.in_use || name == NULL || *name == NUL)
@@ -2283,11 +2281,22 @@ gui_mch_get_color(char_u *name)
22832281
if (requested == INVALCOLOR)
22842282
return INVALCOLOR;
22852283

2286-
vim_snprintf(spec, COLORSPECBUFSIZE, "#%.2x%.2x%.2x",
2284+
return gui_mch_get_rgb_color(
22872285
(requested & 0xff0000) >> 16,
22882286
(requested & 0xff00) >> 8,
22892287
requested & 0xff);
2290-
#undef COLORSPECBUFSIZE
2288+
}
2289+
2290+
/*
2291+
* Return the Pixel value (color) for the given RGB values.
2292+
* Return INVALCOLOR for error.
2293+
*/
2294+
guicolor_T
2295+
gui_mch_get_rgb_color(int r, int g, int b)
2296+
{
2297+
char spec[8]; /* space enough to hold "#RRGGBB" */
2298+
2299+
vim_snprintf(spec, sizeof(spec), "#%.2x%.2x%.2x", r, g, b);
22912300
colormap = DefaultColormap(gui.dpy, DefaultScreen(gui.dpy));
22922301
if (XParseColor(gui.dpy, colormap, (char *)spec, &available) != 0
22932302
&& XAllocColor(gui.dpy, colormap, &available) != 0)

src/libvterm/Makefile.msc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
OBJS = \
2+
src\encoding.c \
3+
src\keyboard.c \
4+
src\mouse.c \
5+
src\parser.c \
6+
src\pen.c \
7+
src\screen.c \
8+
src\state.c \
9+
src\unicode.c \
10+
src\vterm.c
11+
12+
OBJS = \
13+
src\encoding.obj \
14+
src\keyboard.obj \
15+
src\mouse.obj \
16+
src\parser.obj \
17+
src\pen.obj \
18+
src\screen.obj \
19+
src\state.obj \
20+
src\unicode.obj \
21+
src\vterm.obj
22+
23+
all : vterm.lib
24+
25+
26+
.c.obj :
27+
cl /DINLINE= /Iinclude /Fo$@ /c $<
28+
29+
vterm.lib : $(OBJS)
30+
lib /OUT:$@ $(OBJS)

src/proto/gui_gtk_x11.pro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ GuiFont gui_mch_get_font(char_u *name, int report_error);
3636
char_u *gui_mch_get_fontname(GuiFont font, char_u *name);
3737
void gui_mch_free_font(GuiFont font);
3838
guicolor_T gui_mch_get_color(char_u *name);
39+
guicolor_T gui_mch_get_rgb_color(int r, int g, int b);
3940
void gui_mch_set_fg_color(guicolor_T color);
4041
void gui_mch_set_bg_color(guicolor_T color);
4142
void gui_mch_set_sp_color(guicolor_T color);
@@ -53,7 +54,7 @@ void gui_mch_draw_part_cursor(int w, int h, guicolor_T color);
5354
void gui_mch_update(void);
5455
int gui_mch_wait_for_chars(long wtime);
5556
void gui_mch_flush(void);
56-
void gui_mch_clear_block(int row1, int col1, int row2, int col2);
57+
void gui_mch_clear_block(int row1arg, int col1arg, int row2arg, int col2arg);
5758
void gui_mch_clear_all(void);
5859
void gui_mch_delete_lines(int row, int num_lines);
5960
void gui_mch_insert_lines(int row, int num_lines);

0 commit comments

Comments
 (0)